1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  3. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  4. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  5. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

DD Universal Pack v5

Submitted by Dark_Dragon
This bundle is marked as approved. It works and satisfies the submission rules.
This pack contains many different type of spells.


My spell pack requires Jass NewGen Pack JNGP v2 (New) or JNGP v5d (Old). As well make sure to have newest JassHelper

This works with my edited libraries which are now in the map itself, you will need to copy and paste the library to your map once for all spells to work.



Changelog


v1 - First release with 3 spells:
- Slash Strike
- Electric Field
- Dark Torture


v2 - Few fixes + better test map + 1 new spell
- Frost Eruption


v3 - An extreme updata to my spell pack
- Heavy improved test map
- Fixed 'Handle Stack Corruption'
- Improved performances of all spells
- Added 4 new spells
- Shadow Crossing
- Algid Aura
- Nature Blessing
- Water Exhausting


v3b - Additional update to v3
- Fixed bug with Slash Strike
- Fixed bug with Nature Blessing
- Improved performances of Nature Blessing
- Made tooltips on Shadow Crossing and Dark Torture more readable


v4 - Fixed old rare bugs which i found out!
- Used my librarys on almost all spells
- Spells are now faster and less leakless (groupex)
- Added 3 new spells (4 spell was lost by me loosing electricity and all stuff was not saved...)
- Instinct Flash
- Terror Blade
- Black Magic


v4b - Made spells stable to work with default JNGP
- Fixed some minor and big bugs


v4c - Fixed more bugs
- Recompiled map in non-debug mode (forgot in v4b...)
- Used suggestions by Dr. Boom
- Fixed green buff in Water Exhausting
- Made Frost Eruption be based on Channel ability and give "target image"
- Some odd lag fixed...


v4d - Spells where broken for a long time now, so this update primarely fixes that
- Some code changes in library and spells
- Volume of sounds are now user configurable
- Fixed bug when sound fail to preload, thous sounds do not play when first casted
Sounds are now propertly preloaded


v4e - Fixed bug with Electric Field, when heros are killed they cant be revived. Now they can be revived.

v5 - Recoded many spells and made them compatible with new DD Library 1.2
- Electrolix Zap - Frost Eruption
- Frostmourne Impale - Nature Blessing
- Instinct Flash - Algid Aura





Description



Electrolix Zap

Calls for a bolts of lightning down from the sky to strike any enemy unit, dealing damage. Any unit that gets killed by this ability will be burned with lighting. The other units will get purged.


Code
Code (vJASS):

/*
 **********************************************************************************************************
 
          Installation:
 
  1) Make sure that you use Jass NewGen Pack editor and that you installed DD Library in your map
  2) Copy ElectrolixZap abilities (hero and dummy versions) to your map
  3) Export and Import 'thunder1.wav' sound from this map to yours
  4) Export and Import 'Great Lightning.mdx' model from this map to yours
  5) Copy this trigger to your map and modify it to your liking below
 
 **********************************************************************************************************
*/


//! zinc
library ElectrolixZap requires DDLib
{

 // *******************************************************************************
 
 // * Ability Id found in object editor
 // Default:  'elfd'
 constant integer    ABILITY_ELECTROLIX_ZAP        = 'elfd';
 
 // * Sound file being played when spell is cast
 // Default: "Custom\\Ambient\\thunder1.wav"
 constant  string     SOUND_THUNDER           = "Custom\\Ambient\\thunder1.wav";
 // Default: 100.
 constant  real     SOUND_THUNDER_VOL         = 100.;
 // Default: 3500.
 constant real    SOUND_MAX_DISTANCE         = 3500.;
 
 // * Should camera shake when spell is cast
 constant boolean    USE_CAMERA_NOISE         = true;
 // Default: 2.5
 constant real    CAMERA_NOISE_DURATION        = 2.5;
 
 // * Should terrain deformation happen?
 constant boolean    USE_TERRAIN_DEFORM         = true;
 // Default: 200.
 constant  real     TERRAIN_DEFORM_DEPTH         = 200.;
 // Default: 1.
 constant  real     TERRAIN_DEFORM_DURATION        = 1.;
 
 // * Primary lightning strike effect created during initial spell cast
 // Default: "Lightning\\Great Lightning.mdl"
 constant  string     EFFECT_GREAT_LIGHTNING         = "Lightning\\Great Lightning.mdx";
 
 // * Secondary lightning bolts created during initial spell cast
 // Default: "Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl"
 constant  string     EFFECT_LIGHTING_BOLT         = "Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdx";
 // Default: 15
 constant  integer    NUMBER_OF_LIGHTINING_BOLTS       = 15;
 // Default: 0.12 seconds
 constant  real     LIGHTNING_BOLT_STRIKE_INTERVAL       = 0.12;
 
 
 // * After initial primary and secondary bolts, wait for a while before damaging units
 constant real    THUNDER_DAMAGE_DELAY        = 0.6;
 
 // * Dealing damage and summon shield/lightning on targets
 // Default: "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdx"
 constant  string     EFFECT_LIGHTNING_UNIT_ZAP        = "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdx";
 
 // * Load dummies and shock target with forked lightning, add thunder clap effect and purge
 // Default: 'efef'
 constant  integer    ABILITY_DUMMY_ELECTRIC_SHOCK       = 'efef';
 // Default: 1000.
 constant real    DUMMY_LIGHTNING_HEIGHT        = 1000.;
 // Default: "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdx"
 constant  string     EFFECT_DUMMY_ELECTRIC_SHOCK       = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdx";
 // Deafault: 'Apg2'
 constant  integer    ABILITY_DUMMY_PURGE         = 'Apg2';
 
 // * Upon unit dying change its color and animation speed
 constant integer    COLOR_LIGHTNING_BURN_RED       = 00;
 constant integer    COLOR_LIGHTNING_BURN_GREEN       = 00;
 constant integer    COLOR_LIGHTNING_BURN_BLUE       = 00;
 constant real    COLOR_LIGHTNING_BURN_FADE_DURATION     = 5.;
 constant real    LIGHTNING_BURN_ANIMATION_SPEED      = .75;
 
 
 // * When unit gets burned, he gets 'ELECTRIFY_SFX' effect on him
 constant integer    ELECTRIFY_COUNT          = 4;
 constant real    ELECTRIFY_INTERVAL         = .66;
 constant string    ELECTRIFY_SFX          = "Abilities\\Weapons\\Bolt\\BoltImpact.mdx";
 
 
 
 // ==============================================================================================================================================
 // * Level data
 
 function InitElectrolixZapLevelData() {
  // * This is AOE (Area of Effect)/(radius) per level
  // Default 1: 610
  // Default 2: 660
  // Default 3: 705
  ELECTROLIX_ZAP_AOE[01]     = 610.;
  ELECTROLIX_ZAP_AOE[02]     = 660.;
  ELECTROLIX_ZAP_AOE[03]     = 705.;
 
  // This is damage to target per level
  // Default 1: 125
  // Default 2: 260
  // Default 3: 400
  ELECTROLIX_ZAP_DAMAGE[01]    = 125.;
  ELECTROLIX_ZAP_DAMAGE[02]    = 260.;
  ELECTROLIX_ZAP_DAMAGE[03]    = 400.;
 
  // This is the max damage spell can deal to all units
  // Default 1: 1000
  // Default 2: 2100
  // Default 3: 3250
  ELECTROLIX_ZAP_MAX_DAMAGE[01]   = 1000.;
  ELECTROLIX_ZAP_MAX_DAMAGE[02]   = 2100.;
  ELECTROLIX_ZAP_MAX_DAMAGE[03]  = 3250.;
 }
 
 
 //***********************************************************************
 //                    Main Unit Group Filter
 function ElecutixZapGroupFilter(unit f, player caster) -> boolean {
  return !IsUnitType(f, UNIT_TYPE_DEAD)    &&
      !IsUnitType(f, UNIT_TYPE_STRUCTURE)   &&
      !IsUnitType(f, UNIT_TYPE_MAGIC_IMMUNE) &&
      !IsUnitType(f, UNIT_TYPE_MECHANICAL)  &&
      IsUnitEnemy(f, caster)      &&
      IsUnitVisible(f, caster)     &&
      !DDIsUnitWard(f)       &&
      !DDIsUnitInvulnerable(f);
 }
 
 // *******************************************************************************
 // *    Spell other variables (non-modifiable)
 // *******************************************************************************
 
 
 effect    LastLigBolt   = null;
 real   ELECTROLIX_ZAP_AOE[];
 real   ELECTROLIX_ZAP_DAMAGE[];
 real   ELECTROLIX_ZAP_MAX_DAMAGE[];
 
 struct ezdata {
  unit u;
  real aoe;
  player owner;
  real x, y;
  real mxDmg, dmg;
  effect e[64];
  integer i=00;
  group g, dg;
   
  static thistype Temp  = p_null;
 }
 
 struct dmgdelay {
  unit u, f;
  real dmg;
  integer n;
 }
 
 struct unitfade {
  unit u;
  real r, g, b;
  real vr, vg, vb;
 }
 
 function RawDamage2Damage(unit u, real dmg) -> real {
  if (IsUnitType(u, UNIT_TYPE_HERO)) {
   if (UnitHasItemOfTypeBJ(u, 'brac'))
    return dmg*.5;
   return dmg*.75;
  }
  return dmg;
 }
 
 //===========================================================================
 // Main init electric field function
 function onInit() {
  //--------------------->
  //* Load init locals
  //<--------------------
  trigger   t = CreateTrigger();
 
  // *** Initialize constants
  InitElectrolixZapLevelData();
 
 
  // ###############################################################
        TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT);
        TriggerAddCondition(t, Condition(function() -> boolean {
   real   x = GetSpellTargetX(), y = GetSpellTargetY();
   unit   u = GetTriggerUnit();
   integer   lvl = GetUnitAbilityLevel(u, GetSpellAbilityId());
   integer   i;
   sound    s;
   real   d;
   p_real   pr;
            ezdata          ezd;
 
   if (GetSpellAbilityId() != ABILITY_ELECTROLIX_ZAP)
    return false;

   
   // Play sound and shake camera for players within spell cast range
   DDGenericSound(SOUND_THUNDER, SOUND_THUNDER_VOL, x, y, SOUND_MAX_DISTANCE, 1.);
   static if (USE_CAMERA_NOISE)
    DDCameraSetSourceNoiseForPlayers(x, y, 70., 1750., SOUND_MAX_DISTANCE, CAMERA_NOISE_DURATION);
   /*
   for (i=00; i < bj_MAX_PLAYERS; i+=01) {
    if (GetLocalPlayer() == Player(i)) {
     d = SquareRoot( Pw_2(GetCameraTargetPositionX()-x) + Pw_2(GetCameraTargetPositionY()-y) );
     if (d < SOUND_MAX_DISTANCE) {
      s = CreateSound(SOUND_THUNDER, false, false, false, 10, 10, "");
      SetSoundVolume(s, R2I(SOUND_THUNDER_VOL-d*(SOUND_THUNDER_VOL/SOUND_MAX_DISTANCE)));
      StartSound(s);
      KillSoundWhenDone(s);
      s = null;
     
      static if (USE_CAMERA_NOISE)
       CameraSetSourceNoise(70.-(d*(70./SOUND_MAX_DISTANCE)), 1750.-(d*(1750./SOUND_MAX_DISTANCE)));
     }
    }
   }
   
   static if (USE_CAMERA_NOISE)
    DDStartTim(CAMERA_NOISE_DURATION, false, p_null, function() {
     CameraSetSourceNoise(0., 0.);
    });
   
   */

   // * Terrain deformation crater action
   static if (USE_TERRAIN_DEFORM)
    TerrainDeformCrater(x, y, ELECTROLIX_ZAP_AOE[lvl], TERRAIN_DEFORM_DEPTH, R2I(TERRAIN_DEFORM_DURATION*1000.), false);
   
   // * Load main big thunder effect
   DestroyEffect(AddSpecialEffect(EFFECT_GREAT_LIGHTNING, x, y));
   
   // * Load extra lightning effects
   if (NUMBER_OF_LIGHTINING_BOLTS > 00) {
    pr = p_real.create();
    pr[00] = ELECTROLIX_ZAP_AOE[lvl]*ELECTROLIX_ZAP_AOE[lvl];
    pr[01] = x; pr[02] = y;
   
    DDStartTim(LIGHTNING_BOLT_STRIKE_INTERVAL, true, pr, function() {
     p_real pr  = DDTimData();
     real r   = SquareRoot( GetRandomReal(0., pr[00]) );
     real rad  = GetRandomReal(0., bj_PI*2.);
     
     DestroyEffect(LastLigBolt);
     if (DDTimTick() == NUMBER_OF_LIGHTINING_BOLTS) {
      LastLigBolt = null;
      pr.destroy();
      DDQuitTim();
      return;
     }
     
     LastLigBolt = AddSpecialEffect(EFFECT_LIGHTING_BOLT, pr[01] + r * Cos(rad), pr[02] + r * Sin(rad));
    });
   }
 
   ezd = ezdata.create();
   ezd.u = u;
   ezd.aoe = ELECTROLIX_ZAP_AOE[lvl];
   ezd.owner = GetOwningPlayer(u);
   ezd.x = x; ezd.y = y;
   ezd.dmg = ELECTROLIX_ZAP_DAMAGE[lvl];
   ezd.mxDmg = ELECTROLIX_ZAP_MAX_DAMAGE[lvl];
   
   DDStartTim(THUNDER_DAMAGE_DELAY, false, ezd, function() {
    ezdata.Temp = DDTimData();
    ezdata.Temp.g = DDLoadGroup();
   
    GroupEnumUnitsInRange(ezdata.Temp.g, ezdata.Temp.x, ezdata.Temp.y, ezdata.Temp.aoe, Filter(function() -> boolean {
     ezdata ezd = ezdata.Temp;
     
     if ( ElecutixZapGroupFilter(GetFilterUnit(), ezd.owner) ) {
      // *  Do pre-damage so taht creeps dont run away from invulnerable dummy units
      if (GetPlayerController(GetOwningPlayer(GetFilterUnit())) == MAP_CONTROL_CREEP)
       IssuePointOrder(GetFilterUnit(), "attack", GetUnitX(ezd.u), GetUnitY(ezd.u));
     
      ezd.e[ezd.i] = AddSpecialEffectTarget(EFFECT_LIGHTNING_UNIT_ZAP, GetFilterUnit(), "origin");
      ezd.i += 01;
     }
     
     return true;
    }));
   
    ezdata.Temp.dg = DDLoadGroup();
    DDStartTim(THUNDER_DAMAGE_DELAY, false, ezdata.Temp, function() {
     ezdata ezd = DDTimData();
     ezdata.Temp = ezd;
     ezd.dmg = RMinBJ(ezd.mxDmg/ezd.i, ezd.dmg);
     
     ForGroup(ezd.g, function() {
      ezdata ezd = ezdata.Temp;
      unit u = GetEnumUnit();
      real x = GetUnitX(u), y = GetUnitY(u);
      real rad = GetRandomReal(0., bj_PI*2);
      real dist = GetRandomReal(225., 375.);
      unit d = DDLoadSpellDummy(ezd.owner, x + dist * Cos(rad), y + dist * Sin(rad), ABILITY_DUMMY_ELECTRIC_SHOCK, 01);
      real dmg;
      dmgdelay dd;
     
      ezd.i -= 01;
      DestroyEffect(ezd.e[ezd.i]);
      ezd.e[ezd.i] = null;
     
      if (IsUnitEnemy(u, ezd.owner) && !IsUnitType(u, UNIT_TYPE_DEAD)) {
       SetUnitFlyHeight(d, DUMMY_LIGHTNING_HEIGHT, 0.);
       IssueTargetOrder(d, "chainlightning", u);
       DestroyEffect(AddSpecialEffectTarget(EFFECT_DUMMY_ELECTRIC_SHOCK, u, "origin"));
      }
     
      // * if unit dies, then dummy cant cast spell on that unit
      GroupAddUnit(ezd.dg, d);
      dmg = RawDamage2Damage(u, ezd.dmg);
      dd = dmgdelay.create();
      dd.u = ezd.u; dd.f = u;
      dd.dmg = dmg;
      dd.n = ELECTRIFY_COUNT;
      DDStartTim(.2, false, dd, function() {
       dmgdelay dd = DDTimData();
       unitfade uf;
       
       if (IsUnitEnemy(dd.f, GetOwningPlayer(dd.u)) && !IsUnitType(dd.f, UNIT_TYPE_DEAD)) {
        UnitDamageTarget(dd.u, dd.f, dd.dmg, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_UNKNOWN, null);
       
        SetUnitVertexColor(dd.f, COLOR_LIGHTNING_BURN_RED, COLOR_LIGHTNING_BURN_GREEN, COLOR_LIGHTNING_BURN_BLUE, 255);
        SetUnitTimeScale(dd.f, LIGHTNING_BURN_ANIMATION_SPEED);
        DDStartTim(ELECTRIFY_INTERVAL, true, dd, function() {
         dmgdelay dd = DDTimData();
         
         DestroyEffect(AddSpecialEffectTarget(ELECTRIFY_SFX, dd.f, "origin"));
         
         dd.n -= 01;
         if (dd.n == 00) {
          dd.destroy();
          DDQuitTim();
         }
        });
       
        if (IsUnitType(dd.f, UNIT_TYPE_HERO) || !IsUnitType(dd.f, UNIT_TYPE_DEAD)) {
         uf = unitfade.create();
         uf.u = dd.f;
         uf.r = COLOR_LIGHTNING_BURN_RED / 255.;
         uf.g = COLOR_LIGHTNING_BURN_GREEN / 255.;
         uf.b = COLOR_LIGHTNING_BURN_BLUE / 255.;
         uf.vr = DD_INTERVAL * (1.-uf.r) / COLOR_LIGHTNING_BURN_FADE_DURATION;
         uf.vg = DD_INTERVAL * (1.-uf.g) / COLOR_LIGHTNING_BURN_FADE_DURATION;
         uf.vb = DD_INTERVAL * (1.-uf.b) / COLOR_LIGHTNING_BURN_FADE_DURATION;
         
         DDStartTim(DD_INTERVAL, true, uf, function() {
          unitfade uf = DDTimData();
         
          uf.r += uf.vr;
          uf.g += uf.vg;
          uf.b += uf.vb;
         
          SetUnitVertexColor(uf.u, R2I(255.*Pw_2(uf.r)), R2I(255.*Pw_2(uf.g)), R2I(255.*Pw_2(uf.b)), 255);
         
          if (uf.r > 1.) {
           SetUnitTimeScale(uf.u, 1.);
           uf.u = null;
           uf.destroy();
           DDQuitTim();
          }
         
         });
        }
       
       } else
        dd.destroy();
       
       DDQuitTim();
      });
     
      d = null;
      u = null;
     });
     
     DDStartTim(.3, true, ezd, function() {
      ezdata.Temp = DDTimData();
     
      // First run, wait for 1 x .3 secs
      if (DDTimTick() == 00) {
       ForGroup(ezdata.Temp.dg, function() {
        unit e = GetEnumUnit(), t = FirstOfGroup(ezdata.Temp.g);
        UnitRemoveAbility(e, ABILITY_DUMMY_ELECTRIC_SHOCK);
        UnitAddAbility(e, ABILITY_DUMMY_PURGE);
        SetUnitX(e, GetUnitX(t)); SetUnitY(e, GetUnitY(t));
        IssueTargetOrder(e, "purge", t);
        GroupRemoveUnit(ezdata.Temp.g, t);
       
        e = null; t = null;
       });
       return;
      }
     
      // Second run, wait for 2 x .3 secs
      ForGroup(ezdata.Temp.dg, function() {
       UnitRemoveAbility(GetEnumUnit(), ABILITY_DUMMY_PURGE);
       DDRecycleDummy(GetEnumUnit());
      });
     
      DDRecycleGroup(ezdata.Temp.g);
      DDRecycleGroup(ezdata.Temp.dg);
      ezdata.Temp.destroy();
      DDQuitTim();
     });
     
     DDQuitTim();
    });
   
   
    DDQuitTim();
   });
 
   return false;
  }));
 
        t = null;
    }
}
//! endzinc


 


Frostmourne Impale

Shoots a wave of dark blades which damage any unit who comes in range and when they are hit they will be drastically slowed for short amount of time.


Code
Code (vJASS):

/*
 **********************************************************************************************************
 
          Installation:
 
  1) Make sure that you use Jass NewGen Pack editor and that you installed DD Library in your map
  2) Copy ElectrolixZap abilities (hero and dummy versions) to your map
  3) Export and Import 'thunder1.wav' sound from this map to yours
  4) Export and Import 'Great Lightning.mdx' sound from this map to yours
  5) Copy this trigger to your map and modify it to your liking below
 
 **********************************************************************************************************
*/


//! zinc
library NatureBlessing requires DDLib
{

  // This is the main raw code of ability Nature Blessing
  // Default: 'Nbls'
  constant integer   NATURE_BLESSING     = 'Nbls';
 
  // Natures shield effect model path
  // Default: "Spells\\NatureBlessing\\GaiaShield.mdx"
  constant string   NATURE_SHIELD_EFFECT   = "Spells\\NatureBlessing\\GaiaShield.mdx";
 
  // Natures missile effect model path
  // Default: "Spells\\NatureBlessing\\GaiaMissle.mdx"
  constant string   NATURE_MISSILE_EFFECT   = "Spells\\NatureBlessing\\GaiaMissle.mdx";
 
  // Natures explosion model effect path
  // Default: "Spells\\NatureBlessing\\NatureExplosion.mdx"
  constant string   NATURE_EXPLOSION_EFFECT   = "Spells\\NatureBlessing\\NatureExplosion.mdl";
 
  // Natures missile fire sound path (this sound is played when missiles start to move)
  // Default: "Abilities\\Spells\\NightElf\\Tranquility\\TranquilityTarget1.wav"
  constant string   NATURE_SHOOT_SOUND    = "Abilities\\Spells\\NightElf\\Tranquility\\TranquilityTarget1.wav";
  constant real   NATURE_SHOOT_SOUND_VOL   = 100.;
  constant real   NATURE_SHOOT_SOUND_PITCH  = 1.5;
  constant real   NATURE_SHOOT_SOUND_MAX_DISTANCE = 3500.;
 
  // Nature explosion sound file path (is played when nature explosion is caused)
  // Default: "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.wav"
  constant string   NATURE_EXPLOSION_SOUND   = "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.wav";
  constant real   NATURE_EXPLOSION_SOUND_VOL  = 90.;
 
  // This is number of nature missiles created
  // Default: 12
  constant integer   MISSILES_COUNT     = 12;
  // Default: 1.2
  constant real   MISSILE_SIZE     = 1.2;
 
  // This is min and max distance from caster to missiles start point
  // Default: 400 / 600
  constant real   MISSILE_MIN_DISTANCE   = 400.;
  constant real   MISSILE_MAX_DISTANCE   = 600.;
 
  // This is min and max finish height / caster position of missiles
  // Default: 75 / 400
  constant real   MISSILE_MIN_HEIGHT    = 40.;
  constant real   MISSILE_MAX_HEIGHT    = 400.;
 
  // This is missiles value which tells how much time they need to reach caster and how long it takse for them to manifest
  // Default: 0.75 / 0.5
  constant real   MISSILE_TRAVEL_TIME    = .9;
  constant real   MISSILE_BIRTH_TIME    = 0.5;
 
  // Default: 50
  constant real   MISSILE_INITIAL_HEIGHT   = 10.;
 
  // Default: 0.2 seconds
  constant real   HEAL_INTERVAL     = .2;
  // --------------------------------------------------------------
  // *** Do not edit level variables here edit them below ***
  real   EXPLOSION_AOE[];
  real   SHIELD_PROTECT[];
  real   HEAL_PERC_AMOUNT[];
  real   SPELL_DURATION[];
 
 // -----------------------------------------------------------------
 //     *** Edit level data here ***
 function NatureBlessingLevelSetup() {
  // This is AOE of explosion "effect"
  // Default: 410 / 530 / 650
  EXPLOSION_AOE[01] = 410.;
  EXPLOSION_AOE[02] = 530.;
  EXPLOSION_AOE[03] = 650.;
 
  // Shield protection is amount of damage reduced in percentage
  // Default: 15 / 25 / 35
  SHIELD_PROTECT[01] = 15.;
  SHIELD_PROTECT[02] = 25.;
  SHIELD_PROTECT[03] = 35.;
 
  // This is heal amount in percentage per point of life missing
  // Default: 5 / 7 / 9
  HEAL_PERC_AMOUNT[01] = 5.;
  HEAL_PERC_AMOUNT[02] = 7.;
  HEAL_PERC_AMOUNT[03] = 9.;
 
  // This is how long spell lasts in seconds
  // Default: 10 / 10 / 10
  SPELL_DURATION[01] = 10.;
  SPELL_DURATION[02] = 10.;
  SPELL_DURATION[03] = 10.;
 }
 
 function PickUnitsFilter(unit f, player owner) -> boolean {
  return IsUnitAlly(f, owner)         &&
      !IsUnitType(f, UNIT_TYPE_DEAD)       &&
      !IsUnitType(f, UNIT_TYPE_STRUCTURE)      &&
      !DDIsUnitInvulnerable(f)        &&
      !DDIsUnitWard(f)          &&
      !IsUnitType(f, UNIT_TYPE_MAGIC_IMMUNE)    &&
      !IsUnitType(f, UNIT_TYPE_MECHANICAL);
 }
 
 // #####################################################################################
 // #####################################################################################
 
 timer   Tim = null;
 group   Grp = null;
 
 struct unitdata {
  real dur, heal, shield;
  effect e;
 
  static thistype Att[];
 }
 
 struct missiles {
  xeffect  m[MISSILES_COUNT];
  p_real   pos[MISSILES_COUNT];
  p_real  spd[MISSILES_COUNT];
  integer  cnt;
 
  real  X, Y;
  player  owner;
  integer  lvl;
 
 
  static method create(unit c) -> thistype {
   thistype this = allocate();
   integer i;
   real x = GetWidgetX(c), y = GetWidgetY(c);
   real rad = 0., d;
   
   X = x; Y = y;
   owner = GetOwningPlayer(c);
   lvl = GetUnitAbilityLevel(c, NATURE_BLESSING);
   
   cnt = R2I((MISSILE_TRAVEL_TIME-.1) / DD_INTERVAL);
   for(i=00; i < MISSILES_COUNT; i+=01) {
    rad += bj_PI/6.;
    d = GetRandomReal(MISSILE_MIN_DISTANCE, MISSILE_MAX_DISTANCE);
    pos[i] = pVector(x + d * Cos(rad), y + d * Sin(rad), MISSILE_INITIAL_HEIGHT);
    spd[i] = pVector(-Cos(rad) * DD_INTERVAL * d / MISSILE_TRAVEL_TIME,
         -Sin(rad) * DD_INTERVAL * d / MISSILE_TRAVEL_TIME,
         DD_INTERVAL * (GetRandomReal(MISSILE_MIN_HEIGHT, MISSILE_MAX_HEIGHT)-MISSILE_INITIAL_HEIGHT) / MISSILE_TRAVEL_TIME);
    m[i] = xeffect.create(NATURE_MISSILE_EFFECT, pos[i][00], pos[i][01], rad*bj_RADTODEG, MISSILE_SIZE);
    m[i].Z = pos[i][02];
   }
   
   return this;
  }
 
  method destroy() {
   integer i;
   
   for(i=00; i < MISSILES_COUNT; i+=01) {
    m[i].destroy();
    pos[i].destroy();
    spd[i].destroy();
   }
   deallocate();
  }
 
  method Step() -> boolean {
   integer i;
   
   for(i=00; i < MISSILES_COUNT; i+=01) {
    pos[i][00] += spd[i][00];
    pos[i][01] += spd[i][01];
    pos[i][02] += spd[i][02];
   
    m[i].X = pos[i][00];
    m[i].Y = pos[i][01];
    m[i].Z = pos[i][02];
   }
   
   cnt -= 01;
   return (cnt == 00);
  }
 
 }
 
 
 // ==========================================================================================
 function onInit() {
  trigger t = CreateTrigger();
 
  Grp = CreateGroup();
  NatureBlessingLevelSetup();
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
  TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT);
  TriggerAddCondition(t, Condition(function() -> boolean {
   missiles ms;
   unit u;
   
   if (GetSpellAbilityId() != NATURE_BLESSING)
    return false;
   
   u = GetTriggerUnit();
   ms = missiles.create(u);
   
   // Play sound and shake camera for players within spell cast range
   DDGenericSound(NATURE_SHOOT_SOUND, NATURE_SHOOT_SOUND_VOL, GetWidgetX(u), GetWidgetY(u), NATURE_SHOOT_SOUND_MAX_DISTANCE, NATURE_SHOOT_SOUND_PITCH);
   
   DDStartTim(MISSILE_BIRTH_TIME, false, ms, function() {
    DDStartTim(DD_INTERVAL, true, DDTimData(), function() {
     missiles ms = DDTimData();
     trigger t;
     
     if (ms.Step()) {
      DDGenericSound(NATURE_EXPLOSION_SOUND, NATURE_EXPLOSION_SOUND_VOL, ms.X, ms.Y, NATURE_SHOOT_SOUND_MAX_DISTANCE, 1.8);
      xeffect.create(NATURE_EXPLOSION_EFFECT, ms.X, ms.Y, GetRandomReal(0., 360.), EXPLOSION_AOE[ms.lvl]/250.).destroyx(3.);
     
      DDGroupFilterArea(ms.X, ms.Y, EXPLOSION_AOE[ms.lvl], ms, function() -> boolean {
       unitdata ud;
       missiles ms = DDGFilterData();
       unit f = GetFilterUnit();
       
       if (PickUnitsFilter(f, ms.owner)) {
        if (ud.Att[GetHandleId(f)-0x100000] == p_null) {
         ud = unitdata.create();
         ud.Att[GetHandleId(f)-0x100000] = ud;
         ud.e = AddSpecialEffectTarget(NATURE_SHIELD_EFFECT, f, "origin");
         GroupAddUnit(Grp, f);
        } else
         ud = ud.Att[GetHandleId(f)-0x100000];
       
        ud.heal   = HEAL_PERC_AMOUNT[ms.lvl] / 100.;
        ud.shield   = SHIELD_PROTECT[ms.lvl] / 100.;
        ud.dur    = SPELL_DURATION[ms.lvl];
       }
       
       f = null;
       return false;
      });
     
      if (Tim == null) {
       Tim = DDLoadTim();
     
      TimerStart(Tim, HEAL_INTERVAL, true, function() {
       ForGroup(Grp, function() {
        unit e = GetEnumUnit();
        unitdata ud = unitdata.Att[GetHandleId(e)-0x100000];
       
        SetWidgetLife( e, GetWidgetLife(e) + (HEAL_INTERVAL * ud.heal * (GetUnitState(e, UNIT_STATE_MAX_LIFE)-GetWidgetLife(e))) );
       
        ud.dur -= .2;
        if (ud.dur < 0. || IsUnitType(e, UNIT_TYPE_DEAD)) {
         GroupRemoveUnit(Grp, e);
         ud.Att[GetHandleId(e)-0x100000] = p_null;
         DestroyEffect(ud.e);
         ud.e = null;
         ud.destroy();
         if (FirstOfGroup(Grp) == null) {
          DDRecycleTim(Tim);
          Tim = null;
         }
        }
       
        e = null;
       });
      });
     
      }
     
      ms.destroy();
      DDQuitTim();
     }
    });
    DDQuitTim();
   });
   
   u = null;
   return false;
  }));
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
  t = CreateTrigger();
  DDTriggerRegisterAnyUnitDamaged(t);
  TriggerAddCondition(t, Condition(function() -> boolean {
   unit u = GetTriggerUnit();
   unitdata ud = unitdata.Att[GetHandleId(u)-0x100000];
   
   if (ud == p_null) {
    u = null;
    return false;
   }
   
   SetWidgetLife(u, GetWidgetLife(u) + (GetEventDamage() * ud.shield));
   
   u = null;
   return false;
  }));
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 }
 
}
//! endzinc










 


Frost Eruption

Sends an orb of frost at targt point, on landing explodes dealing damage and freezing all enemy ground units, while air units get slowed.


Code
Code (vJASS):

//**************************************************************************************
//                              Installation:
//
// - 1. Make sure you have open the JassNewGen Pack editor not normal one and make sure you have last version
// - 2. Go to Import Manager (F12) and extract icons: BTNCRFrostShock.blp and its DISBTN version
//      sounds: fe_start.mp3, fe_explode1.mp3 and fe_explode2.mp3
//      Models: FrozenOrb.mdx, Frost2.mdx, FreezingRing.mdx, BlizzardEruption.mdx and (dummy.mdx -> if not from before)
// - 3. Import all of this to your map and set there path to as you can see here (in my map)
// - 4. Go to Object Manager (F6) and copy dummy unit {Dummy (DD Universal Pack)}
//      Air Freeze (Dummy) ability, Frost Eruption buff and
//      main ability Frost Eruption. When you are pasting them to your map make sure you
//      type the following rawcodes:
//      Dummy:                  'dumy'
//      Frost Eruption:         'Feru'
//      Air Freeze (Dummy):     'Afre'
//      Frost Eruption {Buff}:  'Bfer'
// - 5. If you want different raw codes edit the below as well:
// - 6. Edit data below to your own will and enjoy the spell:
// - 7. And of course copy this trigger and DDUniversal Pack to your map.
//
//**************************************************************************************

//! zinc
library FrostEruption requires DDLib
{


    // The raw code of the spell Frost Eruption
    // Default: 'Feru'
    constant  integer    ABILITY_FROST_ERUPTION        = 'Feru';
 // This is scale / size of main orb
    // Default: 1.32
    constant  real     ORB_SCALE            = 1.32;
    constant  real     ORB_INITIAL_Z           = 70.;
    constant  real     ORB_MAX_HEIGHT           = 350.;
    constant  real     ORB_TRAVEL_TIME          = 2.;
 
    // With this ability air units are slowed
    // Default: 'Afre'
    constant  integer    ABILITY_AIR_FREEZE          = 'Afre';
    constant  integer    BUFF_AIR_FREEZE           = 'Bfer';
    // This is orb model path
    // Default: "Spells\\FrostEruption\\FrozenOrb.mdl"
    constant  string     ORB_MODEL_PATH           = "Spells\\FrostEruption\\FrozenOrb.mdx";
    // Main frost eruption effect
    // Default: "Spells\\FrostEruption\\BlizzardEruption.mdl"
    constant  string     ORB_ERUPTION_EFFECT         = "Spells\\FrostEruption\\BlizzardEruption.mdx";
 // Default: 1.7
    constant  real     ORB_ERUPTION_EFFECT_SIZE       = 1.7;
    // Frost Eruptions extra explosion effect
    // Default: "Spells\\FrostEruption\\FreezingRing.mdl"
    constant  string     ORB_EXPLOSION_EFFECT         = "Spells\\FrostEruption\\FreezingRing.mdx";
    // Ground units freezed model path
    // Default: "Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl"
    constant  string     FREEZE_EFFECT           = "Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdx";
    // This is orb's trail effect
    // Default: "Spells\\FrostEruption\\Frost2.mdx"
    constant  string     TRAIL_MODEL_PATH          = "Spells\\FrostEruption\\Frost2.mdx";
    // Sound file on load (on spell cast)
    // Default: "Custom\\Spells\\Frost Eruption\\fe_start.mp3"
    constant  string     SPELL_START_SOUND          = "Custom\\Spells\\Frost Eruption\\fe_start.mp3";
 constant  real     SPELL_START_SOUND_VOL         = 75.;
 constant  real     SOUND_MAX_DISTANCE          = 3500.;
 
    // Sound file's on explosion
    // Default: "Custom\\Spells\\Frost Eruption\\fe_explode1.mp3"    
    constant  string     SPELL_EXPLODE_SOUND_1         = "Custom\\Spells\\Frost Eruption\\fe_explode1.mp3";
 constant  real     SPELL_EXPLODE_SOUND_VOL        = 75.; // Both 1 and 2 sounds volume
    // Default: "Custom\\Spells\\Frost Eruption\\fe_explode2.mp3"
    constant  string     SPELL_EXPLODE_SOUND_2         = "Custom\\Spells\\Frost Eruption\\fe_explode2.mp3";
   
    // Terrain deformation depth
    // Default: 128.
    constant  real     EXPLOSION_DEAPTH          = 160.;
    // Terrain deformatiob timeout
    // Default: 0.35
    constant  real     TERRAIN_DEFORMATION_DURATION       = 0.5;
    // Cameras power magnitude
    // Default: 100.
    constant  real     CAMERA_MAGNITUDE          = 20.;
 // Cameras power velocity
    // Default: 1200.
    constant  real     CAMERA_VELOCITY          = 1800.;
    // Camera noise duration
    // Default: 1.85
    constant  real     CAMERA_NOISE_DURATION         = 1.85;
    // How much time will orb need until reaching target point
    // Default: 1.5
    constant  real     ORB_DURATION           = 1.5;
   
    // Do not edit this variables here edit then below
    real   FE_RADIUS[];
    real   FE_DAMAGE[];
    real   FE_MAX_DAMAGE[];
    real   FE_DURATION[];

 // Edit this to match your level data
 function SetupFrostEruption() {
  // Spells damage:
  // Default: 130 / 215 / 290
  FE_DAMAGE[01]    = 130.;
  FE_DAMAGE[02]    = 215.;
  FE_DAMAGE[03]    = 290.;
 
  // Spells radius:
  // Default: 500 / 515 / 540
  FE_RADIUS[01]    = 500.;
  FE_RADIUS[02]    = 515.;
  FE_RADIUS[03]    = 540.;
 
  // Spells max damage:
  // Default: 700 / 1300 / 1950
  FE_MAX_DAMAGE[01]   = 700.;
  FE_MAX_DAMAGE[02]   = 1300.;
  FE_MAX_DAMAGE[03]   = 1950.;
 
  // Spells ground units freeze duration:
  // Default: 4 / 4.5 / 5.25
  FE_DURATION[01]   = 4.;
  FE_DURATION[02]   = 4.5;
  FE_DURATION[03]   = 5.25;
 }

 // Main damage filter
 function FE_UnitFilter(unit f, player owner) -> boolean {
  return IsUnitEnemy(f, owner)        &&
      !IsUnitType(f, UNIT_TYPE_STRUCTURE)     &&
      !IsUnitType(f, UNIT_TYPE_MECHANICAL)    &&
      !IsUnitType(f, UNIT_TYPE_DEAD)     &&
      !DDIsUnitInvulnerable(f)       &&
      !IsUnitType(f, UNIT_TYPE_MAGIC_IMMUNE);
 }
// ================================================================================
// ******                                                                   ******
//              Do not edit below if you don't know jass
// ******                                                                   ******
// ================================================================================
 
 effect   FBEffect[];

 struct orb {
  xeffect o, ot;
  real vx, vy, tz;
  real dist, mxDist, a;
  real spd;
  integer lvl;
  player owner;
  unit u;
  real dmg;
  group g;
  unit dmy;
  integer cnt=00;
 
  static method create(unit u, real x, real y, real tx, real ty, player owner, integer lvl) -> thistype {
   thistype this = allocate();
   
   real rad = Atan2(ty-y, tx-x);
   mxDist = SquareRoot( Pw_2(x-tx) +  Pw_2(y-ty) ) / 2.;
   dist = -mxDist;
   a = -ORB_MAX_HEIGHT/Pw_2(mxDist);
   o = xeffect.create(ORB_MODEL_PATH, x, y, rad*bj_RADTODEG, ORB_SCALE);
   ot = xeffect.create(TRAIL_MODEL_PATH, x, y, rad*bj_RADTODEG, 1.);
   o.Z = ORB_INITIAL_Z;
   spd = DD_INTERVAL * (2.*mxDist / ORB_TRAVEL_TIME);
   vx =  spd * Cos(rad);
   vy =  spd * Sin(rad);
   tz = o.WZ;
   this.owner = owner;
   this.lvl = lvl;
   this.u = u;
   
   return this;
  }
 
  method LaunchOrb() {
   DDStartTim(DD_INTERVAL, true, this, function() {
    orb this = DDTimData();
   
    dist += spd;
    o.X += vx; o.Y += vy;
    o.Z = (tz-o.WZ) + a*Pw_2(dist) + ORB_MAX_HEIGHT;
    ot.X = o.X; ot.Y = o.Y; ot.Z = o.Z;
   
    if (dist > mxDist) {
     g = DDLoadGroup();
     DDGFilterDataSet(this);
     GroupEnumUnitsInRange(g, o.X, o.Y, FE_RADIUS[lvl], Filter(function() -> boolean {
      if (FE_UnitFilter(GetFilterUnit(), orb(DDGFilterData()).owner)) {
       orb(DDGFilterData()).cnt += 01;
       return true;
      }
      return false;
     }));
     
     dmg = FE_MAX_DAMAGE[lvl] / cnt;
     if (dmg > FE_DAMAGE[lvl])
      dmg = FE_DAMAGE[lvl];
     
     ForGroup(g, function() {
      orb o = DDGFilterData();
      unit e = GetEnumUnit();
      UnitDamageTarget(o.u, e, o.dmg, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null);
      if (!IsUnitType(e, UNIT_TYPE_FLYING) && !IsUnitType(e, UNIT_TYPE_DEAD) && FBEffect[H2ID(e)] == null) {
       FBEffect[H2ID(e)] = AddSpecialEffectTarget(FREEZE_EFFECT, e, "origin");
       PauseUnit(e, true);
      }
      e = null;
     });
     
     dmy = DDLoadSpellDummy(owner, o.X, o.Y, ABILITY_AIR_FREEZE, lvl);
     UnitRemoveAbility(dmy, 'Aloc');
     IssueTargetOrder(dmy, "frostnova", dmy);
     
     DDStartTim(FE_DURATION[lvl]-.05, false, this, function() {
      orb o = DDTimData();
     
      UnitAddAbility(o.dmy, 'Aloc');
      UnitRemoveAbility(o.dmy, ABILITY_AIR_FREEZE);
      DDRecycleDummy(o.dmy);
     
      ForGroup(o.g, function() {
       unit e = GetEnumUnit();
       if (!IsUnitType(e, UNIT_TYPE_FLYING) /*&& GetUnitAbilityLevel(e, BUFF_AIR_FREEZE) != 00*/) {
        PauseUnit(e, false);
        UnitRemoveAbility(e, BUFF_AIR_FREEZE);        
        DestroyEffect(FBEffect[H2ID(e)]);
        FBEffect[H2ID(e)] = null;
       }
       e = null;
      });
      DDRecycleGroup(o.g);
      o.destroy();
      DDQuitTim();
     });
     
     TerrainDeformCrater(o.X, o.Y, FE_RADIUS[lvl], EXPLOSION_DEAPTH, R2I(TERRAIN_DEFORMATION_DURATION*1000.), false);
     DDCameraSetSourceNoiseForPlayers(o.X, o.Y, CAMERA_MAGNITUDE, CAMERA_VELOCITY, SOUND_MAX_DISTANCE, CAMERA_NOISE_DURATION);
     xeffect.create(ORB_ERUPTION_EFFECT, o.X, o.Y, GetRandomReal(0., 360.), ORB_ERUPTION_EFFECT_SIZE).destroyx(2.);
     //DestroyEffectTimed(AddSpecialEffect(ORB_ERUPTION_EFFECT, o.X, o.Y), 3.);
     DestroyEffect(AddSpecialEffect(ORB_EXPLOSION_EFFECT, o.X, o.Y));
     if (GetRandomInt(00, 01) == 01)
      DDGenericSound(SPELL_EXPLODE_SOUND_1, SPELL_EXPLODE_SOUND_VOL, o.X, o.Y, SOUND_MAX_DISTANCE, 1.);
     else
      DDGenericSound(SPELL_EXPLODE_SOUND_2, SPELL_EXPLODE_SOUND_VOL, o.X, o.Y, SOUND_MAX_DISTANCE, 1.);
     
     ot.X = DDMaxX; ot.Y = DDMaxY;
     o.destroy();
     ot.destroy();
     DDQuitTim();
    }
   
   });
  }
 }

 //====================================================================================
 // Main Setup Function For FE
 function onInit() {
  // Load locals...
  trigger tg = CreateTrigger();
 
  // Setup user spell
  SetupFrostEruption();
 
  // Register trigger events
  TriggerRegisterAnyUnitEventBJ(tg, EVENT_PLAYER_UNIT_SPELL_EFFECT);
  TriggerRegisterAnyUnitEventBJ(tg, EVENT_PLAYER_UNIT_DEATH);
  TriggerAddCondition(tg, Condition(function() -> boolean {
   unit u;
   real x, y,
     tx, ty;
   orb o;
   
   if (GetTriggerEventId() == EVENT_PLAYER_UNIT_DEATH) {
    u = GetTriggerUnit();
    if (FBEffect[H2ID(u)] != null) {
     PauseUnit(u, false);
     DestroyEffect(FBEffect[H2ID(u)]);
     FBEffect[H2ID(u)] = null;
    }
    u = null;
    return false;
   }
   
   if (GetSpellAbilityId() != ABILITY_FROST_ERUPTION)
    return false;
   
   u = GetTriggerUnit();
   x = GetWidgetX(u); y = GetWidgetY(u);
   tx = GetSpellTargetX(); ty = GetSpellTargetY();
   
   
   o = orb.create(u, x, y, tx, ty, GetOwningPlayer(u), GetUnitAbilityLevel(u, ABILITY_FROST_ERUPTION));
   DDGenericSound(SPELL_START_SOUND, SPELL_START_SOUND_VOL, SOUND_MAX_DISTANCE, x, y, 1.);
   o.LaunchOrb();
   
   u = null;
   return false;
  }));

 }

}
//! endzinc








 


Algid Aura

Slowes down units around caster for x seconds and dealing slight damage every x seconds (pulse width), while chilling lasts less time.


Code
Code (vJASS):

//**************************************************************************************
//                              Installation:
//
// - 1. Make sure you have opend Jass NewGen
// - 2. Go to Import Manager (F12) and extract icons: BTNAlgirAura.blp and its: DISBTN, PAS and DISPAS version
// - 3. Import all of this to your map and set there path to as you can see here (in my map)
// - 4. Go to Object Manager (F6) and copy:
//  abilities: Algid Aura (Dummy) and main ability Algid Aura
//  buffs: Algid Aura (Buff) and Algid Aura (Ability Buff)
//  When you are pasting them to your map make sure you
//      type the following rawcodes or modify them below:
//      Algid Aura:         'Algd'
//      Algid Aura (Dummy):     'Aldm'
//      Algid Aura (Buff):   'Alga'
//      Algid Aura (Ability Buff): 'AlgB'
// - 5. Edit data below to your own will and enjoy the aura:
// - 6. And of course copy this trigger and DD Library to your map.
//
//**************************************************************************************

//! zinc
library AlgidAura requires DDLib
{

 // *****************************************************************************************
 //        === Main Data ===
 // *****************************************************************************************
 
    // Default: 'Algd'
    constant  integer    ABILITY_ALGID_AURA         = 'Algd';
    // Default: 'Aldm'
    constant  integer    ABILITY_ALGID_AURA_DUMMY       = 'Aldm';
 // Default: "frostnova"
    constant  string     ABILITY_ALGID_AURA_DUMMY_ORDER_ID     = "frostnova";
 
 
 real AA_PULSE_WIDTH[];
 
 // *****************************************************************************************
 
 // Edit this to match your level data
 function SetupAlgidAura() {
  // Spells damage:
  // Default: 5 / 5 / 4
  AA_PULSE_WIDTH[01]    = 5.;
  AA_PULSE_WIDTH[02]    = 5.;
  AA_PULSE_WIDTH[03]    = 4.;
 }
 
 // *****************************************************************************************
 
 timer  AATim[];
 
 struct data {
  unit u;
  unit d;
 
  static thistype  Data[];
 }

 //====================================================================================
 // Main Setup Function For FE
 function onInit() {
  // Load locals...
  trigger tg = CreateTrigger();
 
  // Setup user spell
  SetupAlgidAura();
 
  // Register trigger events
  TriggerRegisterAnyUnitEventBJ(tg, EVENT_PLAYER_HERO_SKILL);
  TriggerAddCondition(tg, Condition(function() -> boolean {
   unit u;
   integer id;
   data d;
   
   if (GetLearnedSkill() != ABILITY_ALGID_AURA)
    return false;
   
   u = GetTriggerUnit();
   id = H2ID(u);
   if (AATim[id] == null) {
    AATim[id] = CreateTimer();
    d = data.create();
    data.Data[H2ID(AATim[id])] = d;
    d.u = u; d.d = DDLoadDummy();
    UnitRemoveAbility(d.d, 'Aloc');
    SetUnitOwner(d.d, GetOwningPlayer(u), false);
    UnitAddAbility(d.d, ABILITY_ALGID_AURA_DUMMY);
   } else
    d = data.Data[H2ID(AATim[id])];
   SetUnitAbilityLevel(d.d, ABILITY_ALGID_AURA_DUMMY, GetLearnedSkillLevel());
   
   TimerStart(AATim[id], AA_PULSE_WIDTH[GetLearnedSkillLevel()], true, function() {
    data d = data.Data[H2ID(GetExpiredTimer())];
   
    if (!IsUnitType(d.u, UNIT_TYPE_DEAD)) {
     SetUnitX(d.d, GetWidgetX(d.u));
     SetUnitY(d.d, GetWidgetY(d.u));
     IssueTargetOrder(d.d, ABILITY_ALGID_AURA_DUMMY_ORDER_ID, d.d);
    }
   });
   
   u = null;
   return false;
  }));

 }

}
//! endzinc








 


Nature Blessing

Raises magic missiles from the ground, which travel at position of caster, exploding and protecting any ally unit with shield which reduces any taken damage, as well it increases n% hp regeneration per point of life missing.


Code
Code (vJASS):

/*
 **********************************************************************************************************
 
          Installation:
 
  1) Make sure that you use Jass NewGen Pack editor and that you installed DD Library in your map
  2) Copy ElectrolixZap abilities (hero and dummy versions) to your map
  3) Export and Import 'thunder1.wav' sound from this map to yours
  4) Export and Import 'Great Lightning.mdx' sound from this map to yours
  5) Copy this trigger to your map and modify it to your liking below
 
 **********************************************************************************************************
*/


//! zinc
library NatureBlessing requires DDLib
{

  // This is the main raw code of ability Nature Blessing
  // Default: 'Nbls'
  constant integer   NATURE_BLESSING     = 'Nbls';
 
  // Natures shield effect model path
  // Default: "Spells\\NatureBlessing\\GaiaShield.mdx"
  constant string   NATURE_SHIELD_EFFECT   = "Spells\\NatureBlessing\\GaiaShield.mdx";
 
  // Natures missile effect model path
  // Default: "Spells\\NatureBlessing\\GaiaMissle.mdx"
  constant string   NATURE_MISSILE_EFFECT   = "Spells\\NatureBlessing\\GaiaMissle.mdx";
 
  // Natures explosion model effect path
  // Default: "Spells\\NatureBlessing\\NatureExplosion.mdx"
  constant string   NATURE_EXPLOSION_EFFECT   = "Spells\\NatureBlessing\\NatureExplosion.mdl";
 
  // Natures missile fire sound path (this sound is played when missiles start to move)
  // Default: "Abilities\\Spells\\NightElf\\Tranquility\\TranquilityTarget1.wav"
  constant string   NATURE_SHOOT_SOUND    = "Abilities\\Spells\\NightElf\\Tranquility\\TranquilityTarget1.wav";
  constant real   NATURE_SHOOT_SOUND_VOL   = 100.;
  constant real   NATURE_SHOOT_SOUND_PITCH  = 1.5;
  constant real   NATURE_SHOOT_SOUND_MAX_DISTANCE = 3500.;
 
  // Nature explosion sound file path (is played when nature explosion is caused)
  // Default: "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.wav"
  constant string   NATURE_EXPLOSION_SOUND   = "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.wav";
  constant real   NATURE_EXPLOSION_SOUND_VOL  = 90.;
 
  // This is number of nature missiles created
  // Default: 12
  constant integer   MISSILES_COUNT     = 12;
  // Default: 1.2
  constant real   MISSILE_SIZE     = 1.2;
 
  // This is min and max distance from caster to missiles start point
  // Default: 400 / 600
  constant real   MISSILE_MIN_DISTANCE   = 400.;
  constant real   MISSILE_MAX_DISTANCE   = 600.;
 
  // This is min and max finish height / caster position of missiles
  // Default: 75 / 400
  constant real   MISSILE_MIN_HEIGHT    = 40.;
  constant real   MISSILE_MAX_HEIGHT    = 400.;
 
  // This is missiles value which tells how much time they need to reach caster and how long it takse for them to manifest
  // Default: 0.75 / 0.5
  constant real   MISSILE_TRAVEL_TIME    = .9;
  constant real   MISSILE_BIRTH_TIME    = 0.5;
 
  // Default: 50
  constant real   MISSILE_INITIAL_HEIGHT   = 10.;
 
  // Default: 0.2 seconds
  constant real   HEAL_INTERVAL     = .2;
  // --------------------------------------------------------------
  // *** Do not edit level variables here edit them below ***
  real   EXPLOSION_AOE[];
  real   SHIELD_PROTECT[];
  real   HEAL_PERC_AMOUNT[];
  real   SPELL_DURATION[];
 
 // -----------------------------------------------------------------
 //     *** Edit level data here ***
 function NatureBlessingLevelSetup() {
  // This is AOE of explosion "effect"
  // Default: 410 / 530 / 650
  EXPLOSION_AOE[01] = 410.;
  EXPLOSION_AOE[02] = 530.;
  EXPLOSION_AOE[03] = 650.;
 
  // Shield protection is amount of damage reduced in percentage
  // Default: 15 / 25 / 35
  SHIELD_PROTECT[01] = 15.;
  SHIELD_PROTECT[02] = 25.;
  SHIELD_PROTECT[03] = 35.;
 
  // This is heal amount in percentage per point of life missing
  // Default: 5 / 7 / 9
  HEAL_PERC_AMOUNT[01] = 5.;
  HEAL_PERC_AMOUNT[02] = 7.;
  HEAL_PERC_AMOUNT[03] = 9.;
 
  // This is how long spell lasts in seconds
  // Default: 10 / 10 / 10
  SPELL_DURATION[01] = 10.;
  SPELL_DURATION[02] = 10.;
  SPELL_DURATION[03] = 10.;
 }
 
 function PickUnitsFilter(unit f, player owner) -> boolean {
  return IsUnitAlly(f, owner)         &&
      !IsUnitType(f, UNIT_TYPE_DEAD)       &&
      !IsUnitType(f, UNIT_TYPE_STRUCTURE)      &&
      !DDIsUnitInvulnerable(f)        &&
      !DDIsUnitWard(f)          &&
      !IsUnitType(f, UNIT_TYPE_MAGIC_IMMUNE)    &&
      !IsUnitType(f, UNIT_TYPE_MECHANICAL);
 }
 
 // #####################################################################################
 // #####################################################################################
 
 timer   Tim = null;
 group   Grp = null;
 
 struct unitdata {
  real dur, heal, shield;
  effect e;
 
  static thistype Att[];
 }
 
 struct missiles {
  xeffect  m[MISSILES_COUNT];
  p_real   pos[MISSILES_COUNT];
  p_real  spd[MISSILES_COUNT];
  integer  cnt;
 
  real  X, Y;
  player  owner;
  integer  lvl;
 
 
  static method create(unit c) -> thistype {
   thistype this = allocate();
   integer i;
   real x = GetWidgetX(c), y = GetWidgetY(c);
   real rad = 0., d;
   
   X = x; Y = y;
   owner = GetOwningPlayer(c);
   lvl = GetUnitAbilityLevel(c, NATURE_BLESSING);
   
   cnt = R2I((MISSILE_TRAVEL_TIME-.1) / DD_INTERVAL);
   for(i=00; i < MISSILES_COUNT; i+=01) {
    rad += bj_PI/6.;
    d = GetRandomReal(MISSILE_MIN_DISTANCE, MISSILE_MAX_DISTANCE);
    pos[i] = pVector(x + d * Cos(rad), y + d * Sin(rad), MISSILE_INITIAL_HEIGHT);
    spd[i] = pVector(-Cos(rad) * DD_INTERVAL * d / MISSILE_TRAVEL_TIME,
         -Sin(rad) * DD_INTERVAL * d / MISSILE_TRAVEL_TIME,
         DD_INTERVAL * (GetRandomReal(MISSILE_MIN_HEIGHT, MISSILE_MAX_HEIGHT)-MISSILE_INITIAL_HEIGHT) / MISSILE_TRAVEL_TIME);
    m[i] = xeffect.create(NATURE_MISSILE_EFFECT, pos[i][00], pos[i][01], rad*bj_RADTODEG, MISSILE_SIZE);
    m[i].Z = pos[i][02];
   }
   
   return this;
  }
 
  method destroy() {
   integer i;
   
   for(i=00; i < MISSILES_COUNT; i+=01) {
    m[i].destroy();
    pos[i].destroy();
    spd[i].destroy();
   }
   deallocate();
  }
 
  method Step() -> boolean {
   integer i;
   
   for(i=00; i < MISSILES_COUNT; i+=01) {
    pos[i][00] += spd[i][00];
    pos[i][01] += spd[i][01];
    pos[i][02] += spd[i][02];
   
    m[i].X = pos[i][00];
    m[i].Y = pos[i][01];
    m[i].Z = pos[i][02];
   }
   
   cnt -= 01;
   return (cnt == 00);
  }
 
 }
 
 
 // ==========================================================================================
 function onInit() {
  trigger t = CreateTrigger();
 
  Grp = CreateGroup();
  NatureBlessingLevelSetup();
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
  TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT);
  TriggerAddCondition(t, Condition(function() -> boolean {
   missiles ms;
   unit u;
   
   if (GetSpellAbilityId() != NATURE_BLESSING)
    return false;
   
   u = GetTriggerUnit();
   ms = missiles.create(u);
   
   // Play sound and shake camera for players within spell cast range
   DDGenericSound(NATURE_SHOOT_SOUND, NATURE_SHOOT_SOUND_VOL, GetWidgetX(u), GetWidgetY(u), NATURE_SHOOT_SOUND_MAX_DISTANCE, NATURE_SHOOT_SOUND_PITCH);
   
   DDStartTim(MISSILE_BIRTH_TIME, false, ms, function() {
    DDStartTim(DD_INTERVAL, true, DDTimData(), function() {
     missiles ms = DDTimData();
     trigger t;
     
     if (ms.Step()) {
      DDGenericSound(NATURE_EXPLOSION_SOUND, NATURE_EXPLOSION_SOUND_VOL, ms.X, ms.Y, NATURE_SHOOT_SOUND_MAX_DISTANCE, 1.8);
      xeffect.create(NATURE_EXPLOSION_EFFECT, ms.X, ms.Y, GetRandomReal(0., 360.), EXPLOSION_AOE[ms.lvl]/250.).destroyx(3.);
     
      DDGroupFilterArea(ms.X, ms.Y, EXPLOSION_AOE[ms.lvl], ms, function() -> boolean {
       unitdata ud;
       missiles ms = DDGFilterData();
       unit f = GetFilterUnit();
       
       if (PickUnitsFilter(f, ms.owner)) {
        if (ud.Att[GetHandleId(f)-0x100000] == p_null) {
         ud = unitdata.create();
         ud.Att[GetHandleId(f)-0x100000] = ud;
         ud.e = AddSpecialEffectTarget(NATURE_SHIELD_EFFECT, f, "origin");
         GroupAddUnit(Grp, f);
        } else
         ud = ud.Att[GetHandleId(f)-0x100000];
       
        ud.heal   = HEAL_PERC_AMOUNT[ms.lvl] / 100.;
        ud.shield   = SHIELD_PROTECT[ms.lvl] / 100.;
        ud.dur    = SPELL_DURATION[ms.lvl];
       }
       
       f = null;
       return false;
      });
     
      if (Tim == null) {
       Tim = DDLoadTim();
     
      TimerStart(Tim, HEAL_INTERVAL, true, function() {
       ForGroup(Grp, function() {
        unit e = GetEnumUnit();
        unitdata ud = unitdata.Att[GetHandleId(e)-0x100000];
       
        SetWidgetLife( e, GetWidgetLife(e) + (HEAL_INTERVAL * ud.heal * (GetUnitState(e, UNIT_STATE_MAX_LIFE)-GetWidgetLife(e))) );
       
        ud.dur -= .2;
        if (ud.dur < 0. || IsUnitType(e, UNIT_TYPE_DEAD)) {
         GroupRemoveUnit(Grp, e);
         ud.Att[GetHandleId(e)-0x100000] = p_null;
         DestroyEffect(ud.e);
         ud.e = null;
         ud.destroy();
         if (FirstOfGroup(Grp) == null) {
          DDRecycleTim(Tim);
          Tim = null;
         }
        }
       
        e = null;
       });
      });
     
      }
     
      ms.destroy();
      DDQuitTim();
     }
    });
    DDQuitTim();
   });
   
   u = null;
   return false;
  }));
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
  t = CreateTrigger();
  DDTriggerRegisterAnyUnitDamaged(t);
  TriggerAddCondition(t, Condition(function() -> boolean {
   unit u = GetTriggerUnit();
   unitdata ud = unitdata.Att[GetHandleId(u)-0x100000];
   
   if (ud == p_null) {
    u = null;
    return false;
   }
   
   SetWidgetLife(u, GetWidgetLife(u) + (GetEventDamage() * ud.shield));
   
   u = null;
   return false;
  }));
 
  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 }
 
}
//! endzinc










 


Instinct Flash

Quickly moves to targeted point dealing heavy damage to any enemy unit which comes near caster.


Code
Code (vJASS):

//**************************************************************************************
//                              Installation:
//
// - 1. Make sure you have opened Jass NewGen Editor
// - 2. Go to Import Manager (F12) and extract icons: BTNInstinctFlash.blp and DISBTN versions
//      sounds: sword_chop.wav, sword_echo.wav, sword_draw.wav, sword_dmg1.wav, sword_dmg2.wav
// - 3. Import all of this to your map and set there path to as you can see here (in my map)
// - 4. Go to Object Manager (F6) and copy:
//  units: Illusion Blademaster
//  ability: Instinct Flash
//  When you are pasting them to your map make sure you type the following rawcodes:
//      Illusion Blademaster:   'ssib'
//  Instinct Flash:         'InFl'
// - 5. If you want different raw codes you must edit them below as well:
// - 6. Edit data below to your own will and enjoy!
// - 7. And of course copy 'this trigger' and 'DD Library' to your map.
//
//**************************************************************************************

//! zinc
library InstinctFlash requires DDLib
{

  // *****************************************************************************************
  //        === Main Data ===
  // *****************************************************************************************
   
  // This is the raw code of the spell
  // Default: InFl
  constant integer   ABILITY_INSTINCT_FLASH     = 'InFl';
 
  // This is the raw code of illusion
  // Default: ssib
  constant integer   UNIT_ILLUSION_RAWCODE     = 'ssib';
 
  // *****************************************************************************************
  //        === Effects ===
  // *****************************************************************************************
 
  // Model file of spells motion sfx
  // Default: Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl
  constant string   EFFECT_BLADE_ATTACHMENT     = "Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl";
  constant string   EFFECT_BLADE_ATTACH_POINT    = "weapon";
  // Default: Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl
  constant string   EFFECT_WATER_IMPACT      = "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl";
  // Default: Objects\\SpawnQModels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl
  constant string   EFFECT_GROUND_IMPACT     = "Objects\\SpawnModels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl";
  // Default: Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl
  constant string   EFFECT_UNIT_SLASH_BLEAD     = "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl";
 
 
  // *****************************************************************************************
  //        === Sounds ===
  // *****************************************************************************************
 
  // Default: Custom\\Spells\\Instinct Flash\\sword_draw.wav
  constant string   SOUND_DRAW        = "Custom\\Spells\\Instinct Flash\\sword_draw.wav";
  // Default: 85.
  constant real   SOUND_DRAW_VOL       = 85.;
  // Default: Custom\\Spells\\Instinct Flash\\sword_echo.wav
  constant string    SOUND_ECHO        = "Custom\\Spells\\Instinct Flash\\sword_echo.wav";
  // Default: 45.
  constant real   SOUND_ECHO_VOL       = 45.;
  // Default: Custom\\Spells\\Instinct Flash\\sword_dmg1.wav
  constant string   SOUND_DMG1        = "Custom\\Spells\\Instinct Flash\\sword_dmg1.wav";
  // Default: 45.
  constant real   SOUND_DMG1_VOL       = 85.;
  // Default: Custom\\Spells\\Instinct Flash\\sword_dmg2.wav
  constant string   SOUND_DMG2        = "Custom\\Spells\\Instinct Flash\\sword_dmg2.wav";
  // Default: 85.
  constant real   SOUND_DMG2_VOL       = 85.;
  // Default: Custom\\Spells\\Instinct Flash\\sword_chop.wav
  constant string   SOUND_CHOP        = "Custom\\Spells\\Instinct Flash\\sword_chop.wav";
  // Default: 85.
  constant real   SOUND_CHOP_VOL       = 85.;
  // Default: 3500.
  constant real   SOUND_MAX_DISTANCE      = 3500.;
 
  // *****************************************************************************************
  //        === Initial Illusions ===
  // *****************************************************************************************
 
        // Max illusion creation distance (height)
  // Default: 300
  constant real   ILLUSION_HEIGHT       = 300.;
 
  // Max illusion creation distance (width)
  // Default: 550
  constant real   ILLUSION_WIDTH       = 550.;
 
  // This is duration of illusions in seconds
  // Default: 0.6
  constant real   ILLUSION_DURATION      = .6;
 
  // This is the animation speed of illusions in percentage
  // Default: 100*(1.4-0.15)*0.4 ( 1.4 = Animation duration, 0.4 = Illusion duration, -0.15 extra constant value )
  constant real   ILLUSION_ANIMATION_SPEED    = 70.;
 
  // This is animation of illusion which should be played
  // Default: 9 (stand ready)
  constant integer   ILLUSION_ANIMATION_ID     = 9; // (1.4)
 
  // Maximum number of illusions at same time
  // Default: 8
  constant integer   MAX_ILLUSIONS       = 8;
  constant integer   MAX_ILLUSIONS_ARRAY      = 4;
 
  //
  constant integer   ILLUSION_COLOR_RED      = 125;
  constant integer   ILLUSION_COLOR_GREEN     = 125;
  constant integer   ILLUSION_COLOR_BLUE      = 240;
  constant integer   ILLUSION_COLOR_ALPHA     = 128;
 
  // *****************************************************************************************
  //        === Caster Motion ===
  // *****************************************************************************************
 
  // This is casters end animation
  // Default: 8 (attack 2)
  constant integer   CASTER_ATTACK_ANIMATION_ID    = 8; // (1.134)
  // Speed at which caster is traveling after multiple illusions are fused
  // Default: 1000.
  constant real   CASTER_SPEED       = 1000.;
  // Default: 150
  constant integer   CASTER_COLOR_ALPHA      = 150;
  // Casters end animation speed in percentage
  // Default: 200
  constant real   CASTER_ANIMATION_SPEED     = 200.;
  // This is the area of damage effect
  // Default: 135
  constant real   CASTER_DAMAGE_RANGE      = 135.;
 
  // *****************************************************************************************
  //        === Killed Units Motion  ===
  // *****************************************************************************************
 
  // Defines travel distance of units which are pushed
  // Default: 330
  constant real   PUSH_DISTANCE       = 330.;
 
  // Defines travel height of units which are pushed
  // Default: 230
  constant real   PUSH_HEIGHT        = 230.;
 
  // Defines start push speed
  // Default: 500
  constant real   PUSH_SPEED        = 500.;
 
  // *****************************************************************************************
  //   *** (Aftereffect Illusions From Casters Movement) ***
  // *****************************************************************************************
 
  // This is casters end animation
  // Default: 8 (attack 2)
  constant integer   AEFF_ILLUSION_ATTACK_ANIMATION_ID  = 8; // (1.134)
 
  // Duration of casters end animation
  // Default: 0.66
  constant real   AEFF_ILLUSION_DURATION     = .66;
 
  // Casters end animation speed in percentage
  // Default: 100*1.134/0.5 (1.134 = animation duration, 0.5 seconds to finish animation)
  constant real   AEFF_ILLUSION_ANIMATION_SPEED   = 226.8;
 
  // How much distance caster passes to produce a single aftereffect illusion
  // Default: 125.
  constant real   AEFF_ILLUSION_DISTANCE_STEP    = 125.;
 
 
  real   DamageAmount[];
 
 // *****************************************************************************************
 //        === Level Data ===
 // *****************************************************************************************
 
 // *** Edit level data below ***
 function InstinctFlash_Setup() {
  // *** This is the damage per level ***
  // Default: 175 / 285 / 400
  DamageAmount[01]  = 175.;
  DamageAmount[02]  = 285.;
  DamageAmount[03]  = 400.;
 
  // *** This is the color of illusions ***
  // Arguments: red, green, blue, alpha (from 0 to 255)
  // Default: 125, 125, 240, 255
  //Color = CreateColor(125, 125, 240, 255)
 
 }
 
 // *****************************************************************************************
 //        === Unit Filter ===
 // *****************************************************************************************
 
 function UnitFilter_Setup(unit u, player p) -> boolean {
  return !IsUnitType(u, UNIT_TYPE_STRUCTURE)    &&
      !IsUnitType(u, UNIT_TYPE_FLYING)     &&
      !IsUnitType(u, UNIT_TYPE_DEAD)     &&
      IsUnitEnemy(u, p);
     
 }
 
 
 // ==============================================================================
 //     DO NOT EDIT BELOW IF YOU DONT KNOW JASS
 // ==============================================================================
 
 struct uknockback {
  unit u;
  real x, y, wz;
  real dx, dy;
  real a, dist;
 
  static method create(unit u, real rad) -> thistype {
   thistype this = allocate();
   
   this.u = u;
   UnitAddAbility(u, DD_ABILITY_CROWN_FORM);
   x = GetWidgetX(u); y = GetWidgetY(u); wz = DDTerrZ(x, y);
   a = PUSH_HEIGHT / Pw_2(PUSH_DISTANCE/2.);
   dx = DD_INTERVAL * PUSH_SPEED * Cos(rad);
   dy = DD_INTERVAL * PUSH_SPEED * Sin(rad);
   dist = PUSH_DISTANCE;
   
   return this;
  }
 
  method ApplyMotion() {
   DDStartTim(DD_INTERVAL, true, this, function() {
    thistype this = DDTimData();
   
    x += dx; y += dy;
    SetUnitX(u, x); SetUnitY(u, y);
    SetUnitFlyHeight(u, wz - DDTerrZ(x, y) + PUSH_HEIGHT - a*Pw_2(dist-(PUSH_DISTANCE/2.)), 0.);
   
    dist -= DD_INTERVAL * PUSH_SPEED;
    if (dist < 0.) {
     if (!IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY/*AMPHIBIOUSPATHING*/))
      DestroyEffect(AddSpecialEffect(EFFECT_WATER_IMPACT, x, y));
     else
      DestroyEffect(AddSpecialEffect(EFFECT_GROUND_IMPACT, x, y));
     u = null;
     destroy();
     DDQuitTim();
    }
   });
  }
 }
 
 struct iflash {
  unit u;
  player p;
  effect e;
  real x, y;
  real dx, dy;
  real dist, spd;
  group g, gd;
  integer lvl;
  real fac;
 
  static method create(unit u, real tx, real ty, real rad) -> thistype {
   thistype this = allocate();
   
   this.u = u;
   fac = bj_RADTODEG*rad;
   lvl = GetUnitAbilityLevel(u, ABILITY_INSTINCT_FLASH);
   p = GetOwningPlayer(u);
   x = GetUnitX(u); y = GetUnitY(u);
   spd = DD_INTERVAL * CASTER_SPEED;
   dx = spd * Cos(rad); dy = spd * Sin(rad);
   dist = SquareRoot( Pw_2(tx-x) + Pw_2(ty-y) );
   g = DDLoadGroup(); gd = DDLoadGroup();
   
   SetUnitPathing(u, false);
   SetUnitAnimationByIndex(u, CASTER_ATTACK_ANIMATION_ID);
   ShowUnit(this.u, true);
   PauseUnit(u, true);
   e = AddSpecialEffectTarget(EFFECT_BLADE_ATTACHMENT, this.u, EFFECT_BLADE_ATTACH_POINT);
   SetUnitVertexColor(u, 255, 255, 255, CASTER_COLOR_ALPHA);
   SetUnitTimeScale(u, CASTER_ANIMATION_SPEED/100.);
   
   return this;
  }
 
  method ApplyMotion() {
   DDStartTim(DD_INTERVAL, true, this, function() {
    thistype this = DDTimData();
    unit ae_ill;
   
    x += dx; y += dy;
    dist -= spd;
    SetUnitX(u, x); SetUnitY(u, y);
   
    if (ModuloReal(dist, AEFF_ILLUSION_DISTANCE_STEP) < spd) {
     ae_ill = CreateUnit(Player(15), UNIT_ILLUSION_RAWCODE, x, y, fac);
     SetUnitColor(ae_ill, GetPlayerColor(p));
     SetUnitVertexColor(ae_ill, ILLUSION_COLOR_RED, ILLUSION_COLOR_GREEN, ILLUSION_COLOR_BLUE, CASTER_COLOR_ALPHA);
     SetUnitPathing(ae_ill, false);
     SetUnitX(ae_ill, x); SetUnitY(ae_ill, y);
     PauseUnit(ae_ill, true);
     SetUnitAnimationByIndex(ae_ill, CASTER_ATTACK_ANIMATION_ID);
     DestroyEffect(AddSpecialEffectTarget(EFFECT_BLADE_ATTACHMENT, ae_ill, EFFECT_BLADE_ATTACH_POINT));
     DDFadeUnit(ae_ill, CASTER_COLOR_ALPHA, 00, AEFF_ILLUSION_DURATION);
    }
   
    DDGFilterDataSet(this);
    GroupEnumUnitsInRange(g, x, y, CASTER_DAMAGE_RANGE, Filter(function() -> boolean {
     thistype this = DDGFilterData();
     unit f = GetFilterUnit();
     if (UnitFilter_Setup(f, p) && !IsUnitInGroup(f, gd)) {
      //UnitDamageTarget(u, f, DamageAmount[lvl], true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null);
      DDSpellDamage(u, f, DamageAmount[lvl]);
      DestroyEffect(AddSpecialEffectTarget(EFFECT_UNIT_SLASH_BLEAD, f, "origin"));
      GroupAddUnit(gd, f);
      if (GetRandomInt(00, 01) == 01)
       DDGenericSound(SOUND_DMG1, SOUND_DMG1_VOL, x, y, SOUND_MAX_DISTANCE, 1.);
      else
       DDGenericSound(SOUND_DMG2, SOUND_DMG2_VOL, x, y, SOUND_MAX_DISTANCE, 1.);
     
      if (IsUnitType(f, UNIT_TYPE_DEAD)) {
       uknockback.create(f, Atan2(GetWidgetY(f)-GetWidgetY(u), GetWidgetX(f)-GetWidgetX(u))).ApplyMotion();
       DDGenericSound(SOUND_CHOP, SOUND_CHOP_VOL, x, y, SOUND_MAX_DISTANCE, 1.);
      }
     }
     
     f = null;
     return false;
    }));
   
    if (dist < 0.) {
     SetUnitPathing(u, true);
     PauseUnit(u, false);
     SetUnitTimeScale(u, 1.);
     SetUnitVertexColor(u, 255, 255, 255, 255);
     DDStartTim(.6, false, New_pUnit(u), function() {
      p_unit pu = DDTimData();
      SetUnitAnimation(pu[00], "stand");
      pu.destroy();
      DDQuitTim();
     });
     if (GetLocalPlayer() == p)
      SelectUnit(u, true);
     DDRecycleGroup(g);
     DDRecycleGroup(gd);
     DestroyEffect(e);
     e = null;
     destroy();
     DDQuitTim();
    }
   });
  }
 }
 

 struct illusions {
  unit il[MAX_ILLUSIONS], u;
  real dist[MAX_ILLUSIONS_ARRAY];
  effect e[MAX_ILLUSIONS];
  real w_spd;
  real dx, dy;
  real dx2, dy2;
  real x, y, tx, ty;
  real rad;
 
  static method create(unit u, real tx, real ty) -> thistype {
   thistype this = allocate();
   integer i;
   playercolor pc = GetPlayerColor(GetOwningPlayer(u));
   real px, py;
   
   this.u = u;
   this.tx = tx; this.ty = ty;
   x = GetUnitX(u); y = GetUnitY(u);
   w_spd = DD_INTERVAL * ILLUSION_HEIGHT / ILLUSION_DURATION;
   rad = Atan2(ty-y, tx-x);
   dx = Cos(rad); dy = Sin(rad);
   
   for(i=01; i < MAX_ILLUSIONS_ARRAY+01; i+=01) {
    px = x + (i*ILLUSION_WIDTH)/MAX_ILLUSIONS * -dy;
    py = y + (i*ILLUSION_WIDTH)/MAX_ILLUSIONS * dx;
    px += ( (ILLUSION_HEIGHT / Pw_2(ILLUSION_WIDTH/02)) ) * Pw_2((i-01)*ILLUSION_WIDTH/MAX_ILLUSIONS) * dx;
    py += ( (ILLUSION_HEIGHT / Pw_2(ILLUSION_WIDTH/02)) ) * Pw_2((i-01)*ILLUSION_WIDTH/MAX_ILLUSIONS) * dy;
    il[i-01] = CreateUnit(Player(15), UNIT_ILLUSION_RAWCODE, px, py, bj_RADTODEG*rad);
    e[i-01] = AddSpecialEffectTarget(EFFECT_BLADE_ATTACHMENT, il[i-01], "weapon");
    SetUnitVertexColor(il[i-01], ILLUSION_COLOR_RED, ILLUSION_COLOR_GREEN, ILLUSION_COLOR_BLUE, ILLUSION_COLOR_ALPHA);
    SetUnitColor(il[i-01], pc);
    SetUnitTimeScale(il[i-01], ILLUSION_ANIMATION_SPEED/100.);
    SetUnitAnimationByIndex(il[i-01], ILLUSION_ANIMATION_ID);
   
    px = x - (i*ILLUSION_WIDTH)/MAX_ILLUSIONS * -dy;
    py = y - (i*ILLUSION_WIDTH)/MAX_ILLUSIONS * dx;
    px += ( (ILLUSION_HEIGHT / Pw_2(ILLUSION_WIDTH/02)) ) * Pw_2((i-01)*ILLUSION_WIDTH/MAX_ILLUSIONS) * dx;
    py += ( (ILLUSION_HEIGHT / Pw_2(ILLUSION_WIDTH/02)) ) * Pw_2((i-01)*ILLUSION_WIDTH/MAX_ILLUSIONS) * dy;
    il[(i-01)+MAX_ILLUSIONS_ARRAY] = CreateUnit(Player(15), UNIT_ILLUSION_RAWCODE, px, py, bj_RADTODEG*rad);
    e[i-01+MAX_ILLUSIONS_ARRAY] = AddSpecialEffectTarget(EFFECT_BLADE_ATTACHMENT, il[i-01+MAX_ILLUSIONS_ARRAY], "weapon");
    SetUnitVertexColor(il[(i-01)+MAX_ILLUSIONS_ARRAY], ILLUSION_COLOR_RED, ILLUSION_COLOR_GREEN, ILLUSION_COLOR_BLUE, ILLUSION_COLOR_ALPHA);
    SetUnitColor(il[(i-01)+MAX_ILLUSIONS_ARRAY], pc);
    SetUnitTimeScale(il[(i-01)+MAX_ILLUSIONS_ARRAY], ILLUSION_ANIMATION_SPEED/100.);
    SetUnitAnimationByIndex(il[(i-01)+MAX_ILLUSIONS_ARRAY], ILLUSION_ANIMATION_ID);
   
    dist[i-01] = (i*ILLUSION_HEIGHT*2.)/MAX_ILLUSIONS;
   }
   
   return this;
  }
 
  method ApplyMotion() {
   DDStartTim(DD_INTERVAL, true, this, function() {
    thistype this = DDTimData();
    integer i;
    real px, py;
    real sq;
   
    for(i=01; i < MAX_ILLUSIONS_ARRAY+01; i+=01) {
     dist[i-01] -=  w_spd;
     sq = SquareRoot(Pw_2(ILLUSION_WIDTH/02)*dist[i-01] / ILLUSION_HEIGHT);
     px = x + dist[i-01] * dx;
     py = y + dist[i-01] * dy;
     px += sq * -dy; // +90 degrees
     py += sq * dx;
     SetUnitX(il[i-01], px); SetUnitY(il[i-01], py);
     px = x + dist[i-01] * dx;
     py = y + dist[i-01] * dy;
     px -= sq * -dy; // -90 degrees
     py -= sq * dx;
     SetUnitX(il[i-01+MAX_ILLUSIONS_ARRAY], px); SetUnitY(il[i-01+MAX_ILLUSIONS_ARRAY], py);
     
     if (dist[i-01] < 0. && il[i-01] != null) {
      RemoveUnit(il[i-01]);
      RemoveUnit(il[i-01+MAX_ILLUSIONS_ARRAY]);
      il[i-01] = null;
      il[i-01+MAX_ILLUSIONS_ARRAY] = null;
     }
    }
   
    if (il[MAX_ILLUSIONS_ARRAY-01] == null) {
     DDGenericSound(SOUND_ECHO, SOUND_ECHO_VOL, x, y, SOUND_MAX_DISTANCE, 1.);
     iflash.create(u, tx, ty, rad).ApplyMotion();
     destroy();
     DDQuitTim();
    }
   });
  }
 }
 
 // *** Main map startup function ***
 function onInit() {
  // *** Load locals ***
  trigger t = CreateTrigger();
 
  // *** Define users setup ***
  InstinctFlash_Setup();
 
  // *** Event / cond / act registering ***
  TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT);
  TriggerAddCondition(t, Condition(function() -> boolean {
   illusions il;
   unit u;
   
   if (GetSpellAbilityId() != ABILITY_INSTINCT_FLASH)
    return false;
   
   u = GetTriggerUnit();
   il = illusions.create(u, GetSpellTargetX(), GetSpellTargetY());
   il.ApplyMotion();
   ShowUnit(u, false);
   //SetUnitTimeScale(u, ILLUSION_ANIMATION_SPEED/100.);
   //SetUnitAnimationByIndex(u, ILLUSION_ANIMATION_ID);
   
   
   DDGenericSound(SOUND_DRAW, SOUND_DRAW_VOL, GetSpellTargetX(), GetSpellTargetY(), SOUND_MAX_DISTANCE, 1.);
   
   return false;
  }));
 
 }
 
}
//! endzinc


 





Credits


Main


Main

Crazyrussian
VaLkYroN
Tranquil
jigrael
Vexorian
shamanyouranus
JetFangInferno
Daelin
Hueter
Anachron
SkriK
bananaHUNT
Dan van Ohllus
KelThuzad
Skizzik
Erdie

therecordist.com
freesound.org
dueeast.com (dueeast.com/watersounds.html)

Additional:

TheBlooddancer
-JonNny
Deaod
s4nji

Other

Blizzard
Hive Workshop
JassNewGen Pack team.
Audacity
Notepad++

Additional:

TheBlooddancer
-JonNny
Deaod
s4nji
and every one else who helped.






FAQ

Q: Does this work with default JNGP?
A: Yes

Q: It took you long to release this patch! will there be v5?
A: No, this is the last version of DDUP spell pack.

Q: Will you make a new spell pack with more spells?
A: Maybe in zinc with new libraries. That ofc is not my priority as i am currently working on campaign and that shall take me more than enough time for coding and overall making mods, spells... Still not sure but maybe ill make a new spell pack.
Currently it is unknown.

Q: Is there at least one spell in GUI?
A: No

Q: Will you convert any of spells from vjass to GUI?
A: No

Q: Are this spells only for melee maps?
A: All of spells are made as for melee maps but you can use them in any map, as they are easy to modify. They have as well "max damage" deal to configure, making sure that they are not overpowered.

Q: I dont know jass and i want to install few spells in my map, can you help?
A: Yes! there is an block of comments at beginning of every spell which tells you exactlly on how to install spell in your map.

Q: Its said that this spells are fully editable but there is no such an option!
A: This options are not in "Object Editor" ofc you must edit them in Object Editor but main spell setup is done in custom script at beginning of each spell.

Q: Ok i found that text so what to do now?
A: Each variable of this you will see can be set to your own value to completelly remake my spells to your own will. Each variable does something different and comments above them say what each value does.

Q: I want to use this spells in my map which will be for multiplayer at battle.net, are they MUI?
A: Yes

Q: I can see a lot of lines even through i dont know jass other spells usually have about 300 or less lines, is this slow?
A: Should not be, but best is to test it on your own PC

Q: I have slow CPU, low RAM... i need to decrease FPS, can i do that and how?
A: Some spells have that editable already in globals section for users. New ones do not have that there since its not a part of something that spell should change and in fact this is my own constatn which can ofc be editable by you. Go to selected spell and press Alt Gr + F -> search dialog will appear. There write TIMER_DELAY press enter. It will point you to constant value you will see it points to 0.025 which is 40 FPS. If you want to change it set it to (1 / Your FPS).

Q: Do your spells leak? Do you use AnyUnitEventBJ which leak filters?
A: No. No.




Extra Features


All custom code from my DD Library

Code
Code (vJASS):


//============================================================================
//                  Dark Dragon Library Code v1.2
//
//  Installation:
//                  
//                  1) Export instantdummy.mdx from this map and import it to your map, leave path at "war3mapImported/instantdummy.mdx"
//                  2) Copy this trigger to your map, save your map and then change below line "// external ... " or copy "DD Dummy" and paste it in your map
//     3) Copy and paste "Unit Chill" ability from this map to your map
//     4) Match the rawcodes below to your map or use same ones as below
//                
// Credits:
//          ('Vexorian' - dummy.mdx)
//============================================================================

// *** Change "// external" to "//! external", save your map, close map, change back from "//!" to "//" and save map again.
// *** This will create dummy in your map
//
// ==================================
// external ObjectMerger w3u ushd dumy uabi "Aloc,Amrf" uble 0 ucbs 0 ucpt 0 umxp 0 umxr 0 umdl "war3mapImported\instantdummy.mdx" ushu "None" umvh 0 umvs 1 umas 1 umis 1 ucol 0 ufoo 0 uhom 1 umpi 10000 umpm 10000 usid 1 usin 1 unam "DD Dummy"
// ==================================


//! zinc

library DDLib requires optional TimerUtils, optional GroupUtils
{
   
    // -----------------------------------------------------------------------
    // -----------------------------------------------------------------------
    // *** Lib constants ***
    public {
       
  // ----------------------------------------------------------------------
  // * Start modify/match rawcodes to your map
        constant        integer     DD_DUMMYCODE       = 'dumy';
        constant        integer     DD_ABILITY_CROWN_FORM     = 'Amrf';
  constant   integer  DD_CHILL     = 'Afre';
  constant   integer  DD_CHILL_BUFF    = 'Bfer';
  // * End modify
  // ----------------------------------------------------------------------
 
 
  constant        integer     p_null             = (0x0);
        constant        real        DD_INTERVAL       = .017;
       
                        // map min and max coords
                        real        DDMinX             = 0.;
                        real        DDMinY             = 0.;
                        real        DDMaxX             = 0.;
                        real        DDMaxY             = 0.;
    }
 
 private {
  constant   integer  HARVEST_ID     = 'Ahrl';
  constant  real  TRIGGER_REFRESH_RATE  = (60.)*3.; /// damage detection trigger
                       
                        unit   TreeChecker              = null;
      trigger  TempTrig      = null;
      integer  NTrig       = 0;
      trigger  DmgTrig[];
      p_real   EnumVec      = p_null;
      boolexpr  EnumFilter      = null;
      sound  ErrorSound     = null;
 }
    // -----------------------------------------------------------------------
    // -----------------------------------------------------------------------
    // -----------------------------------------------------------------------
   
    // * types
    public {
       
        // *** pointer to list of data ***
        type    p_integer           extends     integer[8];
        type    p_real              extends     real[8];
        type    p_unit              extends     unit[8];
       
  function H2ID(handle h) -> integer {
   return GetHandleId(h) - 0x100000;
  }
 
        function New_pInteger(integer i) -> p_integer
        { p_integer p = p_integer.create(); p[0] = i; return p; }
        function New_pReal(real r) -> p_real
  { p_real p = p_real.create(); p[0] = r; return p; }
        function New_pUnit(unit u) -> p_unit
  { p_unit p = p_unit.create(); p[0] = u; return p; }
       
  function pVector(real x, real y, real z) -> p_real {
   p_real v = p_real.create();
   v[0] = x; v[1] = y; v[2] = z;
   return v;
  }

    }
   
    // -----------------------------------------------------------------------
    // ->           ***** private globals *****
    // -----------------------------------------------------------------------
    private {
        location    TempLoc         = Location(0., 0.);
        timer       TimerStack[];
        integer     TimN            = 0;
        group       GroupStack[];
        integer     GrpN            = 0;
        unit        DummyStack[];
        integer     DumN            = 0;
 
  integer  UnitStackData = 0;
  unit  UnitStack[];
  integer  US_N   = 0;
       
        public hashtable   DDHT            = InitHashtable();
    }
    // -----------------------------------------------------------------------
   
   public {
   
        // *** Global funcs
       
        function Pw_2(real x) -> real {
            return x*x;
        }
       
        function DDTerrZ(real x, real y) -> real {
            MoveLocation(TempLoc, x, y);
            return GetLocationZ(TempLoc);
        }
       
        function DDWidgetTerrZ(widget w) -> real {
            return DDTerrZ(GetWidgetX(w), GetWidgetY(w));
        }
       
        // =================================================================
        //              *** Save Handle data ****
        // =================================================================
       
        function DDSet(handle h, integer id, integer val) {
            SaveInteger(DDHT, id+1, GetHandleId(h), val);
        }
       
        function DDGet(handle h, integer id) -> integer {
            return LoadInteger(DDHT, id+1, GetHandleId(h));
        }
 
  function DDHas(handle h, integer id) -> boolean {
   return HaveSavedInteger(DDHT, id+1, GetHandleId(h));
  }
 
  function DDFlush(integer id) {
   FlushChildHashtable(DDHT, id+1);
  }
       
        // =================================================================
        //              *** Timer Handling ****
        // =================================================================
   
        // -> Load timer for recycling
        function DDLoadTim() -> timer {
            static if (LIBRARY_TimerUtils) { return NewTimer(); }
            else {
                if (TimN > 0) {
                    TimN -= 1;
                    return TimerStack[TimN];
                }
                return CreateTimer();
            }
        }
       
        // -> recycle loaded timer
        function DDRecycleTim(timer t) {
            static if (LIBRARY_TimerUtils) { ReleaseTimer(t); }
            else {
                TimerStack[TimN] = t;
                TimN += 1;
            }
        }
       
       
        // ** Get data stored on expired timer
        function DDTimData() -> integer {
            return LoadInteger(DDHT, GetHandleId(GetExpiredTimer()), 0);
        }
       
        // ** start timer with data storage
        function DDStartTim(real secs, boolean looping, integer pdata, code func) -> timer {
            timer t = DDLoadTim();
           
            SaveInteger(DDHT, GetHandleId(t), -1, 0); // ticks
            SaveInteger(DDHT, GetHandleId(t), 0, pdata); // data
            TimerStart(t, secs, looping, func);
            return t;
        }
       
        // ** start timer with data storage, and launches it instantly
        function DDStartTimInst(real secs, boolean looping, integer pdata, code func) -> timer {
            timer t = DDLoadTim(), t2 = DDLoadTim(), t3 = DDLoadTim();
           
            SaveInteger(DDHT, GetHandleId(t), -1, 0); // ticks
            SaveInteger(DDHT, GetHandleId(t), 0, pdata); // data
            TimerStart(t, 0., false, func);
           
            t2 = DDLoadTim();
            SaveInteger(DDHT, GetHandleId(t2), -1, 1); // ticks
            SaveInteger(DDHT, GetHandleId(t2), 0, pdata); // data
            TimerStart(t2, secs, looping, func);
   
   t3 = DDLoadTim();
            SaveTimerHandle(DDHT, GetHandleId(t3), 1, t);
   SaveTimerHandle(DDHT, GetHandleId(t3), 2, t2);
            TimerStart(t3, .001, false, function() {
    timer t = GetExpiredTimer();
    timer t2 = LoadTimerHandle(DDHT, GetHandleId(t), 1);
    timer t3 = LoadTimerHandle(DDHT, GetHandleId(t), 2);
   
    // *** was t2 destroyed?
    if (LoadInteger(DDHT, GetHandleId(t2), -1) == -1) {
     // Stop timer 2
     SaveInteger(DDHT, GetHandleId(t3), -1, -1); // ticks
     PauseTimer(t3);
     DDRecycleTim(t3);
    } else {
     // was not destoyed, then clean first one
     SaveInteger(DDHT, GetHandleId(t2), -1, -1); // ticks
     PauseTimer(t2);
     DDRecycleTim(t2);
    }
   
    PauseTimer(t);
    DDRecycleTim(t);
   });
           
            return t;
        }
       
        // *** Gets current tick and adds next one ***
        function DDTimTick() -> integer {
            timer t = GetExpiredTimer();
            integer tick = LoadInteger(DDHT, GetHandleId(t), -1);
            SaveInteger(DDHT, GetHandleId(t), -1, tick + 1); // next tick
            return tick;
        }
       
        // *** Custom timer tick
        function DDCTimTick(timer t) -> integer {
            return LoadInteger(DDHT, GetHandleId(t), -1);
        }
       
        // *** Quit expired timer ***
        function DDQuitTim() {
   SaveInteger(DDHT, GetHandleId(GetExpiredTimer()), -1, -1); // ticks
            PauseTimer(GetExpiredTimer());
            DDRecycleTim(GetExpiredTimer());
        }
       
        // =================================================================
        //              *** Group Handling ****
        // =================================================================
       
        // -> Load timer for recycling
        function DDLoadGroup() -> group {
            static if (LIBRARY_GroupUtils) { return NewGroup(); }
            else {
                if (GrpN > 0) {
                    GrpN -= 1;
                    return GroupStack[GrpN];
                }
                return CreateGroup();
            }
        }
       
        // -> Recycle group
        function DDRecycleGroup(group g) {
            static if (LIBRARY_GroupUtils) { ReleaseGroup(g); }
            else {
    GroupClear(g);
                GroupStack[GrpN] = g;
                GrpN += 1;
            }
        }
       
        // --------------------------------------------------------
        // -- Quick filter area
  private integer GroupFilterData = 00;
 
        function DDGroupFilterArea(real x, real y, real radius, integer data, code func) {
            group g = DDLoadGroup();
   GroupFilterData = data;
            GroupEnumUnitsInRange(g, x, y, radius, Filter(func));
            DDRecycleGroup(g);
        }
       
        // --------------------------------------------------------
        // -- Quick filter rect
        function DDGroupFilterRect(rect r, integer data, code func) {
            group g = DDLoadGroup();
   GroupFilterData = data;
            GroupEnumUnitsInRect(g, r, Filter(func));
            DDRecycleGroup(g);
        }
       
  function DDGFilterData() -> integer {
   return GroupFilterData;
  }
 
  function DDGFilterDataSet(integer data) {
   GroupFilterData = data;
  }
 
  // --------------------------------------------------------
        // *** Filtrates and fills units in to memory
        function DDGroupFillMemArea(real x, real y, real radius, integer data, code filter) {
   group g = DDLoadGroup();
   boolexpr exp = And(Filter(filter), Filter(function() -> boolean {
    UnitStack[US_N] = GetFilterUnit();
    US_N += 1;
    return false;
   }));
   US_N = 0;
   UnitStack[0] = null;
   UnitStackData = data;
   GroupEnumUnitsInRange(g, x, y, radius, exp);
   DDRecycleGroup(g);
   DestroyBoolExpr(exp);
   exp = null;
  }
 
  function DDGroupFillMemRect(rect r, integer data, code filter) {
   group g = DDLoadGroup();
   boolexpr exp = And(Filter(filter), Filter(function() -> boolean {
    UnitStack[US_N] = GetFilterUnit();
    US_N += 1;
    return false;
   }));
   US_N = 0;
   UnitStack[0] = null;
   UnitStackData = data;
   GroupEnumUnitsInRect(g, r, exp);
   DDRecycleGroup(g);
   DestroyBoolExpr(exp);
   exp = null;
  }
 
  function DDMemUnitN() -> integer { return US_N; }
  function DDMemUnitData() -> integer { return UnitStackData; }
 
  function DDMemUnit(integer index) -> unit {
   if (US_N == 0) return null;
   debug {
    if (index < 0) {
     BJDebugMsg("DDMemUnit: index less than 0");
     index = 0;
    } else if (index >= US_N) {
     BJDebugMsg("DDMemUnit: index greater than units alloc size");
     index = 0;
    }
   }
   return UnitStack[index];
  }
  // --------------------------------------------------------
 
  // --------------------------------------------------------
  // ***
       
        // =================================================================
        //              *** Dummy Handling ****
        // =================================================================
       
        // -> Load dummy for recycling
        function DDLoadDummy() -> unit {
            if (DumN > 0) {
                DumN -= 1;
                PauseUnit(DummyStack[DumN], false);
                return DummyStack[DumN];
            }
            return CreateUnit(Player(0xF), DD_DUMMYCODE, DDMaxX, DDMaxY, 0.);
        }
       
        // *** prepares/setups dummy for spell casting
        function DDLoadSpellDummy(player owner, real x, real y, integer abil, integer abilLevel) -> unit {
            unit dummy = DDLoadDummy();
            SetUnitOwner(dummy, owner, false);
            SetUnitX(dummy, x);
            SetUnitY(dummy, y);
            if (abil != p_null) {
                UnitAddAbility(dummy, abil);
                SetUnitAbilityLevel(dummy, abil, abilLevel);
            }
            return dummy;
        }
       
        // -> Recycle dummy
        function DDRecycleDummy(unit u) {
            PauseUnit(u, true);
            DummyStack[DumN] = u;
            DumN += 1;
        }
       
        // -> Recycle dummy timed
        function DDRecycleDummyTimed(unit u, real secs) {
            DDStartTim(secs, false, New_pUnit(u), function() {
                DDRecycleDummy(p_unit(DDTimData())[0]);
                p_unit(DDTimData()).destroy();
                DDQuitTim();
            });
        }
       
        // *** shares vision for timed amount, usually for dummy casting
        function DDUnitShareVisionTimed(unit u, player toP, real secs) {
            p_integer pi = p_integer.create();
           
            pi[0] = New_pUnit(u);
            pi[1] = GetPlayerId(toP);
            UnitShareVision(u, toP, true);
            DDStartTim(secs, false, pi, function() {
                p_integer pi = DDTimData();
               
                UnitShareVision(p_unit(pi[0])[0], Player(pi[1]), false);
                p_unit(pi[0])[0] = null;
                p_unit(pi[0]).destroy();
                pi.destroy();
                DDQuitTim();
            });
           
        }
 
        // *** Remove ability timed ***
        private struct uratimed {
            private {
                unit u;
                integer abil;
            }
           
            static method create(unit whichUnit, integer id, real time) -> uratimed {
                thistype this = allocate();
               
                u = whichUnit;
                abil = id;
                DDStartTim(time, false, this, function() {
                    thistype this = DDTimData();
                    UnitRemoveAbility(u, abil);
                    DDQuitTim();
                    deallocate();
                });
               
                return 0;
            }
        }
        function DDRemoveAbilityTimed(unit u, integer abil, real secs) { uratimed.create(u, abil, secs); }
       
  function DDSpellDamage(unit u, unit v, real dmg) {
   real life = GetWidgetLife(v);
   real dmgfactor = 1.;
   
   if (IsUnitType(v, UNIT_TYPE_HERO)) {
    if (UnitHasItemOfTypeBJ(v, 'brac'))
     dmgfactor = .5;
    else
     dmgfactor = .75;
   }
   
   if (life > dmg*dmgfactor) {
    SetWidgetLife(v, life-(dmg*dmgfactor));
   } else
    UnitDamageTarget(u, v, 99999., true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null);
  }
 
  // -------------------------------------------------------------------------------------
  // *** Chills target unit
  private struct chill {
   unit u, dmy;
   real dur;
   
   static key CHILL_KEY;
  }
 
  function DDUnitChill(player p, unit u, real dur) -> boolean {
   chill c = DDGet(u, chill.CHILL_KEY);
   unit d;
   real rad;
   boolean b;
   
   
   if (c == p_null) {
    c = chill.create();
    c.u = u; c.dur = dur;
    DDSet(u, chill.CHILL_KEY, c);
   
    d = DDLoadDummy();
    c.dmy = d;
    rad = GetUnitFacing(d) * bj_DEGTORAD;
    SetUnitOwner(d, p, false);
    UnitAddAbility(d, DD_CHILL);
    SetUnitX(d, GetUnitX(u) - 20.*Cos(rad));
    SetUnitY(d, GetUnitY(u) - 20.*Sin(rad));
    b = IssueTargetOrder(d, "frostnova", u);
    DDRemoveAbilityTimed(d, DD_CHILL, 2.);
    DDRecycleDummyTimed(d, 2.);
   
    if (b)
     DDStartTim(.1, true, c, function() {
      chill c = DDTimData();
     
      c.dur -= .1;
      if (c.dur <= 0.) {
       UnitRemoveAbility(c.u, DD_CHILL_BUFF);
       DDSet(c.u, chill.CHILL_KEY, p_null);
       c.u = null;
       c.destroy();
       DDQuitTim();
      } else if (GetUnitAbilityLevel(c.u, DD_CHILL_BUFF) == 00) {
       IssueTargetOrder(c.dmy, "frostnova", c.u);
      }
     });
   
    return b;
   }
   
   if (c.dur < dur)
    c.dur = dur;
   
   return true;
  }
 
  // ------------------------------------------------------------------------------------------------
 
  struct fade {
   unit u;
   real trans;
   real rate, e_trans, dur;
   
   static constant real INTERVAL = .1;
   
   static method create(unit u, real dur, real s_trans, real e_trans) -> fade {
    fade this = allocate();
   
    this.u = u;
    this.trans = s_trans;
    this.rate = ((e_trans-s_trans)/dur)*fade.INTERVAL;
    this.e_trans = e_trans;
    this.dur = dur;
   
    return this;
   }
  }
 
  // *** Fades unit over time ***
  public function DDFadeUnit(unit u, integer from_alpha, integer to_alpha, real duration) {
   fade f = fade.create(u,
         duration,
         from_alpha/2.55,
         to_alpha/2.55);
   
   SetUnitVertexColor(u, 255, 255, 255, from_alpha);
   // --- Start thread ---
   DDStartTim(fade.INTERVAL, true, f, function() {
    fade f = DDTimData();
   
    f.trans += f.rate;
    f.dur -= fade.INTERVAL;
    SetUnitVertexColor(f.u, 255, 255, 255, R2I(f.trans*2.55));
   
    if (f.dur < 0.) {
     SetUnitVertexColor(f.u, 255, 255, 255, R2I(f.e_trans*2.55));
     f.u = null;
     f.destroy();
     DDQuitTim();
    }
   });
       
  }
 
  // ------------------------------------------------------------------------------------------------
 
        // Check if unit is invulnerable
        function DDIsUnitInvulnerable(unit u) -> boolean {
            unit d = DDLoadDummy();
            real hp = GetWidgetLife(u);
            boolean flag;
           
            UnitDamageTarget(d, u, 1., true, false, null, null, null);
            flag = GetWidgetLife(u) == hp;
            SetWidgetLife(u, hp);
            DDRecycleDummy(d);
           
            return flag;
        }
       
        // *** check if unit is ward
        function DDIsUnitWard(unit whichUnit) -> boolean {
            return GetUnitDefaultMoveSpeed(whichUnit) == 0.;
        }
 
        // =================================================================
        //              *** Effect Handling ****
        // =================================================================
       
        // -----------------------------------------------
        // *** Define movable effect
        struct xeffect {
            private {
                unit u;
                effect e;
                real fac; // facing angle in radians
                real pitch; // pitch in radians
                real decay;
               
                static constant real        EFFECT_DECAY        = 5.;
            }
           
            // =========================================================================================
            // =========================================================================================
            static method create(string mdl, real x, real y, real fac, real scale) -> xeffect {
                xeffect this = allocate();
               
                u = DDLoadSpellDummy(Player(0xF), x, y, 0, 0);
                //UnitAddAbility(u, 'Amrf');
                //UnitRemoveAbility(u, 'Amrf');
                e = AddSpecialEffectTarget(mdl, u, "origin");
                //SetUnitX(u, x); SetUnitY(u, y);
                SetUnitLookAt(u, "Bone_Head", u, Cos(fac*bj_DEGTORAD)*1000., Sin(fac*bj_DEGTORAD)*1000., 0.);
                SetUnitFlyHeight(u, 0., 0.);
                SetUnitScale(u, scale, scale, scale);
                SetUnitAnimationByIndex(u, 90);
                PauseUnit(u, true);
                this.pitch = bj_PI/2.;
                this.decay = EFFECT_DECAY;
                this.fac = fac;
               
                return this;
            }
           
            // -----------------
            method destroy() {
                DestroyEffect(e);
                e = null;
               
                DDStartTim(decay, false, this, function() {
                    xeffect this = DDTimData();
                    SetUnitX(u, DDMaxX);
                    SetUnitY(u, DDMaxY);
                    DDRecycleDummyTimed(u, EFFECT_DECAY-decay);
                    DDQuitTim();
                    deallocate();
                });
            }
           
            // *** destroys effect timed
            method destroyx(real delay) {
                DDStartTim(delay, false, this, function() {
                    xeffect(DDTimData()).destroy();
                    DDQuitTim();
                });
            }
           
            // decay says that after x seconds dummy will disappera from target location,
            // this is usefull if effects do not disappear as quickly as you want
            method Decay(real secs) {
                     if    (secs > EFFECT_DECAY)    decay = EFFECT_DECAY;
                else if    (secs < 0.)              decay = 0.;
                else                                decay = secs;
            }
            // =========================================================================================
            // =========================================================================================
           
            method operator X=(real x)                  { SetUnitX(u, x); }
            method operator Y=(real y)                  { SetUnitY(u, y); }
            method operator Z=(real z)                  { SetUnitFlyHeight(u, z, 0.); }
           
            method operator X() -> real                 { return GetUnitX(u); }
            method operator Y() -> real                 { return GetUnitY(u); }
            method operator Z() -> real                 { return GetUnitFlyHeight(u); }
            method operator WZ() -> real                { return DDWidgetTerrZ(u); }
           
            method operator Facing=(real fac)           { SetUnitLookAt(u, "Bone_Head", u, Cos(fac*bj_DEGTORAD)*1000., Sin(fac*bj_DEGTORAD)*1000., 0.); this.fac = fac; }
            method operator Facing() -> real            { return fac; }
   
   method operator Pitch=(integer pitch)  { SetUnitAnimationByIndex(u, pitch); }
           
            method Face(widget w) { Facing = Atan2(GetWidgetY(w)-Y, GetWidgetX(w)-X)*bj_RADTODEG; }
        }
       
  private type timedeffect extends effect[01];
 
  function DestroyEffectTimed(effect e, real secs) {
   timedeffect te = timedeffect.create();
   te[00] = e;
   DDStartTim(secs, true, te, function() {
    timedeffect te = DDTimData();
    DestroyEffect(te[00]);
    te.destroy();
    DDQuitTim();
   });
  }
    }
 
 // ----------------------------------------------------------------------------
    // *** Main damage detection function, registers any damage dealt to units ***
    public function DDTriggerRegisterAnyUnitDamaged(trigger t) {
        DmgTrig[NTrig] = t;
        NTrig += 1;
    }
   
    function InitDamageDetection() {
  code c = function() {
   if (TempTrig != null)
    DestroyTrigger(TempTrig);
   
   TempTrig = CreateTrigger();
   TriggerRegisterEnterRectSimple(TempTrig, bj_mapInitialPlayableArea);
   TriggerAddCondition(TempTrig, function() -> boolean {
    integer i;
   
    // *** Check if we need to exec triggers or register an unit ***
    if (GetTriggerEventId() == EVENT_UNIT_DAMAGED) {
     for(i=0; i < NTrig; i+=1)
      if (IsTriggerEnabled(DmgTrig[i]))
       if (TriggerEvaluate(DmgTrig[i]))
        TriggerExecute(DmgTrig[i]);
    }
    else
     // *** Register new unit ***
     TriggerRegisterUnitEvent(GetTriggeringTrigger(),
            GetTriggerUnit(),
            EVENT_UNIT_DAMAGED);
   
    return false;
   });
   
   DDGroupFilterRect(bj_mapInitialPlayableArea, 00, function() -> boolean {
    TriggerRegisterUnitEvent(TempTrig, GetFilterUnit(), EVENT_UNIT_DAMAGED);
    return false;
   });
  };
  trigger t = CreateTrigger();
 
  TriggerAddAction(t, c);
  TriggerExecute(t);
  DestroyTrigger(t);
  TimerStart(CreateTimer(), TRIGGER_REFRESH_RATE, true, c);
  t = null;
    }
 
 // ---------------------------------------------------------------------------------
 
 // *** Main enum dests in range function ***
    public function DDEnumDestsInRange(p_real vec, real radius, boolexpr filter, code pfunc) {
        rect r = Rect(vec[0]-radius, vec[1]-radius, vec[0]+radius, vec[1]+radius);
 
   EnumVec[0] = vec[0];
   EnumVec[1] = vec[1];
   EnumVec[2] = radius;
           
        if (filter != null) filter = And(EnumFilter, filter);
        else filter = EnumFilter;
        EnumDestructablesInRect(r, filter, pfunc);
 
        if (filter != EnumFilter) { DestroyBoolExpr(filter); filter = null; }
  RemoveRect(r);
  r = null;
    }
       
    function InitEnumDests() {
        EnumVec = p_real.create();
        EnumFilter = Filter(function() -> boolean {
            return Pw_2(EnumVec[0]-GetDestructableX(GetFilterDestructable())) + Pw_2(EnumVec[1]-GetDestructableY(GetFilterDestructable())) < Pw_2(EnumVec[2]);
        });
    }
   
 // --------------------------------------------------------------------------------------
 
 // *** checks is destruct tree ***
    public function DDIsDestructableTree(destructable d) -> boolean {
        if (d != null) {
            PauseUnit(TreeChecker, false);
            if (IssueTargetOrder(TreeChecker, "harvest", d)) {
                PauseUnit(TreeChecker, true);
                return true;
            }
            PauseUnit(TreeChecker, true);
        }
        return false;
    }

    function InitDestTreeCheck() {
        TreeChecker = CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), DD_DUMMYCODE, DDMaxX, DDMaxY, 0.);
        UnitAddAbility(TreeChecker, HARVEST_ID);
        PauseUnit(TreeChecker, true);
    }
 
 // --------------------------------------------------------------------------------------
   
 public function DDNewTextTagUnit(unit whichUnit, string text, real dur, real red, real green, real blue, real transparency) {
  CreateTextTagUnitBJ( text, whichUnit, 0., 11.00, red, green, blue, transparency );
  SetTextTagPermanentBJ( bj_lastCreatedTextTag, false );
  SetTextTagVelocityBJ( bj_lastCreatedTextTag, 48.00, 90 );
  SetTextTagFadepointBJ( bj_lastCreatedTextTag, dur-1.25 );
  SetTextTagLifespanBJ( bj_lastCreatedTextTag, dur );
 }
 
 // --------------------------------------------------------------------------------------
 
 struct cameranoisedata {
  player p[12];
  integer n=00;
 }
 
 public function DDCameraSetSourceNoiseForPlayers(real x, real y, real mag, real vel, real maxDist, real duration) {
  integer i;
  real d;
  cameranoisedata cnd = cameranoisedata.create();
 
  for (i=00; i < bj_MAX_PLAYERS; i+=01) {
   if (GetLocalPlayer() == Player(i)) {
    d = SquareRoot( Pw_2(GetCameraTargetPositionX()-x) + Pw_2(GetCameraTargetPositionY()-y) );
    if (d < maxDist) {
     cnd.p[cnd.n] = Player(i);
     CameraSetSourceNoise(mag-(d*(mag/maxDist)), vel-(d*(vel/maxDist)));
     CameraSetTargetNoise(mag-(d*(mag/maxDist)), vel-(d*(vel/maxDist)));
     cnd.n += 01;
    }
   }
  }
 
  DDStartTim(duration, false, cnd, function() {
   cameranoisedata cnd = DDTimData();
   
   while(cnd.n != 00) {
    cnd.n -= 01;
    if (GetLocalPlayer() == cnd.p[cnd.n])
     CameraSetSourceNoise(0., 0.);
     CameraSetTargetNoise(0., 0.);
   }
   
   cnd.destroy();
   DDQuitTim();
  });
 }
 
 // --------------------------------------------------------------------------------------
   
 hashtable GenSndTable = null;
 
    public function DDGenericSound(string file, real vol, real x, real y, real mxDist, real pitch) {
  sound s;
  real d;
  integer i;
  integer snd_n, sh;
       
  // Play sound and shake camera for players within spell cast range
  for (i=00; i < bj_MAX_PLAYERS; i+=01) {
   if (GetLocalPlayer() == Player(i)) {
    d = SquareRoot( Pw_2(GetCameraTargetPositionX()-x) + Pw_2(GetCameraTargetPositionY()-y) );
    if (d < mxDist) {
     sh = StringHash(file);
     snd_n = LoadInteger(GenSndTable, sh, 04);
     s = LoadSoundHandle(GenSndTable, sh, snd_n);
     if (s == null) {
      s = CreateSound(file, false, false, false, 10, 10, "");
      SaveSoundHandle(GenSndTable, sh, snd_n, s);
     } else if (GetSoundIsPlaying(s)) {
      StopSound(s, false, false);
     }
     SetSoundVolume(s, R2I(vol-d*(vol/mxDist)));
     StartSound(s);
     snd_n += 01;
     if (snd_n == 04)
      snd_n = 00;
     SaveInteger(GenSndTable, sh, 04, snd_n);
    }
   }
  }
    }
 
    // --------------------------------------------------------------------------------------
 
 public function DDMsg(string str) {
  DisplayTimedTextFromPlayer(GetLocalPlayer(), 0., 0., 30., str);
 }
 
 // --------------------------------------------------------------------------------------
 
 public function DisplayErrorMsgPlayer(player p, real dur, string msg) {
  if (GetLocalPlayer() == p) {
   StartSound(ErrorSound);
   DisplayTimedTextFromPlayer(p, 0., 0., dur, "|cffffcc00"+ msg +"|r");
  }
 }
 
 // ====================================================================
    function onInit() {
  InitDamageDetection();
  InitDestTreeCheck();
  InitEnumDests();
 
        DDMinX = GetRectMinX(bj_mapInitialPlayableArea);
        DDMinY = GetRectMinY(bj_mapInitialPlayableArea);
        DDMaxX = GetRectMaxX(bj_mapInitialPlayableArea);
        DDMaxY = GetRectMaxY(bj_mapInitialPlayableArea);
 
  GenSndTable = InitHashtable();
 
  ErrorSound = CreateSound( "Sound\\Interface\\Error.wav", false, false, false, 10, 10, "" );
  SetSoundParamsFromLabel( ErrorSound, "InterfaceError" );
  SetSoundDuration( ErrorSound, 614 );
  SetSoundVolume(ErrorSound, 127);
    }
   
}

//! endzinc


 




Note: This spell pack works only for 1.24b+ warcraft patches!

If you have any more questions or suggestions fell free to comment here!
Enjoy!

~Dark Dragon
Contents

DD Universal Pack v5 (Map)

Reviews
Moderator
02:29, 23rd Nov 2008 Dr Super Good: Very good spell pack. All the spells are highly customizable and seem to do their job well. Only problems I noticed are that some spells are not the most efficent. Still I can only recomend using the...
  1. 02:29, 23rd Nov 2008
    Dr Super Good:
    Very good spell pack. All the spells are highly customizable and seem to do their job well. Only problems I noticed are that some spells are not the most efficent. Still I can only recomend using the spells if they are what you are after.

    Possiable areas for improvement
    - Improve code efficiency.
     
  2. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    Bug:

    When using the blademaster spell, at a barrel, you fly in some random way, cause its not an unit.

    Also, please do not use custom models in spells, unless thats what the spell is about.
     
  3. xD.Schurke

    xD.Schurke

    Joined:
    Feb 22, 2006
    Messages:
    948
    Resources:
    5
    Maps:
    1
    Spells:
    4
    Resources:
    5
    ok. they look nice and also i didn't found any leaks (ok realy long spell scripts... 800lines per spell is realy much to read XD)
    also it's realy well documented , I can see you have put a lot of work in it so i give you

    ok like blooddancer said custom models are nice, but not needed in this case... 4.9/5 :p
     
  4. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    588
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    I appreciate your intelligence Blooddancer actually its not a bug but my mistake for allowing it to be casted at barrel. You have my thanks for this one.

    Now Its updated and cant be cast on barrel (destructable) as ofc i used GetSpellTargetUnit(), GetUnitX, Y ... and ofc it did not work.

    Thanks again!

    About part in custom models, I know that you people don't like it for some reason 'size' but i think its nice to give people idea on which model or hero can spells be used on.
     
  5. -JonNny

    -JonNny

    Joined:
    Jan 31, 2007
    Messages:
    486
    Resources:
    12
    Icons:
    3
    Maps:
    4
    Spells:
    4
    Tutorials:
    1
    Resources:
    12
    Its no just the downbload size
    its also the size of all Spells and datas of Hive atall
    Because its just useless to have one model 1000 times in different Spells and model section

    The Spells look nice , but the blademasters Spell looks really strange and not intentioned when casted from a very short range

    The first time i casted Dark Torture one Sword was not removed and stayed forever

    All in all they look nice but its such an huuuge code , i was too lazy to check everything but i can imagine that some things are not really necessary

    Ill give you a [4/5] for this
     
  6. xxdingo93xx

    xxdingo93xx

    Joined:
    Sep 8, 2007
    Messages:
    747
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Well, I will not rate in my standard rating style this time because the code is too long...

    omg xD nearly 3400 lines used totally for 3 spells, sooooooooo many globals and using a library for a spell (?)...
    I am not very sure but you surely have planned that. I usually only use libraries for systems and scopes for spells.
    Well, the spell performace rockz and I give a 10/5 for that, ideas are great. The coding seems to be leakless, perfect but also clearless. I can't figure out to configure it xD Well, 5/5 from me.
     
  7. Dynasti

    Dynasti

    Joined:
    Oct 18, 2007
    Messages:
    877
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    o_O alot of lines :p the spellpack made my comp crash about 3 min into testing for sum reason... My computer has never crashed beafore...
     
  8. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    I know its not a real bug, but its more like an error, cause you made the spell to target 'objects' and not 'units'. But if you somehow, did not remove this, then most people would say that i was a 'bugg' therefor: Bug :D

    Also: Hell'a lot of lines. But also pretty neat spells. You should work on:
    • Not importing models.
    • Less lines

    Regards~
    TheBlooddancer
     
  9. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    588
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    Ok lets see, for some reason my pc starts to lag like hell when using vjass test map option, dont know why. So please test the spells by default starting your Warcraft III.
    Ty!

    I guess ill just have to wait for you to find time rating this in your nice rate system.
    About globals lets see, I made a lots of em to simple edit spell stile, and I am not using any objects storage systems so I need direct one hell of a variables. But dont worry they do not pass the limit of 8191 so they are fast. And you can cast this spells a lots of time in same time. Game Cache limit if 255 variables at same time, which is lol for me.

    Hmm scopes can they do requires and initializer anyway somehow i love keyword library much more I guess it does not cause any trouble to you.
    Ty for comment.

    Thanks for rating. Ok if you really say that you want that model removed or causes you trouble ill remove it.

    Yep blademaster spell is something special as it damages units which are exactly at sword position i did one hell of a trigonometry out there, but anyway at short range it can damage only once and this once it must be at sword position. Last slash it 100% to be target.

    Ok about that swords stay this has to do with collision but ill check this right away.

    Thank you for your comment!

    Yes ofc ty. About models lol if someone really tells me remove it now then I will.
    About less lines. Its because i want to make inline functions actually not make functions but when i got idea of Dark Torture i said like hell more then 2000 lines for one spell is kind killing. But you know this spells are so good made that even if you cast then 5x times at same time its gonna be a little slower then 1x times. Every spell has one global timer this timer lives only when there are TimesOfCast > 0 thats how it is.

    Thank you for comment!
     
    Last edited: Nov 21, 2008
  10. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    I would like you to remove the custom models, and see if you can get same result. If, then edit this upload.

    Oh, yea, and you might wanna merge your double post before Rui see's you.
     
  11. -JonNny

    -JonNny

    Joined:
    Jan 31, 2007
    Messages:
    486
    Resources:
    12
    Icons:
    3
    Maps:
    4
    Spells:
    4
    Tutorials:
    1
    Resources:
    12
    Effects or Icons are not necessary but imo its Ok. Sometimes there is just no matching Icon or Spell look crap with other models (e.g. these swords)
    I didnt look if you did but you should credit the creators and make i hint that Mapper which use your Spell should credit them too

    But I think a big model for a hero is really not needed
     
  12. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    He did credit them, atleast @ The hive.
     
  13. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    588
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    Double post? Didn't I click on update?:confused:


    Both of you i removed the so irritating model :hohum:
    Well anyway now you happy :wink:

    Thank you for finding about this and telling me out. Its fixed + added swords pathing type to NONE from fly so swords will always move at same height even on terrain. Beautiful to see!!! :thumbs_up:

    Once more thank you for comments and have a nice day!
     
  14. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    I meant your two post's above my last post. Not the spell post.
     
  15. Jack_Sparrow93

    Jack_Sparrow93

    Joined:
    May 9, 2008
    Messages:
    1,432
    Resources:
    6
    Icons:
    5
    Maps:
    1
    Resources:
    6
    OMG I live the dark torture! Well done 5/5 +rep
     
  16. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,090
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Boolexprs do not need to be destroyed unless they will never be used again. They do not leaks as they always return the same object. I think I saw you destroy them in this spell atleast once.
     
  17. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    588
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    Yap the boolexpr i use is only (object exist during spell is cast (only one)), when spell ends the object is not needed to be in game anymore so its destroyed. It does returns same object but its object so when spell ends there is no need to leave that object live. In other way some people just make one object which will live always so they dont destroy it, but i am making object exist only during the spell (one of object per spell). As less object in map the less chance to for lag is possible because the object cause lag in maps. Well that's like location, it always returns same location but we will remove it to cause no leak. Even if we could move location whole the time but we remove it coz there would be one hell of a objects in map and when playing on Battle.net with a lot of players hell game would lag hard. Thats why object methodes (functions) are made.

    Once more thank you for comment and approving!
    Best regards!
     
  18. knight26

    knight26

    Joined:
    Jul 16, 2007
    Messages:
    1,101
    Resources:
    0
    Resources:
    0
    HOW AWESOME!!! thats what i call awesomeness... i mostly like the spell with teh swords 10/10
     
  19. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    588
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    Thanks a lot I am glade to hear that you like it!