Name | Type | is_array | initial_value |
do_not_copy_me | location | No | |
FD_dummygrp | group | No | |
FD_int | integer | No | |
FD_real | real | No | |
FD_real2 | real | No | |
FD_real3 | real | No | |
FD_tmppt1 | location | No | |
FD_tmppt2 | location | No |
//TESH.scrollpos=39
//TESH.alwaysfold=0
//==Fiery Damnation v1.31==
//Credits got to: HINDYhat for teaching jass :p
//Needs jngp
//2oo9 by Squiggy
scope FieryDamnation initializer Init //Yea, the first scope handles the dummycreation and the order to move forward
globals //I've seperated the globals into two blocks - the first one's important to modify the spell
private constant integer SPELLID = 'A001' //We set up the constants for the spellid, the dummyability, the angle in which the dummies appear
private constant integer ABILITYID = 'A000' //and the dummyid as well as the path to the effect which is done when casting
private constant integer DUMMYID = 'n000'
private constant integer DUMMY2ID = 'n001'
private constant string EFFPATH = "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"
private constant string EFFPATH2 = "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"
private constant real LIFEFACTOR = 5
endglobals
globals
private player p
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELLID //First, check which ability is cast
endfunction
private function Conditions2 takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == DUMMYID //We check which unit dies
endfunction
private function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real expTime
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real facing = GetUnitFacing(caster)-30 //Here, we set the angle in which to first dummy should move to the caster's - 30
local real dx
local real dy
local unit u
local integer I = 0
local location targloc = GetSpellTargetLoc()
set p = GetOwningPlayer(caster)
set dx = GetLocationX(targloc)-x
set dy = GetLocationY(targloc)-y
set expTime = SquareRoot(dx * dx + dy * dy)/425
loop
exitwhen I == 3
set dx = x+700*Cos((facing+I*30)*bj_DEGTORAD) //Here we set up the targetpoint
set dy = y+700*Sin((facing+I*30)*bj_DEGTORAD)
set u = CreateUnit(p, DUMMYID, x, y, facing+I*30) //The dummy
call IssuePointOrder(u, "move", dx, dy)
call UnitApplyTimedLife(u, 'BTLF', expTime)
call SetUnitAbilityLevel(u, ABILITYID, GetUnitAbilityLevel(caster, SPELLID)) //Now we align the dummy's immolation ability to the caster's level of the ability
call DestroyEffect(AddSpecialEffect(EFFPATH,x, y)) //And last, some effect
set I = I + 1
endloop
set caster = null
call RemoveLocation(targloc)
set targloc = null
set u = null
endfunction
private function Actions2 takes nothing returns nothing //Now the second actions-function is to handle everything what happens when the dummy dies
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real exptimer = GetUnitAbilityLevel(u, ABILITYID) //We set the timer of the dummy to lvl
set u = CreateUnit(GetOwningPlayer(u), DUMMY2ID, x, y, 90) //We spawn the new dummy
call UnitApplyTimedLife(u, 'BTLF', exptimer*(LIFEFACTOR)) //And now we attach the timer to it
call DestroyEffect(AddSpecialEffect(EFFPATH2,x, y)) //It's ordered to cast 'fan of knives'
set u = null
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local trigger t2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerAddAction(t, function Actions)
call TriggerRegisterAnyUnitEventBJ(t2, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t2, Condition(function Conditions2))
call TriggerAddAction(t2, function Actions2)
endfunction
endscope