|
1. How do I check the vnum of a mobile?
|
|
Sun Sep 25, 2005 [8:38 PM]
|
JgzofTBW
tbwadmin@dune.net
member since: Sep 20, 2005
|
Reply
|
|
I know this is probably incredibly simple, but I'm fairly retarded. I'm trying to make a function act differently in the case of a specific mob, so I need a way to check the vnum.
I'm using a godwars codebase. Right now I have this going
if (IS_NPC && (ch->MOB_INDEX_DATA->vnum > 44999) && (ch->MOB_INDEX_DATA->vnum < 45001))
and its a complete failure. =[
Help!
TYIA
|
|
|
|
|
2. RE: How do I check the vnum of a mobile?
|
|
Mon Oct 24, 2005 [9:46 AM]
|
Avarant87
Email not supplied
member since: Apr 6, 2005
|
In Reply To
Reply
|
|
Well..
if (IS_NPC && (ch->MOB_INDEX_DATA->vnum > 44999) && (ch->MOB_INDEX_DATA->vnum < 45001))
Firstly...if your going to do that...why make it so complicated? I don't know circle, or whatever base ur using, so I don't know the parameters, but I'd assume it'd be something like...
if(IS_NPC(ch) && ch->MOB_INDEX_DATA->vnum == 45000) { ... }
|
|
|
|
|
3. RE: How do I check the vnum of a mobile?
|
|
Mon Oct 24, 2005 [10:23 AM]
|
Drey
Email not supplied
member since: Mar 19, 2000
|
In Reply To
Reply
|
|
If you check the definition for 'ch', which I'm guessing will be a CHAR_DATA, you can eventually find out what the field name is for the MOB_INDEX_DATA structure. It's probably something like 'pIndexData'. Right now you're referencing the type, not the name.
Also, it's probably IS_NPC(ch).
|
|
|
|
|