Ancordia_PRC8/_module/nss/craft_nextrobe.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

96 lines
3.2 KiB
Plaintext

#include "x2_inc_itemprop"
//This is actually the main function.
void script(object oItem, object oPC)
{
int nCurrentApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE );
int nNewApp;
switch (nCurrentApp)
{
case 0: nNewApp = 3; break;
case 3: nNewApp = 4; break;
case 4: nNewApp = 5; break;
case 5: nNewApp = 6; break;
case 6: nNewApp = 20; break;
//case 13: nNewApp = 20; break;
case 20: nNewApp = 21; break;
case 21: nNewApp = 26; break;
case 26: nNewApp = 27; break;
case 27: nNewApp = 30; break;
case 30: nNewApp = 31; break;
case 31: nNewApp = 32; break;
case 32: nNewApp = 33; break;
case 33: nNewApp = 100; break;
case 100: nNewApp = 101; break;
case 101: nNewApp = 102; break;
case 102: nNewApp = 103; break;
case 103: nNewApp = 104; break;
case 104: nNewApp = 105; break;
case 105: nNewApp = 106; break;
case 106: nNewApp = 107; break;
case 107: nNewApp = 108; break;
case 108: nNewApp = 109; break;
case 109: nNewApp = 110; break;
case 110: nNewApp = 111; break;
case 111: nNewApp = 112; break;
case 112: nNewApp = 113; break;
case 113: nNewApp = 114; break;
case 114: nNewApp = 115; break;
case 115: nNewApp = 128; break;
//case 117: nNewApp = 128; break;
case 128: nNewApp = 129; break;
case 129: nNewApp = 130; break;
case 130: nNewApp = 131; break;
case 131: nNewApp = 132; break;
case 132: nNewApp = 133; break;
case 133: nNewApp = 134; break;
case 134: nNewApp = 135; break;
case 135: nNewApp = 136; break;
case 136: nNewApp = 137; break;
case 137: nNewApp = 138; break;
case 138: nNewApp = 139; break;
case 139: nNewApp = 140; break;
case 140: nNewApp = 141; break;
case 141: nNewApp = 142; break;
case 142: nNewApp = 143; break;
case 143: nNewApp = 144; break;
case 144: nNewApp = 145; break;
case 145: nNewApp = 146; break;
case 146: nNewApp = 147; break;
case 147: nNewApp = 148; break;
case 148: nNewApp = 149; break;
case 149: nNewApp = 171; break;
case 171: nNewApp = 200; break;
case 200: nNewApp = 0; break;
default: nNewApp = 0; break;
}
FloatingTextStringOnCreature(IntToString(nNewApp), oPC);
object oModified = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE, nNewApp, TRUE);
SetItemCursedFlag(oModified, TRUE);
if (oModified != OBJECT_INVALID) DestroyObject(oItem);
ExecuteScript("craft_pcequip", oPC);
return;
}
void main()
{
object oPC = GetPCSpeaker();
int nSlot = 0;
object oItem;
//Check if the item being crafted is equipped
while (nSlot < 18)
{
oItem = GetItemInSlot(nSlot, oPC);
if (GetLocalInt(oItem, "Prototype") == TRUE) {script(oItem, oPC); return; }
nSlot++;
}
//If the item is not equipped, search for it in the inventory
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetLocalInt(oItem, "Prototype") == TRUE) {script(oItem, oPC); return; }
oItem = GetNextItemInInventory(oPC);
}
}