Register for your free account! | Forgot your password?

You last visited: Today at 15:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++] Change race in QUESTS

Discussion on [C++] Change race in QUESTS within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1

 
elite*gold: 97
Join Date: Mar 2017
Posts: 72
Received Thanks: 64
[C++] Change race in QUESTS

Add it to questlua_pc.cpp:
Code:
int pc_change_race(lua_State * L)
{
	LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

	if (!lua_isnumber(L, 1)) 
	{
		return 0;
	}

	ch->SetRace(lua_tonumber(L,1));
	ch->SetSkillGroup(0);
	ch->ClearSkill();
	ch->ClearSubSkill();
	ch->SetPolymorph(101);
	ch->SetPolymorph(0);
	return 0;
}
Next add this to the RegisterPCFunctionTable:
Code:
{"change_race", pc_change_race},
After you can use it in quests:
Code:
pc.change_race(NUMBER)

Numbers for races:
0 - warrior man
1 - ninja woman
2 - sura man
3 - shaman woman
4 - warrior woman
5 - ninja man
6 - sura woman
7 - shaman man
ericblck is offline  
Thanks
4 Users
Old 08/10/2017, 00:02   #2
 
elite*gold: 0
Join Date: Apr 2013
Posts: 19
Received Thanks: 13
This is usefull . thank you
kasko30 is offline  
Old 08/10/2017, 03:59   #3



 
Samael's Avatar
 
elite*gold: 17
Join Date: May 2014
Posts: 2,101
Received Thanks: 1,292
Very nice. Heres a little edit by me that the player is forced to unequip his Weapon and Armor (cause he cant after change)

HTML Code:
	int pc_change_race(lua_State * L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

		if (!lua_isnumber(L, 1)) 
		{
			return 0;
		}
		if (ch->GetWear(WEAR_BODY) || ch->GetWear(WEAR_WEAPON)) {
			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CHANGE_CHAR_MESSAGE"));
			return 0;
		}

		ch->SetRace(lua_tonumber(L,1));
		ch->SetSkillGroup(0);
		ch->ClearSkill();
		ch->ClearSubSkill();
		ch->SetPolymorph(101);
		ch->SetPolymorph(0);
		ch->SetKill
		return 0;
	}
locale_string.txt:


"CHANGE_CHAR_MESSAGE";
"Unequip weapon and armor first";
Samael is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
[C++] Change race in QUESTS
08/08/2017 - Metin2 Private Server - 0 Replies
#wrong topic, please delete
Race On Bundle Account (Race 07, Race On, STCC:The Game) - 10€
05/14/2011 - Steam Trading - 10 Replies
Verkaufe euch einen Steam Account, welcher das Race On Paket drauf hat! - Race 07 - Race On - STCC:The Game Ich verkaufe ihn für eine 10er PSC. ;) Der Account ist 100% Active! http://s7.directupload.net/images/110506/yq2e22ab .jpg
Question> About changing race armor to other race
08/13/2008 - RF Online - 5 Replies
for example Accretian armor will become Cora Armor. i mean the armor requirements will be change Race : Accretia will become Race : Cora
The big Race to Race Modelchange Collection
04/15/2008 - World of Warcraft - 13 Replies
/close kiddi forum -.-



All times are GMT +1. The time now is 15:22.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.