Show
Ignore:
Timestamp:
11/22/08 00:36:22 (17 years ago)
Author:
yumileroy
Message:

Merged commit 269 (5f0e38da128a).

Original author: gvcoman
Date: 2008-11-21 14:34:05-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Level2.cpp

    r272 r279  
    23622362    // Check 
    23632363    // Remember: "show" must also be the name of a column! 
    2364     if( (show != "emote") && (show != "spell") && (show != "text1") && (show != "text2") 
    2365         && (show != "text3") && (show != "text4") && (show != "text5") 
     2364    if( (show != "emote") && (show != "spell") && (show != "textid1") && (show != "textid2") 
     2365        && (show != "textid3") && (show != "textid4") && (show != "textid5") 
    23662366        && (show != "waittime") && (show != "del") && (show != "move") && (show != "add") 
    23672367        && (show != "model1") && (show != "model2") && (show != "orientation")) 
     
    27032703        PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); 
    27042704        SetSentErrorMessage(true); 
     2705        return false; 
     2706    } 
     2707 
     2708    // set in game textids not supported 
     2709    if( show == "textid1" || show == "textid2" || show == "textid3" || 
     2710        show == "textid4" || show == "textid5" ) 
     2711    { 
    27052712        return false; 
    27062713    } 
     
    28432850 
    28442851        QueryResult *result = 
    2845             WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text1, text2, text3, text4, text5, model1, model2 FROM creature_movement WHERE wpguid = %u", 
     2852            WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u", 
    28462853            target->GetGUIDLow() ); 
    28472854        if(!result) 
     
    28552862            PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID()); 
    28562863 
    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 )", 
     2864            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 )", 
    28582865                target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); 
    28592866            if(!result) 
     
    28722879            uint32 emote            = fields[3].GetUInt32(); 
    28732880            uint32 spell            = fields[4].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(); 
     2881            uint32 textid[MAX_WAYPOINT_TEXT]; 
     2882            for(int i = 0;  i < MAX_WAYPOINT_TEXT; ++i) 
     2883                textid[i]           = fields[5+i].GetUInt32(); 
    28792884            uint32 model1           = fields[10].GetUInt32(); 
    28802885            uint32 model2           = fields[11].GetUInt32(); 
     
    28892894            PSendSysMessage(LANG_WAYPOINT_INFO_EMOTE, emote); 
    28902895            PSendSysMessage(LANG_WAYPOINT_INFO_SPELL, spell); 
    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); 
     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]) : "")); 
    28962898 
    28972899        }while( result->NextRow() ); 
     
    32143216 
    32153217    QueryResult *result = WorldDatabase.PQuery( 
    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 ); 
     3218    //          0      1           2           3           4            5       6       7         8      9      10       11       12       13       14       15 
     3219        "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 ); 
    32183220 
    32193221    if (!result) 
     
    32323234 
    32333235        outfile << "INSERT INTO creature_movement "; 
    3234         outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, text1, text2, text3, text4, text5 ) VALUES "; 
     3236        outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5 ) VALUES "; 
    32353237 
    32363238        outfile << "( "; 
     
    32573259        outfile << fields[9].GetUInt32();                   // spell 
    32583260        outfile << ", "; 
    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         } 
     3261        outfile << fields[10].GetUInt32();                  // textid1 
    32703262        outfile << ", "; 
    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         } 
     3263        outfile << fields[11].GetUInt32();                  // textid2 
    32823264        outfile << ", "; 
    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         } 
     3265        outfile << fields[12].GetUInt32();                  // textid3 
    32943266        outfile << ", "; 
    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         } 
     3267        outfile << fields[13].GetUInt32();                  // textid4 
    33063268        outfile << ", "; 
    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         } 
     3269        outfile << fields[14].GetUInt32();                  // textid5 
    33183270        outfile << ");\n "; 
    33193271