mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Quest API] Add EVENT_COMBINE to Perl and Lua. (#1536)
- Exports $container_slot in Perl. - Exports e.container_slot in Lua. Allows you to perform events when clicking combine in a tradeskill container.
This commit is contained in:
parent
80493719f2
commit
8eef7bb283
@ -122,6 +122,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_BOT_COMMAND",
|
||||
"EVENT_WARP",
|
||||
"EVENT_TEST_BUFF",
|
||||
"EVENT_COMBINE",
|
||||
"EVENT_CONSIDER",
|
||||
"EVENT_CONSIDER_CORPSE"
|
||||
};
|
||||
@ -1657,6 +1658,11 @@ void PerlembParser::ExportEventVariables(
|
||||
break;
|
||||
}
|
||||
|
||||
case EVENT_COMBINE: {
|
||||
ExportVar(package_name.c_str(), "container_slot", std::stoi(data));
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -90,6 +90,7 @@ typedef enum {
|
||||
EVENT_BOT_COMMAND,
|
||||
EVENT_WARP,
|
||||
EVENT_TEST_BUFF,
|
||||
EVENT_COMBINE,
|
||||
EVENT_CONSIDER,
|
||||
EVENT_CONSIDER_CORPSE,
|
||||
_LargestEventID
|
||||
|
||||
@ -133,6 +133,7 @@ const char *LuaEvents[_LargestEventID] = {
|
||||
"event_bot_command",
|
||||
"event_warp",
|
||||
"event_test_buff",
|
||||
"event_combine",
|
||||
"event_consider",
|
||||
"event_consider_corpse"
|
||||
};
|
||||
@ -222,6 +223,7 @@ LuaParser::LuaParser() {
|
||||
PlayerArgumentDispatch[EVENT_COMBINE_VALIDATE] = handle_player_combine_validate;
|
||||
PlayerArgumentDispatch[EVENT_BOT_COMMAND] = handle_player_bot_command;
|
||||
PlayerArgumentDispatch[EVENT_WARP] = handle_player_warp;
|
||||
PlayerArgumentDispatch[EVENT_COMBINE] = handle_player_quest_combine;
|
||||
PlayerArgumentDispatch[EVENT_CONSIDER] = handle_player_consider;
|
||||
PlayerArgumentDispatch[EVENT_CONSIDER_CORPSE] = handle_player_consider_corpse;
|
||||
|
||||
|
||||
@ -573,6 +573,11 @@ void handle_player_warp(QuestInterface* parse, lua_State* L, Client* client, std
|
||||
lua_setfield(L, -2, "from_z");
|
||||
}
|
||||
|
||||
void handle_player_quest_combine(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQ::Any>* extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "container_slot");
|
||||
}
|
||||
|
||||
void handle_player_consider(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQ::Any>* extra_pointers) {
|
||||
lua_pushinteger(L, std::stoi(data));
|
||||
lua_setfield(L, -2, "entity_id");
|
||||
|
||||
@ -105,6 +105,8 @@ void handle_player_bot_command(QuestInterface *parse, lua_State* L, Client* clie
|
||||
std::vector<EQ::Any> *extra_pointers);
|
||||
void handle_player_warp(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQ::Any>* extra_pointers);
|
||||
void handle_player_quest_combine(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQ::Any>* extra_pointers);
|
||||
void handle_player_consider(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
std::vector<EQ::Any>* extra_pointers);
|
||||
void handle_player_consider_corpse(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||
|
||||
@ -375,6 +375,14 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
}
|
||||
|
||||
DBTradeskillRecipe_Struct spec;
|
||||
|
||||
if (parse->EventPlayer(EVENT_COMBINE, user, std::to_string(in_combine->container_slot), 0) == 1) {
|
||||
auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
|
||||
user->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!content_db.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) {
|
||||
|
||||
LogTradeskillsDetail("[HandleCombine] Check 2");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user