• 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] Help with Invoker's Deafening Blast and EMP

Status
Not open for further replies.
Level 5
Joined
Jul 18, 2007
Messages
110
I have no idea how to make these two, you obviously only know what I'm talking about if you have played Invoker from DotA and used these spells. No one seems to know how to accurately make these and I need serious help with them. Any idea how to go about both of them?
 
Level 5
Joined
Jul 18, 2007
Messages
110
Hm, ok, I'll try. Well Deafening Blast is like a wave type move (except I believe the Gargoyle missile scaled is used) which knocksback/silences all enemy units it comes across. EMP is a move where he summons a ball (purge ball) at a targetted point which gradually builds up getting larger than explodes in 2-4 seconds burning 50% mana I believe and 0.5health for every mana point burned.

Who on this site are you sure could do this?
 
With some talking on msn i've made a concept of deafening blast.

http://filesmelt.com/Filehosting2/downloader.php?file=deafeningBlast001.w3x

Research tooltips currently say default ability tooltips
Still not MUI/MPI
based entirly on description
does not increase silence period with level
made in GUI (2 triggers)
Silence uses default ! bubble buff icon (i dont know what "special icon" is)

let me know what to change/if this is what you're looking for.
 
Level 10
Joined
Jun 26, 2005
Messages
236
With my program, I successfully conceived the Invoker spell "EMP" from DotA Allstars v6.56. My program has very slow arithmetic, so I cannot concieve Deafening Blast for you. However, I'm sure this suffices.

Note: My program does everything (but function name changing) automatically, therefore the following JASS code may or may not be 100% correct. Also, the "raw codes" of spells are in their decimal form. I haven't added the ability for my program to "de-numberize".


The main spell code:

JASS:
function ManaReduction takes nothing returns nothing
    local real r = RealComparison(RealComparison2(GetUnitState(GetEnumUnit(), UNIT_STATE_MANA), TempReal), 0)
    local real n = r * 0.5
    
    if AbilityLevelComparison(GetEnumUnit()) == false and r > 0 then
        
        if GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE)>n then
            call SetUnitState(GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_LIFE) - n)
        else
            call SetUnitState(GetEnumUnit(), UNIT_STATE_LIFE, 1)
            call Damage(TempUnit, GetEnumUnit(), 1, n)
        endif
    
    call SetUnitState(GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MANA) - r)
    endif
endfunction

function ForLoop takes unit u, integer i, integer i2 returns nothing
    local group g = GroupUsage()
    
    set TempUnit = u
    set TempFilterUnit = u
    set TempReal = i * 50 + 50
    
    call GroupEnumUnitsInRange(g, GetUnitX(u), GetUnitY(u), 700, Condition(function FilterTargets))
    call ForGroup(g, function ManaReduction)
    
    call GroupRecycle(g)
    
    set g = null
endfunction

function Actions2 takes nothing returns boolean
    local trigger t = GetTriggeringTrigger()
    local string s = H2S(t)
    local integer i = GetTriggerEvalCount(t)
    local unit d = GetStringUnit(s, "Caster")
    local unit u
    local real w = 3.72 * GetStringInteger(s, "WexLevel")
    local real f = 4 * i / (w / 0.05)
    
    call SetUnitScale(d, f, f, f)
    
    if i > (w / 0.05) then
        call ForLoop(d, GetStringInteger(s, "WexLevel"), GetStringInteger(s, "ExortLevel"))
        set u = CreateUnit(GetOwningPlayer(d), 1697657167, GetUnitX(d), GetUnitY(d), 0)
        call SetUnitTimeScale(u, 0.3)
        call RemoveUnit(d)
        call KillUnit(u)
        call FlushStringLocals(s)
        call TriggerRecycle2(t)
    endif
    
    set t=null
    set d=null
    set u=null
    
    return false
endfunction

function Actions takes nothing returns nothing
    local trigger t = CreateTrigger()
    local string s = H2S(t)
    local location l = GetSpellTargetLoc()
    local unit u = GetTriggerUnit()
    local real x = GetLocationX(l)
    local real y = GetLocationY(l)
    local real a = Atan2(y - GetUnitY(u), x - GetUnitX(u))
    local unit d = CreateUnit(GetOwningPlayer(u), 1697657165, x, y, a * bj_RADTODEG)
    
    call TriggerRegisterTimerEvent(t, 0.05, true)
    call TriggerAddCondition(t, Condition(function Actions2))
    
    call SetStringUnit(s, "Caster", d)
    call SetStringInteger(s, "WexLevel", GetUnitAbilityLevel(u, 1093686849))
    call SetStringInteger(s, "QuasLevel", GetUnitAbilityLevel(u, 1093686850))
    call SetStringInteger(s, "ExortLevel", GetUnitAbilityLevel(u, 1093686841))
    
    call RemoveLocation(l)
    
    set t = null
    set l = null
    set u = null
endfunction

function Conditions takes nothing returns boolean
    if GetSpellAbilityId() == 1093686867 then
        call Actions()
    endif
    
    return false
endfunction

function InitTrig_EMP takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    call TriggerRegisterAllPlayersUnitEvent(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Conditions))
    
    set t = null
endfunction

Other functions used
:


JASS:
library OtherFunctions initializer InitGroupSystem
globals
    gamecache DotACache = InitGameCache("DotACache.x")
    unit TempUnit
    unit TempFilterUnit
    real TempReal
    integer TempGroupInteger
    integer TempGroupInteger2
    boolean array GroupUsedOrNot
    group array GroupArray
    integer TriggerCount
    trigger array Triggers
    real array Reals
    timer Timer
endglobals

function H2I takes handle h returns integer
    return h
    return 0
endfunction

function H2S takes handle h returns string
    return I2S(H2I(h))
endfunction

function SetStringInteger takes string hs, string s, integer i returns nothing
    call StoreInteger(DotACache, hs, s, i)
endfunction

function SetStringUnit takes string hs, string s, handle h returns nothing
    call StoreInteger(DotACache, hs, s, H2I(h))
endfunction

function GetStringInteger takes string hs, string s returns integer
    return GetStoredInteger(DotACache, hs, s)
endfunction

function GetStringUnit takes string hs, string s returns unit
    return GetStoredInteger(DotACache, hs, s)
    return null
endfunction

function FlushStringLocals takes string s returns nothing
    call FlushStoredMission(DotACache, s)
endfunction

function FilterLearned takes unit u returns boolean
    return GetUnitAbilityLevel(u, 1113815395) > 0
endfunction

function FilterDead takes unit u returns boolean
    return GetUnitTypeId(u) < 1 or IsUnitType(u, UNIT_TYPE_DEAD) == true
endfunction

function UnitIDComparison takes unit u returns boolean
    local integer i = GetUnitTypeId(u)
    return i == 1848651828 or i == 1848652103 or i == 1848652099 or i == 1848652088 or i == 1697656907 or i == 1697656905 or i == 1697656908 or i == 1697657162
endfunction

function AnotherFilter takes nothing returns boolean
    return GetUnitAbilityLevel(GetFilterUnit(), 1093678162) == 0 and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and FilterDead(GetFilterUnit()) == false and FilterLearned(GetFilterUnit())==false
endfunction

function FilterTargets takes nothing returns boolean
    return IsUnitEnemy(TempFilterUnit, GetOwningPlayer(GetFilterUnit())) and AnotherFilter() and (IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false or UnitIDComparison(GetFilterUnit()))
endfunction

function RealComparison takes real a, real b returns real
    if a < b then
        return a
    else
        return b
    endif
endfunction

function RealComparison2 takes real a, real b returns real
    if a < b then
        return b
    else
        return a
    endif
endfunction

function Whatever takes trigger t, string s returns boolean
    return GetStringInteger(H2S(t), "state" + s) == 1
endfunction

function Whateverr takes unit u returns boolean
    return Whatever(u, "s")
endfunction

function AbilityLevelComparison takes unit u returns boolean
    return GetUnitAbilityLevel(u, 1093686070) > 0 or GetUnitAbilityLevel(u, 1094937961) > 0 or GetUnitAbilityLevel(u, 1093686101) > 0 or GetUnitAbilityLevel(u, 1110454580) > 0 or Whateverr(u)
endfunction

function GroupRecycle takes group g returns nothing
    local integer i = H2I(g) - TempGroupInteger2
    
    if i < 0 or i > 120 then
        //
    else
        call GroupClear(g)
        set GroupUsedOrNot[i] = false
        set TempGroupInteger = i
    endif
endfunction

function GroupUsage takes nothing returns group
    local integer i = TempGroupInteger
    
    loop
        exitwhen i == TempGroupInteger - 1
        
        if GroupUsedOrNot[i] == false then
            set TempGroupInteger = i + 1
            
            if TempGroupInteger == 120 then
                set TempGroupInteger = 0
            endif
            set GroupUsedOrNot[i] = true
            return GroupArray[i]
        endif
    
    set i = i + 1
    
    if i == 120 then
        set i = 0
    endif
    endloop
    
    call BJDebugMsg("|c00ff0303CRITICAL ERROR: FOUND NO AVAILABLE GROUPS|r")
    return CreateGroup()
endfunction

function InitGroupSystem takes nothing returns nothing
    local integer i = 0
    
    set TempGroupInteger = 0
    set GroupArray[i] = CreateGroup()
    set GroupUsedOrNot[i] = false
    set i = i + 1
    set TempGroupInteger2 = H2I(GroupArray[0])
    
    loop
        exitwhen i == 120
        set GroupArray[i] = CreateGroup()
        set GroupUsedOrNot[i] = false
        set i = i + 1
    endloop
endfunction

function Error takes nothing returns nothing
    local integer i = 0
    
    loop
        call DisplayTimedTextToPlayer(Player(i), 0, 0, 120, "|c00ff0303An internal checksum has failed|r")
        set i = i + 1
        exitwhen i == 12
    endloop
endfunction

function TimeElasped takes nothing returns real
    return TimerGetElapsed(Timer)
endfunction

function TriggerRecycle2 takes trigger t returns nothing
    call DisableTrigger(t)
    set TriggerCount = TriggerCount + 1
    set Triggers[TriggerCount] = t
    set Reals[TriggerCount] = TimeElasped() + 60
    
    if TriggerCount > 8000 then
        call Error()
    endif
endfunction

function TriggerRecycle1 takes integer i returns nothing
    if i != TriggerCount then
        set Triggers[i] = Triggers[TriggerCount]
        set Reals[i] = Reals[TriggerCount]
    endif
    
    set Triggers[TriggerCount] = null
    set Reals[TriggerCount] = 0
    set TriggerCount = TriggerCount - 1
endfunction

function TriggerRecycle takes nothing returns boolean
    local real r = TimeElasped()
    local integer i
    set i = 1
    
    loop
        exitwhen i > TriggerCount
        
        if Reals[i] < r then
            if Triggers[i] == null or IsTriggerEnabled(Triggers[i]) == true then
                call Error()
            else
                call DestroyTrigger(Triggers[i])
            endif
            
            call TriggerRecycle1(i)
        else
            set i = i + 1
        endif
    endloop
    
    return false
endfunction

function InitTriggerSystem takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    call TriggerRegisterTimerEvent(t, 15, true)
    call TriggerAddCondition(t, Condition(function TriggerRecycle))
    call TimerStart(Timer, 99999.0, false, null)
    
    set t = null
endfunction

function Damage takes unit n, unit u, integer i, real r returns nothing
    if i == 0 then
        return
    endif
    
    if i == 1 then
        call UnitDamageTarget(n, u, r, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS)
    elseif i == 2 then
        call UnitDamageTarget(n, u, r, true, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
    elseif i == 3 then
        call UnitDamageTarget(n, u, r, true, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS)
    endif
endfunction

function True takes nothing returns boolean
    return true
endfunction

function TriggerRegisterAllPlayersUnitEvent takes trigger t, playerunitevent pue returns nothing
    local integer i = 0
    
    loop
        call TriggerRegisterPlayerUnitEvent(t, Player(i), pue, Condition(function True))
        set i = i + 1
        exitwhen i == 16
    endloop
endfunction
endlibrary
Enjoy.
 
Level 5
Joined
Jul 18, 2007
Messages
110
Because I'm not going to touch GUI.
JASS is fine, just said I would prefer GUI, but meh.

And thanks a lot Bone, damn that was pretty long and REALLY complicated. Also the Wex, Quas, and Exort stuff wasn't necessary, just needed the base spell. I'll attempt to decipher then apply all that but dunno. =/
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Dreadnought[dA];891946 said:
IceFrog has no brainz if that's true =D

I'm having a hard time believing that is his code though @_@ I know for sure I could make that same spell exactly with 1/2 the lines and probably more efficient and I still use GameCache attachments lol

It's a copy of his code, and it's known that DotA's code is equal to ****.
 
Last edited by a moderator:
Level 13
Joined
Sep 14, 2008
Messages
1,408
Mh for the exactly trigger I will need some time...
But the idea is:

1. Make a dummy unit with the model of the farseer attack.
2. Create a trigger which creates this unit at the point of your ability
3. Enable a periodic trigger which increases the unit size of that dummy unit.
4. Create a trigger which end this periodic trigger and kills the dummy unit.
That trigger must pick every unit in range of YourChoice of that dummy unit and deal:
Damage to them/set their mana to ~%
 
Level 5
Joined
Jul 18, 2007
Messages
110
Ok, that's cool. And with Coke's it was awesome and everything, but I was wondering how in DotA they make the missile go like straight through the units and just knock them aside?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Going straight through them is locust.

Anyhow, ripping DotA's code is fail, both because DotA's code is one of the textbook examples of how not to code, and because it's stealing if you do so.

Also, why not think of unique spells rather than copying DotA (Although the silence wave, except for the silence part itself, is a rather generic line knockback)?

Anyhow Coke, check this out and see if you understand it. I should probably rewrite it, but meh.
 
Level 5
Joined
Jul 18, 2007
Messages
110
Well i made the EMP basic triggers for you...
If you want to add more levels just add some ifs to the trigger "EMP end"
like if (level = 1) and so on..

Filebeam - easy filehosting

If it helps you plz give reputation
Thanks a lot man, seems to work fine. And just wondering by is the 0.5 damage per mana burned in DotA done simply with Unit - Cause EmpEMPUnit to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal?

Also, I already said I woulda been fine with JASS, tbh.
 
Level 5
Joined
Jul 18, 2007
Messages
110
You actually had it perfectly right I think, as burning 50 mana = 100 damage. But I was just asking if they manually implemented the values, like that in Dota, or not. Have you played DotA?
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Sure I play Dota... I bet I could beat you^^ (bnet account Erzengel_Azazel or dual.Azazel) wisper me^^

mh there are different ways of dealing the damage..
You could make a unit damage an area... I dunno which is the best one..
But I chose the pick every idea because I can set the units mana with that too...

Edit: What do you think about the "newer" versions of dota... this god damn new map design is just a big piece of shit -.- there was no need to change it...

Kunnka is (or was dunno) imbalanced...

And the new items are stupid too... phase boots are much to cheap...

(Last version i played was 6.56 i think...dunno whether there is a new one so far)
 
Level 5
Joined
Jul 18, 2007
Messages
110
Do you play on East?

How would you do Deafening Blast? The same as Coke (assuming you looked at his)?

Eh... I like it kinda, the whole new gank and juke spots is a good incorporation although might be going overboard with it all.

Yeah, Proudmoore is lame as hell even though he got nerfed, it's a bitch laning vs. his retardedly high AoE cleave.

Phase boots are retarded, I love newbs who get them on like every hero now to seem like they're good.

It's 6.56b I think, Proudmoore got nerfed.

Also DotA is a team game, but I still doubt you are better than me or could 'beat me'. =p

EDIT: Do you have AIM/MSN or anything..?
 
Level 5
Joined
Jul 18, 2007
Messages
110
Could someone help me with this EMP trigger? Trying to make the trigger do damage per mana burned, not just a constant 100 dmg how Azazel made it. Like .5 damage per mana burned.

  • Emp End
    • Events
      • Time - EmpTimer expires
    • Conditions
    • Actions
      • Trigger - Turn off Emp Working <gen>
      • Special Effect - Create a special effect at (Position of EmpEMPUnit) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Unit Group - Pick every unit in (Units within 300.00 of (Position of EmpEMPUnit)) and do (Actions)
        • Loop - Actions
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) / 2.00)
          • Unit - Cause EmpEMPUnit to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal
      • Unit - Kill EmpEMPUnit
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Mh should be easy:

In the trigger that burns the mana use a variable to save the mana BEFORE it is burned.

Then burn it.

Now you go like:

Deal damage(mana stored in variable - mana NOW) x 0.5

The difference between the mana before and the mana now is the burned mana..
 
Level 5
Joined
Jul 18, 2007
Messages
110
Ah, there we go, thanks a lot. Was using integer, just needed to know that function, heh.

Would this do it: Unit - Cause EmpEMPUnit to damage (Picked unit), dealing (0.50 x (Mana / 2.00)) damage of attack type Chaos and damage type Normal

?

Also, when do you use the Integer functions then?
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Well it WOULD work if you burn half the mana. I was not sure wether you burn half the mana or a value. But its ok.

Integer is a "number" which is used for mathematics and so on. Counting...

Real is (i think) a value used in the game like life, mana, movementspeed and so on..
 
Status
Not open for further replies.
Top