It is currently Wed Oct 15, 2008 3:16 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: dmg_mod prop
PostPosted: Thu Jul 10, 2008 8:21 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
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:
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 10, 2008 9:17 pm 
Offline
POL Developer

Joined: Mon Jan 30, 2006 8:10 am
Posts: 112
Instead of using G/SetObjProp(weapon, "dmg_mod") access it directly by:
weapon.dmg_mod := 5;
or
var dmg := weapon.dmg_mod;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 8:50 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
K, thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl