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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2010, 05:49 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default COMMITTED: #npcedit weapon graphics addition

This simply adds two commands which gives you the ability to modify the primary/secondary weapon held in the NPC's hands. The last time I tried to submit this, it was stickied. I am unsure why. :p

#npcedit wep1 graphic_id (primary hand)
#npcedit wep2 graphic_id (secondary hand)

Command.cpp

AFTER
Code:
c->Message(0, "#npcedit findable - Sets an NPC's findable flag");
ADD
Code:
c->Message(0, "#npcedit wep1 - Sets an NPC's primary weapon to a specified graphic id.");
c->Message(0, "#npcedit wep2 - Sets an NPC's secondary weapon to a specified graphic id.");

AFTER
Code:
   else if ( strcasecmp( sep->arg[1], "findable" ) == 0 )
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u is now %s",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2])==0?"not findable":"findable");
      database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set findable=%i where id=%i",atoi(sep->argplus[2])==0?0:1,c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
      c->LogSQL(query);
      safe_delete_array(query);
   }
ADD
Code:
      else if ( strcasecmp( sep->arg[1], "wep1" ) == 0 )
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u will have item graphic %f set to his primary on repop.",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atof(sep->arg[2]));
      database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set d_meele_texture1=%f where id=%i",atof(sep->argplus[2]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
      c->LogSQL(query);
      safe_delete_array(query);
   }
         else if ( strcasecmp( sep->arg[1], "wep2" ) == 0 )
   {
      char errbuf[MYSQL_ERRMSG_SIZE];
      char *query = 0;
      c->Message(15,"NPCID %u will have item graphic %f set to his secondary on repop.",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atof(sep->arg[2]));
      database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set d_meele_texture2=%f where id=%i",atof(sep->argplus[2]),c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
      c->LogSQL(query);
      safe_delete_array(query);
	  }
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #2  
Old 02-01-2010, 06:23 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Duplicate post as mentioned:
http://www.eqemulator.net/forums/showthread.php?t=28848

Stickied submissions means they are waiting to be reviewed and/or added. I don't know why it hasn't been added yet off-hand, though.

:P
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 02-01-2010, 07:14 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

I'm sorry Trev. I use it all the time but when I updated my source, it removed the command. I didn't know what else to do from there and I didn't want to bother with a PM. :p
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #4  
Old 02-01-2010, 07:35 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You could have replied to the original thread on it :P

I don't see any issues with adding that extra option to the command. I might be able to get it added pretty soon if no one else does.

Personally, I have been wanting to expand the NPC settings a bit to allow us to create full armor set appearances for NPCs. I just need to think of the best way to add it in, as I don't want to make another table for it. I am thinking about just removing the npc_types_tint table and replacing it with an npc_armor_sets table instead. Instead of just setting the tint for each slot in the set, it would also let you set the texture for each slot of the set. So, you could have chain legs, plate boots, and cloth arms, etc on NPCs to mix and match however you like. Then, since they are sets, you can easily apply the set to whichever NPCs you want. This will keep the npc_types table from getting any bigger too. I guess I would just rename the armortint_id in npc_types to something like armorset_id.

Hopefully, I can get that all figured out and coded at some point. The reason I mention it here is because once it is added, #npcedit could then be expanded to make use of the new armor set table. And, I am thinking about adding weapon model in there since they are worn armor slots and there are already tinting fields for them. It probably makes more sense to remove the weapon slot tinting fields and leave those 2 slots up to the npc_types table, though.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 02-01-2010, 10:18 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Sounds like a fantastic idea! Thanks for your help Trevius! I'd love to see this added into npcedit until we can get your alternative added in.
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #6  
Old 02-03-2010, 06:58 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ok, I got this code added to R1213. You had this command set to save weapon models to the DB as floats, when it should have been ints. I made the correction, but that may very well be why no one else had bothered to add this to the source yet :P
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 02-03-2010, 08:59 AM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Thank you very much!
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
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 02:17 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