Show
Ignore:
Timestamp:
11/22/08 01:55:16 (17 years ago)
Author:
yumileroy
Message:

*Alterac Valley. By Bogie and Balrok. Note: some core contents are modified. Will fix them later. Some sql are disabled because of possible conflict with offical DB. Use them at your own risk.

Original author: megamage
Date: 2008-11-21 19:45:49-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/BattleGround.cpp

    r230 r283  
    362362    } 
    363363} 
     364 
     365void 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 
    364381 
    365382void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID) 
     
    12191236} 
    12201237 
     1238GameObject* 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 
     1246Creature* 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 
    12211254void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime) 
    12221255{ 
     
    12701303    } 
    12711304 
     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 
    12721315    pCreature->AIM_Initialize(); 
    12731316 
     
    12881331        return false; 
    12891332    } 
     1333    //TODO: only delete creature after not in combat 
    12901334    cr->CleanupsBeforeDelete(); 
    12911335    cr->AddObjectToRemoveList(); 
     
    14751519        m_HonorMode = BG_NORMAL; 
    14761520} 
     1521 
     1522int32 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 
     1531void BattleGround::HandleKillUnit(Creature *creature, Player *killer) 
     1532{ 
     1533}