Skip to content

Commit

Permalink
feat(elysiera): spell modification (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodpjohnston authored and luan committed Jul 27, 2023
1 parent c03d446 commit ab5519f
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 20 deletions.
15 changes: 13 additions & 2 deletions data-otservbr-global/scripts/spells/attack/divine_caldera.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
Expand All @@ -11,9 +13,18 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
local condition = Condition(CONDITION_DAZZLED)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)

local player = creature:getPlayer()

if creature and player then
local dotDmg = -1 * ((player:getLevel() / 5) + (player:getMagicLevel() * 5)) / 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, var)
end

Expand Down
15 changes: 13 additions & 2 deletions data-otservbr-global/scripts/spells/attack/eternal_winter.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))
Expand All @@ -11,9 +13,18 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
local condition = Condition(CONDITION_FREEZING)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)

local player = creature:getPlayer()

if creature and player then
local dotDmg = -1 * ((player:getLevel() / 5) + (player:getMagicLevel() * 9)) / 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, var)
end

Expand Down
24 changes: 18 additions & 6 deletions data-otservbr-global/scripts/spells/attack/groundshaker.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
Expand All @@ -7,16 +9,26 @@ combat:setArea(createCombatArea(AREA_CIRCLE3X3))

function onGetFormulaValues(player, skill, attack, factor)
local level = player:getLevel()
local min = (level / 5) + (skill + attack) * 0.5
local max = (level / 5) + (skill + attack) * 1.1
return -min * 1.28, -max * 1.28 -- TODO : Use New Real Formula instead of an %
local min = (level / 5) + (skill + 2 * attack) * 1.0
local max = (level / 5) + (skill + 2 * attack) * 2.5
return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
local condition = Condition(CONDITION_BLEEDING)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)

local player = creature:getPlayer()
local weaponAttack = ItemType(player:getSlotItem(CONST_SLOT_LEFT)):getAttack()

if creature and player and weaponAttack then
local dotDmg = -1 * ((player:getLevel() / 5) + ((player:getSkillLevel() + 2 * weaponAttack) * 1.8))/ 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, var)
end

Expand All @@ -29,7 +41,7 @@ spell:level(33)
spell:mana(160)
spell:isPremium(true)
spell:needWeapon(true)
spell:cooldown(8 * 1000)
spell:cooldown(16 * 1000)
spell:groupCooldown(2 * 1000)
spell:needLearn(false)
spell:vocation("knight;true", "elite knight;true")
Expand Down
25 changes: 18 additions & 7 deletions data-otservbr-global/scripts/spells/attack/hells_core.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 10)
local max = (level / 5) + (maglevel * 14)
return -min, -max
local min = (level / 5) + (maglevel * 10)
local max = (level / 5) + (maglevel * 14)
return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, variant)
return combat:execute(creature, variant)
local condition = Condition(CONDITION_FIRE)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)

local player = creature:getPlayer()

if creature and player then
local dotDmg = -1 * ((player:getLevel() / 5) + (player:getMagicLevel() * 12)) / 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, variant)
end

spell:group("attack", "focus")
Expand All @@ -30,4 +41,4 @@ spell:cooldown(40 * 1000)
spell:groupCooldown(4 * 1000, 40 * 1000)
spell:needLearn(false)
spell:vocation("sorcerer;true", "master sorcerer;true")
spell:register()
spell:register()
15 changes: 13 additions & 2 deletions data-otservbr-global/scripts/spells/attack/rage_of_the_skies.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
combat:setArea(createCombatArea(AREA_CIRCLE6X6))
Expand All @@ -11,9 +13,18 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
local condition = Condition(CONDITION_ENERGY)
condition:setParameter(CONDITION_PARAM_DELAYED)

local player = creature:getPlayer()

if creature and player then
local dotDmg = -1 * ((player:getLevel() / 5) + (player:getMagicLevel() * 11)) / 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, var)
end

Expand Down
14 changes: 13 additions & 1 deletion data-otservbr-global/scripts/spells/attack/wrath_of_nature.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local spell = Spell("instant")
local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
combat:setArea(createCombatArea(AREA_CIRCLE6X6))
Expand All @@ -11,9 +13,19 @@ end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
local condition = Condition(CONDITION_POISON)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)

local player = creature:getPlayer()

if creature and player then
local dotDmg = -1 * ((player:getLevel() / 5) + (player:getMagicLevel() * 8)) / 10
condition:addDamage(3, 1000, dotDmg/3)
combat:addCondition(condition)
end

return combat:execute(creature, var)
end

Expand Down

0 comments on commit ab5519f

Please sign in to comment.