Code: Select all
function LvlComp()
if (party:getChampion(2):getEnabled()) then
local C1 = OrdinalScript.getChampionWithOrdinal(1);
local C2 = OrdinalScript.getChampionWithOrdinal(2);
while (C2:getLevel() < C1:getLevel()) do
C2:levelUp();
end
end
end
function Lvl3()
if (party:getChampion(3):getEnabled()) then
local C1 = OrdinalScript.getChampionWithOrdinal(1);
local C2 = OrdinalScript.getChampionWithOrdinal(3);
while (C2:getLevel() < C1:getLevel()) do
C2:levelUp();
end
end
end
function lvl4()
if (party:getChampion(4):getEnabled()) then
local C1 = OrdinalScript.getChampionWithOrdinal(1);
local C2 = OrdinalScript.getChampionWithOrdinal(4);
while (C2:getLevel() < C1:getLevel()) do
C2:levelUp();
end
end
endCode: Select all
function getChampionWithOrdinal(ordinal)
for i=1,4 do
if ( party:getChampion(i):getOrdinal() == ordinal )
then return party:getChampion(i);
end
end
return nil;
endCode: Select all
function VainCheck(item)
for champ = 1,4 do
for slot = 1,8 do
vainz = party:getChampion(champ):getItem(slot)
if vainz ~= nil then
if vainz.name == item then
dm_irondoor_1:open()
timer_v:destroy()
end
end
end
end
end
function checkShirt()
VainCheck("Dandy_shirt")
end
function checkPants()
VainCheck("Dandy_pants")
endAny ideas on how to fix this?