Suckback

Chaos_Knight

New Member
Reaction score
39
Okay, i was thinking of a suckinto spell. Like a knockback, but whole around.
The spell sucks in every unit in range of the target point, and deals damage per second. Can someone help me?
Yes, DotA players, i wanna create Engimas "Black Hole".

//Chaos_Knight
 

hgkjfhfdsj

Active Member
Reaction score
55
Not sure if this will be of help...
Extracted from Triggered Skills Explained
Based on Tornado. This provides the duration and summoned unit.

When blackhole is casted, check if it's casted inside of the playable area, or inside of the places where you can't black hole, if it is, then stop Enigma and put the "Cannot cast Black Hole here" error message.

When the tornado is summoned, a dummy unit is created, added a Fog ability (A0X4 if Enigma is Sentinel, A0X3 if Enigma es Scourge) and told to use it on the spot that Black Hole was summoned, "BlackHole" (the Tornado) is saved to the cache, it then creates a new trigger with two events (2), one is the death of the tornado, the other being a timed event every 0.05 seconds. It also assigns the level of the tornado damage aura of the tornado to that of Black Hole's level.

(2): This new function first checks if it has been called because of the unit's death, if it has, then the trigger is destroyed. If it's because of the timed event, recover the BlackHole from the cache, then count every non dummy, non structure, non ancient (except Spirit Bear) enemy unit. For each unit, Set the unit's position to the distance from Black Hole to the unit -2 keeping the same angle (SetUnitPositionLoc reset the commands you have done).

The Fog abillity lasts for 4 seconds, A0X4 targets Friend, while A0X3 targets enemies, it has a 400 AoE. Note that items abilities can be casted while in the blackhole, but you also need to be facing enigma.

The Places where you can't blackhole:
1.-The waterfall at the left sentinel base entrance
2.-The other waterfall at the bottom sentinel base entrance
3.-To the leftest place on the river, you can't cast it there (well, there's a place there where you can cast it and leave people stuck though, the rectangle checked is too small)
4.-To the rightest of the river (this one has a good check)

you can try a knockback system... with:
Set the unit's position to the distance from Black Hole to the unit -2 keeping the same angle (SetUnitPositionLoc reset the commands you have done).
 

Chaos_Knight

New Member
Reaction score
39
Well, that was.. Cool. But still i was thinking of using a negative knockback.
Damn it, i cant figure out how to make this. :banghead:
 

killingdyl

Active Member
Reaction score
6
this is the basics of the knockback trigger, you can add a periodic and lower the value(25) to get a smoother looking slide. you can also add a loop to make them knockback farther each time.
JASS:
   set x = GetUnitX(target)
            set y = GetUnitY(target)
            set rad = Atan2(y - yt, x- xt) //yt and xt are the x and y of the caster unit
            set x = x + 25 * Cos(rad)
            set y = y + 25 * Sin(rad)
            call SetUnitPosition(target, x, y)
 

Chaos_Knight

New Member
Reaction score
39
Blackhole by emjlr3 >> perhaps work from that??

Hey, i imported it and compiled and i changed a little, but it doesnt suck the targets. It creates the dummy. :(

JASS:
library BlackHole initializer InitTrig requires TT

//******************************************************************************************
//*
//*  Blackhole - By emjlr3, Original seen in DotA Allstars
//*
//*  Summon a black hole from the darkest abyss, which sucks enemy units into
//*  its center, dealing damage over time. 
//* 
//*  Requires:
//*    - "TT" trigger copied to your map, if not already there
//*    - The "Black Hole" ability copied to your map
//*    - The "Black Hole (Dummy)" ability copied to your map
//*    - The "Black Hole" buff copied to your map, set as the previous abilities buff
//*    - The "Black Hole" unit copied to your map, with the "Black Hole (Dummy)" ability added to it
//*    - A vJASS Preprocessor
//*
//******************************************************************************************

globals
    // Config. Globals:
    private constant integer abil_id = 'A00A' // Black Hole ability rawcode
    private constant integer dummy_id = 'u003' // Black Hole unit rawcode
    private constant real pull = 50.5 // Distance pulled/interval
    private constant boolean fight = false // Whether units can fight against the pull
    private constant string sfx = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" // Effect created on pulled units
    
    // Needed Globals:
    public trigger Trigger = null // Output trigger will be BlackHole_Trigger, which can be used publically
    private group G = CreateGroup()
    private player P = null
    private real X
    private real Y
endglobals
// Config. Functions:
private function Range takes integer lvl returns real
    return 400. // Area for pull/lvl
endfunction
// Damage is found on the Black Hole (Dummy) ability

private struct data
    unit hole
    unit u
    player p
    integer lvl
    real x
    real y
endstruct

private function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetSummonedUnit())==dummy_id
endfunction
private function Filt takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit())>.405 and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitEnemy(GetFilterUnit(),P)
endfunction
private function Effects takes nothing returns nothing
    local real x 
    local real y
    local real ang
    
    set bj_ghoul[25] = GetEnumUnit()
    set x = GetUnitX(bj_ghoul[25])
    set y = GetUnitY(bj_ghoul[25])
    set ang = Atan2(Y-y,X-x)
    if fight then
        call SetUnitX(bj_ghoul[25],x+pull*Cos(ang))
        call SetUnitY(bj_ghoul[25],y+pull*Sin(ang))
    else
        call SetUnitPosition(bj_ghoul[25],x+pull*Cos(ang),y+pull*Sin(ang))
    endif
    call DestroyEffect(AddSpecialEffectTarget(sfx,bj_ghoul[25],"origin"))
endfunction
private function Movement takes nothing returns boolean
    local data d = TT_GetData()
    
    if GetWidgetLife(d.hole)<.405 then
        call d.destroy()
        return true
    endif
    
    call GroupClear(G)
    set P = d.p
    set X = d.x
    set Y = d.y
    call GroupEnumUnitsInRange(G,d.x,d.y,Range(d.lvl),Condition(function Filt))
    call ForGroup(G,function Effects)
    return false
endfunction
private function Actions takes nothing returns nothing
    local data d = data.create()
    
    set d.hole = GetSummonedUnit()
    set d.x = GetUnitX(d.hole)
    set d.y = GetUnitY(d.hole)
    set d.u = GetSummoningUnit()
    set d.p = GetOwningPlayer(d.u)
    set d.lvl = GetUnitAbilityLevel(d.u,abil_id)
    call TT_Start(function Movement,d)
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
    local trigger Trigger = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( Trigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( Trigger, Condition( function Conditions ) )
    call TriggerAddAction( Trigger, function Actions )
endfunction

endlibrary
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top