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
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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 0

      PRESENTATION PAGE [OLDGODSMT2 RELEASE]

    3. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    4. 2

      United/Club/Midgard serverfiles?

    5. 13

      Metin2 Closed Beta Content (2003-2004)

    6. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.