• 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.

[Trigger] DotaSpell

Status
Not open for further replies.
Level 3
Joined
Oct 4, 2007
Messages
27
I need Help with a Dota Spell.
Its the Spell where Trees Suround a Hero or Creep
How to make it with not to much Triggers?

Thx for Help:wthumbsup:
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Set Point[0] = (Position of (Target unit of ability being cast))
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Point[(Integer A)] = (Point[0] offset by 80.00 towards ((Real((Integer A))) x 45.00) degrees)
          • Unit - Create 1 Dummy_Tree for (Owner of (Triggering unit)) at Point[(Integer A)] facing Default building facing degrees
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Point[GetForLoopIndexA()])
      • Custom script: call RemoveLocation(udg_Point[0])

This is a 8-points-circle.
If you want more, add more numbers to the "1 to 8" and decrease the angle.

For example, "... from 1 to 20 ..." , "set Point... = ... towards ((Real((Integer A))) x Put here something that will be 360/The number of loops) degrees)".

In this case it would be 360/20 = 18.
 
Level 17
Joined
Jun 17, 2007
Messages
1,433
JASS:
//A000 = your ability
function Sprout_Spell takes nothing returns boolean
    return GetSpellAbilityId()=='A000'
endfunction

function Sprout_Main takes nothing returns nothing
    local destructable array ldx
    local integer lEq
    local integer lEQ
    local fogmodifier loB
    local unit lJV=GetTriggerUnit()
    local unit lFB=GetSpellTargetUnit()
    local location ln3=GetUnitLoc(lFB)
    set loB=CreateFogModifierRadiusLocBJ(true,GetOwningPlayer(lJV),FOG_OF_WAR_VISIBLE,ln3,1000.)
    set lEq=1
    set lEQ=8
    loop
        exitwhen lEq>lEQ
        set ldx[lEq]=CreateDestructableLoc('LTlt',PolarProjectionBJ(ln3,150.,(I2R(lEq)*45.)),GetRandomReal(0,360),1,0)
        set lEq=lEq+1
    endloop
    call PolledWait((2.25+(.75*I2R(GetUnitAbilityLevelSwapped('A000,lJV)))))
    set lEq=1
    set lEQ=8
    loop
        exitwhen lEq>lEQ
        call KillDestructable(ldx[lEq])
        set lEq=lEq+1
    endloop
    call DestroyFogModifier(loB)
    call PolledWait(4.)
    set lEq=1
    set lEQ=8
    loop
        exitwhen lEq>lEQ
        call RemoveDestructable(ldx[lEq])
        set lEq=lEq+1
    endloop
    call RemoveLocation(ln3)
endfunction

function Sprout_CheckHelp takes nothing returns nothing
    if GetSpellAbilityId()=='A06Q'and IsUnitAlly(GetSpellTargetUnit(),GetOwningPlayer(GetTriggerUnit()))and GetBoolean(H2Tx(GetOwningPlayer(GetSpellTargetUnit())),"L6")then
        call DropOrder(GetTriggerUnit())
        call SimError(GetOwningPlayer(GetTriggerUnit()),"This target has disablehelp on")
    endif
endfunction

function Sprout_Init takes nothing returns nothing
    local trigger ltt
    set udg_triggerl097=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(udg_triggerl097,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(udg_triggerl097,Condition(function Sprout_Spell))
    call TriggerAddAction(udg_triggerl097,function Sprout_Main)
    set ltt=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddAction(ltt,function Sprout_CheckHelp)
endfunction
 
Level 10
Joined
Jun 26, 2005
Messages
236
JASS:
 if GetSpellAbilityId()=='A06Q'and IsUnitAlly(GetSpellTargetUnit()

hvo, may I ask what 'A06Q' is, as you have A000 as the raw data of the ability.
 
Status
Not open for further replies.
Top