Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

Death Carrier No New Posts Warcraft III Spells and Systems

Started by
moyack

0 Members and 1 Guest are viewing this topic.

Rating

Average Score - 5 / 5

« Created: June 27, 2016, 12:18:57 PM by moyack »

Death Carrier
on: June 19, 2013, 09:01:21 AM
Categories: Target Ground, vJASS
Rating: 5
Warcraft III Spell resource
« Created: June 26, 2017, 08:37:06 AM by moyack »
« Last Edit: October 09, 2017, 12:46:17 AM by moyack »

Related Topics or Resources



by

Death Carrier
By moyack. 2009.


 
Requires: Check related topics

Description:
 
A deadly mark moves randomly over the enemies in an area of effect, jumping 5 times over them before exploding and dealing damage to the nearest enemies to the explosion.
 
Level 1 - The explosion deals 100 damage.
Level 2 - The explosion deals 170 damage.
Level 3 - The explosion deals 240 damage.
 

How to install:

  • Open the test map.
  • Add TimerUtils to your map if you haven't it installed. (Could it be possible??).
  • Copy the trigger, the ability and the effect used in this spell into you map.
  • Voila!! spell installed.

Code: jass
  1. // Death Carrier (hmm probably the name is not the best but meh...)
  2. // By moyack. 2009.
  3. // Made for the spell contest No 13 (for the bad luck maybe??)
  4.  
  5. // Requires TimerUtils.
  6.  
  7.  
  8. library DeathCarrier initializer init requires TimerUtils
  9.  
  10. // Configuration part...
  11. globals
  12. private constant integer SpellID = 'A000'
  13. private constant real dt = 0.5 //
  14. endglobals
  15.  
  16. private constant function Damage takes integer lvl returns real
  17. return 100. + 70. * (lvl - 1)
  18. endfunction
  19.  
  20. private constant function AOE takes integer lvl returns real
  21. return 500. // I left it in this way so it can be configurable to a variable area
  22. endfunction
  23.  
  24. private constant function Jumps takes integer lvl returns integer
  25. return 5 // sets the number of times the maks jumps on units before explode
  26. endfunction
  27. // end configuration part...
  28.  
  29. private function GetEnemies takes nothing returns boolean
  30. endfunction
  31.  
  32. private struct data
  33. integer counter = 0
  34.  
  35. private method onDestroy takes nothing returns nothing
  36. call GroupClear(.g)
  37. set .c = null
  38. endmethod
  39.  
  40. private static method PickRandomUnit takes nothing returns nothing
  41. endif
  42. endmethod
  43.  
  44. private static method DealDamage takes nothing returns nothing
  45. endmethod
  46.  
  47. static method effect takes nothing returns nothing
  48. local data d = data( GetTimerData(GetExpiredTimer()) )
  49. local real x
  50. local real y
  51. call ForGroup(d.g, function data.PickRandomUnit)
  52. call d.destroy()
  53. call ReleaseTimer(GetExpiredTimer())
  54. return
  55. endif
  56. set d.counter = d.counter + 1
  57. if d.counter > Jumps(GetUnitAbilityLevel(d.c, SpellID)) then
  58. call GroupClear(d.g)
  59. call GroupEnumUnitsInRange(d.g, x, y, 0.5*AOE(GetUnitAbilityLevel(d.c, SpellID)), Condition(function GetEnemies))
  60. call ForGroup(d.g, function data.DealDamage)
  61. call d.destroy()
  62. call ReleaseTimer(GetExpiredTimer())
  63. else
  64. endif
  65. endmethod
  66.  
  67. static method Start takes unit c, location l returns nothing
  68. local data d = data.allocate()
  69. local timer t = NewTimer()
  70. if d.g == null then
  71. set d.g = CreateGroup()
  72. endif
  73. set d.c = c
  74. call GroupEnumUnitsInRangeOfLoc(d.g, l, AOE(GetUnitAbilityLevel(c, SpellID)), Condition(function GetEnemies))
  75. call SetTimerData(t, integer(d))
  76. call TimerStart(t, dt, true, function data.effect)
  77. set l = null
  78. set t = null
  79. endmethod
  80. endstruct
  81.  
  82. private function Conditions takes nothing returns boolean
  83. return GetSpellAbilityId() == SpellID
  84. endfunction
  85.  
  86. private function Actions takes nothing returns nothing
  87. call data.Start(GetTriggerUnit(), GetSpellTargetLoc())
  88. endfunction
  89.  
  90. //===========================================================================
  91. private function init takes nothing returns nothing
  92. local trigger t = CreateTrigger( )
  93. call TriggerAddCondition( t, Condition( function Conditions ) )
  94. call TriggerAddAction( t, function Actions )
  95. set t = null
  96. endfunction
  97.  
  98. endlibrary

 
Changelog:
 
(2/2/2009) Removed the timer from the struct, now it's managed via local variables.
(11/3/2009) Now every jump deals a random damage to the jumping unit.
« Last Edit: October 09, 2017, 12:46:17 AM by moyack »



 

* Random Spells & Systems

Started by Nasrudin

Replies: 0
Views: 1757
Warcraft III Models

Started by Judash137

Replies: 0
Views: 4847
Warcraft III Models

Started by Wojannnn

Replies: 0
Views: 1362
Warcraft III Models

Started by Wojannnn

Replies: 0
Views: 1640
Warcraft III Models
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...