antiblock
Cyphriun
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
[SA]Phoenix

Ajuda nesta quest

Question

Spoiler

define DUNGEON_MAP_INDEX 241
define DUNGEON_INDEX_MIN 2410000
define DUNGEON_INDEX_MAX 2420000
define DUNGEON_LEVEL 70
define DUNGEON_ITEM 77200 -- KEVIN HEIR ITEM EINTRAGEN ODER SOWAS

-------------------------------------------
-- EBENE 0 CONSTANTS
-------------------------------------------
define NPC1 30289
define METIN_STONE 8073
define METIN_AMOUNT 10

-------------------------------------------
-- EBENE 1 CONSTANTS
-------------------------------------------
define BOSS1 232

-------------------------------------------
-- EBENE 2 CONSTANTS
-------------------------------------------
define BOSS2 235

-------------------------------------------
-- EBENE 3 CONSTANTS
-------------------------------------------
define MOBS_TO_KILL 1000

-------------------------------------------
-- EBENE 4 CONSTANTS
-------------------------------------------
define BOSS4 236

quest pflanzen_dungeon begin
    state start begin
        -------------------------------------------
        -- FUNKTIONEN
        -------------------------------------------
        function is_in_dungeon()
            return (pc.in_dungeon() and pc.get_map_index() >= DUNGEON_INDEX_MIN and pc.get_map_index() < DUNGEON_INDEX_MAX)
        end
        
        function modulo(a, b)
            return (a - math.floor(a/b)*b)
        end
        
        function is_in_first_floor()            
            return (pc.get_local_x() > 180 and pc.get_local_x() < 380) and (pc.get_local_y() > 100 and pc.get_local_y() < 300)
        end
    
        -------------------------------------------
        -- EBENE 0
        -------------------------------------------
        when login begin
            if pflanzen_dungeon.is_in_dungeon() then
                pc.set_warp_location(DUNGEON_MAP_INDEX, 21270, 1144)
                if party.is_leader() then                    
                    d.set_regen_file("data/dungeon/Wald_Dungeon/regen1.txt")
                    d.notice("Besiegt die Erd. Pflanze am Ende des Raumes um weiter zu kommen.")
                end
            elseif pc.get_map_index() == DUNGEON_MAP_INDEX then
                if party.is_party() and party.is_leader() then
                    party.setf("leader_pid", pc.get_player_id())
                end
                if not pflanzen_dungeon.is_in_first_floor() then
                    pc.warp(2127000, 114400)
                elseif party.is_party() then
                    notice("Deine Gruppe kann in den verfluchten Wald wenn ihr 10 verfluchte Pilze besiegt habt.")
                end
            else
                if party.is_party() and party.is_leader() then
                    party.setf("leader_pid", 0)
                end
            end
        end
        
        when logout with party.is_party() and party.is_leader() and pc.get_map_index() == DUNGEON_MAP_INDEX begin
            party.setf("leader_pid", 0)
        end
        
        when METIN_STONE.kill with party.is_party() and pc.get_map_index() == DUNGEON_MAP_INDEX begin
            if party.getf("leader_pid") == 0 then
                local pids = {party.get_member_pids()}
                for i = 1, table.getn(pids), 1 do
                    q.begin_other_pc_block(pids)
                    if party.is_leader() and pc.get_map_index() == DUNGEON_MAP_INDEX then
                        party.setf("leader_pid", pc.get_player_id())
                    end
                    q.end_other_pc_block()
                end
            end
            
            if party.getf("leader_pid") != 0 then
                party.setf("pflanzen_dungeon_metins", party.getf("pflanzen_dungeon_metins") + 1)
                party.chat("Eure Gruppe hat "..party.getf("pflanzen_dungeon_metins").." Pilze besiegt.")
                if party.getf("pflanzen_dungeon_metins") == METIN_AMOUNT then
                    party.setf("pflanzen_dungeon_metins", 0) 
                    party.chat("Ihr werdet nun in den Dungeon teleportiert.")
                    d.new_jump_party(DUNGEON_MAP_INDEX, 21779, 1149)
                    d.setf("floor", 1)    
                end
            else
                party.chat("Es zählt nur wenn der Gruppenführer auf der Map ist.")
            end
        end
    
        -------------------------------------------
        -- EBENE 1
        -------------------------------------------
        when BOSS1.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.kill_all()
            d.clear_regen()
            d.notice("Ihr habt die Erd. Pflanze besiegt! In 10 Sekunden werdet ihr in den nächsten Raum teleportiert.")
            server_timer("pflanzen_dungeon_warp2", 10, pc.get_map_index())
        end
        
        when pflanzen_dungeon_warp2.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.jump_all(21207, 1751)
                d.setf("floor", 2)
                d.set_regen_file("data/dungeon/Wald_Dungeon/regen2.txt")
                d.notice("Besiegt den König der Dryaden am Ende des Raumes um weiter zu kommen.")
            end
        end
        
        -------------------------------------------
        -- EBENE 2
        -------------------------------------------
        when BOSS2.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.kill_all()
            d.clear_regen()
            d.notice("Ihr habt den König der Dryaden besiegt! In 10 Sekunden werdet ihr in den nächsten Raum teleportiert.")
            server_timer("pflanzen_dungeon_warp3", 10, pc.get_map_index())
        end
        
        when pflanzen_dungeon_warp3.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.jump_all(21470, 1582)
                d.setf("floor", 3)
                d.set_regen_file("data/dungeon/Wald_Dungeon/regen3.txt")
                d.notice(string.format("Bezwingt %d Monster um die Waldkönigin aus ihrem Versteck zu locken.", MOBS_TO_KILL))
                d.setf("mobs_to_kill", MOBS_TO_KILL)
            end
        end
        
        -------------------------------------------
        -- EBENE 3
        -------------------------------------------
        when kill with pflanzen_dungeon.is_in_dungeon() and d.getf("floor") == 3 and not npc.is_pc() begin
            d.setf("mobs_to_kill", d.getf("mobs_to_kill") - 1)
            if d.getf("mobs_to_kill") == 0 then
                d.notice(string.format("Ihr habt %d Monster getötet! Die Waldkönigin ist am Ende des Raumes erschienen.", MOBS_TO_KILL))
                d.setf("floor", 4)
                d.spawn_mob(BOSS4, 741, 802)
            elseif pflanzen_dungeon.modulo(d.getf("mobs_to_kill"), 50) == 0 then
                d.notice("Ihr müsst noch "..d.getf("mobs_to_kill").." Monster bezwingen.")
            end            
        end
        
        -------------------------------------------
        -- EBENE 4
        -------------------------------------------
        
        when BOSS4.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.notice("Die Waldkönigin ist besiegt! In 60 Sekunden werdet ihr zum Beginn des verfluchten Waldes teleportiert.")
            d.kill_all()
            d.clear_regen()
            server_timer("pflanzen_dungeon_out", 60, pc.get_map_index())
        end

        when pflanzen_dungeon_out.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.exit_all()
            end
        end
    end
end

Boas Comunidade venho pedir a vossa atenção por um pouco.

Bem tenho aqui esta quest quando dou install nela da um erro mas quando removo os #defines ela funciona mas dungeon não trabalha como posso resolver isso.

 

:/usr/game/share/locale/portugal/quest # ./qc pflanzen_dungeon.ques                                                                                        t
pflanzen_dungeon.quest:1:must start with 'quest'
Abort (core dumped)
 

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Prueba

Spoiler

quest pflanzen_dungeon begin
    state start begin
        function is_in_dungeon()
            return (pc.in_dungeon() and pc.get_map_index() >= 2410000 and pc.get_map_index() < 2420000)
        end
        
        function modulo(a, b)
            return (a - math.floor(a/b)*b)
        end
        
        function is_in_first_floor()            
            return (pc.get_local_x() > 180 and pc.get_local_x() < 380) and (pc.get_local_y() > 100 and pc.get_local_y() < 300)
        end
    
        -------------------------------------------
        -- EBENE 0
        -------------------------------------------
        when login with pc.get_map_index() == 241 begin
            if pflanzen_dungeon.is_in_dungeon() then
                pc.set_warp_location(241, 21270, 1144)
                return end
                if party.is_leader() then                    
                    d.set_regen_file("data/dungeon/Wald_Dungeon/regen1.txt")
                    d.notice("Besiegt die Erd. Pflanze am Ende des Raumes um weiter zu kommen.")
                    return end
                if party.is_party() and party.is_leader() then
                    party.setf("leader_pid", pc.get_player_id())
                return end
                if not pflanzen_dungeon.is_in_first_floor() then
                    pc.warp(2127000, 114400)
                    return end
                if party.is_party() then
                    notice("Deine Gruppe kann in den verfluchten Wald wenn ihr 10 verfluchte Pilze besiegt habt.")
                return end
                if party.is_party() and party.is_leader() then
                    party.setf("leader_pid", 0)
                    return end end
        
        when logout with party.is_party() and party.is_leader() and pc.get_map_index() == 241 begin
            party.setf("leader_pid", 0)
        end
        when 8073.kill with party.is_party() and pc.get_map_index() == 241 begin
            if party.getf("leader_pid") == 0 then
                local pids = {party.get_member_pids()}
                for i = 1, table.getn(pids), 1 do
                    q.begin_other_pc_block(pids)
                    if party.is_leader() and pc.get_map_index() == 241 then
                        party.setf("leader_pid", pc.get_player_id())
                    end
                    q.end_other_pc_block()
                end
            end
            
            if party.getf("leader_pid") != 0 then
                party.setf("pflanzen_dungeon_metins", party.getf("pflanzen_dungeon_metins") + 1)
                party.chat("Eure Gruppe hat "..party.getf("pflanzen_dungeon_metins").." Pilze besiegt.")
                return end
                if party.getf("pflanzen_dungeon_metins") == 10 then
                    party.setf("pflanzen_dungeon_metins", 0) 
                    party.chat("Ihr werdet nun in den Dungeon teleportiert.")
                    d.new_jump_party(241, 21779, 1149)
                    d.setf("floor", 1)    
            else
                party.chat("Es zählt nur wenn der Gruppenführer auf der Map ist.")
            end
        end
    
        -------------------------------------------
        -- EBENE 1
        -------------------------------------------
        when 2414.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.kill_all()
            d.clear_regen()
            d.notice("Ihr habt die Erd. Pflanze besiegt! In 10 Sekunden werdet ihr in den nächsten Raum teleportiert.")
            server_timer("pflanzen_dungeon_warp2", 10, pc.get_map_index())
        end
        
        when pflanzen_dungeon_warp2.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.jump_all(21207, 1751)
                d.setf("floor", 2)
                d.set_regen_file("data/dungeon/Wald_Dungeon/regen2.txt")
                d.notice("Besiegt den König der Dryaden am Ende des Raumes um weiter zu kommen.")
            end
        end
        
        -------------------------------------------
        -- EBENE 2
        -------------------------------------------
        when 2362.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.kill_all()
            d.clear_regen()
            d.notice("Ihr habt den König der Dryaden besiegt! In 10 Sekunden werdet ihr in den nächsten Raum teleportiert.")
            server_timer("pflanzen_dungeon_warp3", 10, pc.get_map_index())
        end
        
        when pflanzen_dungeon_warp3.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.jump_all(21470, 1582)
                d.setf("floor", 3)
                d.set_regen_file("data/dungeon/Wald_Dungeon/regen3.txt")
                d.notice(string.format("Bezwingt %d Monster um die Waldkönigin aus ihrem Versteck zu locken.", 1000))
                d.setf("mobs_to_kill", 1000)
            end
        end
        
        -------------------------------------------
        -- EBENE 3
        -------------------------------------------
        when kill with not npc.is_pc() and pflanzen_dungeon.is_in_dungeon() and d.getf("floor") == 3 begin
            d.setf("mobs_to_kill", d.getf("mobs_to_kill") - 1)
            if d.getf("mobs_to_kill") == 0 then
                d.notice(string.format("Ihr habt %d Monster getötet! Die Waldkönigin ist am Ende des Raumes erschienen.", 1000))
                d.setf("floor", 4)
                d.spawn_mob(236, 741, 802)
            else
            if pflanzen_dungeon.modulo(d.getf("mobs_to_kill"), 50) == 0 then
                d.notice("Ihr müsst noch "..d.getf("mobs_to_kill").." Monster bezwingen.")
            end            
        end
    end
        when 236.kill with pflanzen_dungeon.is_in_dungeon() begin
            d.notice("Die Waldkönigin ist besiegt! In 60 Sekunden werdet ihr zum Beginn des verfluchten Waldes teleportiert.")
            d.kill_all()
            d.clear_regen()
            server_timer("pflanzen_dungeon_out", 60, pc.get_map_index())
        end
        when pflanzen_dungeon_out.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.exit_all()
            end
        end
    end
end

 

 

Share this post


Link to post
Share on other sites
antiblock
Rodnia | Alpha & Omega
  • 0

Usa o pre_qc.

Share this post


Link to post
Share on other sites

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
Sign in to follow this