forked from otland/forgottenserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Breakable mana shield (otland#3848)
Co-authored-by: Evil Puncker <[email protected]> Co-authored-by: Sarah Wesker <[email protected]> Co-authored-by: Łukasz Zbiżek <[email protected]> Co-authored-by: AKnopik PC <[email protected]> Co-authored-by: Ramon Bernardo <[email protected]>
- Loading branch information
1 parent
c287a65
commit 87ca1d6
Showing
20 changed files
with
328 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
if configManager.getBoolean(configKeys.MANASHIELD_BREAKABLE) then | ||
local combat = Combat() | ||
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) | ||
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) | ||
|
||
local cancelMagicShield = Spell(SPELL_INSTANT) | ||
|
||
function cancelMagicShield.onCastSpell(creature, var) | ||
creature:removeCondition(CONDITION_MANASHIELD_BREAKABLE) | ||
return combat:execute(creature, var) | ||
end | ||
|
||
cancelMagicShield:name("Cancel Magic Shield") | ||
cancelMagicShield:id(44) | ||
cancelMagicShield:words("exana vita") | ||
cancelMagicShield:level(14) | ||
cancelMagicShield:mana(50) | ||
cancelMagicShield:group("support") | ||
cancelMagicShield:isAggressive(false) | ||
cancelMagicShield:isSelfTarget(true) | ||
cancelMagicShield:cooldown(2000) | ||
cancelMagicShield:groupCooldown(2000) | ||
cancelMagicShield:needLearn(false) | ||
cancelMagicShield:vocation("druid;true", "elder druid;true", "sorcerer;true", "master sorcerer;true") | ||
cancelMagicShield:register() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-- Old mana shield | ||
local combat = Combat() | ||
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) | ||
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) | ||
|
||
local condition = Condition(CONDITION_MANASHIELD) | ||
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 1000) | ||
combat:addCondition(condition) | ||
|
||
-- New mana shield | ||
local combatBreakableManaShield = Combat() | ||
combatBreakableManaShield:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) | ||
combatBreakableManaShield:setParameter(COMBAT_PARAM_AGGRESSIVE, false) | ||
|
||
local conditionBreakableManaShield = Condition(CONDITION_MANASHIELD_BREAKABLE) | ||
conditionBreakableManaShield:setParameter(CONDITION_PARAM_TICKS, 60 * 1000) | ||
|
||
local magicShield = Spell(SPELL_INSTANT) | ||
|
||
function magicShield.onCastSpell(creature, variant) | ||
if configManager.getBoolean(configKeys.MANASHIELD_BREAKABLE) then | ||
local player = creature:getPlayer() | ||
if player then | ||
conditionBreakableManaShield:setParameter(CONDITION_PARAM_MANASHIELD_BREAKABLE, math.min(player:getMaxMana(), 300 + 7.6 * player:getLevel() + 7 * player:getMagicLevel())) | ||
player:addCondition(conditionBreakableManaShield) | ||
return combatBreakableManaShield:execute(creature, variant) | ||
end | ||
end | ||
return combat:execute(creature, variant) | ||
end | ||
|
||
magicShield:name("Magic Shield") | ||
magicShield:id(44) | ||
magicShield:words("utamo vita") | ||
magicShield:level(14) | ||
magicShield:mana(50) | ||
magicShield:group("support") | ||
magicShield:isAggressive(false) | ||
magicShield:isSelfTarget(true) | ||
if configManager.getBoolean(configKeys.MANASHIELD_BREAKABLE) then | ||
magicShield:cooldown(14000) | ||
else | ||
magicShield:cooldown(2000) | ||
end | ||
magicShield:groupCooldown(2000) | ||
magicShield:needLearn(false) | ||
magicShield:vocation("druid;true", "elder druid;true", "sorcerer;true", "master sorcerer;true") | ||
magicShield:register() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.