Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 09-06-2014, 12:33 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Assign Grid code is completely weird to me.. using X and Y to find an NPC when the NPC already has a Spawn2 ID ... (much easier to find an npc this way)


waypoint.cpp - replace the whole function with this...
Code:
void ZoneDatabase::AssignGrid(Client *client, int grid, int spawn2id) {
	std::string query = StringFormat("UPDATE spawn2 SET pathgrid = %d WHERE id = %d", grid, spawn2id);
	auto results = QueryDatabase(query);
	if (!results.Success())
	{
		LogFile->write(EQEMuLog::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str());
		return;
    }
    if (results.RowsAffected() != 1) {
        client->Message(0, "ERROR: found spawn2 id %d but the update query failed", spawn2id);
        return;
    }
    if(client)
        client->LogSQL(query.c_str());

    client->Message(0, "Grid assign: spawn2 id = %d updated", spawn2id);
}
zonedb.h - fix the header...

Code:
void	AssignGrid(Client *client, int grid, int spawn2id);

command.cpp -- replace the whole function..

Code:
void command_gassign(Client *c, const Seperator *sep) {
	if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC() && c->GetTarget()->CastToNPC()->GetSpawnPointID() > 0) {
		int spawn2id =  c->GetTarget()->CastToNPC()->GetSpawnPointID();
		database.AssignGrid(c, atoi(sep->arg[1]), spawn2id);
	}
	else
		c->Message(0,"Usage: #gassign [num] - must have an npc target!");
}
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 12:50 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