Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 04-18-2008, 09:48 AM   #1 (permalink)
Lurker
 
Join Date: Mar 2008
Posts: 5
Question Weapon used to kill a monster.

Anyone know how to get the id of the weapon, that the player used, to kill a monster from within the monsters OnKilledBy method??
IceColdFish is offline   Reply With Quote
Old 04-18-2008, 11:41 AM   #2 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,028
Send a message via Yahoo to Lord_Greywolf
Default

i do not think the weapon used at the time he was killed is stored

but you can get the current weapon he is holding
just do a findon layer check for 1handed and 2 hand layers and if base weapon - then you have it

BUT if what i am thinking you really want is this:
if the critter was killed using a certain weapon
then either extra gold, items, etc etc would be in corpse
or something happens to weapon or owner

then you need to do the check in the onafterdeath (or was it ondeath) part of the critters script
(or put that overide in)
onbeforedeath might work also
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 04-19-2008, 08:03 AM   #3 (permalink)
Lurker
 
Join Date: Mar 2008
Posts: 5
Default

Yeah, I was thinking of doing it in the OnDeath method - but i found that the OnKilledBy method gives the mobile that killed, which i obviouslly need to change the item props.

Can you think of a way to get the 'killers' id from the OnDeath routine? Is there a particular reason you recommend using that method rather than the OnKilledBy.

Thanks btw, as what you suggested does work using what I have now.

Last edited by IceColdFish; 04-19-2008 at 08:11 AM.
IceColdFish is offline   Reply With Quote
Old 04-19-2008, 03:15 PM   #4 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,028
Send a message via Yahoo to Lord_Greywolf
Default

onkilledby works also - just did not think of that one
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Reply

Bookmarks

Tags
monster, onkilled, weapon


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5