Code: Select all
function specialWeaponAttacks(champion, weapon)
if (weapon ~= nil) and (weapon.name == "monstrance") then
return attackingWeaponScripts.monstrance(champion, weapon)
end
if (weapon ~= nil) and (weapon.name == "annointed_mace") then
return attackingWeaponScripts.annointedMace(champion, weapon)
end
if (weapon ~= nil) and (weapon.name == "angelfire_stave") then
return attackingWeaponScripts.angelfireStave(champion, weapon)
end
if (weapon ~= nil) and (weapon.name == "psionic_blade") then
return attackingWeaponScripts.psionicBlade(champion, weapon)
end
if (weapon ~= nil) and (weapon.name == "reaper_axe_empty") then
return attackingWeaponScripts.reaperAxe(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "blightning_stave_empty") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "ice_sabre") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "vorpal_blade") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "shock_maul") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "fetid_talons") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "necro_power_glove_empty") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "robindranarth_fist") then
return attackingWeaponScripts.burstSpellAttacks(champion,weapon)
end
if (weapon ~= nil) and (weapon.name == "returning_throwing_axe") then
return grims_returning_axe_script.weaponCheck(champion, weapon)
end
if (weapon ~= nil) and (weapon.name == "recurring_nightmare") then
return grims_returning_axe_script.weaponCheck(champion, weapon)
end
end
---------------------------------------------------------------------------------
monstersList = {"amber_slime","ancient_horde","ancient_warrior","bone_slime","crab","crowern","cube","dark_elf_temple_skeleton_archer","dark_elf_temple_skeleton_archer_patrol", "exotic_crab_purple",
"dark_elf_temple_skeleton_warrior","dark_elf_temple_skeleton_patrol","goromorg","green_lizard","green_slime","herder","herder_big",
"herder_small","herder_swarm","high_elf_temple_skeleton_archer","high_elf_temple_skeleton_archer_patrol","high_elf_temple_skeleton_warrior","high_elf_temple_skeleton_patrol",
"ice_slime","isgardian","laguardian","liche","maggot_slime","ogre","red_slime","scavenger","scavenger_swarm","shrakk_torr","skeleton_archer","skeleton_archer_patrol","skeleton_patrol",
"skeleton_warrior","slug","snail","spider","spider_dark_orange","spider_red","stone_slime05","stone_slime06","stone_slime10","stone_slime11","tentacles","trash_slime",
"uggardian","urgardian","venom_wyvern","warden","warden_exploding","water_slime","wyvern"}
vamp_monster = ""
undeadMonsters = {"ancient_horde","ancient_warrior","blood_warrior","dark_elf_temple_skeleton_archer","dark_elf_temple_skeleton_archer_patrol",
"dark_elf_temple_skeleton_warrior","dark_elf_temple_skeleton_patrol","gold_warrior","gold_warrior_red_eye","high_elf_temple_skeleton_archer",
"high_elf_temple_skeleton_archer_patrol","high_elf_temple_skeleton_warrior","high_elf_temple_skeleton_patrol","liche","mummy_grunt","sin_eater",
"skeleton_archer","skeleton_archer_patrol","skeleton_archer_shadow","skeleton_dark","skeleton_patrol","skeleton_warrior"}
smite_monster = ""
function isInMonsterTable(table, element)
for _,value in pairs(table) do
if value == element then
return true
end
end
return false
end
function whichMonster(level,eggs,why)
for i in entitiesAt(level,eggs,why) do
if isInMonsterTable(monstersList,i.name) then
return i.id
end
end
return ""
end
function whichUndeadMonster(level,eggs,why)
for i in entitiesAt(level,eggs,why) do
if isInMonsterTable(undeadMonsters,i.name) then
return i.id
end
end
return ""
end
----------------------Vampric weapons------------------------------------------------
function reaperAxe(champion,weapon,skill)
local dx,dy = getForward(party.facing)
vamp_champ = champion
vamp_monster = whichMonster(party.level,party.x+dx,party.y+dy)
if vamp_monster == "" then
return true
end
local skill = champion:getSkillLevel("axes")
party:playScreenEffect("damage_screen")
vamp_champ:modifyStat("health", (skill/3))
return true
end
--------------------Syphon weapons---------------------------
function psionicBlade(champion,weapon,skill)
local dx,dy = getForward(party.facing)
syph_champ = champion
vamp_monster = whichMonster(party.level,party.x+dx,party.y+dy)
if vamp_monster == "" then
return true
end
local skill = champion:getSkillLevel("swords")
party:playScreenEffect("damage_screen_blue")
syph_champ:modifyStat("energy", (skill/2))
return true
end
-------------------Spellfire----------------------------------------------
function shieldSpellfire(champion,item)
local skill = champion:getSkillLevel("fire_magic")
local e = champion:getStat("energy")
for i = 7,8 do
local item2 = champion:getItem(i)
if item2 and item2.name == "spellfire_stave" then
local slot = i
if spellfireCounter1:getValue() < 1 then
spellfireCounter1:increment()
hudPrint("The Spellfire Burst resonates with the Stave....")
else
spellfireCounter1:reset()
champion:removeItem(slot)
setMouseItem(spawn("spellfire_stave_charged"))
party:playScreenEffect("damage_screen_pink")
hudPrint("Spellfire Trinity - The Bursts from the Shield have charged the Stave!!")
return true
end
end
end
end
----------------------Annointed weapons------------------------------------------------
function annointedMace(champion,weapon,skill)
local dx,dy = getForward(party.facing)
smite_champ = champion
smite_monster = whichUndeadMonster(party.level,party.x+dx,party.y+dy)
if smite_monster == "" then
return true
end
local skill = champion:getSkillLevel("staves")
party:playScreenEffect("damage_screen_yellow")
smiteDamage(champion,weapon,skill)
return true
end
function monstrance(champion,weapon,skill)
local dx,dy = getForward(party.facing)
smite_champ = champion
smite_monster = whichUndeadMonster(party.level,party.x+dx,party.y+dy)
if smite_monster == "" then
return true
end
local skill = champion:getSkillLevel("staves")
party:playScreenEffect("damage_screen_yellow")
smiteDamage(champion,weapon,skill)
return true
end
function angelfireStave(champion,weapon,skill)
local dx,dy = getForward(party.facing)
smite_champ = champion
smite_monster = whichUndeadMonster(party.level,party.x+dx,party.y+dy)
if smite_monster == "" then
return true
end
local skill = champion:getSkillLevel("staves")
party:playScreenEffect("damage_screen_yellow")
smiteDamage(champion,weapon,skill)
return true
end
function smiteDamage(champion,weapon,skill)
local smite_mon = findEntity(smite_monster)
if smite_mon ~= "" then
spawn("lightburst",smite_mon.level, smite_mon.x, smite_mon.y, smite_mon.facing)
spawn("fx", smite_mon.level, smite_mon.x, smite_mon.y, smite_mon.facing)
:setLight(2, 1, 1, 100, 3, 5, true)
:translate(0, 2, 0)
damageTile(smite_mon.level,smite_mon.x,smite_mon.y,(smite_mon.facing + 2)%4,0, 'physical',skill*7)
end
end
---------------------------------------------------------------
function burstSpellAttacks(champion, weapon, skill)
if (weapon ~= nil) and (weapon.name == "ice_sabre") then
if party.facing == 0 then
spawn("frostburst", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("frostburst", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("frostburst", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("frostburst", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "vorpal_blade") then
if party.facing == 0 then
spawn("poison_cloud", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("poison_cloud", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("poison_cloud", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("poison_cloud", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "shock_maul") then
if party.facing == 0 then
spawn("shockburst", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("shockburst", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("shockburst", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("shockburst", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "fetid_talons") then
if party.facing == 0 then
spawn("poison_cloud", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("poison_cloud", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("poison_cloud", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("poison_cloud", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "necro_power_glove_empty") then
if party.facing == 0 then
spawn("darkburst", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("darkburst", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("darkburst", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("darkburst", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "robindranarth_fist") then
if party.facing == 0 then
spawn("lightburst", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("lightburst", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("lightburst", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("lightburst", party.level, party.x-1, party.y, party.facing)
end
end
if (weapon ~= nil) and (weapon.name == "blightning_stave_empty") then
if party.facing == 0 then
spawn("darkburst", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("darkburst", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("darkburst", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("darkburst", party.level, party.x-1, party.y, party.facing)
end
end
end