• 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] Need Help with Item Ability

Status
Not open for further replies.
Level 3
Joined
Apr 7, 2007
Messages
48
I have an item that does three different things depending on what you target with it, however I do not know how to get these targets in JASS. I've looked through a lot of functions but cannot seem to find any that work.

It can target the ground, the caster of the item, or any other units.

If this is impossible can someone suggest a roundabout way of doing this, thanks.
 
Level 3
Joined
Apr 7, 2007
Messages
48
Yeh that worked I think . . . now the abilites are acting all funny. The first one (point target) works fine but the other two, a lightningshield and a fan of knives, don't work at all.
JASS:
function Trig_Raging_Flame_Conditions takes nothing returns boolean
    return ( GetSpellAbilityId() == 'A008' ) 
endfunction

function Trig_Raging_Flame_Actions takes nothing returns nothing
    local location p
    local unit u
    if (GetSpellTargetUnit() == null) then
        set p = GetSpellTargetLoc()
        set u = CreateUnitAtLoc(Player(3),'h002',p,bj_UNIT_FACING)
        call UnitApplyTimedLife(u,'BTLF',4.0)
        call UnitAddAbility(u,'A009')
        call IssueImmediateOrder(u,"stomp")
        call AddSpecialEffectLoc("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl",p)
        call DestroyEffect(GetLastCreatedEffectBJ())
    else
    endif
    if ( GetTriggerUnit() == GetSpellTargetUnit()) then
        set p = GetUnitLoc(GetTriggerUnit())
        set u = CreateUnitAtLoc(Player(3),'h002',p,bj_UNIT_FACING)
        call UnitApplyTimedLife(u,'BTLF',4.0)
        call UnitAddAbility(u,'A007')
        call IssueImmediateOrder(u,"fanofknives")
    else
        if (not(GetSpellTargetUnit() == null)) then
            set p = GetUnitLoc(GetSpellTargetUnit())
            set u = CreateUnitAtLoc(Player(3),'h002',p,bj_UNIT_FACING)
            call UnitApplyTimedLife(u,'BTLF',4.0)
            call UnitAddAbility(u,'A00A')
            call IssueTargetOrder(u,"lightningshield",GetSpellTargetUnit())
        else
        endif
    endif
    call RemoveLocation(p)
endfunction

//===========================================================================
function InitTrig_Raging_Flame takes nothing returns nothing
    set gg_trg_Raging_Flame = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Raging_Flame, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Raging_Flame, Condition( function Trig_Raging_Flame_Conditions ) )
    call TriggerAddAction( gg_trg_Raging_Flame, function Trig_Raging_Flame_Actions )
endfunction
 
Status
Not open for further replies.
Top