Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move runes from spells for revscriptsys #3425

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function onCastSpell(creature, variant, isHotkey)
local animateDeadRune = Spell("rune")

function animateDeadRune.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
if tile and creature:getSkull() ~= SKULL_BLACK then
Expand All @@ -21,3 +23,16 @@ function onCastSpell(creature, variant, isHotkey)
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end

animateDeadRune:group("support")
animateDeadRune:id(83)
animateDeadRune:name("Animate Dead Rune")
animateDeadRune:runeId(2316)
animateDeadRune:allowFarUse(true)
animateDeadRune:charges(1)
animateDeadRune:level(27)
animateDeadRune:magicLevel(4)
animateDeadRune:cooldown(2000)
animateDeadRune:groupCooldown(2000)
animateDeadRune:isBlocking(true)
animateDeadRune:register()
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
local avalancheRune = Spell("rune")

function avalancheRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

avalancheRune:group("attack")
avalancheRune:id(115)
avalancheRune:name("Avalanche Rune")
avalancheRune:runeId(2274)
avalancheRune:allowFarUse(true)
avalancheRune:charges(4)
avalancheRune:level(30)
avalancheRune:magicLevel(4)
avalancheRune:cooldown(2000)
avalancheRune:groupCooldown(2000)
avalancheRune:register()
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local condition = Condition(CONDITION_OUTFIT)
condition:setTicks(200000)

function onCastSpell(creature, variant, isHotkey)
local chamaleonRune = Spell("rune")
ramon-bernardo marked this conversation as resolved.
Show resolved Hide resolved

function chamaleonRune.onCastSpell(creature, variant, isHotkey)
local position, item = variant:getPosition()
if position.x == CONTAINER_POSITION then
local container = creature:getContainerById(position.y - 64)
Expand All @@ -25,3 +27,17 @@ function onCastSpell(creature, variant, isHotkey)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
return true
end

chamaleonRune:group("support")
chamaleonRune:id(14)
chamaleonRune:name("Chamaleon Rune")
chamaleonRune:runeId(2291)
chamaleonRune:allowFarUse(true)
chamaleonRune:charges(1)
chamaleonRune:level(27)
chamaleonRune:magicLevel(4)
chamaleonRune:cooldown(2000)
chamaleonRune:groupCooldown(2000)
chamaleonRune:isBlocking(true)
chamaleonRune:isSelfTarget(true)
chamaleonRune:register()
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function onCastSpell(creature, variant, isHotkey)
local convinceCreatureRune = Spell("rune")

function convinceCreatureRune.onCastSpell(creature, variant, isHotkey)
local target = Creature(variant:getNumber())
if not target or not target:isMonster() then
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
Expand Down Expand Up @@ -34,3 +36,17 @@ function onCastSpell(creature, variant, isHotkey)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end

convinceCreatureRune:group("support")
convinceCreatureRune:id(12)
convinceCreatureRune:name("Convince Creature Rune")
convinceCreatureRune:runeId(2290)
convinceCreatureRune:allowFarUse(true)
convinceCreatureRune:charges(1)
convinceCreatureRune:level(16)
convinceCreatureRune:magicLevel(5)
convinceCreatureRune:cooldown(2000)
convinceCreatureRune:groupCooldown(2000)
convinceCreatureRune:needTarget(true)
convinceCreatureRune:isBlocking(true)
convinceCreatureRune:register()
26 changes: 26 additions & 0 deletions data/scripts/runes/cure_poison_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local curePoisonRune = Spell("rune")

function curePoisonRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

curePoisonRune:group("healing")
curePoisonRune:id(31)
curePoisonRune:name("Cure Poison Rune")
curePoisonRune:runeId(2266)
curePoisonRune:allowFarUse(true)
curePoisonRune:charges(1)
curePoisonRune:level(15)
curePoisonRune:magicLevel(0)
curePoisonRune:cooldown(2000)
curePoisonRune:groupCooldown(2000)
curePoisonRune:needTarget(true)
curePoisonRune:isBlocking(true)
curePoisonRune:isAggressive(false)
curePoisonRune:register()
30 changes: 30 additions & 0 deletions data/scripts/runes/destroy_field_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local destroyFieldRune = Spell("rune")

function destroyFieldRune.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
local field = tile and tile:getItemByType(ITEM_TYPE_MAGICFIELD)
if field and table.contains(FIELDS, field:getId()) then
field:remove()
position:sendMagicEffect(CONST_ME_POFF)
return true
end

creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

destroyFieldRune:group("support")
destroyFieldRune:id(30)
destroyFieldRune:name("Destroy Field Rune")
destroyFieldRune:runeId(2261)
destroyFieldRune:allowFarUse(true)
destroyFieldRune:charges(3)
destroyFieldRune:level(17)
destroyFieldRune:magicLevel(3)
destroyFieldRune:cooldown(2000)
destroyFieldRune:groupCooldown(2000)
destroyFieldRune:isAggressive(false)
destroyFieldRune:range(5)
destroyFieldRune:register()
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local corpseIds = {3058, 3059, 3060, 3061, 3064, 3065, 3066}
local removalLimit = 500

function onCastSpell(creature, variant, isHotkey)
local desintegrateRune = Spell("rune")

function desintegrateRune.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
if tile then
Expand All @@ -22,3 +24,16 @@ function onCastSpell(creature, variant, isHotkey)
position:sendMagicEffect(CONST_ME_POFF)
return true
end

desintegrateRune:group("support")
desintegrateRune:id(78)
desintegrateRune:name("Disintegrate Rune")
desintegrateRune:runeId(2278)
desintegrateRune:allowFarUse(true)
desintegrateRune:charges(3)
desintegrateRune:level(21)
desintegrateRune:magicLevel(4)
desintegrateRune:cooldown(2000)
desintegrateRune:groupCooldown(2000)
desintegrateRune:range(5)
desintegrateRune:register()
25 changes: 25 additions & 0 deletions data/scripts/runes/energy_bomb_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_ENERGYFIELD_PVP)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local energyBombRune = Spell("rune")

function energyBombRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

energyBombRune:group("attack")
energyBombRune:id(55)
energyBombRune:name("Energy Bomb Rune")
energyBombRune:runeId(2262)
energyBombRune:allowFarUse(true)
energyBombRune:charges(2)
energyBombRune:level(37)
energyBombRune:magicLevel(10)
energyBombRune:cooldown(2000)
energyBombRune:groupCooldown(2000)
energyBombRune:isBlocking(true)
energyBombRune:register()
24 changes: 24 additions & 0 deletions data/scripts/runes/energy_field_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_ENERGYFIELD_PVP)

local energyFieldRune = Spell("rune")

function energyFieldRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

energyFieldRune:group("attack")
energyFieldRune:id(27)
energyFieldRune:name("Energy Field Rune")
energyFieldRune:runeId(2277)
energyFieldRune:allowFarUse(true)
energyFieldRune:charges(3)
energyFieldRune:level(18)
energyFieldRune:magicLevel(3)
energyFieldRune:cooldown(2000)
energyFieldRune:groupCooldown(2000)
energyFieldRune:isBlocking(true)
energyFieldRune:register()
25 changes: 25 additions & 0 deletions data/scripts/runes/energy_wall_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_ENERGYFIELD_PVP)
combat:setArea(createCombatArea(AREA_WALLFIELD, AREADIAGONAL_WALLFIELD))

local energyWallRune = Spell("rune")

function energyWallRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

energyWallRune:group("attack")
energyWallRune:id(33)
energyWallRune:name("Energy Wall Rune")
energyWallRune:runeId(2279)
energyWallRune:allowFarUse(true)
energyWallRune:charges(4)
energyWallRune:level(41)
energyWallRune:magicLevel(9)
energyWallRune:cooldown(2000)
energyWallRune:groupCooldown(2000)
energyWallRune:isBlocking(true)
energyWallRune:register()
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
local explosionRune = Spell("rune")

function explosionRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

explosionRune:group("attack")
explosionRune:id(18)
explosionRune:name("Explosion Rune")
explosionRune:runeId(2313)
explosionRune:allowFarUse(true)
explosionRune:charges(6)
explosionRune:level(31)
explosionRune:magicLevel(6)
explosionRune:cooldown(2000)
explosionRune:groupCooldown(2000)
explosionRune:isBlocking(true)
explosionRune:register()
24 changes: 24 additions & 0 deletions data/scripts/runes/fire_bomb_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_FIREFIELD_PVP_FULL)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local fireBombRune = Spell("rune")

function fireBombRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

fireBombRune:group("attack")
fireBombRune:id(17)
fireBombRune:name("Fire Bomb Rune")
fireBombRune:runeId(2305)
fireBombRune:allowFarUse(true)
fireBombRune:charges(2)
fireBombRune:level(27)
fireBombRune:magicLevel(5)
fireBombRune:cooldown(2000)
fireBombRune:groupCooldown(2000)
fireBombRune:isBlocking(true)
fireBombRune:register()
23 changes: 23 additions & 0 deletions data/scripts/runes/fire_field_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_FIREFIELD_PVP_FULL)

local fireFieldRune = Spell("rune")

function fireFieldRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

fireFieldRune:group("attack")
fireFieldRune:id(25)
fireFieldRune:name("Fire Field Rune")
fireFieldRune:runeId(2301)
fireFieldRune:allowFarUse(true)
fireFieldRune:charges(3)
fireFieldRune:level(15)
fireFieldRune:magicLevel(1)
fireFieldRune:cooldown(2000)
fireFieldRune:groupCooldown(2000)
fireFieldRune:isBlocking(true)
fireFieldRune:register()
24 changes: 24 additions & 0 deletions data/scripts/runes/fire_wall_rune.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_FIREFIELD_PVP_FULL)
combat:setArea(createCombatArea(AREA_WALLFIELD, AREADIAGONAL_WALLFIELD))

local fireWallRune = Spell("rune")

function fireWallRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

fireWallRune:group("attack")
fireWallRune:id(28)
fireWallRune:name("Fire Wall Rune")
fireWallRune:runeId(2303)
fireWallRune:allowFarUse(true)
fireWallRune:charges(4)
fireWallRune:level(33)
fireWallRune:magicLevel(6)
fireWallRune:cooldown(2000)
fireWallRune:groupCooldown(2000)
fireWallRune:isBlocking(true)
fireWallRune:register()
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
local fireballRune = Spell("rune")

function fireballRune.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

fireballRune:group("attack")
fireballRune:id(15)
fireballRune:name("Fireball Rune")
fireballRune:runeId(2302)
fireballRune:allowFarUse(true)
fireballRune:charges(5)
fireballRune:level(27)
fireballRune:magicLevel(4)
fireballRune:cooldown(2000)
fireballRune:groupCooldown(2000)
fireballRune:needTarget(true)
fireballRune:isBlocking(true)
fireballRune:register()
Loading