mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
Implemented LUA counterpart of EVENT_ENVIRONMENTAL_DAMAGE
This commit is contained in:
parent
8229a578ee
commit
39a47ceb93
@ -10,6 +10,7 @@ Akkadius: Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"
|
|||||||
quest::debug("env_final_damage is " . $env_final_damage);
|
quest::debug("env_final_damage is " . $env_final_damage);
|
||||||
}
|
}
|
||||||
Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
|
Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
|
||||||
|
- Implemented LUA counterpart of this same implementation above
|
||||||
|
|
||||||
== 01/29/2015 ==
|
== 01/29/2015 ==
|
||||||
Trevius: Added more information to Mercenary Logging.
|
Trevius: Added more information to Mercenary Logging.
|
||||||
|
|||||||
@ -1612,6 +1612,7 @@ luabind::scope lua_register_events() {
|
|||||||
luabind::value("cast_on", static_cast<int>(EVENT_CAST_ON)),
|
luabind::value("cast_on", static_cast<int>(EVENT_CAST_ON)),
|
||||||
luabind::value("task_accepted", static_cast<int>(EVENT_TASK_ACCEPTED)),
|
luabind::value("task_accepted", static_cast<int>(EVENT_TASK_ACCEPTED)),
|
||||||
luabind::value("task_stage_complete", static_cast<int>(EVENT_TASK_STAGE_COMPLETE)),
|
luabind::value("task_stage_complete", static_cast<int>(EVENT_TASK_STAGE_COMPLETE)),
|
||||||
|
luabind::value("environmental_damage", static_cast<int>(EVENT_ENVIRONMENTAL_DAMAGE)),
|
||||||
luabind::value("task_update", static_cast<int>(EVENT_TASK_UPDATE)),
|
luabind::value("task_update", static_cast<int>(EVENT_TASK_UPDATE)),
|
||||||
luabind::value("task_complete", static_cast<int>(EVENT_TASK_COMPLETE)),
|
luabind::value("task_complete", static_cast<int>(EVENT_TASK_COMPLETE)),
|
||||||
luabind::value("task_fail", static_cast<int>(EVENT_TASK_FAIL)),
|
luabind::value("task_fail", static_cast<int>(EVENT_TASK_FAIL)),
|
||||||
|
|||||||
@ -42,6 +42,7 @@ const char *LuaEvents[_LargestEventID] = {
|
|||||||
"event_spawn",
|
"event_spawn",
|
||||||
"event_attack",
|
"event_attack",
|
||||||
"event_combat",
|
"event_combat",
|
||||||
|
"event_environmental_damage",
|
||||||
"event_aggro",
|
"event_aggro",
|
||||||
"event_slay",
|
"event_slay",
|
||||||
"event_npc_slay",
|
"event_npc_slay",
|
||||||
@ -164,6 +165,7 @@ LuaParser::LuaParser() {
|
|||||||
NPCArgumentDispatch[EVENT_LEAVE_AREA] = handle_npc_area;
|
NPCArgumentDispatch[EVENT_LEAVE_AREA] = handle_npc_area;
|
||||||
|
|
||||||
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
||||||
|
PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage;
|
||||||
PlayerArgumentDispatch[EVENT_DEATH] = handle_player_death;
|
PlayerArgumentDispatch[EVENT_DEATH] = handle_player_death;
|
||||||
PlayerArgumentDispatch[EVENT_DEATH_COMPLETE] = handle_player_death;
|
PlayerArgumentDispatch[EVENT_DEATH_COMPLETE] = handle_player_death;
|
||||||
PlayerArgumentDispatch[EVENT_TIMER] = handle_player_timer;
|
PlayerArgumentDispatch[EVENT_TIMER] = handle_player_timer;
|
||||||
|
|||||||
@ -246,6 +246,19 @@ void handle_player_say(QuestInterface *parse, lua_State* L, Client* client, std:
|
|||||||
lua_setfield(L, -2, "language");
|
lua_setfield(L, -2, "language");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_player_environmental_damage(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
|
std::vector<EQEmu::Any> *extra_pointers){
|
||||||
|
Seperator sep(data.c_str());
|
||||||
|
lua_pushinteger(L, std::stoi(sep.arg[0]));
|
||||||
|
lua_setfield(L, -2, "env_damage");
|
||||||
|
|
||||||
|
lua_pushinteger(L, std::stoi(sep.arg[1]));
|
||||||
|
lua_setfield(L, -2, "env_damage_type");
|
||||||
|
|
||||||
|
lua_pushinteger(L, std::stoi(sep.arg[2]));
|
||||||
|
lua_setfield(L, -2, "env_final_damage");
|
||||||
|
}
|
||||||
|
|
||||||
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
std::vector<EQEmu::Any> *extra_pointers) {
|
std::vector<EQEmu::Any> *extra_pointers) {
|
||||||
Seperator sep(data.c_str());
|
Seperator sep(data.c_str());
|
||||||
|
|||||||
@ -44,6 +44,8 @@ void handle_npc_null(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, s
|
|||||||
//Player
|
//Player
|
||||||
void handle_player_say(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
void handle_player_say(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
std::vector<EQEmu::Any> *extra_pointers);
|
std::vector<EQEmu::Any> *extra_pointers);
|
||||||
|
void handle_player_environmental_damage(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
|
std::vector<EQEmu::Any> *extra_pointers)
|
||||||
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
std::vector<EQEmu::Any> *extra_pointers);
|
std::vector<EQEmu::Any> *extra_pointers);
|
||||||
void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user