View Single Post
  #1  
Old 10-25-2007, 11:16 AM
TheLieka
Developer
 
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
Default #NPCEdit loottable

There's a typo in the command.cpp source that prevents #npcedit loottable (loottable_id) from working.

Fix:
.\zone\command.cpp
Code:
void command_npcedit(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || !c->GetTarget()->IsNPC())
		{
			c->Message(0, "Error: Must have NPC targeted");
			return;
		}
...

      c->Message(0, "#npcedit Hpregen - Sets an NPCs hitpoint regen rate per tick");
      c->Message(0, "#npcedit Manaregen - Sets an NPCs mana regen rate per tick");
      c->Message(0, "#npcedit Loottable - Sets the lootable ID for an NPC "); //Lieka Edit:  Correct typo "Loottable" rather than "Lootable"
      c->Message(0, "#npcedit Merchantid - Sets the merchant ID for an NPC");

...
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u now regens %i mana per tick",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2]));
      database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set mana_regen_rate=%i where id=%i",atoi(sep->argplus[2]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
      c->LogSQL(query);
      safe_delete_array(query);
   }
//Start Lieka Edit:  Fix Loottable Typo
   else if ( strcasecmp( sep->arg[1], "loottable" ) == 0 )
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u is now on loottable_id %i",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2]));
      database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set loottable_id=%i where id=%i",atoi(sep->argplus[2]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
      c->LogSQL(query);
      safe_delete_array(query);//End Lieka Edit
   }
   else if ( strcasecmp( sep->arg[1], "merchantid" ) == 0 )
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u now is merchant_id %i",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2]));

....
__________________
Daxum



Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)
Reply With Quote