aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-05-17 18:06:28 +0200
committerShauren <shauren.trinity@gmail.com>2015-05-17 18:06:28 +0200
commit92bfa759facd47c1e375876c1df4604091811d16 (patch)
tree731f58769764f0f6852e62de2ae3c1adb05fa61f /src/server/game/Spells/SpellEffects.cpp
parent051e3b631db74886479c58485fad46b9a326a966 (diff)
Core/Garrisons: Initial work on garrison followers
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 40a8c853bb0..9e4f0608a38 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -294,7 +294,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectNULL, //217 SPELL_EFFECT_UPGRADE_GARRISON
&Spell::EffectNULL, //218 SPELL_EFFECT_218
&Spell::EffectNULL, //219 SPELL_EFFECT_219
- &Spell::EffectNULL, //220 SPELL_EFFECT_ADD_GARRISON_FOLLOWER
+ &Spell::EffectAddGarrisonFollower, //220 SPELL_EFFECT_ADD_GARRISON_FOLLOWER
&Spell::EffectNULL, //221 SPELL_EFFECT_221
&Spell::EffectNULL, //222 SPELL_EFFECT_CREATE_HEIRLOOM_ITEM
&Spell::EffectNULL, //223 SPELL_EFFECT_CHANGE_ITEM_BONUSES
@@ -5826,3 +5826,15 @@ void Spell::EffectCreateGarrison(SpellEffIndex effIndex)
unitTarget->ToPlayer()->CreateGarrison(GetEffect(effIndex)->MiscValue);
}
+
+void Spell::EffectAddGarrisonFollower(SpellEffIndex effIndex)
+{
+ if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
+ return;
+
+ if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (Garrison* garrison = unitTarget->ToPlayer()->GetGarrison())
+ garrison->AddFollower(GetEffect(effIndex)->MiscValue);
+}