diff options
| author | Matan Shukry <matanshukry@gmail.com> | 2021-12-25 22:25:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-25 21:25:54 +0100 |
| commit | a3d06f2f329a6d21b9a79aed8b39f1d56fa933e6 (patch) | |
| tree | c45cb5cb06c1ced9e6a425b999da30ffe106e8b8 /src/server/game/Entities/Object | |
| parent | b221f4b37251db2206dd14d46c00f1b6f1f16480 (diff) | |
Scripts/Spells: Implemented various rogue spells (#26319)
* Ruthlessness
* Mastery: Main Gauche
* Venomous Wounds
* Symbols of Death
* Backstab
* Premeditation
* Grand Melee
* True Bearing
* Slice and Dice
* Roll the Bones
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index bda27e52492..534162b131c 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2118,16 +2118,20 @@ float WorldObject::ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effInd int32 WorldObject::CalcSpellDuration(SpellInfo const* spellInfo) const { - uint8 comboPoints = 0; + int32 comboPoints = 0; + int32 maxComboPoints = 5; if (Unit const* unit = ToUnit()) + { comboPoints = unit->GetPower(POWER_COMBO_POINTS); + maxComboPoints = unit->GetMaxPower(POWER_COMBO_POINTS); + } int32 minduration = spellInfo->GetDuration(); int32 maxduration = spellInfo->GetMaxDuration(); int32 duration; if (comboPoints && minduration != -1 && minduration != maxduration) - duration = minduration + int32((maxduration - minduration) * comboPoints / 5); + duration = minduration + int32((maxduration - minduration) * comboPoints / maxComboPoints); else duration = minduration; |
