generated from Jaysyn/ModuleTemplate
Initial upload
Initial upload.
This commit is contained in:
19
_module/nss/vtw_chargecost.nss
Normal file
19
_module/nss/vtw_chargecost.nss
Normal file
@@ -0,0 +1,19 @@
|
||||
int StartingConditional()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oItem = GetLocalObject(oPC, "MODIFY_ITEM");
|
||||
|
||||
int iCurrentValue = GetGoldPieceValue(oItem);
|
||||
int iCurrentCharges = GetItemCharges(oItem);
|
||||
int iCost;
|
||||
if (iCurrentCharges < 1) iCost = 0;
|
||||
else iCost = ((iCurrentValue * 50)/iCurrentCharges) - iCurrentValue;
|
||||
int iChargesToAdd = 50 - iCurrentCharges;
|
||||
|
||||
SetLocalInt(oPC, "iModifyCost", iCost);
|
||||
|
||||
SetCustomToken(101, IntToString(iCost));
|
||||
SetCustomToken(103, IntToString(iChargesToAdd));
|
||||
|
||||
return TRUE;
|
||||
}
|
Reference in New Issue
Block a user