Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Configuration --
- GATHER = {}
- OPEN_BAGS = true
- AUTO_DELETE = {}
- DISPLAY_FIGHT_COUNT = true
- MIN_MONSTERS = 1
- MAX_MONSTERS = 8
- -- Function GatherFight --
- function GatherFight()
- for index, actualMap in pairs(mapsWithChangeMap) do
- if (map:onMap(actualMap.map)) then
- if actualMap.gather and actualMap.fight then
- return "both"
- elseif actualMap.gather then
- return "gather"
- elseif actualMap.forcegather then
- return "forcegather"
- elseif actualMap.fight then
- return "fight"
- elseif actualMap.forcefight then
- return "forcefight"
- end
- return "path"
- end
- end
- return false
- end
- -- Function move --
- function move()
- if GatherFight() == "both" then
- return {
- {map = map:currentMap(), custom = processMap, gather = true, fight = true}
- }
- elseif GatherFight() == "gather" then
- return {
- {map = map:currentMap(), custom = processMap, gather = true}
- }
- elseif GatherFight() == "forcegather" then
- return {
- {map = map:currentMap(), custom = processMap, forcegather = true}
- }
- elseif GatherFight() == "fight" then
- return {
- {map = map:currentMap(), custom = processMap, fight = true}
- }
- elseif GatherFight() == "forcefight" then
- return {
- {map = map:currentMap(), custom = processMap, forcefight = true}
- }
- elseif GatherFight() == "path" then
- return {
- {map = map:currentMap(), custom = processMap}
- }
- else
- global:printError("Aucune action sur la map : " .. map:currentMap() .. " | mapID : " .. map:currentMapId())
- global:disconnect()
- end
- end
- -- mapsWithChangeMap --
- mapsWithChangeMap = {
- -- Mine Brakmar --
- { map = "10228", path = {"448"}, gather = true },
- { map = "10227", path = {"44","448"}, gather = true },
- { map = "10229", path = {"44"}, gather = true },
- ---------------------
- -- Mine Amakna Donjon Larve --
- { map = "1052", path = {"177"}, gather = true },
- { map = "1051", path = {"222","448"}, gather = true },
- { map = "10229", path = {"44"}, gather = true },
- ---------------------
- -- Mine Astrub --
- { map = "7599", path = {"169"}, gather = false },
- { map = "7600", path = {"140"}, gather = true },
- { map = "7603", path = {"128","366"}, gather = true },
- { map = "7604", path = {"55","408"}, gather = true },
- { map = "7605", path = {"456"}, gather = true },
- ---------------------
- -- Mine Amakna Sadida --
- { map = "1015", path = {"140"}, gather = true }, -- enlever la cellule 209 pour éviter de monter --
- { map = "1018", path = {"222","227","372"}, gather = true },
- { map = "1019", path = {"222","227","372"}, gather = true },
- { map = "1031", path = {"372"}, gather = true },
- { map = "1025", path = {"367"}, gather = true },
- { map = "1026", path = {"367"}, gather = true },
- { map = "1036", path = {"156","409"}, gather = true },
- { map = "1023", path = {"222","227","367"}, gather = true },
- { map = "1020", path = {"222","227","372"}, gather = true },
- { map = "1021", path = {"222","227","372"}, gather = true },
- { map = "1032", path = {"372"}, gather = true },
- { map = "1027", path = {"367"}, gather = true },
- { map = "1028", path = {"367"}, gather = true },
- { map = "1062", path = {"156","409"}, gather = true },
- { map = "1024", path = {"222","227","367"}, gather = true },
- { map = "1034", path = {"177","417"}, gather = true },
- { map = "1022", path = {"222","227","372"}, gather = true },
- { map = "1033", path = {"372"}, gather = true },
- { map = "1030", path = {"367"}, gather = true },
- { map = "1038", path = {"156","409"}, gather = true },
- { map = "1029", path = {"367"}, gather = true },
- }
- ---------------------
- -- Function processMap --
- function processMap()
- for index, actualMap in pairs(mapsWithChangeMap) do
- if (map:onMap(actualMap.map)) then
- if (type(actualMap.path) == "table") then
- if (not actualMap.toggle) then
- actualMap.toggle = {}
- for i = 1, #(actualMap.path) do
- table.insert(actualMap.toggle, false)
- end
- else
- toggleTemp = false
- for i = 1, #(actualMap.toggle) do
- toggleTemp = actualMap.toggle[i]
- end
- if (toggleTemp) then
- for i = 1, #(actualMap.toggle) do
- actualMap.toggle[i] = false
- end
- end
- end
- for i, action in pairs(actualMap.path) do
- if (not actualMap.toggle[i]) then
- if (type(action) == "string") then
- actualMap.toggle[i] = true
- return map:changeMap(action)
- elseif (type(action) == "number") then
- actualMap.toggle[i] = true
- return map:door(action)
- elseif (type(action) == "function") then
- actualMap.toggle[i] = true
- return action()
- end
- end
- end
- else
- if (actualMap.path) then
- return map:changeMap(actualMap.path)
- elseif (actualMap.door) then
- if (type(actualMap.door) == "string") then
- return map:door(tonumber(actualMap.door))
- elseif (type(actualMap.door) == "number") then
- return map:door(actualMap.door)
- end
- elseif (actualMap.custom) then
- return actualMap.custom()
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement