diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 7537479d9..ab79c7572 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -1,11 +1,32 @@ #ifdef LUA_EQEMU #include "masterentity.h" +#include "lua_item.h" +#include "lua_iteminst.h" #include "lua_mob.h" #include "lua_hate_entry.h" #include "lua_hate_list.h" #include "lua_client.h" +Lua_Mob::Lua_Illusion::Lua_Illusion() { + in_race = 0; + in_gender = 255; + in_texture = 255; + in_helmtexture = 255; + in_haircolor = 255; + in_beardcolor = 255; + in_eyecolor1 = 255; + in_eyecolor2 = 255; + in_hairstyle = 255; + in_luclinface = 255; + in_beard = 255; + in_aa_title = 255; + in_drakkin_heritage = 4294967295; + in_drakkin_tattoo = 4294967295; + in_drakkin_details = 4294967295; + in_size = -1.0; +} + const char *Lua_Mob::GetName() { Lua_Safe_Call_String(); return self->GetName(); @@ -178,27 +199,27 @@ void Lua_Mob::DoAnim(int anim_num, int type, bool ackreq, int filter) { void Lua_Mob::ChangeSize(double in_size) { Lua_Safe_Call_Void(); - self->ChangeSize(in_size); + self->ChangeSize(static_cast(in_size)); } void Lua_Mob::ChangeSize(double in_size, bool no_restriction) { Lua_Safe_Call_Void(); - self->ChangeSize(in_size, no_restriction); + self->ChangeSize(static_cast(in_size), no_restriction); } void Lua_Mob::GMMove(double x, double y, double z) { Lua_Safe_Call_Void(); - self->GMMove(x, y, z); + self->GMMove(static_cast(x), static_cast(y), static_cast(z)); } void Lua_Mob::GMMove(double x, double y, double z, double heading) { Lua_Safe_Call_Void(); - self->GMMove(x, y, z, heading); + self->GMMove(static_cast(x), static_cast(y), static_cast(z), static_cast(heading)); } void Lua_Mob::GMMove(double x, double y, double z, double heading, bool send_update) { Lua_Safe_Call_Void(); - self->GMMove(x, y, z, heading, send_update); + self->GMMove(static_cast(x), static_cast(y), static_cast(z), static_cast(heading), send_update); } bool Lua_Mob::HasProcs() { @@ -740,7 +761,7 @@ bool Lua_Mob::SpellFinished(int spell_id, Lua_Mob target, int slot, int mana_use void Lua_Mob::SpellEffect(Lua_Mob caster, int spell_id, double partial) { Lua_Safe_Call_Void(); - self->SpellEffect(caster, spell_id, partial); + self->SpellEffect(caster, spell_id, static_cast(partial)); } Lua_Mob Lua_Mob::GetPet() { @@ -768,4 +789,763 @@ Lua_HateList Lua_Mob::GetHateList() { return ret; } +Lua_Mob Lua_Mob::GetHateTop() { + Lua_Safe_Call_Mob(); + return Lua_Mob(self->GetHateTop()); +} + +Lua_Mob Lua_Mob::GetHateDamageTop(Lua_Mob other) { + Lua_Safe_Call_Mob(); + return Lua_Mob(self->GetHateDamageTop(other)); +} + +Lua_Mob Lua_Mob::GetHateRandom() { + Lua_Safe_Call_Mob(); + return Lua_Mob(self->GetHateRandom()); +} + +void Lua_Mob::AddToHateList(Lua_Mob other) { + Lua_Safe_Call_Void(); + self->AddToHateList(other); +} + +void Lua_Mob::AddToHateList(Lua_Mob other, int hate) { + Lua_Safe_Call_Void(); + self->AddToHateList(other, hate); +} + +void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage) { + Lua_Safe_Call_Void(); + self->AddToHateList(other, hate, damage); +} + +void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help) { + Lua_Safe_Call_Void(); + self->AddToHateList(other, hate, damage, yell_for_help); +} + +void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy) { + Lua_Safe_Call_Void(); + self->AddToHateList(other, hate, damage, yell_for_help, frenzy); +} + +void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy, bool buff_tic) { + Lua_Safe_Call_Void(); + self->AddToHateList(other, hate, damage, yell_for_help, frenzy, buff_tic); +} + +void Lua_Mob::SetHate(Lua_Mob other) { + Lua_Safe_Call_Void(); + self->SetHate(other); +} + +void Lua_Mob::SetHate(Lua_Mob other, int hate) { + Lua_Safe_Call_Void(); + self->SetHate(other, hate); +} + +void Lua_Mob::SetHate(Lua_Mob other, int hate, int damage) { + Lua_Safe_Call_Void(); + self->SetHate(other, hate, damage); +} + +uint32 Lua_Mob::GetHateAmount(Lua_Mob target) { + Lua_Safe_Call_Int(); + return self->GetHateAmount(target); +} + +uint32 Lua_Mob::GetHateAmount(Lua_Mob target, bool is_damage) { + Lua_Safe_Call_Int(); + return self->GetHateAmount(target, is_damage); +} + +uint32 Lua_Mob::GetDamageAmount(Lua_Mob target) { + Lua_Safe_Call_Int(); + return self->GetDamageAmount(target); +} + +void Lua_Mob::WipeHateList() { + Lua_Safe_Call_Void(); + self->WipeHateList(); +} + +bool Lua_Mob::CheckAggro(Lua_Mob other) { + Lua_Safe_Call_Bool(); + return self->CheckAggro(other); +} + +void Lua_Mob::Stun(int duration) { + Lua_Safe_Call_Void(); + self->Stun(duration); +} + +void Lua_Mob::UnStun() { + Lua_Safe_Call_Void(); + self->UnStun(); +} + +bool Lua_Mob::IsStunned() { + Lua_Safe_Call_Bool(); + return self->IsStunned(); +} + +void Lua_Mob::Spin() { + Lua_Safe_Call_Void(); + self->Spin(); +} + +void Lua_Mob::Kill() { + Lua_Safe_Call_Void(); + self->Kill(); +} + +bool Lua_Mob::CanThisClassDoubleAttack() { + Lua_Safe_Call_Bool(); + return self->CanThisClassDoubleAttack(); +} + +bool Lua_Mob::CanThisClassDualWield() { + Lua_Safe_Call_Bool(); + return self->CanThisClassDualWield(); +} + +bool Lua_Mob::CanThisClassRiposte() { + Lua_Safe_Call_Bool(); + return self->CanThisClassRiposte(); +} + +bool Lua_Mob::CanThisClassDodge() { + Lua_Safe_Call_Bool(); + return self->CanThisClassDodge(); +} + +bool Lua_Mob::CanThisClassParry() { + Lua_Safe_Call_Bool(); + return self->CanThisClassParry(); +} + +bool Lua_Mob::CanThisClassBlock() { + Lua_Safe_Call_Bool(); + return self->CanThisClassBlock(); +} + +void Lua_Mob::SetInvul(bool value) { + Lua_Safe_Call_Void(); + self->SetInvul(value); +} + +bool Lua_Mob::GetInvul() { + Lua_Safe_Call_Bool(); + return self->GetInvul(); +} + +void Lua_Mob::SetExtraHaste(int haste) { + Lua_Safe_Call_Void(); + self->SetExtraHaste(haste); +} + +int Lua_Mob::GetHaste() { + Lua_Safe_Call_Int(); + return self->GetHaste(); +} + +int Lua_Mob::GetMonkHandToHandDamage() { + Lua_Safe_Call_Int(); + return self->GetMonkHandToHandDamage(); +} + +int Lua_Mob::GetMonkHandToHandDelay() { + Lua_Safe_Call_Int(); + return self->GetMonkHandToHandDelay(); +} + +void Lua_Mob::Mesmerize() { + Lua_Safe_Call_Void(); + self->Mesmerize(); +} + +bool Lua_Mob::IsMezzed() { + Lua_Safe_Call_Bool(); + return self->IsMezzed(); +} + +bool Lua_Mob::IsEnraged() { + Lua_Safe_Call_Bool(); + return self->IsEnraged(); +} + +int Lua_Mob::GetReverseFactionCon(Lua_Mob other) { + Lua_Safe_Call_Int(); + return self->GetReverseFactionCon(other); +} + +bool Lua_Mob::IsAIControlled() { + Lua_Safe_Call_Bool(); + return self->IsAIControlled(); +} + +float Lua_Mob::GetAggroRange() { + Lua_Safe_Call_Real(); + return self->GetAggroRange(); +} + +float Lua_Mob::GetAssistRange() { + Lua_Safe_Call_Real(); + return self->GetAssistRange(); +} + +void Lua_Mob::SetPetOrder(int order) { + Lua_Safe_Call_Void(); + self->SetPetOrder(static_cast(order)); +} + +int Lua_Mob::GetPetOrder() { + Lua_Safe_Call_Int(); + return self->GetPetOrder(); +} + +bool Lua_Mob::IsRoamer() { + Lua_Safe_Call_Bool(); + return self->IsRoamer(); +} + +bool Lua_Mob::IsRooted() { + Lua_Safe_Call_Bool(); + return self->IsRooted(); +} + +bool Lua_Mob::IsEngaged() { + Lua_Safe_Call_Bool(); + return self->IsEngaged(); +} + +void Lua_Mob::FaceTarget(Lua_Mob target) { + Lua_Safe_Call_Void(); + self->FaceTarget(target); +} + +void Lua_Mob::SetHeading(double in) { + Lua_Safe_Call_Void(); + self->SetHeading(static_cast(in)); +} + +double Lua_Mob::CalculateHeadingToTarget(double in_x, double in_y) { + Lua_Safe_Call_Real(); + return self->CalculateHeadingToTarget(static_cast(in_x), static_cast(in_y)); +} + +bool Lua_Mob::CalculateNewPosition(double x, double y, double z, double speed) { + Lua_Safe_Call_Bool(); + return self->CalculateNewPosition(static_cast(x), static_cast(y), static_cast(z), static_cast(speed)); +} + +bool Lua_Mob::CalculateNewPosition(double x, double y, double z, double speed, bool check_z) { + Lua_Safe_Call_Bool(); + return self->CalculateNewPosition(static_cast(x), static_cast(y), static_cast(z), static_cast(speed), + check_z); +} + +bool Lua_Mob::CalculateNewPosition2(double x, double y, double z, double speed) { + Lua_Safe_Call_Bool(); + return self->CalculateNewPosition2(static_cast(x), static_cast(y), static_cast(z), static_cast(speed)); +} + +bool Lua_Mob::CalculateNewPosition2(double x, double y, double z, double speed, bool check_z) { + Lua_Safe_Call_Bool(); + return self->CalculateNewPosition2(static_cast(x), static_cast(y), static_cast(z), static_cast(speed), + check_z); +} + +float Lua_Mob::CalculateDistance(double x, double y, double z) { + Lua_Safe_Call_Real(); + return self->CalculateDistance(static_cast(x), static_cast(y), static_cast(z)); +} + +void Lua_Mob::SendTo(double x, double y, double z) { + Lua_Safe_Call_Void(); + self->SendTo(static_cast(x), static_cast(y), static_cast(z)); +} + +void Lua_Mob::SendToFixZ(double x, double y, double z) { + Lua_Safe_Call_Void(); + self->SendToFixZ(static_cast(x), static_cast(y), static_cast(z)); +} + +void Lua_Mob::NPCSpecialAttacks(const char *parse, int perm) { + Lua_Safe_Call_Void(); + self->NPCSpecialAttacks(parse, perm); +} + +void Lua_Mob::NPCSpecialAttacks(const char *parse, int perm, bool reset) { + Lua_Safe_Call_Void(); + self->NPCSpecialAttacks(parse, perm, reset); +} + +void Lua_Mob::NPCSpecialAttacks(const char *parse, int perm, bool reset, bool remove) { + Lua_Safe_Call_Void(); + self->NPCSpecialAttacks(parse, perm, reset, remove); +} + +int Lua_Mob::GetResist(int type) { + Lua_Safe_Call_Int(); + return self->GetResist(type); +} + +bool Lua_Mob::Charmed() { + Lua_Safe_Call_Bool(); + return self->Charmed(); +} + +int Lua_Mob::CheckAggroAmount(int spell_id) { + Lua_Safe_Call_Int(); + return self->CheckAggroAmount(spell_id); +} + +int Lua_Mob::CheckAggroAmount(int spell_id, bool is_proc) { + Lua_Safe_Call_Int(); + return self->CheckAggroAmount(spell_id, is_proc); +} + +int Lua_Mob::CheckHealAggroAmount(int spell_id) { + Lua_Safe_Call_Int(); + return self->CheckHealAggroAmount(spell_id); +} + +int Lua_Mob::CheckHealAggroAmount(int spell_id, uint32 heal_possible) { + Lua_Safe_Call_Int(); + return self->CheckHealAggroAmount(spell_id, heal_possible); +} + +int Lua_Mob::GetAA(int id) { + Lua_Safe_Call_Int(); + return self->GetAA(id); +} + +bool Lua_Mob::DivineAura() { + Lua_Safe_Call_Bool(); + return self->DivineAura(); +} + +void Lua_Mob::SetOOCRegen(int regen) { + Lua_Safe_Call_Void(); + self->SetOOCRegen(regen); +} + +const char* Lua_Mob::GetEntityVariable(const char *name) { + Lua_Safe_Call_String(); + return self->GetEntityVariable(name); +} + +void Lua_Mob::SetEntityVariable(const char *name, const char *value) { + Lua_Safe_Call_Void(); + self->SetEntityVariable(name, value); +} + +bool Lua_Mob::EntityVariableExists(const char *name) { + Lua_Safe_Call_Bool(); + return self->EntityVariableExists(name); +} + +void Lua_Mob::Signal(uint32 id) { + Lua_Safe_Call_Void(); + + if(self->IsClient()) { + self->CastToClient()->Signal(id); + } else if(self->IsNPC()) { + self->CastToNPC()->SignalNPC(id); + } +} + +bool Lua_Mob::CombatRange(Lua_Mob other) { + Lua_Safe_Call_Bool(); + return self->CombatRange(other); +} + +void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage) { + Lua_Safe_Call_Void(); + self->DoSpecialAttackDamage(other, static_cast(skill), max_damage); +} + +void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage) { + Lua_Safe_Call_Void(); + self->DoSpecialAttackDamage(other, static_cast(skill), max_damage, min_damage); +} + +void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override) { + Lua_Safe_Call_Void(); + self->DoSpecialAttackDamage(other, static_cast(skill), max_damage, min_damage, hate_override); +} + +void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time) { + Lua_Safe_Call_Void(); + self->DoSpecialAttackDamage(other, static_cast(skill), max_damage, min_damage, hate_override, reuse_time); +} + +void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time, + bool hit_chance) { + Lua_Safe_Call_Void(); + self->DoSpecialAttackDamage(other, static_cast(skill), max_damage, min_damage, hate_override, reuse_time, hit_chance); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other, range_weapon); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other, range_weapon, item); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other, range_weapon, item, weapon_damage); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage, int chance_mod) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other, range_weapon, item, weapon_damage, chance_mod); +} + +void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage, int chance_mod, + int focus) { + Lua_Safe_Call_Void(); + self->DoThrowingAttackDmg(other, range_weapon, item, weapon_damage, chance_mod, focus); +} + +void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill) { + Lua_Safe_Call_Void(); + self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast(skill)); +} + +void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod) { + Lua_Safe_Call_Void(); + self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast(skill), chance_mod); +} + +void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus) { + Lua_Safe_Call_Void(); + self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast(skill), chance_mod, focus); +} + +void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus, bool can_riposte) { + Lua_Safe_Call_Void(); + self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast(skill), chance_mod, focus, can_riposte); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other, range_weapon); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other, range_weapon, ammo); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other, range_weapon, ammo, weapon_damage); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage, int chance_mod) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other, range_weapon, ammo, weapon_damage, chance_mod); +} + +void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage, int chance_mod, + int focus) { + Lua_Safe_Call_Void(); + self->DoArcheryAttackDmg(other, range_weapon, ammo, weapon_damage, chance_mod, focus); +} + +bool Lua_Mob::CheckLoS(Lua_Mob other) { + Lua_Safe_Call_Bool(); + return self->CheckLosFN(other); +} + +bool Lua_Mob::CheckLoSToLoc(double x, double y, double z) { + Lua_Safe_Call_Bool(); + return self->CheckLosFN(static_cast(x), static_cast(y), static_cast(z), 6.0f); +} + +bool Lua_Mob::CheckLoSToLoc(double x, double y, double z, double mob_size) { + Lua_Safe_Call_Bool(); + return self->CheckLosFN(static_cast(x), static_cast(y), static_cast(z), static_cast(mob_size)); +} + +double Lua_Mob::FindGroundZ(double x, double y) { + Lua_Safe_Call_Real(); + return self->GetGroundZ(static_cast(x), static_cast(y)); +} + +double Lua_Mob::FindGroundZ(double x, double y, double z) { + Lua_Safe_Call_Real(); + return self->GetGroundZ(static_cast(x), static_cast(y), static_cast(z)); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id, is_arrow); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id, is_arrow, static_cast(speed)); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id, is_arrow, static_cast(speed), static_cast(angle)); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle, double tilt) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id, is_arrow, static_cast(speed), static_cast(angle), static_cast(tilt)); +} + +void Lua_Mob::ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle, double tilt, double arc) { + Lua_Safe_Call_Void(); + self->ProjectileAnimation(to, item_id, is_arrow, static_cast(speed), static_cast(angle), static_cast(tilt), + static_cast(arc)); +} + +bool Lua_Mob::HasNPCSpecialAtk(const char *parse) { + Lua_Safe_Call_Bool(); + return self->HasNPCSpecialAtk(parse); +} + +void Lua_Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5) { + Lua_Safe_Call_Void(); + self->SendAppearanceEffect(parm1, parm2, parm3, parm4, parm5); +} + +void Lua_Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5, Lua_Client specific_target) { + Lua_Safe_Call_Void(); + self->SendAppearanceEffect(parm1, parm2, parm3, parm4, parm5, specific_target); +} + +void Lua_Mob::SetFlyMode(int in) { + Lua_Safe_Call_Void(); + self->SetFlyMode(in); +} + +void Lua_Mob::SetTexture(int in) { + Lua_Safe_Call_Void(); + self->SendIllusionPacket(self->GetRace(), 0xFF, in); +} + +void Lua_Mob::SetRace(int in) { + Lua_Safe_Call_Void(); + self->SendIllusionPacket(in); +} + +void Lua_Mob::SetGender(int in) { + Lua_Safe_Call_Void(); + self->SendIllusionPacket(self->GetRace(), in); +} + +void Lua_Mob::SendIllusionPacket(Lua_Mob::Lua_Illusion ill) { + Lua_Safe_Call_Void(); + self->SendIllusionPacket(ill.in_race, ill.in_gender, ill.in_texture, ill.in_helmtexture, ill.in_haircolor, ill.in_beardcolor, + ill.in_eyecolor1, ill.in_eyecolor2, ill.in_hairstyle, ill.in_luclinface, ill.in_beard, ill.in_aa_title, + ill.in_drakkin_heritage, ill.in_drakkin_tattoo, ill.in_drakkin_details, static_cast(ill.in_size)); +} + +void Lua_Mob::QuestReward(Lua_Client c) { + Lua_Safe_Call_Void(); + self->QuestReward(c); +} + +void Lua_Mob::QuestReward(Lua_Client c, uint32 silver) { + Lua_Safe_Call_Void(); + self->QuestReward(c, silver); +} + +void Lua_Mob::QuestReward(Lua_Client c, uint32 silver, uint32 gold) { + Lua_Safe_Call_Void(); + self->QuestReward(c, silver, gold); +} + +void Lua_Mob::QuestReward(Lua_Client c, uint32 silver, uint32 gold, uint32 platinum) { + Lua_Safe_Call_Void(); + self->QuestReward(c, silver, gold, platinum); +} + +void Lua_Mob::CameraEffect(uint32 duration, uint32 intensity) { + Lua_Safe_Call_Void(); + self->CameraEffect(duration, intensity); +} + +void Lua_Mob::CameraEffect(uint32 duration, uint32 intensity, Lua_Client c) { + Lua_Safe_Call_Void(); + self->CameraEffect(duration, intensity, c); +} + +void Lua_Mob::CameraEffect(uint32 duration, uint32 intensity, Lua_Client c, bool global) { + Lua_Safe_Call_Void(); + self->CameraEffect(duration, intensity, c, global); +} + +void Lua_Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020) { + Lua_Safe_Call_Void(); + self->SendSpellEffect(effect_id, duration, finish_delay, zone_wide, unk020); +} + +void Lua_Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect) { + Lua_Safe_Call_Void(); + self->SendSpellEffect(effect_id, duration, finish_delay, zone_wide, unk020, perm_effect); +} + +void Lua_Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, + Lua_Client c) { + Lua_Safe_Call_Void(); + self->SendSpellEffect(effect_id, duration, finish_delay, zone_wide, unk020, perm_effect, c); +} + +void Lua_Mob::TempName() { + Lua_Safe_Call_Void(); + self->TempName(); +} + +void Lua_Mob::TempName(const char *newname) { + Lua_Safe_Call_Void(); + self->TempName(newname); +} + +void Lua_Mob::SetGlobal(const char *varname, const char *newvalue, int options, const char *duration) { + Lua_Safe_Call_Void(); + self->SetGlobal(varname, newvalue, options, duration); +} + +void Lua_Mob::SetGlobal(const char *varname, const char *newvalue, int options, const char *duration, Lua_Mob other) { + Lua_Safe_Call_Void(); + self->SetGlobal(varname, newvalue, options, duration, other); +} + +void Lua_Mob::TarGlobal(const char *varname, const char *value, const char *duration, int npc_id, int char_id, int zone_id) { + Lua_Safe_Call_Void(); + self->TarGlobal(varname, value, duration, npc_id, char_id, zone_id); +} + +void Lua_Mob::DelGlobal(const char *varname) { + Lua_Safe_Call_Void(); + self->DelGlobal(varname); +} + +void Lua_Mob::SetSlotTint(int material_slot, int red_tint, int green_tint, int blue_tint) { + Lua_Safe_Call_Void(); + self->SetSlotTint(material_slot, red_tint, green_tint, blue_tint); +} + +void Lua_Mob::WearChange(int material_slot, int texture, uint32 color) { + Lua_Safe_Call_Void(); + self->WearChange(material_slot, texture, color); +} + +void Lua_Mob::DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup) { + Lua_Safe_Call_Void(); + self->DoKnockback(caster, pushback, pushup); +} + +void Lua_Mob::RemoveNimbusEffect(int effect_id) { + Lua_Safe_Call_Void(); + self->RemoveNimbusEffect(effect_id); +} + +bool Lua_Mob::IsRunning() { + Lua_Safe_Call_Bool(); + return self->IsRunning(); +} + +void Lua_Mob::SetRunning(bool running) { + Lua_Safe_Call_Void(); + self->SetRunning(running); +} + +void Lua_Mob::SetBodyType(int new_body, bool overwrite_orig) { + Lua_Safe_Call_Void(); + self->SetBodyType(static_cast(new_body), overwrite_orig); +} + +void Lua_Mob::SetTargetable(bool on) { + Lua_Safe_Call_Void(); + self->SetTargetable(on); +} + +void Lua_Mob::ModSkillDmgTaken(int skill, int value) { + Lua_Safe_Call_Void(); + self->ModSkillDmgTaken(static_cast(skill), value); +} + +int Lua_Mob::GetModSkillDmgTaken(int skill) { + Lua_Safe_Call_Int(); + return self->GetModSkillDmgTaken(static_cast(skill)); +} + +int Lua_Mob::GetSkillDmgTaken(int skill) { + Lua_Safe_Call_Int(); + return self->GetSkillDmgTaken(static_cast(skill)); +} + +void Lua_Mob::SetAllowBeneficial(bool value) { + Lua_Safe_Call_Void(); + self->SetAllowBeneficial(value); +} + +bool Lua_Mob::GetAllowBeneficial() { + Lua_Safe_Call_Bool(); + return self->GetAllowBeneficial(); +} + +bool Lua_Mob::IsBeneficialAllowed(Lua_Mob target) { + Lua_Safe_Call_Bool(); + return self->IsBeneficialAllowed(target); +} + +void Lua_Mob::ModVulnerability(int resist, int value) { + Lua_Safe_Call_Void(); + self->ModVulnerability(resist, value); +} + +int Lua_Mob::GetModVulnerability(int resist) { + Lua_Safe_Call_Int(); + return self->GetModVulnerability(resist); +} + +void Lua_Mob::SetDisableMelee(bool disable) { + Lua_Safe_Call_Void(); + self->SetDisableMelee(disable); +} + +bool Lua_Mob::IsMeleeDisabled() { + Lua_Safe_Call_Bool(); + return IsMeleeDisabled(); +} + +void Lua_Mob::SetFlurryChance(int value) { + Lua_Safe_Call_Void(); + self->SetFlurryChance(value); +} + +int Lua_Mob::GetFlurryChance() { + Lua_Safe_Call_Int(); + return self->GetFlurryChance(); +} + #endif diff --git a/zone/lua_mob.h b/zone/lua_mob.h index c9ae3cd57..d73a2173c 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -6,11 +6,33 @@ class Mob; struct Lua_HateList; +class Lua_Item; +class Lua_ItemInst; class Lua_Mob : public Lua_Entity { typedef Mob NativeType; public: + struct Lua_Illusion { + Lua_Illusion(); + int in_race; + int in_gender; + int in_texture; + int in_helmtexture; + int in_haircolor; + int in_beardcolor; + int in_eyecolor1; + int in_eyecolor2; + int in_hairstyle; + int in_luclinface; + int in_beard; + int in_aa_title; + uint32 in_drakkin_heritage; + uint32 in_drakkin_tattoo; + uint32 in_drakkin_details; + double in_size; + }; + Lua_Mob() { } Lua_Mob(Mob *d) { SetLuaPtrData(d); } virtual ~Lua_Mob() { } @@ -174,6 +196,159 @@ public: Lua_Mob GetPet(); Lua_Mob GetOwner(); Lua_HateList GetHateList(); + + Lua_Mob GetHateTop(); + Lua_Mob GetHateDamageTop(Lua_Mob other); + Lua_Mob GetHateRandom(); + void AddToHateList(Lua_Mob other); + void AddToHateList(Lua_Mob other, int hate); + void AddToHateList(Lua_Mob other, int hate, int damage); + void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help); + void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy); + void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy, bool buff_tic); + void SetHate(Lua_Mob other); + void SetHate(Lua_Mob other, int hate); + void SetHate(Lua_Mob other, int hate, int damage); + uint32 GetHateAmount(Lua_Mob target); + uint32 GetHateAmount(Lua_Mob target, bool is_damage); + uint32 GetDamageAmount(Lua_Mob target); + void WipeHateList(); + bool CheckAggro(Lua_Mob other); + void Stun(int duration); + void UnStun(); + bool IsStunned(); + void Spin(); + void Kill(); + bool CanThisClassDoubleAttack(); + bool CanThisClassDualWield(); + bool CanThisClassRiposte(); + bool CanThisClassDodge(); + bool CanThisClassParry(); + bool CanThisClassBlock(); + void SetInvul(bool value); + bool GetInvul(); + void SetExtraHaste(int haste); + int GetHaste(); + int GetMonkHandToHandDamage(); + int GetMonkHandToHandDelay(); + void Mesmerize(); + bool IsMezzed(); + bool IsEnraged(); + int GetReverseFactionCon(Lua_Mob other); + bool IsAIControlled(); + float GetAggroRange(); + float GetAssistRange(); + void SetPetOrder(int order); + int GetPetOrder(); + bool IsRoamer(); + bool IsRooted(); + bool IsEngaged(); + void FaceTarget(Lua_Mob target); + void SetHeading(double in); + double CalculateHeadingToTarget(double in_x, double in_y); + bool CalculateNewPosition(double x, double y, double z, double speed); + bool CalculateNewPosition(double x, double y, double z, double speed, bool check_z); + bool CalculateNewPosition2(double x, double y, double z, double speed); + bool CalculateNewPosition2(double x, double y, double z, double speed, bool check_z); + float CalculateDistance(double x, double y, double z); + void SendTo(double x, double y, double z); + void SendToFixZ(double x, double y, double z); + void NPCSpecialAttacks(const char *parse, int perm); + void NPCSpecialAttacks(const char *parse, int perm, bool reset); + void NPCSpecialAttacks(const char *parse, int perm, bool reset, bool remove); + int GetResist(int type); + bool Charmed(); + int CheckAggroAmount(int spell_id); + int CheckAggroAmount(int spell_id, bool is_proc); + int CheckHealAggroAmount(int spell_id); + int CheckHealAggroAmount(int spell_id, uint32 heal_possible); + int GetAA(int id); + bool DivineAura(); + void SetOOCRegen(int regen); + const char* GetEntityVariable(const char *name); + void SetEntityVariable(const char *name, const char *value); + bool EntityVariableExists(const char *name); + void Signal(uint32 id); + bool CombatRange(Lua_Mob other); + void DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage); + void DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage); + void DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override); + void DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time); + void DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time, bool hit_chance); + void DoThrowingAttackDmg(Lua_Mob other); + void DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon); + void DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item); + void DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage); + void DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage, int chance_mod); + void DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_Item item, int weapon_damage, int chance_mod, int focus); + void DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill); + void DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod); + void DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus); + void DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus, bool can_riposte); + void DoArcheryAttackDmg(Lua_Mob other); + void DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon); + void DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo); + void DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage); + void DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage, int chance_mod); + void DoArcheryAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_ItemInst ammo, int weapon_damage, int chance_mod, int focus); + bool CheckLoS(Lua_Mob other); + bool CheckLoSToLoc(double x, double y, double z); + bool CheckLoSToLoc(double x, double y, double z, double mob_size); + double FindGroundZ(double x, double y); + double FindGroundZ(double x, double y, double z); + void ProjectileAnimation(Lua_Mob to, int item_id); + void ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow); + void ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed); + void ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle); + void ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle, double tilt); + void ProjectileAnimation(Lua_Mob to, int item_id, bool is_arrow, double speed, double angle, double tilt, double arc); + bool HasNPCSpecialAtk(const char *parse); + void SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5); + void SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5, Lua_Client specific_target); + void SetFlyMode(int in); + void SetTexture(int in); + void SetRace(int in); + void SetGender(int in); + void SendIllusionPacket(Lua_Illusion illusion); + void QuestReward(Lua_Client c); + void QuestReward(Lua_Client c, uint32 silver); + void QuestReward(Lua_Client c, uint32 silver, uint32 gold); + void QuestReward(Lua_Client c, uint32 silver, uint32 gold, uint32 platinum); + void CameraEffect(uint32 duration, uint32 intensity); + void CameraEffect(uint32 duration, uint32 intensity, Lua_Client c); + void CameraEffect(uint32 duration, uint32 intensity, Lua_Client c, bool global); + void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, + uint32 unk020); + void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, + uint32 unk020, bool perm_effect); + void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, + uint32 unk020, bool perm_effect, Lua_Client c); + void TempName(); + void TempName(const char *newname); + void SetGlobal(const char *varname, const char *newvalue, int options, const char *duration); + void SetGlobal(const char *varname, const char *newvalue, int options, const char *duration, Lua_Mob other); + void TarGlobal(const char *varname, const char *value, const char *duration, int npc_id, int char_id, int zone_id); + void DelGlobal(const char *varname); + void SetSlotTint(int material_slot, int red_tint, int green_tint, int blue_tint); + void WearChange(int material_slot, int texture, uint32 color); + void DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup); + void RemoveNimbusEffect(int effect_id); + bool IsRunning(); + void SetRunning(bool running); + void SetBodyType(int new_body, bool overwrite_orig); + void SetTargetable(bool on); + void ModSkillDmgTaken(int skill, int value); + int GetModSkillDmgTaken(int skill); + int GetSkillDmgTaken(int skill); + void SetAllowBeneficial(bool value); + bool GetAllowBeneficial(); + bool IsBeneficialAllowed(Lua_Mob target); + void ModVulnerability(int resist, int value); + int GetModVulnerability(int resist); + void SetDisableMelee(bool disable); + bool IsMeleeDisabled(); + void SetFlurryChance(int value); + int GetFlurryChance(); }; #endif diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 496339e88..67c65ce37 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -13,13 +13,13 @@ #include "../common/spdat.h" #include "../common/seperator.h" #include "lua_entity.h" +#include "lua_item.h" +#include "lua_iteminst.h" #include "lua_mob.h" #include "lua_hate_entry.h" #include "lua_hate_list.h" #include "lua_client.h" #include "lua_npc.h" -#include "lua_item.h" -#include "lua_iteminst.h" #include "lua_spell.h" #include "zone.h" @@ -815,7 +815,156 @@ void LuaParser::MapFunctions(lua_State *L) { .def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int))&Lua_Mob::SpellFinished) .def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int,bool))&Lua_Mob::SpellFinished) .def("SpellEffect", &Lua_Mob::SpellEffect) - .def("GetHateList", &Lua_Mob::GetHateList), + .def("GetHateList", &Lua_Mob::GetHateList) + .def("GetHateTop", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateTop) + .def("GetHateDamageTop", (Lua_Mob(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateDamageTop) + .def("GetHateRandom", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateRandom) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::AddToHateList) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::AddToHateList) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::AddToHateList) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool))&Lua_Mob::AddToHateList) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool))&Lua_Mob::AddToHateList) + .def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool,bool))&Lua_Mob::AddToHateList) + .def("SetHate", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::SetHate) + .def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::SetHate) + .def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::SetHate) + .def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount) + .def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount) + .def("GetDamageAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetDamageAmount) + .def("WipeHateList", (void(Lua_Mob::*)(void))&Lua_Mob::WipeHateList) + .def("CheckAggro", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckAggro) + .def("Stun", (void(Lua_Mob::*)(int))&Lua_Mob::Stun) + .def("UnStun", (void(Lua_Mob::*)(void))&Lua_Mob::UnStun) + .def("IsStunned", (bool(Lua_Mob::*)(void))&Lua_Mob::IsStunned) + .def("Spin", (void(Lua_Mob::*)(void))&Lua_Mob::Spin) + .def("Kill", (void(Lua_Mob::*)(void))&Lua_Mob::Kill) + .def("CanThisClassDoubleAttack", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDoubleAttack) + .def("CanThisClassDualWield", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDualWield) + .def("CanThisClassRiposte", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassRiposte) + .def("CanThisClassDodge", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDodge) + .def("CanThisClassParry", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassParry) + .def("CanThisClassBlock", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassBlock) + .def("SetInvul", (void(Lua_Mob::*)(bool))&Lua_Mob::SetInvul) + .def("GetInvul", (bool(Lua_Mob::*)(void))&Lua_Mob::GetInvul) + .def("SetExtraHaste", (void(Lua_Mob::*)(int))&Lua_Mob::SetExtraHaste) + .def("GetHaste", (int(Lua_Mob::*)(void))&Lua_Mob::GetHaste) + .def("GetMonkHandToHandDamage", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDamage) + .def("GetMonkHandToHandDelay", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDelay) + .def("Mesmerize", (void(Lua_Mob::*)(void))&Lua_Mob::Mesmerize) + .def("IsMezzed", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMezzed) + .def("IsEnraged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEnraged) + .def("GetReverseFactionCon", (int(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetReverseFactionCon) + .def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled) + .def("GetAggroRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAggroRange) + .def("GetAssistRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAssistRange) + .def("SetPetOrder", (void(Lua_Mob::*)(int))&Lua_Mob::SetPetOrder) + .def("GetPetOrder", (int(Lua_Mob::*)(void))&Lua_Mob::GetPetOrder) + .def("IsRoamer", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRoamer) + .def("IsRooted", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRooted) + .def("IsEngaged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEngaged) + .def("FaceTarget", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::FaceTarget) + .def("SetHeading", (void(Lua_Mob::*)(double))&Lua_Mob::SetHeading) + .def("CalculateHeadingToTarget", (double(Lua_Mob::*)(double,double))&Lua_Mob::CalculateHeadingToTarget) + .def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition) + .def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition) + .def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition2) + .def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition2) + .def("CalculateDistance", (float(Lua_Mob::*)(double,double,double))&Lua_Mob::CalculateDistance) + .def("SendTo", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendTo) + .def("SendToFixZ", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendToFixZ) + .def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int))&Lua_Mob::NPCSpecialAttacks) + .def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool))&Lua_Mob::NPCSpecialAttacks) + .def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool,bool))&Lua_Mob::NPCSpecialAttacks) + .def("GetResist", (int(Lua_Mob::*)(int))&Lua_Mob::GetResist) + .def("Charmed", (bool(Lua_Mob::*)(void))&Lua_Mob::Charmed) + .def("CheckAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckAggroAmount) + .def("CheckAggroAmount", (int(Lua_Mob::*)(int,bool))&Lua_Mob::CheckAggroAmount) + .def("CheckHealAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckHealAggroAmount) + .def("CheckHealAggroAmount", (int(Lua_Mob::*)(int,uint32))&Lua_Mob::CheckHealAggroAmount) + .def("GetAA", (int(Lua_Mob::*)(int))&Lua_Mob::GetAA) + .def("DivineAura", (bool(Lua_Mob::*)(void))&Lua_Mob::DivineAura) + .def("SetOOCRegen", (void(Lua_Mob::*)(int))&Lua_Mob::SetOOCRegen) + .def("GetEntityVariable", (const char*(Lua_Mob::*)(const char*))&Lua_Mob::GetEntityVariable) + .def("SetEntityVariable", (void(Lua_Mob::*)(const char*,const char*))&Lua_Mob::SetEntityVariable) + .def("EntityVariableExists", (bool(Lua_Mob::*)(const char*))&Lua_Mob::EntityVariableExists) + .def("Signal", (void(Lua_Mob::*)(uint32))&Lua_Mob::Signal) + .def("CombatRange", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CombatRange) + .def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoSpecialAttackDamage) + .def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoSpecialAttackDamage) + .def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage) + .def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage) + .def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int,bool))&Lua_Mob::DoSpecialAttackDamage) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoThrowingAttackDmg) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoThrowingAttackDmg) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item))&Lua_Mob::DoThrowingAttackDmg) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int))&Lua_Mob::DoThrowingAttackDmg) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int))&Lua_Mob::DoThrowingAttackDmg) + .def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int,int))&Lua_Mob::DoThrowingAttackDmg) + .def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoMeleeSkillAttackDmg) + .def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg) + .def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg) + .def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,bool))&Lua_Mob::DoMeleeSkillAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoArcheryAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int))&Lua_Mob::DoArcheryAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int))&Lua_Mob::DoArcheryAttackDmg) + .def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int,int))&Lua_Mob::DoArcheryAttackDmg) + .def("CheckLoS", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckLoS) + .def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double))&Lua_Mob::CheckLoSToLoc) + .def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CheckLoSToLoc) + .def("FindGroundZ", (double(Lua_Mob::*)(double,double))&Lua_Mob::FindGroundZ) + .def("FindGroundZ", (double(Lua_Mob::*)(double,double,double))&Lua_Mob::FindGroundZ) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::ProjectileAnimation) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::ProjectileAnimation) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double))&Lua_Mob::ProjectileAnimation) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double))&Lua_Mob::ProjectileAnimation) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double))&Lua_Mob::ProjectileAnimation) + .def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double,double))&Lua_Mob::ProjectileAnimation) + .def("HasNPCSpecialAtk", (bool(Lua_Mob::*)(const char*))&Lua_Mob::HasNPCSpecialAtk) + .def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32))&Lua_Mob::SendAppearanceEffect) + .def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32,Lua_Client))&Lua_Mob::SendAppearanceEffect) + .def("SetFlyMode", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlyMode) + .def("SetTexture", (void(Lua_Mob::*)(int))&Lua_Mob::SetTexture) + .def("SetRace", (void(Lua_Mob::*)(int))&Lua_Mob::SetRace) + .def("SetGender", (void(Lua_Mob::*)(int))&Lua_Mob::SetGender) + .def("SendIllusionPacket", (void(Lua_Mob::*)(Lua_Mob::Lua_Illusion))&Lua_Mob::SendIllusionPacket) + .def("QuestReward", (void(Lua_Mob::*)(Lua_Client))&Lua_Mob::QuestReward) + .def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32))&Lua_Mob::QuestReward) + .def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32))&Lua_Mob::QuestReward) + .def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32,uint32))&Lua_Mob::QuestReward) + .def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32))&Lua_Mob::CameraEffect) + .def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client))&Lua_Mob::CameraEffect) + .def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client,bool))&Lua_Mob::CameraEffect) + .def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32))&Lua_Mob::SendSpellEffect) + .def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool))&Lua_Mob::SendSpellEffect) + .def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool,Lua_Client))&Lua_Mob::SendSpellEffect) + .def("TempName", (void(Lua_Mob::*)(void))&Lua_Mob::TempName) + .def("TempName", (void(Lua_Mob::*)(const char*))&Lua_Mob::TempName) + .def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*))&Lua_Mob::SetGlobal) + .def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*,Lua_Mob))&Lua_Mob::SetGlobal) + .def("TarGlobal", (void(Lua_Mob::*)(const char*,const char*,const char*,int,int,int))&Lua_Mob::TarGlobal) + .def("DelGlobal", (void(Lua_Mob::*)(const char*))&Lua_Mob::DelGlobal) + .def("SetSlotTint", (void(Lua_Mob::*)(int,int,int,int))&Lua_Mob::SetSlotTint) + .def("WearChange", (void(Lua_Mob::*)(int,int,uint32))&Lua_Mob::WearChange) + .def("DoKnockback", (void(Lua_Mob::*)(Lua_Mob,uint32,uint32))&Lua_Mob::DoKnockback) + .def("RemoveNimbusEffect", (void(Lua_Mob::*)(int))&Lua_Mob::RemoveNimbusEffect) + .def("IsRunning", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRunning) + .def("SetRunning", (void(Lua_Mob::*)(bool))&Lua_Mob::SetRunning) + .def("SetBodyType", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetBodyType) + .def("SetTargetable", (void(Lua_Mob::*)(bool))&Lua_Mob::SetTargetable) + .def("ModSkillDmgTaken", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModSkillDmgTaken) + .def("GetModSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetModSkillDmgTaken) + .def("GetSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetSkillDmgTaken) + .def("SetAllowBeneficial", (void(Lua_Mob::*)(bool))&Lua_Mob::SetAllowBeneficial) + .def("GetAllowBeneficial", (bool(Lua_Mob::*)(void))&Lua_Mob::GetAllowBeneficial) + .def("IsBeneficialAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsBeneficialAllowed) + .def("ModVulnerability", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModVulnerability) + .def("GetModVulnerability", (int(Lua_Mob::*)(int))&Lua_Mob::GetModVulnerability) + .def("SetDisableMelee", (void(Lua_Mob::*)(bool))&Lua_Mob::SetDisableMelee) + .def("IsMeleeDisabled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMeleeDisabled) + .def("SetFlurryChance", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlurryChance) + .def("GetFlurryChance", (int(Lua_Mob::*)(void))&Lua_Mob::GetFlurryChance), luabind::class_("Client") .def(luabind::constructor<>()), @@ -847,7 +996,26 @@ void LuaParser::MapFunctions(lua_State *L) { .property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy), luabind::class_("HateList") - .def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator) + .def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator), + + luabind::class_("Illusion") + .def(luabind::constructor<>()) + .def_readwrite("race", &Lua_Mob::Lua_Illusion::in_race) + .def_readwrite("gender", &Lua_Mob::Lua_Illusion::in_gender) + .def_readwrite("texture", &Lua_Mob::Lua_Illusion::in_texture) + .def_readwrite("helmtexture", &Lua_Mob::Lua_Illusion::in_helmtexture) + .def_readwrite("haircolor", &Lua_Mob::Lua_Illusion::in_haircolor) + .def_readwrite("beardcolor", &Lua_Mob::Lua_Illusion::in_beardcolor) + .def_readwrite("eyecolor1", &Lua_Mob::Lua_Illusion::in_eyecolor1) + .def_readwrite("eyecolor2", &Lua_Mob::Lua_Illusion::in_eyecolor2) + .def_readwrite("hairstyle", &Lua_Mob::Lua_Illusion::in_hairstyle) + .def_readwrite("luclinface", &Lua_Mob::Lua_Illusion::in_luclinface) + .def_readwrite("beard", &Lua_Mob::Lua_Illusion::in_beard) + .def_readwrite("aa_title", &Lua_Mob::Lua_Illusion::in_aa_title) + .def_readwrite("drakkin_heritage", &Lua_Mob::Lua_Illusion::in_drakkin_heritage) + .def_readwrite("drakkin_tattoo", &Lua_Mob::Lua_Illusion::in_drakkin_tattoo) + .def_readwrite("drakkin_details", &Lua_Mob::Lua_Illusion::in_drakkin_details) + .def_readwrite("size", &Lua_Mob::Lua_Illusion::in_size) ]; } catch(std::exception &ex) { diff --git a/zone/lua_parser_events.cpp b/zone/lua_parser_events.cpp index 13ec568f8..9d282595c 100644 --- a/zone/lua_parser_events.cpp +++ b/zone/lua_parser_events.cpp @@ -9,12 +9,12 @@ #include "masterentity.h" #include "../common/seperator.h" +#include "lua_item.h" +#include "lua_iteminst.h" #include "lua_entity.h" #include "lua_mob.h" #include "lua_client.h" #include "lua_npc.h" -#include "lua_item.h" -#include "lua_iteminst.h" #include "lua_spell.h" #include "zone.h" #include "lua_parser_events.h" diff --git a/zone/mob.h b/zone/mob.h index 5a962406f..bb49d8517 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -130,7 +130,7 @@ public: virtual void SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint); virtual void WearChange(uint8 material_slot, uint16 texture, uint32 color); void DoAnim(const int animnum, int type=0, bool ackreq = true, eqFilterType filter = FilterNone); - void ProjectileAnimation(Mob* to, uint16 item_id, bool IsArrow = false, float speed = 0, + void ProjectileAnimation(Mob* to, int item_id, bool IsArrow = false, float speed = 0, float angle = 0, float tilt = 0, float arc = 0); void ChangeSize(float in_size, bool bNoRestriction = false); inline uint8 SeeInvisible() const { return see_invis; } @@ -497,10 +497,13 @@ public: void QuestJournalledSay(Client *QuestInitiator, const char *str); uint32 GetItemStat(uint32 itemid, const char *identifier); - int16 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false); uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0); - void SendIllusionPacket(uint16 in_race, uint8 in_gender = 0xFF, uint8 in_texture = 0xFF, uint8 in_helmtexture = 0xFF, uint8 in_haircolor = 0xFF, uint8 in_beardcolor = 0xFF, uint8 in_eyecolor1 = 0xFF, uint8 in_eyecolor2 = 0xFF, uint8 in_hairstyle = 0xFF, uint8 in_luclinface = 0xFF, uint8 in_beard = 0xFF, uint8 in_aa_title = 0xFF, uint32 in_drakkin_heritage = 0xFFFFFFFF, uint32 in_drakkin_tattoo = 0xFFFFFFFF, uint32 in_drakkin_details = 0xFFFFFFFF, float in_size = 0xFFFFFFFF); + void SendIllusionPacket(uint16 in_race, uint8 in_gender = 0xFF, uint8 in_texture = 0xFF, uint8 in_helmtexture = 0xFF, + uint8 in_haircolor = 0xFF, uint8 in_beardcolor = 0xFF, uint8 in_eyecolor1 = 0xFF, uint8 in_eyecolor2 = 0xFF, + uint8 in_hairstyle = 0xFF, uint8 in_luclinface = 0xFF, uint8 in_beard = 0xFF, uint8 in_aa_title = 0xFF, + uint32 in_drakkin_heritage = 0xFFFFFFFF, uint32 in_drakkin_tattoo = 0xFFFFFFFF, + uint32 in_drakkin_details = 0xFFFFFFFF, float in_size = 0xFFFFFFFF); virtual void Stun(int duration); virtual void UnStun(); inline void Silence(bool newval) { silenced = newval; } diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 62531e209..037a46270 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -6796,7 +6796,7 @@ XS(XS_Mob_ProjectileAnim) { Mob * THIS; Mob* mob; - uint16 item_id = (uint16)SvUV(ST(2)); + int item_id = SvUV(ST(2)); bool IsArrow = false; float speed = 0; float angle = 0; diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index c3244f156..6b88b7194 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -129,29 +129,16 @@ void QuestManager::Process() { cur++; } - list::iterator curS, endS, tmpS; - - curS = STimerList.begin(); - endS = STimerList.end(); - while (curS != endS) { - if(!curS->Timer_.Enabled()) { - //remove the timer - tmpS = curS; - tmpS++; - STimerList.erase(curS); - curS = tmpS; - } else if(curS->Timer_.Check()) { - //disable the timer so it gets deleted. - curS->Timer_.Disable(); - - //signal the event... - entity_list.SignalMobsByNPCID(curS->npc_id, curS->signal_id); - - //restart for the same reasons as above. - curS = STimerList.begin(); - endS = STimerList.end(); - } else - curS++; + auto cur_iter = STimerList.begin(); + while(cur_iter != STimerList.end()) { + if(!cur_iter->Timer_.Enabled()) { + cur_iter = STimerList.erase(cur_iter); + } else if(cur_iter->Timer_.Check()) { + entity_list.SignalMobsByNPCID(cur_iter->npc_id, cur_iter->signal_id); + cur_iter = STimerList.erase(cur_iter); + } else { + ++cur_iter; + } } } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 4950e3b35..6b25d3865 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1322,7 +1322,7 @@ void Mob::SendItemAnimation(Mob *to, const Item_Struct *item, SkillType skillInU safe_delete(outapp); } -void Mob::ProjectileAnimation(Mob* to, uint16 item_id, bool IsArrow, float speed, float angle, float tilt, float arc) { +void Mob::ProjectileAnimation(Mob* to, int item_id, bool IsArrow, float speed, float angle, float tilt, float arc) { const Item_Struct* item = nullptr; uint8 item_type = 0;