aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorSubv2112 <s.v.h21@hotmail.com>2012-01-22 08:04:39 -0500
committerSubv2112 <s.v.h21@hotmail.com>2012-01-22 08:04:39 -0500
commit8362e21b2aa7585dc627014e09052d982b1a7fcb (patch)
tree009714b31a160c31b1bbd4db1f592f536672a974 /src/server/game/Spells
parenta3f595ee10d02dda89298fd4193133d77fbf250e (diff)
parent78daae91b21ae8705750a253cb9c6eef02a80815 (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore
Diffstat (limited to 'src/server/game/Spells')
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp14
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp14
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h3
3 files changed, 17 insertions, 14 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 535253f4e13..7c09a2f32c6 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3096,17 +3096,9 @@ void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, boo
}
if (apply)
- {
- if (target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
- caster->ToPlayer()->SetMover(target);
- }
+ target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
else
- {
target->RemoveCharmedBy(caster);
- caster->ToPlayer()->SetMover(caster);
- if (target->GetTypeId() == TYPEID_PLAYER)
- target->ToPlayer()->SetMover(target);
- }
}
// only one spell has this aura
@@ -3134,13 +3126,11 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
if (caster->ToPlayer()->GetPet() != pet)
return;
- if (pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
- caster->ToPlayer()->SetMover(pet);
+ pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
}
else
{
pet->RemoveCharmedBy(caster);
- caster->ToPlayer()->SetMover(caster);
if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 5577422919f..b32e346757f 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1963,6 +1963,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
return false;
+ // TODO:
+ // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget()
+ // - add DoCheckProc() AuraScript hook
+ // to allow additional requirements for procs
+ // this is needed because this is the last moment in which you can prevent aura charge drop on proc
+ // and possibly a way to prevent default checks (if there're going to be any)
+
// Check if current equipment meets aura requirements
// do that only for passive spells
// TODO: this needs to be unified for all kinds of auras
@@ -2023,11 +2030,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
- // TODO: script hooks here (allowing prevention of selected effects)
+ // TODO: OnProc hook here
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (aurApp->HasEffect(i))
+ // TODO: OnEffectProc hook here (allowing prevention of selected effects)
GetEffect(i)->HandleProc(aurApp, eventInfo);
- // TODO: script hooks here
+ // TODO: AfterEffectProc hook here
+
+ // TODO: AfterProc hook here
// Remove aura if we've used last charge to proc
if (IsUsingCharges() && !GetCharges())
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 8c9cde37c15..de743eb2991 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -186,6 +186,9 @@ class Aura
bool CanStackWith(Aura const* existingAura) const;
// Proc system
+ // this subsystem is not yet in use - the core of it is functional, but still some research has to be done
+ // and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
+ // currently proc system functionality is implemented in Unit::ProcDamageAndSpell
bool IsProcOnCooldown() const;
void AddProcCooldown(uint32 msec);
bool IsUsingCharges() const { return m_isUsingCharges; }