mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8344] In case battleground reward items player must "receive" instead "create" item in message.
This commit is contained in:
parent
93ed08e886
commit
7caf5b5b2f
4 changed files with 28 additions and 26 deletions
|
|
@ -855,7 +855,7 @@ void BattleGround::RewardItem(Player *plr, uint32 item_id, uint32 count)
|
||||||
|
|
||||||
if( count != 0 && !dest.empty()) // can add some
|
if( count != 0 && !dest.empty()) // can add some
|
||||||
if (Item* item = plr->StoreNewItem( dest, item_id, true, 0))
|
if (Item* item = plr->StoreNewItem( dest, item_id, true, 0))
|
||||||
plr->SendNewItem(item,count,false,true);
|
plr->SendNewItem(item,count,true,false);
|
||||||
|
|
||||||
if (no_space_count > 0)
|
if (no_space_count > 0)
|
||||||
SendRewardMarkByMail(plr,item_id,no_space_count);
|
SendRewardMarkByMail(plr,item_id,no_space_count);
|
||||||
|
|
|
||||||
|
|
@ -2690,6 +2690,26 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bg reward have some special in code work
|
||||||
|
uint32 bgType = 0;
|
||||||
|
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:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 num_to_add;
|
uint32 num_to_add;
|
||||||
|
|
||||||
// TODO: maybe all this can be replaced by using correct calculated `damage` value
|
// TODO: maybe all this can be replaced by using correct calculated `damage` value
|
||||||
|
|
@ -2770,35 +2790,17 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
|
||||||
|
|
||||||
// send info to the client
|
// send info to the client
|
||||||
if(pItem)
|
if(pItem)
|
||||||
player->SendNewItem(pItem, num_to_add, true, true);
|
player->SendNewItem(pItem, num_to_add, true, bgType == 0);
|
||||||
|
|
||||||
// we succeeded in creating at least one item, so a levelup is possible
|
// we succeeded in creating at least one item, so a levelup is possible
|
||||||
player->UpdateCraftSkill(m_spellInfo->Id);
|
if(bgType == 0)
|
||||||
|
player->UpdateCraftSkill(m_spellInfo->Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for battleground marks send by mail if not add all expected
|
// for battleground marks send by mail if not add all expected
|
||||||
if(no_space > 0 )
|
if(no_space > 0 && bgType)
|
||||||
{
|
{
|
||||||
BattleGroundTypeId bgType;
|
if(BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(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);
|
bg->SendRewardMarkByMail(player, newitemid, no_space);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,6 @@ enum LoginResult
|
||||||
|
|
||||||
// At update excepted builds please update if need define DEFAULT_MAX_LEVEL
|
// At update excepted builds please update if need define DEFAULT_MAX_LEVEL
|
||||||
// in DBCEnum.h to default max player level expected by build
|
// in DBCEnum.h to default max player level expected by build
|
||||||
// and alos in mangosd.conf.in
|
// and also in mangosd.conf.in
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8343"
|
#define REVISION_NR "8344"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue