• 🏆 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!

Fireball v.9.9.5

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


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



JASS:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                              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
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...

Moderator

M

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

Approved
 
Level 6
Joined
Nov 11, 2008
Messages
61
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:

N.O

N.O

Level 6
Joined
Feb 20, 2009
Messages
200
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...
 
Level 14
Joined
Jan 15, 2007
Messages
349
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:
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:
Level 14
Joined
Jan 15, 2007
Messages
349
Anachron said:
Nobody cares about that, Hanky.

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...
Anachron said:
p and cJass are still in developing.

vJASS is also still developing...

Anachron said:
Still, only vJass is approveable until yet, because it has been used for ages now...

Didn't I said that just with other words?
 
Level 6
Joined
Jan 6, 2006
Messages
204
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:
Level 14
Joined
Jan 15, 2007
Messages
349
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.

XenoStalker said:
A moderator had to learn vJass when it came out... I don't see why a moderator can't learn cJass

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:
Level 11
Joined
Apr 6, 2008
Messages
760
JASS:
if (data.N>0)
                {
                    TimerStart(data.T, 1/FPS, true, function callback);
                }

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

JASS:
if (data.N==1)
                {
                    TimerStart(data.T, 1/FPS, true, function callback);
                }
should be like that
 
Level 14
Joined
Jan 15, 2007
Messages
349
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.
 
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 )
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.
 
Top