Jump to content

Recommended Posts

Hello, i have a problem with skills on dungeons, like Enchanted Blade or shaman buff skills.

 

When i use the skills and join to dungeon, skill icon (left-corner) disapears, when i use skills again, icons doesn't shows.

 

When i finish dungeon, function teleporting me to village and i teleport to m1, skills icons are showing.

 

When i use skills on city, icons are showing, when i teleporting to city or anyelse map, i have icons, problem is only on dungeon.

 

Anybody have a solution for this or idea how to fix this, or where i can find some information for this in source?

 

Best regards.

Edited by Zoom
  • Love 2
Link to comment
https://metin2.dev/topic/25045-skills-icon-on-dungeon/
Share on other sites

  • 5 years later...
  • Active+ Member
On 12/7/2020 at 7:24 PM, Zoom said:

Hello, i have a problem with skills on dungeons, like Enchanted Blade or shaman buff skills.

 

When i use the skills and join to dungeon, skill icon (left-corner) disapears, when i use skills again, icons doesn't shows.

 

When i finish dungeon, function teleporting me to village and i teleport to m1, skills icons are showing.

 

When i use skills on city, icons are showing, when i teleporting to city or anyelse map, i have icons, problem is only on dungeon.

 

Anybody have a solution for this or idea how to fix this, or where i can find some information for this in source?

 

Best regards.

Little late after 5 years but I am facing the exact same issue here and I have no idea why. I have no trace as to what may be causing this (I believe that it could be a wrong use of flags or timers, but I cannot be sure).

Any help or pointers are appreciated!

  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/25045-skills-icon-on-dungeon/#findComment-173894
Share on other sites

  • 2 weeks later...
  • Active+ Member

After about 3 weeks I am still in search for a solution. I made the source upside down and I got nothing...

Here is some more information about this bug:

  1. Only affect icons from skills are affected, the rest is fine
  2. LocaleInfo skill messages (on top of the char's head - "I cannot use that skill yet.") also do not appear but the behavior of the skill itself is as expected
  3. This happens only on re-entry, not initial entry:
    Spoiler
    		function make_dungeon() 
    			local setting = snow_dungeon.setting()
    
    			d.new_jump_party(DUNGEON_MAP_INDEX, setting.dungeon_entry_pos[1], setting.dungeon_entry_pos[2]) <== Everything is normal here
    			d.set_item_group("fd_pass_ticket", 1, PASS_TICKET, 1)
    			d.spawn_mob_ac_dir(DUNGEON_MAN, setting.DUNGEON_MAN_pos[1], setting.DUNGEON_MAN_pos[2], 1)
    			d.setf("tickets_consumed", 0)
    		end
    
    		...
    
    		when ENTRY_MAN.chat.gameforge.snow_dungeon._100_npcChat with pc.get_map_index() == ENTRY_MAP_INDEX begin
    			local setting = snow_dungeon.setting()
    			
    			-- Try to find the dungeon instance player belongs to
    			local dungeon_map_idx = 0
    			local is_valid_dungeon = false
    			
    			-- Check if player is in party and party has a dungeon
    			if party.is_party() then
    				dungeon_map_idx = party.getf("dungeon_index")
    
    				if dungeon_map_idx > 0 and d.find(dungeon_map_idx) then
    					-- Verify this is the same party that created the dungeon
    					if d.getf_from_map_index("party_leader_pid", dungeon_map_idx) == party.get_leader_pid() then
    						is_valid_dungeon = true
    					end
    				end
    			end
    			
    			-- If no valid party dungeon, check if player has solo re-entry eligibility
    			if not is_valid_dungeon and pc.getf("snow_dungeon", "initial_entry") == 1 then
    				-- Player was in a dungeon previously, try to find it
    				for test_idx = DUNGEON_MAP_INDEX * 10000, (DUNGEON_MAP_INDEX + 1) * 10000 - 1 do
    					if d.find(test_idx) and d.getf_from_map_index("dungeon_enter", test_idx) == 1 then
    						-- Found active dungeon, allow re-entry
    						dungeon_map_idx = test_idx
    						is_valid_dungeon = true
    
    						break
    					end
    				end
    			end
    			
    			-- Handle re-entry into active dungeon
    			if is_valid_dungeon and dungeon_map_idx > 0 then
    				local map_idx = dungeon_map_idx
    				local current_time = get_global_time()
    				local dungeon_enter = d.getf_from_map_index("dungeon_enter", map_idx)
    				local dungeon_start_time = d.getf_from_map_index("dungeon_start_time", map_idx)
    
    				-- Dungeon has been started; check 5-minute windows
    				if dungeon_enter == 1 then
    					-- True re-entry requires both ticket consumed AND having actually entered before
    					local is_reentry = pc.getf("snow_dungeon", "ticket_delete") == 1 and pc.getf("snow_dungeon", "initial_entry") == 1
    					local allow = false
    
    					if pc.get_level() < 100 then
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(string.format(gameforge.snow_dungeon._050_notice, 100))
    
    						return
    					elseif pc.is_riding() then
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(gameforge.snow_dungeon._620_say)
    
    						return
    					elseif is_reentry then
    						-- Per-player re-entry window from last exit
    						if current_time - pc.getf("snow_dungeon", "exit_time") < 5 * 60 then
    							allow = true
    						end
    					else
    						-- Late entry window from dungeon start; requires ticket
    						if current_time - dungeon_start_time < 5 * 60 then
    							if pc.count_item(PASS_TICKET) < 1 then
    								say_title(mob_name(ENTRY_MAN) .. ": ")
    								say(gameforge.snow_dungeon._040_say)
    								
    								return
    							else
    								allow = true
    							end
    						end
    					end
    
    					if allow then
    						local dungeon_level = d.getf_from_map_index("level", map_idx)
    
    						if dungeon_level == 0 then
    							dungeon_level = 1
    						end
    
    						-- Consume ticket for late entries right here (before warp)
    						-- Re-entries already have ticket_delete = 1 from their initial entry
    						if not is_reentry and pc.getf("snow_dungeon", "ticket_delete") == 0 then
    							pc.remove_item(PASS_TICKET, 1)
    							pc.setf("snow_dungeon", "ticket_delete", 1)
    						end
    
    						-- Count player back into the instance if not already counted
    						if pc.getf("snow_dungeon", "counted") == 0 then
    							if d.find(map_idx) and d.select(map_idx) then
    								d.setf("party_member_count", d.getf("party_member_count") + 1)
    								pc.setf("snow_dungeon", "counted", 1)
    							end
    						end
    
    						-- Mark as having entered if this is first time
    						if pc.getf("snow_dungeon", "initial_entry") == 0 then
    							pc.setqf("snow_dungeon", "initial_entry", 1)
    						end
    
    						pc.warp(setting.WARP_pos[dungeon_level][1] * 100, setting.WARP_pos[dungeon_level][2] * 100, map_idx) <== BUG HAPPENS HERE!
    					else
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(gameforge.snow_dungeon._110_say)
    
    						return
    					end
    				elseif dungeon_enter == 0 and party.is_party() and party.is_leader() then
    					-- Dungeon not started yet, only party leader can request entry
    					local dungeon_level = d.getf_from_map_index("level", map_idx)
    					
    					if dungeon_level == 0 then
    						dungeon_level = 1
    					end
    					
    					pc.warp(setting.WARP_pos[dungeon_level][1] * 100, setting.WARP_pos[dungeon_level][2] * 100, map_idx)
    				elseif dungeon_enter == 0 then
    					-- Dungeon not started and player not leader
    					say_title(mob_name(ENTRY_MAN) .. ": ")
    					say(gameforge.snow_dungeon._160_say)
    					
    					return
    				else
    					-- Re-entry/late entry window expired
    					say_title(mob_name(ENTRY_MAN) .. ": ")
    					say(gameforge.snow_dungeon._110_say)
    					
    					return
    				end
    			-- Handle initial dungeon creation (only for party leaders)
    			elseif party.is_party() then
    				if party.is_leader() then
    					-- Check all party members have passage tickets
    					local pids = { party.get_member_pids() }
    					
    					-- Check all party members are level 100+
    					local min_level = party.get_near_count(pc.get_level(), 0, 1000000)
    					local total_members = party.get_near_count(1, 0, 1000000)
    					
    					if party.get_near_count(100, 0, 1000000) < total_members then
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(string.format(gameforge.snow_dungeon._050_notice, 100))
    
    						return
    					end
    
    					if pc.is_riding() then
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(gameforge.snow_dungeon._620_say)
    
    						return
    					end
    					
    					-- Check for ninja and shaman in party (no nested other_pc_block)
    					local has_ninja = false
    					local has_shaman = false
    					
    					for i = 1, table.getn(pids) do
    						q.begin_other_pc_block(pids[i])
    
    						local job = pc.get_job()
    
    						if job == 1 then
    							has_ninja = true
    						end
    
    						if job == 3 and pc.get_skill_group() == 1 then
    							has_shaman = true
    						end
    
    						q.end_other_pc_block()
    					end
    					
    					if not has_ninja or not has_shaman then
    						say_title(mob_name(ENTRY_MAN) .. ": ")
    						say(gameforge.snow_dungeon._170_say)
    
    						return
    					end
    					
    					say_title(mob_name(ENTRY_MAN) .. ": ")
    					say(gameforge.snow_dungeon._130_say)
    
    					local warp = select(gameforge.snow_dungeon._140_select, gameforge.snow_dungeon._150_select)
    					
    					if warp == 1 then
    						local members_without_ticket = {}
    						local members_riding = {}
    						
    						for i = 1, table.getn(pids) do
    							q.begin_other_pc_block(pids[i])
    
    							if pc.is_riding() then
    								table.insert(members_riding, pc.get_name())
    							end
    
    							if pc.count_item(PASS_TICKET) < 1 then
    								table.insert(members_without_ticket, pc.get_name())
    							end
    
    							q.end_other_pc_block()
    						end
    						
    						if table.getn(members_riding) > 0 then
    							say_title(mob_name(ENTRY_MAN) .. ": ")
    							say(gameforge.snow_dungeon._630_say)
    
    							return
    						elseif table.getn(members_without_ticket) > 0 then
    							say_title(mob_name(ENTRY_MAN) .. ": ")
    							say(gameforge.snow_dungeon._610_notice)
    							say("")
    
    							for i = 1, table.getn(members_without_ticket) do
    								say(string.format("  - %s", members_without_ticket[i]))
    							end
    
    							say("")
    						elseif party.is_map_member_flag_lt("exit_time", get_global_time() - ENTER_LIMIT_TIME * 60) then
    							party.setf("snow_dungeon_boss_kill_count", 0)
    							snow_dungeon.make_dungeon()
    						else
    							say_title(mob_name(ENTRY_MAN) .. ": ")
    							say(gameforge.snow_dungeon._600_say)
    						end
    					end
    				else
    					say_title(mob_name(ENTRY_MAN) .. ": ")
    					say(gameforge.snow_dungeon._160_say)
    				end
    			else
    				say_title(mob_name(ENTRY_MAN) .. ": ")
    				say(gameforge.snow_dungeon._170_say)
    			end
    		end

    BTW the coordinates of the wrap are correct as the character appears within the dungeon normally in case someone asks.

  4. This is where it gets confusing: the non-buggy version uses `new_jump_party` while the buggy version uses `pc.warp`, however the teleporter's quest file (map_warp.quest) also uses `pc.warp` and there are no issues in there (public maps). So the question is where else should I look for in the codebase to find out more about why pc.warp behaves that way with dungeons?

Again, any help or tip is appreciated, thanks!

Link to comment
https://metin2.dev/topic/25045-skills-icon-on-dungeon/#findComment-174113
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.