Mods get their own file so i can take the big chunks of code out of lua parser

This commit is contained in:
KimLS
2017-04-30 00:30:23 -07:00
parent 8d391a7e3f
commit 0fd6815f81
8 changed files with 1028 additions and 353 deletions
+46
View File
@@ -23,6 +23,7 @@
#include "entity.h"
#include "mob.h"
#include "string_ids.h"
#include "lua_parser.h"
#include <string.h>
@@ -137,6 +138,15 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 base_damage, int32 min_damage,
int32 hate_override, int ReuseTime)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
LuaParser::Instance()->DoSpecialAttackDamage(this, who, skill, base_damage, min_damage, hate_override, ReuseTime, ignoreDefault);
if (ignoreDefault) {
return;
}
#endif
// this really should go through the same code as normal melee damage to
// pick up all the special behavior there
@@ -758,6 +768,15 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
uint16 weapon_damage, int16 chance_mod, int16 focus, int ReuseTime, uint32 range_id,
uint32 ammo_id, const EQEmu::ItemData *AmmoItem, int AmmoSlot, float speed)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
LuaParser::Instance()->DoArcheryAttackDmg(this, other, RangeWeapon, Ammo, weapon_damage, chance_mod, focus, ReuseTime, range_id, ammo_id, AmmoItem, AmmoSlot, speed, ignoreDefault);
if (ignoreDefault) {
return;
}
#endif
if ((other == nullptr ||
((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead)) ||
@@ -1138,6 +1157,15 @@ void NPC::RangedAttack(Mob* other)
void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 chance_mod, EQEmu::skills::SkillType skill, float speed, const char *IDFile)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
LuaParser::Instance()->DoRangedAttackDmg(this, other, Launch, damage_mod, chance_mod, skill, speed, IDFile, ignoreDefault);
if (ignoreDefault) {
return;
}
#endif
if ((other == nullptr ||
(other->HasDied())) ||
HasDied() ||
@@ -1302,6 +1330,15 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
uint16 weapon_damage, int16 chance_mod, int16 focus, int ReuseTime, uint32 range_id,
int AmmoSlot, float speed)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
LuaParser::Instance()->DoThrowingAttackDmg(this, other, RangeWeapon, AmmoItem, weapon_damage, chance_mod, focus, ReuseTime, range_id, AmmoSlot, speed, ignoreDefault);
if (ignoreDefault) {
return;
}
#endif
if ((other == nullptr ||
((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead)) ||
HasDied() || (!IsAttackAllowed(other)) || (other->GetInvul() || other->GetSpecialAbility(IMMUNE_MELEE)))) {
@@ -2086,6 +2123,15 @@ int Mob::TryAssassinate(Mob *defender, EQEmu::skills::SkillType skillInUse)
void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQEmu::skills::SkillType skillinuse, int16 chance_mod,
int16 focus, bool CanRiposte, int ReuseTime)
{
#ifdef LUA_EQEMU
bool ignoreDefault = false;
LuaParser::Instance()->DoMeleeSkillAttackDmg(this, other, weapon_damage, skillinuse, chance_mod, focus, CanRiposte, ReuseTime, ignoreDefault);
if (ignoreDefault) {
return;
}
#endif
if (!CanDoSpecialAttack(other))
return;