Register for your free account! | Forgot your password?

You last visited: Today at 17:22

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

 

[C++] Change race in QUESTS

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2017
Posts: 15
Received Thanks: 20
[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   #2
 
elite*gold: 0
Join Date: Apr 2013
Posts: 18
Received Thanks: 13
This is usefull . thank you


kasko30 is offline  
Old   #3

 
elite*gold: 1
Join Date: May 2014
Posts: 1,504
Received Thanks: 584
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";
xSaito is offline  
Thanks
2 Users
Reply



« Previous Thread | Next Thread »

Similar Threads
[C++] Change race in QUESTS
#wrong topic, please delete
0 Replies - Metin2 PServer - Discussions / Questions
Race On Bundle Account (Race 07, Race On, STCC:The Game) - 10€
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....
10 Replies - Steam Trading
Question> About changing race armor to other race
for example Accretian armor will become Cora Armor. i mean the armor requirements will be change Race : Accretia will become Race : Cora
5 Replies - RF Online
The big Race to Race Modelchange Collection
/close kiddi forum -.-
13 Replies - WoW Modelchange Support



All times are GMT +2. The time now is 17:22.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.