kingkingyyk3
Visitor (Welcome to the Jungle, Baby!)
- Reaction score
- 216
[vJass] Shiva's Guard(Artic Blast)
Shiva Guard(Artic Blast)
Shiva Guard(Artic Blast)
JASS:
////////////////////////////////////////////////////////////////////////////////////////////
// Artic Blast (Shiva Guard) by kingking //
// -v 2.2- //
// original created by Icefrog, DotA creator //
// //
// How to implement ? //
// 1) Copy Dummy Slow+Buff and ShivaGuard ability in Object Editor into your map. //
// 2) Copy Missle Dummy to your map. //
// 3) Copy this trigger. //
// 4) Change the rawcode to correct rawcode. //
// //
// Requires : //
// 1) T32 //
// 2) GTrigger //
// 3) DummyCaster //
// 4) Recycle //
// 5) Jasshelper v0.2.A.9 //
////////////////////////////////////////////////////////////////////////////////////////////
scope ArticBlast
globals
private constant integer ABIL_ID = 039;A000039; //Ability's ID
private constant integer MISSLE_ID = 039;e001039; //Missle Dummy's ID
private constant integer DUMMY_SLOW_ID = 039;A001039; //Dummy Slow's ID
private constant string DUMMY_SLOW_ORDER_ID = "slow" //Dummy Slow's Order String
private constant integer NUMBER_OF_BEAMS = 36 //No. of beams
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
private constant group enumGroup = CreateGroup() //Leave it here, no touching.
endglobals
private keyword Data
private constant function Damage takes integer level returns real
return 200. * level //How much damage will deal to targets?
endfunction
private constant function Aoe takes integer level returns real
return 600. + (0. * level) //How large the area is?
endfunction
private constant function Speed takes integer level returns real
return 25. + (0. * level) //How fast the beam will slide?
endfunction
private function FilterUnits takes unit whichUnit, Data whichData returns boolean
return IsUnitEnemy(whichUnit,whichData.owner) and IsUnitType(whichUnit,UNIT_TYPE_DEAD) == false and IsUnitType(whichUnit,UNIT_TYPE_STRUCTURE) == false
//How the targets to be picked?
endfunction
//--------Restricted Area, No more touch, unless you know to edit it.---------\\
private struct Data
static real array cos
static real array sin
static real radian
static conditionfunc func
static Data this
static unit u
unit caster
player owner
group damagedUnits
integer tick
real damage
real speed
integer level
real casterX
real casterY
real aoe
unit array dummies [NUMBER_OF_BEAMS]
private static method effects takes nothing returns boolean
set Data.u = GetFilterUnit()
if FilterUnits(Data.u,Data.this) and not IsUnitInGroup(Data.u,Data.this.damagedUnits) then
call UnitAddAbility(DUMMY,DUMMY_SLOW_ID)
call IssueTargetOrder(DUMMY,DUMMY_SLOW_ORDER_ID,Data.u)
call UnitRemoveAbility(DUMMY,DUMMY_SLOW_ID)
call UnitDamageTarget(Data.this.caster,Data.u,Data.this.damage,false,false,ATTACK_TYPE,DAMAGE_TYPE,null)
call GroupAddUnit(Data.this.damagedUnits,Data.u)
endif
return false
endmethod
private method periodic takes nothing returns nothing
local integer i = 0
if this.tick >= T32_Tick then
set this.casterX = GetUnitX(this.caster)
set this.casterY = GetUnitY(this.caster)
set this.aoe = this.aoe + this.speed
loop
exitwhen i >= NUMBER_OF_BEAMS
call SetUnitX(this.dummies<i>,this.casterX + this.aoe * Data.cos<i>)
call SetUnitY(this.dummies<i>,this.casterY + this.aoe * Data.sin<i>)
set i = i + 1
endloop
set Data.this = this
call GroupEnumUnitsInRange(enumGroup,this.casterX,this.casterY,this.aoe,Data.func)
else
call this.destroy()
call this.stopPeriodic()
endif
endmethod
implement T32x
private static method act takes nothing returns nothing
local Data this = Data.allocate()
local integer i = 0
set this.caster = GetTriggerUnit()
set this.casterX = GetUnitX(this.caster)
set this.casterY = GetUnitY(this.caster)
set this.level = GetUnitAbilityLevel(this.caster,ABIL_ID)
set this.owner = GetOwningPlayer(this.caster)
set this.speed = Speed(this.level)
set this.damage = Damage(this.level)
set this.aoe = 0.
set this.tick = T32_Tick + R2I(Aoe(this.level) / this.speed)
set this.damagedUnits = Group.get()
loop
exitwhen i >= NUMBER_OF_BEAMS
set this.dummies<i> = CreateUnit(Player(15),MISSLE_ID,this.casterX,this.casterY,(Data.radian * i) * 57.2958)
set i = i + 1
endloop
call this.startPeriodic()
endmethod
private method onDestroy takes nothing returns nothing
local integer i = 0
loop
exitwhen i >= NUMBER_OF_BEAMS
call KillUnit(this.dummies<i>)
set this.dummies<i> = null
set i = i + 1
endloop
call Group.release(this.damagedUnits)
endmethod
private static method onInit takes nothing returns nothing
local integer i = 0
set Data.radian = (2 * bj_PI) / NUMBER_OF_BEAMS
loop
exitwhen i > NUMBER_OF_BEAMS
set Data.cos<i> = Cos(Data.radian * i)
set Data.sin<i> = Sin(Data.radian * i)
set i = i + 1
endloop
call GT_AddStartsEffectAction(function Data.act, ABIL_ID)
set Data.func = Condition(function Data.effects)
endmethod
endstruct
// -Spell end-
endscope
</i></i></i></i></i></i></i></i></i>