Show
Ignore:
Timestamp:
11/19/08 13:36:49 (17 years ago)
Author:
yumileroy
Message:

[svn] Update trinityscript to SD2 rev 700. Source: scriptdev2. Patch provided by SLG.

Original author: megamage
Date: 2008-10-25 11:40:10-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/ScriptMgr.cpp

    r105 r109  
    2323DatabaseType TScriptDB; 
    2424Config TScriptConfig; 
    25 uint32 Locale; 
    2625 
    2726// String text additional data, used in TextMap 
     
    4443}; 
    4544 
    46 #define TEXT_SOURCE_RANGE   -100000                         //the amount of entries each text source has available 
     45#define TEXT_SOURCE_RANGE   -1000000                        //the amount of entries each text source has available 
    4746 
    4847// Text Maps 
    49 HM_NAMESPACE::hash_map<uint32, std::string> EventAI_Text_Map; 
    5048HM_NAMESPACE::hash_map<int32, StringTextData> TextMap; 
    5149 
    52 // Localized Text structure for storing locales (for EAI and SD2 scripts). 
    53 struct Localized_Text 
    54 { 
    55     std::string locale_1; 
    56     std::string locale_2; 
    57     std::string locale_3; 
    58     std::string locale_4; 
    59     std::string locale_5; 
    60     std::string locale_6; 
    61     std::string locale_7; 
    62     std::string locale_8; 
    63 }; 
     50 
    6451//*** End Global data *** 
    6552 
    6653//*** EventAI data *** 
    67 HM_NAMESPACE::hash_map<uint32, Localized_Text> EventAI_LocalizedTextMap; 
    68  
    6954//Event AI structure. Used exclusivly by mob_event_ai.cpp (60 bytes each) 
    7055std::list<EventAI_Event> EventAI_Event_List; 
     
    605590    char const* dbstring = NULL; 
    606591 
    607     if( !TScriptConfig.GetString("WorldDatabaseInfo", &dbstring) ) 
     592    if (!TScriptConfig.GetString("WorldDatabaseInfo", &dbstring) ) 
    608593    { 
    609594        error_log("TSCR: Missing world database info from configuration file. Load database aborted."); 
     
    612597 
    613598    //Initialize connection to DB 
    614     if( dbstring && TScriptDB.Initialize(dbstring) ) 
     599    if (dbstring && TScriptDB.Initialize(dbstring) ) 
    615600        outstring_log("TSCR: TrinityScript database: %s",dbstring); 
    616601    else 
     
    642627    TextMap.clear(); 
    643628 
    644     //TODO: Add load from eventai_texts here 
    645  
    646     // Load Script Text  
    647     outstring_log("TSCR: Loading Script Texts..."); 
    648     LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,(TEXT_SOURCE_RANGE*2)+1); 
    649  
    650     // Gather Additional data from Script Texts 
    651     result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM script_texts"); 
    652  
    653     outstring_log("TSCR: Loading Script Texts additional data..."); 
     629    // Load EventAI Text  
     630    outstring_log("TSCR: Loading EventAI Texts..."); 
     631    LoadTrinityStrings(TScriptDB,"eventai_texts",-1,1+(TEXT_SOURCE_RANGE)); 
     632 
     633    // Gather Additional data from EventAI Texts 
     634    result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM eventai_texts"); 
     635 
     636    outstring_log("TSCR: Loading EventAI Texts additional data..."); 
    654637    if (result) 
    655638    { 
     
    670653            if (i >= 0) 
    671654            { 
     655                error_db_log("TSCR: Entry %i in table `eventai_texts` is not a negative value.",i); 
     656                continue; 
     657            } 
     658 
     659            if (i <= TEXT_SOURCE_RANGE) 
     660            { 
     661                error_db_log("TSCR: Entry %i in table `eventai_texts` is out of accepted entry range for table.",i); 
     662                continue; 
     663            } 
     664 
     665            if (temp.SoundId) 
     666            { 
     667                if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId)) 
     668                    error_db_log("TSCR: Entry %i in table `eventai_texts` has soundId %u but sound does not exist.",i,temp.SoundId); 
     669            } 
     670 
     671            if (!GetLanguageDescByID(temp.Language)) 
     672                error_db_log("TSCR: Entry %i in table `eventai_texts` using Language %u but Language does not exist.",i,temp.Language); 
     673 
     674            if (temp.Type > CHAT_TYPE_BOSS_WHISPER) 
     675                error_db_log("TSCR: Entry %i in table `eventai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type); 
     676 
     677            TextMap[i] = temp; 
     678            ++count; 
     679        } while (result->NextRow()); 
     680 
     681        delete result; 
     682 
     683        outstring_log(""); 
     684        outstring_log(">> TSCR: Loaded %u additional EventAI Texts data.", count); 
     685    }else 
     686    { 
     687        barGoLink bar(1); 
     688        bar.step(); 
     689        outstring_log(""); 
     690        outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `eventai_texts` is empty."); 
     691    } 
     692 
     693    // Load Script Text  
     694    outstring_log("TSCR: Loading Script Texts..."); 
     695    LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); 
     696 
     697    // Gather Additional data from Script Texts 
     698    result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM script_texts"); 
     699 
     700    outstring_log("TSCR: Loading Script Texts additional data..."); 
     701    if (result) 
     702    { 
     703        barGoLink bar(result->GetRowCount()); 
     704        uint32 count = 0; 
     705 
     706        do 
     707        { 
     708            bar.step(); 
     709            Field* fields = result->Fetch(); 
     710            StringTextData temp; 
     711 
     712            int32 i             = fields[0].GetInt32(); 
     713            temp.SoundId        = fields[1].GetInt32(); 
     714            temp.Type           = fields[2].GetInt32(); 
     715            temp.Language       = fields[3].GetInt32(); 
     716 
     717            if (i >= 0) 
     718            { 
    672719                error_db_log("TSCR: Entry %i in table `script_texts` is not a negative value.",i); 
    673720                continue; 
     
    710757    // Load Custom Text  
    711758    outstring_log("TSCR: Loading Custom Texts..."); 
    712     LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,(TEXT_SOURCE_RANGE*3)+1); 
     759    LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3)); 
    713760 
    714761    // Gather Additional data from Custom Texts 
     
    772819    } 
    773820 
    774     // Drop existing Event AI Localized Text hash map 
    775     EventAI_LocalizedTextMap.clear(); 
    776  
    777     // Gather EventAI Localized Texts 
    778     result = TScriptDB.PQuery("SELECT id, locale_1, locale_2, locale_3, locale_4, locale_5, locale_6, locale_7, locale_8 " 
    779         "FROM eventai_localized_texts"); 
    780  
    781     outstring_log("TSCR: Loading EventAI Localized Texts..."); 
    782     if(result) 
    783     { 
    784         barGoLink bar(result->GetRowCount()); 
    785         uint32 count = 0; 
    786  
    787         do 
    788         { 
    789             Localized_Text temp; 
    790             bar.step(); 
    791  
    792             Field *fields = result->Fetch(); 
    793  
    794             uint32 i = fields[0].GetInt32(); 
    795  
    796             temp.locale_1 = fields[1].GetString(); 
    797             temp.locale_2 = fields[2].GetString(); 
    798             temp.locale_3 = fields[3].GetString(); 
    799             temp.locale_4 = fields[4].GetString(); 
    800             temp.locale_5 = fields[5].GetString(); 
    801             temp.locale_6 = fields[6].GetString(); 
    802             temp.locale_7 = fields[7].GetString(); 
    803             temp.locale_8 = fields[8].GetString(); 
    804  
    805             EventAI_LocalizedTextMap[i] = temp; 
    806             ++count; 
    807  
    808         }while(result->NextRow()); 
    809  
    810         delete result; 
    811  
    812         outstring_log(""); 
    813         outstring_log(">> Loaded %u EventAI Localized Texts", count); 
    814     }else 
    815     { 
    816         barGoLink bar(1); 
    817         bar.step(); 
    818         outstring_log(""); 
    819         outstring_log(">> Loaded 0 EventAI Localized Texts. DB table `eventai_localized_texts` is empty"); 
    820     } 
    821  
    822     //Drop existing EventAI Text hash map 
    823     EventAI_Text_Map.clear(); 
    824  
    825     //Gather EventAI Text Entries 
    826     result = TScriptDB.PQuery("SELECT id, text FROM eventai_texts"); 
    827  
    828     outstring_log("TSCR: Loading EventAI_Texts..."); 
    829     if (result) 
    830     { 
    831         barGoLink bar(result->GetRowCount()); 
    832         uint32 Count = 0; 
    833  
    834         do 
    835         { 
    836             bar.step(); 
    837             Field *fields = result->Fetch(); 
    838  
    839             uint32 i = fields[0].GetInt32(); 
    840  
    841             std::string text = fields[1].GetString(); 
    842  
    843             if (!strlen(text.c_str())) 
    844                 error_db_log("TSCR: EventAI text %u is empty", i); 
    845  
    846             EventAI_Text_Map[i] = text; 
    847             ++Count; 
    848  
    849         }while (result->NextRow()); 
    850  
    851         delete result; 
    852  
    853         outstring_log(""); 
    854         outstring_log(">> Loaded %u EventAI texts", Count); 
    855     }else 
    856     { 
    857         barGoLink bar(1); 
    858         bar.step(); 
    859         outstring_log(""); 
    860         outstring_log(">> Loaded 0 EventAI texts. DB table `eventai_texts` is empty."); 
    861     } 
    862  
    863     //Gather event data 
     821    //Gather additional data for EventAI 
    864822    result = TScriptDB.PQuery("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM eventai_summons"); 
    865823 
     
    867825    EventAI_Summon_Map.clear(); 
    868826 
    869     outstring_log("TSCR: Loading EventAI_Summons..."); 
     827    outstring_log("TSCR: Loading EventAI Summons..."); 
    870828    if (result) 
    871829    { 
     
    915873    EventAI_Event_List.clear(); 
    916874 
    917     outstring_log("TSCR: Loading EventAI_Scripts..."); 
     875    outstring_log("TSCR: Loading EventAI scripts..."); 
    918876    if (result) 
    919877    { 
     
    10551013                switch (temp.action[j].type) 
    10561014                { 
    1057                     case ACTION_T_SAY: 
    1058                     case ACTION_T_YELL: 
    1059                     case ACTION_T_TEXTEMOTE: 
    1060                         if (GetEventAIText(temp.action[j].param1) == DEFAULT_TEXT) 
    1061                             error_db_log("TSCR: Event %u Action %u refrences missing Localized_Text entry", i, j+1); 
     1015                    case ACTION_T_TEXT: 
     1016                        { 
     1017                            if (temp.action[j].param1_s < 0) 
     1018                            { 
     1019                                if (TextMap.find(temp.action[j].param1_s) == TextMap.end()) 
     1020                                    error_db_log("TSCR: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1); 
     1021                            } 
     1022                            if (temp.action[j].param2_s < 0) 
     1023                            { 
     1024                                if (TextMap.find(temp.action[j].param2_s) == TextMap.end()) 
     1025                                    error_db_log("TSCR: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1); 
     1026 
     1027                                if (!temp.action[j].param1_s) 
     1028                                    error_db_log("TSCR: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1); 
     1029                            } 
     1030                            if (temp.action[j].param3_s < 0) 
     1031                            { 
     1032                                if (TextMap.find(temp.action[j].param3_s) == TextMap.end()) 
     1033                                    error_db_log("TSCR: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1); 
     1034 
     1035                                if (!temp.action[j].param1_s || !temp.action[j].param2_s) 
     1036                                    error_db_log("TSCR: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1); 
     1037                            } 
     1038                        } 
    10621039                        break; 
    10631040 
     
    10671044                        break; 
    10681045 
    1069                     case ACTION_T_RANDOM_SAY: 
    1070                     case ACTION_T_RANDOM_YELL: 
    1071                     case ACTION_T_RANDOM_TEXTEMOTE: 
    1072                         if ((temp.action[j].param1 != 0xffffffff && GetEventAIText(temp.action[j].param1) == DEFAULT_TEXT) || 
    1073                             (temp.action[j].param2 != 0xffffffff && GetEventAIText(temp.action[j].param2) == DEFAULT_TEXT) || 
    1074                             (temp.action[j].param3 != 0xffffffff && GetEventAIText(temp.action[j].param3) == DEFAULT_TEXT)) 
    1075                             error_db_log("TSCR: Event %u Action %u refrences missing Localized_Text entry", i, j+1); 
    1076                         break; 
     1046                    /*case ACTION_T_RANDOM_SOUND: 
     1047                        { 
     1048                            if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1)) 
     1049                                error_db_log("TSCR: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, temp.action[j].param1); 
     1050                            if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param2)) 
     1051                                error_db_log("TSCR: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, temp.action[j].param2); 
     1052                            if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param3)) 
     1053                                error_db_log("TSCR: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, temp.action[j].param3); 
     1054                        } 
     1055                        break;*/ 
    10771056 
    10781057                    case ACTION_T_CAST: 
     
    11531132                        break; 
    11541133 
     1134                    case ACTION_T_YELL: 
     1135                    case ACTION_T_TEXTEMOTE: 
     1136                    case ACTION_T_RANDOM_SAY: 
     1137                    case ACTION_T_RANDOM_YELL: 
     1138                    case ACTION_T_RANDOM_TEXTEMOTE: 
     1139                        error_db_log("TSCR: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1); 
     1140                        break; 
     1141 
    11551142                    default: 
    11561143                        if (temp.action[j].type >= ACTION_T_END) 
     
    12231210    else outstring_log("TSCR: Using configuration file %s",_TRINITY_SCRIPT_CONFIG); 
    12241211 
    1225     //Locale 
    1226     Locale = TScriptConfig.GetIntDefault("Locale", 0); 
    1227  
    1228     if (Locale > 8) 
    1229     { 
    1230         Locale = 0; 
    1231         error_log("TSCR: Locale set to invalid language id. Defaulting to 0."); 
    1232     } 
    1233  
    1234     outstring_log("TSCR: Using locale %u", Locale); 
    1235  
    12361212    EAI_ErrorLevel = TScriptConfig.GetIntDefault("EAIErrorLevel", 1); 
    12371213 
    12381214    switch (EAI_ErrorLevel) 
    12391215    { 
    1240     case 0: 
    1241         outstring_log("TSCR: EventAI Error Reporting level set to 0 (Startup Errors only)"); 
    1242         break; 
    1243     case 1: 
    1244         outstring_log("TSCR: EventAI Error Reporting level set to 1 (Startup errors and Runtime event errors)"); 
    1245         break; 
    1246     case 2: 
    1247         outstring_log("TSCR: EventAI Error Reporting level set to 2 (Startup errors, Runtime event errors, and Creation errors)"); 
    1248         break; 
    1249     default: 
    1250         outstring_log("TSCR: Unknown EventAI Error Reporting level. Defaulting to 1 (Startup errors and Runtime event errors)"); 
    1251         EAI_ErrorLevel = 1; 
    1252         break; 
     1216        case 0: 
     1217            outstring_log("TSCR: EventAI Error Reporting level set to 0 (Startup Errors only)"); 
     1218            break; 
     1219        case 1: 
     1220            outstring_log("TSCR: EventAI Error Reporting level set to 1 (Startup errors and Runtime event errors)"); 
     1221            break; 
     1222        case 2: 
     1223            outstring_log("TSCR: EventAI Error Reporting level set to 2 (Startup errors, Runtime event errors, and Creation errors)"); 
     1224            break; 
     1225        default: 
     1226            outstring_log("TSCR: Unknown EventAI Error Reporting level. Defaulting to 1 (Startup errors and Runtime event errors)"); 
     1227            EAI_ErrorLevel = 1; 
     1228            break; 
    12531229    } 
    12541230 
     
    17951771 
    17961772//********************************* 
    1797 //*** Functions used internally *** 
    1798  
    1799 const char* GetEventAILocalizedText(uint32 entry) 
    1800 { 
    1801     if (entry == 0xffffffff) 
    1802         error_log("TSCR: Entry = -1, GetEventAILocalizedText should not be called in this case."); 
    1803  
    1804     const char* temp = NULL; 
    1805  
    1806     HM_NAMESPACE::hash_map<uint32, Localized_Text>::iterator i = EventAI_LocalizedTextMap.find(entry); 
    1807  
    1808     if (i == EventAI_LocalizedTextMap.end()) 
    1809     { 
    1810         error_log("TSCR: EventAI Localized Text %u not found", entry); 
    1811         return DEFAULT_TEXT; 
    1812     } 
    1813  
    1814     switch (Locale) 
    1815     { 
    1816         case 1: 
    1817             temp =  (*i).second.locale_1.c_str(); 
    1818             break; 
    1819  
    1820         case 2: 
    1821             temp =  (*i).second.locale_2.c_str(); 
    1822             break; 
    1823  
    1824         case 3: 
    1825             temp =  (*i).second.locale_3.c_str(); 
    1826             break; 
    1827  
    1828         case 4: 
    1829             temp =  (*i).second.locale_4.c_str(); 
    1830             break; 
    1831  
    1832         case 5: 
    1833             temp =  (*i).second.locale_5.c_str(); 
    1834             break; 
    1835  
    1836         case 6: 
    1837             temp =  (*i).second.locale_6.c_str(); 
    1838             break; 
    1839  
    1840         case 7: 
    1841             temp =  (*i).second.locale_7.c_str(); 
    1842             break; 
    1843  
    1844         case 8: 
    1845             temp =  (*i).second.locale_8.c_str(); 
    1846             break; 
    1847     }; 
    1848  
    1849     if (strlen(temp)) 
    1850         return temp; 
    1851  
    1852     return DEFAULT_TEXT; 
    1853 } 
    1854  
    1855 const char* GetEventAIText(uint32 entry) 
    1856 { 
    1857     if(entry == 0xffffffff) 
    1858         error_log("TSCR: Entry = -1, GetEventAIText should not be called in this case."); 
    1859  
    1860     const char* str = NULL; 
    1861  
    1862     HM_NAMESPACE::hash_map<uint32, std::string>::iterator itr = EventAI_Text_Map.find(entry); 
    1863     if(itr == EventAI_Text_Map.end()) 
    1864     { 
    1865         error_log("TSCR: Unable to find EventAI Text %u", entry); 
    1866         return DEFAULT_TEXT; 
    1867     } 
    1868  
    1869     str = (*itr).second.c_str(); 
    1870  
    1871     if(strlen(str)) 
    1872         return str; 
    1873  
    1874     if(strlen((*itr).second.c_str())) 
    1875         return (*itr).second.c_str(); 
    1876  
    1877     return DEFAULT_TEXT; 
    1878 } 
     1773//*** Functions used globally *** 
    18791774 
    18801775void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target) 
     
    18881783    if (textEntry >= 0) 
    18891784    { 
    1890         error_log("TSCR: DoScriptText attempts to process entry %i, but entry must be negative.",textEntry); 
     1785        error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); 
    18911786        return; 
    18921787    } 
     
    18961791    if (i == TextMap.end()) 
    18971792    { 
    1898         error_log("TSCR: DoScriptText could not find text entry %i.",textEntry); 
     1793        error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); 
    18991794        return; 
    19001795    } 
     1796 
     1797    debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language); 
    19011798 
    19021799    if((*i).second.SoundId) 
     
    19391836} 
    19401837 
     1838//********************************* 
     1839//*** Functions used internally *** 
     1840 
    19411841Script* GetScriptByName(std::string Name) 
    19421842{ 
    1943     if(Name.empty()) 
     1843    if (Name.empty()) 
    19441844        return NULL; 
    19451845 
    19461846    for(int i=0;i<MAX_SCRIPTS;i++) 
    19471847    { 
    1948         if( m_scripts[i] && m_scripts[i]->Name == Name ) 
     1848        if (m_scripts[i] && m_scripts[i]->Name == Name) 
    19491849            return m_scripts[i]; 
    19501850    } 
     
    19591859{ 
    19601860    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    1961     if(!tmpscript || !tmpscript->pGossipHello) return false; 
     1861    if (!tmpscript || !tmpscript->pGossipHello) return false; 
    19621862 
    19631863    player->PlayerTalkClass->ClearMenus(); 
     
    19711871 
    19721872    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    1973     if(!tmpscript || !tmpscript->pGossipSelect) return false; 
     1873    if (!tmpscript || !tmpscript->pGossipSelect) return false; 
    19741874 
    19751875    player->PlayerTalkClass->ClearMenus(); 
     
    19831883 
    19841884    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    1985     if(!tmpscript || !tmpscript->pGossipSelectWithCode) return false; 
     1885    if (!tmpscript || !tmpscript->pGossipSelectWithCode) return false; 
    19861886 
    19871887    player->PlayerTalkClass->ClearMenus(); 
     
    19931893{ 
    19941894    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    1995     if(!tmpscript || !tmpscript->pQuestAccept) return false; 
     1895    if (!tmpscript || !tmpscript->pQuestAccept) return false; 
    19961896 
    19971897    player->PlayerTalkClass->ClearMenus(); 
     
    20031903{ 
    20041904    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    2005     if(!tmpscript || !tmpscript->pQuestSelect) return false; 
     1905    if (!tmpscript || !tmpscript->pQuestSelect) return false; 
    20061906 
    20071907    player->PlayerTalkClass->ClearMenus(); 
     
    20131913{ 
    20141914    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    2015     if(!tmpscript || !tmpscript->pQuestComplete) return false; 
     1915    if (!tmpscript || !tmpscript->pQuestComplete) return false; 
    20161916 
    20171917    player->PlayerTalkClass->ClearMenus(); 
     
    20231923{ 
    20241924    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    2025     if(!tmpscript || !tmpscript->pChooseReward) return false; 
     1925    if (!tmpscript || !tmpscript->pChooseReward) return false; 
    20261926 
    20271927    player->PlayerTalkClass->ClearMenus(); 
     
    20331933{ 
    20341934    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    2035     if(!tmpscript || !tmpscript->pNPCDialogStatus) return 100; 
     1935    if (!tmpscript || !tmpscript->pNPCDialogStatus) return 100; 
    20361936 
    20371937    player->PlayerTalkClass->ClearMenus(); 
     
    20531953{ 
    20541954    Script *tmpscript = GetScriptByName(_Item->GetProto()->ScriptName); 
    2055     if(!tmpscript || !tmpscript->pItemHello) return false; 
     1955    if (!tmpscript || !tmpscript->pItemHello) return false; 
    20561956 
    20571957    player->PlayerTalkClass->ClearMenus(); 
     
    20631963{ 
    20641964    Script *tmpscript = GetScriptByName(_Item->GetProto()->ScriptName); 
    2065     if(!tmpscript || !tmpscript->pItemQuestAccept) return false; 
     1965    if (!tmpscript || !tmpscript->pItemQuestAccept) return false; 
    20661966 
    20671967    player->PlayerTalkClass->ClearMenus(); 
     
    20731973{ 
    20741974    Script *tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); 
    2075     if(!tmpscript || !tmpscript->pGOHello) return false; 
     1975    if (!tmpscript || !tmpscript->pGOHello) return false; 
    20761976 
    20771977    player->PlayerTalkClass->ClearMenus(); 
     
    20831983{ 
    20841984    Script *tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); 
    2085     if(!tmpscript || !tmpscript->pGOQuestAccept) return false; 
     1985    if (!tmpscript || !tmpscript->pGOQuestAccept) return false; 
    20861986 
    20871987    player->PlayerTalkClass->ClearMenus(); 
     
    20931993{ 
    20941994    Script *tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); 
    2095     if(!tmpscript || !tmpscript->pGOChooseReward) return false; 
     1995    if (!tmpscript || !tmpscript->pGOChooseReward) return false; 
    20961996 
    20971997    player->PlayerTalkClass->ClearMenus(); 
     
    21052005 
    21062006    tmpscript = GetScriptByName(GetAreaTriggerScriptNameById(atEntry->id)); 
    2107     if(!tmpscript || !tmpscript->pAreaTrigger) return false; 
     2007    if (!tmpscript || !tmpscript->pAreaTrigger) return false; 
    21082008 
    21092009    return tmpscript->pAreaTrigger(player, atEntry); 
     
    21152015    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    21162016 
    2117     if(!tmpscript || !tmpscript->GetAI) return NULL; 
     2017    if (!tmpscript || !tmpscript->GetAI) return NULL; 
    21182018    return tmpscript->GetAI(_Creature); 
    21192019} 
     
    21232023{ 
    21242024    Script *tmpscript = GetScriptByName(_Item->GetProto()->ScriptName); 
    2125     if(!tmpscript || !tmpscript->pItemUse) return false; 
     2025    if (!tmpscript || !tmpscript->pItemUse) return false; 
    21262026 
    21272027    return tmpscript->pItemUse(player,_Item,targets); 
     
    21322032{ 
    21332033    Script *tmpscript = GetScriptByName(_Creature->GetScriptName()); 
    2134     if(!tmpscript || !tmpscript->pReceiveEmote) return false; 
     2034    if (!tmpscript || !tmpscript->pReceiveEmote) return false; 
    21352035 
    21362036    return tmpscript->pReceiveEmote(player, _Creature, emote); 
     
    21422042    Script *tmpscript = NULL; 
    21432043 
    2144     if(!map->IsDungeon()) return false; 
     2044    if (!map->IsDungeon()) return false; 
    21452045 
    21462046    tmpscript = GetScriptByName(((InstanceMap*)map)->GetScript()); 
    2147     if(!tmpscript || !tmpscript->GetInstanceData) return false; 
     2047    if (!tmpscript || !tmpscript->GetInstanceData) return false; 
    21482048 
    21492049    return tmpscript->GetInstanceData(map);