Example, item from itemdecs
Code: Select all
Armor 0x1414
{
Name PlatemailGloves
Desc Platemail Gloves
AR 40
Coverage Hands
VendorSellsFor 145
VendorBuysFor 72
MaxHP 70
strrequired 40
equipscript :default-ControlScript-Equip:control/default-equip
unequipscript :default-ControlScript-Equip:control/default-unequip
DestroyScript :default-ControlScript-ItemDestroy:control/default-destroy
CProp DefaultDex i-5
CProp MagicPenalty i5
}
My npc creates it:
Code: Select all
var decay := (ReadGameClock() + (86400*90) ); // 86400 = 1 Giorno # 90 = N Giorni
...
item :=CreateItemInContainer( who.backpack, 0x1414, 1); //Water Plate Gloves 0x1414
item.color:=1167;
item.name := spec + " Water Plate Gloves";
item.desc := item.name;
item.ar_mod := 40;
item.decayat := decay;
EraseObjProperty( item, "MagicPenalty" );
EraseObjProperty( item, "DefaultDex" );
SetObjProperty( item, "WaterDecay", decay );
PlaySoundEffect( me, 0x0014); sleep(1);
I thought, and added this code to
equipscript :default-ControlScript-Equip:control/default-equip
unequipscript :default-ControlScript-Equip:control/default-unequip
Code: Select all
if (GetObjProperty(it, "WaterDecay"))
EraseObjProperty( it, "MagicPenalty" );
EraseObjProperty( it, "DefaultDex" );
endif
If item have thoose properties, we erase it!
But!!!))
Problem of that all is:
When i shut down server, all Properties (MagicPenalty & Default Dex) resumes at all items, that my npc erase it!!!
How can I save EraseObjProperty after my shut down or restart server???