Changeset 272 for trunk/src/game/Level2.cpp
- Timestamp:
- 11/22/08 00:35:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Level2.cpp
r263 r272 2362 2362 // Check 2363 2363 // Remember: "show" must also be the name of a column! 2364 if( (show != "emote") && (show != "spell") && (show != "text id1") && (show != "textid2")2365 && (show != "text id3") && (show != "textid4") && (show != "textid5")2364 if( (show != "emote") && (show != "spell") && (show != "text1") && (show != "text2") 2365 && (show != "text3") && (show != "text4") && (show != "text5") 2366 2366 && (show != "waittime") && (show != "del") && (show != "move") && (show != "add") 2367 2367 && (show != "model1") && (show != "model2") && (show != "orientation")) … … 2703 2703 PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); 2704 2704 SetSentErrorMessage(true); 2705 return false;2706 }2707 2708 // set in game textids not supported2709 if( show == "textid1" || show == "textid2" || show == "textid3" ||2710 show == "textid4" || show == "textid5" )2711 {2712 2705 return false; 2713 2706 } … … 2850 2843 2851 2844 QueryResult *result = 2852 WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text id1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u",2845 WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text1, text2, text3, text4, text5, model1, model2 FROM creature_movement WHERE wpguid = %u", 2853 2846 target->GetGUIDLow() ); 2854 2847 if(!result) … … 2862 2855 PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID()); 2863 2856 2864 result = WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text id1, 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 )",2857 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 )", 2865 2858 target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); 2866 2859 if(!result) … … 2879 2872 uint32 emote = fields[3].GetUInt32(); 2880 2873 uint32 spell = fields[4].GetUInt32(); 2881 uint32 textid[MAX_WAYPOINT_TEXT]; 2882 for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) 2883 textid[i] = fields[5+i].GetUInt32(); 2874 const char * text1 = fields[5].GetString(); 2875 const char * text2 = fields[6].GetString(); 2876 const char * text3 = fields[7].GetString(); 2877 const char * text4 = fields[8].GetString(); 2878 const char * text5 = fields[9].GetString(); 2884 2879 uint32 model1 = fields[10].GetUInt32(); 2885 2880 uint32 model2 = fields[11].GetUInt32(); … … 2894 2889 PSendSysMessage(LANG_WAYPOINT_INFO_EMOTE, emote); 2895 2890 PSendSysMessage(LANG_WAYPOINT_INFO_SPELL, spell); 2896 for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) 2897 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, i+1, textid[i], (textid[i] ? GetTrinityString(textid[i]) : "")); 2891 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 1, text1); 2892 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 2, text2); 2893 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 3, text3); 2894 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 4, text4); 2895 PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, 5, text5); 2898 2896 2899 2897 }while( result->NextRow() ); … … 3216 3214 3217 3215 QueryResult *result = WorldDatabase.PQuery( 3218 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14153219 "SELECT point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text id1, textid2, textid3, textid4, textid5, id FROM creature_movement WHERE id = '%u' ORDER BY point", lowguid );3216 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3217 "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 ); 3220 3218 3221 3219 if (!result) … … 3234 3232 3235 3233 outfile << "INSERT INTO creature_movement "; 3236 outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text id1, textid2, textid3, textid4, textid5 ) VALUES ";3234 outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text1, text2, text3, text4, text5 ) VALUES "; 3237 3235 3238 3236 outfile << "( "; … … 3259 3257 outfile << fields[9].GetUInt32(); // spell 3260 3258 outfile << ", "; 3261 outfile << fields[10].GetUInt32(); // textid1 3259 const char *tmpChar = fields[10].GetString(); 3260 if( !tmpChar ) 3261 { 3262 outfile << "NULL"; // text1 3263 } 3264 else 3265 { 3266 outfile << "'"; 3267 outfile << tmpChar; // text1 3268 outfile << "'"; 3269 } 3262 3270 outfile << ", "; 3263 outfile << fields[11].GetUInt32(); // textid2 3271 tmpChar = fields[11].GetString(); 3272 if( !tmpChar ) 3273 { 3274 outfile << "NULL"; // text2 3275 } 3276 else 3277 { 3278 outfile << "'"; 3279 outfile << tmpChar; // text2 3280 outfile << "'"; 3281 } 3264 3282 outfile << ", "; 3265 outfile << fields[12].GetUInt32(); // textid3 3283 tmpChar = fields[12].GetString(); 3284 if( !tmpChar ) 3285 { 3286 outfile << "NULL"; // text3 3287 } 3288 else 3289 { 3290 outfile << "'"; 3291 outfile << tmpChar; // text3 3292 outfile << "'"; 3293 } 3266 3294 outfile << ", "; 3267 outfile << fields[13].GetUInt32(); // textid4 3295 tmpChar = fields[13].GetString(); 3296 if( !tmpChar ) 3297 { 3298 outfile << "NULL"; // text4 3299 } 3300 else 3301 { 3302 outfile << "'"; 3303 outfile << tmpChar; // text4 3304 outfile << "'"; 3305 } 3268 3306 outfile << ", "; 3269 outfile << fields[14].GetUInt32(); // textid5 3307 tmpChar = fields[14].GetString(); 3308 if( !tmpChar ) 3309 { 3310 outfile << "NULL"; // text5 3311 } 3312 else 3313 { 3314 outfile << "'"; 3315 outfile << tmpChar; // text5 3316 outfile << "'"; 3317 } 3270 3318 outfile << ");\n "; 3271 3319