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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 07:09 AM.


 

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