Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM 12f3d84f5f1d2e9d5c82b9aa279eff88a263347c Mon Sep 17 00:00:00 2001
- FROM: UNKNOWN <cristi@cristis-PC.(NONE)>
- DATE: Sun, 15 Jul 2012 17:08:05 +0300
- Subject: [PATCH] Fix quest Cannot Reproduce
- ---
- src/server/scripts/Northrend/icecrown.cpp | 79 +++++++++++++++++++++++++++++
- 1 file changed, 79 insertions(+)
- diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
- INDEX 8b43cf5..5eb684f 100644
- --- a/src/server/scripts/Northrend/icecrown.cpp
- +++ b/src/server/scripts/Northrend/icecrown.cpp
- @@ -561,6 +561,84 @@ public:
- }
- };
- +/*###########
- +### Support for quest Collect a sample
- +#################*/
- +
- +enum CollectASampleData
- +{
- + SPELL_COLLECT_A_SAMPLE = 60256,
- + NPC_DARK_SAMPLE_BUNNY = 32245,
- + NPC_BLUE_SAMPLE_BUNNY = 32242,
- + NPC_GREEN_SAMPLE_BUNNY = 32244,
- + ZONE_THE_DESOLATION_GATE = 4510,
- + GO_CULTIST_CAULDRON = 300240
- +};
- +
- +
- +class spell_collect_a_sample : public SpellScriptLoader
- +{
- +public:
- + spell_collect_a_sample() : SpellScriptLoader("spell_collect_a_sample") {}
- +
- + class spell_collect_a_sample_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_collect_a_sample_SpellScript)
- +
- + bool Validate(SpellInfo const * /*spellInfo*/)
- + {
- + IF (!sSpellMgr->GetSpellInfo(SPELL_COLLECT_A_SAMPLE))
- + RETURN FALSE;
- + RETURN TRUE;
- + }
- +
- + SpellCastResult CheckIfInZone()
- + {
- + Unit* caster = GetCaster();
- +
- + IF(caster->GetAreaId()==ZONE_THE_DESOLATION_GATE)
- + RETURN SPELL_CAST_OK;
- + ELSE
- + RETURN SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
- + }
- +
- + void HandleDummy(SpellEffIndex /*effIndex*/)
- + {
- + IF (Unit* caster = GetCaster())
- + IF (Player* player = caster->ToPlayer())
- + {
- + std::list<Creature*> Cauldrons_Bunny;
- +
- + GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_BLUE_SAMPLE_BUNNY,7.0f);
- + IF(Cauldrons_Bunny.SIZE() > 0)
- + player->KilledMonsterCredit(NPC_BLUE_SAMPLE_BUNNY,0);
- + ELSE
- + {
- + GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_GREEN_SAMPLE_BUNNY,7.0f);
- + IF(Cauldrons_Bunny.SIZE() > 0)
- + player->KilledMonsterCredit(NPC_GREEN_SAMPLE_BUNNY,0);
- + ELSE
- + {
- + GetCreatureListWithEntryInGrid(Cauldrons_Bunny,player,NPC_DARK_SAMPLE_BUNNY,7.0f);
- + IF(Cauldrons_Bunny.SIZE() > 0)
- + player->KilledMonsterCredit(NPC_DARK_SAMPLE_BUNNY,0);
- + }
- + }
- + }
- + }
- + void Register()
- + {
- + OnCheckCast += SpellCheckCastFn(spell_collect_a_sample_SpellScript::CheckIfInZone);
- + OnEffectHit += SpellEffectFn(spell_collect_a_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- + }
- + };
- +
- + SpellScript* GetSpellScript() const
- + {
- + RETURN NEW spell_collect_a_sample_SpellScript();
- + }
- +};
- +
- void AddSC_icecrown()
- {
- NEW npc_arete;
- @@ -570,4 +648,5 @@ void AddSC_icecrown()
- NEW npc_vereth_the_cunning;
- NEW npc_tournament_training_dummy;
- NEW spell_construct_barricade;
- + NEW spell_collect_a_sample;
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment