[Quest API] Add EVENT_SKILL_UP & EVENT_LANGUAGE_SKILL_UP to Perl/Lua (#2076)

Added EVENT_SKILL_UP to Perl/Lua

Adds sub EVENT_SKILL_UP output for use.
Exports:
$skill_id - ID of the skill being exported. Will export skill or language as the same so check below.
$skill_value - New skill level
$skill_max - Maximum value of skill
$is_tradeskill - 0 for non-tradeskill, 1 for tradeskill

Example usage:
sub EVENT_SKILL_UP {
if($is_tradeskill == 0) {
		quest::shout("Skill Increase! " . $client->GetCleanName() . " has increased their " . quest::getskillname($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
	}
	if ($is_tradeskill == 1) {
		quest::shout("Tradeskill Increase! " . $client->GetCleanName() . " has increased their " . quest::getskillname($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
	}
}

Adds sub EVENT_LANGUAGE_SKILL_UP output for use.
Exports:
$skill_id - ID of the skill being exported. Will export skill or language as the same so check below.
$skill_value - New skill level
$skill_max - Maximum value of skill

Example usage:
sub EVENT_LANGUAGE_SKILL_UP  {
		quest::shout("Language Increase! " . $client->GetCleanName() . " has increased their " . quest::getlanguagename($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
}

Co-authored-by: toxin06 <53322305+toxin06@users.noreply.github.com>
This commit is contained in:
nytmyr
2022-04-25 11:18:52 -05:00
committed by GitHub
parent 0d734a0837
commit b1311780a7
8 changed files with 85 additions and 5 deletions
+27
View File
@@ -828,4 +828,31 @@ void handle_encounter_null(QuestInterface *parse, lua_State* L, Encounter* encou
}
void handle_player_skill_up(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQ::Any>* extra_pointers) {
Seperator sep(data.c_str());
lua_pushinteger(L, std::stoi(sep.arg[0]));
lua_setfield(L, -2, "skill_id");
lua_pushinteger(L, std::stoi(sep.arg[1]));
lua_setfield(L, -2, "skill_value");
lua_pushinteger(L, std::stoi(sep.arg[2]));
lua_setfield(L, -2, "skill_max");
lua_pushinteger(L, std::stoi(sep.arg[3]));
lua_setfield(L, -2, "is_tradeskill");
}
void handle_player_language_skill_up(QuestInterface* parse, lua_State* L, Client* client, std::string data, uint32 extra_data, std::vector<EQ::Any>* extra_pointers) {
Seperator sep(data.c_str());
lua_pushinteger(L, std::stoi(sep.arg[0]));
lua_setfield(L, -2, "skill_id");
lua_pushinteger(L, std::stoi(sep.arg[1]));
lua_setfield(L, -2, "skill_value");
lua_pushinteger(L, std::stoi(sep.arg[2]));
lua_setfield(L, -2, "skill_max");
}
#endif