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

===[NEW] Spell Workshop [NEW]===

Status
Not open for further replies.
Level 1
Joined
May 28, 2011
Messages
1
Im kinda making a maplstory map/campaign and i need a way to flash jump(meaning while jumping, use flash jump to move further)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Wow, I'm shocked this thread is still running even in the capacity I'm seeing!

And not only that the original creator and one of the original makers within the thread.

Shocking. :)
 
I've been working on a Jump system, Im posting this here before I post it in the snippet's section...
Pretty much everything is configurable, you can damage enemy units or heal allied also...
If ONLY jump then, just set the damage/aoe to zero, if no sfx then set the sfx to "x"...

JASS:
//===JumpSystem v1.0
//Created by: Mckill2009

library JumpSystem uses T32x

globals
    private constant attacktype         ATK = ATTACK_TYPE_NORMAL
    private constant damagetype         DMG = DAMAGE_TYPE_NORMAL    
endglobals

private function GetParabolaZ takes real h, real d, real x returns real
    //d is the distx will reach the distance 
    return (4 * h / d) * (d - x) * (x / d)
endfunction

private struct JS
    unit u
    real angle
    real distance
    real speed
    real height
    real damage
    real aoe
    real distx = 0
    string sfx
    boolean ally
    
    private static thistype DATA    
    
//! textmacro F takes f, u    
    static method filter$f$ takes nothing returns boolean
        local thistype this = DATA
        local unit u = GetFilterUnit()
        if IsUnit$u$(u, GetOwningPlayer(.u)) and not IsUnitType(u, UNIT_TYPE_DEAD) then
            call UnitDamageTarget(.u, u, .damage, false, false, ATK, DMG, null)
        endif
        set u = null
        return false
    endmethod
//! endtextmacro

//! runtextmacro F("enemies", "Enemy")
//! runtextmacro F("allies", "Ally")
    
    method periodic takes nothing returns nothing
        if .distance > .distx and not IsUnitType(.u, UNIT_TYPE_DEAD) then
            set .distx = .distx + .speed
            call SetUnitX(.u, GetUnitX(.u) + .speed * Cos(.angle))
            call SetUnitY(.u, GetUnitY(.u) + .speed * Sin(.angle))
            call SetUnitFlyHeight(.u, GetParabolaZ(.height, .distance, .distx), .distance)
        else
            set DATA = this
            if .ally then
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, GetUnitX(.u), GetUnitY(.u), .aoe, function thistype.filterallies)
            else
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, GetUnitX(.u), GetUnitY(.u), .aoe, function thistype.filterenemies)
            endif
            call DestroyEffect(AddSpecialEffectTarget(.sfx, .u, "origin"))           
            call PauseUnit(.u, false)
            call UnitRemoveAbility(.u, 'Avul') 
            call SetUnitFlyHeight(.u, 0, .distance)
            call .stopPeriodic()
            call .destroy()            
        endif
    endmethod
    
    implement T32x
    
    static method create takes unit u, real distance, real angle, real height, real speed, real damage, real aoe, string sfx, boolean b returns thistype
        local thistype this = thistype.allocate()
        set .u = u
        set .angle = angle
        set .distance = distance
        set .speed = speed
        set .height = height
        set .damage = damage
        set .aoe = aoe
        set .sfx = sfx    
        set .ally = b
        call PauseUnit(u, true)
        call UnitAddAbility(u, 'Avul')        
        if GetUnitAbilityLevel(u, 'Arav')<=1 then
            call UnitAddAbility(u, 'Arav')
            call UnitRemoveAbility(u, 'Arav')        
        endif       
        call .startPeriodic()
        return this
    endmethod   
endstruct

function SetUnitJump takes unit u, real xDist, real yDist, real height, real speed, real damage, real aoe, string sfx, boolean ally returns nothing
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local real angle = Atan2(yDist-y, xDist-x)
    local real distance = SquareRoot((xDist-x)*(xDist-x) + (yDist-y)*(yDist-y)) 
    call JS.create(u, distance, angle, height, speed, damage, aoe, sfx, ally)
endfunction

endlibrary


How to use?
  • Demo
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local string s = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
      • Custom script: call SetUnitJump(u, GetSpellTargetX(), GetSpellTargetY(), 200, 15, 0, 0, s, false)
      • Custom script: set u = null
and the unit will jump...
 
Level 3
Joined
Jul 27, 2011
Messages
27
I would really appriciate it if you could do this spell asap, need it for my AoS map I'm currently working on. ;)

Spellname:
Blitz

Tooltip:
The Gladiator swiftly runs up to the target and strikes it with great strength.

Description:
I want it to be like a charge but instead of the usual dustpuffs I want some sort of transparent trail of the Hero replicate behind the Hero, making it look like he moves really fast. (Wich he does also).

Extra:
Target unit spell.

Thanks in advance :D
 
I would really appriciate it if you could do this spell asap, need it for my AoS map I'm currently working on. ;)

Spellname:
Blitz

Tooltip:
The Gladiator swiftly runs up to the target and strikes it with great strength.

Description:
I want it to be like a charge but instead of the usual dustpuffs I want some sort of transparent trail of the Hero replicate behind the Hero, making it look like he moves really fast. (Wich he does also).

Extra:
Target unit spell.

Thanks in advance :D

I created the same spell 3days before without the transparent trail, so i added it and here is your spell. To note that your spell is GUI, MUI and normally Leakless.
http://www.hiveworkshop.com/forums/pastebin.php?id=hulhz3

To all others, i reorganise my requests list and so i think i'll make your spells soon. I just did this spell in 5minutes since i've ever had the spell and needed only to do 1 or 2 modifications.
 
Level 4
Joined
Nov 6, 2011
Messages
83
Can someone make this spell

Giant Wave attack
Aquarius_Water_Attack.gif

Aquarius gathers water in her urn and throws it with tremendous force. It is powerful enough to cause a massive wave, and send a yacht flying several miles

if someone will make it PM me , i will send the model that needed [ Aquarius Model ]
 
Level 1
Joined
Nov 7, 2011
Messages
9
Hi everyone!

I need a few spells for my new campaign.

1. Silencing Shot:
Shoots an arrow at the target. The target takes 100 damage and can't cast any spells for 5 seconds (Silence effect).

2. [Name needed]
Okay, now this one is a bit complicated to explain:
Summons three orbs that rotate around the caster (similar to the lightning shield target animation). These orbs have special abilities:
Orb 1: Gives mana for every kill (3% of maximum amount).
Orb 2: Increases mana regeneration.
Orb 3: Increases maximum mana by 300.
The Orbs kinda work like a manashield, the caster loses mana instead of hp (maybe it should absorb just half of the damage taken, I think that would be even better). However, when 100 damage are absorbed, the first Orb is destroyed (and its ability with it). When 200 damage are absorbed, the second Orb is destroyed (together with its ability). And, guess what, when 300 damage are absorbed, the third orb and its ability are gone.

Would be great if someone could make these.
 
Level 4
Joined
Nov 6, 2011
Messages
83
Can someone make this spell

Giant Wave attack
Aquarius_Water_Attack.gif

Aquarius gathers water in her urn and throws it with tremendous force. It is powerful enough to cause a massive wave, and send a yacht flying several miles

if someone will make it PM me , i will send the model that needed [ Aquarius Model ]
Anyone can do this ??:ogre_haosis:
 
Level 1
Joined
Nov 7, 2011
Messages
9
Hi everyone!

I need a few spells for my new campaign.

1. Silencing Shot:
Shoots an arrow at the target. The target takes 100 damage and can't cast any spells for 5 seconds (Silence effect).

2. [Name needed]
Okay, now this one is a bit complicated to explain:
Summons three orbs that rotate around the caster (similar to the lightning shield target animation). These orbs have special abilities:
Orb 1: Gives mana for every kill (3% of maximum amount).
Orb 2: Increases mana regeneration.
Orb 3: Increases maximum mana by 300.
The Orbs kinda work like a manashield, the caster loses mana instead of hp (maybe it should absorb just half of the damage taken, I think that would be even better). However, when 100 damage are absorbed, the first Orb is destroyed (and its ability with it). When 200 damage are absorbed, the second Orb is destroyed (together with its ability). And, guess what, when 300 damage are absorbed, the third orb and its ability are gone.

Would be great if someone could make these.
Anyone?
Is the second one even possible with triggers?
 
Here for the Barrage only, others, let baassee do it :)
requires: GroupUtils
just change the spellID and dummyID

JASS:
//******************************************************************************
//*                                                                            *
//*                                 Barrage                                    *
//*                                  v1.02                                     *
//*                                                                            *
//*                             By: Rising_Dusk                                *
//*                                                                            *
//******************************************************************************

//**************************************
//* LIBRARY REQUIREMENTS:
//*     - GroupUtils
//* 
scope Barrage initializer Init
globals
    //*************************************************************
    //* Configuration Constants
    
    //* Raw codes
    private constant integer SPELL_ID              = 'AHbz'
    private constant integer DUMMY_ID              = 'hpea'
    //* System related
    private constant real TIMER_INTERVAL           = 0.04
    //* Movement constants
    private constant real AOE_BUFFER               = 30.
    private constant real RANGE_THRESHOLD_SQUARED  = 2025.
    //* Dummy unit configuration
    private constant real DUMMY_MOVE_SPEED         = 900.
    private constant real DUMMY_UNIT_HEIGHT        = 65.
    //* Damage properties
    private constant attacktype ATTACK_TYPE        = ATTACK_TYPE_NORMAL
    private constant damagetype DAMAGE_TYPE        = DAMAGE_TYPE_UNIVERSAL
    //* Offsets for the starting point of the projectiles
    private constant real X_OFFSET                 = -15.
    private constant real Y_OFFSET                 = 40.
    //* Effect placement
    private constant string EFFECT_POINT           = "origin"
    
    //*************************************************************
    //* System Variables
    private timer MoveTimer                        = CreateTimer()
    private boolean ToStart                        = false
    private boolexpr Checker                       = null
    private player TempPlayer                      = null
    private integer Counter                        = 0
    private integer array Arrows
    private trigger Trg                            = CreateTrigger()
    
    private constant integer SPELL_TARGET          = 1
    private constant integer SPELL_POINT           = 2
endglobals

//*****************************************************************
//* Configuration Functions
private constant function Damage takes integer lvl returns real
    //* Spell Damage
    return 7.5*lvl*lvl + 32.5*lvl + 35.
endfunction

private constant function AreaOfEffect takes integer lvl returns real
    //* Spell Area of Effect Radius
    return 160.+40.*lvl
endfunction

private constant function Targets takes integer lvl returns integer
    //* Number of targets to acquire
    return lvl+2
endfunction

private function Check takes nothing returns boolean
    //* The boolexpr for striking a unit
    return IsUnitEnemy(GetFilterUnit(), TempPlayer) and IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_RESISTANT) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') <= 0.
endfunction

//*****************************************************************
private struct arrow
    integer Flag  = 0
    integer Level = 0
    unit Source   = null
    unit Target   = null
    unit Dummy    = null
    effect Fx     = null
    real Angle    = 0.
    real x        = 0.
    real y        = 0.
    
    static method create takes unit u, unit t, real xi, real yi, real xf, real yf, integer flag, integer lvl, real angle returns arrow
        local arrow a = arrow.allocate()
        set a.Source = u
        set a.Target = t
        set a.Dummy  = CreateUnit(GetOwningPlayer(u), DUMMY_ID, xi, yi, angle*bj_RADTODEG)
        set a.Level  = lvl
        set a.Flag   = flag
        set a.Angle  = angle
        set a.Fx     = AddSpellEffectTargetById(SPELL_ID, EFFECT_TYPE_MISSILE, a.Dummy, "origin")
        call SetUnitX(a.Dummy, xi)
        call SetUnitY(a.Dummy, yi)
        if IsUnitType(a.Dummy, UNIT_TYPE_GROUND) then
            call UnitAddAbility(a.Dummy, 'Amrf')
            call UnitRemoveAbility(a.Dummy, 'Amrf')
        endif
        call SetUnitFlyHeight(a.Dummy, DUMMY_UNIT_HEIGHT, 0.)
        if flag == SPELL_POINT then
            set a.x  = xf
            set a.y  = yf
        else
            set a.x  = GetUnitX(t)
            set a.y  = GetUnitY(t)
        endif
        return a
    endmethod
    private method onDestroy takes nothing returns nothing
        //* Clean up all effects
        call DestroyEffect(this.Fx)
        if this.Flag == 1 then
            call DestroyEffect(AddSpellEffectTargetById(SPELL_ID, EFFECT_TYPE_TARGET, this.Target, EFFECT_POINT))
        else
            call DestroyEffect(AddSpellEffectById(SPELL_ID, EFFECT_TYPE_TARGET, this.x, this.y))
        endif
        call KillUnit(this.Dummy)
    endmethod
endstruct

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

private function Callback takes nothing returns nothing
    local unit u      = null
    local unit d      = null
    local unit t      = null
    local arrow a     = 0
    local integer i   = Counter - 1
    local integer j   = 0
    local integer lvl = 0
    local real xi     = 0.
    local real yi     = 0.
    local real xf     = 0.
    local real yf     = 0.
    local real di     = 0.
    local real an     = 0.
    
    //* Loop through all arrow instances and do effects
    loop
        exitwhen i < 0
        set a   = Arrows[i]
        set u   = a.Source
        set t   = a.Target
        set d   = a.Dummy
        set lvl = a.Level
        set xi  = GetUnitX(d)
        set yi  = GetUnitY(d)
        if a.Flag == SPELL_TARGET then
            //* Update position/angle to track the enemy unit
            set a.x     = GetUnitX(t)
            set a.y     = GetUnitY(t)
            set a.Angle = Atan2(a.y-yi, a.x-xi)
            call SetUnitFacing(d, a.Angle*bj_RADTODEG)
        endif
        set di  = (a.x-xi)*(a.x-xi)+(a.y-yi)*(a.y-yi)
        if di <= RANGE_THRESHOLD_SQUARED then
            //* Finished, deal damage if SPELL_TARGET
            if a.Flag == SPELL_TARGET then
                call UnitDamageTarget(u, t, Damage(lvl), false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            endif
            call a.destroy()
            set Counter = Counter - 1
            if Counter < 0 then
                call PauseTimer(MoveTimer)
                set Counter = 0
            else
                set Arrows[i] = Arrows[Counter]
            endif
        else
            //* Not finished, move forward in space and time
            set di = DUMMY_MOVE_SPEED*TIMER_INTERVAL
            set xf = xi + di*Cos(a.Angle)
            set yf = yi + di*Sin(a.Angle)
            call SetUnitX(d, xf)
            call SetUnitY(d, yf)
        endif
        set i = i - 1
    endloop
    
    set u = null
    set d = null
    set t = null
endfunction

private function Actions takes nothing returns nothing
    local unit u      = GetTriggerUnit()
    local unit s      = null
    local location l  = GetSpellTargetLoc()
    local integer lvl = GetUnitAbilityLevel(u, SPELL_ID)
    local integer c   = 0
    local integer o   = Counter
    local integer m   = Targets(lvl)
    local arrow a     = 0
    local real xi     = GetUnitX(u)
    local real yi     = GetUnitY(u)
    local real xf     = GetLocationX(l)
    local real yf     = GetLocationY(l)
    local real di     = 0.
    local real ag     = Atan2(yf-yi, xf-xi)
    local real x      = 0.
    local real y      = 0.
    local real an     = 0.
    
    //* Move the starting point based on constant offsets
    if X_OFFSET != 0. then
        //* X offset
        set an = ag-bj_PI/2
        set xi = xi + X_OFFSET*Cos(an)
        set yi = yi + X_OFFSET*Sin(an)
    endif
    if Y_OFFSET != 0. then
        //* Y offset
        set an = ag
        set xi = xi + Y_OFFSET*Cos(an)
        set yi = yi + Y_OFFSET*Sin(an)
    endif
    set TempPlayer = GetOwningPlayer(u)
    call GroupEnumUnitsInRange(ENUM_GROUP, xf, yf, AreaOfEffect(lvl), Checker)
    //* Create up to Targets(lvl) number of arrows
    loop
        //* Pick a randomly selected unit in the group
        set bj_groupRandomConsidered = 0
        set bj_groupRandomCurrentPick = null
        call ForGroup(ENUM_GROUP, function GroupPickRandomUnitEnum)
        set s = bj_groupRandomCurrentPick
        exitwhen s == null or c >= m
        set an = Atan2(GetUnitY(s)-yi, GetUnitX(s)-xi)
        set a  = arrow.create(u, s, xi, yi, 0., 0., SPELL_TARGET, lvl, an)
        
        set Arrows[Counter] = integer(a)
        set Counter         = Counter + 1
        call GroupRemoveUnit(ENUM_GROUP, s)
        set c = c + 1
    endloop
    //* Create the leftover arrows as random effects so the spell isn't ugly
    if c < m then
        loop
            exitwhen c >= m
            set di = GetRandomReal(AOE_BUFFER*2, AreaOfEffect(lvl)-AOE_BUFFER)
            set ag = GetRandomReal(0, 2*bj_PI)
            set x  = xf + di*Cos(ag)
            set y  = yf + di*Sin(ag)
            set an = Atan2(y-yi, x-xi)
            set a  = arrow.create(u, null, xi, yi, x, y, SPELL_POINT, lvl, an)
            
            set Arrows[Counter] = integer(a)
            set Counter         = Counter + 1
            set c = c + 1
        endloop
    endif
    if o == 0 then
        call TimerStart(MoveTimer, TIMER_INTERVAL, true, function Callback)
    endif
    
    call GroupClear(ENUM_GROUP)
    call RemoveLocation(l)
    set l = null
    set u = null
    set s = null
endfunction

private function Init takes nothing returns nothing
    call TriggerAddAction(Trg, function Actions)
    call TriggerAddCondition(Trg, Condition(function Conditions))
    call TriggerRegisterAnyUnitEventBJ(Trg, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    set Checker = Condition(function Check)
endfunction
endscope
 
Level 12
Joined
Dec 25, 2010
Messages
972
Here for the Barrage only, others, let baassee do it :)
requires: GroupUtils
just change the spellID and dummyID

JASS:
//******************************************************************************
//*                                                                            *
//*                                 Barrage                                    *
//*                                  v1.02                                     *
//*                                                                            *
//*                             By: Rising_Dusk                                *
//*                                                                            *
//******************************************************************************

//**************************************
//* LIBRARY REQUIREMENTS:
//*     - GroupUtils
//* 
scope Barrage initializer Init
globals
    //*************************************************************
    //* Configuration Constants
    
    //* Raw codes
    private constant integer SPELL_ID              = 'AHbz'
    private constant integer DUMMY_ID              = 'hpea'
    //* System related
    private constant real TIMER_INTERVAL           = 0.04
    //* Movement constants
    private constant real AOE_BUFFER               = 30.
    private constant real RANGE_THRESHOLD_SQUARED  = 2025.
    //* Dummy unit configuration
    private constant real DUMMY_MOVE_SPEED         = 900.
    private constant real DUMMY_UNIT_HEIGHT        = 65.
    //* Damage properties
    private constant attacktype ATTACK_TYPE        = ATTACK_TYPE_NORMAL
    private constant damagetype DAMAGE_TYPE        = DAMAGE_TYPE_UNIVERSAL
    //* Offsets for the starting point of the projectiles
    private constant real X_OFFSET                 = -15.
    private constant real Y_OFFSET                 = 40.
    //* Effect placement
    private constant string EFFECT_POINT           = "origin"
    
    //*************************************************************
    //* System Variables
    private timer MoveTimer                        = CreateTimer()
    private boolean ToStart                        = false
    private boolexpr Checker                       = null
    private player TempPlayer                      = null
    private integer Counter                        = 0
    private integer array Arrows
    private trigger Trg                            = CreateTrigger()
    
    private constant integer SPELL_TARGET          = 1
    private constant integer SPELL_POINT           = 2
endglobals

//*****************************************************************
//* Configuration Functions
private constant function Damage takes integer lvl returns real
    //* Spell Damage
    return 7.5*lvl*lvl + 32.5*lvl + 35.
endfunction

private constant function AreaOfEffect takes integer lvl returns real
    //* Spell Area of Effect Radius
    return 160.+40.*lvl
endfunction

private constant function Targets takes integer lvl returns integer
    //* Number of targets to acquire
    return lvl+2
endfunction

private function Check takes nothing returns boolean
    //* The boolexpr for striking a unit
    return IsUnitEnemy(GetFilterUnit(), TempPlayer) and IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_RESISTANT) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') <= 0.
endfunction

//*****************************************************************
private struct arrow
    integer Flag  = 0
    integer Level = 0
    unit Source   = null
    unit Target   = null
    unit Dummy    = null
    effect Fx     = null
    real Angle    = 0.
    real x        = 0.
    real y        = 0.
    
    static method create takes unit u, unit t, real xi, real yi, real xf, real yf, integer flag, integer lvl, real angle returns arrow
        local arrow a = arrow.allocate()
        set a.Source = u
        set a.Target = t
        set a.Dummy  = CreateUnit(GetOwningPlayer(u), DUMMY_ID, xi, yi, angle*bj_RADTODEG)
        set a.Level  = lvl
        set a.Flag   = flag
        set a.Angle  = angle
        set a.Fx     = AddSpellEffectTargetById(SPELL_ID, EFFECT_TYPE_MISSILE, a.Dummy, "origin")
        call SetUnitX(a.Dummy, xi)
        call SetUnitY(a.Dummy, yi)
        if IsUnitType(a.Dummy, UNIT_TYPE_GROUND) then
            call UnitAddAbility(a.Dummy, 'Amrf')
            call UnitRemoveAbility(a.Dummy, 'Amrf')
        endif
        call SetUnitFlyHeight(a.Dummy, DUMMY_UNIT_HEIGHT, 0.)
        if flag == SPELL_POINT then
            set a.x  = xf
            set a.y  = yf
        else
            set a.x  = GetUnitX(t)
            set a.y  = GetUnitY(t)
        endif
        return a
    endmethod
    private method onDestroy takes nothing returns nothing
        //* Clean up all effects
        call DestroyEffect(this.Fx)
        if this.Flag == 1 then
            call DestroyEffect(AddSpellEffectTargetById(SPELL_ID, EFFECT_TYPE_TARGET, this.Target, EFFECT_POINT))
        else
            call DestroyEffect(AddSpellEffectById(SPELL_ID, EFFECT_TYPE_TARGET, this.x, this.y))
        endif
        call KillUnit(this.Dummy)
    endmethod
endstruct

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

private function Callback takes nothing returns nothing
    local unit u      = null
    local unit d      = null
    local unit t      = null
    local arrow a     = 0
    local integer i   = Counter - 1
    local integer j   = 0
    local integer lvl = 0
    local real xi     = 0.
    local real yi     = 0.
    local real xf     = 0.
    local real yf     = 0.
    local real di     = 0.
    local real an     = 0.
    
    //* Loop through all arrow instances and do effects
    loop
        exitwhen i < 0
        set a   = Arrows[i]
        set u   = a.Source
        set t   = a.Target
        set d   = a.Dummy
        set lvl = a.Level
        set xi  = GetUnitX(d)
        set yi  = GetUnitY(d)
        if a.Flag == SPELL_TARGET then
            //* Update position/angle to track the enemy unit
            set a.x     = GetUnitX(t)
            set a.y     = GetUnitY(t)
            set a.Angle = Atan2(a.y-yi, a.x-xi)
            call SetUnitFacing(d, a.Angle*bj_RADTODEG)
        endif
        set di  = (a.x-xi)*(a.x-xi)+(a.y-yi)*(a.y-yi)
        if di <= RANGE_THRESHOLD_SQUARED then
            //* Finished, deal damage if SPELL_TARGET
            if a.Flag == SPELL_TARGET then
                call UnitDamageTarget(u, t, Damage(lvl), false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            endif
            call a.destroy()
            set Counter = Counter - 1
            if Counter < 0 then
                call PauseTimer(MoveTimer)
                set Counter = 0
            else
                set Arrows[i] = Arrows[Counter]
            endif
        else
            //* Not finished, move forward in space and time
            set di = DUMMY_MOVE_SPEED*TIMER_INTERVAL
            set xf = xi + di*Cos(a.Angle)
            set yf = yi + di*Sin(a.Angle)
            call SetUnitX(d, xf)
            call SetUnitY(d, yf)
        endif
        set i = i - 1
    endloop
    
    set u = null
    set d = null
    set t = null
endfunction

private function Actions takes nothing returns nothing
    local unit u      = GetTriggerUnit()
    local unit s      = null
    local location l  = GetSpellTargetLoc()
    local integer lvl = GetUnitAbilityLevel(u, SPELL_ID)
    local integer c   = 0
    local integer o   = Counter
    local integer m   = Targets(lvl)
    local arrow a     = 0
    local real xi     = GetUnitX(u)
    local real yi     = GetUnitY(u)
    local real xf     = GetLocationX(l)
    local real yf     = GetLocationY(l)
    local real di     = 0.
    local real ag     = Atan2(yf-yi, xf-xi)
    local real x      = 0.
    local real y      = 0.
    local real an     = 0.
    
    //* Move the starting point based on constant offsets
    if X_OFFSET != 0. then
        //* X offset
        set an = ag-bj_PI/2
        set xi = xi + X_OFFSET*Cos(an)
        set yi = yi + X_OFFSET*Sin(an)
    endif
    if Y_OFFSET != 0. then
        //* Y offset
        set an = ag
        set xi = xi + Y_OFFSET*Cos(an)
        set yi = yi + Y_OFFSET*Sin(an)
    endif
    set TempPlayer = GetOwningPlayer(u)
    call GroupEnumUnitsInRange(ENUM_GROUP, xf, yf, AreaOfEffect(lvl), Checker)
    //* Create up to Targets(lvl) number of arrows
    loop
        //* Pick a randomly selected unit in the group
        set bj_groupRandomConsidered = 0
        set bj_groupRandomCurrentPick = null
        call ForGroup(ENUM_GROUP, function GroupPickRandomUnitEnum)
        set s = bj_groupRandomCurrentPick
        exitwhen s == null or c >= m
        set an = Atan2(GetUnitY(s)-yi, GetUnitX(s)-xi)
        set a  = arrow.create(u, s, xi, yi, 0., 0., SPELL_TARGET, lvl, an)
        
        set Arrows[Counter] = integer(a)
        set Counter         = Counter + 1
        call GroupRemoveUnit(ENUM_GROUP, s)
        set c = c + 1
    endloop
    //* Create the leftover arrows as random effects so the spell isn't ugly
    if c < m then
        loop
            exitwhen c >= m
            set di = GetRandomReal(AOE_BUFFER*2, AreaOfEffect(lvl)-AOE_BUFFER)
            set ag = GetRandomReal(0, 2*bj_PI)
            set x  = xf + di*Cos(ag)
            set y  = yf + di*Sin(ag)
            set an = Atan2(y-yi, x-xi)
            set a  = arrow.create(u, null, xi, yi, x, y, SPELL_POINT, lvl, an)
            
            set Arrows[Counter] = integer(a)
            set Counter         = Counter + 1
            set c = c + 1
        endloop
    endif
    if o == 0 then
        call TimerStart(MoveTimer, TIMER_INTERVAL, true, function Callback)
    endif
    
    call GroupClear(ENUM_GROUP)
    call RemoveLocation(l)
    set l = null
    set u = null
    set s = null
endfunction

private function Init takes nothing returns nothing
    call TriggerAddAction(Trg, function Actions)
    call TriggerAddCondition(Trg, Condition(function Conditions))
    call TriggerRegisterAnyUnitEventBJ(Trg, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    set Checker = Condition(function Check)
endfunction
endscope

Tried in the original map:
Nothing
 
Level 1
Joined
Nov 7, 2011
Messages
9
@Wingthor

Ofc it's possible, I'll make the first one for sample, if you like it, tell me...
That would be great, thanks!

Nearbe all things are possible.

So, yes. But the problem is that it's quite hard to understand what do you want precisely.
It's quite hard to explain...

Changed it a bit:
The hero summons three orbs that rotate around him (similar to the lightning shield target animation). The hero's maximum mana is increased by 300, his mana regeneration is increased by 100% and he get's mana for each kill (3% of maximum mana amount). The orbs absorb 30% of the damage taken. When 100 points of damage have been absorbed, the first orb and the first bonus (the hero gets mana for each kill) are destroyed. The orbs now absorb 20% of the damage taken. When 200 points of damage have been absorbed, the second orb and the second bonus (increased mana regeneration) are destroyed. The orb now absorbs 10% of the damage taken. When 300 points of damage have been absorbed, the third orb and the third bonus (+300 max mana) are destroyed.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Let me try to explain this with a little diagram:

3 orbs, think sort of like 3 lightning shields (If they had 1 orb, so kind of like fire orb) except they all work together in one overall spell. Thinking of it in layers will be the easiest way to describe it, so as shrek says "An onion has many layers..." There's 3 layers, the inner, the middle, and the outer. Each "Layer" can absorb 10% dmg, so if all 3 layers are up, it's a total of 30% dmg. 2 are up 20% dmg absorb, 1 up 10% dmg absorb.

The innermost layer is the "Hero's Maximum mana increased by 300" part. So we put that in the center. The middle layer is the "Mana Regen increased by 100%" so we put that on the outside of the central layer. The last, outer layer is the most powerful one, "3% max mana per kill" goes around the others. Overall, when the spell is cast, the stats are: +300 mana, +100% mana regen and +3% MaxMana return on kill.

Now this part is where I'm somewhat confused, if this is wrong, please correct me, but the way I understand it is: the spell has a total "health" of 300 damage. After 100 dmg is taken, the first orb (Yellow) is removed, along with it's ability and 10% dmg absorb is lost. After 100 more dmg, the second (Orange) orb is removed, along with it's ability and it's own 10% dmg absorb, and after another set of 100 dmg, the last orb (Red) and it's affiliate abilities and absorb are lost, the spell is now over.

( +3% MaxMana Return per kill ( Mana Regen +100% ( Max Mana +300 ) Mana Regen +100% ) +3% MaxMana Return per kill )

Or if that wasn't good enough:

+3% MaxMana Return Per Kill
.
+100% ManaRegen
.
+300 Mana
.
 
Level 8
Joined
Oct 1, 2010
Messages
408
Hi,

I'm requesting that someone please make the spell that I have done my best to describe here:

http://www.hiveworkshop.com/forums/world-editor-help-zone-98/spell-possible-roots-but-different-207884/#post2057766 - Even though the despicable picture says 'Hero' I actually need this for a unit.

To clarify, I want the wave to affect and root (or dot and stun with a root animation) the unit it hits, then have the wave stop where its hits a unit but keep moving in the places where its hit nothing until it does hit a unit. However, I want the wave range to only be 600 and the width to be 300. Not sure if this is possible, but the I'd really appreciate anything close to this if this spell can't be done.

Sorry if this is confusing! I don't know how to better explain it, and thanks so much to anyone who makes this spell and +rep till the end of time for anyone who does make it, this spell would be a dream come true.
 
Level 1
Joined
Nov 7, 2011
Messages
9
Let me try to explain this with a little diagram:

3 orbs, think sort of like 3 lightning shields (If they had 1 orb, so kind of like fire orb) except they all work together in one overall spell. Thinking of it in layers will be the easiest way to describe it, so as shrek says "An onion has many layers..." There's 3 layers, the inner, the middle, and the outer. Each "Layer" can absorb 10% dmg, so if all 3 layers are up, it's a total of 30% dmg. 2 are up 20% dmg absorb, 1 up 10% dmg absorb.

The innermost layer is the "Hero's Maximum mana increased by 300" part. So we put that in the center. The middle layer is the "Mana Regen increased by 100%" so we put that on the outside of the central layer. The last, outer layer is the most powerful one, "3% max mana per kill" goes around the others. Overall, when the spell is cast, the stats are: +300 mana, +100% mana regen and +3% MaxMana return on kill.

Now this part is where I'm somewhat confused, if this is wrong, please correct me, but the way I understand it is: the spell has a total "health" of 300 damage. After 100 dmg is taken, the first orb (Yellow) is removed, along with it's ability and 10% dmg absorb is lost. After 100 more dmg, the second (Orange) orb is removed, along with it's ability and it's own 10% dmg absorb, and after another set of 100 dmg, the last orb (Red) and it's affiliate abilities and absorb are lost, the spell is now over.

( +3% MaxMana Return per kill ( Mana Regen +100% ( Max Mana +300 ) Mana Regen +100% ) +3% MaxMana Return per kill )
Yes, that explains it perfectly.

However I'm trying to find a new way to make the spell end, because I don't really like the "damage absorb" stuff and I don't want to make it time based. My first idea was to make it work like a mana shield, but I figured that would be stupid considering how quickly mana regenerates with that spell.
 
Level 1
Joined
Nov 7, 2011
Messages
9
Yeah, maybe.
However, I still want the "+300 mana" orb to be removed first, then the "mana regen" one and then the "3% mana per kill" one.
 
Status
Not open for further replies.
Top