• 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] Not sure if this is right for my new spell

Status
Not open for further replies.
Level 6
Joined
Nov 15, 2010
Messages
112
Hey guys, I'm working with my new spell, so i wanna make sure if this is right or not...

The spell is like this;

The caster targets a point and deals damage to enemies at the point, that's mean when the caster cast the spell, he creates a dummy at the point and then the dummy cast a dummy spell to damage the enemies....

Is the code is like this:

JASS:
library DarknessBlaze

    function DarknessBlaze_Conditions takes nothing returns boolean
        return GetSpellAbilityId() == 'A001'
    endfunction    

    globals
        private integer DUMMY = 'h000'
        private integer DUMMY_SPELL = 'A021'
        private string ORDER = "thunderclap"
    endglobals
    
    function DarknessBlaze_Actions takes nothing returns nothing
        local location l = GetSpellTargetLoc
        local unit d
        set d = CreateUnitAtLoc(p, DUMMY, l, 0)
        call UnitAddAbility(d, DUMMY_SPELL)
        call UnitApplyTimedLife(d, 'BTLF', 1.50)
        call IssueImmediateOrder(d, ORDER)
     endfunction
     
endlibrary

PS: My JNGP has errors like his case....
 
Level 6
Joined
Nov 15, 2010
Messages
112
well if you dont know that guy solved his problem in that thread maybe go look at what he did?

which guy???

and i already said that.....
PS: My JNGP has errors like his case....

oh, i forgot to nullify the created unit...
JASS:
library DarknessBlaze

    function DarknessBlaze_Conditions takes nothing returns boolean
        return GetSpellAbilityId() == 'A001'
    endfunction    

    globals
        private integer DUMMY = 'h000'
        private integer DUMMY_SPELL = 'A021'
        private string ORDER = "thunderclap"
    endglobals
    
    function DarknessBlaze_Actions takes nothing returns nothing
        local location l = GetSpellTargetLoc
        local player p = GetTriggerPlayer
        local unit d
        set d = CreateUnitAtLoc(p, DUMMY, l, 0)
        call UnitAddAbility(d, DUMMY_SPELL)
        call UnitApplyTimedLife(d, 'BTLF', 1.50)
        call IssueImmediateOrder(d, ORDER)
        set d = null
     endfunction  
     
endlibrary
 
Status
Not open for further replies.
Top