WolfieeifloW
WEHZ Helper
- Reaction score
- 372
Hey there.
Recently I've got more into structs and methods, but I'm having a bit of trouble.
I've semi-learned about static and non-static structs.
But uhm, I'm wondering how I carry a unit from one method to another:
The whole Conditions method errors:
So, I'm wondering.
How do I get a unit from one method to another?
Recently I've got more into structs and methods, but I'm having a bit of trouble.
I've semi-learned about static and non-static structs.
But uhm, I'm wondering how I carry a unit from one method to another:
JASS:
struct HowlingBlast
unit Caster
unit Target
integer Level
static method Damage takes integer level returns real
return level * 5.
endmethod
static method Radius takes nothing returns real
return 150.
endmethod
static method Conditions takes nothing returns boolean
if (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(.Caster))) then
call Damage_Spell(.Caster, GetFilterUnit(), Damage(.Level) / 2)
endif
return false
endmethod
static method onCast takes nothing returns boolean
local thistype this = thistype.create()
set .Caster = GetTriggerUnit()
set .Target = GetSpellTargetUnit()
set .Level = GetUnitAbilityLevel(.Caster, HOWLING_BLAST)
call Damage_Spell(.Caster, .Target, thistype.Damage(.Level))
call GroupEnumUnitsInRange(GROUP, GetUnitX(.Target), GetUnitY(.Target), thistype.Radius, Filter(function thistype.Conditions))
return false
endmethod
static method onInit takes nothing returns nothing
call TriggerAddCondition(GT_RegisterStartsEffectEvent(CreateTrigger(), HOWLING_BLAST), Condition(function thistype.onCast))
endmethod
endstruct
The whole Conditions method errors:
Undeclared variable this
So, I'm wondering.
How do I get a unit from one method to another?