*Send directly the battleground marks instead of spells - by balrok

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2009-03-07 08:41:31 +01:00
parent 786fa59163
commit 1013a80da3
3 changed files with 14 additions and 56 deletions
+10 -23
View File
@@ -621,42 +621,29 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
return;
BattleGroundMarks mark;
bool IsSpell;
if(!plr || !count)
return;
BattleGroundMarks mark;
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;
case BATTLEGROUND_EY:
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);
+3 -6
View File
@@ -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
};
+1 -27
View File
@@ -2627,33 +2627,7 @@ 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)