fix(Scripts/Spell): Improve Inoculation quest (#15759)
* fix(Core/Quest): Improve Inoculation * update fix * . * ..
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_inoculate_nestlewood_owlkin';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||||
|
(29528, 'spell_inoculate_nestlewood_owlkin');
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 16518;
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16518);
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1651800) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3, 4, 5, 6, 7, 8));
|
||||||
@@ -39,6 +39,8 @@ EndContentData */
|
|||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
#include "ScriptedEscortAI.h"
|
#include "ScriptedEscortAI.h"
|
||||||
#include "ScriptedGossip.h"
|
#include "ScriptedGossip.h"
|
||||||
|
#include "SpellAuras.h"
|
||||||
|
#include "SpellScript.h"
|
||||||
|
|
||||||
/*######
|
/*######
|
||||||
## npc_draenei_survivor
|
## npc_draenei_survivor
|
||||||
@@ -522,6 +524,55 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum NestlewoodOwlkin
|
||||||
|
{
|
||||||
|
NPC_NESTLEWOOD_OWLKIN_ENTRY = 16518,
|
||||||
|
NPC_INOCULATED_OWLKIN_ENTRY = 16534,
|
||||||
|
|
||||||
|
TALK_OWLKIN = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
class spell_inoculate_nestlewood_owlkin : public AuraScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PrepareAuraScript(spell_inoculate_nestlewood_owlkin)
|
||||||
|
|
||||||
|
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
|
{
|
||||||
|
if (Creature* owlkin = GetTarget()->ToCreature())
|
||||||
|
if (owlkin->GetEntry() == NPC_NESTLEWOOD_OWLKIN_ENTRY)
|
||||||
|
owlkin->SetFacingToObject(GetCaster());
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
|
{
|
||||||
|
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Creature* owlkin = GetTarget()->ToCreature())
|
||||||
|
{
|
||||||
|
if (owlkin->GetEntry() == NPC_NESTLEWOOD_OWLKIN_ENTRY)
|
||||||
|
{
|
||||||
|
Player* caster = GetCaster()->ToPlayer();
|
||||||
|
if (owlkin->UpdateEntry(NPC_INOCULATED_OWLKIN_ENTRY))
|
||||||
|
{
|
||||||
|
owlkin->AI()->Talk(TALK_OWLKIN);
|
||||||
|
owlkin->GetMotionMaster()->MoveRandom(15.0f);
|
||||||
|
owlkin->SetUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC));
|
||||||
|
owlkin->DespawnOrUnsummon(15s, 0s);
|
||||||
|
caster->RewardPlayerAndGroupAtEvent(NPC_INOCULATED_OWLKIN_ENTRY, caster);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectApply += AuraEffectApplyFn(spell_inoculate_nestlewood_owlkin::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||||
|
AfterEffectRemove += AuraEffectRemoveFn(spell_inoculate_nestlewood_owlkin::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_azuremyst_isle()
|
void AddSC_azuremyst_isle()
|
||||||
{
|
{
|
||||||
new npc_draenei_survivor();
|
new npc_draenei_survivor();
|
||||||
@@ -531,4 +582,5 @@ void AddSC_azuremyst_isle()
|
|||||||
new go_ravager_cage();
|
new go_ravager_cage();
|
||||||
new npc_stillpine_capitive();
|
new npc_stillpine_capitive();
|
||||||
new go_bristlelimb_cage();
|
new go_bristlelimb_cage();
|
||||||
|
RegisterSpellScript(spell_inoculate_nestlewood_owlkin);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user