• 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] Simple Spell erro

Status
Not open for further replies.
Level 4
Joined
Dec 2, 2009
Messages
53
Code not working, but i can't find the error

JASS:
function ArcCod takes nothing returns boolean
    return GetSpellAbilityId()=='ZZZZ'
endfunction

function ArcDam takes nothing returns nothing
local unit Target = GetSpellTargetUnit()
local unit Caster = GetTriggerUnit()
local real d1 = I2R(GetHeroInt(Caster,true)) * 2.5
    call UnitDamageTarget(Caster, Target, d1, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
endfunction

// ------------------------- Init Trigger----------------------------
function InitTrig_Arcane_Blast takes nothing returns nothing
    local trigger t
    set t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition(t, Condition( function ArcCod ) )
    call TriggerAddAction(t, function ArcDam )
endfunction

anyone can help me?
+ rep
 
Try changing the line UnitDamageTarget to this:
JASS:
call UnitDamageTarget(Caster, Target, d1, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
Or "true" "true". But anyway, I remember some people having problems if they did not set the attack boolean to true.

If it still doesn't work, then add a BJDebugMsg("text") to the actions and see if it even runs. If it doesn't, then the condition was most likely not met. (either wrong id input or wrong spell cast, w/e)
 
Level 4
Joined
Dec 2, 2009
Messages
53
Spell still does not work but when I put ID into another spell worked

i think this part have some error

JASS:
 function InitTrig_Arcane_Blast takes nothing returns nothing
    local trigger t
    set t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition(t, Condition( function ArcCod ) )
    call TriggerAddAction(t, function ArcDam )
endfunction
 
Level 4
Joined
Dec 2, 2009
Messages
53
I found the error, Arcane Blast isn't name of my trigger them the trigger InitTrig_Arcane_Blast doesn't run

Thx everybody try help me :ogre_kawaii:
 
Status
Not open for further replies.
Top