aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-08-14 17:24:52 -0700
committermaximius <none@none>2009-08-14 17:24:52 -0700
commit2fd68eab44c1c0ea02d93ea1b5de47f0880f84ea (patch)
treef411b81aa63bcb7908746676a5461d8332aa63dd /src/game/Creature.cpp
parentc7aa2f64e3593f86ddf3ee5c13eb4ea4d8c1db2d (diff)
*Add Dual Spec support, original by EnderGT, thanks to Thyros and XTElite1 for helping me test :)
--HG-- branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 34d37556a88..fc83a03237a 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -914,6 +914,10 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
if(!isCanTrainingOf(pPlayer,false))
cantalking=false;
break;
+ case GOSSIP_OPTION_LEARNDUALSPEC:
+ if(!(pPlayer->GetSpecsCount() == 1 && isCanTrainingAndResetTalentsOf(pPlayer) && !(pPlayer->getLevel() < 40)))
+ cantalking=false;
+ break;
case GOSSIP_OPTION_UNLEARNTALENTS:
if(!isCanTrainingAndResetTalentsOf(pPlayer))
cantalking=false;
@@ -1061,6 +1065,29 @@ void Creature::OnGossipSelect(Player* player, uint32 option)
player->PlayerTalkClass->CloseGossip();
player->SendTalentWipeConfirm(guid);
break;
+ case GOSSIP_OPTION_LEARNDUALSPEC:
+ if(player->GetSpecsCount() == 1 && !(player->getLevel() < 40))
+ {
+ if (player->GetMoney() < 10000000)
+ {
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
+ player->PlayerTalkClass->CloseGossip();
+ break;
+ }
+ else
+ {
+ player->ModifyMoney(-10000000);
+
+ // Cast spells that teach dual spec
+ // Both are also ImplicitTarget self and must be cast by player
+ player->CastSpell(player,63680,true,NULL,NULL,player->GetGUID());
+ player->CastSpell(player,63624,true,NULL,NULL,player->GetGUID());
+
+ // Should show another Gossip text with "Congratulations..."
+ player->PlayerTalkClass->CloseGossip();
+ }
+ }
+ break;
case GOSSIP_OPTION_UNLEARNPETSKILLS:
player->PlayerTalkClass->CloseGossip();
player->SendPetSkillWipeConfirm();