Jump to content

Recommended Posts

u cant do the "command" if the player no is GM, then how say zonni, u need create a new function to edit the level of the player.

 

pc.setqf("name", value) <--- set the value

 

pc.getqf("name") <--- return the value

 

example:

 

pc.setqf("test", 1) --- set test in 1

 

if pc.getqf("test") == 1 then

say"1"

elseif pc.getqf("test") == 2 then

say"2"

end

 

I dont know why, i still didn't get how can i use the pc.getqf >< at least no in this level situation xD

 

 

Simple pc.set_level function:

function pc.set_level(level)
	while pc.get_level() ~= level do
		pc.give_exp2(pc.get_next_exp)
	end
end

Is that function to put in the questlib?

Now the problem is this:

SYSERR: Nov  1 16:51:41 :: RunState: LUA_ERROR: [string "prestige_system"]:4: attempt to concatenate local `idc' (a table value) WITH ERRORCODE 1
SYSERR: Nov  1 16:51:41 :: RunState: LUA_STATE: index 0 ref 3
SYSERR: Nov  1 16:51:41 :: WriteRunningStateToSyserr: LUA_ERROR: quest prestige_system.start click

 

 

bump

######### Sorry for double post :/ ######### 

 

The quest is now working, the only problem is that the system only works for GM because of this:

command("a "..pc.get_name.." 1")

If you guys can help me creating a new function to decrease level, i'll be really thankful ^^

 

Greetz, RachadoPT

	int set_level(lua_State* L)
	{
		if(lua_isnumber(L, 1))
		{
			int max_level = 105;
			LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
			
			ch->ResetPoint(MINMAX(1, (int)lua_tonumber(L, 1), max_level));

			ch->ClearSkill();
			ch->ClearSubSkill();
		}		
	}
	int set_level(lua_State* L)
	{
		if(lua_isnumber(L, 1))
		{
			int max_level = 105;
			LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
			
			ch->ResetPoint(MINMAX(1, (int)lua_tonumber(L, 1), max_level));

			ch->ClearSkill();
			ch->ClearSubSkill();
		}		
	}

 

Well, i was talking about a function but not directly in the source because i cant compile the source properly >< is it possible to create one in questlib or something? ><

The other function that I posted it can only lvl up,there isn't any way to reduce the level.

Aww... I really have to compile the source? :/ It is not difficult, but there are too many problems for me...

 

1- I dont know C++ (i can only edit the things from the tutorials that i find in the internet)

2- I compiled my own game but when i use it i cant log in my account i dont know why... ://

 

Here's the syserr from the channel when i log in with my game:

SYSERR: Nov  2 23:30:42 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetValidLocation: cannot find sectree_map by map index -268431706
SYSERR: Nov  2 23:30:47 :: PlayerLoad: InputDB::PlayerLoad : cannot find valid location -1677262848 x 30144 (name: )
  • Premium

The other function that I posted it can only lvl up,there isn't any way to reduce the level.

Aww... I really have to compile the source? :/ It is not difficult, but there are too many problems for me...

 

1- I dont know C++ (i can only edit the things from the tutorials that i find in the internet)

2- I compiled my own game but when i use it i cant log in my account i dont know why... ://

 

Here's the syserr from the channel when i log in with my game:

SYSERR: Nov  2 23:30:42 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetValidLocation: cannot find sectree_map by map index -268431706
SYSERR: Nov  2 23:30:47 :: PlayerLoad: InputDB::PlayerLoad : cannot find valid location -1677262848 x 30144 (name: )

I compiled client from novaline & server from mainline and everything works (without many modifications, only error fixes). If you use WoM files you should use release branch.

 

 

The other function that I posted it can only lvl up,there isn't any way to reduce the level.

Aww... I really have to compile the source? :/ It is not difficult, but there are too many problems for me...

 

1- I dont know C++ (i can only edit the things from the tutorials that i find in the internet)

2- I compiled my own game but when i use it i cant log in my account i dont know why... ://

 

Here's the syserr from the channel when i log in with my game:

SYSERR: Nov  2 23:30:42 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetServerLocation: location error name  mapindex 0 0 x 0 empire 3
SYSERR: Nov  2 23:30:47 :: GetValidLocation: cannot find sectree_map by map index -268431706
SYSERR: Nov  2 23:30:47 :: PlayerLoad: InputDB::PlayerLoad : cannot find valid location -1677262848 x 30144 (name: )

I compiled client from novaline & server from mainline and everything works (without many modifications, only error fixes). If you use WoM files you should use release branch.

 

I didn't compile the client binary, i use the 4 inventory page binary that is posted here in Metin2Dev. The serverfiles i use are the RageMt2 files from Metin2Zone with vanilla core, now when i try to use my game core, when i choose my character, the client gets back to the channel screen and i get this error in the channel syserr... :/ 

	int set_level(lua_State* L)
	{
		if(lua_isnumber(L, 1))
		{
			int max_level = 105;
			LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
			
			ch->ResetPoint(MINMAX(1, (int)lua_tonumber(L, 1), max_level));

			ch->ClearSkill();
			ch->ClearSubSkill();
		}		
	}

This function goes in which source file? questlua_pc.cpp?

  • Love 1

Yes

There were already this function:

int pc_set_level(lua_State * L)  
	{
		if (!lua_isnumber(L, 1))
		{
			sys_err("invalid argument");
			return 0;
		}
		else
		{
			int newLevel = lua_tonumber(L, 1);
			LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();


			sys_log(0,"QUEST [LEVEL] %s jumpint to level %d", ch->GetName(), (int)rint(lua_tonumber(L,1)));

			PC* pPC = CQuestManager::instance().GetCurrentPC();
			LogManager::instance().QuestRewardLog(pPC->GetCurrentQuestName().c_str(), ch->GetPlayerID(), ch->GetLevel(), newLevel, 0);
			
			//포인트 : 스킬, 서브스킬, 스탯
			ch->PointChange(POINT_SKILL, newLevel - ch->GetLevel());
			ch->PointChange(POINT_SUB_SKILL, newLevel < 10 ? 0 : newLevel - MAX(ch->GetLevel(), 9));
			ch->PointChange(POINT_STAT, ((MINMAX(1, newLevel, 90) - ch->GetLevel()) * 3) + ch->GetPoint(POINT_LEVEL_STEP));
			//레벨
			ch->PointChange(POINT_LEVEL, newLevel - ch->GetLevel());
			//HP, SP
			ch->SetRandomHP((newLevel - 1) * number(JobInitialPoints[ch->GetJob()].hp_per_lv_begin, JobInitialPoints[ch->GetJob()].hp_per_lv_end));
			ch->SetRandomSP((newLevel - 1) * number(JobInitialPoints[ch->GetJob()].sp_per_lv_begin, JobInitialPoints[ch->GetJob()].sp_per_lv_end));


			// 회복
			ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
			ch->PointChange(POINT_SP, ch->GetMaxSP() - ch->GetSP());
			
			ch->ComputePoints();
			ch->PointsPacket();
			ch->SkillLevelPacket();

			return 0;
		}
	}

BTW, this source is the default one!

 

I dont know if this is the same or not, but if no, what should i put in here:

void RegisterPCFunctionTable()
	{
		luaL_reg pc_functions[] = 
		{
                
                ...

                }
        }

for the new function? ><

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

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.