Now BG honor marks not reawrded in BG

* And related spells not create items.
* Update code for allow creat marks for single existed case: outfield bg
  that not yet implemented in mangos.
This commit is contained in:
VladimirMangos 2010-04-08 03:29:13 +04:00
parent 7f7d0624e8
commit b37933454d
3 changed files with 22 additions and 26 deletions

View file

@ -3172,20 +3172,12 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
}
// bg reward have some special in code work
uint32 bgType = 0;
bool bg_mark = false;
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;
case SPELL_WG_MARK_VICTORY:
case SPELL_WG_MARK_DEFEAT:
bg_mark = true;
break;
default:
break;
@ -3275,19 +3267,22 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
// send info to the client
if(pItem)
player->SendNewItem(pItem, num_to_add, true, bgType == 0);
player->SendNewItem(pItem, num_to_add, true, !bg_mark);
// we succeeded in creating at least one item, so a levelup is possible
if(bgType == 0)
if(!bg_mark)
player->UpdateCraftSkill(m_spellInfo->Id);
}
// for battleground marks send by mail if not add all expected
if(no_space > 0 && bgType)
// FIXME: single existed bg marks for outfield bg and we not have it..
/*
if(no_space > 0 && bg_mark)
{
if(BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(BattleGroundTypeId(bgType)))
bg->SendRewardMarkByMail(player, newitemid, no_space);
}
*/
}
void Spell::EffectCreateItem(SpellEffectIndex eff_idx)
@ -4579,7 +4574,7 @@ void Spell::EffectEnchantItemTmp(SpellEffectIndex eff_idx)
uint32 duration;
// rogue family enchantments exception by duration
if(m_spellInfo->Id == 38615) // Poison
if(m_spellInfo->Id == 38615)
duration = 1800; // 30 mins
// other rogue family enchantments always 1 hour (some have spell damage=0, but some have wrong data in EffBasePoints)
else if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
@ -4596,9 +4591,9 @@ void Spell::EffectEnchantItemTmp(SpellEffectIndex eff_idx)
// shaman rockbiter enchantments
else if(m_spellInfo->SpellVisual[0] == 0)
duration = 1800; // 30 mins
else if(m_spellInfo->Id == 29702) // Greater Ward of Shielding
else if(m_spellInfo->Id == 29702)
duration = 300; // 5 mins
else if(m_spellInfo->Id == 37360) // Consecrated Weapon
else if(m_spellInfo->Id == 37360)
duration = 300; // 5 mins
// default case
else