Random Item PLUGIN..
Im looking for a plugin that will drop a random item on a corpse in event_death.
summonitem is not good enuff, I want it on the corpse. I have all the item numbers from items.sql but I am unable to find a function that will place them on a corpse. there is some old code that I enabled in 6.0 source for poolLoot items but it only drops coins. if anyone has one please share. |
command
Quote:
# After hailing the NPC he gains 1 of item ID 5420 to his inventory. sub EVENT_SAY { if($text=~/hail/i) { quest::addloot(5420,1); } } |
I'm guessing you would need to code a bit...If that's not implemented in perl, you will need to add a new perl function that calls CastToNPC()->AddItem(itemid, quantity) I think. It should not be that hard. Good luck..if still having problems just say.
|
with perl XS you can call $npc->AddItem(id, charges) from perl.
|
...
Quote:
I dont think I have functions tho just yet. sub EVENT_DEATH { quest::say("I'll get you back $name!"); my @items = (all the item numbers go here 1,22,33,433,40.); quest::AddItem("$items[int(rand($#items+1))]"); <-- this is wrong need the item on the npc's corpse. quest::shout("I've just died!"); } |
..
after spending several hours trying to figgure it out .
I gave up on it and just added every single item to one loot table and gave it a chance of .1 to drop. seems to work good but it's a memory hog. |
Put the additem call in EVENT_SPAWN instead of EVENT_DEATH, the mob will spawn with a random item which will be on it's corpse when it dies.
|
hmm
Quote:
guess I overthought that one a bit. |
All times are GMT -4. The time now is 10:28 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.