Jump to content

[Quest] Help with quest


Recommended Posts

  • Active Member

Hello people, the first, thanks for your time to read this. I never try to create a quest, but now i'm little interesting in this, but i have a few problems.

Maybe the code is a s... but for me work, i can spawn mob, and kill, and drop etc, but i have a problem,  if other guy enter to the dungeon, this guy enter in the same channel (is baroness quest, the original doesn't work for me and i an't find it, so i try to create my version). I tried to using this functions:

Quote

d.jump ; d.new_jump_party 

and:

Quote

            local map_index = d.get_map_index()
            if map_index >= 217000 and map_index < 217000 then 

but doesn't work, people enter in the same dungeon, so i was tried to create other version of my quest, but doesn't work to.. so someone can help me?

 

this is dungeon without d.jumps. and dungeons functions:

Spoiler

quest teletransportes begin
    state start begin
        when 30130.chat."Spider Dungeon" begin
            say("Are you sure want enter")
            say("to Spider dungeon?")
            say("you need min lv 60 and")
            say("Spider key to enter.")
            say("Btw, if you complete the dungeon, you need wait")
            say("1h to enter again.")
            local coords = {{88100, 614800}}
            local items = {30324}
            local level = {60}
            local a = select("Yes, i'm ready!","I can't, maybe late.")
            if a != 2 then
                if pc.get_level() < level[a] then
                    say("You don't have the level request to acces this dungeon.")
                    say("you need Level "..level[a].."")
                    return
                end
                if pc.count_item(items[a]) < 1 then
                    say("You need this item:")
                    say_item_vnum(items[a])
                    say("to start this dungeon, come back when you have the key.")
                    return
                end
                say("You are warp to te map, please wait...")
                pc.remove_item("30324")
                wait()
                pc.warp(coords[a][1],coords[a][2])
            end
        end
        when login with pc.get_map_index()==idx begin
            notice("The first, kill the Spider Egg!")
        end
        when 2095.kill begin
            notice("Congratulations!, you kill Spider Egg now, kill Spider Baron!.")
            mob.spawn(2094, pc.get_local_x()+5, pc.get_local_y()+5,1)
        end
        when 2094.kill begin
            notice("Congratulations!!! you kill the Spider Baron, now use the item to spawn Spider Baroness!!")
        end
        when 30328.use begin
            notice("Kill Queen Baroness and obtain rewards!!")
            pc.remove_item("30328")
            mob.spawn(2092, pc.get_local_x()+5, pc.get_local_y()+5,1)
        end
        when 2092.kill with pc.get_map_index == 217 begin
            game.set_event_flag("map",1)
            server_timer("map2",60*60*1)
            timer("nazox", 0*60)--Volver a city en 1 min
            notice_all("The player"..pc.get_name().."killed the Baroness Queen!!")
            notice("Congratulations!! you kill the Baroness Spider!!, in 1 minute you teleport to town.")
        end
        when login with pc.get_map_index()==idx and game.get_event_flag("map") == 1 begin
            warp_to_village()
        end
        when map2.server_timer begin
            game.set_event_flag("map",0)
        end
        when nazox.timer begin
            warp_all_to_village()
        end
    end
end

this is dungeon with d.jump and dungeon functions:

Spoiler

quest nazox begin
    state start begin
        when 30130.chat."Spider Dungeon" begin
            say("Are you sure want enter")
            say("to Spider dungeon?")
            local a = select("Yes, i'm ready!","I can't, maybe late.")
            if a == 1 then
            pc.warp(88100 , 6148000) --Cordenadas
            end
        end
        
        when 30130.chat."Spider Dungeon" begin
            timer("inicio_dungeon", 3)
        end
        
        when inicio_dungeon.timer begin
            d.new_jump_all(217, 369, 516)
            d.setf("metines",5) --Kill  stones 5
        end
        
        when 2095.kill begin
            d.setf ("metines", d.getf("metines") - 1)
            d.notice("still remains to be destroyed"..d.getf("metines").." Spider Egg's!")
            if d.getf("metines") == 0 then
                d.notice("You kill all Spider Eggs, now prepare to fight with")
                d.notice("Spider Baron, good luck!")
                timer("spider_baron", 3)
            end
        end
        
        when spider_baron.timer begin
            d.new_jump_all(369, 516)
            d.spawn_mob(2094, 368, 581)
            timer("queen_barones", 3)
        end
        
        when 2094.kill begin
            d.notice("Congratulations!!! you kill the Spider Baron, now use the item to spawn Spider Baroness!!")
        end

        when queen_barones.timer begin
            d.new_jump_all(369, 516)
        end

        when 30328.use begin
            d.notice("Kill Queen Baroness and obtain rewards!!")
            pc.remove_item("30328")
            d.spawn_mob(2094, 368, 581)
        end

        when 2094.kill
            d.notice("Congratulations!! you complete the dungeon!! in 1 minute")
            d.notice("You come back to town!!")
            notice_all("..pc.get_name().." has killed Baroness Queen!")
            timer("salir_quest", 3)
        end
        
        when salir_quest.timer begin
            warp_to_village()
        end

Thanks 😞

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
Share on other sites

  • Premium

I mean..

In the first quest you're using pc.warp, not even using its index arg, meaning you make a simple warp to a map. Everyone can access that map, obviously.

In the second quest you're warping into the same map always with pc.warp, starting a 3 seconds timer and then calling d.new_jump_all, meaning you send every person in your map, yourself included, inside an instanced version of the target map.

The solution is to either use d.new_jump or d.new_jump party, the former warping only you, the latter warping you and your whole party if present.

Also never use local timers within a dungeons, they're bound to pc instances, meaning if you crash the instance breaks even if you can rejoin to it.

Also always make dungeon checks on triggers, when 2095.kill begin is nowhere near enough. you gotta check the map index, too.

Also you are generating yet another dungeon instance when the baroness spawns via calling d.new_jump_all for absolutely no reason.

Edited by Syreldar
  • Love 1

 

"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

  • Premium

Also, to add what Syreldar said, when using server timers you cannot use qestlua_pc functions (no pc is selected in a server timer).

Furthermore:
 

if map_index >= 217000 and map_index < 217000 then  

I am pretty sure it should've been < 218000 (if it was meant for the exit from the dungeon when logging in):

		when login begin
			if pc.get_map_index() == 217 then
				pc.warp(exit_x*100, exit_y*100, 217)
			end
			elseif pc.get_map_index() >= 217000 and pc.get_map_index() < 218000 then
				pc.set_warp_location(217, exit_x, exit_y)
			end
		end

217000 to 217999 are all valid dungeon instances of the map with index 217

  • Eyes 1
  • Love 1
Link to comment
Share on other sites

  • Premium
7 hours ago, Intel said:

Also, to add what Syreldar said, when using server timers you cannot use qestlua_pc functions (no pc is selected in a server timer).

Furthermore:
 

if map_index >= 217000 and map_index < 217000 then  

I am pretty sure it should've been < 218000 (if it was meant for the exit from the dungeon when logging in):

		when login begin
			if pc.get_map_index() == 217 then
				pc.warp(exit_x*100, exit_y*100, 217)
			end
			elseif pc.get_map_index() >= 217000 and pc.get_map_index() < 218000 then
				pc.set_warp_location(217, exit_x, exit_y)
			end
		end

217000 to 217999 are all valid dungeon instances of the map with index 217

*10000, not 1000!
These formalities can be avoided by using the InDungeon(MAP_INDEX) function from my function lib.

Also care about the "elseif", you should remove the if's end for it to work. 8hzfRRT.png

Edited by Syreldar
Core X - External 2 Internal
  • Love 1
  • Love 1

 

"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

  • Active Member

Thank you all for your help and giving me an idea for future quests, currently I have been able to figure it out thanks to @Th1Doose I am very grateful to you for the simplicity and clean code you have made, I highly recommend it personally. You can close the post, thanks. all of you again, good day!! 🙂🙂 🙂  🙂  🙂  🙂 

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
Share on other sites

  • Premium
4 hours ago, Syreldar said:

*10000, not 1000!
These formalities can be avoided by using the InDungeon(MAP_INDEX) function from my function lib.

Also care about the "elseif", you should remove the if's end for it to work. 8hzfRRT.png

Ya I forgot a 0, uups (I mean, in my defense I had used the original incorrect number kek) Also during the copy of the code I fu**** the if, oh well. Screw lua anyway with love 🥰

Edited by Intel
  • Sad 1
Link to comment
Share on other sites

  • Management
17 hours ago, Th1Doose said:

I already fixed and did the whole dungeon for free while doing clean code.

Happy to help those who need.

And I think the community will be happy to know the solution to help other members 🙂 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

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.