Changeset 44 for trunk/src/game/ObjectMgr.cpp
- Timestamp:
- 11/19/08 13:27:40 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ObjectMgr.cpp
r37 r44 1 1 /* 2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 3 * 4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 3 5 * 4 6 * This program is free software; you can redistribute it and/or modify … … 9 11 * This program is distributed in the hope that it will be useful, 10 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 14 * GNU General Public License for more details. 13 15 * 14 16 * You should have received a copy of the GNU General Public License 15 17 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 19 */ 18 20 … … 323 325 { 324 326 if(!GetPlayerNameByGUID(bidder_guid,bidder_name)) 325 bidder_name = Get MangosStringForDBCLocale(LANG_UNKNOWN);327 bidder_name = GetTrinityStringForDBCLocale(LANG_UNKNOWN); 326 328 } 327 329 } … … 331 333 std::string owner_name; 332 334 if(!GetPlayerNameByGUID(auction->owner,owner_name)) 333 owner_name = Get MangosStringForDBCLocale(LANG_UNKNOWN);335 owner_name = GetTrinityStringForDBCLocale(LANG_UNKNOWN); 334 336 335 337 uint32 owner_accid = GetPlayerAccountIdByGUID(auction->owner); … … 1020 1022 if(mask & 1) 1021 1023 { 1022 CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);1024 CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); 1023 1025 uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 1024 1026 … … 1036 1038 if(mask & 1) 1037 1039 { 1038 CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);1040 CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); 1039 1041 uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 1040 1042 … … 1090 1092 data.animprogress = fields[12].GetUInt32(); 1091 1093 data.go_state = fields[13].GetUInt32(); 1094 data.ArtKit = 0; 1092 1095 data.spawnMask = fields[14].GetUInt8(); 1093 1096 int16 gameEvent = fields[15].GetInt16(); … … 1119 1122 if(mask & 1) 1120 1123 { 1121 CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);1124 CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); 1122 1125 uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 1123 1126 … … 1135 1138 if(mask & 1) 1136 1139 { 1137 CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);1140 CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); 1138 1141 uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 1139 1142 … … 1842 1845 sLog.outErrorDb("Wrong (> 255) level %u in `pet_levelstats` table, ignoring.",current_level); 1843 1846 else 1844 sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `pet_levelstats` table, ignoring.",current_level);1847 sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `pet_levelstats` table, ignoring.",current_level); 1845 1848 continue; 1846 1849 } … … 2080 2083 { 2081 2084 2082 2083 2084 2085 2086 2085 QueryResult *result = NULL; 2086 if(sWorld.getConfig(CONFIG_START_ALL_SPELLS)) 2087 result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom"); 2088 else 2089 result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell"); 2087 2090 2088 2091 uint32 count = 0; … … 2224 2227 sLog.outErrorDb("Wrong (> 255) level %u in `player_classlevelstats` table, ignoring.",current_level); 2225 2228 else 2226 sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);2229 sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); 2227 2230 continue; 2228 2231 } … … 2319 2322 sLog.outErrorDb("Wrong (> 255) level %u in `player_levelstats` table, ignoring.",current_level); 2320 2323 else 2321 sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_levelstats` table, ignoring.",current_level);2324 sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_levelstats` table, ignoring.",current_level); 2322 2325 continue; 2323 2326 } … … 2804 2807 } 2805 2808 2806 if (qinfo->QuestFlags & ~QUEST_ MANGOS_FLAGS_DB_ALLOWED)2809 if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) 2807 2810 { 2808 2811 sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", 2809 qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_ MANGOS_FLAGS_DB_ALLOWED >> 16);2810 qinfo->QuestFlags &= QUEST_ MANGOS_FLAGS_DB_ALLOWED;2812 qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_TRINITY_FLAGS_DB_ALLOWED >> 16); 2813 qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; 2811 2814 } 2812 2815 2813 2816 if(qinfo->QuestFlags & QUEST_FLAGS_DAILY) 2814 2817 { 2815 if(!(qinfo->QuestFlags & QUEST_ MANGOS_FLAGS_REPEATABLE))2818 if(!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) 2816 2819 { 2817 2820 sLog.outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); 2818 qinfo->QuestFlags |= QUEST_ MANGOS_FLAGS_REPEATABLE;2821 qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; 2819 2822 } 2820 2823 } … … 3029 3032 } 3030 3033 3031 qinfo->SetFlag(QUEST_ MANGOS_FLAGS_DELIVER);3034 qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER); 3032 3035 3033 3036 if(!sItemStorage.LookupEntry<ItemPrototype>(id)) … … 3146 3149 if(found) 3147 3150 { 3148 if(!qinfo->HasFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT))3151 if(!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) 3149 3152 { 3150 sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1);3153 sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1); 3151 3154 3152 3155 // this will prevent quest completing without objective 3153 const_cast<Quest*>(qinfo)->SetFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT);3156 const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); 3154 3157 } 3155 3158 } … … 3185 3188 // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast 3186 3189 3187 qinfo->SetFlag(QUEST_ MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO);3190 qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); 3188 3191 3189 3192 if(!qinfo->ReqCreatureOrGOCount[j]) … … 3374 3377 mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId())); 3375 3378 if(qinfo->LimitTime) 3376 qinfo->SetFlag(QUEST_ MANGOS_FLAGS_TIMED);3377 } 3378 3379 // check QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE3379 qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED); 3380 } 3381 3382 // check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE 3380 3383 for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) 3381 3384 { … … 3397 3400 continue; 3398 3401 3399 if(!quest->HasFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT))3400 { 3401 sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.",spellInfo->Id,quest_id);3402 if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) 3403 { 3404 sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.",spellInfo->Id,quest_id); 3402 3405 3403 3406 // this will prevent quest completing without objective 3404 const_cast<Quest*>(quest)->SetFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT);3407 const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); 3405 3408 } 3406 3409 } … … 3659 3662 } 3660 3663 3661 if(! MaNGOS::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))3664 if(!Trinity::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o)) 3662 3665 { 3663 3666 sLog.outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",tablename,tmp.x,tmp.y,tmp.id); … … 3669 3672 case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE: 3670 3673 { 3671 if(! MaNGOS::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))3674 if(!Trinity::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o)) 3672 3675 { 3673 3676 sLog.outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",tablename,tmp.x,tmp.y,tmp.id); … … 3744 3747 } 3745 3748 3746 if(!quest->HasFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT))3747 { 3748 sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",tablename,tmp.datalong,tmp.id);3749 if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) 3750 { 3751 sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",tablename,tmp.datalong,tmp.id); 3749 3752 3750 3753 // this will prevent quest completing without objective 3751 const_cast<Quest*>(quest)->SetFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT);3754 const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); 3752 3755 3753 3756 // continue; - quest objective requiremet set and command can be allowed … … 4378 4381 } 4379 4382 4380 if(!quest->HasFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT))4381 { 4382 sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID);4383 if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) 4384 { 4385 sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID); 4383 4386 4384 4387 // this will prevent quest completing without objective 4385 const_cast<Quest*>(quest)->SetFlag(QUEST_ MANGOS_FLAGS_EXPLORATION_OR_EVENT);4388 const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); 4386 4389 4387 4390 // continue; - quest modified to required obkective and trigger can be allowed. … … 4801 4804 return true; 4802 4805 } 4806 4807 void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inDB) 4808 { 4809 GraveYardMap::iterator graveLow = mGraveYardMap.lower_bound(zoneId); 4810 GraveYardMap::iterator graveUp = mGraveYardMap.upper_bound(zoneId); 4811 if(graveLow==graveUp) 4812 { 4813 //sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); 4814 return; 4815 } 4816 4817 bool found = false; 4818 4819 GraveYardMap::iterator itr; 4820 4821 for(itr = graveLow; itr != graveUp; ++itr) 4822 { 4823 GraveYardData & data = itr->second; 4824 4825 // skip not matching safezone id 4826 if(data.safeLocId != id) 4827 continue; 4828 4829 // skip enemy faction graveyard at same map (normal area, city, or battleground) 4830 // team == 0 case can be at call from .neargrave 4831 if(data.team != 0 && team != 0 && data.team != team) 4832 continue; 4833 4834 found = true; 4835 break; 4836 } 4837 4838 // no match, return 4839 if(!found) 4840 return; 4841 4842 // remove from links 4843 mGraveYardMap.erase(itr); 4844 4845 // remove link from DB 4846 if(inDB) 4847 { 4848 WorldDatabase.PExecute("DELETE FROM game_graveyard_zone WHERE id = '%u' AND ghost_zone = '%u' AND faction = '%u'",id,zoneId,team); 4849 } 4850 4851 return; 4852 } 4853 4803 4854 4804 4855 void ObjectMgr::LoadAreaTriggerTeleports() … … 6147 6198 } 6148 6199 6149 bool ObjectMgr::Load MangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value)6200 bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value) 6150 6201 { 6151 6202 // cleanup affected map part for reloading case 6152 for( MangosStringLocaleMap::iterator itr = mMangosStringLocaleMap.begin(); itr != mMangosStringLocaleMap.end();)6203 for(TrinityStringLocaleMap::iterator itr = mTrinityStringLocaleMap.begin(); itr != mTrinityStringLocaleMap.end();) 6153 6204 { 6154 6205 if(itr->first >= min_value && itr->first <= max_value) 6155 6206 { 6156 MangosStringLocaleMap::iterator itr2 = itr;6207 TrinityStringLocaleMap::iterator itr2 = itr; 6157 6208 ++itr; 6158 m MangosStringLocaleMap.erase(itr2);6209 mTrinityStringLocaleMap.erase(itr2); 6159 6210 } 6160 6211 else … … 6172 6223 sLog.outString(""); 6173 6224 if(min_value > 0) // error only in case internal strings 6174 sLog.outErrorDb(">> Loaded 0 mangosstrings. DB table `%s` is empty. Cannot continue.",table);6225 sLog.outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table); 6175 6226 else 6176 6227 sLog.outString(">> Loaded 0 string templates. DB table `%s` is empty.",table); … … 6202 6253 } 6203 6254 6204 MangosStringLocale& data = mMangosStringLocaleMap[entry];6255 TrinityStringLocale& data = mTrinityStringLocaleMap[entry]; 6205 6256 6206 6257 if(data.Content.size() > 0) … … 6237 6288 6238 6289 sLog.outString(); 6239 if(min_value > 0) // internal mangosstrings6240 sLog.outString( ">> Loaded %u MaNGOSstrings from table %s", count,table);6290 if(min_value > 0) // internal Trinity strings 6291 sLog.outString( ">> Loaded %u Trinity strings from table %s", count,table); 6241 6292 else 6242 6293 sLog.outString( ">> Loaded %u string templates from %s", count,table); … … 6245 6296 } 6246 6297 6247 const char *ObjectMgr::Get MangosString(int32 entry, int locale_idx) const6298 const char *ObjectMgr::GetTrinityString(int32 entry, int locale_idx) const 6248 6299 { 6249 6300 // locale_idx==-1 -> default, locale_idx >= 0 in to idx+1 6250 // Content[0] always exist if exist MangosStringLocale6251 if( MangosStringLocale const *msl = GetMangosStringLocale(entry))6301 // Content[0] always exist if exist TrinityStringLocale 6302 if(TrinityStringLocale const *msl = GetTrinityStringLocale(entry)) 6252 6303 { 6253 6304 if(msl->Content.size() > locale_idx+1 && !msl->Content[locale_idx+1].empty()) … … 6258 6309 6259 6310 if(entry > 0) 6260 sLog.outErrorDb("Entry %i not found in ` mangos_string` table.",entry);6311 sLog.outErrorDb("Entry %i not found in `trinity_string` table.",entry); 6261 6312 else 6262 sLog.outErrorDb(" Mangosstring entry %i not found in DB.",entry);6313 sLog.outErrorDb("Trinity string entry %i not found in DB.",entry); 6263 6314 return "<error>"; 6264 6315 } … … 6869 6920 } 6870 6921 6871 void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost 6922 void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) 6872 6923 { 6873 6924 VendorItemData& vList = m_mCacheVendorItemMap[entry]; 6874 6925 vList.AddItem(item,maxcount,incrtime,extendedcost); 6875 6926 6876 WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost);6877 } 6878 6879 bool ObjectMgr::RemoveVendorItem( uint32 entry,uint32 item 6927 if(savetodb) WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost); 6928 } 6929 6930 bool ObjectMgr::RemoveVendorItem( uint32 entry,uint32 item, bool savetodb) 6880 6931 { 6881 6932 CacheVendorItemMap::iterator iter = m_mCacheVendorItemMap.find(entry); … … 6887 6938 6888 6939 iter->second.RemoveItem(item); 6889 WorldDatabase.PExecuteLog("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item);6940 if(savetodb) WorldDatabase.PExecuteLog("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item); 6890 6941 return true; 6891 6942 } 6892 6943 6893 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors ) const6944 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors, uint32 ORnpcflag ) const 6894 6945 { 6895 6946 CreatureInfo const* cInfo = GetCreatureTemplate(vendor_entry); … … 6899 6950 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6900 6951 else 6901 sLog.outErrorDb("Table ` npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);6952 sLog.outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry); 6902 6953 return false; 6903 6954 } 6904 6955 6905 if(!( cInfo->npcflag& UNIT_NPC_FLAG_VENDOR))6956 if(!((cInfo->npcflag | ORnpcflag) & UNIT_NPC_FLAG_VENDOR)) 6906 6957 { 6907 6958 if(!skip_vendors || skip_vendors->count(vendor_entry)==0) … … 6910 6961 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6911 6962 else 6912 sLog.outErrorDb("Table ` npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);6963 sLog.outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); 6913 6964 6914 6965 if(skip_vendors) … … 6923 6974 ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); 6924 6975 else 6925 sLog.outErrorDb("Table ` npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore",vendor_entry,item_id);6976 sLog.outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore",vendor_entry,item_id); 6926 6977 return false; 6927 6978 } … … 6932 6983 ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST,ExtendedCost); 6933 6984 else 6934 sLog.outErrorDb("Table ` npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",item_id,ExtendedCost,vendor_entry);6985 sLog.outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",item_id,ExtendedCost,vendor_entry); 6935 6986 return false; 6936 6987 } … … 6941 6992 ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime==0", maxcount); 6942 6993 else 6943 sLog.outErrorDb( "Table ` npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);6994 sLog.outErrorDb( "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); 6944 6995 return false; 6945 6996 } … … 6949 7000 ChatHandler(pl).PSendSysMessage("MaxCount==0 but IncrTime<>=0"); 6950 7001 else 6951 sLog.outErrorDb( "Table ` npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);7002 sLog.outErrorDb( "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry); 6952 7003 return false; 6953 7004 } … … 6962 7013 ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST,item_id); 6963 7014 else 6964 sLog.outErrorDb( "Table ` npc_vendor` has duplicate items %u for vendor (Entry: %u), ignore", item_id, vendor_entry);7015 sLog.outErrorDb( "Table `(game_event_)npc_vendor` has duplicate items %u for vendor (Entry: %u), ignore", item_id, vendor_entry); 6965 7016 return false; 6966 7017 } … … 6984 7035 } 6985 7036 6986 bool Load MangosStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)7037 bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value) 6987 7038 { 6988 7039 if(start_value >= 0 || start_value <= end_value) // start/end reversed for negative values … … 6994 7045 6995 7046 // for scripting localized strings allowed use _only_ negative entries 6996 return objmgr.Load MangosStrings(db,table,end_value,start_value);6997 } 7047 return objmgr.LoadTrinityStrings(db,table,end_value,start_value); 7048 }