fix(Core/Totem): Implement casting delay for the Fire Totem used by c… (#14276)

* fix(Core/Totem): Implement casting delay for the Fire Totem used by creatures

* clear debug

* Update src/server/game/Entities/Totem/Totem.h

* fix build

* Update Totem.cpp
This commit is contained in:
Skjalf
2022-12-27 20:38:00 -03:00
committed by GitHub
parent 50b85220a0
commit 2eb374c6e4
2 changed files with 24 additions and 5 deletions

View File

@@ -82,14 +82,28 @@ void Totem::InitSummon()
Minion::InitSummon();
if (m_type == TOTEM_PASSIVE && GetSpell())
CastSpell(this, GetSpell(), true);
{
if (TotemSpellIds(GetUInt32Value(UNIT_CREATED_BY_SPELL)) == TotemSpellIds::FireTotemSpell)
{
m_Events.AddEventAtOffset([this]()
{
CastSpell(this, GetSpell(), true);
}, 4s);
}
else
{
CastSpell(this, GetSpell(), true);
}
}
// Some totems can have both instant effect and passive spell
if(GetSpell(1))
if (GetSpell(1))
{
CastSpell(this, GetSpell(1), true);
}
// xinef: this is better than the script, 100% sure to work
if(GetEntry() == SENTRY_TOTEM_ENTRY)
if (GetEntry() == SENTRY_TOTEM_ENTRY)
{
SetReactState(REACT_AGGRESSIVE);
GetOwner()->CastSpell(this, 6277, true);
@@ -132,7 +146,7 @@ void Totem::UnSummon(uint32 msTime)
// Remove Sentry Totem Aura
if (GetEntry() == SENTRY_TOTEM_ENTRY)
owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);
owner->RemoveAurasDueToSpell(static_cast<uint32>(TotemSpellIds::SentryTotemSpell));
//remove aura all party members too
if (Player* player = owner->ToPlayer())

View File

@@ -27,7 +27,12 @@ enum TotemType
TOTEM_STATUE = 2 // copied straight from moongose, may need more implementation to work
};
// Some Totems cast spells that are not in creature DB
#define SENTRY_TOTEM_SPELLID 6495
enum class TotemSpellIds : uint32
{
SentryTotemSpell = 6495,
FireTotemSpell = 32062
};
#define SENTRY_TOTEM_ENTRY 3968
#define EARTHBIND_TOTEM_ENTRY 2630