Spell Malicious Spawn (w/ custom model)

Hatebreeder

So many apples
Reaction score
381
Hey again,
I was bored, so I started to create a Spell and to model. I created a Model for the Spell, so it has something appealing about it.
Anyways, this is the Model I made:
Burning Coil
Model Viewer Screenshot:
BurningCoilArt.jpg

In-Game Screen Shot:
BurningCoildAction.jpg


NOTE: I changed the animation of the Coil a bit... I hope you like it =)

And here, the Spell for the Model:
Malicious Spawn
JASS / vJASS: vJASS
import difficulty: easy
MUI / MPI / Non-MUI: MUI
Jesp? Guess so
Requires: Jass New Gen Pack; TT (Timer Ticker) by Cohadar

Describtion: Creates a burning coil, that jumps from unit to unit. Heals friendly units and Damages enemies.

Now, to the Code:
JASS:
scope MaliciousSpawn initializer Init
//===============================================================================
//===                     M A L I C I O U S  S P A W N                        ===
//===                      B Y  H A T E B R E E D E R                         ===
//===============================================================================
//===    To Check raw-codes, open Object manager and press Control + D        ===
//===============================================================================
//===               Have fun with the Spell & The Model                       ===
//===============================================================================

    globals
        private constant integer ID = 'A000' //Raw Code of the Spell
        private constant integer DUMMY = 'u001' // Dummy ID
        private constant integer JUMPS = 8 // How often it should jump
        private constant real AOE = 325. // determines the AOE, of targeting the next Unit
        private constant real SPEED = 12. // Speed of the Missle
        private constant string SFX = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" // Damage/Heal SFX
        private constant string ATTACHMENT = "origin" // SFX attachmentpoint
    //===========================================
        private constant group GROUP = CreateGroup()
    endglobals
        
        private constant function Damage takes integer Level returns real
            return (75. * Level) / JUMPS //Max Damage of the Spell
        endfunction
        
        private constant function Heal takes real Dam, integer Level returns real
            return (Dam * (0.2 * Level)) //Healing of the Spell
        endfunction
//==================================================================================
//================== Do not Edit below, unless you know what you are doing =========
//==================================================================================

        private struct Spawn
            unit Caster
            unit Dummy
            unit Target
            integer Count = JUMPS
        endstruct

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ID
endfunction

private function Group_Filter takes nothing returns boolean
    return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction

private function Timer takes nothing returns boolean
    local Spawn Data = TT_GetData()
    local real DummyX = GetUnitX(Data.Dummy)
    local real DummyY = GetUnitY(Data.Dummy)
    local real TargetX = GetUnitX(Data.Target)
    local real TargetY = GetUnitY(Data.Target)
    local real Angle = bj_RADTODEG * Atan2(TargetY - DummyY,TargetX - DummyX)
    local real X = DummyX + SPEED * Cos(Angle * bj_DEGTORAD)
    local real Y = DummyY + SPEED * Sin(Angle * bj_DEGTORAD)
    local real DX
    local real DY
    local real Dist
    local unit P
    local unit D
    
    call SetUnitXY(Data.Dummy,X,Y)
    call SetUnitFacing(Data.Dummy,Angle)
    set DX = TargetX - X
    set DY = TargetY - Y
    set Dist = SquareRoot(DX * DX + DY * DY)

        if Dist <= SPEED then

            set Data.Count = Data.Count - 1
        
                if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
                    call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
                elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
                    call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
                endif

            call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
            call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
            
            set D = Data.Target
            set Data.Target = null
            
                loop
                    set P = FirstOfGroup(GROUP)
                        exitwhen P == null
                            if P != D then
                                set Data.Target = P
                            endif
                            call GroupRemoveUnit(GROUP,P)
                endloop
                
            set P = null
            set D = null
            
                if Data.Count <= 0 or Data.Target == null then
                    call KillUnit(Data.Dummy)
                        call Data.destroy()
                            return true
                endif
                
        endif
return false
endfunction

private function Actions takes nothing returns nothing
    local Spawn Data = Spawn.create()
    local real CasterX
    local real CasterY
    local real TargetX
    local real TargetY
    local real X
    local real Y
    local real Angle
    
    set Data.Caster = GetTriggerUnit()
    set Data.Target = GetSpellTargetUnit()

    set CasterX = GetUnitX(Data.Caster)
    set CasterY = GetUnitY(Data.Caster)
    set TargetX = GetUnitX(Data.Target)
    set TargetY = GetUnitY(Data.Target)
    set Angle = bj_RADTODEG * Atan2(TargetY - CasterY,TargetX - CasterX)
    set X = CasterX + 100 * Cos(Angle * bj_DEGTORAD)
    set Y = CasterY + 100 * Sin(Angle * bj_DEGTORAD)

    set Data.Dummy = CreateUnit(GetOwningPlayer(Data.Caster),DUMMY,X,Y,Angle)
    
    call TT_Start(function Timer,Data)
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger Trig = CreateTrigger(  )
    
    call Preload(SFX)
    
    call TriggerRegisterAnyUnitEventBJ( Trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( Trig, Condition( function Conditions ) )
    call TriggerAddAction( Trig, function Actions )
    set Trig = null
endfunction
endscope


Please tell me of what you think about this =)
 

Attachments

  • BurningCoil.zip
    5 KB · Views: 226
  • Spells And Models - Malicious Spawn.w3x
    45.7 KB · Views: 263

Flare

Stops copies me!
Reaction score
662
Haven't looked through the code in great detail, but:
JASS:
    set Angle = bj_RADTODEG * Atan2(TargetY - CasterY,TargetX - CasterX)
    set X = CasterX + 100 * Cos(Angle * bj_DEGTORAD)
    set Y = CasterY + 100 * Sin(Angle * bj_DEGTORAD)

Why not remove the RADTODEG/DEGTORAD conversions? End result will be exactly the same :p

And you could handle the group actions within the GroupEnum filter i.e.
JASS:
globals
  private Spawn gdata //Declare this below the struct
endglobals

function GroupFilter takes nothing returns boolean
  local unit u = GetFilterUnit ()
if (blablabla) then
call DoSomeStuffWith (gdata)
endif
return false
endfunction

...
set gdata = Data
call GroupEnumUnitsInRange (whichGroup, x, y, radius, Condition (function GroupFilter))

And that'll allow you to keep the group empty and keep all the group functionality in one block (rather than having it in 2 places)

Other than that (I'm too lazy right now to actually examine code properly), it looks pretty cool (both model and the spell concept), shame I can't test it atm though :(
 
Reaction score
456
Excuse me, but what did you have in your mind when you wrote this:
JASS:
private function Timer takes nothing returns boolean
    local Spawn Data = TT_GetData()
    local real DummyX = GetUnitX(Data.Dummy)
    local real DummyY = GetUnitY(Data.Dummy)
    local real TargetX = GetUnitX(Data.Target)
    local real TargetY = GetUnitY(Data.Target)
    local real Angle = bj_RADTODEG * Atan2(TargetY - DummyY,TargetX - DummyX)
    local real X = DummyX + SPEED * Cos(Angle * bj_DEGTORAD)
    local real Y = DummyY + SPEED * Sin(Angle * bj_DEGTORAD)
    local real DX
    local real DY
    local real Dist
    local unit P
    local unit D
    
    call SetUnitXY(Data.Dummy,X,Y)
    call SetUnitFacing(Data.Dummy,Angle)
    set DX = TargetX - X
    set DY = TargetY - Y
    set Dist = SquareRoot(DX * DX + DY * DY)

        if Dist <= SPEED then

            set Data.Count = Data.Count - 1
        
                if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
                    call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
                elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
                    call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
                endif

            call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
            call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
            
            set D = Data.Target
            set Data.Target = null
            
                loop
                    set P = FirstOfGroup(GROUP)
                        exitwhen P == null
                            if P != D then
                                set Data.Target = P
                            endif
                            call GroupRemoveUnit(GROUP,P)
                endloop
                
            set P = null
            set D = null
            
                if Data.Count <= 0 or Data.Target == null then
                    call KillUnit(Data.Dummy)
                        call Data.destroy()
                            return true
                endif
                
        endif
return false
endfunction

I cleaned it up for you:
JASS:
private function Timer takes nothing returns boolean
    local Spawn Data = TT_GetData()
    local real DummyX = GetUnitX(Data.Dummy)
    local real DummyY = GetUnitY(Data.Dummy)
    local real TargetX = GetUnitX(Data.Target)
    local real TargetY = GetUnitY(Data.Target)
    local real Angle = Atan2(TargetY - DummyY, TargetX - DummyX)
    local real X = DummyX + SPEED * Cos(Angle)
    local real Y = DummyY + SPEED * Sin(Angle)
    local real DX
    local real DY
    local real Dist
    local unit P
    local unit D
    
    call SetUnitXY(Data.Dummy, X, Y)
    call SetUnitFacing(Data.Dummy, Angle)
    set DX = TargetX - X
    set DY = TargetY - Y
    set Dist = SquareRoot(DX * DX + DY * DY)

    if Dist <= SPEED then
        set Data.Count = Data.Count - 1
        
        if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
            call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
        elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
            call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
        endif

        call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
        call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
            
        set D = Data.Target
        set Data.Target = null
            
        loop
            set P = FirstOfGroup(GROUP)
            exitwhen P == null
            if P != D then
                set Data.Target = P
            endif
            call GroupRemoveUnit(GROUP,P)
        endloop
                
        set P = null
        set D = null
            
        if Data.Count <= 0 or Data.Target == null then
            call KillUnit(Data.Dummy)
            call Data.destroy()
            return true
        endif      
    endif

    return false
endfunction
 

Hatebreeder

So many apples
Reaction score
381
Excuse me, but what did you have in your mind when you wrote this:
JASS:
private function Timer takes nothing returns boolean
    local Spawn Data = TT_GetData()
    local real DummyX = GetUnitX(Data.Dummy)
    local real DummyY = GetUnitY(Data.Dummy)
    local real TargetX = GetUnitX(Data.Target)
    local real TargetY = GetUnitY(Data.Target)
    local real Angle = bj_RADTODEG * Atan2(TargetY - DummyY,TargetX - DummyX)
    local real X = DummyX + SPEED * Cos(Angle * bj_DEGTORAD)
    local real Y = DummyY + SPEED * Sin(Angle * bj_DEGTORAD)
    local real DX
    local real DY
    local real Dist
    local unit P
    local unit D
    
    call SetUnitXY(Data.Dummy,X,Y)
    call SetUnitFacing(Data.Dummy,Angle)
    set DX = TargetX - X
    set DY = TargetY - Y
    set Dist = SquareRoot(DX * DX + DY * DY)

        if Dist <= SPEED then

            set Data.Count = Data.Count - 1
        
                if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
                    call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
                elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
                    call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
                endif

            call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
            call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
            
            set D = Data.Target
            set Data.Target = null
            
                loop
                    set P = FirstOfGroup(GROUP)
                        exitwhen P == null
                            if P != D then
                                set Data.Target = P
                            endif
                            call GroupRemoveUnit(GROUP,P)
                endloop
                
            set P = null
            set D = null
            
                if Data.Count <= 0 or Data.Target == null then
                    call KillUnit(Data.Dummy)
                        call Data.destroy()
                            return true
                endif
                
        endif
return false
endfunction

I cleaned it up for you:
JASS:
private function Timer takes nothing returns boolean
    local Spawn Data = TT_GetData()
    local real DummyX = GetUnitX(Data.Dummy)
    local real DummyY = GetUnitY(Data.Dummy)
    local real TargetX = GetUnitX(Data.Target)
    local real TargetY = GetUnitY(Data.Target)
    local real Angle = Atan2(TargetY - DummyY, TargetX - DummyX)
    local real X = DummyX + SPEED * Cos(Angle)
    local real Y = DummyY + SPEED * Sin(Angle)
    local real DX
    local real DY
    local real Dist
    local unit P
    local unit D
    
    call SetUnitXY(Data.Dummy, X, Y)
    call SetUnitFacing(Data.Dummy, Angle)
    set DX = TargetX - X
    set DY = TargetY - Y
    set Dist = SquareRoot(DX * DX + DY * DY)

    if Dist <= SPEED then
        set Data.Count = Data.Count - 1
        
        if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
            call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
        elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
            call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
        endif

        call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
        call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
            
        set D = Data.Target
        set Data.Target = null
            
        loop
            set P = FirstOfGroup(GROUP)
            exitwhen P == null
            if P != D then
                set Data.Target = P
            endif
            call GroupRemoveUnit(GROUP,P)
        endloop
                
        set P = null
        set D = null
            
        if Data.Count <= 0 or Data.Target == null then
            call KillUnit(Data.Dummy)
            call Data.destroy()
            return true
        endif      
    endif

    return false
endfunction

Did you just remove the bj_DEGTORAD and RADTODEG thing?
Can I always leave that out?
 

Trollvottel

never aging title
Reaction score
262
if you get a radians value and convert it to degrees just to convert it back to radians to use it in a trigonometrical function it is nonsense ^^.

and

Burning Coil

i didnt see any fire. looks very nice though, i will check the spell later
 

Hatebreeder

So many apples
Reaction score
381
if you get a radians value and convert it to degrees just to convert it back to radians to use it in a trigonometrical function it is nonsense ^^.

and



i didnt see any fire. looks very nice though, i will check the spell later

Look closly =P and check out the Spell =P

@ Uberplayer: There is a small problem with your suggestion... When the Dummy moves, it doesn't change it's facing - It stays as it was when you cast it. But I was able to remove the bj_DEGTORAD and RADTODEG from the Actions function, without it malfunctioning.
 
Reaction score
456
> When the Dummy moves, it doesn't change it's facing
Yeah, sorry. I didn't notice that you use SetUnitFacing function.
 

Hatebreeder

So many apples
Reaction score
381
> When the Dummy moves, it doesn't change it's facing
Yeah, sorry. I didn't notice that you use SetUnitFacing function.

No need to say sorry ^_^

@ Saw, I'll try that =P
EDIT: srry, doesn't work =( I guess I'll have to leave it like it is, no?
 

Tukki

is Skeleton Pirate.
Reaction score
29
JASS:
set Dist = SquareRoot(DX * DX + DY * DY)

    if Dist <= SPEED then

You are using a squareroot which you may remove.

JASS:
set Dist = DX*DX+DY*DY

    if Dist <= SPEED*SPEED then


It sure does look fine! Will test as soon as possible.
 

waaaks!

Zinctified
Reaction score
256
can u add a fiery trail on the model while moving?

anyways, the model is nice and the spell too
 

Hatebreeder

So many apples
Reaction score
381
can u add a fiery trail on the model while moving?

anyways, the model is nice and the spell too

Actually, i find the Model doesn't need a fiery trail, since it has a red glow trail behind it... BUT, I might make one and upload it seperatly
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top