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
+15 -2
View File
@@ -10,6 +10,7 @@
#include <exception>
#include "zone_config.h"
#include "lua_mod.h"
extern const ZoneConfig *Config;
@@ -86,11 +87,24 @@ public:
return &inst;
}
bool HasFunction(std::string function, std::string package_name);
//Mod Extensions
bool ClientAttack(Mob *self, Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts, bool &ignoreDefault);
bool NPCAttack(Mob *self, Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts, bool &ignoreDefault);
bool BotAttack(Mob *self, Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts, bool &ignoreDefault);
void MeleeMitigation(Mob *self, Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
void ApplyDamageTable(Mob *self, DamageHitInfo &hit, bool &ignoreDefault);
bool AvoidDamage(Mob *self, Mob *other, DamageHitInfo &hit, bool &ignoreDefault);
bool CheckHitChance(Mob *self, Mob* other, DamageHitInfo &hit, bool &ignoreDefault);
void DoSpecialAttackDamage(Mob *self, Mob *who, EQEmu::skills::SkillType skill, int32 base_damage, int32 min_damage, int32 hate_override, int ReuseTime, bool &ignoreDefault);
void DoRangedAttackDmg(Mob *self, Mob* other, bool Launch, int16 damage_mod, int16 chance_mod, EQEmu::skills::SkillType skill, float speed, const char *IDFile, bool &ignoreDefault);
void DoArcheryAttackDmg(Mob *self, Mob *other, const EQEmu::ItemInstance *RangeWeapon, const EQEmu::ItemInstance *Ammo, uint16 weapon_damage, int16 chance_mod, int16 focus,
int ReuseTime, uint32 range_id, uint32 ammo_id, const EQEmu::ItemData *AmmoItem, int AmmoSlot, float speed, bool &ignoreDefault);
void DoThrowingAttackDmg(Mob *self, Mob *other, const EQEmu::ItemInstance *RangeWeapon, const EQEmu::ItemData *AmmoItem, uint16 weapon_damage, int16 chance_mod, int16 focus,
int ReuseTime, uint32 range_id, int AmmoSlot, float speed, bool &ignoreDefault);
void DoMeleeSkillAttackDmg(Mob *self, Mob *other, uint16 weapon_damage, EQEmu::skills::SkillType skillinuse, int16 chance_mod, int16 focus, bool CanRiposte, int ReuseTime,
bool &ignoreDefault);
private:
LuaParser();
@@ -109,13 +123,12 @@ private:
std::vector<EQEmu::Any> *extra_pointers);
void LoadScript(std::string filename, std::string package_name);
bool HasFunction(std::string function, std::string package_name);
void MapFunctions(lua_State *L);
QuestEventID ConvertLuaEvent(QuestEventID evt);
std::map<std::string, std::string> vars_;
std::map<std::string, bool> loaded_;
std::vector<std::string> mods_;
std::vector<LuaMod> mods_;
lua_State *L;
NPCArgumentHandler NPCArgumentDispatch[_LargestEventID];