Initial upload

Initial upload.
This commit is contained in:
Jaysyn904
2024-10-09 14:17:22 -04:00
parent a13073fd78
commit e51634d39b
2354 changed files with 658510 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
void main()
{
object oPC = GetPCSpeaker();
object oItem = GetLocalObject(oPC, "MODIFY_ITEM");
object oCopy = GetLocalObject(oPC, "MODIFY_COPY");
SetCustomToken(102, IntToString(GetGold(oPC)));
//Get values of original item and modified copy, then destroy copy
int iCurrentValue = GetGoldPieceValue(oItem);
int iNewValue = GetGoldPieceValue(oCopy);
DestroyObject(oCopy);
//Either amount to pay, refund or no change
int iValue = 0;
int iDiff = 0;
if (iNewValue > iCurrentValue)
{
iValue = iNewValue - iCurrentValue;
iDiff = 1; //iValue is amount to pay
}
else if (iNewValue < iCurrentValue)
{
iValue = iCurrentValue - iNewValue;
iDiff = -1; //iValue is refund
};
SetLocalInt(oPC, "MODIFY_VALUE", iValue);
SetLocalInt(oPC, "MODIFY_DIFF", iDiff);
SetCustomToken(101, IntToString(iValue));
}