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

PainSludge + VenomOrb v1.1

Hell again everyone! Since I'm completely unable to use vJASS, I decide to let it rest, and continue to upload spells in JASS. I'm still very much enjoying this, and I hope you like what I made now :).

Here are two small Venom/Poison Spells:

Venom Orb:

Sends an orb to the targeted area, dealing damage to unit it passes by, while leaving a deadly posion on them. Units will take damage each 0.5 seconds for a short duration. If the unit is moving it will receive 50 % more damage.

JASS:
//***************************************************************************************************
//* ========================
//* Venom Orb ver.1.0
//* ========================
//* Made by Shdow89
//*
//*
//* How to implement:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* 1. Copy the spell "Venom Orb" to your map.
//*
//* 2. - Copy the unit "Venom Orb Dummy" to your map.
//*    - Change the rawcode of the unit in the spell code.
//*    - You can change the dummy unit model path (if you would like to look different), and it's scaling value (size).
//*
//* 3. Make a global variable of type unit group and name it damage_group (case sensitive).
//*
//* 4, Make a global variable of type unit and name it getdamager (case sensitive).
//*
//* 5. - Copy the trigger InitHashtable to your map.
//*    - Copy the enitre enitre costum script section to your's in your map (icon, with the map name is the costum script section)
//*    - Copy the trigger Venom Orb to your map. 
//*    - Change the spell raw codes in the spell code, and other data to what you desire.
//*    - Enjoy
//* Choosable/Effects:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Go down through constant function and change to what you like. Units affected are:
//* Enemy Units, Non-Structure, Non-Magic Immune and living. You can change this in
//* function Venom_Orb_Pick_ActionFilter, after the if call.
//*
//*
//* Editor's Word:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* This spell should acheive MUI grouping without having to use dynamic group creation.
//* At some point it's working, but as you may see I'm still using one dynamic group creation
//* (or maybe not). This spell should really be MUI and leak-less.
//*
//* Spells Action:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Sends an orb to the targeted area, dealing damage to unit it passes by, while leaving
//* a deadly posion on them. Units will take damage each 0.5 seconds for a short duration.
//* If the unit is moving it will receive 50 % more damage.
//*
//* Credits:
//* ¯¯¯¯¯¯¯¯
//* dgriff for help with groups.
//* Paskovich for floating text as an external system.
//*
//**************************************************************************************************************
constant function Venom_Orb_End_SFX takes nothing returns string
    return "Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl" // This effect is spawned when orb reaches it's destination, and when units get hit by it.
endfunction

constant function Venom_Orb_DoT_SFX takes nothing returns string
    return "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl" // This effect is spawned every 0.5 (choosable) seconds on the poison affected unit.
endfunction

constant function Venom_Orb_ID takes nothing returns integer
    return 'A000' // Venom Orb spell raw code. Change to yours.
endfunction

constant function Venom_Orb_Dummy_ID takes nothing returns integer
    return 'h000' // Venom Orb Dummy unit raw code. Change to yours.
endfunction

constant function Venom_Orb_Travel_Dist takes integer i returns real
    return 400.0 * i // How far does the orb travel before it's destroyed. 400 * level of Venom Orb.
endfunction

constant function Venom_Orb_Move_Speed takes nothing returns real
    return 30.0 // How fast is the orb moving.
endfunction

constant function Venom_Orb_Pick_Radius takes nothing returns real
    return 175.0 // Collision radius of the orb (with enemy units). AOE of the spell.
endfunction

constant function Venom_Orb_DoT_Time takes integer i returns real
    return 1.0 * i // The duration of the Damage over Time effect. 1 * level of the Venom Orb seconds.
endfunction

constant function Venom_Orb_Init_Damage takes integer i returns real
    return 25.0 * i // Initial damage that orb deals. When it coolides with the enemy units.
endfunction

constant function Venom_Orb_DoT_Damage takes integer i returns real
    return 20.0 * i // The DoT damage. Damage enemy unit receives every -x- seconds.
endfunction

constant function Venom_Orb_DoT_MoveInc takes nothing returns real
    return 0.5 // If the unit is moving, how much should damage be increased. 0.5 stands for 50 %. 1 stands for 100 %.
endfunction

constant function Venom_Orb_DoTimer_Loop takes nothing returns real
    return 0.5 // Damage over Time durational loop effect. This means every 0.5 seconds unit will get damaged, until the DoT duration expires.
endfunction

constant function Venom_Orb_MoveTimer_Loop takes nothing returns real
    return 0.03 // Timer loop speed for moving the dummy unit. I suggest you leave this as it is.
endfunction

//Done with constants. Don't touch anything below this if you are unsure.
//======================================================================================================================
function Venom_Orb_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Venom_Orb_ID()
endfunction       
    
//======================================================================================================================
//The DoT function for enemy units.
//===================================
function Venom_Orb_DoT takes nothing returns nothing
 local timer dmg = GetExpiredTimer()
 
 local unit tar     = LoadUnitHandle(udg_NowHash, GetHandleId(dmg), 1)
 local unit damager = LoadUnitHandle(udg_NowHash, GetHandleId(dmg), 4)
 
 local real dur    = LoadReal      (udg_NowHash, GetHandleId(dmg), 2)
 local real curDur = LoadReal      (udg_NowHash, GetHandleId(dmg), 5)
 local real x      = LoadReal      (udg_NowHash, GetHandleId(dmg), 6)
 local real y      = LoadReal      (udg_NowHash, GetHandleId(dmg), 7)
 local real x1     = GetUnitX      (tar)
 local real y1     = GetUnitY      (tar)
 local real damage = LoadReal      (udg_NowHash, GetHandleId(dmg), 8)
 
 if curDur < dur and IsUnitType(tar, UNIT_TYPE_DEAD) == false then
 
    if x != x1 or y != y1 then
    
      set damage = damage + (damage * Venom_Orb_DoT_MoveInc())
      call UnitDamageTarget (damager, tar, damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, WEAPON_TYPE_WHOKNOWS)
      call DestroyEffect    (AddSpecialEffect (Venom_Orb_DoT_SFX(), x1, y1))

     
      //Creating a floating text.
      call FloatText        (I2S(R2I(damage)) + "!", 0, 255, 0, x1, y1, 0.07, 0.5, 1.5) 

      call SaveReal         (udg_NowHash, GetHandleId(dmg), 5, curDur + Venom_Orb_DoTimer_Loop())
      call SaveReal         (udg_NowHash, GetHandleId(dmg), 6, x1)
      call SaveReal         (udg_NowHash, GetHandleId(dmg), 7, y1)
      set tar = null
      set damager = null
      set dmg = null
   else
   
      call UnitDamageTarget (damager, tar, damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, WEAPON_TYPE_WHOKNOWS)
      call DestroyEffect    (AddSpecialEffect (Venom_Orb_DoT_SFX(), x1, y1))
      call SaveReal         (udg_NowHash, GetHandleId(dmg), 5, curDur + Venom_Orb_DoTimer_Loop())
      
      //Another floating text.
      call FloatText        (I2S(R2I(damage)) + "!", 0, 255, 0, x1, y1, 0.07, 0.5, 1.5) 
      
      call SaveReal         (udg_NowHash, GetHandleId(dmg), 6, x1)
      call SaveReal         (udg_NowHash, GetHandleId(dmg), 7, y1)
      set tar = null
      set damager = null
      set dmg = null
   endif  
      
  else
  
     call PauseTimer(dmg)
     call DestroyTimer(dmg)
     call FlushChildHashtable(udg_NowHash, GetHandleId(dmg))
     set dmg = null
     set tar = null
     set damager = null
  endif   
endfunction

//===================================================================================
//Filter pick and add to DoT function for enemy units. Boolexpr as callback for group
//===================================================================================
function Venom_Orb_Pick_ActionFilter takes nothing returns boolean
    local unit u    = GetFilterUnit()
    local timer dmg = null
    
   if IsUnitEnemy(u, GetOwningPlayer(udg_getdamager)) == true and IsUnitType(u, UNIT_TYPE_STRUCTURE) == false and IsUnitType(u, UNIT_TYPE_DEAD) == false and IsUnitInGroup(u, udg_damage_group) == false then
   
    call DestroyEffect   (AddSpecialEffect(Venom_Orb_End_SFX(), GetUnitX(u), GetUnitY(u)))
    call UnitDamageTarget(udg_getdamager, u, Venom_Orb_Init_Damage(GetUnitAbilityLevel(udg_getdamager, Venom_Orb_ID())), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, WEAPON_TYPE_WHOKNOWS)
    
    set dmg = CreateTimer()
    call SaveUnitHandle  (udg_NowHash, GetHandleId(dmg), 1, u)
    call SaveUnitHandle  (udg_NowHash, GetHandleId(dmg), 4, udg_getdamager)
    call SaveReal        (udg_NowHash, GetHandleId(dmg), 2, Venom_Orb_DoT_Time(GetUnitAbilityLevel(udg_getdamager, Venom_Orb_ID())))
    call SaveReal        (udg_NowHash, GetHandleId(dmg), 5, 0.0) 
    call SaveReal        (udg_NowHash, GetHandleId(dmg), 6, GetUnitX(u))
    call SaveReal        (udg_NowHash, GetHandleId(dmg), 7, GetUnitY(u))
    call SaveReal        (udg_NowHash, GetHandleId(dmg), 8, Venom_Orb_DoT_Damage(GetUnitAbilityLevel(udg_getdamager, Venom_Orb_ID())))
    call TimerStart      (dmg, Venom_Orb_DoTimer_Loop(), true, function Venom_Orb_DoT)
    set dmg = null
    call GroupAddUnit    (udg_damage_group, u)
   endif
   set u = null
   return false
endfunction  

//=======================================
//The function for moving the dummy unit.
//=======================================
function Venom_Orb_Move takes nothing returns nothing
 local timer move = GetExpiredTimer()
 local timer dmg  = null
 
 local unit miss    = LoadUnitHandle(udg_NowHash, GetHandleId(move), 1)
 local real tarX    = LoadReal      (udg_NowHash, GetHandleId(move), 2)
 local real tarY    = LoadReal      (udg_NowHash, GetHandleId(move), 3)
 local real uniX    = GetUnitX      (miss)
 local real uniY    = GetUnitY      (miss)
 local real dist    = SquareRoot    ((uniX - tarX) * (uniX - tarX) + (uniY - tarY) * (uniY - tarY))
 local real angle   = Atan2         (tarY - uniY, tarX - uniX)
 local real moveX   = uniX + Venom_Orb_Move_Speed() * Cos(angle)
 local real moveY   = uniY + Venom_Orb_Move_Speed() * Sin(angle)
 
 if dist <= Venom_Orb_Move_Speed() or IsTerrainPathable(moveX, moveY, PATHING_TYPE_FLYABILITY) == true then
 
   call PauseTimer(move)
   call DestroyTimer(move)
   call FlushChildHashtable(udg_NowHash, GetHandleId(move))
   set move = null
   call DestroyEffect(AddSpecialEffect(Venom_Orb_End_SFX(), uniX, uniY))
   call RemoveUnit(miss)
   call GroupClear(udg_damage_group)
   set miss = null
   
  else   

   call SetUnitPosition      (miss, moveX, moveY)
   
   set udg_getdamager   = LoadUnitHandle(udg_NowHash, GetHandleId(move), 5)
   set udg_damage_group = LoadGroupHandle(udg_NowHash, GetHandleId(move), 20)
   call GroupEnumUnitsInRange(LoadGroupHandle(udg_NowHash, StringHash("Global G"), 0), moveX, moveY, Venom_Orb_Pick_Radius(), Condition(function Venom_Orb_Pick_ActionFilter))
   call SaveGroupHandle(udg_NowHash, GetHandleId(move), 20, udg_damage_group)
   set miss = null
   set move = null
   
  endif
endfunction   

//===============================================
//The starting function. Action, on cast function
//=================================================
function Venom_Orb_Actions takes nothing returns nothing
 local timer move = CreateTimer()
 
 local unit cast = GetTriggerUnit()

 local real angle = Atan2   (GetSpellTargetY() - GetUnitY(cast), GetSpellTargetX() - GetUnitX(cast))
 local real crX   = GetUnitX(cast) + 15.0 * Cos(angle)
 local real crY   = GetUnitY(cast) + 15.0 * Sin(angle)
 
 local unit miss  = CreateUnit(GetOwningPlayer(cast), Venom_Orb_Dummy_ID(), crX, crY, angle * bj_RADTODEG)
 
 local real targetX = GetUnitX(cast) + Venom_Orb_Travel_Dist(GetUnitAbilityLevel(cast, Venom_Orb_ID())) * Cos(angle)
 local real targetY = GetUnitY(cast) + Venom_Orb_Travel_Dist(GetUnitAbilityLevel(cast, Venom_Orb_ID())) * Sin(angle)
 
 call SaveUnitHandle (udg_NowHash, GetHandleId(move), 1, miss)
 call SaveUnitHandle (udg_NowHash, GetHandleId(move), 5, cast)
 call SaveGroupHandle(udg_NowHash, GetHandleId(move), 20, CreateGroup()) 
 call SaveReal       (udg_NowHash, GetHandleId(move), 2, targetX)
 call SaveReal       (udg_NowHash, GetHandleId(move), 3, targetY)
 
 call TimerStart    (move, Venom_Orb_MoveTimer_Loop(), true, function Venom_Orb_Move)
 
 set cast = null
 set miss = null
 set move = null
endfunction  

//=====================================================================================================================================
// **INIT TRIGGER**
//============================
function InitTrig_Venom_Orb takes nothing returns nothing
    local trigger t = CreateTrigger()

    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Venom_Orb_Conditions))
    call TriggerAddAction(t, function Venom_Orb_Actions)

    call Preload(Venom_Orb_End_SFX())
    call Preload(Venom_Orb_DoT_SFX())
    call PreloadStart()

endfunction

Pain Sludge:

Inflicts a target area with a sticky sludge, dealing minor damage to units in it. Sludges will spawn at all enemy units in the targeted area, pulling them back slightly to that position. Every 0.5 seconds they will receive damage, and farther away they are from their sludge more damage they will receive.

JASS:
//***************************************************************************************************
//* ========================
//* Pain Sludge ver.1.0
//* ========================
//* Made by Shdow89
//*
//*
//* How to implement:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* 1. Copy the spell "Pain Sludge" to your map.
//*
//* 2, Make a global variable of type unit and name it getdamager (case sensitive).
//*    If you already have a variable of same name, or you already made this variable for
//*    the other spell, just skip this step.
//*
//* 5. - Copy the trigger InitHashtable to your map.
//*    - Copy the enitre enitre costum script section to your's in your map (top icon, with the map name is the costum script section)
//*    - Copy the trigger Pain Sludge to your map. 
//*    - Change the spell raw codes in the spell code, and other data to what you desire.
//*    - Enjoy
//* Choosable/Effects:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//*  Go down through constants and change the data what you like (special effects, damage, etc.).
//*  Units affected are Non-Structure, Non-Magic immune, Living and Enemy units.
//*  This can be adjusted in the Pain_Sludge_Action_Filter function, after if call.
//*
//*
//* Editor's Word:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//*  This spell doesn't have dummy units, and no dynamic group creation. I belive I did a
//*  good job here, but I'm not sure, any comments are most wellcome.
//*
//* Spells Action:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//*  Inflicts a target area with a sticky sludge, dealing minor damage to units in it. 
//*  Sludges will spawn at all enemy units in the targeted area, pulling them back slightly 
//*  to that position. Every 0.5 seconds they will receive damage, and farther away they are
//*  from their sludge more damage they will receive.
//* Credits:
//* ¯¯¯¯¯¯¯¯
//* dgriff for help with groups.
//* Paskovich for floating text as an external system.
//*
//**************************************************************************************************************
constant function Pain_Sludge_Midd_SFX takes nothing returns string
    return "Objects\\Spawnmodels\\Naga\\NagaBlood\\NagaBloodWindserpent.mdl" // This SFX is spawned when spell is casted in the center of casting point.
endfunction

constant function Pain_Sludge_Pull_SFX takes nothing returns string
    return "Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl" // This SFX is spawned at the affected unit position, and it represents the sludge to which it's respective unit is being pulled.
endfunction

constant function Pain_Sludge_DoT_SFX takes nothing returns string
    return "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" // This SFX is spawned every x seconds on enemy units, that take damage from sludge.
endfunction

constant function Pain_Sludge_ID takes nothing returns integer
    return 'A001' // The raw code of the Pain Sludge ability. Change to yours if used.
endfunction

constant function Pain_Sludge_AOE takes integer i returns real
    return 200.0 * i // Area of Effect of the spell. This means 200 * level of Pain Sludge.
endfunction

constant function Pain_Sludge_Cast_Dmg takes integer i returns real
    return 50.0 * i // Damage dealt to units when right after cast, to the units in casting area. This means 50 * level of Pain Sludge ability.
endfunction

constant function Pain_Sludge_Default_Pull_Dmg takes integer i returns real
    return 20.0 * i // The damage dealt when unit is being pulled (DoT damage). This means 20 * level of Pain Sludge ability.
endfunction

constant function Pain_Sludge_Distance_Inc takes nothing returns real
    return 0.1 // How much of distance (%) should be converted into damage. Distance between point on cast, and enemy units current position. 0.1 means 10 %.
endfunction

constant function Pain_Sludge_Pull_Dur takes integer i returns real
    return 2.0 + i // The total duration of the Pain Sludge pull action. This means 2 + level of Pain Sludge ability.
endfunction

constant function Pain_Sludge_DmG_Rep takes nothing returns integer
    return 17 // This integer presents when should damage be dealt (in pull function). This means every 16th shot of the Pain_Sludge_Timer_Loop. With default data it is 0.03 * 17 = 0.51 seconds.
endfunction

constant function Pain_Sludge_Pull_Speed takes nothing returns real
    return 4.0 // The speed at which unit is being pulled to it's sludge. Please consider if this is to high, unit won't be able to run away from it.
endfunction

constant function Pain_Sludge_Timer_Loop takes nothing returns real
    return 0.03 // How fast does the timer repeats itself. I suggest you leave this as it is, unless you know exactly what you're doing.
endfunction

//Done with constants. Don't touch anything below this line, if you are unsure.
//=======================================================================================================================

function Pain_Sludge_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Pain_Sludge_ID()
endfunction

//================================================================================================================================
function Pain_Sludge_Pull_Actions takes nothing returns nothing
 local timer pull = GetExpiredTimer()
 
 local effect f  = LoadEffectHandle(udg_NowHash, GetHandleId(pull), 9)

 //Settings for the time:

 local unit    dmg  = LoadUnitHandle  (udg_NowHash, GetHandleId(pull), 2)
 local unit    tar  = LoadUnitHandle  (udg_NowHash, GetHandleId(pull), 1)
 local real    ddmg = LoadReal        (udg_NowHash, GetHandleId(pull), 7)
 local real    dur  = LoadReal        (udg_NowHash, GetHandleId(pull), 3)
 local integer dmgR = LoadInteger     (udg_NowHash, GetHandleId(pull), 8)
 local real    cDur = LoadReal        (udg_NowHash, GetHandleId(pull), 6)
 
 //Settings for the pull:
 
 local real curX  = GetUnitX (tar)
 local real curY  = GetUnitY (tar)
 local real pulX  = LoadReal (udg_NowHash, GetHandleId(pull), 4)
 local real pulY  = LoadReal (udg_NowHash, GetHandleId(pull), 5)
 local real angle = Atan2    (pulY - curY, pulX - curX)
 local real moveX = curX + Pain_Sludge_Pull_Speed() * Cos(angle)
 local real moveY = curY + Pain_Sludge_Pull_Speed() * Sin(angle)
 local real dist  = SquareRoot((pulX - curX)*(pulX - curX) + (pulY - curY)*(pulY - curY))
 
 if cDur < dur and IsUnitType(tar, UNIT_TYPE_DEAD) == false then
 
  call SetUnitX(tar, moveX)
  call SetUnitY(tar, moveY)
 
   if dmgR == Pain_Sludge_DmG_Rep() then
      call UnitDamageTarget(dmg, tar, ddmg + (dist * Pain_Sludge_Distance_Inc()), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, WEAPON_TYPE_WHOKNOWS)
      call DestroyEffect   (AddSpecialEffect(Pain_Sludge_DoT_SFX(), GetUnitX(tar), GetUnitY(tar)))
      call FloatText       (I2S(R2I(ddmg + (dist * Pain_Sludge_Distance_Inc()))) + "!", 0, 255, 0, GetUnitX(tar), GetUnitY(tar), 0.07, 0.5, 1.5)
      call SaveInteger     (udg_NowHash, GetHandleId(pull), 8, 0)
   else
      call SaveInteger     (udg_NowHash, GetHandleId(pull), 8, dmgR + 1)      
   endif 
  
  call SaveReal(udg_NowHash, GetHandleId(pull), 6, cDur + Pain_Sludge_Timer_Loop())
   
  set dmg  = null
  set tar  = null
  set pull = null
  set f    = null
  
 else 
 
   call PauseTimer(pull)
   call DestroyTimer(pull)
   call FlushChildHashtable(udg_NowHash, GetHandleId(pull))
   set pull = null
   call DestroyEffect(f)
   set f   = null
   set dmg = null
   set tar = null
   
 endif              
endfunction



function Pain_Sludge_Action_Filter takes nothing returns boolean
 local unit u      = GetFilterUnit()
 local effect f    = null
 local timer pull  = null
 
 if IsUnitEnemy(u, GetOwningPlayer(udg_getdamager)) == true and IsUnitType(u, UNIT_TYPE_STRUCTURE) == false and IsUnitType(u, UNIT_TYPE_DEAD) == false and IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) == false then
 
    call UnitDamageTarget(udg_getdamager, u, Pain_Sludge_Cast_Dmg (GetUnitAbilityLevel(udg_getdamager, Pain_Sludge_ID())), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_POISON, WEAPON_TYPE_WHOKNOWS)
    
    set pull = CreateTimer()
    call SaveUnitHandle(udg_NowHash, GetHandleId(pull), 1, u)
    call SaveUnitHandle(udg_NowHash, GetHandleId(pull), 2, udg_getdamager)
    call SaveReal      (udg_NowHash, GetHandleId(pull), 3, Pain_Sludge_Pull_Dur(GetUnitAbilityLevel(udg_getdamager, Pain_Sludge_ID())))
    call SaveReal      (udg_NowHash, GetHandleId(pull), 4, GetUnitX(u))
    call SaveReal      (udg_NowHash, GetHandleId(pull), 5, GetUnitY(u))
    call SaveReal      (udg_NowHash, GetHandleId(pull), 6, 0.0)
    call SaveReal      (udg_NowHash, GetHandleId(pull), 7, Pain_Sludge_Default_Pull_Dmg(GetUnitAbilityLevel(udg_getdamager, Pain_Sludge_ID())))
    call SaveInteger   (udg_NowHash, GetHandleId(pull), 8, 0)

    set f = AddSpecialEffect(Pain_Sludge_Pull_SFX(), GetUnitX(u), GetUnitY(u))
    call SaveEffectHandle(udg_NowHash, GetHandleId(pull), 9, f)


    call TimerStart    (pull, Pain_Sludge_Timer_Loop(), true, function Pain_Sludge_Pull_Actions)
    
    set f    = null
    set pull = null
  endif         
    set u = null
    return false
endfunction



function Pain_Sludge_Actions takes nothing returns nothing
 local unit cast  = GetTriggerUnit()
 
 local real castX = GetSpellTargetX()
 local real castY = GetSpellTargetY()
 
 call DestroyEffect(AddSpecialEffect(Pain_Sludge_Midd_SFX(), castX, castY))
 
 set udg_getdamager = cast
 call GroupEnumUnitsInRange(LoadGroupHandle(udg_NowHash, StringHash("Global G"), 0), castX, castY, Pain_Sludge_AOE(GetUnitAbilityLevel(cast, Pain_Sludge_ID())), Condition(function Pain_Sludge_Action_Filter))
 
 set cast = null 
endfunction
//=====================================================================================================================================
// **INIT TRIGGER**
//============================
function InitTrig_Pain_Sludge takes nothing returns nothing
    local trigger t = CreateTrigger()

    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Pain_Sludge_Conditions))
    call TriggerAddAction(t, function Pain_Sludge_Actions)

    call Preload(Pain_Sludge_Pull_SFX())
    call Preload(Pain_Sludge_Midd_SFX())
    call PreloadStart()

endfunction

The spells shoud be MUI and leak-less. Many options to edit, for full documentation check the code or the map.

Credits:
- Paskovich for Floating Text system (external)
- dgriff for help with groups


Comments are most wellcome, and so are rates. Have fun!

Changelog 1.1:

- Added a preload action in Pain Sludge, that I missed before.

Keywords:
Venom, Orb, Sludge, Pain, Pull, Travel, XY, Poison
Contents

Just another Warcraft III map (Map)

Reviews
10:32, 24th Dec 2009 The_Reborn_Devil: The triggering looks good and the effects are nice. There are no leaks as far as I can see. IIIlllllllllllll ----- I approve this spell Rating: Recommended Merry christmas :D

Moderator

M

Moderator

10:32, 24th Dec 2009
The_Reborn_Devil:
The triggering looks good and the effects are nice.
There are no leaks as far as I can see.

IIIlllllllllllll ----- I approve this spell
Rating: Recommended

Merry christmas :D
 
Level 8
Joined
Jun 18, 2007
Messages
214
Check some tutorials.

There are a lot with MUI-Struct explaination, you can also check the other good vJasser codes here in order to get how the MUI stuff is done.

Well I am not sure, but I think that struct usage is for vJass. And, as I said in the description of the spell I can't use vJass, I tried fixing the problem numerous times, and was asking for help. Everything I did failed. Either my computer is silly, or I can't use vJass.
 
Level 8
Joined
Jun 18, 2007
Messages
214
Offtopic: I answered to the thread.
Ontopic: So you will change it to structs when you are able to code in vJass?

This is a JASS spell, If i change it to structs (meaning If I get vJass working at all), I would then have to change to entire code to fit with the newest abilities of vJass, meaning then it would be a vJass spell. But, If I do get vJass working, I will stop to make Jass spells and switch vJass. Thank you very much.
 
Top