Fix TC build

This commit is contained in:
Rochet2
2020-06-29 13:58:03 +03:00
parent f7adf33028
commit 31f4cfd98c
4 changed files with 17 additions and 5 deletions

View File

@@ -282,7 +282,7 @@ void Eluna::On_Reset(Creature* me) // Not an override, custom
} }
// Called when hit by a spell // Called when hit by a spell
bool Eluna::SpellHit(Creature* me, Unit* caster, SpellInfo const* spell) bool Eluna::SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell)
{ {
START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_HIT_BY_SPELL, me, false); START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_HIT_BY_SPELL, me, false);
Push(me); Push(me);
@@ -292,7 +292,7 @@ bool Eluna::SpellHit(Creature* me, Unit* caster, SpellInfo const* spell)
} }
// Called when spell hits a target // Called when spell hits a target
bool Eluna::SpellHitTarget(Creature* me, Unit* target, SpellInfo const* spell) bool Eluna::SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* spell)
{ {
START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_SPELL_HIT_TARGET, me, false); START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_SPELL_HIT_TARGET, me, false);
Push(me); Push(me);

View File

@@ -216,14 +216,22 @@ struct ElunaCreatureAI : ScriptedAI
} }
// Called when hit by a spell // Called when hit by a spell
#if defined TRINITY
void SpellHit(WorldObject* caster, SpellInfo const* spell) override
#else
void SpellHit(Unit* caster, SpellInfo const* spell) override void SpellHit(Unit* caster, SpellInfo const* spell) override
#endif
{ {
if (!sEluna->SpellHit(me, caster, spell)) if (!sEluna->SpellHit(me, caster, spell))
ScriptedAI::SpellHit(caster, spell); ScriptedAI::SpellHit(caster, spell);
} }
// Called when spell hits a target // Called when spell hits a target
#if defined TRINITY
void SpellHitTarget(WorldObject* target, SpellInfo const* spell) override
#else
void SpellHitTarget(Unit* target, SpellInfo const* spell) override void SpellHitTarget(Unit* target, SpellInfo const* spell) override
#endif
{ {
if (!sEluna->SpellHitTarget(me, target, spell)) if (!sEluna->SpellHitTarget(me, target, spell))
ScriptedAI::SpellHitTarget(target, spell); ScriptedAI::SpellHitTarget(target, spell);

View File

@@ -393,8 +393,8 @@ public:
bool ReceiveEmote(Creature* me, Player* player, uint32 emoteId); bool ReceiveEmote(Creature* me, Player* player, uint32 emoteId);
bool CorpseRemoved(Creature* me, uint32& respawnDelay); bool CorpseRemoved(Creature* me, uint32& respawnDelay);
bool MoveInLineOfSight(Creature* me, Unit* who); bool MoveInLineOfSight(Creature* me, Unit* who);
bool SpellHit(Creature* me, Unit* caster, SpellInfo const* spell); bool SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell);
bool SpellHitTarget(Creature* me, Unit* target, SpellInfo const* spell); bool SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* spell);
bool SummonedCreatureDies(Creature* me, Creature* summon, Unit* killer); bool SummonedCreatureDies(Creature* me, Creature* summon, Unit* killer);
bool OwnerAttackedBy(Creature* me, Unit* attacker); bool OwnerAttackedBy(Creature* me, Unit* attacker);
bool OwnerAttacked(Creature* me, Unit* target); bool OwnerAttacked(Creature* me, Unit* target);

View File

@@ -182,6 +182,7 @@ namespace LuaMap
* @param float x * @param float x
* @param float y * @param float y
* @param float z * @param float z
* @param uint32 phasemask = PHASEMASK_NORMAL
* @return uint32 areaId * @return uint32 areaId
*/ */
int GetAreaId(lua_State* L, Map* map) int GetAreaId(lua_State* L, Map* map)
@@ -189,8 +190,11 @@ namespace LuaMap
float x = Eluna::CHECKVAL<float>(L, 2); float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3); float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4); float z = Eluna::CHECKVAL<float>(L, 4);
#if defined TRINITY
float phasemask = Eluna::CHECKVAL<uint32>(L, 5, PHASEMASK_NORMAL);
#if defined TRINITY || AZEROTHCORE Eluna::Push(L, map->GetAreaId(phasemask, x, y, z));
#elif defined AZEROTHCORE
Eluna::Push(L, map->GetAreaId(x, y, z)); Eluna::Push(L, map->GetAreaId(x, y, z));
#else #else
Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z)); Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z));