• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Epicenter v2.1.0.0

This is a spell based on the Epicenter spell in DotA (lol Magtheridon96 you supernoob)

Since most of you haven't played DotA, this is what the spell does:

- The hero begins channeling for ~2 seconds
- When he's done channeling, the ground around him will be slammed and damaged every 0.xx seconds for a short period of time.

Pretty simple :)

It's written in vJASS (You know me guys :p)
Requirements:
- TimerTools by Nestharus
- SpellEffectEvent by Bribe

Here's the code:

JASS:
/***********************************************
*
*   Epicenter
*   v2.1.0.0
*   By Magtheridon96
*
*   - Requires:
*       - TimerTools By Nestharus
*           - hiveworkshop.com/forums/jass-resources-412/system-timer-tools-201165/
*       - SpellEffectEvent By Bribe
*           - hiveworkshop.com/forums/jass-resources-412/snippet-spelleffectevent-187193/
*
***********************************************/
library Epicenter requires Tt, SpellEffectEvent
    
    globals
        private constant integer ABIL_CODE = 'A000'
        private constant string EFFECT_PATH = "Epicenter.mdx"
        private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL
        private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
        private constant boolean PRELOAD_EFFECT = true
    endglobals
    
    private function GetDamage takes integer level returns real
        return 90. + level * 60.
    endfunction
    
    private function GetTimeout takes integer level returns real
        return 0.4
    endfunction
    
    private function GetRadius takes integer level returns real
        return 450. + level * 50.
    endfunction
    
    private function GetWaves takes integer level returns integer
        return 6 + level * 2
    endfunction
    
    private function TargetFilter takes unit caster, player owner, unit target returns boolean
        return not IsUnitType(target, UNIT_TYPE_STRUCTURE) and not IsUnitType(target, UNIT_TYPE_DEAD) and IsUnitEnemy(target, owner)
    endfunction
    
    private struct Spell extends array
        
        private static unit array caster
        private static player array owner
        private static integer array waves
        private static real array radius
        private static real array damage
        
        implement CTM
            local real x
            local real y
            local unit u
        implement CTMExpire
            // Get the caster's coordinates.
            set x = GetUnitX(caster[this])
            set y = GetUnitY(caster[this])
            // Enumerate units in range of the caster.
            call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, radius[this], null)
            loop
                // Get the first unit in the group, check if he's null, and remove him.
                set u = FirstOfGroup(bj_lastCreatedGroup)
                exitwhen null == u
                call GroupRemoveUnit(bj_lastCreatedGroup, u)
                // Only damage wanted units.
                if TargetFilter(caster[this], owner[this], u) then
                    call UnitDamageTarget(caster[this], u, damage[this], false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                endif
            endloop
            // Create and destroy special effect.
            call DestroyEffect(AddSpecialEffect(EFFECT_PATH, x, y))
            // Decrease number of waves left.
            set waves[this] = waves[this] - 1
            // If number of waves left is 0, we destroy the current instance.
            if waves[this] == 0 then
                call this.destroy()
                set caster[this] = null
                set owner[this] = null
            endif
        implement CTMEnd
        
        private static method run takes nothing returns nothing
            local integer level = GetUnitAbilityLevel(GetTriggerUnit(), ABIL_CODE)
            local thistype this = create(GetTimeout(level))
            // Get the caster and the triggering player.
            set caster[this] = GetTriggerUnit()
            set owner[this] = GetTriggerPlayer()
            // Cache the radius and damage to avoid repeating calculations.
            set radius[this] = GetRadius(level)
            set damage[this] = GetDamage(level)
            // Get the number of times the periodic function will run.
            set waves[this] = GetWaves(level)
        endmethod
        
        private static method onInit takes nothing returns nothing
            call RegisterSpellEffectEvent(ABIL_CODE, function thistype.run)
            static if PRELOAD_EFFECT then
                call Preload(EFFECT_PATH)
            endif
        endmethod
    endstruct
    
endlibrary

Oh and sorry for the import ;)
It's just that I can't find any good in-game effects for this :/ (Other than A Command Aura spam suggested by maddeem :p)
The author of the special effect is unknown to me :p

Credits to IceFrog for the idea (Possibly Eul or Guinsoo (I don't know when Sandking was introduced to DotA))

Feel free to comment and rate.

Oh and the testmap is a must-see :p (I'm serious :D)

Keywords:
DotA, epicenter, Epicenter, Magtheridon96, sandking, hero, spell, wave, shockwave, tremur, earthquake, slam, Nestharus, Spellpack, shock, Sandking.
Contents

Just another Warcraft III map (Map)

Reviews
19th Oct 2011 Bribe: It doesn't even lag on my computer, which is saying a lot. Good work on this. Approved.
Level 13
Joined
May 11, 2008
Messages
1,198
How is it incomplete?
I didn't want to add a slow effect :(

If I do, I'm going to have to use Nestharus' Bonus library, and NOBODY is going to like that :( (Unless he posts a map with all the objects implemented (No Lua))

if pigs could fly i'm sure he would. some people just love being jerks.

well, aside from the slow effect, which i guess isn't a big deal according to baassee, there is the concern about the way the spell is casted not being the way it is described. perhaps it's merely that you planned for something and then decided on something else, and then never went back and changed the description(s).

i'd say it's still approvable for sure. lots of junk gets approved and your spell is definitely not junk.

obviously if someone wants to use the spell they're going to use their own tooltips/announcements, so changing your descriptions at those points in the spell isn't going to matter, really. the point is that they won't be able to import it and let it stay like that in their map, which is fine since in this case it's appearing as though you did not make it for any map in particular.

iow, the spell just awaits minor finishing touches from the map maker.
 
It works on single to 10 units btw...

What do you mean exactly?

The loop(test) you made doesnt work on CTM, it forces me to use CTT...also, the test doesnt work on second loading of the map, idk why...

That's natural.
My configuration of the system SUGGESTED CTT because of the timeout, but I chose to use CTM because I made the timeout configurable and it's possible to use a formula.
CTM handles non-constant timeouts.

I updated the SpellEffectEvent and removed the Table anyway which doesnt matter...

Well, I'm not doing that, it's Bribe resource.
He'll chose to do whatever he wants with it :p
 
:L
Then use CTT.

All you need to do:

1) Go to the Spell struct, add this member: private static constant real TIMEOUT = 0.4 // or whatever you want

2) Change CTM to CTT
(Do this for the four modules (Ex: CTMExpire -> CTTExpire))
Then delete the function GetTimeout

And in the static method run, change create(GetTimeout) to just create()

Or, just turn off debug mode and everything will be fine.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
You don't have to turn off debug mode..
JASS:
************************************************************************************
*
*    SETTINGS
*/
    /*
    *   Checks if any CTM modules appear to be constant
    */
    static if DEBUG_MODE then
        private struct DEBI extends array
            static constant boolean SUGGEST_MODULE_CHANGES = true
        endstruct
    endif
 
Top