Core/Gossip: Removed hardcoded costs for dual spec and fixed handling of gossip menus with box_money
This commit is contained in:
@@ -14141,6 +14141,14 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
|||||||
if (!menuItemData)
|
if (!menuItemData)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int32 cost = int32(item->BoxMoney);
|
||||||
|
if (!HasEnoughMoney(cost))
|
||||||
|
{
|
||||||
|
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
|
||||||
|
PlayerTalkClass->SendCloseGossip();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (gossipOptionId)
|
switch (gossipOptionId)
|
||||||
{
|
{
|
||||||
case GOSSIP_OPTION_GOSSIP:
|
case GOSSIP_OPTION_GOSSIP:
|
||||||
@@ -14187,16 +14195,6 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
|||||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||||
if (GetSpecsCount() == 1 && getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
|
if (GetSpecsCount() == 1 && getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
|
||||||
{
|
{
|
||||||
if (!HasEnoughMoney(10000000))
|
|
||||||
{
|
|
||||||
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
|
|
||||||
PlayerTalkClass->SendCloseGossip();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ModifyMoney(-10000000);
|
|
||||||
|
|
||||||
// Cast spells that teach dual spec
|
// Cast spells that teach dual spec
|
||||||
// Both are also ImplicitTarget self and must be cast by player
|
// Both are also ImplicitTarget self and must be cast by player
|
||||||
CastSpell(this, 63680, true, NULL, NULL, GetGUID());
|
CastSpell(this, 63680, true, NULL, NULL, GetGUID());
|
||||||
@@ -14205,7 +14203,6 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
|||||||
// Should show another Gossip text with "Congratulations..."
|
// Should show another Gossip text with "Congratulations..."
|
||||||
PlayerTalkClass->SendCloseGossip();
|
PlayerTalkClass->SendCloseGossip();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GOSSIP_OPTION_UNLEARNTALENTS:
|
case GOSSIP_OPTION_UNLEARNTALENTS:
|
||||||
PlayerTalkClass->SendCloseGossip();
|
PlayerTalkClass->SendCloseGossip();
|
||||||
@@ -14254,6 +14251,8 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModifyMoney(-cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Player::GetGossipTextId(WorldObject *pSource)
|
uint32 Player::GetGossipTextId(WorldObject *pSource)
|
||||||
|
|||||||
Reference in New Issue
Block a user