Core/Spells: implement SPELLVALUE_AURA_DURATION to allow casting spells with a duration value set
This commit is contained in:
1 parent
6abab1704f
commit
cef6f94953
3 files changed
+11
-1
No files matched your search
@@ -125,7 +125,8 @@ enum SpellValueMod : uint8
|
||||
SPELLVALUE_BASE_POINT2,
|
||||
SPELLVALUE_RADIUS_MOD,
|
||||
SPELLVALUE_MAX_TARGETS,
|
||||
SPELLVALUE_AURA_STACK
|
||||
SPELLVALUE_AURA_STACK,
|
||||
SPELLVALUE_AURA_DURATION
|
||||
};
|
||||
|
||||
class CustomSpellValues
|
||||
|
||||
@@ -520,6 +520,7 @@ SpellValue::SpellValue(SpellInfo const* proto)
|
||||
MaxAffectedTargets = proto->MaxAffectedTargets;
|
||||
RadiusMod = 1.0f;
|
||||
AuraStackAmount = 1;
|
||||
AuraDuration = 0;
|
||||
}
|
||||
|
||||
class TC_GAME_API SpellEvent : public BasicEvent
|
||||
@@ -2857,6 +2858,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
}
|
||||
|
||||
int32 duration = m_spellAura->GetMaxDuration();
|
||||
if (m_spellValue->AuraDuration && m_spellValue->AuraDuration != duration)
|
||||
duration = m_spellValue->AuraDuration;
|
||||
|
||||
// unit is immune to aura if it was diminished to 0 duration
|
||||
if (!positive && !unit->ApplyDiminishingToDuration(aurSpellInfo, triggered, duration, m_originalCaster, diminishLevel))
|
||||
@@ -7802,6 +7805,11 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
|
||||
case SPELLVALUE_AURA_STACK:
|
||||
m_spellValue->AuraStackAmount = uint8(value);
|
||||
break;
|
||||
case SPELLVALUE_AURA_DURATION:
|
||||
m_spellValue->AuraDuration = int32(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +233,7 @@ struct SpellValue
|
||||
uint32 MaxAffectedTargets;
|
||||
float RadiusMod;
|
||||
uint8 AuraStackAmount;
|
||||
int32 AuraDuration;
|
||||
};
|
||||
|
||||
enum SpellState
|
||||
|
||||
Reference in new issue
Block a user