Changeset 44 for trunk/src/game/Object.cpp
- Timestamp:
- 11/19/08 13:27:40 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Object.cpp
r42 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 … … 330 332 *data << (uint32)((Player*)this)->GetTransTime(); 331 333 } 332 // MaNGOScurrently not have support for other than player on transport334 //TrinIty currently not have support for other than player on transport 333 335 } 334 336 … … 541 543 updateMask->SetBit(GAMEOBJECT_DYN_FLAGS); 542 544 } 545 if (GetUInt32Value(GAMEOBJECT_ARTKIT)) 546 updateMask->SetBit(GAMEOBJECT_ARTKIT); 543 547 } 544 548 } … … 569 573 { 570 574 // remove custom flag before send 575 571 576 if( index == UNIT_NPC_FLAGS ) 572 *data << uint32(m_uint32Values[ index ] & ~ UNIT_NPC_FLAG_GUARD);577 *data << uint32(m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP)); 573 578 // FIXME: Some values at server stored in float format but must be sent to client in uint32 format 574 579 else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME) … … 1117 1122 rand_z = z; 1118 1123 1119 MaNGOS::NormalizeMapCoord(rand_x);1120 MaNGOS::NormalizeMapCoord(rand_y);1124 Trinity::NormalizeMapCoord(rand_x); 1125 Trinity::NormalizeMapCoord(rand_y); 1121 1126 UpdateGroundPositionZ(rand_x,rand_y,rand_z); // update to LOS height if available 1122 1127 } … … 1131 1136 bool WorldObject::IsPositionValid() const 1132 1137 { 1133 return MaNGOS::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation);1138 return Trinity::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation); 1134 1139 } 1135 1140 … … 1177 1182 } 1178 1183 1179 namespace MaNGOS1184 namespace Trinity 1180 1185 { 1181 1186 class MessageChatLocaleCacheDo … … 1210 1215 i_data_cache.resize(cache_idx+1); 1211 1216 1212 char const* text = objmgr.Get MangosString(i_textId,loc_idx);1217 char const* text = objmgr.GetTrinityString(i_textId,loc_idx); 1213 1218 1214 1219 data = new WorldPacket(SMSG_MESSAGECHAT, 200); … … 1234 1239 std::vector<WorldPacket*> i_data_cache; // 0 = default, i => i-1 locale index 1235 1240 }; 1236 } // namespace MaNGOS1241 } // namespace Trinity 1237 1242 1238 1243 void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid) 1239 1244 { 1240 CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());1245 CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 1241 1246 1242 1247 Cell cell(p); … … 1244 1249 cell.SetNoCreate(); 1245 1250 1246 MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));1247 MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);1248 TypeContainerVisitor< MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);1251 Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); 1252 Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 1253 TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 1249 1254 CellLock<GridReadGuard> cell_lock(cell, p); 1250 1255 cell_lock->Visit(cell_lock, message, *GetMap()); … … 1253 1258 void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) 1254 1259 { 1255 CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());1260 CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 1256 1261 1257 1262 Cell cell(p); … … 1259 1264 cell.SetNoCreate(); 1260 1265 1261 MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL));1262 MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);1263 TypeContainerVisitor< MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);1266 Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL)); 1267 Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 1268 TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 1264 1269 CellLock<GridReadGuard> cell_lock(cell, p); 1265 1270 cell_lock->Visit(cell_lock, message, *GetMap()); … … 1268 1273 void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote) 1269 1274 { 1270 CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());1275 CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 1271 1276 1272 1277 Cell cell(p); … … 1274 1279 cell.SetNoCreate(); 1275 1280 1276 MaNGOS::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));1277 MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);1278 TypeContainerVisitor< MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);1281 Trinity::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); 1282 Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 1283 TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 1279 1284 CellLock<GridReadGuard> cell_lock(cell, p); 1280 1285 cell_lock->Visit(cell_lock, message, *GetMap()); … … 1288 1293 1289 1294 uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); 1290 char const* text = objmgr.Get MangosString(textId,loc_idx);1295 char const* text = objmgr.GetTrinityString(textId,loc_idx); 1291 1296 1292 1297 WorldPacket data(SMSG_MESSAGECHAT, 200); … … 1436 1441 y = GetPositionY() + (GetObjectSize() + distance2d) * sin(absAngle); 1437 1442 1438 MaNGOS::NormalizeMapCoord(x);1439 MaNGOS::NormalizeMapCoord(y);1443 Trinity::NormalizeMapCoord(x); 1444 Trinity::NormalizeMapCoord(y); 1440 1445 } 1441 1446