Advertisement
Guest User

Untitled

a guest
Jan 4th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. From eea7ba33d1823b922611085c4d237756cbc47c87 Mon Sep 17 00:00:00 2001
  2. From: elecyb <elecyb@hotmail.com>
  3. Date: Mon, 12 Aug 2013 17:36:56 -0300
  4. Subject: [PATCH 006/402] (wa0003) Drop deprecated code and fix bug where a
  5. player can have more than one profession specialization.
  6.  
  7. Signed-off-by: elecyb <elecyb@hotmail.com>
  8. ---
  9. src/server/game/Entities/Player/Player.cpp | 38 ++++--------------------------
  10. 1 file changed, 4 insertions(+), 34 deletions(-)
  11.  
  12. diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
  13. index ca7c1ed..dc1ee3b 100644
  14. --- a/src/server/game/Entities/Player/Player.cpp
  15. +++ b/src/server/game/Entities/Player/Player.cpp
  16. @@ -22902,46 +22902,16 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
  17. if (!found)
  18. return;
  19.  
  20. - // prevent learn non first rank unknown profession and second specialization for same profession)
  21. uint32 learned_0 = spellInfo->Effects[0].TriggerSpell;
  22. - if (sSpellMgr->GetSpellRank(learned_0) > 1 && !HasSpell(learned_0))
  23. + if (!HasSpell(learned_0))
  24. {
  25. SpellInfo const* learnedInfo = sSpellMgr->GetSpellInfo(learned_0);
  26. if (!learnedInfo)
  27. return;
  28.  
  29. - // not have first rank learned (unlearned prof?)
  30. - if (!HasSpell(learnedInfo->GetFirstRankSpell()->Id))
  31. - return;
  32. -
  33. - SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(learned_0);
  34. - for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second; ++itr2)
  35. - {
  36. - uint32 profSpell = itr2->second;
  37. -
  38. - // specialization
  39. - if (learnedInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effects[1].Effect == 0 && profSpell)
  40. - {
  41. - // search other specialization for same prof
  42. - for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
  43. - {
  44. - if (itr->second->state == PLAYERSPELL_REMOVED || itr->first == learned_0)
  45. - continue;
  46. -
  47. - SpellInfo const* itrInfo = sSpellMgr->GetSpellInfo(itr->first);
  48. - if (!itrInfo)
  49. - return;
  50. -
  51. - // compare only specializations
  52. - if (itrInfo->Effects[0].Effect != SPELL_EFFECT_TRADE_SKILL || itrInfo->Effects[1].Effect != 0)
  53. - continue;
  54. -
  55. - // compare same chain spells
  56. - if (sSpellMgr->IsSpellRequiringSpell(itr->first, profSpell))
  57. - return;
  58. - }
  59. - }
  60. - }
  61. + // profession specialization can be re-learned from npc
  62. + if (learnedInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effects[1].Effect == 0 && !learnedInfo->SpellLevel)
  63. + return;
  64. }
  65.  
  66. CastSpell(this, spell_id, true);
  67. --
  68. 1.8.3.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement