Core/Phases: Preliminary work with correctly implementing the phase system in 4.3.4

Put here for peer review.
This commit is contained in:
Subv
2014-06-01 22:27:29 -05:00
parent 6bc62d730e
commit 48ec2df81f
40 changed files with 436 additions and 863 deletions

View File

@@ -3200,6 +3200,9 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
return;
}
for (auto phase : m_caster->GetPhases())
pGameObj->SetInPhase(phase, false, true);
int32 duration = m_spellInfo->GetDuration();
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
@@ -3221,6 +3224,9 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
if (linkedGO->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
for (auto phase : m_caster->GetPhases())
linkedGO->SetInPhase(phase, false, true);
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
linkedGO->SetSpellId(m_spellInfo->Id);
@@ -3872,6 +3878,9 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
return;
}
for (auto phase : m_caster->GetPhases())
pGameObj->SetInPhase(phase, false, true);
pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction());
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()+1);
int32 duration = m_spellInfo->GetDuration();
@@ -4228,6 +4237,9 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
return;
}
for (auto phase : m_caster->GetPhases())
go->SetInPhase(phase, false, true);
//pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
int32 duration = m_spellInfo->GetDuration();
go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
@@ -4857,6 +4869,9 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
return;
}
for (auto phase : m_caster->GetPhases())
pGameObj->SetInPhase(phase, false, true);
int32 duration = m_spellInfo->GetDuration();
switch (goinfo->type)
@@ -4919,6 +4934,9 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
if (linkedGO->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
for (auto phase : m_caster->GetPhases())
linkedGO->SetInPhase(phase, false, true);
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
linkedGO->SetSpellId(m_spellInfo->Id);