#include "sd_forge_util" void main() { object oPC = GetLastSpeaker(); int iChoice = GetLocalInt(oPC, "ForgeItemChoice"); string sTAG_Chest1 = GetLocalArrayString(oPC, "ForgeItem", iChoice + 1000); string sTAG_Chest2 = "FI" + GetStringRight(sTAG_Chest1, GetStringLength(sTAG_Chest1)-2); int iHasAllItems = CheckExchangeItems(oPC, 0); if (iHasAllItems == 1) { if (Get_HasEnoughXP(oPC, sTAG_Chest1) && Get_HasEnoughGP(oPC, sTAG_Chest2)) { //perform exchange if (!GetIsDM(oPC)) { RemoveXP(oPC, sTAG_Chest1); RemoveGP(oPC, sTAG_Chest2); } CheckExchangeItems(oPC, 1); DelayCommand(2.0f, SendMessageToPC (oPC, "It would seen to have been a successful transaction. May your item help you in troublesome times")); } else SendMessageToPC (oPC, "Didn't you hear me .. I said 'YOU DONT HAVE ENOUGH XP OR GP FOR THIS ITEM' .. now get that through that thick skull of yours"); } if (iHasAllItems == 0) { SendMessageToPC (oPC, "It doesn't seem like you have all the items. Come back when you do"); } CleanUpVariables(); }