Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Serpent Spawn for Mage's
- by Crest from Pandoriumx
- ]]--
- --[[Variables]]--
- local minCap = 100 -- Mininum cap
- local minSD = 100 -- minimum sds
- local SD = 2000
- local manaPotID = 268 -- ID of mana potion
- local manaPotCost = 50 -- Cost of each mana potion
- local minManaPot = 50 -- Mininum mana potion
- local maxManaPot = 250 -- Maximum mana pots to buy
- local usingSoftboots = true -- Using Softboots? (True Or False)
- local usingRings = true -- Using Life/Rings of Healing? (True Or False)
- local minimizeEQ = true
- local minimizeBPS = true
- local lootBP = "Blue Backpack"
- local goldBP = "Red Backpack"
- local stackBP = "Backpack"
- local runeBP = "Golden Backpack"
- local Boots = 3079 -- Boots (for use with softboots script)
- local ManaToEquip = 4000 -- Mana to equip softboots
- local ManaToUnequip = 4500 -- Mana to unequip softboots
- local RestoreMana = false -- Uses manas < 40% mana and when no creatures on screen until > 85%
- local defaultTileId = 354 -- the tile id when it is closed
- --[[########################################################]]--
- --[[##########NOTHING BELOW HERE SHOULD BE CHANGED##########]]--
- --[[########################################################]]--
- local count = 0
- fileName = '[Mage] Serpent Spawn Goroma'
- --[[LABEL MANAGER]]--
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- displayInformationMessage("Spawn: Medusa\n Vocation: Mage's\n Author: Crest from Pandoriumx")
- function onWalkerSelectLabel(labelName)
- local func = loadstring(labelName)
- if (func) then func()
- end
- end
- --[DepositItems]]--
- function DepositItems()
- Walker.Stop()
- Self.ReachDepo()
- Self.DepositItems(14013, 14042, 14247, 12730, 3032, 3029, 815, 14008, 14041, 14040, 14043, 14250, 14011, 14044, 14012, 14010, 811, 7413, 9302, 814, 3081, 3436, 3369, 3370, 4839, {7643, 1}, {5925, 1}, {10277, 1}, {5879, 1}, {9694, 1}, {10313, 1}, {3032, 1}, {10309, 1}, {237, 1}, {3061, 1}, {3392, 1}, {10282, 1}, {3029, 1})
- Walker.Start()
- end
- --[[RefillPotions]]--
- function Bank()
- Walker.Stop()
- local amountMp = ((maxManaPot - Self.ItemCount(manaPotID)) * manaPotCost)
- local countMp = math.ceil(amountMp / 1000) * 1000
- local amountSD = ((SD - Self.ItemCount(3155)) * 108)
- local countSD = math.ceil(amountSD / 1000) * 1000
- count = count + 1
- Self.SayToNpc({"hi", "deposit all", "yes", "withdraw " .. (countMp + countSD + 200), "yes", "balance"}, 65)
- Walker.Start()
- end
- --[[Follow Jack]]--
- function ShipSea()
- x = Self.Position().x
- Self.SayToNpc({"hi", "mission", "yes"}, 65)
- wait(900, 1200)
- if Self.Position().x == x then Walker.Goto("ShipLBCheck")
- end
- end
- --[[Follow Jack]]--
- function ShipSvar()
- x = Self.Position().x
- Self.SayToNpc({"hi", "Svargrond", "yes"}, 65)
- wait(900, 1200)
- if Self.Position().x == x then Walker.Goto("ShipGoroCheck")
- end
- end
- --[[ResetBps]]--
- function ResetBps()
- Walker.Stop()
- Self.CloseContainers()
- Self.OpenMainBackpack(true):OpenChildren({stackBP, true}, {lootBP, true}, {goldBP, true}, {runeBP, true})
- Container.GetFirst():Minimize()
- Walker.Start()
- end
- --[[BuyPotions]]--
- function BuyPotions()
- Walker.Stop()
- Self.SayToNpc({"hi", "trade"}, 65)
- wait(900, 1200)
- Self.ShopBuyItemsUpTo(manaPotID, maxManaPot)
- wait(900, 1200)
- Self.ShopBuyItemsUpTo(3155, SD)
- Walker.Start()
- end
- --[[StartHunt]]--
- function StartHunt()
- Looter.Start()
- Targeting.Start()
- end
- --[[CheckPotions]]--
- function CheckPotions()
- delayWalker(3000)
- if ((Self.ItemCount(manaPotID) <= minManaPot) or (Self.Cap() <= minCap) or (Self.ItemCount(3155) <= minSD)) then
- wait(100, 1000)
- else
- gotoLabel("StartHunt()")
- end
- end
- --[[Minimize]]--
- function Minimize()
- Walker.Stop()
- if minimizeEQ == true then
- Client.HideEquipment()
- end
- wait(500, 1400)
- if minimizeBPS == true then
- for x = 0, #Container.GetIndexes() - 1 do
- local bp = Container.GetFromIndex(x)
- bp:Minimize()
- wait(200, 400)
- end
- end
- Walker.Start()
- end
- --[[Find Certain Items On Screen]]--
- Map.GetUseItems = function (id)
- if type(id) == "string" then
- id = Item.GetID(id)
- end
- local pos = Self.Position()
- local store = {}
- for x = -7, 7 do
- for y = -5, 5 do
- if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
- itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- table.insert(store, itemPos)
- end
- end
- end
- return store
- end
- --[[DepotChooser]]--
- Self.ReachDepo = function (attempt)
- local attempt = attempt or 4
- Walker.Stop()
- local DepotIDs = {8050, 823, 8043, 815}
- local DepotPos = {}
- for i = 1, #DepotIDs do
- local dps = Map.GetUseItems(DepotIDs[i])
- for d = 1, #dps do
- table.insert(DepotPos, dps[d])
- end
- end
- local function gotoDepot()
- local pos = Self.Position()
- print("Depots found: " .. tostring(#DepotPos))
- for i = 1, #DepotPos do
- location = DepotPos[i]
- Self.UseItemFromGround(location.x, location.y, location.z)
- wait(1000, 2000)
- if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
- wait(5000, 6000)
- if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
- Walker.Start()
- return true
- end
- else
- print("There is something blocking the path.")
- end
- end
- return false
- end
- repeat
- reachedDP = gotoDepot()
- if reachedDP then
- return true
- end
- attempt = attempt - 1
- sleep(100)
- print("Attempt to reach depot was unsuccessfull. " .. attempt .. " attempts left.")
- until attempt <= 0
- return false
- end
- Module.New("Softboots", function(module)
- if usingSoftboots then
- if (Self.Mana() <= ManaToEquip) and (Self.Feet().id ~= 3549) then
- Self.Equip(6529, "feet")
- elseif (Self.Mana() >= ManaToUnequip) and (Self.Feet().id ~= Boots) or (Self.Feet().id == 6530) then
- Self.Equip(Boots, "feet")
- end
- end
- end)
- Module.New("Rings", function(module)
- if usingRings then
- if (Self.Ring().id ~= 3100) and (Self.Ring().id ~= 3089) then
- if (Self.ItemCount(3098) >= 1) then
- Self.Equip(3098, "ring")
- elseif (Self.ItemCount(3052) >= 1) then
- Self.Equip(3052, "ring")
- end
- end
- end
- end)
- Module.New("Restore Mana", function(module)
- if RestoreMana then
- for index = CREATURES_LOW, CREATURES_HIGH do
- local creature = Creature.GetFromIndex(index)
- if not (creature:isOnScreen() and creature:ID() ~= Self.ID()) then
- percent = (Self.Mana() / Self.MaxMana() * 100)
- if (percent <= 50) and (Self.ItemCount(manaPotID) > 0) and (Self.TargetID() == 0) then
- repeat
- percent = (Self.Mana() / Self.MaxMana() * 100)
- delayWalker(1400)
- Self.UseItemWithMe(manaPotID)
- wait(900,1300)
- until (percent >= 85 or Self.ItemCount(238) < 1 or creature:isOnScreen() and creature:ID() ~= Self.ID() or not Self.TargetID() == 0)
- end
- end
- end
- end
- module:Delay(3000)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement