Changeset 230
- Timestamp:
- 11/19/08 13:48:46 (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 30 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/BattleGround.cpp
r102 r230 1285 1285 if(!cr) 1286 1286 { 1287 sLog.outError("Can't find creature guid: %u", m_BgCreatures[type]);1287 sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type])); 1288 1288 return false; 1289 1289 } … … 1299 1299 if(!obj) 1300 1300 { 1301 sLog.outError("Can't find gobject guid: %u", m_BgObjects[type]);1301 sLog.outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type])); 1302 1302 return false; 1303 1303 } -
trunk/src/game/BattleGroundBE.cpp
r102 r230 121 121 } 122 122 123 void BattleGroundBE::RemovePlayer(Player *plr, uint64 guid)123 void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) 124 124 { 125 125 if(GetStatus() == STATUS_WAIT_LEAVE) -
trunk/src/game/BattleGroundEY.cpp
r102 r230 575 575 obj->Delete(); 576 576 else 577 sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",G etDroppedFlagGUID());577 sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID())); 578 578 579 579 SetDroppedFlagGUID(0); … … 770 770 sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId); 771 771 if(!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team)) 772 sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: u, graveyard_id: %u", Point, Team, m_CapturingPointTypes[Point].GraveYardId); 772 sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u", 773 Point, Team, m_CapturingPointTypes[Point].GraveYardId); 773 774 774 775 UpdatePointsIcons(Team, Point); -
trunk/src/game/BattleGroundMgr.cpp
r229 r230 867 867 /*********************************************************/ 868 868 869 bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 p_time)869 bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) 870 870 { 871 871 Player* plr = objmgr.GetPlayer( m_PlayerGuid ); -
trunk/src/game/BattleGroundRL.cpp
r102 r230 119 119 } 120 120 121 void BattleGroundRL::RemovePlayer(Player *plr, uint64 guid)121 void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) 122 122 { 123 123 if(GetStatus() == STATUS_WAIT_LEAVE) -
trunk/src/game/BattleGroundWS.cpp
r102 r230 230 230 obj->Delete(); 231 231 else 232 sLog.outError("unknown droped flag bg, guid: %u",G etDroppedFlagGUID(team));232 sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); 233 233 234 234 SetDroppedFlagGUID(0,team); -
trunk/src/game/CharacterHandler.cpp
r173 r230 754 754 755 755 std::string IP_str = GetRemoteAddress(); 756 sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)",GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUID()); 756 sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)", 757 GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow()); 757 758 758 759 m_playerLoading = false; -
trunk/src/game/Corpse.cpp
r102 r230 82 82 if(!IsPositionValid()) 83 83 { 84 sLog.outError("ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %d Y: ^%d)",guidlow,owner->GetName(),x,y); 84 sLog.outError("ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)", 85 guidlow,owner->GetName(),x,y); 85 86 return false; 86 87 } … … 199 200 if(!IsPositionValid()) 200 201 { 201 sLog.outError("ERROR: Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %d Y: ^%d)",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()),GetPositionX(),GetPositionY()); 202 sLog.outError("ERROR: Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", 203 GetGUIDLow(),GUID_LOPART(GetOwnerGUID()),GetPositionX(),GetPositionY()); 202 204 return false; 203 205 } -
trunk/src/game/Creature.cpp
r229 r230 2183 2183 return objmgr.GetNpcTrainerSpells(GetEntry()); 2184 2184 } 2185 2186 // overwrite WorldObject function for proper name localization 2187 const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const 2188 { 2189 if (loc_idx >= 0) 2190 { 2191 CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry()); 2192 if (cl) 2193 { 2194 if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty()) 2195 return cl->Name[loc_idx].c_str(); 2196 } 2197 } 2198 2199 return GetName(); 2200 } -
trunk/src/game/Creature.h
r186 r230 523 523 void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); } 524 524 525 // overwrite WorldObject function for proper name localization 526 const char* GetNameForLocaleIdx(int32 locale_idx) const; 527 525 528 void setDeathState(DeathState s); // overwrite virtual Unit::setDeathState 526 529 -
trunk/src/game/GameObject.cpp
r229 r230 1286 1286 //trigger->RemoveCorpse(); 1287 1287 } 1288 1289 // overwrite WorldObject function for proper name localization 1290 const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const 1291 { 1292 if (loc_idx >= 0) 1293 { 1294 GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry()); 1295 if (cl) 1296 { 1297 if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty()) 1298 return cl->Name[loc_idx].c_str(); 1299 } 1300 } 1301 1302 return GetName(); 1303 } -
trunk/src/game/GameObject.h
r145 r230 446 446 void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); } 447 447 448 // overwrite WorldObject function for proper name localization 449 const char* GetNameForLocaleIdx(int32 locale_idx) const; 450 448 451 void SaveToDB(); 449 452 void SaveToDB(uint32 mapid, uint8 spawnMask); -
trunk/src/game/ItemPrototype.h
r229 r230 539 539 case INVTYPE_RELIC: 540 540 case INVTYPE_SHIELD: 541 case INVTYPE_HOLDABLE: 541 542 return true; 542 543 } -
trunk/src/game/Language.h
r177 r230 389 389 LANG_COMMAND_GRAVEYARDLINKED = 451, 390 390 LANG_COMMAND_GRAVEYARDWRONGZONE = 452, 391 LANG_COMMAND_GRAVEYARDWRONGTEAM= 453,391 // = 453, 392 392 LANG_COMMAND_GRAVEYARDERROR = 454, 393 393 LANG_COMMAND_GRAVEYARD_NOTEAM = 455, -
trunk/src/game/Level2.cpp
r207 r230 2823 2823 uint32 Maxpoint; 2824 2824 2825 sLog.outDebug("DEBUG: HandleWpShowCommand: lowguid: %u", lowguid); 2826 2827 sLog.outDebug("DEBUG: HandleWpShowCommand: Habe creature: %ld", target ); 2828 2829 sLog.outDebug("DEBUG: HandleWpShowCommand: wpshow - show: %s", show_str); 2830 //PSendSysMessage("wpshow - show: %s", show); 2825 sLog.outDebug("DEBUG: HandleWpShowCommand: lowguid: %u show: %s", lowguid, show_str); 2831 2826 2832 2827 // Show info for the selected waypoint … … 2849 2844 QueryResult *result = 2850 2845 WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, text1, text2, text3, text4, text5, model1, model2 FROM creature_movement WHERE wpguid = %u", 2851 target->GetGUID () );2846 target->GetGUIDLow() ); 2852 2847 if(!result) 2853 2848 { -
trunk/src/game/Level3.cpp
r229 r230 3581 3581 } 3582 3582 3583 if(graveyard->map_id != areaEntry->mapid && g_team != 0)3584 {3585 SendSysMessage(LANG_COMMAND_GRAVEYARDWRONGTEAM);3586 SetSentErrorMessage(true);3587 return false;3588 }3589 3590 3583 if(objmgr.AddGraveYardLink(g_id,player->GetZoneId(),g_team)) 3591 3584 PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId); -
trunk/src/game/LootMgr.cpp
r229 r230 272 272 if( chance != 0 && chance < 0.000001f ) // loot with low chance 273 273 { 274 sLog.outErrorDb("Table '%s' entry %d item %d: low chance (%d) - skipped", store.GetName(), entry, itemid, chance); 274 sLog.outErrorDb("Table '%s' entry %d item %d: low chance (%f) - skipped", 275 store.GetName(), entry, itemid, chance); 275 276 return false; 276 277 } -
trunk/src/game/MiscHandler.cpp
r229 r230 137 137 wstrToLower(str[i]); 138 138 139 sLog.outDebug("String %u: %s", i, str[i].c_str());139 sLog.outDebug("String %u: %s", i, temp.c_str()); 140 140 } 141 141 -
trunk/src/game/MotionMaster.cpp
r102 r230 189 189 { 190 190 DEBUG_LOG("Player (GUID: %u) chase to %s (GUID: %u)", 191 i_owner->GetGUIDLow(), 191 192 target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature", 192 193 target->GetTypeId()==TYPEID_PLAYER ? i_owner->GetGUIDLow() : ((Creature*)i_owner)->GetDBTableGUIDLow() ); -
trunk/src/game/NPCHandler.cpp
r221 r230 140 140 if (!ci) 141 141 { 142 sLog.outDebug( "WORLD: SendTrainerList - ( %u) NO CREATUREINFO! (GUID: %u)", uint32(GUID_LOPART(guid)), guid);142 sLog.outDebug( "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid) ); 143 143 return; 144 144 } … … 147 147 if(!trainer_spells) 148 148 { 149 sLog.outDebug( "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", guid, unit->GetEntry()); 149 sLog.outDebug( "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", 150 GUID_LOPART(guid), unit->GetEntry()); 150 151 return; 151 152 } -
trunk/src/game/Object.cpp
r203 r230 1281 1281 1282 1282 // TODO: i_object.GetName() also must be localized? 1283 i_object.BuildMonsterChat(data,i_msgtype,text,i_language,i_object.GetName (),i_targetGUID);1283 i_object.BuildMonsterChat(data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID); 1284 1284 1285 1285 i_data_cache[cache_idx] = data; -
trunk/src/game/Object.h
r221 r230 400 400 void SetName(std::string newname) { m_name=newname; } 401 401 402 virtual const char* GetNameForLocaleIdx(int32 /*locale_idx*/) const { return GetName(); } 403 402 404 float GetDistance( const WorldObject* obj ) const; 403 405 float GetDistance(const float x, const float y, const float z) const; -
trunk/src/game/ObjectMgr.cpp
r229 r230 4828 4828 } 4829 4829 4830 if(entry->map_id != areaEntry->mapid && team != 0)4831 {4832 sLog.outErrorDb("Table `game_graveyard_zone` has record for ghost zone (%u) at map %u and graveyard (%u) at map %u for team %u, but in case maps are different, player faction setting is ignored. Use faction 0 instead.",zoneId,areaEntry->mapid, safeLocId, entry->map_id, team);4833 team = 0;4834 }4835 4836 4830 if(!AddGraveYardLink(safeLocId,zoneId,team,false)) 4837 4831 sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId); … … 4855 4849 // then check faction 4856 4850 // if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated 4857 // then skipcheck faction4851 // then check faction 4858 4852 GraveYardMap::const_iterator graveLow = mGraveYardMap.lower_bound(zoneId); 4859 4853 GraveYardMap::const_iterator graveUp = mGraveYardMap.upper_bound(zoneId); … … 4864 4858 } 4865 4859 4860 // at corpse map 4866 4861 bool foundNear = false; 4867 4862 float distNear; 4868 4863 WorldSafeLocsEntry const* entryNear = NULL; 4864 4865 // at entrance map for corpse map 4866 bool foundEntr = false; 4867 float distEntr; 4868 WorldSafeLocsEntry const* entryEntr = NULL; 4869 4870 // some where other 4869 4871 WorldSafeLocsEntry const* entryFar = NULL; 4872 4873 MapEntry const* mapEntry = sMapStore.LookupEntry(MapId); 4870 4874 4871 4875 for(GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr) … … 4880 4884 } 4881 4885 4882 // remember first graveyard at another map and ignore other 4883 if(MapId != entry->map_id) 4884 { 4885 if(!entryFar) 4886 entryFar = entry; 4887 continue; 4888 } 4889 4890 // skip enemy faction graveyard at same map (normal area, city, or battleground) 4886 // skip enemy faction graveyard 4891 4887 // team == 0 case can be at call from .neargrave 4892 4888 if(data.team != 0 && team != 0 && data.team != team) 4893 4889 continue; 4894 4890 4891 // find now nearest graveyard at other map 4892 if(MapId != entry->map_id) 4893 { 4894 // if find graveyard at different map from where entrance placed (or no entrance data), use any first 4895 if (!mapEntry || mapEntry->entrance_map < 0 || mapEntry->entrance_map != entry->map_id || 4896 mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0) 4897 { 4898 // not have any corrdinates for check distance anyway 4899 entryFar = entry; 4900 continue; 4901 } 4902 4903 // at entrance map calculate distance (2D); 4904 float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x) 4905 +(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y); 4906 if(foundEntr) 4907 { 4908 if(dist2 < distEntr) 4909 { 4910 distEntr = dist2; 4911 entryEntr = entry; 4912 } 4913 } 4914 else 4915 { 4916 foundEntr = true; 4917 distEntr = dist2; 4918 entryEntr = entry; 4919 } 4920 } 4895 4921 // find now nearest graveyard at same map 4896 float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z); 4897 if(foundNear) 4898 { 4899 if(dist2 < distNear) 4900 { 4922 else 4923 { 4924 float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z); 4925 if(foundNear) 4926 { 4927 if(dist2 < distNear) 4928 { 4929 distNear = dist2; 4930 entryNear = entry; 4931 } 4932 } 4933 else 4934 { 4935 foundNear = true; 4901 4936 distNear = dist2; 4902 4937 entryNear = entry; 4903 4938 } 4904 4939 } 4905 else 4906 { 4907 foundNear = true; 4908 distNear = dist2; 4909 entryNear = entry; 4910 } 4911 } 4912 4940 } 4941 4942 // find now nearest graveyard at same map 4913 4943 if(entryNear) 4914 4944 return entryNear; 4945 4946 if(entryEntr) 4947 return entryEntr; 4915 4948 4916 4949 return entryFar; … … 5132 5165 for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); itr++) 5133 5166 { 5134 if(itr->second.target_mapId == mapEntry-> parent_map)5167 if(itr->second.target_mapId == mapEntry->entrance_map) 5135 5168 { 5136 5169 AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); -
trunk/src/game/Player.cpp
r229 r230 10257 10257 if(pProto && isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer == 0) 10258 10258 { 10259 m_weaponChangeTimer = DEFAULT_SWITCH_WEAPON; 10259 uint32 cooldownSpell = SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s; 10260 10260 10261 if (getClass() == CLASS_ROGUE) 10261 m_weaponChangeTimer = ROGUE_SWITCH_WEAPON; 10262 cooldownSpell = SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s; 10263 10264 SpellEntry const* spellProto = sSpellStore.LookupEntry(cooldownSpell); 10265 10266 if (!spellProto) 10267 sLog.outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell); 10268 else 10269 { 10270 m_weaponChangeTimer = spellProto->StartRecoveryTime; 10271 10272 WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); 10273 data << uint64(GetGUID()); 10274 data << uint8(1); 10275 data << uint32(cooldownSpell); 10276 data << uint32(0); 10277 GetSession()->SendPacket(&data); 10278 } 10262 10279 } 10263 10280 } -
trunk/src/game/Player.h
r229 r230 681 681 typedef std::vector<ItemPosCount> ItemPosCountVec; 682 682 683 enum SwitchWeapon684 {685 DEFAULT_SWITCH_WEAPON = 1500, //cooldown in ms686 ROGUE_SWITCH_WEAPON = 1000687 };688 689 683 enum TradeSlots 690 684 { -
trunk/src/game/SharedDefines.h
r229 r230 1904 1904 #define SPELL_ID_PASSIVE_BATTLE_STANCE 2457 1905 1905 #define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007 1906 #define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119 1907 #define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123 1906 1908 1907 1909 enum WeatherType -
trunk/src/game/World.cpp
r229 r230 203 203 } 204 204 205 WorldSession* old = m_sessions[s->GetAccountId ()];206 m_sessions[s->GetAccountId ()] = s;207 208 205 // if session already exist, prepare to it deleting at next world update 209 206 // NOTE - KickPlayer() should be called on "old" in RemoveSession() 210 if (old) 211 m_kicked_sessions.insert (old); 207 { 208 SessionMap::const_iterator old = m_sessions.find(s->GetAccountId ()); 209 210 if(old != m_sessions.end()) 211 m_kicked_sessions.insert (old->second); 212 } 213 214 m_sessions[s->GetAccountId ()] = s; 212 215 213 216 uint32 Sessions = GetActiveAndQueuedSessionCount (); … … 292 295 if(*iter==sess) 293 296 { 294 Queue::iterator iter2 = iter; 295 ++iter; 296 m_QueuedPlayer.erase(iter2); 297 iter = m_QueuedPlayer.erase(iter); 297 298 decrease_session = false; // removing queued session 298 299 break; -
trunk/src/shared/Database/DBCStructure.h
r102 r230 465 465 //chat* unknownText2 // 100-115 unknown empty text fields 466 466 // 116 text flags 467 int32 parent_map; // 117 map_id of parentmap468 //float start_x // 118 enterx coordinate (if exist single entry)469 //float start_y // 119 entery coordinate (if exist single entry)467 int32 entrance_map; // 117 map_id of entrance map 468 float entrance_x; // 118 entrance x coordinate (if exist single entry) 469 float entrance_y; // 119 entrance y coordinate (if exist single entry) 470 470 uint32 resetTimeRaid; // 120 471 471 uint32 resetTimeHeroic; // 121 -
trunk/src/shared/Database/DBCfmt.cpp
r102 r230 56 56 const char LockEntryfmt[]="niiiiixxxiiiiixxxiixxxxxxxxxxxxxx"; 57 57 const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 58 const char MapEntryfmt[]="nxixssssssssssssssssxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi xxiixxi";58 const char MapEntryfmt[]="nxixssssssssssssssssxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxi"; 59 59 const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; 60 60 const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; -
trunk/src/shared/Database/SqlOperations.cpp
r102 r230 103 103 if(m_queries[index].first != NULL) 104 104 { 105 sLog.outError("Attempt assign query to holder index (%u) where other query stored (Old: [%s] New: [%s])",index,m_queries.size(),m_queries[index].first,sql); 105 sLog.outError("Attempt assign query to holder index (%u) where other query stored (Old: [%s] New: [%s])", 106 index,m_queries[index].first,sql); 106 107 return false; 107 108 }