View Single Post
  #2  
Old 07-02-2004, 10:06 AM
Draupner
Hill Giant
 
Join Date: Jul 2004
Location: In my basement
Posts: 131
Default

NPC Aggro Radius:
Usage is: #npcaggro [radius]

command.cpp Line 256
Code:
command_add("npcaggro","[radius] - Sets the aggro radius for an NPC",100,command_npcaggro) ||
command.cpp Line 2652
Code:
void command_npcaggro(Client *c, const Seperator *sep) //Draupner: Set aggro radius
{
	if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient())))
		c->Message(0, "Usage: #npcaggro [radius]");
	
	else
	{
		char errbuf[MYSQL_ERRMSG_SIZE];
		char *query = 0;
		c->Message(15,"NPCID %u now has an aggro radius of %i",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->argplus[1]));
		if (database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set aggroradius=%i where id=%i",atoi(sep->argplus[1]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf))
			safe_delete_array(query);
	}


}
And finally command.h
Code:
void command_npcaggro(Client *c, const Seperator *sep); //Draupner: Aggro radius
More to come later
Reply With Quote