Core/Movement: ported client control logic updates from 335 branch

This commit is contained in:
Ovahlord committed 2021-11-06 23:41:34 +01:00
1 parent f5342061ba
commit edbbeba5a2
21 files changed
+464 -284

No files matched your search

+4 -3
View File
@@ -20,6 +20,7 @@
#include "Corpse.h"
#include "Creature.h"
#include "DBCStores.h"
#include "GameClient.h"
#include "InstanceScript.h"
#include "Item.h"
#include "ItemTemplate.h"
@@ -528,8 +529,8 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (caster)
{
// bonus amount from combo points
if (_spellInfo->HasAttribute(SPELL_ATTR1_FINISHING_MOVE_DAMAGE) && caster->m_playerMovingMe && comboDamage)
if (uint8 comboPoints = caster->m_playerMovingMe->GetComboPoints())
if (_spellInfo->HasAttribute(SPELL_ATTR1_FINISHING_MOVE_DAMAGE) && caster->IsMovedByClient() && comboDamage)
if (uint8 comboPoints = caster->GetGameClientMovingMe()->GetBasePlayer()->GetComboPoints())
value += comboDamage * comboPoints;
value = caster->ApplyEffectModifiers(_spellInfo, _effIndex, value);
@@ -3370,7 +3371,7 @@ int32 SpellInfo::CalcDuration(Unit* caster, Spell* spell) const
// Increase duration based on combo points
if (HasAttribute(SPELL_ATTR1_FINISHING_MOVE_DURATION))
{
if (uint8 comboPoints = (caster && caster->m_playerMovingMe) ? caster->m_playerMovingMe->GetComboPoints() : 0)
if (uint8 comboPoints = (caster && caster->IsMovedByClient()) ? caster->GetGameClientMovingMe()->GetBasePlayer()->GetComboPoints() : 0)
{
if (GetDuration() != GetMaxDuration() && GetDuration() != -1)
duration += int32((GetMaxDuration() - GetDuration()) * comboPoints / 5);