1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Choose the best Old Gods themed skin at the Texturing Contest #29 - Poll!
    Dismiss Notice
  3. Melee Mapping Contest #2 - Poll is up! Vote for the best competitive 1v1 map!
    Dismiss Notice
  4. Please help test custom maps and more on the latest PTR!
    Dismiss Notice
  5. Evolution complete! Make Darwin proud and go vote in the Techtree Contest #12 - Poll.
    Dismiss Notice
  6. Icon Contest #17 - Results are out! Step by to congratulate our winners!
    Dismiss Notice
  7. We've created the Staff Job Openings thread. We're currently in need of icon, video production, and social/multimedia positions to be filled. Thank you!
    Dismiss Notice

Fireball v.9.9.5

Submitted by Darkt3mpl3r
This bundle is marked as approved. It works and satisfies the submission rules.
Requires:
Jasshelper (0.A.2.2) or later
Good grasp of Jass to modify

Short Description:
Throws a fireball at a target location and deals damage upon impact. Deals half damage to buildings.

Spell by Darkt3mpl3r
Knockback library by Silvenon

Hope your enjoy this spell.

Greetz to my mates Hanky, JonNny, Paladon, eccho, Toadcop, De.Facto, M]ath, WaRadius, Dingo and all others

Changelog:

v.9.9.5 removed boolexpr due to fix by blizzard, tweaked format
v.9.9.4 added multiple missiles, fixed a small leak
v.9.9.3 removed all imported effects
v.9.9.2 added more eyecandy
v.9.9.1 added missile sizing
v.9.9.0 fixed a boolean operator, added tree destruction
v.9.8.9 fixed flying over cliffs
v.9.8.8 changed spell icon
v.9.8.7 initial release


Spellcode:

Code (vJASS):

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                              Fireball v.9.9.5
//                          created by Darkt3mpl3r
//
//
//               °                                        Mapmaking since 2006...
//            °
//          °
//         °
//       °°°ÛÜ
//      °°X°ÛÛÛ                          ÛÛÛÛÛÛÛÛ     ÿÜÛÛÛÛÛÛÛÛÜ
//     °°XX° ÛÛÛ        ßÛÛÛÛÛ        ÛÛÛÛÛÛÛÛÛÛÛÛ   ÛÛÛÛÛÛÛÛÛÛÛÛÛ
//     °XX ° ÛÛÛÛ         ÛÛÛÛÜ     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//     °XX °  ÛÛÛÛÛ        ÛÛÛÛ    ÛÛÛÛÛß    ßÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  
//    °°XXX°° ÛÛÛÛÛÛÜ       ÛÛÛÜ  ÛÛÛÛÛ        ßÛÛÛÛÛ ßÛÛÛÛ    ÛÛÛÛÛÛ  
//   °°°°°°°°  ÛÛÛÛÛÛÛ      ÛÛÛÛ  ÛÛÛÛ                 ÛÛÛÛ      ÛÛÛÛÜ  
//             ÛÛÛÛÛÛÛÛ     ÛÛÛÛ  ÛÛÛÛ        ÛÛÛÛÛÛÛ  ÛÛÛÛÛÜ     ÛÛÛÛ  
//   °°°°°°°°  ÛÛÛÛÛÛÛÛÛ    ÛÛÛÛÜ  ÛÛÛÛÜ     ÛÛÛÛÛÛÛÛ   ÛÛÛÛÛÜ  ÜÛÛÛÛÛÛ  
//   °°XXXXX°   ÛÛÛÛ  ÛÛÛÜ  ÛÛÛÛÛ   ÛÛÛÛÛÛÜ    ßÛÛÛÛÛ   ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  
//   °°XXXXX °° ÛÛÛÛ   ÛÛÛÛÜ ÛÛÛÛ °°°ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°°° ÛÛÛÛÛÛÛÛÛÛÛÛÛß  
//   °  XXXXX °°ÛÛÛÛÛ°°°°ÛÛÛÛÛÛÛÛ°°XX ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ XXX°°ÛÛÛÛÛÛÛÛÛÛÛ     ÛÛÛ
//   °°  XXXXX ÜÛÛÛÛÛÛ X ÛÛÛÛÛÛÛÛÛ XXX ÛÛÛÛÛÛÛÛÛÛÛ  XXXXXX  ÛÛÛÛÛÛÛ°      ÛÛÛ
//    °°  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX °°°°°°   °°°°
//     °°   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX °°°°°X°°
//      °°°  XXXXXXXXXX  °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° XXXXXXXXXXXXXXXXX°°
//        °°°°°°°°°°°°°°°°                                  °°°°°°°°  XXXXXXX °°°
//                                                                  °°°°°° XX °°
//   ...2009 and still moving on.                                        °°°°°°°
//    
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//! zinc

    library fireball requires Knockback
    {   //=========================== Setup ===========================
        // Main Configuration
        constant integer SPELL_ID = 'Afir';  /* Fireball Spell Rawcode*/
        constant integer UNIT_ID  = 'dsfx';  /*   Dummy Unit Rawcode  */
       
        constant integer MISSILE_COUNT = 3;  /*   Number of Missiles  */
       
        constant real FPS         = 32.0;    /* Iterations per second */
       
        // Effects
        constant string ATTACH_FX = "Abilities\\Spells\\Other\\Volcano\\VolcanoMissile.mdl";     // model attachment
        constant string ATTACH_SX = "Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl"; // Another attachment
        constant string VANISH_FX = "Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl";  // Random Appearing Effect
        constant string GROUND_FX = "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl";       // Impact(ground) Effect
       
        constant string HIT_FX    = "Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnBirthMissile.mdl";
        constant string HIT_POINT = "chest"; /* Attachment Point of HIT_FX */
       
        constant real UNITSCALE   = 0.85;    /* Missile Scaling */
       
        // Knockback & AoE
        constant real KNOCKBACK      = 40.0; /* Minimal Knockback Distance */
        constant real KNOCKBACK_AMP  = 200.; /* Max = KNOCKBACK + KNOCKBACK_AMP */
        constant real KNOCKBACK_DUR  = 1.00; /* Time in seconds */
       
        constant real GROUND_RADIUS  = 256.; /* Area of Effect  */
       
        // Missile Behaviour
        constant real DEFAULT_HEIGHT = 48.0;
        constant real DEFAULT_OFFSET = 64.0;
        constant real DEFAULT_SPEED  = 300.;
        constant real ACCELERATION   = 10.0;
        constant real HEIGHT_FACTOR  = 0.40; /* MAX_DISTANCE* FACTOR */
        constant real ROTATIONS      = 1.00; /* Rotations per second */
        constant real CASTRANGE      = 1200; /* Maximum  Cast  Range */
        constant real AMPLITUDE      = 15.0; /* Better keep this low */
       
        // Damage Function. Use "return VALUE*level;" to set your spell damage
        function dmg(integer level) ->integer{return 5+level*25;}    
        constant real BUILDING_FACTOR = 0.5; /* Damage to buildings  */
       
        constant boolean DESTROY_TREES = true;
        //========================End of Setup ========================
       
        real pass_x, pass_y; rect pass_r;
        unit pass_c; group g; integer pass_i;
        location tmploc=Location(0,0);
       
       
        function callback()
        {
            data d;
            integer i=data.N;
           
            real x;
            real y;
            real z;
           
            while (i>0)
            {
                i=i-1;
                d=data.V[i];
               
                d.s=d.s+ACCELERATION/FPS;
                d.d=d.d+d.s;
                d.t=d.t+(2*bj_PI)/(FPS/ROTATIONS);
               
                MoveLocation(tmploc, GetUnitX(d.c), GetUnitY(d.c));
                z=GetLocationZ(tmploc)+GetUnitFlyHeight(d.c);
               
                x=GetUnitX(d.c) + d.s*Cos(d.a) + d.q*Cos(d.t);
                y=GetUnitY(d.c) + d.s*Sin(d.a) + d.q*Sin(d.t);
                z=Sin(d.d/d.md*bj_PI)*d.h+DEFAULT_HEIGHT;
               
                MoveLocation(tmploc, x, y);
                z=z-GetLocationZ(tmploc);
               
                SetUnitX(d.c, x);
                SetUnitY(d.c, y);
                SetUnitFlyHeight(d.c, z, 0.);
               
               
                if (GetRandomInt(0,3)==0)
                {
                DestroyEffect(AddSpecialEffectTarget(VANISH_FX, d.c, "origin"));
                }
               
                if (d.d>=d.md)
                {
                    DestroyEffect(AddSpecialEffect(GROUND_FX, x, y));
                   
                    pass_x=x;
                    pass_y=y;
                    pass_c=d.x;
                    pass_i=d.i;
                    pass_r=Rect(x-GROUND_RADIUS, y-GROUND_RADIUS, x+GROUND_RADIUS, y+GROUND_RADIUS);
                   
                    GroupEnumUnitsInRange(g, x, y, GROUND_RADIUS, null);
                    ForGroup(g, function()
                    {
                    if (IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(pass_c)) && (GetWidgetLife(GetEnumUnit())>=0.405))
                    {
                        if (IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE)==false)
                        {
                            Knockback(GetEnumUnit(),(KNOCKBACK_AMP/SquareRoot((GetUnitY(GetEnumUnit())-pass_y)*(GetUnitY(GetEnumUnit())-pass_y)+(GetUnitX(GetEnumUnit())-pass_x)*(GetUnitX(GetEnumUnit())-pass_x)))+KNOCKBACK,Atan2(GetUnitY(GetEnumUnit())-pass_y,GetUnitX(GetEnumUnit())-pass_x),KNOCKBACK_DUR);
                            UnitDamageTarget(pass_c, GetEnumUnit(), dmg(pass_i), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS);
                            DestroyEffect(AddSpecialEffectTarget(HIT_FX, GetEnumUnit(), HIT_POINT));
                            }
                        else
                        {
                            UnitDamageTarget(pass_c, GetEnumUnit(), BUILDING_FACTOR*dmg(pass_i), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS);
                            DestroyEffect(AddSpecialEffectTarget(HIT_FX, GetEnumUnit(), "origin"));
                            }
                        }
                    } );
                    EnumDestructablesInRect(pass_r, null, function()
                    {
                        destructable d = GetEnumDestructable();
                        unit u         = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), UNIT_ID, GetWidgetX(d), GetWidgetY(d), 0);
                        UnitAddAbility(u, 'Ahrl');
                        if (IssueTargetOrder(u, "harvest", d)) {KillDestructable(d);} // achieved by Pitzermike
                        RemoveUnit(u);
                        u=null;
                        d=null;
                    } );
                   
                    d.destroy();
                    data.N=data.N-1;
                    data.V[i]=data.V[data.N];
                }
               
            }
        }
       
        struct data
        {
            unit c;
            unit x;
            effect fx;
            effect sx;
           
            integer i;
           
            real a;
            real s;
            real h;
           
            real md;
            real d;
           
            real t;
            real q;
           
            static integer N=0;
            static data    V[];
            static timer T=CreateTimer();
           
           
            static method create (unit caster, real x, real y, real a) -> data
            {
                data d=data.allocate();
                real cx=GetUnitX(caster)+DEFAULT_OFFSET*Cos(a);
                real cy=GetUnitY(caster)+DEFAULT_OFFSET*Sin(a);
               
                d.x = caster;
                d.c = CreateUnit(GetOwningPlayer(caster), UNIT_ID, cx, cy, a*bj_RADTODEG);
                d.i = GetUnitAbilityLevel(d.x, SPELL_ID);
                d.fx= AddSpecialEffectTarget(ATTACH_FX, d.c, "origin");
                d.sx= AddSpecialEffectTarget(ATTACH_SX, d.c, "origin");
                d.md= SquareRoot((cx-x)*(cx-x)+(cy-y)*(cy-y));
                d.d = 0;
                d.a = a;
                d.s = DEFAULT_SPEED/FPS;
                d.h = d.md*HEIGHT_FACTOR;
                d.t = a;
                if (GetRandomInt(0, 1) == 1) d.q =(d.md/(CASTRANGE+DEFAULT_OFFSET))*AMPLITUDE;
                else                         d.q =-(d.md/(CASTRANGE+DEFAULT_OFFSET))*AMPLITUDE;
               
                SetUnitScale(d.c, UNITSCALE, UNITSCALE, UNITSCALE);
               
                UnitAddAbility(d.c,    'Amrf');
                UnitRemoveAbility(d.c, 'Amrf');
                SetUnitX(d.c, cx);
                SetUnitY(d.c, cy);
                SetUnitFlyHeight(d.c, DEFAULT_HEIGHT, 0.);
               
                data.V[data.N]=d;
                data.N=data.N+1;
                if (data.N==1)
                {
                    TimerStart(data.T, 1/FPS, true, function callback);
                }
               
                return d;
            }
           
            method onDestroy()
            {
                UnitApplyTimedLife(this.c, 'BTLF', 5.0);
                DestroyEffect(this.fx);
                DestroyEffect(this.sx);
                this.c=null;
                this.x=null;
            }
        }
       
       
        function onSpellCast()
        {
            integer i=MISSILE_COUNT;
            unit u=GetTriggerUnit();
            real x=GetSpellTargetX();
            real y=GetSpellTargetY();
            real a;
            while (i>0)
            {
                a=Atan2(y-GetUnitY(u), x-GetUnitX(u));
                data.create(u,x,y,a);
                TriggerSleepAction(0.1);
                i=i-1;
            }
            u=null;
        }

       
        function spellIdMatch() -> boolean
        {
            return (GetSpellAbilityId() == SPELL_ID);
        }

       
        function onInit()
        {
            trigger t = CreateTrigger();
            TriggerAddAction(t, function onSpellCast);
            TriggerAddCondition(t, Condition(function spellIdMatch));
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT);
            g=CreateGroup();
        }
    }
   
//! endzinc
 



Keywords:
fireball, fire, ball, ngo, clan, missile, projectile, thecakeisalie, knockback
Contents

Fireball (Map)

Reviews
Moderator
22:04, 28th Oct 2009 TriggerHappy: Review for Fireball AFAIK we do allow zinc here. The coding looked good as far as I could see, but bare with me as I think {}'s in Jass look horrible. So I may have missed something. Status...
  1. 22:04, 28th Oct 2009
    TriggerHappy:

    Review for Fireball
    AFAIK we do allow zinc here. The coding
    looked good as far as I could see, but bare with
    me as I think {}'s in Jass look horrible. So I may
    have missed something.
    Status
    Approved
     
  2. Axarion

    Axarion

    Joined:
    Sep 30, 2009
    Messages:
    675
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Another Fireball xD Not really new but the coding looks nice and clean. Maybe a bit more documentation. 4/5
     
  3. Pakmand

    Pakmand

    Joined:
    Nov 11, 2008
    Messages:
    45
    Resources:
    0
    Resources:
    0
    first make i destroy destructible
    second the way it flys looks wierd make it fly more normal
    third rules it uses imported matrial and that is not need
    1 the icon should just be the normal fireball icon
    2 use the humand building big death as explosion
    3 use some thing like firelord misile or the fire ball misile
    and no imported matrial needed enymore !

    as it is know i would vote for rejected
    if updated as listed above it would get a usefull rating
     
    Last edited: Oct 28, 2009
  4. N.O

    N.O

    Joined:
    Feb 20, 2009
    Messages:
    195
    Resources:
    0
    Resources:
    0
    If you don't accept Cjass why does hive accept Vjass?
    Cjass is basically just another method of makeing jass simple just like whoever did for Vjass...
     
  5. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Since vJASS is much longer there than cJASS or ZINC. Maybe later those languages will be allowed but who knows. But well Dark can keep the ZINC part he just need to add conversation of his ZINC spell to vJASS.

    Edit: Aw... by the way good job with the spell. You didn't told me that you make a spell. Well whatever good job. Also I think he can keep the model. He just need to remove the icon since it's not really needed in my opinion.
     
    Last edited: Nov 23, 2009
  6. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,166
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    GUI: Basic blizzard language.
    JASS: Normal blizzard language.
    vJass: Advanced jass (Converted to jass)
    cJass: Advanced jass (Converted to vJass)
    ZINC: Advanced jass (Converted to vJass)
    pJass: Advanced jass (Converted to vJass)

    Still, only vJass is approveable until yet, because it has been used for ages now and its an overall language, which has thousands of coders.

    p and cJass are still in developing.

    (Such as Zinc)
     
    Last edited: Oct 28, 2009
  7. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Oho.. so you are nobody? :)

    Not everyone want to learn the syntax of cJASS or ZINC. Also it would be dumb if a moderator would need to learn cJASS and ZINC just that he can review those spells.

    And by the way...
    vJASS is also still developing...

    Didn't I said that just with other words?
     
  8. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,166
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Sorry m8, I missread. (You are totally right)
     
  9. Ciebron

    Ciebron

    Joined:
    Apr 6, 2008
    Messages:
    760
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Really look at the code, if you know vJass you prolly can learn Zinc on 10mins
     
  10. XenoStalker

    XenoStalker

    Joined:
    Dec 17, 2008
    Messages:
    294
    Resources:
    3
    Icons:
    1
    Maps:
    2
    Resources:
    3
    A moderator had to learn vJass when it came out... I don't see why a moderator can't learn cJass
     
  11. Darkt3mpl3r

    Darkt3mpl3r

    Joined:
    Jan 6, 2006
    Messages:
    201
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You got some good points there.

    Yes, much of the imported material is not nessecary needed but I wanted to bring some eyecandy into the map. I just like clean effects that differentiate from the special effects we know for 7 years now, yes I'm playing Warcraft III from the very beginning. I will change the spell icon, but I'm not quite sure what to do with the effects as I think the warcraft 3 effects kind of bland.

    With the upload of this zinc code I wanted to show the hive that there are new innovative jass languages that are very useful and shorter but yet they can be held very clean. We should evolve and not conservative bind to a static behaviour. I think that the 'common vJass guy' has no problem understanding this code by taking a sharp look - it's very logical.
    Right Axarion there are dozens of fireball around the warcraft 3 universum I just wanted it to have a more special projectile motion and I was thinking about adding some more special behaviour but nothing really quality stuff came into my mind.
    Btw Anachron all language other JASS are getting converted to Jass, not to vJass (as vJass is getting converted to Jass itself)
    I'll be adding a boolean to destroy destructables/trees upon impact

    Maybe I'll speak to you spell mods and ralle to get zinc approved on the hive as it is now a solid part of JassHelper.
     
    Last edited: Nov 1, 2009
  12. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Well Im just saying that there's no need for now that those moderators need to learn the syntax of cJASS (which is btw horrible imo) or ZINC. Well sure it's easy to learn the syntax of cJASS/ZINC but that's an other point.

    That's wrong. At the start of vJASS not everyone instantly switched to it. Just after a time nearly every JASS'er, including the moderators, learned the syntax of vJASS. But I want no drama here. Just accept the fact that cJASS and ZINC won't accepted here for now. But I think ZINC will accpeted here soon enough so calm down. I'll talk with the other spell moderators about it.

    Edit: Darkt3mpl3r could you please add a hidden tag for the spell code? Thanks.
     
    Last edited: Oct 29, 2009
  13. Ciebron

    Ciebron

    Joined:
    Apr 6, 2008
    Messages:
    760
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Code (vJASS):
    if (data.N>0)
                    {
                        TimerStart(data.T, 1/FPS, true, function callback);
                    }


    thats bad no need to start the timer everytime it gets cast

    Code (vJASS):
    if (data.N==1)
                    {
                        TimerStart(data.T, 1/FPS, true, function callback);
                    }
     

    should be like that
     
  14. Darkt3mpl3r

    Darkt3mpl3r

    Joined:
    Jan 6, 2006
    Messages:
    201
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Oh yes, you are right. My bad. I will fix it right away
     
  15. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,166
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Doesn't matter, ZINC, pJass and cJass spells can't be approved for now.
     
  16. Darkt3mpl3r

    Darkt3mpl3r

    Joined:
    Jan 6, 2006
    Messages:
    201
    Resources:
    1
    Spells:
    1
    Resources:
    1
    That's no excuse not improving this spell
     
  17. Hanky

    Hanky

    Joined:
    Jan 15, 2007
    Messages:
    353
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Ok I talked with the other spell moderators. The current status is that spells which are using cJASS or ZINC won't get approved at least for now. So if you want to get your spell approved you need to add a vJASS part.
     
  18. Darkt3mpl3r

    Darkt3mpl3r

    Joined:
    Jan 6, 2006
    Messages:
    201
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Ok thanks Hanky for telling. I'll see what I can do, but I'm kinda busy with other stuff aswell.
    Though I find it kinda weird because zinc is part of JassHelper ( vJass )
     
  19. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,166
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Still it doesn't matter, as ZINC, such as the other jass languages are, as mentioned, still converted to vJass, which is accepted as a standard.