71 lines
2.2 KiB
Plaintext
71 lines
2.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_LSHOULDER );
|
|
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 = 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 = 18; break;
|
|
case 18: nNewApp = 19; break;
|
|
case 19: nNewApp = 20; break;
|
|
case 20: nNewApp = 21; break;
|
|
case 21: nNewApp = 22; break;
|
|
case 22: nNewApp = 23; break;
|
|
case 23: nNewApp = 24; break;
|
|
case 24: nNewApp = 25; break;
|
|
case 25: nNewApp = 54; break;
|
|
case 54: nNewApp = 55; break;
|
|
case 55: nNewApp = 56; break;
|
|
case 56: nNewApp = 57; break;
|
|
case 57: nNewApp = 123; break;
|
|
case 123: nNewApp = 185; break;
|
|
case 185: nNewApp = 186; break;
|
|
case 186: nNewApp = 0; break;
|
|
default: nNewApp = 0; break;
|
|
}
|
|
object oModified = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, 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);
|
|
}
|
|
}
|