ok spent about one hour with it, but at the end its woriking how I wanted. Perhaps solution is not the best one, but does not matter, it is working :d
I have set counter for 4 and button connect to checkOrb function. When every character has orb in its hand, teleport is activated and party escape. if not fireball kill all.
Code: Select all
function itemCheck(item)
-- checks for the item in champions hands
for champ = 1,2 do
for slot = 7,8 do
x = party:getChampion(champ):getItem(slot)
if x ~= nil then
if x.name == item then
orbcounter:decrease ()
end
end
end
end
end
function itemCheck(item)
-- checks for the item in champions hands
for champ = 1,2 do
for slot = 7,8 do
x = party:getChampion(champ):getItem(slot)
if x ~= nil then
if x.name == item then
orbcounter:decrement ()
end
end
end
end
end
function itemCheck(item)
-- checks for the item in champions hands
for champ = 3,4 do
for slot = 7,8 do
x = party:getChampion(champ):getItem(slot)
if x ~= nil then
if x.name == item then
orbcounter:decrement ()
end
end
end
end
end
function itemCheck(item)
-- checks for the item in champions hands
for champ = 3,4 do
for slot = 7,8 do
x = party:getChampion(champ):getItem(slot)
if x ~= nil then
if x.name == item then
orbcounter:decrement ()
end
end
end
end
end
function checkOrb()
itemCheck("water_orb")
end