Name | Type | is_array | initial_value |
Creep_Point | location | Yes | |
F_Integers | integer | Yes | |
F_ReachedFading | real | Yes | |
F_RFS_Caster | unit | Yes | |
F_RFS_MaxDamage | real | Yes | |
F_SetFadeValue | boolean | Yes | |
F_Time | real | Yes | |
F_Unit | unit | Yes | |
KB_GeneralIntegers | integervar | Yes | |
MAP_UNIT | unit | No | |
RF_AoE | real | No | |
RF_DamagePoint | location | No | |
RF_DamageTrees | boolean | No | |
RF_FallingTime | real | No | |
RF_MaxDamagePerRock | real | No | |
RF_MinDamagePerRock | real | No | |
RF_RockfallSequenceTimer | real | No | |
RF_RocksPerLevel | integer | No | |
RF_SineReals | real | Yes | |
RF_UnitGroup | group | No | |
RFA_Angle | real | Yes | |
RFA_Caster | unit | Yes | |
RFA_Distances | real | Yes | |
RFA_Group | group | No | |
RFA_HighSettings | real | Yes | |
RFA_Integers | integer | Yes | |
RFA_JumpHigh | real | Yes | |
RFA_MaxDmg | real | Yes | |
RFA_ReachedDistance | real | Yes | |
RFA_RealTimer | real | Yes | |
RFA_SpeedUnits | real | Yes | |
RFA_TempPoint | location | Yes | |
RFA_Unit | unit | Yes | |
RFAA_JumpHigh_Distance | real | No | |
RFAA_Speed | real | No | |
RFAA_TargetPoint | location | No | |
RFAA_Unit | unit | No | |
RFS_Caster | unit | Yes | |
RFS_Conjuring | boolean | Yes | |
RFS_ConjurPoint | location | No | |
RFS_DummyIntegers | integer | Yes | |
RFS_MaxDamage | real | Yes | |
RFS_NumberConjured | integer | Yes | |
RFS_NumberOfRocks | integer | Yes | |
RFS_Reals | real | Yes | |
RFS_TempPoint | location | Yes | |
RFS_Timer | real | Yes | |
RFSine_Caster | unit | Yes | |
RFSine_Integers | integer | Yes | |
RFSine_MaxDamage | real | Yes | |
RFSine_Unit | unit | Yes | |
Temp_Integer | integer | No | |
TK_SpecialEffect | modelfile | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
Astonishing Beam is a spell created by Paladon.
'Description:
Forms the arcane energies of the caster into
an orb unleashing it`s power down to the earth.
Impact with an enemied unit deals damage and
slows the targets by reducing their size.
To use this spell, you need to do the following steps:
1) Import the DUMMY.mdx into your map.
2) Import the Astonishing Beam spell and the Astonishing Beam buff
as well as the AstonishingBeam_Effect spell into your map.
3) Copy the Dummy unit into your map.
4) Copy the Astonishing Beam script out of the Trigger Editor
and copy the General Script out of the Trigger Editor into your map.
5) Adjust the Settings in the Astonishing Beam script.
Note: This spell uses vJass, you will need the JassNewGen Editor in order to use this spell.
Have fun with it,
Paladon
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope AstonishingBeam initializer GetStarted
globals
private constant integer SpellID = 'A000' // Insert the rawcode of the Astonishing Beam spell in the Object Editor (Ctrl+D)
private constant integer EffectID = 'A001' // Insert the rawcode of the AstonishingBeam_Effect buff in the Object Editor (Ctrl+D)
private constant string OrbModel = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" // Returns the path of the source model of the ray
private constant string ImpactModel = "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl" // Returns the path of the impact model of the ray
private constant string HitModel = "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdl" // Returns the path of the effect displayed whenever the ray hits a unit
private constant string RayModel = "DRAM" // Returns the model of the ray (lightning), "CLPB" is the chain lightning, "DRAL" is the drain life lightning, "DRAM" is the drain mana lightning, "AFOD" returns the finger of death lightning, "HWPB" returns the healing wave lightning and "MBUR" the mana burn lightning.
private constant real Offset = 250 // Returns the length of the ray
private constant real FlyHeight = 300 // Returns height of the source
private constant real RiseTime = 1 // Returns the time until the ray's source is lifted
private constant real ImpactDamagePerLvl = 40 // Returns the damage dealt per level upon impact to the enemied units
endglobals
//!*******************************END OF THE SETTINGS*************************!\\
//**Do not modify anything below this line unless you know what you are doing**\\
//!***************************************************************************!\\
globals
private group PickGroup
private real interval = 0.9*RiseTime
private integer i = 0
private unit tempU
private player tempP
private group tempG
endglobals
//!***********************************
// Filter Function
private function GetFilter takes nothing returns boolean
set tempU = GetFilterUnit()
return GetWidgetLife(tempU)>0 and IsUnitEnemy(tempU,tempP) and IsUnitType(tempU,UNIT_TYPE_STRUCTURE)==false and IsUnitType(tempU,UNIT_TYPE_MAGIC_IMMUNE)==false
endfunction
//!***********************************
// Spell Condition
private function condition takes nothing returns boolean
return GetSpellAbilityId() == SpellID
endfunction
//!***********************************
// Main Part
private struct Spell
private unit caster
private unit orb
private real x
private real y
private real sinnumber
private real size
private real OffsetDegree
private integer state
private integer level
private lightning light
private group PickedGroup
private static Spell array indx
private static integer counter = 0
private static timer time = CreateTimer()
static method Execution takes nothing returns nothing
local Spell d
local location array l
set i = 0
loop
exitwhen i >= Spell.counter
set d = Spell.indx[i]
if d.state == 1 then
set d.sinnumber = d.sinnumber+interval
call SetUnitFlyHeight(d.orb,Sin(d.sinnumber*bj_DEGTORAD)*FlyHeight,0)
if d.sinnumber == 90 then
set d.state = 2
set l[1] = Location(d.x,d.y)
set l[2] = Location(PPX,PPY)
call PolarProjection(d.x,d.y,Offset,(d.size*100-d.OffsetDegree))
set d.light = AddLightningEx(RayModel,true,d.x,d.y,GetLocationZ(l[1])+FlyHeight,PPX,PPY,GetLocationZ(l[2]))
set d.size = d.size - 0.02
call SetUnitScale (d.orb,d.size,d.size,d.size)
endif
else
if d.state == 2 then
set l[1] = Location(d.x,d.y)
set l[2] = Location(PPX,PPY)
call PolarProjection(d.x,d.y,Offset,(d.size*100-d.OffsetDegree))
call MoveLightningEx(d.light,true,d.x,d.y,GetLocationZ(l[1])+FlyHeight,PPX,PPY,GetLocationZ(l[2]))
call DestroyEffect(AddSpecialEffect(ImpactModel,PPX,PPY))
set d.size = d.size - 0.02
if d.size <= 0 then
set d.state = 3
set d.size = 0
call DestroyLightning(d.light)
call RemoveUnit(d.orb)
endif
call SetUnitScale (d.orb,d.size,d.size,d.size)
set tempP = GetOwningPlayer(d.caster)
set tempG = d.PickedGroup
set PickGroup = CreateGroup()
call GroupEnumUnitsInRange(PickGroup,PPX,PPY,100,Condition(function GetFilter))
loop
set tempU = FirstOfGroup(PickGroup)
exitwhen tempU == null
if IsUnitInGroup(tempU,d.PickedGroup)==false then
call GroupAddUnit(d.PickedGroup,tempU)
call UnitDamageTarget(d.caster,tempU,ImpactDamagePerLvl*d.level,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
call DestroyEffect(AddSpecialEffect(HitModel,GetUnitX(tempU),GetUnitY(tempU)))
call CreateDummy (GetOwningPlayer(d.caster),"",PPX,PPY,0,0,1,100,100,100,0)
call UnitAddAbility(LastCreatedDummy,EffectID)
call SetUnitAbilityLevel(LastCreatedDummy,EffectID,d.level)
call IssueTargetOrder(LastCreatedDummy,"bloodlust",tempU)
call UnitApplyTimedLife(LastCreatedDummy,'BTLF',1)
endif
call GroupRemoveUnit(PickGroup,tempU)
endloop
call DestroyGroup(PickGroup)
else
if d.state == 3 then
call GroupClear(d.PickedGroup)
call DestroyGroup(d.PickedGroup)
set d.light = null
set d.orb = null
set d.caster = null
set d.PickedGroup = null
call d.destroy()
set Spell.counter = Spell.counter - 1
set Spell.indx[i] = d.indx[Spell.counter]
set i = i - 1
endif
endif
endif
set i = i + 1
endloop
set i = 0
call RemoveLocation(l[1])
call RemoveLocation(l[2])
set l[1] = null
set l[2] = null
if Spell.counter == 0 then
call PauseTimer(Spell.time)
endif
endmethod
static method GetValues takes unit c, unit orb, real x, real y, integer l returns nothing
local Spell d = Spell.allocate()
set d.caster = c
set d.orb = orb
set d.level = l
set d.x = x
set d.y = y
set d.state = 1
set d.sinnumber = 0
set d.size = 3.6
set d.OffsetDegree = GetRandomReal(0,360)
set d.PickedGroup = CreateGroup()
if Spell.counter == 0 then
call TimerStart(Spell.time,0.01,true, function Spell.Execution)
endif
set Spell.indx[Spell.counter] = d
set Spell.counter = Spell.counter + 1
endmethod
endstruct
private function Input takes nothing returns nothing
local unit t = GetSpellTargetUnit()
local unit c = GetTriggerUnit()
local location l = GetSpellTargetLoc()
set PPX = GetLocationX(l)
set PPY = GetLocationY(l)
call CreateDummy (GetOwningPlayer(c),OrbModel,PPX,PPY,0,0,3.6,50,50,100,0)
call Spell.GetValues(c,LastCreatedDummy,PPX,PPY,GetUnitAbilityLevel(c,SpellID))
call RemoveLocation(l)
set l = null
set c = null
set t = null
endfunction
private constant function NoFilterLeak takes nothing returns boolean
return true
endfunction
private function GetStarted takes nothing returns nothing
local trigger Trig = CreateTrigger()
local filterfunc ff = Filter(function NoFilterLeak)
loop
call TriggerRegisterPlayerUnitEvent(Trig, Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,ff)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
set i = 0
call TriggerAddCondition(Trig, Condition(function condition))
call TriggerAddAction(Trig, function Input)
call Preload(OrbModel)
call Preload(ImpactModel)
call Preload(HitModel)
call PreloadStart()
call DestroyFilter(ff)
set ff =null
endfunction
endscope
//TESH.scrollpos=28
//TESH.alwaysfold=0
library PGScript
globals
constant integer PGScriptDummyID = 'n000'
// Fill in the rawcode of the dummy unit in your map.
// You get the rawcode by pressing Ctrl+D in the Object Editor.
endglobals
//! DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING !\\
//!***********************************
// Dummy Creation Function
// call CreateDummy (owner (player), model path (string), x coordinate (real), y coordinate (real), facing (real), timed life, set 0 for unlimited (real))
globals
unit LastCreatedDummy
endglobals
function CreateDummy takes player p, string modelpath, real x, real y, real face, real dur, real size, real red, real green, real blue, real alpha returns nothing
set LastCreatedDummy = CreateUnit(p,PGScriptDummyID,x,y,face)
call AddSpecialEffectTarget (modelpath,LastCreatedDummy,"origin")
call UnitApplyTimedLife (LastCreatedDummy,'BTLF',dur)
call SetUnitScale (LastCreatedDummy,size,size,size)
if red != 100 or green != 100 or blue != 100 or alpha != 0 then
call SetUnitVertexColor(LastCreatedDummy,PercentTo255(red),PercentTo255(green),PercentTo255(blue),PercentTo255(100.0-alpha))
endif
call UnitAddAbility(LastCreatedDummy,'Arav')
call UnitRemoveAbility(LastCreatedDummy,'Arav')
endfunction
//!***********************************
// Polar Projection Function
// call PolarProjection (x, y, distance, angle)
globals
real PPX
real PPY
endglobals
function PolarProjection takes real rx, real ry, real dist, real angle returns nothing
set PPX = rx + dist * Cos(angle * bj_DEGTORAD)
set PPY = ry + dist * Sin(angle * bj_DEGTORAD)
endfunction
//!***********************************
// Get Angle Function
// call GetAngle (x1,y1,x2,y2)
function GetAngle takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG*Atan2(y2-y1,x2-x1)
endfunction
endlibrary
//TESH.scrollpos=30
//TESH.alwaysfold=0
//************************************************************************
//* *
//* Paladon's General System *
//* [PGS] *
//* Version 1.0 *
//* *
//* This system's purpose is only the support of the featured test map *
//* and does not affect the presented spell(s) or system(s). If you want *
//* to import any of the presented spell(s) or system(s) you don't have *
//* to import this trigger and script. *
//************************************************************************
library PGS
globals
private constant string WMessage = "This spell is presented by Paladon"
//returns the message displayed after starting the map.
private constant integer EnemyPlayer = 1
//returns which player controls your enemies. 0 is red, 1 is blue, etc.
private constant string ReviveEffect = "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl"
//returns the path of the effect displayed upon the rivival of enemies.
private constant real WaitForRevive = 30.00
//returns the time in seconds before the enemy revives again.
private constant boolean FogOn = false
//returns whether the Black Mask and Fog of War is enabled (true) or disabled (false).
private constant real TreeTimer = 10.00
//returns the time in seconds until a fallen tree regrows.
// --- END OF SETTINGS --- DO NOT MODIFY ANYTHING BELOW THIS LINE ---
private unit groupunit
private real array EnemyX
private real array EnemyY
private real array EnemyF
private integer array EnemyI
private filterfunc filter
private destructable Tree
private trigger PGS_TR = CreateTrigger()
private trigger PGS_UR = CreateTrigger()
endglobals
private function TrueFilter takes nothing returns boolean
return true
endfunction
private function W2D takes widget w returns destructable
return null
endfunction
function Message takes string msg returns nothing
local integer i = 0
loop
call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
set i = i + 1
exitwhen i == bj_MAX_PLAYERS
endloop
endfunction
function PGS_URevive takes nothing returns nothing
local unit u = GetTriggerUnit()
if(not(GetUnitUserData(u)<=0))then
call TriggerSleepAction(WaitForRevive)
set groupunit = CreateUnit(Player(EnemyPlayer),EnemyI[GetUnitUserData(u)],EnemyX[GetUnitUserData(u)],EnemyY[GetUnitUserData(u)],EnemyF[GetUnitUserData(u)])
call SetUnitUserData(groupunit, GetUnitUserData(u) )
call DestroyEffect(AddSpecialEffect(ReviveEffect,GetUnitX(groupunit),GetUnitY(groupunit)))
endif
set u = null
endfunction
function PGS_TRevive takes nothing returns nothing
set Tree = W2D(GetTriggerWidget())
call TriggerSleepAction(TreeTimer)
call DestructableRestoreLife(Tree,GetWidgetLife(Tree), true)
set Tree = null
endfunction
function PGS_TR_Events takes nothing returns nothing
set Tree = GetEnumDestructable()
call TriggerRegisterDeathEvent(PGS_TR,Tree)
set Tree = null
endfunction
function InitTrig_PGSystem takes nothing returns nothing
local integer i
local group gro = CreateGroup()
set filter=Filter(function TrueFilter)
call GroupEnumUnitsOfPlayer(gro, Player(EnemyPlayer),filter)
set i = 0
loop
set groupunit = FirstOfGroup(gro)
exitwhen groupunit==null
call GroupRemoveUnit(gro,groupunit)
set i = (i+1)
call SetUnitUserData(groupunit,i)
set EnemyX[i] = GetUnitX(groupunit)
set EnemyY[i] = GetUnitY(groupunit)
set EnemyF[i] = GetUnitFacing(groupunit)
set EnemyI[i] = GetUnitTypeId(groupunit)
endloop
call FogEnable(FogOn)
call FogMaskEnable(FogOn)
call Message(WMessage)
call TriggerRegisterPlayerUnitEvent(PGS_UR,Player(EnemyPlayer), EVENT_PLAYER_UNIT_DEATH,filter)
call TriggerAddAction(PGS_UR, function PGS_URevive)
call TriggerAddAction(PGS_TR, function PGS_TRevive)
set bj_wantDestroyGroup = true
call EnumDestructablesInRect(bj_mapInitialPlayableArea,filter, function PGS_TR_Events)
set PGS_UR = null
call DestroyGroup(gro)
endfunction
endlibrary