mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-11 07:02:35 +00:00
[Quest API] Add GetLanguageName() to Perl/Lua. (#1860)
- Add quest::getlanguagename(language_id) to Perl. - Add eq.get_language_name(language_id) to Lua.
This commit is contained in:
parent
9a0c98397e
commit
29dfe9d404
@ -8023,6 +8023,23 @@ XS(XS__getspell) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS__getlanguagename);
|
||||||
|
XS(XS__getlanguagename) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::getlanguagename(int language_id)");
|
||||||
|
{
|
||||||
|
dXSTARG;
|
||||||
|
int language_id = (int) SvIV(ST(0));
|
||||||
|
std::string language_name = quest_manager.getlanguagename(language_id);
|
||||||
|
|
||||||
|
sv_setpv(TARG, language_name.c_str());
|
||||||
|
XSprePUSH;
|
||||||
|
PUSHTARG;
|
||||||
|
XSRETURN(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is the callback perl will look for to setup the
|
This is the callback perl will look for to setup the
|
||||||
quest package's XSUBs
|
quest package's XSUBs
|
||||||
@ -8315,6 +8332,7 @@ EXTERN_C XS(boot_quest) {
|
|||||||
newXS(strcpy(buf, "get_expedition_by_zone_instance"), XS__get_expedition_by_zone_instance, file);
|
newXS(strcpy(buf, "get_expedition_by_zone_instance"), XS__get_expedition_by_zone_instance, file);
|
||||||
newXS(strcpy(buf, "get_expedition_lockout_by_char_id"), XS__get_expedition_lockout_by_char_id, file);
|
newXS(strcpy(buf, "get_expedition_lockout_by_char_id"), XS__get_expedition_lockout_by_char_id, file);
|
||||||
newXS(strcpy(buf, "get_expedition_lockouts_by_char_id"), XS__get_expedition_lockouts_by_char_id, file);
|
newXS(strcpy(buf, "get_expedition_lockouts_by_char_id"), XS__get_expedition_lockouts_by_char_id, file);
|
||||||
|
newXS(strcpy(buf, "getlanguagename"), XS__getlanguagename, file);
|
||||||
newXS(strcpy(buf, "getinventoryslotid"), XS__getinventoryslotid, file);
|
newXS(strcpy(buf, "getinventoryslotid"), XS__getinventoryslotid, file);
|
||||||
newXS(strcpy(buf, "getitemname"), XS__getitemname, file);
|
newXS(strcpy(buf, "getitemname"), XS__getitemname, file);
|
||||||
newXS(strcpy(buf, "getItemName"), XS_qc_getItemName, file);
|
newXS(strcpy(buf, "getItemName"), XS_qc_getItemName, file);
|
||||||
|
|||||||
@ -3351,6 +3351,10 @@ Lua_Spell lua_get_spell(uint32 spell_id) {
|
|||||||
return Lua_Spell(spell_id);
|
return Lua_Spell(spell_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string lua_get_language_name(int language_id) {
|
||||||
|
return quest_manager.getlanguagename(language_id);
|
||||||
|
}
|
||||||
|
|
||||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||||
cur = table[#name]; \
|
cur = table[#name]; \
|
||||||
if(luabind::type(cur) != LUA_TNIL) { \
|
if(luabind::type(cur) != LUA_TNIL) { \
|
||||||
@ -3794,6 +3798,7 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("is_npc_spawned", &lua_is_npc_spawned),
|
luabind::def("is_npc_spawned", &lua_is_npc_spawned),
|
||||||
luabind::def("count_spawned_npcs", &lua_count_spawned_npcs),
|
luabind::def("count_spawned_npcs", &lua_count_spawned_npcs),
|
||||||
luabind::def("get_spell", &lua_get_spell),
|
luabind::def("get_spell", &lua_get_spell),
|
||||||
|
luabind::def("get_language_name", &lua_get_language_name),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Cross Zone
|
Cross Zone
|
||||||
|
|||||||
@ -1036,6 +1036,10 @@ std::string QuestManager::getskillname(int skill_id) {
|
|||||||
return EQ::skills::GetSkillName(static_cast<EQ::skills::SkillType>(skill_id));
|
return EQ::skills::GetSkillName(static_cast<EQ::skills::SkillType>(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string QuestManager::getlanguagename(int language_id) {
|
||||||
|
return EQ::constants::GetLanguageName(language_id);
|
||||||
|
}
|
||||||
|
|
||||||
void QuestManager::safemove() {
|
void QuestManager::safemove() {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator && initiator->IsClient())
|
if (initiator && initiator->IsClient())
|
||||||
|
|||||||
@ -115,6 +115,7 @@ public:
|
|||||||
std::string getracename(uint16 race_id);
|
std::string getracename(uint16 race_id);
|
||||||
std::string getspellname(uint32 spell_id);
|
std::string getspellname(uint32 spell_id);
|
||||||
std::string getskillname(int skill_id);
|
std::string getskillname(int skill_id);
|
||||||
|
std::string getlanguagename(int language_id);
|
||||||
void safemove();
|
void safemove();
|
||||||
void rain(int weather);
|
void rain(int weather);
|
||||||
void snow(int weather);
|
void snow(int weather);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user