[Feature] Add lua and perl event for test buff (#1403)

* [Feature] Add lua and perl event for test buff

* added EnableTestBuff
This commit is contained in:
Dencelle 2021-06-16 10:04:34 -05:00 committed by GitHub
parent 5d937b5be9
commit 4f5824b4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 3 deletions

View File

@ -165,6 +165,7 @@ RULE_BOOL(Character, ProcessFearedProximity, false, "Processes proximity checks
RULE_BOOL(Character, EnableCharacterEXPMods, false, "Enables character zone-based experience modifiers.")
RULE_BOOL(Character, PVPEnableGuardFactionAssist, true, "Enables faction based assisting against the aggresor in pvp.")
RULE_BOOL(Character, SkillUpFromItems, true, "Allow Skill ups from clickable items")
RULE_BOOL(Character, EnableTestBuff, false, "Allow the use of /testbuff")
RULE_CATEGORY_END()
RULE_CATEGORY(Mercs)

View File

@ -14059,6 +14059,10 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app)
void Client::Handle_OP_TestBuff(const EQApplicationPacket *app)
{
if (!RuleB(Character, EnableTestBuff)) {
return;
}
parse->EventPlayer(EVENT_TEST_BUFF, this, "", 0);
return;
}

View File

@ -119,7 +119,8 @@ const char *QuestEventSubroutines[_LargestEventID] = {
"EVENT_DEATH_ZONE",
"EVENT_USE_SKILL",
"EVENT_COMBINE_VALIDATE",
"EVENT_BOT_COMMAND"
"EVENT_BOT_COMMAND",
"EVENT_TEST_BUFF"
};
PerlembParser::PerlembParser() : perl(nullptr)

View File

@ -88,6 +88,7 @@ typedef enum {
EVENT_USE_SKILL,
EVENT_COMBINE_VALIDATE,
EVENT_BOT_COMMAND,
EVENT_TEST_BUFF,
_LargestEventID
} QuestEventID;

View File

@ -3203,7 +3203,8 @@ luabind::scope lua_register_events() {
luabind::value("tick", static_cast<int>(EVENT_TICK)),
luabind::value("spawn_zone", static_cast<int>(EVENT_SPAWN_ZONE)),
luabind::value("death_zone", static_cast<int>(EVENT_DEATH_ZONE)),
luabind::value("use_skill", static_cast<int>(EVENT_USE_SKILL))
luabind::value("use_skill", static_cast<int>(EVENT_USE_SKILL)),
luabind::value("test_buff", static_cast<int>(EVENT_TEST_BUFF))
];
}

View File

@ -130,7 +130,8 @@ const char *LuaEvents[_LargestEventID] = {
"event_death_zone",
"event_use_skill",
"event_combine_validate",
"event_bot_command"
"event_bot_command",
"event_test_buff"
};
extern Zone *zone;
@ -213,6 +214,7 @@ LuaParser::LuaParser() {
PlayerArgumentDispatch[EVENT_RESPAWN] = handle_player_respawn;
PlayerArgumentDispatch[EVENT_UNHANDLED_OPCODE] = handle_player_packet;
PlayerArgumentDispatch[EVENT_USE_SKILL] = handle_player_use_skill;
PlayerArgumentDispatch[EVENT_TEST_BUFF] = handle_test_buff;
PlayerArgumentDispatch[EVENT_COMBINE_VALIDATE] = handle_player_combine_validate;
PlayerArgumentDispatch[EVENT_BOT_COMMAND] = handle_player_bot_command;

View File

@ -514,6 +514,9 @@ void handle_player_use_skill(QuestInterface *parse, lua_State* L, Client* client
lua_setfield(L, -2, "skill_level");
}
void handle_test_buff(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQ::Any>* extra_pointers) {
}
void handle_player_combine_validate(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQ::Any>* extra_pointers) {
Seperator sep(data.c_str());

View File

@ -97,6 +97,8 @@ void handle_player_null(QuestInterface *parse, lua_State* L, Client* client, std
std::vector<EQ::Any> *extra_pointers);
void handle_player_use_skill(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQ::Any> *extra_pointers);
void handle_test_buff(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQ::Any>* extra_pointers);
void handle_player_combine_validate(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQ::Any>* extra_pointers);
void handle_player_bot_command(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,