Skip to content

Commit

Permalink
UnitAI: Fix Wandering Eye of Kilrogg
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Jan 1, 2025
1 parent dc20d1f commit a619547
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(20038,'spell_explosion_razorgore'),
(21651,'spell_opening_capping'),
(22858,'spell_retaliation_creature'),
(22876,'spell_summon_netherwalker'),
(23134,'spell_goblin_bomb'),
(23226,'spell_ritual_candle_aura'),
(24228,'spell_arlokk_vanish'),
Expand Down
4 changes: 0 additions & 4 deletions src/game/AI/BaseAI/UnitAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,6 @@ void UnitAI::TimedFleeingEnded()

bool UnitAI::DoFlee(uint32 duration)
{
Unit* victim = m_unit->GetVictim();
if (!victim)
return false;

if (!duration)
duration = sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY);

Expand Down
3 changes: 2 additions & 1 deletion src/game/AI/EventAI/CreatureEventAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,6 @@ void CreatureEventAI::OnSpellCast(SpellEntry const* spellInfo, Unit* target)

void CreatureEventAI::EnterCombat(Unit* enemy)
{
CreatureAI::EnterCombat(enemy);
// Check for on combat start events
IncreaseDepthIfNecessary();
for (auto& i : m_CreatureEventAIList)
Expand Down Expand Up @@ -1658,6 +1657,8 @@ void CreatureEventAI::EnterCombat(Unit* enemy)
}
ProcessEvents(enemy);

CreatureAI::EnterCombat(enemy);

m_EventUpdateTime = EVENT_UPDATE_TIME;
m_EventDiff = 0;
}
Expand Down
13 changes: 13 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ struct RitualCandleAura : public SpellScript
}
};

// 22876 - Summon Netherwalker
struct SummonNetherWalker : public SpellScript
{
void OnSuccessfulFinish(Spell* spell) const override
{
Creature* caster = static_cast<Creature*>(spell->GetAffectiveCaster());
if (!caster || !caster->IsAlive() || !caster->IsCreature())
return;
caster->ForcedDespawn();
}
};

void AddSC_dire_maul()
{
Script* pNewScript = new Script;
Expand All @@ -326,4 +338,5 @@ void AddSC_dire_maul()
pNewScript->RegisterSelf();

RegisterSpellScript<RitualCandleAura>("spell_ritual_candle_aura");
RegisterSpellScript<SummonNetherWalker>("spell_summon_netherwalker");
}

0 comments on commit a619547

Please sign in to comment.