Name | Type | is_array | initial_value |
Deaths | integer | Yes | |
Dialog | dialog | No | |
DialogButton | button | Yes | |
Integer_Multiboard | integer | No | |
Kills | integer | Yes | |
Kills_Limit | integer | No | |
MT_Hours | integer | No | |
MT_Minutes | integer | No | |
MT_Seconds | integer | No | |
Multiboard | multiboard | No | |
MultiboardRowCounter | integer | Yes | |
PingHint | location | Yes | |
Player | player | No | |
PlayerNumber | integer | No | |
PowerofShockwavePoint | location | Yes | |
Quest | quest | No | |
SpellInteger | integer | Yes | |
TempInt | integer | No | |
TempInteger | integer | No | |
TempPoint | location | Yes | |
TextColor | string | Yes | |
Unit_Group | group | No | |
Vote | integer | Yes | |
Vote_Timer | timer | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
library MultiShock initializer Init
globals
private constant integer ACTIVATOR_RAWCODE = 'A001'
private constant integer DUMMY_RAWCODE = 'h000'
private constant string DUMMY_STRING = "carrionswarm"
private constant real TARGET_ARC = 300
private constant integer WAVE_NUMBER_PER_LEVEL = 3
private constant integer WAVE_NUMBER_BASE = 0
private constant real TARGET_ARC_CUTOFF = TARGET_ARC/6.28319
private constant real TARGET_OFFSET = 150
private constant real DUMMY_DURATION = 1
endglobals
private function MSCondition takes nothing returns boolean
return GetSpellAbilityId() == ACTIVATOR_RAWCODE
endfunction
private constant function DummyFilter takes nothing returns boolean
return true
endfunction
private function MultiShock takes nothing returns nothing
local unit tu = GetTriggerUnit()
local location tl = GetSpellTargetLoc()
local unit lu
local player p = GetOwningPlayer(tu)
local integer im = WAVE_NUMBER_BASE + GetUnitAbilityLevel(tu,ACTIVATOR_RAWCODE) * WAVE_NUMBER_PER_LEVEL
local integer i = 0
local real x = GetUnitX(tu)
local real y = GetUnitY(tu)
local real tx = GetLocationX(tl)
local real ty = GetLocationY(tl)
local real distance = SquareRoot((x-tx)*(x-tx)+(y-ty)*(y-ty))
local real circum
local real r
call RemoveLocation(tl)
set tl = null
if distance > TARGET_ARC_CUTOFF then
set circum = TARGET_ARC/distance
set r = Atan2(ty-y,tx-x) - circum/2
else
set circum = 6.28319
set r = GetUnitFacing(tu)*bj_DEGTORAD
endif
set circum = circum/im
loop
exitwhen i == im
set lu = CreateUnit(p,DUMMY_RAWCODE,x,y,r*bj_RADTODEG)
call UnitApplyTimedLife(lu,'BTLF',DUMMY_DURATION)
call IssuePointOrder(lu,DUMMY_STRING,x+TARGET_OFFSET*Cos(r),y+TARGET_OFFSET*Sin(r))
set r = r + circum
set i = i + 1
endloop
set tu = null
set lu = null
set p = null
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
local filterfunc ff = Filter(function DummyFilter)
loop
exitwhen (i >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, ff)
set i = i + 1
endloop
call TriggerAddCondition(t,Condition(function MSCondition))
call TriggerAddAction(t,function MultiShock)
call DestroyFilter(ff)
set ff = null
endfunction
endlibrary