mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
[Feature] Add player /inspect quest event (#2508)
Returning non-zero from EVENT_INSPECT will prevent default message
This commit is contained in:
parent
3bc5d4b125
commit
9e836a9780
@ -9155,7 +9155,13 @@ void Client::Handle_OP_LDoNInspect(const EQApplicationPacket *app)
|
|||||||
{
|
{
|
||||||
Mob * target = GetTarget();
|
Mob * target = GetTarget();
|
||||||
if (target && target->GetClass() == LDON_TREASURE && !target->IsAura())
|
if (target && target->GetClass() == LDON_TREASURE && !target->IsAura())
|
||||||
Message(Chat::Yellow, "%s", target->GetCleanName());
|
{
|
||||||
|
std::vector<std::any> args = { target };
|
||||||
|
if (parse->EventPlayer(EVENT_INSPECT, this, "", target->GetID(), &args) == 0)
|
||||||
|
{
|
||||||
|
Message(Chat::Yellow, "%s", target->GetCleanName());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_LDoNOpen(const EQApplicationPacket *app)
|
void Client::Handle_OP_LDoNOpen(const EQApplicationPacket *app)
|
||||||
|
|||||||
@ -158,7 +158,8 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
|||||||
"EVENT_ALT_CURRENCY_MERCHANT_BUY",
|
"EVENT_ALT_CURRENCY_MERCHANT_BUY",
|
||||||
"EVENT_ALT_CURRENCY_MERCHANT_SELL",
|
"EVENT_ALT_CURRENCY_MERCHANT_SELL",
|
||||||
"EVENT_MERCHANT_BUY",
|
"EVENT_MERCHANT_BUY",
|
||||||
"EVENT_MERCHANT_SELL"
|
"EVENT_MERCHANT_SELL",
|
||||||
|
"EVENT_INSPECT",
|
||||||
};
|
};
|
||||||
|
|
||||||
PerlembParser::PerlembParser() : perl(nullptr)
|
PerlembParser::PerlembParser() : perl(nullptr)
|
||||||
@ -1734,6 +1735,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EVENT_INSPECT: {
|
||||||
|
ExportVar(package_name.c_str(), "target_id", extradata);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,6 +102,7 @@ typedef enum {
|
|||||||
EVENT_ALT_CURRENCY_MERCHANT_SELL,
|
EVENT_ALT_CURRENCY_MERCHANT_SELL,
|
||||||
EVENT_MERCHANT_BUY,
|
EVENT_MERCHANT_BUY,
|
||||||
EVENT_MERCHANT_SELL,
|
EVENT_MERCHANT_SELL,
|
||||||
|
EVENT_INSPECT,
|
||||||
_LargestEventID
|
_LargestEventID
|
||||||
} QuestEventID;
|
} QuestEventID;
|
||||||
|
|
||||||
|
|||||||
@ -4306,7 +4306,8 @@ luabind::scope lua_register_events() {
|
|||||||
luabind::value("alt_currency_merchant_buy", static_cast<int>(EVENT_ALT_CURRENCY_MERCHANT_BUY)),
|
luabind::value("alt_currency_merchant_buy", static_cast<int>(EVENT_ALT_CURRENCY_MERCHANT_BUY)),
|
||||||
luabind::value("alt_currency_merchant_sell", static_cast<int>(EVENT_ALT_CURRENCY_MERCHANT_SELL)),
|
luabind::value("alt_currency_merchant_sell", static_cast<int>(EVENT_ALT_CURRENCY_MERCHANT_SELL)),
|
||||||
luabind::value("merchant_buy", static_cast<int>(EVENT_MERCHANT_BUY)),
|
luabind::value("merchant_buy", static_cast<int>(EVENT_MERCHANT_BUY)),
|
||||||
luabind::value("merchant_sell", static_cast<int>(EVENT_MERCHANT_SELL))
|
luabind::value("merchant_sell", static_cast<int>(EVENT_MERCHANT_SELL)),
|
||||||
|
luabind::value("inspect", static_cast<int>(EVENT_INSPECT))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,8 @@ const char *LuaEvents[_LargestEventID] = {
|
|||||||
"event_alt_currency_merchant_buy",
|
"event_alt_currency_merchant_buy",
|
||||||
"event_alt_currency_merchant_sell",
|
"event_alt_currency_merchant_sell",
|
||||||
"event_merchant_buy",
|
"event_merchant_buy",
|
||||||
"event_merchant_sell"
|
"event_merchant_sell",
|
||||||
|
"event_inspect",
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
@ -245,6 +246,7 @@ LuaParser::LuaParser() {
|
|||||||
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_MERCHANT_SELL] = handle_player_alt_currency_merchant;
|
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_MERCHANT_SELL] = handle_player_alt_currency_merchant;
|
||||||
PlayerArgumentDispatch[EVENT_MERCHANT_BUY] = handle_player_merchant;
|
PlayerArgumentDispatch[EVENT_MERCHANT_BUY] = handle_player_merchant;
|
||||||
PlayerArgumentDispatch[EVENT_MERCHANT_SELL] = handle_player_merchant;
|
PlayerArgumentDispatch[EVENT_MERCHANT_SELL] = handle_player_merchant;
|
||||||
|
PlayerArgumentDispatch[EVENT_INSPECT] = handle_player_inspect;
|
||||||
|
|
||||||
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
|
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
|
||||||
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;
|
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;
|
||||||
|
|||||||
@ -619,6 +619,13 @@ void handle_player_consider_corpse(QuestInterface* parse, lua_State* L, Client*
|
|||||||
lua_setfield(L, -2, "corpse_entity_id");
|
lua_setfield(L, -2, "corpse_entity_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_player_inspect(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<std::any>* extra_pointers) {
|
||||||
|
Lua_Mob l_mob(std::any_cast<Mob*>(extra_pointers->at(0)));
|
||||||
|
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
|
||||||
|
l_mob_o.push(L);
|
||||||
|
lua_setfield(L, -2, "other");
|
||||||
|
}
|
||||||
|
|
||||||
//Item
|
//Item
|
||||||
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQ::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQ::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||||
std::vector<std::any> *extra_pointers) {
|
std::vector<std::any> *extra_pointers) {
|
||||||
|
|||||||
@ -123,6 +123,8 @@ void handle_player_alt_currency_merchant(QuestInterface* parse, lua_State* L, Cl
|
|||||||
std::vector<std::any>* extra_pointers);
|
std::vector<std::any>* extra_pointers);
|
||||||
void handle_player_merchant(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
void handle_player_merchant(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
std::vector<std::any>* extra_pointers);
|
std::vector<std::any>* extra_pointers);
|
||||||
|
void handle_player_inspect(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers);
|
||||||
|
|
||||||
//Item
|
//Item
|
||||||
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQ::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
void handle_item_click(QuestInterface *parse, lua_State* L, Client* client, EQ::ItemInstance* item, Mob *mob, std::string data, uint32 extra_data,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user