Spell Nontarget OmniSlash

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Omni Slash - Nontarget​

MUI: Yes
JESP: Yes
Comments/Implement Inst: Yes
Easily Editable: Yes
Import Difficulty: 2/10
Awesome Level: 2/1

WC3ScrnShot_052707_130905_02.jpg


JASS:
scope OmniSlash initializer Init
//Config Header
globals
    private constant integer SpellID = 'A001' //This is the spell code, replace this with your spell's ID.
    private constant real Damage = 50.00 //This is the base amount of damage done to the target.
    private constant real Pause = 0.32 //This is the duration of the pause before the hero teleports again.
    private constant real LockOn = 700.00 //This is the range in which the hero will acquire a target.
    private constant string Anim = "slam" //This is the animation that will be used each time the hero teleports.
endglobals
//At the bottom of this trigger there are a few more things you can customize.
//EndConfigHeader

globals
    private string array Effects
    private integer array AbilLvl
endglobals

private function Living takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0
endfunction

private function OSC takes nothing returns boolean
    return GetSpellAbilityId() == SpellID
endfunction

private function OSA takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target
    
    local integer loopd = 0
    local integer splvl = GetUnitAbilityLevel(caster, SpellID)
    
    local location tarloc
    local location casloc
    local location temp
    
    local group randtarget = CreateGroup()
    
    call PauseUnit(caster, true)
    call SetUnitInvulnerable(caster, true)
    
    loop
    exitwhen loopd == AbilLvl[GetUnitAbilityLevel(caster, SpellID)]
        set casloc = GetUnitLoc(caster)
        
        call GroupEnumUnitsInRangeOfLoc(randtarget, casloc, LockOn, Condition(function Living))
        set target = FirstOfGroup(randtarget) //This picks the unit to attack.
        
        if (target == null) then
            call RemoveLocation(casloc) //Stops the spell if there are no targets around.
            call GroupClear(randtarget)
        endif
        exitwhen target == null
        
        set tarloc = GetUnitLoc(target)
        set temp = PolarProjectionBJ(tarloc, 0.00, GetRandomInt(1, 360))
        
        call SetUnitPositionLoc(caster, temp) //Sets the unit position.
        call SetUnitFacing(caster, AngleBetweenPoints(temp, tarloc)) //Makes the caster face the target.
        call SetUnitAnimation( caster, Anim ) //This is just the attack animation
        call DestroyEffect(AddSpecialEffectTarget(Effects[GetRandomInt(1, 6)], caster, "origin")) //Effect shown on the caster at teleport.
        call DestroyEffect(AddSpecialEffectTarget(Effects[GetRandomInt(1, 6)], target, "origin")) //Effect shown on the target.
        call UnitDamageTarget(caster, target, splvl*Damage, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNKNOWN, WEAPON_TYPE_WHOKNOWS) //This is what does the damage.
        
        call RemoveLocation(casloc)
        call RemoveLocation(tarloc)
        call RemoveLocation(temp)
        call GroupClear(randtarget)
        call PW(Pause)
        set loopd = loopd + 1
    endloop
    
    call PauseUnit(caster, false)
    call SetUnitInvulnerable(caster, false)
    call DestroyGroup(randtarget)
    
    set caster = null
    set target = null
    set temp = null
    set casloc = null
    set tarloc = null
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    
    set Effects[1] = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdx" //Model 1 to be displayed.
    set Effects[2] = "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdx" //Model 2 to be displayed.
    set Effects[3] = "Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdx" //Model 3 to be displayed.
    set Effects[4] = "Abilities\\Spells\\Demon\\ReviveDemon\\ReviveDemon.mdx" //Model 4 to be displayed.
    set Effects[5] = "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdx" //Model 5 to be displayed.
    set Effects[6] = "Abilities\\Spells\\Human\\Resurrect\\Resurrecttarget.mdx" //Model 6 to be displayed.
    set AbilLvl[1] = 3 //Number of units level one of the spell hits.
    set AbilLvl[2] = 5 //Number of units level two of the spell hits.
    set AbilLvl[3] = 8 //Number of units level three of the spell hits.
    
    loop
    exitwhen i > 15
        call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
        set i = i + 1
    endloop
    
    call TriggerAddCondition(t, Condition( function OSC))
    call TriggerAddAction(t, function OSA)
endfunction

endscope


Code:
Change Log:
1.00 - Released.
1.1 - Code Improved.
1.15 - Accepted.
1.2 - Added Dummies that have a 1 Jump OmniSlash.
1.4 - Implemented Constants.
2.0 - Upgraded to work with globals. Code Improvements. Dummys have been removed. Constants cycled out.
2.2 - Code has been improved. Added new implementation instructions. Cleaned up some useless object data. Updated the tooltip.
2.3 - More errors cleaned out. Got rid of the "Double Free" bug.
3.0 - Further updated code, improved a lot of things.
 

Attachments

  • Omni Slash.w3x
    37.7 KB · Views: 539

elmstfreddie

The Finglonger
Reaction score
203
No time to actually look at it, but I scrolled over the text and noticed something:
a) no constants
b) You said "MUI: I have a wait of about 0.32 seconds, I don't think so.", well you use only locals so that doesn't matter. It is.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> Numb Encore - Lincoln Park & Jay-Z

Linkin Park. ;)

Code:
Trig_Untitled_Trigger_001_Conditions
Trig_Untitled_Trigger_001_Actions  
deadnoallyno
rm

This is not JESP, sorry, re-read it's rules.

JASS:


A BJ, just check unit's life.

JASS:
 if ( GetUnitAbilityLevelSwapped('A000', caster) == 1 ) then


Why use this useless BJ? Remove Swapped in the function's name and swtich between the arguements' locations. (Goes to the 2 other if / then / else as well)

JASS:

else
        if


There a function call elseif

JASS:
elseif condition then


Pause caster before the loop, why pasue it 8 times when you can do it only once?

JASS:
set target = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(700.00, casloc, Condition(function deadnoallyno)))


Big leak my friend, you crete an undestroyed group.

JASS:
        
set eff1 = AddSpecialEffectTarget(modl, caster, "origin")
set eff2 = AddSpecialEffectTarget(modl, target, "origin")

... 

call DestroyEffect(eff1)
call DestroyEffect(eff2)


You can just do:

JASS:

call DestroyEffect(AddSpecialEffectTarget(modl, caster, "origin"))
call DestroyEffect(AddSpecialEffectTarget(modl, target, "origin"))


Destroy locations inside the loop.

Nice spell, just fix the notes above...
 

Sim

Forum Administrator
Staff member
Reaction score
534
Upload the map here, on this site.

> MUI: I have a wait of about 0.32 seconds, I don't think so.
> JESP: Yup

That's contradictory. A JESP spell needs to be MUI.

Your wait lasts 0.32 seconds times the number of slashes, which is way longer than just 0.32 seconds :p

Anyways, your spell is MUI so it's fine.

P.S. Shiny, not shiny. What's the difference? Make only 1 spell please :)
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
> Numb Encore - Lincoln Park & Jay-Z

Linkin Park. ;)

Code:
Trig_Untitled_Trigger_001_Conditions
Trig_Untitled_Trigger_001_Actions  
deadnoallyno
rm

This is not JESP, sorry, re-read it's rules.

JASS:


A BJ, just check unit's life.

JASS:
 if ( GetUnitAbilityLevelSwapped('A000', caster) == 1 ) then


Why use this useless BJ? Remove Swapped in the function's name and swtich between the arguements' locations. (Goes to the 2 other if / then / else as well)

JASS:
else
        if


There a function call elseif

JASS:
elseif condition then


Pause caster before the loop, why pasue it 8 times when you can do it only once?

JASS:
set target = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(700.00, casloc, Condition(function deadnoallyno)))


Big leak my friend, you crete an undestroyed group.

JASS:
set eff1 = AddSpecialEffectTarget(modl, caster, "origin")
set eff2 = AddSpecialEffectTarget(modl, target, "origin")

... 

call DestroyEffect(eff1)
call DestroyEffect(eff2)


You can just do:

JASS:
call DestroyEffect(AddSpecialEffectTarget(modl, caster, "origin"))
call DestroyEffect(AddSpecialEffectTarget(modl, target, "origin"))


Destroy locations inside the loop.

Nice spell, just fix the notes above...
Done

Upload the map here, on this site.

> MUI: I have a wait of about 0.32 seconds, I don't think so.
> JESP: Yup

That's contradictory. A JESP spell needs to be MUI.

Your wait lasts 0.32 seconds times the number of slashes, which is way longer than just 0.32 seconds :p

Anyways, your spell is MUI so it's fine.

P.S. Shiny, not shiny. What's the difference? Make only 1 spell please :)

Shiny is for people with faster computers as there is a load of effects I threw in for fun.

@Joker(Div)
I can recode it with constants.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
They all have to be constants to comply with the JESP standard.
 

elmstfreddie

The Finglonger
Reaction score
203
Ah, okay, thanks Daxtreme.
I guess I never saw that since I NEVER go into the spells forum xD

>Shiny is for people with faster computers as there is a load of effects I threw in for fun.
Uhh a part of JESP is to be easily able to edit the effects of the spell, so really it's not required to have a shiny and non shiny version ;)
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
No, shiny version has terran effects, not spell related.
non shiny is just some plain dirt =/
 

Sim

Forum Administrator
Staff member
Reaction score
534
Then your official spell map is the not-shiny one, and upload it as an attachment.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Hence the song, its over 3mb.
Removing song for a totally non shiny version, adding on in a min or 2.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, there are already 2 other omni-slash spells in the section.

Even if yours is different again, it would be a bit redundant to have 3 in there.

Also, that camera lock is bad. Remove it, doesn't fit in a spell imo :p
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Okay
Fixed up the trigger some.
Updated the uploaded file.
Bump
2Qs
1. Could you change the title from [JESP] to [Spell] because it seems my spell isin't JESP.
2. Could you delete my omni slash tutorial?
 

Sim

Forum Administrator
Staff member
Reaction score
534
Approved.

> 1. Could you change the title from [JESP] to [Spell] because it seems my spell isin't JESP.

Done.

> 2. Could you delete my omni slash tutorial?

Just because you made this spell? It can still help people.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
I needa redue it actually.
Could you change the "Simplified" in that to nontarget?
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well then just refer people to this spell :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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

      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