Compare commits

...

4 Commits

Author SHA1 Message Date
KimLS 9fd07b4dd4 Exports continue, mob and some constants 2018-08-27 22:41:03 -07:00
KimLS 31a20a1e4c Begin porting of mappable stuff in earnest 2018-08-26 00:43:44 -07:00
KimLS f40b44a454 Starting rewrite of lua parser in earnest 2018-08-25 15:33:29 -07:00
KimLS d1aef18974 Cleanup before we start gutting luabind 2018-08-24 00:43:54 -07:00
87 changed files with 25470 additions and 1812 deletions
+4
View File
@@ -261,6 +261,9 @@ IF(EQEMU_BUILD_PERL)
ENDIF(EQEMU_BUILD_PERL)
IF(EQEMU_BUILD_LUA)
ADD_DEFINITIONS(-DLUA_EQEMU)
IF(MSVC)
ADD_DEFINITIONS(/bigobj)
ENDIF()
ENDIF(EQEMU_BUILD_LUA)
OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF)
@@ -325,6 +328,7 @@ IF(EQEMU_BUILD_LUA)
FIND_PACKAGE(Boost REQUIRED)
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/sol")
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
IF(EQEMU_SANITIZE_LUA_LIBS)
+22014
View File
File diff suppressed because it is too large Load Diff
+366
View File
@@ -0,0 +1,366 @@
// The MIT License (MIT)
// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// 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.
// This file was generated with a script.
// Generated 2018-06-16 11:58:58.882218 UTC
// This header was generated with sol v2.20.3 (revision 968989b)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
// beginning of sol/forward.hpp
// beginning of sol/feature_test.hpp
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
#ifndef SOL_CXX17_FEATURES
#define SOL_CXX17_FEATURES 1
#endif // C++17 features macro
#endif // C++17 features check
#if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201403L))))
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
#endif // noexcept is part of a function's type
#endif // compiler-specific checks
#if defined(__clang__) && defined(__APPLE__)
#if defined(__has_include)
#if __has_include(<variant>)
#define SOL_STD_VARIANT 1
#endif // has include nonsense
#endif // __has_include
#else
#define SOL_STD_VARIANT 1
#endif // Clang screws up variant
#endif // C++17 only
// beginning of sol/config.hpp
#ifdef _MSC_VER
#if defined(_DEBUG) && !defined(NDEBUG)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // VC++ Debug macros
#ifndef _CPPUNWIND
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // Automatic Exceptions
#ifndef _CPPRTTI
#ifndef SOL_NO_RTTI
#define SOL_NO_RTTI 1
#endif
#endif // Automatic RTTI
#elif defined(__GNUC__) || defined(__clang__)
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // Not Debug && g++ optimizer flag
#ifndef __EXCEPTIONS
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // No Exceptions
#ifndef __GXX_RTTI
#ifndef SOL_NO_RTII
#define SOL_NO_RTTI 1
#endif
#endif // No RTTI
#endif // vc++ || clang++/g++
#if defined(SOL_CHECK_ARGUMENTS) && SOL_CHECK_ARGUMENTS
// Checks low-level getter function
// (and thusly, affects nearly entire framework)
#if !defined(SOL_SAFE_GETTER)
#define SOL_SAFE_GETTER 1
#endif
// Checks access on usertype functions
// local my_obj = my_type.new()
// my_obj.my_member_function()
// -- bad syntax and crash
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
// Checks sol::reference derived boundaries
// sol::function ref(L, 1);
// sol::userdata sref(L, 2);
#if !defined(SOL_SAFE_REFERENCES)
#define SOL_SAFE_REFERENCES 1
#endif
// Changes all typedefs of sol::function to point to the
// protected_function version, instead of unsafe_function
#if !defined(SOL_SAFE_FUNCTION)
#define SOL_SAFE_FUNCTION 1
#endif
// Checks function parameters and
// returns upon call into/from Lua
// local a = 1
// local b = "woof"
// my_c_function(a, b)
#if !defined(SOL_SAFE_FUNCTION_CALLS)
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
// Checks conversions
// int v = lua["bark"];
// int v2 = my_sol_function();
#if !defined(SOL_SAFE_PROXIES)
#define SOL_SAFE_PROXIES 1
#endif
// Check overflowing number conversions
// for things like 64 bit integers that don't fit in a typical lua_Number
// for Lua 5.1 and 5.2
#if !defined(SOL_SAFE_NUMERICS)
#define SOL_SAFE_NUMERICS 1
#endif
// Turn off Number Precision Checks
// if this is defined, we do not do range
// checks on integers / unsigned integers that might
// be bigger than what Lua can represent
#if !defined(SOL_NO_CHECK_NUMBER_PRECISION)
// off by default
#define SOL_NO_CHECK_NUMBER_PRECISION 0
#endif
#endif // Turn on Safety for all if top-level macro is defined
#if defined(SOL_IN_DEBUG_DETECTED) && SOL_IN_DEBUG_DETECTED
#if !defined(SOL_SAFE_REFERENCES)
// Ensure that references are forcefully type-checked upon construction
#define SOL_SAFE_REFERENCES 1
#endif
// Safe usertypes checks for errors such as
// obj = my_type.new()
// obj.f() -- note the '.' instead of ':'
// usertypes should be safe no matter what
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
#if !defined(SOL_SAFE_FUNCTION_CALLS)
// Function calls from Lua should be automatically safe in debug mode
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
// Print any exceptions / errors that occur
// in debug mode to the default error stream / console
#if !defined(SOL_PRINT_ERRORS)
#define SOL_PRINT_ERRORS 1
#endif
#endif // DEBUG: Turn on all debug safety features for VC++ / g++ / clang++ and similar
#if !defined(SOL_PRINT_ERRORS)
#define SOL_PRINT_ERRORS 0
#endif
#if !defined(SOL_DEFAULT_PASS_ON_ERROR)
#define SOL_DEFAULT_PASS_ON_ERROR 0
#endif
#if !defined(SOL_ENABLE_INTEROP)
#define SOL_ENABLE_INTEROP 0
#endif
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
#if !defined(SOL_NO_NIL)
#define SOL_NO_NIL 1
#endif
#endif // avoiding nil defines / keywords
#if defined(SOL_USE_BOOST) && SOL_USE_BOOST
#ifndef SOL_UNORDERED_MAP_COMPATIBLE_HASH
#define SOL_UNORDERED_MAP_COMPATIBLE_HASH 1
#endif // SOL_UNORDERED_MAP_COMPATIBLE_HASH
#endif
#ifndef SOL_STACK_STRING_OPTIMIZATION_SIZE
#define SOL_STACK_STRING_OPTIMIZATION_SIZE 1024
#endif // Optimized conversion routines using a KB or so off the stack
// end of sol/config.hpp
// beginning of sol/config_setup.hpp
// end of sol/config_setup.hpp
// end of sol/feature_test.hpp
namespace sol {
template <bool b>
class basic_reference;
using reference = basic_reference<false>;
using main_reference = basic_reference<true>;
class stack_reference;
struct proxy_base_tag;
template <typename Super>
struct proxy_base;
template <typename Table, typename Key>
struct proxy;
template <typename T>
class usertype;
template <typename T>
class simple_usertype;
template <bool, typename T>
class basic_table_core;
template <bool b>
using table_core = basic_table_core<b, reference>;
template <bool b>
using main_table_core = basic_table_core<b, main_reference>;
template <bool b>
using stack_table_core = basic_table_core<b, stack_reference>;
template <typename T>
using basic_table = basic_table_core<false, T>;
typedef table_core<false> table;
typedef table_core<true> global_table;
typedef main_table_core<false> main_table;
typedef main_table_core<true> main_global_table;
typedef stack_table_core<false> stack_table;
typedef stack_table_core<true> stack_global_table;
template <typename base_t>
struct basic_environment;
using environment = basic_environment<reference>;
using main_environment = basic_environment<main_reference>;
using stack_environment = basic_environment<stack_reference>;
template <typename T, bool>
class basic_function;
template <typename T, bool, typename H>
class basic_protected_function;
using unsafe_function = basic_function<reference, false>;
using safe_function = basic_protected_function<reference, false, reference>;
using main_unsafe_function = basic_function<main_reference, false>;
using main_safe_function = basic_protected_function<main_reference, false, reference>;
using stack_unsafe_function = basic_function<stack_reference, false>;
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
using protected_function = safe_function;
using main_protected_function = main_safe_function;
using stack_protected_function = stack_safe_function;
using stack_aligned_protected_function = stack_aligned_safe_function;
#if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
using function = protected_function;
using main_function = main_protected_function;
using stack_function = stack_protected_function;
#else
using function = unsafe_function;
using main_function = main_unsafe_function;
using stack_function = stack_unsafe_function;
#endif
using stack_aligned_function = stack_aligned_unsafe_function;
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
struct unsafe_function_result;
struct protected_function_result;
using safe_function_result = protected_function_result;
#if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
using function_result = safe_function_result;
#else
using function_result = unsafe_function_result;
#endif
template <typename base_t>
class basic_object;
template <typename base_t>
class basic_userdata;
template <typename base_t>
class basic_lightuserdata;
template <typename base_t>
class basic_coroutine;
template <typename base_t>
class basic_thread;
using object = basic_object<reference>;
using userdata = basic_userdata<reference>;
using lightuserdata = basic_lightuserdata<reference>;
using thread = basic_thread<reference>;
using coroutine = basic_coroutine<reference>;
using main_object = basic_object<main_reference>;
using main_userdata = basic_userdata<main_reference>;
using main_lightuserdata = basic_lightuserdata<main_reference>;
using main_coroutine = basic_coroutine<main_reference>;
using stack_object = basic_object<stack_reference>;
using stack_userdata = basic_userdata<stack_reference>;
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
using stack_thread = basic_thread<stack_reference>;
using stack_coroutine = basic_coroutine<stack_reference>;
struct stack_proxy_base;
struct stack_proxy;
struct variadic_args;
struct variadic_results;
struct stack_count;
struct this_state;
struct this_main_state;
struct this_environment;
template <typename T>
struct as_table_t;
template <typename T>
struct as_container_t;
template <typename T>
struct nested;
template <typename T>
struct light;
template <typename T>
struct user;
template <typename T>
struct as_args_t;
template <typename T>
struct protect_t;
template <typename F, typename... Filters>
struct filter_wrapper;
template <typename T>
struct usertype_traits;
template <typename T>
struct unique_usertype_traits;
} // namespace sol
// end of sol/forward.hpp
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
+50 -50
View File
@@ -40,30 +40,6 @@ SET(zone_sources
horse.cpp
inventory.cpp
loottables.cpp
lua_bit.cpp
lua_corpse.cpp
lua_client.cpp
lua_door.cpp
lua_encounter.cpp
lua_entity.cpp
lua_entity_list.cpp
lua_general.cpp
lua_group.cpp
lua_hate_list.cpp
lua_inventory.cpp
lua_item.cpp
lua_iteminst.cpp
lua_mob.cpp
lua_mod.cpp
lua_npc.cpp
lua_object.cpp
lua_packet.cpp
lua_parser.cpp
lua_parser_events.cpp
lua_raid.cpp
lua_spawn.cpp
lua_spell.cpp
lua_stat_bonuses.cpp
embperl.cpp
embxs.cpp
entity.cpp
@@ -156,7 +132,7 @@ SET(zone_headers
command.h
common.h
corpse.h
data_bucket.h
data_bucket.h
doors.h
embparser.h
embperl.h
@@ -173,31 +149,6 @@ SET(zone_headers
hate_list.h
heal_rotation.h
horse.h
lua_bit.h
lua_client.h
lua_corpse.h
lua_door.h
lua_encounter.h
lua_entity.h
lua_entity_list.h
lua_general.h
lua_group.h
lua_hate_list.h
lua_inventory.h
lua_item.h
lua_iteminst.h
lua_mob.h
lua_mod.h
lua_npc.h
lua_object.h
lua_packet.h
lua_parser.h
lua_parser_events.h
lua_ptr.h
lua_raid.h
lua_spawn.h
lua_spell.h
lua_stat_bonuses.h
map.h
masterentity.h
maxskill.h
@@ -245,6 +196,55 @@ SET(zone_headers
zonedump.h
)
IF(EQEMU_BUILD_LUA)
SET(zone_sources ${zone_sources}
lua/lua_client.cpp
lua/lua_corpse.cpp
lua/lua_door.cpp
lua/lua_entity.cpp
lua/lua_extra_attack_options.cpp
lua/lua_inventory_where.cpp
lua/lua_npc.cpp
lua/lua_mob.cpp
lua/lua_mob_a.cpp
lua/lua_mob_b.cpp
lua/lua_mob_c.cpp
lua/lua_object.cpp
lua/lua_general.cpp
lua/lua_parser.cpp
)
SET(zone_headers ${zone_headers}
lua/lua_events.h
lua/lua_forward.h
lua/lua_parser.h
lua/lua_structs.h
)
SOURCE_GROUP(lua FILES
lua/lua_client.cpp
lua/lua_corpse.cpp
lua/lua_door.cpp
lua/lua_entity.cpp
lua/lua_extra_attack_options.cpp
lua/lua_events.h
lua/lua_forward.h
lua/lua_inventory_where.cpp
lua/lua_npc.cpp
lua/lua_mob.cpp
lua/lua_mob_a.cpp
lua/lua_mob_b.cpp
lua/lua_mob_c.cpp
lua/lua_object.cpp
lua/lua_general.cpp
lua/lua_parser.cpp
lua/lua_parser.h
lua/lua_structs.h
)
endif()
IF(EQEMU_DEPOP_INVALIDATES_CACHE)
ADD_DEFINITIONS(-DDEPOP_INVALIDATES_NPC_TYPES_CACHE)
ENDIF(EQEMU_DEPOP_INVALIDATES_CACHE)
+1 -1
View File
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "water_map.h"
#include "worldserver.h"
#include "zone.h"
#include "lua_parser.h"
#include "lua/lua_parser.h"
#include "fastmath.h"
#include <assert.h>
+1 -1
View File
@@ -5450,7 +5450,7 @@ void Client::SetPortExemption(bool v)
m_PortExemption = v;
}
void Client::Signal(uint32 data)
void Client::Signal(int data)
{
char buf[32];
snprintf(buf, 31, "%d", data);
+1 -1
View File
@@ -1099,6 +1099,7 @@ public:
void MarkSingleCompassLoc(float in_x, float in_y, float in_z, uint8 count=1);
virtual void Signal(int signal);
void CalcItemScale();
bool CalcItemScale(uint32 slot_x, uint32 slot_y); // behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
void DoItemEnterZone();
@@ -1114,7 +1115,6 @@ public:
void SuspendMinion();
void Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration);
void NotifyNewTitlesAvailable();
void Signal(uint32 data);
Mob *GetBindSightTarget() { return bind_sight_target; }
void SetBindSightTarget(Mob *n) { bind_sight_target = n; }
const uint16 GetBoatID() const { return controlling_boat_id; }
+1 -1
View File
@@ -5054,7 +5054,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app)
FastQueuePacket(&outapp);
safe_delete(outapp);
// have the boat signal itself, so quests can be triggered by boat use
boat->CastToNPC()->SignalNPC(0);
boat->Signal(0);
}
void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app)
+1 -1
View File
@@ -3147,7 +3147,7 @@ void EntityList::SignalMobsByNPCID(uint32 snpc, int signal_id)
while (it != npc_list.end()) {
NPC *pit = it->second;
if (pit->GetNPCTypeID() == snpc)
pit->SignalNPC(signal_id);
pit->Signal(signal_id);
++it;
}
}
+1 -1
View File
@@ -28,7 +28,7 @@
#include "queryserv.h"
#include "quest_parser_collection.h"
#include "lua_parser.h"
#include "lua/lua_parser.h"
#include "string_ids.h"
#ifdef BOTS
+8
View File
@@ -0,0 +1,8 @@
#include <sol.hpp>
#include "../client.h"
void lua_register_client(sol::state *state) {
auto client = state->create_simple_usertype<Client>(sol::base_classes, sol::bases<Mob, Entity>());
state->set_usertype("Client", client);
}
+8
View File
@@ -0,0 +1,8 @@
#include <sol.hpp>
#include "../corpse.h"
void lua_register_corpse(sol::state *state) {
auto corpse = state->create_simple_usertype<Corpse>(sol::base_classes, sol::bases<Mob, Entity>());
state->set_usertype("Corpse", corpse);
}
+8
View File
@@ -0,0 +1,8 @@
#include <sol.hpp>
#include "../doors.h"
void lua_register_doors(sol::state *state) {
auto door = state->create_simple_usertype<Doors>(sol::base_classes, sol::bases<Entity>());
state->set_usertype("Door", door);
}
+40
View File
@@ -0,0 +1,40 @@
#include <sol.hpp>
#include "../entity.h"
#include "../client.h"
#include "../npc.h"
#include "../corpse.h"
#include "../doors.h"
#include "../object.h"
#include "../trap.h"
#include "../encounter.h"
#include "../beacon.h"
void lua_register_entity(sol::state *state) {
auto entity = state->create_simple_usertype<Entity>();
entity.set("IsClient", &Entity::IsClient);
entity.set("IsNPC", &Entity::IsNPC);
entity.set("IsMob", &Entity::IsMob);
entity.set("IsMerc", &Entity::IsMerc);
entity.set("IsCorpse", &Entity::IsCorpse);
entity.set("IsPlayerCorpse", &Entity::IsPlayerCorpse);
entity.set("IsNPCCorpse", &Entity::IsNPCCorpse);
entity.set("IsObject", &Entity::IsObject);
entity.set("IsDoor", &Entity::IsDoor);
entity.set("IsTrap", &Entity::IsTrap);
entity.set("IsBeacon", &Entity::IsBeacon);
entity.set("IsEncounter", &Entity::IsEncounter);
entity.set("IsBot", &Entity::IsBot);
entity.set("IsAura", &Entity::IsAura);
entity.set("CastToClient", (Client*(Entity::*)())&Entity::CastToClient);
entity.set("CastToMob", (Mob*(Entity::*)())&Entity::CastToMob);
entity.set("CastToMerc", (Merc*(Entity::*)())&Entity::CastToMerc);
entity.set("CastToCorpse", (Corpse*(Entity::*)())&Entity::CastToCorpse);
entity.set("CastToObject", (Object*(Entity::*)())&Entity::CastToObject);
entity.set("CastToDoors", (Doors*(Entity::*)())&Entity::CastToDoors);
entity.set("CastToTrap", (Trap*(Entity::*)())&Entity::CastToTrap);
entity.set("CastToBeacon", (Beacon*(Entity::*)())&Entity::CastToBeacon);
entity.set("CastToEncounter", (Encounter*(Entity::*)())&Entity::CastToEncounter);
entity.set("GetID", &Entity::GetID);
entity.set("GetName", &Entity::GetName);
state->set_usertype("Entity", entity);
}
+88
View File
@@ -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"
};
+19
View File
@@ -0,0 +1,19 @@
#include <sol.hpp>
#include "../common.h"
void lua_register_extra_attack_options(sol::state *state) {
state->new_usertype<ExtraAttackOptions>("ExtraAttackOptions",
sol::constructors<ExtraAttackOptions()>(),
"damage_percent", &ExtraAttackOptions::damage_percent,
"damage_flat", &ExtraAttackOptions::damage_flat,
"armor_pen_percent", &ExtraAttackOptions::armor_pen_percent,
"armor_pen_flat", &ExtraAttackOptions::armor_pen_flat,
"crit_percent", &ExtraAttackOptions::crit_percent,
"crit_flat", &ExtraAttackOptions::crit_flat,
"hate_percent", &ExtraAttackOptions::hate_percent,
"hate_flat", &ExtraAttackOptions::hate_flat,
"hit_chance", &ExtraAttackOptions::hit_chance,
"melee_damage_bonus_flat", &ExtraAttackOptions::melee_damage_bonus_flat,
"skilldmgtaken_bonus_flat", &ExtraAttackOptions::skilldmgtaken_bonus_flat
);
}
+12
View File
@@ -0,0 +1,12 @@
#pragma once
void lua_register_extra_attack_options(sol::state *state);
void lua_register_inventory_where(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);
void lua_register_general(sol::state *state);
+5
View File
@@ -0,0 +1,5 @@
#include <sol.hpp>
void lua_register_general(sol::state *state) {
auto table = state->create_named_table("eqemu");
}
+12
View File
@@ -0,0 +1,12 @@
#include <sol.hpp>
#include "../client.h"
void lua_register_inventory_where(sol::state *state) {
state->create_named_table("InventoryWhere",
"Personal", static_cast<int>(invWherePersonal),
"Bank", static_cast<int>(invWhereBank),
"SharedBank", static_cast<int>(invWhereSharedBank),
"Trading", static_cast<int>(invWhereTrading),
"Cursor", static_cast<int>(invWhereCursor)
);
}
+18
View File
@@ -0,0 +1,18 @@
#include <sol.hpp>
#include "../mob.h"
void RegisterMobTypesA(sol::simple_usertype<Mob> &type);
void RegisterMobTypesB(sol::simple_usertype<Mob> &type);
void RegisterMobTypesC(sol::simple_usertype<Mob> &type);
void lua_register_mob(sol::state *state) {
//Because Mob is such a large usertype trying to pass everything at once is stressful on the template compiler (lots of memory / cpu)
//(esp on windows which uses a 32bit compiler by default and often runs out of allocated heap trying to compile it)
//So instead of creating/registering the usertype in one go we'll create a simple usertype and fill it in steps before registering it with lua
auto mob = state->create_simple_usertype<Mob>(sol::base_classes, sol::bases<Entity>());
RegisterMobTypesA(mob);
RegisterMobTypesB(mob);
RegisterMobTypesC(mob);
state->set_usertype("Mob", mob);
}
+543
View File
@@ -0,0 +1,543 @@
#include <sol.hpp>
#include "../mob.h"
void mob_depop(Mob &m) {
m.Depop();
}
void mob_depop1(Mob &m, bool start_spawn_timer) {
m.Depop(start_spawn_timer);
}
bool mob_behind_mob(Mob &m) {
return m.BehindMob();
}
bool mob_behind_mob1(Mob &m, Mob *other) {
return m.BehindMob(other);
}
bool mob_behind_mob2(Mob &m, Mob *other, float ourx) {
return m.BehindMob(other, ourx);
}
bool mob_behind_mob3(Mob &m, Mob *other, float ourx, float oury) {
return m.BehindMob(other, ourx, oury);
}
void mob_set_level(Mob &m, uint8 level) {
m.SetLevel(level);
}
void mob_set_level1(Mob &m, uint8 level, bool command) {
m.SetLevel(level, command);
}
bool mob_attack(Mob &m, Mob *other) {
return m.Attack(other);
}
bool mob_attack1(Mob &m, Mob *other, int hand) {
return m.Attack(other, hand);
}
bool mob_attack2(Mob &m, Mob *other, int hand, bool from_riposte) {
return m.Attack(other, hand, from_riposte);
}
bool mob_attack3(Mob &m, Mob *other, int hand, bool from_riposte, bool is_strikethrough) {
return m.Attack(other, hand, from_riposte, is_strikethrough);
}
bool mob_attack4(Mob &m, Mob *other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell) {
return m.Attack(other, hand, from_riposte, is_strikethrough, is_from_spell);
}
bool mob_attack5(Mob &m, Mob *other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, ExtraAttackOptions *opts) {
return m.Attack(other, hand, from_riposte, is_strikethrough, is_from_spell, opts);
}
void mob_damage(Mob &m, Mob *from, int32 damage, uint16 spell_id, int attack_skill) {
m.Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill));
}
void mob_damage1(Mob &m, Mob *from, int32 damage, uint16 spell_id, int attack_skill, bool avoidable) {
m.Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable);
}
void mob_damage2(Mob &m, Mob *from, int32 damage, uint16 spell_id, int attack_skill, bool avoidable, int8 buffslot) {
m.Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable, buffslot);
}
void mob_damage3(Mob &m, Mob *from, int32 damage, uint16 spell_id, int attack_skill, bool avoidable, int8 buffslot, bool bufftic) {
m.Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable, buffslot, bufftic);
}
void mob_damage4(Mob &m, Mob *from, int32 damage, uint16 spell_id, int attack_skill, bool avoidable, int8 buffslot, bool bufftic, int special) {
m.Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable, buffslot, bufftic, static_cast<eSpecialAttacks>(special));
}
void mob_heal_damage(Mob &m, uint32 amount) {
m.HealDamage(amount);
}
void mob_heal_damage1(Mob &m, uint32 amount, Mob *caster) {
m.HealDamage(amount, caster);
}
void mob_heal_damage2(Mob &m, uint32 amount, Mob *caster, uint16 spell_id) {
m.HealDamage(amount, caster, spell_id);
}
uint32 mob_get_level_con(Mob &m, uint8 other) {
return m.GetLevelCon(other);
}
uint32 mob_get_level_con1(Mob &m, uint8 mylevel, uint8 other) {
return m.GetLevelCon(mylevel, other);
}
void mob_do_anim(Mob &m, int animnum) {
m.DoAnim(animnum);
}
void mob_do_anim1(Mob &m, int animnum, int type) {
m.DoAnim(animnum, type);
}
void mob_do_anim2(Mob &m, int animnum, int type, bool ackreq) {
m.DoAnim(animnum, type, ackreq);
}
void mob_do_anim3(Mob &m, int animnum, int type, bool ackreq, int filter) {
m.DoAnim(animnum, type, ackreq, static_cast<eqFilterType>(filter));
}
void mob_change_size(Mob &m, float sz) {
m.ChangeSize(sz);
}
void mob_change_size1(Mob &m, float sz, bool no_restriction) {
m.ChangeSize(sz, no_restriction);
}
void mob_gm_move(Mob &m, float x, float y, float z) {
m.GMMove(x, y, z);
}
void mob_gm_move1(Mob &m, float x, float y, float z, float heading) {
m.GMMove(x, y, z, heading);
}
void mob_gm_move2(Mob &m, float x, float y, float z, float heading, bool send_update) {
m.GMMove(x, y, z, heading, send_update);
}
void mob_try_move_along(Mob &m, float distance, float angle) {
m.TryMoveAlong(distance, angle);
}
void mob_try_move_along1(Mob &m, float distance, float angle, bool send) {
m.TryMoveAlong(distance, angle, send);
}
bool mob_is_invisible(Mob &m) {
return m.IsInvisible();
}
bool mob_is_invisible1(Mob &m, Mob *other) {
return m.IsInvisible(other);
}
bool mob_find_type(Mob &m, uint16 type) {
return m.FindType(type);
}
bool mob_find_type1(Mob &m, uint16 type, bool offensive) {
return m.FindType(type, offensive);
}
bool mob_find_type2(Mob &m, uint16 type, bool offensive, uint16 threshold) {
return m.FindType(type, offensive, threshold);
}
float mob_resist_spell(Mob &m, uint8 type, uint16 spell_id, Mob *caster) {
return m.ResistSpell(type, spell_id, caster);
}
float mob_resist_spell1(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override) {
return m.ResistSpell(type, spell_id, caster, use_resist_override);
}
float mob_resist_spell2(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override) {
return m.ResistSpell(type, spell_id, caster, use_resist_override, resist_override);
}
float mob_resist_spell3(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool chr_check) {
return m.ResistSpell(type, spell_id, caster, use_resist_override, resist_override, chr_check);
}
float mob_resist_spell4(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool chr_check, bool chrm_tick) {
return m.ResistSpell(type, spell_id, caster, use_resist_override, resist_override, chr_check, chrm_tick);
}
float mob_resist_spell5(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool chr_check, bool chrm_tick, bool is_root) {
return m.ResistSpell(type, spell_id, caster, use_resist_override, resist_override, chr_check, chrm_tick, is_root);
}
float mob_resist_spell6(Mob &m, uint8 type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool chr_check, bool chrm_tick, bool is_root, int level_override) {
return m.ResistSpell(type, spell_id, caster, use_resist_override, resist_override, chr_check, chrm_tick, is_root, level_override);
}
void mob_interrupt_spell(Mob &m) {
m.InterruptSpell();
}
void mob_interrupt_spell1(Mob &m, uint16 spell_id) {
m.InterruptSpell(spell_id);
}
float mob_get_waypoint_x(Mob& m) {
return m.GetCurrentWayPoint().x;
}
float mob_get_waypoint_y(Mob& m) {
return m.GetCurrentWayPoint().y;
}
float mob_get_waypoint_z(Mob& m) {
return m.GetCurrentWayPoint().z;
}
float mob_get_waypoint_h(Mob& m) {
return m.GetCurrentWayPoint().w;
}
void mob_message(Mob &m, int type, const std::string &msg) {
m.Message(type, "%s", msg.c_str());
}
void mob_say(Mob &m, const std::string &msg) {
m.Say("%s", msg.c_str());
}
void mob_shout(Mob &m, const std::string &msg) {
m.Shout("%s", msg.c_str());
}
void mob_emote(Mob &m, const std::string &msg) {
m.Emote("%s", msg.c_str());
}
bool mob_cast_spell(Mob &m, uint16 spell_id, uint16 target_id) {
return m.CastSpell(spell_id, target_id);
}
bool mob_cast_spell1(Mob &m, uint16 spell_id, uint16 target_id, int slot) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot));
}
bool mob_cast_spell2(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time);
}
bool mob_cast_spell3(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr);
}
bool mob_cast_spell4(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost, uint32 item_slot) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr, item_slot);
}
bool mob_cast_spell5(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost, uint32 item_slot, uint32 timer) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr, item_slot, timer);
}
bool mob_cast_spell6(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost, uint32 item_slot, uint32 timer, uint32 timer_duration) {
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr, item_slot, timer, timer_duration);
}
bool mob_cast_spell7(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost, uint32 item_slot, uint32 timer, uint32 timer_duration, int16 resist_adjust) {
int16 res = resist_adjust;
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr, item_slot, timer, timer_duration, &res);
}
bool mob_cast_spell8(Mob &m, uint16 spell_id, uint16 target_id, int slot, int32 cast_time, int32 mana_cost, uint32 item_slot, uint32 timer, uint32 timer_duration, int16 resist_adjust, uint32 aa_id) {
int16 res = resist_adjust;
return m.CastSpell(spell_id, target_id, static_cast<EQEmu::CastingSlot>(slot), cast_time, mana_cost, nullptr, item_slot, timer, timer_duration, &res, aa_id);
}
bool mob_spell_finished(Mob &m, uint16 spell_id, Mob *target) {
return m.SpellFinished(spell_id, target);
}
bool mob_spell_finished1(Mob &m, uint16 spell_id, Mob *target, int slot) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot));
}
bool mob_spell_finished2(Mob &m, uint16 spell_id, Mob *target, int slot, uint16 mana_used) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot), mana_used);
}
bool mob_spell_finished3(Mob &m, uint16 spell_id, Mob *target, int slot, uint16 mana_used, uint32 inventory_slot) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot), mana_used, inventory_slot);
}
bool mob_spell_finished4(Mob &m, uint16 spell_id, Mob *target, int slot, uint16 mana_used, uint32 inventory_slot, int16 resist_adjust) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot), mana_used, inventory_slot, resist_adjust);
}
bool mob_spell_finished5(Mob &m, uint16 spell_id, Mob *target, int slot, uint16 mana_used, uint32 inventory_slot, int16 resist_adjust, bool isproc) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot), mana_used, inventory_slot, resist_adjust, isproc);
}
bool mob_spell_finished6(Mob &m, uint16 spell_id, Mob *target, int slot, uint16 mana_used, uint32 inventory_slot, int16 resist_adjust, bool isproc, int level_override) {
return m.SpellFinished(spell_id, target, static_cast<EQEmu::CastingSlot>(slot), mana_used, inventory_slot, resist_adjust, isproc, level_override);
}
void mob_add_to_hate_list(Mob &m, Mob *other) {
m.AddToHateList(other);
}
void mob_add_to_hate_list1(Mob &m, Mob *other, uint32 hate) {
m.AddToHateList(other, hate);
}
void mob_add_to_hate_list2(Mob &m, Mob *other, uint32 hate, int32 damage) {
m.AddToHateList(other, hate, damage);
}
void mob_add_to_hate_list3(Mob &m, Mob *other, uint32 hate, int32 damage, bool yell_for_help) {
m.AddToHateList(other, hate, damage, yell_for_help);
}
void mob_add_to_hate_list4(Mob &m, Mob *other, uint32 hate, int32 damage, bool yell_for_help, bool frenzy) {
m.AddToHateList(other, hate, damage, yell_for_help, frenzy);
}
void mob_add_to_hate_list5(Mob &m, Mob *other, uint32 hate, int32 damage, bool yell_for_help, bool frenzy, bool bufftic) {
m.AddToHateList(other, hate, damage, yell_for_help, frenzy, bufftic);
}
void mob_add_to_hate_list6(Mob &m, Mob *other, uint32 hate, int32 damage, bool yell_for_help, bool frenzy, bool bufftic, uint16 spell_id) {
m.AddToHateList(other, hate, damage, yell_for_help, frenzy, bufftic, spell_id);
}
void mob_add_to_hate_list7(Mob &m, Mob *other, uint32 hate, int32 damage, bool yell_for_help, bool frenzy, bool bufftic, uint16 spell_id, bool pet_command) {
m.AddToHateList(other, hate, damage, yell_for_help, frenzy, bufftic, spell_id, pet_command);
}
void mob_set_hate(Mob &m, Mob *other) {
m.SetHateAmountOnEnt(other);
}
void mob_set_hate1(Mob &m, Mob *other, int hate) {
m.SetHateAmountOnEnt(other, hate);
}
void mob_set_hate2(Mob &m, Mob *other, int hate, int damage) {
m.SetHateAmountOnEnt(other, hate, damage);
}
void RegisterMobTypesA(sol::simple_usertype<Mob> &mob) {
mob.set("GetName", &Mob::GetName);
mob.set("Depop", sol::overload(
&mob_depop,
&mob_depop1));
mob.set("BehindMob", sol::overload(
&mob_behind_mob,
&mob_behind_mob1,
&mob_behind_mob2,
&mob_behind_mob3));
mob.set("SetLevel", sol::overload(
&mob_set_level,
&mob_set_level1));
mob.set("IsMoving", &Mob::IsMoving);
mob.set("GotoBind", &Mob::GoToBind);
mob.set("Attack", sol::overload(
&mob_attack,
&mob_attack1,
&mob_attack2,
&mob_attack3,
&mob_attack4,
&mob_attack5));
mob.set("Damage", sol::overload(
&mob_damage,
&mob_damage1,
&mob_damage2,
&mob_damage3,
&mob_damage4));
mob.set("RangedAttack", &Mob::RangedAttack);
mob.set("ThrowingAttack", &Mob::ThrowingAttack);
mob.set("Heal", &Mob::Heal);
mob.set("HealDamage", sol::overload(
&mob_heal_damage,
&mob_heal_damage1,
&mob_heal_damage2));
mob.set("GetLevelCon", sol::overload(
&mob_get_level_con,
&mob_get_level_con1));
mob.set("SetHP", &Mob::SetHP);
mob.set("DoAnim", sol::overload(
&mob_do_anim,
&mob_do_anim1,
&mob_do_anim2,
&mob_do_anim3));
mob.set("ChangeSize", sol::overload(
&mob_change_size,
&mob_change_size1));
mob.set("GMMove", sol::overload(
&mob_gm_move,
&mob_gm_move1,
&mob_gm_move2));
mob.set("GMMove", sol::overload(
&mob_try_move_along,
&mob_try_move_along1));
mob.set("HasProcs", &Mob::HasProcs);
mob.set("IsInvisible", sol::overload(
&mob_is_invisible,
&mob_is_invisible1));
mob.set("SetInvisible", &Mob::SetInvisible);
mob.set("FindBuff", &Mob::FindBuff);
mob.set("FindType", sol::overload(
&mob_find_type,
&mob_find_type1,
&mob_find_type2));
mob.set("GetBuffSlotFromType", &Mob::GetBuffSlotFromType);
mob.set("GetBaseRace", &Mob::GetBaseRace);
mob.set("GetBaseGender", &Mob::GetBaseGender);
mob.set("GetDeity", &Mob::GetDeity);
mob.set("GetRace", &Mob::GetRace);
mob.set("GetGender", &Mob::GetGender);
mob.set("GetTexture", &Mob::GetTexture);
mob.set("GetHelmTexture", &Mob::GetHelmTexture);
mob.set("GetHairColor", &Mob::GetHairColor);
mob.set("GetBeardColor", &Mob::GetBeardColor);
mob.set("GetEyeColor1", &Mob::GetEyeColor1);
mob.set("GetEyeColor2", &Mob::GetEyeColor2);
mob.set("GetHairStyle", &Mob::GetHairStyle);
mob.set("GetLuclinFace", &Mob::GetLuclinFace);
mob.set("GetBeard", &Mob::GetBeard);
mob.set("GetDrakkinHeritage", &Mob::GetDrakkinHeritage);
mob.set("GetDrakkinTattoo", &Mob::GetDrakkinTattoo);
mob.set("GetDrakkinDetails", &Mob::GetDrakkinDetails);
mob.set("GetClass", &Mob::GetClass);
mob.set("GetLevel", &Mob::GetLevel);
mob.set("GetCleanName", &Mob::GetCleanName);
mob.set("GetTarget", &Mob::GetTarget);
mob.set("SetTarget", &Mob::SetTarget);
mob.set("GetHPRatio", &Mob::GetHPRatio);
mob.set("IsWarriorClass", &Mob::IsWarriorClass);
mob.set("GetHP", &Mob::GetHP);
mob.set("GetMaxHP", &Mob::GetMaxHP);
mob.set("GetItemHPBonuses", &Mob::GetItemHPBonuses);
mob.set("GetSpellHPBonuses", &Mob::GetSpellHPBonuses);
mob.set("GetWalkspeed", &Mob::GetWalkspeed);
mob.set("GetRunspeed", &Mob::GetRunspeed);
mob.set("GetCasterLevel", &Mob::GetCasterLevel);
mob.set("GetMaxMana", &Mob::GetMaxMana);
mob.set("GetMana", &Mob::GetMana);
mob.set("SetMana", &Mob::SetMana);
mob.set("GetManaRatio", &Mob::GetManaRatio);
mob.set("GetAC", &Mob::GetAC);
mob.set("GetATK", &Mob::GetATK);
mob.set("GetSTR", &Mob::GetSTR);
mob.set("GetSTA", &Mob::GetSTA);
mob.set("GetDEX", &Mob::GetDEX);
mob.set("GetAGI", &Mob::GetAGI);
mob.set("GetINT", &Mob::GetINT);
mob.set("GetWIS", &Mob::GetWIS);
mob.set("GetCHA", &Mob::GetCHA);
mob.set("GetMR", &Mob::GetMR);
mob.set("GetFR", &Mob::GetFR);
mob.set("GetDR", &Mob::GetDR);
mob.set("GetPR", &Mob::GetPR);
mob.set("GetCR", &Mob::GetCR);
mob.set("GetCorruption", &Mob::GetCorrup);
mob.set("GetPhR", &Mob::GetPhR);
mob.set("GetMaxSTR", &Mob::GetMaxSTR);
mob.set("GetMaxSTA", &Mob::GetMaxSTA);
mob.set("GetMaxDEX", &Mob::GetMaxDEX);
mob.set("GetMaxAGI", &Mob::GetMaxAGI);
mob.set("GetMaxINT", &Mob::GetMaxINT);
mob.set("GetMaxWIS", &Mob::GetMaxWIS);
mob.set("GetMaxCHA", &Mob::GetMaxCHA);
mob.set("ResistSpell", sol::overload(
&mob_resist_spell,
&mob_resist_spell1,
&mob_resist_spell2,
&mob_resist_spell3,
&mob_resist_spell4,
&mob_resist_spell5,
&mob_resist_spell6));
mob.set("GetSpecializeSkillValue", &Mob::GetSpecializeSkillValue);
mob.set("GetNPCTypeID", &Mob::GetNPCTypeID);
mob.set("IsTargeted", (bool(Mob::*)() const)&Mob::IsTargeted);
mob.set("GetX", &Mob::GetX);
mob.set("GetY", &Mob::GetY);
mob.set("GetZ", &Mob::GetZ);
mob.set("GetHeading", &Mob::GetHeading);
mob.set("GetWaypointX", &mob_get_waypoint_x);
mob.set("GetWaypointY", &mob_get_waypoint_y);
mob.set("GetWaypointZ", &mob_get_waypoint_z);
mob.set("GetWaypointH", &mob_get_waypoint_h);
mob.set("GetWaypointPause", &Mob::GetCWPP);
mob.set("GetWaypointID", &Mob::GetCWP);
mob.set("SetCurrentWP", &Mob::SetCurrentWP);
mob.set("GetSize", &Mob::GetSize);
mob.set("Message", &mob_message);
mob.set("Message_StringID", (void(Mob::*)(uint32, uint32, uint32))&Mob::Message_StringID);
mob.set("Say", &mob_say);
mob.set("QuestSay", &Mob::QuestJournalledSay);
mob.set("Shout", &mob_shout);
mob.set("Emote", &mob_emote);
mob.set("InterruptSpell", sol::overload(
&mob_interrupt_spell,
&mob_interrupt_spell1));
mob.set("CastSpell", sol::overload(
&mob_cast_spell,
&mob_cast_spell1,
&mob_cast_spell2,
&mob_cast_spell3,
&mob_cast_spell4,
&mob_cast_spell5,
&mob_cast_spell6,
&mob_cast_spell7,
&mob_cast_spell8));
mob.set("SpellFinished", sol::overload(
&mob_spell_finished,
&mob_spell_finished1,
&mob_spell_finished2,
&mob_spell_finished3,
&mob_spell_finished4,
&mob_spell_finished5,
&mob_spell_finished6));
mob.set("SendBeginCast", &Mob::SendBeginCast);
mob.set("SpellEffect", &Mob::SpellEffect);
mob.set("GetPet", &Mob::GetPet);
mob.set("GetOwner", &Mob::GetOwner);
mob.set("GetHateList", &Mob::GetHateList);
mob.set("GetHateTop", &Mob::GetHateTop);
mob.set("GetHateDamageTop", &Mob::GetHateDamageTop);
mob.set("GetHateRandom", &Mob::GetHateRandom);
mob.set("AddToHateList", sol::overload(
&mob_add_to_hate_list,
&mob_add_to_hate_list1,
&mob_add_to_hate_list2,
&mob_add_to_hate_list3,
&mob_add_to_hate_list4,
&mob_add_to_hate_list5,
&mob_add_to_hate_list6,
&mob_add_to_hate_list7));
mob.set("SetHate", sol::overload(
&mob_set_hate,
&mob_set_hate1,
&mob_set_hate2));
mob.set("HalveAggro", &Mob::HalveAggro);
mob.set("DoubleAggro", &Mob::DoubleAggro);
mob.set("GetHateAmount", &Mob::GetHateAmount);
mob.set("GetHateAmount", &Mob::GetHateAmount);
mob.set("GetDamageAmount", &Mob::GetDamageAmount);
mob.set("WipeHateList", &Mob::WipeHateList);
mob.set("CheckAggro", &Mob::CheckAggro);
}
+396
View File
@@ -0,0 +1,396 @@
#include <sol.hpp>
#include "../mob.h"
bool mob_calculate_new_position(Mob &m, float x, float y, float z, float speed) {
return m.CalculateNewPosition(x, y, z, speed);
}
bool mob_calculate_new_position1(Mob &m, float x, float y, float z, float speed, bool check_z) {
return m.CalculateNewPosition(x, y, z, speed, check_z);
}
bool mob_calculate_new_position2(Mob &m, float x, float y, float z, float speed, bool check_z, bool calculate_heading) {
return m.CalculateNewPosition(x, y, z, speed, check_z, calculate_heading);
}
void mob_npc_special_attacks(Mob &m, const char *parse, int permtag) {
m.NPCSpecialAttacks(parse, permtag);
}
void mob_npc_special_attacks1(Mob &m, const char *parse, int permtag, bool reset) {
m.NPCSpecialAttacks(parse, permtag, reset);
}
void mob_npc_special_attacks2(Mob &m, const char *parse, int permtag, bool reset, bool remove) {
m.NPCSpecialAttacks(parse, permtag, reset, remove);
}
int32 mob_check_aggro_amount(Mob &m, uint16 spell_id, Mob *target) {
return m.CheckAggroAmount(spell_id, target);
}
int32 mob_check_aggro_amount1(Mob &m, uint16 spell_id, Mob *target, bool isproc) {
return m.CheckAggroAmount(spell_id, target, isproc);
}
int32 mob_check_heal_aggro_amount(Mob &m, uint16 spell_id, Mob *target) {
return m.CheckHealAggroAmount(spell_id, target);
}
int32 mob_check_heal_aggro_amount1(Mob &m, uint16 spell_id, Mob *target, uint32 heal_possible) {
return m.CheckHealAggroAmount(spell_id, target, heal_possible);
}
void mob_set_aa(Mob &m, uint32 rank_id, uint32 new_value) {
m.SetAA(rank_id, new_value);
}
void mob_set_aa1(Mob &m, uint32 rank_id, uint32 new_value, uint32 charges) {
m.SetAA(rank_id, new_value, charges);
}
void mob_do_special_attack_damage(Mob &m, Mob *who, int skill, int base_damage) {
m.DoSpecialAttackDamage(who, static_cast<EQEmu::skills::SkillType>(skill), base_damage);
}
void mob_do_special_attack_damage1(Mob &m, Mob *who, int skill, int base_damage, int min_damage) {
m.DoSpecialAttackDamage(who, static_cast<EQEmu::skills::SkillType>(skill), base_damage, min_damage);
}
void mob_do_special_attack_damage2(Mob &m, Mob *who, int skill, int base_damage, int min_damage, int32 hate_override) {
m.DoSpecialAttackDamage(who, static_cast<EQEmu::skills::SkillType>(skill), base_damage, min_damage, hate_override);
}
void mob_do_special_attack_damage3(Mob &m, Mob *who, int skill, int base_damage, int min_damage, int32 hate_override, int reuse_time) {
m.DoSpecialAttackDamage(who, static_cast<EQEmu::skills::SkillType>(skill), base_damage, min_damage, hate_override, reuse_time);
}
void mob_do_throwing_attack_damage(Mob &m, Mob *other) {
m.DoThrowingAttackDmg(other);
}
void mob_do_throwing_attack_damage1(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon) {
m.DoThrowingAttackDmg(other, weapon);
}
void mob_do_throwing_attack_damage2(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo) {
m.DoThrowingAttackDmg(other, weapon, ammo);
}
void mob_do_throwing_attack_damage3(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage);
}
void mob_do_throwing_attack_damage4(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus);
}
void mob_do_throwing_attack_damage5(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time);
}
void mob_do_throwing_attack_damage6(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id);
}
void mob_do_throwing_attack_damage7(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_slot) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_slot);
}
void mob_do_throwing_attack_damage8(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemData *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_slot, float speed) {
m.DoThrowingAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_slot, speed);
}
void mob_do_melee_skill_attack_damage(Mob &m, Mob *other, uint16 weapon_damage, int skillinuse) {
m.DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skillinuse));
}
void mob_do_melee_skill_attack_damage1(Mob &m, Mob *other, uint16 weapon_damage, int skillinuse, int16 chance_mod) {
m.DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skillinuse), chance_mod);
}
void mob_do_melee_skill_attack_damage2(Mob &m, Mob *other, uint16 weapon_damage, int skillinuse, int16 chance_mod, int16 focus) {
m.DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skillinuse), chance_mod, focus);
}
void mob_do_melee_skill_attack_damage3(Mob &m, Mob *other, uint16 weapon_damage, int skillinuse, int16 chance_mod, int16 focus, bool can_riposte) {
m.DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skillinuse), chance_mod, focus, can_riposte);
}
void mob_do_melee_skill_attack_damage4(Mob &m, Mob *other, uint16 weapon_damage, int skillinuse, int16 chance_mod, int16 focus, bool can_riposte, int reuse_time) {
m.DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skillinuse), chance_mod, focus, can_riposte, reuse_time);
}
void mob_do_archery_attack_damage(Mob &m, Mob *other) {
m.DoArcheryAttackDmg(other);
}
void mob_do_archery_attack_damage1(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon) {
m.DoArcheryAttackDmg(other, weapon);
}
void mob_do_archery_attack_damage2(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo) {
m.DoArcheryAttackDmg(other, weapon, ammo);
}
void mob_do_archery_attack_damage3(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage);
}
void mob_do_archery_attack_damage4(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod);
}
void mob_do_archery_attack_damage5(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus);
}
void mob_do_archery_attack_damage6(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time);
}
void mob_do_archery_attack_damage7(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id);
}
void mob_do_archery_attack_damage8(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_id) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_id);
}
void mob_do_archery_attack_damage9(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_id, const EQEmu::ItemData *ammo_data) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_id, ammo_data);
}
void mob_do_archery_attack_damage10(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_id, const EQEmu::ItemData *ammo_data, int ammo_slot) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_id, ammo_data, ammo_slot);
}
void mob_do_archery_attack_damage11(Mob &m, Mob *other, const EQEmu::ItemInstance *weapon, const EQEmu::ItemInstance *ammo,
uint16 weapon_damage, int16 chance_mod, int16 focus, int reuse_time, uint32 range_id, int ammo_id, const EQEmu::ItemData *ammo_data, int ammo_slot, float speed) {
m.DoArcheryAttackDmg(other, weapon, ammo, weapon_damage, chance_mod, focus, reuse_time, range_id, ammo_slot, ammo_data, ammo_slot, speed);
}
bool mob_check_los(Mob &m, Mob *other) {
return m.CheckLosFN(other);
}
bool mob_check_los_to_loc(Mob &m, float x, float y, float z) {
return m.CheckLosFN(x, y, z, 6.0f);
}
bool mob_check_los_to_loc1(Mob &m, float x, float y, float z, float mob_size) {
return m.CheckLosFN(x, y, z, mob_size);
}
float mob_find_ground_z(Mob &m, float x, float y) {
return m.GetGroundZ(x, y);
}
float mob_find_ground_z1(Mob &m, float x, float y, float offset) {
return m.GetGroundZ(x, y, offset);
}
void mob_projectile_animation(Mob &m, Mob *to, int item_id) {
m.ProjectileAnimation(to, item_id);
}
void mob_projectile_animation1(Mob &m, Mob *to, int item_id, bool is_arrow) {
m.ProjectileAnimation(to, item_id, is_arrow);
}
void mob_projectile_animation2(Mob &m, Mob *to, int item_id, bool is_arrow, float speed) {
m.ProjectileAnimation(to, item_id, is_arrow, speed);
}
void mob_projectile_animation3(Mob &m, Mob *to, int item_id, bool is_arrow, float speed, float angle) {
m.ProjectileAnimation(to, item_id, is_arrow, speed, angle);
}
void mob_projectile_animation4(Mob &m, Mob *to, int item_id, bool is_arrow, float speed, float angle, float tilt) {
m.ProjectileAnimation(to, item_id, is_arrow, speed, angle, tilt);
}
void mob_projectile_animation5(Mob &m, Mob *to, int item_id, bool is_arrow, float speed, float angle, float tilt, float arc) {
m.ProjectileAnimation(to, item_id, is_arrow, speed, angle, tilt, arc);
}
void mob_projectile_animation6(Mob &m, Mob *to, int item_id, bool is_arrow, float speed, float angle, float tilt, float arc, const std::string &id_file) {
m.ProjectileAnimation(to, item_id, is_arrow, speed, angle, tilt, arc, id_file.c_str());
}
void mob_projectile_animation7(Mob &m, Mob *to, int item_id, bool is_arrow, float speed, float angle, float tilt, float arc, const std::string &id_file, int skillinuse) {
m.ProjectileAnimation(to, item_id, is_arrow, speed, angle, tilt, arc, id_file.c_str(), static_cast<EQEmu::skills::SkillType>(skillinuse));
}
void mob_send_appearance_effect(Mob &m, uint32 param1, uint32 param2, uint32 param3, uint32 param4, uint32 param5) {
m.SendAppearanceEffect(param1, param2, param2, param4, param5);
}
void mob_send_appearance_effect1(Mob &m, uint32 param1, uint32 param2, uint32 param3, uint32 param4, uint32 param5, Client *target) {
m.SendAppearanceEffect(param1, param2, param2, param4, param5, target);
}
void mob_set_texture(Mob &m, int in) {
m.SendIllusionPacket(m.GetRace(), 0xFF, in);
}
void mob_set_race(Mob &m, int in) {
m.SendIllusionPacket(in);
}
void mob_set_gender(Mob &m, int in) {
m.SendIllusionPacket(m.GetRace(), in);
}
void RegisterMobTypesB(sol::simple_usertype<Mob> &mob) {
mob.set("Stun", &Mob::Stun);
mob.set("UnStun", &Mob::UnStun);
mob.set("IsStunned", &Mob::IsStunned);
mob.set("Spin", &Mob::Spin);
mob.set("Kill", &Mob::Kill);
mob.set("CanThisClassDoubleAttack", &Mob::CanThisClassDoubleAttack);
mob.set("CanThisClassDualWield", &Mob::CanThisClassDualWield);
mob.set("CanThisClassRiposte", &Mob::CanThisClassRiposte);
mob.set("CanThisClassDodge", &Mob::CanThisClassDodge);
mob.set("CanThisClassParry", &Mob::CanThisClassParry);
mob.set("CanThisClassBlock", &Mob::CanThisClassBlock);
mob.set("SetInvul", &Mob::SetInvul);
mob.set("GetInvul", &Mob::GetInvul);
mob.set("SetExtraHaste", &Mob::SetExtraHaste);
mob.set("GetHaste", &Mob::GetHaste);
mob.set("GetHandToHandDamage", &Mob::GetHandToHandDamage);
mob.set("GetHandToHandDelay", &Mob::GetHandToHandDelay);
mob.set("Mesmerize", &Mob::Mesmerize);
mob.set("IsMezzed", &Mob::IsMezzed);
mob.set("IsEnraged", &Mob::IsEnraged);
mob.set("GetReverseFactionCon", &Mob::GetReverseFactionCon);
mob.set("IsAIControlled", &Mob::IsAIControlled);
mob.set("GetAggroRange", &Mob::GetAggroRange);
mob.set("GetAssistRange", &Mob::GetAssistRange);
mob.set("SetPetOrder", &Mob::SetPetOrder);
mob.set("GetPetOrder", &Mob::GetPetOrder);
mob.set("IsRoamer", &Mob::IsRoamer);
mob.set("IsRooted", &Mob::IsRooted);
mob.set("IsEngaged", &Mob::IsEngaged);
mob.set("FaceTarget", &Mob::FaceTarget);
mob.set("SetHeading", &Mob::SetHeading);
mob.set("CalculateHeadingToTarget", &Mob::CalculateHeadingToTarget);
mob.set("CalculateNewPosition", sol::overload(
&mob_calculate_new_position,
&mob_calculate_new_position1,
&mob_calculate_new_position2));
mob.set("CalculateDistance", &Mob::CalculateDistance);
mob.set("SendTo", &Mob::SendTo);
mob.set("SendToFixZ", &Mob::SendToFixZ);
mob.set("NPCSpecialAttacks", sol::overload(
&mob_npc_special_attacks,
&mob_npc_special_attacks1,
&mob_npc_special_attacks2));
mob.set("GetResist", &Mob::GetResist);
mob.set("Charmed", &Mob::Charmed);
mob.set("CheckAggroAmount", sol::overload(
&mob_check_aggro_amount,
&mob_check_aggro_amount1));
mob.set("CheckHealAggroAmount", sol::overload(
&mob_check_heal_aggro_amount,
&mob_check_heal_aggro_amount1));
mob.set("GetAA", &Mob::GetAA);
mob.set("GetAA", &Mob::GetAA);
mob.set("SetAA", sol::overload(
&mob_set_aa,
&mob_set_aa1));
mob.set("DivineAura", &Mob::DivineAura);
mob.set("SetOOCRegen", &Mob::SetOOCRegen);
mob.set("GetEntityVariable", &Mob::GetEntityVariable);
mob.set("SetEntityVariable", &Mob::SetEntityVariable);
mob.set("EntityVariableExists", &Mob::EntityVariableExists);
mob.set("Signal", &Mob::Signal);
mob.set("CombatRange", &Mob::CombatRange);
mob.set("DoSpecialAttackDamage", sol::overload(
&mob_do_special_attack_damage,
&mob_do_special_attack_damage1,
&mob_do_special_attack_damage2,
&mob_do_special_attack_damage3));
mob.set("DoThrowingAttackDmg", sol::overload(
&mob_do_throwing_attack_damage,
&mob_do_throwing_attack_damage1,
&mob_do_throwing_attack_damage2,
&mob_do_throwing_attack_damage3,
&mob_do_throwing_attack_damage4,
&mob_do_throwing_attack_damage5,
&mob_do_throwing_attack_damage6,
&mob_do_throwing_attack_damage7,
&mob_do_throwing_attack_damage8));
mob.set("DoMeleeSkillAttackDmg", sol::overload(
&mob_do_melee_skill_attack_damage,
&mob_do_melee_skill_attack_damage1,
&mob_do_melee_skill_attack_damage2,
&mob_do_melee_skill_attack_damage3,
&mob_do_melee_skill_attack_damage4));
mob.set("DoArcheryAttackDmg", sol::overload(
&mob_do_archery_attack_damage,
&mob_do_archery_attack_damage1,
&mob_do_archery_attack_damage2,
&mob_do_archery_attack_damage3,
&mob_do_archery_attack_damage4,
&mob_do_archery_attack_damage5,
&mob_do_archery_attack_damage6,
&mob_do_archery_attack_damage7,
&mob_do_archery_attack_damage8,
&mob_do_archery_attack_damage9,
&mob_do_archery_attack_damage10,
&mob_do_archery_attack_damage11));
mob.set("CheckLoS", &mob_check_los);
mob.set("CheckLoSToLoc", sol::overload(
&mob_check_los_to_loc,
&mob_check_los_to_loc1));
mob.set("FindGroundZ", sol::overload(
&mob_find_ground_z,
&mob_find_ground_z1));
mob.set("ProjectileAnimation", sol::overload(
&mob_projectile_animation,
&mob_projectile_animation1,
&mob_projectile_animation2,
&mob_projectile_animation3,
&mob_projectile_animation4,
&mob_projectile_animation5,
&mob_projectile_animation6,
&mob_projectile_animation7));
mob.set("HasNPCSpecialAtk", &Mob::HasNPCSpecialAtk);
mob.set("SendAppearanceEffect", sol::overload(
&mob_send_appearance_effect,
&mob_send_appearance_effect1));
mob.set("SetFlyMode", &Mob::SetFlyMode);
mob.set("SetTexture", &mob_set_texture);
mob.set("SetRace", &mob_set_race);
mob.set("SetGender", &mob_set_gender);
mob.set("SendIllusionPacket", &Mob::SendIllusionPacket);
mob.set("ChangeRace", &Mob::ChangeRace);
mob.set("ChangeGender", &Mob::ChangeGender);
mob.set("ChangeTexture", &Mob::ChangeTexture);
mob.set("ChangeHelmTexture", &Mob::ChangeHelmTexture);
mob.set("ChangeHairColor", &Mob::ChangeHairColor);
mob.set("ChangeBeardColor", &Mob::ChangeBeardColor);
mob.set("ChangeEyeColor1", &Mob::ChangeEyeColor1);
mob.set("ChangeEyeColor2", &Mob::ChangeEyeColor2);
mob.set("ChangeHairStyle", &Mob::ChangeHairStyle);
mob.set("ChangeLuclinFace", &Mob::ChangeLuclinFace);
mob.set("ChangeBeard", &Mob::ChangeBeard);
mob.set("ChangeDrakkinHeritage", &Mob::ChangeDrakkinHeritage);
mob.set("ChangeDrakkinTattoo", &Mob::ChangeDrakkinTattoo);
mob.set("ChangeDrakkinDetails", &Mob::ChangeDrakkinDetails);
}
+180
View File
@@ -0,0 +1,180 @@
#include <sol.hpp>
#include "../mob.h"
void mob_camera_effect(Mob &m, uint32 duration, uint32 intensity) {
m.CameraEffect(duration, intensity);
}
void mob_camera_effect1(Mob &m, uint32 duration, uint32 intensity, Client *c) {
m.CameraEffect(duration, intensity, c);
}
void mob_camera_effect2(Mob &m, uint32 duration, uint32 intensity, Client *c, bool global) {
m.CameraEffect(duration, intensity, c, global);
}
void mob_send_spell_effect(Mob &m, uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020) {
m.SendSpellEffect(effectid, duration, finish_delay, zone_wide, unk020);
}
void mob_send_spell_effect1(Mob &m, uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect) {
m.SendSpellEffect(effectid, duration, finish_delay, zone_wide, unk020, perm_effect);
}
void mob_send_spell_effect2(Mob &m, uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, Client *c) {
m.SendSpellEffect(effectid, duration, finish_delay, zone_wide, unk020, perm_effect, c);
}
void mob_temp_name(Mob &m) {
m.TempName();
}
void mob_temp_name1(Mob &m, const std::string &name) {
m.TempName(name.c_str());
}
void mob_set_appearance(Mob &m, int app) {
m.SetAppearance(static_cast<EmuAppearance>(app));
}
void mob_set_appearance1(Mob &m, int app, bool ignore_self) {
m.SetAppearance(static_cast<EmuAppearance>(app), ignore_self);
}
void mob_buff_fade_by_effect(Mob &m, int effect_id) {
m.BuffFadeByEffect(effect_id);
}
void mob_buff_fade_by_effect1(Mob &m, int effect_id, int skipslot) {
m.BuffFadeByEffect(effect_id, skipslot);
}
void mob_buff_fade_by_slot(Mob &m, int slot) {
m.BuffFadeBySlot(slot);
}
void mob_buff_fade_by_slot1(Mob &m, int slot, bool recalc_bonuses) {
m.BuffFadeBySlot(slot, recalc_bonuses);
}
int mob_can_buff_stack(Mob &m, uint16 spell_id, uint8 caster_level) {
return m.CanBuffStack(spell_id, caster_level);
}
int mob_can_buff_stack1(Mob &m, uint16 spell_id, uint8 caster_level, bool fail_if_overwrite) {
return m.CanBuffStack(spell_id, caster_level, fail_if_overwrite);
}
int mob_get_weapon_damage(Mob &m, Mob *against, EQEmu::ItemInstance *weapon) {
return m.GetWeaponDamage(against, weapon);
}
std::tuple<bool, int> mob_try_finishing_blow(Mob &m, Mob *defender, int damage) {
auto r = m.TryFinishingBlow(defender, damage);
return std::make_tuple(r, damage);
}
void RegisterMobTypesC(sol::simple_usertype<Mob> &mob) {
mob.set("CameraEffect", sol::overload(
&mob_camera_effect,
&mob_camera_effect1,
&mob_camera_effect2));
mob.set("SendSpellEffect", sol::overload(
&mob_send_spell_effect,
&mob_send_spell_effect1,
&mob_send_spell_effect2));
mob.set("TempName", sol::overload(
&mob_temp_name,
&mob_temp_name1));
mob.set("GetGlobal", &Mob::GetGlobal);
mob.set("SetGlobal", &Mob::SetGlobal);
mob.set("SetGlobal", &Mob::SetGlobal);
mob.set("TarGlobal", &Mob::TarGlobal);
mob.set("DelGlobal", &Mob::DelGlobal);
mob.set("SetSlotTint", &Mob::SetSlotTint);
mob.set("WearChange", &Mob::WearChange);
mob.set("DoKnockback", &Mob::DoKnockback);
mob.set("AddNimbusEffect", &Mob::AddNimbusEffect);
mob.set("RemoveNimbusEffect", &Mob::RemoveNimbusEffect);
mob.set("IsFeared", &Mob::IsFeared);
mob.set("IsBlind", &Mob::IsBlind);
mob.set("IsRunning", &Mob::IsRunning);
mob.set("SetRunning", &Mob::SetRunning);
mob.set("SetBodyType", &Mob::SetBodyType);
mob.set("SetTargetable", &Mob::SetTargetable);
mob.set("ModSkillDmgTaken", &Mob::ModSkillDmgTaken);
mob.set("GetModSkillDmgTaken", &Mob::GetModSkillDmgTaken);
mob.set("GetSkillDmgTaken", &Mob::GetSkillDmgTaken);
mob.set("GetFcDamageAmtIncoming", &Mob::GetFcDamageAmtIncoming);
mob.set("GetSkillDmgAmt", &Mob::GetSkillDmgAmt);
mob.set("SetAllowBeneficial", &Mob::SetAllowBeneficial);
mob.set("GetAllowBeneficial", &Mob::GetAllowBeneficial);
mob.set("IsBeneficialAllowed", &Mob::IsBeneficialAllowed);
mob.set("ModVulnerability", &Mob::ModVulnerability);
mob.set("GetModVulnerability", &Mob::GetModVulnerability);
mob.set("SetDisableMelee", &Mob::SetDisableMelee);
mob.set("IsMeleeDisabled", &Mob::IsMeleeDisabled);
mob.set("SetFlurryChance", &Mob::SetFlurryChance);
mob.set("GetFlurryChance", &Mob::GetFlurryChance);
mob.set("GetSkill", &Mob::GetSkill);
mob.set("GetSpecialAbility", &Mob::GetSpecialAbility);
mob.set("GetSpecialAbilityParam", &Mob::GetSpecialAbilityParam);
mob.set("SetSpecialAbility", &Mob::SetSpecialAbility);
mob.set("SetSpecialAbilityParam", &Mob::SetSpecialAbilityParam);
mob.set("ClearSpecialAbilities", &Mob::ClearSpecialAbilities);
mob.set("ProcessSpecialAbilities", &Mob::ProcessSpecialAbilities);
mob.set("GetAppearance", &Mob::GetAppearance);
mob.set("SetAppearance", sol::overload(
&mob_set_appearance,
&mob_set_appearance1));
mob.set("SetDestructibleObject", &Mob::SetDestructibleObject);
mob.set("IsImmuneToSpell", &Mob::IsImmuneToSpell);
mob.set("BuffFadeBySpellID", &Mob::BuffFadeBySpellID);
mob.set("BuffFadeAll", &Mob::BuffFadeAll);
mob.set("BuffFadeByEffect", sol::overload(
&mob_buff_fade_by_effect,
&mob_buff_fade_by_effect1));
mob.set("BuffFadeBySlot", sol::overload(
&mob_buff_fade_by_slot,
&mob_buff_fade_by_slot1));
mob.set("CanBuffStack", sol::overload(
&mob_can_buff_stack,
&mob_can_buff_stack1));
mob.set("SetPseudoRoot", &Mob::SetPseudoRoot);
mob.set("SeeInvisible", &Mob::SeeInvisible);
mob.set("SeeInvisibleUndead", &Mob::SeeInvisibleUndead);
mob.set("SeeHide", &Mob::SeeHide);
mob.set("SeeImprovedHide", &Mob::SeeImprovedHide);
mob.set("GetNimbusEffect1", &Mob::GetNimbusEffect1);
mob.set("GetNimbusEffect2", &Mob::GetNimbusEffect2);
mob.set("GetNimbusEffect3", &Mob::GetNimbusEffect3);
mob.set("IsTargetable", &Mob::IsTargetable);
mob.set("HasShieldEquiped", &Mob::HasShieldEquiped);
mob.set("HasTwoHandBluntEquiped", &Mob::HasTwoHandBluntEquiped);
mob.set("HasTwoHanderEquipped", &Mob::HasTwoHanderEquipped);
mob.set("GetHerosForgeModel", &Mob::GetHerosForgeModel);
mob.set("IsEliteMaterialItem", &Mob::IsEliteMaterialItem);
mob.set("GetBaseSize", &Mob::GetBaseSize);
mob.set("HasOwner", &Mob::HasOwner);
mob.set("IsPet", &Mob::IsPet);
mob.set("HasPet", &Mob::HasPet);
mob.set("IsSilenced", &Mob::IsSilenced);
mob.set("IsAmnesiad", &Mob::IsAmnesiad);
mob.set("GetMeleeMitigation", &Mob::GetMeleeMitigation);
mob.set("GetWeaponDamageBonus", &Mob::GetWeaponDamageBonus);
mob.set("GetItemBonuses", &Mob::GetItemBonuses);
mob.set("GetSpellBonuses", &Mob::GetSpellBonuses);
mob.set("GetAABonuses", &Mob::GetAABonuses);
mob.set("GetMeleeDamageMod_SE", &Mob::GetMeleeDamageMod_SE);
mob.set("GetMeleeMinDamageMod_SE", &Mob::GetMeleeMinDamageMod_SE);
mob.set("IsAttackAllowed", &Mob::IsAttackAllowed);
mob.set("IsCasting", &Mob::IsCasting);
mob.set("AttackAnimation", &Mob::AttackAnimation);
mob.set("GetWeaponDamage", &mob_get_weapon_damage);
mob.set("IsBerserk", &Mob::IsBerserk);
mob.set("TryFinishingBlow", &mob_try_finishing_blow);
mob.set("GetBodyType", &Mob::GetBodyType);
mob.set("GetOrigBodyType", &Mob::GetOrigBodyType);
mob.set("CheckNumHitsRemaining", &Mob::CheckNumHitsRemaining);
}
+241
View File
@@ -0,0 +1,241 @@
#include <sol.hpp>
#include "../npc.h"
void npc_add_item(NPC &n, uint32 item_id, uint16 charges) {
n.AddItem(item_id, charges);
}
void npc_add_item1(NPC &n, uint32 item_id, uint16 charges, bool equipitem) {
n.AddItem(item_id, charges, equipitem);
}
void npc_add_item2(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1) {
n.AddItem(item_id, charges, equipitem, aug1);
}
void npc_add_item3(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2) {
n.AddItem(item_id, charges, equipitem, aug1, aug2);
}
void npc_add_item4(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3) {
n.AddItem(item_id, charges, equipitem, aug1, aug2, aug3);
}
void npc_add_item5(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4) {
n.AddItem(item_id, charges, equipitem, aug1, aug2, aug3, aug4);
}
void npc_add_item6(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
n.AddItem(item_id, charges, equipitem, aug1, aug2, aug3, aug4, aug5);
}
void npc_add_item7(NPC &n, uint32 item_id, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6) {
n.AddItem(item_id, charges, equipitem, aug1, aug2, aug3, aug4, aug5, aug6);
}
void npc_add_loot_table(NPC &n) {
n.AddLootTable();
}
void npc_add_loot_table1(NPC &n, uint32 ltid) {
n.AddLootTable(ltid);
}
void npc_remove_item(NPC &n, uint32 item_id) {
n.RemoveItem(item_id);
}
void npc_remove_item1(NPC &n, uint32 item_id, uint16 quantity) {
n.RemoveItem(item_id, quantity);
}
void npc_remove_item2(NPC &n, uint32 item_id, uint16 quantity, uint16 slot) {
n.RemoveItem(item_id, quantity, slot);
}
void npc_add_cash(NPC &n, uint16 copper, uint16 silver, uint16 gold, uint16 plat) {
n.AddCash(copper, silver, gold, plat);
}
void npc_save_guard_spot(NPC &n) {
n.SaveGuardSpot();
}
void npc_save_guard_spot1(NPC &n, bool clear_guard_spot) {
n.SaveGuardSpot(clear_guard_spot);
}
void npc_ai_set_roambox(NPC &n, float max_distance, float variance) {
n.AI_SetRoambox(max_distance, variance);
}
void npc_ai_set_roambox1(NPC &n, float max_distance, float variance, uint32 delay) {
n.AI_SetRoambox(max_distance, variance, delay);
}
void npc_ai_set_roambox2(NPC &n, float max_distance, float variance, uint32 delay, uint32 min_delay) {
n.AI_SetRoambox(max_distance, variance, delay, min_delay);
}
float npc_get_spawn_point_x(NPC &n) {
return n.GetSpawnPoint().x;
}
float npc_get_spawn_point_y(NPC &n) {
return n.GetSpawnPoint().y;
}
float npc_get_spawn_point_z(NPC &n) {
return n.GetSpawnPoint().z;
}
float npc_get_spawn_point_h(NPC &n) {
return n.GetSpawnPoint().w;
}
float npc_get_guard_point_x(NPC &n) {
return n.GetGuardPoint().x;
}
float npc_get_guard_point_y(NPC &n) {
return n.GetGuardPoint().y;
}
float npc_get_guard_point_z(NPC &n) {
return n.GetGuardPoint().z;
}
float npc_get_guard_point_h(NPC &n) {
return n.GetGuardPoint().w;
}
void npc_add_ai_spell(NPC &n, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust) {
return n.AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, 0, 0);
}
void npc_add_ai_spell1(NPC &n, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust, int min_hp) {
return n.AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, min_hp, 0);
}
void npc_add_ai_spell2(NPC &n, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust, int min_hp, int max_hp) {
return n.AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, min_hp, max_hp);
}
void lua_register_npc(sol::state *state) {
auto npc = state->create_simple_usertype<NPC>(sol::base_classes, sol::bases<Mob, Entity>());
npc.set("Signal", &NPC::Signal);
npc.set("CheckNPCFactionAlly", &NPC::CheckNPCFactionAlly);
npc.set("AddItem", sol::overload(
&npc_add_item,
&npc_add_item1,
&npc_add_item2,
&npc_add_item3,
&npc_add_item4,
&npc_add_item5,
&npc_add_item6,
&npc_add_item7
));
npc.set("AddLootTable", sol::overload(
&npc_add_loot_table,
&npc_add_loot_table1
));
npc.set("RemoveItem", sol::overload(
&npc_remove_item,
&npc_remove_item1,
&npc_remove_item2
));
npc.set("ClearItemList", &NPC::ClearItemList);
npc.set("AddCash", &npc_add_cash);
npc.set("RemoveCash", &NPC::RemoveCash);
npc.set("CountLoot", &NPC::CountLoot);
npc.set("GetLoottableID", &NPC::GetLoottableID);
npc.set("GetCopper", &NPC::GetCopper);
npc.set("GetSilver", &NPC::GetSilver);
npc.set("GetGold", &NPC::GetGold);
npc.set("GetPlatinum", &NPC::GetPlatinum);
npc.set("SetCopper", &NPC::SetCopper);
npc.set("SetSilver", &NPC::SetSilver);
npc.set("SetGold", &NPC::SetGold);
npc.set("SetPlatinum", &NPC::SetPlatinum);
npc.set("SetGrid", &NPC::SetGrid);
npc.set("SetSaveWaypoint", &NPC::SetSaveWaypoint);
npc.set("SetSp2", &NPC::SetSp2);
npc.set("GetWaypointMax", &NPC::GetWaypointMax);
npc.set("GetGrid", &NPC::GetGrid);
npc.set("GetSp2", &NPC::GetSp2);
npc.set("GetNPCFactionID", &NPC::GetNPCFactionID);
npc.set("GetPrimaryFaction", &NPC::GetPrimaryFaction);
npc.set("GetNPCHate", &NPC::GetNPCHate);
npc.set("IsOnHatelist", &NPC::IsOnHatelist);
npc.set("SetNPCFactionID", &NPC::SetNPCFactionID);
npc.set("GetMaxDMG", &NPC::GetMaxDMG);
npc.set("GetMinDMG", &NPC::GetMinDMG);
npc.set("IsAnimal", &NPC::IsAnimal);
npc.set("GetPetSpellID", &NPC::GetPetSpellID);
npc.set("SetPetSpellID", &NPC::SetPetSpellID);
npc.set("GetMaxDamage", &NPC::GetMaxDamage);
npc.set("SetTaunting", &NPC::SetTaunting);
npc.set("PickPocket", &NPC::PickPocket);
npc.set("StartSwarmTimer", &NPC::StartSwarmTimer);
npc.set("DoClassAttacks", &NPC::DoClassAttacks);
npc.set("GetMaxWp", &NPC::GetMaxWp);
npc.set("DisplayWaypointInfo", &NPC::DisplayWaypointInfo);
npc.set("CalculateNewWaypoint", &NPC::CalculateNewWaypoint);
npc.set("AssignWaypoints", &NPC::AssignWaypoints);
npc.set("SetWaypointPause", &NPC::SetWaypointPause);
npc.set("UpdateWaypoint", &NPC::UpdateWaypoint);
npc.set("StopWandering", &NPC::StopWandering);
npc.set("ResumeWandering", &NPC::ResumeWandering);
npc.set("PauseWandering", &NPC::PauseWandering);
npc.set("MoveTo", &NPC::MoveTo);
npc.set("NextGuardPosition", &NPC::NextGuardPosition);
npc.set("SaveGuardSpot", sol::overload(
&npc_save_guard_spot,
&npc_save_guard_spot1
));
npc.set("IsGuarding", &NPC::IsGuarding);
npc.set("AI_SetRoambox", sol::overload(
&npc_ai_set_roambox,
&npc_ai_set_roambox1
));
npc.set("GetNPCSpellsID", &NPC::GetNPCSpellsID);
npc.set("GetSpawnPointID", &NPC::GetSpawnPointID);
npc.set("GetSpawnPointX", &npc_get_spawn_point_x);
npc.set("GetSpawnPointY", &npc_get_spawn_point_y);
npc.set("GetSpawnPointZ", &npc_get_spawn_point_z);
npc.set("GetSpawnPointH", &npc_get_spawn_point_h);
npc.set("GetGuardPointX", &npc_get_guard_point_x);
npc.set("GetGuardPointY", &npc_get_guard_point_y);
npc.set("GetGuardPointZ", &npc_get_guard_point_z);
npc.set("GetGuardPointH", &npc_get_guard_point_h);
npc.set("SetPrimSkill", &NPC::SetPrimSkill);
npc.set("SetSecSkill", &NPC::SetSecSkill);
npc.set("GetPrimSkill", &NPC::GetPrimSkill);
npc.set("GetSecSkill", &NPC::GetSecSkill);
npc.set("GetSwarmOwner", &NPC::GetSwarmOwner);
npc.set("GetSwarmTarget", &NPC::GetSwarmTarget);
npc.set("SetSwarmTarget", &NPC::SetSwarmTarget);
npc.set("ModifyNPCStat", &NPC::ModifyNPCStat);
npc.set("AI_SetRoambox", sol::overload(
&npc_add_ai_spell,
&npc_add_ai_spell1,
&npc_add_ai_spell2
));
npc.set("RemoveAISpell", &NPC::RemoveSpellFromNPCList);
npc.set("SetSpellFocusDMG", &NPC::SetSpellFocusDMG);
npc.set("SetSpellFocusHeal", &NPC::SetSpellFocusHeal);
npc.set("GetSpellFocusDMG", &NPC::GetSpellFocusDMG);
npc.set("GetSpellFocusHeal", &NPC::GetSpellFocusHeal);
npc.set("GetSlowMitigation", &NPC::GetSlowMitigation);
npc.set("GetAttackSpeed", &NPC::GetAttackSpeed);
npc.set("GetAttackDelay", &NPC::GetAttackDelay);
npc.set("GetAccuracyRating", &NPC::GetAccuracyRating);
npc.set("GetSpawnKillCount", &NPC::GetSpawnKillCount);
npc.set("GetScore", &NPC::GetScore);
npc.set("MerchantOpenShop", &NPC::MerchantOpenShop);
npc.set("MerchantCloseShop", &NPC::MerchantCloseShop);
npc.set("GetRawAC", &NPC::GetRawAC);
npc.set("GetAvoidanceRating", &NPC::GetAvoidanceRating);
state->set_usertype("NPC", npc);
}
+36
View File
@@ -0,0 +1,36 @@
#include <sol.hpp>
#include "../object.h"
void lua_register_object(sol::state *state) {
auto object = state->create_simple_usertype<Object>(sol::base_classes, sol::bases<Entity>());
object.set("Depop", &Object::Depop);
object.set("Repop", &Object::Repop);
object.set("SetModelName", &Object::SetModelName);
object.set("GetModelName", &Object::GetModelName);
object.set("GetX", &Object::GetX);
object.set("GetY", &Object::GetY);
object.set("GetZ", &Object::GetZ);
object.set("GetHeading", &Object::GetHeading);
object.set("SetX", &Object::SetX);
object.set("SetY", &Object::SetY);
object.set("SetZ", &Object::SetZ);
object.set("SetHeading", &Object::SetHeading);
object.set("SetLocation", &Object::SetLocation);
object.set("SetItemID", &Object::SetItemID);
object.set("SetIcon", &Object::SetIcon);
object.set("GetIcon", &Object::GetIcon);
object.set("SetType", &Object::SetType);
object.set("GetType", &Object::GetType);
object.set("GetDBID", &Object::GetDBID);
object.set("ClearUser", &Object::ClearUser);
object.set("Save", &Object::Save);
object.set("VarSave", &Object::VarSave);
object.set("DeleteItem", &Object::DeleteItem);
object.set("StartDecay", &Object::StartDecay);
object.set("Delete", sol::overload((void(Object::*)())&Object::Delete, (void(Object::*)(bool))&Object::Delete));
object.set("IsGroundSpawn", &Object::IsGroundSpawn);
object.set("GetEntityVariable", &Object::GetEntityVariable);
object.set("SetEntityVariable", &Object::SetEntityVariable);
object.set("EntityVariableExists", &Object::EntityVariableExists);
state->set_usertype("Object", object);
}
File diff suppressed because it is too large Load Diff
+16 -47
View File
@@ -1,20 +1,9 @@
#ifndef _EQE_LUA_PARSER_H
#define _EQE_LUA_PARSER_H
#ifdef LUA_EQEMU
#include "quest_parser_collection.h"
#include "quest_interface.h"
#pragma once
#include "../quest_parser_collection.h"
#include "../quest_interface.h"
#include <string>
#include <list>
#include <map>
#include <exception>
#include <sol_forward.hpp>
#include "zone_config.h"
#include "lua_mod.h"
extern const ZoneConfig *Config;
struct lua_State;
class Client;
class NPC;
@@ -23,15 +12,6 @@ namespace EQEmu
class ItemInstance;
}
#include "lua_parser_events.h"
struct lua_registered_event;
namespace luabind {
namespace adl {
class object;
}
}
class LuaParser : public QuestInterface {
public:
~LuaParser();
@@ -87,7 +67,7 @@ public:
return &inst;
}
bool HasFunction(std::string function, std::string package_name);
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);
@@ -102,36 +82,25 @@ public:
private:
LuaParser();
LuaParser(const LuaParser&);
LuaParser& operator=(const 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, luabind::adl::object *l_func = nullptr);
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, luabind::adl::object *l_func = nullptr);
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, luabind::adl::object *l_func = nullptr);
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, luabind::adl::object *l_func = nullptr);
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(std::string filename, std::string package_name);
void MapFunctions(lua_State *L);
void LoadScript(const std::string &filename);
void LoadScript(const std::string &filename, const std::string &package_name);
void MapFunctions();
QuestEventID ConvertLuaEvent(QuestEventID evt);
std::map<std::string, std::string> vars_;
std::map<std::string, bool> loaded_;
std::vector<LuaMod> mods_;
lua_State *L;
NPCArgumentHandler NPCArgumentDispatch[_LargestEventID];
PlayerArgumentHandler PlayerArgumentDispatch[_LargestEventID];
ItemArgumentHandler ItemArgumentDispatch[_LargestEventID];
SpellArgumentHandler SpellArgumentDispatch[_LargestEventID];
EncounterArgumentHandler EncounterArgumentDispatch[_LargestEventID];
struct Implementation;
std::unique_ptr<Implementation> mImpl;
};
#endif
#endif
+6
View File
@@ -0,0 +1,6 @@
#include <sol.hpp>
#include "../mob.h"
void lua_register_special_abilities(sol::state *state) {
state->create_named_table("SpecialAbility");
}
+7
View File
@@ -0,0 +1,7 @@
#pragma once
struct Script
{
bool Loaded;
sol::environment Env;
};
@@ -37,240 +37,240 @@ struct Filters { };
struct MessageTypes { };
struct Rule { };
struct lua_registered_event {
std::string encounter_name;
luabind::adl::object lua_reference;
QuestEventID event_id;
};
extern std::map<std::string, std::list<lua_registered_event>> lua_encounter_events_registered;
extern std::map<std::string, bool> lua_encounters_loaded;
extern std::map<std::string, Encounter *> lua_encounters;
extern void MapOpcodes();
extern void ClearMappedOpcode(EmuOpcode op);
void unregister_event(std::string package_name, std::string name, int evt);
void load_encounter(std::string name) {
if(lua_encounters_loaded.count(name) > 0)
return;
auto enc = new Encounter(name.c_str());
entity_list.AddEncounter(enc);
lua_encounters[name] = enc;
lua_encounters_loaded[name] = true;
parse->EventEncounter(EVENT_ENCOUNTER_LOAD, name, "", 0);
}
void load_encounter_with_data(std::string name, std::string info_str) {
if(lua_encounters_loaded.count(name) > 0)
return;
auto enc = new Encounter(name.c_str());
entity_list.AddEncounter(enc);
lua_encounters[name] = enc;
lua_encounters_loaded[name] = true;
std::vector<EQEmu::Any> info_ptrs;
info_ptrs.push_back(&info_str);
parse->EventEncounter(EVENT_ENCOUNTER_LOAD, name, "", 0, &info_ptrs);
}
void unload_encounter(std::string name) {
if(lua_encounters_loaded.count(name) == 0)
return;
auto liter = lua_encounter_events_registered.begin();
while(liter != lua_encounter_events_registered.end()) {
std::list<lua_registered_event> &elist = liter->second;
auto iter = elist.begin();
while(iter != elist.end()) {
if((*iter).encounter_name.compare(name) == 0) {
iter = elist.erase(iter);
} else {
++iter;
}
}
if(elist.size() == 0) {
lua_encounter_events_registered.erase(liter++);
} else {
++liter;
}
}
lua_encounters[name]->Depop();
lua_encounters.erase(name);
lua_encounters_loaded.erase(name);
parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, "", 0);
}
void unload_encounter_with_data(std::string name, std::string info_str) {
if(lua_encounters_loaded.count(name) == 0)
return;
auto liter = lua_encounter_events_registered.begin();
while(liter != lua_encounter_events_registered.end()) {
std::list<lua_registered_event> &elist = liter->second;
auto iter = elist.begin();
while(iter != elist.end()) {
if((*iter).encounter_name.compare(name) == 0) {
iter = elist.erase(iter);
}
else {
++iter;
}
}
if(elist.size() == 0) {
lua_encounter_events_registered.erase(liter++);
}
else {
++liter;
}
}
lua_encounters[name]->Depop();
lua_encounters.erase(name);
lua_encounters_loaded.erase(name);
std::vector<EQEmu::Any> info_ptrs;
info_ptrs.push_back(&info_str);
parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, "", 0, &info_ptrs);
}
void register_event(std::string package_name, std::string name, int evt, luabind::adl::object func) {
if(lua_encounters_loaded.count(name) == 0)
return;
unregister_event(package_name, name, evt);
lua_registered_event e;
e.encounter_name = name;
e.lua_reference = func;
e.event_id = static_cast<QuestEventID>(evt);
auto liter = lua_encounter_events_registered.find(package_name);
if(liter == lua_encounter_events_registered.end()) {
std::list<lua_registered_event> elist;
elist.push_back(e);
lua_encounter_events_registered[package_name] = elist;
} else {
std::list<lua_registered_event> &elist = liter->second;
elist.push_back(e);
}
}
void unregister_event(std::string package_name, std::string name, int evt) {
auto liter = lua_encounter_events_registered.find(package_name);
if(liter != lua_encounter_events_registered.end()) {
std::list<lua_registered_event> elist = liter->second;
auto iter = elist.begin();
while(iter != elist.end()) {
if(iter->event_id == evt && iter->encounter_name.compare(name) == 0) {
iter = elist.erase(iter);
break;
}
++iter;
}
lua_encounter_events_registered[package_name] = elist;
}
}
void register_npc_event(std::string name, int evt, int npc_id, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
std::stringstream package_name;
package_name << "npc_" << npc_id;
register_event(package_name.str(), name, evt, func);
}
}
void register_npc_event(int evt, int npc_id, luabind::adl::object func) {
std::string name = quest_manager.GetEncounter();
register_npc_event(name, evt, npc_id, func);
}
void unregister_npc_event(std::string name, int evt, int npc_id) {
std::stringstream package_name;
package_name << "npc_" << npc_id;
unregister_event(package_name.str(), name, evt);
}
void unregister_npc_event(int evt, int npc_id) {
std::string name = quest_manager.GetEncounter();
unregister_npc_event(name, evt, npc_id);
}
void register_player_event(std::string name, int evt, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
register_event("player", name, evt, func);
}
}
void register_player_event(int evt, luabind::adl::object func) {
std::string name = quest_manager.GetEncounter();
register_player_event(name, evt, func);
}
void unregister_player_event(std::string name, int evt) {
unregister_event("player", name, evt);
}
void unregister_player_event(int evt) {
std::string name = quest_manager.GetEncounter();
unregister_player_event(name, evt);
}
void register_item_event(std::string name, int evt, int item_id, luabind::adl::object func) {
std::string package_name = "item_";
package_name += std::to_string(item_id);
if(luabind::type(func) == LUA_TFUNCTION) {
register_event(package_name, name, evt, func);
}
}
void register_item_event(int evt, int item_id, luabind::adl::object func) {
std::string name = quest_manager.GetEncounter();
register_item_event(name, evt, item_id, func);
}
void unregister_item_event(std::string name, int evt, int item_id) {
std::string package_name = "item_";
package_name += std::to_string(item_id);
unregister_event(package_name, name, evt);
}
void unregister_item_event(int evt, int item_id) {
std::string name = quest_manager.GetEncounter();
unregister_item_event(name, evt, item_id);
}
void register_spell_event(std::string name, int evt, int spell_id, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
std::stringstream package_name;
package_name << "spell_" << spell_id;
register_event(package_name.str(), name, evt, func);
}
}
void register_spell_event(int evt, int spell_id, luabind::adl::object func) {
std::string name = quest_manager.GetEncounter();
register_spell_event(name, evt, spell_id, func);
}
void unregister_spell_event(std::string name, int evt, int spell_id) {
std::stringstream package_name;
package_name << "spell_" << spell_id;
unregister_event(package_name.str(), name, evt);
}
void unregister_spell_event(int evt, int spell_id) {
std::string name = quest_manager.GetEncounter();
unregister_spell_event(name, evt, spell_id);
}
//struct lua_registered_event {
// std::string encounter_name;
// luabind::adl::object lua_reference;
// QuestEventID event_id;
//};
//
//extern std::map<std::string, std::list<lua_registered_event>> lua_encounter_events_registered;
//extern std::map<std::string, bool> lua_encounters_loaded;
//extern std::map<std::string, Encounter *> lua_encounters;
//
//extern void MapOpcodes();
//extern void ClearMappedOpcode(EmuOpcode op);
//
//void unregister_event(std::string package_name, std::string name, int evt);
//
//void load_encounter(std::string name) {
// if(lua_encounters_loaded.count(name) > 0)
// return;
// auto enc = new Encounter(name.c_str());
// entity_list.AddEncounter(enc);
// lua_encounters[name] = enc;
// lua_encounters_loaded[name] = true;
// parse->EventEncounter(EVENT_ENCOUNTER_LOAD, name, "", 0);
//}
//
//void load_encounter_with_data(std::string name, std::string info_str) {
// if(lua_encounters_loaded.count(name) > 0)
// return;
// auto enc = new Encounter(name.c_str());
// entity_list.AddEncounter(enc);
// lua_encounters[name] = enc;
// lua_encounters_loaded[name] = true;
// std::vector<EQEmu::Any> info_ptrs;
// info_ptrs.push_back(&info_str);
// parse->EventEncounter(EVENT_ENCOUNTER_LOAD, name, "", 0, &info_ptrs);
//}
//
//void unload_encounter(std::string name) {
// if(lua_encounters_loaded.count(name) == 0)
// return;
//
// auto liter = lua_encounter_events_registered.begin();
// while(liter != lua_encounter_events_registered.end()) {
// std::list<lua_registered_event> &elist = liter->second;
// auto iter = elist.begin();
// while(iter != elist.end()) {
// if((*iter).encounter_name.compare(name) == 0) {
// iter = elist.erase(iter);
// } else {
// ++iter;
// }
// }
//
// if(elist.size() == 0) {
// lua_encounter_events_registered.erase(liter++);
// } else {
// ++liter;
// }
// }
//
// lua_encounters[name]->Depop();
// lua_encounters.erase(name);
// lua_encounters_loaded.erase(name);
// parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, "", 0);
//}
//
//void unload_encounter_with_data(std::string name, std::string info_str) {
// if(lua_encounters_loaded.count(name) == 0)
// return;
//
// auto liter = lua_encounter_events_registered.begin();
// while(liter != lua_encounter_events_registered.end()) {
// std::list<lua_registered_event> &elist = liter->second;
// auto iter = elist.begin();
// while(iter != elist.end()) {
// if((*iter).encounter_name.compare(name) == 0) {
// iter = elist.erase(iter);
// }
// else {
// ++iter;
// }
// }
//
// if(elist.size() == 0) {
// lua_encounter_events_registered.erase(liter++);
// }
// else {
// ++liter;
// }
// }
//
// lua_encounters[name]->Depop();
// lua_encounters.erase(name);
// lua_encounters_loaded.erase(name);
// std::vector<EQEmu::Any> info_ptrs;
// info_ptrs.push_back(&info_str);
// parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, "", 0, &info_ptrs);
//}
//
//void register_event(std::string package_name, std::string name, int evt, luabind::adl::object func) {
// if(lua_encounters_loaded.count(name) == 0)
// return;
//
// unregister_event(package_name, name, evt);
//
// lua_registered_event e;
// e.encounter_name = name;
// e.lua_reference = func;
// e.event_id = static_cast<QuestEventID>(evt);
//
// auto liter = lua_encounter_events_registered.find(package_name);
// if(liter == lua_encounter_events_registered.end()) {
// std::list<lua_registered_event> elist;
// elist.push_back(e);
// lua_encounter_events_registered[package_name] = elist;
// } else {
// std::list<lua_registered_event> &elist = liter->second;
// elist.push_back(e);
// }
//}
//
//void unregister_event(std::string package_name, std::string name, int evt) {
// auto liter = lua_encounter_events_registered.find(package_name);
// if(liter != lua_encounter_events_registered.end()) {
// std::list<lua_registered_event> elist = liter->second;
// auto iter = elist.begin();
// while(iter != elist.end()) {
// if(iter->event_id == evt && iter->encounter_name.compare(name) == 0) {
// iter = elist.erase(iter);
// break;
// }
// ++iter;
// }
// lua_encounter_events_registered[package_name] = elist;
// }
//}
//
//void register_npc_event(std::string name, int evt, int npc_id, luabind::adl::object func) {
// if(luabind::type(func) == LUA_TFUNCTION) {
// std::stringstream package_name;
// package_name << "npc_" << npc_id;
//
// register_event(package_name.str(), name, evt, func);
// }
//}
//
//void register_npc_event(int evt, int npc_id, luabind::adl::object func) {
// std::string name = quest_manager.GetEncounter();
// register_npc_event(name, evt, npc_id, func);
//}
//
//void unregister_npc_event(std::string name, int evt, int npc_id) {
// std::stringstream package_name;
// package_name << "npc_" << npc_id;
//
// unregister_event(package_name.str(), name, evt);
//}
//
//void unregister_npc_event(int evt, int npc_id) {
// std::string name = quest_manager.GetEncounter();
// unregister_npc_event(name, evt, npc_id);
//}
//
//void register_player_event(std::string name, int evt, luabind::adl::object func) {
// if(luabind::type(func) == LUA_TFUNCTION) {
// register_event("player", name, evt, func);
// }
//}
//
//void register_player_event(int evt, luabind::adl::object func) {
// std::string name = quest_manager.GetEncounter();
// register_player_event(name, evt, func);
//}
//
//void unregister_player_event(std::string name, int evt) {
// unregister_event("player", name, evt);
//}
//
//void unregister_player_event(int evt) {
// std::string name = quest_manager.GetEncounter();
// unregister_player_event(name, evt);
//}
//
//void register_item_event(std::string name, int evt, int item_id, luabind::adl::object func) {
// std::string package_name = "item_";
// package_name += std::to_string(item_id);
//
// if(luabind::type(func) == LUA_TFUNCTION) {
// register_event(package_name, name, evt, func);
// }
//}
//
//void register_item_event(int evt, int item_id, luabind::adl::object func) {
// std::string name = quest_manager.GetEncounter();
// register_item_event(name, evt, item_id, func);
//}
//
//void unregister_item_event(std::string name, int evt, int item_id) {
// std::string package_name = "item_";
// package_name += std::to_string(item_id);
//
// unregister_event(package_name, name, evt);
//}
//
//void unregister_item_event(int evt, int item_id) {
// std::string name = quest_manager.GetEncounter();
// unregister_item_event(name, evt, item_id);
//}
//
//void register_spell_event(std::string name, int evt, int spell_id, luabind::adl::object func) {
// if(luabind::type(func) == LUA_TFUNCTION) {
// std::stringstream package_name;
// package_name << "spell_" << spell_id;
//
// register_event(package_name.str(), name, evt, func);
// }
//}
//
//void register_spell_event(int evt, int spell_id, luabind::adl::object func) {
// std::string name = quest_manager.GetEncounter();
// register_spell_event(name, evt, spell_id, func);
//}
//
//void unregister_spell_event(std::string name, int evt, int spell_id) {
// std::stringstream package_name;
// package_name << "spell_" << spell_id;
//
// unregister_event(package_name.str(), name, evt);
//}
//
//void unregister_spell_event(int evt, int spell_id) {
// std::string name = quest_manager.GetEncounter();
// unregister_spell_event(name, evt, spell_id);
//}
Lua_Mob lua_spawn2(int npc_type, int grid, int unused, double x, double y, double z, double heading) {
auto position = glm::vec4(x, y, z, heading);
@@ -2,11 +2,11 @@
#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 "../../common/spdat.h"
#include "../masterentity.h"
#include "../questmgr.h"
#include "../zone.h"
#include "../zone_config.h"
#include "lua_parser.h"
#include "lua_mod.h"
@@ -3,7 +3,7 @@
#include "lua.hpp"
#include <luabind/luabind.hpp>
#include "../common/spdat.h"
#include "../../common/spdat.h"
#include "lua_spell.h"
Lua_Spell::Lua_Spell(int id) {
-1374
View File
File diff suppressed because it is too large Load Diff
-55
View File
@@ -1,55 +0,0 @@
#ifndef EQEMU_LUA_PTR_H
#define EQEMU_LUA_PTR_H
#ifdef LUA_EQEMU
#ifndef EQEMU_UNSAFE_LUA
#define Lua_Safe_Call_Void() if(!d_) { return; } NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Bool() if(!d_) { return false; } NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Int() if(!d_) { return 0; } NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Real() if(!d_) { return 0.0; } NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_String() if(!d_) { return ""; } NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Class(type) if(!d_) { return type(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
#else
#define Lua_Safe_Call_Void() NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Bool() NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Int() NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Real() NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_String() NativeType *self = reinterpret_cast<NativeType*>(d_)
#define Lua_Safe_Call_Class(type) NativeType *self = reinterpret_cast<NativeType*>(d_)
#endif
template<typename T>
class Lua_Ptr
{
public:
Lua_Ptr() {
}
Lua_Ptr(T *d) : d_(d) {
}
~Lua_Ptr() {
}
T *GetLuaPtrData() {
return d_;
}
void SetLuaPtrData(T *d) {
d_ = d;
}
bool Null() {
return d_ == nullptr;
}
bool Valid() {
return d_ != nullptr;
}
protected:
T *d_;
};
#endif
#endif
-31
View File
@@ -3242,37 +3242,6 @@ void Mob::Warp(const glm::vec3& location)
SendPosition();
}
int16 Mob::GetResist(uint8 type) const
{
if (IsNPC())
{
if (type == 1)
return MR + spellbonuses.MR + itembonuses.MR;
else if (type == 2)
return FR + spellbonuses.FR + itembonuses.FR;
else if (type == 3)
return CR + spellbonuses.CR + itembonuses.CR;
else if (type == 4)
return PR + spellbonuses.PR + itembonuses.PR;
else if (type == 5)
return DR + spellbonuses.DR + itembonuses.DR;
}
else if (IsClient())
{
if (type == 1)
return CastToClient()->GetMR();
else if (type == 2)
return CastToClient()->GetFR();
else if (type == 3)
return CastToClient()->GetCR();
else if (type == 4)
return CastToClient()->GetPR();
else if (type == 5)
return CastToClient()->GetDR();
}
return 25;
}
uint32 Mob::GetLevelHP(uint8 tlevel)
{
int multiplier = 0;
+1 -1
View File
@@ -633,6 +633,7 @@ public:
//Quest
void CameraEffect(uint32 duration, uint32 intensity, Client *c = nullptr, bool global = false);
inline bool GetQglobal() const { return qglobal; }
virtual void Signal(int signal) { };
//Other Packet
void CreateDespawnPacket(EQApplicationPacket* app, bool Decay);
@@ -1020,7 +1021,6 @@ public:
bool CheckWillAggro(Mob *mob);
void InstillDoubt(Mob *who);
int16 GetResist(uint8 type) const;
Mob* GetShieldTarget() const { return shield_target; }
void SetShieldTarget(Mob* mob) { shield_target = mob; }
bool HasActiveSong() const { return(bardsong != 0); }
+1 -1
View File
@@ -60,7 +60,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "tasks.h"
#include "quest_parser_collection.h"
#include "embparser.h"
#include "lua_parser.h"
#include "lua/lua_parser.h"
#include "questmgr.h"
#include "../common/event/event_loop.h"
+2 -2
View File
@@ -2507,9 +2507,9 @@ int32 NPC::CalcMaxMana() {
}
}
void NPC::SignalNPC(int _signal_id)
void NPC::Signal(int signal)
{
signal_q.push_back(_signal_id);
signal_q.push_back(signal);
}
NPC_Emote_Struct* NPC::GetNPCEmote(uint16 emoteid, uint8 event_) {
+1 -1
View File
@@ -253,7 +253,7 @@ public:
void DepopSwarmPets();
void PetOnSpawn(NewSpawn_Struct* ns);
void SignalNPC(int _signal_id);
virtual void Signal(int signal);
inline int32 GetNPCFactionID() const { return npc_faction_id; }
inline int32 GetPrimaryFaction() const { return primary_faction; }
+1 -1
View File
@@ -62,7 +62,7 @@ XS(XS_NPC_SignalNPC) {
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->SignalNPC(_signal_id);
THIS->Signal(_signal_id);
}
XSRETURN_EMPTY;
}
+1 -1
View File
@@ -764,7 +764,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
int signal_id = c.on_change - SpawnCondition::DoSignalMin;
Log(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id);
if(npcthis != nullptr)
npcthis->SignalNPC(signal_id);
npcthis->Signal(signal_id);
}
}
+1 -1
View File
@@ -23,7 +23,7 @@
#include "entity.h"
#include "mob.h"
#include "string_ids.h"
#include "lua_parser.h"
#include "lua/lua_parser.h"
#include <string.h>
+1 -1
View File
@@ -1840,7 +1840,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
CZNPCSignal_Struct* CZCN = (CZNPCSignal_Struct*)pack->pBuffer;
NPC* n = entity_list.GetNPCByNPCTypeID(CZCN->npctype_id);
if (n != 0) {
n->SignalNPC(CZCN->data);
n->Signal(CZCN->data);
}
break;
}