• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetAttackerTeam函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetAttackerTeam函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAttackerTeam函数的具体用法?C++ GetAttackerTeam怎么用?C++ GetAttackerTeam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetAttackerTeam函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SendUpdateWorldState

void BattlefieldTB::TowerDestroyed(TBTowerId tbTowerId)
{
    if (!IsWarTime())
        return;

    // Add 5 minute bonus time
    m_Timer += m_BonusTime;

    SendUpdateWorldState(TB_WS_TIME_BATTLE_END, uint32(time(NULL) + (m_Timer / 1000)));

    SendWarning(TBTowers[tbTowerId].textDamaged);

    SetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED) + 1);
    SendUpdateWorldState(uint32(TB_WS_TOWERS_DESTROYED), int32(GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED)));

    SendUpdateWorldState(uint32(TBTowers[tbTowerId].wsDamaged[GetDefenderTeam()]), int32(0));
    SendUpdateWorldState(uint32(TBTowers[tbTowerId].wsDestroyed), int32(1));

    // Attack bonus buff
    for (ObjectGuid const& guid : m_PlayersInWar[GetAttackerTeam()])
        if (Player* player = ObjectAccessor::FindPlayer(guid))
            player->CastCustomSpell(SPELL_TOWER_ATTACK_BONUS, SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED), player, TRIGGERED_FULL_MASK);

    // Honor reward
    TeamCastSpell(GetAttackerTeam(), SPELL_REWARD_TOWER_DESTROYED);
}
开发者ID:Chaplain,项目名称:TrinityCore,代码行数:26,代码来源:BattlefieldTB.cpp


示例2: UpdateDamagedTowerCount

// Called when a tower is damaged, used for honor reward calcul
void BattlefieldWG::UpdateDamagedTowerCount(TeamId team)
{
    if (team == GetAttackerTeam())
        UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, 1);
    else
        UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, 1);
}
开发者ID:Confusion-su,项目名称:Elation-Server,代码行数:8,代码来源:BattlefieldWG.cpp


示例3: data

// Method sending worldsate to player
WorldPacket BattlefieldWG::BuildInitWorldStates()
{
    WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkShopList.size() * 8)));

    data << uint32(_MapId);
    data << uint32(m_ZoneId);
    data << uint32(0);
    data << uint16(4 + 2 + 4 + BuildingsInZone.size() + WorkShopList.size());

    data << uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER) << uint32(GetAttackerTeam());
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam());
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime()? 0 : 1);
    data << uint32(3710) << uint32(IsWarTime()? 1 : 0);

    for (uint32 i = 0; i < 2; ++i)
        data << ClockWorldState[i] << uint32(time(NULL) + (m_Timer / 1000));

    data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H);
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A);

    for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
    {
        data << (*itr)->m_WorldState << (*itr)->m_State;
    }
    for (WorkShop::const_iterator itr = WorkShopList.begin(); itr != WorkShopList.end(); ++itr)
    {
        data << (*itr)->m_WorldState << (*itr)->m_State;
    }
    return data;
}
开发者ID:Gosa1979,项目名称:ArkCORE2,代码行数:33,代码来源:BattlefieldWG.cpp


示例4: AddBrokenTower

void BattlefieldTB::AddBrokenTower(TeamId team)
{
    m_BattleTime += 5 * MINUTE * IN_MILLISECONDS;
    m_Data32[BATTLEFIELD_TB_DATA_CAPTURED]++;

    if (team == GetDefenderTeam())
    {
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer((*itr)))
                player->RemoveAuraFromStack(SPELL_TB_TOL_BARAD_TOWER_BONUS);

        for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer((*itr)))
                player->CastSpell(player, SPELL_TB_TOL_BARAD_TOWER_BONUS, true);

        if (m_Data32[BATTLEFIELD_TB_DATA_CAPTURED] == 3)
        {
            if (int32(m_Timer - 600000) < 0)
                m_Timer = 0;
            else
                m_Timer -= 600000;

            SendInitWorldStatesToAll();
        }
    }
}
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:26,代码来源:BattlefieldTB.cpp


示例5: SendWarning

void BattlefieldTB::OnBattleEnd(bool endByTimer)
{
    if (!endByTimer) // Attackers win (but now they are defenders already)
        SendWarning(GetDefenderTeam() == TEAM_ALLIANCE ? TB_TEXT_FORTRESS_CAPTURE_ALLIANCE : TB_TEXT_FORTRESS_CAPTURE_HORDE);
    else // Defenders win
        SendWarning(GetDefenderTeam() == TEAM_ALLIANCE ? TB_TEXT_FORTRESS_DEFEND_ALLIANCE : TB_TEXT_FORTRESS_DEFEND_HORDE);

    // UpdateNPCsAndGameObjects() must be called 1 minute after battle ends
    m_updateObjectsTimer = 1 * MINUTE * IN_MILLISECONDS;
    updatedNPCAndObjects = false;

    // Complete quest
    TeamCastSpell(GetDefenderTeam(), GetDefenderTeam() == TEAM_ALLIANCE ? SPELL_VICTORY_ALLIANCE : SPELL_VICTORY_HORDE);

    // Rewards
    TeamCastSpell(GetDefenderTeam(), GetDefenderTeam() == TEAM_ALLIANCE ? SPELL_REWARD_VICTORY_ALLIANCE : SPELL_REWARD_VICTORY_HORDE);
    for (uint32 i = 0; i < GetData(BATTLEFIELD_TB_DATA_TOWERS_INTACT); i++) // Unsure, for each intact tower or only once for having any tower intact?
        TeamCastSpell(GetDefenderTeam(), SPELL_REWARD_TOWER_INTACT);
    TeamCastSpell(GetAttackerTeam(), SPELL_REWARD_DEFEAT);

    for (uint8 team = 0; team < 2; ++team)
    {
        for (ObjectGuid const& guid : m_PlayersInWar[team])
            if (Player* player = ObjectAccessor::FindPlayer(guid))
                RemoveAurasFromPlayer(player);

        m_PlayersInWar[team].clear();
    }

    // Reset time warning vars
    warnedFiveMinutes = false;
    warnedTwoMinutes = false;
    warnedOneMinute = false;
};
开发者ID:Chaplain,项目名称:TrinityCore,代码行数:34,代码来源:BattlefieldTB.cpp


示例6: data

// Method sending worldsate to player
WorldPacket BattlefieldWG::BuildInitWorldStates()
{
    WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkshopsList.size() * 8)));

    data << uint32(m_MapId);
    data << uint32(m_ZoneId);
    data << uint32(0);
    data << uint16(4 + 2 + 4 + BuildingsInZone.size() + WorkshopsList.size());

    data << uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER) << uint32(GetAttackerTeam());
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam());
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime()? 0 : 1); // Note: cleanup these two, their names look awkward
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime()? 1 : 0);

    for (uint32 i = 0; i < 2; ++i)
        data << ClockWorldState[i] << uint32(time(NULL) + (m_Timer / 1000));

    data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H);
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
    data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A);

    for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
        data << (*itr)->m_WorldState << (*itr)->m_State;

    for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
        if (*itr)
            data << WorkshopsData[(*itr)->workshopId].worldstate << (*itr)->state;

    return data;
}
开发者ID:Szone,项目名称:TrinityCore,代码行数:32,代码来源:BattlefieldWG.cpp


示例7: data

// Method sending worldsate to player
WorldPacket BattlefieldTB::BuildInitWorldStates()
{
    WorldPacket data(SMSG_INIT_WORLD_STATES, (4+4+4+2+(BuildingsInZone.size()*8)+(WorkShopList.size()*8)));

    data << uint32(_MapId);
    data << uint32(m_ZoneId);
    data << uint32(0);
    data << uint16(4+2+4+BuildingsInZone.size()+WorkShopList.size());

    data << uint32(5385) << uint32(IsWarTime() ? 0 : GetAttackerTeam()); // Alliance Controlled
    data << uint32(5384) << uint32(IsWarTime() ? 0 : GetDefenderTeam()); // Horde Controlled
    // data << uint32(5547) << uint32(IsWarTime() ? GetAttackerTeam() : 0); // Horde is Attacking
    // data << uint32(5546) << uint32(IsWarTime() ? GetAttackerTeam() : 0); // Alliance is Attacking
    data << uint32(5349) << uint32(IsWarTime() ? BATTLEFIELD_TB_DATA_CAPTURED_FORT_ATT : 0); // Captured count
    data << uint32(5346) << uint32(IsWarTime() ? 1 : 0); // Time remaining
    data << uint32(5387) << uint32(IsWarTime() ? 0 : 1); // Next Battle

    for (uint32 i = 0; i < 2; ++i)
        data << TBClockWorldState[i] << uint32(time(NULL)+(m_Timer / 1000));

    for (TBGameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
    {
        data << (*itr)->m_WorldState << (*itr)->m_State;
    }
    for (TBWorkShop::const_iterator itr = WorkShopList.begin(); itr != WorkShopList.end(); ++itr)
    {
        data << (*itr)->m_WorldState << (*itr)->m_State;
    }
    return data;
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:31,代码来源:BattlefieldTB.cpp


示例8: AddBrokenTower

void BattlefieldTB::AddBrokenTower(TeamId team)
{
    m_BattleTime += 5*60*1000; // Increase battle time by 5 mins.
    m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF]++;
    // Destroy an attack tower
    if (team == GetDefenderTeam())
    {
        // Remove buff stack
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer((*itr)))
                player->RemoveAuraFromStack(SPELL_TOWER_BONUS);

        // Add buff stack
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer((*itr)))
            {
                player->CastSpell(player, SPELL_TOWER_BONUS, true);
                //DoCompleteOrIncrementAchievement(ACHIEVEMENTS_TB_TOWER_DESTROY, player); TODO
            }

        if (m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF] == 3)
        {
            if (int32(m_Timer-600000)<0)
                m_Timer = 0;
            else
                m_Timer -= 600000;

            SendInitWorldStatesToAll();
        }
    }
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:31,代码来源:BattlefieldTB.cpp


示例9: RemoveAurasFromPlayer

void BattlefieldWG::OnPlayerJoinWar(Player* player)
{
    RemoveAurasFromPlayer(player);

    player->CastSpell(player, SPELL_RECRUIT, true);

    if (player->GetZoneId() != m_ZoneId)
    {
        if (player->GetTeamId() == GetDefenderTeam())
            player->TeleportTo(571, 5345, 2842, 410, 3.14f);
        else
        {
            if (player->GetTeamId() == TEAM_HORDE)
                player->TeleportTo(571, 5025.857422f, 3674.628906f, 362.737122f, 4.135169f);
            else
                player->TeleportTo(571, 5101.284f, 2186.564f, 373.549f, 3.812f);
        }
    }

    UpdateTenacity();

    if (player->GetTeamId() == GetAttackerTeam())
    {
        if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) < 3)
            player->SetAuraStack(SPELL_TOWER_CONTROL, player, 3 - GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT));
    }
    else
    {
        if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) > 0)
           player->SetAuraStack(SPELL_TOWER_CONTROL, player, GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT));
    }
    SendInitWorldStatesTo(player);
}
开发者ID:Confusion-su,项目名称:Elation-Server,代码行数:33,代码来源:BattlefieldWG.cpp


示例10: OnPlayerJoinWar

void BattlefieldTB::OnPlayerJoinWar(Player* player)
{
    player->RemoveAurasDueToSpell(SPELL_VETERAN);
    player->RemoveAurasDueToSpell(SPELL_SPIRITUAL_IMMUNITY_TB);
    player->RemoveAurasDueToSpell(SPELL_TOWER_BONUS);

    if (player->GetZoneId() != m_ZoneId)
        if (player->GetTeamId() == GetDefenderTeam())
        {
            player->TeleportTo(732, -1244.58f, 981.233f, 155.426f, 0);
            player->CastSpell(player, SPELL_SLOW_FALL_TB, true);
        }
        else
            player->TeleportTo(732, -827.212646f, 1187.948608f, 112.81f, 3.092834f);

    if (player->GetTeamId() == GetAttackerTeam())
    {
        player->CastSpell(player, SPELL_VETERAN, true);
        if (3-m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF]>0)
            player->SetAuraStack(SPELL_TOWER_BONUS, player, 3-m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF]);
    }
    else
    {
        if (m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF]>0)
            player->SetAuraStack(SPELL_TOWER_BONUS, player, m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF]);
    }
    SendInitWorldStatesTo(player);
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:28,代码来源:BattlefieldTB.cpp


示例11: OnDamaged

void BattlefieldTB::OnDamaged()
{
    for(uint8 team = 0; team < 2; team++)
        for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
            if (Player *plr = sObjectMgr->GetPlayerByLowGUID((*itr)))
                if (plr->GetTeam() == GetAttackerTeam())
                    plr->CastSpell(plr, SPELL_TB_TOL_BARAD_TOWER_DAMAGED, true);
}
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:8,代码来源:BattlefieldTB.cpp


示例12: HideNpc

void BattlefieldTB::OnBattleStart()
{
    // Rebuild all wall
    /*for (TBGameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
        if ((*itr))
            (*itr)->Rebuild();*/

    m_Data32[BATTLEFIELD_TB_DATA_BROKEN_TOWER_DEF] = 0;
    m_Data32[BATTLEFIELD_TB_DATA_CAPTURED_FORT_DEF] = 3;
    m_Data32[BATTLEFIELD_TB_DATA_CAPTURED_FORT_ATT] = 0;

    // Update graveyard (in no war time all graveyard is to deffender, in war time, depend of base)
    for (TBWorkShop::const_iterator itr = WorkShopList.begin(); itr != WorkShopList.end(); ++itr)
    {
        if ((*itr))
            (*itr)->UpdateGraveYardAndWorkshop();
    }

    //Hide keep npc
    for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr)
        if (Unit* unit = ObjectAccessor::FindUnit((*itr)))
            if (Creature* creature = unit->ToCreature())
                HideNpc(creature);

    for (GuidSet::const_iterator itr = KeepCreature[GetDefenderTeam()].begin(); itr != KeepCreature[GetDefenderTeam()].end(); ++itr)
        if (Unit* unit = ObjectAccessor::FindUnit((*itr)))
            if (Creature* creature = unit->ToCreature())
                HideNpc(creature);

    //Show battle npcs
    for (GuidSet::const_iterator itr = WarCreature[GetDefenderTeam()].begin(); itr != WarCreature[GetDefenderTeam()].end(); ++itr)
        if (Unit* unit = ObjectAccessor::FindUnit((*itr)))
            if (Creature* creature = unit->ToCreature())
                HideNpc(creature);

    //Show battle npcs
    for (GuidSet::const_iterator itr = WarCreature[GetAttackerTeam()].begin(); itr != WarCreature[GetAttackerTeam()].end(); ++itr)
        if (Unit* unit = ObjectAccessor::FindUnit((*itr)))
            if (Creature* creature = unit->ToCreature())
                HideNpc(creature);

    //Warnin message
    SendWarningToAllInZone(BATTLEFIELD_TB_TEXT_START);
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:44,代码来源:BattlefieldTB.cpp


示例13: RemoveAurasFromPlayer

void BattlefieldTB::OnPlayerJoinWar(Player* player)
{
    RemoveAurasFromPlayer(player);

    player->SetPvP(true);

    // Bonus damage buff for attackers
    if (player->GetTeamId() == GetAttackerTeam() && GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED) > 0)
        player->CastCustomSpell(SPELL_TOWER_ATTACK_BONUS, SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED), player, TRIGGERED_FULL_MASK);
}
开发者ID:Chaplain,项目名称:TrinityCore,代码行数:10,代码来源:BattlefieldTB.cpp


示例14: AddBrokenTower

// Called when a tower is broke
void BattlefieldWG::AddBrokenTower(TeamId team)
{
    // Destroy an attack tower
    if (team == GetAttackerTeam())
    {
        // Update counter
        m_Data32[BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT]--;
        m_Data32[BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT]++;

        // Remove buff stack
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer(*itr))
                player->RemoveAuraFromStack(SPELL_TOWER_CONTROL);

        // Add buff stack
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
            if (Player* player = ObjectAccessor::FindPlayer(*itr))
            {
                player->CastSpell(player, SPELL_TOWER_CONTROL, true);
                IncrementQuest(player, WGQuest[player->GetTeamId()][3], true);
                DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WG_TOWER_DESTROY, player);
            }
        // If the threw south tower is destroy
        if (m_Data32[BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT] == 3)
        {
            // Remove 10 minutes to battle time
            if (int32(m_Timer - 600000) < 0)
            {
                m_Timer = 0;
            }
            else
            {
                m_Timer -= 600000;
            }
            SendInitWorldStatesToAll();
        }
    }
    else
    {
        m_Data32[BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF]--;
        m_Data32[BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF]++;
    }
}
开发者ID:Gosa1979,项目名称:ArkCORE2,代码行数:44,代码来源:BattlefieldWG.cpp


示例15: AddDamagedTower

// Called when a tower is damaged, used for honor reward calcul
void BattlefieldWG::AddDamagedTower(TeamId team)
{
    if (team == GetAttackerTeam())
    {
        m_Data32[BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT]++;
    }
    else
    {
        m_Data32[BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF]++;
    }
}
开发者ID:Gosa1979,项目名称:ArkCORE2,代码行数:12,代码来源:BattlefieldWG.cpp


示例16: BrokenWallOrTower

void BattlefieldWG::BrokenWallOrTower(TeamId team)
{
    if (team == GetDefenderTeam())
    {
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
        {
            if (Player* player = ObjectAccessor::FindPlayer(*itr))
                IncrementQuest(player, WGQuest[player->GetTeamId()][2], true);
        }
    }
}
开发者ID:Gosa1979,项目名称:ArkCORE2,代码行数:11,代码来源:BattlefieldWG.cpp


示例17: UpdateData

// Called when a tower is broke
void BattlefieldWG::UpdatedDestroyedTowerCount(TeamId team)
{
    // Destroy an attack tower
    if (team == GetAttackerTeam())
    {
        // Update counter
        UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, -1);
        UpdateData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT, 1);

        // Remove buff stack on attackers
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
            if (Player* player = sObjectAccessor->FindPlayer(*itr))
                player->RemoveAuraFromStack(SPELL_TOWER_CONTROL);

        // Add buff stack to defenders
        for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr)
            if (Player* player = sObjectAccessor->FindPlayer(*itr))
            {
                player->CastSpell(player, SPELL_TOWER_CONTROL, true);
                DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WG_TOWER_DESTROY, player);
            }

        // If all three south towers are destroyed (ie. all attack towers), remove ten minutes from battle time
        if (GetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT) == 3)
        {
            if (int32(m_Timer - 600000) < 0)
                m_Timer = 0;
            else
                m_Timer -= 600000;
            SendInitWorldStatesToAll();
        }
    }
    else
    {
        UpdateData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, -1);
        UpdateData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF, 1);
    }
}
开发者ID:Confusion-su,项目名称:Elation-Server,代码行数:39,代码来源:BattlefieldWG.cpp


示例18: OnDestroyed

void BattlefieldTB::OnDestroyed()
{
    for (uint8 team = 0; team < 2; team++)
    {
        for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
            if (Player *plr = sObjectMgr->GetPlayerByLowGUID((*itr)))
                if (plr->GetTeam() == GetAttackerTeam())
                {
                    plr->CastSpell(plr, SPELL_TB_TOL_BARAD_TOWER_DESTROYED, true);
                    plr->CastSpell(plr, SPELL_TB_TOL_BARAD_TOWER_BONUS, true);
                }
    }
    m_Data32[BATTLEFIELD_TB_DATA_CAPTURED]++;
}
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:14,代码来源:BattlefieldTB.cpp


示例19: GetAttackerTeam

bool BattlefieldTB::Update(uint32 diff)
{
    bool m_return = Battlefield::Update(diff);
    if (m_saveTimer <= diff)
    {
        sWorld->setWorldState(5387, m_WarTime);
        if (IsWarTime())
        {
            sWorld->setWorldState(5546, GetAttackerTeam());
            sWorld->setWorldState(5547, GetAttackerTeam());
        }
        else
            sWorld->setWorldState(5384, m_DefenderTeam);
        sWorld->setWorldState(TBClockWorldState[0], m_Timer );
        m_saveTimer = 60 * IN_MILLISECONDS;
    }
    else
        m_saveTimer -= diff;

    for (GuidSet::const_iterator itr = m_PlayersIsSpellImu.begin(); itr != m_PlayersIsSpellImu.end(); ++itr)
        if (Player* player = ObjectAccessor::FindPlayer((*itr)))
        {
            if (player->HasAura(SPELL_SPIRITUAL_IMMUNITY_TB))
            {
                const WorldSafeLocsEntry* graveyard = GetClosestGraveYard(player);
                if (graveyard)
                {
                    if (player->GetDistance2d(graveyard->x, graveyard->y) > 6.0f)
                    {
                        player->RemoveAurasDueToSpell(SPELL_SPIRITUAL_IMMUNITY_TB);
                        m_PlayersIsSpellImu.erase(player->GetGUID());
                    }
                }
            }
        }
    return m_return;
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:37,代码来源:BattlefieldTB.cpp


示例20: UpdateCapturedBaseCount

void BattlefieldTB::UpdateCapturedBaseCount()
{
    uint32 numCapturedBases = 0; // How many bases attacker has captured

    for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
        if (itr->second->GetTeamId() == GetAttackerTeam())
            numCapturedBases += 1;

    SetData(BATTLEFIELD_TB_DATA_BUILDINGS_CAPTURED, numCapturedBases);
    SendUpdateWorldState(TB_WS_BUILDINGS_CAPTURED, uint32(numCapturedBases));

    // Check if attackers won
    if (numCapturedBases == TB_BASE_COUNT)
        EndBattle(false);
}
开发者ID:Chaplain,项目名称:TrinityCore,代码行数:15,代码来源:BattlefieldTB.cpp



注:本文中的GetAttackerTeam函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetAttributes函数代码示例发布时间:2022-05-30
下一篇:
C++ GetAttackTime函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap