View Single Post
  #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