本文整理汇总了C++中Battlefield::GetDefenderTeam方法的典型用法代码示例。如果您正苦于以下问题:C++ Battlefield::GetDefenderTeam方法的具体用法?C++ Battlefield::GetDefenderTeam怎么用?C++ Battlefield::GetDefenderTeam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Battlefield
的用法示例。
在下文中一共展示了Battlefield::GetDefenderTeam方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGossipHello
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (wintergrasp->IsWarTime())
{
AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
}
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
player->SendUpdateWorldState(4354, time(NULL) + timer);
if (timer < 15 * MINUTE)
{
AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
}
else
SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
}
return true;
}
示例2: OnGossipHello
bool npc_wg_queue::OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (wintergrasp->IsWarTime())
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, pCreature->GetGUID());
}
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
pPlayer->SendUpdateWorldState(4354, time(NULL) + timer);
if (timer < 15 * MINUTE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, pCreature->GetGUID());
}
else
pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, pCreature->GetGUID());
}
return true;
}
示例3: OnGossipHello
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (wintergrasp->IsWarTime())
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT_19, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
}
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
player->SendUpdateWorldState(4354, time(NULL) + timer);
if (timer < 15 * MINUTE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
}
return true;
}
示例4: OnGossipHello
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* BfTB = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_TB);
if (BfTB)
{
if (BfTB->IsWarTime())
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(TB_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_WAR : TB_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
}
else
{
uint32 uiTime = BfTB->GetTimer()/1000;
player->SendUpdateWorldState(5332, time(NULL)+uiTime);
if (uiTime < 15 * MINUTE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(TB_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_QUEUE : TB_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
}
else
{
player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_NOWAR:TB_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
}
}
}
return true;
}
示例5: OnConditionCheck
bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
return true;
return false;
}
示例6: HandleScript
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Player* target = GetHitPlayer();
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp || !target || target->getLevel() < 75 || (wintergrasp->GetDefenderTeam() != target->GetTeamId()))
return;
target->CastSpell(target, SPELL_TELEPORT_TO_FORTRESS, true);
}
示例7: OnGossipHello
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (creature->isQuestGiver())
{
QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
QuestRelationBounds objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
qm.ClearMenu();
for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i)
{
uint32 questId = i->second;
QuestStatus status = player->GetQuestStatus(questId);
if (status == QUEST_STATUS_COMPLETE)
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_INCOMPLETE)
qm.AddMenuItem(questId, 4);
//else if (status == QUEST_STATUS_AVAILABLE)
// qm.AddMenuItem(quest_id, 2);
}
for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i)
{
uint32 questId = i->second;
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
if (!quest)
continue;
switch (questId)
{
// Horde attacker
case QUEST_BONES_AND_ARROWS_HORDE_ATT:
case QUEST_JINXING_THE_WALLS_HORDE_ATT:
case QUEST_SLAY_THEM_ALL_HORDE_ATT:
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT:
case QUEST_HEALING_WITH_ROSES_HORDE_ATT:
case QUEST_DEFEND_THE_SIEGE_HORDE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
break;
// Horde defender
case QUEST_BONES_AND_ARROWS_HORDE_DEF:
case QUEST_WARDING_THE_WALLS_HORDE_DEF:
case QUEST_SLAY_THEM_ALL_HORDE_DEF:
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF:
case QUEST_HEALING_WITH_ROSES_HORDE_DEF:
case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF:
case QUEST_STOP_THE_SIEGE_HORDE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
break;
// Alliance attacker
case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT:
case QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT:
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT:
case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT:
case QUEST_A_RARE_HERB_ALLIANCE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
break;
// Alliance defender
case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF:
case QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF:
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF:
case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF:
case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF:
case QUEST_A_RARE_HERB_ALLIANCE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
//.........这里部分代码省略.........