diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-29 20:55:20 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-29 20:55:20 +0200 |
| commit | 738a781468e73041104e1dc23d5401689b9b6d53 (patch) | |
| tree | 620a0fc47d3a096bd97489c3ffed353482ed7ce8 /src/server/scripts | |
| parent | 316663807862ad2a4a24edbe8c2e508715d02cdc (diff) | |
| parent | 3b71172e8a0fdda1da9e64f880cb184a7b617e93 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Quests/QuestDef.cpp
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_quest.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 161 |
2 files changed, 162 insertions, 6 deletions
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 6b7d10ff7b1..12912f68bd5 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -207,12 +207,7 @@ public: int32 creature = quest->RequiredNpcOrGo[i]; uint32 creaturecount = quest->RequiredNpcOrGoCount[i]; - if (uint32 spell_id = quest->RequiredSpellCast[i]) - { - for (uint16 z = 0; z < creaturecount; ++z) - player->CastedCreatureOrGO(creature, 0, spell_id); - } - else if (creature > 0) + if (creature > 0) { if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature)) for (uint16 z = 0; z < creaturecount; ++z) diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index ca94f871d03..2a23d6d8135 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1876,6 +1876,164 @@ class spell_q13086_cannons_target : public SpellScriptLoader } }; +enum BurstAtTheSeams +{ + NPC_DRAKKARI_CHIEFTAINK = 29099, + + QUEST_BURST_AT_THE_SEAMS = 12690, + + SPELL_BURST_AT_THE_SEAMS = 52510, // Burst at the Seams + SPELL_BURST_AT_THE_SEAMS_DMG = 52508, // Damage spell + SPELL_BURST_AT_THE_SEAMS_DMG_2 = 59580, // Abomination self damage spell + SPELL_BURST_AT_THE_SEAMS_BONE = 52516, // Burst at the Seams:Bone + SPELL_BURST_AT_THE_SEAMS_MEAT = 52520, // Explode Abomination:Meat + SPELL_BURST_AT_THE_SEAMS_BMEAT = 52523, // Explode Abomination:Bloody Meat + SPELL_DRAKKARI_SKULLCRUSHER_CREDIT = 52590, // Credit for Drakkari Skullcrusher + SPELL_SUMMON_DRAKKARI_CHIEFTAIN = 52616, // Summon Drakkari Chieftain + SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT = 52620 // Drakkari Chieftain Kill Credit +}; + +class spell_q12690_burst_at_the_seams : public SpellScriptLoader +{ + public: + spell_q12690_burst_at_the_seams() : SpellScriptLoader("spell_q12690_burst_at_the_seams") { } + + class spell_q12690_burst_at_the_seams_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12690_burst_at_the_seams_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS) + || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG) + || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG_2) + || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BONE) + || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_MEAT) + || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BMEAT)) + return false; + return true; + } + + bool Load() OVERRIDE + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } + + void HandleKnockBack(SpellEffIndex /*effIndex*/) + { + if (Unit* creature = GetHitCreature()) + { + if (Unit* charmer = GetCaster()->GetCharmerOrOwner()) + { + if (Player* player = charmer->ToPlayer()) + { + if (player->GetQuestStatus(QUEST_BURST_AT_THE_SEAMS) == QUEST_STATUS_INCOMPLETE) + { + creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true); + creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_MEAT, true); + creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BMEAT, true); + creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG, true); + creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG_2, true); + + player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true); + uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_BURST_AT_THE_SEAMS, NPC_DRAKKARI_CHIEFTAINK); + if ((count % 20) == 0) + player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true); + } + } + } + } + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK); + OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12690_burst_at_the_seams_SpellScript(); + } +}; + +enum EscapeFromSilverbrook +{ + SPELL_SUMMON_WORGEN = 48681 +}; + +// 48682 - Escape from Silverbrook - Periodic Dummy +class spell_q12308_escape_from_silverbrook : public SpellScriptLoader +{ + public: + spell_q12308_escape_from_silverbrook() : SpellScriptLoader("spell_q12308_escape_from_silverbrook") { } + + class spell_q12308_escape_from_silverbrook_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12308_escape_from_silverbrook_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_WORGEN)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WORGEN, true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12308_escape_from_silverbrook_SpellScript(); + } +}; + +// 48681 - Summon Silverbrook Worgen +class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoader +{ + public: + spell_q12308_escape_from_silverbrook_summon_worgen() : SpellScriptLoader("spell_q12308_escape_from_silverbrook_summon_worgen") { } + + class spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript); + + void ModDest(SpellEffIndex effIndex) + { + float dist = GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()); + float angle = (urand(0, 1) ? -1 : 1) * (frand(0.75f, 1.0f) * M_PI); + + Position pos; + GetCaster()->GetNearPosition(pos, dist, angle); + GetHitDest()->Relocate(&pos); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, SPELL_EFFECT_SUMMON); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1922,4 +2080,7 @@ void AddSC_quest_spell_scripts() new spell_q12847_summon_soul_moveto_bunny(); new spell_q13011_bear_flank_master(); new spell_q13086_cannons_target(); + new spell_q12690_burst_at_the_seams(); + new spell_q12308_escape_from_silverbrook_summon_worgen(); + new spell_q12308_escape_from_silverbrook(); } |
