mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +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();
|
||||
|
||||
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())
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user