D.V.D
Make a wish
- Reaction score
- 73
Death Nova
By: D.V.D
First vJass Spell Ever.
Code Type: vJass
Spell Type: No Target
Damage: 50,100,150
Description: The Caster creates circles of dark power around him that keep getting bigger and bigger dealing damage to units in the way. Deals 50,100,150 damage.
Code:
Screenshots:
How to Import:
Copy the code from the map and create a new trigger. Convert the trigger into Jass and delete the code. Then paste the code there and create a ability and edit the raw code in the trigger to the raw code of your ability.
By: D.V.D
First vJass Spell Ever.
Code Type: vJass
Spell Type: No Target
Damage: 50,100,150
Description: The Caster creates circles of dark power around him that keep getting bigger and bigger dealing damage to units in the way. Deals 50,100,150 damage.
Code:
JASS:
scope DeathNova initializer InitTrig
////////////////////////////////////////////////////////////////////////////////////////
// Variables: //
// 1.atype = AttackType of the damage //
// 2.dtype = DamageType of the damage //
// 3.amount = Amount of units created(MUST BE A EVEN NUMBER, NO DECIMAL) //
// 4.damage = Damage done //
// 5.distance = Distance from the point //
// 6.radius = Radius the damage is done in //
// 7.X = X of the middle of the nova //
// 8.Y = Y of the middle of the nova //
// 9.model = The model name when using CreateNovaDamageAllEffect() //
// 10.caster = The Casting Unit of the spell //
////////////////////////////////////////////////////////////////////////////////////////
// Methods: //
// 1.OnDestroy = Nulls everything in the struct and sets it to 0 //
// 2.CreateNovaDamageEffectAll() = Creates a nova that uses Special Effects and //
// damages all the units even allies and yours. //
// 3.CreateNovaDamageAllUnit() = Creates a nova made from units that damages all //
// units including yours and allies. //
////////////////////////////////////////////////////////////////////////////////////////
globals
private constant attacktype Atype = ATTACK_TYPE_MAGIC
private constant damagetype Dtype = DAMAGE_TYPE_NORMAL
private constant integer ID = 039;AHtc039;
private constant real Amount = 20.00
private constant real Distance = 100.00
private constant real Radius = 50.00
private constant string ModelId = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
endglobals
private function GetDamage takes unit caster, integer ID returns real
return(GetUnitAbilityLevel(caster,039;AHtc039;) * 10.00)
endfunction
public struct nova
attacktype atype
damagetype dtype
real amount
real damage
real distance
real radius
real X
real Y
string model
unit caster
method onDestroy takes nothing returns nothing
set .amount = 0.00
set .distance = 0.00
set .radius = 0.00
set .X = 0.00
set .Y = 0.00
set .caster = null
endmethod
method CreateNovaDamageAllEffect takes nothing returns nothing
local real angle = 0
local real intervals = 360 / .amount
local real x
local real y
local effect f
loop
exitwhen angle > 360
set x = .X + .distance * Cos(angle * bj_DEGTORAD)
set y = .Y + .distance * Sin(angle * bj_DEGTORAD)
set f = AddSpecialEffect(.model, x, y)
call UnitDamagePoint(.caster, 0.00, .radius, x, y, .damage, true, false, .atype, .dtype, WEAPON_TYPE_WHOKNOWS)
set angle = angle + intervals
endloop
call DestroyEffect(f)
set f = null
endmethod
endstruct
private function DeathNova takes nothing returns nothing
local nova d = nova.create()
local integer i = 1
local integer e = 10
set d.caster = GetTriggerUnit()
set d.X = GetUnitX(d.caster)
set d.Y = GetUnitY(d.caster)
set d.model = ModelId
set d.distance = Distance
set d.amount = Amount
set d.damage = GetDamage(d.caster,ID)
set d.radius = Radius
set d.atype = Atype
set d.dtype = Dtype
loop
exitwhen i > e
set d.amount = d.amount + 5.00
set d.distance = d.distance + 100.00
set d.radius = d.radius + 10.00
call d.CreateNovaDamageAllEffect()
call PolledWait(0.10)
set i = i + 1
endloop
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == ID
endfunction
//===========================================================================
private function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerAddAction(t, function DeathNova )
endfunction
endscope
Screenshots:
How to Import:
Copy the code from the map and create a new trigger. Convert the trigger into Jass and delete the code. Then paste the code there and create a ability and edit the raw code in the trigger to the raw code of your ability.