Hallo,
Ich habe eine Warpring Quest, jedoch passiert nichts, wenn ich den Warpring rechtsklicke.
Kann sich jemand die Quest mal anschauen?
Code
- quest warpring begin
- state start begin
- when 70007.use begin
- local warp = {--koord Pflicht, rest optional!
- {--Map1
- name = "Map 1",
- {--Rotes Reich
- name = "Rotes Reich",
- koord = {474100, 955000},
- },
- {--Gelbes Reich
- name = "Gelbes Reich",
- koord = {63525, 166543},
- },
- {--Blaues Reich
- name = "Blaues Reich",
- koord = {960100, 268800},
- },
- },
- {--Map2
- name = "Map 2",
- {--Rotes Reich
- name = "Rotes Reich",
- koord = {352200, 882200},
- },
- {--Gelbes Reich
- name = "Gelbes Reich",
- koord = {145900, 239800},
- },
- {--Blaues Reich
- name = "Blaues Reich",
- koord = {863700, 246300},
- },
- },
- {--Standart Maps
- name = "Standart Maps",
- {--Orktal Mitte
- name = "Orktal",
- koord = {333000, 747100},
- },
- {--Hwang-Tempel
- name = "Tempel",
- koord = {553600, 144100},
- },
- {--Feuerland Mitte
- name = "Feuerland",
- koord = {601300, 687900},
- },
- },
- {--Levelmaps
- name = "Levelmaps",
- {--Spinnendungeons 2
- name = "SD2 (55~75)",
- koord = {703800, 462500},
- minlevel = 55,
- maxlevel = 75
- },
- {--Grotte 2
- name = "Grotte 2 (75~90)",
- koord = {241800, 1275000},
- minlevel = 75,
- maxlevel = 90
- },
- {--Spinnendungeons 3
- name = "SD3 (90~115)",
- koord = {97280, 571193},
- minlevel = 90,
- maxlevel = 115
- },
- {--Cape
- name = "Cape (115~125)",
- koord = {1024000, 1664000},
- minlevel = 115,
- maxlevel = 125
- },
- {--Donnerberge
- name = "Donnerberge (125~140)",
- koord = {1226300, 1681100},
- minlevel = 125,
- maxlevel = 140,
- },
- {--Thunder
- name = "Kap der Hoffnung (140~155)",
- koord = {1134900, 1653700},
- minlevel = 140,
- maxlevel = 155,
- },
- {--Thunder
- name = "Kap der Hoffnung (155~170)",
- koord = {1060100, 753900},
- minlevel = 155,
- maxlevel = 170,
- },
- },
- {--Farmmap
- name = "Farmmaps",
- {--Farmmap 50
- name = "Farmmap 50~100",
- koord = {104800, 9900},
- minlevel = 50,
- maxlevel = 100,
- },
- {--Farmmap 95+
- name = "Farmmap 95+",
- koord = {828100, 763400},
- minlevel = 95,
- },
- {--Farmmap 115+
- name = "Farmmap 115+",
- koord = {269900, 12900},
- minlevel = 115,
- },
- {--Farmmap 130+
- name = "Farmmap 130+",
- koord = {1114300, 1519400},
- minlevel = 130,
- },
- {--Farmmap 155+
- name = "Farmmap 155+",
- koord = {128000, 0},
- minlevel = 155,
- },
- },
- {--Runs
- name = "Runs",
- {--Drachen-Raum 75+
- name = "Drachen-Raum 75+",
- koord = {177400, 1220500},
- minlevel = 75,
- },
- {--Dämonenturm 130+
- name = "Dämonenturm 130+",
- koord = {590406, 110717},
- minlevel = 130,
- },
- {--Devils Catacomb
- name = "Devils Catacomb 130+",
- koord = {591967, 100028},
- minlevel = 150,
- },
- },
- }
- warpring.showwarps(warp)
- end
- function warp(tbl)
- local level = pc.get_level()
- if tbl.minlevel and level < tbl.minlevel then
- say("Dein Level ist zu niedrig, um diese Map zu betreten.")
- say("Minimal Level: "..tbl.minlevel)
- select("Abbrechen")
- return
- elseif tbl.maxlevel and level > tbl.maxlevel then
- say("Dein Level ist zu hoch, um diese Map zu betreten.")
- say("Maximal Level: "..tbl.maxlevel)
- select("Abbrechen")
- return
- end
- while not pc.can_warp() do
- say("Du kannst dich noch nicht teleportieren, da du in")
- say("den letzten 10 Sekunden gehandelt hast.")
- if select("Erneut versuchen", "Abbrechen") == 2 then return end
- end
- local warpneedstrings = warpring.get_warpneedstrings(tbl)
- if table.getn(warpneedstrings) > 0 then
- say("Um diese Map zu betreten benötigst du folgende")
- say("Dinge:")
- for _,v in ipairs(warpneedstrings) do
- say(v)
- end
- say("")
- say("Möchtest du trotzdem fortfahren?")
- if select("Teleportieren", "Abbrechen") == 2 then return end
- end
- if not warpring.check_and_remove_warpneeds(tbl) then
- say("Dir fehlt mindestens eins der benötigten Dinge.")
- select("Abbrechen")
- return
- end
- pc.warp(tbl.koord[1], tbl.koord[2])
- end
- function get_warpneedstrings(tbl)
- local warpneeds = {}
- if tbl.itemneed and table.getn(tbl.itemneed) > 0 then
- for _,v in ipairs(tbl.itemneed) do
- table.insert(warpneeds, "- "..v[2].."x "..item_name(v[1]))
- end
- end
- if tbl.goldneed and tbl.goldneed > 0 then
- table.insert(warpneeds, "- "..tbl.goldneed.." Yang")
- end
- return warpneeds
- end
- function check_warpneeds(tbl)
- if tbl.itemneed and table.getn(tbl.itemneed) > 0 then
- for _,v in ipairs(tbl.itemneed) do
- if pc.count_item(v[1]) < v[2] then
- return false
- end
- end
- end
- if tbl.goldneed and tbl.goldneed > 0 then
- if pc.get_gold() < tbl.goldneed then
- return false
- end
- end
- return true
- end
- function remove_warpneeds(tbl)
- if tbl.itemneed and table.getn(tbl.itemneed) > 0 then
- for _,v in ipairs(tbl.itemneed) do
- pc.remove_item(v[1], v[2])
- end
- end
- if tbl.goldneed and tbl.goldneed > 0 then
- pc.change_gold(-tbl.goldneed)
- end
- end
- function check_and_remove_warpneeds(tbl)
- if not warpring.check_warpneeds(tbl) then
- return false
- end
- warpring.remove_warpneeds(tbl)
- return true
- end
- function get_warpnames(tbl)
- local level = pc.get_level()
- local names = {}
- for _,v in ipairs(tbl) do
- if v.minlevel and level < v.minlevel then
- v.name = v.name.." (ab Lv. "..v.minlevel..")"
- elseif v.maxlevel and level > v.maxlevel then
- v.name = v.name.." (bis Lv. "..v.maxlevel..")"
- end
- table.insert(names, v.name)
- end
- return names
- end
- function showwarps(tbl)
- local warpnames = warpring.get_warpnames(tbl)
- local s = tbl[select3(warpnames)] or false
- if not s then return end
- if s.koord then
- warpring.warp(s)
- return
- end
- warpring.showwarps(s)
- end
- end
- end