mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
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:
@@ -82,14 +82,28 @@ void Totem::InitSummon()
|
|||||||
Minion::InitSummon();
|
Minion::InitSummon();
|
||||||
|
|
||||||
if (m_type == TOTEM_PASSIVE && GetSpell())
|
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
|
// Some totems can have both instant effect and passive spell
|
||||||
if(GetSpell(1))
|
if (GetSpell(1))
|
||||||
|
{
|
||||||
CastSpell(this, GetSpell(1), true);
|
CastSpell(this, GetSpell(1), true);
|
||||||
|
}
|
||||||
|
|
||||||
// xinef: this is better than the script, 100% sure to work
|
// xinef: this is better than the script, 100% sure to work
|
||||||
if(GetEntry() == SENTRY_TOTEM_ENTRY)
|
if (GetEntry() == SENTRY_TOTEM_ENTRY)
|
||||||
{
|
{
|
||||||
SetReactState(REACT_AGGRESSIVE);
|
SetReactState(REACT_AGGRESSIVE);
|
||||||
GetOwner()->CastSpell(this, 6277, true);
|
GetOwner()->CastSpell(this, 6277, true);
|
||||||
@@ -132,7 +146,7 @@ void Totem::UnSummon(uint32 msTime)
|
|||||||
|
|
||||||
// Remove Sentry Totem Aura
|
// Remove Sentry Totem Aura
|
||||||
if (GetEntry() == SENTRY_TOTEM_ENTRY)
|
if (GetEntry() == SENTRY_TOTEM_ENTRY)
|
||||||
owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);
|
owner->RemoveAurasDueToSpell(static_cast<uint32>(TotemSpellIds::SentryTotemSpell));
|
||||||
|
|
||||||
//remove aura all party members too
|
//remove aura all party members too
|
||||||
if (Player* player = owner->ToPlayer())
|
if (Player* player = owner->ToPlayer())
|
||||||
|
|||||||
@@ -27,7 +27,12 @@ enum TotemType
|
|||||||
TOTEM_STATUE = 2 // copied straight from moongose, may need more implementation to work
|
TOTEM_STATUE = 2 // copied straight from moongose, may need more implementation to work
|
||||||
};
|
};
|
||||||
// Some Totems cast spells that are not in creature DB
|
// 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 SENTRY_TOTEM_ENTRY 3968
|
||||||
#define EARTHBIND_TOTEM_ENTRY 2630
|
#define EARTHBIND_TOTEM_ENTRY 2630
|
||||||
|
|||||||
Reference in New Issue
Block a user