diff options
Diffstat (limited to 'src/game/BattleGround.cpp')
-rw-r--r-- | src/game/BattleGround.cpp | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 8ca49225597..bce5008788a 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -850,141 +850,6 @@ uint32 BattleGround::GetBattlemasterEntry() const } } -/* -void BattleGround::RewardMark(Player *plr,uint32 count) -{ - BattleGroundMarks mark; - switch(GetTypeID()) - { - case BATTLEGROUND_AV: - mark = ITEM_AV_MARK_OF_HONOR; - break; - case BATTLEGROUND_WS: - mark = ITEM_WS_MARK_OF_HONOR; - break; - case BATTLEGROUND_AB: - mark = ITEM_AB_MARK_OF_HONOR; - break; - case BATTLEGROUND_EY: - mark = ITEM_EY_MARK_OF_HONOR; - break; - case BATTLEGROUND_SA: - mark = ITEM_SA_MARK_OF_HONOR; - break; - default: - return; - } - - //if (IsSpell) - // RewardSpellCast(plr,mark); - //else - RewardItem(plr,mark,count); -} - -void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id) -{ - // 'Inactive' this aura prevents the player from gaining honor points and battleground tokens - if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE)) - return; - - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); - if (!spellInfo) - { - sLog.outError("Battleground reward casting spell %u not exist.",spell_id); - return; - } - - plr->CastSpell(plr, spellInfo, true); -} - -void BattleGround::RewardItem(Player *plr, uint32 item_id, uint32 count) -{ - // 'Inactive' this aura prevents the player from gaining honor points and battleground tokens - if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE)) - return; - - ItemPosCountVec dest; - uint32 no_space_count = 0; - uint8 msg = plr->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item_id, count, &no_space_count); - - if (msg == EQUIP_ERR_ITEM_NOT_FOUND) - { - sLog.outErrorDb("Battleground reward item (Entry %u) not exist in `item_template`.",item_id); - return; - } - - if (msg != EQUIP_ERR_OK) // convert to possible store amount - count -= no_space_count; - - if (count != 0 && !dest.empty()) // can add some - if (Item* item = plr->StoreNewItem(dest, item_id, true, 0)) - plr->SendNewItem(item,count,true,false); - - if (no_space_count > 0) - SendRewardMarkByMail(plr,item_id,no_space_count); -} - -void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count) -{ - uint32 bmEntry = GetBattlemasterEntry(); - if (!bmEntry) - return; - - ItemPrototype const* markProto = objmgr.GetItemPrototype(mark); - if (!markProto) - return; - - if (Item* markItem = Item::CreateItem(mark,count,plr)) - { - // save new item before send - markItem->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted - - // subject: item name - std::string subject = markProto->Name1; - int loc_idx = plr->GetSession()->GetSessionDbLocaleIndex(); - if (loc_idx >= 0) - if (ItemLocale const *il = objmgr.GetItemLocale(markProto->ItemId)) - if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) - subject = il->Name[loc_idx]; - - // text - std::string textFormat = plr->GetSession()->GetTrinityString(LANG_BG_MARK_BY_MAIL); - char textBuf[300]; - snprintf(textBuf, 300, textFormat.c_str(), GetName(), GetName()); - - MailDraft(subject, textBuf) - .AddItem(markItem) - .SendMailTo(plr, MailSender(MAIL_CREATURE, bmEntry)); - } -} - -void BattleGround::RewardQuestComplete(Player *plr) -{ - uint32 quest; - switch(GetTypeID()) - { - case BATTLEGROUND_AV: - quest = SPELL_AV_QUEST_REWARD; - break; - case BATTLEGROUND_WS: - quest = SPELL_WS_QUEST_REWARD; - break; - case BATTLEGROUND_AB: - quest = SPELL_AB_QUEST_REWARD; - break; - case BATTLEGROUND_EY: - quest = SPELL_EY_QUEST_REWARD; - break; - case BATTLEGROUND_SA: - quest = SPELL_SA_QUEST_REWARD; - break; - default: - return; - } - - RewardSpellCast(plr, quest); -} -*/ void BattleGround::BlockMovement(Player *plr) { plr->SetClientControl(plr, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave() |