View Single Post
  #7  
Old 07-02-2004, 02:27 PM
Draupner
Hill Giant
 
Join Date: Jul 2004
Location: In my basement
Posts: 131
Default

Setting Npc AC:
Usage: #npcAC

command.cpp Line 259
Code:
		command_add("npcac","[amount] - Sets NPC ac",100,command_npcac) || //Draupner: Set NPC AC
command.cpp Line 2699
Code:
void command_npcac(Client *c, const Seperator *sep) //Draupner: Set npc ac
{
	if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient())))
		c->Message(0, "Usage: #npcac [amount]");
	
	else
	{
		char errbuf[MYSQL_ERRMSG_SIZE];
		char *query = 0;
		c->Message(15,"NPCID %u now has %i AC",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->argplus[1]));
		if (database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set ac=%i where id=%i",atoi(sep->argplus[1]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf))
			safe_delete_array(query);
	}


}
command.h 113
Code:
void command_npcac(Client *c, const Seperator *sep); //Draupner: Npc AC
Reply With Quote