Jump to content
  • 0

Devil Tower quest dont work


Monkey Dungeon

Question

After i kill the first metin on EG the player dont warp -.-

 

Quest :

quest deviltower_zone begin


    state start begin
    when login begin
        if pc.get_map_index() == 66 then
            if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
                pc.warp((5376+532)*100, (512+596+4)*100, 65)
            end
        pc.set_warp_location(65, 5376+532, 512+596+4)
        elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
            pc.set_warp_location(65, 5376+532, 512+596+4)
        end
    end

    when logout begin
        if pc.count_item(30300) >= 1 then
            pc.remove_item(30300, pc.count_item(30300))
        end
        -- not used in the game
        -- pc.remove_item(30301, pc.count_item(30301))
        if pc.count_item(30302) >= 1 then
            pc.remove_item(30302, pc.count_item(30302))
        end
    end
        
    when deviltower_man.chat.gameforge.deviltower_zone._10_npcChat begin
        if pc.get_level() < 40 then
            say_title(gameforge.deviltower_zone._20_sayTitle)
            say(gameforge.deviltower_zone._30_say)
        else
            say_title(gameforge.deviltower_zone._20_sayTitle)
            say(gameforge.deviltower_zone._40_say)
            local s =  select(gameforge.locale.monkey_dungeon.enter, gameforge.locale.monkey_dungeon.no_enter)
            if s == 1 then
                pc.warp(216500,727000)
            end
        end
    end
    when 8015.kill begin
        timer("devil_stone1_1", 6)
    end
    when devil_stone1_1.timer begin
        d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
        d.regen_file("data/dungeon/deviltower2_regen.txt")
        d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
    end
    when devil_stone3.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
        d.check_eliminated()
    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;
                positions = positions[j];
                positions[j] = t;
            end
        end
        return positions
    end

    when 8016.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.setf("level", 4)
        local positions = deviltower_zone.get_4floor_stone_pos()

        for i = 1, 6 do
            test_chat(positions[1], positions[2])
            d.set_unique("fake" .. i , d.spawn_mob(8017, positions[1], positions[2]))
        end

        test_chat(positions[7][1], positions[7][2])

        local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
        test_chat(vid)
        d.set_unique("real", vid)
        server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
        server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
        
        notice_multiline(gameforge.deviltower_zone._50_dNotice,d.notice)
        
    end

    when devil_stone4_fail1.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._60_dNotice,d.notice)
            server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
        end
    end

    when devil_stone4_fail2.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._70_dNotice,d.notice)
            server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
        end
    end

    when devil_stone4_fail.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._80_dNotice,d.notice)
            d.clear_regen()
            d.exit_all()
            clear_server_timer('devil_stone4_update', get_server_timer_arg())
        end
    end

    when devil_stone4_update.server_timer begin
        if d.select(get_server_timer_arg()) then
            if not d.is_unique_dead("real") then
                for i = 1, 6 do
                    if d.getf("fakedead" .. i) == 0 then
                        if d.unique_get_hp_perc("fake" .. i) < 50 then
                            d.purge_unique("fake" .. i)
                            d.setf("fakedead" .. i, 1)
                            notice_multiline(gameforge.deviltower_zone._90_dNotice,d.notice)
                        end
                    end
                end
            else
                server_timer("devil_stone4_end", 5, get_server_timer_arg())
                --d.kill_all()
                d.purge()
                notice_multiline(gameforge.deviltower_zone._100_dNotice,d.notice)
                clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
                clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
                clear_server_timer('devil_stone4_fail', get_server_timer_arg())
            end
        else
            server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
        end
    end

    when devil_stone4_stop_timer.server_timer begin
        clear_server_timer('devil_stone4_update', get_server_timer_arg())
    end

    when devil_stone4_end.server_timer begin
        if d.select(get_server_timer_arg()) then
            clear_server_timer('devil_stone4_update', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail', get_server_timer_arg())
            
            -- clear regen from memory when exit
            d.clear_regen()
            
            d.setf("level", 5)
            d.setf("stone_count", 5)
            notice_multiline(gameforge.deviltower_zone._110_dNotice,d.notice)
            d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
            server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
            clear_server_timer('devil_stone4_update', get_server_timer_arg())

            d.set_regen_file("data/dungeon/deviltower5_regen.txt")

            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
    when devil_stone5_fail1.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._120_dNotice,d.notice)
            server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
        end
    end

    when devil_stone5_fail2.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._60_dNotice,d.notice)
            server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
        end
    end

    when devil_stone5_fail3.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._70_dNotice,d.notice)
            server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
        end
    end

    when devil_stone5_fail.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._80_dNotice,d.notice)
            d.exit_all()
        end
    end


    when 1062.kill with pc.in_dungeon() and d.getf("level") == 5 begin
        local KILL_COUNT_FOR_DROP_KEY = 50
        local n =d.getf("count") + 1
        d.setf("count", n)
        if n == KILL_COUNT_FOR_DROP_KEY then
            game.drop_item(50084, 1)
            d.setf("count", 0)
        end
    end

    when devil_stone5.take with item.vnum == 50084 begin
        npc.purge()
        item.remove()
        d.setf("stone_count", d.getf("stone_count") - 1)
        if d.getf("stone_count") <= 0 then
            d.setf("level", 6)
            d.clear_regen()
            d.regen_file("data/dungeon/deviltower6_regen.txt")

            notice_multiline(gameforge.deviltower_zone._130_dNotice,d.notice)
            d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
            local server_arg = d.get_map_index()
            clear_server_timer('devil_stone5_fail1', server_arg)
            clear_server_timer('devil_stone5_fail2', server_arg)
            clear_server_timer('devil_stone5_fail3', server_arg)
            clear_server_timer('devil_stone5_fail', server_arg)
        else
            d.notice(string.format(gameforge.deviltower_zone._140_dNotice, d.getf("stone_count")))
        end
    end

    when devil_stone6.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 begin
        d.kill_all()
        notice_multiline(gameforge.deviltower_zone._150_dNotice,d.notice)
        d.check_eliminated()
        notice_multiline(gameforge.deviltower_zone._160_dNotice,d.notice)
        local reward_alchemist = {20074, 20075, 20076}
        d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
        d.setqf2("deviltower_zone","can_refine", 1)
    end


    when 20074.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
        say_title(mob_name(20074))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            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
            end    
            if s==2 then
                return
            end

            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20074))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end

    when 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
        say_title(mob_name(20075))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            say_title(mob_name(20075))

            say(gameforge.deviltower_zone._200_say)
            local s= select(gameforge.deviltower_zone._210_select, gameforge.deviltower_zone._220_select)
            if s==3 then
                pc.warp(590500, 110900)
                return
            end    
            if s==2 then
                return
            end    

            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20075))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end
    when 20076.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
        say_title(mob_name(20076))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            say_title(mob_name(20076))

            say(gameforge.deviltower_zone._200_say)
            local s= select(gameforge.deviltower_zone._210_select, gameforge.deviltower_zone._220_select)
            if s==3 then
                pc.warp(590500, 110900)
                return
            end    
            if s==2 then
                return
            end    

            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20076))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end
    when devil_jump_7.timer begin
        d.clear_regen()

        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)


        notice_multiline(gameforge.deviltower_zone._240_dNotice,d.notice)
        d.jump_all(2048+590, 6656+638)
    end

    when 8018.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        local cont = d.getf("7_stone_kill") + 1
        d.setf("7_stone_kill", cont)

        if cont >= 4 then
            d.setf("7_stone_kill", 0)
            d.set_regen_file("data/dungeon/deviltower7_regen.txt")
        end    
    end

    when 8019.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        game.drop_item(30300, 1)
    end

    when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        pc.remove_item("30300", 1)

        local pct = number(1,10)

        if pct == 1 then
            game.drop_item(30302, 1)
            d.clear_regen()
        else
            -- nothing happens cause the items isnt used in the game
            -- game.drop_item(30301, 1)
        end
    end

    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
            pc.remove_item( "30302", 1)
            return
        end
            
        say_title(gameforge.blacksmith._40_sayTitle)
        say(gameforge.deviltower_zone._250_say)
        pc.remove_item("30302", 1)
        timer("devil_jump_8", 6)
        d.clear_regen()
    end

    when devil_jump_8.timer begin
        d.setf("level", 8)

        notice_multiline(gameforge.deviltower_zone._260_dNotice,d.notice)
        d.jump_all(2048+590, 6656+403)
        d.set_regen_file("data/dungeon/deviltower8_regen.txt")
        d.spawn_mob(20366, 640, 460)
        local _count = pc.count_item(30302)
        pc.remove_item(30302,_count)
        
    end

    when 1040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        local pct1 = number(1, 5)
        if pct1 == 1 then
            local pct2 = number(1, 10)
            if pct2 == 1 then
                game.drop_item(30304, 1)
            else
                game.drop_item(30303, 1)
            end
        else
            return
        end
    end

    when 20366.take with item.vnum == 30304 begin
        npc.purge()
        item.remove()
        timer("devil_jump_9", 6)
    end

    when devil_jump_9.timer begin
        d.setf("level", 9)
        d.jump_all(2048+590, 6656+155)
        d.regen_file("data/dungeon/deviltower9_regen.txt")
    end
    when 1093.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.kill_all()
        timer("sensi_killed", 5)
    end
    when sensi_killed.timer begin
        cmdchat("CMD1")
        d.kill_all()
        d.spawn_mob(9012, 618, 187)
        d.spawn_mob(20074, 611, 179)
        d.spawn_mob(20075, 620, 170)
        d.spawn_mob(20076, 628, 179)
        d.spawn_mob(9003, 621, 187)
        d.setqf("can_refine", 1)
        d.notice("Du hast den Sensenmann getötet und damit den 2. Teil des Dungeons abgeschlossen.")
        d.notice("Als Belohnung darfst du einen Gegenstand bei den dämonischen Schmieden verbessern.")
        d.notice("Falls du den Dungeon fortführen möchtest, kannst du dir bei der Gemischtwarenhändlerin")
        d.notice("erneut Tränke kaufen. Du wirst in 2 Minuten automatisch auf die nächste Ebene teleportiert.")
        timer("zeit_nach_sensi", 110)
    end
    when zeit_nach_sensi.timer begin
        d.notice("In 10 Sekunden wirst du auf die nächste Ebene teleportiert.")
        timer("zeit_bis_gemeinerking", 10)
    end
    when zeit_bis_gemeinerking.timer begin
        d.jump_all(2048+590, 6656+155)
        d.kill_all()
        d.spawn_mob(1094, 620, 170)
        d.notice("Der Gemeine Dämonenkönig treibt hier sein Unwesen.")
        d.notice("Töte ihn, um auf die nächste Ebene zu gelangen.")
    end
    when 1094.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        timer("zeit_bis_bt", 10)
        d.notice("Du hast den Gemeinen Dämonenkönig getötet.")
        d.notice("In 10 Sekunden wirst du auf die letzte Ebene teleportiert.")
    end
    when zeit_bis_bt.timer begin
        d.jump_all(2048+590, 6656+155)
        d.kill_all()
        d.spawn_mob(1095, 620, 170)
        d.notice("Du befindest dich auf der letzten Ebene des Dämonenturmes.")
        d.notice("Töte den Blauen Tod und du wirst reich belohnt!")
    end
    when 1095.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        cmdchat("CMD1")
        d.kill_all()
        d.spawn_mob(9012, 618, 187)
        d.spawn_mob(20074, 611, 179)
        d.spawn_mob(20075, 620, 170)
        d.spawn_mob(20076, 628, 179)
        d.spawn_mob(9003, 621, 187)
        d.setqf("can_refine", 1)
        d.notice("Du hast den Blauen Tod getötet und damit den Dämonenturm abgeschlossen.")
        d.notice("Herzlichen Glückwunsch!")
        d.notice("Du darfst erneut einen Gegenstand bei den dämonischen Schmieden verbessern. Viel Glück!")
        notice_all("".. pc.get_name() .." hat den Blauen Tod getötet und damit den Dämonenturm abgeschlossen.")
    end
end
end

 

whats wrong? :/

Link to comment

14 answers to this question

Recommended Posts

  • 0
quest deviltower_zone begin
    state start begin
        when login begin
            if pc.get_map_index() == 66 then
                if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
                    pc.warp((5376+532)*100, (512+596+4)*100, 65)
                end
                pc.set_warp_location(65, 5376+532, 512+596+4)
            elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
                pc.set_warp_location(65, 5376+532, 512+596+4)
            end
        end

		when logout begin
			pc.remove_item(30300, pc.count_item(30300))
			pc.remove_item(30301, pc.count_item(30301))
			pc.remove_item(30302, pc.count_item(30302))
		end
	when deviltower_man.chat.locale.deviltower_man_chat begin
            say_title("Wächter des Dämonturmes")
			if pc . get_level ( ) < 40 then 
				say("Du hast noch nicht genügend Erfahrung gesammelt.")
				say("Komme wieder, wenn du Level 40 bist!") 
				return
			end
			say("Möchtest du den Daemonenturm betreten?") 
			local s = select ("Betreten", "Abbrechen") 
			if s == 1 then 
				pc.warp (216500, 727000) 				
			end
        end
        when kill begin
		    if npc.get_race() == 8015 then
                timer("devil_stone1_1", 6)
           end
		end
        when devil_stone1_1.timer begin
            d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
            d.regen_file("data/dungeon/deviltower2_regen.txt")
            d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
        end
        when kill begin
		    if npc.get_race() == 1091 then
                d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
                d.check_eliminated()
            end
		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 kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		    if npc.get_race() == 8016 then
                d.setf("level", 4)
                local positions = deviltower_zone.get_4floor_stone_pos()
                for i = 1, 6 do
                    chat(positions[i][1], positions[i][2])
                    d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
                end
                chat(positions[7][1], positions[7][2])
                local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
                chat(vid)
                d.set_unique("real", vid)
	        server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
	        server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())

                d.notice("Findet den richtigen Metinstein und zerstört ihn.")
			    d.notice("Die falschen Metinsteine werden verschwinden!")
			    d.notice("Ihr habt 15 Minuten zeit!")
            end
		end

        when devil_stone4_fail1.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 10 Minuten")
		server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone4_fail2.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 5 Minuten")
		server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone4_fail.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Die Zeit ist abgelaufen")
				d.notice("Ihr werdet nun nach draußen teleportiert")
                d.exit_all()
		clear_server_timer('devil_stone4_update', get_server_timer_arg())
            end
        end

        when devil_stone4_update.server_timer begin
            if d.select(get_server_timer_arg()) then
                if not d.is_unique_dead("real") then
                    for i = 1, 6 do
                        if d.getf("fakedead" .. i) == 0 then
                            if d.unique_get_hp_perc("fake" .. i) < 50 then
                                d.purge_unique("fake" .. i)
                                d.setf("fakedead" .. i, 1)
                                d.notice("Die falschen Metinsteine verschwinden..");
                            end
                        end
                    end
                else
                    server_timer("devil_stone4_end", 5, get_server_timer_arg())
                    d.notice("Ihr habt den richtigen Metinstein zerstört.")
					d.notice("Ihr werdet nun in die nächste Etage teleportiert")
		    clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
		    clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
		    clear_server_timer('devil_stone4_fail', get_server_timer_arg())
                end
            else
		server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
            end
        end

        when devil_stone4_stop_timer.server_timer begin
	    clear_server_timer('devil_stone4_update', get_server_timer_arg())
        end

        when devil_stone4_end.server_timer begin
            if d.select(get_server_timer_arg()) then
			clear_server_timer('devil_stone4_update', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail', get_server_timer_arg())

                d.setf("level", 5)
                d.setf("stone_count", 5)
               d.notice("Du bist nun in der 5. Ebene")
				d.notice("Öffne alle Alten Siegel um in die nächste Ebene zu gelangen.")
				d.notice("Du hast 20 Minuten Zeit um alle Siegel zu öffnen.")
                d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
		server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
		clear_server_timer('devil_stone4_update', get_server_timer_arg())

                d.set_regen_file("data/dungeon/deviltower5_regen.txt")

                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
        when devil_stone5_fail1.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 15 Minuten")
		server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail2.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 10 Minuten")
		server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail3.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 5 Minuten")
		server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Die Zeit ist abgelaufen")
				d.notice("Ihr werdet nun nach draußen teleportiert")
                d.exit_all()
            end
        end

        when kill with npc.get_race() == 1062 and pc.in_dungeon() and d.getf("level") == 5 begin
            local KILL_COUNT_FOR_DROP_KEY = 50
            local n =d.getf("count") + 1
            d.setf("count", n)
            if n == KILL_COUNT_FOR_DROP_KEY then
                game.drop_item(50084, 1)
                d.setf("count", 0)
			end
        end
        when devil_stone5.take with item.vnum == 50084 begin
            npc.purge()
            item.remove()
            d.setf("stone_count", d.getf("stone_count") - 1)
            if d.getf("stone_count") <= 0 then
				clear_server_timer('devil_stone5_fail1', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail2', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail3', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail', get_server_timer_arg())
                d.notice("Ihr habt alle alten Siegel geöffnet. Herzlichen Glückwunsch!")
				d.notice("Als Belohnung erhaltet ihr einen besonderen Schmied!")
				d.kill_all()
				d.check_eliminated()
                local reward_alchemist = {20074, 20075, 20076}
            	d.spawn_mob(reward_alchemist[number(1,3)], 383, 462);
				d.setqf("can_refine", 1)
            else
                d.notice("Es verbleibt eine Anzahl von "..d.getf("stone_count").." Siegeln")
            end
        end

        when 20074.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
              say_title(mob_name(20074))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20074))
              if pc.level >=75 then
              say(""..mob_name(20074)..":")
                  say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
                  npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
              say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht Level 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
	        end
       when 20075.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
		      say_title(mob_name(20075))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20075))
              if pc.level >=75 then
                   say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
                  npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
		       say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht Level 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
        end
       when 20076.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
		      say_title(mob_name(20076))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20076))
              if pc.level >=75 then
                   say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
				    npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
		    say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht LvL 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
	    end

       when devil_jump_7.timer begin
		
	    end
	
	    when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	        if npc.get_race() == 8018 then
			    local cont = d.getf("7_stone_kill") + 1
			    d.setf("7_stone_kill", cont)

			    if cont >= 4 then
				    d.setf("7_stone_kill", 0)
				    d.set_regen_file("data/dungeon/deviltower7_regen.txt")
			    end
            end
	    end

	    when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	        if npc.get_race() == 8019 then
			    game.drop_item(30300, 1)
		    end
	    end

	    when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		    pc.remove_item("30300", 1)

		    local pct = number(1,10)

		    if pct == 1 then
			    game.drop_item(30302, 1)
			    d.clear_regen()
		    else
			    game.drop_item(30301, 1)
			
		    end
	    end

	    when 30302.use with pc.in_dungeon() and d.getf( "level" ) == 7 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		-- 8ÃþÀ¸·Î ¿öÇÁ

			    if d.getf( "level" ) != 7 then
				    pc.remove_item( "30302", 1)
				    return
			    end
			
		    say_title("Karte")
			    say("Die Karte wird euch alle in die nächste Ebene")
			    say("des Dämonenturms bringen.")
		    pc.remove_item("30302", 1)
	        timer("devil_jump_8", 6)
		    d.setf("level", 8)
		    d.clear_regen()
	    end
						
	--------------------------------------------
	-- 8Ãþ ÁøÀÔºÎÅÍ 9Ãþ ±îÁö
	--------------------------------------------
	when devil_jump_8.timer begin
		d.jump_all(2048+590, 6656+403)
		d.set_regen_file("data/dungeon/deviltower8_regen.txt")
		d.spawn_mob(20366, 640, 460)
		local _count= pc.count_item(30302)-- Áø »ç±ÍŸ¿ö Áö¿ì±â
		pc.remove_item(30302,_count)
		
	end

	when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	    if npc.get_race() == 1040 then
			local pct1 = number(1, 5)

			if pct1 == 1 and d.getf("level") == 8 then
				local pct2 = number(1, 10)
				if pct2 == 1 then
				-- ÁøÂ¥ ¿*¼è µå·Ó
					game.drop_item(30304, 1)
				else
				-- °¡Â¥ ¿*¼è µå·Ó
					game.drop_item(30303, 1)
				end
			else
				return
			end
		end
	end

	when 20366.take with item.vnum == 30304 begin
		-- ºÀÀÎ ÇØü 9Ãþ ¤¡¤¡
		npc.purge()
		item.remove()
		timer("devil_jump_9", 6)
	end

	---------------------------------------------
	-- 9Ãþ ÁøÀÔºÎÅÍ ¿Ï·á±îÁö
	---------------------------------------------
	when devil_jump_9.timer begin
		d.setf("level", 9)
		d.jump_all(2048+590, 6656+155)
		d.regen_file("data/dungeon/deviltower9_regen.txt")
	end

	when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	    if npc.get_race() == 1093 then
			d.kill_all()
			timer("devil_end_jump", 60)
		end
	end

	when devil_end_jump.timer begin
	    d.exit_all()
	end
end
end

This one should work. Good luck ^_^

  • Love 1
Link to comment
  • 0
quest deviltower_zone begin
    state start begin
        when login begin
            if pc.get_map_index() == 66 then
                if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
                    pc.warp((5376+532)*100, (512+596+4)*100, 65)
                end
                pc.set_warp_location(65, 5376+532, 512+596+4)
            elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
                pc.set_warp_location(65, 5376+532, 512+596+4)
            end
        end

		when logout begin
			pc.remove_item(30300, pc.count_item(30300))
			pc.remove_item(30301, pc.count_item(30301))
			pc.remove_item(30302, pc.count_item(30302))
		end
	when deviltower_man.chat.locale.deviltower_man_chat begin
            say_title("Wächter des Dämonturmes")
			if pc . get_level ( ) < 40 then 
				say("Du hast noch nicht genügend Erfahrung gesammelt.")
				say("Komme wieder, wenn du Level 40 bist!") 
				return
			end
			say("Möchtest du den Daemonenturm betreten?") 
			local s = select ("Betreten", "Abbrechen") 
			if s == 1 then 
				pc.warp (216500, 727000) 				
			end
        end
        when kill begin
		    if npc.get_race() == 8015 then
                timer("devil_stone1_1", 6)
           end
		end
        when devil_stone1_1.timer begin
            d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
            d.regen_file("data/dungeon/deviltower2_regen.txt")
            d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
        end
        when kill begin
		    if npc.get_race() == 1091 then
                d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
                d.check_eliminated()
            end
		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 kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		    if npc.get_race() == 8016 then
                d.setf("level", 4)
                local positions = deviltower_zone.get_4floor_stone_pos()
                for i = 1, 6 do
                    chat(positions[i][1], positions[i][2])
                    d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
                end
                chat(positions[7][1], positions[7][2])
                local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
                chat(vid)
                d.set_unique("real", vid)
	        server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
	        server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())

                d.notice("Findet den richtigen Metinstein und zerstört ihn.")
			    d.notice("Die falschen Metinsteine werden verschwinden!")
			    d.notice("Ihr habt 15 Minuten zeit!")
            end
		end

        when devil_stone4_fail1.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 10 Minuten")
		server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone4_fail2.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 5 Minuten")
		server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone4_fail.server_timer with d.getf("level") == 4 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Die Zeit ist abgelaufen")
				d.notice("Ihr werdet nun nach draußen teleportiert")
                d.exit_all()
		clear_server_timer('devil_stone4_update', get_server_timer_arg())
            end
        end

        when devil_stone4_update.server_timer begin
            if d.select(get_server_timer_arg()) then
                if not d.is_unique_dead("real") then
                    for i = 1, 6 do
                        if d.getf("fakedead" .. i) == 0 then
                            if d.unique_get_hp_perc("fake" .. i) < 50 then
                                d.purge_unique("fake" .. i)
                                d.setf("fakedead" .. i, 1)
                                d.notice("Die falschen Metinsteine verschwinden..");
                            end
                        end
                    end
                else
                    server_timer("devil_stone4_end", 5, get_server_timer_arg())
                    d.notice("Ihr habt den richtigen Metinstein zerstört.")
					d.notice("Ihr werdet nun in die nächste Etage teleportiert")
		    clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
		    clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
		    clear_server_timer('devil_stone4_fail', get_server_timer_arg())
                end
            else
		server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
            end
        end

        when devil_stone4_stop_timer.server_timer begin
	    clear_server_timer('devil_stone4_update', get_server_timer_arg())
        end

        when devil_stone4_end.server_timer begin
            if d.select(get_server_timer_arg()) then
			clear_server_timer('devil_stone4_update', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
			clear_server_timer('devil_stone4_fail', get_server_timer_arg())

                d.setf("level", 5)
                d.setf("stone_count", 5)
               d.notice("Du bist nun in der 5. Ebene")
				d.notice("Öffne alle Alten Siegel um in die nächste Ebene zu gelangen.")
				d.notice("Du hast 20 Minuten Zeit um alle Siegel zu öffnen.")
                d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
		server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
		clear_server_timer('devil_stone4_update', get_server_timer_arg())

                d.set_regen_file("data/dungeon/deviltower5_regen.txt")

                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
        when devil_stone5_fail1.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 15 Minuten")
		server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail2.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 10 Minuten")
		server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail3.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Verbleibende Zeit: 5 Minuten")
		server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
            end
        end

        when devil_stone5_fail.server_timer with d.getf("level") == 5 begin
            if d.select(get_server_timer_arg()) then
                d.notice("Die Zeit ist abgelaufen")
				d.notice("Ihr werdet nun nach draußen teleportiert")
                d.exit_all()
            end
        end

        when kill with npc.get_race() == 1062 and pc.in_dungeon() and d.getf("level") == 5 begin
            local KILL_COUNT_FOR_DROP_KEY = 50
            local n =d.getf("count") + 1
            d.setf("count", n)
            if n == KILL_COUNT_FOR_DROP_KEY then
                game.drop_item(50084, 1)
                d.setf("count", 0)
			end
        end
        when devil_stone5.take with item.vnum == 50084 begin
            npc.purge()
            item.remove()
            d.setf("stone_count", d.getf("stone_count") - 1)
            if d.getf("stone_count") <= 0 then
				clear_server_timer('devil_stone5_fail1', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail2', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail3', get_server_timer_arg())
				clear_server_timer('devil_stone5_fail', get_server_timer_arg())
                d.notice("Ihr habt alle alten Siegel geöffnet. Herzlichen Glückwunsch!")
				d.notice("Als Belohnung erhaltet ihr einen besonderen Schmied!")
				d.kill_all()
				d.check_eliminated()
                local reward_alchemist = {20074, 20075, 20076}
            	d.spawn_mob(reward_alchemist[number(1,3)], 383, 462);
				d.setqf("can_refine", 1)
            else
                d.notice("Es verbleibt eine Anzahl von "..d.getf("stone_count").." Siegeln")
            end
        end

        when 20074.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
              say_title(mob_name(20074))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20074))
              if pc.level >=75 then
              say(""..mob_name(20074)..":")
                  say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
                  npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
              say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht Level 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
	        end
       when 20075.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
		      say_title(mob_name(20075))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20075))
              if pc.level >=75 then
                   say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
                  npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
		       say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht Level 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
        end
       when 20076.chat."Die höheren Etagen.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
		      say_title(mob_name(20076))
			    say("Ihr möchtet in die 7.Etage?")
			    say("Ihr haben Glück! Heute erlaube ich es ihnen vielleicht!")
			    say("Aber voher muss ich euch noch prüfen..")
			    say("Mal sehen..")
              wait()
		      say_title(mob_name(20076))
              if pc.level >=75 then
                   say("Ich erlaube euch weiterzugehen!")
				    say("Viel Glück und passt auf euch auf da oben!")
				    npc.unlock()
				    d.purge()
				    wait()
                 d.clear_regen()
			    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.jump_all(2048+590, 6656+638)
                  return
              end
		    say_reward("Betreten der 7.Etage nicht erlaubt!")
			    say("Ihr seid nicht qualifiziert genug!")
			    say("Erreicht LvL 75 oder höher,")
			    say("damit ihr eure Fertigkeiten steigern könnt")
			    say("und kommt dann wieder!")
		    wait()
		    pc.warp(590500, 110500)
		    return
	    end

       when devil_jump_7.timer begin
		
	    end
	
	    when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	        if npc.get_race() == 8018 then
			    local cont = d.getf("7_stone_kill") + 1
			    d.setf("7_stone_kill", cont)

			    if cont >= 4 then
				    d.setf("7_stone_kill", 0)
				    d.set_regen_file("data/dungeon/deviltower7_regen.txt")
			    end
            end
	    end

	    when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	        if npc.get_race() == 8019 then
			    game.drop_item(30300, 1)
		    end
	    end

	    when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		    pc.remove_item("30300", 1)

		    local pct = number(1,10)

		    if pct == 1 then
			    game.drop_item(30302, 1)
			    d.clear_regen()
		    else
			    game.drop_item(30301, 1)
			
		    end
	    end

	    when 30302.use with pc.in_dungeon() and d.getf( "level" ) == 7 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
		-- 8ÃþÀ¸·Î ¿öÇÁ

			    if d.getf( "level" ) != 7 then
				    pc.remove_item( "30302", 1)
				    return
			    end
			
		    say_title("Karte")
			    say("Die Karte wird euch alle in die nächste Ebene")
			    say("des Dämonenturms bringen.")
		    pc.remove_item("30302", 1)
	        timer("devil_jump_8", 6)
		    d.setf("level", 8)
		    d.clear_regen()
	    end
						
	--------------------------------------------
	-- 8Ãþ ÁøÀÔºÎÅÍ 9Ãþ ±îÁö
	--------------------------------------------
	when devil_jump_8.timer begin
		d.jump_all(2048+590, 6656+403)
		d.set_regen_file("data/dungeon/deviltower8_regen.txt")
		d.spawn_mob(20366, 640, 460)
		local _count= pc.count_item(30302)-- Áø »ç±ÍŸ¿ö Áö¿ì±â
		pc.remove_item(30302,_count)
		
	end

	when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	    if npc.get_race() == 1040 then
			local pct1 = number(1, 5)

			if pct1 == 1 and d.getf("level") == 8 then
				local pct2 = number(1, 10)
				if pct2 == 1 then
				-- ÁøÂ¥ ¿*¼è µå·Ó
					game.drop_item(30304, 1)
				else
				-- °¡Â¥ ¿*¼è µå·Ó
					game.drop_item(30303, 1)
				end
			else
				return
			end
		end
	end

	when 20366.take with item.vnum == 30304 begin
		-- ºÀÀÎ ÇØü 9Ãþ ¤¡¤¡
		npc.purge()
		item.remove()
		timer("devil_jump_9", 6)
	end

	---------------------------------------------
	-- 9Ãþ ÁøÀÔºÎÅÍ ¿Ï·á±îÁö
	---------------------------------------------
	when devil_jump_9.timer begin
		d.setf("level", 9)
		d.jump_all(2048+590, 6656+155)
		d.regen_file("data/dungeon/deviltower9_regen.txt")
	end

	when kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
	    if npc.get_race() == 1093 then
			d.kill_all()
			timer("devil_end_jump", 60)
		end
	end

	when devil_end_jump.timer begin
	    d.exit_all()
	end
end
end

This one should work. Good luck ^_^

 

 

stop on the 7 stage

the king stage (after the seal stage) were the forger apear directly without killing any mobs

the seal stage does not let 50084 fall .

Link to comment
  • 0

 

quest deviltower_zone begin
    state start begin
        when login begin
  NO SPAM 

This one should work. Good luck ^_^

 

 

stop on the 7 stage

the king stage (after the seal stage) were the forger apear directly without killing any mobs

the seal stage does not let 50084 fall .

 

 

Fix the quest please! ;(

Link to comment
  • 0

KaiserPT have fixxed it, i will post it later

 

okey

and im not so sure about stark quest after i tested another one

the problem might be cz of my server

Link to comment
  • 0
  • VIP

 

KaiserPT have fixxed it, i will post it later

 

okey

and im not so sure about stark quest after i tested another one

the problem might be cz of my server

 

 

Same bug

Link to comment
  • 0
quest deviltower_zone begin
    state start begin
    when login begin
        if pc.get_map_index() == 66 then
            if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
                pc.warp((5376+532)*100, (512+596+4)*100, 65)
            end
        pc.set_warp_location(65, 5376+532, 512+596+4)
        elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
            pc.set_warp_location(65, 5376+532, 512+596+4)
        end
    end
 
    when logout begin
        if pc.count_item(30300) >= 1 then
            pc.remove_item(30300, pc.count_item(30300))
        end
        -- not used in the game
        -- pc.remove_item(30301, pc.count_item(30301))
        if pc.count_item(30302) >= 1 then
            pc.remove_item(30302, pc.count_item(30302))
        end
    end
        
    when deviltower_man.chat.gameforge.deviltower_zone._10_npcChat begin
        if pc.get_level() < 40 then
            say_title(gameforge.deviltower_zone._20_sayTitle)
            say(gameforge.deviltower_zone._30_say)
        else
            say_title(gameforge.deviltower_zone._20_sayTitle)
            say(gameforge.deviltower_zone._40_say)
            local s =  select(gameforge.locale.monkey_dungeon.enter, gameforge.locale.monkey_dungeon.no_enter)
            if s == 1 then
                pc.warp(216500,727000)
            end
        end
    end
    when kill with npc.get_race() == 8015 begin
        timer("devil_stone1_1", 6)
    end
    when devil_stone1_1.timer begin
        d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
        d.regen_file("data/dungeon/deviltower2_regen.txt")
        d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
    end
    when kill with npc.get_race() == 1091 and pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
        d.check_eliminated()
    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;
                positions = positions[j];
                positions[j] = t;
            end
        end
        return positions
    end
 
    when kill with npc.get_race() == 8016 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.setf("level", 4)
        local positions = deviltower_zone.get_4floor_stone_pos()
 
        for i = 1, 6 do
            test_chat(positions[1], positions[2])
            d.set_unique("fake" .. i , d.spawn_mob(8017, positions[1], positions[2]))
        end
 
        test_chat(positions[7][1], positions[7][2])
 
        local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
        test_chat(vid)
        d.set_unique("real", vid)
        server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
        server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
        
        notice_multiline(gameforge.deviltower_zone._50_dNotice,d.notice)
        
    end
 
    when devil_stone4_fail1.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._60_dNotice,d.notice)
            server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
        end
    end
 
    when devil_stone4_fail2.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._70_dNotice,d.notice)
            server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
        end
    end
 
    when devil_stone4_fail.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._80_dNotice,d.notice)
            d.clear_regen()
            d.exit_all()
            clear_server_timer('devil_stone4_update', get_server_timer_arg())
        end
    end
 
    when devil_stone4_update.server_timer begin
        if d.select(get_server_timer_arg()) then
            if not d.is_unique_dead("real") then
                for i = 1, 6 do
                    if d.getf("fakedead" .. i) == 0 then
                        if d.unique_get_hp_perc("fake" .. i) < 50 then
                            d.purge_unique("fake" .. i)
                            d.setf("fakedead" .. i, 1)
                            notice_multiline(gameforge.deviltower_zone._90_dNotice,d.notice)
                        end
                    end
                end
            else
                server_timer("devil_stone4_end", 5, get_server_timer_arg())
                --d.kill_all()
                d.purge()
                notice_multiline(gameforge.deviltower_zone._100_dNotice,d.notice)
                clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
                clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
                clear_server_timer('devil_stone4_fail', get_server_timer_arg())
            end
        else
            server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
        end
    end
 
    when devil_stone4_stop_timer.server_timer begin
        clear_server_timer('devil_stone4_update', get_server_timer_arg())
    end
 
    when devil_stone4_end.server_timer begin
        if d.select(get_server_timer_arg()) then
            clear_server_timer('devil_stone4_update', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
            clear_server_timer('devil_stone4_fail', get_server_timer_arg())
            
            -- clear regen from memory when exit
            d.clear_regen()
            
            d.setf("level", 5)
            d.setf("stone_count", 5)
            notice_multiline(gameforge.deviltower_zone._110_dNotice,d.notice)
            d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
            server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
            clear_server_timer('devil_stone4_update', get_server_timer_arg())
 
            d.set_regen_file("data/dungeon/deviltower5_regen.txt")
 
            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
    when devil_stone5_fail1.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._120_dNotice,d.notice)
            server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
        end
    end
 
    when devil_stone5_fail2.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._60_dNotice,d.notice)
            server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
        end
    end
 
    when devil_stone5_fail3.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._70_dNotice,d.notice)
            server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
        end
    end
 
    when devil_stone5_fail.server_timer begin
        if d.select(get_server_timer_arg()) then
            notice_multiline(gameforge.deviltower_zone._80_dNotice,d.notice)
            d.exit_all()
        end
    end
 
 
    when kill with npc.get_race() == 1062 and d.getf("level") == 5 begin
        local KILL_COUNT_FOR_DROP_KEY = 50
        local n =d.getf("count") + 1
        d.setf("count", n) 
        if n == KILL_COUNT_FOR_DROP_KEY then
            game.drop_item(50084, 1)
            d.setf("count", 0)
        end
    end
 
    when devil_stone5.take with item.vnum == 50084 begin
        npc.purge()
        item.remove()
        d.setf("stone_count", d.getf("stone_count") - 1)
        if d.getf("stone_count") <= 0 then
            d.setf("level", 6)
            d.clear_regen()
            d.regen_file("data/dungeon/deviltower6_regen.txt")
 
            notice_multiline(gameforge.deviltower_zone._130_dNotice,d.notice)
            d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
            local server_arg = d.get_map_index()
            clear_server_timer('devil_stone5_fail1', server_arg)
            clear_server_timer('devil_stone5_fail2', server_arg)
            clear_server_timer('devil_stone5_fail3', server_arg)
            clear_server_timer('devil_stone5_fail', server_arg)
        else
            d.notice(string.format(gameforge.deviltower_zone._140_dNotice, d.getf("stone_count")))
        end
    end
 
    when kill with npc.get_race() == 1092 and pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 begin
        d.kill_all()
        notice_multiline(gameforge.deviltower_zone._150_dNotice,d.notice)
        d.check_eliminated()
        notice_multiline(gameforge.deviltower_zone._160_dNotice,d.notice)
        local reward_alchemist = {20074, 20075, 20076}
        d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
        d.setqf2("deviltower_zone","can_refine", 1)
    end
 
 
    when 20074.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
        say_title(mob_name(20074))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            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
            end
            if s==2 then
                return
            end
 
            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20074))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end
 
    when 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
        say_title(mob_name(20075))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            say_title(mob_name(20075))
 
            say(gameforge.deviltower_zone._200_say)
            local s= select(gameforge.deviltower_zone._210_select, gameforge.deviltower_zone._220_select)
            if s==3 then
                pc.warp(590500, 110900)
                return
            end
            if s==2 then
                return
            end
 
            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20075))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end
    when 20076.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
        say_title(mob_name(20076))
        say(gameforge.deviltower_zone._190_say)
        wait()
        if pc.level >=75 then
            say_title(mob_name(20076))
 
            say(gameforge.deviltower_zone._200_say)
            local s= select(gameforge.deviltower_zone._210_select, gameforge.deviltower_zone._220_select)
            if s==3 then
                pc.warp(590500, 110900)
                return
            end
            if s==2 then
                return
            end
 
            timer("devil_jump_7", 6)
            npc.unlock()
            d.purge()
            return
        end
        say_title(mob_name(20076))
        say(gameforge.deviltower_zone._230_say)
        wait()
        pc.warp(590500, 110500)
        return
    end
    when devil_jump_7.timer begin
        d.clear_regen()
 
        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)
 
 
        notice_multiline(gameforge.deviltower_zone._240_dNotice,d.notice)
        d.jump_all(2048+590, 6656+638)
    end
 
    when kill with npc.get_race() == 8018 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        local cont = d.getf("7_stone_kill") + 1
        d.setf("7_stone_kill", cont)
 
        if cont >= 4 then
            d.setf("7_stone_kill", 0)
            d.set_regen_file("data/dungeon/deviltower7_regen.txt")
        end
    end
 
    when kill with npc.get_race() == 8019 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        game.drop_item(30300, 1)
    end
 
    when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        pc.remove_item("30300", 1)
 
        local pct = number(1,10)
 
        if pct == 1 then
            game.drop_item(30302, 1)
            d.clear_regen()
        else
            -- nothing happens cause the items isnt used in the game
            -- game.drop_item(30301, 1)
        end
    end
 
    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
            pc.remove_item( "30302", 1)
            return
        end
            
        say_title(gameforge.blacksmith._40_sayTitle)
        say(gameforge.deviltower_zone._250_say)
        pc.remove_item("30302", 1)
        timer("devil_jump_8", 6)
        d.clear_regen()
    end
 
    when devil_jump_8.timer begin
        d.setf("level", 8)
 
        notice_multiline(gameforge.deviltower_zone._260_dNotice,d.notice)
        d.jump_all(2048+590, 6656+403)
        d.set_regen_file("data/dungeon/deviltower8_regen.txt")
        d.spawn_mob(20366, 640, 460)
        local _count = pc.count_item(30302)
        pc.remove_item(30302,_count)
        
    end
 
    when kill with npc.get_race() == 1040 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        local pct1 = number(1, 5)
        if pct1 == 1 then
            local pct2 = number(1, 10)
            if pct2 == 1 then
                game.drop_item(30304, 1)
            else
                game.drop_item(30303, 1)
            end
        else
            return
        end
    end
 
    when 20366.take with item.vnum == 30304 begin
        npc.purge()
        item.remove()
        timer("devil_jump_9", 6)
    end
 
    when devil_jump_9.timer begin
        d.setf("level", 9)
 
 
        notice_multiline(gameforge.deviltower_zone._270_dNotice,d.notice)
        d.jump_all(2048+590, 6656+155)
        d.regen_file("data/dungeon/deviltower9_regen.txt")
    end
 
    when kill with npc.get_race() == 1093 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
        d.kill_all()
        d.setqf2("deviltower_zone","9_done", 1)
        notice_multiline(gameforge.deviltower_zone._280_dNotice,d.notice)
        notice_multiline(gameforge.deviltower_zone._290_dNotice,d.notice)
        server_timer("devil_end_jump", 60, d.get_map_index())
    end
 
        when devil_end_jump.server_timer begin
            if d.select (get_server_timer_arg()) then
                d.clear_regen()
                d.exit_all()
            end
        end
    end
end
  • Love 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.