-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStruct Spell Holy Will.j
More file actions
executable file
·45 lines (38 loc) · 1.97 KB
/
Copy pathStruct Spell Holy Will.j
File metadata and controls
executable file
·45 lines (38 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/// Cleric
library StructSpellsSpellHolyWill requires Asl, StructGameClasses, StructGameSpell
/// Die ausgewählte Einheit absorbiert 10 Sekunden lang 95% des ihr zugefügten Schadens. 5 Minuten Abklingzeit.
struct SpellHolyWill extends Spell
public static constant integer abilityId = 'A08D'
public static constant integer favouriteAbilityId = 'A08E'
public static constant integer classSelectionAbilityId = 'A1LJ'
public static constant integer classSelectionGrimoireAbilityId = 'A1LK'
public static constant integer maxLevel = 1
private static constant integer time = 10
private static constant integer percentage = 95
private static method onDamageAction takes DamageProtector damageProtector returns nothing
call Spell.showDamageAbsorbationTextTag(damageProtector.target(), damageProtector.lastPreventedDamage())
endmethod
public stub method onCastAction takes nothing returns nothing
local DamageProtector damageProtector = DamageProtector.create(GetSpellTargetUnit())
local effect targetEffect = AddSpellEffectTargetById(thistype.abilityId, EFFECT_TYPE_TARGET, GetSpellTargetUnit(), "origin")
local integer i
call damageProtector.setProtectedDamagePercentage(thistype.percentage)
call damageProtector.setOnDamageAction(thistype.onDamageAction)
set i = thistype.time
loop
exitwhen (AUnitSpell.allyTargetLoopCondition(GetSpellTargetUnit()) or i == 0)
call TriggerSleepAction(1.0)
set i = i - 1
endloop
call damageProtector.destroy()
call DestroyEffect(targetEffect)
set targetEffect = null
endmethod
public static method create takes Character character returns thistype
local thistype this = thistype.allocate(character, Classes.cleric(), thistype.spellTypeUltimate1, thistype.maxLevel, thistype.abilityId, thistype.favouriteAbilityId, 0, 0, 0)
call this.addGrimoireEntry('A1LJ', 'A1LK')
call this.addGrimoireEntry('A0PJ', 'A0PK')
return this
endmethod
endstruct
endlibrary