*Send directly the battleground marks instead of spells - by balrok
--HG-- branch : trunk
This commit is contained in:
@@ -621,42 +621,29 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||
if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
|
||||
return;
|
||||
|
||||
if(!plr || !count)
|
||||
return;
|
||||
|
||||
BattleGroundMarks mark;
|
||||
bool IsSpell;
|
||||
switch(GetTypeID())
|
||||
{
|
||||
case BATTLEGROUND_AV:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AV_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_AV_MARK_LOSER;
|
||||
mark = ITEM_AV_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_WS:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_WS_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_WS_MARK_LOSER;
|
||||
mark = ITEM_WS_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_AB:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AB_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_AB_MARK_LOSER;
|
||||
mark = ITEM_AB_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_EY:
|
||||
IsSpell = false;
|
||||
mark = ITEM_EY_MARK_OF_HONOR;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if(IsSpell)
|
||||
plr->CastSpell(plr, mark, true);
|
||||
else if ( objmgr.GetItemPrototype( mark ) )
|
||||
if ( objmgr.GetItemPrototype( mark ) )
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 no_space_count = 0;
|
||||
@@ -664,7 +651,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||
if( msg != EQUIP_ERR_OK ) // convert to possible store amount
|
||||
count -= no_space_count;
|
||||
|
||||
if( count != 0 && !dest.empty()) // can add some
|
||||
if(!dest.empty()) // can add some
|
||||
if(Item* item = plr->StoreNewItem( dest, mark, true, 0))
|
||||
plr->SendNewItem(item,count,false,true);
|
||||
|
||||
|
||||
@@ -50,12 +50,9 @@ enum BattleGroundQuests
|
||||
|
||||
enum BattleGroundMarks
|
||||
{
|
||||
SPELL_WS_MARK_LOSER = 24950,
|
||||
SPELL_WS_MARK_WINNER = 24951,
|
||||
SPELL_AB_MARK_LOSER = 24952,
|
||||
SPELL_AB_MARK_WINNER = 24953,
|
||||
SPELL_AV_MARK_LOSER = 24954,
|
||||
SPELL_AV_MARK_WINNER = 24955,
|
||||
ITEM_AV_MARK_OF_HONOR = 20560,
|
||||
ITEM_WS_MARK_OF_HONOR = 20558,
|
||||
ITEM_AB_MARK_OF_HONOR = 20559,
|
||||
ITEM_EY_MARK_OF_HONOR = 29024
|
||||
};
|
||||
|
||||
|
||||
@@ -2628,32 +2628,6 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
|
||||
// we succeeded in creating at least one item, so a levelup is possible
|
||||
player->UpdateCraftSkill(m_spellInfo->Id);
|
||||
}
|
||||
|
||||
// for battleground marks send by mail if not add all expected
|
||||
if(no_space > 0 )
|
||||
{
|
||||
BattleGroundTypeId bgType;
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case SPELL_AV_MARK_WINNER:
|
||||
case SPELL_AV_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_AV;
|
||||
break;
|
||||
case SPELL_WS_MARK_WINNER:
|
||||
case SPELL_WS_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_WS;
|
||||
break;
|
||||
case SPELL_AB_MARK_WINNER:
|
||||
case SPELL_AB_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_AB;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if(BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgType))
|
||||
bg->SendRewardMarkByMail(player,newitemid,no_space);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectCreateItem(uint32 i)
|
||||
|
||||
Reference in New Issue
Block a user