67 lines
2.7 KiB
Plaintext
67 lines
2.7 KiB
Plaintext
void CheckItem(object PC, object item)
|
|
{
|
|
itemproperty prop;
|
|
int stype;
|
|
// SendMessageToPC(PC, GetName(item));
|
|
if (GetItemHasItemProperty(item, ITEM_PROPERTY_ONHITCASTSPELL) == TRUE) {
|
|
prop = GetFirstItemProperty(item);
|
|
while(GetIsItemPropertyValid(prop) == TRUE) {
|
|
if (GetItemPropertyType(prop) == ITEM_PROPERTY_ONHITCASTSPELL) {
|
|
stype = GetItemPropertySubType(prop);
|
|
if (stype == 1) stype=0; //curse
|
|
else if (stype == 3) stype=0; //blind/deaf
|
|
else if (stype == 7) stype=0; //confusion
|
|
else if (stype == 8) stype=0; //contagion
|
|
else if (stype == 10) stype=0; //daze
|
|
else if (stype == 11) stype=0; //d blast fball
|
|
else if (stype == 73) stype=0; //destruction
|
|
else if (stype == 12) stype=0; //dismissal
|
|
else if (stype == 14) stype=0; //doom
|
|
else if (stype == 15) stype=0; //energy drain
|
|
else if (stype == 16) stype=0; //enervation
|
|
else if (stype == 18) stype=0; //fear
|
|
else if (stype == 19) stype=0; //feeblemind
|
|
else if (stype == 22) stype=0; //flame lash
|
|
// else if (stype == 29) stype=0; //hammer of gods
|
|
else if (stype == 30) stype=0; //harm
|
|
else if (stype == 31) stype=0; //hold animal
|
|
else if (stype == 32) stype=0; //hold monster
|
|
else if (stype == 33) stype=0; //hold person
|
|
else if (stype == 38) stype=0; //lesser spell breach
|
|
else if (stype == 47) stype=0; //mind fog
|
|
else if (stype == 76) stype=0; //neg eng burst
|
|
else if (stype == 50) stype=0; //poison
|
|
else if (stype == 54) stype=0; //scare
|
|
else if (stype == 58) stype=0; //sleep
|
|
else if (stype == 59) stype=0; //slow
|
|
else if (stype == 108) stype=0; //flesh to stone
|
|
else if (stype == 132) stype=0; //ruin armour
|
|
else RemoveItemProperty(item, prop);
|
|
}
|
|
prop = GetNextItemProperty(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
void ScanPack(object PC, object item)
|
|
{
|
|
CheckItem(PC, item);
|
|
item = GetNextItemInInventory(PC);
|
|
if (item != OBJECT_INVALID) DelayCommand(1.0, ScanPack(PC, item));
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object PC = OBJECT_SELF;
|
|
object item;
|
|
int s;
|
|
for (s = 0; s < NUM_INVENTORY_SLOTS; s++ ) {
|
|
item = GetItemInSlot(s, PC);
|
|
if (GetIsObjectValid(item) == TRUE) {
|
|
}
|
|
DelayCommand(s*1.0, CheckItem(PC, item));
|
|
}
|
|
item = GetFirstItemInInventory(PC);
|
|
DelayCommand(15.0, ScanPack(PC, item));
|
|
}
|