Changeset 283 for trunk/src/game/BattleGround.cpp
- Timestamp:
- 11/22/08 01:55:16 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/BattleGround.cpp
r230 r283 362 362 } 363 363 } 364 365 void BattleGround::YellToAll(Creature* creature, const char* text, uint32 language) 366 { 367 for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) 368 { 369 WorldPacket data(SMSG_MESSAGECHAT, 200); 370 Player *plr = objmgr.GetPlayer(itr->first); 371 if(!plr) 372 { 373 sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); 374 continue; 375 } 376 creature->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,creature->GetName(),itr->first); 377 plr->GetSession()->SendPacket(&data); 378 } 379 } 380 364 381 365 382 void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID) … … 1219 1236 } 1220 1237 1238 GameObject* BattleGround::GetBGObject(uint32 type) 1239 { 1240 GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]); 1241 if(!obj) 1242 sLog.outError("couldn't get gameobject %i",type); 1243 return obj; 1244 } 1245 1246 Creature* BattleGround::GetBGCreature(uint32 type) 1247 { 1248 Creature *creature = HashMapHolder<Creature>::Find(m_BgCreatures[type]); 1249 if(!creature) 1250 sLog.outError("couldn't get creature %i",type); 1251 return creature; 1252 } 1253 1221 1254 void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime) 1222 1255 { … … 1270 1303 } 1271 1304 1305 CreatureData &data = objmgr.NewOrExistCreatureData(pCreature->GetDBTableGUIDLow()); 1306 1307 data.id = entry; 1308 // data.mapid = GetMapId(); 1309 data.posX = x; 1310 data.posY = y; 1311 data.posZ = z; 1312 data.orientation = o; 1313 data.spawndist = 15; 1314 1272 1315 pCreature->AIM_Initialize(); 1273 1316 … … 1288 1331 return false; 1289 1332 } 1333 //TODO: only delete creature after not in combat 1290 1334 cr->CleanupsBeforeDelete(); 1291 1335 cr->AddObjectToRemoveList(); … … 1475 1519 m_HonorMode = BG_NORMAL; 1476 1520 } 1521 1522 int32 BattleGround::GetObjectType(uint64 guid) 1523 { 1524 for(uint32 i = 0;i <= m_BgObjects.size(); i++) 1525 if(m_BgObjects[i] == guid) 1526 return i; 1527 sLog.outError("BattleGround: cheating? a player used a gameobject which isnt supposed to be a usable object!"); 1528 return -1; 1529 } 1530 1531 void BattleGround::HandleKillUnit(Creature *creature, Player *killer) 1532 { 1533 }