Skip to content

Commit

Permalink
Renamed trapper functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchyDev committed Nov 23, 2023
1 parent 831d6ae commit a960d9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/TrialOfStrength.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ void ToSWorldScript::OnAfterConfigLoad(bool reload)
sToSMapMgr->CurseTemplates.clear();
}

if (!sConfigMgr->GetOption<bool>("TrialOfStrength.Enable", false))
{
return;
}

LoadWaveTemplates();
LoadEnemyGroups();
LoadRewardTemplates();
Expand Down
12 changes: 6 additions & 6 deletions src/scripts/AI/ToSAIMeleeTrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ToSAIMeleeTrapper : public CreatureScript
{
TOS_EVENT_COMBATANT_SPELL_ID_NET = 50762, // Net

TOS_EVENT_COMBATANT_SPELL_RANDOM = 1,
TOS_EVENT_COMBATANT_SPELL_NET = 1,
};

EventMap events;
Expand All @@ -33,7 +33,7 @@ class ToSAIMeleeTrapper : public CreatureScript
{
events.Reset();

events.ScheduleEvent(TOS_EVENT_COMBATANT_SPELL_RANDOM, 3s);
events.ScheduleEvent(TOS_EVENT_COMBATANT_SPELL_NET, 3s);
}

void UpdateAI(uint32 diff) override
Expand All @@ -45,15 +45,15 @@ class ToSAIMeleeTrapper : public CreatureScript

switch (events.ExecuteEvent())
{
case TOS_EVENT_COMBATANT_SPELL_RANDOM:
RandomAttack();
case TOS_EVENT_COMBATANT_SPELL_NET:
TrapTarget();
break;
}

DoMeleeAttackIfReady();
}

void RandomAttack()
void TrapTarget()
{
auto creature = me->GetVictim();
if (!creature)
Expand All @@ -63,7 +63,7 @@ class ToSAIMeleeTrapper : public CreatureScript

me->CastSpell(creature, TOS_EVENT_COMBATANT_SPELL_ID_NET);

events.ScheduleEvent(TOS_EVENT_COMBATANT_SPELL_RANDOM, 15s);
events.ScheduleEvent(TOS_EVENT_COMBATANT_SPELL_NET, 15s);
}
};
};
Expand Down

0 comments on commit a960d9f

Please sign in to comment.