mirror of
https://github.com/EQEmu/Server.git
synced 2026-07-06 08:57:15 +00:00
Starting rewrite of lua parser in earnest
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../client.h"
|
||||
|
||||
void lua_register_client(sol::state *state) {
|
||||
state->new_usertype<Client>("Client",
|
||||
sol::base_classes, sol::bases<Mob, Entity>()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../corpse.h"
|
||||
|
||||
void lua_register_corpse(sol::state *state) {
|
||||
state->new_usertype<Corpse>("Corpse",
|
||||
sol::base_classes, sol::bases<Mob, Entity>()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../doors.h"
|
||||
|
||||
void lua_register_doors(sol::state *state) {
|
||||
state->new_usertype<Doors>("Doors",
|
||||
sol::base_classes, sol::bases<Entity>()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#include <sol.hpp>
|
||||
#include "../entity.h"
|
||||
#include "../client.h"
|
||||
#include "../npc.h"
|
||||
#include "../corpse.h"
|
||||
#include "../doors.h"
|
||||
#include "../object.h"
|
||||
|
||||
void lua_register_entity(sol::state *state) {
|
||||
state->new_usertype<Entity>("Entity",
|
||||
"IsClient", &Entity::IsClient,
|
||||
"IsNPC", &Entity::IsNPC,
|
||||
"IsMob", &Entity::IsMob,
|
||||
"IsMerc", &Entity::IsMerc,
|
||||
"IsCorpse", &Entity::IsCorpse,
|
||||
"IsPlayerCorpse", &Entity::IsPlayerCorpse,
|
||||
"IsNPCCorpse", &Entity::IsNPCCorpse,
|
||||
"IsObject", &Entity::IsObject,
|
||||
"IsDoor", &Entity::IsDoor,
|
||||
"IsTrap", &Entity::IsTrap,
|
||||
"IsBeacon", &Entity::IsBeacon,
|
||||
"IsEncounter", &Entity::IsEncounter,
|
||||
"IsBot", &Entity::IsBot,
|
||||
"IsAura", &Entity::IsAura,
|
||||
"CastToClient", (Client*(Entity::*)())&Entity::CastToClient,
|
||||
"CastToMob", (Mob*(Entity::*)())&Entity::CastToMob,
|
||||
//"CastToMerc", (Merc*(Entity::*)())&Entity::CastToMerc,
|
||||
"CastToCorpse", (Corpse*(Entity::*)())&Entity::CastToCorpse,
|
||||
"CastToObject", (Object*(Entity::*)())&Entity::CastToObject,
|
||||
"CastToDoors", (Doors*(Entity::*)())&Entity::CastToDoors,
|
||||
//"CastToTrap", (Trap*(Entity::*)())&Entity::CastToTrap,
|
||||
//"CastToBeacon", (Beacon*(Entity::*)())&Entity::CastToBeacon,
|
||||
//"CastToEncounter", (Encounter*(Entity::*)())&Entity::CastToEncounter,
|
||||
"GetID", &Entity::GetID,
|
||||
"GetName", &Entity::GetName
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
#pragma once
|
||||
|
||||
const char *LuaEvents[_LargestEventID] = {
|
||||
"event_say",
|
||||
"event_trade",
|
||||
"event_death",
|
||||
"event_spawn",
|
||||
"event_attack",
|
||||
"event_combat",
|
||||
"event_aggro",
|
||||
"event_slay",
|
||||
"event_npc_slay",
|
||||
"event_waypoint_arrive",
|
||||
"event_waypoint_depart",
|
||||
"event_timer",
|
||||
"event_signal",
|
||||
"event_hp",
|
||||
"event_enter",
|
||||
"event_exit",
|
||||
"event_enter_zone",
|
||||
"event_click_door",
|
||||
"event_loot",
|
||||
"event_zone",
|
||||
"event_level_up",
|
||||
"event_killed_merit",
|
||||
"event_cast_on",
|
||||
"event_task_accepted",
|
||||
"event_task_stage_complete",
|
||||
"event_task_update",
|
||||
"event_task_complete",
|
||||
"event_task_fail",
|
||||
"event_aggro_say",
|
||||
"event_player_pickup",
|
||||
"event_popup_response",
|
||||
"event_environmental_damage",
|
||||
"event_proximity_say",
|
||||
"event_cast",
|
||||
"event_cast_begin",
|
||||
"event_scale_calc",
|
||||
"event_item_enter_zone",
|
||||
"event_target_change",
|
||||
"event_hate_list",
|
||||
"event_spell_effect",
|
||||
"event_spell_effect",
|
||||
"event_spell_buff_tic",
|
||||
"event_spell_buff_tic",
|
||||
"event_spell_fade",
|
||||
"event_spell_effect_translocate_complete",
|
||||
"event_combine_success",
|
||||
"event_combine_failure",
|
||||
"event_item_click",
|
||||
"event_item_click_cast",
|
||||
"event_group_change",
|
||||
"event_forage_success",
|
||||
"event_forage_failure",
|
||||
"event_fish_start",
|
||||
"event_fish_success",
|
||||
"event_fish_failure",
|
||||
"event_click_object",
|
||||
"event_discover_item",
|
||||
"event_disconnect",
|
||||
"event_connect",
|
||||
"event_item_tick",
|
||||
"event_duel_win",
|
||||
"event_duel_lose",
|
||||
"event_encounter_load",
|
||||
"event_encounter_unload",
|
||||
"event_command",
|
||||
"event_drop_item",
|
||||
"event_destroy_item",
|
||||
"event_feign_death",
|
||||
"event_weapon_proc",
|
||||
"event_equip_item",
|
||||
"event_unequip_item",
|
||||
"event_augment_item",
|
||||
"event_unaugment_item",
|
||||
"event_augment_insert",
|
||||
"event_augment_remove",
|
||||
"event_enter_area",
|
||||
"event_leave_area",
|
||||
"event_respawn",
|
||||
"event_death_complete",
|
||||
"event_unhandled_opcode",
|
||||
"event_tick",
|
||||
"event_spawn_zone",
|
||||
"event_death_zone",
|
||||
"event_use_skill"
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
void lua_register_general(sol::state *state);
|
||||
void lua_register_entity(sol::state *state);
|
||||
void lua_register_mob(sol::state *state);
|
||||
void lua_register_npc(sol::state *state);
|
||||
void lua_register_client(sol::state *state);
|
||||
void lua_register_doors(sol::state *state);
|
||||
void lua_register_corpse(sol::state *state);
|
||||
void lua_register_object(sol::state *state);
|
||||
@@ -0,0 +1,5 @@
|
||||
#include <sol.hpp>
|
||||
|
||||
void lua_register_general(sol::state *state) {
|
||||
auto table = state->create_named_table("eqemu");
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../mob.h"
|
||||
|
||||
void lua_register_mob(sol::state *state) {
|
||||
state->new_usertype<Mob>("Mob",
|
||||
sol::base_classes, sol::bases<Entity>()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../npc.h"
|
||||
|
||||
void lua_register_npc(sol::state *state) {
|
||||
state->new_usertype<NPC>("NPC",
|
||||
sol::base_classes, sol::bases<Mob, Entity>()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <sol.hpp>
|
||||
#include "../object.h"
|
||||
|
||||
void lua_register_object(sol::state *state) {
|
||||
state->new_usertype<Object>("Object",
|
||||
sol::base_classes, sol::bases<Entity>()
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
#pragma once
|
||||
#include "../quest_parser_collection.h"
|
||||
#include "../quest_interface.h"
|
||||
#include <string>
|
||||
#include <sol_forward.hpp>
|
||||
|
||||
class Client;
|
||||
class NPC;
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
class ItemInstance;
|
||||
}
|
||||
|
||||
class LuaParser : public QuestInterface {
|
||||
public:
|
||||
~LuaParser();
|
||||
|
||||
virtual int EventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventGlobalNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventGlobalPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventItem(QuestEventID evt, Client *client, EQEmu::ItemInstance *item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int EventEncounter(QuestEventID evt, std::string encounter_name, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
virtual bool HasQuestSub(uint32 npc_id, QuestEventID evt);
|
||||
virtual bool HasGlobalQuestSub(QuestEventID evt);
|
||||
virtual bool PlayerHasQuestSub(QuestEventID evt);
|
||||
virtual bool GlobalPlayerHasQuestSub(QuestEventID evt);
|
||||
virtual bool SpellHasQuestSub(uint32 spell_id, QuestEventID evt);
|
||||
virtual bool ItemHasQuestSub(EQEmu::ItemInstance *itm, QuestEventID evt);
|
||||
virtual bool EncounterHasQuestSub(std::string encounter_name, QuestEventID evt);
|
||||
|
||||
virtual void LoadNPCScript(std::string filename, int npc_id);
|
||||
virtual void LoadGlobalNPCScript(std::string filename);
|
||||
virtual void LoadPlayerScript(std::string filename);
|
||||
virtual void LoadGlobalPlayerScript(std::string filename);
|
||||
virtual void LoadItemScript(std::string filename, EQEmu::ItemInstance *item);
|
||||
virtual void LoadSpellScript(std::string filename, uint32 spell_id);
|
||||
virtual void LoadEncounterScript(std::string filename, std::string encounter_name);
|
||||
|
||||
virtual void AddVar(std::string name, std::string val);
|
||||
virtual std::string GetVar(std::string name);
|
||||
virtual void Init();
|
||||
virtual void ReloadQuests();
|
||||
virtual uint32 GetIdentifier() { return 0xb0712acc; }
|
||||
|
||||
virtual int DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int DispatchEventItem(QuestEventID evt, Client *client, EQEmu::ItemInstance *item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
virtual int DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
static LuaParser* Instance() {
|
||||
static LuaParser inst;
|
||||
return &inst;
|
||||
}
|
||||
|
||||
bool HasFunction(const std::string &function, const std::string &package_name);
|
||||
|
||||
//Mod Extensions
|
||||
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 TryCriticalHit(Mob *self, Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
|
||||
void CommonOutgoingHitSuccess(Mob *self, Mob* other, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
|
||||
uint32 GetRequiredAAExperience(Client *self, bool &ignoreDefault);
|
||||
uint32 GetEXPForLevel(Client *self, uint16 level, bool &ignoreDefault);
|
||||
uint32 GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault);
|
||||
|
||||
private:
|
||||
LuaParser();
|
||||
LuaParser(const LuaParser&) = delete;
|
||||
LuaParser& operator=(const LuaParser&) = delete;
|
||||
|
||||
int _EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers, sol::function *l_func = nullptr);
|
||||
int _EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers, sol::function *l_func = nullptr);
|
||||
int _EventItem(std::string package_name, QuestEventID evt, Client *client, EQEmu::ItemInstance *item, Mob *mob, std::string data,
|
||||
uint32 extra_data, std::vector<EQEmu::Any> *extra_pointers, sol::function *l_func = nullptr);
|
||||
int _EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers, sol::function *l_func = nullptr);
|
||||
int _EventEncounter(std::string package_name, QuestEventID evt, std::string encounter_name, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
void LoadScript(const std::string &filename);
|
||||
void LoadScript(const std::string &filename, const std::string &package_name);
|
||||
void MapFunctions();
|
||||
QuestEventID ConvertLuaEvent(QuestEventID evt);
|
||||
|
||||
struct Implementation;
|
||||
std::unique_ptr<Implementation> mImpl;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
struct Script
|
||||
{
|
||||
bool Loaded;
|
||||
sol::environment Env;
|
||||
};
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
** Lua BitOp -- a bit operations library for Lua 5.1/5.2.
|
||||
** http://bitop.luajit.org/
|
||||
**
|
||||
** Copyright (C) 2008-2012 Mike Pall. All rights reserved.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining
|
||||
** a copy of this software and associated documentation files (the
|
||||
** "Software"), to deal in the Software without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Software, and to
|
||||
** permit persons to whom the Software is furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be
|
||||
** included in all copies or substantial portions of the Software.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
**
|
||||
** [ MIT license: http://www.opensource.org/licenses/mit-license.php ]
|
||||
*/
|
||||
|
||||
#ifdef LUA_EQEMU
|
||||
#define LUA_BITOP_VERSION "1.0.2"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int32_t SBits;
|
||||
typedef uint32_t UBits;
|
||||
|
||||
typedef union {
|
||||
lua_Number n;
|
||||
#ifdef LUA_NUMBER_DOUBLE
|
||||
uint64_t b;
|
||||
#else
|
||||
UBits b;
|
||||
#endif
|
||||
} BitNum;
|
||||
|
||||
/* Convert argument to bit type. */
|
||||
static UBits barg(lua_State *L, int idx)
|
||||
{
|
||||
BitNum bn;
|
||||
UBits b;
|
||||
#if LUA_VERSION_NUM < 502
|
||||
bn.n = lua_tonumber(L, idx);
|
||||
#else
|
||||
bn.n = luaL_checknumber(L, idx);
|
||||
#endif
|
||||
#if defined(LUA_NUMBER_DOUBLE)
|
||||
bn.n += 6755399441055744.0; /* 2^52+2^51 */
|
||||
#ifdef SWAPPED_DOUBLE
|
||||
b = (UBits)(bn.b >> 32);
|
||||
#else
|
||||
b = (UBits)bn.b;
|
||||
#endif
|
||||
#elif defined(LUA_NUMBER_INT) || defined(LUA_NUMBER_LONG) || \
|
||||
defined(LUA_NUMBER_LONGLONG) || defined(LUA_NUMBER_LONG_LONG) || \
|
||||
defined(LUA_NUMBER_LLONG)
|
||||
if (sizeof(UBits) == sizeof(lua_Number))
|
||||
b = bn.b;
|
||||
else
|
||||
b = (UBits)(SBits)bn.n;
|
||||
#elif defined(LUA_NUMBER_FLOAT)
|
||||
#error "A 'float' lua_Number type is incompatible with this library"
|
||||
#else
|
||||
#error "Unknown number type, check LUA_NUMBER_* in luaconf.h"
|
||||
#endif
|
||||
#if LUA_VERSION_NUM < 502
|
||||
if (b == 0 && !lua_isnumber(L, idx)) {
|
||||
luaL_typerror(L, idx, "number");
|
||||
}
|
||||
#endif
|
||||
return b;
|
||||
}
|
||||
|
||||
/* Return bit type. */
|
||||
#define BRET(b) lua_pushnumber(L, (lua_Number)(SBits)(b)); return 1;
|
||||
|
||||
static int bit_tobit(lua_State *L) { BRET(barg(L, 1)) }
|
||||
static int bit_bnot(lua_State *L) { BRET(~barg(L, 1)) }
|
||||
|
||||
#define BIT_OP(func, opr) \
|
||||
static int func(lua_State *L) { int i; UBits b = barg(L, 1); \
|
||||
for (i = lua_gettop(L); i > 1; i--) b opr barg(L, i); BRET(b) }
|
||||
BIT_OP(bit_band, &=)
|
||||
BIT_OP(bit_bor, |=)
|
||||
BIT_OP(bit_bxor, ^=)
|
||||
|
||||
#define bshl(b, n) (b << n)
|
||||
#define bshr(b, n) (b >> n)
|
||||
#define bsar(b, n) ((SBits)b >> n)
|
||||
#define brol(b, n) ((b << n) | (b >> (32-n)))
|
||||
#define bror(b, n) ((b << (32-n)) | (b >> n))
|
||||
#define BIT_SH(func, fn) \
|
||||
static int func(lua_State *L) { \
|
||||
UBits b = barg(L, 1); UBits n = barg(L, 2) & 31; BRET(fn(b, n)) }
|
||||
BIT_SH(bit_lshift, bshl)
|
||||
BIT_SH(bit_rshift, bshr)
|
||||
BIT_SH(bit_arshift, bsar)
|
||||
BIT_SH(bit_rol, brol)
|
||||
BIT_SH(bit_ror, bror)
|
||||
|
||||
static int bit_bswap(lua_State *L)
|
||||
{
|
||||
UBits b = barg(L, 1);
|
||||
b = (b >> 24) | ((b >> 8) & 0xff00) | ((b & 0xff00) << 8) | (b << 24);
|
||||
BRET(b)
|
||||
}
|
||||
|
||||
static int bit_tohex(lua_State *L)
|
||||
{
|
||||
UBits b = barg(L, 1);
|
||||
SBits n = lua_isnone(L, 2) ? 8 : (SBits)barg(L, 2);
|
||||
const char *hexdigits = "0123456789abcdef";
|
||||
char buf[8];
|
||||
int i;
|
||||
if (n < 0) { n = -n; hexdigits = "0123456789ABCDEF"; }
|
||||
if (n > 8) n = 8;
|
||||
for (i = (int)n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; }
|
||||
lua_pushlstring(L, buf, (size_t)n);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const struct luaL_Reg bit_funcs[] = {
|
||||
{ "tobit", bit_tobit },
|
||||
{ "bnot", bit_bnot },
|
||||
{ "band", bit_band },
|
||||
{ "bor", bit_bor },
|
||||
{ "bxor", bit_bxor },
|
||||
{ "lshift", bit_lshift },
|
||||
{ "rshift", bit_rshift },
|
||||
{ "arshift", bit_arshift },
|
||||
{ "rol", bit_rol },
|
||||
{ "ror", bit_ror },
|
||||
{ "bswap", bit_bswap },
|
||||
{ "tohex", bit_tohex },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
/* Signed right-shifts are implementation-defined per C89/C99.
|
||||
** But the de facto standard are arithmetic right-shifts on two's
|
||||
** complement CPUs. This behaviour is required here, so test for it.
|
||||
*/
|
||||
#define BAD_SAR (bsar(-8, 2) != (SBits)-2)
|
||||
|
||||
int luaopen_bit(lua_State *L)
|
||||
{
|
||||
UBits b;
|
||||
lua_pushnumber(L, (lua_Number)1437217655L);
|
||||
b = barg(L, -1);
|
||||
if (b != (UBits)1437217655L || BAD_SAR) { /* Perform a simple self-test. */
|
||||
const char *msg = "compiled with incompatible luaconf.h";
|
||||
#ifdef LUA_NUMBER_DOUBLE
|
||||
#ifdef _WIN32
|
||||
if (b == (UBits)1610612736L)
|
||||
msg = "use D3DCREATE_FPU_PRESERVE with DirectX";
|
||||
#endif
|
||||
if (b == (UBits)1127743488L)
|
||||
msg = "not compiled with SWAPPED_DOUBLE";
|
||||
#endif
|
||||
if (BAD_SAR)
|
||||
msg = "arithmetic right-shift broken";
|
||||
luaL_error(L, "bit library self-test failed (%s)", msg);
|
||||
}
|
||||
#if LUA_VERSION_NUM < 502
|
||||
luaL_register(L, "bit", bit_funcs);
|
||||
#else
|
||||
luaL_newlib(L, bit_funcs);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef _LUABIT_H
|
||||
#define _LUABIT_H
|
||||
|
||||
int luaopen_bit(lua_State *L);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,315 @@
|
||||
#ifndef EQEMU_LUA_CLIENT_H
|
||||
#define EQEMU_LUA_CLIENT_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_mob.h"
|
||||
|
||||
class Client;
|
||||
class Lua_Group;
|
||||
class Lua_Raid;
|
||||
class Lua_Inventory;
|
||||
class Lua_Packet;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client();
|
||||
luabind::scope lua_register_inventory_where();
|
||||
|
||||
class Lua_Client : public Lua_Mob
|
||||
{
|
||||
typedef Client NativeType;
|
||||
public:
|
||||
Lua_Client() { SetLuaPtrData(nullptr); }
|
||||
Lua_Client(Client *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_Client() { }
|
||||
|
||||
operator Client*() {
|
||||
return reinterpret_cast<Client*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
void SendSound();
|
||||
void Save();
|
||||
void Save(int commit_now);
|
||||
void SaveBackup();
|
||||
bool Connected();
|
||||
bool InZone();
|
||||
void Kick();
|
||||
void Disconnect();
|
||||
bool IsLD();
|
||||
void WorldKick();
|
||||
bool GetAnon();
|
||||
void Duck();
|
||||
void Stand();
|
||||
void SetGM(bool v);
|
||||
void SetPVP(bool v);
|
||||
bool GetPVP();
|
||||
bool GetGM();
|
||||
void SetBaseClass(int v);
|
||||
void SetBaseRace(int v);
|
||||
void SetBaseGender(int v);
|
||||
int GetBaseFace();
|
||||
int GetLanguageSkill(int skill_id);
|
||||
const char *GetLastName();
|
||||
int GetLDoNPointsTheme(int theme);
|
||||
int GetBaseSTR();
|
||||
int GetBaseSTA();
|
||||
int GetBaseCHA();
|
||||
int GetBaseDEX();
|
||||
int GetBaseINT();
|
||||
int GetBaseAGI();
|
||||
int GetBaseWIS();
|
||||
int GetWeight();
|
||||
uint32 GetEXP();
|
||||
uint32 GetAAExp();
|
||||
uint32 GetAAPercent();
|
||||
uint32 GetTotalSecondsPlayed();
|
||||
void UpdateLDoNPoints(int points, uint32 theme);
|
||||
void SetDeity(int v);
|
||||
void AddEXP(uint32 add_exp);
|
||||
void AddEXP(uint32 add_exp, int conlevel);
|
||||
void AddEXP(uint32 add_exp, int conlevel, bool resexp);
|
||||
void SetEXP(uint32 set_exp, uint32 set_aaxp);
|
||||
void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp);
|
||||
void SetBindPoint();
|
||||
void SetBindPoint(int to_zone);
|
||||
void SetBindPoint(int to_zone, int to_instance);
|
||||
void SetBindPoint(int to_zone, int to_instance, float new_x);
|
||||
void SetBindPoint(int to_zone, int to_instance, float new_x, float new_y);
|
||||
void SetBindPoint(int to_zone, int to_instance, float new_x, float new_y, float new_z);
|
||||
float GetBindX();
|
||||
float GetBindX(int index);
|
||||
float GetBindY();
|
||||
float GetBindY(int index);
|
||||
float GetBindZ();
|
||||
float GetBindZ(int index);
|
||||
float GetBindHeading();
|
||||
float GetBindHeading(int index);
|
||||
uint32 GetBindZoneID();
|
||||
uint32 GetBindZoneID(int index);
|
||||
void MovePC(int zone, float x, float y, float z, float heading);
|
||||
void MovePCInstance(int zone, int instance, float x, float y, float z, float heading);
|
||||
void ChangeLastName(const char *in);
|
||||
int GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 race, uint32 class_, uint32 deity, uint32 faction, Lua_NPC npc);
|
||||
void SetFactionLevel(uint32 char_id, uint32 npc_id, int char_class, int char_race, int char_deity);
|
||||
void SetFactionLevel2(uint32 char_id, int faction_id, int char_class, int char_race, int char_deity, int value, int temp);
|
||||
int GetRawItemAC();
|
||||
uint32 AccountID();
|
||||
const char *AccountName();
|
||||
int Admin();
|
||||
uint32 CharacterID();
|
||||
int GuildRank();
|
||||
uint32 GuildID();
|
||||
int GetFace();
|
||||
bool TakeMoneyFromPP(uint64 copper);
|
||||
bool TakeMoneyFromPP(uint64 copper, bool update_client);
|
||||
void AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client);
|
||||
bool TGB();
|
||||
int GetSkillPoints();
|
||||
void SetSkillPoints(int skill);
|
||||
void IncreaseSkill(int skill_id);
|
||||
void IncreaseSkill(int skill_id, int value);
|
||||
void IncreaseLanguageSkill(int skill_id);
|
||||
void IncreaseLanguageSkill(int skill_id, int value);
|
||||
int GetRawSkill(int skill_id);
|
||||
bool HasSkill(int skill_id);
|
||||
bool CanHaveSkill(int skill_id);
|
||||
void SetSkill(int skill_id, int value);
|
||||
void AddSkill(int skill_id, int value);
|
||||
void CheckSpecializeIncrease(int spell_id);
|
||||
void CheckIncreaseSkill(int skill_id, Lua_Mob target);
|
||||
void CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod);
|
||||
void SetLanguageSkill(int language, int value);
|
||||
int MaxSkill(int skill_id);
|
||||
bool IsMedding();
|
||||
int GetDuelTarget();
|
||||
bool IsDueling();
|
||||
void SetDuelTarget(int c);
|
||||
void SetDueling(bool v);
|
||||
void ResetAA();
|
||||
void MemSpell(int spell_id, int slot);
|
||||
void MemSpell(int spell_id, int slot, bool update_client);
|
||||
void UnmemSpell(int slot);
|
||||
void UnmemSpell(int slot, bool update_client);
|
||||
void UnmemSpellBySpellID(int32 spell_id);
|
||||
void UnmemSpellAll();
|
||||
void UnmemSpellAll(bool update_client);
|
||||
void ScribeSpell(int spell_id, int slot);
|
||||
void ScribeSpell(int spell_id, int slot, bool update_client);
|
||||
void UnscribeSpell(int slot);
|
||||
void UnscribeSpell(int slot, bool update_client);
|
||||
void UnscribeSpellAll();
|
||||
void UnscribeSpellAll(bool update_client);
|
||||
void TrainDisc(int itemid);
|
||||
void TrainDiscBySpellID(int32 spell_id);
|
||||
int GetDiscSlotBySpellID(int32 spell_id);
|
||||
void UntrainDisc(int slot);
|
||||
void UntrainDisc(int slot, bool update_client);
|
||||
void UntrainDiscAll();
|
||||
void UntrainDiscAll(bool update_client);
|
||||
bool IsSitting();
|
||||
void SetFeigned(bool v);
|
||||
bool GetFeigned();
|
||||
bool AutoSplitEnabled();
|
||||
void SetHorseId(int id);
|
||||
int GetHorseId();
|
||||
void NukeItem(uint32 item_num);
|
||||
void NukeItem(uint32 item_num, int where_to_check);
|
||||
void SetTint(int slot_id, uint32 color);
|
||||
void SetMaterial(int slot_id, uint32 item_id);
|
||||
void Undye();
|
||||
int GetItemIDAt(int slot_id);
|
||||
int GetAugmentIDAt(int slot_id, int aug_slot);
|
||||
void DeleteItemInInventory(int slot_id, int quantity);
|
||||
void DeleteItemInInventory(int slot_id, int quantity, bool update_client);
|
||||
void SummonItem(uint32 item_id);
|
||||
void SummonItem(uint32 item_id, int charges);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
|
||||
bool attuned);
|
||||
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
|
||||
bool attuned, int to_slot);
|
||||
void SetStats(int type, int value);
|
||||
void IncStats(int type, int value);
|
||||
void DropItem(int slot_id);
|
||||
void BreakInvis();
|
||||
void LeaveGroup();
|
||||
bool IsGrouped();
|
||||
bool IsRaidGrouped();
|
||||
bool Hungry();
|
||||
bool Thirsty();
|
||||
int GetInstrumentMod(int spell_id);
|
||||
bool DecreaseByID(uint32 type, int amt);
|
||||
void Escape();
|
||||
void GoFish();
|
||||
void ForageItem();
|
||||
void ForageItem(bool guarantee);
|
||||
float CalcPriceMod(Lua_Mob other, bool reverse);
|
||||
void ResetTrade();
|
||||
bool UseDiscipline(int spell_id, int target_id);
|
||||
int GetCharacterFactionLevel(int faction_id);
|
||||
void SetZoneFlag(int zone_id);
|
||||
void ClearZoneFlag(int zone_id);
|
||||
bool HasZoneFlag(int zone_id);
|
||||
void SendZoneFlagInfo(Lua_Client to);
|
||||
void SetAATitle(const char *title);
|
||||
int GetClientVersion();
|
||||
uint32 GetClientVersionBit();
|
||||
void SetTitleSuffix(const char *text);
|
||||
void SetAAPoints(int points);
|
||||
int GetAAPoints();
|
||||
int GetSpentAA();
|
||||
void AddAAPoints(int points);
|
||||
void RefundAA();
|
||||
int GetModCharacterFactionLevel(int faction);
|
||||
int GetLDoNWins();
|
||||
int GetLDoNLosses();
|
||||
int GetLDoNWinsTheme(int theme);
|
||||
int GetLDoNLossesTheme(int theme);
|
||||
int GetStartZone();
|
||||
void SetStartZone(int zone_id);
|
||||
void SetStartZone(int zone_id, float x);
|
||||
void SetStartZone(int zone_id, float x, float y);
|
||||
void SetStartZone(int zone_id, float x, float y, float z);
|
||||
void KeyRingAdd(uint32 item);
|
||||
bool KeyRingCheck(uint32 item);
|
||||
void AddPVPPoints(uint32 points);
|
||||
void AddCrystals(uint32 radiant, uint32 ebon);
|
||||
uint32 GetPVPPoints();
|
||||
uint32 GetRadiantCrystals();
|
||||
uint32 GetEbonCrystals();
|
||||
void QuestReadBook(const char *text, int type);
|
||||
void UpdateGroupAAs(int points, uint32 type);
|
||||
uint32 GetGroupPoints();
|
||||
uint32 GetRaidPoints();
|
||||
void LearnRecipe(uint32 recipe);
|
||||
int GetEndurance();
|
||||
int GetMaxEndurance();
|
||||
int GetEndurancePercent();
|
||||
void SetEndurance(int endur);
|
||||
void SendOPTranslocateConfirm(Lua_Mob caster, int spell_id);
|
||||
uint32 GetIP();
|
||||
void AddLevelBasedExp(int exp_pct);
|
||||
void AddLevelBasedExp(int exp_pct, int max_level);
|
||||
void IncrementAA(int aa);
|
||||
bool GrantAlternateAdvancementAbility(int aa_id, int points);
|
||||
bool GrantAlternateAdvancementAbility(int aa_id, int points, bool ignore_cost);
|
||||
void MarkSingleCompassLoc(float in_x, float in_y, float in_z);
|
||||
void MarkSingleCompassLoc(float in_x, float in_y, float in_z, int count);
|
||||
void ClearCompassMark();
|
||||
int GetNextAvailableSpellBookSlot();
|
||||
int GetNextAvailableSpellBookSlot(int start);
|
||||
int FindSpellBookSlotBySpellID(int spell_id);
|
||||
void UpdateTaskActivity(int task, int activity, int count);
|
||||
void AssignTask(int task, int npc_id);
|
||||
void AssignTask(int task, int npc_id, bool enforce_level_requirement);
|
||||
void FailTask(int task);
|
||||
bool IsTaskCompleted(int task);
|
||||
bool IsTaskActive(int task);
|
||||
bool IsTaskActivityActive(int task, int activity);
|
||||
int GetCorpseCount();
|
||||
int GetCorpseID(int corpse);
|
||||
int GetCorpseItemAt(int corpse, int slot);
|
||||
void AssignToInstance(int instance_id);
|
||||
void Freeze();
|
||||
void UnFreeze();
|
||||
int GetAggroCount();
|
||||
uint64 GetCarriedMoney();
|
||||
uint64 GetAllMoney();
|
||||
uint32 GetMoney(uint8 type, uint8 subtype);
|
||||
void OpenLFGuildWindow();
|
||||
void Signal(uint32 id);
|
||||
void AddAlternateCurrencyValue(uint32 currency, int amount);
|
||||
void SendWebLink(const char *site);
|
||||
bool HasSpellScribed(int spell_id);
|
||||
void SetAccountFlag(std::string flag, std::string val);
|
||||
std::string GetAccountFlag(std::string flag);
|
||||
int GetAccountAge();
|
||||
Lua_Group GetGroup();
|
||||
Lua_Raid GetRaid();
|
||||
bool PutItemInInventory(int slot_id, Lua_ItemInst inst);
|
||||
bool PushItemOnCursor(Lua_ItemInst inst);
|
||||
Lua_Inventory GetInventory();
|
||||
void SendItemScale(Lua_ItemInst inst);
|
||||
void QueuePacket(Lua_Packet app);
|
||||
void QueuePacket(Lua_Packet app, bool ack_req);
|
||||
void QueuePacket(Lua_Packet app, bool ack_req, int client_connection_status);
|
||||
void QueuePacket(Lua_Packet app, bool ack_req, int client_connection_status, int filter);
|
||||
int GetHunger();
|
||||
int GetThirst();
|
||||
void SetHunger(int in_hunger);
|
||||
void SetThirst(int in_thirst);
|
||||
void SetConsumption(int in_hunger, int in_thirst);
|
||||
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg);
|
||||
void SendColoredText(uint32 type, std::string msg);
|
||||
void PlayMP3(std::string file);
|
||||
void QuestReward(Lua_Mob target);
|
||||
void QuestReward(Lua_Mob target, uint32 copper);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver, uint32 gold);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid, uint32 exp);
|
||||
void QuestReward(Lua_Mob target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid, uint32 exp, bool faction);
|
||||
void QuestReward(Lua_Mob target, luabind::adl::object reward);
|
||||
bool IsDead();
|
||||
int CalcCurrentWeight();
|
||||
int CalcATK();
|
||||
void FilteredMessage(Mob *sender, uint32 type, int filter, const char* message);
|
||||
void EnableAreaHPRegen(int value);
|
||||
void DisableAreaHPRegen();
|
||||
void EnableAreaManaRegen(int value);
|
||||
void DisableAreaManaRegen();
|
||||
void EnableAreaEndRegen(int value);
|
||||
void DisableAreaEndRegen();
|
||||
void EnableAreaRegens(int value);
|
||||
void DisableAreaRegens();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,191 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "corpse.h"
|
||||
#include "lua_corpse.h"
|
||||
#include "lua_client.h"
|
||||
|
||||
uint32 Lua_Corpse::GetCharID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCharID();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetDecayTime() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetDecayTime();
|
||||
}
|
||||
|
||||
void Lua_Corpse::Lock() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Lock();
|
||||
}
|
||||
|
||||
void Lua_Corpse::UnLock() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UnLock();
|
||||
}
|
||||
|
||||
bool Lua_Corpse::IsLocked() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsLocked();
|
||||
}
|
||||
|
||||
void Lua_Corpse::ResetLooter() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ResetLooter();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetDBID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCorpseDBID();
|
||||
}
|
||||
|
||||
bool Lua_Corpse::IsRezzed() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsRezzed();
|
||||
}
|
||||
|
||||
const char* Lua_Corpse::GetOwnerName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetOwnerName();
|
||||
}
|
||||
|
||||
bool Lua_Corpse::Save() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->Save();
|
||||
}
|
||||
|
||||
void Lua_Corpse::Delete() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Delete();
|
||||
}
|
||||
|
||||
void Lua_Corpse::Bury() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Bury();
|
||||
}
|
||||
|
||||
void Lua_Corpse::Depop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Depop();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::CountItems() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CountItems();
|
||||
}
|
||||
|
||||
void Lua_Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(itemnum, charges, slot, aug1, aug2, aug3, aug4, aug5);
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetWornItem(int16 equipSlot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetWornItem(equipSlot);
|
||||
}
|
||||
|
||||
void Lua_Corpse::RemoveItem(uint16 lootslot) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveItem(lootslot);
|
||||
}
|
||||
|
||||
void Lua_Corpse::SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCash(copper, silver, gold, platinum);
|
||||
}
|
||||
|
||||
void Lua_Corpse::RemoveCash() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveCash();
|
||||
}
|
||||
|
||||
bool Lua_Corpse::IsEmpty() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEmpty();
|
||||
}
|
||||
|
||||
void Lua_Corpse::SetDecayTimer(uint32 decaytime) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDecayTimer(decaytime);
|
||||
}
|
||||
|
||||
bool Lua_Corpse::CanMobLoot(int charid) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->CanPlayerLoot(charid);
|
||||
}
|
||||
|
||||
void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AllowPlayerLoot(them, slot);
|
||||
}
|
||||
|
||||
bool Lua_Corpse::Summon(Lua_Client client, bool spell, bool checkdistance) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->Summon(client, spell, checkdistance);
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetCopper() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCopper();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetSilver() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSilver();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetGold() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetGold();
|
||||
}
|
||||
|
||||
uint32 Lua_Corpse::GetPlatinum() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPlatinum();
|
||||
}
|
||||
|
||||
void Lua_Corpse::AddLooter(Lua_Mob who) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddLooter(who);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_corpse() {
|
||||
return luabind::class_<Lua_Corpse, Lua_Mob>("Corpse")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Corpse::Null)
|
||||
.property("valid", &Lua_Corpse::Valid)
|
||||
.def("GetCharID", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetCharID)
|
||||
.def("GetDecayTime", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetDecayTime)
|
||||
.def("Lock", (void(Lua_Corpse::*)(void))&Lua_Corpse::Lock)
|
||||
.def("UnLock", (void(Lua_Corpse::*)(void))&Lua_Corpse::UnLock)
|
||||
.def("IsLocked", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsLocked)
|
||||
.def("ResetLooter", (void(Lua_Corpse::*)(void))&Lua_Corpse::ResetLooter)
|
||||
.def("GetDBID", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetDBID)
|
||||
.def("IsRezzed", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsRezzed)
|
||||
.def("GetOwnerName", (const char *(Lua_Corpse::*)(void))&Lua_Corpse::GetOwnerName)
|
||||
.def("Save", (bool(Lua_Corpse::*)(void))&Lua_Corpse::Save)
|
||||
.def("Delete", (void(Lua_Corpse::*)(void))&Lua_Corpse::Delete)
|
||||
.def("Bury", (void(Lua_Corpse::*)(void))&Lua_Corpse::Bury)
|
||||
.def("Depop", (void(Lua_Corpse::*)(void))&Lua_Corpse::Depop)
|
||||
.def("CountItems", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::CountItems)
|
||||
.def("AddItem", (void(Lua_Corpse::*)(uint32, uint16, int16, uint32, uint32, uint32, uint32, uint32))&Lua_Corpse::AddItem)
|
||||
.def("GetWornItem", (uint32(Lua_Corpse::*)(int16))&Lua_Corpse::GetWornItem)
|
||||
.def("RemoveItem", (void(Lua_Corpse::*)(uint16))&Lua_Corpse::RemoveItem)
|
||||
.def("SetCash", (void(Lua_Corpse::*)(uint32, uint32, uint32, uint32))&Lua_Corpse::SetCash)
|
||||
.def("RemoveCash", (void(Lua_Corpse::*)(void))&Lua_Corpse::RemoveCash)
|
||||
.def("IsEmpty", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsEmpty)
|
||||
.def("SetDecayTimer", (void(Lua_Corpse::*)(uint32))&Lua_Corpse::SetDecayTimer)
|
||||
.def("CanMobLoot", (bool(Lua_Corpse::*)(int))&Lua_Corpse::CanMobLoot)
|
||||
.def("AllowMobLoot", (void(Lua_Corpse::*)(Lua_Mob, uint8))&Lua_Corpse::AllowMobLoot)
|
||||
.def("Summon", (bool(Lua_Corpse::*)(Lua_Client, bool, bool))&Lua_Corpse::Summon)
|
||||
.def("GetCopper", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetCopper)
|
||||
.def("GetSilver", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetSilver)
|
||||
.def("GetGold", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetGold)
|
||||
.def("GetPlatinum", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetPlatinum)
|
||||
.def("AddLooter", (void(Lua_Corpse::*)(Lua_Mob))&Lua_Corpse::AddLooter);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef EQEMU_LUA_CORPSE_H
|
||||
#define EQEMU_LUA_CORPSE_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_mob.h"
|
||||
|
||||
class Corpse;
|
||||
class Lua_Client;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_corpse();
|
||||
|
||||
class Lua_Corpse : public Lua_Mob
|
||||
{
|
||||
typedef Corpse NativeType;
|
||||
public:
|
||||
Lua_Corpse() { SetLuaPtrData(nullptr); }
|
||||
Lua_Corpse(Corpse *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_Corpse() { }
|
||||
|
||||
operator Corpse*() {
|
||||
return reinterpret_cast<Corpse*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
uint32 GetCharID();
|
||||
uint32 GetDecayTime();
|
||||
void Lock();
|
||||
void UnLock();
|
||||
bool IsLocked();
|
||||
void ResetLooter();
|
||||
uint32 GetDBID();
|
||||
bool IsRezzed();
|
||||
const char *GetOwnerName();
|
||||
bool Save();
|
||||
void Delete();
|
||||
void Bury();
|
||||
void Depop();
|
||||
uint32 CountItems();
|
||||
void AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5);
|
||||
uint32 GetWornItem(int16 equipSlot);
|
||||
void RemoveItem(uint16 lootslot);
|
||||
void SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
|
||||
void RemoveCash();
|
||||
bool IsEmpty();
|
||||
void SetDecayTimer(uint32 decaytime);
|
||||
bool CanMobLoot(int charid);
|
||||
void AllowMobLoot(Lua_Mob them, uint8 slot);
|
||||
bool Summon(Lua_Client client, bool spell, bool checkdistance);
|
||||
uint32 GetCopper();
|
||||
uint32 GetSilver();
|
||||
uint32 GetGold();
|
||||
uint32 GetPlatinum();
|
||||
void AddLooter(Lua_Mob who);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,218 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "doors.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_door.h"
|
||||
|
||||
void Lua_Door::SetDoorName(const char *name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDoorName(name);
|
||||
}
|
||||
|
||||
const char *Lua_Door::GetDoorName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetDoorName();
|
||||
}
|
||||
|
||||
float Lua_Door::GetX() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetPosition().x;
|
||||
}
|
||||
|
||||
float Lua_Door::GetY() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetPosition().y;
|
||||
}
|
||||
|
||||
float Lua_Door::GetZ() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetPosition().z;
|
||||
}
|
||||
|
||||
float Lua_Door::GetHeading() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetPosition().w;
|
||||
}
|
||||
|
||||
void Lua_Door::SetX(float x) {
|
||||
Lua_Safe_Call_Void();
|
||||
auto position = self->GetPosition();
|
||||
position.x = x;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetY(float y) {
|
||||
Lua_Safe_Call_Void();
|
||||
auto position = self->GetPosition();
|
||||
position.y = y;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetZ(float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
auto position = self->GetPosition();
|
||||
position.z = z;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetHeading(float h) {
|
||||
Lua_Safe_Call_Void();
|
||||
auto position = self->GetPosition();
|
||||
position.w = h;
|
||||
self->SetPosition(position);
|
||||
}
|
||||
|
||||
void Lua_Door::SetLocation(float x, float y, float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetLocation(x, y, z);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetDoorDBID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetDoorDBID();
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetDoorID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetDoorID();
|
||||
}
|
||||
|
||||
void Lua_Door::SetSize(uint32 sz) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSize(sz);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetSize() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSize();
|
||||
}
|
||||
|
||||
void Lua_Door::SetIncline(uint32 incline) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetIncline(incline);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetIncline() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetIncline();
|
||||
}
|
||||
|
||||
void Lua_Door::SetOpenType(uint32 type) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetOpenType(type);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetOpenType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetOpenType();
|
||||
}
|
||||
|
||||
void Lua_Door::SetDisableTimer(bool flag) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDisableTimer(flag);
|
||||
}
|
||||
|
||||
bool Lua_Door::GetDisableTimer() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->GetDisableTimer();
|
||||
}
|
||||
|
||||
void Lua_Door::SetLockPick(uint32 pick) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetLockpick(pick);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetLockPick() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetLockpick();
|
||||
}
|
||||
|
||||
void Lua_Door::SetKeyItem(uint32 key) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetKeyItem(key);
|
||||
}
|
||||
|
||||
uint32 Lua_Door::GetKeyItem() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetKeyItem();
|
||||
}
|
||||
|
||||
void Lua_Door::SetNoKeyring(int type) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetNoKeyring(type);
|
||||
}
|
||||
|
||||
int Lua_Door::GetNoKeyring() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetNoKeyring();
|
||||
}
|
||||
|
||||
void Lua_Door::CreateDatabaseEntry() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->CreateDatabaseEntry();
|
||||
}
|
||||
|
||||
void Lua_Door::ForceOpen(Lua_Mob sender) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ForceOpen(sender);
|
||||
}
|
||||
|
||||
void Lua_Door::ForceOpen(Lua_Mob sender, bool alt_mode) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ForceOpen(sender, alt_mode);
|
||||
}
|
||||
|
||||
void Lua_Door::ForceClose(Lua_Mob sender) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ForceClose(sender);
|
||||
}
|
||||
|
||||
void Lua_Door::ForceClose(Lua_Mob sender, bool alt_mode) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ForceClose(sender, alt_mode);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_door() {
|
||||
return luabind::class_<Lua_Door, Lua_Entity>("Door")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Door::Null)
|
||||
.property("valid", &Lua_Door::Valid)
|
||||
.def("SetDoorName", (void(Lua_Door::*)(const char*))&Lua_Door::SetDoorName)
|
||||
.def("GetDoorName", (const char*(Lua_Door::*)(void))&Lua_Door::GetDoorName)
|
||||
.def("GetX", (float(Lua_Door::*)(void))&Lua_Door::GetX)
|
||||
.def("GetY", (float(Lua_Door::*)(void))&Lua_Door::GetY)
|
||||
.def("GetZ", (float(Lua_Door::*)(void))&Lua_Door::GetZ)
|
||||
.def("GetHeading", (float(Lua_Door::*)(void))&Lua_Door::GetHeading)
|
||||
.def("SetX", (void(Lua_Door::*)(float))&Lua_Door::SetX)
|
||||
.def("SetY", (void(Lua_Door::*)(float))&Lua_Door::SetY)
|
||||
.def("SetZ", (void(Lua_Door::*)(float))&Lua_Door::SetZ)
|
||||
.def("SetHeading", (void(Lua_Door::*)(float))&Lua_Door::SetHeading)
|
||||
.def("SetLocation", (void(Lua_Door::*)(float,float,float))&Lua_Door::SetLocation)
|
||||
.def("GetDoorDBID", (uint32(Lua_Door::*)(void))&Lua_Door::GetDoorDBID)
|
||||
.def("GetDoorID", (uint32(Lua_Door::*)(void))&Lua_Door::GetDoorID)
|
||||
.def("SetSize", (void(Lua_Door::*)(uint32))&Lua_Door::SetSize)
|
||||
.def("GetSize", (uint32(Lua_Door::*)(void))&Lua_Door::GetSize)
|
||||
.def("SetIncline", (void(Lua_Door::*)(uint32))&Lua_Door::SetIncline)
|
||||
.def("GetIncline", (uint32(Lua_Door::*)(void))&Lua_Door::GetIncline)
|
||||
.def("SetOpenType", (void(Lua_Door::*)(uint32))&Lua_Door::SetOpenType)
|
||||
.def("GetOpenType", (uint32(Lua_Door::*)(void))&Lua_Door::GetOpenType)
|
||||
.def("SetDisableTimer", (void(Lua_Door::*)(bool))&Lua_Door::SetDisableTimer)
|
||||
.def("GetDisableTimer", (bool(Lua_Door::*)(void))&Lua_Door::GetDisableTimer)
|
||||
.def("SetLockPick", (void(Lua_Door::*)(uint32))&Lua_Door::SetLockPick)
|
||||
.def("GetLockPick", (uint32(Lua_Door::*)(void))&Lua_Door::GetLockPick)
|
||||
.def("SetKeyItem", (void(Lua_Door::*)(uint32))&Lua_Door::SetKeyItem)
|
||||
.def("GetKeyItem", (uint32(Lua_Door::*)(void))&Lua_Door::GetKeyItem)
|
||||
.def("SetNoKeyring", (void(Lua_Door::*)(int))&Lua_Door::SetNoKeyring)
|
||||
.def("GetNoKeyring", (int(Lua_Door::*)(void))&Lua_Door::GetNoKeyring)
|
||||
.def("CreateDatabaseEntry", (void(Lua_Door::*)(void))&Lua_Door::CreateDatabaseEntry)
|
||||
.def("ForceOpen", (void(Lua_Door::*)(Lua_Mob))&Lua_Door::ForceOpen)
|
||||
.def("ForceOpen", (void(Lua_Door::*)(Lua_Mob,bool))&Lua_Door::ForceOpen)
|
||||
.def("ForceClose", (void(Lua_Door::*)(Lua_Mob))&Lua_Door::ForceClose)
|
||||
.def("ForceClose", (void(Lua_Door::*)(Lua_Mob,bool))&Lua_Door::ForceClose);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
#ifndef EQEMU_LUA_DOOR_H
|
||||
#define EQEMU_LUA_DOOR_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_entity.h"
|
||||
|
||||
class Doors;
|
||||
class Lua_Mob;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_door();
|
||||
|
||||
class Lua_Door : public Lua_Entity
|
||||
{
|
||||
typedef Doors NativeType;
|
||||
public:
|
||||
Lua_Door() { }
|
||||
Lua_Door(Doors *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_Door() { }
|
||||
|
||||
operator Doors*() {
|
||||
void *d = GetLuaPtrData();
|
||||
if(d) {
|
||||
return reinterpret_cast<Doors*>(d);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SetDoorName(const char *name);
|
||||
const char *GetDoorName();
|
||||
float GetX();
|
||||
float GetY();
|
||||
float GetZ();
|
||||
float GetHeading();
|
||||
void SetX(float x);
|
||||
void SetY(float y);
|
||||
void SetZ(float z);
|
||||
void SetHeading(float h);
|
||||
void SetLocation(float x, float y, float z);
|
||||
uint32 GetDoorDBID();
|
||||
uint32 GetDoorID();
|
||||
void SetSize(uint32 sz);
|
||||
uint32 GetSize();
|
||||
void SetIncline(uint32 incline);
|
||||
uint32 GetIncline();
|
||||
void SetOpenType(uint32 type);
|
||||
uint32 GetOpenType();
|
||||
void SetDisableTimer(bool flag);
|
||||
bool GetDisableTimer();
|
||||
void SetLockPick(uint32 pick);
|
||||
uint32 GetLockPick();
|
||||
void SetKeyItem(uint32 key);
|
||||
uint32 GetKeyItem();
|
||||
void SetNoKeyring(int type);
|
||||
int GetNoKeyring();
|
||||
void CreateDatabaseEntry();
|
||||
void ForceOpen(Lua_Mob sender);
|
||||
void ForceOpen(Lua_Mob sender, bool alt_mode);
|
||||
void ForceClose(Lua_Mob sender);
|
||||
void ForceClose(Lua_Mob sender, bool alt_mode);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include "lua_encounter.h"
|
||||
#include "encounter.h"
|
||||
|
||||
|
||||
luabind::scope lua_register_encounter() {
|
||||
return luabind::class_<Lua_Encounter>("Encounter");
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef EQEMU_LUA_ENCOUNTER_H
|
||||
#define EQEMU_LUA_ENCOUNTER_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Encounter;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
namespace adl {
|
||||
class object;
|
||||
}
|
||||
}
|
||||
|
||||
luabind::scope lua_register_encounter();
|
||||
|
||||
class Lua_Encounter : public Lua_Ptr<Encounter>
|
||||
{
|
||||
typedef Encounter NativeType;
|
||||
public:
|
||||
Lua_Encounter() { SetLuaPtrData(nullptr); }
|
||||
Lua_Encounter(Encounter *d) { SetLuaPtrData(reinterpret_cast<Encounter*>(d)); }
|
||||
virtual ~Lua_Encounter() { }
|
||||
|
||||
operator Encounter*() {
|
||||
return reinterpret_cast<Encounter*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,148 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "entity.h"
|
||||
#include "lua_entity.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_corpse.h"
|
||||
#include "lua_object.h"
|
||||
#include "lua_door.h"
|
||||
|
||||
bool Lua_Entity::IsClient() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsClient();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsNPC() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsNPC();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsMob() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsMob();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsMerc() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsMerc();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsCorpse() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsCorpse();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsPlayerCorpse() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsPlayerCorpse();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsNPCCorpse() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsNPCCorpse();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsObject() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsObject();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsDoor() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsDoor();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsTrap() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsTrap();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsBeacon() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsBeacon();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsEncounter() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEncounter();
|
||||
}
|
||||
|
||||
bool Lua_Entity::IsBot() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsBot();
|
||||
}
|
||||
|
||||
int Lua_Entity::GetID() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
Lua_Client Lua_Entity::CastToClient() {
|
||||
void *d = GetLuaPtrData();
|
||||
Client *m = reinterpret_cast<Client*>(d);
|
||||
return Lua_Client(m);
|
||||
}
|
||||
|
||||
Lua_NPC Lua_Entity::CastToNPC() {
|
||||
void *d = GetLuaPtrData();
|
||||
NPC *m = reinterpret_cast<NPC*>(d);
|
||||
return Lua_NPC(m);
|
||||
}
|
||||
|
||||
Lua_Mob Lua_Entity::CastToMob() {
|
||||
void *d = GetLuaPtrData();
|
||||
Mob *m = reinterpret_cast<Mob*>(d);
|
||||
return Lua_Mob(m);
|
||||
}
|
||||
|
||||
Lua_Corpse Lua_Entity::CastToCorpse() {
|
||||
void *d = GetLuaPtrData();
|
||||
Corpse *m = reinterpret_cast<Corpse*>(d);
|
||||
return Lua_Corpse(m);
|
||||
}
|
||||
|
||||
Lua_Object Lua_Entity::CastToObject() {
|
||||
void *d = GetLuaPtrData();
|
||||
Object *m = reinterpret_cast<Object*>(d);
|
||||
return Lua_Object(m);
|
||||
}
|
||||
|
||||
Lua_Door Lua_Entity::CastToDoor() {
|
||||
void *d = GetLuaPtrData();
|
||||
Doors *m = reinterpret_cast<Doors*>(d);
|
||||
return Lua_Door(m);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity() {
|
||||
return luabind::class_<Lua_Entity>("Entity")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Entity::Null)
|
||||
.property("valid", &Lua_Entity::Valid)
|
||||
.def("IsClient", &Lua_Entity::IsClient)
|
||||
.def("IsNPC", &Lua_Entity::IsNPC)
|
||||
.def("IsMob", &Lua_Entity::IsMob)
|
||||
.def("IsMerc", &Lua_Entity::IsMerc)
|
||||
.def("IsCorpse", &Lua_Entity::IsCorpse)
|
||||
.def("IsPlayerCorpse", &Lua_Entity::IsPlayerCorpse)
|
||||
.def("IsNPCCorpse", &Lua_Entity::IsNPCCorpse)
|
||||
.def("IsObject", &Lua_Entity::IsObject)
|
||||
.def("IsDoor", &Lua_Entity::IsDoor)
|
||||
.def("IsTrap", &Lua_Entity::IsTrap)
|
||||
.def("IsBeacon", &Lua_Entity::IsBeacon)
|
||||
.def("IsEncounter", &Lua_Entity::IsEncounter)
|
||||
.def("IsBot", &Lua_Entity::IsBot)
|
||||
.def("GetID", &Lua_Entity::GetID)
|
||||
.def("CastToClient", &Lua_Entity::CastToClient)
|
||||
.def("CastToNPC", &Lua_Entity::CastToNPC)
|
||||
.def("CastToMob", &Lua_Entity::CastToMob)
|
||||
.def("CastToCorpse", &Lua_Entity::CastToCorpse)
|
||||
.def("CastToObject", &Lua_Entity::CastToObject)
|
||||
.def("CastToDoor", &Lua_Entity::CastToDoor);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef EQEMU_LUA_ENTITY_H
|
||||
#define EQEMU_LUA_ENTITY_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Entity;
|
||||
class Lua_Client;
|
||||
class Lua_NPC;
|
||||
class Lua_Mob;
|
||||
struct Lua_HateList;
|
||||
class Lua_Item;
|
||||
class Lua_ItemInst;
|
||||
class Lua_Corpse;
|
||||
class Lua_Object;
|
||||
class Lua_Door;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity();
|
||||
|
||||
class Lua_Entity : public Lua_Ptr<Entity>
|
||||
{
|
||||
typedef Entity NativeType;
|
||||
public:
|
||||
Lua_Entity() : Lua_Ptr(nullptr) { }
|
||||
Lua_Entity(Entity *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Entity() { }
|
||||
|
||||
operator Entity*() {
|
||||
return reinterpret_cast<Entity*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
bool IsClient();
|
||||
bool IsNPC();
|
||||
bool IsMob();
|
||||
bool IsMerc();
|
||||
bool IsCorpse();
|
||||
bool IsPlayerCorpse();
|
||||
bool IsNPCCorpse();
|
||||
bool IsObject();
|
||||
bool IsDoor();
|
||||
bool IsTrap();
|
||||
bool IsBeacon();
|
||||
bool IsEncounter();
|
||||
bool IsBot();
|
||||
int GetID();
|
||||
|
||||
Lua_Client CastToClient();
|
||||
Lua_NPC CastToNPC();
|
||||
Lua_Mob CastToMob();
|
||||
Lua_Corpse CastToCorpse();
|
||||
Lua_Object CastToObject();
|
||||
Lua_Door CastToDoor();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,544 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/iterator_policy.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "lua_entity_list.h"
|
||||
#include "lua_entity.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_object.h"
|
||||
#include "lua_door.h"
|
||||
#include "lua_corpse.h"
|
||||
#include "lua_group.h"
|
||||
#include "lua_raid.h"
|
||||
#include "lua_spawn.h"
|
||||
|
||||
struct Lua_Mob_List {
|
||||
std::vector<Lua_Mob> entries;
|
||||
};
|
||||
|
||||
struct Lua_NPC_List {
|
||||
std::vector<Lua_NPC> entries;
|
||||
};
|
||||
|
||||
struct Lua_Client_List {
|
||||
std::vector<Lua_Client> entries;
|
||||
};
|
||||
|
||||
struct Lua_Corpse_List {
|
||||
std::vector<Lua_Corpse> entries;
|
||||
};
|
||||
|
||||
struct Lua_Object_List {
|
||||
std::vector<Lua_Object> entries;
|
||||
};
|
||||
|
||||
struct Lua_Doors_List {
|
||||
std::vector<Lua_Door> entries;
|
||||
};
|
||||
|
||||
struct Lua_Spawn_List {
|
||||
std::vector<Lua_Spawn> entries;
|
||||
};
|
||||
|
||||
Lua_Mob Lua_EntityList::GetMobID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->GetMobID(id));
|
||||
}
|
||||
|
||||
Lua_Mob Lua_EntityList::GetMob(const char *name) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->GetMob(name));
|
||||
}
|
||||
|
||||
Lua_Mob Lua_EntityList::GetMob(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->GetMob(id));
|
||||
}
|
||||
|
||||
Lua_Mob Lua_EntityList::GetMobByNpcTypeID(int npc_type) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->GetMobByNpcTypeID(npc_type));
|
||||
}
|
||||
|
||||
bool Lua_EntityList::IsMobSpawnedByNpcTypeID(int npc_type) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsMobSpawnedByNpcTypeID(npc_type);
|
||||
}
|
||||
|
||||
Lua_NPC Lua_EntityList::GetNPCByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_NPC);
|
||||
return Lua_NPC(self->GetNPCByID(id));
|
||||
}
|
||||
|
||||
Lua_NPC Lua_EntityList::GetNPCByNPCTypeID(int npc_type) {
|
||||
Lua_Safe_Call_Class(Lua_NPC);
|
||||
return Lua_NPC(self->GetNPCByNPCTypeID(npc_type));
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetClientByName(const char *name) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetClientByName(name));
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetClientByAccID(uint32 acct_id) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetClientByAccID(acct_id));
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetClientByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetClientByID(id));
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetClientByCharID(uint32 char_id) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetClientByCharID(char_id));
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetClientByWID(uint32 wid) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetClientByWID(wid));
|
||||
}
|
||||
|
||||
Lua_Object Lua_EntityList::GetObjectByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Object);
|
||||
return Lua_Object(self->GetObjectByID(id));
|
||||
}
|
||||
|
||||
Lua_Object Lua_EntityList::GetObjectByDBID(uint32 db_id) {
|
||||
Lua_Safe_Call_Class(Lua_Object);
|
||||
return Lua_Object(self->GetObjectByDBID(db_id));
|
||||
}
|
||||
|
||||
Lua_Door Lua_EntityList::GetDoorsByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Door);
|
||||
return Lua_Door(self->GetDoorsByID(id));
|
||||
}
|
||||
|
||||
Lua_Door Lua_EntityList::GetDoorsByDBID(uint32 db_id) {
|
||||
Lua_Safe_Call_Class(Lua_Door);
|
||||
return Lua_Door(self->GetDoorsByDBID(db_id));
|
||||
}
|
||||
|
||||
Lua_Door Lua_EntityList::GetDoorsByDoorID(uint32 door_id) {
|
||||
Lua_Safe_Call_Class(Lua_Door);
|
||||
return Lua_Door(self->GetDoorsByDoorID(door_id));
|
||||
}
|
||||
|
||||
Lua_Door Lua_EntityList::FindDoor(uint32 id) {
|
||||
Lua_Safe_Call_Class(Lua_Door);
|
||||
return Lua_Door(self->FindDoor(id));
|
||||
}
|
||||
|
||||
Lua_Group Lua_EntityList::GetGroupByMob(Lua_Mob mob) {
|
||||
Lua_Safe_Call_Class(Lua_Group);
|
||||
return Lua_Group(self->GetGroupByMob(mob));
|
||||
}
|
||||
|
||||
Lua_Group Lua_EntityList::GetGroupByClient(Lua_Client client) {
|
||||
Lua_Safe_Call_Class(Lua_Group);
|
||||
return Lua_Group(self->GetGroupByClient(client));
|
||||
}
|
||||
|
||||
Lua_Group Lua_EntityList::GetGroupByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Group);
|
||||
return Lua_Group(self->GetGroupByID(id));
|
||||
}
|
||||
|
||||
Lua_Group Lua_EntityList::GetGroupByLeaderName(const char *name) {
|
||||
Lua_Safe_Call_Class(Lua_Group);
|
||||
return Lua_Group(self->GetGroupByLeaderName(name));
|
||||
}
|
||||
|
||||
Lua_Raid Lua_EntityList::GetRaidByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Raid);
|
||||
return Lua_Raid(self->GetRaidByID(id));
|
||||
}
|
||||
|
||||
Lua_Raid Lua_EntityList::GetRaidByClient(Lua_Client client) {
|
||||
Lua_Safe_Call_Class(Lua_Raid);
|
||||
return Lua_Raid(self->GetRaidByClient(client));
|
||||
}
|
||||
|
||||
Lua_Corpse Lua_EntityList::GetCorpseByOwner(Lua_Client client) {
|
||||
Lua_Safe_Call_Class(Lua_Corpse);
|
||||
return Lua_Corpse(self->GetCorpseByOwner(client));
|
||||
}
|
||||
|
||||
Lua_Corpse Lua_EntityList::GetCorpseByID(int id) {
|
||||
Lua_Safe_Call_Class(Lua_Corpse);
|
||||
return Lua_Corpse(self->GetCorpseByID(id));
|
||||
}
|
||||
|
||||
Lua_Corpse Lua_EntityList::GetCorpseByName(const char *name) {
|
||||
Lua_Safe_Call_Class(Lua_Corpse);
|
||||
return Lua_Corpse(self->GetCorpseByName(name));
|
||||
}
|
||||
|
||||
Lua_Spawn Lua_EntityList::GetSpawnByID(uint32 id) {
|
||||
Lua_Safe_Call_Class(Lua_Spawn);
|
||||
return self->GetSpawnByID(id);
|
||||
}
|
||||
|
||||
void Lua_EntityList::ClearClientPetitionQueue() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ClearClientPetitionQueue();
|
||||
}
|
||||
|
||||
bool Lua_EntityList::CanAddHateForMob(Lua_Mob p) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->CanAddHateForMob(p);
|
||||
}
|
||||
|
||||
void Lua_EntityList::Message(uint32 guild_dbid, uint32 type, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Message(guild_dbid, type, message);
|
||||
}
|
||||
|
||||
void Lua_EntityList::MessageStatus(uint32 guild_dbid, int min_status, uint32 type, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MessageStatus(guild_dbid, min_status, type, message);
|
||||
}
|
||||
|
||||
void Lua_EntityList::MessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MessageClose(sender, skip_sender, dist, type, message);
|
||||
}
|
||||
|
||||
void Lua_EntityList::FilteredMessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, int filter, const char *message)
|
||||
{
|
||||
Lua_Safe_Call_Void();
|
||||
self->FilteredMessageClose(sender, skip_sender, dist, type, (eqFilterType)filter, message);
|
||||
}
|
||||
|
||||
void Lua_EntityList::RemoveFromTargets(Lua_Mob mob) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveFromTargets(mob);
|
||||
}
|
||||
|
||||
void Lua_EntityList::RemoveFromTargets(Lua_Mob mob, bool RemoveFromXTargets) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveFromTargets(mob, RemoveFromXTargets);
|
||||
}
|
||||
|
||||
void Lua_EntityList::ReplaceWithTarget(Lua_Mob target, Lua_Mob new_target) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ReplaceWithTarget(target, new_target);
|
||||
}
|
||||
|
||||
void Lua_EntityList::OpenDoorsNear(Lua_NPC opener) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->OpenDoorsNear(opener);
|
||||
}
|
||||
|
||||
std::string Lua_EntityList::MakeNameUnique(const char *name) {
|
||||
Lua_Safe_Call_String();
|
||||
|
||||
char t_name[64];
|
||||
strncpy(t_name, name, 64);
|
||||
return self->MakeNameUnique(t_name);
|
||||
}
|
||||
|
||||
std::string Lua_EntityList::RemoveNumbers(const char *name) {
|
||||
Lua_Safe_Call_String();
|
||||
|
||||
char t_name[64];
|
||||
strncpy(t_name, name, 64);
|
||||
return self->RemoveNumbers(t_name);
|
||||
}
|
||||
|
||||
void Lua_EntityList::SignalMobsByNPCID(uint32 npc_id, int signal) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SignalMobsByNPCID(npc_id, signal);
|
||||
}
|
||||
|
||||
int Lua_EntityList::DeleteNPCCorpses() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->DeleteNPCCorpses();
|
||||
}
|
||||
|
||||
int Lua_EntityList::DeletePlayerCorpses() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->DeletePlayerCorpses();
|
||||
}
|
||||
|
||||
void Lua_EntityList::HalveAggro(Lua_Mob who) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->HalveAggro(who);
|
||||
}
|
||||
|
||||
void Lua_EntityList::DoubleAggro(Lua_Mob who) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DoubleAggro(who);
|
||||
}
|
||||
|
||||
void Lua_EntityList::ClearFeignAggro(Lua_Mob who) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ClearFeignAggro(who);
|
||||
}
|
||||
|
||||
bool Lua_EntityList::Fighting(Lua_Mob who) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->Fighting(who);
|
||||
}
|
||||
|
||||
void Lua_EntityList::RemoveFromHateLists(Lua_Mob who) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveFromHateLists(who);
|
||||
}
|
||||
|
||||
void Lua_EntityList::RemoveFromHateLists(Lua_Mob who, bool set_to_one) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveFromHateLists(who, set_to_one);
|
||||
}
|
||||
|
||||
void Lua_EntityList::MessageGroup(Lua_Mob who, bool skip_close, uint32 type, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MessageGroup(who, skip_close, type, message);
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetRandomClient(float x, float y, float z, float dist) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return self->GetRandomClient(glm::vec3(x, y, z), dist);
|
||||
}
|
||||
|
||||
Lua_Client Lua_EntityList::GetRandomClient(float x, float y, float z, float dist, Lua_Client exclude) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return self->GetRandomClient(glm::vec3(x, y, z), dist, exclude);
|
||||
}
|
||||
|
||||
Lua_Mob_List Lua_EntityList::GetMobList() {
|
||||
Lua_Safe_Call_Class(Lua_Mob_List);
|
||||
Lua_Mob_List ret;
|
||||
auto &t_list = self->GetMobList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Mob(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Client_List Lua_EntityList::GetClientList() {
|
||||
Lua_Safe_Call_Class(Lua_Client_List);
|
||||
Lua_Client_List ret;
|
||||
auto &t_list = self->GetClientList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Client(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Client_List Lua_EntityList::GetShuffledClientList() {
|
||||
Lua_Safe_Call_Class(Lua_Client_List);
|
||||
Lua_Client_List ret;
|
||||
auto &t_list = self->GetClientList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Client(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
zone->random.Shuffle(ret.entries.begin(), ret.entries.end());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_NPC_List Lua_EntityList::GetNPCList() {
|
||||
Lua_Safe_Call_Class(Lua_NPC_List);
|
||||
Lua_NPC_List ret;
|
||||
auto &t_list = self->GetNPCList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_NPC(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Corpse_List Lua_EntityList::GetCorpseList() {
|
||||
Lua_Safe_Call_Class(Lua_Corpse_List);
|
||||
Lua_Corpse_List ret;
|
||||
auto &t_list = self->GetCorpseList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Corpse(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Object_List Lua_EntityList::GetObjectList() {
|
||||
Lua_Safe_Call_Class(Lua_Object_List);
|
||||
Lua_Object_List ret;
|
||||
auto &t_list = self->GetObjectList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Object(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Doors_List Lua_EntityList::GetDoorsList() {
|
||||
Lua_Safe_Call_Class(Lua_Doors_List);
|
||||
Lua_Doors_List ret;
|
||||
auto &t_list = self->GetDoorsList();
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Door(iter->second));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Spawn_List Lua_EntityList::GetSpawnList() {
|
||||
Lua_Safe_Call_Class(Lua_Spawn_List);
|
||||
Lua_Spawn_List ret;
|
||||
std::list<Spawn2*> t_list;
|
||||
self->GetSpawnList(t_list);
|
||||
|
||||
auto iter = t_list.begin();
|
||||
while(iter != t_list.end()) {
|
||||
ret.entries.push_back(Lua_Spawn(*iter));
|
||||
++iter;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Lua_EntityList::SignalAllClients(int signal) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SignalAllClients(signal);
|
||||
}
|
||||
|
||||
void Lua_EntityList::ChannelMessage(Lua_Mob from, int channel_num, int language, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ChannelMessage(from, channel_num, language, message);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity_list() {
|
||||
return luabind::class_<Lua_EntityList>("EntityList")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_EntityList::Null)
|
||||
.property("valid", &Lua_EntityList::Valid)
|
||||
.def("GetMobID", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMobID)
|
||||
.def("GetMob", (Lua_Mob(Lua_EntityList::*)(const char*))&Lua_EntityList::GetMob)
|
||||
.def("GetMob", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMob)
|
||||
.def("GetMobByNpcTypeID", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMobByNpcTypeID)
|
||||
.def("IsMobSpawnedByNpcTypeID", (bool(Lua_EntityList::*)(int))&Lua_EntityList::IsMobSpawnedByNpcTypeID)
|
||||
.def("GetNPCByID", (Lua_NPC(Lua_EntityList::*)(int))&Lua_EntityList::GetNPCByID)
|
||||
.def("GetNPCByNPCTypeID", (Lua_NPC(Lua_EntityList::*)(int))&Lua_EntityList::GetNPCByNPCTypeID)
|
||||
.def("GetClientByName", (Lua_Client(Lua_EntityList::*)(const char*))&Lua_EntityList::GetClientByName)
|
||||
.def("GetClientByAccID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByAccID)
|
||||
.def("GetClientByID", (Lua_Client(Lua_EntityList::*)(int))&Lua_EntityList::GetClientByID)
|
||||
.def("GetClientByCharID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByCharID)
|
||||
.def("GetClientByWID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByWID)
|
||||
.def("GetObjectByID", (Lua_Object(Lua_EntityList::*)(int))&Lua_EntityList::GetObjectByID)
|
||||
.def("GetObjectByDBID", (Lua_Object(Lua_EntityList::*)(uint32))&Lua_EntityList::GetObjectByDBID)
|
||||
.def("GetDoorsByID", (Lua_Door(Lua_EntityList::*)(int))&Lua_EntityList::GetDoorsByID)
|
||||
.def("GetDoorsByDBID", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::GetDoorsByDBID)
|
||||
.def("GetDoorsByDoorID", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::GetDoorsByDoorID)
|
||||
.def("FindDoor", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::FindDoor)
|
||||
.def("GetGroupByMob", (Lua_Group(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::GetGroupByMob)
|
||||
.def("GetGroupByClient", (Lua_Group(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetGroupByClient)
|
||||
.def("GetGroupByID", (Lua_Group(Lua_EntityList::*)(int))&Lua_EntityList::GetGroupByID)
|
||||
.def("GetGroupByLeaderName", (Lua_Group(Lua_EntityList::*)(const char*))&Lua_EntityList::GetGroupByLeaderName)
|
||||
.def("GetRaidByID", (Lua_Raid(Lua_EntityList::*)(int))&Lua_EntityList::GetRaidByID)
|
||||
.def("GetRaidByClient", (Lua_Raid(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetRaidByClient)
|
||||
.def("GetCorpseByOwner", (Lua_Corpse(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetCorpseByOwner)
|
||||
.def("GetCorpseByID", (Lua_Corpse(Lua_EntityList::*)(int))&Lua_EntityList::GetCorpseByID)
|
||||
.def("GetCorpseByName", (Lua_Corpse(Lua_EntityList::*)(const char*))&Lua_EntityList::GetCorpseByName)
|
||||
.def("GetSpawnByID", (Lua_Spawn(Lua_EntityList::*)(uint32))&Lua_EntityList::GetSpawnByID)
|
||||
.def("ClearClientPetitionQueue", (void(Lua_EntityList::*)(void))&Lua_EntityList::ClearClientPetitionQueue)
|
||||
.def("CanAddHateForMob", (bool(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::CanAddHateForMob)
|
||||
.def("Message", (void(Lua_EntityList::*)(uint32, uint32, const char*))&Lua_EntityList::Message)
|
||||
.def("MessageStatus", (void(Lua_EntityList::*)(uint32, uint32, uint32, const char*))&Lua_EntityList::MessageStatus)
|
||||
.def("MessageClose", (void(Lua_EntityList::*)(Lua_Mob, bool, float, uint32, const char*))&Lua_EntityList::MessageClose)
|
||||
.def("FilteredMessageClose", &Lua_EntityList::FilteredMessageClose)
|
||||
.def("RemoveFromTargets", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::RemoveFromTargets)
|
||||
.def("RemoveFromTargets", (void(Lua_EntityList::*)(Lua_Mob, bool))&Lua_EntityList::RemoveFromTargets)
|
||||
.def("ReplaceWithTarget", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob))&Lua_EntityList::ReplaceWithTarget)
|
||||
.def("OpenDoorsNear", (void(Lua_EntityList::*)(Lua_NPC))&Lua_EntityList::OpenDoorsNear)
|
||||
.def("MakeNameUnique", (std::string(Lua_EntityList::*)(const char*))&Lua_EntityList::MakeNameUnique)
|
||||
.def("RemoveNumbers", (std::string(Lua_EntityList::*)(const char*))&Lua_EntityList::RemoveNumbers)
|
||||
.def("SignalMobsByNPCID", (void(Lua_EntityList::*)(uint32, int))&Lua_EntityList::SignalMobsByNPCID)
|
||||
.def("DeleteNPCCorpses", (int(Lua_EntityList::*)(void))&Lua_EntityList::DeleteNPCCorpses)
|
||||
.def("DeletePlayerCorpses", (int(Lua_EntityList::*)(void))&Lua_EntityList::DeletePlayerCorpses)
|
||||
.def("HalveAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::HalveAggro)
|
||||
.def("DoubleAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::DoubleAggro)
|
||||
.def("ClearFeignAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::ClearFeignAggro)
|
||||
.def("Fighting", (bool(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::Fighting)
|
||||
.def("RemoveFromHateLists", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::RemoveFromHateLists)
|
||||
.def("RemoveFromHateLists", (void(Lua_EntityList::*)(Lua_Mob, bool))&Lua_EntityList::RemoveFromHateLists)
|
||||
.def("MessageGroup", (void(Lua_EntityList::*)(Lua_Mob, bool, uint32, const char*))&Lua_EntityList::MessageGroup)
|
||||
.def("GetRandomClient", (Lua_Client(Lua_EntityList::*)(float, float, float, float))&Lua_EntityList::GetRandomClient)
|
||||
.def("GetRandomClient", (Lua_Client(Lua_EntityList::*)(float, float, float, float, Lua_Client))&Lua_EntityList::GetRandomClient)
|
||||
.def("GetMobList", (Lua_Mob_List(Lua_EntityList::*)(void))&Lua_EntityList::GetMobList)
|
||||
.def("GetClientList", (Lua_Client_List(Lua_EntityList::*)(void))&Lua_EntityList::GetClientList)
|
||||
.def("GetShuffledClientList", (Lua_Client_List(Lua_EntityList::*)(void))&Lua_EntityList::GetShuffledClientList)
|
||||
.def("GetNPCList", (Lua_NPC_List(Lua_EntityList::*)(void))&Lua_EntityList::GetNPCList)
|
||||
.def("GetCorpseList", (Lua_Corpse_List(Lua_EntityList::*)(void))&Lua_EntityList::GetCorpseList)
|
||||
.def("GetObjectList", (Lua_Object_List(Lua_EntityList::*)(void))&Lua_EntityList::GetObjectList)
|
||||
.def("GetDoorsList", (Lua_Doors_List(Lua_EntityList::*)(void))&Lua_EntityList::GetDoorsList)
|
||||
.def("GetSpawnList", (Lua_Spawn_List(Lua_EntityList::*)(void))&Lua_EntityList::GetSpawnList)
|
||||
.def("SignalAllClients", (void(Lua_EntityList::*)(int))&Lua_EntityList::SignalAllClients)
|
||||
.def("ChannelMessage", (void(Lua_EntityList::*)(Lua_Mob, int, int, const char*))&Lua_EntityList::ChannelMessage);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_mob_list() {
|
||||
return luabind::class_<Lua_Mob_List>("MobList")
|
||||
.def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client_list() {
|
||||
return luabind::class_<Lua_Client_List>("ClientList")
|
||||
.def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_npc_list() {
|
||||
return luabind::class_<Lua_NPC_List>("NPCList")
|
||||
.def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_corpse_list() {
|
||||
return luabind::class_<Lua_Corpse_List>("CorpseList")
|
||||
.def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_object_list() {
|
||||
return luabind::class_<Lua_Object_List>("ObjectList")
|
||||
.def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_door_list() {
|
||||
return luabind::class_<Lua_Doors_List>("DoorList")
|
||||
.def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_spawn_list() {
|
||||
return luabind::class_<Lua_Spawn_List>("SpawnList")
|
||||
.def_readwrite("entries", &Lua_Spawn_List::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
#ifndef EQEMU_LUA_ENTITY_LIST_H
|
||||
#define EQEMU_LUA_ENTITY_LIST_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class EntityList;
|
||||
class Lua_Mob;
|
||||
class Lua_Client;
|
||||
class Lua_NPC;
|
||||
class Lua_Door;
|
||||
class Lua_Corpse;
|
||||
class Lua_Object;
|
||||
class Lua_Group;
|
||||
class Lua_Raid;
|
||||
class Lua_Spawn;
|
||||
struct Lua_Mob_List;
|
||||
struct Lua_Client_List;
|
||||
struct Lua_NPC_List;
|
||||
struct Lua_Corpse_List;
|
||||
struct Lua_Object_List;
|
||||
struct Lua_Doors_List;
|
||||
struct Lua_Spawn_List;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity_list();
|
||||
luabind::scope lua_register_mob_list();
|
||||
luabind::scope lua_register_client_list();
|
||||
luabind::scope lua_register_npc_list();
|
||||
luabind::scope lua_register_corpse_list();
|
||||
luabind::scope lua_register_object_list();
|
||||
luabind::scope lua_register_door_list();
|
||||
luabind::scope lua_register_spawn_list();
|
||||
|
||||
class Lua_EntityList : public Lua_Ptr<EntityList>
|
||||
{
|
||||
typedef EntityList NativeType;
|
||||
public:
|
||||
Lua_EntityList() : Lua_Ptr(nullptr) { }
|
||||
Lua_EntityList(EntityList *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_EntityList() { }
|
||||
|
||||
operator EntityList*() {
|
||||
return reinterpret_cast<EntityList*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
Lua_Mob GetMobID(int id);
|
||||
Lua_Mob GetMob(const char *name);
|
||||
Lua_Mob GetMob(int id);
|
||||
Lua_Mob GetMobByNpcTypeID(int npc_type);
|
||||
bool IsMobSpawnedByNpcTypeID(int npc_type);
|
||||
Lua_NPC GetNPCByID(int id);
|
||||
Lua_NPC GetNPCByNPCTypeID(int npc_type);
|
||||
Lua_Client GetClientByName(const char *name);
|
||||
Lua_Client GetClientByAccID(uint32 acct_id);
|
||||
Lua_Client GetClientByID(int id);
|
||||
Lua_Client GetClientByCharID(uint32 char_id);
|
||||
Lua_Client GetClientByWID(uint32 wid);
|
||||
Lua_Object GetObjectByID(int id);
|
||||
Lua_Object GetObjectByDBID(uint32 db_id);
|
||||
Lua_Door GetDoorsByID(int id);
|
||||
Lua_Door GetDoorsByDBID(uint32 db_id);
|
||||
Lua_Door GetDoorsByDoorID(uint32 door_id);
|
||||
Lua_Door FindDoor(uint32 id);
|
||||
Lua_Group GetGroupByMob(Lua_Mob mob);
|
||||
Lua_Group GetGroupByClient(Lua_Client client);
|
||||
Lua_Group GetGroupByID(int id);
|
||||
Lua_Group GetGroupByLeaderName(const char *name);
|
||||
Lua_Raid GetRaidByID(int id);
|
||||
Lua_Raid GetRaidByClient(Lua_Client client);
|
||||
Lua_Corpse GetCorpseByOwner(Lua_Client client);
|
||||
Lua_Corpse GetCorpseByID(int id);
|
||||
Lua_Corpse GetCorpseByName(const char *name);
|
||||
Lua_Spawn GetSpawnByID(uint32 id);
|
||||
void ClearClientPetitionQueue();
|
||||
bool CanAddHateForMob(Lua_Mob p);
|
||||
void Message(uint32 guild_dbid, uint32 type, const char *message);
|
||||
void MessageStatus(uint32 guild_dbid, int min_status, uint32 type, const char *message);
|
||||
void MessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, const char *message);
|
||||
void FilteredMessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, int filter, const char *message);
|
||||
void RemoveFromTargets(Lua_Mob mob);
|
||||
void RemoveFromTargets(Lua_Mob mob, bool RemoveFromXTargets);
|
||||
void ReplaceWithTarget(Lua_Mob target, Lua_Mob new_target);
|
||||
void OpenDoorsNear(Lua_NPC opener);
|
||||
std::string MakeNameUnique(const char *name);
|
||||
std::string RemoveNumbers(const char *name);
|
||||
void SignalMobsByNPCID(uint32 npc_id, int signal);
|
||||
int DeleteNPCCorpses();
|
||||
int DeletePlayerCorpses();
|
||||
void HalveAggro(Lua_Mob who);
|
||||
void DoubleAggro(Lua_Mob who);
|
||||
void ClearFeignAggro(Lua_Mob who);
|
||||
bool Fighting(Lua_Mob who);
|
||||
void RemoveFromHateLists(Lua_Mob who);
|
||||
void RemoveFromHateLists(Lua_Mob who, bool set_to_one);
|
||||
void MessageGroup(Lua_Mob who, bool skip_close, uint32 type, const char *message);
|
||||
Lua_Client GetRandomClient(float x, float y, float z, float dist);
|
||||
Lua_Client GetRandomClient(float x, float y, float z, float dist, Lua_Client exclude);
|
||||
Lua_Mob_List GetMobList();
|
||||
Lua_Client_List GetClientList();
|
||||
Lua_Client_List GetShuffledClientList();
|
||||
Lua_NPC_List GetNPCList();
|
||||
Lua_Corpse_List GetCorpseList();
|
||||
Lua_Object_List GetObjectList();
|
||||
Lua_Doors_List GetDoorsList();
|
||||
Lua_Spawn_List GetSpawnList();
|
||||
void SignalAllClients(int signal);
|
||||
void ChannelMessage(Lua_Mob from, int channel_num, int language, const char *message);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
#ifndef EQEMU_LUA_GENERAL_H
|
||||
#define EQEMU_LUA_GENERAL_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
luabind::scope lua_register_general();
|
||||
luabind::scope lua_register_random();
|
||||
luabind::scope lua_register_events();
|
||||
luabind::scope lua_register_faction();
|
||||
luabind::scope lua_register_slot();
|
||||
luabind::scope lua_register_material();
|
||||
luabind::scope lua_register_client_version();
|
||||
luabind::scope lua_register_appearance();
|
||||
luabind::scope lua_register_classes();
|
||||
luabind::scope lua_register_skills();
|
||||
luabind::scope lua_register_bodytypes();
|
||||
luabind::scope lua_register_filters();
|
||||
luabind::scope lua_register_message_types();
|
||||
luabind::scope lua_register_rules_const();
|
||||
luabind::scope lua_register_rulei();
|
||||
luabind::scope lua_register_ruler();
|
||||
luabind::scope lua_register_ruleb();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,135 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "groups.h"
|
||||
#include "masterentity.h"
|
||||
#include "lua_group.h"
|
||||
#include "lua_entity.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
|
||||
void Lua_Group::DisbandGroup() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DisbandGroup();
|
||||
}
|
||||
|
||||
bool Lua_Group::IsGroupMember(Lua_Mob mob) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsGroupMember(mob);
|
||||
}
|
||||
|
||||
void Lua_Group::CastGroupSpell(Lua_Mob caster, int spell_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->CastGroupSpell(caster, spell_id);
|
||||
}
|
||||
|
||||
void Lua_Group::SplitExp(uint32 exp, Lua_Mob other) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitExp(exp, other);
|
||||
}
|
||||
|
||||
void Lua_Group::GroupMessage(Lua_Mob sender, int language, const char *message) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->GroupMessage(sender, language, 100, message);
|
||||
}
|
||||
|
||||
uint32 Lua_Group::GetTotalGroupDamage(Lua_Mob other) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetTotalGroupDamage(other);
|
||||
}
|
||||
|
||||
void Lua_Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitMoney(copper, silver, gold, platinum);
|
||||
}
|
||||
|
||||
void Lua_Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitMoney(copper, silver, gold, platinum, splitter);
|
||||
}
|
||||
|
||||
void Lua_Group::SetLeader(Lua_Mob leader) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetLeader(leader);
|
||||
}
|
||||
|
||||
Lua_Mob Lua_Group::GetLeader() {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return self->GetLeader();
|
||||
}
|
||||
|
||||
const char *Lua_Group::GetLeaderName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetLeaderName();
|
||||
}
|
||||
|
||||
bool Lua_Group::IsLeader(Lua_Mob leader) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsLeader(leader);
|
||||
}
|
||||
|
||||
int Lua_Group::GroupCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GroupCount();
|
||||
}
|
||||
|
||||
int Lua_Group::GetHighestLevel() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetHighestLevel();
|
||||
}
|
||||
|
||||
int Lua_Group::GetLowestLevel() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetLowestLevel();
|
||||
}
|
||||
|
||||
void Lua_Group::TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->TeleportGroup(sender, zone_id, instance_id, x, y, z, h);
|
||||
}
|
||||
|
||||
int Lua_Group::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
Lua_Mob Lua_Group::GetMember(int index) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
|
||||
if(index >= 6 || index < 0) {
|
||||
return Lua_Mob();
|
||||
}
|
||||
|
||||
return self->members[index];
|
||||
}
|
||||
|
||||
luabind::scope lua_register_group() {
|
||||
return luabind::class_<Lua_Group>("Group")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Group::Null)
|
||||
.property("valid", &Lua_Group::Valid)
|
||||
.def("DisbandGroup", (void(Lua_Group::*)(void))&Lua_Group::DisbandGroup)
|
||||
.def("IsGroupMember", (bool(Lua_Group::*)(Lua_Mob))&Lua_Group::IsGroupMember)
|
||||
.def("CastGroupSpell", (void(Lua_Group::*)(Lua_Mob,int))&Lua_Group::CastGroupSpell)
|
||||
.def("SplitExp", (void(Lua_Group::*)(uint32,Lua_Mob))&Lua_Group::SplitExp)
|
||||
.def("GroupMessage", (void(Lua_Group::*)(Lua_Mob,int,const char* message))&Lua_Group::GroupMessage)
|
||||
.def("GetTotalGroupDamage", (uint32(Lua_Group::*)(Lua_Mob))&Lua_Group::GetTotalGroupDamage)
|
||||
.def("SplitMoney", (void(Lua_Group::*)(uint32,uint32,uint32,uint32))&Lua_Group::SplitMoney)
|
||||
.def("SplitMoney", (void(Lua_Group::*)(uint32,uint32,uint32,uint32,Lua_Client))&Lua_Group::SplitMoney)
|
||||
.def("SetLeader", (void(Lua_Group::*)(Lua_Mob))&Lua_Group::SetLeader)
|
||||
.def("GetLeader", (Lua_Mob(Lua_Group::*)(void))&Lua_Group::GetLeader)
|
||||
.def("GetLeaderName", (const char*(Lua_Group::*)(void))&Lua_Group::GetLeaderName)
|
||||
.def("IsLeader", (bool(Lua_Group::*)(Lua_Mob))&Lua_Group::IsLeader)
|
||||
.def("GroupCount", (int(Lua_Group::*)(void))&Lua_Group::GroupCount)
|
||||
.def("GetHighestLevel", (int(Lua_Group::*)(void))&Lua_Group::GetHighestLevel)
|
||||
.def("GetLowestLevel", (int(Lua_Group::*)(void))&Lua_Group::GetLowestLevel)
|
||||
.def("TeleportGroup", (void(Lua_Group::*)(Lua_Mob,uint32,uint32,float,float,float,float))&Lua_Group::TeleportGroup)
|
||||
.def("GetID", (int(Lua_Group::*)(void))&Lua_Group::GetID)
|
||||
.def("GetMember", (Lua_Mob(Lua_Group::*)(int))&Lua_Group::GetMember);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef EQEMU_LUA_GROUP_H
|
||||
#define EQEMU_LUA_GROUP_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Group;
|
||||
class Lua_Mob;
|
||||
class Lua_Client;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_group();
|
||||
|
||||
class Lua_Group : public Lua_Ptr<Group>
|
||||
{
|
||||
typedef Group NativeType;
|
||||
public:
|
||||
Lua_Group() : Lua_Ptr(nullptr) { }
|
||||
Lua_Group(Group *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Group() { }
|
||||
|
||||
operator Group*() {
|
||||
return reinterpret_cast<Group*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
void DisbandGroup();
|
||||
bool IsGroupMember(Lua_Mob mob);
|
||||
void CastGroupSpell(Lua_Mob caster, int spell_id);
|
||||
void SplitExp(uint32 exp, Lua_Mob other);
|
||||
void GroupMessage(Lua_Mob sender, int language, const char *message);
|
||||
uint32 GetTotalGroupDamage(Lua_Mob other);
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter);
|
||||
void SetLeader(Lua_Mob leader);
|
||||
Lua_Mob GetLeader();
|
||||
const char *GetLeaderName();
|
||||
bool IsLeader(Lua_Mob leader);
|
||||
int GroupCount();
|
||||
int GetHighestLevel();
|
||||
int GetLowestLevel();
|
||||
void TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h);
|
||||
int GetID();
|
||||
Lua_Mob GetMember(int index);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
#include <luabind/iterator_policy.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "hate_list.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_hate_list.h"
|
||||
|
||||
struct Lua_HateList
|
||||
{
|
||||
std::vector<Lua_HateEntry> entries;
|
||||
};
|
||||
|
||||
Lua_Mob Lua_HateEntry::GetEnt() {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->ent);
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetEnt(Lua_Mob e) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ent = e;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetDamage() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->damage;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetDamage(int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->damage = value;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetHate() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->hate;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetHate(int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->hate = value;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetFrenzy() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->bFrenzy;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetFrenzy(bool value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->bFrenzy = value;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_hate_entry() {
|
||||
|
||||
return luabind::class_<Lua_HateEntry>("HateEntry")
|
||||
.property("null", &Lua_HateEntry::Null)
|
||||
.property("valid", &Lua_HateEntry::Valid)
|
||||
.property("ent", &Lua_HateEntry::GetEnt, &Lua_HateEntry::SetEnt)
|
||||
.property("damage", &Lua_HateEntry::GetDamage, &Lua_HateEntry::SetDamage)
|
||||
.property("hate", &Lua_HateEntry::GetHate, &Lua_HateEntry::SetHate)
|
||||
.property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_hate_list() {
|
||||
return luabind::class_<Lua_HateList>("HateList")
|
||||
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
#include <luabind/iterator_policy.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "hate_list.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_hate_list.h"
|
||||
|
||||
Lua_Mob Lua_HateEntry::GetEnt() {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->entity_on_hatelist);
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetEnt(Lua_Mob e) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->entity_on_hatelist = e;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetDamage() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->hatelist_damage;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetDamage(int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->hatelist_damage = value;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetHate() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->stored_hate_amount;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetHate(int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->stored_hate_amount = value;
|
||||
}
|
||||
|
||||
int Lua_HateEntry::GetFrenzy() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->is_entity_frenzy;
|
||||
}
|
||||
|
||||
void Lua_HateEntry::SetFrenzy(bool value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->is_entity_frenzy = value;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_hate_entry() {
|
||||
|
||||
return luabind::class_<Lua_HateEntry>("HateEntry")
|
||||
.property("null", &Lua_HateEntry::Null)
|
||||
.property("valid", &Lua_HateEntry::Valid)
|
||||
.property("ent", &Lua_HateEntry::GetEnt, &Lua_HateEntry::SetEnt)
|
||||
.property("damage", &Lua_HateEntry::GetDamage, &Lua_HateEntry::SetDamage)
|
||||
.property("hate", &Lua_HateEntry::GetHate, &Lua_HateEntry::SetHate)
|
||||
.property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_hate_list() {
|
||||
return luabind::class_<Lua_HateList>("HateList")
|
||||
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef EQEMU_LUA_HATE_LIST_H
|
||||
#define EQEMU_LUA_HATE_LIST_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Lua_Mob;
|
||||
struct struct_HateList;
|
||||
|
||||
luabind::scope lua_register_hate_entry();
|
||||
luabind::scope lua_register_hate_list();
|
||||
|
||||
class Lua_HateEntry : public Lua_Ptr<struct_HateList>
|
||||
{
|
||||
typedef struct_HateList NativeType;
|
||||
public:
|
||||
Lua_HateEntry() : Lua_Ptr(nullptr) { }
|
||||
Lua_HateEntry(struct_HateList *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_HateEntry() { }
|
||||
|
||||
Lua_Mob GetEnt();
|
||||
void SetEnt(Lua_Mob e);
|
||||
int GetDamage();
|
||||
void SetDamage(int value);
|
||||
int GetHate();
|
||||
void SetHate(int value);
|
||||
int GetFrenzy();
|
||||
void SetFrenzy(bool value);
|
||||
};
|
||||
|
||||
struct Lua_HateList
|
||||
{
|
||||
std::vector<Lua_HateEntry> entries;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,201 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "lua_inventory.h"
|
||||
#include "lua_iteminst.h"
|
||||
#include "lua_item.h"
|
||||
|
||||
Lua_ItemInst Lua_Inventory::GetItem(int slot_id) {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return self->GetItem(slot_id);
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_Inventory::GetItem(int slot_id, int bag_slot) {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return self->GetItem(slot_id, bag_slot);
|
||||
}
|
||||
|
||||
int Lua_Inventory::PutItem(int slot_id, Lua_ItemInst item) {
|
||||
Lua_Safe_Call_Int();
|
||||
EQEmu::ItemInstance *inst = item;
|
||||
if(!inst) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->PutItem(slot_id, *inst);
|
||||
}
|
||||
|
||||
int Lua_Inventory::PushCursor(Lua_ItemInst item) {
|
||||
Lua_Safe_Call_Int();
|
||||
EQEmu::ItemInstance *inst = item;
|
||||
if(!inst) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->PushCursor(*inst);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::SwapItem(int slot_a, int slot_b) {
|
||||
Lua_Safe_Call_Bool();
|
||||
EQEmu::InventoryProfile::SwapItemFailState fail_state = EQEmu::InventoryProfile::swapInvalid;
|
||||
return self->SwapItem(slot_a, slot_b, fail_state);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::DeleteItem(int slot_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->DeleteItem(slot_id);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::DeleteItem(int slot_id, int quantity) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->DeleteItem(slot_id, quantity);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::CheckNoDrop(int slot_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->CheckNoDrop(slot_id);
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_Inventory::PopItem(int slot_id) {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return Lua_ItemInst(self->PopItem(slot_id), true);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItem(int item_id) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItem(item_id);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItem(int item_id, int quantity) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItem(item_id, quantity);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItem(int item_id, int quantity, int where) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItem(item_id, quantity, where);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::HasSpaceForItem(Lua_Item item, int quantity) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->HasSpaceForItem(item, quantity);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItemByUse(int use) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItemByUse(use);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItemByUse(int use, uint8 quantity) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItemByUse(use, quantity);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItemByUse(int use, uint8 quantity, uint8 where) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItemByUse(use, quantity, where);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItemByLoreGroup(uint32 loregroup) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItemByLoreGroup(loregroup);
|
||||
}
|
||||
|
||||
int Lua_Inventory::HasItemByLoreGroup(uint32 loregroup, int where) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HasItemByLoreGroup(loregroup, where);
|
||||
}
|
||||
|
||||
int Lua_Inventory::FindFreeSlot(bool for_bag, bool try_cursor) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->FindFreeSlot(for_bag, try_cursor);
|
||||
}
|
||||
|
||||
int Lua_Inventory::FindFreeSlot(bool for_bag, bool try_cursor, int min_size) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->FindFreeSlot(for_bag, try_cursor, min_size);
|
||||
}
|
||||
|
||||
int Lua_Inventory::FindFreeSlot(bool for_bag, bool try_cursor, int min_size, bool is_arrow) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->FindFreeSlot(for_bag, try_cursor, min_size, is_arrow);
|
||||
}
|
||||
|
||||
int Lua_Inventory::CalcSlotId(int slot_id) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CalcSlotId(slot_id);
|
||||
}
|
||||
|
||||
int Lua_Inventory::CalcSlotId(int slot_id, int bag_slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CalcSlotId(slot_id, bag_slot);
|
||||
}
|
||||
|
||||
int Lua_Inventory::CalcBagIdx(int slot_id) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CalcBagIdx(slot_id);
|
||||
}
|
||||
|
||||
int Lua_Inventory::CalcSlotFromMaterial(int material) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CalcSlotFromMaterial(material);
|
||||
}
|
||||
|
||||
int Lua_Inventory::CalcMaterialFromSlot(int equipslot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CalcMaterialFromSlot(equipslot);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::CanItemFitInContainer(Lua_Item item, Lua_Item container) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->CanItemFitInContainer(item, container);
|
||||
}
|
||||
|
||||
bool Lua_Inventory::SupportsContainers(int slot_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->SupportsContainers(slot_id);
|
||||
}
|
||||
|
||||
int Lua_Inventory::GetSlotByItemInst(Lua_ItemInst inst) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSlotByItemInst(inst);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_inventory() {
|
||||
return luabind::class_<Lua_Inventory>("Inventory")
|
||||
.def(luabind::constructor<>())
|
||||
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int))&Lua_Inventory::GetItem)
|
||||
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int,int))&Lua_Inventory::GetItem)
|
||||
.def("PutItem", (int(Lua_Inventory::*)(int,Lua_ItemInst))&Lua_Inventory::PutItem)
|
||||
.def("PushCursor", (int(Lua_Inventory::*)(Lua_ItemInst))&Lua_Inventory::PushCursor)
|
||||
.def("SwapItem", (bool(Lua_Inventory::*)(int,int))&Lua_Inventory::SwapItem)
|
||||
.def("DeleteItem", (bool(Lua_Inventory::*)(int))&Lua_Inventory::DeleteItem)
|
||||
.def("DeleteItem", (bool(Lua_Inventory::*)(int,int))&Lua_Inventory::DeleteItem)
|
||||
.def("CheckNoDrop", (bool(Lua_Inventory::*)(int))&Lua_Inventory::CheckNoDrop)
|
||||
.def("PopItem", (Lua_ItemInst(Lua_Inventory::*)(int))&Lua_Inventory::PopItem)
|
||||
.def("HasItem", (int(Lua_Inventory::*)(int))&Lua_Inventory::HasItem)
|
||||
.def("HasItem", (int(Lua_Inventory::*)(int,int))&Lua_Inventory::HasItem)
|
||||
.def("HasItem", (int(Lua_Inventory::*)(int,int,int))&Lua_Inventory::HasItem)
|
||||
.def("HasSpaceForItem", (bool(Lua_Inventory::*)(Lua_Item,int))&Lua_Inventory::HasSpaceForItem)
|
||||
.def("HasItemByUse", (int(Lua_Inventory::*)(int))&Lua_Inventory::HasItemByUse)
|
||||
.def("HasItemByUse", (int(Lua_Inventory::*)(int,uint8))&Lua_Inventory::HasItemByUse)
|
||||
.def("HasItemByUse", (int(Lua_Inventory::*)(int,uint8,uint8))&Lua_Inventory::HasItemByUse)
|
||||
.def("HasItemByLoreGroup", (int(Lua_Inventory::*)(uint32))&Lua_Inventory::HasItemByLoreGroup)
|
||||
.def("HasItemByLoreGroup", (int(Lua_Inventory::*)(uint32,int))&Lua_Inventory::HasItemByLoreGroup)
|
||||
.def("FindFreeSlot", (int(Lua_Inventory::*)(bool,bool))&Lua_Inventory::FindFreeSlot)
|
||||
.def("FindFreeSlot", (int(Lua_Inventory::*)(bool,bool,int))&Lua_Inventory::FindFreeSlot)
|
||||
.def("FindFreeSlot", (int(Lua_Inventory::*)(bool,bool,int,bool))&Lua_Inventory::FindFreeSlot)
|
||||
.def("CalcSlotId", (int(Lua_Inventory::*)(int))&Lua_Inventory::CalcSlotId)
|
||||
.def("CalcSlotId", (int(Lua_Inventory::*)(int,int))&Lua_Inventory::CalcSlotId)
|
||||
.def("CalcBagIdx", (int(Lua_Inventory::*)(int))&Lua_Inventory::CalcBagIdx)
|
||||
.def("CalcSlotFromMaterial", (int(Lua_Inventory::*)(int))&Lua_Inventory::CalcSlotFromMaterial)
|
||||
.def("CalcMaterialFromSlot", (int(Lua_Inventory::*)(int))&Lua_Inventory::CalcMaterialFromSlot)
|
||||
.def("CanItemFitInContainer", (bool(Lua_Inventory::*)(Lua_Item,Lua_Item))&Lua_Inventory::CanItemFitInContainer)
|
||||
.def("SupportsContainers", (bool(Lua_Inventory::*)(int))&Lua_Inventory::SupportsContainers)
|
||||
.def("GetSlotByItemInst", (int(Lua_Inventory::*)(Lua_ItemInst))&Lua_Inventory::GetSlotByItemInst);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
#ifndef EQEMU_LUA_INVENTORY_H
|
||||
#define EQEMU_LUA_INVENTORY_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Lua_ItemInst;
|
||||
class Lua_Item;
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
class InventoryProfile;
|
||||
}
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_inventory();
|
||||
|
||||
// This class should be deprecated due to the nature of inventory actions.
|
||||
// Direct manipulation of the inventory system bypasses the client management
|
||||
// of database calls and can lead to lost items, duplicated items and/or
|
||||
// desync'd inventories, if not handled correctly.
|
||||
|
||||
class Lua_Inventory : public Lua_Ptr<EQEmu::InventoryProfile>
|
||||
{
|
||||
typedef EQEmu::InventoryProfile NativeType;
|
||||
public:
|
||||
Lua_Inventory() : Lua_Ptr(nullptr) { }
|
||||
Lua_Inventory(EQEmu::InventoryProfile *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Inventory() { }
|
||||
|
||||
operator EQEmu::InventoryProfile*() {
|
||||
return reinterpret_cast<EQEmu::InventoryProfile*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
Lua_ItemInst GetItem(int slot_id);
|
||||
Lua_ItemInst GetItem(int slot_id, int bag_slot);
|
||||
int PutItem(int slot_id, Lua_ItemInst item);
|
||||
int PushCursor(Lua_ItemInst item);
|
||||
bool SwapItem(int slot_a, int slot_b);
|
||||
bool DeleteItem(int slot_id);
|
||||
bool DeleteItem(int slot_id, int quantity);
|
||||
bool CheckNoDrop(int slot_id);
|
||||
Lua_ItemInst PopItem(int slot_id);
|
||||
int HasItem(int item_id);
|
||||
int HasItem(int item_id, int quantity);
|
||||
int HasItem(int item_id, int quantity, int where);
|
||||
bool HasSpaceForItem(Lua_Item item, int quantity);
|
||||
int HasItemByUse(int use);
|
||||
int HasItemByUse(int use, uint8 quantity);
|
||||
int HasItemByUse(int use, uint8 quantity, uint8 where);
|
||||
int HasItemByLoreGroup(uint32 loregroup);
|
||||
int HasItemByLoreGroup(uint32 loregroup, int where);
|
||||
int FindFreeSlot(bool for_bag, bool try_cursor);
|
||||
int FindFreeSlot(bool for_bag, bool try_cursor, int min_size);
|
||||
int FindFreeSlot(bool for_bag, bool try_cursor, int min_size, bool is_arrow);
|
||||
int CalcSlotId(int slot_id);
|
||||
int CalcSlotId(int slot_id, int bag_slot);
|
||||
int CalcBagIdx(int slot_id);
|
||||
int CalcSlotFromMaterial(int material);
|
||||
int CalcMaterialFromSlot(int equipslot);
|
||||
bool CanItemFitInContainer(Lua_Item item, Lua_Item container);
|
||||
bool SupportsContainers(int slot_id);
|
||||
int GetSlotByItemInst(Lua_ItemInst inst);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,209 @@
|
||||
#ifndef EQEMU_LUA_ITEM_H
|
||||
#define EQEMU_LUA_ITEM_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
struct ItemData;
|
||||
}
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_item();
|
||||
|
||||
class Lua_Item : public Lua_Ptr<const EQEmu::ItemData>
|
||||
{
|
||||
typedef const EQEmu::ItemData NativeType;
|
||||
public:
|
||||
Lua_Item(uint32 item_id);
|
||||
Lua_Item() : Lua_Ptr(nullptr) { }
|
||||
Lua_Item(const EQEmu::ItemData *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Item() { }
|
||||
|
||||
operator const EQEmu::ItemData*() {
|
||||
return reinterpret_cast<const EQEmu::ItemData*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
int GetMinStatus();
|
||||
int GetItemClass();
|
||||
const char *GetName();
|
||||
const char *GetLore();
|
||||
const char *GetIDFile();
|
||||
uint32 GetID();
|
||||
int GetWeight();
|
||||
int GetNoRent();
|
||||
int GetNoDrop();
|
||||
int GetSize();
|
||||
uint32 GetSlots();
|
||||
uint32 GetPrice();
|
||||
uint32 GetIcon();
|
||||
uint32 GetLoreGroup();
|
||||
bool GetLoreFlag();
|
||||
bool GetPendingLoreFlag();
|
||||
bool GetArtifactFlag();
|
||||
bool GetSummonedFlag();
|
||||
int GetFVNoDrop();
|
||||
uint32 GetFavor();
|
||||
uint32 GetGuildFavor();
|
||||
uint32 GetPointType();
|
||||
int GetBagType();
|
||||
int GetBagSlots();
|
||||
int GetBagSize();
|
||||
int GetBagWR();
|
||||
bool GetBenefitFlag();
|
||||
bool GetTradeskills();
|
||||
int GetCR();
|
||||
int GetDR();
|
||||
int GetPR();
|
||||
int GetMR();
|
||||
int GetFR();
|
||||
int GetAStr();
|
||||
int GetASta();
|
||||
int GetAAgi();
|
||||
int GetADex();
|
||||
int GetACha();
|
||||
int GetAInt();
|
||||
int GetAWis();
|
||||
int GetHP();
|
||||
int GetMana();
|
||||
int GetAC();
|
||||
uint32 GetDeity();
|
||||
int GetSkillModValue();
|
||||
uint32 GetSkillModType();
|
||||
uint32 GetBaneDmgRace();
|
||||
int GetBaneDmgAmt();
|
||||
uint32 GetBaneDmgBody();
|
||||
bool GetMagic();
|
||||
int GetCastTime_();
|
||||
int GetReqLevel();
|
||||
uint32 GetBardType();
|
||||
int GetBardValue();
|
||||
int GetLight();
|
||||
int GetDelay();
|
||||
int GetRecLevel();
|
||||
int GetRecSkill();
|
||||
int GetElemDmgType();
|
||||
int GetElemDmgAmt();
|
||||
int GetRange();
|
||||
uint32 GetDamage();
|
||||
uint32 GetColor();
|
||||
uint32 GetClasses();
|
||||
uint32 GetRaces();
|
||||
int GetMaxCharges();
|
||||
int GetItemType();
|
||||
int GetMaterial();
|
||||
double GetSellRate();
|
||||
uint32 GetFulfilment();
|
||||
int GetCastTime();
|
||||
uint32 GetEliteMaterial();
|
||||
int GetProcRate();
|
||||
int GetCombatEffects();
|
||||
int GetShielding();
|
||||
int GetStunResist();
|
||||
int GetStrikeThrough();
|
||||
uint32 GetExtraDmgSkill();
|
||||
uint32 GetExtraDmgAmt();
|
||||
int GetSpellShield();
|
||||
int GetAvoidance();
|
||||
int GetAccuracy();
|
||||
uint32 GetCharmFileID();
|
||||
int GetFactionMod1();
|
||||
int GetFactionMod2();
|
||||
int GetFactionMod3();
|
||||
int GetFactionMod4();
|
||||
int GetFactionAmt1();
|
||||
int GetFactionAmt2();
|
||||
int GetFactionAmt3();
|
||||
int GetFactionAmt4();
|
||||
const char *GetCharmFile();
|
||||
uint32 GetAugType();
|
||||
int GetAugSlotType(int i);
|
||||
int GetAugSlotVisible(int i);
|
||||
int GetAugSlotUnk2(int i);
|
||||
uint32 GetLDoNTheme();
|
||||
uint32 GetLDoNPrice();
|
||||
uint32 GetLDoNSold();
|
||||
uint32 GetBaneDmgRaceAmt();
|
||||
uint32 GetAugRestrict();
|
||||
uint32 GetEndur();
|
||||
uint32 GetDotShielding();
|
||||
uint32 GetAttack();
|
||||
uint32 GetRegen();
|
||||
uint32 GetManaRegen();
|
||||
uint32 GetEnduranceRegen();
|
||||
uint32 GetHaste();
|
||||
uint32 GetDamageShield();
|
||||
uint32 GetRecastDelay();
|
||||
uint32 GetRecastType();
|
||||
uint32 GetAugDistiller();
|
||||
bool GetAttuneable();
|
||||
bool GetNoPet();
|
||||
bool GetPotionBelt();
|
||||
bool GetStackable();
|
||||
bool GetNoTransfer();
|
||||
bool GetQuestItemFlag();
|
||||
int GetStackSize();
|
||||
int GetPotionBeltSlots();
|
||||
int GetClick_Effect();
|
||||
int GetClick_Type();
|
||||
int GetClick_Level();
|
||||
int GetClick_Level2();
|
||||
int GetProc_Effect();
|
||||
int GetProc_Type();
|
||||
int GetProc_Level();
|
||||
int GetProc_Level2();
|
||||
int GetWorn_Effect();
|
||||
int GetWorn_Type();
|
||||
int GetWorn_Level();
|
||||
int GetWorn_Level2();
|
||||
int GetFocus_Effect();
|
||||
int GetFocus_Type();
|
||||
int GetFocus_Level();
|
||||
int GetFocus_Level2();
|
||||
int GetScroll_Effect();
|
||||
int GetScroll_Type();
|
||||
int GetScroll_Level();
|
||||
int GetScroll_Level2();
|
||||
int GetBard_Effect();
|
||||
int GetBard_Type();
|
||||
int GetBard_Level();
|
||||
int GetBard_Level2();
|
||||
int GetBook();
|
||||
uint32 GetBookType();
|
||||
const char *GetFilename();
|
||||
int GetSVCorruption();
|
||||
uint32 GetPurity();
|
||||
uint32 GetBackstabDmg();
|
||||
uint32 GetDSMitigation();
|
||||
int GetHeroicStr();
|
||||
int GetHeroicInt();
|
||||
int GetHeroicWis();
|
||||
int GetHeroicAgi();
|
||||
int GetHeroicDex();
|
||||
int GetHeroicSta();
|
||||
int GetHeroicCha();
|
||||
int GetHeroicMR();
|
||||
int GetHeroicFR();
|
||||
int GetHeroicCR();
|
||||
int GetHeroicDR();
|
||||
int GetHeroicPR();
|
||||
int GetHeroicSVCorrup();
|
||||
int GetHealAmt();
|
||||
int GetSpellDmg();
|
||||
uint32 GetLDoNSellBackRate();
|
||||
uint32 GetScriptFileID();
|
||||
int GetExpendableArrow();
|
||||
uint32 GetClairvoyance();
|
||||
const char *GetClickName();
|
||||
const char *GetProcName();
|
||||
const char *GetWornName();
|
||||
const char *GetFocusName();
|
||||
const char *GetScrollName();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,321 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "lua_iteminst.h"
|
||||
#include "lua_item.h"
|
||||
|
||||
Lua_ItemInst::Lua_ItemInst(int item_id) {
|
||||
SetLuaPtrData(database.CreateItem(item_id));
|
||||
cloned_ = true;
|
||||
}
|
||||
|
||||
Lua_ItemInst::Lua_ItemInst(int item_id, int charges) {
|
||||
SetLuaPtrData(database.CreateItem(item_id, charges));
|
||||
cloned_ = true;
|
||||
}
|
||||
|
||||
Lua_ItemInst& Lua_ItemInst::operator=(const Lua_ItemInst& o) {
|
||||
if(o.cloned_) {
|
||||
cloned_ = true;
|
||||
d_ = new EQEmu::ItemInstance(*o.d_);
|
||||
} else {
|
||||
cloned_ = false;
|
||||
d_ = o.d_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Lua_ItemInst::Lua_ItemInst(const Lua_ItemInst& o) {
|
||||
if(o.cloned_) {
|
||||
cloned_ = true;
|
||||
d_ = new EQEmu::ItemInstance(*o.d_);
|
||||
} else {
|
||||
cloned_ = false;
|
||||
d_ = o.d_;
|
||||
}
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsType(int item_class) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsType(static_cast<EQEmu::item::ItemClass>(item_class));
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsStackable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsStackable();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsEquipable(int race, int class_) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEquipable(race, class_);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsEquipable(int slot_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEquipable(slot_id);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAugmentable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAugmentable();
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetAugmentType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAugmentType();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsExpendable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsExpendable();
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_ItemInst::GetItem(int slot) {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return Lua_ItemInst(self->GetItem(slot));
|
||||
}
|
||||
|
||||
Lua_Item Lua_ItemInst::GetItem() {
|
||||
Lua_Safe_Call_Class(Lua_Item);
|
||||
return Lua_Item(self->GetItem());
|
||||
}
|
||||
|
||||
Lua_Item Lua_ItemInst::GetUnscaledItem(int slot) {
|
||||
Lua_Safe_Call_Class(Lua_Item);
|
||||
return self->GetUnscaledItem();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetItemID(int slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemID(slot);
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetTotalItemCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetTotalItemCount();
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_ItemInst::GetAugment(int slot) {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return self->GetAugment(slot);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetAugmentItemID(int slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAugmentItemID(slot);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAugmented() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAugmented();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsWeapon() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsWeapon();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAmmo() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAmmo();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetItemScriptID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemScriptID();
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetCharges() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCharges();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCharges(int charges) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetCharges(charges);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetPrice() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPrice();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetPrice(uint32 price) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetPrice(price);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetColor(uint32 color) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetColor(color);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetColor() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetColor();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsInstNoDrop() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAttuned();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetInstNoDrop(bool flag) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetAttuned(flag);
|
||||
}
|
||||
|
||||
std::string Lua_ItemInst::GetCustomDataString() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetCustomDataString();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, std::string value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, float value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, bool value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
std::string Lua_ItemInst::GetCustomData(std::string identifier) {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetCustomData(identifier);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::DeleteCustomData(std::string identifier) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DeleteCustomData(identifier);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetScale(double scale_factor) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetExp((int)(scale_factor*10000+.5));
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetScaling(bool v) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetScaling(v);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetExp() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetExp();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetExp(uint32 exp) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetExp(exp);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::AddExp(uint32 exp) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddExp(exp);
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetMaxEvolveLvl() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetMaxEvolveLvl();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetKillsNeeded(int current_level) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetKillsNeeded(current_level);
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_ItemInst::Clone() {
|
||||
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||
return Lua_ItemInst(self->Clone(), true);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetTimer(std::string name, uint32 time) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetTimer(name, time);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::StopTimer(std::string name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->StopTimer(name);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::ClearTimers() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ClearTimers();
|
||||
}
|
||||
|
||||
luabind::scope lua_register_iteminst() {
|
||||
return luabind::class_<Lua_ItemInst>("ItemInst")
|
||||
.def(luabind::constructor<>())
|
||||
.def(luabind::constructor<int>())
|
||||
.def(luabind::constructor<int,int>())
|
||||
.property("null", &Lua_ItemInst::Null)
|
||||
.property("valid", &Lua_ItemInst::Valid)
|
||||
.def("IsType", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsType)
|
||||
.def("IsStackable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsStackable)
|
||||
.def("IsEquipable", (bool(Lua_ItemInst::*)(int,int))&Lua_ItemInst::IsEquipable)
|
||||
.def("IsEquipable", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsEquipable)
|
||||
.def("IsAugmentable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmentable)
|
||||
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
|
||||
.def("IsExpendable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsExpendable)
|
||||
.def("GetItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItem)
|
||||
.def("GetUnscaledItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetUnscaledItem)
|
||||
.def("GetItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItemID)
|
||||
.def("GetTotalItemCount", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetTotalItemCount)
|
||||
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
|
||||
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
|
||||
.def("IsAugmented", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmented)
|
||||
.def("IsWeapon", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsWeapon)
|
||||
.def("IsAmmo", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAmmo)
|
||||
.def("GetID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetID)
|
||||
.def("GetItemScriptID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItemScriptID)
|
||||
.def("GetItem", (Lua_Item(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItem)
|
||||
.def("GetCharges", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCharges)
|
||||
.def("SetCharges", (void(Lua_ItemInst::*)(int))&Lua_ItemInst::SetCharges)
|
||||
.def("GetPrice", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetPrice)
|
||||
.def("SetPrice", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetPrice)
|
||||
.def("SetColor", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetColor)
|
||||
.def("GetColor", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetColor)
|
||||
.def("IsInstNoDrop", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsInstNoDrop)
|
||||
.def("SetInstNoDrop", (void(Lua_ItemInst::*)(bool))&Lua_ItemInst::SetInstNoDrop)
|
||||
.def("GetCustomDataString", (std::string(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCustomDataString)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,std::string))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,int))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,float))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,bool))&Lua_ItemInst::SetCustomData)
|
||||
.def("GetCustomData", (std::string(Lua_ItemInst::*)(std::string))&Lua_ItemInst::GetCustomData)
|
||||
.def("DeleteCustomData", (void(Lua_ItemInst::*)(std::string))&Lua_ItemInst::DeleteCustomData)
|
||||
.def("SetScaling", (void(Lua_ItemInst::*)(bool))&Lua_ItemInst::SetScaling)
|
||||
.def("SetScale", (void(Lua_ItemInst::*)(double))&Lua_ItemInst::SetScale)
|
||||
.def("GetExp", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetExp)
|
||||
.def("SetExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetExp)
|
||||
.def("AddExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::AddExp)
|
||||
.def("GetMaxEvolveLvl", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetMaxEvolveLvl)
|
||||
.def("GetKillsNeeded", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetKillsNeeded)
|
||||
.def("Clone", (Lua_ItemInst(Lua_ItemInst::*)(void))&Lua_ItemInst::Clone)
|
||||
.def("SetTimer", (void(Lua_ItemInst::*)(std::string,uint32))&Lua_ItemInst::SetTimer)
|
||||
.def("StopTimer", (void(Lua_ItemInst::*)(std::string))&Lua_ItemInst::StopTimer)
|
||||
.def("ClearTimers", (void(Lua_ItemInst::*)(void))&Lua_ItemInst::ClearTimers);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,89 @@
|
||||
#ifndef EQEMU_LUA_ITEMINST_H
|
||||
#define EQEMU_LUA_ITEMINST_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Lua_Item;
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
class ItemInstance;
|
||||
}
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_iteminst();
|
||||
|
||||
class Lua_ItemInst : public Lua_Ptr<EQEmu::ItemInstance>
|
||||
{
|
||||
typedef EQEmu::ItemInstance NativeType;
|
||||
public:
|
||||
Lua_ItemInst(int item_id);
|
||||
Lua_ItemInst(int item_id, int charges);
|
||||
Lua_ItemInst() : Lua_Ptr(nullptr), cloned_(false) { }
|
||||
Lua_ItemInst(EQEmu::ItemInstance *d) : Lua_Ptr(d), cloned_(false) { }
|
||||
Lua_ItemInst(EQEmu::ItemInstance *d, bool cloned) : Lua_Ptr(d), cloned_(cloned) { }
|
||||
Lua_ItemInst& operator=(const Lua_ItemInst& o);
|
||||
Lua_ItemInst(const Lua_ItemInst& o);
|
||||
virtual ~Lua_ItemInst() { if(cloned_) { EQEmu::ItemInstance *ptr = GetLuaPtrData(); if(ptr) { delete ptr; } } }
|
||||
|
||||
operator EQEmu::ItemInstance*() {
|
||||
return reinterpret_cast<EQEmu::ItemInstance*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
bool IsType(int item_class);
|
||||
bool IsStackable();
|
||||
bool IsEquipable(int race, int class_);
|
||||
bool IsEquipable(int slot_id);
|
||||
bool IsAugmentable();
|
||||
int GetAugmentType();
|
||||
bool IsExpendable();
|
||||
Lua_ItemInst GetItem(int slot);
|
||||
Lua_Item GetItem();
|
||||
void SetItem(Lua_Item item);
|
||||
Lua_Item GetUnscaledItem(int slot);
|
||||
uint32 GetItemID(int slot);
|
||||
int GetTotalItemCount();
|
||||
Lua_ItemInst GetAugment(int slot);
|
||||
uint32 GetAugmentItemID(int slot);
|
||||
bool IsAugmented();
|
||||
bool IsWeapon();
|
||||
bool IsAmmo();
|
||||
uint32 GetID();
|
||||
uint32 GetItemScriptID();
|
||||
int GetCharges();
|
||||
void SetCharges(int charges);
|
||||
uint32 GetPrice();
|
||||
void SetPrice(uint32 price);
|
||||
void SetColor(uint32 color);
|
||||
uint32 GetColor();
|
||||
bool IsInstNoDrop();
|
||||
void SetInstNoDrop(bool flag);
|
||||
std::string GetCustomDataString();
|
||||
void SetCustomData(std::string identifier, std::string value);
|
||||
void SetCustomData(std::string identifier, int value);
|
||||
void SetCustomData(std::string identifier, float value);
|
||||
void SetCustomData(std::string identifier, bool value);
|
||||
std::string GetCustomData(std::string identifier);
|
||||
void DeleteCustomData(std::string identifier);
|
||||
void SetScaling(bool v);
|
||||
void SetScale(double scale_factor);
|
||||
uint32 GetExp();
|
||||
void SetExp(uint32 exp);
|
||||
void AddExp(uint32 exp);
|
||||
int GetMaxEvolveLvl();
|
||||
uint32 GetKillsNeeded(int current_level);
|
||||
Lua_ItemInst Clone();
|
||||
void SetTimer(std::string name, uint32 time);
|
||||
void StopTimer(std::string name);
|
||||
void ClearTimers();
|
||||
|
||||
private:
|
||||
bool cloned_;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,419 @@
|
||||
#ifndef EQEMU_LUA_MOB_H
|
||||
#define EQEMU_LUA_MOB_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_entity.h"
|
||||
|
||||
class Mob;
|
||||
struct Lua_HateList;
|
||||
class Lua_Item;
|
||||
class Lua_ItemInst;
|
||||
class Lua_StatBonuses;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
namespace adl {
|
||||
class object;
|
||||
}
|
||||
}
|
||||
|
||||
luabind::scope lua_register_mob();
|
||||
luabind::scope lua_register_special_abilities();
|
||||
|
||||
class Lua_Mob : public Lua_Entity
|
||||
{
|
||||
typedef Mob NativeType;
|
||||
public:
|
||||
Lua_Mob() { SetLuaPtrData(nullptr); }
|
||||
Lua_Mob(Mob *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_Mob() { }
|
||||
|
||||
operator Mob*() {
|
||||
return reinterpret_cast<Mob*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
const char *GetName();
|
||||
void Depop();
|
||||
void Depop(bool start_spawn_timer);
|
||||
bool BehindMob();
|
||||
bool BehindMob(Lua_Mob other);
|
||||
bool BehindMob(Lua_Mob other, float x);
|
||||
bool BehindMob(Lua_Mob other, float x, float y);
|
||||
void SetLevel(int level);
|
||||
void SetLevel(int level, bool command);
|
||||
void SendWearChange(int material_slot);
|
||||
bool IsMoving();
|
||||
bool IsFeared();
|
||||
bool IsBlind();
|
||||
void GotoBind();
|
||||
void Gate();
|
||||
bool Attack(Lua_Mob other);
|
||||
bool Attack(Lua_Mob other, int hand);
|
||||
bool Attack(Lua_Mob other, int hand, bool from_riposte);
|
||||
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough);
|
||||
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell);
|
||||
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::adl::object opts);
|
||||
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill);
|
||||
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable);
|
||||
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot);
|
||||
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic);
|
||||
void RangedAttack(Lua_Mob other);
|
||||
void ThrowingAttack(Lua_Mob other);
|
||||
void Heal();
|
||||
void HealDamage(uint32 amount);
|
||||
void HealDamage(uint32 amount, Lua_Mob other);
|
||||
uint32 GetLevelCon(int other);
|
||||
uint32 GetLevelCon(int my, int other);
|
||||
void SetHP(int hp);
|
||||
void DoAnim(int anim_num);
|
||||
void DoAnim(int anim_num, int type);
|
||||
void DoAnim(int anim_num, int type, bool ackreq);
|
||||
void DoAnim(int anim_num, int type, bool ackreq, int filter);
|
||||
void ChangeSize(double in_size);
|
||||
void ChangeSize(double in_size, bool no_restriction);
|
||||
void GMMove(double x, double y, double z);
|
||||
void GMMove(double x, double y, double z, double heading);
|
||||
void GMMove(double x, double y, double z, double heading, bool send_update);
|
||||
void TryMoveAlong(float distance, float heading);
|
||||
void TryMoveAlong(float distance, float heading, bool send);
|
||||
bool HasProcs();
|
||||
bool IsInvisible();
|
||||
bool IsInvisible(Lua_Mob other);
|
||||
void SetInvisible(int state);
|
||||
bool FindBuff(int spell_id);
|
||||
bool FindType(int type);
|
||||
bool FindType(int type, bool offensive);
|
||||
bool FindType(int type, bool offensive, int threshold);
|
||||
int GetBuffSlotFromType(int slot);
|
||||
int GetBaseRace();
|
||||
int GetBaseGender();
|
||||
int GetDeity();
|
||||
int GetRace();
|
||||
int GetGender();
|
||||
int GetTexture();
|
||||
int GetHelmTexture();
|
||||
int GetHairColor();
|
||||
int GetBeardColor();
|
||||
int GetEyeColor1();
|
||||
int GetEyeColor2();
|
||||
int GetHairStyle();
|
||||
int GetLuclinFace();
|
||||
int GetBeard();
|
||||
int GetDrakkinHeritage();
|
||||
int GetDrakkinTattoo();
|
||||
int GetDrakkinDetails();
|
||||
int GetClass();
|
||||
int GetLevel();
|
||||
const char *GetCleanName();
|
||||
Lua_Mob GetTarget();
|
||||
void SetTarget(Lua_Mob t);
|
||||
double GetHPRatio();
|
||||
bool IsWarriorClass();
|
||||
int GetHP();
|
||||
int GetMaxHP();
|
||||
int GetItemHPBonuses();
|
||||
int GetSpellHPBonuses();
|
||||
double GetWalkspeed();
|
||||
double GetRunspeed();
|
||||
int GetCasterLevel(int spell_id);
|
||||
int GetMaxMana();
|
||||
int GetMana();
|
||||
int SetMana(int mana);
|
||||
double GetManaRatio();
|
||||
int GetAC();
|
||||
int GetATK();
|
||||
int GetSTR();
|
||||
int GetSTA();
|
||||
int GetDEX();
|
||||
int GetAGI();
|
||||
int GetINT();
|
||||
int GetWIS();
|
||||
int GetCHA();
|
||||
int GetMR();
|
||||
int GetFR();
|
||||
int GetDR();
|
||||
int GetPR();
|
||||
int GetCR();
|
||||
int GetCorruption();
|
||||
int GetPhR();
|
||||
int GetMaxSTR();
|
||||
int GetMaxSTA();
|
||||
int GetMaxDEX();
|
||||
int GetMaxAGI();
|
||||
int GetMaxINT();
|
||||
int GetMaxWIS();
|
||||
int GetMaxCHA();
|
||||
double ResistSpell(int resist_type, int spell_id, Lua_Mob caster);
|
||||
double ResistSpell(int resist_type, int spell_id, Lua_Mob caster, bool use_resist_override);
|
||||
double ResistSpell(int resist_type, int spell_id, Lua_Mob caster, bool use_resist_override, int resist_override);
|
||||
double ResistSpell(int resist_type, int spell_id, Lua_Mob caster, bool use_resist_override, int resist_override, bool charisma_check);
|
||||
int GetSpecializeSkillValue(int spell_id);
|
||||
int GetNPCTypeID();
|
||||
bool IsTargeted();
|
||||
double GetX();
|
||||
double GetY();
|
||||
double GetZ();
|
||||
double GetHeading();
|
||||
double GetWaypointX();
|
||||
double GetWaypointY();
|
||||
double GetWaypointZ();
|
||||
double GetWaypointH();
|
||||
double GetWaypointPause();
|
||||
int GetWaypointID();
|
||||
void SetCurrentWP(int wp);
|
||||
double GetSize();
|
||||
void Message(int type, const char *message);
|
||||
void Message_StringID(int type, int string_id, uint32 distance);
|
||||
void Say(const char *message);
|
||||
void QuestSay(Lua_Client client, const char *message);
|
||||
void Shout(const char *message);
|
||||
void Emote(const char *message);
|
||||
void InterruptSpell();
|
||||
void InterruptSpell(int spell_id);
|
||||
bool CastSpell(int spell_id, int target_id);
|
||||
bool CastSpell(int spell_id, int target_id, int slot);
|
||||
bool CastSpell(int spell_id, int target_id, int slot, int cast_time);
|
||||
bool CastSpell(int spell_id, int target_id, int slot, int cast_time, int mana_cost);
|
||||
bool CastSpell(int spell_id, int target_id, int slot, int cast_time, int mana_cost, int item_slot);
|
||||
bool CastSpell(int spell_id, int target_id, int slot, int cast_time, int mana_cost, int item_slot, int timer, int timer_duration);
|
||||
bool CastSpell(int spell_id, int target_id, int slot, int cast_time, int mana_cost, int item_slot, int timer, int timer_duration,
|
||||
int resist_adjust);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target, int slot);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target, int slot, int mana_used);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target, int slot, int mana_used, uint32 inventory_slot);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target, int slot, int mana_used, uint32 inventory_slot, int resist_adjust);
|
||||
bool SpellFinished(int spell_id, Lua_Mob target, int slot, int mana_used, uint32 inventory_slot, int resist_adjust, bool proc);
|
||||
void SendBeginCast(int spell_id, int cast_time);
|
||||
void SpellEffect(Lua_Mob caster, int spell_id, double partial);
|
||||
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);
|
||||
void HalveAggro(Lua_Mob other);
|
||||
void DoubleAggro(Lua_Mob other);
|
||||
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 GetHandToHandDamage();
|
||||
int GetHandToHandDelay();
|
||||
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);
|
||||
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);
|
||||
int GetAAByAAID(int id);
|
||||
bool SetAA(int rank_id, int new_value);
|
||||
bool SetAA(int rank_id, int new_value, int charges);
|
||||
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 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(luabind::adl::object illusion);
|
||||
void ChangeRace(int in);
|
||||
void ChangeGender(int in);
|
||||
void ChangeTexture(int in);
|
||||
void ChangeHelmTexture(int in);
|
||||
void ChangeHairColor(int in);
|
||||
void ChangeBeardColor(int in);
|
||||
void ChangeEyeColor1(int in);
|
||||
void ChangeEyeColor2(int in);
|
||||
void ChangeHairStyle(int in);
|
||||
void ChangeLuclinFace(int in);
|
||||
void ChangeBeard(int in);
|
||||
void ChangeDrakkinHeritage(int in);
|
||||
void ChangeDrakkinTattoo(int in);
|
||||
void ChangeDrakkinDetails(int in);
|
||||
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);
|
||||
std::string GetGlobal(const char *varname);
|
||||
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 AddNimbusEffect(int effect_id);
|
||||
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);
|
||||
int GetFcDamageAmtIncoming(Lua_Mob caster, uint32 spell_id, bool use_skill, uint16 skill);
|
||||
int GetSkillDmgAmt(uint16 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();
|
||||
int GetSkill(int skill_id);
|
||||
int GetSpecialAbility(int ability);
|
||||
int GetSpecialAbilityParam(int ability, int param);
|
||||
void SetSpecialAbility(int ability, int level);
|
||||
void SetSpecialAbilityParam(int ability, int param, int value);
|
||||
void ClearSpecialAbilities();
|
||||
void ProcessSpecialAbilities(std::string str);
|
||||
void SetAppearance(int app);
|
||||
uint32 GetAppearance();
|
||||
void SetAppearance(int app, bool ignore_self);
|
||||
void SetDestructibleObject(bool set);
|
||||
bool IsImmuneToSpell(int spell_id, Lua_Mob caster);
|
||||
void BuffFadeBySpellID(int spell_id);
|
||||
void BuffFadeByEffect(int effect_id);
|
||||
void BuffFadeByEffect(int effect_id, int skipslot);
|
||||
void BuffFadeAll();
|
||||
void BuffFadeBySlot(int slot);
|
||||
void BuffFadeBySlot(int slot, bool recalc_bonuses);
|
||||
int CanBuffStack(int spell_id, int caster_level);
|
||||
int CanBuffStack(int spell_id, int caster_level, bool fail_if_overwrite);
|
||||
void SetPseudoRoot(bool in);
|
||||
uint8 SeeInvisible();
|
||||
bool SeeInvisibleUndead();
|
||||
bool SeeHide();
|
||||
bool SeeImprovedHide();
|
||||
uint8 GetNimbusEffect1();
|
||||
uint8 GetNimbusEffect2();
|
||||
uint8 GetNimbusEffect3();
|
||||
bool IsTargetable();
|
||||
bool HasShieldEquiped();
|
||||
bool HasTwoHandBluntEquiped();
|
||||
bool HasTwoHanderEquipped();
|
||||
uint32 GetHerosForgeModel(uint8 material_slot);
|
||||
uint32 IsEliteMaterialItem(uint8 material_slot);
|
||||
float GetBaseSize();
|
||||
bool HasOwner();
|
||||
bool IsPet();
|
||||
bool HasPet();
|
||||
bool IsSilenced();
|
||||
bool IsAmnesiad();
|
||||
int32 GetMeleeMitigation();
|
||||
int GetWeaponDamageBonus(Lua_Item weapon, bool offhand);
|
||||
Lua_StatBonuses GetItemBonuses();
|
||||
Lua_StatBonuses GetSpellBonuses();
|
||||
Lua_StatBonuses GetAABonuses();
|
||||
int16 GetMeleeDamageMod_SE(uint16 skill);
|
||||
int16 GetMeleeMinDamageMod_SE(uint16 skill);
|
||||
bool IsAttackAllowed(Lua_Mob target, bool isSpellAttack);
|
||||
bool IsCasting();
|
||||
int AttackAnimation(int Hand, Lua_ItemInst weapon);
|
||||
int GetWeaponDamage(Lua_Mob against, Lua_ItemInst weapon);
|
||||
bool IsBerserk();
|
||||
bool TryFinishingBlow(Lua_Mob defender, int &damage);
|
||||
int GetBodyType();
|
||||
int GetOrigBodyType();
|
||||
void CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,631 @@
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "../../common/spdat.h"
|
||||
#include "../masterentity.h"
|
||||
#include "../questmgr.h"
|
||||
#include "../zone.h"
|
||||
#include "../zone_config.h"
|
||||
|
||||
#include "lua_parser.h"
|
||||
#include "lua_mod.h"
|
||||
#include "lua_bit.h"
|
||||
#include "lua_entity.h"
|
||||
#include "lua_item.h"
|
||||
#include "lua_iteminst.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_hate_list.h"
|
||||
#include "lua_client.h"
|
||||
#include "lua_inventory.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_spell.h"
|
||||
#include "lua_entity_list.h"
|
||||
#include "lua_group.h"
|
||||
#include "lua_raid.h"
|
||||
#include "lua_corpse.h"
|
||||
#include "lua_object.h"
|
||||
#include "lua_door.h"
|
||||
#include "lua_spawn.h"
|
||||
#include "lua_packet.h"
|
||||
#include "lua_general.h"
|
||||
#include "lua_encounter.h"
|
||||
#include "lua_stat_bonuses.h"
|
||||
|
||||
void LuaMod::Init()
|
||||
{
|
||||
m_has_melee_mitigation = parser_->HasFunction("MeleeMitigation", package_name_);
|
||||
m_has_apply_damage_table = parser_->HasFunction("ApplyDamageTable", package_name_);
|
||||
m_has_avoid_damage = parser_->HasFunction("AvoidDamage", package_name_);
|
||||
m_has_check_hit_chance = parser_->HasFunction("CheckHitChance", package_name_);
|
||||
m_has_try_critical_hit = parser_->HasFunction("TryCriticalHit", package_name_);
|
||||
m_has_get_required_aa_experience = parser_->HasFunction("GetRequiredAAExperience", package_name_);
|
||||
m_has_get_exp_for_level = parser_->HasFunction("GetEXPForLevel", package_name_);
|
||||
m_has_get_experience_for_kill = parser_->HasFunction("GetExperienceForKill", package_name_);
|
||||
m_has_common_outgoing_hit_success = parser_->HasFunction("CommonOutgoingHitSuccess", package_name_);
|
||||
}
|
||||
|
||||
void PutDamageHitInfo(lua_State *L, luabind::adl::object &e, DamageHitInfo &hit) {
|
||||
luabind::adl::object lua_hit = luabind::newtable(L);
|
||||
lua_hit["base_damage"] = hit.base_damage;
|
||||
lua_hit["min_damage"] = hit.min_damage;
|
||||
lua_hit["damage_done"] = hit.damage_done;
|
||||
lua_hit["offense"] = hit.offense;
|
||||
lua_hit["tohit"] = hit.tohit;
|
||||
lua_hit["hand"] = hit.hand;
|
||||
lua_hit["skill"] = (int)hit.skill;
|
||||
e["hit"] = lua_hit;
|
||||
}
|
||||
|
||||
void GetDamageHitInfo(luabind::adl::object &ret, DamageHitInfo &hit) {
|
||||
auto luaHitTable = ret["hit"];
|
||||
if (luabind::type(luaHitTable) == LUA_TTABLE) {
|
||||
auto base_damage = luaHitTable["base_damage"];
|
||||
auto min_damage = luaHitTable["min_damage"];
|
||||
auto damage_done = luaHitTable["damage_done"];
|
||||
auto offense = luaHitTable["offense"];
|
||||
auto tohit = luaHitTable["tohit"];
|
||||
auto hand = luaHitTable["hand"];
|
||||
auto skill = luaHitTable["skill"];
|
||||
|
||||
if (luabind::type(base_damage) == LUA_TNUMBER) {
|
||||
hit.base_damage = luabind::object_cast<int>(base_damage);
|
||||
}
|
||||
|
||||
if (luabind::type(min_damage) == LUA_TNUMBER) {
|
||||
hit.min_damage = luabind::object_cast<int>(min_damage);
|
||||
}
|
||||
|
||||
if (luabind::type(damage_done) == LUA_TNUMBER) {
|
||||
hit.damage_done = luabind::object_cast<int>(damage_done);
|
||||
}
|
||||
|
||||
if (luabind::type(offense) == LUA_TNUMBER) {
|
||||
hit.offense = luabind::object_cast<int>(offense);
|
||||
}
|
||||
|
||||
if (luabind::type(tohit) == LUA_TNUMBER) {
|
||||
hit.tohit = luabind::object_cast<int>(tohit);
|
||||
}
|
||||
|
||||
if (luabind::type(hand) == LUA_TNUMBER) {
|
||||
hit.hand = luabind::object_cast<int>(hand);
|
||||
}
|
||||
|
||||
if (luabind::type(skill) == LUA_TNUMBER) {
|
||||
hit.skill = (EQEmu::skills::SkillType)luabind::object_cast<int>(skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PutExtraAttackOptions(lua_State *L, luabind::adl::object &e, ExtraAttackOptions *opts) {
|
||||
if (opts) {
|
||||
luabind::adl::object lua_opts = luabind::newtable(L);
|
||||
lua_opts["damage_percent"] = opts->damage_percent;
|
||||
lua_opts["damage_flat"] = opts->damage_flat;
|
||||
lua_opts["armor_pen_percent"] = opts->armor_pen_percent;
|
||||
lua_opts["armor_pen_flat"] = opts->armor_pen_flat;
|
||||
lua_opts["crit_percent"] = opts->crit_percent;
|
||||
lua_opts["crit_flat"] = opts->crit_flat;
|
||||
lua_opts["hate_percent"] = opts->hate_percent;
|
||||
lua_opts["hate_flat"] = opts->hate_flat;
|
||||
lua_opts["hit_chance"] = opts->hit_chance;
|
||||
lua_opts["melee_damage_bonus_flat"] = opts->melee_damage_bonus_flat;
|
||||
lua_opts["skilldmgtaken_bonus_flat"] = opts->skilldmgtaken_bonus_flat;
|
||||
e["opts"] = lua_opts;
|
||||
}
|
||||
}
|
||||
|
||||
void GetExtraAttackOptions(luabind::adl::object &ret, ExtraAttackOptions *opts) {
|
||||
if (opts) {
|
||||
auto luaOptsTable = ret["opts"];
|
||||
if (luabind::type(luaOptsTable) == LUA_TTABLE) {
|
||||
auto damage_percent = luaOptsTable["damage_percent"];
|
||||
auto damage_flat = luaOptsTable["damage_flat"];
|
||||
auto armor_pen_percent = luaOptsTable["armor_pen_percent"];
|
||||
auto armor_pen_flat = luaOptsTable["armor_pen_flat"];
|
||||
auto crit_percent = luaOptsTable["crit_percent"];
|
||||
auto crit_flat = luaOptsTable["crit_flat"];
|
||||
auto hate_percent = luaOptsTable["hate_percent"];
|
||||
auto hate_flat = luaOptsTable["hate_flat"];
|
||||
auto hit_chance = luaOptsTable["hit_chance"];
|
||||
auto melee_damage_bonus_flat = luaOptsTable["melee_damage_bonus_flat"];
|
||||
auto skilldmgtaken_bonus_flat = luaOptsTable["skilldmgtaken_bonus_flat"];
|
||||
|
||||
if (luabind::type(damage_percent) == LUA_TNUMBER) {
|
||||
opts->damage_percent = luabind::object_cast<float>(damage_percent);
|
||||
}
|
||||
|
||||
if (luabind::type(damage_flat) == LUA_TNUMBER) {
|
||||
opts->damage_flat = luabind::object_cast<int>(damage_flat);
|
||||
}
|
||||
|
||||
if (luabind::type(armor_pen_percent) == LUA_TNUMBER) {
|
||||
opts->armor_pen_percent = luabind::object_cast<float>(armor_pen_percent);
|
||||
}
|
||||
|
||||
if (luabind::type(armor_pen_flat) == LUA_TNUMBER) {
|
||||
opts->armor_pen_flat = luabind::object_cast<int>(armor_pen_flat);
|
||||
}
|
||||
|
||||
if (luabind::type(crit_percent) == LUA_TNUMBER) {
|
||||
opts->crit_percent = luabind::object_cast<float>(crit_percent);
|
||||
}
|
||||
|
||||
if (luabind::type(crit_flat) == LUA_TNUMBER) {
|
||||
opts->crit_flat = luabind::object_cast<float>(crit_flat);
|
||||
}
|
||||
|
||||
if (luabind::type(hate_percent) == LUA_TNUMBER) {
|
||||
opts->hate_percent = luabind::object_cast<float>(hate_percent);
|
||||
}
|
||||
|
||||
if (luabind::type(hate_flat) == LUA_TNUMBER) {
|
||||
opts->hate_flat = luabind::object_cast<int>(hate_flat);
|
||||
}
|
||||
|
||||
if (luabind::type(hit_chance) == LUA_TNUMBER) {
|
||||
opts->hit_chance = luabind::object_cast<int>(hit_chance);
|
||||
}
|
||||
|
||||
if (luabind::type(melee_damage_bonus_flat) == LUA_TNUMBER) {
|
||||
opts->melee_damage_bonus_flat = luabind::object_cast<int>(melee_damage_bonus_flat);
|
||||
}
|
||||
|
||||
if (luabind::type(skilldmgtaken_bonus_flat) == LUA_TNUMBER) {
|
||||
opts->skilldmgtaken_bonus_flat = luabind::object_cast<int>(skilldmgtaken_bonus_flat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::MeleeMitigation(Mob *self, Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_melee_mitigation) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "MeleeMitigation");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
Lua_Mob l_other(attacker);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
PutExtraAttackOptions(L, e, opts);
|
||||
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
GetExtraAttackOptions(ret, opts);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::ApplyDamageTable(Mob *self, DamageHitInfo &hit, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_apply_damage_table) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "ApplyDamageTable");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::AvoidDamage(Mob *self, Mob *other, DamageHitInfo &hit, bool &returnValue, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_avoid_damage) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "AvoidDamage");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
Lua_Mob l_other(other);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
auto returnValueObj = ret["ReturnValue"];
|
||||
if (luabind::type(returnValueObj) == LUA_TBOOLEAN) {
|
||||
returnValue = luabind::object_cast<bool>(returnValueObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::CheckHitChance(Mob *self, Mob* other, DamageHitInfo &hit, bool &returnValue, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_check_hit_chance) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "CheckHitChance");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
Lua_Mob l_other(other);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
auto returnValueObj = ret["ReturnValue"];
|
||||
if (luabind::type(returnValueObj) == LUA_TBOOLEAN) {
|
||||
returnValue = luabind::object_cast<bool>(returnValueObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::CommonOutgoingHitSuccess(Mob *self, Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault)
|
||||
{
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_common_outgoing_hit_success) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "CommonOutgoingHitSuccess");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
Lua_Mob l_other(other);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
PutExtraAttackOptions(L, e, opts);
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
GetExtraAttackOptions(ret, opts);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::TryCriticalHit(Mob *self, Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_try_critical_hit) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "TryCriticalHit");
|
||||
|
||||
Lua_Mob l_self(self);
|
||||
Lua_Mob l_other(defender);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
|
||||
PutDamageHitInfo(L, e, hit);
|
||||
PutExtraAttackOptions(L, e, opts);
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
GetDamageHitInfo(ret, hit);
|
||||
GetExtraAttackOptions(ret, opts);
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::GetRequiredAAExperience(Client *self, uint32 &returnValue, bool &ignoreDefault)
|
||||
{
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_get_required_aa_experience) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "GetRequiredAAExperience");
|
||||
|
||||
Lua_Client l_self(self);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
auto returnValueObj = ret["ReturnValue"];
|
||||
if (luabind::type(returnValueObj) == LUA_TNUMBER) {
|
||||
returnValue = luabind::object_cast<uint32>(returnValueObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, bool &ignoreDefault) {
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
if (!m_has_get_exp_for_level) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "GetEXPForLevel");
|
||||
|
||||
Lua_Client l_self(self);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["level"] = level;
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
auto returnValueObj = ret["ReturnValue"];
|
||||
if (luabind::type(returnValueObj) == LUA_TNUMBER) {
|
||||
returnValue = luabind::object_cast<uint32>(returnValueObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint32 &returnValue, bool &ignoreDefault)
|
||||
{
|
||||
int start = lua_gettop(L);
|
||||
uint32 retval = 0;
|
||||
|
||||
try {
|
||||
if (!m_has_get_experience_for_kill) {
|
||||
return;
|
||||
}
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name_.c_str());
|
||||
lua_getfield(L, -1, "GetExperienceForKill");
|
||||
|
||||
Lua_Client l_self(self);
|
||||
Lua_Mob l_other(against);
|
||||
luabind::adl::object e = luabind::newtable(L);
|
||||
e["self"] = l_self;
|
||||
e["other"] = l_other;
|
||||
e.push(L);
|
||||
|
||||
if (lua_pcall(L, 1, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
parser_->AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lua_type(L, -1) == LUA_TTABLE) {
|
||||
luabind::adl::object ret(luabind::from_stack(L, -1));
|
||||
auto IgnoreDefaultObj = ret["IgnoreDefault"];
|
||||
if (luabind::type(IgnoreDefaultObj) == LUA_TBOOLEAN) {
|
||||
ignoreDefault = ignoreDefault || luabind::object_cast<bool>(IgnoreDefaultObj);
|
||||
}
|
||||
|
||||
auto returnValueObj = ret["ReturnValue"];
|
||||
if (luabind::type(returnValueObj) == LUA_TNUMBER) {
|
||||
returnValue = luabind::object_cast<uint32>(returnValueObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception &ex) {
|
||||
parser_->AddError(ex.what());
|
||||
}
|
||||
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if (n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
struct lua_State;
|
||||
|
||||
class LuaParser;
|
||||
class LuaMod
|
||||
{
|
||||
public:
|
||||
LuaMod(lua_State *ls, LuaParser *lp, const std::string &package_name) {
|
||||
L = ls;
|
||||
parser_ = lp;
|
||||
package_name_ = package_name;
|
||||
Init();
|
||||
}
|
||||
~LuaMod() { }
|
||||
void Init();
|
||||
|
||||
void MeleeMitigation(Mob *self, Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
|
||||
void ApplyDamageTable(Mob *self, DamageHitInfo &hit, bool &ignoreDefault);
|
||||
void AvoidDamage(Mob *self, Mob *other, DamageHitInfo &hit, bool &returnValue, bool &ignoreDefault);
|
||||
void CheckHitChance(Mob *self, Mob* other, DamageHitInfo &hit, bool &returnValue, bool &ignoreDefault);
|
||||
void CommonOutgoingHitSuccess(Mob *self, Mob* other, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
|
||||
void TryCriticalHit(Mob *self, Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault);
|
||||
void GetRequiredAAExperience(Client *self, uint32 &returnValue, bool &ignoreDefault);
|
||||
void GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, bool &ignoreDefault);
|
||||
void GetExperienceForKill(Client *self, Mob *against, uint32 &returnValue, bool &ignoreDefault);
|
||||
private:
|
||||
LuaParser *parser_;
|
||||
lua_State *L;
|
||||
std::string package_name_;
|
||||
|
||||
bool m_has_melee_mitigation;
|
||||
bool m_has_apply_damage_table;
|
||||
bool m_has_avoid_damage;
|
||||
bool m_has_check_hit_chance;
|
||||
bool m_has_common_outgoing_hit_success;
|
||||
bool m_has_try_critical_hit;
|
||||
bool m_has_get_required_aa_experience;
|
||||
bool m_has_get_exp_for_level;
|
||||
bool m_has_get_experience_for_kill;
|
||||
};
|
||||
@@ -0,0 +1,611 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "npc.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_client.h"
|
||||
|
||||
void Lua_NPC::Signal(int id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SignalNPC(id);
|
||||
}
|
||||
|
||||
int Lua_NPC::CheckNPCFactionAlly(int faction) {
|
||||
Lua_Safe_Call_Int();
|
||||
return static_cast<int>(self->CheckNPCFactionAlly(faction));
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1, aug2);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1, aug2, aug3);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4, aug5);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddLootTable() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddLootTable();
|
||||
}
|
||||
|
||||
void Lua_NPC::AddLootTable(int id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddLootTable(id);
|
||||
}
|
||||
|
||||
void Lua_NPC::RemoveItem(int item_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveItem(item_id);
|
||||
}
|
||||
|
||||
void Lua_NPC::RemoveItem(int item_id, int quantity) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveItem(item_id, quantity);
|
||||
}
|
||||
|
||||
void Lua_NPC::RemoveItem(int item_id, int quantity, int slot) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveItem(item_id, quantity, slot);
|
||||
}
|
||||
|
||||
void Lua_NPC::ClearItemList() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ClearItemList();
|
||||
}
|
||||
|
||||
void Lua_NPC::AddCash(int copper, int silver, int gold, int platinum) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddCash(copper, silver, gold, platinum);
|
||||
}
|
||||
|
||||
void Lua_NPC::RemoveCash() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveCash();
|
||||
}
|
||||
|
||||
int Lua_NPC::CountLoot() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CountLoot();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetLoottableID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetLoottableID();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetCopper() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCopper();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetSilver() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSilver();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetGold() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetGold();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetPlatinum() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPlatinum();
|
||||
}
|
||||
|
||||
void Lua_NPC::SetCopper(uint32 amt) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCopper(amt);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSilver(uint32 amt) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSilver(amt);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetGold(uint32 amt) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetGold(amt);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetPlatinum(uint32 amt) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetPlatinum(amt);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetGrid(int grid) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetGrid(grid);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSaveWaypoint(int wp) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSaveWaypoint(wp);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSp2(int sg2) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSp2(sg2);
|
||||
}
|
||||
|
||||
int Lua_NPC::GetWaypointMax() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetWaypointMax();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetGrid() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetGrid();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetSp2() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSp2();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetNPCFactionID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetNPCFactionID();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetPrimaryFaction() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPrimaryFaction();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetNPCHate(Lua_Mob ent) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetNPCHate(ent);
|
||||
}
|
||||
|
||||
bool Lua_NPC::IsOnHatelist(Lua_Mob ent) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsOnHatelist(ent);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetNPCFactionID(int id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetNPCFactionID(id);
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetMaxDMG() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetMaxDMG();
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetMinDMG() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetMinDMG();
|
||||
}
|
||||
|
||||
bool Lua_NPC::IsAnimal() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAnimal();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetPetSpellID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPetSpellID();
|
||||
}
|
||||
|
||||
void Lua_NPC::SetPetSpellID(int id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetPetSpellID(id);
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetMaxDamage(int level) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetMaxDamage(level);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetTaunting(bool t) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetTaunting(t);
|
||||
}
|
||||
|
||||
void Lua_NPC::PickPocket(Lua_Client thief) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->PickPocket(thief);
|
||||
}
|
||||
|
||||
void Lua_NPC::StartSwarmTimer(uint32 duration) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->StartSwarmTimer(duration);
|
||||
}
|
||||
|
||||
void Lua_NPC::DoClassAttacks(Lua_Mob target) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DoClassAttacks(target);
|
||||
}
|
||||
|
||||
int Lua_NPC::GetMaxWp() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetMaxWp();
|
||||
}
|
||||
|
||||
void Lua_NPC::DisplayWaypointInfo(Lua_Client to) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DisplayWaypointInfo(to);
|
||||
}
|
||||
|
||||
void Lua_NPC::CalculateNewWaypoint() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->CalculateNewWaypoint();
|
||||
}
|
||||
|
||||
void Lua_NPC::AssignWaypoints(int grid) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AssignWaypoints(grid);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetWaypointPause() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetWaypointPause();
|
||||
}
|
||||
|
||||
void Lua_NPC::UpdateWaypoint(int wp) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UpdateWaypoint(wp);
|
||||
}
|
||||
|
||||
void Lua_NPC::StopWandering() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->StopWandering();
|
||||
}
|
||||
|
||||
void Lua_NPC::ResumeWandering() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ResumeWandering();
|
||||
}
|
||||
|
||||
void Lua_NPC::PauseWandering(int pause_time) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->PauseWandering(pause_time);
|
||||
}
|
||||
|
||||
void Lua_NPC::MoveTo(float x, float y, float z, float h, bool save) {
|
||||
Lua_Safe_Call_Void();
|
||||
auto position = glm::vec4(x, y, z, h);
|
||||
self->MoveTo(position, save);
|
||||
}
|
||||
|
||||
void Lua_NPC::NextGuardPosition() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->NextGuardPosition();
|
||||
}
|
||||
|
||||
void Lua_NPC::SaveGuardSpot() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SaveGuardSpot();
|
||||
}
|
||||
|
||||
void Lua_NPC::SaveGuardSpot(bool clear) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SaveGuardSpot(clear);
|
||||
}
|
||||
|
||||
bool Lua_NPC::IsGuarding() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsGuarding();
|
||||
}
|
||||
|
||||
void Lua_NPC::AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AI_SetRoambox(dist, max_x, min_x, max_y, min_y);
|
||||
}
|
||||
|
||||
void Lua_NPC::AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y, uint32 delay, uint32 mindelay) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AI_SetRoambox(dist, max_x, min_x, max_y, min_y, delay, mindelay);
|
||||
}
|
||||
|
||||
int Lua_NPC::GetNPCSpellsID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetNPCSpellsID();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSpawnPointID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpawnPointID();
|
||||
}
|
||||
|
||||
float Lua_NPC::GetSpawnPointX() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetSpawnPoint().x;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetSpawnPointY() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetSpawnPoint().y;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetSpawnPointZ() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetSpawnPoint().z;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetSpawnPointH() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetSpawnPoint().w;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetGuardPointX() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetGuardPoint().x;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetGuardPointY() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetGuardPoint().y;
|
||||
}
|
||||
|
||||
float Lua_NPC::GetGuardPointZ() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetGuardPoint().z;
|
||||
}
|
||||
|
||||
void Lua_NPC::SetPrimSkill(int skill_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetPrimSkill(skill_id);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSecSkill(int skill_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSecSkill(skill_id);
|
||||
}
|
||||
|
||||
int Lua_NPC::GetPrimSkill() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPrimSkill();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSecSkill() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSecSkill();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSwarmOwner() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSwarmOwner();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSwarmTarget() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSwarmTarget();
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSwarmTarget(int target) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSwarmTarget(target);
|
||||
}
|
||||
|
||||
void Lua_NPC::ModifyNPCStat(const char *stat, const char *value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ModifyNPCStat(stat, value);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, 0, 0);
|
||||
}
|
||||
|
||||
void Lua_NPC::AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust, int min_hp, int max_hp) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, min_hp, max_hp);
|
||||
}
|
||||
|
||||
void Lua_NPC::RemoveAISpell(int spell_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->RemoveSpellFromNPCList(spell_id);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSpellFocusDMG(int focus) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSpellFocusDMG(focus);
|
||||
}
|
||||
|
||||
void Lua_NPC::SetSpellFocusHeal(int focus) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetSpellFocusHeal(focus);
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSpellFocusDMG() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpellFocusDMG();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSpellFocusHeal() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpellFocusHeal();
|
||||
}
|
||||
|
||||
float Lua_NPC::GetSlowMitigation() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetSlowMitigation();
|
||||
}
|
||||
|
||||
float Lua_NPC::GetAttackSpeed() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetAttackSpeed();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetAttackDelay() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAttackDelay();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetAccuracyRating() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAccuracyRating();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetSpawnKillCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpawnKillCount();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetScore() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetScore();
|
||||
}
|
||||
|
||||
void Lua_NPC::MerchantOpenShop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MerchantOpenShop();
|
||||
}
|
||||
|
||||
void Lua_NPC::MerchantCloseShop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MerchantCloseShop();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetRawAC() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetRawAC();
|
||||
}
|
||||
|
||||
int Lua_NPC::GetAvoidanceRating()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAvoidanceRating();
|
||||
}
|
||||
|
||||
luabind::scope lua_register_npc() {
|
||||
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
|
||||
.def(luabind::constructor<>())
|
||||
.def("Signal", (void(Lua_NPC::*)(int))&Lua_NPC::Signal)
|
||||
.def("CheckNPCFactionAlly", (int(Lua_NPC::*)(int))&Lua_NPC::CheckNPCFactionAlly)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int,int))&Lua_NPC::AddItem)
|
||||
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int,int,int))&Lua_NPC::AddItem)
|
||||
.def("AddLootTable", (void(Lua_NPC::*)(void))&Lua_NPC::AddLootTable)
|
||||
.def("AddLootTable", (void(Lua_NPC::*)(int))&Lua_NPC::AddLootTable)
|
||||
.def("RemoveItem", (void(Lua_NPC::*)(int))&Lua_NPC::RemoveItem)
|
||||
.def("RemoveItem", (void(Lua_NPC::*)(int,int))&Lua_NPC::RemoveItem)
|
||||
.def("RemoveItem", (void(Lua_NPC::*)(int,int,int))&Lua_NPC::RemoveItem)
|
||||
.def("ClearItemList", (void(Lua_NPC::*)(void))&Lua_NPC::ClearItemList)
|
||||
.def("AddCash", (void(Lua_NPC::*)(int,int,int,int))&Lua_NPC::AddCash)
|
||||
.def("RemoveCash", (void(Lua_NPC::*)(void))&Lua_NPC::RemoveCash)
|
||||
.def("CountLoot", (int(Lua_NPC::*)(void))&Lua_NPC::CountLoot)
|
||||
.def("GetLoottableID", (int(Lua_NPC::*)(void))&Lua_NPC::GetLoottableID)
|
||||
.def("GetCopper", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetCopper)
|
||||
.def("GetSilver", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSilver)
|
||||
.def("GetGold", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetGold)
|
||||
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
|
||||
.def("SetCopper", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetCopper)
|
||||
.def("SetSilver", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetSilver)
|
||||
.def("SetGold", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetGold)
|
||||
.def("SetPlatinum", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetPlatinum)
|
||||
.def("SetGrid", (void(Lua_NPC::*)(int))&Lua_NPC::SetGrid)
|
||||
.def("SetSaveWaypoint", (void(Lua_NPC::*)(int))&Lua_NPC::SetSaveWaypoint)
|
||||
.def("SetSp2", (void(Lua_NPC::*)(int))&Lua_NPC::SetSp2)
|
||||
.def("GetWaypointMax", (int(Lua_NPC::*)(void))&Lua_NPC::GetWaypointMax)
|
||||
.def("GetGrid", (int(Lua_NPC::*)(void))&Lua_NPC::GetGrid)
|
||||
.def("GetSp2", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSp2)
|
||||
.def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID)
|
||||
.def("GetPrimaryFaction", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimaryFaction)
|
||||
.def("GetNPCHate", (int(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate)
|
||||
.def("IsOnHatelist", (bool(Lua_NPC::*)(Lua_Mob))&Lua_NPC::IsOnHatelist)
|
||||
.def("SetNPCFactionID", (void(Lua_NPC::*)(int))&Lua_NPC::SetNPCFactionID)
|
||||
.def("GetMaxDMG", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetMaxDMG)
|
||||
.def("GetMinDMG", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetMinDMG)
|
||||
.def("IsAnimal", (bool(Lua_NPC::*)(void))&Lua_NPC::IsAnimal)
|
||||
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
|
||||
.def("SetPetSpellID", (void(Lua_NPC::*)(int))&Lua_NPC::SetPetSpellID)
|
||||
.def("GetMaxDamage", (uint32(Lua_NPC::*)(int))&Lua_NPC::GetMaxDamage)
|
||||
.def("SetTaunting", (void(Lua_NPC::*)(bool))&Lua_NPC::SetTaunting)
|
||||
.def("PickPocket", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::PickPocket)
|
||||
.def("StartSwarmTimer", (void(Lua_NPC::*)(uint32))&Lua_NPC::StartSwarmTimer)
|
||||
.def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks)
|
||||
.def("GetMaxWp", (int(Lua_NPC::*)(void))&Lua_NPC::GetMaxWp)
|
||||
.def("DisplayWaypointInfo", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::DisplayWaypointInfo)
|
||||
.def("CalculateNewWaypoint", (void(Lua_NPC::*)(void))&Lua_NPC::CalculateNewWaypoint)
|
||||
.def("AssignWaypoints", (void(Lua_NPC::*)(int))&Lua_NPC::AssignWaypoints)
|
||||
.def("SetWaypointPause", (void(Lua_NPC::*)(void))&Lua_NPC::SetWaypointPause)
|
||||
.def("UpdateWaypoint", (void(Lua_NPC::*)(int))&Lua_NPC::UpdateWaypoint)
|
||||
.def("StopWandering", (void(Lua_NPC::*)(void))&Lua_NPC::StopWandering)
|
||||
.def("ResumeWandering", (void(Lua_NPC::*)(void))&Lua_NPC::ResumeWandering)
|
||||
.def("PauseWandering", (void(Lua_NPC::*)(int))&Lua_NPC::PauseWandering)
|
||||
.def("MoveTo", (void(Lua_NPC::*)(float,float,float,float,bool))&Lua_NPC::MoveTo)
|
||||
.def("NextGuardPosition", (void(Lua_NPC::*)(void))&Lua_NPC::NextGuardPosition)
|
||||
.def("SaveGuardSpot", (void(Lua_NPC::*)(void))&Lua_NPC::SaveGuardSpot)
|
||||
.def("SaveGuardSpot", (void(Lua_NPC::*)(bool))&Lua_NPC::SaveGuardSpot)
|
||||
.def("IsGuarding", (bool(Lua_NPC::*)(void))&Lua_NPC::IsGuarding)
|
||||
.def("AI_SetRoambox", (void(Lua_NPC::*)(float,float,float,float,float))&Lua_NPC::AI_SetRoambox)
|
||||
.def("AI_SetRoambox", (void(Lua_NPC::*)(float,float,float,float,float,uint32,uint32))&Lua_NPC::AI_SetRoambox)
|
||||
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
|
||||
.def("GetSpawnPointID", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointID)
|
||||
.def("GetSpawnPointX", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointX)
|
||||
.def("GetSpawnPointY", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointY)
|
||||
.def("GetSpawnPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointZ)
|
||||
.def("GetSpawnPointH", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointH)
|
||||
.def("GetGuardPointX", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointX)
|
||||
.def("GetGuardPointY", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointY)
|
||||
.def("GetGuardPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointZ)
|
||||
.def("SetPrimSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetPrimSkill)
|
||||
.def("SetSecSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetSecSkill)
|
||||
.def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill)
|
||||
.def("GetSecSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetSecSkill)
|
||||
.def("GetSwarmOwner", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmOwner)
|
||||
.def("GetSwarmTarget", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmTarget)
|
||||
.def("SetSwarmTarget", (void(Lua_NPC::*)(int))&Lua_NPC::SetSwarmTarget)
|
||||
.def("ModifyNPCStat", (void(Lua_NPC::*)(const char*,const char*))&Lua_NPC::ModifyNPCStat)
|
||||
.def("AddAISpell", (void(Lua_NPC::*)(int,int,int,int,int,int))&Lua_NPC::AddAISpell)
|
||||
.def("AddAISpell", (void(Lua_NPC::*)(int,int,int,int,int,int,int,int))&Lua_NPC::AddAISpell)
|
||||
.def("RemoveAISpell", (void(Lua_NPC::*)(int))&Lua_NPC::RemoveAISpell)
|
||||
.def("SetSpellFocusDMG", (void(Lua_NPC::*)(int))&Lua_NPC::SetSpellFocusDMG)
|
||||
.def("SetSpellFocusHeal", (void(Lua_NPC::*)(int))&Lua_NPC::SetSpellFocusHeal)
|
||||
.def("GetSpellFocusDMG", (void(Lua_NPC::*)(int))&Lua_NPC::GetSpellFocusDMG)
|
||||
.def("GetSpellFocusHeal", (void(Lua_NPC::*)(int))&Lua_NPC::GetSpellFocusHeal)
|
||||
.def("GetSlowMitigation", (int(Lua_NPC::*)(void))&Lua_NPC::GetSlowMitigation)
|
||||
.def("GetAttackSpeed", (float(Lua_NPC::*)(void))&Lua_NPC::GetAttackSpeed)
|
||||
.def("GetAttackDelay", (int(Lua_NPC::*)(void))&Lua_NPC::GetAttackDelay)
|
||||
.def("GetAccuracyRating", (int(Lua_NPC::*)(void))&Lua_NPC::GetAccuracyRating)
|
||||
.def("GetSpawnKillCount", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnKillCount)
|
||||
.def("GetScore", (int(Lua_NPC::*)(void))&Lua_NPC::GetScore)
|
||||
.def("MerchantOpenShop", (void(Lua_NPC::*)(void))&Lua_NPC::MerchantOpenShop)
|
||||
.def("MerchantCloseShop", (void(Lua_NPC::*)(void))&Lua_NPC::MerchantCloseShop)
|
||||
.def("GetRawAC", (int(Lua_NPC::*)(void))&Lua_NPC::GetRawAC)
|
||||
.def("GetAvoidanceRating", &Lua_NPC::GetAvoidanceRating);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,132 @@
|
||||
#ifndef EQEMU_LUA_NPC_H
|
||||
#define EQEMU_LUA_NPC_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_mob.h"
|
||||
|
||||
class NPC;
|
||||
class Lua_Mob;
|
||||
class Lua_NPC;
|
||||
class Lua_Client;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_npc();
|
||||
|
||||
class Lua_NPC : public Lua_Mob
|
||||
{
|
||||
typedef NPC NativeType;
|
||||
public:
|
||||
Lua_NPC() { SetLuaPtrData(nullptr); }
|
||||
Lua_NPC(NPC *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_NPC() { }
|
||||
|
||||
operator NPC*() {
|
||||
return reinterpret_cast<NPC*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
void Signal(int id);
|
||||
int CheckNPCFactionAlly(int faction);
|
||||
void AddItem(int item_id, int charges);
|
||||
void AddItem(int item_id, int charges, bool equip);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5);
|
||||
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6);
|
||||
void AddLootTable();
|
||||
void AddLootTable(int id);
|
||||
void RemoveItem(int item_id);
|
||||
void RemoveItem(int item_id, int quantity);
|
||||
void RemoveItem(int item_id, int quantity, int slot);
|
||||
void ClearItemList();
|
||||
void AddCash(int copper, int silver, int gold, int platinum);
|
||||
void RemoveCash();
|
||||
int CountLoot();
|
||||
int GetLoottableID();
|
||||
uint32 GetCopper();
|
||||
uint32 GetSilver();
|
||||
uint32 GetGold();
|
||||
uint32 GetPlatinum();
|
||||
void SetCopper(uint32 amt);
|
||||
void SetSilver(uint32 amt);
|
||||
void SetGold(uint32 amt);
|
||||
void SetPlatinum(uint32 amt);
|
||||
void SetGrid(int grid);
|
||||
void SetSaveWaypoint(int wp);
|
||||
void SetSp2(int sg2);
|
||||
int GetWaypointMax();
|
||||
int GetGrid();
|
||||
uint32 GetSp2();
|
||||
int GetNPCFactionID();
|
||||
int GetPrimaryFaction();
|
||||
int GetNPCHate(Lua_Mob ent);
|
||||
bool IsOnHatelist(Lua_Mob ent);
|
||||
void SetNPCFactionID(int id);
|
||||
uint32 GetMaxDMG();
|
||||
uint32 GetMinDMG();
|
||||
bool IsAnimal();
|
||||
int GetPetSpellID();
|
||||
void SetPetSpellID(int id);
|
||||
uint32 GetMaxDamage(int level);
|
||||
void SetTaunting(bool t);
|
||||
void PickPocket(Lua_Client thief);
|
||||
void StartSwarmTimer(uint32 duration);
|
||||
void DoClassAttacks(Lua_Mob target);
|
||||
int GetMaxWp();
|
||||
void DisplayWaypointInfo(Lua_Client to);
|
||||
void CalculateNewWaypoint();
|
||||
void AssignWaypoints(int grid);
|
||||
void SetWaypointPause();
|
||||
void UpdateWaypoint(int wp);
|
||||
void StopWandering();
|
||||
void ResumeWandering();
|
||||
void PauseWandering(int pause_time);
|
||||
void MoveTo(float x, float y, float z, float h, bool save);
|
||||
void NextGuardPosition();
|
||||
void SaveGuardSpot();
|
||||
void SaveGuardSpot(bool clear);
|
||||
bool IsGuarding();
|
||||
void AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y);
|
||||
void AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y, uint32 delay, uint32 mindelay);
|
||||
int GetNPCSpellsID();
|
||||
int GetSpawnPointID();
|
||||
float GetSpawnPointX();
|
||||
float GetSpawnPointY();
|
||||
float GetSpawnPointZ();
|
||||
float GetSpawnPointH();
|
||||
float GetGuardPointX();
|
||||
float GetGuardPointY();
|
||||
float GetGuardPointZ();
|
||||
void SetPrimSkill(int skill_id);
|
||||
void SetSecSkill(int skill_id);
|
||||
int GetPrimSkill();
|
||||
int GetSecSkill();
|
||||
int GetSwarmOwner();
|
||||
int GetSwarmTarget();
|
||||
void SetSwarmTarget(int target);
|
||||
void ModifyNPCStat(const char *stat, const char *value);
|
||||
void AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust);
|
||||
void AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust, int min_hp, int max_hp);
|
||||
void RemoveAISpell(int spell_id);
|
||||
void SetSpellFocusDMG(int focus);
|
||||
void SetSpellFocusHeal(int focus);
|
||||
int GetSpellFocusDMG();
|
||||
int GetSpellFocusHeal();
|
||||
float GetSlowMitigation();
|
||||
float GetAttackSpeed();
|
||||
int GetAttackDelay();
|
||||
int GetAccuracyRating();
|
||||
int GetSpawnKillCount();
|
||||
int GetScore();
|
||||
void MerchantOpenShop();
|
||||
void MerchantCloseShop();
|
||||
int GetRawAC();
|
||||
int GetAvoidanceRating();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,222 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "object.h"
|
||||
#include "lua_object.h"
|
||||
|
||||
void Lua_Object::Depop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Depop();
|
||||
}
|
||||
|
||||
void Lua_Object::Repop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Repop();
|
||||
}
|
||||
|
||||
void Lua_Object::SetModelName(const char *name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetModelName(name);
|
||||
}
|
||||
|
||||
const char *Lua_Object::GetModelName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetModelName();
|
||||
}
|
||||
|
||||
float Lua_Object::GetX() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetX();
|
||||
}
|
||||
|
||||
float Lua_Object::GetY() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetY();
|
||||
}
|
||||
|
||||
float Lua_Object::GetZ() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetZ();
|
||||
}
|
||||
|
||||
float Lua_Object::GetHeading() {
|
||||
Lua_Safe_Call_Real();
|
||||
float h = 0.0f;
|
||||
self->GetHeading(&h);
|
||||
return h;
|
||||
}
|
||||
|
||||
void Lua_Object::SetX(float x) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetX(x);
|
||||
}
|
||||
|
||||
void Lua_Object::SetY(float y) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetY(y);
|
||||
}
|
||||
|
||||
void Lua_Object::SetZ(float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetZ(z);
|
||||
}
|
||||
|
||||
void Lua_Object::SetHeading(float h) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetHeading(h);
|
||||
}
|
||||
|
||||
void Lua_Object::SetLocation(float x, float y, float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetLocation(x, y, z);
|
||||
}
|
||||
|
||||
void Lua_Object::SetItemID(uint32 item_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetItemID(item_id);
|
||||
}
|
||||
|
||||
uint32 Lua_Object::GetItemID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemID();
|
||||
}
|
||||
|
||||
void Lua_Object::SetIcon(uint32 icon) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetIcon(icon);
|
||||
}
|
||||
|
||||
uint32 Lua_Object::GetIcon() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetIcon();
|
||||
}
|
||||
|
||||
void Lua_Object::SetType(uint32 type) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetType(type);
|
||||
}
|
||||
|
||||
uint32 Lua_Object::GetType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetType();
|
||||
}
|
||||
|
||||
uint32 Lua_Object::GetDBID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetDBID();
|
||||
}
|
||||
|
||||
void Lua_Object::ClearUser() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ClearUser();
|
||||
}
|
||||
|
||||
void Lua_Object::SetID(int user) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetID(user);
|
||||
}
|
||||
|
||||
int Lua_Object::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
bool Lua_Object::Save() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->Save();
|
||||
}
|
||||
|
||||
uint32 Lua_Object::VarSave() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->VarSave();
|
||||
}
|
||||
|
||||
void Lua_Object::DeleteItem(int index) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DeleteItem(index);
|
||||
}
|
||||
|
||||
void Lua_Object::StartDecay() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->StartDecay();
|
||||
}
|
||||
|
||||
void Lua_Object::Delete() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Delete();
|
||||
}
|
||||
|
||||
void Lua_Object::Delete(bool reset_state) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Delete(reset_state);
|
||||
}
|
||||
|
||||
bool Lua_Object::IsGroundSpawn() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->IsGroundSpawn();
|
||||
}
|
||||
|
||||
void Lua_Object::Close() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Close();
|
||||
}
|
||||
|
||||
const char *Lua_Object::GetEntityVariable(const char *name) {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetEntityVariable(name);
|
||||
}
|
||||
|
||||
void Lua_Object::SetEntityVariable(const char *name, const char *value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetEntityVariable(name, value);
|
||||
}
|
||||
|
||||
bool Lua_Object::EntityVariableExists(const char *name) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->EntityVariableExists(name);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_object() {
|
||||
return luabind::class_<Lua_Object, Lua_Entity>("Object")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Object::Null)
|
||||
.property("valid", &Lua_Object::Valid)
|
||||
.def("Depop", (void(Lua_Object::*)(void))&Lua_Object::Depop)
|
||||
.def("Repop", (void(Lua_Object::*)(void))&Lua_Object::Repop)
|
||||
.def("SetModelName", (void(Lua_Object::*)(const char*))&Lua_Object::SetModelName)
|
||||
.def("GetModelName", (const char*(Lua_Object::*)(void))&Lua_Object::GetModelName)
|
||||
.def("GetX", (float(Lua_Object::*)(void))&Lua_Object::GetX)
|
||||
.def("GetY", (float(Lua_Object::*)(void))&Lua_Object::GetY)
|
||||
.def("GetZ", (float(Lua_Object::*)(void))&Lua_Object::GetZ)
|
||||
.def("GetHeading", (float(Lua_Object::*)(void))&Lua_Object::GetHeading)
|
||||
.def("SetX", (void(Lua_Object::*)(float))&Lua_Object::SetX)
|
||||
.def("SetY", (void(Lua_Object::*)(float))&Lua_Object::SetY)
|
||||
.def("SetZ", (void(Lua_Object::*)(float))&Lua_Object::SetZ)
|
||||
.def("SetHeading", (void(Lua_Object::*)(float))&Lua_Object::SetHeading)
|
||||
.def("SetLocation", (void(Lua_Object::*)(float,float,float))&Lua_Object::SetLocation)
|
||||
.def("SetItemID", (void(Lua_Object::*)(uint32))&Lua_Object::SetItemID)
|
||||
.def("GetItemID", (uint32(Lua_Object::*)(void))&Lua_Object::GetItemID)
|
||||
.def("SetIcon", (void(Lua_Object::*)(uint32))&Lua_Object::SetIcon)
|
||||
.def("GetIcon", (uint32(Lua_Object::*)(void))&Lua_Object::GetIcon)
|
||||
.def("SetType", (void(Lua_Object::*)(uint32))&Lua_Object::SetType)
|
||||
.def("GetType", (uint32(Lua_Object::*)(void))&Lua_Object::GetType)
|
||||
.def("GetDBID", (uint32(Lua_Object::*)(void))&Lua_Object::GetDBID)
|
||||
.def("ClearUser", (void(Lua_Object::*)(void))&Lua_Object::ClearUser)
|
||||
.def("SetID", (void(Lua_Object::*)(int))&Lua_Object::SetID)
|
||||
.def("GetID", (int(Lua_Object::*)(void))&Lua_Object::GetID)
|
||||
.def("Save", (bool(Lua_Object::*)(void))&Lua_Object::Save)
|
||||
.def("VarSave", (uint32(Lua_Object::*)(void))&Lua_Object::VarSave)
|
||||
.def("DeleteItem", (void(Lua_Object::*)(int))&Lua_Object::DeleteItem)
|
||||
.def("StartDecay", (void(Lua_Object::*)(void))&Lua_Object::StartDecay)
|
||||
.def("Delete", (void(Lua_Object::*)(void))&Lua_Object::Delete)
|
||||
.def("Delete", (void(Lua_Object::*)(bool))&Lua_Object::Delete)
|
||||
.def("IsGroundSpawn", (bool(Lua_Object::*)(void))&Lua_Object::IsGroundSpawn)
|
||||
.def("Close", (void(Lua_Object::*)(void))&Lua_Object::Close)
|
||||
.def("GetEntityVariable", (const char*(Lua_Object::*)(const char*))&Lua_Object::GetEntityVariable)
|
||||
.def("SetEntityVariable", (void(Lua_Object::*)(const char*,const char*))&Lua_Object::SetEntityVariable)
|
||||
.def("EntityVariableExists", (bool(Lua_Object::*)(const char*))&Lua_Object::EntityVariableExists);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef EQEMU_LUA_OBJECT_H
|
||||
#define EQEMU_LUA_OBJECT_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_entity.h"
|
||||
|
||||
class Object;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_object();
|
||||
|
||||
class Lua_Object : public Lua_Entity
|
||||
{
|
||||
typedef Object NativeType;
|
||||
public:
|
||||
Lua_Object() { SetLuaPtrData(nullptr); }
|
||||
Lua_Object(Object *d) { SetLuaPtrData(reinterpret_cast<Entity*>(d)); }
|
||||
virtual ~Lua_Object() { }
|
||||
|
||||
operator Object*() {
|
||||
void *d = GetLuaPtrData();
|
||||
if(d) {
|
||||
return reinterpret_cast<Object*>(d);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Depop();
|
||||
void Repop();
|
||||
void SetModelName(const char *name);
|
||||
const char *GetModelName();
|
||||
float GetX();
|
||||
float GetY();
|
||||
float GetZ();
|
||||
float GetHeading();
|
||||
void SetX(float x);
|
||||
void SetY(float y);
|
||||
void SetZ(float z);
|
||||
void SetHeading(float h);
|
||||
void SetLocation(float x, float y, float z);
|
||||
void SetItemID(uint32 item_id);
|
||||
uint32 GetItemID();
|
||||
void SetIcon(uint32 icon);
|
||||
uint32 GetIcon();
|
||||
void SetType(uint32 type);
|
||||
uint32 GetType();
|
||||
uint32 GetDBID();
|
||||
void ClearUser();
|
||||
void SetID(int user);
|
||||
int GetID();
|
||||
bool Save();
|
||||
uint32 VarSave();
|
||||
void DeleteItem(int index);
|
||||
void StartDecay();
|
||||
void Delete();
|
||||
void Delete(bool reset_state);
|
||||
bool IsGroundSpawn();
|
||||
void Close();
|
||||
const char *GetEntityVariable(const char *name);
|
||||
void SetEntityVariable(const char *name, const char *value);
|
||||
bool EntityVariableExists(const char *name);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,855 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "lua_packet.h"
|
||||
|
||||
struct Opcodes { };
|
||||
|
||||
Lua_Packet::Lua_Packet(int opcode, int size) {
|
||||
SetLuaPtrData(new EQApplicationPacket(static_cast<EmuOpcode>(opcode), size));
|
||||
owned_ = true;
|
||||
}
|
||||
|
||||
Lua_Packet::Lua_Packet(int opcode, int size, bool raw) {
|
||||
if(raw) {
|
||||
SetLuaPtrData(new EQApplicationPacket(OP_Unknown, size));
|
||||
owned_ = true;
|
||||
|
||||
EQApplicationPacket *self = reinterpret_cast<EQApplicationPacket*>(d_);
|
||||
self->SetOpcodeBypass(opcode);
|
||||
} else {
|
||||
SetLuaPtrData(new EQApplicationPacket(static_cast<EmuOpcode>(opcode), size));
|
||||
owned_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
Lua_Packet& Lua_Packet::operator=(const Lua_Packet& o) {
|
||||
if(o.owned_) {
|
||||
owned_ = true;
|
||||
EQApplicationPacket *app = reinterpret_cast<EQApplicationPacket*>(o.d_);
|
||||
if(app) {
|
||||
d_ = new EQApplicationPacket(app->GetOpcode(), app->pBuffer, app->size);
|
||||
|
||||
EQApplicationPacket *self = reinterpret_cast<EQApplicationPacket*>(d_);
|
||||
self->SetOpcodeBypass(app->GetOpcodeBypass());
|
||||
} else {
|
||||
d_ = nullptr;
|
||||
}
|
||||
} else {
|
||||
owned_ = false;
|
||||
d_ = o.d_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Lua_Packet::Lua_Packet(const Lua_Packet& o) {
|
||||
if(o.owned_) {
|
||||
owned_ = true;
|
||||
EQApplicationPacket *app = reinterpret_cast<EQApplicationPacket*>(o.d_);
|
||||
if(app) {
|
||||
d_ = new EQApplicationPacket(app->GetOpcode(), app->pBuffer, app->size);
|
||||
|
||||
EQApplicationPacket *self = reinterpret_cast<EQApplicationPacket*>(d_);
|
||||
self->SetOpcodeBypass(app->GetOpcodeBypass());
|
||||
} else {
|
||||
d_ = nullptr;
|
||||
}
|
||||
} else {
|
||||
owned_ = false;
|
||||
d_ = o.d_;
|
||||
}
|
||||
}
|
||||
|
||||
int Lua_Packet::GetSize() {
|
||||
Lua_Safe_Call_Int();
|
||||
return static_cast<int>(self->size);
|
||||
}
|
||||
|
||||
int Lua_Packet::GetOpcode() {
|
||||
Lua_Safe_Call_Int();
|
||||
return static_cast<int>(self->GetOpcode());
|
||||
}
|
||||
|
||||
void Lua_Packet::SetOpcode(int op) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetOpcodeBypass(static_cast<uint16>(op));
|
||||
}
|
||||
|
||||
int Lua_Packet::GetRawOpcode() {
|
||||
Lua_Safe_Call_Int();
|
||||
return static_cast<int>(self->GetOpcodeBypass());
|
||||
}
|
||||
|
||||
void Lua_Packet::SetRawOpcode(int op) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetOpcode(static_cast<EmuOpcode>(op));
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteInt8(int offset, int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(int8) <= self->size) {
|
||||
*reinterpret_cast<int8*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteInt16(int offset, int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(int16) <= self->size) {
|
||||
*reinterpret_cast<int16*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteInt32(int offset, int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(int32) <= self->size) {
|
||||
*reinterpret_cast<int32*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteInt64(int offset, int64 value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(int64) <= self->size) {
|
||||
*reinterpret_cast<int64*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteFloat(int offset, float value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(float) <= self->size) {
|
||||
*reinterpret_cast<float*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteDouble(int offset, double value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + sizeof(double) <= self->size) {
|
||||
*reinterpret_cast<double*>(self->pBuffer + offset) = value;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteString(int offset, std::string value) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + value.length() + 1 <= self->size) {
|
||||
memcpy(self->pBuffer + offset, value.c_str(), value.length());
|
||||
*reinterpret_cast<int8*>(self->pBuffer + offset + value.length()) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_Packet::WriteFixedLengthString(int offset, std::string value, int string_length) {
|
||||
Lua_Safe_Call_Void();
|
||||
|
||||
if(offset + string_length <= static_cast<int>(self->size)) {
|
||||
memset(self->pBuffer + offset, 0, string_length);
|
||||
memcpy(self->pBuffer + offset, value.c_str(), value.length());
|
||||
}
|
||||
}
|
||||
|
||||
int Lua_Packet::ReadInt8(int offset) {
|
||||
Lua_Safe_Call_Int();
|
||||
if(offset + sizeof(int8) <= self->size) {
|
||||
int8 v = *reinterpret_cast<int8*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Lua_Packet::ReadInt16(int offset) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(offset + sizeof(int16) <= self->size) {
|
||||
int16 v = *reinterpret_cast<int16*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Lua_Packet::ReadInt32(int offset) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(offset + sizeof(int32) <= self->size) {
|
||||
int32 v = *reinterpret_cast<int32*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64 Lua_Packet::ReadInt64(int offset) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(offset + sizeof(int64) <= self->size) {
|
||||
int64 v = *reinterpret_cast<int64*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
float Lua_Packet::ReadFloat(int offset) {
|
||||
Lua_Safe_Call_Real();
|
||||
|
||||
if(offset + sizeof(float) <= self->size) {
|
||||
float v = *reinterpret_cast<float*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
double Lua_Packet::ReadDouble(int offset) {
|
||||
Lua_Safe_Call_Real();
|
||||
|
||||
if(offset + sizeof(double) <= self->size) {
|
||||
double v = *reinterpret_cast<double*>(self->pBuffer + offset);
|
||||
return v;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string Lua_Packet::ReadString(int offset) {
|
||||
Lua_Safe_Call_String();
|
||||
|
||||
if(offset < static_cast<int>(self->size)) {
|
||||
std::string ret;
|
||||
|
||||
int i = offset;
|
||||
for(;;) {
|
||||
if(i >= static_cast<int>(self->size)) {
|
||||
break;
|
||||
}
|
||||
|
||||
char c = *reinterpret_cast<char*>(self->pBuffer + i);
|
||||
|
||||
if(c == '\0') {
|
||||
break;
|
||||
}
|
||||
|
||||
ret.push_back(c);
|
||||
++i;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string Lua_Packet::ReadFixedLengthString(int offset, int string_length) {
|
||||
Lua_Safe_Call_String();
|
||||
|
||||
if(offset + string_length <= static_cast<int>(self->size)) {
|
||||
std::string ret;
|
||||
|
||||
int i = offset;
|
||||
for(;;) {
|
||||
if(i >= offset + string_length) {
|
||||
break;
|
||||
}
|
||||
|
||||
char c = *reinterpret_cast<char*>(self->pBuffer + i);
|
||||
ret.push_back(c);
|
||||
++i;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
luabind::scope lua_register_packet() {
|
||||
return luabind::class_<Lua_Packet>("Packet")
|
||||
.def(luabind::constructor<>())
|
||||
.def(luabind::constructor<int,int>())
|
||||
.def(luabind::constructor<int,int,bool>())
|
||||
.property("null", &Lua_Packet::Null)
|
||||
.property("valid", &Lua_Packet::Valid)
|
||||
.def("GetSize", &Lua_Packet::GetSize)
|
||||
.def("GetOpcode", &Lua_Packet::GetOpcode)
|
||||
.def("SetOpcode", &Lua_Packet::SetOpcode)
|
||||
.def("GetRawOpcode", &Lua_Packet::GetRawOpcode)
|
||||
.def("SetRawOpcode", &Lua_Packet::SetRawOpcode)
|
||||
.def("WriteInt8", &Lua_Packet::WriteInt8)
|
||||
.def("WriteInt16", &Lua_Packet::WriteInt16)
|
||||
.def("WriteInt32", &Lua_Packet::WriteInt32)
|
||||
.def("WriteInt64", &Lua_Packet::WriteInt64)
|
||||
.def("WriteFloat", &Lua_Packet::WriteFloat)
|
||||
.def("WriteDouble", &Lua_Packet::WriteDouble)
|
||||
.def("WriteString", &Lua_Packet::WriteString)
|
||||
.def("WriteFixedLengthString", &Lua_Packet::WriteFixedLengthString)
|
||||
.def("ReadInt8", &Lua_Packet::ReadInt8)
|
||||
.def("ReadInt16", &Lua_Packet::ReadInt16)
|
||||
.def("ReadInt32", &Lua_Packet::ReadInt32)
|
||||
.def("ReadInt64", &Lua_Packet::ReadInt64)
|
||||
.def("ReadFloat", &Lua_Packet::ReadFloat)
|
||||
.def("ReadDouble", &Lua_Packet::ReadDouble)
|
||||
.def("ReadString", &Lua_Packet::ReadString)
|
||||
.def("ReadFixedLengthString", &Lua_Packet::ReadFixedLengthString);
|
||||
}
|
||||
|
||||
//TODO: Reorder these to match emu_oplist.h again
|
||||
luabind::scope lua_register_packet_opcodes() {
|
||||
return luabind::class_<Opcodes>("Opcode")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("ExploreUnknown", static_cast<int>(OP_ExploreUnknown)),
|
||||
luabind::value("Heartbeat", static_cast<int>(OP_Heartbeat)),
|
||||
luabind::value("ReloadUI", static_cast<int>(OP_ReloadUI)),
|
||||
luabind::value("IncreaseStats", static_cast<int>(OP_IncreaseStats)),
|
||||
luabind::value("ApproveZone", static_cast<int>(OP_ApproveZone)),
|
||||
luabind::value("Dye", static_cast<int>(OP_Dye)),
|
||||
luabind::value("Stamina", static_cast<int>(OP_Stamina)),
|
||||
luabind::value("ControlBoat", static_cast<int>(OP_ControlBoat)),
|
||||
luabind::value("MobUpdate", static_cast<int>(OP_MobUpdate)),
|
||||
luabind::value("ClientUpdate", static_cast<int>(OP_ClientUpdate)),
|
||||
luabind::value("ChannelMessage", static_cast<int>(OP_ChannelMessage)),
|
||||
luabind::value("SimpleMessage", static_cast<int>(OP_SimpleMessage)),
|
||||
luabind::value("FormattedMessage", static_cast<int>(OP_FormattedMessage)),
|
||||
luabind::value("TGB", static_cast<int>(OP_TGB)),
|
||||
luabind::value("Bind_Wound", static_cast<int>(OP_Bind_Wound)),
|
||||
luabind::value("Charm", static_cast<int>(OP_Charm)),
|
||||
luabind::value("Begging", static_cast<int>(OP_Begging)),
|
||||
luabind::value("MoveCoin", static_cast<int>(OP_MoveCoin)),
|
||||
luabind::value("SpawnDoor", static_cast<int>(OP_SpawnDoor)),
|
||||
luabind::value("Sneak", static_cast<int>(OP_Sneak)),
|
||||
luabind::value("ExpUpdate", static_cast<int>(OP_ExpUpdate)),
|
||||
luabind::value("DumpName", static_cast<int>(OP_DumpName)),
|
||||
luabind::value("RespondAA", static_cast<int>(OP_RespondAA)),
|
||||
luabind::value("UpdateAA", static_cast<int>(OP_UpdateAA)),
|
||||
luabind::value("SendAAStats", static_cast<int>(OP_SendAAStats)),
|
||||
luabind::value("SendAATable", static_cast<int>(OP_SendAATable)),
|
||||
luabind::value("AAAction", static_cast<int>(OP_AAAction)),
|
||||
luabind::value("BoardBoat", static_cast<int>(OP_BoardBoat)),
|
||||
luabind::value("LeaveBoat", static_cast<int>(OP_LeaveBoat)),
|
||||
luabind::value("AdventureInfoRequest", static_cast<int>(OP_AdventureInfoRequest)),
|
||||
luabind::value("AdventureInfo", static_cast<int>(OP_AdventureInfo)),
|
||||
luabind::value("AdventureRequest", static_cast<int>(OP_AdventureRequest)),
|
||||
luabind::value("AdventureDetails", static_cast<int>(OP_AdventureDetails)),
|
||||
luabind::value("LDoNButton", static_cast<int>(OP_LDoNButton)),
|
||||
luabind::value("AdventureData", static_cast<int>(OP_AdventureData)),
|
||||
luabind::value("AdventureFinish", static_cast<int>(OP_AdventureFinish)),
|
||||
luabind::value("LeaveAdventure", static_cast<int>(OP_LeaveAdventure)),
|
||||
luabind::value("AdventureUpdate", static_cast<int>(OP_AdventureUpdate)),
|
||||
luabind::value("SendExpZonein", static_cast<int>(OP_SendExpZonein)),
|
||||
luabind::value("RaidUpdate", static_cast<int>(OP_RaidUpdate)),
|
||||
luabind::value("GuildLeader", static_cast<int>(OP_GuildLeader)),
|
||||
luabind::value("GuildPeace", static_cast<int>(OP_GuildPeace)),
|
||||
luabind::value("GuildRemove", static_cast<int>(OP_GuildRemove)),
|
||||
luabind::value("GuildMemberList", static_cast<int>(OP_GuildMemberList)),
|
||||
luabind::value("GuildMemberUpdate", static_cast<int>(OP_GuildMemberUpdate)),
|
||||
luabind::value("GuildMemberLevelUpdate", static_cast<int>(OP_GuildMemberLevelUpdate)),
|
||||
luabind::value("GuildInvite", static_cast<int>(OP_GuildInvite)),
|
||||
luabind::value("GuildMOTD", static_cast<int>(OP_GuildMOTD)),
|
||||
luabind::value("SetGuildMOTD", static_cast<int>(OP_SetGuildMOTD)),
|
||||
luabind::value("GuildPublicNote", static_cast<int>(OP_GuildPublicNote)),
|
||||
luabind::value("GetGuildsList", static_cast<int>(OP_GetGuildsList)),
|
||||
luabind::value("GuildDemote", static_cast<int>(OP_GuildDemote)),
|
||||
luabind::value("GuildInviteAccept", static_cast<int>(OP_GuildInviteAccept)),
|
||||
luabind::value("GuildWar", static_cast<int>(OP_GuildWar)),
|
||||
luabind::value("GuildDelete", static_cast<int>(OP_GuildDelete)),
|
||||
luabind::value("GuildManageRemove", static_cast<int>(OP_GuildManageRemove)),
|
||||
luabind::value("GuildManageAdd", static_cast<int>(OP_GuildManageAdd)),
|
||||
luabind::value("GuildManageStatus", static_cast<int>(OP_GuildManageStatus)),
|
||||
luabind::value("GuildManageBanker", static_cast<int>(OP_GuildManageBanker)),
|
||||
luabind::value("GetGuildMOTD", static_cast<int>(OP_GetGuildMOTD)),
|
||||
luabind::value("Trader", static_cast<int>(OP_Trader)),
|
||||
luabind::value("Bazaar", static_cast<int>(OP_Bazaar)),
|
||||
luabind::value("BecomeTrader", static_cast<int>(OP_BecomeTrader)),
|
||||
luabind::value("TraderItemUpdate", static_cast<int>(OP_TraderItemUpdate)),
|
||||
luabind::value("TraderShop", static_cast<int>(OP_TraderShop)),
|
||||
luabind::value("TraderBuy", static_cast<int>(OP_TraderBuy)),
|
||||
luabind::value("PetCommands", static_cast<int>(OP_PetCommands)),
|
||||
luabind::value("TradeSkillCombine", static_cast<int>(OP_TradeSkillCombine)),
|
||||
luabind::value("AugmentItem", static_cast<int>(OP_AugmentItem)),
|
||||
luabind::value("ItemName", static_cast<int>(OP_ItemName)),
|
||||
luabind::value("ShopItem", static_cast<int>(OP_ShopItem)),
|
||||
luabind::value("ShopPlayerBuy", static_cast<int>(OP_ShopPlayerBuy)),
|
||||
luabind::value("ShopPlayerSell", static_cast<int>(OP_ShopPlayerSell)),
|
||||
luabind::value("ShopDelItem", static_cast<int>(OP_ShopDelItem)),
|
||||
luabind::value("ShopRequest", static_cast<int>(OP_ShopRequest)),
|
||||
luabind::value("ShopEnd", static_cast<int>(OP_ShopEnd)),
|
||||
luabind::value("LFGCommand", static_cast<int>(OP_LFGCommand)),
|
||||
luabind::value("LFGAppearance", static_cast<int>(OP_LFGAppearance)),
|
||||
luabind::value("GroupUpdate", static_cast<int>(OP_GroupUpdate)),
|
||||
luabind::value("GroupInvite", static_cast<int>(OP_GroupInvite)),
|
||||
luabind::value("GroupDisband", static_cast<int>(OP_GroupDisband)),
|
||||
luabind::value("GroupInvite2", static_cast<int>(OP_GroupInvite2)),
|
||||
luabind::value("GroupFollow", static_cast<int>(OP_GroupFollow)),
|
||||
luabind::value("GroupFollow2", static_cast<int>(OP_GroupFollow2)),
|
||||
luabind::value("GroupCancelInvite", static_cast<int>(OP_GroupCancelInvite)),
|
||||
luabind::value("CustomTitles", static_cast<int>(OP_CustomTitles)),
|
||||
luabind::value("Split", static_cast<int>(OP_Split)),
|
||||
luabind::value("Jump", static_cast<int>(OP_Jump)),
|
||||
luabind::value("ConsiderCorpse", static_cast<int>(OP_ConsiderCorpse)),
|
||||
luabind::value("SkillUpdate", static_cast<int>(OP_SkillUpdate)),
|
||||
luabind::value("GMEndTrainingResponse", static_cast<int>(OP_GMEndTrainingResponse)),
|
||||
luabind::value("GMEndTraining", static_cast<int>(OP_GMEndTraining)),
|
||||
luabind::value("GMTrainSkill", static_cast<int>(OP_GMTrainSkill)),
|
||||
luabind::value("GMTraining", static_cast<int>(OP_GMTraining)),
|
||||
luabind::value("DeleteItem", static_cast<int>(OP_DeleteItem)),
|
||||
luabind::value("CombatAbility", static_cast<int>(OP_CombatAbility)),
|
||||
luabind::value("TrackUnknown", static_cast<int>(OP_TrackUnknown)),
|
||||
luabind::value("TrackTarget", static_cast<int>(OP_TrackTarget)),
|
||||
luabind::value("Track", static_cast<int>(OP_Track)),
|
||||
luabind::value("ItemLinkClick", static_cast<int>(OP_ItemLinkClick)),
|
||||
luabind::value("ItemLinkResponse", static_cast<int>(OP_ItemLinkResponse)),
|
||||
luabind::value("ItemLinkText", static_cast<int>(OP_ItemLinkText)),
|
||||
luabind::value("RezzAnswer", static_cast<int>(OP_RezzAnswer)),
|
||||
luabind::value("RezzComplete", static_cast<int>(OP_RezzComplete)),
|
||||
luabind::value("SendZonepoints", static_cast<int>(OP_SendZonepoints)),
|
||||
luabind::value("SetRunMode", static_cast<int>(OP_SetRunMode)),
|
||||
luabind::value("InspectRequest", static_cast<int>(OP_InspectRequest)),
|
||||
luabind::value("InspectAnswer", static_cast<int>(OP_InspectAnswer)),
|
||||
luabind::value("SenseTraps", static_cast<int>(OP_SenseTraps)),
|
||||
luabind::value("DisarmTraps", static_cast<int>(OP_DisarmTraps)),
|
||||
luabind::value("Assist", static_cast<int>(OP_Assist)),
|
||||
luabind::value("AssistGroup", static_cast<int>(OP_AssistGroup)),
|
||||
luabind::value("PickPocket", static_cast<int>(OP_PickPocket)),
|
||||
luabind::value("LootRequest", static_cast<int>(OP_LootRequest)),
|
||||
luabind::value("EndLootRequest", static_cast<int>(OP_EndLootRequest)),
|
||||
luabind::value("MoneyOnCorpse", static_cast<int>(OP_MoneyOnCorpse)),
|
||||
luabind::value("LootComplete", static_cast<int>(OP_LootComplete)),
|
||||
luabind::value("LootItem", static_cast<int>(OP_LootItem)),
|
||||
luabind::value("MoveItem", static_cast<int>(OP_MoveItem)),
|
||||
luabind::value("WhoAllRequest", static_cast<int>(OP_WhoAllRequest)),
|
||||
luabind::value("WhoAllResponse", static_cast<int>(OP_WhoAllResponse)),
|
||||
luabind::value("Consume", static_cast<int>(OP_Consume)),
|
||||
luabind::value("AutoAttack", static_cast<int>(OP_AutoAttack)),
|
||||
luabind::value("AutoAttack2", static_cast<int>(OP_AutoAttack2)),
|
||||
luabind::value("TargetMouse", static_cast<int>(OP_TargetMouse)),
|
||||
luabind::value("TargetCommand", static_cast<int>(OP_TargetCommand)),
|
||||
luabind::value("TargetReject", static_cast<int>(OP_TargetReject)),
|
||||
luabind::value("TargetHoTT", static_cast<int>(OP_TargetHoTT)),
|
||||
luabind::value("Hide", static_cast<int>(OP_Hide)),
|
||||
luabind::value("Forage", static_cast<int>(OP_Forage)),
|
||||
luabind::value("Fishing", static_cast<int>(OP_Fishing)),
|
||||
luabind::value("Bug", static_cast<int>(OP_Bug)),
|
||||
luabind::value("Emote", static_cast<int>(OP_Emote)),
|
||||
luabind::value("Consider", static_cast<int>(OP_Consider)),
|
||||
luabind::value("FaceChange", static_cast<int>(OP_FaceChange)),
|
||||
luabind::value("RandomReq", static_cast<int>(OP_RandomReq)),
|
||||
luabind::value("RandomReply", static_cast<int>(OP_RandomReply)),
|
||||
luabind::value("Camp", static_cast<int>(OP_Camp)),
|
||||
luabind::value("YellForHelp", static_cast<int>(OP_YellForHelp)),
|
||||
luabind::value("SafePoint", static_cast<int>(OP_SafePoint)),
|
||||
luabind::value("Buff", static_cast<int>(OP_Buff)),
|
||||
luabind::value("ColoredText", static_cast<int>(OP_ColoredText)),
|
||||
luabind::value("SpecialMesg", static_cast<int>(OP_SpecialMesg)),
|
||||
luabind::value("Consent", static_cast<int>(OP_Consent)),
|
||||
luabind::value("ConsentResponse", static_cast<int>(OP_ConsentResponse)),
|
||||
luabind::value("Stun", static_cast<int>(OP_Stun)),
|
||||
luabind::value("BeginCast", static_cast<int>(OP_BeginCast)),
|
||||
luabind::value("CastSpell", static_cast<int>(OP_CastSpell)),
|
||||
luabind::value("InterruptCast", static_cast<int>(OP_InterruptCast)),
|
||||
luabind::value("Death", static_cast<int>(OP_Death)),
|
||||
luabind::value("FeignDeath", static_cast<int>(OP_FeignDeath)),
|
||||
luabind::value("Illusion", static_cast<int>(OP_Illusion)),
|
||||
luabind::value("LevelUpdate", static_cast<int>(OP_LevelUpdate)),
|
||||
luabind::value("LevelAppearance", static_cast<int>(OP_LevelAppearance)),
|
||||
luabind::value("MemorizeSpell", static_cast<int>(OP_MemorizeSpell)),
|
||||
luabind::value("HPUpdate", static_cast<int>(OP_HPUpdate)),
|
||||
luabind::value("Mend", static_cast<int>(OP_Mend)),
|
||||
luabind::value("Taunt", static_cast<int>(OP_Taunt)),
|
||||
luabind::value("GMDelCorpse", static_cast<int>(OP_GMDelCorpse)),
|
||||
luabind::value("GMFind", static_cast<int>(OP_GMFind)),
|
||||
luabind::value("GMServers", static_cast<int>(OP_GMServers)),
|
||||
luabind::value("GMGoto", static_cast<int>(OP_GMGoto)),
|
||||
luabind::value("GMSummon", static_cast<int>(OP_GMSummon)),
|
||||
luabind::value("GMKill", static_cast<int>(OP_GMKill)),
|
||||
luabind::value("GMLastName", static_cast<int>(OP_GMLastName)),
|
||||
luabind::value("GMToggle", static_cast<int>(OP_GMToggle)),
|
||||
luabind::value("GMEmoteZone", static_cast<int>(OP_GMEmoteZone)),
|
||||
luabind::value("GMBecomeNPC", static_cast<int>(OP_GMBecomeNPC)),
|
||||
luabind::value("GMHideMe", static_cast<int>(OP_GMHideMe)),
|
||||
luabind::value("GMZoneRequest", static_cast<int>(OP_GMZoneRequest)),
|
||||
luabind::value("GMZoneRequest2", static_cast<int>(OP_GMZoneRequest2)),
|
||||
luabind::value("Petition", static_cast<int>(OP_Petition)),
|
||||
luabind::value("PetitionRefresh", static_cast<int>(OP_PetitionRefresh)),
|
||||
luabind::value("PDeletePetition", static_cast<int>(OP_PDeletePetition)),
|
||||
luabind::value("PetitionBug", static_cast<int>(OP_PetitionBug)),
|
||||
luabind::value("PetitionUpdate", static_cast<int>(OP_PetitionUpdate)),
|
||||
luabind::value("PetitionCheckout", static_cast<int>(OP_PetitionCheckout)),
|
||||
luabind::value("PetitionCheckout2", static_cast<int>(OP_PetitionCheckout2)),
|
||||
luabind::value("PetitionDelete", static_cast<int>(OP_PetitionDelete)),
|
||||
luabind::value("PetitionResolve", static_cast<int>(OP_PetitionResolve)),
|
||||
luabind::value("PetitionCheckIn", static_cast<int>(OP_PetitionCheckIn)),
|
||||
luabind::value("PetitionUnCheckout", static_cast<int>(OP_PetitionUnCheckout)),
|
||||
luabind::value("PetitionQue", static_cast<int>(OP_PetitionQue)),
|
||||
luabind::value("SetServerFilter", static_cast<int>(OP_SetServerFilter)),
|
||||
luabind::value("NewSpawn", static_cast<int>(OP_NewSpawn)),
|
||||
luabind::value("Animation", static_cast<int>(OP_Animation)),
|
||||
luabind::value("ZoneChange", static_cast<int>(OP_ZoneChange)),
|
||||
luabind::value("DeleteSpawn", static_cast<int>(OP_DeleteSpawn)),
|
||||
luabind::value("EnvDamage", static_cast<int>(OP_EnvDamage)),
|
||||
luabind::value("Action", static_cast<int>(OP_Action)),
|
||||
luabind::value("Damage", static_cast<int>(OP_Damage)),
|
||||
luabind::value("ManaChange", static_cast<int>(OP_ManaChange)),
|
||||
luabind::value("ClientError", static_cast<int>(OP_ClientError)),
|
||||
luabind::value("Save", static_cast<int>(OP_Save)),
|
||||
luabind::value("LocInfo", static_cast<int>(OP_LocInfo)),
|
||||
luabind::value("Surname", static_cast<int>(OP_Surname)),
|
||||
luabind::value("ClearSurname", static_cast<int>(OP_ClearSurname)),
|
||||
luabind::value("SwapSpell", static_cast<int>(OP_SwapSpell)),
|
||||
luabind::value("DeleteSpell", static_cast<int>(OP_DeleteSpell)),
|
||||
luabind::value("CloseContainer", static_cast<int>(OP_CloseContainer)),
|
||||
luabind::value("ClickObjectAction", static_cast<int>(OP_ClickObjectAction)),
|
||||
luabind::value("GroundSpawn", static_cast<int>(OP_GroundSpawn)),
|
||||
luabind::value("ClearObject", static_cast<int>(OP_ClearObject)),
|
||||
luabind::value("ZoneUnavail", static_cast<int>(OP_ZoneUnavail)),
|
||||
luabind::value("ItemPacket", static_cast<int>(OP_ItemPacket)),
|
||||
luabind::value("TradeRequest", static_cast<int>(OP_TradeRequest)),
|
||||
luabind::value("TradeRequestAck", static_cast<int>(OP_TradeRequestAck)),
|
||||
luabind::value("TradeAcceptClick", static_cast<int>(OP_TradeAcceptClick)),
|
||||
luabind::value("TradeMoneyUpdate", static_cast<int>(OP_TradeMoneyUpdate)),
|
||||
luabind::value("TradeCoins", static_cast<int>(OP_TradeCoins)),
|
||||
luabind::value("CancelTrade", static_cast<int>(OP_CancelTrade)),
|
||||
luabind::value("FinishTrade", static_cast<int>(OP_FinishTrade)),
|
||||
luabind::value("SaveOnZoneReq", static_cast<int>(OP_SaveOnZoneReq)),
|
||||
luabind::value("Logout", static_cast<int>(OP_Logout)),
|
||||
luabind::value("LogoutReply", static_cast<int>(OP_LogoutReply)),
|
||||
luabind::value("PreLogoutReply", static_cast<int>(OP_PreLogoutReply)),
|
||||
luabind::value("DuelResponse2", static_cast<int>(OP_DuelResponse2)),
|
||||
luabind::value("InstillDoubt", static_cast<int>(OP_InstillDoubt)),
|
||||
luabind::value("SafeFallSuccess", static_cast<int>(OP_SafeFallSuccess)),
|
||||
luabind::value("DisciplineUpdate", static_cast<int>(OP_DisciplineUpdate)),
|
||||
luabind::value("SendGuildTributes", static_cast<int>(OP_SendGuildTributes)),
|
||||
luabind::value("SendTributes", static_cast<int>(OP_SendTributes)),
|
||||
luabind::value("TributeUpdate", static_cast<int>(OP_TributeUpdate)),
|
||||
luabind::value("TributeItem", static_cast<int>(OP_TributeItem)),
|
||||
luabind::value("TributePointUpdate", static_cast<int>(OP_TributePointUpdate)),
|
||||
luabind::value("TributeInfo", static_cast<int>(OP_TributeInfo)),
|
||||
luabind::value("GuildTributeInfo", static_cast<int>(OP_GuildTributeInfo)),
|
||||
luabind::value("OpenGuildTributeMaster", static_cast<int>(OP_OpenGuildTributeMaster)),
|
||||
luabind::value("OpenTributeMaster", static_cast<int>(OP_OpenTributeMaster)),
|
||||
luabind::value("TributeTimer", static_cast<int>(OP_TributeTimer)),
|
||||
luabind::value("SelectTribute", static_cast<int>(OP_SelectTribute)),
|
||||
luabind::value("TributeNPC", static_cast<int>(OP_TributeNPC)),
|
||||
luabind::value("TributeMoney", static_cast<int>(OP_TributeMoney)),
|
||||
luabind::value("TributeToggle", static_cast<int>(OP_TributeToggle)),
|
||||
luabind::value("CloseTributeMaster", static_cast<int>(OP_CloseTributeMaster)),
|
||||
luabind::value("RecipesFavorite", static_cast<int>(OP_RecipesFavorite)),
|
||||
luabind::value("RecipesSearch", static_cast<int>(OP_RecipesSearch)),
|
||||
luabind::value("RecipeReply", static_cast<int>(OP_RecipeReply)),
|
||||
luabind::value("RecipeDetails", static_cast<int>(OP_RecipeDetails)),
|
||||
luabind::value("RecipeAutoCombine", static_cast<int>(OP_RecipeAutoCombine)),
|
||||
luabind::value("Shielding", static_cast<int>(OP_Shielding)),
|
||||
luabind::value("FindPersonRequest", static_cast<int>(OP_FindPersonRequest)),
|
||||
luabind::value("FindPersonReply", static_cast<int>(OP_FindPersonReply)),
|
||||
luabind::value("ZoneEntry", static_cast<int>(OP_ZoneEntry)),
|
||||
luabind::value("PlayerProfile", static_cast<int>(OP_PlayerProfile)),
|
||||
luabind::value("CharInventory", static_cast<int>(OP_CharInventory)),
|
||||
luabind::value("ZoneSpawns", static_cast<int>(OP_ZoneSpawns)),
|
||||
luabind::value("Weather", static_cast<int>(OP_Weather)),
|
||||
luabind::value("ReqNewZone", static_cast<int>(OP_ReqNewZone)),
|
||||
luabind::value("NewZone", static_cast<int>(OP_NewZone)),
|
||||
luabind::value("ReqClientSpawn", static_cast<int>(OP_ReqClientSpawn)),
|
||||
luabind::value("SpawnAppearance", static_cast<int>(OP_SpawnAppearance)),
|
||||
luabind::value("ClientReady", static_cast<int>(OP_ClientReady)),
|
||||
luabind::value("ZoneComplete", static_cast<int>(OP_ZoneComplete)),
|
||||
luabind::value("ApproveWorld", static_cast<int>(OP_ApproveWorld)),
|
||||
luabind::value("LogServer", static_cast<int>(OP_LogServer)),
|
||||
luabind::value("MOTD", static_cast<int>(OP_MOTD)),
|
||||
luabind::value("SendLoginInfo", static_cast<int>(OP_SendLoginInfo)),
|
||||
luabind::value("DeleteCharacter", static_cast<int>(OP_DeleteCharacter)),
|
||||
luabind::value("SendCharInfo", static_cast<int>(OP_SendCharInfo)),
|
||||
luabind::value("ExpansionInfo", static_cast<int>(OP_ExpansionInfo)),
|
||||
luabind::value("CharacterCreate", static_cast<int>(OP_CharacterCreate)),
|
||||
luabind::value("CharacterCreateRequest", static_cast<int>(OP_CharacterCreateRequest)),
|
||||
luabind::value("RandomNameGenerator", static_cast<int>(OP_RandomNameGenerator)),
|
||||
luabind::value("GuildsList", static_cast<int>(OP_GuildsList)),
|
||||
luabind::value("ApproveName", static_cast<int>(OP_ApproveName)),
|
||||
luabind::value("EnterWorld", static_cast<int>(OP_EnterWorld)),
|
||||
luabind::value("PostEnterWorld ", static_cast<int>(OP_PostEnterWorld )),
|
||||
luabind::value("SendSystemStats", static_cast<int>(OP_SendSystemStats)),
|
||||
luabind::value("World_Client_CRC1", static_cast<int>(OP_World_Client_CRC1)),
|
||||
luabind::value("World_Client_CRC2", static_cast<int>(OP_World_Client_CRC2)),
|
||||
luabind::value("SetChatServer", static_cast<int>(OP_SetChatServer)),
|
||||
luabind::value("SetChatServer2", static_cast<int>(OP_SetChatServer2)),
|
||||
luabind::value("ZoneServerInfo", static_cast<int>(OP_ZoneServerInfo)),
|
||||
luabind::value("WorldClientReady", static_cast<int>(OP_WorldClientReady)),
|
||||
luabind::value("WorldUnknown001", static_cast<int>(OP_WorldUnknown001)),
|
||||
luabind::value("AckPacket", static_cast<int>(OP_AckPacket)),
|
||||
luabind::value("WearChange", static_cast<int>(OP_WearChange)),
|
||||
luabind::value("CrashDump", static_cast<int>(OP_CrashDump)),
|
||||
luabind::value("LoginComplete", static_cast<int>(OP_LoginComplete)),
|
||||
luabind::value("GMNameChange", static_cast<int>(OP_GMNameChange)),
|
||||
luabind::value("ReadBook", static_cast<int>(OP_ReadBook)),
|
||||
luabind::value("GMKick", static_cast<int>(OP_GMKick)),
|
||||
luabind::value("RezzRequest", static_cast<int>(OP_RezzRequest)),
|
||||
luabind::value("MultiLineMsg", static_cast<int>(OP_MultiLineMsg)),
|
||||
luabind::value("TimeOfDay", static_cast<int>(OP_TimeOfDay)),
|
||||
luabind::value("CompletedTasks", static_cast<int>(OP_CompletedTasks)),
|
||||
luabind::value("MoneyUpdate", static_cast<int>(OP_MoneyUpdate)),
|
||||
luabind::value("ClickObject", static_cast<int>(OP_ClickObject)),
|
||||
luabind::value("MoveDoor", static_cast<int>(OP_MoveDoor)),
|
||||
luabind::value("TraderDelItem", static_cast<int>(OP_TraderDelItem)),
|
||||
luabind::value("AdventureMerchantPurchase", static_cast<int>(OP_AdventureMerchantPurchase)),
|
||||
luabind::value("TestBuff", static_cast<int>(OP_TestBuff)),
|
||||
luabind::value("DuelResponse", static_cast<int>(OP_DuelResponse)),
|
||||
luabind::value("RequestDuel", static_cast<int>(OP_RequestDuel)),
|
||||
luabind::value("BazaarInspect", static_cast<int>(OP_BazaarInspect)),
|
||||
luabind::value("ClickDoor", static_cast<int>(OP_ClickDoor)),
|
||||
luabind::value("GroupAcknowledge", static_cast<int>(OP_GroupAcknowledge)),
|
||||
luabind::value("GroupDelete", static_cast<int>(OP_GroupDelete)),
|
||||
luabind::value("AdventureMerchantResponse", static_cast<int>(OP_AdventureMerchantResponse)),
|
||||
luabind::value("ShopEndConfirm", static_cast<int>(OP_ShopEndConfirm)),
|
||||
luabind::value("AdventureMerchantRequest", static_cast<int>(OP_AdventureMerchantRequest)),
|
||||
luabind::value("Sound", static_cast<int>(OP_Sound)),
|
||||
luabind::value("0x0193", static_cast<int>(OP_0x0193)),
|
||||
luabind::value("0x0347", static_cast<int>(OP_0x0347)),
|
||||
luabind::value("WorldComplete", static_cast<int>(OP_WorldComplete)),
|
||||
luabind::value("MobRename", static_cast<int>(OP_MobRename)),
|
||||
luabind::value("TaskDescription", static_cast<int>(OP_TaskDescription)),
|
||||
luabind::value("TaskActivity", static_cast<int>(OP_TaskActivity)),
|
||||
luabind::value("TaskMemberList", static_cast<int>(OP_TaskMemberList)),
|
||||
luabind::value("AnnoyingZoneUnknown", static_cast<int>(OP_AnnoyingZoneUnknown)),
|
||||
luabind::value("Some3ByteHPUpdate", static_cast<int>(OP_Some3ByteHPUpdate)),
|
||||
luabind::value("FloatListThing", static_cast<int>(OP_FloatListThing)),
|
||||
luabind::value("AAExpUpdate", static_cast<int>(OP_AAExpUpdate)),
|
||||
luabind::value("ForceFindPerson", static_cast<int>(OP_ForceFindPerson)),
|
||||
luabind::value("PlayMP3", static_cast<int>(OP_PlayMP3)),
|
||||
luabind::value("RequestClientZoneChange", static_cast<int>(OP_RequestClientZoneChange)),
|
||||
luabind::value("SomeItemPacketMaybe", static_cast<int>(OP_SomeItemPacketMaybe)),
|
||||
luabind::value("QueryResponseThing", static_cast<int>(OP_QueryResponseThing)),
|
||||
luabind::value("Some6ByteHPUpdate", static_cast<int>(OP_Some6ByteHPUpdate)),
|
||||
luabind::value("BankerChange", static_cast<int>(OP_BankerChange)),
|
||||
luabind::value("BecomeCorpse", static_cast<int>(OP_BecomeCorpse)),
|
||||
luabind::value("Action2", static_cast<int>(OP_Action2)),
|
||||
luabind::value("BazaarSearch", static_cast<int>(OP_BazaarSearch)),
|
||||
luabind::value("SetTitle", static_cast<int>(OP_SetTitle)),
|
||||
luabind::value("SetTitleReply", static_cast<int>(OP_SetTitleReply)),
|
||||
luabind::value("ConfirmDelete", static_cast<int>(OP_ConfirmDelete)),
|
||||
luabind::value("ConsentDeny", static_cast<int>(OP_ConsentDeny)),
|
||||
luabind::value("CrystalCountUpdate", static_cast<int>(OP_CrystalCountUpdate)),
|
||||
luabind::value("DeletePetition", static_cast<int>(OP_DeletePetition)),
|
||||
luabind::value("DenyResponse", static_cast<int>(OP_DenyResponse)),
|
||||
luabind::value("Disarm", static_cast<int>(OP_Disarm)),
|
||||
luabind::value("Feedback", static_cast<int>(OP_Feedback)),
|
||||
luabind::value("FriendsWho", static_cast<int>(OP_FriendsWho)),
|
||||
luabind::value("GMApproval", static_cast<int>(OP_GMApproval)),
|
||||
luabind::value("GMSearchCorpse", static_cast<int>(OP_GMSearchCorpse)),
|
||||
luabind::value("GuildBank", static_cast<int>(OP_GuildBank)),
|
||||
luabind::value("InitialHPUpdate", static_cast<int>(OP_InitialHPUpdate)),
|
||||
luabind::value("InitialMobHealth", static_cast<int>(OP_InitialMobHealth)),
|
||||
luabind::value("LFGGetMatchesRequest", static_cast<int>(OP_LFGGetMatchesRequest)),
|
||||
luabind::value("LFGGetMatchesResponse", static_cast<int>(OP_LFGGetMatchesResponse)),
|
||||
luabind::value("LFGResponse", static_cast<int>(OP_LFGResponse)),
|
||||
luabind::value("LFPCommand", static_cast<int>(OP_LFPCommand)),
|
||||
luabind::value("LFPGetMatchesRequest", static_cast<int>(OP_LFPGetMatchesRequest)),
|
||||
luabind::value("LFPGetMatchesResponse", static_cast<int>(OP_LFPGetMatchesResponse)),
|
||||
luabind::value("LeadershipExpToggle", static_cast<int>(OP_LeadershipExpToggle)),
|
||||
luabind::value("LeadershipExpUpdate", static_cast<int>(OP_LeadershipExpUpdate)),
|
||||
luabind::value("LoadSpellSet", static_cast<int>(OP_LoadSpellSet)),
|
||||
luabind::value("LockoutTimerInfo", static_cast<int>(OP_LockoutTimerInfo)),
|
||||
luabind::value("MendHPUpdate", static_cast<int>(OP_MendHPUpdate)),
|
||||
luabind::value("MobHealth", static_cast<int>(OP_MobHealth)),
|
||||
luabind::value("MoveLogDisregard", static_cast<int>(OP_MoveLogDisregard)),
|
||||
luabind::value("MoveLogRequest", static_cast<int>(OP_MoveLogRequest)),
|
||||
luabind::value("PetitionSearch", static_cast<int>(OP_PetitionSearch)),
|
||||
luabind::value("PetitionSearchResults", static_cast<int>(OP_PetitionSearchResults)),
|
||||
luabind::value("PetitionSearchText", static_cast<int>(OP_PetitionSearchText)),
|
||||
luabind::value("RaidInvite", static_cast<int>(OP_RaidInvite)),
|
||||
luabind::value("ReclaimCrystals", static_cast<int>(OP_ReclaimCrystals)),
|
||||
luabind::value("Report", static_cast<int>(OP_Report)),
|
||||
luabind::value("SenseHeading", static_cast<int>(OP_SenseHeading)),
|
||||
luabind::value("LDoNOpen", static_cast<int>(OP_LDoNOpen)),
|
||||
luabind::value("LDoNSenseTraps", static_cast<int>(OP_LDoNSenseTraps)),
|
||||
luabind::value("LDoNPickLock", static_cast<int>(OP_LDoNPickLock)),
|
||||
luabind::value("LDoNDisarmTraps", static_cast<int>(OP_LDoNDisarmTraps)),
|
||||
luabind::value("LDoNInspect", static_cast<int>(OP_LDoNInspect)),
|
||||
luabind::value("DynamicWall", static_cast<int>(OP_DynamicWall)),
|
||||
luabind::value("RequestTitles", static_cast<int>(OP_RequestTitles)),
|
||||
luabind::value("PurchaseLeadershipAA", static_cast<int>(OP_PurchaseLeadershipAA)),
|
||||
luabind::value("UpdateLeadershipAA", static_cast<int>(OP_UpdateLeadershipAA)),
|
||||
luabind::value("AdventurePointsUpdate", static_cast<int>(OP_AdventurePointsUpdate)),
|
||||
luabind::value("ZoneInUnknown", static_cast<int>(OP_ZoneInUnknown)),
|
||||
luabind::value("ZoneServerReady ", static_cast<int>(OP_ZoneServerReady )),
|
||||
luabind::value("ZoneGuildList", static_cast<int>(OP_ZoneGuildList)),
|
||||
luabind::value("SendTitleList", static_cast<int>(OP_SendTitleList)),
|
||||
luabind::value("NewTitlesAvailable", static_cast<int>(OP_NewTitlesAvailable)),
|
||||
luabind::value("Bandolier", static_cast<int>(OP_Bandolier)),
|
||||
luabind::value("OpenDiscordMerchant", static_cast<int>(OP_OpenDiscordMerchant)),
|
||||
luabind::value("DiscordMerchantInventory", static_cast<int>(OP_DiscordMerchantInventory)),
|
||||
luabind::value("GiveMoney", static_cast<int>(OP_GiveMoney)),
|
||||
luabind::value("OnLevelMessage", static_cast<int>(OP_OnLevelMessage)),
|
||||
luabind::value("RequestKnowledgeBase", static_cast<int>(OP_RequestKnowledgeBase)),
|
||||
luabind::value("KnowledgeBase", static_cast<int>(OP_KnowledgeBase)),
|
||||
luabind::value("VetRewardsAvaliable", static_cast<int>(OP_VetRewardsAvaliable)),
|
||||
luabind::value("VetClaimRequest", static_cast<int>(OP_VetClaimRequest)),
|
||||
luabind::value("VetClaimReply", static_cast<int>(OP_VetClaimReply)),
|
||||
luabind::value("WeaponEquip1", static_cast<int>(OP_WeaponEquip1)),
|
||||
luabind::value("PlayerStateAdd", static_cast<int>(OP_PlayerStateAdd)),
|
||||
luabind::value("PlayerStateRemove", static_cast<int>(OP_PlayerStateRemove)),
|
||||
luabind::value("WorldLogout", static_cast<int>(OP_WorldLogout)),
|
||||
luabind::value("SessionReady", static_cast<int>(OP_SessionReady)),
|
||||
luabind::value("Login", static_cast<int>(OP_Login)),
|
||||
luabind::value("ServerListRequest", static_cast<int>(OP_ServerListRequest)),
|
||||
luabind::value("PlayEverquestRequest", static_cast<int>(OP_PlayEverquestRequest)),
|
||||
luabind::value("ChatMessage", static_cast<int>(OP_ChatMessage)),
|
||||
luabind::value("LoginAccepted", static_cast<int>(OP_LoginAccepted)),
|
||||
luabind::value("ServerListResponse", static_cast<int>(OP_ServerListResponse)),
|
||||
luabind::value("Poll", static_cast<int>(OP_Poll)),
|
||||
luabind::value("PlayEverquestResponse", static_cast<int>(OP_PlayEverquestResponse)),
|
||||
luabind::value("EnterChat", static_cast<int>(OP_EnterChat)),
|
||||
luabind::value("PollResponse", static_cast<int>(OP_PollResponse)),
|
||||
luabind::value("Command", static_cast<int>(OP_Command)),
|
||||
luabind::value("ZonePlayerToBind", static_cast<int>(OP_ZonePlayerToBind)),
|
||||
luabind::value("AutoFire", static_cast<int>(OP_AutoFire)),
|
||||
luabind::value("Rewind", static_cast<int>(OP_Rewind)),
|
||||
luabind::value("OpenNewTasksWindow", static_cast<int>(OP_OpenNewTasksWindow)),
|
||||
luabind::value("TaskActivityComplete", static_cast<int>(OP_TaskActivityComplete)),
|
||||
luabind::value("AcceptNewTask", static_cast<int>(OP_AcceptNewTask)),
|
||||
luabind::value("CancelTask", static_cast<int>(OP_CancelTask)),
|
||||
luabind::value("TaskHistoryRequest", static_cast<int>(OP_TaskHistoryRequest)),
|
||||
luabind::value("TaskHistoryReply", static_cast<int>(OP_TaskHistoryReply)),
|
||||
luabind::value("PetBuffWindow", static_cast<int>(OP_PetBuffWindow)),
|
||||
luabind::value("RaidJoin", static_cast<int>(OP_RaidJoin)),
|
||||
luabind::value("Translocate", static_cast<int>(OP_Translocate)),
|
||||
luabind::value("Sacrifice", static_cast<int>(OP_Sacrifice)),
|
||||
luabind::value("KeyRing", static_cast<int>(OP_KeyRing)),
|
||||
luabind::value("PopupResponse", static_cast<int>(OP_PopupResponse)),
|
||||
luabind::value("DeleteCharge", static_cast<int>(OP_DeleteCharge)),
|
||||
luabind::value("PotionBelt", static_cast<int>(OP_PotionBelt)),
|
||||
luabind::value("Barter", static_cast<int>(OP_Barter)),
|
||||
luabind::value("VoiceMacroIn", static_cast<int>(OP_VoiceMacroIn)),
|
||||
luabind::value("VoiceMacroOut", static_cast<int>(OP_VoiceMacroOut)),
|
||||
luabind::value("WorldObjectsSent", static_cast<int>(OP_WorldObjectsSent)),
|
||||
luabind::value("BlockedBuffs", static_cast<int>(OP_BlockedBuffs)),
|
||||
luabind::value("RemoveBlockedBuffs", static_cast<int>(OP_RemoveBlockedBuffs)),
|
||||
luabind::value("ClearBlockedBuffs", static_cast<int>(OP_ClearBlockedBuffs)),
|
||||
luabind::value("GroupUpdateLeaderAA", static_cast<int>(OP_GroupUpdateLeaderAA)),
|
||||
luabind::value("MarkNPC", static_cast<int>(OP_MarkNPC)),
|
||||
luabind::value("ClearNPCMarks", static_cast<int>(OP_ClearNPCMarks)),
|
||||
luabind::value("DoGroupLeadershipAbility", static_cast<int>(OP_DoGroupLeadershipAbility)),
|
||||
luabind::value("DelegateAbility", static_cast<int>(OP_DelegateAbility)),
|
||||
luabind::value("SetGroupTarget", static_cast<int>(OP_SetGroupTarget)),
|
||||
luabind::value("ApplyPoison", static_cast<int>(OP_ApplyPoison)),
|
||||
luabind::value("FinishWindow", static_cast<int>(OP_FinishWindow)),
|
||||
luabind::value("FinishWindow2", static_cast<int>(OP_FinishWindow2)),
|
||||
luabind::value("ItemVerifyRequest", static_cast<int>(OP_ItemVerifyRequest)),
|
||||
luabind::value("ItemVerifyReply", static_cast<int>(OP_ItemVerifyReply)),
|
||||
luabind::value("GMTrainSkillConfirm", static_cast<int>(OP_GMTrainSkillConfirm)),
|
||||
luabind::value("RestState", static_cast<int>(OP_RestState)),
|
||||
luabind::value("AugmentInfo", static_cast<int>(OP_AugmentInfo)),
|
||||
luabind::value("PVPStats", static_cast<int>(OP_PVPStats)),
|
||||
luabind::value("PVPLeaderBoardRequest", static_cast<int>(OP_PVPLeaderBoardRequest)),
|
||||
luabind::value("PVPLeaderBoardReply", static_cast<int>(OP_PVPLeaderBoardReply)),
|
||||
luabind::value("PVPLeaderBoardDetailsRequest", static_cast<int>(OP_PVPLeaderBoardDetailsRequest)),
|
||||
luabind::value("PVPLeaderBoardDetailsReply", static_cast<int>(OP_PVPLeaderBoardDetailsReply)),
|
||||
luabind::value("DisciplineTimer", static_cast<int>(OP_DisciplineTimer)),
|
||||
luabind::value("RespawnWindow", static_cast<int>(OP_RespawnWindow)),
|
||||
luabind::value("AdventureMerchantSell", static_cast<int>(OP_AdventureMerchantSell)),
|
||||
luabind::value("AdventureStatsRequest", static_cast<int>(OP_AdventureStatsRequest)),
|
||||
luabind::value("AdventureStatsReply", static_cast<int>(OP_AdventureStatsReply)),
|
||||
luabind::value("AdventureLeaderboardRequest", static_cast<int>(OP_AdventureLeaderboardRequest)),
|
||||
luabind::value("AdventureLeaderboardReply", static_cast<int>(OP_AdventureLeaderboardReply)),
|
||||
luabind::value("SetStartCity", static_cast<int>(OP_SetStartCity)),
|
||||
luabind::value("LoginUnknown1", static_cast<int>(OP_LoginUnknown1)),
|
||||
luabind::value("LoginUnknown2", static_cast<int>(OP_LoginUnknown2)),
|
||||
luabind::value("ItemViewUnknown", static_cast<int>(OP_ItemViewUnknown)),
|
||||
luabind::value("GetGuildMOTDReply", static_cast<int>(OP_GetGuildMOTDReply)),
|
||||
luabind::value("SetGuildRank", static_cast<int>(OP_SetGuildRank)),
|
||||
luabind::value("SpawnPositionUpdate", static_cast<int>(OP_SpawnPositionUpdate)),
|
||||
luabind::value("ManaUpdate", static_cast<int>(OP_ManaUpdate)),
|
||||
luabind::value("EnduranceUpdate", static_cast<int>(OP_EnduranceUpdate)),
|
||||
luabind::value("MobManaUpdate", static_cast<int>(OP_MobManaUpdate)),
|
||||
luabind::value("MobEnduranceUpdate", static_cast<int>(OP_MobEnduranceUpdate)),
|
||||
luabind::value("GroupUpdateB", static_cast<int>(OP_GroupUpdateB)),
|
||||
luabind::value("GroupDisbandYou", static_cast<int>(OP_GroupDisbandYou)),
|
||||
luabind::value("GroupDisbandOther", static_cast<int>(OP_GroupDisbandOther)),
|
||||
luabind::value("GroupLeaderChange", static_cast<int>(OP_GroupLeaderChange)),
|
||||
luabind::value("GroupLeadershipAAUpdate", static_cast<int>(OP_GroupLeadershipAAUpdate)),
|
||||
luabind::value("GroupRoles", static_cast<int>(OP_GroupRoles)),
|
||||
luabind::value("SendFindableNPCs", static_cast<int>(OP_SendFindableNPCs)),
|
||||
luabind::value("HideCorpse", static_cast<int>(OP_HideCorpse)),
|
||||
luabind::value("TargetBuffs", static_cast<int>(OP_TargetBuffs)),
|
||||
luabind::value("TradeBusy", static_cast<int>(OP_TradeBusy)),
|
||||
luabind::value("GuildUpdateURLAndChannel", static_cast<int>(OP_GuildUpdateURLAndChannel)),
|
||||
luabind::value("CameraEffect", static_cast<int>(OP_CameraEffect)),
|
||||
luabind::value("SpellEffect", static_cast<int>(OP_SpellEffect)),
|
||||
luabind::value("DzQuit", static_cast<int>(OP_DzQuit)),
|
||||
luabind::value("DzListTimers", static_cast<int>(OP_DzListTimers)),
|
||||
luabind::value("DzPlayerList", static_cast<int>(OP_DzPlayerList)),
|
||||
luabind::value("DzAddPlayer", static_cast<int>(OP_DzAddPlayer)),
|
||||
luabind::value("DzRemovePlayer", static_cast<int>(OP_DzRemovePlayer)),
|
||||
luabind::value("DzSwapPlayer", static_cast<int>(OP_DzSwapPlayer)),
|
||||
luabind::value("DzMakeLeader", static_cast<int>(OP_DzMakeLeader)),
|
||||
luabind::value("DzJoinExpeditionConfirm", static_cast<int>(OP_DzJoinExpeditionConfirm)),
|
||||
luabind::value("DzJoinExpeditionReply", static_cast<int>(OP_DzJoinExpeditionReply)),
|
||||
luabind::value("DzExpeditionInfo", static_cast<int>(OP_DzExpeditionInfo)),
|
||||
luabind::value("DzMemberStatus", static_cast<int>(OP_DzMemberStatus)),
|
||||
luabind::value("DzLeaderStatus", static_cast<int>(OP_DzLeaderStatus)),
|
||||
luabind::value("DzExpeditionEndsWarning", static_cast<int>(OP_DzExpeditionEndsWarning)),
|
||||
luabind::value("DzExpeditionList", static_cast<int>(OP_DzExpeditionList)),
|
||||
luabind::value("DzMemberList", static_cast<int>(OP_DzMemberList)),
|
||||
luabind::value("DzCompass", static_cast<int>(OP_DzCompass)),
|
||||
luabind::value("DzChooseZone", static_cast<int>(OP_DzChooseZone)),
|
||||
luabind::value("BuffCreate", static_cast<int>(OP_BuffCreate)),
|
||||
luabind::value("GuildStatus", static_cast<int>(OP_GuildStatus)),
|
||||
luabind::value("BuffRemoveRequest", static_cast<int>(OP_BuffRemoveRequest)),
|
||||
luabind::value("CorpseDrag", static_cast<int>(OP_CorpseDrag)),
|
||||
luabind::value("CorpseDrop", static_cast<int>(OP_CorpseDrop)),
|
||||
luabind::value("ChangeSize", static_cast<int>(OP_ChangeSize)),
|
||||
luabind::value("GroupMakeLeader", static_cast<int>(OP_GroupMakeLeader)),
|
||||
luabind::value("RemoveAllDoors", static_cast<int>(OP_RemoveAllDoors)),
|
||||
luabind::value("RemoveNimbusEffect", static_cast<int>(OP_RemoveNimbusEffect)),
|
||||
luabind::value("GuildCreate", static_cast<int>(OP_GuildCreate)),
|
||||
luabind::value("AltCurrency", static_cast<int>(OP_AltCurrency)),
|
||||
luabind::value("FellowshipUpdate", static_cast<int>(OP_FellowshipUpdate)),
|
||||
luabind::value("AltCurrencyMerchantRequest", static_cast<int>(OP_AltCurrencyMerchantRequest)),
|
||||
luabind::value("AltCurrencyMerchantReply", static_cast<int>(OP_AltCurrencyMerchantReply)),
|
||||
luabind::value("AltCurrencyPurchase", static_cast<int>(OP_AltCurrencyPurchase)),
|
||||
luabind::value("AltCurrencySellSelection", static_cast<int>(OP_AltCurrencySellSelection)),
|
||||
luabind::value("AltCurrencyReclaim", static_cast<int>(OP_AltCurrencyReclaim)),
|
||||
luabind::value("AltCurrencySell", static_cast<int>(OP_AltCurrencySell)),
|
||||
luabind::value("Untargetable", static_cast<int>(OP_Untargetable)),
|
||||
luabind::value("CrystalReclaim", static_cast<int>(OP_CrystalReclaim)),
|
||||
luabind::value("CrystalCreate", static_cast<int>(OP_CrystalCreate)),
|
||||
luabind::value("SendMaxCharacters", static_cast<int>(OP_SendMaxCharacters)),
|
||||
luabind::value("SendMembership", static_cast<int>(OP_SendMembership)),
|
||||
luabind::value("SendMembershipDetails", static_cast<int>(OP_SendMembershipDetails)),
|
||||
luabind::value("LFGuild", static_cast<int>(OP_LFGuild)),
|
||||
luabind::value("XTargetRequest", static_cast<int>(OP_XTargetRequest)),
|
||||
luabind::value("XTargetResponse", static_cast<int>(OP_XTargetResponse)),
|
||||
luabind::value("XTargetAutoAddHaters", static_cast<int>(OP_XTargetAutoAddHaters)),
|
||||
luabind::value("Weblink", static_cast<int>(OP_Weblink)),
|
||||
luabind::value("InspectMessageUpdate", static_cast<int>(OP_InspectMessageUpdate)),
|
||||
luabind::value("ItemPreview", static_cast<int>(OP_ItemPreview)),
|
||||
luabind::value("MercenaryDataRequest", static_cast<int>(OP_MercenaryDataRequest)),
|
||||
luabind::value("MercenaryDataResponse", static_cast<int>(OP_MercenaryDataResponse)),
|
||||
luabind::value("MercenaryHire", static_cast<int>(OP_MercenaryHire)),
|
||||
luabind::value("MercenaryUnknown1", static_cast<int>(OP_MercenaryUnknown1)),
|
||||
luabind::value("MercenaryTimer", static_cast<int>(OP_MercenaryTimer)),
|
||||
luabind::value("MercenaryAssign", static_cast<int>(OP_MercenaryAssign)),
|
||||
luabind::value("MercenaryDataUpdate", static_cast<int>(OP_MercenaryDataUpdate)),
|
||||
luabind::value("MercenaryCommand", static_cast<int>(OP_MercenaryCommand)),
|
||||
luabind::value("MercenarySuspendRequest", static_cast<int>(OP_MercenarySuspendRequest)),
|
||||
luabind::value("MercenarySuspendResponse", static_cast<int>(OP_MercenarySuspendResponse)),
|
||||
luabind::value("MercenaryUnsuspendResponse", static_cast<int>(OP_MercenaryUnsuspendResponse)),
|
||||
luabind::value("MercenaryDataUpdateRequest", static_cast<int>(OP_MercenaryDataUpdateRequest)),
|
||||
luabind::value("MercenaryDismiss", static_cast<int>(OP_MercenaryDismiss)),
|
||||
luabind::value("MercenaryTimerRequest", static_cast<int>(OP_MercenaryTimerRequest)),
|
||||
luabind::value("OpenInventory", static_cast<int>(OP_OpenInventory)),
|
||||
luabind::value("OpenContainer", static_cast<int>(OP_OpenContainer)),
|
||||
luabind::value("Marquee", static_cast<int>(OP_Marquee)),
|
||||
luabind::value("ClientTimeStamp", static_cast<int>(OP_ClientTimeStamp)),
|
||||
luabind::value("GuildPromote", static_cast<int>(OP_GuildPromote)),
|
||||
luabind::value("Fling", static_cast<int>(OP_Fling))
|
||||
];
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef EQEMU_LUA_PACKET_H
|
||||
#define EQEMU_LUA_PACKET_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
class EQApplicationPacket;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_packet();
|
||||
luabind::scope lua_register_packet_opcodes();
|
||||
|
||||
class Lua_Packet : public Lua_Ptr<EQApplicationPacket>
|
||||
{
|
||||
typedef EQApplicationPacket NativeType;
|
||||
public:
|
||||
Lua_Packet() : Lua_Ptr(nullptr), owned_(false) { }
|
||||
Lua_Packet(EQApplicationPacket *d) : Lua_Ptr(d), owned_(false) { }
|
||||
Lua_Packet(int opcode, int size);
|
||||
Lua_Packet(int opcode, int size, bool raw);
|
||||
Lua_Packet& operator=(const Lua_Packet& o);
|
||||
Lua_Packet(const Lua_Packet& o);
|
||||
virtual ~Lua_Packet() { if(owned_) { EQApplicationPacket *ptr = GetLuaPtrData(); if(ptr) { delete ptr; } } }
|
||||
|
||||
int GetSize();
|
||||
int GetOpcode();
|
||||
void SetOpcode(int op);
|
||||
int GetRawOpcode();
|
||||
void SetRawOpcode(int op);
|
||||
void WriteInt8(int offset, int value);
|
||||
void WriteInt16(int offset, int value);
|
||||
void WriteInt32(int offset, int value);
|
||||
void WriteInt64(int offset, int64 value);
|
||||
void WriteFloat(int offset, float value);
|
||||
void WriteDouble(int offset, double value);
|
||||
void WriteString(int offset, std::string value);
|
||||
void WriteFixedLengthString(int offset, std::string value, int string_length);
|
||||
int ReadInt8(int offset);
|
||||
int ReadInt16(int offset);
|
||||
int ReadInt32(int offset);
|
||||
int64 ReadInt64(int offset);
|
||||
float ReadFloat(int offset);
|
||||
double ReadDouble(int offset);
|
||||
std::string ReadString(int offset);
|
||||
std::string ReadFixedLengthString(int offset, int string_length);
|
||||
|
||||
operator EQApplicationPacket*() {
|
||||
return reinterpret_cast<EQApplicationPacket*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
private:
|
||||
bool owned_;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,752 @@
|
||||
#ifdef LUA_EQEMU
|
||||
#include <sstream>
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "quest_parser_collection.h"
|
||||
#include "quest_interface.h"
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "../common/seperator.h"
|
||||
#include "../common/misc_functions.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_spell.h"
|
||||
#include "lua_corpse.h"
|
||||
#include "lua_door.h"
|
||||
#include "lua_object.h"
|
||||
#include "lua_packet.h"
|
||||
#include "lua_encounter.h"
|
||||
#include "zone.h"
|
||||
#include "lua_parser_events.h"
|
||||
|
||||
//NPC
|
||||
void handle_npc_event_say(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
npc->DoQuestPause(init);
|
||||
|
||||
Lua_Client l_client(reinterpret_cast<Client*>(init));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "message");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "language");
|
||||
}
|
||||
|
||||
void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Client l_client(reinterpret_cast<Client*>(init));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_createtable(L, 0, 0);
|
||||
std::stringstream ident;
|
||||
ident << npc->GetNPCTypeID();
|
||||
|
||||
if(extra_pointers) {
|
||||
size_t sz = extra_pointers->size();
|
||||
for(size_t i = 0; i < sz; ++i) {
|
||||
std::string prefix = "item" + std::to_string(i + 1);
|
||||
EQEmu::ItemInstance *inst = EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(i));
|
||||
|
||||
Lua_ItemInst l_inst = inst;
|
||||
luabind::adl::object l_inst_o = luabind::adl::object(L, l_inst);
|
||||
l_inst_o.push(L);
|
||||
|
||||
lua_setfield(L, -2, prefix.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
lua_pushinteger(L, std::stoul(parse->GetVar("platinum." + ident.str())));
|
||||
lua_setfield(L, -2, "platinum");
|
||||
|
||||
lua_pushinteger(L, std::stoul(parse->GetVar("gold." + ident.str())));
|
||||
lua_setfield(L, -2, "gold");
|
||||
|
||||
lua_pushinteger(L, std::stoul(parse->GetVar("silver." + ident.str())));
|
||||
lua_setfield(L, -2, "silver");
|
||||
|
||||
lua_pushinteger(L, std::stoul(parse->GetVar("copper." + ident.str())));
|
||||
lua_setfield(L, -2, "copper");
|
||||
lua_setfield(L, -2, "trade");
|
||||
}
|
||||
|
||||
void handle_npc_event_hp(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(extra_data == 1) {
|
||||
lua_pushinteger(L, -1);
|
||||
lua_setfield(L, -2, "hp_event");
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "inc_hp_event");
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "hp_event");
|
||||
lua_pushinteger(L, -1);
|
||||
lua_setfield(L, -2, "inc_hp_event");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_npc_single_mob(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Mob l_mob(init);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_npc_single_client(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Client l_client(reinterpret_cast<Client*>(init));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_npc_single_npc(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_NPC l_npc(reinterpret_cast<NPC*>(init));
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_npc_task_accepted(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Client l_client(reinterpret_cast<Client*>(init));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "task_id");
|
||||
}
|
||||
|
||||
void handle_npc_popup(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Mob l_mob(init);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "popup_id");
|
||||
}
|
||||
|
||||
void handle_npc_waypoint(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Mob l_mob(init);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "wp");
|
||||
}
|
||||
|
||||
void handle_npc_hate(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Mob l_mob(init);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushboolean(L, std::stoi(data) == 0 ? false : true);
|
||||
lua_setfield(L, -2, "joined");
|
||||
}
|
||||
|
||||
|
||||
void handle_npc_signal(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "signal");
|
||||
}
|
||||
|
||||
void handle_npc_timer(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "timer");
|
||||
}
|
||||
|
||||
void handle_npc_death(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Mob l_mob(init);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "damage");
|
||||
|
||||
int spell_id = std::stoi(sep.arg[1]);
|
||||
if(IsValidSpell(spell_id)) {
|
||||
Lua_Spell l_spell(&spells[spell_id]);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
} else {
|
||||
Lua_Spell l_spell(nullptr);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
}
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||
lua_setfield(L, -2, "skill_id");
|
||||
}
|
||||
|
||||
void handle_npc_cast(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
int spell_id = std::stoi(data);
|
||||
if(IsValidSpell(spell_id)) {
|
||||
Lua_Spell l_spell(&spells[spell_id]);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
} else {
|
||||
Lua_Spell l_spell(nullptr);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_npc_area(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(0)));
|
||||
lua_setfield(L, -2, "area_id");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(1)));
|
||||
lua_setfield(L, -2, "area_type");
|
||||
}
|
||||
|
||||
void handle_npc_null(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
}
|
||||
|
||||
//Player
|
||||
void handle_player_say(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "message");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "language");
|
||||
}
|
||||
|
||||
void handle_player_environmental_damage(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers){
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "env_damage");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "env_damage_type");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||
lua_setfield(L, -2, "env_final_damage");
|
||||
}
|
||||
|
||||
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
|
||||
Mob *o = entity_list.GetMobID(std::stoi(sep.arg[0]));
|
||||
Lua_Mob l_mob(o);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "damage");
|
||||
|
||||
int spell_id = std::stoi(sep.arg[2]);
|
||||
if(IsValidSpell(spell_id)) {
|
||||
Lua_Spell l_spell(&spells[spell_id]);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
} else {
|
||||
Lua_Spell l_spell(nullptr);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
}
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[3]));
|
||||
lua_setfield(L, -2, "skill");
|
||||
}
|
||||
|
||||
void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "timer");
|
||||
}
|
||||
|
||||
void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
const EQEmu::ItemData *item = database.GetItem(extra_data);
|
||||
if(item) {
|
||||
Lua_Item l_item(item);
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
} else {
|
||||
Lua_Item l_item(nullptr);
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_player_fish_forage_success(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
}
|
||||
|
||||
void handle_player_click_object(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Object l_object(EQEmu::any_cast<Object*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_object_o = luabind::adl::object(L, l_object);
|
||||
l_object_o.push(L);
|
||||
lua_setfield(L, -2, "object");
|
||||
}
|
||||
|
||||
void handle_player_click_door(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Door l_door(EQEmu::any_cast<Doors*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_door_o = luabind::adl::object(L, l_door);
|
||||
l_door_o.push(L);
|
||||
lua_setfield(L, -2, "door");
|
||||
}
|
||||
|
||||
void handle_player_signal(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "signal");
|
||||
}
|
||||
|
||||
void handle_player_popup_response(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "popup_id");
|
||||
}
|
||||
|
||||
void handle_player_pick_up(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
}
|
||||
|
||||
void handle_player_cast(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
int spell_id = std::stoi(data);
|
||||
if(IsValidSpell(spell_id)) {
|
||||
Lua_Spell l_spell(&spells[spell_id]);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
} else {
|
||||
Lua_Spell l_spell(nullptr);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
}
|
||||
|
||||
lua_setfield(L, -2, "spell");
|
||||
}
|
||||
|
||||
void handle_player_task_fail(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "task_id");
|
||||
}
|
||||
|
||||
void handle_player_zone(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "zone_id");
|
||||
}
|
||||
|
||||
void handle_player_duel_win(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Client l_client(EQEmu::any_cast<Client*>(extra_pointers->at(1)));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_player_duel_loss(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Client l_client(EQEmu::any_cast<Client*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_player_loot(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
|
||||
Lua_Corpse l_corpse(EQEmu::any_cast<Corpse*>(extra_pointers->at(1)));
|
||||
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
|
||||
l_corpse_o.push(L);
|
||||
lua_setfield(L, -2, "corpse");
|
||||
}
|
||||
|
||||
void handle_player_task_stage_complete(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "task_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "activity_id");
|
||||
}
|
||||
|
||||
void handle_player_task_update(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "count");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "activity_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||
lua_setfield(L, -2, "task_id");
|
||||
}
|
||||
|
||||
void handle_player_command(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Seperator sep(data.c_str(), ' ', 10, 100, true);
|
||||
std::string command(sep.arg[0] + 1);
|
||||
lua_pushstring(L, command.c_str());
|
||||
lua_setfield(L, -2, "command");
|
||||
|
||||
luabind::adl::object args = luabind::newtable(L);
|
||||
int max_args = sep.GetMaxArgNum();
|
||||
for(int i = 1; i < max_args; ++i) {
|
||||
if(strlen(sep.arg[i]) > 0) {
|
||||
args[i] = std::string(sep.arg[i]);
|
||||
}
|
||||
}
|
||||
|
||||
args.push(L);
|
||||
lua_setfield(L, -2, "args");
|
||||
}
|
||||
|
||||
void handle_player_combine(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "recipe_id");
|
||||
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "recipe_name");
|
||||
}
|
||||
|
||||
void handle_player_feign(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_NPC l_npc(EQEmu::any_cast<NPC*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
lua_setfield(L, -2, "other");
|
||||
}
|
||||
|
||||
void handle_player_area(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(0)));
|
||||
lua_setfield(L, -2, "area_id");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(1)));
|
||||
lua_setfield(L, -2, "area_type");
|
||||
}
|
||||
|
||||
void handle_player_respawn(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "option");
|
||||
|
||||
lua_pushboolean(L, extra_data == 1 ? true : false);
|
||||
lua_setfield(L, -2, "resurrect");
|
||||
}
|
||||
|
||||
void handle_player_packet(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_Packet l_packet(EQEmu::any_cast<EQApplicationPacket*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_packet_o = luabind::adl::object(L, l_packet);
|
||||
l_packet_o.push(L);
|
||||
lua_setfield(L, -2, "packet");
|
||||
|
||||
lua_pushboolean(L, extra_data == 1 ? true : false);
|
||||
lua_setfield(L, -2, "connecting");
|
||||
}
|
||||
|
||||
void handle_player_null(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
}
|
||||
|
||||
void handle_player_use_skill(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Seperator sep(data.c_str());
|
||||
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||
lua_setfield(L, -2, "skill_id");
|
||||
|
||||
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||
lua_setfield(L, -2, "skill_level");
|
||||
}
|
||||
|
||||
//Item
|
||||
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "slot_id");
|
||||
}
|
||||
|
||||
void handle_item_timer(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "timer");
|
||||
}
|
||||
|
||||
void handle_item_proc(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
|
||||
Lua_Mob l_mob(mob);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
lua_setfield(L, -2, "target");
|
||||
|
||||
if(IsValidSpell(extra_data)) {
|
||||
Lua_Spell l_spell(&spells[extra_data]);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
} else {
|
||||
Lua_Spell l_spell(nullptr);
|
||||
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
|
||||
l_spell_o.push(L);
|
||||
lua_setfield(L, -2, "spell");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_item_loot(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(mob && mob->IsCorpse()) {
|
||||
Lua_Corpse l_corpse(mob->CastToCorpse());
|
||||
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
|
||||
l_corpse_o.push(L);
|
||||
lua_setfield(L, -2, "corpse");
|
||||
} else {
|
||||
Lua_Corpse l_corpse(nullptr);
|
||||
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
|
||||
l_corpse_o.push(L);
|
||||
lua_setfield(L, -2, "corpse");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_item_equip(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "slot_id");
|
||||
}
|
||||
|
||||
void handle_item_augment(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "aug");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "slot_id");
|
||||
}
|
||||
|
||||
void handle_item_augment_insert(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "slot_id");
|
||||
}
|
||||
|
||||
void handle_item_augment_remove(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
Lua_ItemInst l_item(EQEmu::any_cast<EQEmu::ItemInstance*>(extra_pointers->at(0)));
|
||||
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
|
||||
l_item_o.push(L);
|
||||
lua_setfield(L, -2, "item");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "slot_id");
|
||||
|
||||
lua_pushboolean(L, *EQEmu::any_cast<bool*>(extra_pointers->at(1)));
|
||||
lua_setfield(L, -2, "destroyed");
|
||||
}
|
||||
|
||||
void handle_item_null(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
}
|
||||
|
||||
//Spell
|
||||
void handle_spell_effect(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(npc) {
|
||||
Lua_Mob l_npc(npc);
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
} else if(client) {
|
||||
Lua_Mob l_client(client);
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
} else {
|
||||
Lua_Mob l_mob(nullptr);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
}
|
||||
|
||||
lua_setfield(L, -2, "target");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(0)));
|
||||
lua_setfield(L, -2, "buff_slot");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "caster_id");
|
||||
}
|
||||
|
||||
void handle_spell_tic(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(npc) {
|
||||
Lua_Mob l_npc(npc);
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
} else if(client) {
|
||||
Lua_Mob l_client(client);
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
} else {
|
||||
Lua_Mob l_mob(nullptr);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
}
|
||||
|
||||
lua_setfield(L, -2, "target");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(0)));
|
||||
lua_setfield(L, -2, "tics_remaining");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<uint8*>(extra_pointers->at(1)));
|
||||
lua_setfield(L, -2, "caster_level");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<int*>(extra_pointers->at(2)));
|
||||
lua_setfield(L, -2, "buff_slot");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "caster_id");
|
||||
}
|
||||
|
||||
void handle_spell_fade(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(npc) {
|
||||
Lua_Mob l_npc(npc);
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
} else if(client) {
|
||||
Lua_Mob l_client(client);
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
} else {
|
||||
Lua_Mob l_mob(nullptr);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
}
|
||||
|
||||
lua_setfield(L, -2, "target");
|
||||
|
||||
lua_pushinteger(L, extra_data);
|
||||
lua_setfield(L, -2, "buff_slot");
|
||||
|
||||
lua_pushinteger(L, *EQEmu::any_cast<uint16*>(extra_pointers->at(0)));
|
||||
lua_setfield(L, -2, "caster_id");
|
||||
}
|
||||
|
||||
void handle_translocate_finish(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if(npc) {
|
||||
Lua_Mob l_npc(npc);
|
||||
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
|
||||
l_npc_o.push(L);
|
||||
} else if(client) {
|
||||
Lua_Mob l_client(client);
|
||||
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
} else {
|
||||
Lua_Mob l_mob(nullptr);
|
||||
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||
l_mob_o.push(L);
|
||||
}
|
||||
|
||||
lua_setfield(L, -2, "target");
|
||||
}
|
||||
|
||||
void handle_spell_null(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
}
|
||||
|
||||
void handle_encounter_timer(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
lua_pushstring(L, data.c_str());
|
||||
lua_setfield(L, -2, "timer");
|
||||
}
|
||||
|
||||
void handle_encounter_load(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if (encounter) {
|
||||
Lua_Encounter l_enc(encounter);
|
||||
luabind::adl::object l_enc_o = luabind::adl::object(L, l_enc);
|
||||
l_enc_o.push(L);
|
||||
lua_setfield(L, -2, "encounter");
|
||||
}
|
||||
if (extra_pointers) {
|
||||
std::string *str = EQEmu::any_cast<std::string*>(extra_pointers->at(0));
|
||||
lua_pushstring(L, str->c_str());
|
||||
lua_setfield(L, -2, "data");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_encounter_unload(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
if (extra_pointers) {
|
||||
std::string *str = EQEmu::any_cast<std::string*>(extra_pointers->at(0));
|
||||
lua_pushstring(L, str->c_str());
|
||||
lua_setfield(L, -2, "data");
|
||||
}
|
||||
}
|
||||
|
||||
void handle_encounter_null(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers) {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,145 @@
|
||||
#ifndef _EQE_LUA_PARSER_EVENTS_H
|
||||
#define _EQE_LUA_PARSER_EVENTS_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
typedef void(*NPCArgumentHandler)(QuestInterface*, lua_State*, NPC*, Mob*, std::string, uint32, std::vector<EQEmu::Any>*);
|
||||
typedef void(*PlayerArgumentHandler)(QuestInterface*, lua_State*, Client*, std::string, uint32, std::vector<EQEmu::Any>*);
|
||||
typedef void(*ItemArgumentHandler)(QuestInterface*, lua_State*, Client*, EQEmu::ItemInstance*, Mob*, std::string, uint32, std::vector<EQEmu::Any>*);
|
||||
typedef void(*SpellArgumentHandler)(QuestInterface*, lua_State*, NPC*, Client*, uint32, uint32, std::vector<EQEmu::Any>*);
|
||||
typedef void(*EncounterArgumentHandler)(QuestInterface*, lua_State*, Encounter* encounter, std::string, uint32, std::vector<EQEmu::Any>*);
|
||||
|
||||
//NPC
|
||||
void handle_npc_event_say(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_event_hp(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_single_mob(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_single_client(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_single_npc(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_task_accepted(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_popup(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_waypoint(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_hate(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_signal(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_timer(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_death(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_cast(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_area(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_npc_null(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
//Player
|
||||
void handle_player_say(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_environmental_damage(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_fish_forage_success(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_click_object(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_click_door(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_signal(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_popup_response(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_pick_up(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_cast(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_task_fail(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_zone(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_duel_win(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_duel_loss(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_loot(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_task_stage_complete(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_task_update(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_command(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_combine(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_feign(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_area(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_respawn(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_packet(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_null(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_player_use_skill(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
//Item
|
||||
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_timer(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_proc(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_loot(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_equip(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_augment(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_augment_insert(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_augment_remove(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_item_null(QuestInterface *parse, lua_State* L, Client* client, EQEmu::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
//Spell
|
||||
void handle_spell_effect(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_spell_tic(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_spell_fade(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_translocate_finish(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_spell_null(QuestInterface *parse, lua_State* L, NPC* npc, Client* client, uint32 spell_id, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
|
||||
//Encounter
|
||||
void handle_encounter_timer(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_encounter_load(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_encounter_unload(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
void handle_encounter_null(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
|
||||
std::vector<EQEmu::Any> *extra_pointers);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,164 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <luabind/object.hpp>
|
||||
|
||||
#include "raid.h"
|
||||
#include "masterentity.h"
|
||||
#include "lua_raid.h"
|
||||
#include "lua_entity.h"
|
||||
#include "lua_mob.h"
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
|
||||
bool Lua_Raid::IsRaidMember(const char *name) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsRaidMember(name);
|
||||
}
|
||||
|
||||
void Lua_Raid::CastGroupSpell(Lua_Mob caster, int spell_id, uint32 group_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->CastGroupSpell(caster, spell_id, group_id);
|
||||
}
|
||||
|
||||
int Lua_Raid::GroupCount(uint32 group_id) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GroupCount(group_id);
|
||||
}
|
||||
|
||||
int Lua_Raid::RaidCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->RaidCount();
|
||||
}
|
||||
|
||||
int Lua_Raid::GetGroup(const char *c) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetGroup(c);
|
||||
}
|
||||
|
||||
int Lua_Raid::GetGroup(Lua_Client c) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetGroup(c);
|
||||
}
|
||||
|
||||
void Lua_Raid::SplitExp(uint32 exp, Lua_Mob other) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitExp(exp, other);
|
||||
}
|
||||
|
||||
uint32 Lua_Raid::GetTotalRaidDamage(Lua_Mob other) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetTotalRaidDamage(other);
|
||||
}
|
||||
|
||||
void Lua_Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitMoney(copper, silver, gold, platinum);
|
||||
}
|
||||
|
||||
void Lua_Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SplitMoney(copper, silver, gold, platinum, splitter);
|
||||
}
|
||||
|
||||
void Lua_Raid::BalanceHP(int penalty, uint32 group_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->BalanceHP(penalty, group_id);
|
||||
}
|
||||
|
||||
bool Lua_Raid::IsLeader(const char *c) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsLeader(c);
|
||||
}
|
||||
|
||||
bool Lua_Raid::IsLeader(Lua_Client c) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsLeader(c);
|
||||
}
|
||||
|
||||
bool Lua_Raid::IsGroupLeader(const char *name) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsGroupLeader(name);
|
||||
}
|
||||
|
||||
int Lua_Raid::GetHighestLevel() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetHighestLevel();
|
||||
}
|
||||
|
||||
int Lua_Raid::GetLowestLevel() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetLowestLevel();
|
||||
}
|
||||
|
||||
Lua_Client Lua_Raid::GetClientByIndex(int index) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return self->GetClientByIndex(index);
|
||||
}
|
||||
|
||||
void Lua_Raid::TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h, uint32 group_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->TeleportGroup(sender, zone_id, instance_id, x, y, z, h, group_id);
|
||||
}
|
||||
|
||||
void Lua_Raid::TeleportRaid(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->TeleportRaid(sender, zone_id, instance_id, x, y, z, h);
|
||||
}
|
||||
|
||||
int Lua_Raid::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
Lua_Client Lua_Raid::GetMember(int index) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
|
||||
if(index >= 72 || index < 0) {
|
||||
return Lua_Client();
|
||||
}
|
||||
|
||||
return self->members[index].member;
|
||||
}
|
||||
|
||||
int Lua_Raid::GetGroupNumber(int index) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(index >= 72 || index < 0 || self->members[index].GroupNumber == RAID_GROUPLESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return self->members[index].GroupNumber;
|
||||
}
|
||||
|
||||
|
||||
luabind::scope lua_register_raid() {
|
||||
return luabind::class_<Lua_Raid>("Raid")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Raid::Null)
|
||||
.property("valid", &Lua_Raid::Valid)
|
||||
.def("IsRaidMember", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsRaidMember)
|
||||
.def("CastGroupSpell", (void(Lua_Raid::*)(Lua_Mob,int,uint32))&Lua_Raid::CastGroupSpell)
|
||||
.def("GroupCount", (int(Lua_Raid::*)(uint32))&Lua_Raid::GroupCount)
|
||||
.def("RaidCount", (int(Lua_Raid::*)(void))&Lua_Raid::RaidCount)
|
||||
.def("GetGroup", (int(Lua_Raid::*)(const char*))&Lua_Raid::GetGroup)
|
||||
.def("GetGroup", (int(Lua_Raid::*)(Lua_Client))&Lua_Raid::GetGroup)
|
||||
.def("SplitExp", (void(Lua_Raid::*)(uint32,Lua_Mob))&Lua_Raid::SplitExp)
|
||||
.def("GetTotalRaidDamage", (uint32(Lua_Raid::*)(Lua_Mob))&Lua_Raid::GetTotalRaidDamage)
|
||||
.def("SplitMoney", (void(Lua_Raid::*)(uint32,uint32,uint32,uint32))&Lua_Raid::SplitMoney)
|
||||
.def("SplitMoney", (void(Lua_Raid::*)(uint32,uint32,uint32,uint32,Lua_Client))&Lua_Raid::SplitMoney)
|
||||
.def("BalanceHP", (void(Lua_Raid::*)(int,uint32))&Lua_Raid::BalanceHP)
|
||||
.def("IsLeader", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsLeader)
|
||||
.def("IsGroupLeader", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsGroupLeader)
|
||||
.def("GetHighestLevel", (int(Lua_Raid::*)(void))&Lua_Raid::GetHighestLevel)
|
||||
.def("GetLowestLevel", (int(Lua_Raid::*)(void))&Lua_Raid::GetLowestLevel)
|
||||
.def("GetClientByIndex", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetClientByIndex)
|
||||
.def("TeleportGroup", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float,uint32))&Lua_Raid::TeleportGroup)
|
||||
.def("TeleportRaid", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float))&Lua_Raid::TeleportRaid)
|
||||
.def("GetID", (int(Lua_Raid::*)(void))&Lua_Raid::GetID)
|
||||
.def("GetMember", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetMember)
|
||||
.def("GetGroupNumber", (int(Lua_Raid::*)(int))&Lua_Raid::GetGroupNumber);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef EQEMU_LUA_RAID_H
|
||||
#define EQEMU_LUA_RAID_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Raid;
|
||||
class Lua_Client;
|
||||
class Lua_Mob;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_raid();
|
||||
|
||||
class Lua_Raid : public Lua_Ptr<Raid>
|
||||
{
|
||||
typedef Raid NativeType;
|
||||
public:
|
||||
Lua_Raid() : Lua_Ptr(nullptr) { }
|
||||
Lua_Raid(Raid *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Raid() { }
|
||||
|
||||
operator Raid*() {
|
||||
return reinterpret_cast<Raid*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
bool IsRaidMember(const char *name);
|
||||
void CastGroupSpell(Lua_Mob caster, int spell_id, uint32 group_id);
|
||||
int GroupCount(uint32 group_id);
|
||||
int RaidCount();
|
||||
int GetGroup(const char *c);
|
||||
int GetGroup(Lua_Client c);
|
||||
void SplitExp(uint32 exp, Lua_Mob other);
|
||||
uint32 GetTotalRaidDamage(Lua_Mob other);
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
|
||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter);
|
||||
void BalanceHP(int penalty, uint32 group_id);
|
||||
bool IsLeader(const char *c);
|
||||
bool IsLeader(Lua_Client c);
|
||||
bool IsGroupLeader(const char *name);
|
||||
int GetHighestLevel();
|
||||
int GetLowestLevel();
|
||||
Lua_Client GetClientByIndex(int index);
|
||||
void TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h, uint32 group_id);
|
||||
void TeleportRaid(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h);
|
||||
int GetID();
|
||||
Lua_Client GetMember(int index);
|
||||
int GetGroupNumber(int index);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,174 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "spawn2.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_spawn.h"
|
||||
|
||||
void Lua_Spawn::LoadGrid() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->LoadGrid();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Enable() {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->Enable();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Disable() {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->Disable();
|
||||
}
|
||||
|
||||
bool Lua_Spawn::Enabled() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->Enabled();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Reset() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Reset();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Depop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Depop();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Repop() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Repop();
|
||||
}
|
||||
|
||||
void Lua_Spawn::Repop(uint32 delay) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->Repop(delay);
|
||||
}
|
||||
|
||||
void Lua_Spawn::ForceDespawn() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ForceDespawn();
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
float Lua_Spawn::GetX() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetX();
|
||||
}
|
||||
|
||||
float Lua_Spawn::GetY() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetY();
|
||||
}
|
||||
|
||||
float Lua_Spawn::GetZ() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetZ();
|
||||
}
|
||||
|
||||
float Lua_Spawn::GetHeading() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->GetHeading();
|
||||
}
|
||||
|
||||
void Lua_Spawn::SetRespawnTimer(uint32 newrespawntime) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetRespawnTimer(newrespawntime);
|
||||
}
|
||||
|
||||
void Lua_Spawn::SetVariance(uint32 newvariance) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetVariance(newvariance);
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::GetVariance() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetVariance();
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::RespawnTimer() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->RespawnTimer();
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::SpawnGroupID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->SpawnGroupID();
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::CurrentNPCID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CurrentNPCID();
|
||||
}
|
||||
|
||||
void Lua_Spawn::SetCurrentNPCID(uint32 nid) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCurrentNPCID(nid);
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::GetSpawnCondition() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpawnCondition();
|
||||
}
|
||||
|
||||
bool Lua_Spawn::NPCPointerValid() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->NPCPointerValid();
|
||||
}
|
||||
|
||||
void Lua_Spawn::SetNPCPointer(Lua_NPC n) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetNPCPointer(n);
|
||||
}
|
||||
|
||||
void Lua_Spawn::SetTimer(uint32 duration) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetTimer(duration);
|
||||
}
|
||||
|
||||
uint32 Lua_Spawn::GetKillCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetKillCount();
|
||||
}
|
||||
|
||||
|
||||
luabind::scope lua_register_spawn() {
|
||||
return luabind::class_<Lua_Spawn>("Spawn")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Spawn::Null)
|
||||
.property("valid", &Lua_Spawn::Valid)
|
||||
.def("LoadGrid", (void(Lua_Spawn::*)(void))&Lua_Spawn::LoadGrid)
|
||||
.def("Enable", (void(Lua_Spawn::*)(void))&Lua_Spawn::Enable)
|
||||
.def("Disable", (void(Lua_Spawn::*)(void))&Lua_Spawn::Disable)
|
||||
.def("Enabled", (bool(Lua_Spawn::*)(void))&Lua_Spawn::Enabled)
|
||||
.def("Reset", (void(Lua_Spawn::*)(void))&Lua_Spawn::Reset)
|
||||
.def("Depop", (void(Lua_Spawn::*)(void))&Lua_Spawn::Depop)
|
||||
.def("Repop", (void(Lua_Spawn::*)(void))&Lua_Spawn::Repop)
|
||||
.def("Repop", (void(Lua_Spawn::*)(uint32))&Lua_Spawn::Repop)
|
||||
.def("ForceDespawn", (void(Lua_Spawn::*)(void))&Lua_Spawn::ForceDespawn)
|
||||
.def("GetID", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::GetID)
|
||||
.def("GetX", (float(Lua_Spawn::*)(void))&Lua_Spawn::GetX)
|
||||
.def("GetY", (float(Lua_Spawn::*)(void))&Lua_Spawn::GetY)
|
||||
.def("GetZ", (float(Lua_Spawn::*)(void))&Lua_Spawn::GetZ)
|
||||
.def("GetHeading", (float(Lua_Spawn::*)(void))&Lua_Spawn::GetHeading)
|
||||
.def("SetRespawnTimer", (void(Lua_Spawn::*)(uint32))&Lua_Spawn::SetRespawnTimer)
|
||||
.def("SetVariance", (void(Lua_Spawn::*)(uint32))&Lua_Spawn::SetVariance)
|
||||
.def("GetVariance", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::GetVariance)
|
||||
.def("RespawnTimer", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::RespawnTimer)
|
||||
.def("SpawnGroupID", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::SpawnGroupID)
|
||||
.def("CurrentNPCID", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::CurrentNPCID)
|
||||
.def("SetCurrentNPCID", (void(Lua_Spawn::*)(uint32))&Lua_Spawn::SetCurrentNPCID)
|
||||
.def("GetSpawnCondition", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::GetSpawnCondition)
|
||||
.def("NPCPointerValid", (bool(Lua_Spawn::*)(void))&Lua_Spawn::NPCPointerValid)
|
||||
.def("SetNPCPointer", (void(Lua_Spawn::*)(Lua_NPC))&Lua_Spawn::SetNPCPointer)
|
||||
.def("SetTimer", (void(Lua_Spawn::*)(uint32))&Lua_Spawn::SetTimer)
|
||||
.def("GetKillCount", (uint32(Lua_Spawn::*)(void))&Lua_Spawn::GetKillCount);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef EQEMU_LUA_SPAWN_H
|
||||
#define EQEMU_LUA_SPAWN_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class Spawn2;
|
||||
class Lua_NPC;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_spawn();
|
||||
|
||||
class Lua_Spawn : public Lua_Ptr<Spawn2>
|
||||
{
|
||||
typedef Spawn2 NativeType;
|
||||
public:
|
||||
Lua_Spawn() : Lua_Ptr(nullptr) { }
|
||||
Lua_Spawn(Spawn2 *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Spawn() { }
|
||||
|
||||
operator Spawn2*() {
|
||||
return reinterpret_cast<Spawn2*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
void LoadGrid();
|
||||
void Enable();
|
||||
void Disable();
|
||||
bool Enabled();
|
||||
void Reset();
|
||||
void Depop();
|
||||
void Repop();
|
||||
void Repop(uint32 delay);
|
||||
void ForceDespawn();
|
||||
uint32 GetID();
|
||||
float GetX();
|
||||
float GetY();
|
||||
float GetZ();
|
||||
float GetHeading();
|
||||
void SetRespawnTimer(uint32 newrespawntime);
|
||||
void SetVariance(uint32 newvariance);
|
||||
uint32 GetVariance();
|
||||
uint32 RespawnTimer();
|
||||
uint32 SpawnGroupID();
|
||||
uint32 CurrentNPCID();
|
||||
void SetCurrentNPCID(uint32 nid);
|
||||
uint32 GetSpawnCondition();
|
||||
bool NPCPointerValid();
|
||||
void SetNPCPointer(Lua_NPC n);
|
||||
void SetTimer(uint32 duration);
|
||||
uint32 GetKillCount();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,567 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
#include "../../common/spdat.h"
|
||||
#include "lua_spell.h"
|
||||
|
||||
Lua_Spell::Lua_Spell(int id) {
|
||||
if(IsValidSpell(id)) {
|
||||
SetLuaPtrData(&spells[id]);
|
||||
} else {
|
||||
SetLuaPtrData(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int Lua_Spell::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->id;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetName() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->name;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetPlayer1() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->player_1;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetTeleportZone() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->teleport_zone;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetYouCast() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->you_cast;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetOtherCasts() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->other_casts;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetCastOnYou() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->cast_on_you;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetCastOnOther() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->cast_on_other;
|
||||
}
|
||||
|
||||
const char *Lua_Spell::GetSpellFades() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->spell_fades;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetRange() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->range;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetAoeRange() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->aoerange;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetPushBack() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->pushback;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetPushUp() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->pushup;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetCastTime() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->cast_time;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetRecoveryTime() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->recovery_time;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetRecastTime() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->recast_time;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetBuffdurationFormula() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->buffdurationformula;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetBuffDuration() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->buffduration;
|
||||
}
|
||||
|
||||
uint32 Lua_Spell::GetAEDuration() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->AEDuration;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetMana() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->mana;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetBase(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 12 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->base[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetBase2(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 12 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->base2[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetMax(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 12 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->max[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetComponents(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 4 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->components[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetComponentCounts(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 4 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->component_counts[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetNoexpendReagent(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 4 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->NoexpendReagent[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetFormula(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 12 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->formula[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetGoodEffect() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->goodEffect;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetActivated() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->Activated;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetResistType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->resisttype;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEffectID(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 12 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->effectid[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetTargetType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->targettype;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetBaseDiff() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->basediff;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetSkill() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->skill;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetZoneType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->zonetype;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEnvironmentType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->EnvironmentType;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetTimeOfDay() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->TimeOfDay;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetClasses(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 16 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->classes[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetCastingAnim() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CastingAnim;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetSpellAffectIndex() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->SpellAffectIndex;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetDisallowSit() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->disallow_sit;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetDeities(int i) {
|
||||
Lua_Safe_Call_Int();
|
||||
|
||||
if(i >= 16 || i < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->deities[i];
|
||||
}
|
||||
|
||||
int Lua_Spell::GetUninterruptable() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->uninterruptable;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetResistDiff() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->ResistDiff;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetRecourseLink() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->RecourseLink;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetShortBuffBox() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->short_buff_box;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetDescNum() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->descnum;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEffectDescNum() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->effectdescnum;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetBonusHate() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->bonushate;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEndurCost() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->EndurCost;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEndurTimerIndex() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->EndurUpkeep;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetHateAdded() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->HateAdded;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetEndurUpkeep() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->EndurUpkeep;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetNumHits() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->numhits;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPVPResistBase() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->pvpresistbase;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPVPResistCalc() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->pvpresistcalc;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPVPResistCap() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->pvpresistcap;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetSpellCategory() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->spell_category;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetCanMGB() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->can_mgb;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetDispelFlag() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->dispel_flag;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetMinResist() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->MinResist;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetMaxResist() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->MaxResist;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetViralTargets() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->viral_targets;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetViralTimer() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->viral_timer;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetNimbusEffect() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->NimbusEffect;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetDirectionalStart() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->directional_start;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetDirectionalEnd() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->directional_end;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetSpellGroup() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->spellgroup;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPowerfulFlag() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->no_resist;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetCastRestriction() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->CastRestriction;
|
||||
}
|
||||
|
||||
bool Lua_Spell::GetAllowRest() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->AllowRest;
|
||||
}
|
||||
|
||||
bool Lua_Spell::GetInCombat() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->InCombat;
|
||||
}
|
||||
|
||||
bool Lua_Spell::GetOutOfCombat() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->OutofCombat;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetAEMaxTargets() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->aemaxtargets;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetMaxTargets() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->no_heal_damage_item_mod;
|
||||
}
|
||||
|
||||
bool Lua_Spell::GetPersistDeath() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->persistdeath;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetMinDist() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->min_dist;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetMinDistMod() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->min_dist_mod;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetMaxDist() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->max_dist;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetMaxDistMod() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->max_dist_mod;
|
||||
}
|
||||
|
||||
float Lua_Spell::GetMinRange() {
|
||||
Lua_Safe_Call_Real();
|
||||
return self->min_range;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetDamageShieldType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->DamageShieldType;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_spell() {
|
||||
return luabind::class_<Lua_Spell>("Spell")
|
||||
.def(luabind::constructor<>())
|
||||
.def(luabind::constructor<int>())
|
||||
.property("null", &Lua_Spell::Null)
|
||||
.property("valid", &Lua_Spell::Valid)
|
||||
.def("ID", &Lua_Spell::GetID)
|
||||
.def("Name", &Lua_Spell::GetName)
|
||||
.def("Player1", &Lua_Spell::GetPlayer1)
|
||||
.def("TeleportZone", &Lua_Spell::GetTeleportZone)
|
||||
.def("YouCast", &Lua_Spell::GetYouCast)
|
||||
.def("OtherCasts", &Lua_Spell::GetOtherCasts)
|
||||
.def("CastOnYou", &Lua_Spell::GetCastOnYou)
|
||||
.def("CastOnOther", &Lua_Spell::GetCastOnOther)
|
||||
.def("SpellFades", &Lua_Spell::GetSpellFades)
|
||||
.def("Range", &Lua_Spell::GetRange)
|
||||
.def("AoeRange", &Lua_Spell::GetAoeRange)
|
||||
.def("PushBack", &Lua_Spell::GetPushBack)
|
||||
.def("PushUp", &Lua_Spell::GetPushUp)
|
||||
.def("CastTime", &Lua_Spell::GetCastTime)
|
||||
.def("RecoveryTime", &Lua_Spell::GetRecoveryTime)
|
||||
.def("RecastTime", &Lua_Spell::GetRecastTime)
|
||||
.def("BuffdurationFormula", &Lua_Spell::GetBuffdurationFormula)
|
||||
.def("BuffDuration", &Lua_Spell::GetBuffDuration)
|
||||
.def("AEDuration", &Lua_Spell::GetAEDuration)
|
||||
.def("Mana", &Lua_Spell::GetMana)
|
||||
.def("Base", &Lua_Spell::GetBase)
|
||||
.def("Base2", &Lua_Spell::GetBase2)
|
||||
.def("Max", &Lua_Spell::GetMax)
|
||||
.def("Components", &Lua_Spell::GetComponents)
|
||||
.def("ComponentCounts", &Lua_Spell::GetComponentCounts)
|
||||
.def("NoexpendReagent", &Lua_Spell::GetNoexpendReagent)
|
||||
.def("Formula", &Lua_Spell::GetFormula)
|
||||
.def("GoodEffect", &Lua_Spell::GetGoodEffect)
|
||||
.def("Activated", &Lua_Spell::GetActivated)
|
||||
.def("ResistType", &Lua_Spell::GetResistType)
|
||||
.def("EffectID", &Lua_Spell::GetEffectID)
|
||||
.def("TargetType", &Lua_Spell::GetTargetType)
|
||||
.def("BaseDiff", &Lua_Spell::GetBaseDiff)
|
||||
.def("Skill", &Lua_Spell::GetSkill)
|
||||
.def("ZoneType", &Lua_Spell::GetZoneType)
|
||||
.def("EnvironmentType", &Lua_Spell::GetEnvironmentType)
|
||||
.def("TimeOfDay", &Lua_Spell::GetTimeOfDay)
|
||||
.def("Classes", &Lua_Spell::GetClasses)
|
||||
.def("CastingAnim", &Lua_Spell::GetCastingAnim)
|
||||
.def("SpellAffectIndex", &Lua_Spell::GetSpellAffectIndex)
|
||||
.def("DisallowSit", &Lua_Spell::GetDisallowSit)
|
||||
.def("Deities", &Lua_Spell::GetDeities)
|
||||
.def("Uninterruptable", &Lua_Spell::GetUninterruptable)
|
||||
.def("ResistDiff", &Lua_Spell::GetResistDiff)
|
||||
.def("RecourseLink", &Lua_Spell::GetRecourseLink)
|
||||
.def("ShortBuffBox", &Lua_Spell::GetShortBuffBox)
|
||||
.def("DescNum", &Lua_Spell::GetDescNum)
|
||||
.def("EffectDescNum", &Lua_Spell::GetEffectDescNum)
|
||||
.def("BonusHate", &Lua_Spell::GetBonusHate)
|
||||
.def("EndurCost", &Lua_Spell::GetEndurCost)
|
||||
.def("EndurTimerIndex", &Lua_Spell::GetEndurTimerIndex)
|
||||
.def("HateAdded", &Lua_Spell::GetHateAdded)
|
||||
.def("EndurUpkeep", &Lua_Spell::GetEndurUpkeep)
|
||||
.def("NumHits", &Lua_Spell::GetNumHits)
|
||||
.def("PVPResistBase", &Lua_Spell::GetPVPResistBase)
|
||||
.def("PVPResistCalc", &Lua_Spell::GetPVPResistCalc)
|
||||
.def("PVPResistCap", &Lua_Spell::GetPVPResistCap)
|
||||
.def("SpellCategory", &Lua_Spell::GetSpellCategory)
|
||||
.def("CanMGB", &Lua_Spell::GetCanMGB)
|
||||
.def("DispelFlag", &Lua_Spell::GetDispelFlag)
|
||||
.def("MinResist", &Lua_Spell::GetMinResist)
|
||||
.def("MaxResist", &Lua_Spell::GetMaxResist)
|
||||
.def("ViralTargets", &Lua_Spell::GetViralTargets)
|
||||
.def("ViralTimer", &Lua_Spell::GetViralTimer)
|
||||
.def("NimbusEffect", &Lua_Spell::GetNimbusEffect)
|
||||
.def("DirectionalStart", &Lua_Spell::GetDirectionalStart)
|
||||
.def("DirectionalEnd", &Lua_Spell::GetDirectionalEnd)
|
||||
.def("SpellGroup", &Lua_Spell::GetSpellGroup)
|
||||
.def("PowerfulFlag", &Lua_Spell::GetPowerfulFlag)
|
||||
.def("CastRestriction", &Lua_Spell::GetCastRestriction)
|
||||
.def("AllowRest", &Lua_Spell::GetAllowRest)
|
||||
.def("InCombat", &Lua_Spell::GetInCombat)
|
||||
.def("OutOfCombat", &Lua_Spell::GetOutOfCombat)
|
||||
.def("AEMaxTargets", &Lua_Spell::GetAEMaxTargets)
|
||||
.def("MaxTargets", &Lua_Spell::GetMaxTargets)
|
||||
.def("PersistDeath", &Lua_Spell::GetPersistDeath)
|
||||
.def("MinDist", &Lua_Spell::GetMinDist)
|
||||
.def("MinDistMod", &Lua_Spell::GetMinDistMod)
|
||||
.def("MaxDist", &Lua_Spell::GetMaxDist)
|
||||
.def("MaxDistMod", &Lua_Spell::GetMaxDistMod)
|
||||
.def("MinRange", &Lua_Spell::GetMinRange)
|
||||
.def("DamageShieldType", &Lua_Spell::GetDamageShieldType);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,113 @@
|
||||
#ifndef EQEMU_LUA_SPELL_H
|
||||
#define EQEMU_LUA_SPELL_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
|
||||
struct SPDat_Spell_Struct;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_spell();
|
||||
|
||||
class Lua_Spell : public Lua_Ptr<const SPDat_Spell_Struct>
|
||||
{
|
||||
typedef const SPDat_Spell_Struct NativeType;
|
||||
public:
|
||||
Lua_Spell(int id);
|
||||
Lua_Spell() : Lua_Ptr(nullptr) { }
|
||||
Lua_Spell(const SPDat_Spell_Struct *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Spell() { }
|
||||
|
||||
operator const SPDat_Spell_Struct*() {
|
||||
return reinterpret_cast<const SPDat_Spell_Struct*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
int GetID();
|
||||
const char *GetName();
|
||||
const char *GetPlayer1();
|
||||
const char *GetTeleportZone();
|
||||
const char *GetYouCast();
|
||||
const char *GetOtherCasts();
|
||||
const char *GetCastOnYou();
|
||||
const char *GetCastOnOther();
|
||||
const char *GetSpellFades();
|
||||
float GetRange();
|
||||
float GetAoeRange();
|
||||
float GetPushBack();
|
||||
float GetPushUp();
|
||||
uint32 GetCastTime();
|
||||
uint32 GetRecoveryTime();
|
||||
uint32 GetRecastTime();
|
||||
uint32 GetBuffdurationFormula();
|
||||
uint32 GetBuffDuration();
|
||||
uint32 GetAEDuration();
|
||||
int GetMana();
|
||||
int GetBase(int i);
|
||||
int GetBase2(int i);
|
||||
int GetMax(int i);
|
||||
int GetComponents(int i);
|
||||
int GetComponentCounts(int i);
|
||||
int GetNoexpendReagent(int i);
|
||||
int GetFormula(int i);
|
||||
int GetGoodEffect();
|
||||
int GetActivated();
|
||||
int GetResistType();
|
||||
int GetEffectID(int i);
|
||||
int GetTargetType();
|
||||
int GetBaseDiff();
|
||||
int GetSkill();
|
||||
int GetZoneType();
|
||||
int GetEnvironmentType();
|
||||
int GetTimeOfDay();
|
||||
int GetClasses(int i);
|
||||
int GetCastingAnim();
|
||||
int GetSpellAffectIndex();
|
||||
int GetDisallowSit();
|
||||
int GetDeities(int i);
|
||||
int GetUninterruptable();
|
||||
int GetResistDiff();
|
||||
int GetRecourseLink();
|
||||
int GetShortBuffBox();
|
||||
int GetDescNum();
|
||||
int GetEffectDescNum();
|
||||
int GetBonusHate();
|
||||
int GetEndurCost();
|
||||
int GetEndurTimerIndex();
|
||||
int GetHateAdded();
|
||||
int GetEndurUpkeep();
|
||||
int GetNumHits();
|
||||
int GetPVPResistBase();
|
||||
int GetPVPResistCalc();
|
||||
int GetPVPResistCap();
|
||||
int GetSpellCategory();
|
||||
int GetCanMGB();
|
||||
int GetDispelFlag();
|
||||
int GetMinResist();
|
||||
int GetMaxResist();
|
||||
int GetViralTargets();
|
||||
int GetViralTimer();
|
||||
int GetNimbusEffect();
|
||||
float GetDirectionalStart();
|
||||
float GetDirectionalEnd();
|
||||
int GetSpellGroup();
|
||||
int GetPowerfulFlag();
|
||||
int GetCastRestriction();
|
||||
bool GetAllowRest();
|
||||
bool GetInCombat();
|
||||
bool GetOutOfCombat();
|
||||
int GetAEMaxTargets();
|
||||
int GetMaxTargets();
|
||||
bool GetPersistDeath();
|
||||
float GetMinDist();
|
||||
float GetMinDistMod();
|
||||
float GetMaxDist();
|
||||
float GetMaxDistMod();
|
||||
float GetMinRange();
|
||||
int GetDamageShieldType();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,285 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua_ptr.h"
|
||||
#include "common.h"
|
||||
|
||||
struct StatBonuses;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_stat_bonuses();
|
||||
|
||||
class Lua_StatBonuses : public Lua_Ptr<StatBonuses>
|
||||
{
|
||||
typedef StatBonuses NativeType;
|
||||
public:
|
||||
Lua_StatBonuses() : Lua_Ptr(nullptr) { }
|
||||
Lua_StatBonuses(StatBonuses *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_StatBonuses() { }
|
||||
|
||||
operator StatBonuses*() {
|
||||
return reinterpret_cast<StatBonuses*>(GetLuaPtrData());
|
||||
}
|
||||
|
||||
int32 GetAC() const;
|
||||
int32 GetHP() const;
|
||||
int32 GetHPRegen() const;
|
||||
int32 GetMaxHP() const;
|
||||
int32 GetManaRegen() const;
|
||||
int32 GetEnduranceRegen() const;
|
||||
int32 GetMana() const;
|
||||
int32 GetEndurance() const;
|
||||
int32 GetATK() const;
|
||||
int32 GetSTR() const;
|
||||
int32 GetSTRCapMod() const;
|
||||
int32 GetHeroicSTR() const;
|
||||
int32 GetSTA() const;
|
||||
int32 GetSTACapMod() const;
|
||||
int32 GetHeroicSTA() const;
|
||||
int32 GetDEX() const;
|
||||
int32 GetDEXCapMod() const;
|
||||
int32 GetHeroicDEX() const;
|
||||
int32 GetAGI() const;
|
||||
int32 GetAGICapMod() const;
|
||||
int32 GetHeroicAGI() const;
|
||||
int32 GetINT() const;
|
||||
int32 GetINTCapMod() const;
|
||||
int32 GetHeroicINT() const;
|
||||
int32 GetWIS() const;
|
||||
int32 GetWISCapMod() const;
|
||||
int32 GetHeroicWIS() const;
|
||||
int32 GetCHA() const;
|
||||
int32 GetCHACapMod() const;
|
||||
int32 GetHeroicCHA() const;
|
||||
int32 GetMR() const;
|
||||
int32 GetMRCapMod() const;
|
||||
int32 GetHeroicMR() const;
|
||||
int32 GetFR() const;
|
||||
int32 GetFRCapMod() const;
|
||||
int32 GetHeroicFR() const;
|
||||
int32 GetCR() const;
|
||||
int32 GetCRCapMod() const;
|
||||
int32 GetHeroicCR() const;
|
||||
int32 GetPR() const;
|
||||
int32 GetPRCapMod() const;
|
||||
int32 GetHeroicPR() const;
|
||||
int32 GetDR() const;
|
||||
int32 GetDRCapMod() const;
|
||||
int32 GetHeroicDR() const;
|
||||
int32 GetCorrup() const;
|
||||
int32 GetCorrupCapMod() const;
|
||||
int32 GetHeroicCorrup() const;
|
||||
uint16 GetDamageShieldSpellID() const;
|
||||
int GetDamageShield() const;
|
||||
int GetDamageShieldType() const;
|
||||
int GetSpellDamageShield() const;
|
||||
int GetSpellShield() const;
|
||||
int GetReverseDamageShield() const;
|
||||
uint16 GetReverseDamageShieldSpellID() const;
|
||||
int GetReverseDamageShieldType() const;
|
||||
int Getmovementspeed() const;
|
||||
int32 Gethaste() const;
|
||||
int32 Gethastetype2() const;
|
||||
int32 Gethastetype3() const;
|
||||
int32 Getinhibitmelee() const;
|
||||
float GetAggroRange() const;
|
||||
float GetAssistRange() const;
|
||||
int32 Getskillmod(int idx) const;
|
||||
int32 Getskillmodmax(int idx) const;
|
||||
int Geteffective_casting_level() const;
|
||||
int Getreflect_chance() const;
|
||||
uint32 GetsingingMod() const;
|
||||
uint32 GetAmplification() const;
|
||||
uint32 GetbrassMod() const;
|
||||
uint32 GetpercussionMod() const;
|
||||
uint32 GetwindMod() const;
|
||||
uint32 GetstringedMod() const;
|
||||
uint32 GetsongModCap() const;
|
||||
int8 Gethatemod() const;
|
||||
int32 GetEnduranceReduction() const;
|
||||
int32 GetStrikeThrough() const;
|
||||
int32 GetMeleeMitigation() const;
|
||||
int32 GetMeleeMitigationEffect() const;
|
||||
int32 GetCriticalHitChance(int idx) const;
|
||||
int32 GetCriticalSpellChance() const;
|
||||
int32 GetSpellCritDmgIncrease() const;
|
||||
int32 GetSpellCritDmgIncNoStack() const;
|
||||
int32 GetDotCritDmgIncrease() const;
|
||||
int32 GetCriticalHealChance() const;
|
||||
int32 GetCriticalHealOverTime() const;
|
||||
int32 GetCriticalDoTChance() const;
|
||||
int32 GetCrippBlowChance() const;
|
||||
int32 GetAvoidMeleeChance() const;
|
||||
int32 GetAvoidMeleeChanceEffect() const;
|
||||
int32 GetRiposteChance() const;
|
||||
int32 GetDodgeChance() const;
|
||||
int32 GetParryChance() const;
|
||||
int32 GetDualWieldChance() const;
|
||||
int32 GetDoubleAttackChance() const;
|
||||
int32 GetTripleAttackChance() const;
|
||||
int32 GetDoubleRangedAttack() const;
|
||||
int32 GetResistSpellChance() const;
|
||||
int32 GetResistFearChance() const;
|
||||
bool GetFearless() const;
|
||||
bool GetIsFeared() const;
|
||||
bool GetIsBlind() const;
|
||||
int32 GetStunResist() const;
|
||||
int32 GetMeleeSkillCheck() const;
|
||||
uint8 GetMeleeSkillCheckSkill() const;
|
||||
int32 GetHitChance() const;
|
||||
int32 GetHitChanceEffect(int idx) const;
|
||||
int32 GetDamageModifier(int idx) const;
|
||||
int32 GetDamageModifier2(int idx) const;
|
||||
int32 GetMinDamageModifier(int idx) const;
|
||||
int32 GetProcChance() const;
|
||||
int32 GetProcChanceSPA() const;
|
||||
int32 GetExtraAttackChance() const;
|
||||
int32 GetDoTShielding() const;
|
||||
int32 GetFlurryChance() const;
|
||||
int32 GetHundredHands() const;
|
||||
int32 GetMeleeLifetap() const;
|
||||
int32 GetVampirism() const;
|
||||
int32 GetHealRate() const;
|
||||
int32 GetMaxHPChange() const;
|
||||
int32 GetHealAmt() const;
|
||||
int32 GetSpellDmg() const;
|
||||
int32 GetClairvoyance() const;
|
||||
int32 GetDSMitigation() const;
|
||||
int32 GetDSMitigationOffHand() const;
|
||||
int32 GetTwoHandBluntBlock() const;
|
||||
uint32 GetItemManaRegenCap() const;
|
||||
int32 GetGravityEffect() const;
|
||||
bool GetAntiGate() const;
|
||||
bool GetMagicWeapon() const;
|
||||
int32 GetIncreaseBlockChance() const;
|
||||
uint32 GetPersistantCasting() const;
|
||||
int GetXPRateMod() const;
|
||||
bool GetBlockNextSpell() const;
|
||||
bool GetImmuneToFlee() const;
|
||||
uint32 GetVoiceGraft() const;
|
||||
int32 GetSpellProcChance() const;
|
||||
int32 GetCharmBreakChance() const;
|
||||
int32 GetSongRange() const;
|
||||
uint32 GetHPToManaConvert() const;
|
||||
bool GetNegateEffects() const;
|
||||
bool GetTriggerMeleeThreshold() const;
|
||||
bool GetTriggerSpellThreshold() const;
|
||||
int32 GetShieldBlock() const;
|
||||
int32 GetBlockBehind() const;
|
||||
bool GetCriticalRegenDecay() const;
|
||||
bool GetCriticalHealDecay() const;
|
||||
bool GetCriticalDotDecay() const;
|
||||
bool GetDivineAura() const;
|
||||
bool GetDistanceRemoval() const;
|
||||
int32 GetFrenziedDevastation() const;
|
||||
bool GetNegateIfCombat() const;
|
||||
int8 GetScreech() const;
|
||||
int32 GetAlterNPCLevel() const;
|
||||
bool GetBerserkSPA() const;
|
||||
int32 GetMetabolism() const;
|
||||
bool GetSanctuary() const;
|
||||
int32 GetFactionModPct() const;
|
||||
uint32 GetPC_Pet_Flurry() const;
|
||||
int8 GetPackrat() const;
|
||||
uint8 GetBuffSlotIncrease() const;
|
||||
uint32 GetDelayDeath() const;
|
||||
int8 GetBaseMovementSpeed() const;
|
||||
uint8 GetIncreaseRunSpeedCap() const;
|
||||
int32 GetDoubleSpecialAttack() const;
|
||||
uint8 GetFrontalStunResist() const;
|
||||
int32 GetBindWound() const;
|
||||
int32 GetMaxBindWound() const;
|
||||
int32 GetChannelChanceSpells() const;
|
||||
int32 GetChannelChanceItems() const;
|
||||
uint8 GetSeeInvis() const;
|
||||
uint8 GetTripleBackstab() const;
|
||||
bool GetFrontalBackstabMinDmg() const;
|
||||
uint8 GetFrontalBackstabChance() const;
|
||||
uint8 GetConsumeProjectile() const;
|
||||
uint8 GetForageAdditionalItems() const;
|
||||
uint8 GetSalvageChance() const;
|
||||
uint32 GetArcheryDamageModifier() const;
|
||||
bool GetSecondaryDmgInc() const;
|
||||
uint32 GetGiveDoubleAttack() const;
|
||||
int32 GetPetCriticalHit() const;
|
||||
int32 GetPetAvoidance() const;
|
||||
int32 GetCombatStability() const;
|
||||
int32 GetDoubleRiposte() const;
|
||||
int32 GetAmbidexterity() const;
|
||||
int32 GetPetMaxHP() const;
|
||||
int32 GetPetFlurry() const;
|
||||
uint8 GetMasteryofPast() const;
|
||||
bool GetGivePetGroupTarget() const;
|
||||
int32 GetRootBreakChance() const;
|
||||
int32 GetUnfailingDivinity() const;
|
||||
int32 GetItemHPRegenCap() const;
|
||||
int32 GetOffhandRiposteFail() const;
|
||||
int32 GetItemATKCap() const;
|
||||
int32 GetShieldEquipDmgMod() const;
|
||||
bool GetTriggerOnValueAmount() const;
|
||||
int8 GetStunBashChance() const;
|
||||
int8 GetIncreaseChanceMemwipe() const;
|
||||
int8 GetCriticalMend() const;
|
||||
int32 GetImprovedReclaimEnergy() const;
|
||||
int32 GetPetMeleeMitigation() const;
|
||||
bool GetIllusionPersistence() const;
|
||||
uint16 Getextra_xtargets() const;
|
||||
bool GetShroudofStealth() const;
|
||||
uint16 GetReduceFallDamage() const;
|
||||
uint8 GetTradeSkillMastery() const;
|
||||
int16 GetNoBreakAESneak() const;
|
||||
int16 GetFeignedCastOnChance() const;
|
||||
int32 GetDivineSaveChance(int idx) const;
|
||||
uint32 GetDeathSave(int idx) const;
|
||||
int32 GetAccuracy(int idx) const;
|
||||
int16 GetSkillDmgTaken(int idx) const;
|
||||
uint32 GetSpellTriggers(int idx) const;
|
||||
uint32 GetSpellOnKill(int idx) const;
|
||||
uint32 GetSpellOnDeath(int idx) const;
|
||||
int32 GetCritDmgMod(int idx) const;
|
||||
int32 GetSkillReuseTime(int idx) const;
|
||||
int32 GetSkillDamageAmount(int idx) const;
|
||||
int GetHPPercCap(int idx) const;
|
||||
int GetManaPercCap(int idx) const;
|
||||
int GetEndPercCap(int idx) const;
|
||||
uint8 GetFocusEffects(int idx) const;
|
||||
int16 GetFocusEffectsWorn(int idx) const;
|
||||
int32 GetSkillDamageAmount2(int idx) const;
|
||||
uint32 GetNegateAttacks(int idx) const;
|
||||
uint32 GetMitigateMeleeRune(int idx) const;
|
||||
uint32 GetMeleeThresholdGuard(int idx) const;
|
||||
uint32 GetSpellThresholdGuard(int idx) const;
|
||||
uint32 GetMitigateSpellRune(int idx) const;
|
||||
uint32 GetMitigateDotRune(int idx) const;
|
||||
uint32 GetManaAbsorbPercentDamage(int idx) const;
|
||||
int32 GetImprovedTaunt(int idx) const;
|
||||
int8 GetRoot(int idx) const;
|
||||
uint32 GetAbsorbMagicAtt(int idx) const;
|
||||
uint32 GetMeleeRune(int idx) const;
|
||||
int32 GetAStacker(int idx) const;
|
||||
int32 GetBStacker(int idx) const;
|
||||
int32 GetCStacker(int idx) const;
|
||||
int32 GetDStacker(int idx) const;
|
||||
bool GetLimitToSkill(int idx) const;
|
||||
uint32 GetSkillProc(int idx) const;
|
||||
uint32 GetSkillProcSuccess(int idx) const;
|
||||
uint32 GetPC_Pet_Rampage(int idx) const;
|
||||
int32 GetSkillAttackProc(int idx) const;
|
||||
int32 GetSlayUndead(int idx) const;
|
||||
int32 GetGiveDoubleRiposte(int idx) const;
|
||||
uint32 GetRaiseSkillCap(int idx) const;
|
||||
int32 GetSEResist(int idx) const;
|
||||
int32 GetFinishingBlow(int idx) const;
|
||||
uint32 GetFinishingBlowLvl(int idx) const;
|
||||
uint32 GetHeadShot(int idx) const;
|
||||
uint8 GetHSLevel(int idx) const;
|
||||
uint32 GetAssassinate(int idx) const;
|
||||
uint8 GetAssassinateLevel(int idx) const;
|
||||
int32 GetReduceTradeskillFail(int idx) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user