Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 10-25-2007, 10:40 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

This is the fixed code? Please, can you point out the typo and what was fixed?
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #3  
Old 10-25-2007, 10:47 PM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

I'll look at this in the coming days to validate the code.
__________________
Read my developer notes at my blog.

Quote:
If it's not on IRC, it ain't l33t!
Reply With Quote
  #4  
Old 10-26-2007, 09:08 AM
TheLieka
Developer
 
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
Default

This is the fixed code. The parts in red are where it was changed. I'll post the broken code tonight.

Dax
__________________
Daxum



Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)
Reply With Quote
  #5  
Old 10-26-2007, 11:16 AM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

I have validated your code and understand that your fix here is largely correcting a type, changing "lootable" to "loottable". I will commit your proposed change to the server code base.

Thank you for your contribution.
__________________
Read my developer notes at my blog.

Quote:
If it's not on IRC, it ain't l33t!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:19 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3