Prune some deadwood.
--HG-- branch : trunk
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -448,11 +448,6 @@ class BattleGround
|
||||
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
|
||||
void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
|
||||
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
|
||||
/*void RewardMark(Player *plr,uint32 count);
|
||||
void SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count);
|
||||
void RewardItem(Player *plr, uint32 item_id, uint32 count);
|
||||
void RewardQuestComplete(Player *plr);
|
||||
void RewardSpellCast(Player *plr, uint32 spell_id);*/
|
||||
void UpdateWorldState(uint32 Field, uint32 Value);
|
||||
void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source);
|
||||
void EndBattleGround(uint32 winner);
|
||||
|
||||
@@ -1667,7 +1667,6 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
ActionButton* addActionButton(uint8 button, uint32 action, uint8 type);
|
||||
void removeActionButton(uint8 button);
|
||||
uint32 GetActionButtonSpell(uint8 button) const;
|
||||
ActionButton const* GetActionButton(uint8 button);
|
||||
void SendInitialActionButtons() const { SendActionButtons(1); }
|
||||
void SendActionButtons(uint32 state) const;
|
||||
|
||||
@@ -1790,21 +1790,6 @@ void Spell::EffectDummy(uint32 i)
|
||||
case SPELLFAMILY_HUNTER:
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 781: // Disengage
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, 50);
|
||||
data.append(m_caster->GetPackGUID());
|
||||
data << getMSTime();
|
||||
data << float(cosf(m_caster->GetOrientation()+M_PI));
|
||||
data << float(sinf(m_caster->GetOrientation()+M_PI));
|
||||
data << float(15);
|
||||
data << float(-7.0f);
|
||||
m_caster->ToPlayer()->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
case 23989: // Readiness talent
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
|
||||
Reference in New Issue
Block a user