75 lines
2.4 KiB
Plaintext
75 lines
2.4 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_RSHIN);
|
|
int nNewApp;
|
|
switch (nCurrentApp)
|
|
{
|
|
case 1: nNewApp = 3; break;
|
|
case 3: nNewApp = 4; break;
|
|
case 4: nNewApp = 5; break;
|
|
case 5: nNewApp = 6; break;
|
|
case 6: nNewApp = 7; break;
|
|
case 7: nNewApp = 8; break;
|
|
case 8: nNewApp = 9; break;
|
|
case 9: nNewApp = 10; break;
|
|
case 10: nNewApp = 11; break;
|
|
case 11: nNewApp = 12; break;
|
|
case 12: nNewApp = 13; break;
|
|
case 13: nNewApp = 14; break;
|
|
case 14: nNewApp = 15; break;
|
|
case 15: nNewApp = 16; break;
|
|
case 16: nNewApp = 17; break;
|
|
case 17: nNewApp = 81; break;
|
|
case 81: nNewApp = 82; break;
|
|
case 82: nNewApp = 84; break;
|
|
case 84: nNewApp = 85; break;
|
|
case 85: nNewApp = 90; break;
|
|
case 90: nNewApp = 91; break;
|
|
case 91: nNewApp = 92; break;
|
|
case 92: nNewApp = 93; break;
|
|
case 93: nNewApp = 121; break;
|
|
case 121: nNewApp = 128; break;
|
|
case 128: nNewApp = 151; break;
|
|
case 151: nNewApp = 153; break;
|
|
case 153: nNewApp = 154; break;
|
|
case 154: nNewApp = 155; break;
|
|
case 155: nNewApp = 158; break;
|
|
case 158: nNewApp = 161; break;
|
|
case 161: nNewApp = 186; break;
|
|
case 186: nNewApp = 1; break;
|
|
default: nNewApp = 1; break;
|
|
}
|
|
object oModified1 = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, nNewApp, TRUE);
|
|
object oModified = CopyItemAndModify(oModified1, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, nNewApp, TRUE);
|
|
DestroyObject(oModified1);
|
|
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);
|
|
}
|
|
}
|