aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp96
1 files changed, 24 insertions, 72 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 643a5b6f819..bb6a4473e0b 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -2361,8 +2361,8 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
std::string show = show_str;
// Check
// Remember: "show" must also be the name of a column!
- if( (show != "emote") && (show != "spell") && (show != "text1") && (show != "text2")
- && (show != "text3") && (show != "text4") && (show != "text5")
+ if( (show != "emote") && (show != "spell") && (show != "textid1") && (show != "textid2")
+ && (show != "textid3") && (show != "textid4") && (show != "textid5")
&& (show != "waittime") && (show != "del") && (show != "move") && (show != "add")
&& (show != "model1") && (show != "model2") && (show != "orientation"))
{
@@ -2705,6 +2705,13 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
return false;
}
+ // set in game textids not supported
+ if( show == "textid1" || show == "textid2" || show == "textid3" ||
+ show == "textid4" || show == "textid5" )
+ {
+ return false;
+ }
+
WaypointMgr.SetNodeText(lowguid, point, show_str, arg_str);
Creature* npcCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT));
@@ -2842,7 +2849,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
//pCreature->GetPositionX();
QueryResult *result =
- WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text1, text2, text3, text4, text5, model1, model2 FROM creature_movement WHERE wpguid = %u",
+ WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u",
target->GetGUIDLow() );
if(!result)
{
@@ -2854,7 +2861,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
const char* maxDIFF = "0.01";
PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID());
- result = WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text1, text2, text3, text4, text5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )",
+ result = WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )",
target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF);
if(!result)
{
@@ -2871,11 +2878,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
int waittime = fields[2].GetUInt32();
uint32 emote = fields[3].GetUInt32();
uint32 spell = fields[4].GetUInt32();
- const char * text1 = fields[5].GetString();
- const char * text2 = fields[6].GetString();
- const char * text3 = fields[7].GetString();
- const char * text4 = fields[8].GetString();
- const char * text5 = fields[9].GetString();
+ uint32 textid[MAX_WAYPOINT_TEXT];
+ for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i)
+ textid[i] = fields[5+i].GetUInt32();
uint32 model1 = fields[10].GetUInt32();
uint32 model2 = fields[11].GetUInt32();
@@ -2888,11 +2893,8 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
PSendSysMessage(LANG_WAYPOINT_INFO_MODEL, 2, model2);
PSendSysMessage(LANG_WAYPOINT_INFO_EMOTE, emote);
PSendSysMessage(LANG_WAYPOINT_INFO_SPELL, spell);
- PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 1, text1);
- PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 2, text2);
- PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 3, text3);
- PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 4, text4);
- PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 5, text5);
+ for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i)
+ PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, i+1, textid[i], (textid[i] ? GetTrinityString(textid[i]) : ""));
}while( result->NextRow() );
// Cleanup memory
@@ -3213,8 +3215,8 @@ bool ChatHandler::HandleWpExportCommand(const char *args)
PSendSysMessage("DEBUG: wp export, GUID: %u", lowguid);
QueryResult *result = WorldDatabase.PQuery(
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- "SELECT point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text1, text2, text3, text4, text5, id FROM creature_movement WHERE id = '%u' ORDER BY point", lowguid );
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ "SELECT point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id FROM creature_movement WHERE id = '%u' ORDER BY point", lowguid );
if (!result)
{
@@ -3231,7 +3233,7 @@ bool ChatHandler::HandleWpExportCommand(const char *args)
Field *fields = result->Fetch();
outfile << "INSERT INTO creature_movement ";
- outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text1, text2, text3, text4, text5 ) VALUES ";
+ outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5 ) VALUES ";
outfile << "( ";
outfile << fields[15].GetUInt32(); // id
@@ -3256,65 +3258,15 @@ bool ChatHandler::HandleWpExportCommand(const char *args)
outfile << ", ";
outfile << fields[9].GetUInt32(); // spell
outfile << ", ";
- const char *tmpChar = fields[10].GetString();
- if( !tmpChar )
- {
- outfile << "NULL"; // text1
- }
- else
- {
- outfile << "'";
- outfile << tmpChar; // text1
- outfile << "'";
- }
+ outfile << fields[10].GetUInt32(); // textid1
outfile << ", ";
- tmpChar = fields[11].GetString();
- if( !tmpChar )
- {
- outfile << "NULL"; // text2
- }
- else
- {
- outfile << "'";
- outfile << tmpChar; // text2
- outfile << "'";
- }
+ outfile << fields[11].GetUInt32(); // textid2
outfile << ", ";
- tmpChar = fields[12].GetString();
- if( !tmpChar )
- {
- outfile << "NULL"; // text3
- }
- else
- {
- outfile << "'";
- outfile << tmpChar; // text3
- outfile << "'";
- }
+ outfile << fields[12].GetUInt32(); // textid3
outfile << ", ";
- tmpChar = fields[13].GetString();
- if( !tmpChar )
- {
- outfile << "NULL"; // text4
- }
- else
- {
- outfile << "'";
- outfile << tmpChar; // text4
- outfile << "'";
- }
+ outfile << fields[13].GetUInt32(); // textid4
outfile << ", ";
- tmpChar = fields[14].GetString();
- if( !tmpChar )
- {
- outfile << "NULL"; // text5
- }
- else
- {
- outfile << "'";
- outfile << tmpChar; // text5
- outfile << "'";
- }
+ outfile << fields[14].GetUInt32(); // textid5
outfile << ");\n ";
} while( result->NextRow() );