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)
|
||||
return;
|
||||
|
||||
int32 cost = int32(item->BoxMoney);
|
||||
if (!HasEnoughMoney(cost))
|
||||
{
|
||||
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
|
||||
PlayerTalkClass->SendCloseGossip();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (gossipOptionId)
|
||||
{
|
||||
case GOSSIP_OPTION_GOSSIP:
|
||||
@@ -14187,24 +14195,13 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
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
|
||||
// Both are also ImplicitTarget self and must be cast by player
|
||||
CastSpell(this, 63680, true, NULL, NULL, GetGUID());
|
||||
CastSpell(this, 63624, true, NULL, NULL, GetGUID());
|
||||
|
||||
// Cast spells that teach dual spec
|
||||
// Both are also ImplicitTarget self and must be cast by player
|
||||
CastSpell(this, 63680, true, NULL, NULL, GetGUID());
|
||||
CastSpell(this, 63624, true, NULL, NULL, GetGUID());
|
||||
|
||||
// Should show another Gossip text with "Congratulations..."
|
||||
PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
// Should show another Gossip text with "Congratulations..."
|
||||
PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
break;
|
||||
case GOSSIP_OPTION_UNLEARNTALENTS:
|
||||
@@ -14254,6 +14251,8 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ModifyMoney(-cost);
|
||||
}
|
||||
|
||||
uint32 Player::GetGossipTextId(WorldObject *pSource)
|
||||
@@ -19429,7 +19428,7 @@ void Player::VehicleSpellInitialize()
|
||||
/*if (v23 > 0)
|
||||
{
|
||||
for (uint32 i = 0; i < v23; ++i)
|
||||
data << uint32(v16); // Some spellid?
|
||||
data << uint32(v16); // Some spellid?
|
||||
}*/
|
||||
|
||||
// Cooldowns
|
||||
|
||||
Reference in New Issue
Block a user