Jump to content
×
×
  • Create New...

Quest Functions - Get IP | Kill | Set Coins | Empire Name | Name | Job | Level


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( 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
  • Metin2 Dev 3
  • Love 8
Link to comment
Share on other sites

  • Premium
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 :)
  • Love 1

Currently working on my FreeBSD blog:

FreeBSD is Fun, practical tutorials and articles

⚠️                Are you under attack?               ⚠️

Link to comment
Share on other sites

  • Moon

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

  • Love 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 6

      Owsap Productions

    2. 11

      BUG SAFEBOX disappear stacks ..

    3. 2

      Error no member named SetcCreateTime in Citem

    4. 2

      Need some help with effect slot on pickup system

    5. 1

      GF Pet system "x" level / percent

    6. 1

      disable quest esc

    7. 2

      Navicat Premium 16.1.3 x64

    8. 2

      Join the Metin2 Dev team

    9. 2

      Error no member named SetcCreateTime in Citem

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.