Scripts/ZG: Update scripts to new register model (5/5) (#26695)

(cherry picked from commit 7f853ea735)
This commit is contained in:
offl
2021-07-14 22:24:36 +03:00
committed by Shauren
parent 1dd989a8d6
commit 94ff33894d
2 changed files with 76 additions and 98 deletions

View File

@@ -39,72 +39,61 @@ enum Events
{
};
class boss_venoxis : public CreatureScript
struct boss_venoxis : public BossAI
{
public:
boss_venoxis() : CreatureScript("boss_venoxis") { }
boss_venoxis(Creature* creature) : BossAI(creature, DATA_VENOXIS) { }
struct boss_venoxisAI : public BossAI
void Reset() override
{
_Reset();
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_DEATH);
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
}
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_PLAYER_KILL);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
/*
while (uint32 eventId = events.ExecuteEvent())
{
boss_venoxisAI(Creature* creature) : BossAI(creature, DATA_VENOXIS) { }
void Reset() override
switch (eventId)
{
_Reset();
default:
break;
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_DEATH);
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
}
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_PLAYER_KILL);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
/*
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
*/
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetZulGurubAI<boss_venoxisAI>(creature);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
*/
DoMeleeAttackIfReady();
}
};
void AddSC_boss_venoxis()
{
new boss_venoxis();
RegisterZulGurubCreatureAI(boss_venoxis);
}

View File

@@ -31,56 +31,45 @@ enum Events
{
};
class boss_wushoolay : public CreatureScript
struct boss_wushoolay : public BossAI
{
public:
boss_wushoolay() : CreatureScript("boss_wushoolay") { }
boss_wushoolay(Creature* creature) : BossAI(creature, DATA_HAZZARAH)
{
}
struct boss_wushoolayAI : public BossAI
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
/*
while (uint32 eventId = events.ExecuteEvent())
{
boss_wushoolayAI(Creature* creature) : BossAI(creature, DATA_HAZZARAH)
switch (eventId)
{
default:
break;
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
/*
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
*/
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetZulGurubAI<boss_wushoolayAI>(creature);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
*/
DoMeleeAttackIfReady();
}
};
void AddSC_boss_wushoolay()
{
new boss_wushoolay();
RegisterZulGurubCreatureAI(boss_wushoolay);
}