casucristy

ghwerw

Jul 15th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 3.22 KB | None | 0 0
  1. FROM 12f3d84f5f1d2e9d5c82b9aa279eff88a263347c Mon Sep 17 00:00:00 2001
  2. FROM: UNKNOWN <cristi@cristis-PC.(NONE)>
  3. DATE: Sun, 15 Jul 2012 17:08:05 +0300
  4. Subject: [PATCH] Fix quest Cannot Reproduce
  5.  
  6. ---
  7.  src/server/scripts/Northrend/icecrown.cpp |   79 +++++++++++++++++++++++++++++
  8.  1 file changed, 79 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
  11. INDEX 8b43cf5..5eb684f 100644
  12. --- a/src/server/scripts/Northrend/icecrown.cpp
  13. +++ b/src/server/scripts/Northrend/icecrown.cpp
  14. @@ -561,6 +561,84 @@ public:
  15.      }
  16.  };
  17.  
  18. +/*###########
  19. +### Support for quest Collect a sample
  20. +#################*/
  21. +
  22. +enum CollectASampleData
  23. +{
  24. +    SPELL_COLLECT_A_SAMPLE     =   60256,
  25. +   NPC_DARK_SAMPLE_BUNNY       =   32245,
  26. +   NPC_BLUE_SAMPLE_BUNNY       =   32242,
  27. +   NPC_GREEN_SAMPLE_BUNNY      =   32244,
  28. +   ZONE_THE_DESOLATION_GATE    =   4510,
  29. +   GO_CULTIST_CAULDRON         =   300240
  30. +};
  31. +
  32. +
  33. +class spell_collect_a_sample : public SpellScriptLoader
  34. +{
  35. +public:
  36. +    spell_collect_a_sample() : SpellScriptLoader("spell_collect_a_sample") {}
  37. +
  38. +    class spell_collect_a_sample_SpellScript : public SpellScript
  39. +    {
  40. +        PrepareSpellScript(spell_collect_a_sample_SpellScript)
  41. +
  42. +        bool Validate(SpellInfo const * /*spellInfo*/)
  43. +        {
  44. +            IF (!sSpellMgr->GetSpellInfo(SPELL_COLLECT_A_SAMPLE))
  45. +                RETURN FALSE;
  46. +            RETURN TRUE;
  47. +        }
  48. +      
  49. +       SpellCastResult CheckIfInZone()
  50. +        {
  51. +            Unit* caster = GetCaster();
  52. +
  53. +           IF(caster->GetAreaId()==ZONE_THE_DESOLATION_GATE)
  54. +               RETURN SPELL_CAST_OK;
  55. +            ELSE
  56. +                RETURN SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
  57. +        }
  58. +
  59. +        void HandleDummy(SpellEffIndex /*effIndex*/)
  60. +        {
  61. +            IF (Unit* caster = GetCaster())
  62. +                IF (Player* player = caster->ToPlayer())
  63. +                {
  64. +                   std::list<Creature*> Cauldrons_Bunny;
  65. +
  66. +                   GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_BLUE_SAMPLE_BUNNY,7.0f);
  67. +                   IF(Cauldrons_Bunny.SIZE() > 0)
  68. +                       player->KilledMonsterCredit(NPC_BLUE_SAMPLE_BUNNY,0);
  69. +                   ELSE
  70. +                   {
  71. +                       GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_GREEN_SAMPLE_BUNNY,7.0f);
  72. +                       IF(Cauldrons_Bunny.SIZE() > 0)
  73. +                           player->KilledMonsterCredit(NPC_GREEN_SAMPLE_BUNNY,0);
  74. +                       ELSE
  75. +                       {
  76. +                           GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_DARK_SAMPLE_BUNNY,7.0f);
  77. +                           IF(Cauldrons_Bunny.SIZE() > 0)
  78. +                               player->KilledMonsterCredit(NPC_DARK_SAMPLE_BUNNY,0);
  79. +                       }
  80. +                   }
  81. +                }
  82. +        }
  83. +        void Register()
  84. +        {
  85. +           OnCheckCast += SpellCheckCastFn(spell_collect_a_sample_SpellScript::CheckIfInZone);
  86. +            OnEffectHit += SpellEffectFn(spell_collect_a_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
  87. +        }
  88. +    };
  89. +
  90. +    SpellScript* GetSpellScript() const
  91. +    {
  92. +        RETURN NEW spell_collect_a_sample_SpellScript();
  93. +    }
  94. +};
  95. +
  96.  void AddSC_icecrown()
  97.  {
  98.      NEW npc_arete;
  99. @@ -570,4 +648,5 @@ void AddSC_icecrown()
  100.      NEW npc_vereth_the_cunning;
  101.      NEW npc_tournament_training_dummy;
  102.     NEW spell_construct_barricade;
  103. +   NEW spell_collect_a_sample;
  104.  }
  105. --
  106. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment