Spell Holy Light

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.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
How is that useless :confused: ?
What if someone wants a neutral to cast the spell?
If the spell doesn't have that it won't work.
 

D.V.D

Make a wish
Reaction score
73
Nothing changed. The spell makes a line instead of random points. Haven't tried without X/Y's yet but I will soon.
 

D.V.D

Make a wish
Reaction score
73
I think so too because there units are placed wrong and the places they're placed are made according to the X/Y's.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> I don't have a GUI version of this. I just used GUI functions beccause there aren't any good tutorials.

If you mean tutorials on JASS well then I can't tell where you are searching, because that's certainly not here. :rolleyes:

Better GUI than converted GUI into JASS.

Here's a screenshot of your spell. It is required so I made it for you. :)

holylight.jpg
 

D.V.D

Make a wish
Reaction score
73
Thanks for the screenshot. Well, were would I search? Hive, wc3campaigns? Posting screenshot on the first page and I actually learned more jass from posting this spell from Wolfenotic. :)
 

Kenny

Back for now.
Reaction score
202
Thought I'd just expand on what Wolfie has already done:

JASS:
// Configurables:
constant function HL_Ability_Id takes nothing returns integer
    return 'A001' // Raw code of the ability.
endfunction

constant function HL_Dummy_Id takes nothing returns integer
    return 'h000' // 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,'BTLF',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


Its free-hand so I'm not 100% sure it will work, but it should.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Ahh yes.
So used to globals (with NewGen) just didn't bother putting them in since this is normal JASS :p .
 

D.V.D

Make a wish
Reaction score
73
> 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.

I looked at those. There all introduction and just explain what jass is but they all still use BJ's or they use natives for functions not used in spell making triggers.

Daxtreme, I don't want to go into vJass because I use the new patch and I can't enable anything in Girimoire with the patch or, the triggers will be disabeld :(. Thanks for helping anyways. You guys just need to tell me why put // for the player controller check conditions? Whats the difference?
 

Flare

Stops copies me!
Reaction score
662
First of all, yellow text in first post - please remove it, it's difficult to read

(Assuming that code in first post is up-to-date)
JASS:
    call RemoveLocation( p1 )
    call RemoveLocation( p2 )
    call DestroyGroup( unitgroup )

Those locations must be destroyed within the integer loop. Let's say you are at level 10 - loop runs 24 times, but you only remove those points and group once. That's 46 locations, 23 groups per spell instance floating around, being useless, leaking.

JASS:
set unitgroup = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevel(Caster, 'A001')) * 100.00 ), p2)

I'm fairly sure that GetUnitsInRangeOfLocAll leaks a boolexpr - use natives (i.e. GroupEnumUnitsInRange) and a filter function to avoid the leak.

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.
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...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top