dmg_mod prop

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

dmg_mod prop

Post by Poi »

Hio. Again. and again and again, etc...

Ok, so here is my script and my problem..

It seems to get stuck at "You cannot add damage to that" when targeting anything...

This means, it can't find the prop dmg_mod
sooo, I don't know whats wrong because I can go in uo and type .getprop dmg_mod just fine... any ideas?

Code: Select all

use os;
use uo;
use util;

program checks(who, deed)
var maxdmg := 25;
if (!who)
SendSysMessage(who,"Error.");
return;
endif
if(!deed)
SendSysMessage(who,"That deed does not seem to exist.");
return;
endif
SendSysMessage(who,"Please target the weapon.");
var wep := Target( who );
if (!wep)
SendSysMessage(who,"What your selected does not seem to exist.");
return;
endif
var cdmg := GetObjProperty(wep, "dmg_mod");
SendSysMessage(who,cdmg);
//if ((!cdmg))
//SendSysMessage(who,"You cannot add damage to that.");
//return;
//endif
var dmg := RandomInt(7);
if (cdmg > maxdmg)
SetObjProperty(wep, "dmg_mod", maxdmg);
SendSysMessage(who,"Your weapon is already at its limit on damage.");
return;
endif

if (cdmg + dmg > maxdmg)
SetObjProperty(wep, "dmg_mod", maxdmg);
SendSysMessage(who,"Your weapon is now at its limit.");
return;
endif

SetObjProperty(wep, "dmg_mod", cdmg + dmg);
SendSysMessage(who,"Added " + dmg + " damage to your weapon!");


endprogram
Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Post by Luth »

Instead of using G/SetObjProp(weapon, "dmg_mod") access it directly by:
weapon.dmg_mod := 5;
or
var dmg := weapon.dmg_mod;
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

K, thanks
Post Reply