Bronze .Avenue™ 793 Posted March 29, 2014 Bronze Share Posted March 29, 2014 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) pc // New Functions by Avenue int pc_get_ip(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); lua_pushstring(L, ch->GetDesc()->GetHostName()); return 1; } int pc_kill(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); ch->Dead(); return 0; } int pc_set_coins(lua_State * L) { if (!lua_isnumber(L, 1)) { sys_err("invalid argument"); return 0; } LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); long val = (long)lua_tonumber(L, 1); SQLMsg *msg; msg = DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins + '%ld' WHERE id = '%d'", val, ch->GetAID()); if (msg->uiSQLErrno != 0) { sys_err("pc_update_coins query failed"); return 0; } } int pc_get_empire_name(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); const char* tabelle[3] = {"Shinsoo","Chunjo","Jinno"}; int empireave = ch->GetEmpire()-1; lua_pushstring(L, tabelle[empireave]); return 1; } // New Functions by Avenue end // New Functions by Avenue { "get_ip", pc_get_ip }, { "kill", pc_kill }, { "set_coins", pc_set_coins }, { "get_empire_name", pc_get_empire_name }, // New Functions by Avenue end npc // New Functions by Avenue int npc_get_ip(lua_State* L) { LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetDesc()->GetHostName()); return 1; } int npc_get_level(lua_State* L) { LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetLevel()); return 1; } int npc_get_name(lua_State* L) { LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetName()); return 1; } int npc_get_job(lua_State* L) { LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetJob()); return 1; } // New Functions by Avenue end // New Functions by Avenue { "get_ip", npc_get_ip }, { "get_level", npc_get_level }, { "get_name", npc_get_name }, { "get_job", npc_get_job }, // New Functions by Avenue end Great thanks to Sanchez,InyaProduction,Metin2 Team, Xunil , etc. @ Metin2Dev 15 1 1 12 Link to comment Share on other sites More sharing options...
Premium Shogun 4613 Posted March 29, 2014 Premium Share Posted March 29, 2014 pc_set_coins There's already this function (charge_cash_by_voucher or something) pc_get_empire_name > this should go into questlib for localization reasons About your npc functions, npc.get_vid makes them redundant as you can just select the npc and use existing pc functions with it. pc.kill and pc.get_ip seem the most useful for me. Thanks for sharing anyway 2 Link to comment Share on other sites More sharing options...
metin2team 766 Posted March 30, 2014 Share Posted March 30, 2014 Thank you .. it looks nice pc.charge_cash << just that Shogun ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Shinsoo")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Chunjo")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Jinno")); and then you can add that yo your locale_string.txt 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts