REO-EE/_module/nss/wardrobeload1.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

43 lines
1.2 KiB
Plaintext

void main()
{
object oPC = GetPCSpeaker();
object oDatabase = GetItemPossessedBy(oPC, "database");
object oLoad;
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
string sLastChat = GetLocalString(oPC,"TD_QUILLCHAT");
//int iText = (GetStringLength(sLastChat));
//string sText = GetStringRight(sLastChat,iText);
if (!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)))
{
FloatingTextStringOnCreature("No armor/clothes equipped, cannot proceed.", oPC, FALSE);
return;
}
if (sLastChat == "1" || sLastChat == "2" || sLastChat == "3" || sLastChat == "4" || sLastChat == "5" || sLastChat == "6" || sLastChat == "7" || sLastChat == "8" || sLastChat == "9" || sLastChat == "10")
{
oLoad = RetrieveCampaignObject("REO_Wardrobe", "WR_" + GetName(oPC) + "_" + sLastChat + "", GetLocation(oPC), oPC);
if (!GetIsObjectValid(oLoad))
{
FloatingTextStringOnCreature("No armor/clothes saved in this slot.", oPC, FALSE);
return;
}
DestroyObject(oArmor);
DelayCommand(0.5, AssignCommand(oPC, ActionEquipItem(oLoad, INVENTORY_SLOT_CHEST)));
FloatingTextStringOnCreature("Wardrobe " + sLastChat + " loaded.", oPC, FALSE);
DeleteLocalString(oPC,"TD_QUILLCHAT");
return;
}
else
{
FloatingTextStringOnCreature("Invalid number, cannot proceed.", oPC, FALSE);
return;
}
}