WolfieeifloW
WEHZ Helper
- Reaction score
- 372
I wasn't sure about that part.
You can change that part back to using a location instead of X/Y and then try it.
You can change that part back to using a location instead of X/Y and then try it.
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
// Configurables:
constant function HL_Ability_Id takes nothing returns integer
return 039;A001039; // Raw code of the ability.
endfunction
constant function HL_Dummy_Id takes nothing returns integer
return 039;h000039; // Raw code of the dummy unit.
endfunction
constant function HL_Min_Dist takes nothing returns real
return 250.00 // Minimum random distance for the effects.
endfunction
constant function HL_Max_Dist takes nothing returns real
return 550.00 // Maximum random distance for the effects.
endfunction
function HL_Radius takes integer level returns real
return 100.00 * level // Radius for damaging / healing units.
endfunction
function HL_Strikes takes integer level returns integer
local integer array i
set i[1] = 8
set i[2] = 10
set i[3] = 12
set i[4] = 13
set i[5] = 15
set i[6] = 17
set i[7] = 18
set i[8] = 20
set i[9] = 24
set i[10] = 30
return i[level] // Number of strikes per level.
endfunction
function HL_Damage_Heal takes integer level returns integer
local integer array dh
set dh[1] = 30
set dh[2] = 60
set dh[3] = 130
set dh[4] = 200
set dh[5] = 375
set dh[6] = 560
set dh[7] = 1250
set dh[8] = 4675
set dh[9] = 6780
set dh[10] = 8000
return dh[level] // Damage dealt / hitpoints healed, per level.
endfunction
// End of configurables.
//===========================================================================
function HL_Conditions takes nothing returns boolean
return GetSpellAbilityId() == HL_Ability_Id()
endfunction
//===========================================================================
function HL_Filter_Units takes nothing returns boolean
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
endfunction
//===========================================================================
function HL_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real xx = 0.00
local real yy = 0.00
local integer i = 0
local integer level = GetUnitAbilityLevel(caster,HL_Ability_Id())
local group g = CreateGroup()
local unit dummy = null
local unit u = null
call TriggerSleepAction(0.40)
loop
exitwhen i > HL_Strikes(level)
set xx = x + GetRandomReal(HL_Min_Dist(),HL_Max_Dist()) * Cos(GetRandomReal(0.00,360.00) * bj_DEGTORAD)
set yy = y + GetRandomReal(HL_Min_Dist(),HL_Max_Dist()) * Sin(GetRandomReal(0.00,360.00) * bj_DEGTORAD)
set dummy = CreateUnit(GetOwningPlayer(caster),HL_Dummy_Id(),xx,yy,0.00)
call UnitApplyTimedLife(dummy,039;BTLF039;,1.00)
call PauseUnit(dummy,true)
call TriggerSleepAction(0.20)
call GroupEnumUnitsInRange(g,xx,yy,HL_Radius(level),Filter(function HL_Filter_Units))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
if GetOwningPlayer(u) == GetOwningPlayer(caster) then
call SetWidgetLife(u,GetWidgetLife(u) + HL_Damage_Heal(level))
else
call UnitDamageTarget(caster,u,HL_Damage_Heal(level),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
endif
endloop
set i = i + 1
endloop
call GroupClear(g)
call DestroyGroup(g)
set g = null
set caster = null
set dummy = null
set u = null
endfunction
//===========================================================================
function HL_True_Filter takes nothing returns boolean
return true
endfunction
//===========================================================================
function InitTrig_Holy_Light takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT,Filter(function HL_True_Filter))
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t,Condition(function HL_Conditions))
call TriggerAddAction(t,function HL_Actions)
endfunction
> Well, were would I search? Hive, wc3campaigns? Posting screenshot on the first page and I actually learned more jass fro
Hrmmm. If you re-read carefully what I meant is that I'm quite surprised you found no JASS tutorials here on TheHelper.
There are plenty. http://world-editor-tutorials.thehelper.net/cat_usersubmit.php under JASS.
call RemoveLocation( p1 )
call RemoveLocation( p2 )
call DestroyGroup( unitgroup )
set unitgroup = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevel(Caster, 039;A001039;)) * 100.00 ), p2)
You are just repeating the BJ's code... it's not going to make a big difference, other than to annoy you for having to type excessive code. The BJ already covers neutrals, as far as I remember (90% sure that bj_MAX_PLAYER_SLOTS == 16). Removing the BJ line, and replacing it with the code that the BJ contains won't actually change the functionality in any way...How is that useless ?
What if someone wants a neutral to cast the spell?
If the spell doesn't have that it won't work.