• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spear of Ragnarok v1.4

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
The spear is the item of armageddon, doomsday, the apocolypse. This is that item, but less powerful to be balanced somewhat.

The unit casts the spell and instantly an explosion is formed on target point dealing 25% max hp to affected units. Five rings move outward from the targeted point and deal 1% max hp to all nearby units, the damage stacks if the unit is close enough to more of the ring. The Spell's range is 875, max affected range however is 100 more for the rings. The closer you are to the middle the more damage a unit'll suffer. Works on buildings.

For use: Make two global variables (unit udg_Unit, player udg_Player) then copy the spell in object editor, then the item, then the dummy unit and finaly the trigger. The spell is based off channel and has not had it's order string changed.

JASS:
function Trig_Spear_Conditions takes nothing returns boolean
    return GetSpellAbilityId()=='A000'
endfunction
function Trig_Spear_Filter takes nothing returns boolean
    local unit u=GetFilterUnit()
    return IsUnitEnemy(u,udg_Player)==true and GetUnitState(u,UNIT_STATE_LIFE)>0
endfunction
function Trig_Spear_BigDamage takes nothing returns nothing
    local unit u=GetEnumUnit()
    call UnitDamageTarget(udg_Unit,u,GetUnitState(u,UNIT_STATE_MAX_LIFE)*.25,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
function Trig_Spear_Damage takes nothing returns nothing
    local unit u=GetEnumUnit()
    call UnitDamageTarget(udg_Unit,u,GetUnitState(u,UNIT_STATE_MAX_LIFE)*.01,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
function Trig_Spear_Actions takes nothing returns nothing
    local real array Cord
    local unit U=GetSpellAbilityUnit()
    local player P=GetOwningPlayer(U)
    local integer i=1
    local integer I
    local unit u
    local group g=CreateGroup()
    set Cord[0]=GetLocationX(GetSpellTargetLoc())
    set Cord[1]=GetLocationY(GetSpellTargetLoc())
    //This is the explosion at the epicenter, it's made and is killed 1.5 seconds later then at end of spell is removed.
    set u=CreateUnit(P,'h000',Cord[0],Cord[1],0)
    call UnitApplyTimedLife(u,'BTLF',1.5)
    set udg_Unit=U//These globals pass the owning player and casting unit to check
    set udg_Player=P//if the picked unit is an enemy and if so the casting unit deals damage to it.
    call GroupEnumUnitsInRange(g,Cord[0],Cord[1],875,Condition(function Trig_Spear_Filter))
    call ForGroup(g,function Trig_Spear_BigDamage)//Deals 25% of max unit's hp.
    call GroupClear(g)
    loop//This loop controls how many steps outward the rings move
        exitwhen i>14
        set I=1
        loop//This loop controls the angle for each part of each ring.
            exitwhen I>60
            set Cord[4]=2.5
            loop//This loop places a peice of all the rings. (2.5,17.5,32.5,47.5,62.5). So five rings. at that distance times i.
                exitwhen Cord[4]>62.5
                set udg_Unit=U
                set udg_Player=P
                set Cord[2]=Cord[0]+Cord[4]*i*Cos(6*I*.01745)
                set Cord[3]=Cord[1]+Cord[4]*i*Sin(6*I*.01745)
                call GroupEnumUnitsInRange(g,Cord[2],Cord[3],100,Condition(function Trig_Spear_Filter))
                call ForGroup(g,function Trig_Spear_Damage)//Deals 1% of max unit's hp.
                call GroupClear(g)
                call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdl",Cord[2],Cord[3]))
                set Cord[4]=Cord[4]+15
            endloop
            set I=I+1
        endloop
        call TriggerSleepAction(0.01)
        set i=i+1
    endloop
    call RemoveUnit(u)
endfunction
function InitTrig_Spear takes nothing returns nothing
    set gg_trg_Spear=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Spear,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Spear,Condition(function Trig_Spear_Conditions))
    call TriggerAddAction(gg_trg_Spear,function Trig_Spear_Actions)
endfunction

Please give credit if you use.
Also let me know if any errors are found (besides lag if you spam the spell).
Also, any improvments that could be made tell me.

1.0: Uploaded spell.
1.1: Removed BJs, locations, and leaks.
1.2: Changed unit creation method for explosion.
1.3: Changed code to do group functions differently.
1.4: Removed all locations.


Keywords:
Ragnarok, Spear, Zeatherann, Apocolypse, Dooms Day, Doom, Armageddon, Boom, Explosion, Ring, Ripple.
Contents

Just another Warcraft III map (Map)

Reviews
09:19, 11th Jun 2010 TriggerHappy: Leaks. Locations. No configurables. Don't submit your first jass spells.

Moderator

M

Moderator

09:19, 11th Jun 2010
TriggerHappy:

Leaks.
Locations.
No configurables.

Don't submit your first jass spells.
 
Thanks people! Few things to say;
1: The effects are removed.
2: I will fix it to use less BJs (may need help on some)
3: Will remove locations and clean leaks, guess coding at midnight not's good.
4: How do i get same effect without a wait?
5: Fast rejection lol.

Edit: If i never post my first spell (this is not my first) then how will i learn to make it better huh? You all were quick to pounce on my, as far as i can tell this spell doesn't mess anything up and works, aside from not removing locs after.
 
Level 31
Joined
May 3, 2008
Messages
3,155
If i never post my first spell (this is not my first) then how will i learn to make it better huh? You all were quick to pounce on my, as far as i can tell this spell doesn't mess anything up and works, aside from not removing locs after.

No offense, but you sounds too stupid by making this statement (Mark in red) cause

1) We got tutorial sections.
2) We got trigger & script section for you to get feedback for any errors.
3) This section only reserves for complete work, with minimal error (0 error is better and you should have known it by the way the rules describe it.)
 
Level 12
Joined
Dec 10, 2008
Messages
850
You could still do better when you create the initial unit (I do believe its the SFX dummy, I cant check that). Use CreateUnit(?) as it takes x,y and not a location. They way your doing it is iniffiecent and a waste of time by converting x,y to a location, when you an just get the x,y and pass them.

And it would be much faster if you just got the spells x,y location in the locals block and then use them to pass the units spot. it saves you 2 lines of code and slims down on typing out code.

Theres more things, but those 2 stood out to me.
 
Top