Joa, hab lange nichts mehr released.. wird mal wieder Zeit c:
pc
npc
Ihr könnt mir gerne weitere Questbefehle nennen. Ich würde dann versuchen, sie zu schreiben, da ich mich im Bereich C++ noch steigern will :3
Großes Dankeschön an Sanchez,InyaProduction,Metin2 Team, Xunil , etc. @ *********
###################
Oben in die questlua_npc.cpp folgendes eintragen, falls nicht vorhanden:
[Only registered and activated users can see links. Click Here To Register...]
pc
Code:
// 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;
}
delete msg;
}
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
Code:
// 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
Code:
// New Functions by Avenue
int npc_get_ip(lua_State* L)
{
LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
lua_pushstring(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_pushstring(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
Code:
// 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
Ihr könnt mir gerne weitere Questbefehle nennen. Ich würde dann versuchen, sie zu schreiben, da ich mich im Bereich C++ noch steigern will :3
Großes Dankeschön an Sanchez,InyaProduction,Metin2 Team, Xunil , etc. @ *********
###################
Oben in die questlua_npc.cpp folgendes eintragen, falls nicht vorhanden:
Code:
#include "desc.h"