• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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