Page 1 of 1

Script help need - SOLVED

Posted: Fri Mar 29, 2013 11:09 pm
by Drakkan
Hi guys, it was a while, but I need your help again :) If somebody wanna make script which I need for my dungeon I will be reeeelay glad. This script is somehow complex, but I think it could be done.

Ok here is the thing - new member called Insal joins party (I have already used grimwigedts for it) - this will enable timer called Thief. After some time (let say 10 min) I need following script to start -

Insal will leave the party and steal all torches from all party members and also some kind of food from all members (lets say Pitroot breads and all chees). THeoreticaly it is not difficult (disable particular champion, run items iterator checks...) but practicaly I am not able to write it.
THanks for any help
EDIT: few notes - Insal could be any party member slot. All items carried by Insal (other then torches and food) need to be dropped on floor when he leave party

Re: Script help need

Posted: Tue Apr 02, 2013 7:59 pm
by Drakkan
ok i got so far now - this script disable Insal from the party

Code: Select all

function remove()
removeChampion("Insal")
end

function removeChampion(name)
for i=1,4 do
local champ = party:getChampion(i)
if champ:getEnabled() and champ:getName() == name then
champ:setEnabled(false)
end
end
end
this script steal all items I need from inventories

Code: Select all

function steal()
stealItem("torch")
stealItem("pitroot_bread")
end

function stealItem(itemname)
 for champion=1,4 do
  for slot=1,31 do
   local item = party:getChampion(champion):getItem(slot)
   if item and item.name == itemname then
    party:getChampion(champion):removeItem(slot)
end
end
end
end
now I need all items carried by Insal other than above (torches, bread) to be dropped on floor. Any help pls ?

Re: Script help need

Posted: Tue Apr 02, 2013 9:01 pm
by AdrTru
Try to spawn new item of same type as you remove from party.

Re: Script help need - SOLVED

Posted: Tue Apr 02, 2013 9:24 pm
by Drakkan
alraedy solved, thanks for tip anyway and thanks to John Wordsworth for help