aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-02-19 19:14:56 +0100
committertreeston <treeston.mmoc@gmail.com>2016-02-23 13:41:56 +0100
commit2f14664340ba486a226a0c48d285e7141a16b62f (patch)
treecd92f2229a2e4a214b62e979afcf2f6a15b286cd /src/server/scripts/Spells
parente4dfbb60fd85ad9fb8fbbd700b684c6ece8abdbb (diff)
Core/UnitAI: Rework creature-controlled player behavior.
- Removed hacked control mechanism, use proper PlayerAI instead - Port old hacky code to new SimpleCharmedPlayerAI class - Make adjustments to aforementioned code to fix bugs: - Properly clean up movement after charm ends - Only try to attack a target if charmer is engaged in combat
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 3cea620559a..f1ad785c13d 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -22,7 +22,7 @@
*/
#include "Player.h"
-#include "UnitAI.h"
+#include "PlayerAI.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
@@ -1909,9 +1909,9 @@ public:
if (!player || player->GetGhoulResurrectGhoulGUID().IsEmpty())
return;
- oldAI = player->GetAI();
+ oldAI = player->AI();
oldAIState = player->IsAIEnabled;
- player->SetAI(new player_ghoulAI(player, player->GetGhoulResurrectGhoulGUID()));
+ player->SetAI(static_cast<UnitAI*>(new player_ghoulAI(player, player->GetGhoulResurrectGhoulGUID())));
player->IsAIEnabled = true;
}
@@ -1922,8 +1922,8 @@ public:
return;
player->IsAIEnabled = oldAIState;
- UnitAI* thisAI = player->GetAI();
- player->SetAI(oldAI);
+ PlayerAI* thisAI = player->AI();
+ player->SetAI(static_cast<UnitAI*>(oldAI));
delete thisAI;
// Dismiss ghoul if necessary
@@ -1943,7 +1943,7 @@ public:
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_raise_ally_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
- UnitAI* oldAI;
+ PlayerAI* oldAI;
bool oldAIState;
};