Log in

View Full Version : Loot Spidris or another custom monster in OT



Chiitus
09-19-2016, 12:28 AM
Script still in beta, doesnt had time to make this to work perfect (but i will).

EDIT: High recommend to you add monster corpse id in the necessary files in folder Xenobot/Data.

SCRIPT:

function getContainerByIndex(myIndex)
for index, container in Container.iContainers() do
if(index == myIndex) then
return index
end
end
return nil
end

local position
local KILL_MONSTERS = {"Spidris", "Custom Monster New"}
local lootItems = {14088, 14089, 14086} -- Please modify it to include the Croc Rare Items
local productItems = {14082, 3030}
local goldContainer = getContainerByIndex(0) -- 1 Second Backpack
local cpContainer = getContainerByIndex(2) -- 2 Third Backpack
local prodContainer = getContainerByIndex(1)

Module.New("loot-spidris", function()
local target -- local target = Creature.New(Self.TargetID) -- Must create the Creature Object from the current Target
target = Creature.GetByID(Self.TargetID()) -- Must create the Creature Object from the current Target
if table.contains(KILL_MONSTERS, target:Name()) then -- If the Creature Name is "The Snapper" then
if target:isAlive() then -- If it's alive...
Targeting.Stop()
Walker.Stop()
Looter.Stop()
position = target:Position() -- Lets save the position so we loot it later
return true
end
if not target:isAlive() and position ~= nil then -- If there is a position and the Croc died then we can loot it
wait(500)
Self.UseLever(position.x, position.y, position.z)
wait(300)
local crocBody = Container.GetLast() -- Container object for the just opened Boss Corpse
for slot, item in crocBody:iItems() do -- Iterate all Items in the Croc Body
if table.contains(lootItems, item.id) then -- If the item is in the list then loot it
crocBody:MoveItemToContainer(slot, cpContainer, 0) -- This should loot all rares into your Creature Product Backpcak
end
if(item.id == Item.GetID("platinum coin")) then -- If the Item is Gold Coins
crocBody:MoveItemToContainer(slot, goldContainer, 0) -- This should loot all gold Coins into your Gold Backpack
end
if table.contains(productItems, item.id) then -- If the item is in the list then loot it
crocBody:MoveItemToContainer(slot, prodContainer, 0) -- This should loot all rares into your Creature Product Backpcak
end
wait(400)
end
Targeting.Start()
Walker.Start()
Looter.Start()
position = nil -- We finished looting the Crocodile, lets clear this just to be safe
end
end
wait(200)
end)

Sajgon
10-28-2016, 09:15 AM
Script still in beta, doesnt had time to make this to work perfect (but i will).

EDIT: High recommend to you add monster corpse id in the necessary files in folder Xenobot/Data.


Hey - good work but still buggy, often it doesnt start targeting, walker and looter back up again and has to be done manually. i tried few workaround but still works kinda bad.

did you update the script yet without uploading it?

kind regards
<3

Chiitus
11-17-2016, 04:04 AM
Hey!
Not yet, i let Tibia off for a while, but im back again, the script will be updated soon!
Thx.

Julian Ownz
11-24-2016, 09:18 AM
It bugged ... The scripts shut down the Targeting / walker / looter ... and call again .. so far and right!
But many times he does not turn on the targeting / walker / looter again, so the monsters are reborn and the puppet stands without doing anything.
Do you have a solution for this?