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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top