way to check if mob has an item
Is there a way I can check whether or not a mob has a particular item on it in the .pl file?
When a certain mob dies I want to code up an EVENT_DEATH that checks his drops/possessions and says different things based on what he has. I think hasitem is only to check PC inventory? |
Not sure about this. Quick look at perl_npc.cpp I only see NPC::CountLoot
but that doesn't return item info. I thought I saw a quest somewhere that did something like this but I cant find it. Any copy I had was probably lost on the last HD failure. Wonder if Akk or Nate have something like this they could show you. |
It's a silly quest, but the http://www.runen.co.uk/Everquest/Zon...reAhendle2.htm quest calls for this and I was trying to add the finishing touches.
|
I took a look in perl_npc.cpp, questmgr.cpp, and perl_mob.cpp and couldn't seem to find anything for pulling an item from an NPC's loot. There is NPC::QueryLoot in npc.cpp, but it's only used for #npcstats. It may be possible to write something for Perl that allows you to check for certain items in the NPC's current loot though.
|
Temporary work around if you only had one or two mobs that you wanted to use this on would be to use perl to assign loot. That way you would have direct knowledge in the quest file of what it has.
|
Quote:
|
Here is my quest file if you want it.
You'd want to take the blurred map out of this mob's loottables as I roll and assign in the pl file. This is the mob in erudsxing (a_zombie_sailor). Code:
sub EVENT_SPAWN |
All times are GMT -4. The time now is 11:37 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.