Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2003, 01:42 PM
Wolfman
Fire Beetle
 
Join Date: Mar 2003
Posts: 23
Default #spawnfix command

Here's a quick command I put together to fix spawngroups' coordinates and headings on the fly. Just target a mob and it automatically updates coords and heading, to the character you're currently using coords and headings, in the db. Use #repop for effects to instantly show up. Here's the diff file for it.


Quote:
--- client.cpp 2003-06-15 21:25:24.000000000 -0400
+++ client.cpp 2003-06-15 21:08:29.000000000 -0400
@@ -4104,6 +4104,38 @@
else if (strcasecmp(sep->arg[0], "#npcspawn") == 0) {
NPCSpawn(sep);
}
+ else if (strcasecmp(sep->arg[0], "#spawnfix") == 0) {
+ if (target==0) {
+ Message(0, "Error: #spawnfix: No Target.");
+ }
+ else {
+ int32 tmp = 0;
+ char errbuf[MYSQL_ERRMSG_SIZE];
+ char *query = 0;
+ MYSQL_RES *result;
+ MYSQL_ROW row;
+
+ if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT id from spawn2 where zone='%s' AND x='%f' AND y='%f' AND heading='%f'", zone->GetShortName(), target->GetX(), target->GetY(), target->GetHeading()), errbuf, &result)) {
+ row = mysql_fetch_row(result);
+
+ if (row[0])
+ tmp = atoi(row[0]);
+
+ query = 0;
+ if(database.RunQuery(query, MakeAnyLenString(&query, "UPDATE spawn2 SET x='%f', y='%f', z='%f', heading='%f' WHERE id='%i'",this->GetX(), this->GetY(), this->GetZ(), this->GetHeading(),tmp), errbuf, 0))
+ Message(0, "Updating coordinates successful!");
+
+ delete[] query;
+ mysql_free_result(result);
+
+ }
+ else {
+ mysql_free_result(result);
+ Message(0, "Upating coordinates failed!");
+ }
+ }
+ }
+
else
return false;
return true;
@@ -4523,6 +4555,7 @@
Message(0, " #zsave [file name] - Save the current zone header to ./cfg/<filename>.cfg");
Message(0, " #dbspawn2 [spawngroup] [respawn] [variance]");
Message(0, " #npcspawn [create|add|update|remove|delete]");
+ Message(0, " #spawnfix - Fixes coordinates and heading for spawn groups");
Message(0, " #fixmob [nextrace|prevrace|gender|nexttexture|prevtexture|n exthelm|prevhelm]");
}
if ((strcasecmp(sep->arg[1], "debug") == 0 || strcasecmp(sep->arg[1], "all") == 0) && admin >= 201)

I've done some minor testing and didn't run into any troubles using it.
Reply With Quote
  #2  
Old 06-15-2003, 02:23 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Thats really handy! I'm throwing this into CVS now.. I'm sure the database developers will really appreciate this one.


Just tested it out... Thats going to make modifying spawn placement so much nicer.. Once all the mobs are dumped into the zone, it'll be a cinch to place them using this.

Great update Wolf, thanks!
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #3  
Old 06-15-2003, 11:22 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Very nice, look forward to playing with this command.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #4  
Old 06-16-2003, 11:42 AM
used_pawn
Sarnak
 
Join Date: Apr 2003
Posts: 53
Default

yay!
i kludge something similar into my own code, but i like yours better, hehe
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:21 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3