diff options
| author | talamortis <talamortis@gmail.com> | 2017-07-03 18:13:33 +0100 |
|---|---|---|
| committer | talamortis <talamortis@gmail.com> | 2017-07-03 18:13:33 +0100 |
| commit | 49e61d99d3f2ec4825095fee8a4671aefa154920 (patch) | |
| tree | 15c23ed1edcfd9b074c4c04db8ae89a894e419bb | |
| parent | 4c9dd9197df6b2e68ac4b98aacab8f5ce75cd28d (diff) | |
Fix Midsummer fire quest An Innocent Disguise aswell as fixed indentation.
| -rw-r--r-- | data/sql/updates/pending_db_world/rev_1499101625045878500.sql | 10 | ||||
| -rw-r--r-- | src/game/AI/CoreAI/PetAI.cpp | 4 | ||||
| -rw-r--r-- | src/scripts/Events/midsummer.cpp | 55 |
3 files changed, 67 insertions, 2 deletions
diff --git a/data/sql/updates/pending_db_world/rev_1499101625045878500.sql b/data/sql/updates/pending_db_world/rev_1499101625045878500.sql new file mode 100644 index 0000000000..9221034017 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1499101625045878500.sql @@ -0,0 +1,10 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1499101625045878500'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (46337, 'spell_gen_crab_disguise'); +UPDATE `creature_template` SET `unit_class` = 8 WHERE `entry` = 25863; + +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(25863, 0, 0, 0, 4, 0, 100, 0, 1000, 1000, 1800000, 1800000, 11, 184, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - On Aggro - Cast \'Fire Shield\''), +(25863, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3400, 5400, 11, 20793, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - In Combat CMC - Cast \'Fireball\''), +(25863, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 25, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - Between 0-15% Health - Flee For Assist (No Repeat)'); + diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 712fb0c5f8..8e2516db73 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -100,8 +100,8 @@ void PetAI::UpdateAI(uint32 diff) Unit* owner = me->GetCharmerOrOwner(); //if Pet is in combat put player in combat - if (me->IsInCombat()) - owner->IsInCombat(); + if (me->IsInCombat()) + owner->IsInCombat(); if (m_updateAlliesTimer <= diff) // UpdateAllies self set update timer diff --git a/src/scripts/Events/midsummer.cpp b/src/scripts/Events/midsummer.cpp index 8fce374e70..00ae527c05 100644 --- a/src/scripts/Events/midsummer.cpp +++ b/src/scripts/Events/midsummer.cpp @@ -201,6 +201,60 @@ class npc_midsummer_torch_target : public CreatureScript // SPELLS /////////////////////////////// +enum CrabDisguise +{ + SPELL_CRAB_DISGUISE = 46337, + SPELL_APPLY_DIGUISE = 34804, + SPELL_FADE_DIGUISE = 47693, +}; + +class spell_gen_crab_disguise : public SpellScriptLoader +{ +public: + spell_gen_crab_disguise() : SpellScriptLoader("spell_gen_crab_disguise") { } + + class spell_gen_crab_disguise_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_crab_disguise_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CRAB_DISGUISE)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true); + caster->setFaction(88); + } + + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + caster->CastSpell(caster, SPELL_FADE_DIGUISE, true); + caster->RestoreFaction(); + } + } + + void Register() + { + AfterEffectApply += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_crab_disguise_AuraScript(); + } + enum RibbonPole { SPELL_RIBBON_POLE_CHANNEL_VISUAL = 29172, @@ -513,6 +567,7 @@ void AddSC_event_midsummer_scripts() new npc_midsummer_torch_target(); // Spells + new spell_gen_crab_disguise(); new spell_midsummer_ribbon_pole(); new spell_midsummer_torch_quest(); new spell_midsummer_fling_torch(); |
