Jump to content

Recommended Posts

Hi. How to fix that bug? 

 

i already have 

if (item2->IsEquipped())
	return false;

but i'm using quest with gui

quest nixo_kd begin
	state start begin
		when login begin
			cmdchat("KD_QUEST "..q.getcurrentquestindex())
		end
		when button or info begin
			if pc.count_item(25100) >= 1 then
				info = get_input("KD_SEND")
				splited = string.split(info, '|')
				if item.select_cell(tonumber(splited[1])) then
					if item.vnum == tonumber(splited[2]) then
						if item.get_type() == 1 or item.get_type() == 2 and item.get_sub_type() == 0 then
							for i = 0, 2 do
								if item.get_socket(i) == tonumber(splited[3]) then
									if item.get_socket(i) > 20000 and item.get_socket(i) != 28960 then
										item.set_socket(i, 1)
										pc.give_item2(tonumber(splited[3]))
										pc.remove_item(25100, 1)
										break
									end
								end
							end
						end
					end
				end
			end
		end
	end
end

and this bugfix doesn't work. Any ideas? 

Link to comment
https://metin2.dev/topic/18092-stone-bug/
Share on other sites

You can make a new lua function in source then use it.

	int item_is_equipped(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		LPITEM item = q.GetCurrentItem();

		if (item)
			lua_pushboolean(L, item->IsEquipped());
		else
			lua_pushboolean(L, false);

		return 1;
	}

 

  • Love 1
Link to comment
https://metin2.dev/topic/18092-stone-bug/#findComment-98766
Share on other sites

26 minut temu, Den napisał:

You can make a new lua function in source then use it.


	int item_is_equipped(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		LPITEM item = q.GetCurrentItem();

		if (item)
			lua_pushboolean(L, item->IsEquipped());
		else
			lua_pushboolean(L, false);

		return 1;
	}

 

I added your function, it worked one time but now it doesn't work XD

Quest:

quest nixo_kd begin
	state start begin
		when login begin
			cmdchat("KD_QUEST "..q.getcurrentquestindex())
		end
		when button or info begin
			if not pc.can_warp() then
				chat("You need to wait 10s.")
				return
			end
			if item.is_equipped() then
				chat("You can't do this! ")
				return
			end
			if pc.count_item(25100) >= 1 then
				info = get_input("KD_SEND")
				splited = string.split(info, '|')
				if item.select_cell(tonumber(splited[1])) then
					if item.vnum == tonumber(splited[2]) then
						if item.get_type() == 1 or item.get_type() == 2 and item.get_sub_type() == 0 then
							for i = 0, 2 do
								if item.get_socket(i) == tonumber(splited[3]) then
									if item.get_socket(i) > 20000 and item.get_socket(i) != 28960 then
										item.set_socket(i, 1)
										pc.give_item2(tonumber(splited[3]))
										pc.remove_item(25100, 1)
										break
									end
								end
							end
						end
					end
				end
			end
		end
	end
end

Any ideas? 

Link to comment
https://metin2.dev/topic/18092-stone-bug/#findComment-98769
Share on other sites

  • Developer
3 hours ago, avertuss said:

if item.is_equipped() then chat("You can't do this! ") return end

use this under

3 hours ago, avertuss said:

if item.select_cell(tonumber(splited[1])) then

and not before..

  • Love 1

My youtube channel  on which you can see my works here

Link to comment
https://metin2.dev/topic/18092-stone-bug/#findComment-98781
Share on other sites

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.