• 🏆 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!

[JASS] Check this one :D

Status
Not open for further replies.
Level 6
Joined
Aug 1, 2009
Messages
159
Hi, since I was able to some basic spells, I would like to ask why this wont work? I was reading the Grenade Tutorial and followed the MUI JASS thing near the ending of the tutorial, this is what I got:

JASS:
function Trig_Throw_Start_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_Throw_Start_Func003001 takes nothing returns boolean
    local unit Target = GetSpellTargetUnit()
    return ( UnitHasBuffBJ(Target, 'B000') == true )
endfunction

function Trig_Throw_Start_Actions takes nothing returns nothing
    local unit Caster = GetTriggerUnit()
    local unit DummyUnit
    local unit Target = GetSpellTargetUnit()
    local location TargetLoc = GetUnitLoc(Target)
    loop
        exitwhen ( Trig_Throw_Start_Func003001() )
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
    endloop
    call DestroyEffectBJ( AddSpecialEffectLocBJ( TargetLoc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" ))
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 8
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set DummyUnit = CreateUnitAtLoc( GetOwningPlayer(Caster), 'h001', TargetLoc, 270.00 )
        call UnitAddAbilityBJ( 'A001', DummyUnit )
        call UnitApplyTimedLifeBJ( 6.00, 'BTLF', DummyUnit )
        set udg_PolarPoint = PolarProjectionBJ(TargetLoc, 200.00, ( 45.00 * I2R(GetForLoopIndexA()) ))
        call IssuePointOrderLocBJ( DummyUnit, "breathoffire", udg_PolarPoint )
        call RemoveLocation(udg_PolarPoint)
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_ALL, Target )
    call RemoveLocation(TargetLoc)
    set Caster = null
    set DummyUnit = null
endfunction

//===========================================================================
function InitTrig_Throw_Start takes nothing returns nothing
    set gg_trg_Throw_Start = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Throw_Start, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Throw_Start, Condition( function Trig_Throw_Start_Conditions ) )
    call TriggerAddAction( gg_trg_Throw_Start, function Trig_Throw_Start_Actions )
endfunction

GUI Version:

  • Throw Start Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Throw
    • Actions
      • Set Target = (Target unit of ability being cast)
      • Set TargetLoc = (Position of Target)
      • Wait until ((Target has buff Burned ) Equal to True), checking every 0.10 seconds
      • Special Effect - Create a special effect at TargetLoc using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy (Throw) for (Owner of (Triggering unit)) at TargetLoc facing Default building facing degrees
          • Set DummyUnit = (Last created unit)
          • Unit - Add Breath of Fire (Neutral Hostile) to DummyUnit
          • Unit - Add a 6.00 second Generic expiration timer to DummyUnit
          • Set PolarPoint = (TargetLoc offset by 200.00 towards (45.00 x (Real((Integer A)))) degrees)
          • Unit - Order DummyUnit to Neutral Pandaren Brewmaster - Breath Of Fire PolarPoint
          • Custom script: call RemoveLocation(udg_PolarPoint)
      • Unit - Remove All buffs from Target
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TargetLoc)
Can you check it out?
 
JASS:
function Trig_Throw_Start_Actions player p,unit tar,unit DummyUnit returns nothing
    local integer i = 0
    local real x = GetUnitX(tar)
    local real y = GetUnitY(tar)
    call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",x,y))
    loop
        set DummyUnit = CreateUnit(p, 'h001', x,y, 270. )
        call UnitAddAbility(DummyUnit, 'A001' )
        call UnitApplyTimedLife(DummyUnit,'BTLF',6. )
        call IssuePointOrder( DummyUnit, "breathoffire",x+200.*Cos(.7854*i),y+200.*Sin(.7854*i))
        exitwhen i == 7
        set i = i + 1
    endloop
    // You shouldn't be using buffs as indicators that your spell is working as that can be buggy
    // more often than you'd like.
endfunction
 
function Trig_Throw_Start_Conditions takes nothing returns boolean
    if GetSpellAbilityId() == 'A000' then
        call Trig_Throw_Start_Actions(GetTriggerPlayer(),GetSpellTargetUnit(),null)
    endif
    return false
endfunction
 
//===========================================================================
function InitTrig_Throw_Start takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Trig_Throw_Start_Conditions ) )
endfunction
 
Status
Not open for further replies.
Top