Guten Abend ,
Habe mal eine frage was mach ich hier falsch bei meiner warpring quest wollte es so ein stellen das mann auf die Map mit einen bestimmten level kann und bei einen bestimmten level nicht mehr.
Hier meine Quest:
C
- quest warpring begin
- state start begin
- when 70007.use or 9012.chat.gameforge.map_warp._10_npcChat or 20009.chat.gameforge.neutral_warp._10_npcChat 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 = {333074, 747167},
- },
- {--Hwang-Tempel
- name = "Tempel",
- koord = {553600, 144100},
- },
- {--Feuerland Mitte
- name = "Feuerland",
- koord = {601300, 687900},
- },
- {--Dämonenturm
- name = "Dämonenturm (40)",
- koord = {590406, 110717},
- minlevel = 40,
- },
- },
- {--Spinnendungeons
- name = "Spinnendungeons (40-90)",
- {--Spinnendungeons 1
- name = "SD1 (40-55)",
- koord = {60000, 497000},
- minlevel = 40,
- maxlevel = 55,
- },
- {--Spinnendungeons 2
- name = "SD2 (55-75)",
- koord = {703800, 462500},
- minlevel = 55,
- maxlevel = 75
- },
- {--Spinnendungeons 2
- name = "SD3 (75-90)",
- koord = {97280, 571193},
- minlevel = 75,
- },
- },
- {--Grotte der Verbannung
- name = "Grotte der Verbannung",
- {--Grotte 1
- name = "Grotte 1",
- koord = {10000, 1207800},
- minlevel = 75,
- maxlevel = 90,
- },
- {--Grotte 2
- name = "Grotte 2 (75-90)",
- koord = {241800, 1275000},
- minlevel = 75,
- maxlevel = 90
- },
- },
- {--Farmmap
- name = "Farmmaps",
- {--Farmmap 50
- name = "Farmmap 50",
- koord = {2639802, 2693718},
- minlevel = 30,
- maxlevel = 50,
- },
- {--Farmmap 100
- name = "Farmmap 100",
- koord = {801800, 1499000},
- minlevel = 100,
- maxlevel = 125,
- },
- },
- {--Levelmaps
- name = "Levelmaps",
- {--Gautamakliff (90-110)
- name = "Gautamakliff (90-110)",
- koord = {1226300, 1681100},
- minlevel = 90,
- maxlevel = 110,
- },
- {--Nephritbucht (110-125)
- name = "Nephritbucht (110-125)",
- koord = {1086900, 1655800},
- minlevel = 110,
- maxlevel = 125,
- },
- },
- {--Runs
- name = "Runs",
- {--Rotdrachen-Festung
- name = "Rotdrachen-Festung (110)",
- koord = {614265, 706964},
- minlevel = 110,
- },
- {--Devils Catacomb
- name = "Devils Catacomb (110)",
- koord = {591967, 100028},
- minlevel = 110,
- },
- },
- }
- 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
Weil ich möchte z.b 90-110 das mann bei 110 Rausgeportet wird wie mache ich das am besteb?
Bitte um hilfe.
-----------------
Mit freundlichen grüßen
AceWavee.