• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] How hard is it to make a AoE Spell?

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
So i have a spell called Raging Howl which decreases health regen (easy part, just spell effect) and i want it to do 2 times Strength (of caster ofcourse) in damage. I made it in GUI and it worked fine, but i stepped to JASS and tried to make it in JASS.

This is what i got:

JASS:
function Trig_Raging_Howl_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00M' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Raging_Howl_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local group g = CreateGroup()
    local unit u
    call GetUnitsInRangeOfLocAll (500, GetUnitLoc (caster) )
    loop
        set u = FirstOfGroup ( g )
        exitwhen u == null        
        if IsUnitEnemy(u, GetOwningPlayer(caster)) then
            return false
        endif
        return true
        call UnitDamageTargetBJ(caster, u, ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, true)) * 2.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )  
        call  GroupRemoveUnit (g , u )
                                                                                                                                           
    endloop
endfunction

//===========================================================================
function InitTrig_Raging_Howl takes nothing returns nothing
    set gg_trg_Raging_Howl = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Raging_Howl, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Raging_Howl, Condition( function Trig_Raging_Howl_Conditions ) )
    call TriggerAddAction( gg_trg_Raging_Howl, function Trig_Raging_Howl_Actions )
endfunction

But when i test the spell nothing happens..

Can someone please help me?

Thanks in advance,
Quetzalcotl
 
Last edited by a moderator:
Level 12
Joined
Apr 27, 2008
Messages
1,228
What Poot means:
JASS:
local unit caster = GetTriggerUnit()
    local group g = CreateGroup()
    local unit u
    call GetUnitsInRangeOfLocAll (500, GetUnitLoc (caster) )
Should be:
JASS:
local unit caster = GetTriggerUnit()
    local group g = GetUnitsInRangeOfLocAll (500, GetUnitLoc (caster) )
    local unit u
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
That too ;)
JASS:
function Trig_Raging_Howl_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local group g = GetUnitsInRangeOfLocAll (500, GetUnitLoc (caster) )
    local unit u
    loop
        set u = FirstOfGroup ( g )
        exitwhen u == null
        if IsUnitEnemy(u, GetOwningPlayer(caster)) then
        call UnitDamageTargetBJ(caster, u, ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, caster, true)) * 2.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
        endif
        call GroupRemoveUnit (g , u )
    endloop
endfunction
 
Status
Not open for further replies.
Top