feat(Core/Instance): Add instance validation for creature scripts (#4596)

This commit is contained in:
Kitzunu
2021-04-05 15:34:26 +02:00
committed by GitHub
parent 60f865fce6
commit f9d708b450
371 changed files with 1315 additions and 767 deletions

View File

@@ -91,7 +91,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_gatewatcher_gyrokillAI(creature);
return GetMechanarAI<boss_gatewatcher_gyrokillAI>(creature);
}
};

View File

@@ -94,7 +94,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_gatewatcher_iron_handAI(creature);
return GetMechanarAI<boss_gatewatcher_iron_handAI>(creature);
}
};

View File

@@ -126,7 +126,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_mechano_lord_capacitusAI(creature);
return GetMechanarAI<boss_mechano_lord_capacitusAI>(creature);
}
};

View File

@@ -115,7 +115,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_nethermancer_sepethreaAI(creature);
return GetMechanarAI<boss_nethermancer_sepethreaAI>(creature);
}
};
@@ -179,7 +179,7 @@ public:
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_ragin_flamesAI(creature);
return GetMechanarAI<npc_ragin_flamesAI>(creature);
}
};

View File

@@ -146,7 +146,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_pathaleon_the_calculatorAI(creature);
return GetMechanarAI<boss_pathaleon_the_calculatorAI>(creature);
}
};

View File

@@ -6,10 +6,13 @@
#define DEF_MECHANAR_H
#include "CreatureAI.h"
#include "CreatureAIImpl.h"
#include "Player.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#define MechanarScriptName "instance_mechanar"
enum DataTypes
{
DATA_GATEWATCHER_GYROKILL = 0,
@@ -52,4 +55,10 @@ enum SpellIds
SPELL_TELEPORT_VISUAL = 35517
};
template <class AI, class T>
inline AI* GetMechanarAI(T* obj)
{
return GetInstanceAI<AI>(obj, MechanarScriptName);
}
#endif