Spell Black Hole

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Black Hole..
The ultimate of the universe...
Came up on warcraft3...Yeah !! Thats me...i made it!!

Although this spell looks alike to dota Enigma's ultimate....but it is not...this is made by me by scratch.

Suck the nearby enemy (750 AOE) to the point being casted...
Dealing level of ability x 10 damage every second.



Jass Version:
JASS:

scope BlackHoleJass

//===================================================================================
//                                      BlackHole                                 
//                                by kentchow75/~GaLs~
//===================================================================================
//
// Implemention Instruction
// 
//--------------------------------------------------------------------------------
// -Object Needed to be copied from Object Editor to your map.
//  [ Ability ]
//  1. Black Hole [E]
//
//--------------------------------------------------------------------------------
// -Trigger  
//  1. Copy this whole trigger to your map.
//  2. Copy ABC to your map if you don't have one.
//  3. Copy RealXY to your map if you don't have one.
//--------------------------------------------------------------------------------
// -Requirements
//  1. Jass NewGen WorldEditor from <a href="http://www.wc3campaigns.net" target="_blank" class="link link--external" rel="nofollow ugc noopener">www.wc3campaigns.net</a>. ( v4d and above )
//  2. ABC system.
//  3. RealXY library.
//--------------------------------------------------------------------------------
//===================================================================================
//  Implementation End                                 
//===================================================================================
globals
//*******************************************************************************************
//  Configuration  (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************

//&lt;-------------------- Rawcode --------------------&gt;//
    private constant integer SPELL_ID = &#039;A003&#039; //Rawcode of the Ability
//&lt;-------------------- Rawcode End --------------------&gt;//

//&lt;-------------------- Radius --------------------&gt;//
    private constant real RADIUS = 750. //How far will this spell sucks enemy from the point being casted
//&lt;-------------------- Radius End --------------------&gt;//

//&lt;-------------------- Period --------------------&gt;//
    private constant real PERIOD = 0.05  //How fast will the unit being suck (The lesser, the faster)
//&lt;-------------------- Period End --------------------&gt;//

//&lt;-------------------- Effect String --------------------&gt;//
    private constant string UNIT_EFFECT = &quot;Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl&quot;
    //The effect that will be shown on the unit when the unit is being suck
    
    private constant string LOC_EFFECT = &quot;Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl&quot;
    //The effect that will shown in the target ground (Advise not to change it)
//&lt;-------------------- Effect String --------------------&gt;//
endglobals

//&lt;-------------------- Damage Per Second --------------------&gt;//
private constant function DPS takes integer level returns real 
    return 10. * level //The formula for counting how much damage to deal to the unit being suck per second
endfunction
//&lt;-------------------- Damage Per Second End --------------------&gt;//

//*******************************************************************************************
//  Configuration End
//*******************************************************************************************

// -----------------------&gt; Do not edit anything below this line. &lt;-----------------------//
// -----------------------&gt; Do not edit anything below this line. &lt;-----------------------//
// -----------------------&gt; Do not edit anything below this line. &lt;-----------------------//

globals
    private unit Caster
endglobals

private function GetDamageMiliSec takes real DamagePerSec returns real
    return DamagePerSec * PERIOD
endfunction

struct BlackHole
unit caster
real cx
real cy
real tx
real ty
real DamagePerSecond
group victims = CreateGroup()
timer t = CreateTimer()
timer Efft = CreateTimer()
    
    static method VictimsCond takes nothing returns boolean
    local unit fil = GetFilterUnit()
    local boolean b1 = GetUnitState(fil,UNIT_STATE_LIFE) &gt; 0
    local boolean b2 = IsUnitType(fil, UNIT_TYPE_STRUCTURE) == false
    local boolean b3 = IsUnitType(fil, UNIT_TYPE_MAGIC_IMMUNE) == false
    local boolean b4 = IsUnitAlly(fil,GetOwningPlayer(Caster)) == false
    
    set fil = null
    return b1 and b2 and b3 and b4
    endmethod
    
    static method tCallBack takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local BlackHole bh = GetTimerStructA(t)
    local unit enum 
    local real ex
    local real ey
    local real AngleToHole
    local real movex
    local real movey
    local real range
    
    if GetUnitCurrentOrder(bh.caster) == 852600 then 
        call GroupEnumUnitsInRange(bh.victims,bh.tx,bh.ty,RADIUS,Condition(function BlackHole.VictimsCond))
        
        set enum = FirstOfGroup(bh.victims)
        loop
        exitwhen enum == null
            set ex = GetWidgetX(enum)
            set ey = GetWidgetY(enum)
            set AngleToHole = AngleBetweenXY(ex,ey,bh.tx,bh.ty)
            set range = DistanceBetweenXY(ex,ey,bh.tx,bh.ty)
            set movex = OffsetX(ex,5+((RADIUS-(range))/25),AngleToHole)
            set movey = OffsetY(ey,5+((RADIUS-(range))/25),AngleToHole)
        
            call IssueImmediateOrder(enum,&quot;stop&quot;)
            if not IsTerrainPathable(movex, movey, PATHING_TYPE_WALKABILITY) then
                call SetUnitX(enum,movex)
                call SetUnitY(enum,movey)
            endif
            call UnitDamageTarget(bh.caster,enum,GetDamageMiliSec(bh.DamagePerSecond),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
            
            call DestroyEffect(AddSpecialEffectTarget(UNIT_EFFECT,enum,&quot;origin&quot;))
            
            call GroupRemoveUnit(bh.victims,enum)
            set enum = FirstOfGroup(bh.victims)
        endloop
    elseif GetUnitCurrentOrder(bh.caster) != 852600 then
        call bh.destroy()
    endif
    set t = null
    endmethod
    
    static method EffCallBack takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local BlackHole bh = GetTimerStructA(t)
    
    call DestroyEffect(AddSpecialEffect(LOC_EFFECT,bh.tx,bh.ty))
    
    set t = null
    endmethod

    static method create takes unit cast, real tarx, real tary returns BlackHole
    local BlackHole bh = BlackHole.allocate()
    set bh.caster = cast
    set bh.cx = GetWidgetX(cast)
    set bh.cy = GetWidgetY(cast)
    set bh.tx = tarx
    set bh.ty = tary
    set bh.DamagePerSecond = DPS(GetUnitAbilityLevel(cast,SPELL_ID))
    set Caster = cast
    
    call SetTimerStructA(bh.t,bh)
    call TimerStart(bh.t,PERIOD,true,function BlackHole.tCallBack)
    
    call SetTimerStructA(bh.Efft,bh)
    call TimerStart(bh.Efft,0.4,true,function BlackHole.EffCallBack)

    return bh
    endmethod

    method onDestroy takes nothing returns nothing
    call ClearTimerStructA(.t)
    call ClearTimerStructA(.Efft)
    
    call PauseTimer(.t)
    call PauseTimer(.Efft)
    call DestroyTimer(.t)
    call DestroyTimer(.Efft)
    
    call DestroyGroup(.victims)
    
    endmethod
endstruct

private function Cond takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function Act takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local BlackHole bh = BlackHole.create(GetSpellAbilityUnit(),GetLocationX(loc),GetLocationY(loc)) 
call RemoveLocation(loc)
set loc = null
endfunction

//===========================================================================
function InitTrig_BlackHoleJass takes nothing returns nothing
local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Cond))
    call TriggerAddAction( t, function Act)
endfunction

endscope
//===========================================================================


*It is advise to use the Jass version as it is much more realistic because the speed of sliding in is not constant.
It depends on how far the enemy from the casted point, the nearer, sucks faster.

Download Here:
View attachment Black Hole.w3x
View attachment Black Hole +Jass v1.1.w3x
 

Dimaspy

New Member
Reaction score
19
Good job!
Nice spell, too bad I'm not able to use it in any of my maps. they are too realistic..
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
You meant my spell too realistic or...your map too realistic -.-?
___________________________
I know this is a bad idea...but rep me..?Haha..
Dont -rep me please
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Every 0.25 seconds of game-time

Doesn't look smooth enough. Lower that number.

You should also add a condition check that deals with magic immune units. It works on golems - and it shouldn't, in my opinion.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
erm...i will do it to lowered the event time intersection...
And...do you think this spell should be nth to magic immune unit??

Edit: The new map is uploaded...this should manage to fix the thingy mentioned by dex
 

martix

There is no spoon
Reaction score
49
Black hole as in simple movement towards the center like "dota Enigma's ultimate" OR does it have nice gravitational effects and stuff?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
it has a nice effect of sucking effect in it :)
 

Sim

Forum Administrator
Staff member
Reaction score
534
Black hole as in simple movement towards the center like "dota Enigma's ultimate" OR does it have nice gravitational effects and stuff?

It is like in DotA.

It's still not smooth enough Gals. Simply set the periodic to 0.04 and the distance moved to 10 or 5, instead of 50:

Code:
Set fvloc[4] = (fvloc[3] offset by 50.00 towards (Angle from fvloc[3] to fvloc[1]) degrees)

Should be

Code:
Set fvloc[4] = (fvloc[3] offset by 10.00 towards (Angle from fvloc[3] to fvloc[1]) degrees)
 

martix

There is no spoon
Reaction score
49
As a challange - make a realistic version of the spell too. :)
Otherwise I could do it. :)
Ever seen some starcraft 2 trailers - there's a demo... :p
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
what means by a ''realistic'' version?

**I posted the ''smoothen'' map on the header**
 

Psiblade94122

In need of sleep
Reaction score
138
a realistic version could be done by setting the distance moved variable into a math equation where it checks how far awat a unit is from the center

it would look something like this
Code:
Set Temp_UG = Units within 750 of Black hole
Unit Group - Pick every unit in Temp_UG
Set L = Position of Black hole
Set L2 = Position of picked unit
Set Temp_Real = Math - ((distance between L and L2 - 750 )/ 10)
Set L3 = L with an offset of Temp_Real towards (Math - Angle between L and L2 <or the other way around, not sure)
Unit - Move (instantly) picked unit to L3

srry, i only know gui atm and school starts tomorrow, but this is what a " realistic" black hole trigger would look like <i used one thats like this on my orbiting battle map)

btw ~Gals~ gj on the spell ^_^ +rep
 

RedSword

New Member
Reaction score
4
Could it be possible to makes unit under the effect of black hole to be sucked as in a spiral ? (I guess that's what they wanna say by "realistic")
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>Could it be possible to makes unit under the effect of black hole to be sucked as in a spiral ?
We can do that...just by adjusting the picked unit group's matching condition...

>>it would look something like this
i'm bad in maths...cant understand...
 

Psiblade94122

In need of sleep
Reaction score
138
lol srry, in a nutshell, the closer your unit is to the black hole, the more the unit will be "sucked" in.

Basically it works something like this

How far away your unit is from the black hole, subtracted from the AoE of the black hole then divided by 10 to make the animation smooth
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Update!

I am using this spell for my project, and GUI doesn't really fit it, so I remake it into a Jass version. I decided to upload it here too.
 
B

benj_war3

Guest
Is this the Enigma spell? Sorry for asking :) or maybe something better!! Good job!
 
Reaction score
456
You know, the configuration menu doesn't have to be filled with comment lines, because it makes it look so messy.

For an example:
JASS:
//&lt;-------------------- Rawcode --------------------&gt;//
    private constant integer SPELL_ID = &#039;A003&#039; //Rawcode of the Ability
//&lt;-------------------- Rawcode End --------------------&gt;//

We can understand what value that is, without the comments line on top and bottom:
JASS:
//Rawcode of the Ability
private constant integer SPELL_ID = &#039;A003&#039;


By using that kind of method to the whole configuration menu:
JASS:
//*******************************************************************************************
//  Configuration  (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************

globals
    //Rawcode of the Ability
    private constant integer SPELL_ID = &#039;A003&#039;
    
    //How far will this spell sucks enemy from the point being casted
    private constant real RADIUS = 750.

    //How fast will the unit being suck (The lesser, the faster)
    private constant real PERIOD = 0.05

    //The effect that will be shown on the unit when the unit is being suck
    private constant string UNIT_EFFECT = &quot;Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl&quot;
    
    //The effect that will shown in the target ground (Advise not to change it)
    private constant string LOC_EFFECT = &quot;Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl&quot;
endglobals

private constant function DPS takes integer level returns real 
    return 10. * level //The formula for counting how much damage to deal to the unit being suck per second
endfunction

//*******************************************************************************************
//  Configuration End
//*******************************************************************************************
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top