casucristy

hwsada

Jul 15th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.14 KB | None | 0 0
  1. From 4a6538a663591b1a3bc0cb7d7b56e64651f9ec76 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Mon, 16 Jul 2012 04:21:49 +0300
  4. Subject: [PATCH] Fix for quest Walking the Dog
  5.  
  6. ---
  7.  src/server/scripts/Spells/spell_generic.cpp |   78 +++++++++++++++++++++++++++
  8.  1 file changed, 78 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
  11. index 7698b15..5ebea1f 100644
  12. --- a/src/server/scripts/Spells/spell_generic.cpp
  13. +++ b/src/server/scripts/Spells/spell_generic.cpp
  14. @@ -2109,6 +2109,8 @@ public:
  15.      }
  16.  };
  17.  
  18. +
  19. +
  20.  enum TournamentPennantSpells
  21.  {
  22.      SPELL_PENNANT_STORMWIND_ASPIRANT      = 62595,
  23. @@ -2395,6 +2397,81 @@ public:
  24.      }
  25.  };
  26.  
  27. +/*####
  28. +###    Spell Feed Spawn Of Smolderos
  29. +### @Support for quest 25294
  30. +#######*/
  31. +
  32. +enum eWalkingTheDogEntries
  33. +{
  34. +    SPELL_FEED_SPAWN_OF_SMOLDEROS  =   74142,
  35. +   NPC_SMOLDEROS                   =   39659,
  36. +   QUEST_WALKING_THE_DOG           =   25294,
  37. +   ZONE_DARKWHISPER_GORGE          =   4991,
  38. +   QUEST_CREDIT                    =   39673
  39. +
  40. +};
  41. +
  42. +
  43. +class spell_feed_spawn_of_smolderos : public SpellScriptLoader
  44. +{
  45. +public:
  46. +    spell_feed_spawn_of_smolderos() : SpellScriptLoader("spell_feed_spawn_of_smolderos") {}
  47. +
  48. +    class spell_feed_spawn_of_smolderos_SpellScript : public SpellScript
  49. +    {
  50. +        PrepareSpellScript(spell_feed_spawn_of_smolderos_SpellScript)
  51. +
  52. +        bool Validate(SpellInfo const * /*spellInfo*/)
  53. +        {
  54. +            if (!sSpellMgr->GetSpellInfo(SPELL_FEED_SPAWN_OF_SMOLDEROS))
  55. +                return false;
  56. +            return true;
  57. +        }
  58. +
  59. +       SpellCastResult CheckIfInZone()
  60. +        {
  61. +            Unit* caster = GetCaster();
  62. +
  63. +           if(caster && caster->GetAreaId()==ZONE_DARKWHISPER_GORGE && SearchForSmolderos(caster))
  64. +               return SPELL_CAST_OK;
  65. +           else
  66. +               return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
  67. +        }
  68. +
  69. +        void HandleDummy(SpellEffIndex /*effIndex*/)
  70. +        {
  71. +            if (Unit* caster = GetCaster())
  72. +                if (Player* player = caster->ToPlayer())
  73. +                {
  74. +                    player->KilledMonsterCredit(QUEST_CREDIT, 0);
  75. +                }
  76. +        }
  77. +
  78. +       bool SearchForSmolderos(Unit* caster)
  79. +       {
  80. +           std::list<Creature*> lSmolderos;
  81. +           caster->GetCreatureListWithEntryInGrid(lSmolderos,NPC_SMOLDEROS,10.0f);
  82. +
  83. +           if(lSmolderos.size()>0)
  84. +               return true;
  85. +           else
  86. +               return false;
  87. +       }
  88. +
  89. +        void Register()
  90. +        {
  91. +           OnCheckCast += SpellCheckCastFn(spell_feed_spawn_of_smolderos_SpellScript::CheckIfInZone);
  92. +            OnEffectHit += SpellEffectFn(spell_feed_spawn_of_smolderos_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
  93. +        }
  94. +    };
  95. +
  96. +    SpellScript* GetSpellScript() const
  97. +    {
  98. +        return new spell_feed_spawn_of_smolderos_SpellScript();
  99. +    }
  100. +};
  101. +
  102.  void AddSC_generic_spell_scripts()
  103.  {
  104.      new spell_gen_absorb0_hitlimit1();
  105. @@ -2439,4 +2516,5 @@ void AddSC_generic_spell_scripts()
  106.      new spell_gen_summon_tournament_mount();
  107.      new spell_gen_on_tournament_mount();
  108.      new spell_gen_tournament_pennant();
  109. +   new spell_feed_spawn_of_smolderos();
  110.  }
  111. --
  112. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment