Set NPC Run Speed
Usage: #npcrun
command.cpp Line 258
Code:
command_add("npcrun","[run] [help] - Sets Run/Walk speed for an NPC",100,command_npcrun) || //Draupner: Set npc run speed
command.cpp Line 2653
Code:
void command_npcrun(Client *c, const Seperator *sep) //Draupner: Set npc speed
{
if ( strcasecmp( sep->arg[1], "help" ) == 0 )
{
c->Message(0, "Walk/Run Speed Chart: ");
c->Message(4, " (.7) Normal Walk Speed");
c->Message(4, " (1.05) 9k Mount");
c->Message(4, " (1.25) Normal Run Speed");
c->Message(4, " (1.375) Run 1");
c->Message(4, " (1.50) Run 2");
c->Message(4, " (1.625) Run 3");
c->Message(4, " (1.9375) Spirit of Wolf");
c->Message(4, " (2.675) 100k Mount");
c->Message(4, " (3.2) Max Bard Speed");
}
else if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient())))
{
c->Message(0, "Usage: #npcrun [run] [help]");
}
else
{
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
c->Message(15,"NPCID %u now runs at %i",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->argplus[1]));
if (database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set runspeed=%i where id=%i",atoi(sep->argplus[1]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf))
safe_delete_array(query);
}
}
command.h Line 112
Code:
void command_npcrun(Client *c, const Seperator *sep); //Draupner: Npc Run Speed
AC will be done before I go to bed will try working on rest tomarrow.