Spell Earth Splitter

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
This spell is from DotA.. I have recoded it..

JASS:
/*
    Earth Splitter v2.0.1
        by kingking
    
    Description : Using his mighty axe, the Tauren Chieften rends the very earth itself, 
    sending a jagged crack under the feet of his enemies. After several seconds the earth 
    implodes, sending his foes tumbling inwards. Any unit caught in the implosion will 
    take damage based on their maximum life and have their speed slowed for a short time. 
    Implodes after certain seconds. Deals part of a unit's maximum HP and slow it.
    
    Implement Instruction :
    1) Copy this trigger and required libraries to your map.
    2) Make sure you implemented the required libraries correctly.
    3) Copy the abilities, "Earth Splitter" and "Earth Splitter slow" to your map.
    4) Copy the Earth Splitter buff.
    5) Set the buff in Earth Splitter Slow.
    6) Adjust the constant globals to correct rawcodes.
    7) You may tweak constant functions if you want.
    8) Enjoy it!
    
    Requires :
    GTrigger Event System
    KeyTimers 2
    DummyCaster
    Jasshelper v0.A.2.A or later
*/
scope EarthSplitter
    
    /* <=                            Constant globals                                 =>  */
    globals
        private constant integer ABIL_ID = 'A000'
        //Ability's Id
        private constant integer SLOW_ID = 'A001' 
        //Slow's id
        private constant string GROUND_EFFECT = "Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl"
        //Effect on the ground when unit are damaged and slowed
        private constant real GROUND_EFFECT_DURATION = 2.
        //Duration of efect.
        private constant string SMASH_EFFECT = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
        //Effect of projectile.
        private constant attacktype DAMAGE_A_ATTACK_TYPE = ATTACK_TYPE_MELEE
        private constant damagetype DAMAGE_A_DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
        private constant weapontype DAMAGE_A_WEAPON_TYPE = null
        private constant attacktype DAMAGE_B_ATTACK_TYPE = ATTACK_TYPE_MAGIC
        private constant damagetype DAMAGE_B_DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
        private constant weapontype DAMAGE_B_WEAPON_TYPE = null
    endglobals
    
    private keyword d
    
    //==============                <= Constants =>                               ========\\
    private function FilterUnit takes unit whichUnit returns boolean
        return IsUnitEnemy(whichUnit,d.owner) and IsUnitType(whichUnit,UNIT_TYPE_DEAD) == false and IsUnitType(whichUnit,UNIT_TYPE_STRUCTURE) == false
    endfunction
    
    private function DamageFactor takes integer lvl returns real
        return 10. * lvl + 15.
    endfunction
    
    private function WaveSpeed takes integer lvl returns real
        return .2
    endfunction
    
    private function WaveRange takes integer lvl returns real
        return 150.
    endfunction
    
    private function NumberOfWaves takes integer lvl returns integer
        return 12
    endfunction
    
    private function Delay takes integer lvl returns real
        return 1.
    endfunction
    
    private function AoE takes integer lvl returns real
        return 250.
    endfunction
    
    private function DamageAFrac takes integer lvl returns real
        return 50.
    endfunction
    
    private function DamageBFrac takes integer lvl returns real
        return 50.
    endfunction
    
//                           <= NO MORE TOUCHING =>                                       \\
    
    private keyword Data
    
    globals
        private constant integer MaxWave = 13
        private constant group enumGroup = CreateGroup()
        private conditionfunc cf
        private Data d
    endglobals
    
    private struct Data 
        unit caster
        player owner
        real array eX [MaxWave]
        real array eY [MaxWave]
        effect array eff [MaxWave]
        real cx
        real cy
        real tx
        real ty
        real angle
        real array cos [3]
        real array sin [3]
        integer tick
        group g
        real fraction
        integer level
        real waveRange
        real halfRange
        integer waveCount
        real aoe
        real dmgAFrac
        real dmgBFrac
        
        private static method End takes nothing returns boolean
            local thistype this = KT_GetData()
            loop
                call DestroyEffect(.eff[.tick])
                set .eff[.tick] = null
                set .tick = .tick + 1
            exitwhen .tick > .waveCount
            endloop
            call GroupClear(.g)
            call .destroy()
            return true
        endmethod
        
        private static method Damage takes nothing returns boolean
            local unit u = GetFilterUnit()
            local real maxHP
            if not IsUnitInGroup(u,d.g) and FilterUnit(u) then
                call UnitAddAbility(DUMMY,SLOW_ID)
                call SetUnitAbilityLevel(DUMMY,SLOW_ID,d.level)
                call IssueTargetOrder(DUMMY,"slow",u)
                call UnitRemoveAbility(DUMMY,SLOW_ID)
                set maxHP = GetUnitState(u,UNIT_STATE_MAX_LIFE) * d.fraction
                call UnitDamageTarget(d.caster,u,d.dmgAFrac * maxHP,false,false,DAMAGE_A_ATTACK_TYPE,DAMAGE_A_DAMAGE_TYPE,DAMAGE_A_WEAPON_TYPE)
                call UnitDamageTarget(d.caster,u,d.dmgBFrac * maxHP,false,false,DAMAGE_B_ATTACK_TYPE,DAMAGE_B_DAMAGE_TYPE,DAMAGE_B_WEAPON_TYPE)
                call SetUnitX(u,d.eX[d.tick])
                call SetUnitY(u,d.eY[d.tick])
                call GroupAddUnit(d.g,u)
            endif
            set u = null
            return false
        endmethod
        
        private static method Periodic2 takes nothing returns boolean
            local thistype this = KT_GetData()
            if .g == null then
                set .g = CreateGroup()
            endif
            loop
                set .eff[.tick] = AddSpecialEffect(GROUND_EFFECT,.eX[.tick],.eY[.tick])
                set d = this
                call GroupEnumUnitsInRange(enumGroup,.eX[.tick],.eY[.tick],.aoe,cf)
                set .tick = .tick - 1
            exitwhen .tick == -1
            endloop
            call KT_Add(function thistype.End,this,GROUND_EFFECT_DURATION)
            return true
        endmethod
        
        private static method Periodic takes nothing returns boolean
            local thistype this = KT_GetData()
            if .tick < .waveCount then
                set .tick = .tick + 1
                set .cx = .cx + .cos[0]
                set .cy = .cy + .sin[0]
                set .eX[.tick] = .cx
                set .eY[.tick] = .cy
                call DestroyEffect(AddSpecialEffect(SMASH_EFFECT,.cx + .cos[0],.cy + .sin[0]))
                call DestroyEffect(AddSpecialEffect(SMASH_EFFECT,.cx + .cos[1],.cy + .sin[1]))
                call DestroyEffect(AddSpecialEffect(SMASH_EFFECT,.cx + .cos[2],.cy + .sin[2]))
                return false
            endif
            call KT_Add(function thistype.Periodic2, this, Delay(.level))
            return true
        endmethod
        
        private static method Act takes nothing returns boolean
            local thistype this = thistype.allocate()
            set .caster = GetTriggerUnit()
            set .tx = GetSpellTargetX()
            set .ty = GetSpellTargetY()
            set .cx = GetUnitX(.caster)
            set .cy = GetUnitY(.caster)
            set .angle = Atan2(.ty - .cy,.tx - .cx)
            set .level = GetUnitAbilityLevel(.caster,ABIL_ID)
            set .waveRange = WaveRange(.level)
            set .halfRange = .waveRange / 2.
            set .cos[0] = .waveRange * Cos(.angle)
            set .sin[0] = .waveRange * Sin(.angle)
            set .cos[1] = .halfRange * Cos(.angle + 2.1)
            set .sin[1] = .halfRange * Sin(.angle + 2.1)
            set .cos[2] = .halfRange * Cos(.angle - 2.1)
            set .sin[2] = .halfRange * Sin(.angle - 2.1)
            set .waveCount = NumberOfWaves(.level)
            set .aoe = AoE(.level)
            set .fraction = DamageFactor(.level) * .01
            set .owner = GetOwningPlayer(.caster)
            set .dmgAFrac = DamageAFrac(.level) * .01
            set .dmgBFrac = DamageBFrac(.level) * .01
            set .tick = 0
            call KT_Add(function thistype.Periodic,this,WaveSpeed(.level))
            return false
        endmethod
        
        private static method onInit takes nothing returns nothing
            call GT_AddStartsEffectAction(function thistype.Act,ABIL_ID)
            
            set cf = Condition(function thistype.Damage)
        endmethod
    endstruct

endscope
/////////////////////////////////End/////////////////////////////////////////////////////////


Description : Using his mighty axe, the Tauren Chieften rends the very earth itself, sending a jagged crack under the feet of his enemies. After several seconds the earth implodes, sending his foes tumbling inwards. Any unit caught in the implosion will take damage based on their maximum life and have their speed slowed for a short time. Implodes after 3 seconds. Deals 35% of a unit's maximum HP and slow it.

Let's take a peek to it :
76605432.jpg

70305474.jpg


GUI/Jass/vJass -> Hints : Jasshelper is needed.
MUI/MPI -> Hints : Use structs to store data, MUI or not MUI?
Leak/Lag -> Classic case. :eek:

The icon is also included!
 

Attachments

  • DotA_Spell_Pack_14.w3x
    99.4 KB · Views: 424

8uY_YoU

New Member
Reaction score
4
Woo.. Earthsplitler.. An ability that has cool effect
Nice job..
But i still wondering how Natural Order works? It seems the system has been hacked..!
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Woo.. Earthsplitler.. An ability that has cool effect
Nice job..
But i still wondering how Natural Order works? It seems the system has been hacked..!

Natural Order is easy, triggers are not needed. Set the Devolution Aura's Armor Bonus to negative value and tick the percent bonus. Finally set the target and AoE. It is done!!
 
Reaction score
341
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
Major problem in here.

The dota ones slows at the end. Your doesn't.

Edit: When browsing the map I saw the spell "slow" but, it seem that they'rew not slowed and the effect is not showing.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Major problem in here.

The dota ones slows at the end. Your doesn't.

Edit: When browsing the map I saw the spell "slow" but, it seem that they'rew not slowed and the effect is not showing.

Fixed in v1.1
 

Jesus4Lyf

Good Idea™
Reaction score
397
WHY??? Why are you making DotA spells all the time :( I want more original :D
Yep. QFT.

>Learn to use GroupUtils for ENUMING units instead of creating and destroying them.
Oh, so we need a H2I system to enumerate groups now, do we? What's it meant to do, anyway? You certainly don't need a system to enumerate groups without creating and destroying, lol. o.o
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Yep. QFT.

>Learn to use GroupUtils for ENUMING units instead of creating and destroying them.
Oh, so we need a H2I system to enumerate groups now, do we? What's it meant to do, anyway? You certainly don't need a system to enumerate groups without creating and destroying, lol. o.o

I prefer not to add an optional system unless it is needed very hard.
 

Azlier

Old World Ghost
Reaction score
461
If you don't use GroupUtils, recycle the groups instead. It's very easy to do.

JASS:
scope Lolwut

private struct Omg

    group Group

    static method create takes nothing returns thistype
        ...
        if .Group == null then
            set .Group = CreateGroup()
            //Never, ever destroy it.
        else
            call GroupClear(.Group)
        endif
        ...
    endmethod

endstruct
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I didn't read it all but:

Can the attack/damage/weapon types be configurable please?
And from what I see;
The group 'picked' is being filled and emptied instantaneously;
So why not use a global group for it ;) !
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
So why not use a global group for it !
Can the attack/damage/weapon types be configurable please?
I will add it later.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
v1.2

Group Recycle?
No more destroy group.

Doesn't kill trees
Added.

Is this counted as double posting? :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top