Jump to content

Server Kick Out in Deviltower


Recommended Posts

Version of Files 41027

Hey

 

1. Description of the problem / Question :

I bought the Devil Tower system for 50 Euros. The friend I bought did not help me with the Core I bought in this regard. He argued that the problem was not caused by him. Can anybody help me?

 

2. SysErr ( Client / Server ) / SysLog ( Server )

Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1302)

Jun 8 19:49:33 :: DROP_ITEM: Korku Maskesi +0 247064 733121 from Ağaç Kurbağası Lideri

Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1302)

Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1305)

Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=165, npc=8017)

Jun 8 19:49:33 :: XXX Dungeon Notice 0x2c036300 Doğru metin bulundu.

Jun 8 19:49:33 :: Dungeon GetMapIndex 660004 Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1305)

Jun 8 19:49:33 :: GIVE_GOLD: Buse 545 Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1302)

Jun 8 19:49:33 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=1097, npc=1302)

Jun 8 19:49:33 :: Dungeon GetMapIndex 660004 Jun 8 19:49:33 :: XXX AddServerTimer Devil_5 660004 0x821844c0

Jun 8 19:49:33 :: Dungeon GetMapIndex 660004 Jun 8 19:49:33 :: XXX AddServerTimer Devil_5 660004 0x82184ae

 SYSERR: Jun 8 19:49:33 :: AddServerTimer: already registered server timer name:Devil_5 arg:660004

 

3. How to reproduce it ?

A group successfully completes the devil's tower, and immediately after it restarts the devil's tower using another channel, the server collapses when it completes the floor to find the right metin stones.

 

4. Screenshots  : https://metin2.download/picture/71g21ZUHw3C53DVYrlHArfle1q48VDi1/.png https://metin2.download/picture/dxg5hgaqifE4bBwU5aoX9lo0ZDmot59T/.png

 

Thanks, Sincerly,
 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

10 minutes ago, Vanilla said:

Can you provide a bit more insight on the crash? A full gdb backtrace would be nice. Otherwise we can't do much except for guesses.

 

A group successfully completes the devil's tower, and immediately after it restarts the devil's tower using another channel, the server collapses when it completes the floor to find the right metin stones.

 

https://paste.ubuntu.com/p/MgqyG7P3Dn/

2 hours ago, WeedHex said:

LUA_API int lua_gettop (lua_State *L) {
  return (L->top - L->base);
}

L pointer was null, but why? Maybe shit LUA.

 

I add the LUA here. :(

BT Full :

 

1. https://metin2.download/picture/Obp5nw5822MB3C2g5l3jzXZQTYb0Ab42/.png

2. https://metin2.download/picture/8HD0imnnCU3sYaueQy9PYS1mi0XgjBU1/.png

3. https://metin2.download/picture/4pU9BN9Z7z4ryfh37XHJ1b72f7Sx44qv/.png

4. https://metin2.download/picture/lYfE18j2RD85SoN1vS0g3R89WYT79302/.png

5. https://metin2.download/picture/XQ3j9tIrJ0Bf48FffSye3OHOU3Td80fo/.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

It looks like the OnKill trigger caused this issue. Did you change something there? Also the debug is incomplete, there are many variables optimized out, can you maybe try to build with higher debug flags so we can see more info? It'd be interesting to see if your quest is triggering the issue and what exactly is happening there. For now all I can say is that the OnKill event for the metinstone triggers HandleEvent (which is obvious) and then ExecuteQuestScript but no values are shown there due to optimization. But this one calls for RunState which which is also optimized out. Can you show me what's in questlua.cpp lien 1020? Or better yet show the whole function?

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment
Share on other sites

  • Premium

It's quest related, I would need to see the quest to help you, though.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

1 hour ago, Vanilla said:

It looks like the OnKill trigger caused this issue. Did you change something there? Also the debug is incomplete, there are many variables optimized out, can you maybe try to build with higher debug flags so we can see more info? It'd be interesting to see if your quest is triggering the issue and what exactly is happening there. For now all I can say is that the OnKill event for the metinstone triggers HandleEvent (which is obvious) and then ExecuteQuestScript but no values are shown there due to optimization. But this one calls for RunState which which is also optimized out. Can you show me what's in questlua.cpp lien 1020? Or better yet show the whole function?

	//
	// * RunState
	//
	// decides script to wait for user input, or finish
	//
	bool CQuestManager::RunState(QuestState & qs)
	{
		ClearError();

		m_CurrentRunningState = &qs;
		int ret = lua_resume(qs.co, qs.args);

		if (ret == 0)
		{
			if (lua_gettop(qs.co) == 0)
			{
				// end of quest
				GotoEndState(qs);
				return false;
			}

			if (!strcmp(lua_tostring(qs.co, 1), "select"))
			{
				GotoSelectState(qs);
				return true;
			}

			if (!strcmp(lua_tostring(qs.co, 1), "wait"))
			{
				GotoPauseState(qs);
				return true;
			}

			if (!strcmp(lua_tostring(qs.co, 1), "input"))
			{
				GotoInputState(qs);
				return true;
			}

			if (!strcmp(lua_tostring(qs.co, 1), "confirm"))
			{
				GotoConfirmState(qs);
				return true;
			}

			if (!strcmp(lua_tostring(qs.co, 1), "select_item"))
			{
				GotoSelectItemState(qs);
				return true;
			}
		}
		else
		{
			sys_err("LUA_ERROR: %s", lua_tostring(qs.co, 1));
		}

		WriteRunningStateToSyserr();
		SetError();

		GotoEndState(qs);
		return false;
	}
8 minutes ago, Syreldar said:

It's quest related, I would need to see the quest to help you, though.

 

Here sir https://paste.ubuntu.com/p/MgqyG7P3Dn/

Link to comment
Share on other sites

The whole quest is kinda.. ugh... I mean.. Really.

I would not recommend using ANY dungeon functions if you are NOT sure that the player actually IS in a dungeon. Could be the culprit since your kill trigger causes the crash and there are many kill triggers that actually check for dungeon flags even before there's a check if the player is in a dungeon. Dunno if the map_index check overwrites that but I wouldn't count on it.

 

Other than that server timers might still trigger even when the dungeon is already solved and destroyed. That might also be an issue, lemme check the quest a bit in detail, I only looked roughly over it. But I'm 99% sure it's the kill trigger that's causing it, at least the gdb clearly shows this and not a server_timer.

 

It's definitely a quest error and you'd actually ask this person since you paid for it. If he's too fine to fix it, he shouldn't have sold it. But what am I talking about? We're here in metin2 where almost anyone can sell any stuff as long as people are willing to pay for it, no matter the quality..

Edited by Vanilla
  • Love 2

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment
Share on other sites

Just now, WeedHex said:

Use default deviltower no?

 

Working, I couldn't find a proper deviltower. I searched so long. Turkish communities are weak in this regard. They changed everywhere.

 

Can you share it with me?

Just now, Vanilla said:

The whole quest is kinda.. ugh... I mean.. Really.

I would not recommend using ANY dungeon functions if you are NOT sure that the player actually IS in a dungeon. Could be the culprit since your kill trigger causes the crash and there are many kill triggers that actually check for dungeon flags even before there's a check if the player is in a dungeon. Dunno if the map_index check overwrites that but I wouldn't count on it.

 

I am aware. I think I should get rid of this dungeon now.

Link to comment
Share on other sites

  • Premium
7 minutes ago, xDwin said:

 

Working, I couldn't find a proper deviltower. I searched so long. Turkish communities are weak in this regard. They changed everywhere.

 

Can you share it with me?

 

I am aware. I think I should get rid of this dungeon now.

 

Just a fast search.

Btw I think you bought dungeon from "drakarys service" I made some research. I don't think he sells buggy things, maybe it's really your bad or bad service. Who knows.

Link to comment
Share on other sites

I am changing the quest so it's checking for pc.in_dungeon() first before actually calling d-functions. Tell me if it works, I'll edit it here as soon as I'm done with it. I did not check anything else on the quest but maybe this may even solve the mystery

 

quest deviltower_zone begin
	state start begin

		function clear_deviltower_flags()
			d.setf("katilmetini", 0)
			d.setf("bug_1", 0)
			d.setf("IsOn", 0)
			d.setf("stone_count", 0)
			d.setf("real_time", 0)
			d.setf("level", 0)
			d.setf("Sa_Soe",0)
			d.setf("Zin_Sa_Gui",0)
			d.setf("7_stone_kill",0)
			d.setqf2("deviltower_zone","can_refine", 0)
		end

		function GetMissionInfo(Floor,Time)
			d.command(string.format("RefreshDungeonTimer %d %d",Floor,Time))
		end

		function get_4floor_stone_pos()
			local positions = 
				{
					{368, 629}, {419, 630}, {428, 653}, {422, 679},
					{395, 689}, {369, 679}, {361, 658},
			}
			for i = 1, 6 do
				local j = number(i, 7)
				if i != j then
					local t = positions[i];
					positions[i] = positions[j];
					positions[j] = t;
				end
			end
			return positions
		end

		when 20348.chat."Şeytan Kulesi " begin
			if pc.get_level() < 40 then
				say_title("Kule Bekçisi :")
				say("")
				say("40 seviye altı kuleye giremez. ")
				return
			else
				say_title("Kule Bekçisi :")
				say("Şeytan kulesine girmek istiyor musun ? ")
				local s =  select("Gir ", "Vazgeç ")
				if s == 1 then
					pc.warp(216500,727000)
				else
					return
				end
			end
		end

		--[[when 20348.chat."2.Kattan Başla (Bireysel-Grup)" begin
			say_title(mob_name(20348))
			say("")
			local c = select("Grup olarak (75M)","Bireysel olarak (50M)","Vazgeç ")
			if c == 1 then
				if party.is_party() then
					if pc.get_gold() > 75000000 then
						say_title(mob_name(20348))
						say("")
						say("2.Kata Grupla gitmek istiyorsun demek ki ")
						say("Lakin 75M gibi bir ücreti bulunmakta ")
						say("kabul ediyor musun? ")
						say("")
						local x = select("Evet", "Hayır")
						if x == 2 then
							return
						else
							pc.change_gold(-75000000)
							d.new_jump_party(66, 2174, 7040)
							d.setf("level",2)
							d.setf("MeleyBLOCKMAP",1)
						end
					else
						say_title(mob_name(20348))
						say("")
						say("Gerekli paranız bulunmamakta! ")
						return
					end
				else
					say("Grup olmadan grup seçeneğine basamazsın! ")
					return
				end
			elseif c == 2 then
				if pc.get_gold() > 50000000 then
					say_title(mob_name(20348))
					say("")
					say("2.Kata tek gitmek istiyorsun demek ki ")
					say("Lakin 50M gibi bir ücreti bulunmakta ")
					say("kabul ediyor musun? ")
					say("")
					local x = select("Evet", "Hayır")
					if x == 2 then
						return
					else
						pc.change_gold(-50000000)
						d.new_jump(66, 2174 * 100, 7040 * 100)
						d.setf("MeleyBLOCKMAP",1)
						d.setf("level",2)
					end
				else
					say_title(mob_name(20348))
					say("")
					say("Gerekli yang karakteriniz de bulunmamakta! ")
				end
			else
				return
			end
		end
		--]]


-- Dungeon
---------------------------------------------------------------------
		when kill with npc.get_race() == 8015 and pc.get_map_index() == 66 begin
			timer("devil_stone1_1", 6)
		end
		-- Floor 2
		when devil_stone1_1.timer with pc.get_map_index() == 66 begin
			d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
			d.setf("level",2)
			d.setf("MeleyBLOCKMAP",1)
		end
		when login with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() <= 670000 begin
			cmdchat(string.format("RefreshDungeonTimer %d %d",d.getf("level"),d.getf("real_time")-get_global_time()))
			if d.getf("bug_1") == 0 then
				if d.getf("level") == 2 then
					d.regen_file("data/dungeon/deviltower/deviltower2_regen.txt")
					d.clear_regen()
					d.mission_notice(d.get_map_index(),"Bütün canavarları alt edin. ")
					d.setf("level",2)
					deviltower_zone.GetMissionInfo(2,15*60)
					d.setf("real_time",get_global_time()+15*60)
					server_timer('deviltower_fail', 15*60, d.get_map_index())
					d.setf("bug_1",1)
					d.setf("IsOn",1)
					d.setf("MeleyBLOCKMAP",1)
					server_loop_timer("devil_one_two_floor",5,d.get_map_index())
				end
			end
			if d.getf("MeleyBLOCKMAP") == 0 then
				pc.warp(590500, 110500)
				return
			end
			local level = d.getf("level")
			if level == 2 then
				d.jump_all(special.devil_tower[1][1],special.devil_tower[1][2])
			elseif level == 3 then
				d.jump_all(special.devil_tower[2][1],special.devil_tower[2][2])
			elseif level == 4 then
				d.jump_all(special.devil_tower[3][1],special.devil_tower[3][2])
			elseif level == 5 then
				d.jump_all(special.devil_tower[4][1],special.devil_tower[4][2])
			elseif level == 6 then
				d.jump_all(special.devil_tower[5][1],special.devil_tower[5][2])
			elseif level == 7 then
				d.jump_all(2048+590, 6656+638)
			elseif level == 8 then
				d.jump_all(2048+590, 6656+403)
			elseif level == 9 then
				d.jump_all(2048+590, 6656+155)
			end
		end

		when devil_one_two_floor.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.count_monster() < 1 then
					if d.getf("level") == 2 and d.getf("IsOn") == 1 then
						server_timer('Devil_3', 10, d.get_map_index())
						deviltower_zone.GetMissionInfo(2,10)
						d.mission_notice(d.get_map_index(),"Görev başarılı. Bir sonraki görev veriliyor... ")
						d.setf("real_time",get_global_time()+10)
						d.setf("IsOn",0)
						clear_server_timer('deviltower_fail', get_server_timer_arg())
					elseif d.getf("level") == 3 and d.getf("IsOn") == 1 then
						server_timer('Devil_4', 10, d.get_map_index())
						deviltower_zone.GetMissionInfo(3,10)
						d.mission_notice(d.get_map_index(),"Görev başarılı. Bir sonraki görev veriliyor... ")
						d.setf("real_time",get_global_time()+10)
						d.setf("IsOn",0)
						clear_server_timer('deviltower_fail', get_server_timer_arg())
					end
				end
			end
		end

		when Devil_3.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 2 then
					d.jump_all(special.devil_tower[2][1], special.devil_tower[2][2])
					d.setf("level",3)
					d.setf("IsOn",1)
					d.regen_file("data/dungeon/deviltower/deviltower3_regen.txt")
					d.clear_regen() -- clear
					d.mission_notice(d.get_map_index(),"Bütün canavarları alt edin. ")
					deviltower_zone.GetMissionInfo(3,15*60)
					d.setf("real_time",get_global_time()+15*60)
					server_timer('deviltower_fail', 15*60, d.get_map_index())
				end
			end
		end

		when Devil_4.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 3 then
					clear_server_timer('Devil_3', get_server_timer_arg())
					d.jump_all(special.devil_tower[3][1], special.devil_tower[3][2])
					d.setf("level",4)
					d.setf("IsOn",1)
					d.regen_file("data/dungeon/deviltower/deviltower4_regen.txt")
					d.clear_regen() -- clear
					d.mission_notice(d.get_map_index(),"Metin taşını alt et. ")
					deviltower_zone.GetMissionInfo(4,15*60)
					d.setf("real_time",get_global_time()+15*60)
					server_timer('deviltower_fail', 15*60, d.get_map_index())
				end
			end
		end

		when 8016.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			deviltower_zone.GetMissionInfo(4,10)
			d.setf("real_time",get_global_time()+10)
			d.mission_notice(d.get_map_index(),"Görev başarılı. Bir sonraki görev veriliyor... ")
			server_timer('Devil_4_1', 10, d.get_map_index())
			clear_server_timer('devil_one_two_floor', d.get_map_index())
			clear_server_timer('deviltower_fail', d.get_map_index())
		end

		when Devil_4_1.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 4 then
					clear_server_timer('Devil_4', get_server_timer_arg())
					clear_server_timer('deviltower_fail', get_server_timer_arg())
					local positions = deviltower_zone.get_4floor_stone_pos()
					for i = 1, 6 do
						d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
					end
					local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
					d.set_unique("real", vid)
					server_timer('deviltower_fail', 20*60, d.get_map_index())
					d.mission_notice(d.get_map_index(),"Gerçek metin taşını bulun. ")
					deviltower_zone.GetMissionInfo(4,20*60)
					d.setf("real_time",get_global_time()+20*60)
				end
			end
		end

		when deviltower_fail.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.global_warp_all_to_base(5905*100, 1105*100,get_server_timer_arg(),60)
				d.setf("MeleyBLOCKMAP",0)
			end
		end

		when Devil_5.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 4 then
					clear_server_timer('Devil_4_1', get_server_timer_arg())
					clear_server_timer('deviltower_fail', get_server_timer_arg())
					d.setf("level", 5)
					d.setf("stone_count", 5)
					d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
					d.set_regen_file("data/dungeon/deviltower/deviltower5_regen.txt") -- Sabit Metin
					d.mission_notice(d.get_map_index(),"Kilit açma taşlarını mühürlere sürükleyin. Kalan Mühür (5)")
					server_timer('deviltower_fail', 20*60, get_server_timer_arg())
					deviltower_zone.GetMissionInfo(5,20*60)
					d.setf("real_time",get_global_time()+20*60)
					d.spawn_mob(20073, 421, 452)
					d.spawn_mob(20073, 380, 460)
					d.spawn_mob(20073, 428, 414)
					d.spawn_mob(20073, 398, 392)
					d.spawn_mob(20073, 359, 426)
				end
			end
		end

		when Devil_6.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 5 then
					clear_server_timer('Devil_5', get_server_timer_arg())
					d.setf("level", 6)
					d.regen_file("data/dungeon/deviltower/deviltower6_regen.txt")
					d.clear_regen()
					d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
					server_timer('deviltower_fail', 15*60, get_server_timer_arg())
					deviltower_zone.GetMissionInfo(6,15*60)
					d.setf("real_time",get_global_time()+15*60)
					d.mission_notice(d.get_map_index(),"Kibirli Şeytan Kralı'nı alt edin.")
				end
			end
		end

		when Devil_7.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 6 then
					clear_server_timer('Devil_7', get_server_timer_arg())
					clear_server_timer('deviltower_fail', get_server_timer_arg())
					d.spawn_mob(8018, 639, 658)
					d.spawn_mob(8018, 611, 637)
					d.spawn_mob(8018, 596, 674)
					d.spawn_mob(8018, 629, 670)
					d.setf("level", 7)
					d.mission_notice(d.get_map_index(),"Bütün metin taşlarını alt edin.(0/4) ")
					deviltower_zone.GetMissionInfo(7,0)
					d.setf("real_time",get_global_time()+0)
					d.jump_all(2048+590, 6656+638)
				end
			end
		end

		when Devil_8.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 7 then
					clear_server_timer('Devil_7', get_server_timer_arg())
					d.setf("level", 8)
					d.jump_all(2048+590, 6656+403)
					d.set_regen_file("data/dungeon/deviltower/deviltower8_regen.txt")
					d.mission_notice(d.get_map_index(),"Zin Sa Gui anahtarını ele geçirip, anıt üzerine sürükleyin. ")
					deviltower_zone.GetMissionInfo(8,0)
					d.setf("real_time",get_global_time()+0)
					d.spawn_mob(20366, 640, 460)
				end
			end
		end

		when Devil_9.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.getf("level") == 8 then
					clear_server_timer('Devil_8', get_server_timer_arg())
					d.setf("level", 9)
					d.jump_all(2048+590, 6656+155)
					d.regen_file("data/dungeon/deviltower/deviltower9_regen.txt")
					d.clear_regen()
					deviltower_zone.GetMissionInfo(9,0)
					d.setf("real_time",get_global_time()+0)
					d.mission_notice(d.get_map_index(),"Lusifer alt edin. ")
				end
			end
		end

		when 8017.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 4 then
				return
			end
			if d.is_unique_dead("real") then
				d.notice("Doğru metin bulundu. ")
				d.mission_notice(d.get_map_index(),"Görev tamamlandı bir sonraki görev veriliyor.. ")
				d.new_kill_all()
				d.clear_regen() -- for stone
				server_timer('Devil_5', 10, d.get_map_index())
				deviltower_zone.GetMissionInfo(4,10)
				d.setf("real_time",get_global_time()+10)
			else
				d.notice("Yanlış metin taşı yok oldu. ")
			end
		end

		when 8040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 5 then
				return
			end
			game.drop_item(50084, 1)
		end

		when devil_stone5.take with pc.in_dungeon() and item.get_vnum() == 50084 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 5 then
				return
			end
			npc.purge()
			item.remove()
			d.setf("stone_count", d.getf("stone_count")-1)
			d.mission_notice(d.get_map_index(),"Kilit açma taşlarını mühürlere sürükleyin. Kalan mühür ("..d.getf("stone_count")..") ")
			if d.getf("stone_count") <= 0 then
				clear_server_timer('deviltower_fail', pc.get_map_index())
				d.dungeon_remove_all(50084)
				deviltower_zone.GetMissionInfo(5,10)
				d.mission_notice(d.get_map_index(),"Görev tamamlandı bir sonraki görev veriliyor.. ")
				server_timer("Devil_6", 10,d.get_map_index())
				d.setf("real_time",get_global_time()+10)
			end
		end

-- KIBIRLI SEYTAN KRAL
		when devil_stone6.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 6 then
				return
			end
			d.kill_all()
			d.clear_regen()
			d.mission_notice(d.get_map_index(),"Demirci'den bir üst kata ışınlanın. ")
			d.check_eliminated()
			local reward_alchemist = {20074, 20075, 20076}
			d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
			d.setqf2("deviltower_zone","can_refine", 1) -- dungeon all user
			clear_server_timer('deviltower_fail', pc.get_map_index())
		end
-- KIBIRLI SEYTAN KRAL

-- KULE DEMIRCI
		when 20074.chat.gameforge.deviltower_zone._170_npcChat or
			20076.chat.gameforge.deviltower_zone._170_npcChat or
			20075.chat.gameforge.deviltower_zone._170_npcChat with
			pc.in_dungeon() and
			pc.get_map_index() >= 660000 and
			pc.get_map_index() < 670000 and
			npc.lock() begin
			if d.getf("level") != 6 then
				clear()
				return
			end
			if pc.level >=60 then
				say_title(mob_name(20074))
				say(gameforge.deviltower_zone._190_say)
				wait()
				say_title(mob_name(20074))
				say(gameforge.deviltower_zone._200_say)
				local s= select(gameforge.deviltower_zone._210_select, gameforge.locale.cancel, gameforge.deviltower_zone._220_select)
				if s==3 then
					pc.warp(590500, 110900)
					return
				elseif s==2 then
					return
				else
					server_timer("Devil_7", 10,d.get_map_index())
					npc.unlock()
					d.new_kill_all()
					d.clear_regen() -- For Regen files
					deviltower_zone.GetMissionInfo(5,10)
					d.setf("real_time",get_global_time()+10)
					return
				end
			else
				say_title(mob_name(20074))
				say(gameforge.deviltower_zone._230_say)
				return
			end
		end
-- KULE DEMIRCI

-- OLUM METNI
		when 8018.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 7 then
				return
			end
			local stone = d.getf("7_stone_kill")+1
			d.setf("7_stone_kill", stone)
			d.mission_notice(d.get_map_index(),"Bütün metin taşlarını alt edin.("..d.getf("7_stone_kill").."/4) ")
			if stone >= 4 then
				d.setf("7_stone_kill",0)
				d.set_regen_file("data/dungeon/deviltower/deviltower7_regen.txt") -- just stone
				d.mission_notice(d.get_map_index(),"Metin taşını kesip tabelayı ele geçirin. Metin hakkı(200) ")
				d.setf("katilmetini",200)
			end
		end
-- OLUM METNI

-- KATIL METINI
		when 8019.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 7 then
				return
			end
			d.setf("katilmetini", d.getf("katilmetini")-1)
			d.mission_notice(d.get_map_index(),"Metin taşını kesip anahtarını ele geçirin. Metin hakkı ("..d.getf("katilmetini")..") ")
			local pct = number(1,10)
			if pct == 1 then
				game.drop_item(30302, 1)
			end
			if d.getf("katilmetini") < 1 then
				d.mission_notice(d.get_map_index(),"Metin hakkınız bitti. Yukarı gönderiliyorsunuz. ")
				d.setf("katilmetini", 0)
				d.clear_regen()
				server_timer("Devil_8", 10,d.get_map_index())
				deviltower_zone.GetMissionInfo(7,10)
				d.setf("real_time",get_global_time()+10)
			end
		end
-- KATIL METINI

-- KATIL METINI ITEMI
		when 30302.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000  begin
			if d.getf("level") != 7 then
				return
			end
			if d.getf("Zin_Sa_Gui") == 0 then
				d.new_kill_all()
				d.clear_regen()
				pc.remove_item(30302, 1)
				server_timer("Devil_8", 10,d.get_map_index())
				d.mission_notice(d.get_map_index(),"Görev başarılı bir sonraki göreve gönderiliyorsunuz. ")
				d.setf("Zin_Sa_Gui",1)
				deviltower_zone.GetMissionInfo(7,10)
				d.setf("real_time",get_global_time()+10)
				d.dungeon_remove_all(30302) -- Sau Gui Tabelası
			else
				d.notice("Bug bildirildi yetkili kişilere! ")
				return
			end
		end
-- KATIL METINI ITEMI

-- ZING BONG IN
		when 1040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
			if d.getf("level") != 8 then
				return
			end
			local lucky = number(1, 20)
			if lucky == 1 then
				game.drop_item(30304, 1)
			end
		end
-- ZING BONG IN

-- 8 KAT ANIT
		when 20366.take with item.get_vnum() == 30304 and pc.in_dungeon() begin
			if d.getf("level") != 8 then
				return
			end
			if d.getf("Sa_Soe") == 0 then
				item.remove()
				d.new_kill_all()
				d.clear_regen()
				d.setf("Sa_Soe",1)
				server_timer("Devil_9", 10,d.get_map_index())
				deviltower_zone.GetMissionInfo(8,10)
				d.setf("real_time",get_global_time()+10)
				d.mission_notice(d.get_map_index(),"Görev başarılı bir sonraki göreve gönderiliyorsunuz. ")
				d.dungeon_remove_all(30304) -- Zin Bong In Anahtar
			else
				d.notice("Bug bildirildi yetkili kişilere! ")
				return
			end
		end
-- 8 KAT ANIT


-- AZRAIL KESME
		when 1093.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() <= 670000 begin
        	if d.getf("level") != 9 then
				return
			end
			local x = pc.get_map_index()
			clear_server_timer('Devil_9', pc.get_map_index())
			d.global_warp_all_to_base(5905*100, 1105*100,pc.get_map_index(),60)
			deviltower_zone.clear_deviltower_flags()
			deviltower_zone.GetMissionInfo(9,60)
			d.setf("real_time",get_global_time()+1*60)
			d.setf("WeKillAzo",1)
			d.setf("MeleyBLOCKMAP",0)
			d.mission_notice(d.get_map_index(),"Görev başarılı. Dışarı gönderiliyorsunuz. ")
		end
-- AZRAIL KESME

		when 20348.chat."Zindana geri dön... " with pc.getf("deviltower_zone","map") >= 1 begin
			local c = pc.getf("deviltower_zone","map")
			local z = pc.getf("deviltower_zone","channel")
			local dwLevel = d.getf_from_map_index("level",c)
			if z == pc.get_channel_id() then
				if d.select(c) then
					if get_global_time() > pc.getf("deviltower_zone","time") then
						say("Geri dönme hakkını kaybettin. ")
						pc.setf("deviltower_zone","map",0)
						pc.setf("deviltower_zone","time",0)
						pc.setf("deviltower_zone","channel",0)
						return
					end
					if dwLevel == 2 then
						pc.warp(special.devil_tower[1][1]*100,special.devil_tower[1][2]*100, c)
					elseif dwLevel == 2 then
						pc.warp(special.devil_tower[2][1]*100,special.devil_tower[2][2]*100, c)
					elseif dwLevel == 3 then
						pc.warp(special.devil_tower[3][1]*100,special.devil_tower[3][2]*100, c)
					elseif dwLevel == 4 then
						pc.warp(special.devil_tower[4][1]*100,special.devil_tower[4][2]*100, c)
					else
						pc.warp(special.devil_tower[5][1]*100,special.devil_tower[5][2]*100, c)
					end
				else
					say("Zindan patronu kesildi! ")
					pc.setf("devilcatacomb_zone","map",0)
					pc.setf("devilcatacomb_zone","time",0)
					pc.setf("devilcatacomb_zone","channel",0)
				end
			else
				say("Zindanınız bu kanalda görünmüyor! ")
				say(string.format("Zindanı açtığınız kanal: %d ",z))
				return
			end
		end


		when logout with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() <= 670000 begin
			if d.select(pc.get_map_index()) then
				if d.getf("MeleyBLOCKMAP") == 1 then
					pc.setf("deviltower_zone","map",d.get_map_index())
					pc.setf("deviltower_zone","time",get_global_time()+5*60)
					pc.setf("deviltower_zone","channel",pc.get_channel_id())
				else
					pc.setf("deviltower_zone","map",0)
					pc.setf("deviltower_zone","time",0)
					pc.setf("deviltower_zone","channel",0)
				end
			end
		end
	end
end
Edited by Vanilla

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

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



×
×
  • 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.