View Single Post
  #6  
Old 03-20-2002, 06:16 AM
ScotchTape
Fire Beetle
 
Join Date: Mar 2002
Posts: 12
Default

Dunno if anyone has done it yet, but this is some simple code that sets up a "IsHateful" property. If you're hateful, then you'll agro. If not, you won't (and it'll return false out of AddHateToNpcs,etc.)

Code:
npc.cpp:80
	//turn off hate by default
	//todo: lookup value from table later

	IsHateful(false);
Code:
npc.h
class NPC : public Mob
{
public:

....

	//********************************************************//
	//Can this npc agro?
	//on_or_off: true, yes the npc uses hate
	//			 false, no the npc does not use hate
	//********************************************************//
	bool	IsHateful() { return _IsHateful;}			
	void	IsHateful(bool on_or_off){_IsHateful=on_or_off;}

private:

	bool _IsHateful;	//Can this NPC agro?
};
Lastly..
Code:
NpcAI.cpp:19
	if (!sender->IsHateful())
		return false;
hth,
-ST
Reply With Quote