WIP for NPC spell push, off by default for now

This commit is contained in:
Michael Cook (mackal)
2018-03-07 16:50:24 -05:00
parent 0d63c8b9ef
commit ae966e546b
8 changed files with 94 additions and 18 deletions
+7
View File
@@ -81,6 +81,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include "fastmath.h"
#include <assert.h>
#include <math.h>
@@ -104,6 +105,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
extern Zone* zone;
extern volatile bool is_zone_loaded;
extern WorldServer worldserver;
extern FastMath g_Math;
using EQEmu::CastingSlot;
@@ -3945,6 +3947,11 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{
spelltar->CastToClient()->SetKnockBackExemption(true);
}
} else if (RuleB(Spells, NPCSpellPush) && !spelltar->IsRooted() && spelltar->ForcedMovement == 0) {
spelltar->m_Delta.x += action->force * g_Math.FastSin(action->hit_heading);
spelltar->m_Delta.y += action->force * g_Math.FastCos(action->hit_heading);
spelltar->m_Delta.z += action->hit_pitch;
spelltar->ForcedMovement = 6;
}
}