Re: New Spells >> show them off here
Posted: Mon Mar 25, 2013 11:11 am
It will work for the whole dungeon, no problem. The only thing that is level-affected is timers
Official Legend of Grimrock Forums
http://grimrock.net/forum/
Code: Select all
ammoCycle = { "rock" , "throwing_knife" , "arrow" , "shuriken" , "throwing_axe" , "quarrel" , "throwing_hammer" , "death_star" }
ammoNumbers = {}
--build inverse table
for i , v in ipairs( ammoCycle ) do
ammoNumbers[v] = i
end
function transmute(caster,x,y,direction,skill)
local item
local slot
for i = 7,8 do
item = caster:getItem(i)
if item and ammoNumbers[item.name] then
slot = i
break
end
end
if not slot then
return
end
local oldAmmoName = item.name
local stackSize = (item:getStackSize()) - 1
caster:removeItem(slot)
if stackSize == 0 then
hudPrint("According to the Law of Diminishing Returns... You must transmute more than 1 piece of ammunition")
return false
end
local newAmmoNumber = ( ammoNumbers[oldAmmoName] % ( table.getn( ammoCycle ) ) ) + 1
local newAmmo = spawn( ammoCycle[newAmmoNumber] )
newAmmo:setStackSize( stackSize )
caster:insertItem( slot , newAmmo )
playSound("generic_spell")
party:playScreenEffect("damage_screen_yellow")
hudPrint( caster:getName() .. " transmuted ammunition." )
end
Code: Select all
-----------------------------------FIRE-------------------------------
defineSpell{
name = "explosive_mine",
uiName = "Explosive Mine",
skill = "fire_magic",
level = 0,
runes = "ABDG",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.explosive_mine(caster,x,y,direction,skill)
end,
}
defineSpell{
name = "detonate_mine",
uiName = "Detonate Mine",
skill = "fire_magic",
level = 0,
runes = "ABG",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.detonate(caster,x,y,direction,skill)
end,
}
-----------------------------ICE----------------------------
defineSpell{
name = "freezing_trap",
uiName = "Freezing Trap",
skill = "ice_magic",
level = 0,
runes = "BFI",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.freezingtrap(caster,x,y,direction,skill)
end,
}
defineSpell{
name = "trigger_freeze",
uiName = "Trigger Freeze",
skill = "ice_magic",
level = 0,
runes = "AFI",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.freeze(caster,x,y,direction,skill)
end,
}
----------------EARTH------------------------------------------
defineSpell{
name = "vapor_snare",
uiName = "Vapor Snare",
skill = "earth_magic",
level = 0,
runes = "BFG",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.vaporsnare(caster,x,y,direction,skill)
end,
}
defineSpell{
name = "trigger_vapors",
uiName = "Trigger Vapors",
skill = "earth_magic",
level = 0,
runes = "ABFG",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return magicScript.poisonsnare(caster,x,y,direction,skill)
end,
}
Code: Select all
-----------------------explosive mine-------------------------------
function explosive_mine(caster, x, y, direction, skill)
if findEntity("counterMine") ~= nil then
findEntity("counterMine"):destroy()
else
spawn("counter", party.level, party.x, party.y, 0, "counterMine")
end
local a = "mine"..counterMine:getValue()
spawn("pressure_plate_hidden", party.level, party.x, party.y, 0, "a")
:setTriggeredByParty(false)
:setTriggeredByMonster(true)
:setTriggeredByItem(false)
:addConnector("any", "magic", "detonate")
hudPrint("You have prepared the explosive mine...")
counterMine:increment()
end
function detonate(caster, x, y, direction, skill)
explosives_ord = 1
explosives_ord = caster:getOrdinal()
local originator = 2 ^ (explosives_ord+1)
if findEntity("counterMine") == nil then
hudPrint("You must first set the Explosive Mine before detonating it....")
return true
else
for i = 0, counterMine:getValue() do
a = findEntity("mine"..i)
if a ~= nil then
spawn("fireburst", a.level, a.x, a.y, a.facing)
damageTile(a.level, a.x, a.y, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x, a.y-1, a.facing)
damageTile(a.level, a.x, a.y-1, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x+1, a.y, a.facing)
damageTile(a.level, a.x+1, a.y, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x, a.y+1, a.facing)
damageTile(a.level, a.x, a.y+1, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x-1, a.y, a.facing)
damageTile(a.level, a.x-1, a.y, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x+1, a.y+1, a.facing)
damageTile(a.level, a.x+1, a.y+1, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x-1, a.y-1, a.facing)
damageTile(a.level, a.x-1, a.y-1, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x-1, a.y+1, a.facing)
damageTile(a.level, a.x-1, a.y+1, a.facing,originator+1,'fire',skill*5)
spawn("fireburst", a.level, a.x+1, a.y-1, a.facing)
damageTile(a.level, a.x+1, a.y-1, a.facing,originator+1,'fire',skill*5)
end
a:setTriggeredByMonster(false)
findEntity("counterMine"):destroy()
findEntity("a"):destroy()
return
end
end
end
-------------------------freeze bomb-----------------------------
function freezingtrap()
if findEntity("counterFreeze") ~= nil then
findEntity("counterFreeze"):destroy()
else
spawn("counter", party.level, party.x, party.y, 0, "counterFreeze")
end
local f = "trap"..counterFreeze:getValue()
spawn("pressure_plate_hidden", party.level, party.x, party.y, 0, "f")
:setTriggeredByParty(false)
:setTriggeredByMonster(true)
:setTriggeredByItem(false)
:addConnector("any", "magic", "freeze")
hudPrint("You have prepared the Freezing Trap...")
counterFreeze:increment()
end
function freeze()
if findEntity("counterFreeze") == nil then
hudPrint("You must first set the Freezing Trap before triggering it....")
return true
else
for i = 0, counterFreeze:getValue() do
f = findEntity("trap"..i)
if f ~= nil then
spawn("frostburst", f.level, f.x, f.y, f.facing)
spawn("frostburst", f.level, f.x, f.y-1, f.facing)
spawn("frostburst", f.level, f.x+1, f.y, f.facing)
spawn("frostburst", f.level, f.x, f.y+1, f.facing)
spawn("frostburst", f.level, f.x-1, f.y, f.facing)
spawn("frostburst", f.level, f.x+1, f.y+1, f.facing)
spawn("frostburst", f.level, f.x-1, f.y-1, f.facing)
spawn("frostburst", f.level, f.x-1, f.y+1, f.facing)
spawn("frostburst", f.level, f.x+1, f.y-1, f.facing)
end
f:setTriggeredByMonster(false)
findEntity("counterFreeze"):destroy()
findEntity("f"):destroy()
return
end
end
end
-----------vapor snare--------------------------------------
function vaporsnare(caster, x, y, direction, skill)
if findEntity("counterSnare") ~= nil then
findEntity("counterSnare"):destroy()
else
spawn("counter", party.level, party.x, party.y, 0, "counterSnare")
end
local a = "snare"..counterSnare:getValue()
spawn("pressure_plate_hidden", party.level, party.x, party.y, 0, "a")
:setTriggeredByParty(false)
:setTriggeredByMonster(true)
:setTriggeredByItem(false)
:addConnector("any", "magic", "poisonsnare")
hudPrint("You have prepared the Poison Vapor Snare...")
counterSnare:increment()
end
function poisonsnare(caster, x, y, direction, skill)
explosives_ord = 1
explosives_ord = caster:getOrdinal()
local originator = 2 ^ (explosives_ord+1)
if findEntity("counterSnare") == nil then
hudPrint("You must first set the Vapor Snag before triggering it....")
return true
else
for i = 0, counterSnare:getValue() do
a = findEntity("snare"..i)
if a ~= nil then
spawn("poison_cloud", a.level, a.x, a.y, a.facing)
damageTile(a.level, a.x, a.y, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x, a.y-1, a.facing)
damageTile(a.level, a.x, a.y-1, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x+1, a.y, a.facing)
damageTile(a.level, a.x+1, a.y, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x, a.y+1, a.facing)
damageTile(a.level, a.x, a.y+1, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x-1, a.y, a.facing)
damageTile(a.level, a.x-1, a.y, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x+1, a.y+1, a.facing)
damageTile(a.level, a.x+1, a.y+1, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x-1, a.y-1, a.facing)
damageTile(a.level, a.x-1, a.y-1, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x-1, a.y+1, a.facing)
damageTile(a.level, a.x-1, a.y+1, a.facing,originator+1,'poison',skill*2)
spawn("poison_cloud", a.level, a.x+1, a.y-1, a.facing)
damageTile(a.level, a.x+1, a.y-1, a.facing,originator+1,'poison',skill*2)
end
a:setTriggeredByMonster(false)
findEntity("counterSnare"):destroy()
findEntity("a"):destroy()
return
end
end
end
Code: Select all
function freeze(caster, x, y, direction, skill)
shards_ord = 1 --add
shards_ord = caster:getOrdinal() --add
local originator = 2 ^ (shards_ord+1) --add
if findEntity("counterFreeze") == nil then
hudPrint("You must first set the Freezing Trap before triggering it....")
return true
else
Code: Select all
defineObject{
name = "one_ice_shard",
class = "IceShards",
attackPower = 1,
chainCounter = 1,
--cameraShake = true,
tags = { "spell" },
}
Code: Select all
defineSpell{
name = "transmutation",
uiName = "Transmutation",
skill = "earth_magic",
level = 0,
runes = "EFG",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
return transmutationScript.transmuteSorting(caster,x,y,direction,skill)
end,
}
Code: Select all
defineObject{
name = "floating_sword_socket",
class = "Alcove",
anchorPos = vec(0, 1.1, -1.0),
anchorRotation = vec(90,0,90),
targetPos = vec(0, 1.1, -0.38),
targetSize = vec(0, 0, 0),
placement = "wall",
editorIcon = 92,
}
Code: Select all
defineSound{
name = "anime_sword",
filename = "mod_assets/sounds/anime_sword.wav",
loop = false,
volume = 1.5,
minDistance = 1.5,
maxDistance = 5,
}
Code: Select all
defineParticleSystem{
name = "damage_screen_yellow",
emitters = {
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,1},
boxMax = {0,0,1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/damage_screen.tga",
lifetime = {0.4, 0.4},
colorAnimation = false,
color0 = {1.5, 1.5, 0.5},
opacity = 0.45,
fadeIn = 0.001,
fadeOut = 0.3,
size = {2.3, 2.3},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 0,
blendMode = "Translucent",
objectSpace = true,
}
}
}
defineParticleSystem{
name = "damage_screen_pink",
emitters = {
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,1},
boxMax = {0,0,1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/damage_screen.tga",
lifetime = {0.4, 0.4},
colorAnimation = false,
color0 = {1.2, 0.2, 0.7},
opacity = 0.45,
fadeIn = 0.001,
fadeOut = 0.3,
size = {2.3, 2.3},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 0,
blendMode = "Translucent",
objectSpace = true,
}
}
}
defineParticleSystem{
name = "damage_screen_white",
emitters = {
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,1},
boxMax = {0,0,1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/damage_screen.tga",
lifetime = {0.4, 0.4},
colorAnimation = false,
color0 = {2, 2, 2},
opacity = 0.45,
fadeIn = 0.001,
fadeOut = 0.3,
size = {2.3, 2.3},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 0,
blendMode = "Translucent",
objectSpace = true,
}
}
}
Code: Select all
---------------------------------Sorting function----------------------------------
function transmuteSorting(caster,x,y,direction,skill)
local item = getMouseItem()
local x = item
if x == nil then
hudPrint("This spell is 'usually' used to alter types of ammunition... and you must hold the ammunition with
the mouse cursor.")
return
end
if x and isInTable(ammoCycle, x.name) then
return transmutationScript.transmuteAmmo(caster,x,y,direction,skill)
end
if x and item.name == "mystery_ore" then
return transmutationScript.oreTransmute(caster,x,y,direction,skill)
end
if x and isInTable(transmuteList, x.name) then
return transmutationScript.secretTransmute(caster,x,y,direction,skill)
end
end
function isInTable(table, element)
for _,value in pairs(table) do
if value == element then
return true
end
end
return false
end
-------------------------------Ammunition Change----------------------------------------------------
ammoCycle = { "rock" , "throwing_knife" , "arrow" , "shuriken" , "throwing_axe" , "quarrel" }
--you can freely add more items to this table without having to change anything else
ammoNumbers = {}
--build inverse table
for i , v in ipairs( ammoCycle ) do
ammoNumbers[v] = i
end
function transmuteAmmo(caster,x,y,direction,skill) --each time cast, stack size is reduced by 1
local x = getMouseItem()
local z = x:getStackSize()
if z == 0 then
hudPrint("According to the Law of Diminishing Returns... You must transmute more than 1 piece of ammo")
return
end
local stackSize = (z) - 1
local oldAmmoName = x.name
local newAmmoNumber = ( ammoNumbers[oldAmmoName] % ( table.getn( ammoCycle ) ) ) + 1
local newAmmo = spawn(ammoCycle[newAmmoNumber])
x:destroy()
setMouseItem(newAmmo)
newAmmo:setStackSize( stackSize )
playSound("anime_sword") --custom sound
party:playScreenEffect("damage_screen_yellow") --custom screen effect
hudPrint( caster:getName() .. " transmuted ammunition." )
return
end
---------------------------------Random Ore Change------------------------------------------------------
mysteryList = {"full_helmet" , "magic_orb" , "throwing_axe" , "milkreed" , "long_sword" , "chitin_boots" , "whitewood_wand" , "flask" , "rock" , "leather_gloves" , "red_gem" , "note" , "bracelet_tirin" , "rat_shank" , "arrow"}
--^^change items to reflect your needs or custom stuff, items represent #1 - 15
function oreTransmute(caster,x,y,direction,skill) --an earth spell but you will need sufficient skill in air, earth and
--fire magic to cast transmute if you have the ore in mouse
--cursor
if findEntity("oresocket") ~= nil then
findEntity("oresocket"):destroy()
end
local d = getMouseItem()
if d and d.name == "machine_part_north" then
local skillLevel = 5
if caster:getSkillLevel("air_magic") >= skillLevel and caster:getSkillLevel("earth_magic") >= skillLevel and caster:getSkillLevel("fire_magic") >= skillLevel then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "oresocket")
findEntity("oresocket"):addItem(spawn( mysteryList[math.random(1,15)] ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the piece of Ore ...... ")
playSound("anime_sword") --custom sound
party:playScreenEffect("damage_screen_yellow") --custom effect
return
end
hudPrint("You must be more skilled in earth, air and fire magic to transmute this piece of ore...")
end
end
--------------------------------------Secret Change-------------------------------------------------------
transmuteList = {"chitin_greaves" , "chitin_mask" , "chitin_boots" , "chitin_mail" , "magic_orb" , "throwing_axe" , "ring_mail" ,"cutlas" , "whitewood_wand" , "longbow" , "rock" , "machine_junk4" , "machine_part_north"}
--^^change to suit your needs, I have only included basic asset pack items - I have not used all of them
function secretTransmute(caster,x,y,direction,skill)
if findEntity("secretsocket") ~= nil then
findEntity("secretsocket"):destroy()
end
local b = getMouseItem()
if b and isInTable(transmuteList, b.name) then
if b.name == "chitin_mask" or b.name == "chitin_mail" or b.name == "chitin_boots" or b.name ==
"chitin_greaves" then
local c = caster:getSkillLevel("earth_magic")
if c >= 5 then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "secretsocket")
findEntity("secretsocket"):addItem(spawn( "longbow" ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the Chitin Armour to create a Long Bow." )
playSound("anime_sword")
party:playScreenEffect("damage_screen_white")
else
hudPrint("You need to be more skilled in earth magic to transmute pieces of Chitin armour...")
end
elseif b.name == "magic_orb" then
local c = caster:getSkillLevel("earth_magic")
if c >= 5 then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "secretsocket")
findEntity("secretsocket"):addItem(spawn( "zhandul_orb" ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the Orb of Radiance to create Zhandul's Orb." )
playSound("anime_sword")
party:playScreenEffect("damage_screen_white")
else
hudPrint("You need to be more skilled in earth magic to transmute the Orb of Radiance...")
end
elseif b.name == "ring_mail" then
local c = caster:getSkillLevel("earth_magic")
if c >= 5 then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "secretsocket")
findEntity("secretsocket"):addItem(spawn( "plate_cuirass" ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the Ring Mail to create Plate Cuirass" )
playSound("anime_sword")
party:playScreenEffect("damage_screen_white")
else
hudPrint("You need to be more skilled in earth magic to transmute the Ring Mail...")
end
elseif b.name == "throwing_axe" then
local c = caster:getSkillLevel("earth_magic")
if c >= 5 then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "secretsocket")
findEntity("secretsocket"):addItem(spawn( "tar_bead" ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the Throwing Axe to create some Tar Bead." )
playSound("anime_sword")
party:playScreenEffect("damage_screen_white")
else
hudPrint("You need to be more skilled in earth magic to transmute theThrowing Axe...")
end
end
end
hudPrint("You must hold the item to Transmute with the mouse cursor...")
return false
end
Code: Select all
elseif b.name == "fire_blade" or b.name == "fire_blade_empty" then
local c = caster:getSkillLevel("earth_magic")
if c >= 5 then
setMouseItem(nil)
spawn("floating_sword_socket", party.level, party.x, party.y, party.facing, "secretsocket")
findEntity("secretsocket"):addItem(spawn( "fire_blade" ,nil, nil, nil, nil))
hudPrint( caster:getName() .. " transmuted the Throwing Axe to create some Tar Bead." )
playSound("anime_sword")
party:playScreenEffect("damage_screen_white")
else
hudPrint("You need to be more skilled in earth magic to transmute theThrowing Axe...")
end
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onCastSpell = function(champion, spell)
return partySpellScripts.spellEnhancements(champion, spell)
end
}
Code: Select all
function spellEnhancements(champion, spell)
if spell == "shock" then
if (champion:getItem(7) ~= nil and champion:getItem(7).name == "spark_staff") or (champion:getItem(8) ~=
nil and champion:getItem(8).name == "spark_staff") then
--how do I ask the burst spell to set Attack Power????--
hudPrint("zappy!")
end
end
end
Code: Select all
defineObject{
name = "frostburst",
class = "BurstSpell",
particleSystem = "frostburst",
lightColor = vec(0.25, 0.5, 1),
lightBrightness = 40,
lightRange = 4,
sound = "frostburst",
attackPower = 20,
damageType = "cold",
--cameraShake = true,
tags = { "spell" },
}
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onCastSpell = function(champion, spell)
return partySpellScripts.spellEnhancements(champion, spell)
end
}
Code: Select all
spellCasters = 0
function spellEnhancements(champion, spell)
local item
local slot
if spell == "spellfire_burst" then
for i = 7,8 do
item = champion:getItem(i)
if item and item.name == "shield_spellfire" then
return attackingWeaponScripts.shieldSpellfire(champion, item)
end
end
end
if spell == "shock" then
if (champion:getItem(7) ~= nil and champion:getItem(7).name == "spark_staff") or (champion:getItem(8) ~=
nil and champion:getItem(8).name == "spark_staff") then
return grimwold_AOEspell_script.stormSpell(champion:getOrdinal(),"shock","shockburst","shockburst",100,"")
end
end
if spell == "lightning_bolt" then
if (champion:getItem(7) ~= nil and champion:getItem(7).name == "spark_staff") or (champion:getItem(8) ~=
nil and champion:getItem(8).name == "spark_staff") then
local dx,dy = getForward(party.facing)
spawn("lightning_bolt_greater",party.level,party.x+ dx,party.y+ dy,party.facing)
end
end
return true
end
Code: Select all
defineSpell{
name = "redistribute",
uiName = "Redistribute",
skill = "spellcraft",
level = 5,
runes = "BEH",
manaCost = 1,
onCast = function(caster, x, y, direction, skill)
local amount = caster:getStat("energy")
local share = 3
for i =1,4 do
if not party:getChampion(i):getEnabled() or not party:getChampion
(i):isAlive()
then
share = share - 1
end
end
for i=1,4 do
if party:getChampion(i):getEnabled() and party:getChampion
(i):isAlive() then
party:getChampion(i):modifyStat("energy", amount/share)
end
end
caster:modifyStat("energy", -amount)
playSound("consume_food")
party:playScreenEffect("death_dust")
end,
}
Code: Select all
defineSpell{
name = "mix_potions_energy",
uiName = "Mix Energy Potions",
skill = "spellcraft",
level = 10,
runes = "D",
manaCost = 5,
onCast = function(caster, x, y, direction, skill)
local counter_flasks = 0
local counter_blooddrops = 0
local amount = 0
local helper = 0
local k = 1
local q = 1
local a = nill
for i=1,4 do
for j=1,31 do
if party:getChampion(i):getItem(j) ~= nill then
if party:getChampion(i):getItem(j).name == "flask"
then
counter_flasks = counter_flasks + 1
elseif party:getChampion(i):getItem(j).name ==
"blooddrop_blossom"
then
counter_blooddrops = counter_blooddrops +
party:getChampion(i):getItem(j):getStackSize()
end
end
end
end
if counter_flasks >= counter_blooddrops
then
amount = counter_blooddrops
else
amount = counter_flasks
end
helper = amount
while k<=4 and amount~=0 do
q = 1
while q<=31 and amount~=0 do
if party:getChampion(k):getItem(q) ~= nill then
if party:getChampion(k):getItem(q).name == "flask"
then
party:getChampion(k):removeItem(q)
a = spawn("potion_energy")
party:getChampion(k):insertItem(q, a)
amount = amount - 1
end
end
q = q +1
end
k = k+1
end
amount = helper
k=1
while k<=4 and amount~=0 do
q = 1
while q<=31 and amount~=0 do
if party:getChampion(k):getItem(q) ~= nill then
if party:getChampion(k):getItem(q).name ==
"blooddrop_blossom"
then
party:getChampion(k):getItem
(q):setStackSize(party:getChampion(k):getItem(q):getStackSize() - 1)
amount = amount - 1
if party:getChampion(k):getItem
(q):getStackSize() == 0
then
party:getChampion(k):removeItem(q)
q = q-1
end
end
end
q = q +1
end
k = k+1
end
end,
}