open a door if a champion has certain level skill
Posted: Mon Jul 29, 2013 3:02 pm
Hey guys,
can someone tell me how to open a door if one of the champion have a certain level of a certain skills?
like:
if Champion(1) or Champion(2) or Champion(3) or Champion(4:) has skills ("spellcraft") level 15 then door_1:open()
I ve see this code in the script repository but I can't adapt it as what I want
can someone tell me how to open a door if one of the champion have a certain level of a certain skills?
like:
if Champion(1) or Champion(2) or Champion(3) or Champion(4:) has skills ("spellcraft") level 15 then door_1:open()
I ve see this code in the script repository but I can't adapt it as what I want
SpoilerShow
Code: Select all
function teststat(stat, value, xpmin, xpmax)
local astat = {}
astat[1] = party:getChampion(1):getStat("vitality")
astat[2] = party:getChampion(2):getStat("strength")
astat[3] = party:getChampion(3):getStat("dexterity")
astat[4] = party:getChampion(4):getStat("willpower")
local aname = {}
aname[1] = party:getChampion(1):getName()
aname[2] = party:getChampion(2):getName()
aname[3] = party:getChampion(3):getName()
aname[4] = party:getChampion(4):getName()
for i=1,4 do
if astat[i] < math.random(10) then
-- 10 le niveau de stat a tester
hudPrint(aname[i].." doesn't learn anything.")
else
local experiencegained = math.random(100,200)
-- xpmin 100 et xpmax 200
hudPrint(aname[i].." succeeds to understand what is going on and gain "..experiencegained.." XP." )
party:getChampion(i):gainExp(experiencegained)
end
end
end