Page 1 of 1

How can I disable MagicPenalty and DefaultDex

Posted: Sun Oct 13, 2013 2:31 pm
by Harley
In one of my script, that creates some armor, i have add

Code: Select all

	
EraseObjProperty( item, "MagicPenalty" );
	EraseObjProperty( item, "DefaultDex" );
	SetObjProperty( item, "WaterDecay", decay );
In my equip script, I have added

Code: Select all

    if (GetObjProperty(it, "WaterDecay"))
     EraseObjProperty( it, "MagicPenalty" );
     EraseObjProperty( it, "DefaultDex" );
    endif
But, after server restart, thoose properties appear again.

I use 099 Distro, and don't understand, where can I fix this?

Thanks.

Re: How can I disable MagicPenalty and DefaultDex

Posted: Mon Oct 14, 2013 12:18 am
by Yukiko
At first I thought maybe there was a "start.src" script that was restoring the values but I searched through the scripts and didn't find any reference to those CProps in the "start.src" scripts.

I found a reference to "DefautlDex" in "equipment.inc" located in C:\pol\pkg\items\equipment\include. The operation is a GetObjProperty. There is no SetObjProperty in any of the scripts.

There are two references to the CProp "MagicPenalty". One in ...pkg\items\rituals\ProtectiveAura.src and in ...pkg\systems\spells\include\spells_math.inc. The first script sets the property and the second script just reads it.

I found no reference to the CProp "WaterDecay".

The value DefaultDex exists in 4 itemdesc.cfg files as members of various items. All are itemdesc files are located under ...pkg\items. They are in the followinf packages: armor, gmitems, hides and ingots. MagicPenalty exists in other itemdesc.cfg files and WaterDecay doesn't exist in any itemdesc.cfg file. I didn't find any scripts that read those member's values and use them to set the CProp. So I don't think that is what is setting the CProps on your items.

So here is my question, How are you shutting down your POL server? If you are just closing down POL by clicking the "X" on the console window then POL can't update the world data files because you are terminating the program via the OS and not through POL. The proper way to shut down POL is by typing <ctrl>-C at the console window. This is the only way I can think of that might cause the CProps to seem to reappear on the characters.

Let me know if I was of any help.

Re: How can I disable MagicPenalty and DefaultDex

Posted: Mon Oct 14, 2013 12:12 pm
by Harley
Yukiko, yeah, I searched them too, and didn't find any script, that starting them!

It's mystic)
I shut down: .savenow and Ctrl+C

WaterDecay i wrote at script, that disable DefaultDex & MagicPenalty...
Then, I wrote to the equipment.inc if WaterDecay .... and compiled all scripts.

So, I don't know, if that variant will don't work, maybe I'll write another armours & weapons with out DefaultDex & MagicPenalty, but it's so much extra stuff in objtypes.txt!
I don't want him to score!


I think, that someone script or server restart all properties at items after shut down & restart!!!
How can I disable this?)))

Re: How can I disable MagicPenalty and DefaultDex

Posted: Fri Oct 18, 2013 8:49 am
by Harley
So, anybody helps me?:-))

Re: How can I disable MagicPenalty and DefaultDex

Posted: Fri Oct 18, 2013 10:38 pm
by gundamwing84
Can you post up a snippet of code from the items.txt file showing the water decay property is set?

for example an object from my shard with properties set (taken from data\items.txt):

Code: Select all

Item
{
	Name	a Legacy cloak of Invocation [enchanted by Braden Heat]
	Serial	0x40013bb0
	ObjType	0x1515
	Graphic	0x1515
	X	1041
	Y	2175
	Z	-20
	Revision	6
	Realm	britannia
	CProp	skill16 i30
	CProp	skilladv i16
	DecayAt	125888
	Quality	1
	HP	120
	maxhp_mod	70
}
Edit: also the function that has this in it:

Code: Select all

if (GetObjProperty(it, "WaterDecay"))
     EraseObjProperty( it, "MagicPenalty" );
     EraseObjProperty( it, "DefaultDex" );
    endif
and this:

Code: Select all

EraseObjProperty( item, "MagicPenalty" );
   EraseObjProperty( item, "DefaultDex" );
   SetObjProperty( item, "WaterDecay", decay );

Re: How can I disable MagicPenalty and DefaultDex

Posted: Sun Oct 20, 2013 9:11 pm
by Harley
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???

Re: How can I disable MagicPenalty and DefaultDex

Posted: Thu Jan 30, 2014 9:29 am
by Agata
If your itemdesc entries have it, even if you erase them, they will be back on next restart. And gundam asked for items.txt in your data folder, that is, in your world savedata.

Re: How can I disable MagicPenalty and DefaultDex

Posted: Thu Jan 30, 2014 8:52 pm
by Harley
Agata, thanks for answer! I guessed and made a new itemdesc!