mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/ZG: Update scripts to new register model (1/5) (#26684)
(cherry picked from commit 3d19a71ef2)
This commit is contained in:
@@ -31,64 +31,53 @@ enum Events
|
||||
{
|
||||
};
|
||||
|
||||
class boss_grilek : public CreatureScript
|
||||
struct boss_grilek : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_grilek() : CreatureScript("boss_grilek") { }
|
||||
boss_grilek(Creature* creature) : BossAI(creature, DATA_GRILEK)
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_grilekAI : public BossAI
|
||||
void Reset() override
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
}
|
||||
|
||||
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_grilekAI(Creature* creature) : BossAI(creature, DATA_GRILEK)
|
||||
switch (eventId)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
}
|
||||
|
||||
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_grilekAI>(creature);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_grilek()
|
||||
{
|
||||
new boss_grilek();
|
||||
RegisterZulGurubCreatureAI(boss_grilek);
|
||||
}
|
||||
|
||||
@@ -37,69 +37,58 @@ enum Events
|
||||
{
|
||||
};
|
||||
|
||||
class boss_kilnara : public CreatureScript
|
||||
struct boss_kilnara : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_kilnara() : CreatureScript("boss_kilnara") { }
|
||||
boss_kilnara(Creature* creature) : BossAI(creature, DATA_KILNARA) { }
|
||||
|
||||
struct boss_kilnaraAI : public BossAI
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
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_kilnaraAI(Creature* creature) : BossAI(creature, DATA_KILNARA) { }
|
||||
|
||||
void Reset() override
|
||||
switch (eventId)
|
||||
{
|
||||
_Reset();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulGurubAI<boss_kilnaraAI>(creature);
|
||||
}
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kilnara()
|
||||
{
|
||||
new boss_kilnara();
|
||||
RegisterZulGurubCreatureAI(boss_kilnara);
|
||||
}
|
||||
|
||||
@@ -95,4 +95,7 @@ inline AI* GetZulGurubAI(T* obj)
|
||||
return GetInstanceAI<AI>(obj, ZGScriptName);
|
||||
}
|
||||
|
||||
#define RegisterZulGurubCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetZulGurubAI)
|
||||
#define RegisterZulGurubGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetZulGurubAI)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user