• 🏆 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!

Diabolic Edict [JASS]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Easy to implement Diabolic Edict

Saturates the area around Leshrac with magic, causing random explosions to enemies. Lasts 8 seconds.
Level 1 - Slow explosions.
Level 2 - Medium speed explosions.
Level 3 - Larger area, medium speed explosions.
Level 4 - Large area, fast explosions.
How to implement

* Just open object editor and press (ctrl+D) and replace your ability ID in that lines.

return GetSpellAbilityId() == 'A003'
local integer i = GetUnitAbilityLevelSwapped('A003', u)

JASS:
function Trig_Diabolic_Edict_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A003' 
endfunction

function Diabolic_Edict_Group takes nothing returns boolean
    return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true, IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_Diabolic_Edict_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer i = GetUnitAbilityLevelSwapped('A003', u)
    local location l
    local timer t = CreateTimer()
    local unit v
    call StartTimerBJ(t,false, 8)
    loop
        exitwhen TimerGetRemaining(t) <= 0.00
        set l = GetUnitLoc(u)
        set v = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(500.00, l, Condition(function Diabolic_Edict_Group))) 
        call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl", v, "chest" ))
        call UnitDamageTarget( u, v, 12.5*i, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
        call RemoveLocation(l)
        call TriggerSleepAction(.2)
    endloop 
    call DestroyTimer(t)
    set t = null
    set u = null
    set l = null
    set v = null   
endfunction

//===========================================================================
function InitTrig_Diabolic_Edict takes nothing returns nothing
    set gg_trg_Diabolic_Edict = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Diabolic_Edict, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Diabolic_Edict, Condition( function Trig_Diabolic_Edict_Conditions ) )
    call TriggerAddAction( gg_trg_Diabolic_Edict, function Trig_Diabolic_Edict_Actions )
endfunction


Enjoy.

Keywords:
Diabolic, Edict, Diffusal, Master, Spark, Eternity, Yellow, Explosion, Timer, Boucing, Scatter, Magic, Powerful, Leshrac, Malicious, Force, Burn.
Contents

Omnislash (Map)

Reviews
19:52, 5th Oct 2010 busterkomo: Switch from using locations to coordinates. Stop using BJs (GetUnitAbilityLevelSwapped, for example).

Moderator

M

Moderator

19:52, 5th Oct 2010
busterkomo:
  • Switch from using locations to coordinates.
  • Stop using BJs (GetUnitAbilityLevelSwapped, for example).
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Edit: Show me how I can remove the BJs.


JASS:
GetUnitAbilityLevelSwapped('A003', u)
->
JASS:
GetUnitAbilityLevel( u , 'A003')

JASS:
TimerStartBJ()
->
JASS:
StartTimer()

JASS:
GetBooleanAnd
to something like
JASS:
if IsUnitType( t , UNIT_TYPE_ALIVE ) and IsUnitEnemy( t , PLAYER ) then

JASS:
GetUnitsInRangeOfLocMatching
->
JASS:
GroupEnumUnitsInRange()

If you're using JNGP, there's the function list to check out the functions. They're also listed here: http://www.wc3jass.com/viewforum.php?f=20
 
oh crap... you start a timer but then just checks it in a loop that uses wait??? you could have just used a real variable there and then after the wait, reduce the value of that variable...

but I suggest redoing this spell... the waits are bad... youre leaking unit group...

and I dont like the idea that you need to go to the main function to modify things like damage, special effects etc...
 
Level 11
Joined
Oct 19, 2008
Messages
284
JASS:
GetUnitAbilityLevelSwapped('A003', u)
->
JASS:
GetUnitAbilityLevel( u , 'A003')

JASS:
TimerStartBJ()
->
JASS:
StartTimer()

JASS:
GetBooleanAnd
to something like
JASS:
if IsUnitType( t , UNIT_TYPE_ALIVE ) and IsUnitEnemy( t , PLAYER ) then

JASS:
GetUnitsInRangeOfLocMatching
->
JASS:
GroupEnumUnitsInRange()

If you're using JNGP, there's the function list to check out the functions. They're also listed here: http://www.wc3jass.com/viewforum.php?f=20

Thank you. I will study harder to not make the same errors.
 
Top