1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  5. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  8. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[vJASS] Atomic Bomb v3.1.0.1

Submitted by Magtheridon96
This bundle is marked as approved. It works and satisfies the submission rules.
The documentation explains everything you need to know.

Code (vJASS):
/*************************************
*
*   AtomicBomb
*   v3.1.0.1
*   By Magtheridon96
*
*   - Creates a bombing plane behind the caster
*     that will drop an atomic bomb dealing damage
*     to enemy units in an area of effect. Deals
*     bonus damage to closer units.
*
*   Requires:
*   ---------
*
*       - CTL by Nestharus
*           - hiveworkshop.com/forums/jass-resources-412/snippet-constant-timer-loop-32-a-201381/
*       - SpellEffectEvent by Bribe
*           - hiveworkshop.com/forums/jass-resources-412/snippet-spelleffectevent-187193/
*       - Particle by Nestharus
*           - hiveworkshop.com/forums/submissions-414/snippet-needs-work-particle-206279/
*
*       Optional:
*       ---------
*
*           - TimerUtils by Vexorian (This also caters to my version of TimerUtils in the Hive Jass section Graveyard)
*               - wc3c.net/showthread.php?t=101322
*
*   Importing:
*   ----------
*
*       - Copy this code to a new trigger.
*       - Make sure you have all the requirements implemented too.
*       - Go the object editor and copy/paste the objects to your map (1 ability, 2 dummy units).
*       - There is also an object called Particle that you need which is part of the Particle library.
*       - Import the special effect and dummy.mdl to your map.
*       - Configure the data in the globals to your liking.
*       - Done!
*
*   Credits:
*   --------
*
*       - WILL THE ALMIGHTY (Explosion Effect)
*       - Bribe (SpellEffectEvent, Table)
*       - Nestharus (CTL, Particle)
*       - Vexorian (TimerUtils)
*
*************************************/

library AtomicBomb requires CTL, SpellEffectEvent, Particle, optional TimerUtils
   
    // Configuration
    globals
        // The ability raw code
        private constant integer ABIL_CODE = 'A000'
        // The plane dummy unit raw code
        private constant integer PLANE_CODE = 'h003'
        // The bomb dummy unit raw code
        private constant integer BOMB_CODE = 'h001'
        // Explosion Effect
        private constant string EXPLOSION_EFFECT = "war3mapImported\\NuclearExplosion.mdx"
        // The effect that is created when the plane is created.
        private constant string PLANE_IN_EFFECT = "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl"
        // The effect that is created when the plane is destroyed.
        private constant string PLANE_OUT_EFFECT = "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl"
        // How much time should we wait before destroying the explosion effect?
        private constant real DESTROY_EXPLOSION_AFTER = 15.
        // How much time should we wait before destroying the effect created when the plane is created?
        private constant real DESTROY_IN_EFFECT_PARTICLE_AFTER = 1.4
        // How much time should we wait before destroying the effect created when the plane is destroyed?
        private constant real DESTROY_OUT_EFFECT_PARTICLE_AFTER = 1.4
        // Bomb and Plane height
        private constant real BOMB_HEIGHT = 700.
        // Bomb Drop Speed Base (It will accelerate starting from this base-speed)
        private constant real BOMB_DROP_SPEED = 1.
        // Bomb Drop Acceleration
        private constant real BOMB_DROP_ACCEL = 1.
        // The dummy owning player
        private constant player DUMMY_OWNER = Player(13)
        // Destroy trees around the explosion?
        private constant boolean DESTROY_TREES = true
        // The offset from the point from the target point for plane creation
        private constant real PLANE_DISTANCE = 800.
        // How long does the plane stay after it drops the bomb?
        private constant real PLANE_AFTER_DROP = 2.
        // Attack type
        private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL
        // Damage type
        private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
        // The largest collision a unit has in your map
        private constant real MAX_COLLISION = 197.
    endglobals
    // End Configuration
   
    // The speed of the plane per 1/32th of a second
    private function GetPlaneSpeedFactor takes integer level returns real
        return 9.
    endfunction
   
    // The damage dealed to each unit
    private function GetDamage takes integer level returns real
        return 150 + level * 75.
    endfunction
   
    // The damage radius
    private function GetDamageRadius takes integer level returns real
        return 275 + level * 75.
    endfunction
   
    // How close do units have to be for the spell to deal bonus damage?
    private function GetBonusDamageRadius takes integer level returns real
        return 125 + level * 50.
    endfunction
   
    // I want the spell to deal double the damage to units closer than the bonus damage radius.
    private function GetBonusDamageFactor takes integer level returns real
        return 1.3
    endfunction
   
    // This function will filter out some targets (Allied, dead, magic immune and structures)
    private function TargetFilter takes player owner, unit caster, unit target returns boolean
        return IsUnitEnemy(target, owner) and not (IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(target, UNIT_TYPE_STRUCTURE) or IsUnitType(target, UNIT_TYPE_DEAD) or GetUnitTypeId(target) == 0)
    endfunction
   
    private struct Spell extends array
        private static group enumGroup = CreateGroup()
       
        private static unit array caster
        private static unit array plane
        private static unit array bomb
        private static real array xDis
        private static real array yDis
        private static real array planeX
        private static real array planeY
        private static real array dropX
        private static real array dropY
        private static real array damage
        private static real array radius
        private static real array bonusDamage
        private static real array bonusRadius
        private static real array speed
        private static real array height
        private static integer array counter
        private static integer array level
        private static boolean array dropped
        private static boolean array exploded
        private static player array owner
       
        static if DESTROY_TREES then
            private static rect treeRect = null
            private static unit treeDetector = null
            private static real treesRadius = 0
            private static real treesX = 0
            private static real treesY = 0
            private static method isTree takes destructable d returns boolean
                return IssueTargetOrderById(treeDetector, 852018, d) and IssueImmediateOrderById(treeDetector, 851972)
            endmethod
            private static method destroyTree takes nothing returns nothing
                local destructable d = GetEnumDestructable()
                local real x = GetWidgetX(d) - treesX
                local real y = GetWidgetY(d) - treesY
                // If the destructable is a tree and it is in the circle, kill it
                if x*x+y*y <= treesRadius and isTree(d) then
                    call KillDestructable(d)
                endif
                set d = null
            endmethod
        endif
       
        // You don't need a Table or a hashtable if you have TimerUtils
        static if not LIBRARY_TimerUtils then
            private static Table timerData
        endif
       
        // I want to murder this function
        private static method destroyParticle takes nothing returns nothing
            static if LIBRARY_TimerUtilsEx then
                call Particle(ReleaseTimer(GetExpiredTimer())).destroy()
            elseif LIBRARY_TimerUtils then
                call Particle(GetTimerData(GetExpiredTimer())).destroy()
                call ReleaseTimer(GetExpiredTimer())
            else
                call Particle(timerData[GetHandleId(GetExpiredTimer())]).destroy()
                call DestroyTimer(GetExpiredTimer())
            endif
        endmethod
       
        implement CTL
            local timer t
            local unit u
            local real x
            local real y
        implement CTLExpire
            // Set the planeX and planeY coordinates
            set planeX[this] = planeX[this] + xDis[this]
            set planeY[this] = planeY[this] + yDis[this]
           
            // Moving the plane out of the map bounds would crash the game, so we should make sure the coordinates are sound.
            if planeX[this] <= WorldBounds.maxX or planeX[this] >= WorldBounds.minX or planeY[this] <= WorldBounds.maxY or planeY[this] >= WorldBounds.minY then
                // Move the plane
                call SetUnitX(plane[this], planeX[this])
                call SetUnitY(plane[this], planeY[this])
            endif
           
            // If the bomb has been dropped
            if dropped[this] then
                // If the bomb exploded
                if exploded[this] then
                   
                    // Counter-based checking
                    set counter[this] = counter[this] - 1
                    if counter[this] == 0 then
                   
                        // Destroy the current instance of the spell
                        call this.destroy()
                       
                        // Remove the plane
                        call RemoveUnit(plane[this])
                       
                        // Timer Utils is optional :3
                        // This is a pretty ugly way of creating a special effect with a Z-coordinate.
                        static if LIBRARY_TimerUtils then
                            call TimerStart(NewTimerEx(Particle.createEx(Player(13), planeX[this], planeY[this], BOMB_HEIGHT, 0, 0, 1, 255, 255, 255, 255, PLANE_OUT_EFFECT, 0)), DESTROY_OUT_EFFECT_PARTICLE_AFTER, false, function thistype.destroyParticle)
                        else
                            set t = CreateTimer()
                            set timerData[GetHandleId(t)] = Particle.createEx(Player(13), planeX[this], planeY[this], BOMB_HEIGHT, 0, 0, 1, 255, 255, 255, 255, PLANE_OUT_EFFECT, 0)
                            call TimerStart(t, DESTROY_OUT_EFFECT_PARTICLE_AFTER, false, function thistype.destroyParticle)
                            set t = null
                        endif
                       
                        // Null variables
                        set caster[this] = null
                        set plane[this] = null
                        set bomb[this] = null
                        set owner[this] = null
                    endif
                else
                    // If the height of the bomb is close to 0
                    if height[this] <= 5 then
                       
                        // Destroy the bomb and create the explosion
                        call RemoveUnit(bomb[this])
                       
                        static if LIBRARY_TimerUtils then
                            call TimerStart(NewTimerEx(Particle.createEx(Player(13), dropX[this], dropY[this], 0, 0, 0, 1, 255, 255, 255, 255, EXPLOSION_EFFECT, 0)), DESTROY_EXPLOSION_AFTER, false, function thistype.destroyParticle)
                        else
                            set t = CreateTimer()
                            set timerData[GetHandleId(t)] = Particle.createEx(Player(13), dropX[this], dropY[this], 0, 0, 0, 1, 255, 255, 255, 255, EXPLOSION_EFFECT, 0)
                            call TimerStart(t, DESTROY_EXPLOSION_AFTER, false, function thistype.destroyParticle)
                            set t = null
                        endif
                       
                        // Loop through all units in the area
                        call GroupEnumUnitsInRange(enumGroup, dropX[this], dropY[this], radius[this] + MAX_COLLISION, null)
                        loop
                            set u = FirstOfGroup(enumGroup)
                            exitwhen u == null
                            call GroupRemoveUnit(enumGroup, u)
                           
                            // Check if the target unit passes the filter and make sure he's in the blast radius.
                            if TargetFilter(owner[this], caster[this], u) and IsUnitInRangeXY(u, dropX[this], dropY[this], radius[this]) then
                               
                                set x = GetUnitX(u) - dropX[this]
                                set y = GetUnitY(u) - dropY[this]
                               
                                // If the unit is closer than the bonusRange
                                if x*x+y*y <= bonusRadius[this] then
                                    // We deal the bonus damage
                                    call UnitDamageTarget(caster[this], u, bonusDamage[this], false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                                else
                                    // Else, we deal the normal damage
                                    call UnitDamageTarget(caster[this], u, damage[this], false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                                endif
                            endif
                        endloop
                       
                        static if DESTROY_TREES then
                            call SetRect(treeRect, dropX[this] - radius[this], dropY[this] - radius[this], dropX[this] + radius[this], dropY[this] + radius[this])
                           
                            // Cache tree destroy data
                            set treesRadius = radius[this]*radius[this]
                            set treesX = dropX[this]
                            set treesY = dropY[this]
                           
                            // Enumerate through all destructables in the rect
                            call EnumDestructablesInRect(treeRect, null, function thistype.destroyTree)
                        endif
                       
                        // The counter is now going to be used to determine
                        // the number of iterations before the spell ends.
                        set counter[this] = R2I(PLANE_AFTER_DROP * 32)
                        set exploded[this] = true
                    else
                        // Decrease the bomb's height a bit
                        set height[this] = height[this] - speed[this]
                        call SetUnitFlyHeight(bomb[this], height[this], 0)
                       
                        // Accelerate drop speed
                        set speed[this] = speed[this] + BOMB_DROP_ACCEL
                    endif
                endif
            else
                // Decrease the counter by 1
                set counter[this] = counter[this] - 1
                // When the counter is 0, the plane has reached it's destination.
                if counter[this] == 0 then
                    // Store the dropX and dropY coordinates
                    set dropX[this] = planeX[this]
                    set dropY[this] = planeY[this]
                   
                    // Create the bomb under the plane
                    set bomb[this] = CreateUnit(DUMMY_OWNER, BOMB_CODE, dropX[this], dropY[this], 0)
                   
                    // Set the bomb's height
                    call UnitAddAbility(bomb[this], 'Amrf')
                    call UnitRemoveAbility(bomb[this], 'Amrf')
                    call SetUnitFlyHeight(bomb[this], BOMB_HEIGHT, 0)
                   
                    // We have dropped the bomb
                    set dropped[this] = true
                   
                    // Set the bomb height and the bomb drop speed
                    set height[this] = BOMB_HEIGHT
                    set speed[this] = BOMB_DROP_SPEED
                endif
            endif
        implement CTLNull
            set u = null
        implement CTLEnd
       
        private static method run takes nothing returns nothing
            local thistype this = create()
            local real x = GetSpellTargetX()
            local real y = GetSpellTargetY()
            local real a
            local real s
            local real cos
            local real sin
            local timer t
           
            // Set the caster and the owner and the level of the ability
            set caster[this] = GetTriggerUnit()
            set owner[this] = GetTriggerPlayer()
            set level[this] = GetUnitAbilityLevel(caster[this], ABIL_CODE)
           
            // Cache angle data
            set a = Atan2(y - GetUnitY(caster[this]), x - GetUnitX(caster[this]))
            set cos = Cos(a)
            set sin = Sin(a)
           
            // Set the plane coordinates
            set planeX[this] = x - PLANE_DISTANCE * cos
            set planeY[this] = y - PLANE_DISTANCE * sin
           
            // Create the plane
            set plane[this] = CreateUnit(DUMMY_OWNER, PLANE_CODE, planeX[this], planeY[this], a * bj_RADTODEG)
           
            // Set the speed and x/yOffsets per timeout
            set s = GetPlaneSpeedFactor(level[this])
            set xDis[this] = cos * s
            set yDis[this] = sin * s
           
            // We haven't dropped or exploded the bomb
            set dropped[this] = false
            set exploded[this] = false
           
            // Number of iterations before the bomb drops
            set counter[this] = R2I(PLANE_DISTANCE / s)
           
            // Set the plane's height
            call UnitAddAbility(plane[this], 'Amrf')
            call UnitRemoveAbility(plane[this], 'Amrf')
            call SetUnitFlyHeight(plane[this], BOMB_HEIGHT, 0)
           
            // TimerUtils is optional
            // This is an ugly way of creating a special effect with Z
            static if LIBRARY_TimerUtils then
                call TimerStart(NewTimerEx(Particle.createEx(Player(13), planeX[this], planeY[this], BOMB_HEIGHT, 0, 0, 1, 255, 255, 255, 255, PLANE_IN_EFFECT, 0)), DESTROY_IN_EFFECT_PARTICLE_AFTER, false, function thistype.destroyParticle)
            else
                set t = CreateTimer()
                set timerData[GetHandleId(t)] = Particle.createEx(Player(13), planeX[this], planeY[this], BOMB_HEIGHT, 0, 0, 1, 255, 255, 255, 255, PLANE_IN_EFFECT, 0)
                call TimerStart(t, DESTROY_IN_EFFECT_PARTICLE_AFTER, false, function thistype.destroyParticle)
                set t = null
            endif
           
            // Set the damage and the radius
            set damage[this] = GetDamage(level[this])
            set radius[this] = GetDamageRadius(level[this])
           
            // Set the bonus damage and the bonus radius
            set a = GetBonusDamageRadius(level[this])
            set bonusRadius[this] = a*a
            set bonusDamage[this] = GetBonusDamageFactor(level[this])*damage[this]
        endmethod
       
        private static method onInit takes nothing returns nothing
            // Register the spell to SpellEffectEvent
            call RegisterSpellEffectEvent(ABIL_CODE, function thistype.run)
           
            static if DESTROY_TREES then
                set treeDetector = CreateUnit(Player(15), 'hfoo', 0, 0, 0)
                call UnitAddAbility(treeDetector, 'Ahrl')
                call UnitAddAbility(treeDetector, 'Aloc')
                call ShowUnit(treeDetector, false)
                set treeRect = Rect(0,0,0,0)
            endif
           
            // If you don't have TimerUtils, you need a Table
            static if not LIBRARY_TimerUtils then
                set timerData = Table.create()
            endif
        endmethod
    endstruct
endlibrary


Finally, after more than a year, I've updated this spell and it works perfectly :)
It used to be in GUI, but I finally had the time to rewrite and fix it.

Oh, and the testmap is a must-see ;)
I made it so that it's like a demonstration :D
Just type 'start', then sit back and watch the show 8)

Keywords:
Bomb, Bomber, Nuke, Nuclear, Explosion, Magtheridon96, Explode, Atom, Atomic, Naruto, DotA, Kamehameha, Omnislash, Meathook, Meat hook.
Contents

new map (Map)

Reviews
Moderator
6 April 2012 Bribe: This is a very good example of well-written, readable code, and since it works flawlessly from what I can tell from my tests, I will go for approving this.
  1. 6 April 2012
    Bribe: This is a very good example of well-written, readable code, and since it works flawlessly from what I can tell from my tests, I will go for approving this.
     
  2. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Sorry I deleted v1.0 instead of updating. I'm new here.
     
    Last edited: Apr 28, 2012
  3. x3GlikE

    x3GlikE

    Joined:
    Jul 7, 2010
    Messages:
    658
    Resources:
    0
    Resources:
    0
    testing...

    Please post your triggers, Your triggers are MUI and leak less I think.

    The spell is to simple, And you leak one thing the loc you didn't remove it.
    • Unit - Create 1 Atomic Bomb for ect at Atomic_Target
     
  4. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Trigger
    • Custom script: call RemoveLocation ( udg_AtomicBomb_Target_Point[udg_AtomicBomb_Index] )


    I fixed it. :ogre_haosis: :goblin_yeah:

    I hope there aren't anymore leaks.

    Oh and btw i forgot to write a Changelog ( even though it's almost nothing )

    The full trigger is below:

    Trigger
    • Atomic Bomb
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Atomic Bomb
      • Actions
        • Set AtomicBomb_Index = (AtomicBomb_Index + 1)
        • Set AtomicBomb_Caster[AtomicBomb_Index] = (Casting unit)
        • Set AtomicBomb_Level[AtomicBomb_Index] = (Level of Atomic Bomb for AtomicBomb_Caster[AtomicBomb_Index])
        • Set AtomicBomb_Damage[AtomicBomb_Index] = (100 + (AtomicBomb_Level[AtomicBomb_Index] x 125))
        • Set AtomicBomb_Target_Point[AtomicBomb_Index] = (Target point of ability being cast)
        • Unit - Create 1 Dummy (rocket) for (Owner of AtomicBomb_Caster[AtomicBomb_Index]) at AtomicBomb_Target_Point[AtomicBomb_Index] facing Default building facing degrees
        • Set AtomicBomb_Dummy[AtomicBomb_Index] = (Last created unit)
        • Unit - Add a 1.00 second Generic expiration timer to AtomicBomb_Dummy[AtomicBomb_Index]
        • Animation - Change AtomicBomb_Dummy[AtomicBomb_Index] flying height to 0.00 at 800.00
        • Custom script: call RemoveUnit ( udg_AtomicBomb_Dummy[udg_AtomicBomb_Index] )
        • Unit - Create 1 Atomic Bomb Dummy for (Owner of AtomicBomb_Caster[AtomicBomb_Index]) at AtomicBomb_Target_Point[AtomicBomb_Index] facing Default building facing degrees
        • Set AtomicBomb_Group[AtomicBomb_Index] = (Units within 1200.00 of AtomicBomb_Target_Point[AtomicBomb_Index])
        • Unit Group - Pick every unit in AtomicBomb_Group[AtomicBomb_Index] and do (Actions)
          • Loop - Actions
            • Unit - Cause AtomicBomb_Caster[AtomicBomb_Index] to damage (Picked unit), dealing (Real(AtomicBomb_Damage[AtomicBomb_Index])) damage of attack type Chaos and damage type Normal
            • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Environment\UndeadBuildingFire\UndeadLargeBuildingFire2.mdl
            • Special Effect - Destroy (Last created special effect)
        • Custom script: call DestroyGroup ( udg_AtomicBomb_Group[udg_AtomicBomb_Index] )
        • Custom script: call RemoveLocation ( udg_AtomicBomb_Target_Point[udg_AtomicBomb_Index] )


    If you find any more problems or have any advice on how I can improve the spell, please notify me as soon as possible.
     
    Last edited: Apr 28, 2012
  5. NoMoreChallenge

    NoMoreChallenge

    Joined:
    Nov 14, 2009
    Messages:
    192
    Resources:
    0
    Resources:
    0
    Please don't multi post and OMG it's :vw_wtf: big
     
  6. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    First, dont multi post... next don't advertise...

    and its pretty big for a simple spell, does it have custom models? if yes, then remove them...

    and there's no use using the index since its just an instant spell...
     
  7. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I only used the index just in case 2 heroes used the same spell at the same time - very rare, but just to stay on the safe side ;)
     
  8. Laserdude

    Laserdude

    Joined:
    Jun 30, 2010
    Messages:
    246
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Nice eyecandy, but, very simple, and, the spell effects could be improved, as if a bomb is dropped form the sky as a visual effect and when it reaches the ground, it detonates. It could be improved further by letting a plane or helicopter drop the bomb.
    Also, you have a poor description.
    The model is a bit useless, and it seems to bug when it is used in shallow water (look at the water that is yellow).
     
  9. Ironside

    Ironside

    Joined:
    Feb 3, 2009
    Messages:
    2,723
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Make the dummy unit die at the end. Also at least make it destroy trees too....
     
  10. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    i'll improve everything on friday cuz im kind of busy right now (homework, tests, all that shit). But keep giving me feedback cuz this spell does need a little bit of improvement.
    i'll add more special effects, make it destroy trees and destructibles, and the plane drop thing sounds good. On the weekend i'll upload v1.3. Till then, keep giving me feedback.
     
  11. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    its instant so you dont have to worry about two heroes casting at the same time... even if two or more heroes cast this at same time, it still won't bug... so just remove those useless indexes... its a waste of memory and processing power...
     
  12. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    k. thanks for the advice :)
     
  13. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    and maybe try to do an in-game screenie of the spell in action, coz it looks like it was from WE...

    not to say that the index you used is bad (coz you just add 1 every time, once you reach 8192?, ur doomed...)
     
    Last edited: Jan 24, 2011
  14. Laserdude

    Laserdude

    Joined:
    Jun 30, 2010
    Messages:
    246
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Well, since you can see the starting pos in the screenshot, I am almost certain it is from WE.
    And as said, the index is useless, unless you add all the things you hav epromised, cause a delayed spell would require an indexing system or hashtables.
     
  15. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    and you don't kill the second dummy unit in your triggers... so it stays there and causes leaks...
     
  16. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Object editor:
    *Give the ability a bit of follow through time (about a second or two) so it plays the caster's animation.
    *Enable Targeting image in Options for the ability
    *Set the AoE
    *The dummies have sight radius of 1. Why not 0?

    Trigger editor:
    *Do the real conversion of the damage outside the unit group loop.
    *What is the first dummy supposed to do? You remove it instantly so it doesn't show at all.
    *You could add a trigger that actually shows the bomb flying to the targeted point. Now the spell is too simple.
    *The damage could be distance dependant, since atomic bomb explosion on ground level causes the most overpressure at close range and less at further away.
    *Rather than using a variable fot the group, do this, it's faster:
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit Units within 1200.00 of AtomicBomb_Target_Point and do (Actions)
      • Loop - Actions
     
  17. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    ok thanks for the advice guys. i'm going to change the spell almost completely. I'll make a B2 bomber come and drop the bomb, and then it will detonate. And as you said Maker, i'll change the damage to range-dependent. :) i'm so glad u guys are there to help me improve. i've learned a lot about writing spells, fixing leaks, indexing, recycling indexes, and many other stuff - All thanks to you :D




    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    GUYS!!! I rewrote the spell!
    Check it out. It's much better now!!
    Hope you like it! :D
     
    Last edited: Jan 24, 2011
  18. Laserdude

    Laserdude

    Joined:
    Jun 30, 2010
    Messages:
    246
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Your new verison is not MUI.
    If the spell is cast twice in a row, the first plane stops moving, without dropping the bomb.
    Also, you still have a cooldown on your spell. Remove it, since you get no cooldown by pressing ESC anyway, so it is useless.
    The new effects is fine, allthought I do not like the way the bomb is travelling. It is travelling at full speed at start. Make the speed increase over-time.
    And, the chopper would look better if it would come down from the clouds and then go back up after the bomb is dropped. Also, increase the bomb falling height.

    Fixes needed:
    -Make it MUI
    -Update your spell targeting.
    -Remove the ESC trigger and simply set the HP and Mana regen to 1000 and set ability cooldown to 0.

    I think that is all, for now.
    Hope this helps!
     
  19. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    thanks. i'm working on it right now! i think that i should use hastables instead of indexing, but i have ABSOLUTELY NO IDEA how to work with hashtables. I'll take a tutorial, update the spell, then i'll show it to you.