//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
library Ascii /* v1.1.0.0 TheDamian/Nestharus
************************************************************************************
*
* function Char2Ascii takes string s returns integer
* integer ascii = Char2Ascii("F")
*
* function Ascii2Char takes integer a returns string
* string char = Ascii2Char('F')
*
* function A2S takes integer a returns string
* string rawcode = A2S('CODE')
*
* function S2A takes string s returns integer
* integer rawcode = S2A("CODE")
*
************************************************************************************/
globals
private integer array i //hash
private integer array h //hash2
private integer array y //hash3
private string array c //char
endglobals
function Char2Ascii takes string p returns integer
local integer z = i[StringHash(p)/0x1F0748+0x40D]
if (c[z] != p) then
if (c[z - 32] != p) then
if (c[h[z]] != p) then
if (c[y[z]] != p) then
if (c[83] != p) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"ASCII ERROR: INVALID CHARACTER: " + p)
return 0
endif
return 83
endif
return y[z]
endif
return h[z]
endif
return z - 32
endif
return z
endfunction
function Ascii2Char takes integer a returns string
return c[a]
endfunction
function A2S takes integer a returns string
local string s=""
loop
set s=c[a-a/256*256]+s
set a=a/256
exitwhen 0==a
endloop
return s
endfunction
function S2A takes string s returns integer
local integer a=0
local integer l=StringLength(s)
local integer j=0
local string m
local integer h
loop
exitwhen j==l
set a = a*256 + Char2Ascii(SubString(s,j,j+1))
set j=j+1
endloop
return a
endfunction
private module Init
private static method onInit takes nothing returns nothing
set i[966] = 8
set i[1110] = 9
set i[1621] = 10
set i[1375] = 12
set i[447] = 13
set i[233] = 32
set i[2014] = 33
set i[1348] = 34
set i[1038] = 35
set i[1299] = 36
set i[1018] = 37
set i[1312] = 38
set i[341] = 39
set i[939] = 40
set i[969] = 41
set i[952] = 42
set i[2007] = 43
set i[1415] = 44
set i[2020] = 45
set i[904] = 46
set i[1941] = 47
set i[918] = 48
set i[1593] = 49
set i[719] = 50
set i[617] = 51
set i[703] = 52
set i[573] = 53
set i[707] = 54
set i[1208] = 55
set i[106] = 56
set i[312] = 57
set i[124] = 58
set i[1176] = 59
set i[74] = 60
set i[1206] = 61
set i[86] = 62
set i[340] = 63
set i[35] = 64
set i[257] = 65
set i[213] = 66
set i[271] = 67
set i[219] = 68
set i[1330] = 69
set i[1425] = 70
set i[1311] = 71
set i[238] = 72
set i[1349] = 73
set i[244] = 74
set i[1350] = 75
set i[205] = 76
set i[1392] = 77
set i[1378] = 78
set i[1432] = 79
set i[1455] = 80
set i[1454] = 81
set i[1431] = 82
set i[1409] = 83
set i[1442] = 84
set i[534] = 85
set i[1500] = 86
set i[771] = 87
set i[324] = 88
set i[1021] = 89
set i[73] = 90
set i[1265] = 91
set i[1941] = 92
set i[1671] = 93
set i[1451] = 94
set i[1952] = 95
set i[252] = 96
set i[257] = 97
set i[213] = 98
set i[271] = 99
set i[219] = 100
set i[1330] = 101
set i[1425] = 102
set i[1311] = 103
set i[238] = 104
set i[1349] = 105
set i[244] = 106
set i[1350] = 107
set i[205] = 108
set i[1392] = 109
set i[1378] = 110
set i[1432] = 111
set i[1455] = 112
set i[1454] = 113
set i[1431] = 114
set i[1409] = 115
set i[1442] = 116
set i[534] = 117
set i[1500] = 118
set i[771] = 119
set i[324] = 120
set i[1021] = 121
set i[73] = 122
set i[868] = 123
set i[1254] = 124
set i[588] = 125
set i[93] = 126
set i[316] = 161
set i[779] = 162
set i[725] = 163
set i[287] = 164
set i[212] = 165
set i[7] = 166
set i[29] = 167
set i[1958] = 168
set i[1009] = 169
set i[1580] = 170
set i[1778] = 171
set i[103] = 172
set i[400] = 174
set i[1904] = 175
set i[135] = 176
set i[1283] = 177
set i[469] = 178
set i[363] = 179
set i[550] = 180
set i[1831] = 181
set i[1308] = 182
set i[1234] = 183
set i[1017] = 184
set i[1093] = 185
set i[1577] = 186
set i[606] = 187
set i[1585] = 188
set i[1318] = 189
set i[980] = 190
set i[1699] = 191
set i[1292] = 192
set i[477] = 193
set i[709] = 194
set i[1600] = 195
set i[2092] = 196
set i[50] = 197
set i[546] = 198
set i[408] = 199
set i[853] = 200
set i[205] = 201
set i[411] = 202
set i[1311] = 203
set i[1422] = 204
set i[1808] = 205
set i[457] = 206
set i[1280] = 207
set i[614] = 208
set i[1037] = 209
set i[237] = 210
set i[1409] = 211
set i[1023] = 212
set i[1361] = 213
set i[695] = 214
set i[161] = 215
set i[1645] = 216
set i[1822] = 217
set i[644] = 218
set i[1395] = 219
set i[677] = 220
set i[1677] = 221
set i[881] = 222
set i[861] = 223
set i[1408] = 224
set i[1864] = 225
set i[1467] = 226
set i[1819] = 227
set i[1971] = 228
set i[949] = 229
set i[774] = 230
set i[1828] = 231
set i[865] = 232
set i[699] = 233
set i[786] = 234
set i[1806] = 235
set i[1286] = 236
set i[1128] = 237
set i[1490] = 238
set i[1720] = 239
set i[1817] = 240
set i[729] = 241
set i[1191] = 242
set i[1164] = 243
set i[413] = 244
set i[349] = 245
set i[1409] = 246
set i[660] = 247
set i[2016] = 248
set i[1087] = 249
set i[1497] = 250
set i[753] = 251
set i[1579] = 252
set i[1456] = 253
set i[606] = 254
set i[1625] = 255
set h[92] = 47
set h[201] = 108
set h[201] = 76
set h[203] = 103
set h[203] = 71
set h[246] = 115
set h[246] = 83
set h[246] = 211
set h[254] = 187
set y[201] = 108
set y[203] = 103
set y[246] = 115
set c[8]="\b"
set c[9]="\t"
set c[10]="\n"
set c[12]="\f"
set c[13]="\r"
set c[32]=" "
set c[33]="!"
set c[34]="\""
set c[35]="#"
set c[36]="$"
set c[37]="%"
set c[38]="&"
set c[39]="'"
set c[40]="("
set c[41]=")"
set c[42]="*"
set c[43]="+"
set c[44]=","
set c[45]="-"
set c[46]="."
set c[47]="/"
set c[48]="0"
set c[49]="1"
set c[50]="2"
set c[51]="3"
set c[52]="4"
set c[53]="5"
set c[54]="6"
set c[55]="7"
set c[56]="8"
set c[57]="9"
set c[58]=":"
set c[59]=";"
set c[60]="<"
set c[61]="="
set c[62]=">"
set c[63]="?"
set c[64]="@"
set c[65]="A"
set c[66]="B"
set c[67]="C"
set c[68]="D"
set c[69]="E"
set c[70]="F"
set c[71]="G"
set c[72]="H"
set c[73]="I"
set c[74]="J"
set c[75]="K"
set c[76]="L"
set c[77]="M"
set c[78]="N"
set c[79]="O"
set c[80]="P"
set c[81]="Q"
set c[82]="R"
set c[83]="S"
set c[84]="T"
set c[85]="U"
set c[86]="V"
set c[87]="W"
set c[88]="X"
set c[89]="Y"
set c[90]="Z"
set c[91]="["
set c[92]="\\"
set c[93]="]"
set c[94]="^"
set c[95]="_"
set c[96]="`"
set c[97]="a"
set c[98]="b"
set c[99]="c"
set c[100]="d"
set c[101]="e"
set c[102]="f"
set c[103]="g"
set c[104]="h"
set c[105]="i"
set c[106]="j"
set c[107]="k"
set c[108]="l"
set c[109]="m"
set c[110]="n"
set c[111]="o"
set c[112]="p"
set c[113]="q"
set c[114]="r"
set c[115]="s"
set c[116]="t"
set c[117]="u"
set c[118]="v"
set c[119]="w"
set c[120]="x"
set c[121]="y"
set c[122]="z"
set c[123]="{"
set c[124]="|"
set c[125]="}"
set c[126]="~"
set c[128] = "€"
set c[130] = "‚"
set c[131] = "ƒ"
set c[132] = "„"
set c[133] = "…"
set c[134] = "†"
set c[135] = "‡"
set c[136] = "ˆ"
set c[137] = "‰"
set c[138] = "Š"
set c[139] = "‹"
set c[140] = "Œ"
set c[142] = "Ž"
set c[145] = "‘"
set c[146] = "’"
set c[147] = "“"
set c[148] = "”"
set c[149] = "•"
set c[150] = "–"
set c[151] = "—"
set c[152] = "˜"
set c[153] = "™"
set c[154] = "š"
set c[155] = "›"
set c[156] = "œ"
set c[158] = "ž"
set c[159] = "Ÿ"
set c[160] = " "
set c[161] = "¡"
set c[162] = "¢"
set c[163] = "£"
set c[164] = "¤"
set c[165] = "¥"
set c[166] = "¦"
set c[167] = "§"
set c[168] = "¨"
set c[169] = "©"
set c[170] = "ª"
set c[171] = "«"
set c[172] = "¬"
set c[174] = "®"
set c[175] = "¯"
set c[176] = "°"
set c[177] = "±"
set c[178] = "²"
set c[179] = "³"
set c[180] = "´"
set c[181] = "µ"
set c[182] = "¶"
set c[183] = "·"
set c[184] = "¸"
set c[185] = "¹"
set c[186] = "º"
set c[187] = "»"
set c[188] = "¼"
set c[189] = "½"
set c[190] = "¾"
set c[191] = "¿"
set c[192] = "À"
set c[193] = "Á"
set c[194] = "Â"
set c[195] = "Ã"
set c[196] = "Ä"
set c[197] = "Å"
set c[198] = "Æ"
set c[199] = "Ç"
set c[200] = "È"
set c[201] = "É"
set c[202] = "Ê"
set c[203] = "Ë"
set c[204] = "Ì"
set c[205] = "Í"
set c[206] = "Î"
set c[207] = "Ï"
set c[208] = "Ð"
set c[209] = "Ñ"
set c[210] = "Ò"
set c[211] = "Ó"
set c[212] = "Ô"
set c[213] = "Õ"
set c[214] = "Ö"
set c[215] = "×"
set c[216] = "Ø"
set c[217] = "Ù"
set c[218] = "Ú"
set c[219] = "Û"
set c[220] = "Ü"
set c[221] = "Ý"
set c[222] = "Þ"
set c[223] = "ß"
set c[224] = "à"
set c[225] = "á"
set c[226] = "â"
set c[227] = "ã"
set c[228] = "ä"
set c[229] = "å"
set c[230] = "æ"
set c[231] = "ç"
set c[232] = "è"
set c[233] = "é"
set c[234] = "ê"
set c[235] = "ë"
set c[236] = "ì"
set c[237] = "í"
set c[238] = "î"
set c[239] = "ï"
set c[240] = "ð"
set c[241] = "ñ"
set c[242] = "ò"
set c[243] = "ó"
set c[244] = "ô"
set c[245] = "õ"
set c[246] = "ö"
set c[247] = "÷"
set c[248] = "ø"
set c[249] = "ù"
set c[250] = "ú"
set c[251] = "û"
set c[252] = "ü"
set c[253] = "ý"
set c[254] = "þ"
set c[255] = "ÿ"
endmethod
endmodule
private struct Inits extends array
implement Init
endstruct
endlibrary
library TasSpellView initializer init_function requires optional Ascii, optional FrameLoader
// TasSpellView 1.1b by Tasyen
//displays with custom UI the abilites of not controled units in the command card
// when REFORGED = false you need to tell the abilityCodes used by units to have cooldown display
// the unit does not need to have the skills they are displayed when added that way.
// call TasSpellView_AddUnitCodeData('Ulic', "AUfn,AUfu,AUdr,AUdd")
globals
constant boolean REFORGED = true // have BlzGetAbilityId? otherwise false
public boolean AutoRun = true //(true) will create Itself at 0s, (false) you need to InitSpellView()
public string TocPath = "war3mapImported\\TasSpellView.toc"
public real UpdateTime = 0.1
public boolean ShowCooldown = true // can be set async, needs BlzGetAbilityId for ability by index
//ToolTip
public real ToolTipSizeX = 0.26
public real ToolTipPosX = 0.79
public real ToolTipPosY = 0.165
public framepointtype ToolTipPos = FRAMEPOINT_BOTTOMRIGHT
// currentSelected
public integer DataCount = 0
public integer DataMod = 0
public integer array DataAbiCode
public integer array DataMana
public real array DataRange
public real array DataAoe
public real array DataCool
public string array DataName
public string array DataText
public string array DataIcon
public framehandle ParentSimple
public framehandle Parent
public group Group
public timer Timer
public unit LastUnit = null
public integer MOD_ABI = 1
public integer MOD_ABI_CODE = 0
public string array UnitCodeText
public integer array UnitCodeType
public integer UnitCodeCount = 0
endglobals
public function ParentFuncSimple takes nothing returns framehandle
return BlzGetFrameByName("ConsoleUI", 0)
endfunction
public function ParentFunc takes nothing returns framehandle
return BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
endfunction
public function AbiFilter takes ability abi, string text returns boolean
if BlzGetAbilityId(abi) == 'AIDS' then
return false
endif
if BlzGetAbilityIntegerLevelField(abi,ABILITY_ILF_ITEM_CAPACITY,0) > 0 then
return false
endif
if BlzGetAbilityBooleanField(abi, ABILITY_BF_ITEM_ABILITY) then
return false
endif
if BlzGetAbilityIntegerField(abi, ABILITY_IF_BUTTON_POSITION_NORMAL_X) == 0 and BlzGetAbilityIntegerField(abi, ABILITY_IF_BUTTON_POSITION_NORMAL_Y) == -11 then
return false
endif
if text == "Tool tip missing!" or text == "" or text == " " then
return false
endif
return true
endfunction
public function AddUnitCodeData takes integer unitCode, string abiCodeString returns nothing
set UnitCodeCount = UnitCodeCount + 1
set UnitCodeType[UnitCodeCount] = unitCode
set UnitCodeText[UnitCodeCount] = abiCodeString
endfunction
public function GetUnitCodeData takes integer unitCode returns string
local integer i = UnitCodeCount
loop
exitwhen i <= 0
if unitCode == UnitCodeType[i] then
return UnitCodeText[i]
endif
set i = i - 1
endloop
return ""
endfunction
static if LIBRARY_Ascii then
public function AddSpellString takes string abiString returns nothing
local integer startIndex = 0
local integer skillCode
local integer addCount = 0
loop
exitwhen startIndex + 3 >= StringLength(abiString)
set skillCode = S2A(SubString(abiString, startIndex, startIndex + 4))
set startIndex = startIndex + 5
set DataAbiCode[addCount] = skillCode
set addCount = addCount + 1
endloop
set DataCount = addCount - 1
endfunction
endif
public function GetUnitData takes unit u returns nothing
local integer i = 0
local integer addCount = 0
local ability abi
local string abiString
set DataCount = 0
// have presaved Data
set abiString = GetUnitCodeData(GetUnitTypeId(u))
if abiString != "" then
static if LIBRARY_Ascii then
call AddSpellString(abiString)
endif
set DataMod = MOD_ABI_CODE
else
set DataMod = MOD_ABI
static if REFORGED then
// store abiCode treat it like MOD_ABI_CODE
set DataMod = MOD_ABI_CODE
endif
set i = 0
set addCount = 0
loop
set abi = BlzGetUnitAbilityByIndex(u, i)
exitwhen abi == null
if AbiFilter(abi, BlzGetAbilityStringLevelField(abi, ABILITY_SLF_TOOLTIP_NORMAL, 0)) then
static if REFORGED then
// store abiCode treat it like MOD_ABI_CODE
set DataAbiCode[addCount] = BlzGetAbilityId(abi)
else
// store the data
set DataIcon[addCount] = BlzGetAbilityStringLevelField(abi, ABILITY_SLF_ICON_NORMAL, 0)
set DataName[addCount] = BlzGetAbilityStringLevelField(abi, ABILITY_SLF_TOOLTIP_NORMAL, 0)
set DataText[addCount] = BlzGetAbilityStringLevelField(abi, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 0)
set DataMana[addCount] = BlzGetAbilityIntegerLevelField(abi, ABILITY_ILF_MANA_COST, 0)
set DataCool[addCount] = BlzGetAbilityRealLevelField(abi, ABILITY_RLF_COOLDOWN, 0)
set DataRange[addCount] = BlzGetAbilityRealLevelField(abi, ABILITY_RLF_CAST_RANGE, 0)
set DataAoe[addCount] = BlzGetAbilityRealLevelField(abi, ABILITY_RLF_AREA_OF_EFFECT, 0)
//if DataMana[addCount] > 9999 then
// set DataMana[addCount] = string.format( "\x25.0f", DataMana[addCount]/1000).."k"
//endif
//if DataRange[addCount] > 9999 then
//set DataRange[addCount] = string.format( "\x25.0f", DataRange[addCount]/1000).."k"
//endif
//if DataArea[addCount] > 9999 then
//set DataArea[addCount] = string.format( "\x25.0f", DataArea[addCount]/1000).."k"
//endif
endif
set addCount = addCount + 1
endif
set i = i + 1
endloop
set DataCount = addCount - 1
set abi = null
endif
endfunction
public function Update takes nothing returns nothing
local boolean foundTooltip = false
local unit u
local boolean hasControl
local boolean showSpellView
local integer i
local integer level
local real cdRemain
local real cdTotal
local integer abiCode
local ability abi
call GroupEnumUnitsSelected(Group, GetLocalPlayer(), null)
set u = FirstOfGroup(Group)
call GroupClear(Group)
if u != LastUnit then
set LastUnit = u
call GetUnitData(u)
endif
set hasControl = IsUnitOwnedByPlayer(u, GetLocalPlayer()) or GetPlayerAlliance(GetOwningPlayer(u), GetLocalPlayer(), ALLIANCE_SHARED_CONTROL)
// check for visible buttons, if any is visible then do not show TasSpellView
if not hasControl then
set i = 0
loop
if BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0)) then
set hasControl = true
exitwhen true
endif
exitwhen i == 11
set i = i + 1
endloop
endif
set showSpellView = not hasControl
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewSimpleFrame", 0), showSpellView)
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewFrame", 0), showSpellView)
if showSpellView then
set i = 0
loop
if i <= DataCount then
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButton", i), true)
if DataMod == MOD_ABI then
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i), false)
call BlzFrameSetTexture(BlzGetFrameByName("TasSpellViewButtonBackdrop", i), DataIcon[i], 0, false)
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonOverLayFrame", i), false)
elseif DataMod == MOD_ABI_CODE then
set abiCode = DataAbiCode[i]
set level = GetUnitAbilityLevel(u, abiCode)
if ShowCooldown then
set cdRemain = BlzGetUnitAbilityCooldownRemaining(u, abiCode)
if cdRemain > 0 then
// this be inaccurate when the map has systems to change cooldowns only during the casting.
set cdTotal = BlzGetUnitAbilityCooldown(u, abiCode, level - 1)
//print(GetObjectName(data[i]),cdRemain,cdTotal, cdRemain/cdTotal)
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i), true)
call BlzFrameSetValue(BlzGetFrameByName("TasSpellViewButtonCooldown", i), 100-(cdRemain/cdTotal)*100)
//print(BlzFrameIsVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i)), BlzFrameGetValue(BlzGetFrameByName("TasSpellViewButtonCooldown", i)))
else
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i), false)
endif
else
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i), false)
endif
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonOverLayFrame", i), true)
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewButtonChargeText", i), I2S(level))
call BlzFrameSetTexture(BlzGetFrameByName("TasSpellViewButtonBackdrop", i), BlzGetAbilityIcon(abiCode), 0, false)
endif
else
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButtonCooldown", i), false)
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewButton", i), false)
endif
// hovered?
if BlzFrameIsVisible(BlzGetFrameByName("TasSpellViewButtonToolTip", i)) then
set foundTooltip = true
if DataMod == MOD_ABI then
call BlzFrameSetTexture(BlzGetFrameByName("TasSpellViewTooltipIcon", 0), DataIcon[i], 0, false)
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipName", 0), DataName[i])
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipText", 0), DataText[i])
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipManaText", 0), I2S(DataMana[i]))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipCooldownText", 0), R2SW(DataCool[i],1,1))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipRangeText", 0), I2S(R2I(DataRange[i])))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipAreaText", 0), I2S(R2I(DataAoe[i])))
elseif DataMod == MOD_ABI_CODE then
set abiCode = DataAbiCode[i]
set level = GetUnitAbilityLevel(u, DataAbiCode[i])
set abi = BlzGetUnitAbility(u, abiCode)
call BlzFrameSetTexture(BlzGetFrameByName("TasSpellViewTooltipIcon", 0), BlzGetAbilityIcon(abiCode), 0, false)
if level > 0 then
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipManaText", 0), I2S(BlzGetUnitAbilityManaCost(u, abiCode, level - 1)))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipCooldownText", 0), R2SW(BlzGetUnitAbilityCooldown(u, abiCode, level - 1),1,1))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipRangeText", 0), I2S(R2I(BlzGetAbilityRealLevelField(abi, ABILITY_RLF_CAST_RANGE, level - 1))))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipAreaText", 0), I2S(R2I(BlzGetAbilityRealLevelField(abi, ABILITY_RLF_AREA_OF_EFFECT, level - 1))))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipName", 0), BlzGetAbilityTooltip(abiCode, level - 1))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipText", 0), BlzGetAbilityExtendedTooltip(abiCode, level - 1))
else
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipName", 0), BlzGetAbilityResearchTooltip(abiCode, 0))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipText", 0), BlzGetAbilityResearchExtendedTooltip(abiCode, 0))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipManaText", 0), I2S(BlzGetAbilityManaCost(abiCode, 0)))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipCooldownText", 0), R2SW(BlzGetAbilityCooldown(abiCode, 0),1,1))
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipRangeText", 0), "0")
call BlzFrameSetText(BlzGetFrameByName("TasSpellViewTooltipAreaText", 0), "0")
endif
endif
endif
exitwhen i == 11
set i = i + 1
endloop
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewTooltipFrame", 0), foundTooltip)
endif
set u = null
set abi = null
endfunction
public function InitFrames takes nothing returns nothing
local integer i
local framehandle frame
local framehandle tooltipFrame
if not BlzLoadTOCFile(TocPath) then
call BJDebugMsg("|cffff0000TasSpellView - Error Reading Toc File at: " + TocPath)
endif
set ParentSimple = BlzCreateFrameByType("SIMPLEFRAME", "TasSpellViewSimpleFrame", ParentFuncSimple(), "", 0)
set Parent = BlzCreateFrameByType("FRAME", "TasSpellViewFrame", ParentFunc(), "", 0)
set i = 0
loop
set frame = BlzCreateSimpleFrame("TasSpellViewButton", ParentSimple, i)
call BlzFrameSetPoint(frame, FRAMEPOINT_CENTER, BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, i), FRAMEPOINT_CENTER, 0, 0.0)
call BlzFrameSetLevel(frame, 6) // reforged stuff
call BlzFrameSetLevel(BlzGetFrameByName("TasSpellViewButtonOverLayFrame", i), 7) // reforged stuff
set tooltipFrame = BlzCreateFrameByType("SIMPLEFRAME", "TasSpellViewButtonToolTip", frame, "", i)
call BlzFrameSetTooltip(frame, tooltipFrame)
call BlzFrameSetVisible(tooltipFrame, false)
call BlzFrameSetVisible(BlzCreateFrame("TasSpellViewButtonCooldown", Parent, 0, i), false)
// reserve HandleIds
call BlzGetFrameByName("TasSpellViewButtonBackdrop", i)
call BlzGetFrameByName("TasSpellViewButtonTextOverLay", i)
call BlzGetFrameByName("TasSpellViewButtonOverLayFrame", i)
call BlzGetFrameByName("TasSpellViewButtonChargeBox", i)
call BlzGetFrameByName("TasSpellViewButtonChargeText", i)
set i = i + 1
exitwhen i > 11
endloop
if GetHandleId(BlzGetFrameByName("TasSpellViewButtonBackdrop", 1)) == 0 then
call BJDebugMsg("|cffff0000TasSpellView - Error Create TasSpellViewButton|r")
call BJDebugMsg(" Check Imported toc & fdf & TocPath in Map script")
call BJDebugMsg(" Imported toc needs to have empty ending line")
call BJDebugMsg(" fdf path in toc needs to match map imported path")
call BJDebugMsg(" TocPath in Map script needs to match map imported path")
endif
// create one ToolTip which shows data for current hovered inside a timer.
// also reserve handleIds to allow async usage
call BlzCreateFrame("TasSpellViewTooltipFrame", Parent, 0, 0)
call BlzGetFrameByName("TasSpellViewTooltipBox", 0)
call BlzGetFrameByName("TasSpellViewTooltipIcon", 0)
call BlzGetFrameByName("TasSpellViewTooltipName", 0)
call BlzGetFrameByName("TasSpellViewTooltipSeperator", 0)
call BlzGetFrameByName("TasSpellViewTooltipText", 0)
call BlzGetFrameByName("TasSpellViewTooltipManaText", 0)
call BlzGetFrameByName("TasSpellViewTooltipCooldownText", 0)
call BlzGetFrameByName("TasSpellViewTooltipRangeText", 0)
call BlzGetFrameByName("TasSpellViewTooltipAreaText", 0)
call BlzFrameSetSize(BlzGetFrameByName("TasSpellViewTooltipText", 0), ToolTipSizeX, 0)
call BlzFrameSetAbsPoint(BlzGetFrameByName("TasSpellViewTooltipText", 0), ToolTipPos, ToolTipPosX, ToolTipPosY)
call BlzFrameSetPoint(BlzGetFrameByName("TasSpellViewTooltipBox", 0), FRAMEPOINT_TOPLEFT, BlzGetFrameByName("TasSpellViewTooltipIcon", 0), FRAMEPOINT_TOPLEFT, -0.005, 0.005)
call BlzFrameSetPoint(BlzGetFrameByName("TasSpellViewTooltipBox", 0), FRAMEPOINT_BOTTOMRIGHT, BlzGetFrameByName("TasSpellViewTooltipText", 0), FRAMEPOINT_BOTTOMRIGHT, 0.005, -0.005)
call BlzFrameSetVisible(BlzGetFrameByName("TasSpellViewTooltipFrame", 0), false)
call BlzFrameSetVisible(ParentSimple, false)
call BlzFrameSetVisible(Parent, false)
if GetHandleId(BlzGetFrameByName("TasSpellViewTooltipFrame", 0)) == 0 then
call BJDebugMsg("TasSpellView - Error - Create TasSpellViewTooltipFrame")
call BJDebugMsg("Check Imported toc & fdf & TocPath")
endif
endfunction
function InitSpellView takes nothing returns nothing
set Group = CreateGroup()
set Timer = CreateTimer()
call TimerStart(Timer, UpdateTime, true, function Update)
call InitFrames()
static if LIBRARY_FrameLoader then
call FrameLoaderAdd(function InitFrames)
endif
endfunction
private function init_function takes nothing returns nothing
if AutoRun then
call InitSpellView()
endif
endfunction
endlibrary
library ClickAndHoldMovement initializer Init
/*
===========================================================================================
Click-And-Hold Movement
by Antares
Enable click-and-hold movement (hold the right mouse-button to move your hero) for hero maps
like aeon of strife, hero arenas, or rpgs.
===========================================================================================
*/
globals
//====================================================
//Config
//====================================================
private constant real IGNORE_MOUSE_SPELL_DURATION = 0.5 //Disables the click-and-hold trigger for this many seconds when a unit in the selected group casts a spell. This enables the user to cast a spell without releasing the right mouse-button.
private constant real IGNORE_MOUSE_CLICK_DURATION = 0.25 //Disables the click-and-hold trigger for this many seconds right after the right mouse-button is pressed. This prevents the trigger from firing on a simple right-click.
private constant real MOUSE_MOVE_COOLDOWN_DURATION = 0.1 //Duration of the cooldown on the click-and-hold trigger on giving orders.
private constant boolean DISABLE_IF_MULTIPLE_SELECTED = false
private constant boolean STOP_MOVING_ON_RELEASE = false //The commanded units will stop moving as soon as the right mouse-button is released. They will also ignore pathing blockers between the mouse-cursor and the unit.
private constant boolean CUSTOM_CALLBACK = false //Enable if you want to write your own callback function for the click-and-hold trigger. Otherwise, it will be a replaced by a simple smart command.
//====================================================
private trigger array mouseMoveTrigger
real array mouseX
real array mouseY
private boolean array rightClickOn
private timer array ignoreMouseTimer
private group array selectedUnits
private boolean array setGroup
private boolean array noOrders
endglobals
//====================================================
private function CustomCallback takes unit whichUnit, real x, real y returns nothing
//Define your custom callback code here.
endfunction
//====================================================
private function SetAndCheckSelection takes integer P returns boolean
local boolean invalidSelection
local unit first
local player whichPlayer = Player(P)
set selectedUnits[P] = CreateGroup()
call GroupEnumUnitsSelected(selectedUnits[P] , whichPlayer , null)
static if DISABLE_IF_MULTIPLE_SELECTED then
set invalidSelection = BlzGroupGetSize(selectedUnits[P]) != 1
else
set invalidSelection = BlzGroupGetSize(selectedUnits[P]) == 0
endif
set setGroup[P] = false
if invalidSelection then
call DestroyGroup(selectedUnits[P])
return false
else
set first = FirstOfGroup(selectedUnits[P])
if GetOwningPlayer(first) == whichPlayer or (IsUnitAlly(first,whichPlayer) and GetPlayerAlliance(GetOwningPlayer(first),whichPlayer,ALLIANCE_SHARED_CONTROL)) then
set first = null
return true
else
call DestroyGroup(selectedUnits[P])
set first = null
return false
endif
endif
endfunction
private function CommandGroup takes integer P returns nothing
local integer i = BlzGroupGetSize(selectedUnits[P]) - 1
local unit u
local real angle
loop
exitwhen i < 0
static if CUSTOM_CALLBACK then
call CustomCallback( BlzGroupUnitAt(selectedUnits[P] , i) , mouseX[P] , mouseY[P] )
elseif STOP_MOVING_ON_RELEASE then
set u = BlzGroupUnitAt(selectedUnits[P] , i)
set angle = Atan2( mouseY[P] - GetUnitY(u) , mouseX[P] - GetUnitX(u) )
call IssuePointOrderById( BlzGroupUnitAt(selectedUnits[P] , i) , 851971 , GetUnitX(u) + 50*Cos(angle) , GetUnitY(u) + 50*Sin(angle) )
else
call IssuePointOrderById( BlzGroupUnitAt(selectedUnits[P] , i) , 851971 , mouseX[P] , mouseY[P] )
endif
set i = i - 1
endloop
set u = null
endfunction
private function Enable takes nothing returns nothing
local integer i
local integer P = 0
local timer t = GetExpiredTimer()
loop
exitwhen t == ignoreMouseTimer[P]
set P = P + 1
endloop
set noOrders[P] = false
if rightClickOn[P] then
if setGroup[P] then
if SetAndCheckSelection(P) then
call CommandGroup(P)
endif
else
call CommandGroup(P)
endif
endif
set t = null
endfunction
private function MouseSpellIgnore takes nothing returns nothing
local unit whichUnit = GetSpellAbilityUnit()
local integer P = GetPlayerId(GetOwningPlayer(whichUnit))
if IsUnitInGroup(whichUnit , selectedUnits[P]) then
set noOrders[P] = true
call TimerStart( ignoreMouseTimer[P] , IGNORE_MOUSE_SPELL_DURATION , false , function Enable )
endif
set whichUnit = null
endfunction
private function MouseMove takes nothing returns nothing
local integer i
local integer P = GetPlayerId(GetTriggerPlayer())
local real mX = BlzGetTriggerPlayerMouseX()
local real mY = BlzGetTriggerPlayerMouseY()
if mY != 0 or mX != 0 then
set mouseX[P] = mX
set mouseY[P] = mY
endif
if noOrders[P] then
return
endif
if MOUSE_MOVE_COOLDOWN_DURATION > 0 then
set noOrders[P] = true
call TimerStart( ignoreMouseTimer[P] , MOUSE_MOVE_COOLDOWN_DURATION , false , function Enable )
endif
call CommandGroup(P)
endfunction
private function MouseRightClick takes nothing returns nothing
local integer A
local integer P
if BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT then
set P = GetPlayerId(GetTriggerPlayer())
set rightClickOn[P] = true
set noOrders[P] = true
set setGroup[P] = true
set mouseX[P] = BlzGetTriggerPlayerMouseX()
set mouseY[P] = BlzGetTriggerPlayerMouseY()
call TimerStart( ignoreMouseTimer[P] , IGNORE_MOUSE_CLICK_DURATION , false , function Enable )
call EnableTrigger(mouseMoveTrigger[P])
endif
endfunction
private function MouseRightRelease takes nothing returns nothing
local integer P
if BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT then
set P = GetPlayerId(GetTriggerPlayer())
call DestroyGroup(selectedUnits[P])
set rightClickOn[P] = false
call DisableTrigger(mouseMoveTrigger[P])
endif
endfunction
private function At0s takes nothing returns nothing
local integer P = 0
local trigger trigDown = CreateTrigger()
local trigger trigUp = CreateTrigger()
local trigger trigIgnore = CreateTrigger()
local trigger trigStore = CreateTrigger()
loop
exitwhen P > 23
if GetPlayerSlotState(Player(P)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(P)) == MAP_CONTROL_USER then
set mouseMoveTrigger[P] = CreateTrigger()
call TriggerRegisterPlayerEvent( trigDown, Player(P), EVENT_PLAYER_MOUSE_DOWN )
call TriggerRegisterPlayerEvent( trigUp, Player(P), EVENT_PLAYER_MOUSE_UP )
call TriggerRegisterPlayerEvent( mouseMoveTrigger[P], Player(P), EVENT_PLAYER_MOUSE_MOVE )
call TriggerAddCondition( mouseMoveTrigger[P] , function MouseMove )
call DisableTrigger(mouseMoveTrigger[P])
set ignoreMouseTimer[P] = CreateTimer()
endif
set P = P + 1
endloop
call DestroyTrigger(GetTriggeringTrigger())
call TriggerAddCondition( trigDown , function MouseRightClick )
call TriggerAddCondition( trigUp , function MouseRightRelease )
call TriggerRegisterAnyUnitEventBJ( trigIgnore, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( trigIgnore , function MouseSpellIgnore )
set trigDown = null
set trigUp = null
set trigIgnore = null
set trigStore = null
endfunction
private function Init takes nothing returns nothing
local trigger at0sTrigger = CreateTrigger()
call TriggerRegisterTimerEvent( at0sTrigger , 0.0 , false )
call TriggerAddAction( at0sTrigger , function At0s )
set at0sTrigger = null
endfunction
endlibrary
library SpecialEffect /* v1.3.1 by AGD | https://www.hiveworkshop.com/threads/specialeffect.325954/ | Patches 1.31+
*/uses /*
*/LinkedList /* https://www.hiveworkshop.com/threads/325635/ | Should use atleast v1.3.0
*/optional Table /* https://www.hiveworkshop.com/threads/188084/
*/optional Alloc /* https://www.hiveworkshop.com/threads/324937/
*/optional ErrorMessage /* https://github.com/nestharus/JASS/blob/master/jass/Systems/ErrorMessage/main.j
*///! novjass
|-----|
| API |
|-----|
/*
*/struct SpecialEffect extends array/*
*/readonly real x /*
*/readonly real y /*
*/readonly real z /* Absolute height
*/readonly real height/* Height relative to the ground
*/readonly real yaw /*
*/readonly real pitch /*
*/readonly real roll /*
*/method currentHandle takes nothing returns effect/*
- Current <effect> handle pointed by the iterator
*/method resetIterator takes nothing returns nothing/*
*/method moveIterator takes nothing returns boolean/*
- Use these iterator methods together with 'currentHandle()' if you need to traverse
each <effect> handle
- moveIterator() returns true when it moves past the last element of the list
(resetIterator() is automatically called when this happens)
- Sample Usage:
local SpecialEffect sfx = this.specialEffect
loop
exitwhen sfx.moveIterator()
call BlzSetSpecialEffectAlpha(sfx.currentHandle(), 0xAA)
endloop
*/method killHandle takes effect effectHandle, real deathTime returns nothing/*
- Kills a specific <effect> handle, playing its death animation
*/method killModel takes string model, real deathTime returns nothing/*
- Kills all <effect> handles matching the specific model, playing their death animation
*/method kill takes real deathTime, boolean wantDestroy returns nothing/*
- Kills all models, playing their death animation and destroys this SpecialEffect
instance afterwards if <wantDestroy> is true
*/method addModel takes string model returns effect/*
- You can add multiple similar models
*/method removeHandle takes effect effectHandle returns nothing/*
- Removes a specific <effect> handle if found
*/method removeModel takes string model returns nothing/*
- Removes all <effect> handles matching the given model
*/method clearModels takes nothing returns nothing/*
- Removes all <effect> handles
Note:
removeHandle(), removeModel(), and clearModels() instantly vanishes the attached
models without playing their death animation
*/method getHandle takes string model returns effect/*
- For random access (Uses linear search actually)
- Returns the first instance of <effect> handle matching the given model
*/method move takes real x, real y, real z returns nothing/*
*/method moveRelative takes real x, real y, real height returns nothing/*
- Keeps the offset between the actual position of the <effect> handles and the
origin coordinates of this SpecialEffect instance
*/method setPosition takes real x, real y, real z returns nothing/*
*/method setPositionRelative takes real x, real y, real height returns nothing/*
- Sets the actual position of all <effect> handles
*/method setOrientation takes real yaw, real pitch, real roll returns nothing/*
*/method setVisibility takes player whichPlayer, boolean visible returns nothing/*
- Toggles the visibility flag locally for a player
*/static method create takes real x, real y, real z returns SpecialEffect/*
*/static method createRelative takes real x, real y, real height returns SpecialEffect/*
- Constructors
*/method destroy takes nothing returns nothing/*
- Calls clearModels() and destroys this SpecialEffect instance
- Dying instances are also immediately vanished by this method
*///! endnovjass
globals
/*
* Special effects that need to be instantly vanished are moved to this coordinates before destroyed
*/
private constant real HIDDEN_PLACE_X = 0.00
private constant real HIDDEN_PLACE_Y = 10000.00
private location loc = Location(0.00, 0.00)
endglobals
/*========================================== SYSTEM CODE ==========================================*/
static if DEBUG_MODE then
private function AssertError takes boolean condition, string methodName, string structName, integer node, string message returns nothing
static if LIBRARY_ErrorMessage then
call ThrowError(condition, SCOPE_PREFIX, methodName, structName, node, message)
else
if condition then
call BJDebugMsg("[Library: " + SCOPE_PREFIX + "] [Struct: " + structName + "] [Method: " + methodName + "] [Instance: " + I2S(node) + "] : |cffff0000" + message + "|r")
endif
endif
endfunction
endif
public function GetTerrainZ takes real x, real y returns real
call MoveLocation(loc, x, y)
return GetLocationZ(loc)
endfunction
/*
* Allocator for the whole lib
*/
private struct Node extends array
static if LIBRARY_Alloc then
implement optional Alloc
else
private static thistype array stack
debug method operator allocated takes nothing returns boolean
debug return this > 0 and stack[this] == 0
debug endmethod
/*
* Credits to MyPad for the algorithm
*/
static method allocate takes nothing returns thistype
local thistype node = stack[0]
if stack[node] == 0 then
debug call AssertError(node == JASS_MAX_ARRAY_SIZE - 2, "allocate()", "thistype", node, "Overflow")
set node = node + 1
set stack[0] = node
else
set stack[0] = stack[node]
set stack[node] = 0
endif
return node
endmethod
method deallocate takes nothing returns nothing
debug call AssertError(not this.allocated, "deallocate()", "thistype", this, "Double-free")
set stack[this] = stack[0]
set stack[0] = this
endmethod
endif
endstruct
static if DEBUG_MODE then
private function AssertNodeValidity takes Node node, string methodName, string objectName returns nothing
static if Node.allocated.exists then
debug call AssertError(not node.allocated, methodName, objectName, node, "Invalid node")
endif
endfunction
endif
private function VanishEffect takes effect e returns nothing
call BlzSetSpecialEffectX(e, HIDDEN_PLACE_X)
call BlzSetSpecialEffectY(e, HIDDEN_PLACE_Y)
call DestroyEffect(e)
endfunction
/*
* List of <effect>s
*/
private struct EffectHandle extends array
readonly effect effect
SpecialEffect parent
string model
real dx
real dy
real dz
private static method onInsert takes thistype node returns nothing
local SpecialEffect parent = node.parent
set node.effect = AddSpecialEffect(node.model, HIDDEN_PLACE_X, HIDDEN_PLACE_Y)
call BlzSetSpecialEffectPosition(node.effect, parent.x, parent.y, parent.z)
call BlzSetSpecialEffectOrientation(node.effect, parent.yaw, parent.pitch, parent.roll)
endmethod
private static method onRemove takes thistype node returns nothing
call VanishEffect(node.effect)
set node.effect = null
set node.model = null
call Node(node).deallocate()
endmethod
private static method allocate takes nothing returns thistype
return Node.allocate()
endmethod
private method deallocate takes nothing returns nothing
call Node(this).deallocate()
endmethod
implement InstantiatedList
implement LinkedListEx
method getHandleIndex takes effect e returns thistype
local thistype node = this.next
loop
exitwhen node == this or node.effect == e
endloop
return node
endmethod
method getModelIndex takes string model returns thistype
local thistype node = this.next
loop
exitwhen node == this or node.model == model
set node = node.next
endloop
return node
endmethod
endstruct
private struct DelayedCleanupList extends array
EffectHandle effectHandle
private static method onRemove takes thistype node returns nothing
if EffectHandle.isLinked(node.effectHandle) then
call EffectHandle.remove(node.effectHandle)
endif
call Node(node).deallocate()
endmethod
implement List
endstruct
/*
* SpecialEffect is a cluster of <effect>s that can easily be controlled as a single object
*/
struct SpecialEffect extends array
readonly real x
readonly real y
readonly real z
readonly real height
readonly real yaw
readonly real pitch
readonly real roll
private boolean hidden
private boolean wantDestroy
private EffectHandle current
private EffectHandle killed
private thistype instance
static if LIBRARY_Table then
private static key table
else
private static hashtable table = InitHashtable()
endif
private method startTimer takes real timeout, code callback returns nothing
local timer t = CreateTimer()
static if LIBRARY_Table then
set Table(table)[GetHandleId(t)] = this
else
call SaveInteger(table, 0, GetHandleId(t), this)
endif
call TimerStart(t, timeout, false, callback)
set t = null
endmethod
private static method releaseTimer takes nothing returns thistype
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
static if LIBRARY_Table then
local thistype node = Table(table)[id]
call Table(table).remove(id)
else
local thistype node = LoadInteger(table, 0, id)
call RemoveSavedInteger(table, 0, id)
endif
call DestroyTimer(t)
set t = null
return node
endmethod
private method operator handle takes nothing returns EffectHandle
return this
endmethod
method currentHandle takes nothing returns effect
return this.current.effect
endmethod
method resetIterator takes nothing returns nothing
set this.current = this.handle
endmethod
method moveIterator takes nothing returns boolean
set this.current = this.current.next
return this.current == this.handle
endmethod
private static method onSetOrientation takes EffectHandle list, real yaw, real pitch, real roll returns nothing
local EffectHandle node = list.next
loop
exitwhen node == list
call BlzSetSpecialEffectOrientation(node.effect, yaw, pitch, roll)
set node = node.next
endloop
endmethod
private static method onSetPosition takes EffectHandle list, real x, real y, real z returns nothing
local EffectHandle node = list.next
loop
exitwhen node == list
call BlzSetSpecialEffectPosition(node.effect, x, y, z)
set node = node.next
endloop
endmethod
private static method onMove takes EffectHandle list, real dx, real dy, real dz returns nothing
local EffectHandle node = list.next
loop
exitwhen node == list
call BlzSetSpecialEffectPosition(node.effect, BlzGetLocalSpecialEffectX(node.effect) + dx, BlzGetLocalSpecialEffectY(node.effect) + dy, BlzGetLocalSpecialEffectZ(node.effect) + dz)
set node = node.next
endloop
endmethod
private method onSetVisibility takes EffectHandle list, player whichPlayer, boolean visible returns nothing
local EffectHandle node = list.next
loop
exitwhen node == list
if visible then
call BlzSetSpecialEffectPosition(node.effect, this.x + node.dx, this.y + node.dy, this.z + node.dz)
else
set node.dx = BlzGetLocalSpecialEffectX(node.effect) - this.x
set node.dy = BlzGetLocalSpecialEffectY(node.effect) - this.y
set node.dz = BlzGetLocalSpecialEffectZ(node.effect) - this.z
call BlzSetSpecialEffectX(node.effect, HIDDEN_PLACE_X)
call BlzSetSpecialEffectY(node.effect, HIDDEN_PLACE_Y)
endif
set node = node.next
endloop
endmethod
private method updatePosition takes real x, real y, real z, real height returns nothing
set this.x = x
set this.y = y
set this.z = z
set this.height = height
endmethod
method setOrientation takes real yaw, real pitch, real roll returns nothing
debug call AssertNodeValidity(this, "setOrientation()", "thistype")
call onSetOrientation(this.handle, yaw, pitch, roll)
call onSetOrientation(this.killed, yaw, pitch, roll)
set this.yaw = yaw
set this.pitch = pitch
set this.roll = roll
endmethod
private method setPositionEx takes real x, real y, real z, real height returns nothing
call onSetPosition(this.handle, x, y, z)
call onSetPosition(this.killed, x, y, z)
call this.updatePosition(x, y, z, height)
endmethod
method setPosition takes real x, real y, real z returns nothing
debug call AssertNodeValidity(this, "setPosition()", "thistype")
call this.setPositionEx(x, y, z, z - GetTerrainZ(x, y))
endmethod
method setPositionRelative takes real x, real y, real height returns nothing
debug call AssertNodeValidity(this, "setPositionRelative()", "thistype")
call this.setPositionEx(x, y, height + GetTerrainZ(x, y), height)
endmethod
private method moveEx takes real x, real y, real z, real height returns nothing
call onMove(this.handle, x - this.x, y - this.y, z - this.z)
call onMove(this.killed, x - this.x, y - this.y, z - this.z)
call this.updatePosition(x, y, z, height)
endmethod
method move takes real x, real y, real z returns nothing
debug call AssertNodeValidity(this, "move()", "thistype")
call this.moveEx(x, y, z, z - GetTerrainZ(x, y))
endmethod
method moveRelative takes real x, real y, real height returns nothing
debug call AssertNodeValidity(this, "moveRelative()", "thistype")
call this.moveEx(x, y, height + GetTerrainZ(x, y), height)
endmethod
method setVisibility takes player whichPlayer, boolean visible returns nothing
debug call AssertNodeValidity(this, "setVisibility()", "thistype")
if whichPlayer == GetLocalPlayer() and this.hidden == visible then
call this.onSetVisibility(this.handle, whichPlayer, visible)
call this.onSetVisibility(this.killed, whichPlayer, visible)
set this.hidden = not visible
endif
endmethod
method getHandle takes string model returns effect
debug call AssertNodeValidity(this, "getHandle()", "thistype")
return this.handle.getModelIndex(model).effect
endmethod
method addModel takes string model returns effect
local EffectHandle node = Node.allocate()
debug call AssertNodeValidity(this, "addModel()", "thistype")
set node.parent = this.handle
set node.model = model
call EffectHandle.insert(this.handle.getModelIndex(model).prev, node)
return node.effect
endmethod
method removeHandle takes effect e returns nothing
local EffectHandle node = this.handle.next
debug call AssertNodeValidity(this, "removeHandle()", "thistype")
loop
exitwhen node == this.handle
if node.effect == e then
call EffectHandle.remove(node)
exitwhen true
endif
set node = node.next
endloop
endmethod
method removeModel takes string model returns nothing
local EffectHandle node = this.handle.getModelIndex(model)
debug call AssertNodeValidity(this, "removeModel()", "thistype")
if node != this.handle then
loop
exitwhen node.model != model
call EffectHandle.remove(node)
set node = node.next
endloop
endif
endmethod
method clearModels takes nothing returns nothing
debug call AssertNodeValidity(this, "clearModels()", "thistype")
call this.killed.flush()
call this.handle.flush()
endmethod
private static method createEx takes real x, real y, real z, real height returns thistype
local thistype node = EffectHandle.create()
set node.killed = EffectHandle.create()
set node.yaw = 0
set node.pitch = 0
set node.roll = 0
set node.hidden = false
call node.updatePosition(x, y, z, height)
call node.resetIterator()
return node
endmethod
static method create takes real x, real y, real z returns thistype
return createEx(x, y, z, z - GetTerrainZ(x, y))
endmethod
static method createRelative takes real x, real y, real height returns thistype
return createEx(x, y, height + GetTerrainZ(x, y), height)
endmethod
method destroy takes nothing returns nothing
debug call AssertNodeValidity(this, "destroy()", "thistype")
call this.killed.destroy()
call this.handle.destroy()
endmethod
private static method onExpireKill takes nothing returns nothing
local thistype node = releaseTimer()
if EffectHandle.isLinked(node.instance) then
call EffectHandle.remove(node.instance)
endif
call Node(node).deallocate()
endmethod
private static method onExpireKillRange takes nothing returns nothing
local DelayedCleanupList list = releaseTimer()
local thistype node = thistype(list).instance
set thistype(list).instance = 0
if node.wantDestroy then
set node.wantDestroy = false
call node.destroy()
endif
call list.flush()
call Node(list).deallocate()
endmethod
private method killHandleRange takes string model, real deathTime, boolean wantDestroy returns nothing
local DelayedCleanupList list
local DelayedCleanupList temp
local thistype node
local thistype next
local boolean resetIter = false
if not this.handle.empty then
set this.wantDestroy = wantDestroy
if model == null then
set node = this.handle.next
else
set node = this.handle.getModelIndex(model)
endif
if node != this.handle then
set list = Node.allocate()
set thistype(list).instance = this
call DelayedCleanupList.makeHead(list)
loop
exitwhen node == this.handle or (node.handle.model != model and model != null)
set next = node.handle.next
if node.handle == this.current then
set resetIter = true
endif
set temp = Node.allocate()
set temp.effectHandle = node
call list.pushBack(temp)
call EffectHandle.move(this.killed.prev, node)
call BlzPlaySpecialEffect(node.handle.effect, ANIM_TYPE_DEATH)
set node = next
endloop
if resetIter then
set this.current = node.handle.prev
endif
call thistype(list).startTimer(deathTime, function thistype.onExpireKillRange)
endif
elseif wantDestroy then
call this.destroy()
endif
endmethod
method killHandle takes effect e, real deathTime returns nothing
local thistype node
local thistype instance
debug call AssertNodeValidity(this, "killHandle()", "thistype")
if not this.handle.empty then
set instance = this.handle.getHandleIndex(e)
if instance != this.handle then
set node = Node.allocate()
set node.instance = instance
if instance.handle == this.current then
set this.current = this.current.prev
endif
call EffectHandle.move(this.killed.prev, instance.handle)
call BlzPlaySpecialEffect(instance.handle.effect, ANIM_TYPE_DEATH)
call node.startTimer(deathTime, function thistype.onExpireKill)
endif
endif
endmethod
method killModel takes string model, real deathTime returns nothing
debug call AssertNodeValidity(this, "killModel()", "thistype")
call this.killHandleRange(model, deathTime, false)
endmethod
method kill takes real deathTime, boolean wantDestroy returns nothing
debug call AssertNodeValidity(this, "kill()", "thistype")
call this.killHandleRange(null, deathTime, wantDestroy)
endmethod
endstruct
endlibrary
library Misssile /* version 3.2.0 (Update for patches 1.31+)
*************************************************************************************
*
* Resource link:
* https://www.hiveworkshop.com/threads/missile.325956/
*
* Legacy Resource Link (for patches 1.30.x and below):
* https://www.hiveworkshop.com/threads/missile.265370/
*
*************************************************************************************
*
* Original Resource by BPower, updated by AGD
*
* Credits to Dirac, emjlr3, AceHart, Bribe, Wietlol, Nestharus,
* Maghteridon96, Vexorian, Zwiebelchen, and Chopinski
*
*************************************************************************************
*
* Creating custom projectiles in Warcraft III.
*
* Philosophy:
* I want that feature --> Compiler writes that code into your map script.
* I don't want that --> Compiler ignores that code completely.
*
* Important:
* Take yourself 2 minutes time to setup Misssile correctly.
* Otherwise I can't guarantee, that Misssile works the way you want.
* Once the setup is done, you can check out some examples and Misssile will be easy
* to use for everyone. I promise it.
*
* Do the setup at:
*
* 1.) Import instruction
* 2.) Global configuration
* 3.) Function configuration
*
*************************************************************************************
*
* */ requires /*
*
* */ Table /* https://www.hiveworkshop.com/threads/188084/
* */ SpecialEffect /* https://www.hiveworkshop.com/threads/325954/ | Should use atleast v1.1.0
* */ LinkedList /* https://www.hiveworkshop.com/threads/325635/
*
*************************************************************************************
*
* */ optional Alloc /* https://www.hiveworkshop.com/threads/324937/
* */ optional ErrorMessage /* https://github.com/nestharus/JASS/blob/master/jass/Systems/ErrorMessage/main.j
*
************************************************************************************
*
* 1. Import instruction
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* • Import the required libraries.
* • Copy Misssile into to your map.
*
* 2. Global configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*/
globals
/**
* Misssiles are moved periodically. An interval of 1./32. is recommended.
* • Too short timeout intervals may cause performance issues.
* • Too large timeout intervals may look fishy.
*/
public constant real TIMER_TIMEOUT = 1./32.
/**
* The maximum collision size used in your map. If unsure use 197. ( Town hall collision )
* • Applies for all types of widgets.
* • A precise value can improve Misssile's performance,
* since smaller values enumerate less widgtes per loop per missile.
*/
public constant real MAXIMUM_COLLISION_SIZE = 250.
/**
* Collision types for missiles. ( Documentation only )
* Misssile decides internally each loop which type of collision is required.
* • Uses circular collision dectection for speed < collision. ( Good accuracy, best performance )
* • Uses rectangle collision for speed >= collision. ( Best accuracy, normal performance )
*/
public constant integer COLLISION_TYPE_CIRCLE = 0
public constant integer COLLISION_TYPE_RECTANGLE = 1
/**
* Determine when rectangle collision is required to detect nearby widgets.
* • The smaller the factor the earlier rectangle collision is used. ( by default 1. )
* • Formula: speed >= collision*Misssile_COLLISION_ACCURACY_FACTOR
*/
public constant real COLLISION_ACCURACY_FACTOR = 1.
/*
Optional toogles:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Set booleans listed below to "true" and the compiler will write
the feature into your map. Otherwise this code is completly ignored.
• Yay, I want that --> "true"
• Naah that's useless for me --> "false"
**
* USE_COLLISION_Z_FILTER enables z axis checks for widget collision. ( Adds minimal overhead )
* Use it when you need:
* • Misssiles flying over or under widgets.
* • Determine between flying and walking units.
*/
public constant boolean USE_COLLISION_Z_FILTER = true
/**
* DELAYED_MISSILE_DEATH_ANIMATION_TIME is the delay in seconds
* to accomodate for the sfx death duration of destroyed Misssiles
*/
private constant real DELAYED_MISSILE_DEATH_ANIMATION_TIME = 2.16
endglobals
/*
* 3. Function configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*/
/**
* GetUnitHeight(unit) returns a fictional value for z - axis collision.
* You have two options:
* • One constant value shared over all units.
* • Dynamic values based on handle id, type id, unit user data, scaling or other parameters.
*/
public function GetUnitHeight takes unit whichUnit returns real
return 108.// Other example: return LoadReal(hash, GetHandleId(whichUnit), KEY_UNIT_HEIGHT)
endfunction
/**
* Same as GetUnitHeight, but for destructables.
* Using occluder height is an idea of mine. Of course you can use your own values.
*/
public function GetDestHeight takes destructable d returns real
return GetDestructableOccluderHeight(d)// Other example: return 72.
endfunction
/**
* Again it's up to you to figure out a fictional item height.
*/
public function GetItemHeight takes item i returns real
return 16.
endfunction
public function GetDestCollisionSize takes destructable d returns real
return 43.2
endfunction
public function GetItemCollisionSize takes item i returns real
return 18.
endfunction
/**
* 4. API
* ¯¯¯¯¯¯
*/
//! novjass
// Custom type Misssile for your projectile needs.
struct Misssile extends array
// Constants:
// ==========
readonly static constant real HIT_BOX = (2./3.)
// • Fictional hit box for homing missiles.
// while 0 would be the toe and 1 the head of a unit.
// Available creators:
// ===================
static method create takes real x, real y, real z, real angleInRadians, real distanceToTravel, real endZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
// Available destructors:
// ======================
//
return true
// • Core destructor.
// • Returning true in any of the interface methods of the MisssileStruct module
// will destroy that instance instantly.
method destroy takes nothing returns nothing
// • Destroys the missile during the next timer callback.
method terminate takes nothing returns nothing
// • Destroys the missile instantly.
// Fields you can set and read directly:
// =====================================
//
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner remains PLAYER_NEUTRAL_PASSIVE.
real speed // Vector lenght for missile movement in plane x / y. ( DOES NOT TAKE THE TIMER TIMEOUT IN ACCOUNT )
real acceleration
real damage
real turn // Set a turn rate for missiles.
integer data // For data transfer set and read data.
boolean recycle // Is automatically set to true, when a Misssile reaches it's destination.
boolean wantDestroy // Set wantDestroy to true, to destroy a missile during the next timer callback.
// Neither collision nor collisionZ accept values below zero.
real collision // Collision size in the x-y-z axes
// Fields you can only read:
// =========================
readonly SpecialEffect effect
readonly boolean allocated
// Position members for you needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and the pitch angle "alpha".
// Furthermore method origin.move(x, y, z) and impact.move(x, y, z).
readonly real terrainZ
readonly real x
readonly real y
readonly real z
readonly real angle// Current angle in radians.
// Method operators for set and read:
// ==================================
//
method operator model= takes string modelFile returns nothing
method operator model takes nothing returns string
// • For multiple effects manipulate "this.effect" directly instead.
method operator scale= takes real value returns nothing
method operator scale takes nothing returns real
// • Set and read the scaling of 'this.effect'.
method operator curve= takes real value returns nothing
method operator curve takes nothing returns real
// • Enables curved movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
method operator arc= takes real value returns nothing
method operator arc takes nothing returns real
// • Enables arcing movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
method operator spin= takes real rps returns nothing
method operator spin takes nothing returns real
// • Spin in rad/sec
// Methods for missile movement:
// =============================
//
method bounce takes nothing returns nothing
// • Moves the MisssilePosition "origin" to the current missile coordinates.
// • Resets the distance traveled to 0.
method deflect takes real tx, real ty returns nothing
// • Deflect the missile towards tx, ty. Then calls bounce.
method deflectEx takes real tx, real ty, real tz returns nothing
// • Deflect the missile towards tx, ty, tz. Then calls bounce.
method flightTime2Speed takes real duration returns nothing
// • Converts a fly time to a vector lenght for member "speed".
// • Does not take acceleration into account. ( Disclaimer )
method setMovementSpeed takes real value returns nothing
// • Converts Warcraft III movement speed to a vector lenght for member "speed".
// Methods for missile collision: ( all are hashtable entries )
// ==============================
// By default a widget can only be hit once per missile.
//
method hitWidget takes widget w returns nothing
// • Saves a widget in the memory as hit by this instance.
method hasHitWidget takes widget w returns boolean
// • Returns true, if "w" has been hit by this instance.
method removeHitWidget takes widget w returns nothing
// • Removes a widget from this missile's memory for widget collision. ( Can hit "w" again )
method flushHitWidgets takes nothing returns nothing
// • Flushes a missile's memory for widget collision. ( All widgets can be hit again )
method enableHitAfter takes widget w, real seconds returns nothing
// • Automatically calls removeHitWidget(w) after "seconds" time. ( Can hit "w" again after given time )
// Module MisssileStruct:
// =====================
//
module MisssileLaunch // ( optional )
module MisssileStruct
// • Enables the entire missile interface for that struct.
// Interface in structs: ( Must implement module MisssileStruct )
// =====================
//
// • Write one, many or all of the static method below into your struct.
// • Misssiles launched in this struct will run those methods, when their events fire.
//
// • All of those static methods must return a boolean.
// a) return true --> destroys the missile instance instantly.
// b) return false --> keep on flying.
// Available static method:
// ========================
//
static method onCollide takes Misssile missile, unit hit returns boolean
// • Runs for units in collision range of a missile.
static method onDestructable takes Misssile missile, destructable hit returns boolean
// • Runs for destructables in collision range of a missile.
static method onItem takes Misssile missile, item hit returns boolean
// • Runs for items in collision range of a missile.
static method onTerrain takes Misssile missile returns boolean
// • Runs when a missile collides with the terrain. ( Ground and cliffs )
static method onFinish takes Misssile missile returns boolean
// • Runs only when a missile reaches it's destination.
// • However does not run, if a Misssile is destroyed in another method.
static method onPeriod takes Misssile missile returns boolean
// • Runs every Misssile_TIMER_TIMEOUT seconds.
static method onRemove takes Misssile missile returns boolean
// • Runs when a missile is destroyed.
// • Unlike onFinish, onRemove will runs ALWAYS when a missile is destroyed!!!
//
// For onRemove the returned boolean has a unique meaning:
// • Return true will recycle this missile delayed.
// • Return false will recycle this missile right away.
static method launch takes Misssile toLaunch returns nothing
// • Well ... Launches this Misssile.
// • Misssile "toLaunch" will behave as declared in the struct. ( static methods from above )
// Misc: ( From the global setup )
// =====
//
// Constants:
// ==========
//
public constant real TIMER_TIMEOUT
public constant real MAXIMUM_COLLISION_SIZE
public constant boolean USE_COLLISION_Z_FILTER
readonly static constant real HIT_BOX
// Functions:
// ==========
//
public function GetLocZ takes real x, real y returns real
public function GetUnitHeight takes unit u returns real
public function GetDestHeight takes destructable d returns real
public function GetItemHeight takes item i returns real
public function GetDestCollisionSize takes destructable d returns real
public function GetItemCollisionSize takes item i returns real
//========================================================================
// Misssile system. Make changes carefully.
//========================================================================
//! endnovjass
// Hello and welcome to Misssile.
// I wrote a guideline for every piece of code inside Misssile, so you
// can easily understand how the it gets compiled and evaluated.
//
// Let's go!
private keyword Init
globals
// Core constant handle variables of Misssile.
private constant trigger CORE = CreateTrigger()
private constant trigger MOVE = CreateTrigger()
private constant timer TMR = CreateTimer()
private constant location LOC = Location(0., 0.)
private constant rect RECT = Rect(0., 0., 0., 0.)
private constant group GROUP = CreateGroup()
// For starting and stopping the timer.
private integer active = 0
// Arrays for data structure.
private integer array instances
private Misssile array missileList
private boolexpr array expression
private triggercondition array condition
private unit tempUnit
private item tempItem
private destructable tempDest
private TableArray table
endglobals
public function GetLocZ takes real x, real y returns real
call MoveLocation(LOC, x, y)
return GetLocationZ(LOC)
endfunction
/*===============================================================================================*/
/*
* One allocator for the whole library
*/
private struct Node extends array
static if LIBRARY_Alloc then
implement optional Alloc
else
/*
* Credits to MyPad for the allocation algorithm
*/
private static thistype array stack
static method allocate takes nothing returns thistype
local thistype node = stack[0]
if stack[node] == 0 then
static if LIBRARY_ErrorMessage then
debug call ThrowError(node == (JASS_MAX_ARRAY_SIZE - 1), "Misssile", "allocate()", "thistype", node, "Overflow")
endif
set node = node + 1
set stack[0] = node
else
set stack[0] = stack[node]
set stack[node] = 0
endif
return node
endmethod
method deallocate takes nothing returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "Misssile", "deallocate()", "thistype", 0, "Null node")
debug call ThrowError(stack[this] > 0, "Misssile", "deallocate()", "thistype", this, "Double-free")
endif
set stack[this] = stack[0]
set stack[0] = this
endmethod
endif
endstruct
// Simple trigonometry.
struct MisssilePosition extends array
readonly real x
readonly real y
readonly real z
readonly real angle
readonly real distance
readonly real square
readonly real slope
readonly real alpha
// Creates an origin - impact link.
private thistype ref
private static method math takes thistype a, thistype b returns nothing
local real dx
local real dy
loop
set dx = b.x - a.x
set dy = b.y - a.y
set dx = dx*dx + dy*dy
set dy = SquareRoot(dx)
exitwhen dx != 0. and dy != 0.
set b.x = b.x + .01
set b.z = b.z - GetLocZ(b.x -.01, b.y) + GetLocZ(b.x, b.y)
endloop
set a.square = dx
set a.distance = dy
set a.angle = Atan2(b.y - a.y, b.x - a.x)
set a.slope = (b.z - a.z)/dy
set a.alpha = Atan(a.slope)
// Set b.
if b.ref == a then
set b.angle = a.angle + bj_PI
set b.distance = dy
set b.slope = -a.slope
set b.alpha = -a.alpha
set b.square = dx
endif
endmethod
static method link takes thistype a, thistype b returns nothing
set a.ref = b
set b.ref = a
call math(a, b)
endmethod
method move takes real toX, real toY, real toZ returns nothing
set this.x = toX
set this.y = toY
set this.z = toZ + GetLocZ(toX, toY)
if this.ref != this then
call math(this, this.ref)
endif
endmethod
static method create takes real x, real y, real z returns MisssilePosition
local thistype this = Node.allocate()
set this.ref = this
call this.move(x, y, z)
return this
endmethod
method destroy takes nothing returns nothing
call Node(this).deallocate()
endmethod
endstruct
struct MisssileList extends array
method operator missile takes nothing returns Misssile
return this
endmethod
implement StaticList
endstruct
struct Misssile extends array
// Attach point name for effects created by model=.
readonly static constant string ORIGIN = "origin"
// Set a ficitional hit box in range of 0 to 1,
// while 0 is the toe and 1 the head of a unit.
readonly static constant real HIT_BOX = (2./3.)
// Checks for double launching. Throws an error message.
debug boolean launched
// The position of a missile using curve= does not
// match the position used by Misssile's trigonometry.
// Therefore we need this member two times.
// Readable x / y / z for your needs and posX / posY for cool mathematics.
private real posX
private real posY
private real dist// distance
// Readonly members:
// =================
//
// Prevents a double free case.
readonly boolean allocated
readonly SpecialEffect effect
// Position members for your needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and "alpha".
readonly real terrainZ
readonly real angle// Current angle
readonly real prevX
readonly real prevY
readonly real prevZ
// Collision detection type. ( Evaluated new in each loop )
readonly integer collisionType// Current collision type ( circular or rectangle )
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner is PLAYER_NEUTRAL_PASSIVE.
real speed // Vector length for missile movement in plane x / y.
real acceleration
real damage
integer data // For data transfer set and read data.
boolean recycle // Is set to true, when a Misssile reaches it's destination.
real turn // Sets a turn rate for a missile.
real collision // Collision size in plane x / y.
private static method onInsert takes thistype node returns nothing
call MisssileList.pushBack(node)
endmethod
private static method onRemove takes thistype node returns nothing
call MisssileList.remove(node)
endmethod
implement List
method operator x takes nothing returns real
return this.effect.x
endmethod
method operator y takes nothing returns real
return this.effect.y
endmethod
method operator z takes nothing returns real
return this.effect.height
endmethod
private string path
method operator model= takes string file returns nothing
call this.effect.kill(DELAYED_MISSILE_DEATH_ANIMATION_TIME, false)
// null and ""
if StringLength(file) > 0 then
call BlzSetSpecialEffectScale(this.effect.addModel(file), this.scaling)
set this.path = file
else
set this.path = null
endif
endmethod
method operator model takes nothing returns string
return this.path
endmethod
readonly real open
// Enables curved movement for your missile.
// Remember that the result of Tan(PI/2) is infinity.
method operator curve= takes real value returns nothing
set this.open = Tan(value)*this.origin.distance/4
endmethod
method operator curve takes nothing returns real
return Atan(4*this.open/this.origin.distance)
endmethod
readonly real height
// Enables arcing movement for your missile.
method operator arc= takes real value returns nothing
set this.height = Tan(value)*this.origin.distance/4
endmethod
method operator arc takes nothing returns real
return Atan(4*this.height/this.origin.distance)
endmethod
private real spinRate
private real currentRoll
method operator spin= takes real value returns nothing
set this.spinRate = value*TIMER_TIMEOUT
endmethod
method operator spin takes nothing returns real
return this.spinRate/TIMER_TIMEOUT
endmethod
private real scaling
method operator scale= takes real value returns nothing
call this.effect.resetIterator()
loop
exitwhen this.effect.moveIterator()
call BlzSetSpecialEffectScale(this.effect.currentHandle(), value)
endloop
set this.scaling = value
endmethod
method operator scale takes nothing returns real
return this.scaling
endmethod
method bounce takes nothing returns nothing
call this.origin.move(this.x, this.y, this.z)
set this.dist = 0.
endmethod
method deflect takes real tx, real ty returns nothing
local real a = 2.*Atan2(ty - this.y, tx - this.x) + bj_PI - this.angle
call this.impact.move(x + (origin.distance - this.dist)*Cos(a), this.y + (this.origin.distance - this.dist)*Sin(a), this.impact.z)
call this.bounce()
endmethod
method deflectEx takes real tx, real ty, real tz returns nothing
call this.impact.move(this.impact.x, this.impact.y, tz)
call this.deflect(tx, ty)
endmethod
method flightTime2Speed takes real duration returns nothing
set this.speed = RMaxBJ(0.00000001, (this.origin.distance - this.dist)*Misssile_TIMER_TIMEOUT/RMaxBJ(0.00000001, duration))
endmethod
method setMovementSpeed takes real value returns nothing
set this.speed = value*Misssile_TIMER_TIMEOUT
endmethod
boolean wantDestroy// For "true" a missile is destroyed on the next timer callback. 100% safe.
method destroy takes nothing returns nothing
set this.wantDestroy = true
endmethod
// Instantly destroys a missile.
method terminate takes nothing returns nothing
if this.allocated then
set this.allocated = false
call this.impact.destroy()
call this.origin.destroy()
call table[this].flush()
set this.source = null
set this.target = null
set this.owner = null
call this.effect.kill(DELAYED_MISSILE_DEATH_ANIMATION_TIME, true)
call Node(this).deallocate()
call remove(this)
endif
endmethod
// Runs in createEx.
private method resetMembers takes nothing returns nothing
set this.path = null
set this.scaling = 1.
set this.speed = 0.
set this.acceleration = 0.
set this.spinRate = 0.
set this.distance = 0.
set this.dist = 0.
set this.height = 0.
set this.turn = 0.
set this.open = 0.
set this.collision = 0.
set this.collisionType = 0
set this.stackSize = 0
set this.wantDestroy = false
set this.recycle = false
endmethod
static method create takes real x, real y, real z, real angle, real distance, real impactZ returns thistype
local real impactX = x + distance*Cos(angle)
local real impactY = y + distance*Sin(angle)
local thistype this = Node.allocate()
call this.resetMembers()
set this.effect = SpecialEffect.create(x, y, z + GetLocZ(x, y))
set this.origin = MisssilePosition.create(x, y, z)
set this.impact = MisssilePosition.create(impactX, impactY, impactZ)
call MisssilePosition.link(this.origin, this.impact)
set this.currentRoll = 0.
set this.posX = x
set this.posY = y
set this.angle = this.origin.angle
set this.allocated = true
debug set this.launched = false
return this
endmethod
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns thistype
local real dx = impactX - x
local real dy = impactY - y
local real dz = impactZ - z
return create(x, y, z, Atan2(dy, dx), SquareRoot(dx*dx + dy*dy), impactZ)
endmethod
// Misssile motion takes place every Misssile_TIMER_TIMEOUT
// before accessing each active struct.
static Misssile temp = 0
static method move takes nothing returns boolean
local integer loops = 0 // Current iteration.
local integer limit = 150 // Set iteration border per trigger evaluation to avoid hitting the operation limit.
local thistype this = thistype.temp
local MisssilePosition p
local real a
local real d
local real roll
local unit u
local real newX
local real newY
local real newZ
local real prevAbsZ
local real vel
local real point
loop
exitwhen this == MisssileList.head or loops == limit
set p = this.origin
// Save previous, respectively current missile position.
set this.prevX = this.x
set this.prevY = this.y
set this.prevZ = this.z
set prevAbsZ = this.effect.z
// Evaluate the collision type.
set vel = this.speed
set this.speed = vel + this.acceleration
if vel < this.collision*Misssile_COLLISION_ACCURACY_FACTOR then
set this.collisionType = Misssile_COLLISION_TYPE_CIRCLE
else
set this.collisionType = Misssile_COLLISION_TYPE_RECTANGLE
endif
// Update missile guidance to its intended target.
set u = this.target
if u != null then
if 0 == GetUnitTypeId(u) then
set this.target = null
else
call p.move(this.prevX, this.prevY, this.prevZ)
call this.impact.move(GetUnitX(u), GetUnitY(u), GetUnitFlyHeight(u) + GetUnitHeight(u)*Misssile.HIT_BOX)
set this.dist = 0
set this.height = 0
set this.curve = 0
endif
endif
set a = p.angle
// Update the missile facing angle depending on the turn ratio.
if 0. != this.turn and Cos(this.angle - a) < Cos(this.turn) then
if 0. > Sin(a - this.angle) then
set this.angle = this.angle - this.turn
else
set this.angle = this.angle + this.turn
endif
else
set this.angle = a
endif
// Update the missile position on the parabola.
set d = p.distance// origin - impact distance.
set this.recycle = this.dist + vel >= d
if this.recycle then
set point = d
set this.distance = this.distance + d - this.dist
set newX = this.impact.x
set newY = this.impact.y
set newZ = this.impact.z
set this.posX = newX
set this.posY = newY
else
set this.distance = this.distance + vel
set point = this.dist + vel
set newX = this.posX + vel*Cos(this.angle)
set newY = this.posY + vel*Sin(this.angle)
set this.posX = newX
set this.posY = newY
// Update point(x/y) if a curving trajectory is defined.
if 0. != this.open and u == null then
set vel = 4*this.open*point*(d - point)/p.square
set a = this.angle + bj_PI/2
set newX = newX + vel*Cos(a)
set newY = newY + vel*Sin(a)
if vel < 0.00 then
set a = Atan2(newY - this.prevY, newX - this.prevX) + bj_PI
else
set a = Atan2(newY - this.prevY, newX - this.prevX)
endif
else
set a = this.angle
endif
// Update pos z if an arc or height is set.
if 0. == this.height and 0. == p.alpha then
set newZ = p.z
else
set newZ = p.z + p.slope*point
if 0. != this.height and u == null then
set newZ = newZ + (4*this.height*point*(d - point)/p.square)
endif
endif
endif
set this.dist = point
set this.terrainZ = GetLocZ(newX, newY)
if this.open < 0.00 then
set roll = Atan2(this.open, this.height) + bj_PI
else
set roll = Atan2(this.open, this.height)
endif
set this.currentRoll = this.currentRoll - this.spinRate
// Set missile position and orientation
call this.effect.move(newX, newY, newZ)
call this.effect.setOrientation(a, -Atan2(newZ - prevAbsZ, vel), this.currentRoll - roll)
set loops = loops + 1
set this = MisssileList(this).next
endloop
set u = null
set thistype.temp = this
return this == MisssileList.head
endmethod
// Widget collision API:
// =====================
//
// Runs automatically on widget collision.
method hitWidget takes widget w returns nothing
if w != null then
set table[this].widget[GetHandleId(w)] = w
endif
endmethod
// All widget which have been hit return true.
method hasHitWidget takes widget w returns boolean
return table[this].handle.has(GetHandleId(w))
endmethod
// Removes a widget from the missile's memory of hit widgets. ( This widget can be hit again )
method removeHitWidget takes widget w returns nothing
if w != null then
call table[this].handle.remove(GetHandleId(w))
endif
endmethod
// Flushes a missile's memory for collision. ( All widgets can be hit again )
method flushHitWidgets takes nothing returns nothing
call table[this].flush()
endmethod
// Tells missile to call removeHitWidget(w) after "seconds" time.
// Does not apply to widgets, which are already hit by this missile.
readonly integer stackSize
method enableHitAfter takes widget w, real seconds returns nothing
local integer id = GetHandleId(w)
local Table t
if w != null then
set t = table[this]
if not t.has(id) then
set t[id] = stackSize
set t[stackSize] = id
set stackSize = stackSize + 1
endif
set t.real[id] = seconds
endif
endmethod
method updateStack takes nothing returns nothing
local integer dex = 0
local integer id
local real time
local Table t
loop
exitwhen dex == stackSize
set t = table[this]
set id = t[dex]
set time = t.real[id] - Misssile_TIMER_TIMEOUT
if time <= 0. or not t.handle.has(id) then
set stackSize = stackSize - 1
set id = t[stackSize]
set t[dex] = id
set t[id] = dex
// Enables hit.
call t.handle.remove(id)
// Remove data from stack.
call t.real.remove(id)
call t.remove(id)
call t.remove(stackSize)
else
set t.real[id] = time
set dex = dex + 1
endif
endloop
endmethod
// Widget collision code:
// ======================
//
private static boolean circle = true
//
// Rectangle collision for fast moving missiles with small collision radius.
//
// Runs for destructables and items in a rectangle.
// Checks if widget w is in collision range of a missile.
// Is not precise in z - axis collision.
private method isWidgetInRange takes real x, real y, real ws, real ms returns boolean
set x = x - this.x
set y = y - this.y
set ws = ws + ms
return x*x + y*y <= ws*ws
endmethod
private method isWidgetInRect takes real x, real y, real ws, real ms returns boolean
local real dx = this.x - this.prevX
local real dy = this.y - this.prevY
local real s = (dx*(x - this.prevX) + dy*(y - this.prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1 then
set s = 1.
endif
set dx = (this.prevX + s*dx) - x
set dy = (this.prevY + s*dy) - y
set ws = ws + ms
return dx*dx + dy*dy <= ws*ws
endmethod
private method isUnitInRect takes real x, real y returns boolean
local real dx = this.x - this.prevX
local real dy = this.y - this.prevY
local real s = (dx*(x - this.prevX) + dy*(y - this.prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1 then
set s = 1.
endif
return IsUnitInRangeXY(tempUnit, this.prevX + s*dx, this.prevY + s*dy, this.collision)
endmethod
static if Misssile_USE_COLLISION_Z_FILTER then
private method checkZCollision takes real z, real wz returns boolean
set z = z - this.terrainZ
return z + wz >= this.z - this.collision and z <= this.z + this.collision
endmethod
endif
private method isWidgetInCollision takes widget w, real ws, real wz, real ms returns boolean
local real x = GetWidgetX(w)
local real y = GetWidgetY(w)
static if Misssile_USE_COLLISION_Z_FILTER then
if circle then
return this.checkZCollision(GetLocZ(x, y), wz) and this.isWidgetInRange(x, y, ws, ms)
endif
return this.checkZCollision(GetLocZ(x, y), wz) and this.isWidgetInRect(x, y, ws, ms)
else
if circle then
return this.isWidgetInRange(x, y, ws, ms)
endif
return this.isWidgetInRect(x, y, ws, ms)
endif
endmethod
private method isUnitInCollision takes nothing returns boolean
static if Misssile_USE_COLLISION_Z_FILTER then
local real x = GetUnitX(tempUnit)
local real y = GetUnitY(tempUnit)
if circle then
return this.checkZCollision(GetUnitFlyHeight(tempUnit) + GetLocZ(x, y), GetUnitHeight(tempUnit)) and IsUnitInRangeXY(tempUnit, this.x, this.y, this.collision)
endif
return this.checkZCollision(GetUnitFlyHeight(tempUnit) + GetLocZ(x, y), GetUnitHeight(tempUnit)) and this.isUnitInRect(x, y)
else
if circle then
return IsUnitInRangeXY(tempUnit, this.x, this.y, this.collision)
endif
return this.isUnitInRect(GetUnitX(tempUnit), GetUnitY(tempUnit))
endif
endmethod
//
// Runs for every enumerated destructable.
// • Directly filters out already hit destructables.
// • Distance formula based on the Pythagorean theorem.
//
static method destFilter takes nothing returns boolean
if temp.allocated then
set tempDest = GetFilterDestructable()
if not temp.hasHitWidget(tempDest) and temp.isWidgetInCollision(tempDest, GetDestCollisionSize(tempDest), GetDestHeight(tempDest), temp.collision) then
set table[temp].destructable[GetHandleId(tempDest)] = tempDest
return true
endif
endif
return false
endmethod
//
// Runs for every enumerated item.
// • Directly filters out already hit items.
// • Distance formula based on the Pythagorean theorem.
// • Items have a fix collision size of 16.
//
static method itemFilter takes nothing returns boolean
if temp.allocated then
set tempItem = GetFilterItem()
if not temp.hasHitWidget(tempItem) and temp.isWidgetInCollision(tempItem, GetItemCollisionSize(tempItem), GetItemHeight(tempItem), RMaxBJ(temp.collision, 16.)) then
set table[temp].item[GetHandleId(tempItem)] = tempItem
return true
endif
endif
return false
endmethod
//
// Runs for every enumerated units.
// • Filters out units which are not in collision range in plane x / y.
//
static method unitFilter takes nothing returns boolean
if temp.allocated then
set tempUnit = GetFilterUnit()
if not temp.hasHitWidget(tempUnit) and temp.isUnitInCollision() then
set table[temp].unit[GetHandleId(tempUnit)] = tempUnit
return true
endif
endif
return false
endmethod
/*
* Proper rect preparation.
*/
private method prepareRectRectangle takes nothing returns nothing
local real x1 = RMinBJ(this.prevX, this.x)
local real y1 = RMinBJ(this.prevY, this.y)
local real d = this.collision + Misssile_MAXIMUM_COLLISION_SIZE
call SetRect(RECT, x1 - d, y1 - d, this.prevX + this.x - x1 + d, this.prevY + this.y - y1 + d)
endmethod
private method prepareRect takes nothing returns nothing
local real d = this.collision + Misssile_MAXIMUM_COLLISION_SIZE
set circle = this.collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call SetRect(RECT, this.x - d, this.y - d, this.x + d, this.y + d)
else
call this.prepareRectRectangle()
endif
set thistype.temp = this
endmethod
/*
* 5.) API for the MisssileStruct iteration.
*/
method checkUnitCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
set thistype.temp = this
set circle = this.collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call GroupEnumUnitsInRange(GROUP, this.x, this.y, this.collision + Misssile_MAXIMUM_COLLISION_SIZE, Filter(filter))
else
call this.prepareRectRectangle()
call GroupEnumUnitsInRect(GROUP, RECT, Filter(filter))
endif
endif
endmethod
method checkDestCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
call this.prepareRect()
call EnumDestructablesInRect(RECT, Filter(filter), null)
endif
endmethod
method checkItemCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
call this.prepareRect()
call EnumItemsInRect(RECT, Filter(filter), null)
endif
endmethod
private static method onScopeInit takes nothing returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError((Misssile_MAXIMUM_COLLISION_SIZE < 0), "Misssile", "DEBUG_MISSILE", "collision", 0, "Global setup for public real MAXIMUM_COLLISION_SIZE is incorrect, below zero! This map currently can't use Misssile!")
endif
call TriggerAddCondition(MOVE, Condition(function thistype.move))
set table = TableArray[JASS_MAX_ARRAY_SIZE]
endmethod
implement Init
endstruct
// Boolean expressions per struct:
// ===============================
//
// Condition function for the core trigger evaluation. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateExpression takes integer structId, code func returns nothing
set expression[structId] = Condition(func)
endfunction
// Creates a collection for a struct. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateCollection takes integer structId returns nothing
local Misssile node = Node.allocate()
call Misssile.makeHead(node) // Make a circular list
set missileList[structId] = node
endfunction
// Core:
// =====
//
// Fires every Misssile_TIMER_TIMEOUT.
private function Fire takes nothing returns nothing
local integer i = 0
// Move all launched missiles.
set Misssile.temp = MisssileList.front
loop
exitwhen TriggerEvaluate(MOVE)
exitwhen i == 60// Moved over 8910 missiles, something buggy happened.
set i = i + 1 // This case is impossible, hence never happens. But if I'm wrong, which also never happens
endloop // then the map 100% crashes. i == 66 will prevent the game crash and Misssile will start to
// to debug itself over the next iterations.
// Access all structs using module MisssileStruct.
static if DEBUG_MODE and LIBRARY_ErrorMesssage then
if not TriggerEvaluate(CORE) then
call ThrowWarning(true, "Misssile", "Fire", "op limit", 0, /*
*/"You just ran into a op limit!
The op limit protection of Misssile is insufficient for your map.
The code of the missile module can't run in one thread and must be splitted.
If unsure make a post in the official 'The Hive Workshop' forum thread of Misssile!")
endif
else
call TriggerEvaluate(CORE)
endif
endfunction
// Conditionally starts the timer.
private function StartPeriodic takes integer structId returns nothing
if 0 == instances[structId] then
if 0 == active then
call TimerStart(TMR, Misssile_TIMER_TIMEOUT, true, function Fire)
endif
set active = active + 1
set condition[structId] = TriggerAddCondition(CORE, expression[structId])
endif
set instances[structId] = instances[structId] + 1
endfunction
// Conditionally stops the timer in the next callback.
private function StopPeriodic takes integer structId returns nothing
if condition[structId] != null then
set instances[structId] = instances[structId] - 1
if 0 == instances[structId] then
call TriggerRemoveCondition(CORE, condition[structId])
set condition[structId] = null
set active = active - 1
if 0 == active then
call PauseTimer(TMR)
endif
endif
endif
endfunction
// Modules:
// ========
//
// You want to place module MisssileLaunch at the very top of your struct.
module MisssileLaunch
static method launch takes Misssile missile returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(missile.launched, "thistype", "launch", "missile.launched", missile, "This missile was already launched before!")
endif
debug set missile.launched = true
call missileList[thistype.typeid].pushBack(missile)
call StartPeriodic(thistype.typeid)
endmethod
endmodule
module MisssileTerminate
// Called from missileIterate. "P" to avoid code collision.
static method missileTerminateP takes Misssile node returns nothing
if node.allocated then
static if thistype.onRemove.exists then
call thistype.onRemove(node)
endif
call node.terminate()
call StopPeriodic(thistype.typeid)
endif
endmethod
endmodule
// Allows you to inject missile in certain stages of the motion process.
module MisssileAction
static if thistype.onCollide.exists then
private static method missileActionUnit takes nothing returns nothing
if Misssile.unitFilter() and thistype.onCollide(Misssile.temp, tempUnit) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
static if thistype.onItem.exists then
private static method missileActionItem takes nothing returns nothing
if Misssile.itemFilter() and thistype.onItem(Misssile.temp, tempItem) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
static if thistype.onDestructable.exists then
private static method missileActionDest takes nothing returns nothing
if Misssile.destFilter() and thistype.onDestructable(Misssile.temp, tempDest) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
// Runs every Misssile_TIMER_TIMEOUT for this struct.
static method missileIterateP takes nothing returns boolean
local Misssile node = missileList[thistype.typeid].front
loop
exitwhen node == missileList[thistype.typeid]
if node.wantDestroy then
call missileTerminateP(node)
else
if node.stackSize > 0 then
call node.updateStack()
endif
// Runs unit collision.
static if thistype.onCollide.exists then
call node.checkUnitCollision(function thistype.missileActionUnit)
endif
// Runs destructable collision.
static if thistype.onDestructable.exists then
call node.checkDestCollision(function thistype.missileActionDest)
endif
// Runs item collision.
static if thistype.onItem.exists then
call node.checkItemCollision(function thistype.missileActionItem)
endif
// Runs when the destination is reached.
if node.recycle and node.allocated then
static if thistype.onFinish.exists then
if thistype.onFinish(node) then
call missileTerminateP(node)
endif
else
call missileTerminateP(node)
endif
endif
// Runs on terrain collision.
static if thistype.onTerrain.exists then
if node.allocated and 0. > node.z and thistype.onTerrain(node) then
call missileTerminateP(node)
endif
endif
// Runs every Misssile_TIMER_TIMEOUT.
static if thistype.onPeriod.exists then
if node.allocated and thistype.onPeriod(node) then
call missileTerminateP(node)
endif
endif
endif
set node = node.next
endloop
static if DEBUG_MODE and LIBRARY_ErrorMessage then
return true
else
return false
endif
endmethod
endmodule
module MisssileStruct
implement MisssileLaunch
implement MisssileTerminate
implement MisssileAction
private static method onInit takes nothing returns nothing
call MisssileCreateCollection(thistype.typeid)
call MisssileCreateExpression(thistype.typeid, function thistype.missileIterateP)
endmethod
endmodule
private module Init
private static method onInit takes nothing returns nothing
call Misssile.onScopeInit()
endmethod
endmodule
// The end!
endlibrary
library Misssile /* version 3.2.0 (Update for patches 1.31+)
*************************************************************************************
*
* Resource link:
* https://www.hiveworkshop.com/threads/missile.325956/
*
* Legacy Resource Link (for patches 1.30.x and below):
* https://www.hiveworkshop.com/threads/missile.265370/
*
*************************************************************************************
*
* Original Resource by BPower, updated by AGD
*
* Credits to Dirac, emjlr3, AceHart, Bribe, Wietlol, Nestharus,
* Maghteridon96, Vexorian, Zwiebelchen, and Chopinski
*
*************************************************************************************
*
* Creating custom projectiles in Warcraft III.
*
* Philosophy:
* I want that feature --> Compiler writes that code into your map script.
* I don't want that --> Compiler ignores that code completely.
*
* Important:
* Take yourself 2 minutes time to setup Misssile correctly.
* Otherwise I can't guarantee, that Misssile works the way you want.
* Once the setup is done, you can check out some examples and Misssile will be easy
* to use for everyone. I promise it.
*
* Do the setup at:
*
* 1.) Import instruction
* 2.) Global configuration
* 3.) Function configuration
*
*************************************************************************************
*
* */ requires /*
*
* */ /* https://www.hiveworkshop.com/threads/188084/
* */ SpecialEffect /* https://www.hiveworkshop.com/threads/325954/ | Should use atleast v1.1.0
* */ LinkedList /* https://www.hiveworkshop.com/threads/325635/
*
*************************************************************************************
*
* */ optional Alloc /* https://www.hiveworkshop.com/threads/324937/
* */ optional ErrorMessage /* https://github.com/nestharus/JASS/blob/master/jass/Systems/ErrorMessage/main.j
*
************************************************************************************
*
* 1. Import instruction
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* • Import the required libraries.
* • Copy Misssile into to your map.
*
* 2. Global configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*/
globals
/**
* Misssiles are moved periodically. An interval of 1./32. is recommended.
* • Too short timeout intervals may cause performance issues.
* • Too large timeout intervals may look fishy.
*/
public constant real TIMER_TIMEOUT = 1./32.
/**
* The maximum collision size used in your map. If unsure use 197. ( Town hall collision )
* • Applies for all types of widgets.
* • A precise value can improve Misssile's performance,
* since smaller values enumerate less widgtes per loop per missile.
*/
public constant real MAXIMUM_COLLISION_SIZE = 250.
/**
* Collision types for missiles. ( Documentation only )
* Misssile decides internally each loop which type of collision is required.
* • Uses circular collision dectection for speed < collision. ( Good accuracy, best performance )
* • Uses rectangle collision for speed >= collision. ( Best accuracy, normal performance )
*/
public constant integer COLLISION_TYPE_CIRCLE = 0
public constant integer COLLISION_TYPE_RECTANGLE = 1
/**
* Determine when rectangle collision is required to detect nearby widgets.
* • The smaller the factor the earlier rectangle collision is used. ( by default 1. )
* • Formula: speed >= collision*Misssile_COLLISION_ACCURACY_FACTOR
*/
public constant real COLLISION_ACCURACY_FACTOR = 4.
/*
Optional toogles:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Set booleans listed below to "true" and the compiler will write
the feature into your map. Otherwise this code is completly ignored.
• Yay, I want that --> "true"
• Naah that's useless for me --> "false"
**
* USE_COLLISION_Z_FILTER enables z axis checks for widget collision. ( Adds minimal overhead )
* Use it when you need:
* • Misssiles flying over or under widgets.
* • Determine between flying and walking units.
*/
public constant boolean USE_COLLISION_Z_FILTER = true
/**
* DELAYED_MISSILE_DEATH_ANIMATION_TIME is the delay in seconds
* to accomodate for the sfx death duration of destroyed Misssiles
*/
private constant real DELAYED_MISSILE_DEATH_ANIMATION_TIME = 2.16
endglobals
/*
* 3. Function configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*/
/**
* GetUnitHeight(unit) returns a fictional value for z - axis collision.
* You have two options:
* • One constant value shared over all units.
* • Dynamic values based on handle id, type id, unit user data, scaling or other parameters.
*/
public function GetUnitHeight takes unit whichUnit returns real
return 108.// Other example: return LoadReal(hash, GetHandleId(whichUnit), KEY_UNIT_HEIGHT)
endfunction
/**
* Same as GetUnitHeight, but for destructables.
* Using occluder height is an idea of mine. Of course you can use your own values.
*/
public function GetDestHeight takes destructable d returns real
return GetDestructableOccluderHeight(d)// Other example: return 72.
endfunction
/**
* Again it's up to you to figure out a fictional item height.
*/
public function GetItemHeight takes item i returns real
return 16.
endfunction
public function GetDestCollisionSize takes destructable d returns real
return 43.2
endfunction
public function GetItemCollisionSize takes item i returns real
return 18.
endfunction
/**
* 4. API
* ¯¯¯¯¯¯
*/
//! novjass
// Custom type Misssile for your projectile needs.
struct Misssile extends array
// Constants:
// ==========
readonly static constant real HIT_BOX = (2./3.)
// • Fictional hit box for homing missiles.
// while 0 would be the toe and 1 the head of a unit.
// Available creators:
// ===================
static method create takes real x, real y, real z, real angleInRadians, real distanceToTravel, real endZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
// Available destructors:
// ======================
//
return true
// • Core destructor.
// • Returning true in any of the interface methods of the MisssileStruct module
// will destroy that instance instantly.
method destroy takes nothing returns nothing
// • Destroys the missile during the next timer callback.
method terminate takes nothing returns nothing
// • Destroys the missile instantly.
// Fields you can set and read directly:
// =====================================
//
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner remains PLAYER_NEUTRAL_PASSIVE.
real speed // Vector lenght for missile movement in plane x / y. ( DOES NOT TAKE THE TIMER TIMEOUT IN ACCOUNT )
real acceleration
real damage
real turn // Set a turn rate for missiles.
integer data // For data transfer set and read data.
boolean recycle // Is automatically set to true, when a Misssile reaches it's destination.
boolean wantDestroy // Set wantDestroy to true, to destroy a missile during the next timer callback.
// Neither collision nor collisionZ accept values below zero.
real collision // Collision size in the x-y-z axes
// Fields you can only read:
// =========================
readonly SpecialEffect effect
readonly boolean allocated
// Position members for you needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and the pitch angle "alpha".
// Furthermore method origin.move(x, y, z) and impact.move(x, y, z).
readonly real terrainZ
readonly real x
readonly real y
readonly real z
readonly real angle// Current angle in radians.
// Method operators for set and read:
// ==================================
//
method operator model= takes string modelFile returns nothing
method operator model takes nothing returns string
// • For multiple effects manipulate "this.effect" directly instead.
method operator scale= takes real value returns nothing
method operator scale takes nothing returns real
// • Set and read the scaling of 'this.effect'.
method operator curve= takes real value returns nothing
method operator curve takes nothing returns real
// • Enables curved movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
method operator arc= takes real value returns nothing
method operator arc takes nothing returns real
// • Enables arcing movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
method operator spin= takes real rps returns nothing
method operator spin takes nothing returns real
// • Spin in rad/sec
// Methods for missile movement:
// =============================
//
method bounce takes nothing returns nothing
// • Moves the MisssilePosition "origin" to the current missile coordinates.
// • Resets the distance traveled to 0.
method deflect takes real tx, real ty returns nothing
// • Deflect the missile towards tx, ty. Then calls bounce.
method deflectEx takes real tx, real ty, real tz returns nothing
// • Deflect the missile towards tx, ty, tz. Then calls bounce.
method flightTime2Speed takes real duration returns nothing
// • Converts a fly time to a vector lenght for member "speed".
// • Does not take acceleration into account. ( Disclaimer )
method setMovementSpeed takes real value returns nothing
// • Converts Warcraft III movement speed to a vector lenght for member "speed".
// Methods for missile collision: ( all are hashtable entries )
// ==============================
// By default a widget can only be hit once per missile.
//
method hitWidget takes widget w returns nothing
// • Saves a widget in the memory as hit by this instance.
method hasHitWidget takes widget w returns boolean
// • Returns true, if "w" has been hit by this instance.
method removeHitWidget takes widget w returns nothing
// • Removes a widget from this missile's memory for widget collision. ( Can hit "w" again )
method flushHitWidgets takes nothing returns nothing
// • Flushes a missile's memory for widget collision. ( All widgets can be hit again )
method enableHitAfter takes widget w, real seconds returns nothing
// • Automatically calls removeHitWidget(w) after "seconds" time. ( Can hit "w" again after given time )
// Module MisssileStruct:
// =====================
//
module MisssileLaunch // ( optional )
module MisssileStruct
// • Enables the entire missile interface for that struct.
// Interface in structs: ( Must implement module MisssileStruct )
// =====================
//
// • Write one, many or all of the static method below into your struct.
// • Misssiles launched in this struct will run those methods, when their events fire.
//
// • All of those static methods must return a boolean.
// a) return true --> destroys the missile instance instantly.
// b) return false --> keep on flying.
// Available static method:
// ========================
//
static method onCollide takes Misssile missile, unit hit returns boolean
// • Runs for units in collision range of a missile.
static method onDestructable takes Misssile missile, destructable hit returns boolean
// • Runs for destructables in collision range of a missile.
static method onItem takes Misssile missile, item hit returns boolean
// • Runs for items in collision range of a missile.
static method onTerrain takes Misssile missile returns boolean
// • Runs when a missile collides with the terrain. ( Ground and cliffs )
static method onFinish takes Misssile missile returns boolean
// • Runs only when a missile reaches it's destination.
// • However does not run, if a Misssile is destroyed in another method.
static method onPeriod takes Misssile missile returns boolean
// • Runs every Misssile_TIMER_TIMEOUT seconds.
static method onRemove takes Misssile missile returns boolean
// • Runs when a missile is destroyed.
// • Unlike onFinish, onRemove will runs ALWAYS when a missile is destroyed!!!
//
// For onRemove the returned boolean has a unique meaning:
// • Return true will recycle this missile delayed.
// • Return false will recycle this missile right away.
static method launch takes Misssile toLaunch returns nothing
// • Well ... Launches this Misssile.
// • Misssile "toLaunch" will behave as declared in the struct. ( static methods from above )
// Misc: ( From the global setup )
// =====
//
// Constants:
// ==========
//
public constant real TIMER_TIMEOUT
public constant real MAXIMUM_COLLISION_SIZE
public constant boolean USE_COLLISION_Z_FILTER
readonly static constant real HIT_BOX
// Functions:
// ==========
//
public function GetLocZ takes real x, real y returns real
public function GetUnitHeight takes unit u returns real
public function GetDestHeight takes destructable d returns real
public function GetItemHeight takes item i returns real
public function GetDestCollisionSize takes destructable d returns real
public function GetItemCollisionSize takes item i returns real
//========================================================================
// Misssile system. Make changes carefully.
//========================================================================
//! endnovjass
// Hello and welcome to Misssile.
// I wrote a guideline for every piece of code inside Misssile, so you
// can easily understand how the it gets compiled and evaluated.
//
// Let's go!
private keyword Init
globals
// Core constant handle variables of Misssile.
private constant trigger CORE = CreateTrigger()
private constant trigger MOVE = CreateTrigger()
private constant timer TMR = CreateTimer()
private constant location LOC = Location(0., 0.)
private constant rect RECT = Rect(0., 0., 0., 0.)
private constant group GROUP = CreateGroup()
// For starting and stopping the timer.
private integer active = 0
// Arrays for data structure.
private integer array instances
private Misssile array missileList
private boolexpr array expression
private triggercondition array condition
private unit tempUnit
private item tempItem
private destructable tempDest
private hashtable HASH = InitHashtable()
endglobals
public function GetLocZ takes real x, real y returns real
call MoveLocation(LOC, x, y)
return GetLocationZ(LOC)
endfunction
/*===============================================================================================*/
/*
* One allocator for the whole library
*/
private struct Node extends array
static if LIBRARY_Alloc then
implement optional Alloc
else
/*
* Credits to MyPad for the allocation algorithm
*/
private static thistype array stack
static method allocate takes nothing returns thistype
local thistype node = stack[0]
if stack[node] == 0 then
static if LIBRARY_ErrorMessage then
debug call ThrowError(node == (JASS_MAX_ARRAY_SIZE - 1), "Misssile", "allocate()", "thistype", node, "Overflow")
endif
set node = node + 1
set stack[0] = node
else
set stack[0] = stack[node]
set stack[node] = 0
endif
return node
endmethod
method deallocate takes nothing returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "Misssile", "deallocate()", "thistype", 0, "Null node")
debug call ThrowError(stack[this] > 0, "Misssile", "deallocate()", "thistype", this, "Double-free")
endif
set stack[this] = stack[0]
set stack[0] = this
endmethod
endif
endstruct
// Simple trigonometry.
struct MisssilePosition extends array
readonly real x
readonly real y
readonly real z
readonly real angle
readonly real distance
readonly real square
readonly real slope
readonly real alpha
// Creates an origin - impact link.
private thistype ref
private static method math takes thistype a, thistype b returns nothing
local real dx
local real dy
loop
set dx = b.x - a.x
set dy = b.y - a.y
set dx = dx*dx + dy*dy
set dy = SquareRoot(dx)
exitwhen dx != 0. and dy != 0.
set b.x = b.x + .01
set b.z = b.z - GetLocZ(b.x -.01, b.y) + GetLocZ(b.x, b.y)
endloop
set a.square = dx
set a.distance = dy
set a.angle = Atan2(b.y - a.y, b.x - a.x)
set a.slope = (b.z - a.z)/dy
set a.alpha = Atan(a.slope)
// Set b.
if b.ref == a then
set b.angle = a.angle + bj_PI
set b.distance = dy
set b.slope = -a.slope
set b.alpha = -a.alpha
set b.square = dx
endif
endmethod
static method link takes thistype a, thistype b returns nothing
set a.ref = b
set b.ref = a
call math(a, b)
endmethod
method move takes real toX, real toY, real toZ returns nothing
set this.x = toX
set this.y = toY
set this.z = toZ + GetLocZ(toX, toY)
if this.ref != this then
call math(this, this.ref)
endif
endmethod
static method create takes real x, real y, real z returns MisssilePosition
local thistype this = Node.allocate()
set this.ref = this
call this.move(x, y, z)
return this
endmethod
method destroy takes nothing returns nothing
call Node(this).deallocate()
endmethod
endstruct
struct MisssileList extends array
method operator missile takes nothing returns Misssile
return this
endmethod
implement StaticList
endstruct
struct Misssile extends array
// Attach point name for effects created by model=.
readonly static constant string ORIGIN = "origin"
// Set a ficitional hit box in range of 0 to 1,
// while 0 is the toe and 1 the head of a unit.
readonly static constant real HIT_BOX = (2./3.)
// Checks for double launching. Throws an error message.
debug boolean launched
// The position of a missile using curve= does not
// match the position used by Misssile's trigonometry.
// Therefore we need this member two times.
// Readable x / y / z for your needs and posX / posY for cool mathematics.
private real posX
private real posY
private real dist// distance
// Readonly members:
// =================
//
// Prevents a double free case.
readonly boolean allocated
readonly SpecialEffect effect
// Position members for your needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and "alpha".
readonly real terrainZ
readonly real angle// Current angle
readonly real prevX
readonly real prevY
readonly real prevZ
// Collision detection type. ( Evaluated new in each loop )
readonly integer collisionType// Current collision type ( circular or rectangle )
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner is PLAYER_NEUTRAL_PASSIVE.
real speed // Vector length for missile movement in plane x / y.
real acceleration
real damage
integer data // For data transfer set and read data.
boolean recycle // Is set to true, when a Misssile reaches it's destination.
real turn // Sets a turn rate for a missile.
real collision // Collision size in plane x / y.
private static method onInsert takes thistype node returns nothing
call MisssileList.pushBack(node)
endmethod
private static method onRemove takes thistype node returns nothing
call MisssileList.remove(node)
endmethod
implement List
method operator x takes nothing returns real
return this.effect.x
endmethod
method operator y takes nothing returns real
return this.effect.y
endmethod
method operator z takes nothing returns real
return this.effect.height
endmethod
private string path
method operator model= takes string file returns nothing
call this.effect.kill(DELAYED_MISSILE_DEATH_ANIMATION_TIME, false)
// null and ""
if StringLength(file) > 0 then
call BlzSetSpecialEffectScale(this.effect.addModel(file), this.scaling)
set this.path = file
else
set this.path = null
endif
endmethod
method operator model takes nothing returns string
return this.path
endmethod
readonly real open
// Enables curved movement for your missile.
// Remember that the result of Tan(PI/2) is infinity.
method operator curve= takes real value returns nothing
set this.open = Tan(value)*this.origin.distance/4
endmethod
method operator curve takes nothing returns real
return Atan(4*this.open/this.origin.distance)
endmethod
readonly real height
// Enables arcing movement for your missile.
method operator arc= takes real value returns nothing
set this.height = Tan(value)*this.origin.distance/4
endmethod
method operator arc takes nothing returns real
return Atan(4*this.height/this.origin.distance)
endmethod
private real spinRate
private real currentRoll
method operator spin= takes real value returns nothing
set this.spinRate = value*TIMER_TIMEOUT
endmethod
method operator spin takes nothing returns real
return this.spinRate/TIMER_TIMEOUT
endmethod
private real scaling
method operator scale= takes real value returns nothing
call this.effect.resetIterator()
loop
exitwhen this.effect.moveIterator()
call BlzSetSpecialEffectScale(this.effect.currentHandle(), value)
endloop
set this.scaling = value
endmethod
method operator scale takes nothing returns real
return this.scaling
endmethod
method bounce takes nothing returns nothing
call this.origin.move(this.x, this.y, this.z)
set this.dist = 0.
endmethod
method deflect takes real tx, real ty returns nothing
local real a = 2.*Atan2(ty - this.y, tx - this.x) + bj_PI - this.angle
call this.impact.move(x + (origin.distance - this.dist)*Cos(a), this.y + (this.origin.distance - this.dist)*Sin(a), this.impact.z)
call this.bounce()
endmethod
method deflectEx takes real tx, real ty, real tz returns nothing
call this.impact.move(this.impact.x, this.impact.y, tz)
call this.deflect(tx, ty)
endmethod
method flightTime2Speed takes real duration returns nothing
set this.speed = RMaxBJ(0.00000001, (this.origin.distance - this.dist)*Misssile_TIMER_TIMEOUT/RMaxBJ(0.00000001, duration))
endmethod
method setMovementSpeed takes real value returns nothing
set this.speed = value*Misssile_TIMER_TIMEOUT
endmethod
boolean wantDestroy// For "true" a missile is destroyed on the next timer callback. 100% safe.
method destroy takes nothing returns nothing
set this.wantDestroy = true
endmethod
// Instantly destroys a missile.
method terminate takes nothing returns nothing
if this.allocated then
set this.allocated = false
call this.impact.destroy()
call this.origin.destroy()
call FlushChildHashtable(HASH, this)
set this.source = null
set this.target = null
set this.owner = null
call this.effect.kill(DELAYED_MISSILE_DEATH_ANIMATION_TIME, true)
call Node(this).deallocate()
call remove(this)
endif
endmethod
// Runs in createEx.
private method resetMembers takes nothing returns nothing
set this.path = null
set this.scaling = 1.
set this.speed = 0.
set this.acceleration = 0.
set this.spinRate = 0.
set this.distance = 0.
set this.dist = 0.
set this.height = 0.
set this.turn = 0.
set this.open = 0.
set this.collision = 0.
set this.collisionType = 0
set this.stackSize = 0
set this.wantDestroy = false
set this.recycle = false
endmethod
static method create takes real x, real y, real z, real angle, real distance, real impactZ returns thistype
local real impactX = x + distance*Cos(angle)
local real impactY = y + distance*Sin(angle)
local thistype this = Node.allocate()
call this.resetMembers()
set this.effect = SpecialEffect.create(x, y, z + GetLocZ(x, y))
set this.origin = MisssilePosition.create(x, y, z)
set this.impact = MisssilePosition.create(impactX, impactY, impactZ)
call MisssilePosition.link(this.origin, this.impact)
set this.currentRoll = 0.
set this.posX = x
set this.posY = y
set this.angle = this.origin.angle
set this.allocated = true
debug set this.launched = false
return this
endmethod
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns thistype
local real dx = impactX - x
local real dy = impactY - y
local real dz = impactZ - z
return create(x, y, z, Atan2(dy, dx), SquareRoot(dx*dx + dy*dy), impactZ)
endmethod
// Misssile motion takes place every Misssile_TIMER_TIMEOUT
// before accessing each active struct.
static Misssile temp = 0
static method move takes nothing returns boolean
local integer loops = 0 // Current iteration.
local integer limit = 150 // Set iteration border per trigger evaluation to avoid hitting the operation limit.
local thistype this = thistype.temp
local MisssilePosition p
local real a
local real d
local real roll
local unit u
local real newX
local real newY
local real newZ
local real prevAbsZ
local real vel
local real point
local real dx
local real dy
loop
exitwhen this == MisssileList.head or loops == limit
set p = this.origin
// Save previous, respectively current missile position.
set this.prevX = this.x
set this.prevY = this.y
set this.prevZ = this.z
set prevAbsZ = this.effect.z
// Evaluate the collision type.
set vel = this.speed
set this.speed = vel + this.acceleration
if vel < this.collision*Misssile_COLLISION_ACCURACY_FACTOR then
set this.collisionType = Misssile_COLLISION_TYPE_CIRCLE
else
set this.collisionType = Misssile_COLLISION_TYPE_RECTANGLE
endif
// Update missile guidance to its intended target.
set u = this.target
if u != null then
if 0 == GetUnitTypeId(u) then
set a = p.angle
set this.target = null
else
//call p.move(this.prevX, this.prevY, this.prevZ)
call this.impact.move(GetUnitX(u), GetUnitY(u), GetUnitFlyHeight(u) + GetUnitHeight(u)*Misssile.HIT_BOX)
set dx = this.impact.x - (this.posX + vel*Cos(this.angle))
set dy = this.impact.y - (this.posY + vel*Sin(this.angle))
set a = Atan2(dy, dx)
set this.dist = p.distance - SquareRoot(dx*dx + dy*dy)
//set this.dist = 0
//set this.height = 0
//set this.curve = 0
endif
else
set a = p.angle
endif
// Update the missile facing angle depending on the turn ratio.
if 0. != this.turn and Cos(this.angle - a) < Cos(this.turn) then
if 0. > Sin(a - this.angle) then
set this.angle = this.angle - this.turn
else
set this.angle = this.angle + this.turn
endif
else
set this.angle = a
endif
// Update the missile position on the parabola.
set d = p.distance// origin - impact distance.
set this.recycle = this.dist + vel >= d
if this.recycle then
set point = d
set this.distance = this.distance + d - this.dist
set newX = this.impact.x
set newY = this.impact.y
set newZ = this.impact.z
set this.posX = newX
set this.posY = newY
else
set this.distance = this.distance + vel
set point = this.dist + vel
set newX = this.posX + vel*Cos(this.angle)
set newY = this.posY + vel*Sin(this.angle)
set this.posX = newX
set this.posY = newY
// Update point(x/y) if a curving trajectory is defined.
if 0. != this.open then //and u == null then
set vel = 4*this.open*point*(d - point)/p.square
set a = this.angle + bj_PI/2
set newX = newX + vel*Cos(a)
set newY = newY + vel*Sin(a)
if vel < 0.00 then
set a = Atan2(newY - this.prevY, newX - this.prevX) + bj_PI
else
set a = Atan2(newY - this.prevY, newX - this.prevX)
endif
else
set a = this.angle
endif
// Update pos z if an arc or height is set.
if 0. == this.height and 0. == p.alpha then
set newZ = p.z
else
set newZ = p.z + p.slope*point
if 0. != this.height then// and u == null then
set newZ = newZ + (4*this.height*point*(d - point)/p.square)
endif
endif
endif
set this.dist = point
set this.terrainZ = GetLocZ(newX, newY)
if this.open < 0.00 then
set roll = Atan2(this.open, this.height) + bj_PI
else
set roll = Atan2(this.open, this.height)
endif
set this.currentRoll = this.currentRoll - this.spinRate
// Set missile position and orientation
call this.effect.move(newX, newY, newZ)
call this.effect.setOrientation(a, -Atan2(newZ - prevAbsZ, vel), this.currentRoll - roll)
set loops = loops + 1
set this = MisssileList(this).next
endloop
set u = null
set thistype.temp = this
return this == MisssileList.head
endmethod
// Widget collision API:
// =====================
//
// Runs automatically on widget collision.
method hitWidget takes widget w returns nothing
if w != null then
call SaveWidgetHandle(HASH, this, GetHandleId(w), w)
endif
endmethod
// All widget which have been hit return true.
method hasHitWidget takes widget w returns boolean
return HaveSavedHandle(HASH, this, GetHandleId(w))
endmethod
// Removes a widget from the missile's memory of hit widgets. ( This widget can be hit again )
method removeHitWidget takes widget w returns nothing
if w != null then
call RemoveSavedHandle(HASH, this, GetHandleId(w))
endif
endmethod
// Flushes a missile's memory for collision. ( All widgets can be hit again )
method flushHitWidgets takes nothing returns nothing
call FlushChildHashtable(HASH, this)
endmethod
// Tells missile to call removeHitWidget(w) after "seconds" time.
// Does not apply to widgets, which are already hit by this missile.
readonly integer stackSize
method enableHitAfter takes widget w, real seconds returns nothing
local integer id = GetHandleId(w)
if w != null then
if not HaveSavedInteger(HASH, this, id) then
call SaveInteger(HASH, this, id, stackSize)
call SaveInteger(HASH, this, stackSize, id)
set stackSize = stackSize + 1
endif
call SaveReal(HASH, this, id, seconds)// Set time.
endif
endmethod
method updateStack takes nothing returns nothing
local integer dex = 0
local integer id
local real time
loop
exitwhen dex == stackSize
set id = LoadInteger(HASH, this, dex)
set time = LoadReal(HASH, this, id) - Misssile_TIMER_TIMEOUT
if time <= 0. or not HaveSavedHandle(HASH, this, id) then
set stackSize = stackSize - 1
set id = LoadInteger(HASH, this, stackSize)
call SaveInteger(HASH, this, dex, id)
call SaveInteger(HASH, this, id, dex)
// Enables hit.
call RemoveSavedHandle(HASH, this, id)
// Remove data from stack.
call RemoveSavedReal(HASH, this, id)
call RemoveSavedInteger(HASH, this, id)
call RemoveSavedInteger(HASH, this, stackSize)
else
call SaveReal(HASH, this, id, time)
set dex = dex + 1
endif
endloop
endmethod
// Widget collision code:
// ======================
//
private static boolean circle = true
//
// Rectangle collision for fast moving missiles with small collision radius.
//
// Runs for destructables and items in a rectangle.
// Checks if widget w is in collision range of a missile.
// Is not precise in z - axis collision.
private method isWidgetInRange takes real x, real y, real ws, real ms returns boolean
set x = x - this.x
set y = y - this.y
set ws = ws + ms
return x*x + y*y <= ws*ws
endmethod
private method isWidgetInRect takes real x, real y, real ws, real ms returns boolean
local real dx = this.x - this.prevX
local real dy = this.y - this.prevY
local real s = (dx*(x - this.prevX) + dy*(y - this.prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1 then
set s = 1.
endif
set dx = (this.prevX + s*dx) - x
set dy = (this.prevY + s*dy) - y
set ws = ws + ms
return dx*dx + dy*dy <= ws*ws
endmethod
private method isUnitInRect takes real x, real y returns boolean
local real dx = this.x - this.prevX
local real dy = this.y - this.prevY
local real s = (dx*(x - this.prevX) + dy*(y - this.prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1 then
set s = 1.
endif
return IsUnitInRangeXY(tempUnit, this.prevX + s*dx, this.prevY + s*dy, this.collision)
endmethod
static if Misssile_USE_COLLISION_Z_FILTER then
private method checkZCollision takes real z, real wz returns boolean
set z = z - this.terrainZ
return z + wz >= this.z - this.collision and z <= this.z + this.collision
endmethod
endif
private method isWidgetInCollision takes widget w, real ws, real wz, real ms returns boolean
local real x = GetWidgetX(w)
local real y = GetWidgetY(w)
static if Misssile_USE_COLLISION_Z_FILTER then
if circle then
return this.checkZCollision(GetLocZ(x, y), wz) and this.isWidgetInRange(x, y, ws, ms)
endif
return this.checkZCollision(GetLocZ(x, y), wz) and this.isWidgetInRect(x, y, ws, ms)
else
if circle then
return this.isWidgetInRange(x, y, ws, ms)
endif
return this.isWidgetInRect(x, y, ws, ms)
endif
endmethod
private method isUnitInCollision takes nothing returns boolean
static if Misssile_USE_COLLISION_Z_FILTER then
local real x = GetUnitX(tempUnit)
local real y = GetUnitY(tempUnit)
if circle then
return this.checkZCollision(GetUnitFlyHeight(tempUnit) + GetLocZ(x, y), GetUnitHeight(tempUnit)) and IsUnitInRangeXY(tempUnit, this.x, this.y, this.collision)
endif
return this.checkZCollision(GetUnitFlyHeight(tempUnit) + GetLocZ(x, y), GetUnitHeight(tempUnit)) and this.isUnitInRect(x, y)
else
if circle then
return IsUnitInRangeXY(tempUnit, this.x, this.y, this.collision)
endif
return this.isUnitInRect(GetUnitX(tempUnit), GetUnitY(tempUnit))
endif
endmethod
//
// Runs for every enumerated destructable.
// • Directly filters out already hit destructables.
// • Distance formula based on the Pythagorean theorem.
//
static method destFilter takes nothing returns boolean
if temp.allocated then
set tempDest = GetFilterDestructable()
if not temp.hasHitWidget(tempDest) and temp.isWidgetInCollision(tempDest, GetDestCollisionSize(tempDest), GetDestHeight(tempDest), temp.collision) then
// set table[temp].destructable[GetHandleId(tempDest)] = tempDest
call SaveDestructableHandle(HASH, temp, GetHandleId(tempDest), tempDest)
return true
endif
endif
return false
endmethod
/* static method destFilter takes nothing returns boolean
local destructable d = GetFilterDestructable()
local boolean b = false
if not HaveSavedHandle(HASH, temp, GetHandleId(d)) then
set b = temp.isWidgetInRange(d, GetDestructableHeight(d), temp.collision)
endif
set d = null
return b
endmethod */
//
// Runs for every enumerated item.
// • Directly filters out already hit items.
// • Distance formula based on the Pythagorean theorem.
// • Items have a fix collision size of 16.
//
static method itemFilter takes nothing returns boolean
if temp.allocated then
set tempItem = GetFilterItem()
if not temp.hasHitWidget(tempItem) and temp.isWidgetInCollision(tempItem, GetItemCollisionSize(tempItem), GetItemHeight(tempItem), RMaxBJ(temp.collision, 16.)) then
// set table[temp].item[GetHandleId(tempItem)] = tempItem
call SaveItemHandle(HASH, temp, GetHandleId(tempItem), tempItem)
return true
endif
endif
return false
endmethod
/*static method itemFilter takes nothing returns boolean
local item i = GetFilterItem()
local boolean b = false
if not HaveSavedHandle(HASH, temp, GetHandleId(i)) then // Item in missile collision size or item pathing in missile range.
set b = temp.isWidgetInRange(i, GetItemHeight(i), RMaxBJ(temp.collision, 16.))
endif
set i = null
return b
endmethod*/
//
// Runs for every enumerated units.
// • Filters out units which are not in collision range in plane x / y.
//
static method unitFilter takes nothing returns boolean
if temp.allocated then
set tempUnit = GetFilterUnit()
if not temp.hasHitWidget(tempUnit) and temp.isUnitInCollision() then
//set table[temp].unit[GetHandleId(tempUnit)] = tempUnit
call SaveUnitHandle(HASH, temp, GetHandleId(tempUnit), tempUnit)
return true
endif
endif
return false
endmethod
/* static method unitFilter takes nothing returns boolean
local thistype this = thistype.temp
local unit u = GetFilterUnit()
local real dx
local real dy
local real s
local boolean is = false
if not HaveSavedHandle(HASH, this, GetHandleId(u)) then
set dx = x - prevX
set dy = y - prevY
set s = (dx*(GetUnitX(u) - prevX) + dy*(GetUnitY(u)- prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1. then
set s = 1.
endif
set is = IsUnitInRangeXY(u, prevX + s*dx, prevY + s*dy, collision)
endif
set u = null
return is
endmethod*/
/*
* Proper rect preparation.
*/
private method prepareRectRectangle takes nothing returns nothing
local real x1 = RMinBJ(this.prevX, this.x)
local real y1 = RMinBJ(this.prevY, this.y)
local real d = this.collision + Misssile_MAXIMUM_COLLISION_SIZE
call SetRect(RECT, x1 - d, y1 - d, this.prevX + this.x - x1 + d, this.prevY + this.y - y1 + d)
endmethod
private method prepareRect takes nothing returns nothing
local real d = this.collision + Misssile_MAXIMUM_COLLISION_SIZE
set circle = this.collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call SetRect(RECT, this.x - d, this.y - d, this.x + d, this.y + d)
else
call this.prepareRectRectangle()
endif
set thistype.temp = this
endmethod
/*
* 5.) API for the MisssileStruct iteration.
*/
method checkUnitCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
set thistype.temp = this
set circle = this.collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call GroupEnumUnitsInRange(GROUP, this.x, this.y, this.collision + Misssile_MAXIMUM_COLLISION_SIZE, Filter(filter))
else
call this.prepareRectRectangle()
call GroupEnumUnitsInRect(GROUP, RECT, Filter(filter))
endif
endif
endmethod
method checkDestCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
call this.prepareRect()
call EnumDestructablesInRect(RECT, Filter(filter), null)
endif
endmethod
method checkItemCollision takes code filter returns nothing
if this.allocated and this.collision > 0. then
call this.prepareRect()
call EnumItemsInRect(RECT, Filter(filter), null)
endif
endmethod
private static method onScopeInit takes nothing returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError((Misssile_MAXIMUM_COLLISION_SIZE < 0), "Misssile", "DEBUG_MISSILE", "collision", 0, "Global setup for public real MAXIMUM_COLLISION_SIZE is incorrect, below zero! This map currently can't use Misssile!")
endif
call TriggerAddCondition(MOVE, Condition(function thistype.move))
endmethod
implement Init
endstruct
// Boolean expressions per struct:
// ===============================
//
// Condition function for the core trigger evaluation. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateExpression takes integer structId, code func returns nothing
set expression[structId] = Condition(func)
endfunction
// Creates a collection for a struct. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateCollection takes integer structId returns nothing
local Misssile node = Node.allocate()
call Misssile.makeHead(node) // Make a circular list
set missileList[structId] = node
endfunction
// Core:
// =====
//
// Fires every Misssile_TIMER_TIMEOUT.
private function Fire takes nothing returns nothing
local integer i = 0
// Move all launched missiles.
set Misssile.temp = MisssileList.front
loop
exitwhen TriggerEvaluate(MOVE)
exitwhen i == 60// Moved over 8910 missiles, something buggy happened.
set i = i + 1 // This case is impossible, hence never happens. But if I'm wrong, which also never happens
endloop // then the map 100% crashes. i == 66 will prevent the game crash and Misssile will start to
// to debug itself over the next iterations.
// Access all structs using module MisssileStruct.
static if DEBUG_MODE and LIBRARY_ErrorMesssage then
if not TriggerEvaluate(CORE) then
call ThrowWarning(true, "Misssile", "Fire", "op limit", 0, /*
*/"You just ran into a op limit!
The op limit protection of Misssile is insufficient for your map.
The code of the missile module can't run in one thread and must be splitted.
If unsure make a post in the official 'The Hive Workshop' forum thread of Misssile!")
endif
else
call TriggerEvaluate(CORE)
endif
endfunction
// Conditionally starts the timer.
private function StartPeriodic takes integer structId returns nothing
if 0 == instances[structId] then
if 0 == active then
call TimerStart(TMR, Misssile_TIMER_TIMEOUT, true, function Fire)
endif
set active = active + 1
set condition[structId] = TriggerAddCondition(CORE, expression[structId])
endif
set instances[structId] = instances[structId] + 1
endfunction
// Conditionally stops the timer in the next callback.
private function StopPeriodic takes integer structId returns nothing
if condition[structId] != null then
set instances[structId] = instances[structId] - 1
if 0 == instances[structId] then
call TriggerRemoveCondition(CORE, condition[structId])
set condition[structId] = null
set active = active - 1
if 0 == active then
call PauseTimer(TMR)
endif
endif
endif
endfunction
// Modules:
// ========
//
// You want to place module MisssileLaunch at the very top of your struct.
module MisssileLaunch
static method launch takes Misssile missile returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(missile.launched, "thistype", "launch", "missile.launched", missile, "This missile was already launched before!")
endif
debug set missile.launched = true
call missileList[thistype.typeid].pushBack(missile)
call StartPeriodic(thistype.typeid)
endmethod
endmodule
module MisssileTerminate
// Called from missileIterate. "P" to avoid code collision.
static method missileTerminateP takes Misssile node returns nothing
if node.allocated then
static if thistype.onRemove.exists then
call thistype.onRemove(node)
endif
call node.terminate()
call StopPeriodic(thistype.typeid)
endif
endmethod
endmodule
// Allows you to inject missile in certain stages of the motion process.
module MisssileAction
static if thistype.onCollide.exists then
private static method missileActionUnit takes nothing returns nothing
if Misssile.unitFilter() and thistype.onCollide(Misssile.temp, tempUnit) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
static if thistype.onItem.exists then
private static method missileActionItem takes nothing returns nothing
if Misssile.itemFilter() and thistype.onItem(Misssile.temp, tempItem) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
static if thistype.onDestructable.exists then
private static method missileActionDest takes nothing returns nothing
if Misssile.destFilter() and thistype.onDestructable(Misssile.temp, tempDest) then
call missileTerminateP(Misssile.temp)
endif
endmethod
endif
// Runs every Misssile_TIMER_TIMEOUT for this struct.
static method missileIterateP takes nothing returns boolean
local Misssile node = missileList[thistype.typeid].front
loop
exitwhen node == missileList[thistype.typeid]
if node.wantDestroy then
call missileTerminateP(node)
else
if node.stackSize > 0 then
call node.updateStack()
endif
// Runs unit collision.
static if thistype.onCollide.exists then
call node.checkUnitCollision(function thistype.missileActionUnit)
endif
// Runs destructable collision.
static if thistype.onDestructable.exists then
call node.checkDestCollision(function thistype.missileActionDest)
endif
// Runs item collision.
static if thistype.onItem.exists then
call node.checkItemCollision(function thistype.missileActionItem)
endif
// Runs when the destination is reached.
if node.recycle and node.allocated then
static if thistype.onFinish.exists then
if thistype.onFinish(node) then
call missileTerminateP(node)
endif
else
call missileTerminateP(node)
endif
endif
// Runs on terrain collision.
static if thistype.onTerrain.exists then
if node.allocated and 0. > node.z and thistype.onTerrain(node) then
call missileTerminateP(node)
endif
endif
// Runs every Misssile_TIMER_TIMEOUT.
static if thistype.onPeriod.exists then
if node.allocated and thistype.onPeriod(node) then
call missileTerminateP(node)
endif
endif
endif
set node = node.next
endloop
static if DEBUG_MODE and LIBRARY_ErrorMessage then
return true
else
return false
endif
endmethod
endmodule
module MisssileStruct
implement MisssileLaunch
implement MisssileTerminate
implement MisssileAction
private static method onInit takes nothing returns nothing
call MisssileCreateCollection(thistype.typeid)
call MisssileCreateExpression(thistype.typeid, function thistype.missileIterateP)
endmethod
endmodule
private module Init
private static method onInit takes nothing returns nothing
call Misssile.onScopeInit()
endmethod
endmodule
// The end!
endlibrary
library Misssile /* version 2.5.1
*************************************************************************************
*
* Creating custom projectiles in Warcraft III.
*
* Major goal:
* No unessary external requirements.
* Implements code optional.
*
* Philosophy:
* I want that feature --> Compiler writes that code into your map script.
* I don't want that --> Compiler ignores that code completly.
*
* Important:
* Take yourself 2 minutes time to setup Misssile correctly.
* Otherwise I can't guarantee, that Misssile works the way you want.
* Once the setup is done, you can check out some examples and Misssile will be easy
* to use for everyone. I promise it.
*
* Do the setup at:
*
* 1.) Import instruction
* 2.) Global configuration
* 3.) Function configuration
*
* Credits to Dirac, emjlr3, AceHart, Bribe, Wietlol,
* Nestharus, Maghteridon96, Vexorian and Zwiebelchen.
*
*************************************************************************************
*
* */ requires /*
*
* - Misssile requires nothing.
*
*************************************************************************************
*
* Optional requirements listed can reduce overall code generation,
* add safety mechanisms, decrease overhead and optimize handle management.
* For a better overview I put them into blocks.
*
* I recommend to use at least one per block in your map.
*
* a) For best debug results: ( Useful )
* */ optional ErrorMessage /* github.com/nestharus/JASS/tree/master/jass/Systems/ErrorMessage
*
* b) Fatal error protection: ( Case: unit out moves of world bounds )
* - WorldBounds is safer than BoundSentinel.
* - WorldBounds adds more overhead than BoundSentinel.
* - Using none of these two forces Misssile to switch from SetUnitX/Y to the SetUnitPosition native.
* */ optional WorldBounds /* githubusercontent.com/nestharus/JASS/master/jass/Systems/WorldBounds/script.j
* */ optional BoundSentinel /* wc3c.net/showthread.php?t=102576
*
* c) Handle recycling: ( Performace gain, memory management )
* - uses MisssileRecylcer > Dummy > xedummy.
* */ optional MisssileRecycler /* hiveworkshop.com/forums/jass-resources-412/system-missilerecycler-206086/
* */ optional Dummy /* github.com/nestharus/JASS/blob/master/jass/Systems/Dummy/Dummy.w3x
* */ optional xedummy /* wc3c.net/showthread.php?t=101150
*
* d) Unit indexing: ( Avoid an onIndex event )
* - not required for Misssile. Only if you use one already.
* */ optional UnitIndexer /* github.com/nestharus/JASS/tree/master/jass/Systems/Unit%20Indexer
*
************************************************************************************
*
* 1. Import instruction
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* • Copy Misssile into to your map.
* • You need a dummy unit, using Vexorians "dummy.mdx".
* This unit must use the locust and crow form ability. ( Aloc & Amrf )
* ¯¯¯¯
*
* 2. Global configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Seven constants to setup!
*/
globals
/**
* Misssiles are moved periodically. An interval of 1./32. is recommended.
* • Too short timeout intervals may cause performance issues.
* • Too large timeout intervals may look fishy.
*/
public constant real TIMER_TIMEOUT = 1./32.
/**
* Owner of all Misssile dummies. Should be a neutral player in your map.
*/
public constant player NEUTRAL_PASSIVE = Player(15)
/**
* Raw code of the dummy unit. Object Editor ( F6 )
* • Must be correct, otherwise missile dummies can neither be recycled nor destroyed.
* • Units of other type ids will not be thrown into the recycler bin.
*/
public constant integer DUMMY_UNIT_ID = 'e022'
/**
* The maximum collision size used in your map. If unsure use 197. ( Town hall collision )
* • Applies for all types of widgets.
* • A precise value can improve Misssile's performance,
* since smaller values enumerate less widgtes per loop per missile.
*/
public constant real MAXIMUM_COLLISION_SIZE = 250.
/**
* Collision types for missiles. ( Documentation only )
* Misssile decides internally each loop which type of collision is required.
* • Uses circular collision dectection for speed < collision. ( Good accuracy, best performance )
* • Uses rectangle collision for speed >= collision. ( Best accuracy, normal performance )
*/
public constant integer COLLISION_TYPE_CIRCLE = 0
public constant integer COLLISION_TYPE_RECTANGLE = 1
/**
* Determine when rectangle collision is required to detect nearby widgets.
* • The smaller the factor the earlier rectangle collision is used. ( by default 1. )
* • Formula: speed >= collision*Misssile_COLLISION_ACCURACY_FACTOR
*/
public constant real COLLISION_ACCURACY_FACTOR = 1.
// Optional toogles:
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// Set booleans listed below to "true" and the compiler will write
// the feature into your map. Otherwise this code is completly ignored.
// • Yay, I want that --> "true"
// • Naah that's useless for me --> "false"
/**
* USE_COLLISION_Z_FILTER enables z axis checks for widget collision. ( Adds minimal overhead )
* Use it when you need:
* • Misssiles flying over or under widgets.
* • Determine between flying and walking units.
*/
public constant boolean USE_COLLISION_Z_FILTER = true
/**
* WRITE_DELAYED_MISSILE_RECYCLING enables a delayed dummy recycling system. ( Very recommended )
* Use it if:
* • You use a dummy recycling library like MisssileRecycler, Dummy or xedummy.
* • You want to properly display death animations of effects added to missiles.
*/
public constant boolean WRITE_DELAYED_MISSILE_RECYCLING = true
/**
* DELAYED_MISSILE_DEATH_ANIMATION_TIME is the delay in seconds
* Misssile holds back a dummy, before recycling it.
* • The time value does not have to be precise.
* • Requires WRITE_DELAYED_MISSILE_RECYCLING = true
*/
private constant real DELAYED_MISSILE_DEATH_ANIMATION_TIME = 2.
/**
* USE_DESTRUCTABLE_FILTER and USE_ITEM_FILTER are redundant constants from previous Misssile versions.
* They do nothing, but remain for backwards compatibilty.
* From Misssile version 1.5 on all widget collisions are always enabled.
*/
public constant boolean USE_DESTRUCTABLE_FILTER = true
public constant boolean USE_ITEM_FILTER = true
endglobals
/*
* 3. Function configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Four functions to setup!
*/
/**
* GetUnitBodySize(unit) returns a fictional value for z - axis collision.
* You have two options:
* • One constant value shared over all units.
* • Dynamic values based on handle id, type id, unit user data, scaling or other parameters.
*/
function GetUnitBodySize takes unit whichUnit returns real
return 100.// Other example: return LoadReal(hash, GetHandleId(whichUnit), KEY_UNIT_BODY_SIZE)
endfunction
/**
* Same as GetUnitBodySize, but for destructables.
* Using occluder height is an idea of mine. Of course you can use your own values.
*/
function GetDestructableHeight takes destructable d returns real
return GetDestructableOccluderHeight(d)// Other example: return 100.
endfunction
/**
* Same as GetUnitBodySize, but for items.
* Again it's up to you to figure out a fictional item height.
*/
function GetItemHeight takes item i returns real
return 16.
endfunction
/**
* Unit indexers and missiles ( Only if you don't use a dummy recycling library )
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* It is most likely intended that projectiles don't run through a unit indexing process.
* ToogleUnitIndexer runs:
* • Directly before a dummy is created.
* • Directly after dummy unit creation.
*
* Please return the previous setup of your indexing tool ( enabled, disabled ),
* so Misssile can properly reset it to the original state.
*/
private function ToogleUnitIndexer takes boolean enable returns boolean
local boolean prev = false//UnitIndexer.enabled
// set UnitIndexer.enabled = enable
return prev
endfunction
/**
* 4. API
* ¯¯¯¯¯¯
*/
//! novjass ( Disables the compiler until the next endnovjass )
// Custom type Misssile for your projectile needs.
struct Misssile extends array
// Constants:
// ==========
//
readonly static constant string ORIGIN = "origin"
// • Attach point name for fxs on dummies.
readonly static constant real HIT_BOX = (2./3.)
// • Fictional hit box for homing missiles.
// while 0 would be the toe and 1 the head of a unit.
// Available creators:
// ===================
//
static method createEx takes unit missileDummy, real impactX, real impactY, real impactZ returns Misssile
// • Core creator method.
// • May launches any unit.
// • Units of type Misssile_DUMMY_UNIT_ID get recycled in the end.
static method create takes real x, real y, real z, real angleInRadians, real distanceToTravel, real endZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns Misssile
// • Converts arguments to fit into createEx, then calls createEx.
// Available destructors:
// ======================
//
return true
// • Core destructor.
// • Returning true in any of the interface methods of the MisssileStruct module
// will destroy that instance instantly.
method destroy takes nothing returns nothing
// • Destroys the missile during the next timer callback.
method terminate takes nothing returns nothing
// • Destroys the missile instantly.
// Fields you can set and read directly:
// =====================================
//
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner remains PLAYER_NEUTRAL_PASSIVE.
real speed // Vector lenght for missile movement in plane x / y. ( DOES NOT TAKE THE TIMER TIMEOUT IN ACCOUNT )
real acceleration
real damage
real turn // Set a turn rate for missiles.
integer data // For data transfer set and read data.
boolean recycle // Is automatically set to true, when a Misssile reaches it's destination.
boolean wantDestroy // Set wantDestroy to true, to destroy a missile during the next timer callback.
// Neither collision nor collisionZ accept values below zero.
real collision // Collision size in plane x / y.
real collisionZ // Collision size in z - axis. ( deprecated )
// Fields you can only read:
// =========================
//
readonly boolean allocated
readonly unit dummy// The dummy unit of this missile.
// Position members for you needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and the pitch angle "alpha".
// Furthermore method origin.move(x, y, z) and impact.move(x, y, z).
readonly real terrainZ
readonly real x
readonly real y
readonly real z
readonly real angle// Current angle in radians.
// Method operators for set and read:
// ==================================
//
method operator model= takes string modelFile returns nothing
method operator model takes nothing returns string
// • Adds an effect handle on a missile dummy to it's "origin".
// • You can read the file path.
// • For multiple effects access "this.dummy" in your struct.
method operator scale= takes real value returns nothing
method operator scale takes nothing returns real
// • Set and read the scaling of the dummy unit.
method operator curve= takes real value returns nothing
method operator curve takes nothing returns real
// • Enables curved movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
method operator arc= takes real value returns nothing
method operator arc takes nothing returns real
// • Enables arcing movement for your missile. ( Pass in radians, NOT degrees )
// • Do not pass in PI/2.
// Methods for missile movement:
// =============================
//
method bounce takes nothing returns nothing
// • Moves the MisssilePosition "origin" to the current missile coordinates.
// • Resets the distance traveled to 0.
method deflect takes real tx, real ty returns nothing
// • Deflect the missile towards tx, ty. Then calls bounce.
method deflectEx takes real tx, real ty, real tz returns nothing
// • Deflect the missile towards tx, ty, tz. Then calls bounce.
method flightTime2Speed takes real duration returns nothing
// • Converts a fly time to a vector lenght for member "speed".
// • Does not take acceleration into account. ( Disclaimer )
method setMovementSpeed takes real value returns nothing
// • Converts Warcraft III movement speed to a vector lenght for member "speed".
// Methods for missile collision: ( all are hashtable entries )
// ==============================
// By default a widget can only be hit once per missile.
//
method hitWidget takes widget w returns nothing
// • Saves a widget in the memory as hit by this instance.
method hasHitWidget takes widget w returns boolean
// • Returns true, if "w" has been hit by this instance.
method removeHitWidget takes widget w returns nothing
// • Removes a widget from this missile's memory for widget collision. ( Can hit "w" again )
method flushHitWidgets takes nothing returns nothing
// • Flushes a missile's memory for widget collision. ( All widgets can be hit again )
method enableHitAfter takes widget w, real seconds returns nothing
// • Automatically calls removeHitWidget(w) after "seconds" time. ( Can hit "w" again after given time )
// Module MisssileStruct:
// =====================
//
module MisssileLaunch // ( optional )
module MisssileStruct
// • Enables the entire missile interface for that struct.
// Interface in structs: ( Must implement module MisssileStruct )
// =====================
//
// • Write one, many or all of the static method below into your struct.
// • Misssiles launched in this struct will run those methods, when their events fire.
//
// • All of those static methods must return a boolean.
// a) return true --> destroys the missile instance instantly.
// b) return false --> keep on flying.
// Available static method:
// ========================
//
static method onCollide takes Misssile missile, unit hit returns boolean
// • Runs for units in collision range of a missile.
static method onDestructable takes Misssile missile, destructable hit returns boolean
// • Runs for destructables in collision range of a missile.
static method onItem takes Misssile missile, item hit returns boolean
// • Runs for items in collision range of a missile.
static method onTerrain takes Misssile missile returns boolean
// • Runs when a missile collides with the terrain. ( Ground and cliffs )
static method onFinish takes Misssile missile returns boolean
// • Runs only when a missile reaches it's destination.
// • However does not run, if a Misssile is destroyed in another method.
static method onPeriod takes Misssile missile returns boolean
// • Runs every Misssile_TIMER_TIMEOUT seconds.
static method onRemove takes Misssile missile returns boolean
// • Runs when a missile is destroyed.
// • Unlike onFinish, onRemove will runs ALWAYS when a missile is destroyed!!!
//
// For onRemove the returned boolean has a unique meaning:
// • Return true will recycle this missile delayed. ( Only if WRITE_DELAYED_MISSILE_RECYCLING = true )
// • Return false will recycle this missile right away.
static method launch takes Misssile toLaunch returns nothing
// • Well ... Launches this Misssile.
// • Misssile "toLaunch" will behave as declared in the struct. ( static methods from above )
// Misc: ( From the global setup )
// =====
//
// Constants:
// ==========
//
public constant real TIMER_TIMEOUT
public constant player NEUTRAL_PASSIVE
public constant integer DUMMY_UNIT_ID
public constant real MAXIMUM_COLLISION_SIZE
public constant boolean USE_COLLISION_Z_FILTER
public constant boolean WRITE_DELAYED_MISSILE_RECYCLING
public constant boolean USE_DESTRUCTABLE_FILTER
public constant boolean USE_ITEM_FILTER
readonly static constant string ORIGIN
readonly static constant real HIT_BOX
// Functions:
// ==========
//
public function GetLocZ takes real x, real y returns real
function GetUnitBodySize takes unit whichUnit returns real
function GetDestructableHeight takes destructable d returns real
function GetItemHeight takes item i returns real
//========================================================================
// Misssile system. Make changes carefully.
//========================================================================
//! endnovjass ( Enables the compiler )
// Hello and welcome to Misssile.
// I wrote a guideline for every piece of code inside Misssile, so you
// can easily understand how the it gets compiled and evaluated.
//
// Let's go!
globals
// Core constant handle variables of Misssile.
private constant trigger CORE = CreateTrigger()
private constant trigger MOVE = CreateTrigger()
private constant timer TMR = CreateTimer()
private constant location LOC = Location(0., 0.)
private constant rect RECT = Rect(0., 0., 0., 0.)
private constant group GROUP = CreateGroup()
private constant hashtable HASH = InitHashtable()
// For starting and stopping the timer.
private integer active = 0
// Arrays for data structure.
private integer array instances
private Misssile array missileList
private boolexpr array expression
private triggercondition array condition
private integer array remove
private boolean array destroying
private boolean array recycling
private integer array nextNode
private integer array prevNode
// Internal widget filter functions.
private boolexpr destFilter
private boolexpr itemFilter
private boolexpr unitFilter
endglobals
public function GetLocZ takes real x, real y returns real
call MoveLocation(LOC, x, y)
return GetLocationZ(LOC)
endfunction
// For WRITE_DELAYED_MISSILE_RECYCLING = true Misssile will hold back
// dummies for DELAYED_MISSILE_DEATH_ANIMATION_TIME before they are recylced. ( Code placed in a static if )
//
//! runtextmacro optional WRITE_MISSILE_RECYCLE_BIN("WRITE_DELAYED_MISSILE_RECYCLING", "DELAYED_MISSILE_DEATH_ANIMATION_TIME")
// The code of WRITE_MISSILE_POSITION_CODE boxes a missiles position and does the required trigonometry.
//
//! runtextmacro WRITE_MISSILE_POSITION_CODE()
// Misssiles structure works like a linked list with the folling methods:
// allocateCollection(), allocateNode(), insertFront(node) and remove()
//
private keyword MisssileStructure
struct Misssile extends array
implement MisssileStructure
// Constants:
// ==========
//
// Attach point name for effects created by model=.
readonly static constant string ORIGIN = "origin"
// Set a ficitional hit box in range of 0 to 1,
// while 0 is the toe and 1 the head of a unit.
readonly static constant real HIT_BOX = (2./3.)
// DEBUG_MODE only members:
// ========================
//
// Checks for double launching. Throws an error message.
debug boolean launched
// Private members:
// ================
//
// The position of a missile using curve= does not
// match the position used by Misssile's trigonometry.
// Therefore we need this member two times.
// Readable x / y / z for your needs and posX / posY for cool mathematics.
private real posX
private real posY
private real dist// distance
// Readonly members:
// =================
//
// Prevents a double free case.
readonly boolean allocated
// The dummy unit.
readonly unit dummy
// Position members for your needs.
readonly MisssilePosition origin// Grants access to readonly members of MisssilePosition,
readonly MisssilePosition impact// which are "x", "y", "z", "angle", "distance", "slope" and "alpha".
readonly real terrainZ
readonly real x
readonly real y
readonly real z
readonly real angle// Current angle
readonly real prevX
readonly real prevY
readonly real prevZ
// Collision detection type. ( Evaluated new in each loop )
readonly integer collisionType// Current collision type ( circular or rectangle )
// Members you can set:
// ====================
//
unit source
unit target // For homing missiles.
real distance // Distance traveled.
player owner // Pseudo owner for faster onCollide evaluation. The proper dummy owner is PLAYER_NEUTRAL_PASSIVE.
real speed // Vector lenght for missile movement in plane x / y.
real acceleration
real damage
integer data // For data transfer set and read data.
boolean recycle // Is set to true, when a Misssile reaches it's destination.
real turn // Sets a turn rate for a missile.
real collision // Collision size in plane x / y.
// Setting collision z is deprecated since Misssile v2.5.
method operator collisionZ= takes real value returns nothing
endmethod
method operator collisionZ takes nothing returns real
return collision
endmethod
// Operator overloading:
// =====================
//
// Special effect on the missile dummy. For multiple effect attaching, access unit "dummy" directly.
private effect sfx
private string path
method operator model= takes string file returns nothing
if sfx != null then
call DestroyEffect(sfx)
set sfx = null
endif
// null and ""
if StringLength(file) > 0 then
set sfx = AddSpecialEffectTarget(file, dummy, ORIGIN)
set path = file
else
set path = null
endif
endmethod
method operator model takes nothing returns string
return path
endmethod
real open
// Enables curved movement for your missile.
// Remember that the result of Tan(PI/2) is infinity.
method operator curve= takes real value returns nothing
set open = Tan(value)*origin.distance
endmethod
method operator curve takes nothing returns real
return Atan(open/origin.distance)
endmethod
real height
// Enables arcing movement for your missile.
method operator arc= takes real value returns nothing
set height = Tan(value)*origin.distance/4
endmethod
method operator arc takes nothing returns real
return Atan(4*height/origin.distance)
endmethod
private real scaling
method operator scale= takes real value returns nothing
call SetUnitScale(dummy, value, 0., 0.)
set scaling = value
endmethod
method operator scale takes nothing returns real
return scaling
endmethod
// Methods:
// ========
//
method bounce takes nothing returns nothing
call origin.move(x, y, z)
set dist = 0.
endmethod
method deflect takes real tx, real ty returns nothing
local real a = 2.*Atan2(ty - y, tx - x) + bj_PI - angle
call impact.move(x + (origin.distance - dist)*Cos(a), y + (origin.distance - dist)*Sin(a), impact.z)
call bounce()
endmethod
method deflectEx takes real tx, real ty, real tz returns nothing
call impact.move(impact.x, impact.y, tz)
call deflect(tx, ty)
endmethod
method flightTime2Speed takes real duration returns nothing
set speed = RMaxBJ(0.00000001, (origin.distance - dist)*Misssile_TIMER_TIMEOUT/RMaxBJ(0.00000001, duration))
endmethod
method setMovementSpeed takes real value returns nothing
set speed = value*Misssile_TIMER_TIMEOUT
endmethod
boolean wantDestroy// For "true" a missile is destroyed on the next timer callback. 100% safe.
method destroy takes nothing returns nothing
set wantDestroy = true
endmethod
// Instantly destroys a missile.
method terminate takes nothing returns nothing
if allocated then
call remove()
call impact.destroy()
call origin.destroy()
call DestroyEffect(sfx)
call FlushChildHashtable(HASH, this)
if GetUnitTypeId(dummy) == Misssile_DUMMY_UNIT_ID then
// MisssileRecycler > Dummy > xe.
static if LIBRARY_MisssileRecycler then
call RecycleMisssile(dummy)
elseif LIBRARY_Dummy and Dummy.create.exists then
call Dummy[dummy].destroy()
elseif LIBRARY_xedummy and xedummy.release.exists then
call xedummy.release(dummy)
else
call RemoveUnit(dummy)
endif
endif
set sfx = null
set source = null
set target = null
set dummy = null
set owner = null
endif
endmethod
// Runs in createEx.
//! textmacro MISSILE_RESET_ALL_MEMBERS
set path = null
set speed = 0.
set acceleration = 0.
set distance = 0.
set dist = 0
set dist = 0.
set height = 0.
set turn = 0.
set open = 0.
set collision = 0.
set collisionType = 0
set stackSize = 0
set scaling = 1.
set wantDestroy = false
set recycle = false
//! endtextmacro
// Launches a dummy of your choice.
static method createEx takes unit missileDummy, real impactX, real impactY, real impactZ returns thistype
local thistype this = thistype.allocateNode()
local real originX = GetUnitX(missileDummy)
local real originY = GetUnitY(missileDummy)
local real originZ = GetUnitFlyHeight(missileDummy)
//
//! runtextmacro MISSILE_RESET_ALL_MEMBERS()
//
set origin = MisssilePosition.create(originX, originY, originZ)
set impact = MisssilePosition.create(impactX, impactY, impactZ)
call MisssilePosition.link(origin, impact)
set posX = originX
set posY = originY
set x = originX
set y = originY
set z = originZ
set angle = origin.angle
set dummy = missileDummy
call SetUnitFlyHeight(missileDummy, originZ, 0.)
call SaveUnitHandle(HASH, this, GetHandleId(missileDummy), missileDummy)
//
static if LIBRARY_ErrorMessage then
debug call ThrowWarning(GetUnitTypeId(missileDummy) == 0, "Misssile", "createEx", "missileDummy", this, "Invalid missile dummy unit ( null )!")
endif
debug set launched = false
return this
endmethod
// Freaky static if ensures these libraries really don't exist.
static if not LIBRARY_MisssileRecycler and not LIBRARY_Dummy and not Dummy.create.exists and not LIBRARY_xe_dummy and not xe_dummy.new.exists then
private static method newMisssileUnit takes real x, real y, real z, real face returns unit
local boolean prev = ToogleUnitIndexer(false)
set bj_lastCreatedUnit = CreateUnit(Misssile_NEUTRAL_PASSIVE, Misssile_DUMMY_UNIT_ID , x, y, face)
call ToogleUnitIndexer(prev)
call SetUnitX(bj_lastCreatedUnit, x)
call SetUnitY(bj_lastCreatedUnit, y)
call UnitAddAbility(bj_lastCreatedUnit, 'Amrf')
call SetUnitFlyHeight(bj_lastCreatedUnit, z, 0.)
call PauseUnit(bj_lastCreatedUnit, true)
return bj_lastCreatedUnit
endmethod
endif
// MisssileRecylcer > Dummy > xe > Misssile.
//! textmacro MISSILE_GET_DUMMY_FROM_LIBRARY
static if LIBRARY_MisssileRecycler then
return createEx(GetRecycledMisssile(x, y, z, angle*bj_RADTODEG), impactX, impactY, impactZ)
elseif LIBRARY_Dummy and Dummy.create.exists then
local Dummy dummy = Dummy.create(x, y, angle*bj_RADTODEG)
call SetUnitFlyHeight(dummy.unit, z, 0.)
return createEx(dummy.unit, impactX, impactY, impactZ)
elseif LIBRARY_xedummy and xedummy.new.exists then
set bj_lastCreatedUnit = xedummy.new(Misssile_NEUTRAL_PASSIVE, x, y, angle*bj_RADTODEG)
call SetUnitFlyHeight(bj_lastCreatedUnit, z, 0.)
return createEx(bj_lastCreatedUnit, impactX, impactY, impactZ)
else
return createEx(Misssile.newMisssileUnit(x, y, z, angle*bj_RADTODEG), impactX, impactY, impactZ)
endif
//! endtextmacro
// Wrapper to createEx.
static method create takes real x, real y, real z, real angle, real distance, real impactZ returns thistype
local real impactX = x + distance*Cos(angle)
local real impactY = y + distance*Sin(angle)
// Get the dummy unit.
//! runtextmacro MISSILE_GET_DUMMY_FROM_LIBRARY()
endmethod
// Wrapper to createEx.
static method createXYZ takes real x, real y, real z, real impactX, real impactY, real impactZ returns thistype
local real angle = Atan2(impactY - y, impactX - x)
// Get the dummy unit.
//! runtextmacro MISSILE_GET_DUMMY_FROM_LIBRARY()
endmethod
// Misssile motion takes place every Misssile_TIMER_TIMEOUT
// before accessing each active struct.
static Misssile temp = 0
static method move takes nothing returns boolean
local integer loops = 0 // Current iteration.
local integer limit = 150 // Set iteration border per trigger evaluation to avoid hitting the operation limit.
local thistype this = thistype.temp
local MisssilePosition p
local real a
local real d
local unit u
local real newX
local real newY
local real vel
local real point
local real pitch
loop
exitwhen 0 == this or loops == limit
set p = origin
// Save previous, respectively current missile position.
set prevX = x
set prevY = y
set prevZ = z
// Evaluate the collision type.
set vel = speed
set speed = vel + acceleration
if vel < collision*Misssile_COLLISION_ACCURACY_FACTOR then
set collisionType = Misssile_COLLISION_TYPE_CIRCLE
else
set collisionType = Misssile_COLLISION_TYPE_RECTANGLE
endif
// Update missile guidance to its intended target.
set u = target
if u != null then
if 0 == GetUnitTypeId(u) then
set target = null
else
call origin.move(x, y, z)
call impact.move(GetUnitX(u), GetUnitY(u), GetUnitFlyHeight(u) + GetUnitBodySize(u)*Misssile.HIT_BOX)
set dist = 0
set height = 0
set curve = 0
endif
endif
set a = p.angle
// Update the missile facing angle depending on the turn ratio.
if 0. != turn and Cos(angle - a) < Cos(turn) then
if 0. > Sin(a - angle) then
set angle = angle - turn
else
set angle = angle + turn
endif
else
set angle = a
endif
// Update the missile position on the parabola.
set d = p.distance// origin - impact distance.
set recycle = dist + vel >= d
if recycle then// Maximum distance reached.
set point = d
set distance = distance + d - dist
else
set distance = distance + vel
set point = dist + vel
endif
set dist = point
set newX = posX + vel*Cos(angle)
set newY = posY + vel*Sin(angle)
set posX = newX
set posY = newY
// Update point(x/y) if a curving trajectory is defined.
set u = dummy
if 0. != open and target == null then
set vel = 4*open*point*(d - point)/p.square
set a = angle + bj_PI/2
set newX = newX + vel*Cos(a)
set newY = newY + vel*Sin(a)
set a = angle + Atan(-((4*open)*(2*point - d))/p.square)
else
set a = angle
endif
set x = newX
set y = newY
// Update pos z if an arc or height is set.
call MoveLocation(LOC, newX, newY)
set terrainZ = GetLocationZ(LOC)
set pitch = p.alpha
if 0. == height and 0. == pitch then
set z = p.z - terrainZ
else
set z = p.z - terrainZ + p.slope*point
if 0. != height and target == null then
set z = z + (4*height*point*(d - point)/p.square)
set pitch = pitch - Atan(((4*height)*(2*point - d))/p.square)*bj_RADTODEG
endif
endif
// Update the pitch angle of the dummy unit.
if GetUnitTypeId(u) == Misssile_DUMMY_UNIT_ID then
call SetUnitAnimationByIndex(u, R2I(pitch + 90.5))
endif
// Move the missile dummy via native.
call SetUnitFlyHeight(u, z, 0.)
call SetUnitFacing(u, a*bj_RADTODEG)
// WorldBounds > BoundSentinel.
static if not LIBRARY_BoundSentinel and not LIBRARY_WorldBounds then
if RectContainsCoords(bj_mapInitialPlayableArea, newX, newY) then
call SetUnitX(u, newX)
call SetUnitY(u, newY)
endif
elseif LIBRARY_WorldBounds then
if newX < WorldBounds.maxX and newX > WorldBounds.minX and newY < WorldBounds.maxY and newY > WorldBounds.minY then
call SetUnitX(u, newX)
call SetUnitY(u, newY)
endif
else
call SetUnitX(u, newX)
call SetUnitY(u, newY)
endif
set loops = loops + 1
set this = nextNode[this]
endloop
set u = null
set thistype.temp = this
return this == 0
endmethod
// Widget collision API:
// =====================
//
// Runs automatically on widget collision.
method hitWidget takes widget w returns nothing
if w != null then
call SaveWidgetHandle(HASH, this, GetHandleId(w), w)
endif
endmethod
// All widget which have been hit return true.
method hasHitWidget takes widget w returns boolean
return HaveSavedHandle(HASH, this, GetHandleId(w))
endmethod
// Removes a widget from the missile's memory of hit widgets. ( This widget can be hit again )
method removeHitWidget takes widget w returns nothing
if w != null then
call RemoveSavedHandle(HASH, this, GetHandleId(w))
endif
endmethod
// Flushes a missile's memory for collision. ( All widgets can be hit again )
method flushHitWidgets takes nothing returns nothing
call FlushChildHashtable(HASH, this)
call hitWidget(dummy)
endmethod
// Tells missile to call removeHitWidget(w) after "seconds" time.
// Does not apply to widgets, which are already hit by this missile.
readonly integer stackSize
method enableHitAfter takes widget w, real seconds returns nothing
local integer id = GetHandleId(w)
if w != null then
if not HaveSavedInteger(HASH, this, id) then
call SaveInteger(HASH, this, id, stackSize)
call SaveInteger(HASH, this, stackSize, id)
set stackSize = stackSize + 1
endif
call SaveReal(HASH, this, id, seconds)// Set time.
endif
endmethod
method updateStack takes nothing returns nothing
local integer dex = 0
local integer id
local real time
loop
exitwhen dex == stackSize
set id = LoadInteger(HASH, this, dex)
set time = LoadReal(HASH, this, id) - Misssile_TIMER_TIMEOUT
if time <= 0. or not HaveSavedHandle(HASH, this, id) then
set stackSize = stackSize - 1
set id = LoadInteger(HASH, this, stackSize)
call SaveInteger(HASH, this, dex, id)
call SaveInteger(HASH, this, id, dex)
// Enables hit.
call RemoveSavedHandle(HASH, this, id)
// Remove data from stack.
call RemoveSavedReal(HASH, this, id)
call RemoveSavedInteger(HASH, this, id)
call RemoveSavedInteger(HASH, this, stackSize)
else
call SaveReal(HASH, this, id, time)
set dex = dex + 1
endif
endloop
endmethod
// Widget collision code:
// ======================
//
private static boolean circle = true
//
// 1.) Rectangle collision for fast moving missiles with small collision radius.
//
// Runs for destructables and items in a rectangle.
// Checks if widget w is in collision range of a missile.
// Is not precise in z - axis collision.
private method isWidgetInRectangle takes widget w, real wz, real distance returns boolean
local real wx = GetWidgetX(w)
local real wy = GetWidgetY(w)
local real dz = Misssile_GetLocZ(wx, wy) - terrainZ
local real dx = x - prevX
local real dy = y - prevY
local real s = (dx*(wx - prevX) + dy*(wy - prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1 then
set s = 1.
endif
set dx = (prevX + s*dx) - wx
set dy = (prevY + s*dy) - wy
return dx*dx + dy*dy <= distance*distance and dz + wz >= z - distance and dz <= z + distance
endmethod
//
// 2.) Circular collision detection for all other missiles.
//
// Returns true for widgets in a xyz collision range.
private method isWidgetInRange takes widget w, real wz, real distance returns boolean
local real wx = GetWidgetX(w)
local real wy = GetWidgetY(w)
local real dz = Misssile_GetLocZ(wx, wy) - terrainZ
// collision in plane x and y, collision in z axis.
return IsUnitInRangeXY(dummy, wx, wy, distance) and dz + wz >= z - distance and dz <= z + distance
endmethod
//
// 3.) Action functions inside the widget enumeration thread.
//
// Runs for every enumerated destructable.
// • Directly filters out already hit destructables.
// • Distance formula based on the Pythagorean theorem.
//
private static method filterDests takes nothing returns boolean
local destructable d = GetFilterDestructable()
local boolean b = false
if not HaveSavedHandle(HASH, temp, GetHandleId(d)) then
if circle then
set b = temp.isWidgetInRange(d, GetDestructableHeight(d), temp.collision)
else
set b = temp.isWidgetInRectangle(d, GetDestructableHeight(d), temp.collision)
endif
endif
set d = null
return b
endmethod
//
// Runs for every enumerated item.
// • Directly filters out already hit items.
// • Distance formula based on the Pythagorean theorem.
// • Items have a fix collision size of 16.
//
private static method filterItems takes nothing returns boolean
local item i = GetFilterItem()
local boolean b = false
if not HaveSavedHandle(HASH, temp, GetHandleId(i)) then
if circle then // Item in missile collision size or item pathing in missile range.
set b = temp.isWidgetInRange(i, GetItemHeight(i), RMaxBJ(temp.collision, 16.))
else
set b = temp.isWidgetInRectangle(i, GetItemHeight(i), RMaxBJ(temp.collision, 16.))
endif
endif
set i = null
return b
endmethod
//
// 4.) Filter function for rectangle unit collision.
//
// Runs for every enumerated units.
// • Filters out units which are not in collision range in plane x / y.
// • Inlined and therefore a bit faster than item and destructable collision.
//
private static method filterUnits takes nothing returns boolean
local thistype this = thistype.temp
local unit u = GetFilterUnit()
local real dx
local real dy
local real s
local boolean is = false
if not HaveSavedHandle(HASH, this, GetHandleId(u)) then
set dx = x - prevX
set dy = y - prevY
set s = (dx*(GetUnitX(u) - prevX) + dy*(GetUnitY(u)- prevY))/(dx*dx + dy*dy)
if s < 0. then
set s = 0.
elseif s > 1. then
set s = 1.
endif
set is = IsUnitInRangeXY(u, prevX + s*dx, prevY + s*dy, collision)
endif
set u = null
return is
endmethod
//
// 5.) Proper rect preparation.
//
// For rectangle.
private method prepareRectRectangle takes nothing returns nothing
local real x1 = prevX
local real y1 = prevY
local real x2 = x
local real y2 = y
local real d = collision + Misssile_MAXIMUM_COLLISION_SIZE
// What is min, what is max ...
if x1 < x2 then
if y1 < y2 then
call SetRect(RECT, x1 - d, y1 - d, x2 + d, y2 + d)
else
call SetRect(RECT, x1 - d, y2 - d, x2 + d, y1 + d)
endif
elseif y1 < y2 then
call SetRect(RECT, x2 - d, y1 - d, x1 + d, y2 + d)
else
call SetRect(RECT, x2 - d, y2 - d, x1 + d, y1 + d)
endif
endmethod
//
// For circular.
private method prepareRectCircle takes nothing returns nothing
local real d = collision + Misssile_MAXIMUM_COLLISION_SIZE
call SetRect(RECT, x - d, y - d, x + d, y + d)
endmethod
//
// 5.) API for the MisssileStruct iteration.
//
method groupEnumUnitsRectangle takes nothing returns nothing
call prepareRectRectangle()
set thistype.temp = this
call GroupEnumUnitsInRect(GROUP, RECT, unitFilter)
endmethod
//
// Prepares destructable enumeration, then runs enumDests.
method checkDestCollision takes code func returns nothing
set circle = collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call prepareRectCircle()
else
call prepareRectRectangle()
endif
//
set thistype.temp = this
call EnumDestructablesInRect(RECT, destFilter, func)
endmethod
//
// Prepares item enumeration, then runs enumItems.
method checkItemCollision takes code func returns nothing
set circle = collisionType == Misssile_COLLISION_TYPE_CIRCLE
if circle then
call prepareRectCircle()
else
call prepareRectRectangle()
endif
//
set thistype.temp = this
call EnumItemsInRect(RECT, itemFilter, func)
endmethod
static if Misssile_WRITE_DELAYED_MISSILE_RECYCLING then
method nullBefore takes nothing returns nothing
set dummy = null
endmethod
endif
// Does not check for 'Aloc' and 'Amrf' as they could be customized.
private static method onInit takes nothing returns nothing
static if LIBRARY_ErrorMessage then
debug local boolean prev = ToogleUnitIndexer(false)
debug local unit dummy = CreateUnit(Misssile_NEUTRAL_PASSIVE, Misssile_DUMMY_UNIT_ID, 0., 0., 0.)
debug call ToogleUnitIndexer(prev)
//
debug call ThrowError((GetUnitTypeId(dummy) != Misssile_DUMMY_UNIT_ID), "Misssile", "DEBUG_MISSILE", "type id", 0, "Global setup for public integer DUMMY_UNIT_ID is incorrect! This map currently can't use Misssile!")
debug call ThrowError((Misssile_MAXIMUM_COLLISION_SIZE < 0), "Misssile", "DEBUG_MISSILE", "collision", 0, "Global setup for public real MAXIMUM_COLLISION_SIZE is incorrect, below zero! This map currently can't use Misssile!")
debug call RemoveUnit(dummy)
debug set dummy = null
endif
//
set unitFilter = Filter(function thistype.filterUnits)
set destFilter = Filter(function thistype.filterDests)
set itemFilter = Filter(function thistype.filterItems)
call TriggerAddCondition(MOVE, Condition(function thistype.move))
endmethod
endstruct
// You made it to the end of Misssile, but we are not finished.
// Do you remember about the data structure, the delayed recycler
// and of course our interface module "MisssileStruct"
//
// This comes now!
// Debug code taken from List ( full credits to Nestharus )
private module MisssileStructure
private static thistype collectionCount = 0
private static thistype nodeCount = 0
static if LIBRARY_ErrorMessage then
debug private boolean isNode
debug private boolean isCollection
endif
private thistype _list
method operator list takes nothing returns thistype
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "MisssileStructure", "list", "thistype", this, "Attempted To Read Null Node.")
debug call ThrowError(not isNode, "MisssileStructure", "list", "thistype", this, "Attempted To Read Invalid Node.")
endif
return _list
endmethod
private thistype _next
method operator next takes nothing returns thistype
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "MisssileStructure", "next", "thistype", this, "Attempted To Go Out Of Bounds.")
debug call ThrowError(not isNode, "MisssileStructure", "next", "thistype", this, "Attempted To Read Invalid Node.")
endif
return _next
endmethod
private thistype _prev
method operator prev takes nothing returns thistype
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "MisssileStructure", "prev", "thistype", this, "Attempted To Go Out Of Bounds.")
debug call ThrowError(not isNode, "MisssileStructure", "prev", "thistype", this, "Attempted To Read Invalid Node.")
endif
return _prev
endmethod
private thistype _first
method operator first takes nothing returns thistype
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "MisssileStructure", "first", "thistype", this, "Attempted To Read Null List.")
debug call ThrowError(not isCollection, "MisssileStructure", "first", "thistype", this, "Attempted To Read Invalid List.")
endif
return _first
endmethod
private thistype _last
method operator last takes nothing returns thistype
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "MisssileStructure", "last", "thistype", this, "Attempted To Read Null List.")
debug call ThrowError(not isCollection, "MisssileStructure", "last", "thistype", this, "Attempted To Read Invalid List.")
endif
return _last
endmethod
static method allocateCollection takes nothing returns thistype
local thistype this = thistype(0)._first
if (0 == this) then
static if LIBRARY_ErrorMessage then
debug call ThrowError(collectionCount == 8191, "MisssileStructure", "allocateCollection", "thistype", 0, "Overflow.")
endif
set this = collectionCount + 1
set collectionCount = this
else
set thistype(0)._first = _first
endif
static if LIBRARY_ErrorMessage then
debug set isCollection = true
endif
set _first = 0
return this
endmethod
static method allocateNode takes nothing returns thistype
local thistype this = thistype(0)._next
if (0 == this) then
static if LIBRARY_ErrorMessage then
debug call ThrowError(nodeCount == 8191, "MisssileStructure", "allocateNode", "thistype", 0, "Overflow.")
endif
set this = nodeCount + 1
set nodeCount = this
else
set thistype(0)._next = _next
endif
set allocated = true
return this
endmethod
method insertFront takes thistype node returns thistype
// Extra static unique list for missile motion.
set nextNode[node] = 0
set prevNode[node] = prevNode[0]
set nextNode[prevNode[0]] = node
set prevNode[0] = node
static if LIBRARY_ErrorMessage then
debug call ThrowError(this == 0, "List", "push", "thistype", this, "Attempted To Push On To Null List.")
debug call ThrowError(not isCollection, "List", "push", "thistype", this, "Attempted To Push On To Invalid List.")
debug set node.isNode = true
endif
set node._list = this
if (_first == 0) then
set _first = node
set _last = node
set node._next = 0
else
set _first._prev = node
set node._next = _first
set _first = node
endif
set node._prev = 0
return node
endmethod
method remove takes nothing returns nothing
local thistype node = this
set this = node._list
static if LIBRARY_ErrorMessage then
debug call ThrowError(node == 0, "MisssileStructure", "remove", "thistype", this, "Attempted To Remove Null Node.")
debug call ThrowError(not node.isNode, "MisssileStructure", "remove", "thistype", this, "Attempted To Remove Invalid Node (" + I2S(node) + ").")
debug set node.isNode = false
endif
set node._list = 0
if (0 == node._prev) then
set _first = node._next
else
set node._prev._next = node._next
endif
if (0 == node._next) then
set _last = node._prev
else
set node._next._prev = node._prev
endif
set node._next = thistype(0)._next
set thistype(0)._next = node
set node.allocated = false
// Static unique list for missile motion.
set nextNode[prevNode[node]] = nextNode[node]
set prevNode[nextNode[node]] = prevNode[node]
endmethod
endmodule
// Boolean expressions per struct:
// ===============================
//
// Condition function for the core trigger evaluation. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateExpression takes integer structId, code func returns nothing
set expression[structId] = Condition(func)
endfunction
// Creates a collection for a struct. ( Runs for all struct using module MisssileStruct )
private function MisssileCreateCollection takes integer structId returns nothing
set missileList[structId] = Misssile.allocateCollection()
endfunction
// Core:
// =====
//
// Fires every Misssile_TIMER_TIMEOUT.
private function Fire takes nothing returns nothing
local integer i = remove[0]
set remove[0] = 0
loop
exitwhen 0 == i
if recycling[i] then
call TriggerRemoveCondition(CORE, condition[i])
set condition[i] = null
set active = active - 1
endif
set destroying[i] = false
set recycling[i] = false
set i = remove[i]
endloop
if 0 == active then
call PauseTimer(TMR)
else
// Move all launched missiles.
set Misssile.temp = nextNode[0]
set i = 0
loop
exitwhen TriggerEvaluate(MOVE)
exitwhen i == 60// Moved over 8910 missiles, something buggy happened.
set i = i + 1 // This case is impossible, hence never happens. But if I'm wrong, which also never happens
endloop // then the map 100% crashes. i == 66 will prevent the game crash and Misssile will start to
// to debug itself over the next iterations.
// Access all structs using module MisssileStruct.
static if DEBUG_MODE and LIBRARY_ErrorMesssage then
if not TriggerEvaluate(CORE) then
call ThrowWarning(true, "Misssile", "Fire", "op limit", 0, /*
*/"You just ran into a op limit!
The op limit protection of Misssile is insufficient for your map.
The code of the missile module can't run in one thread and must be splitted.
If unsure make a post in the official 'The Hive Workshop' forum thread of Misssile!")
endif
else
call TriggerEvaluate(CORE)
endif
endif
endfunction
// Conditionally starts the timer.
private function StartPeriodic takes integer structId returns nothing
if 0 == instances[structId] or destroying[structId] then
if destroying[structId] then
set recycling[structId] = false
else
if 0 == active then
call TimerStart(TMR, Misssile_TIMER_TIMEOUT, true, function Fire)
endif
set active = active + 1
set condition[structId] = TriggerAddCondition(CORE, expression[structId])
endif
endif
set instances[structId] = instances[structId] + 1
endfunction
// Conditionally stops the timer in the next callback.
private function StopPeriodic takes integer structId returns nothing
set instances[structId] = instances[structId] - 1
if 0 == instances[structId] and condition[structId] != null then
if not destroying[structId] and not recycling[structId] then
set destroying[structId] = true
set recycling[structId] = true
set remove[structId] = remove[0]
set remove[0] = structId
endif
endif
endfunction
// Modules:
// ========
//
// You want to place module MisssileLaunch at the very top of your struct.
module MisssileLaunch
static method launch takes Misssile missile returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(missile.launched, "thistype", "launch", "missile.launched", missile, "This missile was already launched before!")
endif
debug set missile.launched = true
//
call missileList[thistype.typeid].insertFront(missile)
call StartPeriodic(thistype.typeid)
endmethod
endmodule
module MisssileTerminate
// Called from missileIterate. "P" to avoid code collision.
static method missileTerminateP takes Misssile node returns nothing
if node.allocated then
static if thistype.onRemove.exists then
static if Misssile_WRITE_DELAYED_MISSILE_RECYCLING and RecycleBin.recycle.exists then
if thistype.onRemove(node) and GetUnitTypeId(node.dummy) == Misssile_DUMMY_UNIT_ID then
call RecycleBin.recycle(node.dummy)
call node.nullBefore()
endif
else
call thistype.onRemove(node)
endif
endif
call node.terminate()
call StopPeriodic(thistype.typeid)
endif
endmethod
endmodule
// Allows you to inject missile in certain stages of the motion process.
module MisssileAction
static if DEBUG_MODE then
// Runs check during compile time.
static if thistype.onMisssile.exists then
Error Message from library Misssile in struct thistype !
thistype.onMisssile is a reserved name for Misssile, once you implemented MisssileStruct.
thistype.onMisssile is currently not supported by library Misssile.
Please delete or re-name that method.
endif
endif
static if thistype.onItem.exists then
private static method missileActionItem takes nothing returns nothing
local item i = GetEnumItem()
local Misssile this = Misssile.temp
if this.allocated then
call SaveItemHandle(HASH, this, GetHandleId(i), i)
if thistype.onItem(this, i) then
call missileTerminateP(this)
endif
endif
set i = null
endmethod
endif
static if thistype.onDestructable.exists then
private static method missileActionDest takes nothing returns nothing
local destructable d = GetEnumDestructable()
local Misssile this = Misssile.temp
if this.allocated then
call SaveDestructableHandle(HASH, this, GetHandleId(d), d)
if thistype.onDestructable(this, d) then
call missileTerminateP(this)
endif
endif
set d = null
endmethod
endif
// Runs every Misssile_TIMER_TIMEOUT for this struct.
static method missileIterateP takes nothing returns boolean
local Misssile this = missileList[thistype.typeid].first
local Misssile node
local real collideZ
local boolean b
local unit u
loop
exitwhen 0 == this
set node = this.next// The linked list should not lose the next node.
if this.wantDestroy then
call thistype.missileTerminateP(this)
else
if this.stackSize > 0 then
call this.updateStack()
endif
// Runs unit collision.
static if thistype.onCollide.exists then
if this.allocated and 0. < this.collision then
set b = this.collisionType == Misssile_COLLISION_TYPE_RECTANGLE
if b then
call this.groupEnumUnitsRectangle()
else
call GroupEnumUnitsInRange(GROUP, this.x, this.y, this.collision + Misssile_MAXIMUM_COLLISION_SIZE, null)
endif
loop
set u = FirstOfGroup(GROUP)
exitwhen u == null
call GroupRemoveUnit(GROUP, u)
if not HaveSavedHandle(HASH, this, GetHandleId(u)) then
if IsUnitInRange(u, this.dummy, this.collision) or b then
// Eventually run z collision checks.
static if Misssile_USE_COLLISION_Z_FILTER then
set collideZ = Misssile_GetLocZ(GetUnitX(u), GetUnitY(u)) + GetUnitFlyHeight(u) - this.terrainZ
if (collideZ + GetUnitBodySize(u) >= this.z - this.collisionZ) and (collideZ <= this.z + this.collisionZ) then
// Mark as hit.
call SaveUnitHandle(HASH, this, GetHandleId(u), u)
if thistype.onCollide(this, u) then
call thistype.missileTerminateP(this)
exitwhen true
endif
endif
else
// Runs unit collision without z collision checks.
call SaveUnitHandle(HASH, this, GetHandleId(u), u)
if thistype.onCollide(this, u) then
call thistype.missileTerminateP(this)
exitwhen true
endif
endif
endif
endif
endloop
endif
endif
// Runs destructable collision.
static if thistype.onDestructable.exists then
// Check if the missile is not terminated.
if this.allocated and 0. < this.collision then
call this.checkDestCollision(function thistype.missileActionDest)
endif
endif
// Runs item collision.
static if thistype.onItem.exists then
// Check if the missile is not terminated.
if this.allocated and 0. < this.collision then
call this.checkItemCollision(function thistype.missileActionItem)
endif
endif
// Runs when the destination is reached.
if this.recycle and this.allocated then
static if thistype.onFinish.exists then
if thistype.onFinish(this) then
call thistype.missileTerminateP(this)
endif
else
call thistype.missileTerminateP(this)
endif
endif
// Runs on terrian collision.
static if thistype.onTerrain.exists then
if this.allocated and 0. > this.z and thistype.onTerrain(this) then
call missileTerminateP(this)
endif
endif
// Runs every Misssile_TIMER_TIMEOUT.
static if thistype.onPeriod.exists then
if this.allocated and thistype.onPeriod(this) then
call missileTerminateP(this)
endif
endif
endif
set this = node
endloop
set u = null
static if DEBUG_MODE and LIBRARY_ErrorMessage then
return true
else
return false
endif
endmethod
endmodule
module MisssileStruct
implement MisssileLaunch
implement MisssileTerminate
implement MisssileAction
private static method onInit takes nothing returns nothing
call MisssileCreateCollection(thistype.typeid)
call MisssileCreateExpression(thistype.typeid, function thistype.missileIterateP)
endmethod
endmodule
// Misssile position:
// =================
//
// Simple trigonometry.
//! textmacro WRITE_MISSILE_POSITION_CODE
struct MisssilePosition extends array
private static integer array recycler
private static integer alloc = 0
// Readonly members you can access.
readonly real x
readonly real y
readonly real z
readonly real angle
readonly real distance
readonly real square
readonly real slope
readonly real alpha
// Creates an origin - impact link.
private thistype ref
private static method math takes thistype a, thistype b returns nothing
local real dx
local real dy
loop
set dx = b.x - a.x
set dy = b.y - a.y
set dx = dx*dx + dy*dy
set dy = SquareRoot(dx)
exitwhen dx != 0. and dy != 0.
set b.x = b.x + .01
set b.z = b.z - Misssile_GetLocZ(b.x -.01, b.y) + Misssile_GetLocZ(b.x, b.y)
endloop
set a.square = dx
set a.distance = dy
set a.angle = Atan2(b.y - a.y, b.x - a.x)
set a.slope = (b.z - a.z)/dy
set a.alpha = Atan(a.slope)*bj_RADTODEG
// Set b.
if b.ref == a then
set b.angle = a.angle + bj_PI
set b.distance = dy
set b.slope = -a.slope
set b.alpha = -a.alpha
set b.square = dx
endif
endmethod
static method link takes thistype a, thistype b returns nothing
set a.ref = b
set b.ref = a
call math(a, b)
endmethod
method move takes real toX, real toY, real toZ returns nothing
set x = toX
set y = toY
set z = toZ + Misssile_GetLocZ(toX, toY)
if ref != this then
call math(this, ref)
endif
endmethod
method destroy takes nothing returns nothing
set recycler[this] = recycler[0]
set recycler[0] = this
endmethod
static method create takes real x, real y, real z returns MisssilePosition
local thistype this = recycler[0]
if 0 == this then
set alloc = alloc + 1
set this = alloc
else
set recycler[0] = recycler[this]
endif
set ref = this
call move(x, y, z)
return this
endmethod
endstruct
//! endtextmacro
// Delayed dummy recycling:
// ========================
//
// Ensures proper fx death animations.
//! textmacro WRITE_MISSILE_RECYCLE_BIN takes DO_THIS, AFTER_TIME
static if $DO_THIS$ then
private struct RecycleBin extends array
private static constant timer t = CreateTimer()
private static integer max = 0
private static unit array dummy
private static real array time
private static method onPeriodic takes nothing returns nothing
local integer dex = 0
loop
exitwhen dex == thistype.max
set thistype.time[dex] = thistype.time[dex] - 1
if 0 >= thistype.time[dex] then
static if LIBRARY_MisssileRecycler then
call RecycleMisssile(thistype.dummy[dex])
elseif Dummy.create.exists and LIBRARY_Dummy then
call Dummy[thistype.dummy[dex]].destroy()
elseif LIBRARY_xedummy and xedummy.release.exists then
call xedummy.release(thistype.dummy[dex])
else
call RemoveUnit(thistype.dummy[dex])
endif
set thistype.dummy[dex] = null
set thistype.max = thistype.max - 1
set thistype.dummy[dex] = thistype.dummy[thistype.max]
set thistype.time[dex] = thistype.time[thistype.max]
set thistype.dummy[thistype.max] = null
set dex = dex - 1
if 0 == thistype.max then
call PauseTimer(thistype.t)
endif
endif
set dex = dex + 1
endloop
endmethod
static method recycle takes unit toRecycle returns nothing
if 0 == thistype.max then
call TimerStart(thistype.t, 1., true, function thistype.onPeriodic)
endif
set thistype.dummy[max] = toRecycle
set thistype.time[max] = $AFTER_TIME$ + TimerGetRemaining(thistype.t)
set thistype.max = thistype.max + 1
endmethod
endstruct
endif
//! endtextmacro
// The end!
endlibrary
library Table /* made by Bribe, special thanks to Vexorian & Nestharus, version 4.1.0.1.
One map, one hashtable. Welcome to NewTable 4.1.0.1
This newest iteration of Table introduces the new HashTable struct.
You can now instantiate HashTables which enables the use of large
parent and large child keys, just like a standard hashtable. Previously,
the user would have to instantiate a Table to do this on their own which -
while doable - is something the user should not have to do if I can add it
to this resource myself (especially if they are inexperienced).
This library was originally called NewTable so it didn't conflict with
the API of Table by Vexorian. However, the damage is done and it's too
late to change the library name now. To help with damage control, I
have provided an extension library called TableBC, which bridges all
the functionality of Vexorian's Table except for 2-D string arrays &
the ".flush(integer)" method. I use ".flush()" to flush a child hash-
table, because I wanted the API in NewTable to reflect the API of real
hashtables (I thought this would be more intuitive).
API
------------
struct Table
| static method create takes nothing returns Table
| create a new Table
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush all stored values inside of it
|
| method remove takes integer key returns nothing
| remove the value at index "key"
|
| method operator []= takes integer key, $TYPE$ value returns nothing
| assign "value" to index "key"
|
| method operator [] takes integer key returns $TYPE$
| load the value at index "key"
|
| method has takes integer key returns boolean
| whether or not the key was assigned
|
----------------
struct TableArray
| static method operator [] takes integer array_size returns TableArray
| create a new array of Tables of size "array_size"
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush and destroy it
|
| method operator size takes nothing returns integer
| returns the size of the TableArray
|
| method operator [] takes integer key returns Table
| returns a Table accessible exclusively to index "key"
*/
globals
private integer less = 0 //Index generation for TableArrays (below 0).
private integer more = 8190//Index generation for Tables.
//Configure it if you use more than 8190 "key" variables in your map (this will never happen though).
private hashtable ht = InitHashtable()
private key sizeK
private key listK
endglobals
private struct dex extends array
static method operator size takes nothing returns Table
return sizeK
endmethod
static method operator list takes nothing returns Table
return listK
endmethod
endstruct
private struct handles extends array
method has takes integer key returns boolean
return HaveSavedHandle(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSavedHandle(ht, this, key)
endmethod
endstruct
private struct agents extends array
method operator []= takes integer key, agent value returns nothing
call SaveAgentHandle(ht, this, key, value)
endmethod
endstruct
//! textmacro NEW_ARRAY_BASIC takes SUPER, FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$(ht, this, key, value)
endmethod
method has takes integer key returns boolean
return HaveSaved$SUPER$(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSaved$SUPER$(ht, this, key)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//! textmacro NEW_ARRAY takes FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$Handle(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$Handle(ht, this, key, value)
endmethod
method has takes integer key returns boolean
return HaveSavedHandle(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSavedHandle(ht, this, key)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//Run these textmacros to include the entire hashtable API as wrappers.
//Don't be intimidated by the number of macros - Vexorian's map optimizer is
//supposed to kill functions which inline (all of these functions inline).
//! runtextmacro NEW_ARRAY_BASIC("Real", "Real", "real")
//! runtextmacro NEW_ARRAY_BASIC("Boolean", "Boolean", "boolean")
//! runtextmacro NEW_ARRAY_BASIC("String", "Str", "string")
//New textmacro to allow table.integer[] syntax for compatibility with textmacros that might desire it.
//! runtextmacro NEW_ARRAY_BASIC("Integer", "Integer", "integer")
//! runtextmacro NEW_ARRAY("Player", "player")
//! runtextmacro NEW_ARRAY("Widget", "widget")
//! runtextmacro NEW_ARRAY("Destructable", "destructable")
//! runtextmacro NEW_ARRAY("Item", "item")
//! runtextmacro NEW_ARRAY("Unit", "unit")
//! runtextmacro NEW_ARRAY("Ability", "ability")
//! runtextmacro NEW_ARRAY("Timer", "timer")
//! runtextmacro NEW_ARRAY("Trigger", "trigger")
//! runtextmacro NEW_ARRAY("TriggerCondition", "triggercondition")
//! runtextmacro NEW_ARRAY("TriggerAction", "triggeraction")
//! runtextmacro NEW_ARRAY("TriggerEvent", "event")
//! runtextmacro NEW_ARRAY("Force", "force")
//! runtextmacro NEW_ARRAY("Group", "group")
//! runtextmacro NEW_ARRAY("Location", "location")
//! runtextmacro NEW_ARRAY("Rect", "rect")
//! runtextmacro NEW_ARRAY("BooleanExpr", "boolexpr")
//! runtextmacro NEW_ARRAY("Sound", "sound")
//! runtextmacro NEW_ARRAY("Effect", "effect")
//! runtextmacro NEW_ARRAY("UnitPool", "unitpool")
//! runtextmacro NEW_ARRAY("ItemPool", "itempool")
//! runtextmacro NEW_ARRAY("Quest", "quest")
//! runtextmacro NEW_ARRAY("QuestItem", "questitem")
//! runtextmacro NEW_ARRAY("DefeatCondition", "defeatcondition")
//! runtextmacro NEW_ARRAY("TimerDialog", "timerdialog")
//! runtextmacro NEW_ARRAY("Leaderboard", "leaderboard")
//! runtextmacro NEW_ARRAY("Multiboard", "multiboard")
//! runtextmacro NEW_ARRAY("MultiboardItem", "multiboarditem")
//! runtextmacro NEW_ARRAY("Trackable", "trackable")
//! runtextmacro NEW_ARRAY("Dialog", "dialog")
//! runtextmacro NEW_ARRAY("Button", "button")
//! runtextmacro NEW_ARRAY("TextTag", "texttag")
//! runtextmacro NEW_ARRAY("Lightning", "lightning")
//! runtextmacro NEW_ARRAY("Image", "image")
//! runtextmacro NEW_ARRAY("Ubersplat", "ubersplat")
//! runtextmacro NEW_ARRAY("Region", "region")
//! runtextmacro NEW_ARRAY("FogState", "fogstate")
//! runtextmacro NEW_ARRAY("FogModifier", "fogmodifier")
//! runtextmacro NEW_ARRAY("Hashtable", "hashtable")
struct Table extends array
// Implement modules for intuitive syntax (tb.handle; tb.unit; etc.)
implement realm
implement integerm
implement booleanm
implement stringm
implement playerm
implement widgetm
implement destructablem
implement itemm
implement unitm
implement abilitym
implement timerm
implement triggerm
implement triggerconditionm
implement triggeractionm
implement eventm
implement forcem
implement groupm
implement locationm
implement rectm
implement boolexprm
implement soundm
implement effectm
implement unitpoolm
implement itempoolm
implement questm
implement questitemm
implement defeatconditionm
implement timerdialogm
implement leaderboardm
implement multiboardm
implement multiboarditemm
implement trackablem
implement dialogm
implement buttonm
implement texttagm
implement lightningm
implement imagem
implement ubersplatm
implement regionm
implement fogstatem
implement fogmodifierm
implement hashtablem
method operator handle takes nothing returns handles
return this
endmethod
method operator agent takes nothing returns agents
return this
endmethod
//set this = tb[GetSpellAbilityId()]
method operator [] takes integer key returns Table
return LoadInteger(ht, this, key) //return this.integer[key]
endmethod
//set tb[389034] = 8192
method operator []= takes integer key, Table tb returns nothing
call SaveInteger(ht, this, key, tb) //set this.integer[key] = tb
endmethod
//set b = tb.has(2493223)
method has takes integer key returns boolean
return HaveSavedInteger(ht, this, key) //return this.integer.has(key)
endmethod
//call tb.remove(294080)
method remove takes integer key returns nothing
call RemoveSavedInteger(ht, this, key) //call this.integer.remove(key)
endmethod
//Remove all data from a Table instance
method flush takes nothing returns nothing
call FlushChildHashtable(ht, this)
endmethod
//local Table tb = Table.create()
static method create takes nothing returns Table
local Table this = dex.list[0]
if this == 0 then
set this = more + 1
set more = this
else
set dex.list[0] = dex.list[this]
call dex.list.remove(this) //Clear hashed memory
endif
debug set dex.list[this] = -1
return this
endmethod
// Removes all data from a Table instance and recycles its index.
//
// call tb.destroy()
//
method destroy takes nothing returns nothing
debug if dex.list[this] != -1 then
debug call BJDebugMsg("Table Error: Tried to double-free instance: " + I2S(this))
debug return
debug endif
call this.flush()
set dex.list[this] = dex.list[0]
set dex.list[0] = this
endmethod
//! runtextmacro optional TABLE_BC_METHODS()
endstruct
//! runtextmacro optional TABLE_BC_STRUCTS()
struct TableArray extends array
//Returns a new TableArray to do your bidding. Simply use:
//
// local TableArray ta = TableArray[array_size]
//
static method operator [] takes integer array_size returns TableArray
local Table tb = dex.size[array_size] //Get the unique recycle list for this array size
local TableArray this = tb[0] //The last-destroyed TableArray that had this array size
debug if array_size <= 0 then
debug call BJDebugMsg("TypeError: Invalid specified TableArray size: " + I2S(array_size))
debug return 0
debug endif
if this == 0 then
set this = less - array_size
set less = this
else
set tb[0] = tb[this] //Set the last destroyed to the last-last destroyed
call tb.remove(this) //Clear hashed memory
endif
set dex.size[this] = array_size //This remembers the array size
return this
endmethod
//Returns the size of the TableArray
method operator size takes nothing returns integer
return dex.size[this]
endmethod
//This magic method enables two-dimensional[array][syntax] for Tables,
//similar to the two-dimensional utility provided by hashtables them-
//selves.
//
//ta[integer a].unit[integer b] = unit u
//ta[integer a][integer c] = integer d
//
//Inline-friendly when not running in debug mode
//
method operator [] takes integer key returns Table
static if DEBUG_MODE then
local integer i = this.size
if i == 0 then
call BJDebugMsg("IndexError: Tried to get key from invalid TableArray instance: " + I2S(this))
return 0
elseif key < 0 or key >= i then
call BJDebugMsg("IndexError: Tried to get key [" + I2S(key) + "] from outside TableArray bounds: " + I2S(i))
return 0
endif
endif
return this + key
endmethod
//Destroys a TableArray without flushing it; I assume you call .flush()
//if you want it flushed too. This is a public method so that you don't
//have to loop through all TableArray indices to flush them if you don't
//need to (ie. if you were flushing all child-keys as you used them).
//
method destroy takes nothing returns nothing
local Table tb = dex.size[this.size]
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to destroy an invalid TableArray: " + I2S(this))
debug return
debug endif
if tb == 0 then
//Create a Table to index recycled instances with their array size
set tb = Table.create()
set dex.size[this.size] = tb
endif
call dex.size.remove(this) //Clear the array size from hash memory
set tb[this] = tb[0]
set tb[0] = this
endmethod
private static Table tempTable
private static integer tempEnd
//Avoids hitting the op limit
private static method clean takes nothing returns nothing
local Table tb = .tempTable
local integer end = tb + 0x1000
if end < .tempEnd then
set .tempTable = end
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
else
set end = .tempEnd
endif
loop
call tb.flush()
set tb = tb + 1
exitwhen tb == end
endloop
endmethod
//Flushes the TableArray and also destroys it. Doesn't get any more
//similar to the FlushParentHashtable native than this.
//
method flush takes nothing returns nothing
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to flush an invalid TableArray instance: " + I2S(this))
debug return
debug endif
set .tempTable = this
set .tempEnd = this + this.size
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
call this.destroy()
endmethod
endstruct
//NEW: Added in Table 4.0. A fairly simple struct but allows you to do more
//than that which was previously possible.
struct HashTable extends array
//Enables myHash[parentKey][childKey] syntax.
//Basically, it creates a Table in the place of the parent key if
//it didn't already get created earlier.
method operator [] takes integer index returns Table
local Table t = Table(this)[index]
if t == 0 then
set t = Table.create()
set Table(this)[index] = t //whoops! Forgot that line. I'm out of practice!
endif
return t
endmethod
//You need to call this on each parent key that you used if you
//intend to destroy the HashTable or simply no longer need that key.
method remove takes integer index returns nothing
local Table t = Table(this)[index]
if t != 0 then
call t.destroy()
call Table(this).remove(index)
endif
endmethod
//Added in version 4.1
method has takes integer index returns boolean
return Table(this).has(index)
endmethod
//HashTables are just fancy Table indices.
method destroy takes nothing returns nothing
call Table(this).destroy()
endmethod
//Like I said above...
static method create takes nothing returns thistype
return Table.create()
endmethod
endstruct
endlibrary
library LinkedList /* v1.3.0 https://www.hiveworkshop.com/threads/linkedlist-modules.325635/
*/uses /*
*/optional ErrorMessage /* https://github.com/nestharus/JASS/blob/master/jass/Systems/ErrorMessage/main.j
*///! novjass
/*
Author:
- AGD
Credits:
- Nestharus, Dirac, Bribe
> For their scripts and discussions which I used as reference
Pros:
- Feature-rich (Can be)
- Modular
- Safety-oriented (On DEBUG_MODE, but not 100% fool-proof ofcourse)
- Flexible (Does not enforce a built-in allocator - allows user to choose between a custom Alloc
or the default vjass allocator, or neither)
- Extensible (Provides interfaces)
Note:
If you are using using Dirac's 'LinkedListModule' library, you need to replace its contents with
the compatibility lib provided alongside this library for all to work seamlessly.
*/
|-----|
| API |
|-----|
/*
Note: All the fields except from 'prev' and 'next' are actually operators, so you might want to
avoid using them from the interface methods that would be declared above them.
=====================================================================================================
List Fields Modules (For those who want to write or inline the core linked-list operations themselves)
*/module LinkedListFields/*
*/readonly thistype prev/*
*/readonly thistype next/*
*/module StaticListFields extends LinkedListFields/*
*/readonly static constant thistype sentinel/*
*/readonly static thistype front/*
*/readonly static thistype back/*
*/readonly static boolean empty/*
*/module ListFields extends LinkedListFields/*
*/readonly thistype front/*
*/readonly thistype back/*
*/readonly boolean empty/*
=====================================================================================================
Lite List Modules (Should be enough for most cases)
*/module LinkedListLite extends LinkedListFields/*
*/optional interface static method onInsert takes thistype node returns nothing/*
*/optional interface static method onRemove takes thistype node returns nothing/*
*/optional interface method onTraverse takes thistype node returns boolean/*
*/static method insert takes thistype prev, thistype node returns nothing/*
*/static method remove takes thistype node returns nothing/*
*/method traverseForwards takes nothing returns nothing/*
*/method traverseBackwards takes nothing returns nothing/*
- Only present if onTraverse() is also present
*/module StaticListLite extends StaticListFields, LinkedListLite/*
*/static method pushFront takes thistype node returns nothing/*
*/static method popFront takes nothing returns thistype/*
*/static method pushBack takes thistype node returns nothing/*
*/static method popBack takes nothing returns thistype/*
*/module ListLite extends ListFields, LinkedListLite/*
*/method pushFront takes thistype node returns nothing/*
*/method popFront takes nothing returns thistype/*
*/method pushBack takes thistype node returns nothing/*
*/method popBack takes nothing returns thistype/*
*/module InstantiatedListLite extends ListLite/*
*/interface static method allocate takes nothing returns thistype/*
*/interface method deallocate takes nothing returns nothing/*
*/optional interface method onConstruct takes nothing returns nothing/*
*/optional interface method onDestruct takes nothing returns nothing/*
*/static method create takes nothing returns thistype/*
*/method destroy takes nothing returns nothing/*
=====================================================================================================
Standard List Modules
*/module LinkedList extends LinkedListLite/*
*/static method isLinked takes thistype node returns boolean/*
*/module StaticList extends StaticListLite, LinkedList/*
*/static method clear takes nothing returns nothing/*
*/static method flush takes nothing returns nothing/*
*/module List extends ListLite, LinkedList/*
*/static method makeHead takes thistype node returns nothing/*
*/method clear takes nothing returns nothing/*
*/method flush takes nothing returns nothing/*
*/module InstantiatedList extends InstantiatedListLite, List/*
=====================================================================================================
Feature-rich List Modules (For those who somehow need exotic linked-list operations)
*/module LinkedListEx extends LinkedList/*
*/static method move takes thistype prev, thistype node returns nothing/*
*/static method swap takes thistype nodeA, thistype nodeB returns nothing/*
*/module StaticListEx extends StaticList, LinkedListEx/*
*/static method contains takes thistype node returns boolean/*
*/static method getSize takes nothing returns integer/*
*/static method rotateLeft takes nothing returns nothing/*
*/static method rotateRight takes nothing returns nothing/*
*/module ListEx extends List, LinkedListEx/*
*/method contains takes thistype node returns boolean/*
*/method getSize takes nothing returns integer/*
*/method rotateLeft takes nothing returns nothing/*
*/method rotateRight takes nothing returns nothing/*
*/module InstantiatedListEx extends InstantiatedList, ListEx/*
*///! endnovjass
/*========================================= CONFIGURATION ===========================================
* Only affects DEBUG_MODE
* If false, throws warnings instead (Errors pauses the game (Or stops the thread) while warnings do not)
*/
globals
private constant boolean THROW_ERRORS = true
endglobals
/*====================================== END OF CONFIGURATION =====================================*/
static if DEBUG_MODE then
public function AssertError takes boolean condition, string methodName, string structName, integer node, string message returns nothing
static if LIBRARY_ErrorMessage then
static if THROW_ERRORS then
call ThrowError(condition, SCOPE_PREFIX, methodName, structName, node, message)
else
call ThrowWarning(condition, SCOPE_PREFIX, methodName, structName, node, message)
endif
else
if condition then
static if THROW_ERRORS then
call BJDebugMsg("|cffff0000[ERROR]|r [Library: " + SCOPE_PREFIX + "] [Struct: " + structName + "] [Method: " + methodName + "] [Instance: " + I2S(node) + "] : |cffff0000" + message + "|r")
call PauseGame(true)
else
call BJDebugMsg("|cffffcc00[WARNING]|r [Library: " + SCOPE_PREFIX + "] [Struct: " + structName + "] [Method: " + methodName + "] [Instance: " + I2S(node) + "] : |cffffcc00" + message + "|r")
endif
endif
endif
endfunction
endif
private module LinkedListUtils
method p_clear takes nothing returns nothing
set this.next.prev = 0
set this.prev.next = 0
set this.prev = this
set this.next = this
endmethod
method p_flush takes nothing returns nothing
local thistype node = this.prev
loop
exitwhen node == this
call remove(node)
set node = node.prev
endloop
endmethod
endmodule
private module LinkedListUtilsEx
implement LinkedListUtils
method p_contains takes thistype toFind returns boolean
local thistype node = this.next
loop
exitwhen node == this
if node == toFind then
return true
endif
set node = node.next
endloop
return false
endmethod
method p_getSize takes nothing returns integer
local integer count = 0
local thistype node = this.next
loop
exitwhen node == this
set count = count + 1
set node = node.next
endloop
return count
endmethod
endmodule
private module LinkedListLiteBase
implement LinkedListFields
debug method p_isEmptyHead takes nothing returns boolean
debug return this == this.next and this == this.prev
debug endmethod
static method p_insert takes thistype this, thistype node returns nothing
local thistype next = this.next
set node.prev = this
set node.next = next
set next.prev = node
set this.next = node
endmethod
static method p_remove takes thistype node returns nothing
set node.next.prev = node.prev
set node.prev.next = node.next
endmethod
static method insert takes thistype this, thistype node returns nothing
debug call AssertError(node == 0, "insert()", "thistype", 0, "Cannot insert null node")
debug call AssertError(not node.p_isEmptyHead() and (node.next.prev == node or node.prev.next == node), "insert()", "thistype", 0, "Already linked node [" + I2S(node) + "]: prev = " + I2S(node.prev) + " ; next = " + I2S(node.next))
call p_insert(this, node)
static if thistype.onInsert.exists then
call onInsert(node)
endif
endmethod
static method remove takes thistype node returns nothing
debug call AssertError(node == 0, "remove()", "thistype", 0, "Cannot remove null node")
debug call AssertError(node.next.prev != node and node.prev.next != node, "remove()", "thistype", 0, "Invalid node [" + I2S(node) + "]")
static if thistype.onRemove.exists then
call onRemove(node)
endif
call p_remove(node)
endmethod
static if thistype.onTraverse.exists then
method p_traverse takes boolean forward returns nothing
local thistype node
local thistype next
debug local thistype prev
debug local boolean array traversed
if forward then
set node = this.next
loop
exitwhen node == this or node.prev.next != node
debug call AssertError(traversed[node], "traverseForwards()", "thistype", this, "A node was traversed twice in a single traversal")
debug set traversed[node] = true
debug set prev = node.prev
set next = node.next
if this.onTraverse(node) then
call remove(node)
debug set traversed[node] = false
debug elseif next.prev == prev then
debug set traversed[node] = false
endif
set node = next
endloop
else
set node = this.prev
loop
exitwhen node == this or node.next.prev != node
debug call AssertError(traversed[node], "traverseBackwards()", "thistype", this, "A node was traversed twice in a single traversal")
debug set traversed[node] = true
debug set prev = node.next
set next = node.prev
if this.onTraverse(node) then
call remove(node)
debug set traversed[node] = false
debug elseif next.prev == prev then
debug set traversed[node] = false
endif
set node = next
endloop
endif
endmethod
method traverseForwards takes nothing returns nothing
call this.p_traverse(true)
endmethod
method traverseBackwards takes nothing returns nothing
call this.p_traverse(false)
endmethod
endif
endmodule
private module LinkedListBase
implement LinkedListLiteBase
static method isLinked takes thistype node returns boolean
return node.next.prev == node or node.prev.next == node
endmethod
endmodule
module LinkedListFields
readonly thistype prev
readonly thistype next
endmodule
module LinkedListLite
implement LinkedListLiteBase
implement optional LinkedListLiteModuleCompatibility // For API compatibility with Dirac's 'LinkedListModule' library
endmodule
module LinkedList
implement LinkedListBase
implement optional LinkedListModuleCompatibility // For API compatibility with Dirac's 'LinkedListModule' library
endmodule
module LinkedListEx
implement LinkedListBase
static method p_move takes thistype prev, thistype node returns nothing
call p_remove(node)
call p_insert(prev, node)
endmethod
static method move takes thistype prev, thistype node returns nothing
debug call AssertError(not isLinked(node), "move()", "thistype", 0, "Cannot use unlinked node [" + I2S(node) + "]")
call p_move(prev, node)
endmethod
static method swap takes thistype this, thistype node returns nothing
local thistype thisPrev = this.prev
local thistype thisNext = this.next
debug call AssertError(this == 0, "swap()", "thistype", 0, "Cannot swap null node")
debug call AssertError(node == 0, "swap()", "thistype", 0, "Cannot swap null node")
debug call AssertError(not isLinked(this), "swap()", "thistype", 0, "Cannot use unlinked node [" + I2S(this) + "]")
debug call AssertError(not isLinked(node), "swap()", "thistype", 0, "Cannot use unlinked node [" + I2S(node) + "]")
call p_move(node, this)
if thisNext != node then
call p_move(thisPrev, node)
endif
endmethod
endmodule
module StaticListFields
implement LinkedListFields
static constant method operator head takes nothing returns thistype
return 0
endmethod
static method operator back takes nothing returns thistype
return head.prev
endmethod
static method operator front takes nothing returns thistype
return head.next
endmethod
static method operator empty takes nothing returns boolean
return front == head
endmethod
endmodule
module StaticListLite
implement StaticListFields
implement LinkedListLiteBase
static method pushFront takes thistype node returns nothing
debug call AssertError(node == 0, "pushFront()", "thistype", 0, "Cannot use null node")
debug call AssertError(not node.p_isEmptyHead() and (node.next.prev == node or node.prev.next == node), "pushFront()", "thistype", 0, "Already linked node [" + I2S(node) + "]: prev = " + I2S(node.prev) + " ; next = " + I2S(node.next))
call insert(head, node)
endmethod
static method popFront takes nothing returns thistype
local thistype node = front
debug call AssertError(node.prev != head, "popFront()", "thistype", 0, "Invalid list")
call remove(node)
return node
endmethod
static method pushBack takes thistype node returns nothing
debug call AssertError(node == 0, "pushBack()", "thistype", 0, "Cannot use null node")
debug call AssertError(not node.p_isEmptyHead() and (node.next.prev == node or node.prev.next == node), "pushBack()", "thistype", 0, "Already linked node [" + I2S(node) + "]: prev = " + I2S(node.prev) + " ; next = " + I2S(node.next))
call insert(back, node)
endmethod
static method popBack takes nothing returns thistype
local thistype node = back
debug call AssertError(node.next != head, "popBack()", "thistype", 0, "Invalid list")
call remove(node)
return node
endmethod
endmodule
module StaticList
implement StaticListLite
implement LinkedListBase
implement LinkedListUtils
static method clear takes nothing returns nothing
call head.p_clear()
endmethod
static method flush takes nothing returns nothing
call head.p_flush()
endmethod
endmodule
module StaticListEx
implement StaticList
implement LinkedListEx
implement LinkedListUtilsEx
static method contains takes thistype node returns boolean
return head.p_contains(node)
endmethod
static method getSize takes nothing returns integer
return head.p_getSize()
endmethod
static method rotateLeft takes nothing returns nothing
call p_move(back, front)
endmethod
static method rotateRight takes nothing returns nothing
call p_move(head, back)
endmethod
endmodule
module ListFields
implement LinkedListFields
method operator back takes nothing returns thistype
return this.prev
endmethod
method operator front takes nothing returns thistype
return this.next
endmethod
method operator empty takes nothing returns boolean
return this.next == this
endmethod
endmodule
module ListLite
implement ListFields
implement LinkedListLiteBase
method pushFront takes thistype node returns nothing
debug call AssertError(this == 0, "pushFront()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "pushFront()", "thistype", this, "Invalid list")
debug call AssertError(node == 0, "pushFront()", "thistype", this, "Cannot insert null node")
debug call AssertError(not node.p_isEmptyHead() and (node.next.prev == node or node.prev.next == node), "pushFront()", "thistype", this, "Already linked node [" + I2S(node) + "]: prev = " + I2S(node.prev) + " ; next = " + I2S(node.next))
call insert(this, node)
endmethod
method popFront takes nothing returns thistype
local thistype node = this.next
debug call AssertError(this == 0, "popFront()", "thistype", 0, "Null list")
debug call AssertError(node.prev != this, "popFront()", "thistype", this, "Invalid list")
call remove(node)
return node
endmethod
method pushBack takes thistype node returns nothing
debug call AssertError(this == 0, "pushBack()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "pushBack()", "thistype", this, "Invalid list")
debug call AssertError(node == 0, "pushBack()", "thistype", this, "Cannot insert null node")
debug call AssertError(not node.p_isEmptyHead() and (node.next.prev == node or node.prev.next == node), "pushBack()", "thistype", this, "Already linked node [" + I2S(node) + "]: prev = " + I2S(node.prev) + " ; next = " + I2S(node.next))
call insert(this.prev, node)
endmethod
method popBack takes nothing returns thistype
local thistype node = this.prev
debug call AssertError(this == 0, "popBack()", "thistype", 0, "Null list")
debug call AssertError(node.next != this, "pushFront()", "thistype", this, "Invalid list")
call remove(node)
return node
endmethod
endmodule
module List
implement ListLite
implement LinkedListBase
implement LinkedListUtils
static method makeHead takes thistype node returns nothing
set node.prev = node
set node.next = node
endmethod
method clear takes nothing returns nothing
debug call AssertError(this == 0, "clear()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "clear()", "thistype", this, "Invalid list")
call this.p_clear()
endmethod
method flush takes nothing returns nothing
debug call AssertError(this == 0, "flush()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "flush()", "thistype", this, "Invalid list")
call this.p_flush()
endmethod
endmodule
module ListEx
implement List
implement LinkedListEx
implement LinkedListUtilsEx
method contains takes thistype node returns boolean
debug call AssertError(this == 0, "contains()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "contains()", "thistype", this, "Invalid list")
return this.p_contains(node)
endmethod
method getSize takes nothing returns integer
debug call AssertError(this == 0, "getSize()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "getSize()", "thistype", this, "Invalid list")
return this.p_getSize()
endmethod
method rotateLeft takes nothing returns nothing
debug call AssertError(this == 0, "rotateLeft()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "rotateLeft()", "thistype", this, "Invalid list")
call p_move(this.back, this.front)
endmethod
method rotateRight takes nothing returns nothing
debug call AssertError(this == 0, "rotateRight()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev == this, "rotateRight()", "thistype", this, "Invalid list")
call p_move(this, this.back)
endmethod
endmodule
module InstantiatedListLite
implement ListLite
debug private boolean valid
static method create takes nothing returns thistype
local thistype node = allocate()
set node.prev = node
set node.next = node
debug set node.valid = true
static if thistype.onConstruct.exists then
call node.onConstruct()
endif
return node
endmethod
method destroy takes nothing returns nothing
debug call AssertError(this == 0, "destroy()", "thistype", 0, "Null list")
debug call AssertError(this.next.prev != this, "destroy()", "thistype", this, "Invalid list")
debug call AssertError(not this.valid, "destroy()", "thistype", this, "Double-free")
debug set this.valid = false
static if thistype.flush.exists then
call this.flush()
endif
static if thistype.onDestruct.exists then
call this.onDestruct()
endif
debug set this.prev = 0
debug set this.next = 0
call this.deallocate()
endmethod
endmodule
module InstantiatedList
implement List
implement InstantiatedListLite
endmodule
module InstantiatedListEx
implement ListEx
implement InstantiatedList
endmodule
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library ShopSystem requires RegisterPlayerUnitEvent
/*
Version 1.2 by Adiktuz
Credits to Bribe and Magtheridon96 for Table and RegisterPlayerUnitEvent
A simple shop system which allows you to have multiple shops/shopping category inside a single shop.
If you've read my tutorial about sub-shops maybe you'll be asking what is the difference of this
to the system in the tutorial. Well, this one uses only one shop per player. Also with this one, all
items sold should be set via the trigger editor.
You can create an infinite-level shop with this one.
You can only register 11 items per catergory
Requirements:
JNGP with the latest jass helper
knowledge on how to call functions
knowledge on how to obtain rawcodes
knowledge on copying object data and adjusting them
Make sure that the shops you will register with this system doesn't have any items sold
on its object data
How to use:
1) Copy the dummy shop, the dummy select unit ability and the dummy click ability from the object editor into your map.
2) Make sure that you adjust the settings of the dummy shop in case it cannot recognize the dummy
select unit ability.
3) Copy this system and Bribe's Table library into your map.
4) Adjust some of the globals to fit your new map.
4) Start registering your main shops and items. See attached example trigger for better understanding.
Creating category items
1) Make a new item based on power ups
2) Add the Dummy Click ability
3) Make sure you set gold cost to 0 and set model used to none
Functions to toggle shop/item availability
shopAvailableForPlayer(player p, boolean what)
shopAvailableForPlayerId(integer id, boolean what)
--> Enables or disables the shop system for the player p, or the player with
PlayerId of id, depending on the setting of boolean what
itemAvailableForPlayer(integer itemid, player p, boolean what)
itemAvailableForPlayerId(integer itemid, player p, boolean what)
--> Enables or disables the item with the rawcode itemid for player p or the player with
PlayerId of id, depending on the setting of boolean what
*/
globals
private hashtable ShopTable = InitHashtable()
private hashtable WhichShop = InitHashtable()
private hashtable MainShop = InitHashtable()
private unit array DummyShop
private boolean array CanShop
// The next constant is required in order to avoid conflict when more than one player
// is buying from the same shop
private constant integer DUMMY_SHOP_ID = 'n01G'
private hashtable ItemHash = InitHashtable()
endglobals
private module init
static method onInit takes nothing returns nothing
local integer i = 0
//set ShopTable = Table.create()
//set WhichShop = Table.create()
//set MainShop = Table.create()
set thistype.items = InitHashtable()
call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SELECTED, function MainShops.selectShop)
call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SELL_ITEM, function thistype.changeItems)
loop
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set DummyShop[i] = CreateUnit(Player(i),DUMMY_SHOP_ID, 0.0, 0.0, 0.0)
// I make the player own it because if not and they are not visible to the player
// the selection action actually runs before the dummy gets moved so the selection becomes empty
set CanShop[i] = true
endif
set i = i + 1
exitwhen i > 11
endloop
endmethod
endmodule
struct Shops extends array
//integer array items [11]
static hashtable items
integer itemnum
private static integer instanceCount = 0
private static thistype recycle = 0
private thistype recycleNext
static method clearShop takes integer id returns nothing
local integer i = 0
local thistype this = LoadInteger(WhichShop,id,0)
loop
call RemoveItemFromStock(DummyShop[id], LoadInteger(thistype.items,this*11 + i,0))
set i = i + 1
exitwhen i > this.itemnum
endloop
endmethod
static method changeItems takes nothing returns boolean
local player p = GetOwningPlayer(GetBuyingUnit())
local integer i = 0
local thistype this = LoadInteger(ShopTable,GetItemTypeId(GetSoldItem()),0)
local integer id = GetPlayerId(p)
if this == 0 then
set p = null
return false
endif
call thistype.clearShop(id)
call SaveInteger(WhichShop,id,0,this)
loop
if not LoadBoolean(ItemHash, id, LoadInteger(thistype.items,this*11 + i,0)) then
call AddItemToStock(DummyShop[id], LoadInteger(thistype.items,this*11 + i,0), 1,1)
endif
set i = i + 1
exitwhen i == this.itemnum
endloop
set p = null
return false
endmethod
static method forceChangeItems takes integer baseItem, integer id returns boolean
local integer i = 0
local thistype this = LoadInteger(ShopTable,baseItem,0)
call thistype.clearShop(id)
call SaveInteger(WhichShop,id,0,this)
loop
if not LoadBoolean(ItemHash, id, LoadInteger(thistype.items,this*11 + i,0)) then
call AddItemToStock(DummyShop[id], LoadInteger(thistype.items,this*11 + i,0), 1,1)
endif
set i = i + 1
exitwhen i == this.itemnum
endloop
return false
endmethod
static method addItemLink takes integer itemBaseId, integer itemAddId returns nothing
local thistype this = LoadInteger(ShopTable,itemBaseId,0)
if this.itemnum < 11 then
call SaveInteger(thistype.items,this*11+this.itemnum,0,itemAddId)
set this.itemnum = this.itemnum + 1
else
debug call BJDebugMsg("Item list already full")
endif
endmethod
static method removeItem takes integer baseItemId, integer itemId returns nothing
local thistype this = LoadInteger(ShopTable,baseItemId,0)
local integer i = 0
loop
if LoadInteger(this.items,this*11 + i,0) == itemId then
set this.itemnum = this.itemnum - 1
call SaveInteger(thistype.items,this*11+i,0,LoadInteger(thistype.items,this*11+this.itemnum,0))
debug call BJDebugMsg("REMOVED " + I2S( LoadInteger(thistype.items,this*11 + i,0)))
return
endif
set i = i + 1
exitwhen i == this.itemnum
endloop
endmethod
static method duplicate takes integer baseItemId, integer itemId returns nothing
local thistype base = LoadInteger(ShopTable,baseItemId,0)
local thistype that //= .allocate()
local integer i = 0
if (recycle == 0) then
set instanceCount = instanceCount + 1
set that = instanceCount
else
set that = recycle
set recycle = recycle.recycleNext
endif
call SaveInteger(ShopTable,itemId,0,that)
set that.itemnum = base.itemnum
loop
call SaveInteger(thistype.items,that*11+i,0,LoadInteger(thistype.items,base*11+i,0))
set i = i + 1
exitwhen i == base.itemnum
endloop
endmethod
static method register takes integer itemId returns nothing
local thistype this //= .allocate()
if (recycle == 0) then
set instanceCount = instanceCount + 1
set this = instanceCount
else
set this = recycle
set recycle = recycle.recycleNext
endif
call SaveInteger(ShopTable,itemId,0,this)
endmethod
implement init
endstruct
struct MainShops extends array
private static integer instanceCount = 0
private static thistype recycle = 0
private thistype recycleNext
integer baseItem
static method selectShop takes nothing returns boolean
local unit u = GetTriggerUnit()
local thistype this = LoadInteger(MainShop,GetHandleId(u),0)
local player p = GetTriggerPlayer()
local integer id = GetPlayerId(p)
if this == 0 or not CanShop[id] then
set p = null
return false
endif
// If you click the portait, it will still point your camera towards the main shop
call SetUnitX(DummyShop[id], GetUnitX(u))
call SetUnitY(DummyShop[id], GetUnitY(u))
call Shops.forceChangeItems(this.baseItem, id)
if GetLocalPlayer() == p then
call ClearSelection()
call SelectUnit(DummyShop[id], true)
endif
set u =null
return false
endmethod
static method register takes unit shop, integer baseItem returns nothing
local thistype this //= .allocate()
if (recycle == 0) then
set instanceCount = instanceCount + 1
set this = instanceCount
else
set this = recycle
set recycle = recycle.recycleNext
endif
call SaveInteger(MainShop,GetHandleId(shop),0,this)
set this.baseItem = baseItem
endmethod
endstruct
function shopAvailableForPlayer takes player p, boolean what returns nothing
set CanShop[GetPlayerId(p)] = what
endfunction
function shopAvailableForPlayerId takes integer id, boolean what returns nothing
set CanShop[id] = what
endfunction
function itemAvailableForPlayer takes integer itemid, player p, boolean what returns nothing
call SaveBoolean(ItemHash, GetPlayerId(p), itemid, not what)
endfunction
function itemAvailableForPlayerId takes integer itemid, integer id, boolean what returns nothing
call SaveBoolean(ItemHash, id, itemid, not what)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library Sample initializer init requires ShopSystem
/*
In this example, we will be making shop which is both a two-level and a three-level shop.
Here you will be familiarized to the method of registering main shops and linking items to the
system. We will also make another shop which sells directly what the second level of the other
shop sells. We will also make a return to upper category dummy item. This was made so that you'll have a better grasp on how to use the system.
Theoretically, you can create an infinite-level shop using the ShopSystem.
*/
private function create takes nothing returns nothing
// Create the shop on top
local unit shop = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'n01C', 6458, -3100, 270.0)
/* Register the created shop as a main shop
I03G is the rawcode of the dummy item which we will use in order to determine
which items should the shop initialy have
*/
call MainShops.register(shop, 'I03G')
set shop = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'n01C', -6400, -3100, 270.0)
call MainShops.register(shop, 'I03G')
/* We register I03G to the shop system so that we can now link items to be sold when I03G is sold.
and since our shop is linked with I03G, whenever we click the shop, it will show the items linked
to I03G
*/
call Shops.register('I03G')//Main Shop
/* Now we will link items to I03G, take note that this items will also be used as categories
so we will register them to the system too
*/
call Shops.addItemLink('I03G', 'I03I') // Weapons
call Shops.addItemLink('I03G', 'I03J') // Defensive Items
call Shops.addItemLink('I03G', 'I03L')//Trinkets
call Shops.addItemLink('I03G', 'I03K')//Boots
call Shops.addItemLink('I03G', 'I03M')//Misc
// Now it's time to register those two items too
call Shops.register('I03I') //Weapons
call Shops.register('I03J') //Defensive Items
call Shops.register('I03L')//Trinkets
call Shops.register('I03K')//Boots
call Shops.register('I03M')//Miscel
// Now we will register items to I002 first since we will no longer have any category below potions
//call Shops.addItemLink('I03M', 'I03C') //Potion of Mana
call Shops.addItemLink('I03M', 'I03D') //Misc,Daedalus
call Shops.addItemLink('I03M', 'I04Y')//Misc,Shining Daedalus
call Shops.addItemLink('I03M', 'I03E')//Misc,Night's Veil
call Shops.addItemLink('I03M', 'I04H')//Misc, Demonic Heart
call Shops.addItemLink('I03M', 'I04N')//Misc,Demonic Eye
call Shops.addItemLink('I03M', 'I04Q')//Misc,Demonic Hand
call Shops.addItemLink('I03K', 'I01S')//Boots,Supreme Elven Boots
call Shops.addItemLink('I03K', 'I01T')
call Shops.addItemLink('I03K', 'I000')
call Shops.addItemLink('I03K', 'I01U')
call Shops.addItemLink('I03K', 'I04I')
// Now we setup another set of links with the equipments category
call Shops.addItemLink('I03I', 'I03N') //Weapons
call Shops.addItemLink('I03I', 'I03O') //Armor
call Shops.addItemLink('I03I', 'I03P')
call Shops.addItemLink('I03I', 'I03Q')
call Shops.addItemLink('I03J', 'I03T')
call Shops.addItemLink('I03J', 'I03U')
call Shops.addItemLink('I03L', 'I03R')
call Shops.addItemLink('I03L', 'I03S')
call Shops.register('I03N') //Weapons
call Shops.register('I03O') //Armor
call Shops.register('I03P')
call Shops.register('I03Q')
call Shops.register('I03T')
call Shops.register('I03U')
call Shops.register('I03R')
call Shops.register('I03S')
call Shops.addItemLink('I03Q', 'I055')
call Shops.addItemLink('I03P', 'I05S')
call Shops.register('I055')
call Shops.register('I05S')
// Now we link items to the weapons category
call Shops.addItemLink('I03N', 'I023')//Standard Weapons
call Shops.addItemLink('I03N', 'I01L')
call Shops.addItemLink('I03N', 'I01X')
call Shops.addItemLink('I03N', 'I041')
call Shops.addItemLink('I03N', 'I04A')
call Shops.addItemLink('I03N', 'I036')
call Shops.addItemLink('I03N', 'I048')
call Shops.addItemLink('I03N', 'I03V')
call Shops.addItemLink('I03N', 'I02U')
call Shops.addItemLink('I03O', 'I00W')//Melee weapons
call Shops.addItemLink('I03O', 'I01N')
call Shops.addItemLink('I03O', 'I02A')
call Shops.addItemLink('I03O', 'I02W')
call Shops.addItemLink('I03O', 'I038')
call Shops.addItemLink('I03O', 'I02V')
call Shops.addItemLink('I03O', 'I04R')//Demonic Mutilator
call Shops.addItemLink('I03O', 'I04W')//True Mutilator
call Shops.addItemLink('I03O', 'I05G')
call Shops.addItemLink('I03P', 'I02C')//Agility Weapons
call Shops.addItemLink('I03P', 'I02E')
//call Shops.addItemLink('I03P', 'I02G')
call Shops.addItemLink('I03P', 'I04B')
call Shops.addItemLink('I03P', 'I04C')
call Shops.addItemLink('I03P', 'I02M')
call Shops.addItemLink('I03P', 'I02N')
call Shops.addItemLink('I03P', 'I02O')
call Shops.addItemLink('I03P', 'I04U')
call Shops.addItemLink('I03P', 'I04V')
call Shops.addItemLink('I05S', 'I02G')
call Shops.addItemLink('I05S', 'I05R')
call Shops.addItemLink('I05S', 'I05U')
call Shops.addItemLink('I03Q', 'I020')//Caster Weapons
call Shops.addItemLink('I03Q', 'I029')
call Shops.addItemLink('I03Q', 'I05V')
//call Shops.addItemLink('I03Q', 'I037')
call Shops.addItemLink('I03Q', 'I027')
call Shops.addItemLink('I03Q', 'I045')
call Shops.addItemLink('I03Q', 'I032')
call Shops.addItemLink('I03Q', 'I03F')
call Shops.addItemLink('I03Q', 'I040')
call Shops.addItemLink('I03Q', 'I04T')
call Shops.addItemLink('I055', 'I058')
call Shops.addItemLink('I055', 'I037')
call Shops.addItemLink('I055', 'I05I')
call Shops.addItemLink('I055', 'I05P')
call Shops.addItemLink('I055', 'I05Q')
call Shops.addItemLink('I055', 'I02Y')
call Shops.addItemLink('I03U', 'I02H')//Armors
call Shops.addItemLink('I03U', 'I02I')
call Shops.addItemLink('I03U', 'I02J')
call Shops.addItemLink('I03U', 'I02K')
call Shops.addItemLink('I03U', 'I04O')//Demon Carapace
call Shops.addItemLink('I03U', 'I04P')//Demon Vessel
call Shops.addItemLink('I03T', 'I01Z')
call Shops.addItemLink('I03T', 'I02R')
call Shops.addItemLink('I03T', 'I02T')
call Shops.addItemLink('I03T', 'I02Z')
call Shops.addItemLink('I03T', 'I05D')
call Shops.addItemLink('I03T', 'I05F')
call Shops.addItemLink('I03T', 'I05J')
call Shops.addItemLink('I03T', 'I05M')
call Shops.addItemLink('I03R', 'I01V')
call Shops.addItemLink('I03R', 'I01W')
call Shops.addItemLink('I03R', 'I012')
call Shops.addItemLink('I03R', 'I01Q')
call Shops.addItemLink('I03R', 'I01R')
call Shops.addItemLink('I03S', 'I02D')
call Shops.addItemLink('I03S', 'I02F')
call Shops.addItemLink('I03S', 'I03B')
call Shops.addItemLink('I03S', 'I049')
call Shops.addItemLink('I03S', 'I039')
call Shops.addItemLink('I03S', 'I030')
call Shops.addItemLink('I03S', 'I02S')
call Shops.addItemLink('I03S', 'I05B')
//call itemAvailableForPlayerId('ofir', 0, false) we disable selling of Orb of fire for Player Red
// Now we link items to the armor category
// Now we will create a return to upper category button for the weapons category
call Shops.duplicate('I03G','I04J') //Return,Main
call Shops.addItemLink('I03M', 'I04J')//Misc, Return
call Shops.addItemLink('I03K', 'I04J')//Boots, Return
call Shops.addItemLink('I03I', 'I04J')//Weapons, Return to Main
call Shops.addItemLink('I03L', 'I04J')//Trinkets, Return to Main
call Shops.addItemLink('I03J', 'I04J')//Defensive Items, Return to Main
call Shops.duplicate('I03I','I04K')//Return, to Weapons Category
call Shops.addItemLink('I03Q', 'I04K')//Caster Weapon Return
call Shops.addItemLink('I03P', 'I04K')//Agility Weapon Return
call Shops.addItemLink('I03O', 'I04K')//Melee Weapon Return
call Shops.addItemLink('I03N', 'I04K')//Standard Weapon Return
call Shops.duplicate('I03Q','I057')
call Shops.addItemLink('I055', 'I057')
call Shops.duplicate('I03P','I05T')
call Shops.addItemLink('I05S','I05T')
call Shops.duplicate('I03J','I04L')//Return, to Defensive Category
call Shops.addItemLink('I03U', 'I04L')//Armor Return
call Shops.addItemLink('I03T', 'I04L')//Shields Return
call Shops.duplicate('I03L','I04M')//Return, to Trinkets Category
call Shops.addItemLink('I03R', 'I04M')//Rings Return
call Shops.addItemLink('I03S', 'I04M')//Crystals Return
//call Shops.duplicate('I03O','I03H') //Armor
//call Shops.duplicate('I03P','I03H')
//call Shops.duplicate('I03Q','I03H')
//call Shops.duplicate('I03T','I03H')
//call Shops.duplicate('I03U','I03H')
//call Shops.duplicate('I03R','I03H')
//call Shops.duplicate('I03I','I03H') //Equipments
//call Shops.duplicate('I03J','I03H') //Potions
//call Shops.duplicate('I03L','I03H')
//call Shops.duplicate('I03M','I03H')
//call Shops.duplicate('I03K','I03H')
//call Shops.duplicate('I03Q','I03H')
//call Shops.addItemLink('I03N','I03H') //Weapons
//call Shops.addItemLink('I03O','I03H') //Armor
//call Shops.addItemLink('I03P','I03H')
//call Shops.addItemLink('I03Q','I03H')
//call Shops.addItemLink('I03T','I03H')
//call Shops.addItemLink('I03U','I03H')
//call Shops.addItemLink('I03R','I03H')
//call Shops.addItemLink('I03Q','I03H')
// the .duplicate method automatically registers the new item so no need to call .register
// Upper category of weapons is equipments so we duplicate its instance into the upper category dummy
//call Shops.addItemLink('I003', 'I03H') // Don't forget to link it to the weapons dummy
// Now we will create another shop at the left which sells the items in the weapons category of our
// previous shop.
//set shop = CreateUnit(Player(15), 'n001', 93.4, -1430.0, 270.0)
//call MainShops.register(shop, 'I006')
// We actually created a new dummy item since this shop cannot have the return to upper
// category option since it sells the items from the weapons category directly
// to easily do this:
//call Shops.duplicate('I003', 'I006') // we duplicate the weapons category
//call Shops.removeItem('I006', 'I03H') // but remove the return to upper category item from the duplicated instance.
set shop=null
endfunction
private function init takes nothing returns nothing
call TimerStart(CreateTimer(), 0.00, false, function create)
endfunction
endlibrary
scope SampleDialogSystem initializer Init
globals
private dialog array Dialog
private button array Button
private button array PlayerButton[25][10]
private trigger T=CreateTrigger()
endglobals
private function GetTitle takes player p, integer slot returns string
local string s = SaveFile(slot).getTitle()
if (s == null or s == "") then
return "Empty"
endif
if (StringLength(s) > 32) then
set s = SubString(s, 0, 26) + "...)"
endif
return s
endfunction
private function OnButtonClick takes nothing returns boolean
local button b = GetClickedButton()
local player p = GetTriggerPlayer()
local string s = ""
local integer pid = GetPlayerId(p)
local boolean safe = (File.ReadEnabled and GetLocalPlayer() == p)
local User u = User(pid)
local integer curSlot = SaveHelper.GetSaveSlot(u)
if (b == Button[(u.id*12)+0]) then // save char
if (curSlot == 0) then
call DialogClear(Dialog[(u.id*12)+2])
call DialogSetMessage(Dialog[(u.id*12)+2], "|cffff8000Save Character|r")
if (not safe) then
call ClearTextMessages()
call DisplayTimedTextToPlayer(p, 0, 0, 60000, udg_LocalFiles_WarningMessage)
endif
set PlayerButton[pid][10] = DialogAddButton(Dialog[(u.id*12)+2], "|cffffcc00[1] |cffffffff" + GetTitle(p, 1) + "|r", 0)
set PlayerButton[pid][11] = DialogAddButton(Dialog[(u.id*12)+2], "|cffffcc00[2] |cffffffff" + GetTitle(p, 2), 0)
set PlayerButton[pid][12] = DialogAddButton(Dialog[(u.id*12)+2], "|cffffcc00[3] |cffffffff" + GetTitle(p, 3), 0)
set PlayerButton[pid][13] = DialogAddButton(Dialog[(u.id*12)+2], "|cffffcc00[4] |cffffffff" + GetTitle(p, 4), 0)
set PlayerButton[pid][14] = DialogAddButton(Dialog[(u.id*12)+2], "|cffffcc00[5] |cffffffff" + GetTitle(p, 5), 0)
call DialogAddButton(Dialog[(u.id*12)+2], "|cffff8000Close", 0)
call DialogDisplay(GetLocalPlayer(), Dialog[(u.id*12)+2], safe)
else
call SaveCharToSlot(udg_SavePlayerHero[pid], curSlot, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
call DisplayTextToPlayer(u.toPlayer(), 0, 0, "|cffffcc00[" + I2S(curSlot) + "]|r " + SaveHelper.GetUnitTitle(SaveHelper.GetUserHero(u)))
endif
elseif(b == Button[(u.id*12)+1]) then // load char
if (not safe) then
call ClearTextMessages()
call ClearTextMessages()
call DisplayTimedTextToPlayer(p, 0, 0, 60000, udg_LocalFiles_WarningMessage)
endif
call DialogClear(Dialog[(u.id*12)+1])
call DialogSetMessage(Dialog[(u.id*12)+1], "|cffff8000Load Character|r")
set PlayerButton[pid][20] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00Autosave - |cffffffff" + GetTitle(p, 10), 0)
set PlayerButton[pid][0] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00[1] |cffffffff" + GetTitle(p, 1), 0)
set PlayerButton[pid][1] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00[2] |cffffffff" + GetTitle(p, 2), 0)
set PlayerButton[pid][2] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00[3] |cffffffff" + GetTitle(p, 3), 0)
set PlayerButton[pid][3] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00[4] |cffffffff" + GetTitle(p, 4), 0)
set PlayerButton[pid][4] = DialogAddButton(Dialog[(u.id*12)+1], "|cffffcc00[5] |cffffffff" + GetTitle(p, 5), 0)
call DialogAddButton(Dialog[(u.id*12)+1], "|cffff8000Close", 0)
call DialogDisplay(p, Dialog[(u.id*12)+1], safe)
elseif(b == Button[(u.id*12)+2]) then // load char
if (not safe) then
call ClearTextMessages()
call DisplayTimedTextToPlayer(p,0,0,60000, udg_LocalFiles_WarningMessage)
endif
call DialogClear(Dialog[(u.id*12)+3])
call DialogSetMessage(Dialog[(u.id*12)+3], "|cffff8000Delete Character|r")
set PlayerButton[pid][5] = DialogAddButton(Dialog[(u.id*12)+3], "|cffff0000[X] - |cffffffff" + GetTitle(p, 1), 0)
set PlayerButton[pid][6] = DialogAddButton(Dialog[(u.id*12)+3], "|cffff0000[X] - |cffffffff" + GetTitle(p, 2), 0)
set PlayerButton[pid][7] = DialogAddButton(Dialog[(u.id*12)+3], "|cffff0000[X] - |cffffffff" + GetTitle(p, 3), 0)
set PlayerButton[pid][8] = DialogAddButton(Dialog[(u.id*12)+3], "|cffff0000[X] - |cffffffff" + GetTitle(p, 4), 0)
set PlayerButton[pid][9] = DialogAddButton(Dialog[(u.id*12)+3], "|cffff0000[X] - |cffffffff" + GetTitle(p, 5), 0)
call DialogAddButton(Dialog[(u.id*12)+3], "|cffff8000Close", 0)
call DialogDisplay(p, Dialog[(u.id*12)+3], safe)
elseif(b == PlayerButton[pid][0]) then
call LoadSaveSlot(p, 1)
elseif(b == PlayerButton[pid][1]) then
call LoadSaveSlot(p, 2)
elseif(b == PlayerButton[pid][2]) then
call LoadSaveSlot(p, 3)
elseif(b == PlayerButton[pid][3]) then
call LoadSaveSlot(p, 4)
elseif(b == PlayerButton[pid][4]) then
call LoadSaveSlot(p, 5)
elseif(b == PlayerButton[pid][20]) then
call LoadSaveSlot(p, 10)
elseif(b == PlayerButton[pid][5]) then
call DeleteCharSlot(p, 1)
elseif(b == PlayerButton[pid][6]) then
call DeleteCharSlot(p, 2)
elseif(b == PlayerButton[pid][7]) then
call DeleteCharSlot(p, 3)
elseif(b == PlayerButton[pid][8]) then
call DeleteCharSlot(p, 4)
elseif(b == PlayerButton[pid][9]) then
call DeleteCharSlot(p, 5)
elseif(b == PlayerButton[pid][10]) then
call SaveCharToSlot(udg_SavePlayerHero[pid], 1, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
elseif(b == PlayerButton[pid][11]) then
call SaveCharToSlot(udg_SavePlayerHero[pid], 2, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
elseif(b == PlayerButton[pid][12]) then
call SaveCharToSlot(udg_SavePlayerHero[pid], 3, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
elseif(b == PlayerButton[pid][13]) then
call SaveCharToSlot(udg_SavePlayerHero[pid], 4, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
elseif(b == PlayerButton[pid][14]) then
call SaveCharToSlot(udg_SavePlayerHero[pid], 5, GetHeroSaveCode(SaveHelper.GetUserHero(u)))
endif
return false
endfunction
private function ShowMenu takes nothing returns boolean
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p)
if (GetLocalPlayer() == p) then
call DialogSetMessage(Dialog[(i*12)+0], "|cffff8000Main Menu|r")
call DialogDisplay(p, Dialog[(i*12)+0], true)
endif
return false
endfunction
private function InitDialog takes nothing returns nothing
local integer i = 0
local trigger t = CreateTrigger()
local User u
loop
exitwhen i == User.AmountPlaying
set u = User.fromPlaying(i)
set Dialog[(u.id*12)+0] = DialogCreate()
set Button[(u.id*12)+0] = DialogAddButton(Dialog[(u.id*12)+0], "|cffffcc00Save Character", 0)
set Button[(u.id*12)+1] = DialogAddButton(Dialog[(u.id*12)+0], "|cffffcc00Load Character", 0)
set Button[(u.id*12)+2] = DialogAddButton(Dialog[(u.id*12)+0], "|cffffcc00Delete Character", 0)
call DialogAddButton(Dialog[(u.id*12)+0], "|cffff8000Close", 0)
set Dialog[(u.id*12)+1] = DialogCreate()
set Dialog[(u.id*12)+2] = DialogCreate()
set Dialog[(u.id*12)+3] = DialogCreate()
call TriggerRegisterDialogEvent(t, Dialog[(u.id*12)+0])
call TriggerRegisterDialogEvent(t, Dialog[(u.id*12)+1])
call TriggerRegisterDialogEvent(t, Dialog[(u.id*12)+2])
call TriggerRegisterDialogEvent(t, Dialog[(u.id*12)+3])
set i = i + 1
endloop
call TriggerAddCondition(t, Filter(function OnButtonClick))
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
//set CurrentCharSaveSlot[i] = -1
call TriggerRegisterPlayerEvent(t, Player(i), EVENT_PLAYER_END_CINEMATIC)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Filter(function ShowMenu))
call TimerStart(CreateTimer(), 0, false, function InitDialog)
endfunction
endscope
function Trig_HeroNames_Actions takes nothing returns nothing
set udg_SaveNameList[0] = null
// Blood Mage
set udg_SaveNameList[72] = "Eldin Sunstrider"
set udg_SaveNameList[1] = "Tanin Hawkwing"
set udg_SaveNameList[2] = "Lorn Bloodseeker"
set udg_SaveNameList[3] = "Aldos Firestar"
set udg_SaveNameList[4] = "Gilaras Drakeson"
set udg_SaveNameList[5] = "Hale Magefire"
set udg_SaveNameList[6] = "Kath'ranis Remar"
set udg_SaveNameList[7] = "Tyoril Sunchaser"
set udg_SaveNameList[8] = "Sylvos Windrunner"
set udg_SaveNameList[9] = "Tenris Mirkblood"
set udg_SaveNameList[10] = "Marakanis Starfury"
set udg_SaveNameList[11] = "Geldor Earthfire"
set udg_SaveNameList[12] = "Halendor Burnkin"
set udg_SaveNameList[13] = "Kelen the Destroyer"
// Tauren Chieften
set udg_SaveNameList[14] = "Marn Thunderhorn"
set udg_SaveNameList[15] = "Tygore Dusthoof"
set udg_SaveNameList[16] = "Tam Windtotem"
set udg_SaveNameList[17] = "Durn Harpyslayer"
set udg_SaveNameList[18] = "Kam Ghoststeer"
set udg_SaveNameList[19] = "Kel Stonebull"
set udg_SaveNameList[20] = "Mull Stormhoof"
set udg_SaveNameList[21] = "Grok Bloodhorn"
set udg_SaveNameList[22] = "Malar Plainstrider"
set udg_SaveNameList[23] = "Taur Runetotem"
// Lich
set udg_SaveNameList[24] = "Ordin Frostbane"
set udg_SaveNameList[25] = "Ras Splinterspine"
set udg_SaveNameList[26] = "Morbent Fell"
set udg_SaveNameList[27] = "Rage Winterchill"
set udg_SaveNameList[28] = "Araj the Summoner"
set udg_SaveNameList[29] = "Kali'naj Dethknell"
set udg_SaveNameList[30] = "Rak Coldskull"
set udg_SaveNameList[31] = "Din Frostfire"
set udg_SaveNameList[32] = "Calis Wraithson"
set udg_SaveNameList[33] = "Venim Iceblade"
set udg_SaveNameList[34] = "Naze the Eternal"
set udg_SaveNameList[35] = "Ras Frostwhisper"
set udg_SaveNameList[36] = "Coldreaver"
set udg_SaveNameList[37] = "Cho'Nammoth"
set udg_SaveNameList[38] = "Kryptikk Soulslayer"
set udg_SaveNameList[39] = "Alandil Lieng"
// Demon Hunter
set udg_SaveNameList[40] = "Shadowsong"
set udg_SaveNameList[41] = "Shadowfury"
set udg_SaveNameList[42] = "Shadowstalker"
set udg_SaveNameList[43] = "Flameseeker"
set udg_SaveNameList[44] = "Darkweaver"
set udg_SaveNameList[45] = "Darkterror"
set udg_SaveNameList[46] = "Darksorrow"
set udg_SaveNameList[47] = "Sindweller"
set udg_SaveNameList[48] = "Painkiller"
set udg_SaveNameList[49] = "Hellbourne"
set udg_SaveNameList[50] = "Wrathbringer"
set udg_SaveNameList[51] = "Ragerunner"
set udg_SaveNameList[52] = "Firebrand"
set udg_SaveNameList[53] = "Bloodwrath"
set udg_SaveNameList[54] = "Terrorblade"
// Naga Sea Witch
set udg_SaveNameList[55] = "Anna Kondra"
set udg_SaveNameList[56] = "Scilla Murkshadow"
set udg_SaveNameList[57] = "Ursula Snakemane"
set udg_SaveNameList[58] = "Lady Venomtongue"
set udg_SaveNameList[59] = "Lady Serpentra"
set udg_SaveNameList[60] = "Lady Darkscale"
set udg_SaveNameList[61] = "Serena Scarscale"
set udg_SaveNameList[62] = "Asprah Serpus"
set udg_SaveNameList[63] = "Venna Seastorm"
set udg_SaveNameList[64] = "Charib'dishal"
// Beastmaster
set udg_SaveNameList[65] = "Mag Bearmaul"
set udg_SaveNameList[66] = "Tagar Bearclaw"
set udg_SaveNameList[67] = "Gorsh Talonfang"
set udg_SaveNameList[68] = "Maxx Rocmane"
set udg_SaveNameList[69] = "Gaz Boartusk"
set udg_SaveNameList[70] = "Mok Rocksnout"
set udg_SaveNameList[71] = "Gish Eagle Eye"
endfunction
//===========================================================================
function InitTrig_HeroNames takes nothing returns nothing
set gg_trg_HeroNames = CreateTrigger( )
call TriggerAddAction( gg_trg_HeroNames, function Trig_HeroNames_Actions )
endfunction
library SaveHelperLib initializer Init requires SyncHelper, PlayerUtils, SaveFile
// Uses GUI variables from the "Save Init" trigger. You can modify these functions to use your own variables.
private keyword SaveHelperInit
struct SaveHelper extends array
static constant hashtable Hashtable = InitHashtable()
static constant integer KEY_ITEMS = 1
static constant integer KEY_UNITS = 2
static constant integer KEY_NAMES = 3
static method MaxCodeSyncLength takes nothing returns integer
return udg_SaveLoadMaxLength
endmethod
static method GetUserHero takes User user returns unit
return udg_SavePlayerHero[user.id]
endmethod
static method RemoveUserHero takes User user returns nothing
call RemoveUnit(udg_SavePlayerHero[user.id])
set udg_SavePlayerHero[user.id] = null
endmethod
static method SetUserHero takes User user, unit u returns nothing
set udg_SavePlayerHero[user.id] = u
endmethod
static method IsUserLoading takes User user returns boolean
return udg_SavePlayerLoading[user.id]
endmethod
static method SetUserLoading takes User user, boolean flag returns nothing
set udg_SavePlayerLoading[user.id] = flag
endmethod
static method SetSaveSlot takes User user, integer slot returns nothing
set udg_SaveCurrentSlot[user.id] = slot
endmethod
static method GetSaveSlot takes User user returns integer
return udg_SaveCurrentSlot[user.id]
endmethod
static method GetUnitTitle takes unit u returns string
return GetObjectName(GetUnitTypeId(u)) + " (" + GetHeroProperName(u) + ")"
endmethod
static method GetMapName takes nothing returns string
return udg_MapName
endmethod
static method MaxAbilityLevel takes nothing returns integer
return 10
endmethod
static method MaxAbilities takes nothing returns integer
return udg_SaveAbilityTypeMax
endmethod
static method MaxItems takes nothing returns integer
return udg_SaveItemTypeMax
endmethod
static method MaxUnits takes nothing returns integer
return udg_SaveUnitTypeMax
endmethod
static method MaxNames takes nothing returns integer
return udg_SaveNameMax
endmethod
static method MaxHeroStat takes nothing returns integer
return udg_SaveUnitMaxStat
endmethod
static method GetAbility takes integer index returns integer
return udg_SaveAbilityType[index]
endmethod
static method GetItem takes integer index returns integer
return udg_SaveItemType[index]
endmethod
static method GetUnit takes integer index returns integer
return udg_SaveUnitType[index]
endmethod
static method ConvertItemId takes integer itemId returns integer
return LoadInteger(thistype.Hashtable, KEY_ITEMS, itemId)
endmethod
static method ConvertUnitId takes integer unitId returns integer
return LoadInteger(thistype.Hashtable, KEY_UNITS, unitId)
endmethod
static method GetHeroNameFromID takes integer id returns string
return udg_SaveNameList[id]
endmethod
static method GetHeroNameID takes string name returns integer
return LoadInteger(thistype.Hashtable, KEY_NAMES, StringHash(name))
endmethod
static method ConvertHeroName takes string name returns string
return udg_SaveNameList[GetHeroNameID(name)]
endmethod
static method GUILoadNext takes nothing returns nothing
set udg_SaveValue[udg_SaveCount] = Savecode(udg_SaveTempInt).Decode(udg_SaveMaxValue[udg_SaveCount])
endmethod
static method GetLevelXP takes integer level returns real
local real xp = udg_HeroXPLevelFactor // level 1
local integer i = 1
loop
exitwhen i > level
set xp = (xp*udg_HeroXPPrevLevelFactor) + (i+1) * udg_HeroXPLevelFactor
set i = i + 1
endloop
return xp-udg_HeroXPLevelFactor
endmethod
static method Init takes nothing returns nothing // called at the end of "Save Init" trigger
local integer i = 0
loop
exitwhen i >= thistype.MaxItems() //or udg_SaveItemType[i] == 0
call SaveInteger(thistype.Hashtable, KEY_ITEMS, udg_SaveItemType[i], i)
set i = i + 1
endloop
set i = 0
loop
exitwhen i >= thistype.MaxUnits() //or udg_SaveUnitType[i] == 0
call SaveInteger(thistype.Hashtable, KEY_UNITS, udg_SaveUnitType[i], i)
set i = i + 1
endloop
set i = 1
loop
exitwhen i >= SaveHelper.MaxNames() or udg_SaveNameList[i] == "" or udg_SaveNameList[i] == null
call SaveInteger(thistype.Hashtable, KEY_NAMES, StringHash(udg_SaveNameList[i]), i)
set i = i + 1
endloop
endmethod
endstruct
function GetHeroSaveCode takes unit u returns string
if (udg_SaveUseGUI) then
call TriggerExecute(gg_trg_Save_GUI)
return udg_SaveTempString
endif
return ""
endfunction
private function LoadSaveSlot_OnLoad takes nothing returns nothing
local player p = GetTriggerPlayer()
local string prefix = BlzGetTriggerSyncPrefix()
local string data = BlzGetTriggerSyncData()
local User user = User[p]
call SaveHelper.SetUserLoading(user, false)
if (udg_SaveUseGUI) then
set udg_SaveLoadEvent_Code = data
set udg_SaveLoadEvent_Player = p
set udg_SaveLoadEvent = 1.
set udg_SaveLoadEvent = -1
endif
endfunction
function LoadSaveSlot takes player p, integer slot returns nothing
local SaveFile savefile = SaveFile(slot)
local string s
local User user = User[p]
if (not SaveFile.exists(slot)) then
call DisplayTextToPlayer(p, 0, 0, "Did not find any save data.")
return
elseif (SaveHelper.IsUserLoading(user)) then
call DisplayTextToPlayer(p, 0, 0, "Please wait while your character synchronizes.")
else
set s = savefile.getData()
if (GetLocalPlayer() == p) then
call SyncString(s)
endif
call ClearTextMessages()
call DisplayTimedTextToPlayer(p, 0, 0, 15, "Synchronzing with other players...")
call SaveHelper.SetSaveSlot(user, slot)
endif
endfunction
function DeleteCharSlot takes player p, integer slot returns nothing
if (GetLocalPlayer() == p) then
call SaveFile(slot).clear(p, slot)
endif
endfunction
function SaveCharToSlot takes unit u, integer slot, string s returns nothing
local player p = GetOwningPlayer(u)
if (GetLocalPlayer() == p) then
call SaveFile(slot).create(p, SaveHelper.GetUnitTitle(u), slot, s)
endif
call SaveHelper.SetSaveSlot(User[p], slot)
endfunction
private function Init takes nothing returns nothing
call OnSyncString(function LoadSaveSlot_OnLoad)
endfunction
endlibrary
library SyncHelper
globals
public constant string SYNC_PREFIX = "S"
endglobals
private keyword INITS
private struct Sync extends array
static trigger Trigger = CreateTrigger()
implement INITS
endstruct
function SyncString takes string s returns boolean
return BlzSendSyncData(SYNC_PREFIX, s)
endfunction
function OnSyncString takes code func returns triggeraction
return TriggerAddAction(Sync.Trigger, func)
endfunction
function RemoveSyncString takes triggeraction t returns nothing
call TriggerRemoveAction(Sync.Trigger, t)
endfunction
private module INITS
private static method onInit takes nothing returns nothing
local integer i = 0
loop
call BlzTriggerRegisterPlayerSyncEvent(.Trigger, Player(i), SYNC_PREFIX, false)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
endmethod
endmodule
endlibrary
scope Sync initializer OnInit
globals
string array SAVEDATA
endglobals
function SyncDataRead takes nothing returns nothing
set SAVEDATA[S2I(BlzGetTriggerSyncPrefix())] = BlzGetTriggerSyncData()
endfunction
function OnInit takes nothing returns nothing
local integer playerIndex = 0
local trigger trig = CreateTrigger()
call TriggerAddAction(trig, function SyncDataRead)
loop
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "0", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "1", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "2", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "3", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "4", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "5", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "6", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "7", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "8", false)
call BlzTriggerRegisterPlayerSyncEvent(trig, Player(playerIndex), "9", false)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
endscope
library SaveFile requires FileIO
private keyword SaveFileInit
struct SaveFile extends array
static constant string ManualPath = "Manual"
static constant string InvalidPath = "Unknown"
static constant integer MIN = 1
static constant integer MAX = 10
private File file
static method operator Folder takes nothing returns string
return "Enfos FFB"
endmethod
static method getPath takes integer slot returns string
if (slot == 0) then
return .Folder + "\\SaveSlot_" + .InvalidPath + ".pld"
elseif (slot > 0 and (slot < .MIN or slot > .MAX)) then
return .Folder + "\\SaveSlot_" + .InvalidPath + ".pld"
elseif (slot < 0) then
return .Folder + "\\SaveSlot_" + .ManualPath + ".pld"
endif
return .Folder + "\\SaveSlot_" + I2S(slot) + ".pld"
endmethod
static method create takes player p, string title, integer slot, string data returns thistype
if (GetLocalPlayer() == p) then
call FileIO_Write(.getPath(slot), title + "\n" + data)
endif
return slot
endmethod
static method clear takes player p, integer slot returns thistype
if (GetLocalPlayer() == p) then
call FileIO_Write(.getPath(slot), "")
endif
return slot
endmethod
static method exists takes integer slot returns boolean // async
return StringLength(FileIO_Read(.getPath(slot))) > 1
endmethod
method getLines takes integer line, boolean includePrevious returns string // async
local string contents = FileIO_Read(.getPath(this))
local integer len = StringLength(contents)
local string char = null
local string buffer = ""
local integer curLine = 0
local integer i = 0
loop
exitwhen i > len
set char = SubString(contents, i, i + 1)
if (char == "\n") then
set curLine = curLine + 1
if (curLine > line) then
return buffer
endif
if (not includePrevious) then
set buffer = ""
endif
else
set buffer = buffer + char
endif
set i = i + 1
endloop
if (curLine == line) then
return buffer
endif
return null
endmethod
method getLine takes integer line returns string // async
return .getLines(line, false)
endmethod
method getTitle takes nothing returns string // async
return .getLines(0, false)
endmethod
method getData takes nothing returns string // async
return .getLines(1, false)
endmethod
implement SaveFileInit
endstruct
private module SaveFileInit
private static method onInit takes nothing returns nothing
//set thistype.Folder = udg_MapName
endmethod
endmodule
endlibrary
library FileIO
/***************************************************************
*
* v1.1.0, by TriggerHappy
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*
* Provides functionality to read and write files.
* _________________________________________________________________________
* 1. Requirements
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* - Patch 1.29 or higher.
* - JassHelper (vJASS)
* _________________________________________________________________________
* 2. Installation
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Copy the script to your map and save it.
* _________________________________________________________________________
* 3. API
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* struct File extends array
*
* static constant integer AbilityCount
* static constant integer PreloadLimit
*
* readonly static boolean ReadEnabled
* readonly static integer Counter
* readonly static integer array List
*
* static method open takes string filename returns File
* static method create takes string filename returns File
*
* ---------
*
* method write takes string value returns File
* method read takes nothing returns string
*
* method readEx takes boolean close returns string
* method readAndClose takes nothing returns string
* method readBuffer takes nothing returns string
* method writeBuffer takes string contents returns nothing
* method appendBuffer takes string contents returns nothing
*
* method close takes nothing returns nothing
*
* public function Write takes string filename, string contents returns nothing
* public function Read takes string filename returns string
*
***************************************************************/
globals
// Enable this if you want to allow the system to read files generated in patch 1.30 or below.
// NOTE: For this to work properly you must edit the 'Amls' ability and change the levels to 2
// as well as typing something in "Level 2 - Text - Tooltip - Normal" text field.
//
// Enabling this will also cause the system to treat files written with .write("") as empty files.
//
// This setting is really only intended for those who were already using the system in their map
// prior to patch 1.31 and want to keep old files created with this system to still work.
private constant boolean BACKWARDS_COMPATABILITY = false
endglobals
private keyword FileInit
struct File extends array
static constant integer AbilityCount = 10
static constant integer PreloadLimit = 200
readonly static integer Counter = 0
readonly static integer array List
readonly static integer array AbilityList
readonly static boolean ReadEnabled = false
readonly string filename
private string buffer
static method open takes string filename returns thistype
local thistype this = .List[0]
if (this == 0) then
set this = Counter + 1
set Counter = this
else
set .List[0] = .List[this]
endif
set this.filename = filename
set this.buffer = null
debug if (this >= JASS_MAX_ARRAY_SIZE) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0, 120, "FileIO(" + filename + ") WARNING: Maximum instance limit " + I2S(JASS_MAX_ARRAY_SIZE) + " reached.")
debug endif
return this
endmethod
// This is used to detect invalid characters which aren't supported in preload files.
static if (DEBUG_MODE) then
private static method validateInput takes string contents returns string
local integer i = 0
local integer l = StringLength(contents)
local string ch = ""
loop
exitwhen i >= l
set ch = SubString(contents, i, i + 1)
if (ch == "\\") then
return ch
elseif (ch == "\"") then
return ch
endif
set i = i + 1
endloop
return null
endmethod
endif
method write takes string contents returns thistype
local integer i = 0
local integer c = 0
local integer len = StringLength(contents)
local integer lev = 0
local string prefix = "-" // this is used to signify an empty string vs a null one
local string chunk
debug if (.validateInput(contents) != null) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0, 120, "FileIO(" + filename + ") ERROR: Invalid character |cffffcc00" + .validateInput(contents) + "|r")
debug return this
debug endif
set this.buffer = null
// Check if the string is empty. If null, the contents will be cleared.
if (contents == "") then
set len = len + 1
endif
// Begin to generate the file
call PreloadGenClear()
call PreloadGenStart()
loop
exitwhen i >= len
debug if (c >= .AbilityCount) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0, 120, "FileIO(" + filename + ") ERROR: String exceeds max length (" + I2S(.AbilityCount * .PreloadLimit) + ").|r")
debug endif
set lev = 0
static if (BACKWARDS_COMPATABILITY) then
if (c == 0) then
set lev = 1
set prefix = ""
else
set prefix = "-"
endif
endif
set chunk = SubString(contents, i, i + .PreloadLimit)
call Preload("\" )\ncall BlzSetAbilityTooltip(" + I2S(.AbilityList[c]) + ", \"" + prefix + chunk + "\", " + I2S(lev) + ")\n//")
set i = i + .PreloadLimit
set c = c + 1
endloop
call Preload("\" )\nendfunction\nfunction a takes nothing returns nothing\n //")
call PreloadGenEnd(this.filename)
return this
endmethod
method clear takes nothing returns thistype
return this.write(null)
endmethod
private method readPreload takes nothing returns string
local integer i = 0
local integer lev = 0
local string array original
local string chunk = ""
local string output = ""
loop
exitwhen i == .AbilityCount
set original[i] = BlzGetAbilityTooltip(.AbilityList[i], 0)
set i = i + 1
endloop
// Execute the preload file
call Preloader(this.filename)
// Read the output
set i = 0
loop
exitwhen i == .AbilityCount
set lev = 0
// Read from ability index 1 instead of 0 if
// backwards compatability is enabled
static if (BACKWARDS_COMPATABILITY) then
if (i == 0) then
set lev = 1
endif
endif
// Make sure the tooltip has changed
set chunk = BlzGetAbilityTooltip(.AbilityList[i], lev)
if (chunk == original[i]) then
if (i == 0 and output == "") then
return null // empty file
endif
return output
endif
// Check if the file is an empty string or null
static if not (BACKWARDS_COMPATABILITY) then
if (i == 0) then
if (SubString(chunk, 0, 1) != "-") then
return null // empty file
endif
set chunk = SubString(chunk, 1, StringLength(chunk))
endif
endif
// Remove the prefix
if (i > 0) then
set chunk = SubString(chunk, 1, StringLength(chunk))
endif
// Restore the tooltip and append the chunk
call BlzSetAbilityTooltip(.AbilityList[i], original[i], lev)
set output = output + chunk
set i = i + 1
endloop
return output
endmethod
method close takes nothing returns nothing
if (this.buffer != null) then
call .write(.readPreload() + this.buffer)
set this.buffer = null
endif
set .List[this] = .List[0]
set .List[0] = this
endmethod
method readEx takes boolean close returns string
local string output = .readPreload()
local string buf = this.buffer
if (close) then
call this.close()
endif
if (output == null) then
return buf
endif
if (buf != null) then
set output = output + buf
endif
return output
endmethod
method read takes nothing returns string
return .readEx(false)
endmethod
method readAndClose takes nothing returns string
return .readEx(true)
endmethod
method appendBuffer takes string contents returns thistype
set .buffer = .buffer + contents
return this
endmethod
method readBuffer takes nothing returns string
return .buffer
endmethod
method writeBuffer takes string contents returns nothing
set .buffer = contents
endmethod
static method create takes string filename returns thistype
return .open(filename).write("")
endmethod
implement FileInit
endstruct
private module FileInit
private static method onInit takes nothing returns nothing
local string originalTooltip
// We can't use a single ability with multiple levels because
// tooltips return the first level's value if the value hasn't
// been set. This way we don't need to edit any object editor data.
set File.AbilityList[0] = 'Amls'
set File.AbilityList[1] = 'Aroc'
set File.AbilityList[2] = 'Amic'
set File.AbilityList[3] = 'Amil'
set File.AbilityList[4] = 'Aclf'
set File.AbilityList[5] = 'Acmg'
set File.AbilityList[6] = 'Adef'
set File.AbilityList[7] = 'Adis'
set File.AbilityList[8] = 'Afbt'
set File.AbilityList[9] = 'Afbk'
// Backwards compatability check
static if (BACKWARDS_COMPATABILITY) then
static if (DEBUG_MODE) then
set originalTooltip = BlzGetAbilityTooltip(File.AbilityList[0], 1)
call BlzSetAbilityTooltip(File.AbilityList[0], SCOPE_PREFIX, 1)
if (BlzGetAbilityTooltip(File.AbilityList[0], 1) == originalTooltip) then
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0, 120, "FileIO WARNING: Backwards compatability enabled but \"" + GetObjectName(File.AbilityList[0]) + "\" isn't setup properly.|r")
endif
endif
endif
// Read check
set File.ReadEnabled = File.open("FileTester.pld").write(SCOPE_PREFIX).readAndClose() == SCOPE_PREFIX
endmethod
endmodule
public function Write takes string filename, string contents returns nothing
call File.open(filename).write(contents).close()
endfunction
public function Read takes string filename returns string
return File.open(filename).readEx(true)
endfunction
endlibrary
library PlayerUtils
/**************************************************************
*
* v1.2.9 by TriggerHappy
*
* This library provides a struct which caches data about players
* as well as provides functionality for manipulating player colors.
*
* Constants
* ------------------
*
* force FORCE_PLAYING - Player group of everyone who is playing.
*
* Struct API
* -------------------
* struct User
*
* static method fromIndex takes integer i returns User
* static method fromLocal takes nothing returns User
* static method fromPlaying takes integer id returns User
*
* static method operator [] takes integer id returns User
* static method operator count takes nothing returns integer
*
* method operator name takes nothing returns string
* method operator name= takes string name returns nothing
* method operator color takes nothing returns playercolor
* method operator color= takes playercolor c returns nothing
* method operator defaultColor takes nothing returns playercolor
* method operator hex takes nothing returns string
* method operator nameColored takes nothing returns string
*
* method toPlayer takes nothing returns player
* method colorUnits takes playercolor c returns nothing
*
* readonly string originalName
* readonly boolean isPlaying
* readonly static player Local
* readonly static integer LocalId
* readonly static integer AmountPlaying
* readonly static playercolor array Color
* readonly static player array PlayingPlayer
*
**************************************************************/
globals
// automatically change unit colors when changing player color
private constant boolean AUTO_COLOR_UNITS = true
// use an array for name / color lookups (instead of function calls)
private constant boolean ARRAY_LOOKUP = false
// this only applies if ARRAY_LOOKUP is true
private constant boolean HOOK_SAFETY = false // disable for speed, but only use the struct to change name/color safely
constant force FORCE_PLAYING = CreateForce()
private string array Name
private string array Hex
private string array OriginalHex
private playercolor array CurrentColor
endglobals
private keyword PlayerUtilsInit
struct User extends array
static constant integer NULL = bj_MAX_PLAYER_SLOTS
readonly player handle
readonly integer id
readonly thistype next
readonly thistype prev
readonly string originalName
readonly boolean isPlaying
readonly static thistype first
readonly static thistype last
readonly static player Local
readonly static integer LocalId
readonly static integer AmountPlaying = 0
readonly static playercolor array Color
static if not (LIBRARY_GroupUtils) then
readonly static group ENUM_GROUP = CreateGroup()
endif
private static thistype array PlayingPlayer
private static integer array PlayingPlayerIndex
// similar to Player(#)
static method fromIndex takes integer i returns thistype
return thistype(i)
endmethod
// similar to GetLocalPlayer
static method fromLocal takes nothing returns thistype
return thistype(thistype.LocalId)
endmethod
// access active players array
static method fromPlaying takes integer index returns thistype
return PlayingPlayer[index]
endmethod
static method operator [] takes player p returns thistype
return thistype(GetPlayerId(p))
endmethod
method toPlayer takes nothing returns player
return this.handle
endmethod
method operator name takes nothing returns string
static if (ARRAY_LOOKUP) then
return Name[this]
else
return GetPlayerName(this.handle)
endif
endmethod
method operator name= takes string newName returns nothing
call SetPlayerName(this.handle, newName)
static if (ARRAY_LOOKUP) then
static if not (HOOK_SAFETY) then
set Name[this] = newName
endif
endif
endmethod
method operator color takes nothing returns playercolor
static if (ARRAY_LOOKUP) then
return CurrentColor[this]
else
return GetPlayerColor(this.handle)
endif
endmethod
method operator hex takes nothing returns string
return OriginalHex[GetHandleId(this.color)]
endmethod
method operator color= takes playercolor c returns nothing
call SetPlayerColor(this.handle, c)
static if (ARRAY_LOOKUP) then
set CurrentColor[this] = c
static if not (HOOK_SAFETY) then
static if (AUTO_COLOR_UNITS) then
call this.colorUnits(color)
endif
endif
endif
endmethod
method operator defaultColor takes nothing returns playercolor
return Color[this]
endmethod
method operator nameColored takes nothing returns string
return hex + this.name + "|r"
endmethod
method colorUnits takes playercolor c returns nothing
local unit u
call GroupEnumUnitsOfPlayer(ENUM_GROUP, this.handle, null)
loop
set u = FirstOfGroup(ENUM_GROUP)
exitwhen u == null
call SetUnitColor(u, c)
call GroupRemoveUnit(ENUM_GROUP, u)
endloop
endmethod
static method onLeave takes nothing returns boolean
local thistype p = thistype[GetTriggerPlayer()]
local integer i = .PlayingPlayerIndex[p.id]
// clean up
call ForceRemovePlayer(FORCE_PLAYING, p.toPlayer())
// recycle index
set .AmountPlaying = .AmountPlaying - 1
set .PlayingPlayerIndex[i] = .PlayingPlayerIndex[.AmountPlaying]
set .PlayingPlayer[i] = .PlayingPlayer[.AmountPlaying]
if (.AmountPlaying == 1) then
set p.prev.next = User.NULL
set p.next.prev = User.NULL
else
set p.prev.next = p.next
set p.next.prev = p.prev
endif
set .last = .PlayingPlayer[.AmountPlaying]
set p.isPlaying = false
return false
endmethod
implement PlayerUtilsInit
endstruct
private module PlayerUtilsInit
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
local thistype p
set thistype.Local = GetLocalPlayer()
set thistype.LocalId = GetPlayerId(thistype.Local)
set OriginalHex[0] = "|cffff0303"
set OriginalHex[1] = "|cff0042ff"
set OriginalHex[2] = "|cff1ce6b9"
set OriginalHex[3] = "|cff540081"
set OriginalHex[4] = "|cfffffc01"
set OriginalHex[5] = "|cfffe8a0e"
set OriginalHex[6] = "|cff20c000"
set OriginalHex[7] = "|cffe55bb0"
set OriginalHex[8] = "|cff959697"
set OriginalHex[9] = "|cff7ebff1"
set OriginalHex[10] = "|cff106246"
set OriginalHex[11] = "|cff4e2a04"
if (bj_MAX_PLAYERS > 12) then
set OriginalHex[12] = "|cff9B0000"
set OriginalHex[13] = "|cff0000C3"
set OriginalHex[14] = "|cff00EAFF"
set OriginalHex[15] = "|cffBE00FE"
set OriginalHex[16] = "|cffEBCD87"
set OriginalHex[17] = "|cffF8A48B"
set OriginalHex[18] = "|cffBFFF80"
set OriginalHex[19] = "|cffDCB9EB"
set OriginalHex[20] = "|cff282828"
set OriginalHex[21] = "|cffEBF0FF"
set OriginalHex[22] = "|cff00781E"
set OriginalHex[23] = "|cffA46F33"
endif
set thistype.first = User.NULL
loop
exitwhen i == bj_MAX_PLAYERS
set p = User(i)
set p.handle = Player(i)
set p.id = i
set thistype.Color[i] = GetPlayerColor(p.handle)
set CurrentColor[i] = thistype.Color[i]
if (GetPlayerController(p.handle) == MAP_CONTROL_USER and GetPlayerSlotState(p.handle) == PLAYER_SLOT_STATE_PLAYING) then
set .PlayingPlayer[AmountPlaying] = p
set .PlayingPlayerIndex[i] = .AmountPlaying
set .last = i
if (.first == User.NULL) then
set .first = i
set User(i).next = User.NULL
set User(i).prev = User.NULL
else
set User(i).prev = PlayingPlayer[AmountPlaying-1].id
set PlayingPlayer[AmountPlaying-1].next = User(i)
set User(i).next = User.NULL
endif
set p.isPlaying = true
call TriggerRegisterPlayerEvent(t, p.handle, EVENT_PLAYER_LEAVE)
call ForceAddPlayer(FORCE_PLAYING, p.handle)
set Hex[p] = OriginalHex[GetHandleId(thistype.Color[i])]
set .AmountPlaying = .AmountPlaying + 1
endif
set Name[p] = GetPlayerName(p.handle)
set p.originalName=Name[p]
set i = i + 1
endloop
call TriggerAddCondition(t, Filter(function thistype.onLeave))
endmethod
endmodule
//===========================================================================
static if (ARRAY_LOOKUP) then
static if (HOOK_SAFETY) then
private function SetPlayerNameHook takes player whichPlayer, string name returns nothing
set Name[GetPlayerId(whichPlayer)] = name
endfunction
private function SetPlayerColorHook takes player whichPlayer, playercolor color returns nothing
local User p = User[whichPlayer]
set Hex[p] = OriginalHex[GetHandleId(color)]
set CurrentColor[p] = color
static if (AUTO_COLOR_UNITS) then
call p.colorUnits(color)
endif
endfunction
hook SetPlayerName SetPlayerNameHook
hook SetPlayerColor SetPlayerColorHook
endif
endif
endlibrary
library Savecode requires BigNum
private constant function uppercolor takes nothing returns string
return "|cffff0000"
endfunction
private constant function lowercolor takes nothing returns string
return "|cff00ff00"
endfunction
private constant function numcolor takes nothing returns string
return "|cff0000ff"
endfunction
private function player_charset takes nothing returns string
return "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
endfunction
private function player_charsetlen takes nothing returns integer
return StringLength(player_charset())
endfunction
private function charset takes nothing returns string
return "!#$%&'()*+,-.0123456789:;=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}`"
endfunction
private function charsetlen takes nothing returns integer
return StringLength(charset())
endfunction
private function BASE takes nothing returns integer
return charsetlen()
endfunction
private constant function HASHN takes nothing returns integer
return 5000 //1./HASHN() is the probability of a random code being valid
endfunction
private constant function MAXINT takes nothing returns integer
return 2147483647
endfunction
private function player_chartoi takes string c returns integer
local integer i = 0
local string cs = player_charset()
local integer len = player_charsetlen()
loop
exitwhen i>=len or c == SubString(cs,i,i+1)
set i = i + 1
endloop
return i
endfunction
private function chartoi takes string c returns integer
local integer i = 0
local string cs = charset()
local integer len = charsetlen()
loop
exitwhen i>=len or c == SubString(cs,i,i+1)
set i = i + 1
endloop
return i
endfunction
private function itochar takes integer i returns string
return SubString(charset(),i,i+1)
endfunction
//You probably want to use a different char set for this
//Also, use a hash that doesn't suck so much
private function scommhash takes string s returns integer
local integer array count
local integer i = 0
local integer len = StringLength(s)
local integer x
set s = StringCase(s,true)
loop
exitwhen i >= len
set x = player_chartoi(SubString(s,i,i+1))
set count[x] = count[x] + 1
set i = i + 1
endloop
set i = 0
set len = player_charsetlen()
set x = 0
loop
exitwhen i>= len
set x = count[i]*count[i]*i+count[i]*x+x+199
// call BJDebugMsg(I2S(x)+" "+I2S(count[i]))
// call TriggerSleepAction(0.)
set i = i + 1
endloop
if x < 0 then
set x = -x
endif
return x
endfunction
private function modb takes integer x returns integer
if x >= BASE() then
return x - BASE()
elseif x < 0 then
return x + BASE()
else
return x
endif
endfunction
struct Savecode
real digits //logarithmic approximation
BigNum bignum
static method create takes nothing returns Savecode
local Savecode sc = Savecode.allocate()
set sc.digits = 0.
set sc.bignum = BigNum.create(BASE())
return sc
endmethod
method onDestroy takes nothing returns nothing
call .bignum.destroy()
endmethod
method Encode takes integer val, integer max returns nothing
set .digits = .digits + log(max+1,BASE())
call .bignum.MulSmall(max+1)
call .bignum.AddSmall(val)
endmethod
method Decode takes integer max returns integer
return .bignum.DivSmall(max+1)
endmethod
method IsEmpty takes nothing returns boolean
return .bignum.IsZero()
endmethod
method Length takes nothing returns real
return .digits
endmethod
method Clean takes nothing returns nothing
call .bignum.Clean()
endmethod
//These functions get too intimate with BigNum_l
method Pad takes nothing returns nothing
local BigNum_l cur = .bignum.list
local BigNum_l prev
local integer maxlen = R2I(1.0 + .Length())
loop
exitwhen cur == 0
set prev = cur
set cur = cur.next
set maxlen = maxlen - 1
endloop
loop
exitwhen maxlen <= 0
set prev.next = BigNum_l.create()
set prev = prev.next
set maxlen = maxlen - 1
endloop
endmethod
method ToString takes nothing returns string
local BigNum_l cur = .bignum.list
local string s = ""
loop
exitwhen cur == 0
set s = itochar(cur.leaf) + s
set cur = cur.next
endloop
return s
endmethod
method FromString takes string s returns nothing
local integer i = StringLength(s)-1
local BigNum_l cur = BigNum_l.create()
set .bignum.list = cur
loop
set cur.leaf = chartoi(SubString(s,i,i+1))
exitwhen i <= 0
set cur.next = BigNum_l.create()
set cur = cur.next
set i = i - 1
endloop
endmethod
method Hash takes nothing returns integer
local integer hash = 0
local integer x
local BigNum_l cur = .bignum.list
loop
exitwhen cur == 0
set x = cur.leaf
set hash = ModuloInteger(hash+79*hash/(x+1) + 293*x/(1+hash - (hash/BASE())*BASE()) + 479,HASHN())
set cur = cur.next
endloop
return hash
endmethod
//this is not cryptographic which is fine for this application
//sign = 1 is forward
//sign = -1 is backward
method Obfuscate takes integer key, integer sign returns nothing
local integer seed = GetRandomInt(0,MAXINT())
local integer advance
local integer x
local BigNum_l cur = .bignum.list
if sign == -1 then
call SetRandomSeed(.bignum.LastDigit())
set cur.leaf = modb(cur.leaf + sign*GetRandomInt(0,BASE()-1))
set x = cur.leaf
endif
call SetRandomSeed(key)
loop
exitwhen cur == 0
if sign == -1 then
set advance = cur.leaf
endif
set cur.leaf = modb(cur.leaf + sign*GetRandomInt(0,BASE()-1))
if sign == 1 then
set advance = cur.leaf
endif
set advance = advance + GetRandomInt(0,BASE()-1)
call SetRandomSeed(advance)
set x = cur.leaf
set cur = cur.next
endloop
if sign == 1 then
call SetRandomSeed(x)
set .bignum.list.leaf = modb(.bignum.list.leaf + sign*GetRandomInt(0,BASE()-1))
endif
call SetRandomSeed(seed)
endmethod
method Dump takes nothing returns nothing
local BigNum_l cur = .bignum.list
local string s = ""
set s = "max: "+R2S(.digits)
loop
exitwhen cur == 0
set s = I2S(cur.leaf)+" "+s
set cur = cur.next
endloop
call BJDebugMsg(s)
endmethod
method Save takes player p, integer loadtype returns string
local integer key = scommhash(GetPlayerName(p))+loadtype*73
local string s
local integer hash
call .Clean()
set hash = .Hash()
call .Encode(hash,HASHN())
call .Clean()
/////////////////////// Save code information. Comment out next two lines in implementation
//call BJDebugMsg("Expected length: " +I2S(R2I(1.0+.Length())))
//call BJDebugMsg("Room left in last char: "+R2S(1.-ModuloReal((.Length()),1)))
///////////////////////
call .Pad()
call .Obfuscate(key,1)
return .ToString()
endmethod
method Load takes player p, string s, integer loadtype returns boolean
local integer ikey = scommhash(GetPlayerName(p))+loadtype*73
local integer inputhash
call .FromString(s)
call .Obfuscate(ikey,-1)
set inputhash = .Decode(HASHN())
call .Clean()
return inputhash == .Hash()
endmethod
endstruct
private function isupper takes string c returns boolean
return c == StringCase(c,true)
endfunction
private function ischar takes string c returns boolean
return S2I(c) == 0 and c!= "0"
endfunction
private function chartype takes string c returns integer
if(ischar(c)) then
if isupper(c) then
return 0
else
return 1
endif
else
return 2
endif
endfunction
private function testchar takes string c returns nothing
if(ischar(c)) then
if isupper(c) then
call BJDebugMsg(c+" isupper")
else
call BJDebugMsg(c+" islower")
endif
else
call BJDebugMsg(c+ " isnumber")
endif
endfunction
public function colorize takes string s returns string
local string out = ""
local integer i = 0
local integer len = StringLength(s)
local integer ctype
local string c
loop
exitwhen i >= len
set c = SubString(s,i,i+1)
set ctype = chartype(c)
if ctype == 0 then
set out = out + uppercolor()+c+"|r"
elseif ctype == 1 then
set out = out + lowercolor()+c+"|r"
else
set out = out + numcolor()+c+"|r"
endif
set i = i + 1
endloop
return out
endfunction
private function prop_Savecode takes nothing returns boolean
local string s
local Savecode loadcode
//--- Data you want to save ---
local integer medal1 = 10
local integer medal2 = 3
local integer medalmax = 13
local integer XP = 1337
local integer XPmax = 1000000
local Savecode savecode = Savecode.create()
call SetPlayerName(Player(0),"yomp")
call SetPlayerName(Player(1),"fruitcup")
call savecode.Encode(medal1,medalmax)
call savecode.Encode(medal2,medalmax)
call savecode.Encode(XP,XPmax)
//--- Savecode_save generates the savecode for a specific player ---
set s = savecode.Save(Player(0),1)
call savecode.destroy()
// call BJDebugMsg("Savecode: " + Savecode_colorize(s))
//--- User writes down code, inputs again ---
set loadcode = Savecode.create()
if loadcode.Load(Player(0),s,1) then
// call BJDebugMsg("load ok")
else
call BJDebugMsg("load failed")
return false
endif
//Must decode in reverse order of encodes
// load object : max value that data can take
if XP != loadcode.Decode(XPmax) then
return false
elseif medal2 != loadcode.Decode(medalmax) then
return false
elseif medal1 != loadcode.Decode(medalmax) then
return false
endif
call loadcode.destroy()
return true
endfunction
endlibrary
//===========================================================================
function InitTrig_save_system takes nothing returns nothing
endfunction
library BigNum
//prefer algebraic approach because of real subtraction issues
function log takes real y, real base returns real
local real x
local real factor = 1.0
local real logy = 0.0
local real sign = 1.0
if(y < 0.) then
return 0.0
endif
if(y < 1.) then
set y = 1.0/y
set sign = -1.0
endif
//Chop out powers of the base
loop
exitwhen y < 1.0001 //decrease this ( bounded below by 1) to improve precision
if(y > base) then
set y = y / base
set logy = logy + factor
else
set base = SquareRoot(base) //If you use just one base a lot, precompute its squareroots
set factor = factor / 2.
endif
endloop
return sign*logy
endfunction
struct BigNum_l
integer leaf
BigNum_l next
debug static integer nalloc = 0
static method create takes nothing returns BigNum_l
local BigNum_l bl = BigNum_l.allocate()
set bl.next = 0
set bl.leaf = 0
debug set BigNum_l.nalloc = BigNum_l.nalloc + 1
return bl
endmethod
method onDestroy takes nothing returns nothing
debug set BigNum_l.nalloc = BigNum_l.nalloc - 1
endmethod
//true: want destroy
method Clean takes nothing returns boolean
if .next == 0 and .leaf == 0 then
return true
elseif .next != 0 and .next.Clean() then
call .next.destroy()
set .next = 0
return .leaf == 0
else
return false
endif
endmethod
method DivSmall takes integer base, integer denom returns integer
local integer quotient
local integer remainder = 0
local integer num
if .next != 0 then
set remainder = .next.DivSmall(base,denom)
endif
set num = .leaf + remainder*base
set quotient = num/denom
set remainder = num - quotient*denom
set .leaf = quotient
return remainder
endmethod
endstruct
struct BigNum
BigNum_l list
integer base
static method create takes integer base returns BigNum
local BigNum b = BigNum.allocate()
set b.list = 0
set b.base = base
return b
endmethod
method onDestroy takes nothing returns nothing
local BigNum_l cur = .list
local BigNum_l next
loop
exitwhen cur == 0
set next = cur.next
call cur.destroy()
set cur = next
endloop
endmethod
method IsZero takes nothing returns boolean
local BigNum_l cur = .list
loop
exitwhen cur == 0
if cur.leaf != 0 then
return false
endif
set cur = cur.next
endloop
return true
endmethod
method Dump takes nothing returns nothing
local BigNum_l cur = .list
local string s = ""
loop
exitwhen cur == 0
set s = I2S(cur.leaf)+" "+s
set cur = cur.next
endloop
call BJDebugMsg(s)
endmethod
method Clean takes nothing returns nothing
local BigNum_l cur = .list
call cur.Clean()
endmethod
//fails if bignum is null
//BASE() + carry must be less than MAXINT()
method AddSmall takes integer carry returns nothing
local BigNum_l next
local BigNum_l cur = .list
local integer sum
if cur == 0 then
set cur = BigNum_l.create()
set .list = cur
endif
loop
exitwhen carry == 0
set sum = cur.leaf + carry
set carry = sum / .base
set sum = sum - carry*.base
set cur.leaf = sum
if cur.next == 0 then
set cur.next = BigNum_l.create()
endif
set cur = cur.next
endloop
endmethod
//x*BASE() must be less than MAXINT()
method MulSmall takes integer x returns nothing
local BigNum_l cur = .list
local integer product
local integer remainder
local integer carry = 0
loop
exitwhen cur == 0 and carry == 0
set product = x * cur.leaf + carry
set carry = product/.base
set remainder = product - carry*.base
set cur.leaf = remainder
if cur.next == 0 and carry != 0 then
set cur.next = BigNum_l.create()
endif
set cur = cur.next
endloop
endmethod
//Returns remainder
method DivSmall takes integer denom returns integer
return .list.DivSmall(.base,denom)
endmethod
method LastDigit takes nothing returns integer
local BigNum_l cur = .list
local BigNum_l next
loop
set next = cur.next
exitwhen next == 0
set cur = next
endloop
return cur.leaf
endmethod
endstruct
private function prop_Allocator1 takes nothing returns boolean
local BigNum b1
local BigNum b2
set b1 = BigNum.create(37)
call b1.destroy()
set b2 = BigNum.create(37)
call b2.destroy()
return b1 == b2
endfunction
private function prop_Allocator2 takes nothing returns boolean
local BigNum b1
local boolean b = false
set b1 = BigNum.create(37)
call b1.AddSmall(17)
call b1.MulSmall(19)
debug if BigNum_l.nalloc < 1 then
debug return false
debug endif
call b1.destroy()
debug set b = BigNum_l.nalloc == 0
return b
endfunction
private function prop_Arith takes nothing returns boolean
local BigNum b1
set b1 = BigNum.create(37)
call b1.AddSmall(73)
call b1.MulSmall(39)
call b1.AddSmall(17)
//n = 2864
if b1.DivSmall(100) != 64 then
return false
elseif b1.DivSmall(7) != 0 then
return false
elseif b1.IsZero() then
return false
elseif b1.DivSmall(3) != 1 then
return false
elseif b1.DivSmall(3) != 1 then
return false
elseif not b1.IsZero() then
return false
endif
return true
endfunction
endlibrary
//===========================================================================
function InitTrig_bignum_lib takes nothing returns nothing
endfunction
//TESH.scrollpos=48
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: v1.00
/// Last Modified: April 24, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which replay parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: people
/// who leave while end-game stats are being shown)
///////////////////////////////////////////////////////////////
/// Interface:
/// void FlagPlayer(player, flag_constant)
/// void DefineValue(name, type_constant, goal_constant, suggest_constant)
/// void UpdateValueInt(name, player, operation_constant, value)
/// void UpdateValueReal(name, player, operation_constant, value)
/// void UpdateValueString(name, player, value)
/// void DefineEvent0(name, format)
/// void DefineEvent1(name, format, argName1)
/// void DefineEvent2(name, format, argName1, argName2)
/// void DefineEvent3(name, format, argName1, argName2, argName3)
/// void LogEvent0(name)
/// void LogEvent1(name, arg0)
/// void LogEvent2(name, arg0, arg1)
/// void LogEvent3(name, arg0, arg1, arg2)
/// void LogCustom(unique_identifier, data)
/// void RaiseGuard(reason)
///////////////////////////////////////////////////////////////
/// Notes:
/// - Errors are displayed using BJDebugMsg
/// - Don't try to update a value before defining it
/// - Parsers expect a very specific format, don't screw with the library's output.
/// - If you emit a bunch of data per second, you will cause bandwidth problems for dial-up users. Try to avoid
/// emitting lots of data all at once except at the start and end of games or rounds.
/// - An event's format string uses {#} to represent arguments
/// - Calling RaiseGuard will increase the number of senders for each message from 1 to 3. This increases
/// security but uses more network bandwidth. It is done automatically if tampering is detected.
///////////////////////////////////////////////////////////////
library MMD initializer init
globals
public constant integer GOAL_NONE = 101
public constant integer GOAL_HIGH = 102
public constant integer GOAL_LOW = 103
public constant integer TYPE_STRING = 101
public constant integer TYPE_REAL = 102
public constant integer TYPE_INT = 103
public constant integer OP_ADD = 101
public constant integer OP_SUB = 102
public constant integer OP_SET = 103
public constant integer SUGGEST_NONE = 101
public constant integer SUGGEST_TRACK = 102
public constant integer SUGGEST_LEADERBOARD = 103
public constant integer FLAG_DRAWER = 101
public constant integer FLAG_LOSER = 102
public constant integer FLAG_WINNER = 103
public constant integer FLAG_LEAVER = 104
public constant integer FLAG_PRACTICING = 105
endglobals
///////////////////////////////////////////////////////////////
/// Private variables and constants
///////////////////////////////////////////////////////////////
globals
private constant boolean SHOW_DEBUG_MESSAGES = true
private constant string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+= \\!@#$%^&*()/?>.<,;:'\"{}[]|`~"
private constant integer num_chars = StringLength(chars)
private string array flags
private string array goals
private string array ops
private string array types
private string array suggestions
private boolean initialized = false
private gamecache gc = null
private constant string ESCAPED_CHARS = " \\"
private constant integer CURRENT_VERSION = 1
private constant integer MINIMUM_PARSER_VERSION = 1
private constant string FILENAME = "MMD.Dat"
private constant string M_KEY_VAL = "val:"
private constant string M_KEY_CHK = "chk:"
private constant integer NUM_SENDERS_NAIVE = 1
private constant integer NUM_SENDERS_SAFE = 3
private integer num_senders = NUM_SENDERS_NAIVE
private integer num_msg = 0
private timer clock = CreateTimer()
private string array q_msg
private real array q_time
private integer array q_index
private keyword QueueNode
private QueueNode q_head = 0
private QueueNode q_tail = 0
endglobals
///////////////////////////////////////////////////////////////
/// Private functions
///////////////////////////////////////////////////////////////
///Triggered when tampering is detected. Increases the number of safeguards against tampering.
public function RaiseGuard takes string reason returns nothing
debug if SHOW_DEBUG_MESSAGES then
debug call BJDebugMsg("MMD: Guard Raised! (" + reason + ")")
debug endif
set num_senders = NUM_SENDERS_SAFE //increase number of players voting on each message
endfunction
///Returns seconds elapsed in game time
private function time takes nothing returns real
return TimerGetElapsed(clock)
endfunction
///Initializes the char-to-int conversion
private function prepC2I takes nothing returns nothing
local integer i = 0
local string id
loop
exitwhen i >= num_chars
set id = SubString(chars, i, i+1)
if id == StringCase(id, true) then
set id = id + "U"
endif
call StoreInteger(gc, "c2i", id, i)
set i = i + 1
endloop
endfunction
///Converts a character to an integer
private function C2I takes string c returns integer
local integer i
local string id = c
if id == StringCase(id, true) then
set id = id + "U"
endif
set i = GetStoredInteger(gc, "c2i", id)
if (i < 0 or i >= num_chars or SubString(chars, i, i+1) != c) and HaveStoredInteger(gc, "c2i", id) then
//A cheater sent a fake sync to screw with the cached values
set i = 0
loop
exitwhen i >= num_chars //just a weird character
if c == SubString(chars, i, i+1) then //cheating!
call RaiseGuard("c2i poisoned")
call StoreInteger(gc, "c2i", id, i)
exitwhen true
endif
set i = i + 1
endloop
endif
return i
endfunction
///Computes a weak hash value, hopefully secure enough for our purposes
private function poor_hash takes string s, integer seed returns integer
local integer n = StringLength(s)
local integer m = n + seed
local integer i = 0
loop
exitwhen i >= n
set m = m * 41 + C2I(SubString(s, i, i+1))
set i = i + 1
endloop
return m
endfunction
///Stores previously sent messages for tamper detection purposes
private struct QueueNode
readonly real timeout
readonly string msg
readonly integer checksum
readonly string key
public QueueNode next = 0
public static method create takes integer id, string msg returns QueueNode
local QueueNode this = QueueNode.allocate()
set .timeout = time() + 7.0 + GetRandomReal(0, 2+0.1*GetPlayerId(GetLocalPlayer()))
set .msg = msg
set .checksum = poor_hash(.msg, id)
set .key = I2S(id)
return this
endmethod
private method onDestroy takes nothing returns nothing
call FlushStoredInteger(gc, M_KEY_VAL+.key, .msg)
call FlushStoredInteger(gc, M_KEY_CHK+.key, .key)
set .msg = null
set .key = null
set .next = 0
endmethod
public method send takes nothing returns nothing
call StoreInteger(gc, M_KEY_VAL+.key, .msg, .checksum)
call StoreInteger(gc, M_KEY_CHK+.key, .key, .checksum)
call SyncStoredInteger(gc, M_KEY_VAL+.key, .msg)
call SyncStoredInteger(gc, M_KEY_CHK+.key, .key)
endmethod
endstruct
///Returns true for a fixed size uniform random subset of players in the game
private function isEmitter takes nothing returns boolean
local integer i = 0
local integer n = 0
local integer r
local integer array picks
local boolean array pick_flags
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
if n < num_senders then //initializing picks
set picks[n] = i
set pick_flags[i] = true
else //maintain the invariant 'P(being picked) = c/n'
set r = GetRandomInt(0, n)
if r < num_senders then
set pick_flags[picks[r]] = false
set picks[r] = i
set pick_flags[i] = true
endif
endif
set n = n + 1
endif
set i = i + 1
endloop
return pick_flags[GetPlayerId(GetLocalPlayer())]
endfunction
///Places meta-data in the replay and in network traffic
private function emit takes string message returns nothing
local QueueNode q
if not initialized then
call BJDebugMsg("MMD Emit Error: Library not initialized yet.")
return
endif
//remember sent messages for tamper check
set q = QueueNode.create(num_msg, message)
if q_head == 0 then
set q_head = q
else
set q_tail.next = q
endif
set q_tail = q
//send new message
set num_msg = num_msg + 1
if isEmitter() then
call q.send()
endif
endfunction
///Performs tamper checks
private function tick takes nothing returns nothing
local QueueNode q
local integer i
//check previously sent messages for tampering
set q = q_head
loop
exitwhen q == 0 or q.timeout >= time()
if not HaveStoredInteger(gc, M_KEY_VAL+q.key, q.msg) then
call RaiseGuard("message skipping")
call q.send()
elseif not HaveStoredInteger(gc, M_KEY_CHK+q.key, q.key) then
call RaiseGuard("checksum skipping")
call q.send()
elseif GetStoredInteger(gc, M_KEY_VAL+q.key, q.msg) != q.checksum then
call RaiseGuard("message tampering")
call q.send()
elseif GetStoredInteger(gc, M_KEY_CHK+q.key, q.key) != q.checksum then
call RaiseGuard("checksum tampering")
call q.send()
endif
set q_head = q.next
call q.destroy()
set q = q_head
endloop
if q_head == 0 then
set q_tail = 0
endif
//check for future message tampering
set i = 0
loop
exitwhen not HaveStoredInteger(gc, M_KEY_CHK+I2S(num_msg), I2S(num_msg))
call RaiseGuard("message insertion")
call emit("Blank")
set i = i + 1
exitwhen i >= 10
endloop
endfunction
///Replaces control characters with escape sequences
private function pack takes string value returns string
local integer j
local integer i = 0
local string result = ""
local string c
loop //for each character in argument string
exitwhen i >= StringLength(value)
set c = SubString(value, i, i+1)
set j = 0
loop //for each character in escaped chars string
exitwhen j >= StringLength(ESCAPED_CHARS)
//escape control characters
if c == SubString(ESCAPED_CHARS, j, j+1) then
set c = "\\" + c
exitwhen true
endif
set j = j + 1
endloop
set result = result + c
set i = i + 1
endloop
return result
endfunction
///Updates the value of a defined variable for a given player
private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Set Error: Invalid player. Must be P1 to P12.")
elseif val_type != GetStoredInteger(gc, "types", name) then
call BJDebugMsg("MMD Set Error: Updated value of undefined variable or used value of incorrect type.")
elseif StringLength(op) == 0 then
call BJDebugMsg("MMD Set Error: Unrecognized operation type.")
elseif StringLength(name) > 50 then
call BJDebugMsg("MMD Set Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Set Error: Variable name is empty.")
else
call emit("VarP " + I2S(id) + " " + pack(name) + " " + op + " " + value)
endif
endfunction
///Defines an event's arguments and format
private function DefineEvent takes string name, integer num_args, string format, string arg_data returns nothing
if GetStoredInteger(gc, "events", name) != 0 then
call BJDebugMsg("MMD DefEvent Error: Event redefined.")
else
call StoreInteger(gc, "events", name, num_args+1)
call emit("DefEvent " + pack(name) + " " + I2S(num_args) + " " + arg_data + pack(format))
endif
endfunction
///Places an event in the meta-data
private function LogEvent takes string name, integer num_args, string data returns nothing
if GetStoredInteger(gc, "events", name) != num_args+1 then
call BJDebugMsg("MMD LogEvent Error: Event not defined or defined with different # of args.")
else
call emit("Event " + pack(name) + data)
endif
endfunction
///////////////////////////////////////////////////////////////
/// Public functions
///////////////////////////////////////////////////////////////
///Sets a player flag like "win_on_leave"
public function FlagPlayer takes player p, string flag_type returns nothing
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Flag Error: Invalid player. Must be P1 to P12.")
elseif StringLength(flag_type) == 0 then
call BJDebugMsg("MMD Flag Error: Unrecognized flag type.")
elseif GetPlayerController(Player(id)) == MAP_CONTROL_USER then
call emit("FlagP " + I2S(id) + " " + flag_type)
endif
endfunction
///Defines a variable to store things in
public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
local string goal = goals[goal_type]
local string vtype = types[value_type]
local string stype = suggestions[suggestion_type]
if goal == null then
call BJDebugMsg("MMD Def Error: Unrecognized goal type.")
elseif vtype == null then
call BJDebugMsg("MMD Def Error: Unrecognized value type.")
elseif stype == null then
call BJDebugMsg("Stats Def Error: Unrecognized suggestion type.")
elseif StringLength(name) > 32 then
call BJDebugMsg("MMD Def Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Def Error: Variable name is empty.")
elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
call BJDebugMsg("MMD Def Error: Strings must have goal type of none.")
elseif GetStoredInteger(gc, "types", name) != 0 then
call BJDebugMsg("MMD Def Error: Value redefined.")
else
call StoreInteger(gc, "types", name, value_type)
call emit("DefVarP " + pack(name) + " " + vtype + " " + goal + " " + stype)
endif
endfunction
///Updates the value of an integer variable
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
call update_value(name, p, ops[op], I2S(value), TYPE_INT)
endfunction
///Updates the value of a real variable
public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
endfunction
///Updates the value of a string variable
public function UpdateValueString takes string name, player p, string value returns nothing
local string q = "\""
call update_value(name, p, ops[OP_SET], q + pack(value) + q, TYPE_STRING)
endfunction
public function DefineEvent0 takes string name, string format returns nothing
call DefineEvent(name, 0, format, "")
endfunction
public function DefineEvent1 takes string name, string format, string argName0 returns nothing
call DefineEvent(name, 1, format, pack(argName0) + " ")
endfunction
public function DefineEvent2 takes string name, string format, string argName0, string argName1 returns nothing
call DefineEvent(name, 2, format, pack(argName0) + " " + pack(argName1) + " ")
endfunction
public function DefineEvent3 takes string name, string format, string argName0, string argName1, string argName2 returns nothing
call DefineEvent(name, 3, format, pack(argName0) + " " + pack(argName1) + " " + pack(argName2) + " ")
endfunction
public function LogEvent0 takes string name returns nothing
call LogEvent(name, 0, "")
endfunction
public function LogEvent1 takes string name, string arg0 returns nothing
call LogEvent(name, 1, " " + pack(arg0))
endfunction
public function LogEvent2 takes string name, string arg0, string arg1 returns nothing
call LogEvent(name, 2, " " + pack(arg0) + " " + pack(arg1))
endfunction
public function LogEvent3 takes string name, string arg0, string arg1, string arg2 returns nothing
call LogEvent(name, 3, " " + pack(arg0) + " " + pack(arg1) + " " + pack(arg2))
endfunction
///Emits meta-data which parsers will ignore unless they are customized to understand it
public function LogCustom takes string unique_identifier, string data returns nothing
call emit("custom " + pack(unique_identifier) + " " + pack(data))
endfunction
///////////////////////////////////////////////////////////////
/// Initialization
///////////////////////////////////////////////////////////////
///Emits initialization data
private function init2 takes nothing returns nothing
local integer i
local trigger t
set initialized = true
call emit("init version " + I2S(MINIMUM_PARSER_VERSION) + " " + I2S(CURRENT_VERSION))
set i = 0
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
call emit("init pid " + I2S(i) + " " + pack(GetPlayerName(Player(i))))
endif
set i = i + 1
endloop
set t = CreateTrigger()
call TriggerAddAction(t, function tick)
call TriggerRegisterTimerEvent(t, 0.37, true)
endfunction
///Places init2 on a timer, initializes game cache, and translates constants
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0, false)
call TriggerAddAction(t, function init2)
set goals[GOAL_NONE] = "none"
set goals[GOAL_HIGH] = "high"
set goals[GOAL_LOW] = "low"
set types[TYPE_INT] = "int"
set types[TYPE_REAL] = "real"
set types[TYPE_STRING] = "string"
set suggestions[SUGGEST_NONE] = "none"
set suggestions[SUGGEST_TRACK] = "track"
set suggestions[SUGGEST_LEADERBOARD] = "leaderboard"
set ops[OP_ADD] = "+="
set ops[OP_SUB] = "-="
set ops[OP_SET] = "="
set flags[FLAG_DRAWER] = "drawer"
set flags[FLAG_LOSER] = "loser"
set flags[FLAG_WINNER] = "winner"
set flags[FLAG_LEAVER] = "leaver"
set flags[FLAG_PRACTICING] = "practicing"
call FlushGameCache(InitGameCache(FILENAME))
set gc = InitGameCache(FILENAME)
call TimerStart(clock, 999999999, false, null)
call prepC2I()
endfunction
endlibrary
library LineAim initializer OnInit
globals
public real LightningRed = 0.8
public real LightningGreen = 0.8
public real LightningBlue = 1.0
public real LightningAlpha = 1.0
// splats/lightningdata.slk
// does not update after creation
public string LightningFileCode = "LAIM"
public integer UnitTintingRed = 0
public integer UnitTintingGreen = 255
public integer UnitTintingBlue = 0
public integer UnitTintingAlpha = 255
// highest coli units can have
public integer MaxColi = 200
// System Data
public boolean HitEnemy
public boolean HitAlly
public lightning LineA
public lightning LineB
public lightning LineC
public filterfunc PickUnitAction
public group AffectedUnits
public group TempGroup
public integer localPlayerIndex
public player localPlayer
public unit array Caster
public real X = 0
public real Y = 0
public integer SkillCode
public real AoeStart = 0
public real AoeEnd = 0
public real Range = 0
public trigger MouseTrigger
public real PosX = 0
public real PosY = 0
public real Radius = 0
public hashtable Hash = InitHashtable()
endglobals
function isInTargetingMode takes nothing returns boolean
local integer index = 0
loop
if BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, index)) then
exitwhen true
endif
set index = index + 1
exitwhen index == 12 // when 12 is reached no button is visible
endloop
return index == 11 //when the loop broke in index == 11 its targeting mode
endfunction
private function ButtonActionFunc takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer playerIndex = GetPlayerId(p)
local integer tId = GetHandleId(GetTriggeringTrigger())
local integer spellCode = LoadInteger(Hash, tId, 0)
local ability skill = BlzGetUnitAbility(u, spellCode)
// instance api starts with index 0 for level 1
local integer level = GetUnitAbilityLevel(u, spellCode) - 1
local string orderString = LoadStr(Hash, tId, 0)
set Caster[playerIndex] = u
if p == GetLocalPlayer() then
set AoeStart = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_AREA_OF_EFFECT, level)
if orderString == "impale" then
set AoeEnd = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_AREA_OF_EFFECT, level)
elseif orderString == "carrionswarm" then
set AoeEnd = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_FINAL_AREA_UCS4, level)
elseif orderString == "breathoffire" then
set AoeEnd = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_FINAL_AREA_UCS4, level)
else
set AoeEnd = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_FINAL_AREA_OSH4, level)
endif
set HitEnemy = LoadBoolean(Hash, tId, 0)
set HitAlly = LoadBoolean(Hash, tId, 1)
// for reasons imaple's AREA_OF_EFFECT has to be halved
if orderString == "impale" then
set AoeStart = AoeStart/2
set AoeEnd = AoeEnd/2
endif
if orderString == "impale" then
set Range = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_WAVE_DISTANCE, level)
elseif orderString == "carrionswarm" then
set Range = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_DISTANCE_UCS3, level)
elseif orderString == "breathoffire" then
set Range = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_DISTANCE_UCS3, level)
else
set Range = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_DISTANCE_OSH3, level)
endif
set SkillCode = spellCode
endif
set u = null
set p = null
set skill = null
endfunction
function LineAimerRegister takes integer spellCode, string orderString, boolean hitEnemy, boolean hitAlly returns nothing
local trigger t = CreateTrigger()
local integer tId = GetHandleId(t)
call TriggerRegisterCommandEvent(t, spellCode, orderString)
call TriggerAddAction(t, function ButtonActionFunc)
call SaveInteger(Hash, tId, 0, spellCode)
call SaveStr(Hash, tId, 0, orderString)
call SaveBoolean(Hash, tId, 0, hitEnemy)
call SaveBoolean(Hash, tId, 1, hitAlly)
endfunction
function LineAimerRegisterEx takes integer spellCode, string orderString returns nothing
call LineAimerRegister(spellCode, orderString, true, false)
endfunction
private function MouseActionFunc takes nothing returns nothing
if GetTriggerPlayer() == GetLocalPlayer() then
set X = BlzGetTriggerPlayerMouseX()
set Y = BlzGetTriggerPlayerMouseY()
endif
endfunction
private function UnitActionFunc takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean isAlly = IsUnitAlly(u, localPlayer)
// disallow oneself, bigger radius is included because PickUnits in Range picks units based on there center. But IsUnitInRangeXY includes colision.
if u != Caster[localPlayerIndex] and IsUnitInRangeXY(u, PosX, PosY, Radius) then
// filter allies/enemies when wanted
if (HitEnemy and not isAlly) or (HitAlly and isAlly) then
call GroupAddUnit(AffectedUnits, u)
call SetUnitVertexColor(u, UnitTintingRed, UnitTintingGreen, UnitTintingBlue, UnitTintingAlpha)
endif
endif
set u = null
return false
endfunction
private function TimerFunc takes nothing returns nothing
local real unitX
local real unitY
local real rad
local real maxRange
local real maxRangeCos
local real maxRangeSin
local real off = bj_PI/2
local real x
local real y
local unit u
local real i = 0
local real radiusChange
local real step
loop
set u = FirstOfGroup(AffectedUnits)
exitwhen u == null
call SetUnitVertexColor(u, BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_RED), BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_GREEN), BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_BLUE), BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_ALPHA))
call GroupRemoveUnit(AffectedUnits, u)
endloop
if SkillCode > 0 and BlzIsLocalClientActive() then
if isInTargetingMode() then
set unitX = GetUnitX(Caster[localPlayerIndex])
set unitY = GetUnitY(Caster[localPlayerIndex])
// when there is an unit under the mouse, use it for the direction
if BlzGetMouseFocusUnit() != null then
// is the hovered unit not the caster?
if BlzGetMouseFocusUnit() != Caster[localPlayerIndex] then
set rad = Atan2(GetUnitY(BlzGetMouseFocusUnit()) - unitY, GetUnitX(BlzGetMouseFocusUnit()) - unitX)
else
// caster himself, use current facing
set rad = bj_DEGTORAD*GetUnitFacing(Caster[localPlayerIndex])
endif
else
set rad = Atan2(Y - unitY, X - unitX)
endif
// the shockwave starts from AoeStart offset traveling Range then having AoeEnd in the final moment
set maxRange = (Range + AoeEnd + AoeStart)
set maxRangeCos = Cos(rad)*maxRange
set maxRangeSin = Sin(rad)*maxRange
call SetLightningColor(LineA, LightningRed, LightningGreen, LightningBlue, LightningAlpha)
call SetLightningColor(LineB, LightningRed, LightningGreen, LightningBlue, LightningAlpha)
call SetLightningColor(LineC, LightningRed, LightningGreen, LightningBlue, LightningAlpha)
call MoveLightning(LineA, false, unitX + AoeStart*Cos(rad + off), unitY + AoeStart*Sin(rad + off), unitX + maxRangeCos + AoeEnd*Cos(rad+ off), unitY + maxRangeSin + AoeEnd*Sin(rad+ off))
call MoveLightning(LineB, false, unitX + AoeStart*Cos(rad - off), unitY + AoeStart*Sin(rad - off), unitX + maxRangeCos + AoeEnd*Cos(rad- off), unitY + maxRangeSin + AoeEnd*Sin(rad - off))
call MoveLightning(LineC, false, unitX + maxRangeCos + AoeEnd*Cos(rad+ off), unitY + maxRangeSin + AoeEnd*Sin(rad+ off), unitX +maxRangeCos + AoeEnd*Cos(rad- off), unitY + maxRangeSin + AoeEnd*Sin(rad - off) )
// 0.1 is the internal dmg intervale of shockwave
set step = 0.1*Range
set Radius = AoeStart
if AoeStart != AoeEnd then
set radiusChange = (AoeEnd - AoeStart)
set radiusChange = radiusChange/ ((Range)/step)
else
set radiusChange = 0
endif
loop
exitwhen i > Range
//print(radius)
// + MaxColi because GroupEnumUnitsInRange checks for unit centers
set PosX = unitX + (AoeStart + i)*Cos(rad)
set PosY = unitY + (AoeStart + i)*Sin(rad)
set Radius = Radius
call GroupEnumUnitsInRange(TempGroup, PosX, PosY, Radius + MaxColi, PickUnitAction)
set Radius = Radius + radiusChange
set i = i + step
endloop
else
// targeting Mode ended stop now
set SkillCode = 0
endif
else
// hide by 0 alpha
call SetLightningColor(LineA, 1, 1, 1, 0)
call SetLightningColor(LineB, 1, 1, 1, 0)
call SetLightningColor(LineC, 1, 1, 1, 0)
endif
endfunction
private function OnInit takes nothing returns nothing
local integer loopA
set MouseTrigger = CreateTrigger()
call TriggerAddAction(MouseTrigger, function MouseActionFunc)
set loopA = 0
loop
call TriggerRegisterPlayerEvent(MouseTrigger, Player(loopA), EVENT_PLAYER_MOUSE_MOVE)
set loopA = loopA + 1
exitwhen loopA == bj_MAX_PLAYER_SLOTS
endloop
// preload this frames, make sure they got a handleId for everyone
set loopA = 0
loop
call BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, loopA)
set loopA = loopA + 1
exitwhen loopA == 12
endloop
set LineA = AddLightning(LightningFileCode, false, 0, 0, 0, 0)
set LineB = AddLightning(LightningFileCode, false, 0, 0, 0, 0)
set LineC = AddLightning(LightningFileCode, false, 0, 0, 0, 0)
set PickUnitAction = Filter(function UnitActionFunc)
set AffectedUnits = CreateGroup()
set TempGroup = CreateGroup()
set localPlayer = GetLocalPlayer()
set localPlayerIndex = GetPlayerId(localPlayer)
call TimerStart(CreateTimer(), 0.05, true, function TimerFunc)
endfunction
endlibrary
scope LineAimerRegister initializer OnInit
private function OnInit takes nothing returns nothing
call LineAimerRegisterEx('A0JV',"breathoffire")
call LineAimerRegisterEx('A0IX',"breathoffire")
endfunction
endscope
--[[
LineAimer by Tasyen
Requires Warcraft 3 V1.32+
Shows a precast hitzone for registered Line Direction dmg spells and tints units. (Shockwave, Carrion swarm, Breath of Fire/Frost, Impale, Smashing wave).
API
function LineAimerRegister(spellCode, orderString[, hitEnemy, hitAlly])
unmentioned hitEnemy, hitAlly results into -> true, false
Exmple, default Abilities
LineAimerRegister(FourCC("AOsh"), "shockwave")
LineAimerRegister('AOs2', "shockwave")
LineAimerRegister('ACsh', "shockwave")
LineAimerRegister('ACst', "shockwave")
LineAimerRegister('ANsh', "shockwave")
LineAimerRegister('ANbf', "breathoffire")
LineAimerRegister('ANcf', "breathoffire")
LineAimerRegister('ACbc', "breathoffire")
LineAimerRegister('ACbf', "breathoffire")
LineAimerRegister('AUcs', "carrionswarm")
LineAimerRegister('ACca', "carrionswarm")
LineAimerRegister('ACcv', "carrionswarm")
LineAimerRegister('ACc2', "carrionswarm")
LineAimerRegister('ACc3', "carrionswarm")
LineAimerRegister('AUim', "impale")
LineAimerRegister('ACmp', "impale")
--]]
LineAimer = {
Lightning ={
-- 0 to 1.0
Red = 1.0
,Blue = 1
,Green = 1
,Alpha = 1.0
-- splats/lightningdata.slk
-- does not update after creation
,FileCode = "LAIM"
}
,UnitTintingAlly ={
[true] = {
-- 0 to 255
Red = 0
,Blue = 0
,Green = 255
,Alpha = 255
}
,[false] = {
Red = 0
,Blue = 0
,Green = 255
,Alpha = 255
}
}
-- highest coli units can have.
,MaxColi = 200
-- data is only known to the local player, except for the unit reference
,Caster = {}
--,Img = {}
,X = 0
,Y = 0
,SkillCode = 0
,AoeStart = 0
,AoeEnd = 0
,Range = 0
,ToCreate = {}
,SkillFields = {
shockwave = {ABILITY_RLF_FINAL_AREA_OSH4, ABILITY_RLF_DISTANCE_OSH3}
,carrionswarm = {ABILITY_RLF_FINAL_AREA_UCS4, ABILITY_RLF_DISTANCE_UCS3}
,breathoffire = {ABILITY_RLF_FINAL_AREA_UCS4, ABILITY_RLF_DISTANCE_UCS3}
,impale = {ABILITY_RLF_AREA_OF_EFFECT, ABILITY_RLF_WAVE_DISTANCE}
}
}
function isInTargetingMode()
local index = 0
repeat
if BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, index)) then break end
index = index + 1
until index == 12 --when 12 is reached no button is visible
return index == 11 --when the loop broke in index == 11 its targeting mode
end
do
local data = LineAimer
local function newAimTrigger(spellCode, orderString, hitEnemy, hitAlly)
-- default values for hitEnemy, hitAlly
if hitEnemy == nil and hitAlly == nil then
hitEnemy = true
hitAlly = false
end
-- error display
if data[spellCode] then
print("LineAimer - Register Twice", GetObjectName(spellCode), spellCode)
return
end
local trigger = CreateTrigger()
local player
local triggerUnit
TriggerRegisterCommandEvent(trigger, spellCode, orderString)
TriggerAddAction(trigger, function()
triggerUnit = GetTriggerUnit()
player = GetOwningPlayer(triggerUnit)
data.Caster[player] = triggerUnit
local skill = BlzGetUnitAbility(triggerUnit, spellCode)
-- instance api starts with index 0 for level 1
local level = GetUnitAbilityLevel(triggerUnit, spellCode) - 1
if player == GetLocalPlayer() then
data.AoeStart = BlzGetAbilityRealLevelField(skill, ABILITY_RLF_AREA_OF_EFFECT, level)
data.AoeEnd = BlzGetAbilityRealLevelField(skill, data.SkillFields[orderString][1], level)
data.HitEnemy = hitEnemy
data.HitAlly = hitAlly
-- for reasons imaple's AREA_OF_EFFECT has to be halved
if orderString == "impale" then
data.AoeStart = data.AoeStart/2
data.AoeEnd = data.AoeEnd/2
end
data.Range = BlzGetAbilityRealLevelField(skill, data.SkillFields[orderString][2], level)
data.SkillCode = spellCode
end
--[[ if data.Img[player] then
SetImageRenderAlways(data.Img[player], false)
DestroyImage(data.Img[player])
end
local endSize = data.AoeEnd*2
data.Img[player] = CreateImage("ReplaceableTextures\\Selection\\SpellAreaOfEffect.blp", endSize, endSize, 0, 0, 0, 0, endSize/2, endSize/2, 0, 2)
SetImageRenderAlways(data.Img[player], true)
--]]
skill = nil
end)
data[spellCode] = true
triggerUnit = nil
end
function LineAimerRegister(spellCode, orderString, hitEnemy, hitAlly)
-- support calls without FourCC
if type(spellCode) == "string" then spellCode = FourCC(spellCode) end
-- delay the creation when this is called to early
if data.Started then
newAimTrigger(spellCode, orderString, hitEnemy, hitAlly)
else
table.insert(data.ToCreate, {spellCode, orderString, hitEnemy, hitAlly})
end
end
-- hook into Blizzard's at Map Init
local oldInit = InitBlizzard
function InitBlizzard()
oldInit()
data.Started = true
data.MouseTrigger = CreateTrigger()
for playerIndex = 0, bj_MAX_PLAYER_SLOTS do
TriggerRegisterPlayerEvent(data.MouseTrigger, Player(playerIndex), EVENT_PLAYER_MOUSE_MOVE)
end
TriggerAddAction(data.MouseTrigger, function()
if GetTriggerPlayer() == GetLocalPlayer() then
data.X = BlzGetTriggerPlayerMouseX()
data.Y = BlzGetTriggerPlayerMouseY()
end
end)
-- create the to early created ones
for i, v in ipairs(data.ToCreate) do
newAimTrigger(v[1], v[2], v[3], v[4])
end
data.ToCreate = nil
-- preload this frames, make sure they got a handleId for everyone
for i = 0, 11 do BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, i) end
data.LineA = AddLightning(data.Lightning.FileCode, false, 0, 0, 0, 0)
data.LineB = AddLightning(data.Lightning.FileCode, false, 0, 0, 0, 0)
data.LineC = AddLightning(data.Lightning.FileCode, false, 0, 0, 0, 0)
local localPlayer = GetLocalPlayer()
local unitX, unitY, rad, maxRange
local off = bj_PI/2
local tempGroup = CreateGroup()
local affectedUnits = CreateGroup()
local x, y
local filterUnit
local pickUnitAction = Filter(function()
filterUnit = GetFilterUnit()
local isAlly = IsUnitAlly(filterUnit, localPlayer)
-- disallow oneself, bigger radius is included because PickUnits in Range picks units based on there center. But IsUnitInRangeXY includes colision.
if filterUnit ~= data.Caster[localPlayer] and IsUnitInRangeXY(filterUnit, data.PosX, data.PosY, data.Radius) then
-- filter allies/enemies when wanted
if (data.HitEnemy and not isAlly) or (data.HitAlly and isAlly) then
GroupAddUnit(affectedUnits, filterUnit)
SetUnitVertexColor(filterUnit, data.UnitTintingAlly[isAlly].Red, data.UnitTintingAlly[isAlly].Green, data.UnitTintingAlly[isAlly].Blue, data.UnitTintingAlly[isAlly].Alpha)
end
end
filterUnit = nil
return false
end)
TimerStart(CreateTimer(), 0.05, true, function()
xpcall(function()
-- revert tinting for units picked in the last iteration and remove reference to them
local unit
for i = 0, BlzGroupGetSize(affectedUnits) do
unit = BlzGroupUnitAt(affectedUnits, i)
SetUnitVertexColor(unit, BlzGetUnitIntegerField(unit, UNIT_IF_TINTING_COLOR_RED), BlzGetUnitIntegerField(unit, UNIT_IF_TINTING_COLOR_GREEN), BlzGetUnitIntegerField(unit, UNIT_IF_TINTING_COLOR_BLUE), BlzGetUnitIntegerField(unit, UNIT_IF_TINTING_COLOR_ALPHA))
end
GroupClear(affectedUnits)
if data.SkillCode > 0 and BlzIsLocalClientActive() then
if isInTargetingMode() then
unitX = GetUnitX(data.Caster[localPlayer])
unitY = GetUnitY(data.Caster[localPlayer])
-- when there is an unit under the mouse, use it for the direction
if BlzGetMouseFocusUnit() then
-- is the hovered unit not the caster?
if BlzGetMouseFocusUnit() ~= data.Caster[localPlayer] then
rad = Atan2(GetUnitY(BlzGetMouseFocusUnit()) - unitY, GetUnitX(BlzGetMouseFocusUnit()) - unitX)
else
-- caster himself, use current facing
rad = bj_DEGTORAD*GetUnitFacing(data.Caster[localPlayer])
end
else
rad = Atan2(data.Y - unitY, data.X - unitX)
end
-- the shockwave starts from data.AoeStart offset traveling data.Range then having data.AoeEnd in the final moment
maxRange = (data.Range + data.AoeEnd + data.AoeStart)
maxRangeCos = Cos(rad)*maxRange
maxRangeSin = Sin(rad)*maxRange
SetLightningColor(data.LineA, data.Lightning.Red, data.Lightning.Green, data.Lightning.Blue, data.Lightning.Alpha)
SetLightningColor(data.LineB, data.Lightning.Red, data.Lightning.Green, data.Lightning.Blue, data.Lightning.Alpha)
SetLightningColor(data.LineC, data.Lightning.Red, data.Lightning.Green, data.Lightning.Blue, data.Lightning.Alpha)
--if not true then
--MoveLightning(data.LineA, false, unitX + data.AoeStart*Cos(rad + off), unitY + data.AoeStart*Sin(rad + off), unitX + Cos(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Cos(rad+ off), unitY + Sin(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Sin(rad+ off))
--MoveLightning(data.LineB, false, unitX + data.AoeStart*Cos(rad - off), unitY + data.AoeStart*Sin(rad - off), unitX + Cos(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Cos(rad- off), unitY + Sin(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Sin(rad - off))
--MoveLightning(data.LineC, false, unitX + Cos(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Cos(rad+ off), unitY + Sin(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Sin(rad+ off), unitX + Cos(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Cos(rad- off), unitY + Sin(rad)*(data.Range + data.AoeStart) + data.AoeEnd*Sin(rad - off) )
MoveLightning(data.LineA, false, unitX + data.AoeStart*Cos(rad + off), unitY + data.AoeStart*Sin(rad + off), unitX + maxRangeCos + data.AoeEnd*Cos(rad+ off), unitY + maxRangeSin + data.AoeEnd*Sin(rad+ off))
MoveLightning(data.LineB, false, unitX + data.AoeStart*Cos(rad - off), unitY + data.AoeStart*Sin(rad - off), unitX + maxRangeCos + data.AoeEnd*Cos(rad- off), unitY + maxRangeSin + data.AoeEnd*Sin(rad - off))
MoveLightning(data.LineC, false, unitX + maxRangeCos + data.AoeEnd*Cos(rad+ off), unitY + maxRangeSin + data.AoeEnd*Sin(rad+ off), unitX +maxRangeCos + data.AoeEnd*Cos(rad- off), unitY + maxRangeSin + data.AoeEnd*Sin(rad - off) )
--else
--MoveLightning(data.LineA, false, unitX + maxRangeCos + data.AoeEnd*Cos(rad+ off), unitY + maxRangeSin + data.AoeEnd*Sin(rad+ off), unitX + data.AoeStart*Cos(rad + off), unitY + data.AoeStart*Sin(rad + off))
--MoveLightning(data.LineB, false, unitX + maxRangeCos + data.AoeEnd*Cos(rad- off), unitY + maxRangeSin + data.AoeEnd*Sin(rad - off), unitX + data.AoeStart*Cos(rad - off), unitY + data.AoeStart*Sin(rad - off))
--MoveLightning(data.LineC, false, unitX + maxRangeCos + data.AoeEnd*Cos(rad+ off), unitY + maxRangeSin + data.AoeEnd*Sin(rad+ off), unitX +maxRangeCos + data.AoeEnd*Cos(rad- off), unitY + maxRangeSin + data.AoeEnd*Sin(rad - off) )
--end
--SetImagePosition(data.Img[localPlayer], unitX + (data.AoeStart + data.Range)*Cos(rad), unitY + (data.AoeStart + data.Range)* Sin(rad), 0)
local radiusChange
-- 0.1 is the internal dmg intervale of shockwave
local step = 0.1*data.Range
local radius = data.AoeStart
if data.AoeStart ~= data.AoeEnd then
radiusChange = (data.AoeEnd - data.AoeStart)
radiusChange = radiusChange/ ((data.Range)/step)
else
radiusChange = 0
end
for i = 0, data.Range, step do
--print(radius)
-- + data.MaxColi because GroupEnumUnitsInRange checks for unit centers
data.PosX = unitX + (data.AoeStart + i)*Cos(rad)
data.PosY = unitY + (data.AoeStart + i)*Sin(rad)
data.Radius = radius
GroupEnumUnitsInRange(tempGroup, data.PosX, data.PosY, radius + data.MaxColi, pickUnitAction)
radius = radius + radiusChange
end
else
-- targeting Mode ended stop now
data.SkillCode = 0
-- SetImageRenderAlways(data.Img[localPlayer], false)
end
else
-- hide by 0 alpha
SetLightningColor(data.LineA, 1, 1, 1, 0)
SetLightningColor(data.LineB, 1, 1, 1, 0)
SetLightningColor(data.LineC, 1, 1, 1, 0)
end
end,print)
end)
end
end
LineAimerRegister('A0JV', "breathoffire")
LineAimerRegister('A0IX', "breathoffire")
/*
UnitEventsEx v1.01
by Spellbound
Credits to Bribe for the excellent GUI Unit Event, of which this library is the vJASS
version of. He was also helpful in understanding how his system works so that I may code this.
Additional credits to Jesus4Lyf for Transport, Nestharus for UnitEvent and grim001 for AutoEvents.
*/
/*
_________________________________________________________________________
DESCRIPTION
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
UnitEventsEx provides you with extra events not available in the vanilla game. Specifically,
you will be able to detect when a unit transforms, loads and unloads from a transport unit, is
reanimated by Reanimate Dead, reincarnates or is brought back to life.
Additionally, each of those events can be toggled on or off depending on whether you need them.
See // CONFIGURATION under the globals block below.
*/
/*
_________________________________________________________________________
INSTALLATION
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
UnitEventsEx requires:
UnitDex by TriggerHappy (Make sure you have the Detect Leave (UnitDex) ability in your map)
https://www.hiveworkshop.com/threads/system-unitdex-unit-indexer.248209/
RegisterEvent Pack by Bannar (both RegisterNativeEvent and RegisterPlayerUnitEvent)
https://www.hiveworkshop.com/threads/snippet-registerevent-pack.250266/
Optionally uses:
ListT by Bannar
https://www.hiveworkshop.com/threads/containers-list-t.249011/
WorldBounds by Nestharus
https://github.com/nestharus/JASS/blob/master/jass/Systems/WorldBounds/script.j
Once you have the required libraries in place, either copy the Detect Transform (ExtraEvents)
ability to your map and set DETECT_TRANSFORM_ABILITY in the globals block below to the id of
the spell.
Alternatively, you can use the textmacro below. Import ExtraEvents, uncomment it, save your map,
close it, reload and comment it out again. The ability will have been created in your Object Editor.
*/
// //! external ObjectMerger w3a Adef EETD anam "Detect Transform" ansf "(ExtraEvents)" aart "" acat "" arac 0
/*
_________________________________________________________________________
CONFUGRATION
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ExtraEvents can be configured to exclude those events you do not wish to use. Define which
events will be needed in the CONFIG block below.
*/
/*
_________________________________________________________________________
API
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Event Registration
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
call RegisterNativeEvent(yourEvent, function yourFunction )
This registers the event for all players.
call RegisterIndexNativeEvent(playerIndex, yourEvent, function yourFunction )
This registers the event for a specific player.
NB: Player 1 starts on zero.
call RegisterIndexNativeEvent(GetHandleId(event unit), yourEvent, function yourFunction )
This registers the event for a specific unit.
call GetIndexNativeEventTrigger(GetHandleId(event unit), yourEvent)
This returns the trigger associated with that unit id and event id. Destroy that trigger
to remove it. Useful for temporary events.
Also works with playerIndex.
The Events you can call are:
EVENT_ON_TRANSFORM
EVENT_ON_CARGO_LOAD
EVENT_ON_CARGO_UNLOAD
EVENT_ON_RESURRECTION
EVENT_ON_ANIMATE_DEAD
EVENT_ON_REINCARNATION_START
EVENT_ON_REINCARNATION_FINISH
Event Getters
¯¯¯¯¯¯¯¯¯¯¯¯¯
call GetEventUnit()
returns the event unit, similar to GetTriggerUnit().
MB: GetTriggerUnit() will NOT work with ExtraEvents.
call GetCargoUnit()
returns the transport unit.
NB: Only works on EVENT_ON_CARGO_LOAD and EVENT_ON_CARGO_UNLOAD
call GetCargoSize()
returns the number of units loaded in a transport.
NB: Only works on EVENT_ON_CARGO_LOAD and EVENT_ON_CARGO_UNLOAD
*/
library UnitEventsEx requires RegisterPlayerUnitEvent
globals
// CONFIGURATION
// the transform detection ability. If DETECT_TRANSFORM is false, this is not needed.
private constant integer DETECT_TRANSFORM_ABILITY = 'EEdt'
// toggles the detection of transform events.
private constant boolean DETECT_TRANSFORM = true
// toggles the detection of load/unload of cargo units, except for dead units (eg Meat Wagon's Exhume Corpse)
private constant boolean DETECT_CARGO = true
// toggles the detection of unloading dead units in cargo (Exhume Corpse). Does nothing if DETECT_CARGO is false.
private constant boolean DETECT_CARGO_DEAD = true
// toggles the detection of when a unit begins and finishes reincarnating.
private constant boolean DETECT_REINCARNATION = true
// toggles the detection of when a unit is animated via animate dead.
private constant boolean DETECT_ANIMATE_DEAD = true
// toggles the detection of units that are brought back to life via resurrection.
private constant boolean DETECT_RESURRECTION = true
// this overrides reincarnation, animate dead and resurrection. Set to true if you want any of these events to work.
// for some reason setting DETECT_REVIVES = (DETECT_REINCARNATION or DETECT_ANIMATE_DEAD or DETECT_RESURRECTION) does not work.
private constant boolean DETECT_REVIVES = true
// END CONFIGURATION
private unit eventUnit = null
private unit eventOther = null
private integer eventPreType = 0
integer EVENT_ON_TRANSFORM
integer EVENT_ON_CARGO_LOAD
integer EVENT_ON_CARGO_UNLOAD
integer EVENT_ON_RESURRECTION
integer EVENT_ON_ANIMATE_DEAD
integer EVENT_ON_REINCARNATION_START
integer EVENT_ON_REINCARNATION_FINISH
private integer Stack = -1
private unit array IndexedUnit
private unit array CargoUnit
private group array CargoGroup
private integer array PreTransformType
private real MaxX
private real MaxY
private boolean array IsNew
private boolean array IsAlive
private boolean array IsReincarnating
private boolean array IsTransforming
private timer AfterIndexTimer = CreateTimer()
private boolean rezCheck = true
endglobals
native UnitAlive takes unit u returns boolean
//! runtextmacro optional DEFINE_LIST("", "UEExList", "unit")
private function FireEvent takes integer ev, unit u, unit other returns nothing
local integer playerId = GetPlayerId(GetOwningPlayer(u))
local integer handleId = GetHandleId(u)
local integer id = GetUnitId(u)
local unit prevUnit = eventUnit
local unit prevOther = eventOther
local integer prevType = eventPreType
set eventUnit = u
set eventOther = other
set eventPreType = PreTransformType[id]
call TriggerEvaluate(GetNativeEventTrigger(ev))
if IsNativeEventRegistered(playerId, ev) then
call TriggerEvaluate(GetIndexNativeEventTrigger(playerId, ev))
elseif IsNativeEventRegistered(handleId, ev) then
call TriggerEvaluate(GetIndexNativeEventTrigger(handleId, ev))
endif
set eventUnit = prevUnit
set eventOther = prevOther
set eventPreType = prevType
set prevUnit = null
set prevOther = null
endfunction
private struct Cargo
static if LIBRARY_ListT then
private static UEExList array CargoList
endif
static method delete takes integer transport_id returns nothing
static if LIBRARY_ListT then
call CargoList[transport_id].destroy()
else
call DestroyGroup(CargoGroup[transport_id])
endif
endmethod
static method remove takes unit u, unit transport returns nothing
local integer transport_id = GetUnitId(transport)
static if LIBRARY_ListT then
call CargoList[transport_id].removeElem(u)
else
call GroupRemoveUnit(CargoGroup[transport_id], u)
endif
call FireEvent(EVENT_ON_CARGO_UNLOAD, u, transport)
endmethod
static method add takes unit u, unit transport returns nothing
local integer transport_id = GetUnitId(transport)
static if LIBRARY_ListT then
call CargoList[transport_id].push(u)
else
call GroupAddUnit(CargoGroup[transport_id], u)
endif
call FireEvent(EVENT_ON_CARGO_LOAD, u, transport)
endmethod
static method size takes integer transport_id returns integer
static if LIBRARY_ListT then
return CargoList[transport_id].size()
else
return CountUnitsInGroup(CargoGroup[transport_id])
endif
endmethod
static method exists takes integer transport_id returns boolean
static if LIBRARY_ListT then
return (CargoList[transport_id] != 0)
else
return (CargoGroup[transport_id] != null)
endif
endmethod
static method create takes integer transport_id returns thistype
static if LIBRARY_ListT then
set CargoList[transport_id] = UEExList.create()
else
set CargoGroup[transport_id] = CreateGroup()
endif
return 0
endmethod
endstruct
// these functions are here so that they don't call functions below them.
function GetEventUnit takes nothing returns unit
return eventUnit
endfunction
function GetCargoUnit takes nothing returns unit
return eventOther
endfunction
function GetCargoSize takes unit transport returns integer
return Cargo.size(GetUnitId(transport))
endfunction
private module UnitEventsExCore
/*/* afterIndex */*/
private static method afterIndex takes nothing returns nothing
local integer i = Stack
local integer id
local unit u
loop
exitwhen i < 0
set u = IndexedUnit[i]
set id = GetUnitId(u)
if IsNew[id] then
set IsNew[id] = false
elseif IsTransforming[id] then
static if DETECT_TRANSFORM then
call FireEvent(EVENT_ON_TRANSFORM, u, null)
set IsTransforming[id] = false
// The unit has finished transforming. Store it's new type id.
set PreTransformType[id] = GetUnitTypeId(u)
call UnitAddAbility(u, DETECT_TRANSFORM_ABILITY)
endif
elseif IsAlive[id] then
static if DETECT_REINCARNATION then
set IsReincarnating[id] = true
set IsAlive[id] = false
call FireEvent(EVENT_ON_REINCARNATION_START, u, null)
endif
endif
set IndexedUnit[i] = null
set i = i - 1
endloop
set Stack = -1
set u = null
endmethod
/*/* timerCheck */*/
private static method timerCheck takes unit u returns nothing
set Stack = Stack + 1
set IndexedUnit[Stack] = u
call TimerStart(AfterIndexTimer, 0., false, function thistype.afterIndex)
endmethod
/*/* unload */*/
private static method unload takes unit u returns nothing
local integer id = GetUnitId(u)
local integer cargo_id = GetUnitId(CargoUnit[id])
call Cargo.remove(u, CargoUnit[id])
if not IsUnitLoaded(u) or not UnitAlive(CargoUnit[id]) then
set CargoUnit[id] = null
endif
endmethod
/*/* onOrder */*/
private static method onOrder takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer id = GetUnitId(u)
// onOrder occurs after onEnter
/*
NB: when units are unloaded from a transport, they fire a stop order (see below)
When units are removed from the game or die, they fire an undefend order.
*/
// If id is not zero then the unit has been indexed.
if id > 0 then
// Detect Cargo
static if DETECT_CARGO then
if GetIssuedOrderId() == 851972 then // order stop
// This does not detect unloaded corpses.
if CargoUnit[id] != null and not IsUnitLoaded(u) or UnitAlive(u) then
call thistype.unload(u)
endif
set u = null
return
endif
endif
// Detect Morph
static if DETECT_TRANSFORM then
if GetUnitAbilityLevel(u, DETECT_TRANSFORM_ABILITY) == 0 and not IsTransforming[id] then
// re-adding DETECT_TRANSFORM_ABILITY immediately doesn't work, so it has to be
// done after a zero-second timer.
set IsTransforming[id] = true
call thistype.timerCheck(u)
set u = null
return
endif
endif
// Detect Revives
static if DETECT_REVIVES then
// If unit was not previously alive and ...
if not IsAlive[id] and UnitAlive(u) then
set IsAlive[id] = true
// ... it is also a summoned unit then it has been Reanimated.
if IsUnitType(u, UNIT_TYPE_SUMMONED) then
static if DETECT_ANIMATE_DEAD then
call FireEvent(EVENT_ON_ANIMATE_DEAD, u, null)
endif
// ... IsReincarnating[id] is true then it is done reincarnating.
elseif IsReincarnating[id] then
static if DETECT_REINCARNATION then
call FireEvent(EVENT_ON_REINCARNATION_FINISH, u, null)
endif
// ... neither of the above two conditions have been met, it has been resurrected.
elseif not IsNew[id] and not rezCheck then
static if DETECT_RESURRECTION then
call FireEvent(EVENT_ON_RESURRECTION, u, null)
endif
endif
// Else if the unit is dead then ...
elseif not UnitAlive(u) then
// if unit was just indexed then it was created as a corpse.
if IsNew[id] then
set IsAlive[id] = false
// else if either of these parameters are true then ...
elseif CargoUnit[id] == null or not IsUnitType(u, UNIT_TYPE_HERO) then
/* order undefend fires before a UNIT_DEATH event, so if the unit is not
alive, yet IsAlive[id] is true, that means the unit is potentially reincar-
nating. Fire a zero-second timer to give time for the UNIT_DEATH event to
trigger. If IsAlive[id] is still true, then the unit is reincarnating. */
if IsAlive[id] then
call thistype.timerCheck(u)
endif
endif
endif
endif // static if DETECT_REVIVES then
endif
set u = null
endmethod
/*/* onDeath */*/
private static method onDeath takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer id = GetUnitId(u)
// This checks if the unit has been indexed.
if id > 0 then
set IsAlive[id] = false
endif
static if DETECT_CARGO then
if CargoUnit[id] != null then
call FireEvent(EVENT_ON_CARGO_UNLOAD, u, CargoUnit[id])
set CargoUnit[id] = null
endif
endif
set u = null
endmethod
/*/* onLoad */*/
private static method onLoad takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer id = GetUnitId(u)
local integer cargo_id
// if unit somehow loaded into a transport while being inside another, unload it
if CargoUnit[id] != null then
call thistype.unload(u)
endif
static if DETECT_CARGO_DEAD then
// if a Meat Wagon loads up a corpse either by grabbing one on the ground of via Exhume
// Corpse, that corpse is sent to the edge of the map by this system. This way, when it
// is unloaded and placed back at the Meat Wagon's location, it fires an onEnter event,
// which allows the system to detect when a corpse was unloaded from a transport.
if not UnitAlive(u) then
call SetUnitX(u, MaxX)
call SetUnitY(u, MaxY)
endif
endif
set CargoUnit[id] = GetTransportUnit()
set cargo_id = GetUnitId(CargoUnit[id])
if not Cargo.exists(cargo_id) then
call Cargo.create(cargo_id)
endif
call Cargo.add(u, CargoUnit[id])
set u = null
endmethod
/*/* onEnter */*/
private static method onEnter takes nothing returns nothing
local unit u = GetFilterUnit()
local integer id = GetUnitId(u)
local integer cargo_id = GetUnitId(CargoUnit[id])
// onEnter occurs AFTER onIndex
// The unit was dead, but has re-entered the map. Used to detect when a Meat Wagon unloads a corpse.
if id > 0 then
if not IsUnitLoaded(u) and CargoUnit[id] != null then
call thistype.unload(u)
endif
endif
set u = null
endmethod
/*/* onIndex */*/
private static method onIndex takes nothing returns nothing
local unit u = GetIndexedUnit()
local integer id = GetUnitId(u)
// onIndex occurs BEFORE onEnter
set IsNew[id] = true
static if DETECT_TRANSFORM then
set IsTransforming[id] = false
set PreTransformType[id] = GetUnitTypeId(u)
call UnitAddAbility(u, DETECT_TRANSFORM_ABILITY)
endif
static if DETECT_REINCARNATION and DETECT_REVIVES then
set IsReincarnating[id] = false
endif
if UnitAlive(u) then
set IsAlive[id] = true
else
set IsAlive[id] = false
endif
// This is called here so as to set the variable IsNew[] to false after 0. seconds.
call thistype.timerCheck(u)
set u = null
endmethod
/*/* onDeindex */*/
private static method onDeindex takes nothing returns nothing
local unit u = GetIndexedUnit()
local integer id = GetUnitId(u)
if Cargo.exists(id) then
call Cargo.delete(id)
endif
set u = null
endmethod
private static method onInit takes nothing returns nothing
local integer i
static if DETECT_CARGO and DETECT_CARGO_DEAD then
static if (not LIBRARY_WorldBounds) then
local rect world = GetWorldBounds()
local region reg = CreateRegion()
set MaxX = GetRectMaxX(world)
set MaxY = GetRectMaxY(world)
endif
endif
set EVENT_ON_CARGO_LOAD = CreateNativeEvent()
set EVENT_ON_CARGO_UNLOAD = CreateNativeEvent()
set EVENT_ON_TRANSFORM = CreateNativeEvent()
set EVENT_ON_ANIMATE_DEAD = CreateNativeEvent()
set EVENT_ON_RESURRECTION = CreateNativeEvent()
set EVENT_ON_REINCARNATION_START = CreateNativeEvent()
set EVENT_ON_REINCARNATION_FINISH = CreateNativeEvent()
call RegisterAnyPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER, function thistype.onOrder)
call RegisterAnyPlayerUnitEvent(EVENT_PLAYER_UNIT_DEATH, function thistype.onDeath)
static if DETECT_CARGO then
static if DETECT_CARGO_DEAD then
static if (not LIBRARY_WorldBounds) then
call RegionAddRect(reg, world)
call TriggerRegisterEnterRegion(CreateTrigger(), reg, function thistype.onEnter)
call RemoveRect(world)
set world = null
set reg = null
else
call TriggerRegisterEnterRegion(CreateTrigger(), WorldBounds.worldRegion, function thistype.onEnter)
endif
call RegisterAnyPlayerUnitEvent(EVENT_PLAYER_UNIT_LOADED, function thistype.onLoad)
endif
call RegisterUnitIndexEvent(Condition(function thistype.onDeindex), EVENT_UNIT_DEINDEX)
endif
call RegisterUnitIndexEvent(Condition(function thistype.onIndex), EVENT_UNIT_INDEX)
static if DETECT_TRANSFORM then
set i = 0
loop
call SetPlayerAbilityAvailable(Player(i), DETECT_TRANSFORM_ABILITY, false)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
endif
// see resurrectionTimer below.
call TimerStart(CreateTimer(), 0., false, function thistype.resurrectionTimer)
endmethod
// for some reason dummy recyclers creating dummies to store fires off a resurrection event, so
// this boolean rezCheck is set to false after a 0. second timer to prevent this from happening.
// rezCheck must be false for a resurrection event to happen.
private static method resurrectionTimer takes nothing returns nothing
set rezCheck = false
call DestroyTimer(GetExpiredTimer())
endmethod
endmodule
private struct UnitEventsEx
implement UnitEventsExCore
endstruct
endlibrary
scope onUnitEventsEx
private function onLoad takes nothing returns nothing
local unit transport = GetCargoUnit()
call BJDebugMsg(GetUnitName(GetEventUnit()) + " was loaded into " + GetUnitName(transport))
set transport = null
endfunction
private function onUnload takes nothing returns nothing
local unit transport = GetCargoUnit()
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has disembarked from " + GetUnitName(transport))
set transport = null
endfunction
private function onReincarnateStart takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has begun reincarnating.")
endfunction
private function onReincarnateFinish takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has reincarnated.")
endfunction
private function onAnimate takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has been reanimated.")
endfunction
private function onResurrect takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has been resurrected.")
endfunction
private function onMorph takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEventUnit()) + " has finished morphing.")
endfunction
struct onUnitEventsEx
private static method onInit takes nothing returns nothing
call RegisterNativeEvent(EVENT_ON_CARGO_LOAD, function onLoad)
call RegisterNativeEvent(EVENT_ON_CARGO_UNLOAD, function onUnload)
call RegisterNativeEvent(EVENT_ON_REINCARNATION_START, function onReincarnateStart)
call RegisterNativeEvent(EVENT_ON_REINCARNATION_FINISH, function onReincarnateFinish)
call RegisterNativeEvent(EVENT_ON_ANIMATE_DEAD, function onAnimate)
call RegisterNativeEvent(EVENT_ON_RESURRECTION, function onResurrect)
call RegisterNativeEvent(EVENT_ON_TRANSFORM, function onMorph)
endmethod
endstruct
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Rects
public function IsUnitInRect takes unit u, rect r returns boolean
return (GetUnitX(u) > GetRectMinX(r)-32 and GetUnitX(u) < GetRectMaxX(r)+32) and (GetUnitY(u) > GetRectMinY(r)-32 and GetUnitY(u) < GetRectMaxY(r)+32)
endfunction
endlibrary
//TESH.scrollpos=53
//TESH.alwaysfold=0
library FearSystem /* v2.7
************************************************************************************
*
* */uses /*
* */optional/*
*
* */ Table /* http://www.hiveworkshop.com/forums/jass-resources-412/snippet-new-table-188084/
* //By Bribe or Vexorian
*
************************************************************************************
*
* struct Fear extends array
*
* Description
* -------------------------
*
* This is a fear system; use it to remove player
* control from a unit temporarily. Units affected
* will also be unable to attack.
*
* Fields
* -------------------------
*
* unit targ -> The unit you want to apply the fear.
*
* string path -> The path of the sfx you want to add to the unit.
*
* string attach -> The attachment string you want the sfx to be on the unit
*
* readonly effect e -> The effect currently applied to the unit.
* Initializes to null
*
* Methods
* -------------------------
*
* static method create takes nothing returns thistype
* method destroy takes nothing returns nothing
*
* method start takes nothing returns nothing
* When you have set every parameters you start your fear instance.
*
* method changeEffect takes string path, string attach returns nothing
* If you already have set the effect of your instance and it is running
* and you want to change it use this.
*
* static method isFeared takes unit u returns boolean
* static method get takes unit u returns thistype
*
* Operators
* -------------------------
*
* method operator time= takes real t returns nothing
* method operator time takes nothing returns real
*
* Credits
* -------------------------
*
* - Vexorian for vJASS and Table
* - Maker for the DisableUnit function
* - Bribe for Table
* - Chobibo for the addition in the DisableUnit function/
*
************************************************************************************/
native UnitAlive takes unit u returns boolean
globals
//There will be check every FPS second.
private constant real FPS = 0.031250000
//Feared units will change direction every EACH_CHANGE FPS.
private constant integer EACH_CHANGE = 8
//Feared units will go maximum in a circle of 150 around them each time they change direction.
private constant real AROUND = 300.
//The rawcode of the attack disable. Be sure it is the same in the Object Editor.
private constant integer DISABLE_ATTACK = 'A0CF'
//The rawcode of the morph. Be sure it is the same in the Object Editor.
private constant integer MORPH_ID = 'AEme'
//The rawcode of the bear form. Be sure it is the same in the Object Editor.
private constant integer BEAR_ID = 'Abrf'
endglobals
globals
private hashtable ht = InitHashtable()
endglobals
private function round takes real r returns integer
return R2I(r+0.5)
endfunction
private function modulo takes integer a, integer b returns integer
return a - (a/b)*b
endfunction
//Credits to Maker for this awesum func <3
private function DisableControl takes unit u returns nothing
local boolean b
//call UnitAddAbility(u, 'Aloc')
//call UnitRemoveAbility(u, 'Aloc')
// if IsUnitType(u, UNIT_TYPE_HERO) then
// call UnitAddAbility(u,MORPH_ID)
// call IssueImmediateOrder(u, "metamorphosis")
// call UnitRemoveAbility(u,MORPH_ID)
// else
// call UnitAddAbility(u, BEAR_ID)
// call IssueImmediateOrder(u, "bearform")
// call UnitRemoveAbility(u, BEAR_ID)
// endif
//Thanks to chobibo for this idea
// if GetLocalPlayer() != GetOwningPlayer(u) then
// set b = not IsUnitHidden(u)
// call ShowUnit(u,false)
// call ShowUnit(u,b)
// endif
//I added this line to disable their attack too.
call UnitAddAbility(u,DISABLE_ATTACK)
call UnitAddAbility(u,'A0CW')
endfunction
private function EnableControl takes unit u returns nothing
local boolean backup = not IsUnitHidden(u)
//call ShowUnit(u,false)
//I added this line to enable their attack.
call UnitRemoveAbility(u,DISABLE_ATTACK)
call UnitRemoveAbility(u,'A0CW')
//call ShowUnit(u,backup)
endfunction
struct Fear extends array
unit targ
string path
string attach
readonly effect e
readonly boolean b
private integer steps
private integer startat
private static timer period
private static integer dindex
private static thistype array data
private static integer instanceCount
private static thistype recycle
private thistype recycleNext
private static method periodic takes nothing returns nothing
local thistype this
local real x
local real y
local integer i = 0
loop
exitwhen i > dindex
set this = data[i]
if modulo(this.steps,EACH_CHANGE) == this.startat then
set x = GetUnitX(this.targ)
set y = GetUnitY(this.targ)
call IssuePointOrder(this.targ, "move", GetRandomReal(x-AROUND,x+AROUND), GetRandomReal(y-AROUND, y+AROUND) )
endif
set this.steps = this.steps - 1
if this.steps == 0 or not(UnitAlive(this.targ)) then
set data[i] = data[dindex]
set i = i - 1
set dindex = dindex - 1
if this.e != null then
call DestroyEffect(this.e)
set this.e = null
endif
call IssueImmediateOrder(this.targ,"stop")
call EnableControl(this.targ)
call FlushChildHashtable(ht,GetHandleId(this.targ))
if this.b then
set this.targ = null
set recycleNext = recycle
set recycle = this
endif
endif
if dindex == -1 then
call PauseTimer(period)
endif
set i = i + 1
endloop
endmethod
static method isFeared takes unit u returns boolean
return HaveSavedInteger(ht,GetHandleId(u),0)
endmethod
method operator time= takes real t returns nothing
set this.steps = round(t/FPS)
endmethod
method operator time takes nothing returns real
return this.steps*FPS
endmethod
method changeEffect takes string path, string attach returns nothing
call DestroyEffect(this.e)
set this.e = null
set this.e = AddSpecialEffectTarget(path,this.targ,attach)
endmethod
static method get takes unit u returns thistype
local thistype this
if isFeared(u) then
return LoadInteger(ht,GetHandleId(u),0)
else
debug call BJDebugMsg("Tryng to get wrong instance")
return 0
endif
endmethod
method start takes nothing returns nothing
debug if this.targ==null or this.steps==0 then
debug call BJDebugMsg("You're instanciating badly ....")
debug return
debug endif
set dindex = dindex + 1
set data[dindex] = this
set this.startat = modulo(this.steps,EACH_CHANGE)
call DisableControl(this.targ)
if this.path != "" and this.attach != "" then
set this.e = AddSpecialEffectTarget(this.path, this.targ, this.attach)
endif
call SaveInteger(ht,GetHandleId(this.targ),0,this)
if dindex == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
endif
endmethod
static method create takes nothing returns thistype
local thistype this
if recycle == 0 then
set instanceCount = instanceCount + 1
set this = instanceCount
else
set this = recycle
set recycle = recycle.recycleNext
endif
set this.path = ""
set this.attach = ""
set this.e = null
set this.b = false
return this
endmethod
method destroy takes nothing returns nothing
set this.b = true
endmethod
private static method onInit takes nothing returns nothing
set dindex = - 1
set instanceCount = 0
set recycle = 0
set period = CreateTimer()
endmethod
endstruct
endlibrary
library MouseUtils
/*
-------------------
MouseUtils
- MyPad
1.0.2.3
-------------------
----------------------------------------------------------------------------
A simple snippet that allows one to
conveniently use the mouse natives
as they were meant to be...
-------------------
| API |
-------------------
struct UserMouse extends array
static method operator [] (player p) -> thistype
- Returns the player's id + 1
static method getCurEventType() -> integer
- Returns the custom event that got executed.
method operator player -> player
- Returns Player(this - 1)
readonly real mouseX
readonly real mouseY
- Returns the current mouse coordinates.
readonly method operator isMouseClicked -> boolean
- Determines whether any mouse key has been clicked,
and will return true on the first mouse key.
method isMouseButtonClicked(mousebuttontype mouseButton)
- Returns true if the mouse button hasn't been
released yet.
method setMousePos(real x, y) (introduced in 1.0.2.2)
- Sets the mouse position for a given player.
static method registerCode(code c, integer ev) -> triggercondition
- Lets code run upon the execution of a certain event.
- Returns a triggercondition that can be removed later.
static method unregisterCallback(triggercondition trgHndl, integer ev)
- Removes a generated triggercondition from the trigger.
functions:
GetPlayerMouseX(player p) -> real
GetPlayerMouseY(player p) -> real
- Returns the coordinates of the mouse of the player.
OnMouseEvent(code func, integer eventId) -> triggercondition
- See UserMouse.registerCode
GetMouseEventType() -> integer
- See UserMouse.getCurEventType
UnregisterMouseCallback(triggercondition t, integer eventId)
- See UserMouse.unregisterCallback
SetUserMousePos(player p, real x, real y)
- See UserMouse.setMousePos
Unique Global Constants:
IMPL_LOCK (Introduced in v.1.0.2.2)
- Enables or disables the lock option
-------------------
| Credits |
-------------------
- Pyrogasm for pointing out a comparison logic flaw
in operator isMouseClicked.
- Illidan(Evil)X for the useful enum handles that
grant more functionality to this snippet.
- TriggerHappy for the suggestion to include
associated events and callbacks to this snippet.
- Quilnez for pointing out a bug related to the
method isMouseButtonClicked not working as intended
in certain situations.
----------------------------------------------------------------------------
*/
// Arbitrary constants
globals
constant integer EVENT_MOUSE_UP = 0x400
constant integer EVENT_MOUSE_DOWN = 0x800
constant integer EVENT_MOUSE_MOVE = 0xC00
// Introduced in v1.0.2.3
private constant real STARTUP_DELAY = 0.01
private constant boolean NO_DELAY = false
// Introduced in v1.0.2.2
private constant boolean IMPL_LOCK = true
endglobals
private module Init
static if not NO_DELAY then
private static method invokeTimerInit takes nothing returns nothing
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
call thistype.timerInit()
endmethod
endif
private static method onInit takes nothing returns nothing
static if not NO_DELAY then
local timer temp = CreateTimer()
static if thistype.timerInitDelay.exists then
call TimerStart(temp, thistype.timerInitDelay(), false, function thistype.invokeTimerInit)
else
call TimerStart(temp, 0.0, false, function thistype.invokeTimerInit)
endif
set temp = null
else
call thistype.init()
endif
endmethod
endmodule
struct UserMouse extends array
static if IMPL_LOCK then
// Determines the minimum interval that a mouse move event detector
// will be deactivated. (Globally-based)
// You can configure it to any amount you like.
private static constant real INTERVAL = 0.031250000
// Determines how many times a mouse move event detector can fire
// before being deactivated. (locally-based)
// You can configure this to any integer value. (Preferably positive)
private static constant integer MOUSE_COUNT_MAX = 16
// Determines the amount to be deducted from mouseEventCount
// per INTERVAL. Runs independently of resetTimer
private static constant integer MOUSE_COUNT_LOSS = 8
private static constant boolean IS_INSTANT = (INTERVAL <= 0.)
endif
private static integer currentEventType = 0
private static integer updateCount = 0
private static trigger stateDetector = null
static if IMPL_LOCK and not IS_INSTANT then
private static timer resetTimer = null
private integer mouseEventCount
private timer mouseEventReductor
endif
private static trigger array evTrigger
private static integer array mouseButtonStack
private thistype next
private thistype prev
private thistype resetNext
private thistype resetPrev
private trigger posDetector
private integer mouseClickCount
readonly real mouseX
readonly real mouseY
// Converts the enum type mousebuttontype into an integer
private static method toIndex takes mousebuttontype mouseButton returns integer
return GetHandleId(mouseButton)
endmethod
static method getCurEventType takes nothing returns integer
return currentEventType
endmethod
static method operator [] takes player p returns thistype
if thistype(GetPlayerId(p) + 1).posDetector != null then
return GetPlayerId(p) + 1
endif
return 0
endmethod
method operator player takes nothing returns player
return Player(this - 1)
endmethod
method operator isMouseClicked takes nothing returns boolean
return .mouseClickCount > 0
endmethod
method isMouseButtonClicked takes mousebuttontype mouseButton returns boolean
return UserMouse.mouseButtonStack[(this - 1)*3 + UserMouse.toIndex(mouseButton)] > 0
endmethod
method setMousePos takes integer x, integer y returns nothing
if GetLocalPlayer() == this.player then
call BlzSetMousePos(x, y)
endif
endmethod
static if IMPL_LOCK then
private static method getMouseEventReductor takes timer t returns thistype
local thistype this = thistype(0).next
loop
exitwhen this.mouseEventReductor == t or this == 0
set this = this.next
endloop
return this
endmethod
private static method onMouseUpdateListener takes nothing returns nothing
local thistype this = thistype(0).resetNext
set updateCount = 0
loop
exitwhen this == 0
set updateCount = updateCount + 1
set this.mouseEventCount = 0
call EnableTrigger(this.posDetector)
set this.resetNext.resetPrev = this.resetPrev
set this.resetPrev.resetNext = this.resetNext
set this = this.resetNext
endloop
if updateCount > 0 then
static if not IS_INSTANT then
call TimerStart(resetTimer, INTERVAL, false, function thistype.onMouseUpdateListener)
else
call onMouseUpdateListener()
endif
else
static if not IS_INSTANT then
call TimerStart(resetTimer, 0.00, false, null)
call PauseTimer(resetTimer)
endif
endif
endmethod
private static method onMouseReductListener takes nothing returns nothing
local thistype this = getMouseEventReductor(GetExpiredTimer())
if this.mouseEventCount <= 0 then
call PauseTimer(this.mouseEventReductor)
else
set this.mouseEventCount = IMaxBJ(this.mouseEventCount - MOUSE_COUNT_LOSS, 0)
call TimerStart(this.mouseEventReductor, INTERVAL, false, function thistype.onMouseReductListener)
endif
endmethod
endif
private static method onMouseUpOrDown takes nothing returns nothing
local thistype this = thistype[GetTriggerPlayer()]
local integer index = (this - 1)*3 + UserMouse.toIndex(BlzGetTriggerPlayerMouseButton())
local boolean releaseFlag = false
if GetTriggerEventId() == EVENT_PLAYER_MOUSE_DOWN then
set this.mouseClickCount = IMinBJ(this.mouseClickCount + 1, 3)
set releaseFlag = UserMouse.mouseButtonStack[index] <= 0
set UserMouse.mouseButtonStack[index] = IMinBJ(UserMouse.mouseButtonStack[index] + 1, 1)
if releaseFlag then
set currentEventType = EVENT_MOUSE_DOWN
call TriggerEvaluate(evTrigger[EVENT_MOUSE_DOWN])
endif
else
set this.mouseClickCount = IMaxBJ(this.mouseClickCount - 1, 0)
set releaseFlag = UserMouse.mouseButtonStack[index] > 0
set UserMouse.mouseButtonStack[index] = IMaxBJ(UserMouse.mouseButtonStack[index] - 1, 0)
if releaseFlag then
set currentEventType = EVENT_MOUSE_UP
call TriggerEvaluate(evTrigger[EVENT_MOUSE_UP])
endif
endif
endmethod
private static method onMouseMove takes nothing returns nothing
local thistype this = thistype[GetTriggerPlayer()]
local boolean started = false
set this.mouseX = BlzGetTriggerPlayerMouseX()
set this.mouseY = BlzGetTriggerPlayerMouseY()
static if IMPL_LOCK then
set this.mouseEventCount = this.mouseEventCount + 1
call BJDebugMsg("Mouse moved: " + I2S(this.mouseEventCount))
if this.mouseEventCount <= 1 then
call TimerStart(this.mouseEventReductor, INTERVAL, false, function thistype.onMouseReductListener)
endif
endif
set currentEventType = EVENT_MOUSE_MOVE
call TriggerEvaluate(evTrigger[EVENT_MOUSE_MOVE])
static if IMPL_LOCK then
if this.mouseEventCount >= thistype.MOUSE_COUNT_MAX then
call DisableTrigger(this.posDetector)
if thistype(0).resetNext == 0 then
static if not IS_INSTANT then
call TimerStart(resetTimer, INTERVAL, false, function thistype.onMouseUpdateListener)
// Mouse event reductor should be paused
else
set started = true
endif
call PauseTimer(this.mouseEventReductor)
endif
set this.resetNext = 0
set this.resetPrev = this.resetNext.resetPrev
set this.resetPrev.resetNext = this
set this.resetNext.resetPrev = this
if started then
call onMouseUpdateListener()
endif
endif
endif
endmethod
private static method initCallback takes nothing returns nothing
local thistype this = 1
local player p = this.player
static if IMPL_LOCK and not IS_INSTANT then
set resetTimer = CreateTimer()
endif
set stateDetector = CreateTrigger()
set evTrigger[EVENT_MOUSE_UP] = CreateTrigger()
set evTrigger[EVENT_MOUSE_DOWN] = CreateTrigger()
set evTrigger[EVENT_MOUSE_MOVE] = CreateTrigger()
call TriggerAddCondition( stateDetector, Condition(function thistype.onMouseUpOrDown))
loop
exitwhen integer(this) > bj_MAX_PLAYER_SLOTS
if GetPlayerController(p) == MAP_CONTROL_USER and GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
set this.next = 0
set this.prev = thistype(0).prev
set thistype(0).prev.next = this
set thistype(0).prev = this
set this.posDetector = CreateTrigger()
static if IMPL_LOCK and not IS_INSTANT then
set this.mouseEventReductor = CreateTimer()
endif
call TriggerRegisterPlayerEvent( this.posDetector, p, EVENT_PLAYER_MOUSE_MOVE )
call TriggerAddCondition( this.posDetector, Condition(function thistype.onMouseMove))
call TriggerRegisterPlayerEvent( stateDetector, p, EVENT_PLAYER_MOUSE_UP )
call TriggerRegisterPlayerEvent( stateDetector, p, EVENT_PLAYER_MOUSE_DOWN )
endif
set this = this + 1
set p = this.player
endloop
endmethod
static if NO_DELAY then
private static method init takes nothing returns nothing
call thistype.initCallback()
endmethod
else
private static constant method timerInitDelay takes nothing returns real
return STARTUP_DELAY
endmethod
private static method timerInit takes nothing returns nothing
call thistype.initCallback()
endmethod
endif
static method registerCode takes code handlerFunc, integer eventId returns triggercondition
return TriggerAddCondition(evTrigger[eventId], Condition(handlerFunc))
endmethod
static method unregisterCallback takes triggercondition whichHandler, integer eventId returns nothing
call TriggerRemoveCondition(evTrigger[eventId], whichHandler)
endmethod
implement Init
endstruct
function GetPlayerMouseX takes player p returns real
return UserMouse[p].mouseX
endfunction
function GetPlayerMouseY takes player p returns real
return UserMouse[p].mouseY
endfunction
function OnMouseEvent takes code func, integer eventId returns triggercondition
return UserMouse.registerCode(func, eventId)
endfunction
function GetMouseEventType takes nothing returns integer
return UserMouse.getCurEventType()
endfunction
function UnregisterMouseCallback takes triggercondition whichHandler, integer eventId returns nothing
call UserMouse.unregisterCallback(whichHandler, eventId)
endfunction
function SetUserMousePos takes player p, integer x, integer y returns nothing
call UserMouse[p].setMousePos(x, y)
endfunction
endlibrary
scope GetMouseXY initializer OnInit
globals
real array MouseX
real array MouseY
endglobals
private function Conditions takes nothing returns boolean
local integer i
if GAME_STARTED then
set i = GetPlayerId(GetTriggerPlayer())
set MouseX[i] = BlzGetTriggerPlayerMouseX()
set MouseY[i] = BlzGetTriggerPlayerMouseY()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>9
call TriggerRegisterPlayerEvent( t,Player(i), EVENT_PLAYER_MOUSE_MOVE )
call TriggerAddCondition( t, Condition( function Conditions ) )
set i = i + 1
endloop
endfunction
endscope
//TESH.scrollpos=3
//TESH.alwaysfold=0
library ProgressBars requires TimerUtils optional BoundSentinel
/**************************************************************
*
* ProgressBars v2.0.1 by TriggerHappy
*
* This library allows you to easily create and modify progress bars.
* It works by creating a dummy unit with a special model and changing
* the animation speed to increase or reduce the bar speed. It is more than
* just a wrapper as it recycles each progress bar, meaning it will avoid
* costly CreateUnit calls whenever possible which also leak.
*
* Options:
* x - set X coordinate
* y - set Y coordinate
* xOffset - offset of the target unit, if any.
* yOffset - offset of the target unit, if any.
* zOffset - how high the bar is from the ground.
* color - allows you to tint the bar or add transparency
* targetUnit - pick which unit the bar should hover over
* size - set model scale
*
* Usage:
* local ProgressBar bar = ProgressBar.create()
* set bar.zOffset = 150
* set bar.color = PLAYER_COLOR_RED
* set bar.targetUnit = CreateUnit(Player(0), 'hfoo', 0, 0, 0)
* call bar.setPercentage(30)
*
* Installation:
* 1. Copy the dummy unit over to your map
* 2. Change the DUMMY constant to fit the Raw code of the dummy.
* 3. Copy this and all required libraries over to your map.
*
* Thanks to JesusHipster for the Progress Bar models
* and to Vexorian for TimerUtils & BoundSentinel
*
**************************************************************/
globals
private constant integer PROGRESS_BAR_DUMMY = 'e00B' // the default one
private constant player PROGRESS_BAR_OWNER = Player(PLAYER_NEUTRAL_PASSIVE) // owner of the dummy
private constant real UPDATE_POSITION_PERIOD = 0.03 // the timer period used with .targetUnit
endglobals
struct ProgressBar
unit bar
unit target
real xOffset = 0
real yOffset = 0
timer timer
timer timer2
private boolean t_enabled = false
private real endVal
private real curVal=0
private real pspeed=0
private boolean reverse
private boolean done
private boolean recycle
readonly static unit array dummy
readonly static integer lastDummyIndex = -1
method operator x= takes real x returns nothing
call SetUnitX(this.bar, x)
endmethod
method operator x takes nothing returns real
return GetUnitX(this.bar)
endmethod
method operator y= takes real y returns nothing
call SetUnitY(this.bar, y)
endmethod
method operator y takes nothing returns real
return GetUnitY(this.bar)
endmethod
method operator zOffset= takes real offset returns nothing
call SetUnitFlyHeight(this.bar, offset, 0)
endmethod
method operator zOffset takes nothing returns real
return GetUnitFlyHeight(this.bar)
endmethod
method operator size= takes real size returns nothing
call SetUnitScale(this.bar, size, size, size)
endmethod
method operator color= takes playercolor color returns nothing
call SetUnitColor(this.bar, color)
endmethod
method show takes boolean flag returns nothing
call UnitRemoveAbility(this.bar, 'Aloc')
call ShowUnit(this.bar, flag)
call UnitAddAbility(this.bar, 'Aloc')
endmethod
method reset takes nothing returns nothing
call SetUnitAnimationByIndex(this.bar, 1)
endmethod
method RGB takes integer red, integer green, integer blue, integer alpha returns nothing
call SetUnitVertexColor(this.bar, red, green, blue, alpha)
endmethod
method destroy takes nothing returns nothing
if (recycle) then
set lastDummyIndex = lastDummyIndex + 1
set dummy[lastDummyIndex] = this.bar
call SetUnitAnimationByIndex(this.bar, 0)
call SetUnitTimeScale(this.bar, 1)
endif
set this.bar = null
set this.target = null
set this.t_enabled = false
set this.endVal = 0
set this.curVal = 0
if (this.timer != null) then
call ReleaseTimer(this.timer)
set this.timer = null
endif
if (this.timer2 != null) then
call ReleaseTimer(this.timer2)
set this.timer2 = null
endif
endmethod
private static method updatePercentage takes nothing returns nothing
local timer expired = GetExpiredTimer()
local thistype this = GetTimerData(expired)
if (this.reverse) then
if (this.curVal > this.endVal) then
call SetUnitTimeScale(this.bar, -this.pspeed)
set this.curVal = (this.curVal - (this.pspeed))
elseif (this.curVal <= this.endVal) then
call PauseTimer(this.timer2)
call SetUnitTimeScale(this.bar, 0)
set this.curVal = this.endVal
set this.done = true
endif
else
if (this.curVal < this.endVal) then
call SetUnitTimeScale(this.bar, this.pspeed)
set this.curVal = (this.curVal + (this.pspeed))
elseif (this.curVal >= this.endVal) then
call PauseTimer(this.timer2)
call SetUnitTimeScale(this.bar, 0)
set this.curVal = this.endVal
set this.done = true
endif
endif
endmethod
private static method updatePosition takes nothing returns nothing
local thistype this = GetTimerData(GetExpiredTimer())
if (this.target != null) then
call SetUnitX(this.bar, GetUnitX(this.target) + xOffset)
call SetUnitY(this.bar, GetUnitY(this.target) + yOffset)
else
call ReleaseTimer(GetExpiredTimer())
endif
endmethod
private static method getDummy takes nothing returns unit
if (lastDummyIndex <= -1) then
set bj_lastCreatedUnit = CreateUnit(PROGRESS_BAR_OWNER, PROGRESS_BAR_DUMMY, 0, 0, 270)
call PauseUnit(bj_lastCreatedUnit, true)
return bj_lastCreatedUnit
endif
call SetUnitAnimationByIndex(dummy[lastDummyIndex], 1)
set lastDummyIndex = lastDummyIndex - 1
return dummy[lastDummyIndex + 1]
endmethod
static method release takes integer count returns nothing
if (count > thistype.lastDummyIndex) then
set count = thistype.lastDummyIndex
endif
loop
exitwhen count <= 0
call RemoveUnit(dummy[count])
set dummy[count] = null
set count = count - 1
endloop
set thistype.lastDummyIndex = -1
endmethod
static method create takes nothing returns thistype
local thistype this = thistype.allocate()
set this.bar = thistype.getDummy()
set this.done = true
set this.recycle = true
call SetUnitAnimationByIndex(this.bar, 1)
call SetUnitTimeScale(this.bar, 0)
return this
endmethod
static method createEx takes integer unitId returns thistype
local thistype this = thistype.allocate()
set this.bar = CreateUnit(PROGRESS_BAR_OWNER, unitId, 0, 0, 0)
set this.done = true
set this.recycle = false
call SetUnitAnimationByIndex(this.bar, 1)
call SetUnitTimeScale(this.bar, 0)
return this
endmethod
method setPercentage takes real percent, real speed returns nothing
set this.endVal = R2I(percent)
set this.pspeed = speed
set this.reverse = (curVal > endVal)
if (this.done) then
if (this.timer2 == null) then
set this.timer2 = NewTimerEx(this)
endif
call TimerStart(this.timer2, 0.01, true, function thistype.updatePercentage)
set this.done=false
endif
endmethod
method operator targetUnit= takes unit u returns nothing
set this.target = u
if (u != null) then
if (this.timer == null) then
set this.timer = NewTimerEx(this)
endif
call TimerStart(this.timer, UPDATE_POSITION_PERIOD, true, function thistype.updatePosition)
call SetUnitX(this.bar, GetUnitX(this.target) - xOffset)
call SetUnitY(this.bar, GetUnitY(this.target) - yOffset)
set this.t_enabled = true
else
if (this.timer != null) then
call ReleaseTimer(this.timer)
endif
set this.t_enabled = false
endif
endmethod
endstruct
endlibrary
//TESH.scrollpos=36
//TESH.alwaysfold=0
/******************************************************************************
*
* TIMED LIGHTNINGS by Maker v1.0.1.1
*
* Allows the creation of lightnings with expiration timer.
* Supports:
* o Fading lightnings in and out
* o Attaching to units
* o Attaching to points
* o Linear movement in x-, y- and z-axes
*
*
* Methods
*
* P2U
* From a static point attached to a unit
* static method P2U takes lightning l, unit t, real time, real x1, real y1, real z1, real z2, real startAlpha, real endAlpha returns nothing
*
* The lightning, target unit, duration, origin x, origin y, origin z, end z
*
*
* P2UEx
* From a moving point attached to a unit
* static method P2UEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
*
* The lightning, target unit, duration, target z, origin start x, origin start y, origin start z, origin end x, origin end y, origin end z
*
* U2P
* From attached to a unit to a static point
* static method U2P takes lightning l, unit s, real t, real x1, real y1, real x2, real y2, real z1, real z2, real startAlpha, real endAlpha returns nothing
*
* The lightning, source unit, duration, origin x, origin y, point x , point y, source z, point z
*
* U2PEx
* From attached to a unit to a moving point
* static method U2PEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
*
* The lightning, source unit, duration, source z, point start x, point start y, point start z, point end x, point end y, point end z
*
* U2U
* From attached to a unit to attached to a unit
* static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
*
* The lightning, source unit, target unit, duration, source z, target z
*
* P2P
* From a static point to a static point
* static method P2P takes lightning l, real t, real startAlpha, real endAlpha returns nothing
*
* The lightning, duration
*
* P2PEx
* From a moving point to a moving point
* static method P2PEx takes lightning l, real t, real x1, real y1, real z1, real x2, real y2, real z2, real x3, real y3, real z3, real x4, real y4, real z4, real startAlpha, real endAlpha returns nothing
*
* The lightning, duration, origin start x, origin start y, origin start z, origin end x, origin end y, origin end z, target start x, target start y, target start z, target end x, target end y, target end z
*
*
* Alpha values are between 1 and 0. 1 is fully visible, 0 is transparent.
*
*******************************************************************************/
library TimedLightnings
globals
private constant real TO = 0.03125000 // Update interval
private integer CT = 0 // Lightning count
private timer TMR = CreateTimer()
private location loc = Location(0,0)
endglobals
struct TimedL extends array
lightning l
real av // aplha value
real da // transparency change rate
real x1
real x2
real y1
real y2
real z1
real z2
real dx1
real dy1
real dz1
real dx2
real dy2
real dz2
unit s // source
unit t // target
integer time // how many ticks, time
integer next // next node
integer prev // previous node
boolean moves
private static integer rlast = 0 // previous created
private static thistype first // first node
private static integer ic = 0
private static integer ir = 0
private thistype rn
private static thistype dat
private static thistype dat2
private static thistype dat3
private static method destroyL takes nothing returns nothing
/*-Link previous node with next one-*/
set dat3 = dat2.prev
set dat3.next = dat2.next
/*-----Set new last created node----*/
if dat2 == rlast then
set rlast = dat3
endif
/*-Link next node with previous one-*/
set dat3 = dat2.next
set dat3.prev = dat2.prev
/*--------Set new first node--------*/
if dat2 == first then
set first = dat3
endif
call DestroyLightning(dat2.l)
set CT = CT - 1
if CT == 0 then
call PauseTimer(TMR)
endif
set dat2.rn=ir
set ir=dat2
endmethod
private static method looping takes nothing returns nothing
local real z1
local real z2
set dat = first
loop
set z1 = 0
set z2 = 0
set dat.time = dat.time - 1
if dat.da != 0 then
set dat.av = dat.av - dat.da
call SetLightningColor(dat.l, 1, 1, 1, dat.av)
endif
if dat.s == null then
if dat.dx1 != 0 then
set dat.x1 = dat.x1 + dat.dx1
endif
if dat.dy1 != 0 then
set dat.y1 = dat.y1 + dat.dy1
endif
if dat.dz1 != 0 then
set dat.z1 = dat.z1 + dat.dz1
endif
else
set dat.x1 = GetUnitX(dat.s)
set dat.y1 = GetUnitY(dat.s)
set z1 = GetUnitFlyHeight(dat.s)
endif
if dat.t == null then
if dat.dx2 != 0 then
set dat.x2 = dat.x2 + dat.dx2
endif
if dat.dy2 != 0 then
set dat.y2 = dat.y2 + dat.dy2
endif
if dat.dz2 != 0 then
set dat.z2 = dat.z2 + dat.dz2
endif
else
set dat.x2 = GetUnitX(dat.t)
set dat.y2 = GetUnitY(dat.t)
set z2 = GetUnitFlyHeight(dat.t)
endif
if dat.moves then
call MoveLocation(loc, dat.x1, dat.y1)
set z1 = GetLocationZ(loc) + dat.z1 + z1
call MoveLocation(loc, dat.x2, dat.y2)
set z2 = GetLocationZ(loc) + dat.z2 + z2
call MoveLightningEx(dat.l, true, dat.x1, dat.y1, z1, dat.x2, dat.y2, z2)
endif
if dat.time == 0 then
set dat2 = dat
set dat = dat.next
call destroyL()
else
set dat = dat.next
endif
exitwhen dat == 0
endloop
endmethod
private static method InitAdd takes nothing returns nothing
/* Add node to list, make this the last on list */
if rlast != 0 then
set dat2 = rlast
set dat2.next = dat
endif
/* Link this with previous node */
set dat.prev = rlast
/* Make this the last created node */
set rlast = dat
set CT = CT + 1
if CT == 1 then
/* Make this the first node */
set first = dat
call TimerStart(TMR, TO, true, function thistype.looping)
endif
endmethod
private static method Recycle takes nothing returns nothing
if 0==ir then
set ic=ic+1
set dat=ic
else
set dat=ir
set ir=dat.rn
endif
endmethod
static method P2U takes lightning l, unit t, real time, real x1, real y1, real z1, real z2, real startAlpha, real endAlpha returns nothing
local thistype this
call Recycle()
set this = dat
set .x1 = x1
set .y1 = y1
set .z1 = z1
set .z2 = z2
set .s = null
set .t = t
set .next = 0 // Nodes are added to the end of the list, there is no next node
set .l = l
set .time = R2I(time/TO) // Calculates how many loops does the lightning lasts
set .av = startAlpha
set .da = (startAlpha-endAlpha)*TO/time // Transparency change speed
set .moves = true
call InitAdd()
endmethod
static method U2P takes lightning l, unit s, real t, real x1, real y1, real x2, real y2, real z1, real z2, real startAlpha, real endAlpha returns nothing
local thistype this
call Recycle()
set this = dat
set .x1 = x1
set .y1 = y1
set .x2 = x2
set .y2 = y2
set .z1 = z1
set .z2 = z2
set .s = s
set .t = null
set .next = 0
set .l = l
set .time = R2I(t/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*TO/t
set .moves = true
call InitAdd()
endmethod
static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
local thistype this
call Recycle()
set this = dat
set .z1 = z1
set .z2 = z2
set .s = s
set .t = t
set .next = 0
set .l = l
set .time = R2I(time/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*TO/time
set .moves = true
call InitAdd()
endmethod
static method P2P takes lightning l, real t, real startAlpha, real endAlpha returns nothing
local thistype this
call Recycle()
set this = dat
set .s = null
set .t = null
set .next = 0
set .l = l
set .time = R2I(t/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*TO/t
set .moves = false
call InitAdd()
endmethod
static method P2UEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
local thistype this
local real n = TO/t
call Recycle()
set this = dat
set .x1 = x1
set dx1 = (x2-x1)*n
set .y1 = y1
set dy1 = (y2-y1)*n
set .z1 = z1
set dz1 = (z2-z1)*n
set .z2 = zu
set .s = null
set .t = a
set .next = 0
set .l = l
set .time = R2I(t/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*n
set .moves = true
call InitAdd()
endmethod
static method U2PEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
local thistype this
local real n = TO/t
call Recycle()
set this = dat
set .x2 = x1
set .dx2 = (x2-x1)*n
set .y2 = y1
set .dy2 = (y2-y1)*n
set .z2 = z1
set .dz2 = (z2-z1)*n
set .z1 = zu
set .s = a
set .t = null
set .next = 0
set .l = l
set .time = R2I(t/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*n
set .moves = true
call thistype.InitAdd()
endmethod
static method P2PEx takes lightning l, real t, real x1, real y1, real z1, real x2, real y2, real z2, real x3, real y3, real z3, real x4, real y4, real z4, real startAlpha, real endAlpha returns nothing
local thistype this
local real n = TO/t
call Recycle()
set this = dat
set .x1 = x1
set .x2 = x3
set .y1 = y1
set .y2 = y3
set .z1 = z1
set .z2 = z3
set .dx1 = (x2-x1)*n
set .dy1 = (y2-y1)*n
set .dz1 = (z2-z1)*n
set .dx2 = (x4-x3)*n
set .dy2 = (y4-y3)*n
set .dz2 = (z4-z3)*n
set .s = null
set .t = null
set .next = 0
set .l = l
set .time = R2I(t/TO)
set .av = startAlpha
set .da = (startAlpha-endAlpha)*n
set .moves = true
call InitAdd()
endmethod
endstruct
endlibrary
library RegisterNativeEvent uses optional Table
globals
private integer eventIndex = 500 // 0-499 reserved for Blizzard native events
endglobals
private module NativeEventInit
private static method onInit takes nothing returns nothing
static if LIBRARY_Table then
set table = TableArray[0x2000]
endif
endmethod
endmodule
private struct NativeEvent extends array
static if LIBRARY_Table then
static TableArray table
else
static hashtable table = InitHashtable()
endif
implement NativeEventInit
endstruct
function IsNativeEventRegistered takes integer whichIndex, integer whichEvent returns boolean
static if LIBRARY_Table then
return NativeEvent.table[whichEvent].trigger.has(whichIndex)
else
return HaveSavedHandle(NativeEvent.table, whichEvent, whichIndex)
endif
endfunction
function RegisterNativeEventTrigger takes integer whichIndex, integer whichEvent returns boolean
if not IsNativeEventRegistered(whichIndex, whichEvent) then
static if LIBRARY_Table then
set NativeEvent.table[whichEvent].trigger[whichIndex] = CreateTrigger()
else
call SaveTriggerHandle(NativeEvent.table, whichEvent, whichIndex, CreateTrigger())
endif
return true
endif
return false
endfunction
function GetIndexNativeEventTrigger takes integer whichIndex, integer whichEvent returns trigger
static if LIBRARY_Table then
return NativeEvent.table[whichEvent].trigger[whichIndex]
else
return LoadTriggerHandle(NativeEvent.table, whichEvent, whichIndex)
endif
endfunction
function GetNativeEventTrigger takes integer whichEvent returns trigger
return GetIndexNativeEventTrigger(bj_MAX_PLAYER_SLOTS, whichEvent)
endfunction
function CreateNativeEvent takes nothing returns integer
local integer eventId = eventIndex
call RegisterNativeEventTrigger(bj_MAX_PLAYER_SLOTS, eventId)
set eventIndex = eventIndex + 1
return eventId
endfunction
function RegisterIndexNativeEvent takes integer whichIndex, integer whichEvent, code func returns triggercondition
call RegisterNativeEventTrigger(whichIndex, whichEvent)
return TriggerAddCondition(GetIndexNativeEventTrigger(whichIndex, whichEvent), Condition(func))
endfunction
function RegisterNativeEvent takes integer whichEvent, code func returns triggercondition
return RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS, whichEvent, func)
endfunction
function UnregisterNativeEventHandler takes integer whichEvent, triggercondition handler returns nothing
call TriggerRemoveCondition(GetNativeEventTrigger(whichEvent), handler)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
/*****************************************************************************
*
* RegisterUnitEvent v1.0.0.1
* by Bannar aka Spinnaker
*
* Register version of TriggerRegisterUnitEvent.
*
******************************************************************************
*
* Requirements:
*
* RegisterNativeEvent by Bannar
* hiveworkshop.com/forums/submissions-414/snippet-registerevent-pack-250266/
*
******************************************************************************
*
* Functions:
*
* function RegisterUnitEvent takes unit whichUnit, unitevent whichEvent, code cb returns nothing
* registers unitevent whichEvent for unit whichUnit adding code cb as callback
*
* function GetUnitEventTrigger takes unitevent whichEvent returns trigger
* retrieves trigger handle for unitevent whichEvent
*
*****************************************************************************/
library RegisterUnitEvent requires RegisterNativeEvent
globals
triggercondition array TriggerCondition
endglobals
function RegisterUnitEvent takes unit whichUnit, unitevent whichEvent, code cb returns nothing
local integer eventId = GetHandleId(whichEvent)
if RegisterNativeEvent(GetHandleId(whichUnit), eventId) then
call TriggerRegisterUnitEvent(GetNativeEventTrigger(eventId), whichUnit, whichEvent)
endif
set TriggerCondition[eventId] = TriggerAddCondition(GetNativeEventTrigger(eventId), Condition(cb))
endfunction
function GetUnitEventTrigger takes unitevent whichEvent returns trigger
return GetNativeEventTrigger(GetHandleId(whichEvent))
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
/**************************************************************
*
* RegisterPlayerUnitEvent
* v5.1.0.0
* By Magtheridon96
*
* I would like to give a special thanks to Bribe, azlier
* and BBQ for improving this library. For modularity, it only
* supports player unit events.
*
* Functions passed to RegisterPlayerUnitEvent must either
* return a boolean (false) or nothing. (Which is a Pro)
*
* Warning:
* --------
*
* - Don't use TriggerSleepAction inside registered code.
* - Don't destroy a trigger unless you really know what you're doing.
*
* API:
* ----
*
* - function RegisterPlayerUnitEvent takes playerunitevent whichEvent, code whichFunction returns nothing
* - Registers code that will execute when an event fires.
* - function RegisterPlayerUnitEventForPlayer takes playerunitevent whichEvent, code whichFunction, player whichPlayer returns nothing
* - Registers code that will execute when an event fires for a certain player.
* - function GetPlayerUnitEventTrigger takes playerunitevent whichEvent returns trigger
* - Returns the trigger corresponding to ALL functions of a playerunitevent.
*
**************************************************************/
library RegisterPlayerUnitEvent // Special Thanks to Bribe and azlier
globals
private trigger array t
endglobals
function RegisterPlayerUnitEvent takes playerunitevent p, code c returns nothing
local integer i = GetHandleId(p)
local integer k = 15
if t[i] == null then
set t[i] = CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent(t[i], Player(k), p, null)
exitwhen k == 0
set k = k - 1
endloop
endif
call TriggerAddCondition(t[i], Filter(c))
endfunction
function RegisterPlayerUnitEventForPlayer takes playerunitevent p, code c, player pl returns nothing
local integer i = 260 + 16 * GetHandleId(p) + GetPlayerId(pl)
if t[i] == null then
set t[i] = CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t[i], pl, p, null)
endif
call TriggerAddCondition(t[i], Filter(c))
endfunction
function GetPlayerUnitEventTrigger takes playerunitevent p returns trigger
return t[GetHandleId(p)]
endfunction
endlibrary
/*****************************************************************************
*
* RegisterPlayerUnitEvent v1.0.3.2
* by Bannar
*
* Register version of TriggerRegisterPlayerUnitEvent.
*
* Special thanks to Magtheridon96, Bribe, azlier and BBQ for the original library version.
*
******************************************************************************
*
* Requirements:
*
* RegisterNativeEvent by Bannar
* hiveworkshop.com/threads/snippet-registerevent-pack.250266/
*
******************************************************************************
*
* Functions:
*
* function GetAnyPlayerUnitEventTrigger takes playerunitevent whichEvent returns trigger
* Retrieves trigger handle for playerunitevent whichEvent.
*
* function GetPlayerUnitEventTrigger takes player whichPlayer, playerunitevent whichEvent returns trigger
* Retrieves trigger handle for playerunitevent whichEvent specific to player whichPlayer.
*
* function RegisterAnyPlayerUnitEvent takes playerunitevent whichEvent, code func returns nothing
* Registers generic playerunitevent whichEvent adding code func as callback.
*
* function RegisterPlayerUnitEvent takes player whichPlayer, playerunitevent whichEvent, code func returns nothing
* Registers playerunitevent whichEvent for player whichPlayer adding code func as callback.
*
*****************************************************************************/
library RegisterPlayerUnitEvent requires RegisterNativeEvent
function GetAnyPlayerUnitEventTrigger takes playerunitevent whichEvent returns trigger
return GetNativeEventTrigger(GetHandleId(whichEvent))
endfunction
function GetPlayerUnitEventTrigger takes player whichPlayer, playerunitevent whichEvent returns trigger
return GetIndexNativeEventTrigger(GetPlayerId(whichPlayer), GetHandleId(whichEvent))
endfunction
function RegisterAnyPlayerUnitEvent takes playerunitevent whichEvent, code func returns nothing
local integer eventId = GetHandleId(whichEvent)
local integer index = 0
local trigger t = null
if RegisterNativeEventTrigger(bj_MAX_PLAYER_SLOTS, eventId) then
set t = GetNativeEventTrigger(eventId)
loop
call TriggerRegisterPlayerUnitEvent(t, Player(index), whichEvent, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
set t = null
endif
call RegisterNativeEvent(eventId, func)
endfunction
function RegisterPlayerUnitEvent takes player whichPlayer, playerunitevent whichEvent, code func returns nothing
local integer playerId = GetPlayerId(whichPlayer)
local integer eventId = GetHandleId(whichEvent)
if RegisterNativeEventTrigger(playerId, eventId) then
call TriggerRegisterPlayerUnitEvent(GetIndexNativeEventTrigger(playerId, eventId), whichPlayer, whichEvent, null)
endif
call RegisterIndexNativeEvent(playerId, eventId, func)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//============================================================================
// SpellEffectEvent
// - Version 1.1.0.0
//
// API
// ---
// RegisterSpellEffectEvent(integer abil, code onCast)
//
// Requires
// --------
// RegisterPlayerUnitEvent: hiveworkshop.com/forums/showthread.php?t=203338
//
// Optional
// --------
// Table: hiveworkshop.com/forums/showthread.php?t=188084
//
library SpellEffectEvent requires RegisterPlayerUnitEvent, optional Table
//============================================================================
private module M
static if LIBRARY_Table then
static Table tb
else
static hashtable ht = InitHashtable()
endif
static method onCast takes nothing returns nothing
static if LIBRARY_Table then
call TriggerEvaluate(.tb.trigger[GetSpellAbilityId()])
else
call TriggerEvaluate(LoadTriggerHandle(.ht, 0, GetSpellAbilityId()))
endif
endmethod
private static method onInit takes nothing returns nothing
static if LIBRARY_Table then
set .tb = Table.create()
endif
call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, function thistype.onCast)
endmethod
endmodule
//============================================================================
private struct S extends array
implement M
endstruct
//============================================================================
function RegisterSpellEffectEvent takes integer abil, code onCast returns nothing
static if LIBRARY_Table then
if not S.tb.handle.has(abil) then
set S.tb.trigger[abil] = CreateTrigger()
endif
call TriggerAddCondition(S.tb.trigger[abil], Filter(onCast))
else
if not HaveSavedHandle(S.ht, 0, abil) then
call SaveTriggerHandle(S.ht, 0, abil, CreateTrigger())
endif
call TriggerAddCondition(LoadTriggerHandle(S.ht, 0, abil), Filter(onCast))
endif
endfunction
endlibrary
scope InitializeCitadelVariables initializer OnInit
globals
real array CitadelSpawnX
real array CitadelSpawnY
integer array RANDOMDAMAGE
integer array RANDOMHEALTH
real array RANDOMARMOR
real array RANDOMMOVESPEED
integer array RANDOMLEVEL
integer array RANDOMBOUNTY
real array RANDOMATTACKINTERVAL
integer array COMMANDERRANDOMDAMAGE
integer array COMMANDERRANDOMHEALTH
real array COMMANDERRANDOMARMOR
real array COMMANDERRANDOMMOVESPEED
integer array COMMANDERRANDOMLEVEL
integer array COMMANDERRANDOMBOUNTY
real array COMMANDERRANDOMATTACKINTERVAL
endglobals
private function OnInit takes nothing returns nothing
local framehandle blackbox
call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false) // Hide bottom black box
set blackbox = BlzCreateFrameByType("BACKDROP", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) // tiny black box behind portrait
call BlzFrameSetSize(blackbox, 0.1, 0.15)
call BlzFrameSetAbsPoint(blackbox, FRAMEPOINT_CENTER, 0.25, 0.05)
call BlzFrameSetTexture(blackbox, "war3mapImported\\Black box.tga", 0, true)
call BlzFrameSetLevel(blackbox , -1)
set CitadelSpawnX[0]= -6399.
set CitadelSpawnY[0]= -1235.8
set CitadelSpawnX[1]= -6385.7
set CitadelSpawnY[1]= -1641.
set CitadelSpawnX[2]= -6775.5
set CitadelSpawnY[2]= -1555.8
set CitadelSpawnX[3]= -5932.4
set CitadelSpawnY[3]= -1516.6
set CitadelSpawnX[4]= -6103.8
set CitadelSpawnY[4]= -995.8
set CitadelSpawnX[5]= 6421.0
set CitadelSpawnY[5]= -1252.
set CitadelSpawnX[6]= 6432.6
set CitadelSpawnY[6]= -1699.2
set CitadelSpawnX[7]= 6061.7
set CitadelSpawnY[7]= -1451.1
set CitadelSpawnX[8]= 6819.3
set CitadelSpawnY[8]= -1475.9
set CitadelSpawnX[9]= 6437.0
set CitadelSpawnY[9]= -708.1
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(0))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(1))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(2))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(3))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(4))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(5))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(6))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(7))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(8))
call SetPlayerAbilityAvailableBJ(false,'A0KV',Player(9))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(0))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(1))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(2))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(3))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(4))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(5))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(6))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(7))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(8))
call SetPlayerAbilityAvailableBJ(false,'A0LA',Player(9))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(0))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(1))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(2))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(3))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(4))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(5))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(6))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(7))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(8))
call SetPlayerAbilityAvailableBJ(false,'A0OK',Player(9))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(0))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(1))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(2))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(3))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(4))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(5))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(6))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(7))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(8))
call SetPlayerAbilityAvailableBJ(false,'A0P9',Player(9))
call SetPlayerTeam(Player(12),0)
call SetPlayerTeam(Player(13),1)
set RANDOMDAMAGE[1] = 4
set RANDOMHEALTH[1] = 50
set RANDOMARMOR[1] = 5.
set RANDOMMOVESPEED[1] = 100.
set RANDOMATTACKINTERVAL[1] = 1.800
set RANDOMLEVEL[1] = 1
set RANDOMBOUNTY[1] = 8
set COMMANDERRANDOMDAMAGE[1] = 7
set COMMANDERRANDOMHEALTH[1] = 175
set COMMANDERRANDOMARMOR[1] = 20.
set COMMANDERRANDOMMOVESPEED[1] = 100.
set COMMANDERRANDOMATTACKINTERVAL[1] = 1.800
set COMMANDERRANDOMLEVEL[1] = 1
set COMMANDERRANDOMBOUNTY[1] = 200
set RANDOMDAMAGE[2] = 9
set RANDOMHEALTH[2] = 160
set RANDOMARMOR[2] = 1.
set RANDOMMOVESPEED[2] = 105.
set RANDOMATTACKINTERVAL[2] = 1.300
set RANDOMLEVEL[2] = 1
set RANDOMBOUNTY[2] = 20
set COMMANDERRANDOMDAMAGE[2] = 12
set COMMANDERRANDOMHEALTH[2] = 315
set COMMANDERRANDOMARMOR[2] = 0.
set COMMANDERRANDOMMOVESPEED[2] = 105.
set COMMANDERRANDOMATTACKINTERVAL[2] = 1.900
set COMMANDERRANDOMLEVEL[2] = 4
set COMMANDERRANDOMBOUNTY[2] = 400
set RANDOMDAMAGE[3] = 13
set RANDOMHEALTH[3] = 240
set RANDOMARMOR[3] = 1.
set RANDOMMOVESPEED[3] = 110.
set RANDOMATTACKINTERVAL[3] = 0.750
set RANDOMLEVEL[3] = 2
set RANDOMBOUNTY[3] = 60
set COMMANDERRANDOMDAMAGE[3] = 39
set COMMANDERRANDOMHEALTH[3] = 750
set COMMANDERRANDOMARMOR[3] = 3.
set COMMANDERRANDOMMOVESPEED[3] = 110.
set COMMANDERRANDOMATTACKINTERVAL[3] = 1.500
set COMMANDERRANDOMLEVEL[3] = 8
set COMMANDERRANDOMBOUNTY[3] = 1200
set RANDOMDAMAGE[4] = 22
set RANDOMHEALTH[4] = 300
set RANDOMARMOR[4] = 2.
set RANDOMMOVESPEED[4] = 115.
set RANDOMATTACKINTERVAL[4] = 1.700
set RANDOMLEVEL[4] = 2
set RANDOMBOUNTY[4] = 110
set COMMANDERRANDOMDAMAGE[4] = 100
set COMMANDERRANDOMHEALTH[4] = 750
set COMMANDERRANDOMARMOR[4] = 3.
set COMMANDERRANDOMMOVESPEED[4] = 115.
set COMMANDERRANDOMATTACKINTERVAL[4] = 2.700
set COMMANDERRANDOMLEVEL[4] = 12
set COMMANDERRANDOMBOUNTY[4] = 4040
set RANDOMDAMAGE[5] = 44
set RANDOMHEALTH[5] = 420
set RANDOMARMOR[5] = 2.
set RANDOMMOVESPEED[5] = 120.
set RANDOMATTACKINTERVAL[5] = 1.600
set RANDOMLEVEL[5] = 3
set RANDOMBOUNTY[5] = 140
set COMMANDERRANDOMDAMAGE[5] = 200
set COMMANDERRANDOMHEALTH[5] = 1200
set COMMANDERRANDOMARMOR[5] = 3.
set COMMANDERRANDOMMOVESPEED[5] = 120.
set COMMANDERRANDOMATTACKINTERVAL[5] = 4.650
set COMMANDERRANDOMLEVEL[5] = 12
set COMMANDERRANDOMBOUNTY[5] = 2800
set RANDOMDAMAGE[6] = 49
set RANDOMHEALTH[6] = 900
set RANDOMARMOR[6] = 3.
set RANDOMMOVESPEED[6] = 125.
set RANDOMATTACKINTERVAL[6] = 0.900
set RANDOMLEVEL[6] = 3
set RANDOMBOUNTY[6] = 200
set COMMANDERRANDOMDAMAGE[6] = 118
set COMMANDERRANDOMHEALTH[6] = 1300
set COMMANDERRANDOMARMOR[6] = 5.
set COMMANDERRANDOMMOVESPEED[6] = 125.
set COMMANDERRANDOMATTACKINTERVAL[6] = 1.200
set COMMANDERRANDOMLEVEL[6] = 12
set COMMANDERRANDOMBOUNTY[6] = 4000
set RANDOMDAMAGE[7] = 54
set RANDOMHEALTH[7] = 1500
set RANDOMARMOR[7] = 8.
set RANDOMMOVESPEED[7] = 180.
set RANDOMATTACKINTERVAL[7] = 0.800
set RANDOMLEVEL[7] = 5
set RANDOMBOUNTY[7] = 230
set COMMANDERRANDOMDAMAGE[7] = 99
set COMMANDERRANDOMHEALTH[7] = 3000
set COMMANDERRANDOMARMOR[7] = 3.
set COMMANDERRANDOMMOVESPEED[7] = 180.
set COMMANDERRANDOMATTACKINTERVAL[7] = 0.800
set COMMANDERRANDOMLEVEL[7] = 18
set COMMANDERRANDOMBOUNTY[7] = 1200
set RANDOMDAMAGE[8] = 34
set RANDOMHEALTH[8] = 1100
set RANDOMARMOR[8] = 10.
set RANDOMMOVESPEED[8] = 180.
set RANDOMATTACKINTERVAL[8] = 0.900
set RANDOMLEVEL[8] = 4
set RANDOMBOUNTY[8] = 260
set COMMANDERRANDOMDAMAGE[8] = 400
set COMMANDERRANDOMHEALTH[8] = 8000
set COMMANDERRANDOMARMOR[8] = 8.
set COMMANDERRANDOMMOVESPEED[8] = 185.
set COMMANDERRANDOMATTACKINTERVAL[8] = 4.
set COMMANDERRANDOMLEVEL[8] = 16
set COMMANDERRANDOMBOUNTY[8] = 5200
set RANDOMDAMAGE[9] = 124
set RANDOMHEALTH[9] = 1500
set RANDOMARMOR[9] = 10.
set RANDOMMOVESPEED[9] = 145.
set RANDOMATTACKINTERVAL[9] = 1.700
set RANDOMLEVEL[9] = 5
set RANDOMBOUNTY[9] = 340
set COMMANDERRANDOMDAMAGE[9] = 199
set COMMANDERRANDOMHEALTH[9] = 3500
set COMMANDERRANDOMARMOR[9] = 20.
set COMMANDERRANDOMMOVESPEED[9] = 145.
set COMMANDERRANDOMATTACKINTERVAL[9] = 1.700
set COMMANDERRANDOMLEVEL[9] = 20
set COMMANDERRANDOMBOUNTY[9] = 5800
set RANDOMDAMAGE[10] = 149
set RANDOMHEALTH[10] = 4800
set RANDOMARMOR[10] = 10.
set RANDOMMOVESPEED[10] = 150.
set RANDOMATTACKINTERVAL[10] = 1.300
set RANDOMLEVEL[10] = 5
set RANDOMBOUNTY[10] = 300
set COMMANDERRANDOMDAMAGE[10] = 219
set COMMANDERRANDOMHEALTH[10] = 4800
set COMMANDERRANDOMARMOR[10] = 8.
set COMMANDERRANDOMMOVESPEED[10] = 155.
set COMMANDERRANDOMATTACKINTERVAL[10] = 1.700
set COMMANDERRANDOMLEVEL[10] = 20
set COMMANDERRANDOMBOUNTY[10] = 6400
set RANDOMDAMAGE[11] = 174
set RANDOMHEALTH[11] = 3000
set RANDOMARMOR[11] = 10.
set RANDOMMOVESPEED[11] = 155.
set RANDOMATTACKINTERVAL[11] = 1.200
set RANDOMLEVEL[11] = 6
set RANDOMBOUNTY[11] = 200
set COMMANDERRANDOMDAMAGE[11] = 289
set COMMANDERRANDOMHEALTH[11] = 7000
set COMMANDERRANDOMARMOR[11] = 9.
set COMMANDERRANDOMMOVESPEED[11] = 155.
set COMMANDERRANDOMATTACKINTERVAL[11] = 1.700
set COMMANDERRANDOMLEVEL[11] = 24
set COMMANDERRANDOMBOUNTY[11] = 7200
set RANDOMDAMAGE[12] = 199
set RANDOMHEALTH[12] = 2400
set RANDOMARMOR[12] = 30.
set RANDOMMOVESPEED[12] = 190.
set RANDOMATTACKINTERVAL[12] = 0.750
set RANDOMLEVEL[12] = 6
set RANDOMBOUNTY[12] = 450
set COMMANDERRANDOMDAMAGE[12] = 349
set COMMANDERRANDOMHEALTH[12] = 6825
set COMMANDERRANDOMARMOR[12] = 40.
set COMMANDERRANDOMMOVESPEED[12] = 190.
set COMMANDERRANDOMATTACKINTERVAL[12] = 1.250
set COMMANDERRANDOMLEVEL[12] = 24
set COMMANDERRANDOMBOUNTY[12] = 8000
set RANDOMDAMAGE[13] = 252
set RANDOMHEALTH[13] = 2800
set RANDOMARMOR[13] = 7.
set RANDOMMOVESPEED[13] = 165.
set RANDOMATTACKINTERVAL[13] = 1.200
set RANDOMLEVEL[13] = 7
set RANDOMBOUNTY[13] = 500
set COMMANDERRANDOMDAMAGE[13] = 1199
set COMMANDERRANDOMHEALTH[13] = 13700
set COMMANDERRANDOMARMOR[13] = 11.
set COMMANDERRANDOMMOVESPEED[13] = 165.
set COMMANDERRANDOMATTACKINTERVAL[13] = 0.750
set COMMANDERRANDOMLEVEL[13] = 28
set COMMANDERRANDOMBOUNTY[13] = 9000
set RANDOMDAMAGE[14] = 349
set RANDOMHEALTH[14] = 10000
set RANDOMARMOR[14] = 10.
set RANDOMMOVESPEED[14] = 170.
set RANDOMATTACKINTERVAL[14] = 0.400
set RANDOMLEVEL[14] = 7
set RANDOMBOUNTY[14] = 560
set COMMANDERRANDOMDAMAGE[14] = 403
set COMMANDERRANDOMHEALTH[14] = 15000
set COMMANDERRANDOMARMOR[14] = 20.
set COMMANDERRANDOMMOVESPEED[14] = 170.
set COMMANDERRANDOMATTACKINTERVAL[14] = 0.800
set COMMANDERRANDOMLEVEL[14] = 28
set COMMANDERRANDOMBOUNTY[14] = 10000
set RANDOMDAMAGE[15] = 319
set RANDOMHEALTH[15] = 6700
set RANDOMARMOR[15] = 8.
set RANDOMMOVESPEED[15] = 200.
set RANDOMATTACKINTERVAL[15] = 1.500
set RANDOMLEVEL[15] = 8
set RANDOMBOUNTY[15] = 640
set COMMANDERRANDOMDAMAGE[15] = 499
set COMMANDERRANDOMHEALTH[15] = 24750
set COMMANDERRANDOMARMOR[15] = 12.
set COMMANDERRANDOMMOVESPEED[15] = 200.
set COMMANDERRANDOMATTACKINTERVAL[15] = 0.500
set COMMANDERRANDOMLEVEL[15] = 32
set COMMANDERRANDOMBOUNTY[15] = 11000
set RANDOMDAMAGE[16] = 699
set RANDOMHEALTH[16] = 6000
set RANDOMARMOR[16] = 15.
set RANDOMMOVESPEED[16] = 180.
set RANDOMATTACKINTERVAL[16] = 1.400
set RANDOMLEVEL[16] = 8
set RANDOMBOUNTY[16] = 720
set COMMANDERRANDOMDAMAGE[16] = 999
set COMMANDERRANDOMHEALTH[16] = 25000
set COMMANDERRANDOMARMOR[16] = 20.
set COMMANDERRANDOMMOVESPEED[16] = 180.
set COMMANDERRANDOMATTACKINTERVAL[16] = 1.100
set COMMANDERRANDOMLEVEL[16] = 32
set COMMANDERRANDOMBOUNTY[16] = 12000
set RANDOMDAMAGE[17] = 399
set RANDOMHEALTH[17] = 13000
set RANDOMARMOR[17] = 30.
set RANDOMMOVESPEED[17] = 185.
set RANDOMATTACKINTERVAL[17] = 0.700
set RANDOMLEVEL[17] = 9
set RANDOMBOUNTY[17] = 800
set COMMANDERRANDOMDAMAGE[17] = 699
set COMMANDERRANDOMHEALTH[17] = 14350
set COMMANDERRANDOMARMOR[17] = 14.
set COMMANDERRANDOMMOVESPEED[17] = 185.
set COMMANDERRANDOMATTACKINTERVAL[17] = 0.700
set COMMANDERRANDOMLEVEL[17] = 36
set COMMANDERRANDOMBOUNTY[17] = 13000
set RANDOMDAMAGE[18] = 699
set RANDOMHEALTH[18] = 4750
set RANDOMARMOR[18] = 9.
set RANDOMMOVESPEED[18] = 190.
set RANDOMATTACKINTERVAL[18] = 2.300
set RANDOMLEVEL[18] = 9
set RANDOMBOUNTY[18] = 900
set COMMANDERRANDOMDAMAGE[18] = 749
set COMMANDERRANDOMHEALTH[18] = 30000
set COMMANDERRANDOMARMOR[18] = 10.
set COMMANDERRANDOMMOVESPEED[18] = 190.
set COMMANDERRANDOMATTACKINTERVAL[18] = 2.300
set COMMANDERRANDOMLEVEL[18] = 45
set COMMANDERRANDOMBOUNTY[8] = 7000
set RANDOMDAMAGE[19] = 699
set RANDOMHEALTH[19] = 12500
set RANDOMARMOR[19] = 25.
set RANDOMMOVESPEED[19] = 195.
set RANDOMATTACKINTERVAL[19] = 1.600
set RANDOMLEVEL[19] = 10
set RANDOMBOUNTY[19] = 1000
set COMMANDERRANDOMDAMAGE[19] = 749
set COMMANDERRANDOMHEALTH[19] = 55000
set COMMANDERRANDOMARMOR[19] = 15.
set COMMANDERRANDOMMOVESPEED[19] = 195.
set COMMANDERRANDOMATTACKINTERVAL[19] = 1.600
set COMMANDERRANDOMLEVEL[19] = 40
set COMMANDERRANDOMBOUNTY[19] = 15000
set RANDOMDAMAGE[20] = 799
set RANDOMHEALTH[20] = 21000
set RANDOMARMOR[20] = 20.
set RANDOMMOVESPEED[20] = 200.
set RANDOMATTACKINTERVAL[20] = 6.250
set RANDOMLEVEL[20] = 10
set RANDOMBOUNTY[20] = 1160
set COMMANDERRANDOMDAMAGE[20] = 849
set COMMANDERRANDOMHEALTH[20] = 100000
set COMMANDERRANDOMARMOR[20] = 15.
set COMMANDERRANDOMMOVESPEED[20] = 200.
set COMMANDERRANDOMATTACKINTERVAL[20] = 6.250
set COMMANDERRANDOMLEVEL[20] = 40
set COMMANDERRANDOMBOUNTY[20] = 10000
set RANDOMDAMAGE[21] = 599
set RANDOMHEALTH[21] = 35000
set RANDOMARMOR[21] = 11.
set RANDOMMOVESPEED[21] = 205.
set RANDOMATTACKINTERVAL[21] = 0.900
set RANDOMLEVEL[21] = 11
set RANDOMBOUNTY[21] = 1340
set COMMANDERRANDOMDAMAGE[21] = 899
set COMMANDERRANDOMHEALTH[21] = 180000
set COMMANDERRANDOMARMOR[21] = 27.
set COMMANDERRANDOMMOVESPEED[21] = 205.
set COMMANDERRANDOMATTACKINTERVAL[21] = 0.900
set COMMANDERRANDOMLEVEL[21] = 44
set COMMANDERRANDOMBOUNTY[21] = 17000
set RANDOMDAMAGE[22] = 499
set RANDOMHEALTH[22] = 96000
set RANDOMARMOR[22] = 24.
set RANDOMMOVESPEED[22] = 270.
set RANDOMATTACKINTERVAL[22] = 0.800
set RANDOMLEVEL[22] = 11
set RANDOMBOUNTY[22] = 1440
set COMMANDERRANDOMDAMAGE[22] = 999
set COMMANDERRANDOMHEALTH[22] = 240000
set COMMANDERRANDOMARMOR[22] = 18.
set COMMANDERRANDOMMOVESPEED[22] = 270.
set COMMANDERRANDOMATTACKINTERVAL[22] = 0.600
set COMMANDERRANDOMLEVEL[22] = 44
set COMMANDERRANDOMBOUNTY[22] = 18000
set RANDOMDAMAGE[23] = 1999
set RANDOMHEALTH[23] = 64000
set RANDOMARMOR[23] = 30.
set RANDOMMOVESPEED[23] = 215.
set RANDOMATTACKINTERVAL[23] = 3.000
set RANDOMLEVEL[23] = 12
set RANDOMBOUNTY[23] = 1760
set COMMANDERRANDOMDAMAGE[23] = 2499
set COMMANDERRANDOMHEALTH[23] = 184000
set COMMANDERRANDOMARMOR[23] = 30.
set COMMANDERRANDOMMOVESPEED[23] = 215.
set COMMANDERRANDOMATTACKINTERVAL[23] = 1.000
set COMMANDERRANDOMLEVEL[23] = 48
set COMMANDERRANDOMBOUNTY[23] = 19000
set RANDOMDAMAGE[24] = 1399
set RANDOMHEALTH[24] = 74000
set RANDOMARMOR[24] = 30.
set RANDOMMOVESPEED[24] = 220.
set RANDOMATTACKINTERVAL[24] = 0.650
set RANDOMLEVEL[24] = 12
set RANDOMBOUNTY[24] = 2000
set COMMANDERRANDOMDAMAGE[24] = 1699
set COMMANDERRANDOMHEALTH[24] = 150000
set COMMANDERRANDOMARMOR[24] = 21.
set COMMANDERRANDOMMOVESPEED[24] = 220.
set COMMANDERRANDOMATTACKINTERVAL[24] = 1.100
set COMMANDERRANDOMLEVEL[24] = 49
set COMMANDERRANDOMBOUNTY[24] = 20000
set RANDOMDAMAGE[25] = 1499
set RANDOMHEALTH[25] = 100000
set RANDOMARMOR[25] = 40.
set RANDOMMOVESPEED[25] = 225.
set RANDOMATTACKINTERVAL[25] = 1.500
set RANDOMLEVEL[25] = 13
set RANDOMBOUNTY[25] = 2240
set COMMANDERRANDOMDAMAGE[25] = 4099
set COMMANDERRANDOMHEALTH[25] = 150000
set COMMANDERRANDOMARMOR[25] = 50.
set COMMANDERRANDOMMOVESPEED[25] = 225.
set COMMANDERRANDOMATTACKINTERVAL[25] = 2.000
set COMMANDERRANDOMLEVEL[25] = 52
set COMMANDERRANDOMBOUNTY[25] = 21000
set RANDOMDAMAGE[26] = 1499
set RANDOMHEALTH[26] = 150000
set RANDOMARMOR[26] = 23.
set RANDOMMOVESPEED[26] = 230.
set RANDOMATTACKINTERVAL[26] = 1.000
set RANDOMLEVEL[26] = 13
set RANDOMBOUNTY[26] = 2600
set COMMANDERRANDOMDAMAGE[26] = 2499
set COMMANDERRANDOMHEALTH[26] = 300000
set COMMANDERRANDOMARMOR[26] = 40.
set COMMANDERRANDOMMOVESPEED[26] = 230.
set COMMANDERRANDOMATTACKINTERVAL[26] = 0.700
set COMMANDERRANDOMLEVEL[26] = 52
set COMMANDERRANDOMBOUNTY[26] = 22000
set RANDOMDAMAGE[27] = 1999
set RANDOMHEALTH[27] = 140000
set RANDOMARMOR[27] = 60.
set RANDOMMOVESPEED[27] = 235.
set RANDOMATTACKINTERVAL[27] = 0.600
set RANDOMLEVEL[27] = 14
set RANDOMBOUNTY[27] = 3000
set COMMANDERRANDOMDAMAGE[27] = 5999
set COMMANDERRANDOMHEALTH[27] = 270000
set COMMANDERRANDOMARMOR[27] = 50.
set COMMANDERRANDOMMOVESPEED[27] = 235.
set COMMANDERRANDOMATTACKINTERVAL[27] = 0.800
set COMMANDERRANDOMLEVEL[27] = 56
set COMMANDERRANDOMBOUNTY[27] = 24000
set RANDOMDAMAGE[28] = 1499
set RANDOMHEALTH[28] = 290000
set RANDOMARMOR[28] = 80.
set RANDOMMOVESPEED[28] = 240.
set RANDOMATTACKINTERVAL[28] = 1.300
set RANDOMLEVEL[28] = 14
set RANDOMBOUNTY[28] = 3600
set COMMANDERRANDOMDAMAGE[28] = 3699
set COMMANDERRANDOMHEALTH[28] = 640000
set COMMANDERRANDOMARMOR[28] = 100.
set COMMANDERRANDOMMOVESPEED[28] = 240.
set COMMANDERRANDOMATTACKINTERVAL[28] = 1.300
set COMMANDERRANDOMLEVEL[28] = 56
set COMMANDERRANDOMBOUNTY[28] = 26000
set RANDOMDAMAGE[29] = 1399
set RANDOMHEALTH[29] = 350000
set RANDOMARMOR[29] = 45.
set RANDOMMOVESPEED[29] = 245.
set RANDOMATTACKINTERVAL[29] = 0.400
set RANDOMLEVEL[29] = 15
set RANDOMBOUNTY[29] = 4300
set COMMANDERRANDOMDAMAGE[29] = 2999
set COMMANDERRANDOMHEALTH[29] = 1000000
set COMMANDERRANDOMARMOR[29] = 60.
set COMMANDERRANDOMMOVESPEED[29] = 245.
set COMMANDERRANDOMATTACKINTERVAL[29] = 0.350
set COMMANDERRANDOMLEVEL[29] = 60
set COMMANDERRANDOMBOUNTY[29] = 30000
set RANDOMDAMAGE[30] = 2999
set RANDOMHEALTH[30] = 335000
set RANDOMARMOR[30] = 50.
set RANDOMMOVESPEED[30] = 250.
set RANDOMATTACKINTERVAL[30] = 0.900
set RANDOMLEVEL[30] = 15
set RANDOMBOUNTY[30] = 5100
set COMMANDERRANDOMDAMAGE[30] = 3332
set COMMANDERRANDOMHEALTH[30] = 865000
set COMMANDERRANDOMARMOR[30] = 70.
set COMMANDERRANDOMMOVESPEED[30] = 250.
set COMMANDERRANDOMATTACKINTERVAL[30] = 0.700
set COMMANDERRANDOMLEVEL[30] = 60
set COMMANDERRANDOMBOUNTY[30] = 36000
set RANDOMDAMAGE[31] = 5999
set RANDOMHEALTH[31] = 208888
set RANDOMARMOR[31] = 50.
set RANDOMMOVESPEED[31] = 255.
set RANDOMATTACKINTERVAL[31] = 5.000
set RANDOMLEVEL[31] = 16
set RANDOMBOUNTY[31] = 5800
set COMMANDERRANDOMDAMAGE[31] = 2999
set COMMANDERRANDOMHEALTH[31] = 888888
set COMMANDERRANDOMARMOR[31] = 70.
set COMMANDERRANDOMMOVESPEED[31] = 255.
set COMMANDERRANDOMATTACKINTERVAL[31] = 1.1
set COMMANDERRANDOMLEVEL[31] = 64
set COMMANDERRANDOMBOUNTY[31] = 42000
set RANDOMDAMAGE[32] = 12499
set RANDOMHEALTH[32] = 240000
set RANDOMARMOR[32] = 55.
set RANDOMMOVESPEED[32] = 260.
set RANDOMATTACKINTERVAL[32] = 4.300
set RANDOMLEVEL[32] = 16
set RANDOMBOUNTY[32] = 6600
set COMMANDERRANDOMDAMAGE[32] = 3999
set COMMANDERRANDOMHEALTH[32] = 800000
set COMMANDERRANDOMARMOR[32] = 75.
set COMMANDERRANDOMMOVESPEED[32] = 260.
set COMMANDERRANDOMATTACKINTERVAL[32] = 1.2
set COMMANDERRANDOMLEVEL[32] = 64
set COMMANDERRANDOMBOUNTY[32] = 50000
set RANDOMDAMAGE[33] = 2499
set RANDOMHEALTH[33] = 480000
set RANDOMARMOR[33] = 55.
set RANDOMMOVESPEED[33] = 265.
set RANDOMATTACKINTERVAL[33] = 0.800
set RANDOMLEVEL[33] = 17
set RANDOMBOUNTY[33] = 7400
set COMMANDERRANDOMDAMAGE[33] = 3999
set COMMANDERRANDOMHEALTH[33] = 2000000
set COMMANDERRANDOMARMOR[33] = 75.
set COMMANDERRANDOMMOVESPEED[33] = 265.
set COMMANDERRANDOMATTACKINTERVAL[33] = 1.250
set COMMANDERRANDOMLEVEL[33] = 68
set COMMANDERRANDOMBOUNTY[33] = 58000
set RANDOMDAMAGE[34] = 5999
set RANDOMHEALTH[34] = 420000
set RANDOMARMOR[34] = 60.
set RANDOMMOVESPEED[34] = 270.
set RANDOMATTACKINTERVAL[34] = 0.500
set RANDOMLEVEL[34] = 17
set RANDOMBOUNTY[34] = 8200
set COMMANDERRANDOMDAMAGE[34] = 10999
set COMMANDERRANDOMHEALTH[34] = 950000
set COMMANDERRANDOMARMOR[34] = 80.
set COMMANDERRANDOMMOVESPEED[34] = 270.
set COMMANDERRANDOMATTACKINTERVAL[34] = 0.5
set COMMANDERRANDOMLEVEL[34] = 68
set COMMANDERRANDOMBOUNTY[34] = 66000
set RANDOMDAMAGE[35] = 999
set RANDOMHEALTH[35] = 1000000
set RANDOMARMOR[35] = 75.
set RANDOMMOVESPEED[35] = 275.
set RANDOMATTACKINTERVAL[35] = 0.600
set RANDOMLEVEL[35] = 18
set RANDOMBOUNTY[35] = 9600
set COMMANDERRANDOMDAMAGE[35] = 14999
set COMMANDERRANDOMHEALTH[35] = 2400000
set COMMANDERRANDOMARMOR[35] = 80.
set COMMANDERRANDOMMOVESPEED[35] = 275.
set COMMANDERRANDOMATTACKINTERVAL[35] = 0.600
set COMMANDERRANDOMLEVEL[35] = 72
set COMMANDERRANDOMBOUNTY[35] = 76000
set RANDOMDAMAGE[36] = 2499
set RANDOMHEALTH[36] = 600000
set RANDOMARMOR[36] = 444.
set RANDOMMOVESPEED[36] = 260.
set RANDOMATTACKINTERVAL[36] = 0.500
set RANDOMLEVEL[36] = 18
set RANDOMBOUNTY[36] = 10400
set COMMANDERRANDOMDAMAGE[36] = 6999
set COMMANDERRANDOMHEALTH[36] = 3000000
set COMMANDERRANDOMARMOR[36] = 244.
set COMMANDERRANDOMMOVESPEED[36] = 260.
set COMMANDERRANDOMATTACKINTERVAL[36] = 0.500
set COMMANDERRANDOMLEVEL[36] = 72
set COMMANDERRANDOMBOUNTY[36] = 86000
set RANDOMDAMAGE[37] = 4999
set RANDOMHEALTH[37] = 1100000
set RANDOMARMOR[37] = 60.
set RANDOMMOVESPEED[37] = 280.
set RANDOMATTACKINTERVAL[37] = 1.000
set RANDOMLEVEL[37] = 19
set RANDOMBOUNTY[37] = 13000
set COMMANDERRANDOMDAMAGE[37] = 9999
set COMMANDERRANDOMHEALTH[37] = 1492500
set COMMANDERRANDOMARMOR[37] = 80.
set COMMANDERRANDOMMOVESPEED[37] = 320.
set COMMANDERRANDOMATTACKINTERVAL[37] = 0.600
set COMMANDERRANDOMLEVEL[37] = 76
set COMMANDERRANDOMBOUNTY[37] = 100000
set RANDOMDAMAGE[38] = 3999
set RANDOMHEALTH[38] = 1350000
set RANDOMARMOR[38] = 75.
set RANDOMMOVESPEED[38] = 260.
set RANDOMATTACKINTERVAL[38] = 0.500
set RANDOMLEVEL[38] = 19
set RANDOMBOUNTY[38] = 14000
set COMMANDERRANDOMDAMAGE[38] = 5999
set COMMANDERRANDOMHEALTH[38] = 2775000
set COMMANDERRANDOMARMOR[38] = 83.
set COMMANDERRANDOMMOVESPEED[38] = 260.
set COMMANDERRANDOMATTACKINTERVAL[38] = 0.400
set COMMANDERRANDOMLEVEL[38] = 76
set COMMANDERRANDOMBOUNTY[38] = 120000
set RANDOMDAMAGE[39] = 9999
set RANDOMHEALTH[39] = 1100000
set RANDOMARMOR[39] = 75.
set RANDOMMOVESPEED[39] = 300.
set RANDOMATTACKINTERVAL[39] = 0.800
set RANDOMLEVEL[39] = 20
set RANDOMBOUNTY[39] = 18000
set COMMANDERRANDOMDAMAGE[39] = 16665
set COMMANDERRANDOMHEALTH[39] = 5399999
set COMMANDERRANDOMARMOR[39] = 125.
set COMMANDERRANDOMMOVESPEED[39] = 300.
set COMMANDERRANDOMATTACKINTERVAL[39] = 0.800
set COMMANDERRANDOMLEVEL[39] = 78
set COMMANDERRANDOMBOUNTY[39] = 140000
set RANDOMDAMAGE[40] = 149
set RANDOMHEALTH[40] = 3600
set RANDOMARMOR[40] = 10.
set RANDOMMOVESPEED[40] = 150.
set RANDOMATTACKINTERVAL[40] = 1.300
set RANDOMLEVEL[40] = 5
set RANDOMBOUNTY[40] = 300
set COMMANDERRANDOMDAMAGE[40] = 0
set COMMANDERRANDOMHEALTH[40] = 6000
set COMMANDERRANDOMARMOR[40] = 16.
set COMMANDERRANDOMMOVESPEED[40] = 200.
set COMMANDERRANDOMATTACKINTERVAL[40] = 1.700
set COMMANDERRANDOMLEVEL[40] = 20
set COMMANDERRANDOMBOUNTY[40] = 6400
//call BJDebugMsg("This totally worked")
endfunction
endscope
/**
* IsTerrainWalkable snippet for estimating the walkability status of a co-ordinate pair, credits
* to Anitarf and Vexorian.
*
* API:
* boolean IsTerrainWalkable(real x, real y) - returns the walkability of (x,y)
*/
library IsTerrainWalkable initializer init
globals
// this value is how far from a point the item may end up for the point to be considered pathable
private constant real MAX_RANGE=10.
// the following two variables are set to the position of the item after each pathing check
// that way, if a point isn't pathable, these will be the coordinates of the nearest point that is
public real X=0.
public real Y=0.
private rect r
private item check
private item array hidden
private integer hiddenMax=0
endglobals
private function init takes nothing returns nothing
set check=CreateItem('ciri',0.,0.)
call SetItemVisible(check,false)
set r=Rect(0.0,0.0,128.0,128.0)
endfunction
private function hideBothersomeItem takes nothing returns nothing
if IsItemVisible(GetEnumItem()) then
set hidden[hiddenMax]=GetEnumItem()
call SetItemVisible(hidden[hiddenMax],false)
set hiddenMax=hiddenMax+1
endif
endfunction
function IsTerrainWalkable takes real x, real y returns boolean
// first, hide any items in the area so they don't get in the way of our item
call MoveRectTo(r,x,y)
call EnumItemsInRect(r,null,function hideBothersomeItem)
// try to move the check item and get its coordinates
// this unhides the item...
call SetItemPosition(check,x,y)
set X=GetItemX(check)
set Y=GetItemY(check)
//...so we must hide it again
call SetItemVisible(check,false)
// before returning, unhide any items that got hidden at the start
loop
exitwhen hiddenMax==0
set hiddenMax=hiddenMax-1
call SetItemVisible(hidden[hiddenMax],true)
endloop
// return pathability status
return (x-X)*(x-X)+(y-Y)*(y-Y)<MAX_RANGE*MAX_RANGE
endfunction
endlibrary
library NewBonus
/* ----------------------- NewBonus v2.2 by Chopinski ----------------------- */
//! novjass
Since ObjectMerger is broken and we still have no means to edit
bonus values (green values) i decided to create a light weight
Bonus library that works in the same way that the original Bonus Mod
by Earth Fury did. NewBonus requires patch 1.30+.
Credits to Earth Fury for the original Bonus idea
How to Import?
Importing bonus mod is really simple. Just copy the 9 abilities with the
prefix "NewBonus" from the Object Editor into your map and match their new raw
code to the bonus types in the global block below. Then create a trigger called
NewBonus, convert it to custom text and paste this code there. You done!
API:
function GetUnitBonus takes unit u, integer bonus_type returns real
-> Returns the specified bonus amount for the unit
-> Example: set amount = GetUnitBonus(GetTriggerUnit(), BONUS_AGILITY)
function SetUnitBonus takes unit u, integer bonus_type, real amount returns real
-> Set the specified bonus type to amount for the unit
-> Example: call SetUnitBonus(GetTriggerUnit(), BONUS_DAMAGE, 100)
function RemoveUnitBonus takes unit u, integer bonus_type returns nothing
-> Removes the Specified bonus type from unit
-> Example: call RemoveUnitBonus(GetTriggerUnit(), BONUS_AGILITY)
function AddUnitBonus takes unit u, integer bonus_type, real amount returns real
-> Add the specified amount for the specified bonus tyte for unit
-> Example: call AddUnitBonus(GetTriggerUnit(), BONUS_DAMAGE, 100)
//! endnovjass
/* ----------------------------------- END ---------------------------------- */
/* -------------------------------------------------------------------------- */
/* Configuration */
/* -------------------------------------------------------------------------- */
globals
//The bonus types
constant integer BONUS_DAMAGE = 1
constant integer BONUS_ARMOR = 2
constant integer BONUS_AGILITY = 3
constant integer BONUS_STRENGTH = 4
constant integer BONUS_INTELLIGENCE = 5
constant integer BONUS_HEALTH = 6
constant integer BONUS_MANA = 7
constant integer BONUS_MOVEMENT_SPEED = 8
constant integer BONUS_SIGHT_RANGE = 9
constant integer BONUS_HEALTH_REGEN = 10
constant integer BONUS_MANA_REGEN = 11
constant integer BONUS_ATTACK_SPEED = 12
constant integer BONUS_MAGIC_RESISTANCE = 13
constant integer BONUS_EVASION_CHANCE = 14
constant integer BONUS_CRITICAL_CHANCE = 15
constant integer BONUS_CRITICAL_DAMAGE = 16
constant integer BONUS_LIFE_STEAL = 17
//The abilities codes for each bonus
//When pasting the abilities over to your map
//their raw code should match the bonus here
private constant integer DAMAGE_ABILITY = 'Z001'
private constant integer ARMOR_ABILITY = 'Z002'
private constant integer STATS_ABILITY = 'Z003'
private constant integer HEALTH_ABILITY = 'Z004'
private constant integer MANA_ABILITY = 'Z005'
private constant integer HEALTHREGEN_ABILITY = 'Z006'
private constant integer MANAREGEN_ABILITY = 'Z007'
private constant integer ATTACKSPEED_ABILITY = 'Z008'
private constant integer MOVEMENTSPEED_ABILITY = 'Z009'
private constant integer SIGHT_RANGE_ABILITY = 'Z00A'
private constant integer MAGIC_RESISTANCE_ABILITY = 'Z00B'
private constant integer CRITICAL_STRIKE_ABILITY = 'Z00C'
private constant integer EVASION_ABILITY = 'Z00D'
private constant integer LIFE_STEAL_ABILITY = 'Z00E'
//The abilities fields that are modified. For the sake of readability
private constant abilityintegerlevelfield DAMAGE_FIELD = ABILITY_ILF_ATTACK_BONUS
private constant abilityintegerlevelfield ARMOR_FIELD = ABILITY_ILF_DEFENSE_BONUS_IDEF
private constant abilityintegerlevelfield AGILITY_FIELD = ABILITY_ILF_AGILITY_BONUS
private constant abilityintegerlevelfield STRENGTH_FIELD = ABILITY_ILF_STRENGTH_BONUS_ISTR
private constant abilityintegerlevelfield INTELLIGENCE_FIELD = ABILITY_ILF_INTELLIGENCE_BONUS
private constant abilityintegerlevelfield HEALTH_FIELD = ABILITY_ILF_MAX_LIFE_GAINED
private constant abilityintegerlevelfield MANA_FIELD = ABILITY_ILF_MAX_MANA_GAINED
private constant abilityintegerlevelfield MOVEMENTSPEED_FIELD = ABILITY_ILF_MOVEMENT_SPEED_BONUS
private constant abilityintegerlevelfield SIGHT_RANGE_FIELD = ABILITY_ILF_SIGHT_RANGE_BONUS
private constant abilityreallevelfield HEALTHREGEN_FIELD = ABILITY_RLF_AMOUNT_OF_HIT_POINTS_REGENERATED
private constant abilityreallevelfield MANAREGEN_FIELD = ABILITY_RLF_AMOUNT_REGENERATED
private constant abilityreallevelfield ATTACKSPEED_FIELD = ABILITY_RLF_ATTACK_SPEED_INCREASE_ISX1
private constant abilityreallevelfield MAGIC_RESISTANCE_FIELD = ABILITY_RLF_DAMAGE_REDUCTION_ISR2
private constant abilityreallevelfield CRITICAL_CHANCE_FIELD = ABILITY_RLF_CHANCE_TO_CRITICAL_STRIKE
private constant abilityreallevelfield CRITICAL_DAMAGE_FIELD = ABILITY_RLF_DAMAGE_MULTIPLIER_OCR2
private constant abilityreallevelfield EVASION_FIELD = ABILITY_RLF_CHANCE_TO_EVADE_EEV1
private constant abilityreallevelfield LIFE_STEAL_FIELD = ABILITY_RLF_LIFE_STOLEN_PER_ATTACK
endglobals
/* -------------------------------------------------------------------------- */
/* System */
/* -------------------------------------------------------------------------- */
struct NewBonus
static method SetUnitAbilityBonusI takes unit u, integer abilCode, abilityintegerlevelfield field, integer amount returns integer
if GetUnitAbilityLevel(u, abilCode) == 0 then
call UnitAddAbility(u, abilCode)
call UnitMakeAbilityPermanent(u, true, abilCode)
endif
if BlzSetAbilityIntegerLevelField(BlzGetUnitAbility(u, abilCode), field, 0, amount) then
call IncUnitAbilityLevel(u, abilCode)
call DecUnitAbilityLevel(u, abilCode)
endif
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, abilCode), field, 0)
endmethod
static method SetUnitAbilityBonusR takes unit u, integer abilCode, abilityreallevelfield field, real amount returns real
if GetUnitAbilityLevel(u, abilCode) == 0 then
call UnitAddAbility(u, abilCode)
call UnitMakeAbilityPermanent(u, true, abilCode)
endif
if BlzSetAbilityRealLevelField(BlzGetUnitAbility(u, abilCode), field, 0, amount) then
call IncUnitAbilityLevel(u, abilCode)
call DecUnitAbilityLevel(u, abilCode)
endif
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, abilCode), field, 0)
endmethod
static method Get takes unit u, integer bonus_type returns integer
if bonus_type == BONUS_DAMAGE then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, DAMAGE_ABILITY), DAMAGE_FIELD, 0)
elseif bonus_type == BONUS_ARMOR then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, ARMOR_ABILITY), ARMOR_FIELD, 0)
elseif bonus_type == BONUS_HEALTH then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, HEALTH_ABILITY), HEALTH_FIELD, 0)
elseif bonus_type == BONUS_MANA then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, MANA_ABILITY), MANA_FIELD, 0)
elseif bonus_type == BONUS_AGILITY then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, STATS_ABILITY), AGILITY_FIELD, 0)
elseif bonus_type == BONUS_STRENGTH then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, STATS_ABILITY), STRENGTH_FIELD, 0)
elseif bonus_type == BONUS_INTELLIGENCE then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, STATS_ABILITY), INTELLIGENCE_FIELD, 0)
elseif bonus_type == BONUS_MOVEMENT_SPEED then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, MOVEMENTSPEED_ABILITY), MOVEMENTSPEED_FIELD, 0)
elseif bonus_type == BONUS_SIGHT_RANGE then
return BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, SIGHT_RANGE_ABILITY), SIGHT_RANGE_FIELD, 0)
else
call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type")
endif
return -1
endmethod
static method Set takes unit u, integer bonus_type, integer amount returns integer
local real p
if bonus_type == BONUS_DAMAGE then
return SetUnitAbilityBonusI(u, DAMAGE_ABILITY, DAMAGE_FIELD, amount)
elseif bonus_type == BONUS_ARMOR then
return SetUnitAbilityBonusI(u, ARMOR_ABILITY, ARMOR_FIELD, amount)
elseif bonus_type == BONUS_HEALTH then
set p = GetUnitLifePercent(u)
call BlzSetUnitMaxHP(u, (BlzGetUnitMaxHP(u) + amount - Get(u, bonus_type)))
call SetUnitLifePercentBJ(u, p)
return SetUnitAbilityBonusI(u, HEALTH_ABILITY, HEALTH_FIELD, amount)
elseif bonus_type == BONUS_MANA then
set p = GetUnitManaPercent(u)
call BlzSetUnitMaxMana(u, (BlzGetUnitMaxMana(u) + amount - Get(u, bonus_type)))
call SetUnitManaPercentBJ(u, p)
return SetUnitAbilityBonusI(u, MANA_ABILITY, MANA_FIELD, amount)
elseif bonus_type == BONUS_AGILITY then
return SetUnitAbilityBonusI(u, STATS_ABILITY, AGILITY_FIELD, amount)
elseif bonus_type == BONUS_STRENGTH then
return SetUnitAbilityBonusI(u, STATS_ABILITY, STRENGTH_FIELD, amount)
elseif bonus_type == BONUS_INTELLIGENCE then
return SetUnitAbilityBonusI(u, STATS_ABILITY, INTELLIGENCE_FIELD, amount)
elseif bonus_type == BONUS_MOVEMENT_SPEED then
return SetUnitAbilityBonusI(u, MOVEMENTSPEED_ABILITY, MOVEMENTSPEED_FIELD, amount)
elseif bonus_type == BONUS_SIGHT_RANGE then
call BlzSetUnitRealField(u, UNIT_RF_SIGHT_RADIUS, (BlzGetUnitRealField(u, UNIT_RF_SIGHT_RADIUS) + amount - Get(u, bonus_type)))
return SetUnitAbilityBonusI(u, SIGHT_RANGE_ABILITY, SIGHT_RANGE_FIELD, amount)
else
call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type")
endif
return -1
endmethod
static method Add takes unit u, integer bonus_type, integer amount returns integer
local integer current_amount = Get(u, bonus_type)
if amount > 0 and current_amount > 2147483647 - amount then
set amount = 2147483647 - current_amount
elseif amount < 0 and current_amount < -2147483648 - amount then
set amount = -2147483648 - current_amount
endif
call Set(u, bonus_type, (current_amount + amount))
return amount
endmethod
static method GetR takes unit u, integer bonus_type returns real
if bonus_type == BONUS_HEALTH_REGEN then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, HEALTHREGEN_ABILITY), HEALTHREGEN_FIELD, 0)
elseif bonus_type == BONUS_MANA_REGEN then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, MANAREGEN_ABILITY), MANAREGEN_FIELD, 0)
elseif bonus_type == BONUS_ATTACK_SPEED then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, ATTACKSPEED_ABILITY), ATTACKSPEED_FIELD, 0)
elseif bonus_type == BONUS_MAGIC_RESISTANCE then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, MAGIC_RESISTANCE_ABILITY), MAGIC_RESISTANCE_FIELD, 0)
elseif bonus_type == BONUS_CRITICAL_CHANCE then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, CRITICAL_STRIKE_ABILITY), CRITICAL_CHANCE_FIELD, 0)
elseif bonus_type == BONUS_CRITICAL_DAMAGE then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, CRITICAL_STRIKE_ABILITY), CRITICAL_DAMAGE_FIELD, 0)
elseif bonus_type == BONUS_EVASION_CHANCE then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, EVASION_ABILITY), EVASION_FIELD, 0)
elseif bonus_type == BONUS_LIFE_STEAL then
return BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, LIFE_STEAL_ABILITY), LIFE_STEAL_FIELD, 0)
else
call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type")
endif
return -1.
endmethod
static method SetR takes unit u, integer bonus_type, real amount returns real
if bonus_type == BONUS_HEALTH_REGEN then
call SetUnitAbilityBonusR(u, HEALTHREGEN_ABILITY, HEALTHREGEN_FIELD, amount)
elseif bonus_type == BONUS_MANA_REGEN then
call SetUnitAbilityBonusR(u, MANAREGEN_ABILITY, MANAREGEN_FIELD, amount)
elseif bonus_type == BONUS_ATTACK_SPEED then
call SetUnitAbilityBonusR(u, ATTACKSPEED_ABILITY, ATTACKSPEED_FIELD, amount)
elseif bonus_type == BONUS_MAGIC_RESISTANCE then
call SetUnitAbilityBonusR(u, MAGIC_RESISTANCE_ABILITY, MAGIC_RESISTANCE_FIELD, amount)
elseif bonus_type == BONUS_CRITICAL_CHANCE then
call SetUnitAbilityBonusR(u, CRITICAL_STRIKE_ABILITY, CRITICAL_CHANCE_FIELD, amount)
elseif bonus_type == BONUS_CRITICAL_DAMAGE then
call SetUnitAbilityBonusR(u, CRITICAL_STRIKE_ABILITY, CRITICAL_DAMAGE_FIELD, amount)
elseif bonus_type == BONUS_EVASION_CHANCE then
call SetUnitAbilityBonusR(u, EVASION_ABILITY, EVASION_FIELD, amount)
elseif bonus_type == BONUS_LIFE_STEAL then
call SetUnitAbilityBonusR(u, LIFE_STEAL_ABILITY, LIFE_STEAL_FIELD, amount)
else
call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type")
endif
return amount
endmethod
static method AddR takes unit u, integer bonus_type, real amount returns real
if bonus_type >= BONUS_HEALTH_REGEN and bonus_type <= BONUS_LIFE_STEAL then
call SetR(u, bonus_type, GetR(u, bonus_type) + amount)
else
call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type")
endif
return amount
endmethod
endstruct
/* -------------------------------------------------------------------------- */
/* JASS API */
/* -------------------------------------------------------------------------- */
function GetUnitBonus takes unit u, integer bonus_type returns real
if bonus_type <= BONUS_SIGHT_RANGE then
return I2R(NewBonus.Get(u, bonus_type))
else
return NewBonus.GetR(u, bonus_type)
endif
endfunction
function SetUnitBonus takes unit u, integer bonus_type, real amount returns real
if bonus_type <= BONUS_SIGHT_RANGE then
return I2R(NewBonus.Set(u, bonus_type, R2I(amount)))
else
return NewBonus.SetR(u, bonus_type, amount)
endif
endfunction
function RemoveUnitBonus takes unit u, integer bonus_type returns nothing
if bonus_type <= BONUS_SIGHT_RANGE then
call NewBonus.Set(u, bonus_type, 0)
else
if bonus_type == BONUS_CRITICAL_DAMAGE then
call NewBonus.SetR(u, bonus_type, 1)
else
call NewBonus.SetR(u, bonus_type, 0)
endif
if bonus_type == BONUS_LIFE_STEAL then
call UnitRemoveAbility(u, LIFE_STEAL_ABILITY)
endif
endif
endfunction
function AddUnitBonus takes unit u, integer bonus_type, real amount returns real
if bonus_type <= BONUS_SIGHT_RANGE then
return I2R(NewBonus.Add(u, bonus_type, R2I(amount)))
else
return NewBonus.AddR(u, bonus_type, amount)
endif
endfunction
endlibrary
library NewBonusUtils requires NewBonus, RegisterPlayerUnitEvent
/* ----------------------- NewBonusUtils v2.2 by Chopinski ----------------------- */
//! novjass
Required Library: RegisterPlayerUnitEvent -> www.hiveworkshop.com/threads/snippet-registerplayerunitevent.203338/
API:
function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing
-> Add the specified amount for the specified bonus type for unit for a duration
-> Example: call AddUnitBonusTimed(GetTriggerUnit(), BONUS_ARMOR, 13, 10.5)
function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing
-> Links the bonus amount specified to a buff or ability. As long as the unit has the buff or
-> the ability represented by the parameter buffId the bonus is not removed.
-> Example: call LinkBonusToBuff(GetTriggerUnit(), BONUS_ARMOR, 10, 'B000')
function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing
-> Links the bonus amount specified to an item. As long as the unit has that item the bonus is not removed.
-> Note that it will work for items with the same id, because it takes as parameter the item object.
-> Example: call LinkBonusToItem(GetManipulatingUnit(), BONUS_ARMOR, 10, GetManipulatedItem())
function UnitCopyBonuses takes unit source, unit target returns nothing
-> Copy the source unit bonuses using the Add functionality to the target unit
-> Example: call UnitCopyBonuses(GetTriggerUnit(), GetSummonedUnit())
function UnitMirrorBonuses takes unit source, unit target returns nothing
-> Copy the source unit bonuses using the Set functionality to the target unit
-> Example: call UnitMirrorBonuses(GetTriggerUnit(), GetSummonedUnit())
//! endnovjass
/* ----------------------------------- END ---------------------------------- */
/* -------------------------------------------------------------------------- */
/* System */
/* -------------------------------------------------------------------------- */
private struct NewBonusUtils extends NewBonus
static timer timer = CreateTimer()
static integer key = -1
static thistype array array
static integer k = -1
static thistype array items
unit unit
item item
real ticks
integer type
integer buff
real amount
boolean link
method remove takes integer i, boolean isItem returns integer
call AddUnitBonus(unit, type, -amount)
if isItem then
set items[i] = items[k]
set k = k - 1
else
set array[i] = array[key]
set key = key - 1
if key == -1 then
call PauseTimer(timer)
endif
endif
set unit = null
set item = null
call deallocate()
return i - 1
endmethod
static method onDrop takes nothing returns nothing
local item itm = GetManipulatedItem()
local integer i = 0
local thistype this
loop
exitwhen i > k
set this = items[i]
if item == itm then
set i = remove(i, true)
endif
set i = i + 1
endloop
endmethod
static method onPeriod takes nothing returns nothing
local integer i = 0
local thistype this
loop
exitwhen i > key
set this = array[i]
if link then
set ticks = ticks - 1
if ticks <= 0 then
set i = remove(i, false)
endif
else
if GetUnitAbilityLevel(unit, buff) == 0 then
set i = remove(i, false)
endif
endif
set i = i + 1
endloop
endmethod
static method linkTimed takes unit u, integer bonus_type, real amount, real duration, boolean link returns nothing
local thistype this = thistype.allocate()
set this.unit = u
set this.type = bonus_type
set this.ticks = duration/0.03125000
set this.link = link
set this.amount = AddUnitBonus(u, bonus_type, amount)
set key = key + 1
set array[key] = this
if key == 0 then
call TimerStart(timer, 0.03125000, true, function thistype.onPeriod)
endif
endmethod
static method linkBuff takes unit u, integer bonus_type, real amount, integer buffId, boolean link returns nothing
local thistype this = thistype.allocate()
set this.unit = u
set this.type = bonus_type
set this.buff = buffId
set this.link = link
set this.amount = AddUnitBonus(u, bonus_type, amount)
set key = key + 1
set array[key] = this
if key == 0 then
call TimerStart(timer, 0.03125000, true, function thistype.onPeriod)
endif
endmethod
static method linkItem takes unit u, integer bonus_type, real amount, item i returns nothing
local thistype this = thistype.allocate()
set this.unit = u
set this.item = i
set this.type = bonus_type
set this.amount = AddUnitBonus(u, bonus_type, amount)
set k = k + 1
set items[k] = this
endmethod
static method copy takes unit source, unit target returns nothing
local integer i = 1
loop
exitwhen i > 17
if GetUnitBonus(source, i) != 0 then
call AddUnitBonus(target, i, GetUnitBonus(source, i))
endif
set i = i + 1
endloop
endmethod
static method mirror takes unit source, unit target returns nothing
local integer i = 1
loop
exitwhen i > 17
call SetUnitBonus(target, i, GetUnitBonus(source, i))
set i = i + 1
endloop
endmethod
static method onInit takes nothing returns nothing
call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_DROP_ITEM, function thistype.onDrop)
endmethod
endstruct
/* -------------------------------------------------------------------------- */
/* JASS API */
/* -------------------------------------------------------------------------- */
function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing
call NewBonusUtils.linkTimed(u, bonus_type, amount, duration, true)
endfunction
function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing
call NewBonusUtils.linkBuff(u, bonus_type, amount, buffId, false)
endfunction
function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing
call NewBonusUtils.linkItem(u, bonus_type, amount, i)
endfunction
function UnitCopyBonuses takes unit source, unit target returns nothing
call NewBonusUtils.copy(source, target)
endfunction
function UnitMirrorBonuses takes unit source, unit target returns nothing
call NewBonusUtils.mirror(source, target)
endfunction
endlibrary
library LineSegmentEnumeration /* v2.2a -- hiveworkshop.com/threads/line-segment-enumeration-v1-1.286552/
Information
¯¯¯¯¯¯¯¯¯¯¯
Allows to enumerate widgets inside a line segment with an offset.
So basicly it will result in a rect, but which is also allowed to be rotated.
Mechanics
¯¯¯¯¯¯¯¯¯
(Issue:)
The problem with normal jass rects is that they aren't defined by 4 points, but only by 4 values: x/y -min/max.
The result is that a jass rect is never rotated, so it's always paralel to the x/y axis.
But when we draw a line from point A to point B we might also create a non-axix-parelel rect, and then
we can't use the normal rect natives from jass anymore to find out if a point is inside the rect.
(Solution:)
To solve this problem the system does following:
jass rect: rectangular defined by 4 values (axis paralel)
custom rect: the real rectangular that is defined by user (not axis parelel)
1. Create a big jass rect that is big enough so we can ensure to enum all widgets that are potentialy inside our custom rect. (Enum_Group)
This Enum_Group will contain all wanted units, but may also contain not wanted units.
2. Construct the custom rect following a form with the same parameters as in this image, but in 2D:
https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Ellipsoide.svg/800px-Ellipsoide.svg.png
3. Loop through Enum_Group and define each widget's coordinates relative to the center of the custom rect as a 2D vector
4. Get the components of the widget's position vector on the local (rotated) x-y axis of the custom rect
5. Check if the projected lengths (absolute value of components) of the widget's position is less than <a> and <b> as described in the
image linked above.
*/
// --- API ---
//! novjass
struct LineSegment
static constant real MAX_UNIT_COLLISION
static method EnumUnitsEx takes group whichgroup, real ax, real ay, real bx, real by, real offset, boolean checkCollision returns nothing
static method EnumUnits takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
static method EnumDestructables takes real ax, real ay, real bx, real by, real offset returns nothing
// after enumerated destructables you have access to:
static integer DestructableCounter // starts with index "0"
static destructable array Destructable
static method EnumItems takes real ax, real ay, real bx, real by, real offset returns nothing
// after enumerated items you have access to:
static integer ItemCounter // starts with index "0"
static destructable array Item
//! endnovjass
// ==== End API ====
struct LineSegment extends array
public static constant real MAX_UNIT_COLLISION = 197.00
private static constant rect RECT = Rect(0, 0, 0, 0)
private static constant group GROUP = CreateGroup()
private static real ox
private static real oy
private static real dx
private static real dy
private static real da
private static real db
private static real ui
private static real uj
private static real wdx
private static real wdy
private static method PrepareRect takes real ax, real ay, real bx, real by, real offset, real offsetCollision returns nothing
local real maxX
local real maxY
local real minX
local real minY
// get center coordinates of rectangle
set ox = 0.5*(ax + bx)
set oy = 0.5*(ay + by)
// get rectangle major axis as vector
set dx = 0.5*(bx - ax)
set dy = 0.5*(by - ay)
// get half of rectangle length (da) and height (db)
set da = SquareRoot(dx*dx + dy*dy)
set db = offset
// get unit vector of the major axis
set ui = dx/da
set uj = dy/da
// Prepare the bounding Jass Rect
set offset = offset + offsetCollision
if ax > bx then
set maxX = ax + offset
set minX = bx - offset
else
set maxX = bx + offset
set minX = ax - offset
endif
if ay > by then
set maxY = ay + offset
set minY = by - offset
else
set maxY = by + offset
set minY = ay - offset
endif
call SetRect(RECT, minX, minY, maxX, maxY)
endmethod
private static method RotateWidgetCoordinates takes widget w returns nothing
// distance of widget from rectangle center in vector form
set wdx = GetWidgetX(w) - ox
set wdy = GetWidgetY(w) - oy
set dx = wdx*ui + wdy*uj // get the component of above vector in the rect's major axis
set dy = wdx*(-uj) + wdy*ui // get the component of above vector in the rect's transverse axis
endmethod
private static method IsWidgetInRect takes widget w returns boolean
call RotateWidgetCoordinates(w)
// Check if the components above are less than half the length and height of the rectangle
// (Square them to compare absolute values)
return dx*dx <= da*da and dy*dy <= db*db
endmethod
private static method IsUnitInRect takes unit u, boolean checkCollision returns boolean
if checkCollision then
call RotateWidgetCoordinates(u)
// Check if the perpendicular distances of the unit from both axes of the rect are less than
// da and db
return IsUnitInRangeXY(u, ox - dy*uj, oy + dy*ui, RAbsBJ(da)) /*
*/ and IsUnitInRangeXY(u, ox + dx*ui, oy + dx*uj, RAbsBJ(db))
endif
return IsWidgetInRect(u)
endmethod
public static method EnumUnitsEx takes group whichgroup, real ax, real ay, real bx, real by, real offset, boolean checkCollision returns nothing
local unit u
if checkCollision then
call PrepareRect(ax, ay, bx, by, offset, MAX_UNIT_COLLISION)
else
call PrepareRect(ax, ay, bx, by, offset, 0.00)
endif
call GroupEnumUnitsInRect(GROUP, RECT, null)
// enum through all tracked units, and check if it's inside bounds
call GroupClear(whichgroup)
loop
set u = FirstOfGroup(GROUP)
exitwhen u == null
if IsUnitInRect(u, checkCollision) then
call GroupAddUnit(whichgroup, u)
endif
call GroupRemoveUnit(GROUP, u)
endloop
endmethod
public static method EnumUnits takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
call EnumUnitsEx(whichgroup, ax, ay, bx, by, offset, false)
endmethod
//! textmacro LSE_WIDGET takes TYPE, NAME
public static integer $NAME$Counter = -1
public static $TYPE$ array $NAME$
private static method on$NAME$Filter takes nothing returns nothing
local $TYPE$ t = GetFilter$NAME$()
if IsWidgetInRect(t) then
set $NAME$Counter = $NAME$Counter + 1
set $NAME$[$NAME$Counter] = t
endif
set t = null
endmethod
public static method Enum$NAME$s takes real ax, real ay, real bx, real by, real offset returns nothing
call PrepareRect(ax, ay, bx, by, offset, 0.00)
set $NAME$Counter = -1
call Enum$NAME$sInRect(RECT, Filter(function thistype.on$NAME$Filter), null)
endmethod
//! endtextmacro
//! runtextmacro LSE_WIDGET("destructable", "Destructable")
//! runtextmacro LSE_WIDGET("item", "Item")
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ItemSet /* v2.5
*************************************************************************************
*
* ItemSet allows to create "item sets" as known from various other games.
* Bonuses are applied to an unit, depending on the number of equipped items
* of that item set.
*
* One item set can have as many bonuses as you want.
* Upper bound for bonus instancing is 8190.
*
* Available bonuses are:
* 1. Abilities
*
* Optional bonuses, if libraries exist:
* 2. ItemPower ( BPower ) for custom item affixes.
* 3a. BonusMod ( Earthfury ) for excellent bonus handling ( Life, Mana, Agility, ... ).
* 3b. Bonus ( Nestharus ) equals BonusMod in API and functionality. I recommend "BonusMod" over "Bonus".
*
*************************************************************************************
*
* */ uses /*
*
* */ optional Bonus /* https://github.com/nestharus/JASS/tree/master/jass/Systems/Bonus
* */ optional BonusMod /* http://www.wc3c.net/showthread.php?t=107940
* */ optional ItemPower /* http://www.hiveworkshop.com/forums/spells-569/itempower-v1-1-0-0-a-243917/
* */ optional ErrorMessage /* https://raw.githubusercontent.com/nestharus/JASS/master/jass/Systems/ErrorMessage/script.j
*
************************************************************************************
*
* 1. Import instruction
*  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
* Copy the ItemSet script into your map.
* Libraries listed as optional are not mandatory to have.
*  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
* 2. API
*  ̄ ̄ ̄ ̄ ̄ ̄
*
* readonly static constant integer COMPLETE = 0
* readonly static constant integer INCOMPLETE = 1
* function RegisterItemSetEvent takes integer whichEvent, code func returns nothing
* --> GetTriggerItemSet() returns the event ItemSet
* --> GetTriggerItemSetUnit() returns the event unit
* --> GetTriggerItemSetEventId() returns the event integer ( COMPLETE, INCOMPLETE )
*
*
* struct ItemSet extends array
*
* Creator:
* static method create takes string name, string model, string attachPointName returns thistype
* --> create a new ItemSet instance. Each item set has a name, an effect model and an attach point.
* - Can take null as effect model, if a specialeffect is not wanted.
*
* Adding items:
* method addItem takes integer itemId returns nothing
* --> Add an item to an ItemSet instance. One item id can only be linked to one ItemSet instance.
*
* Adding ItemSet Bonuses:
* method addAbility takes integer itemCount, integer abilityId returns nothing
* --> Adds an ability to the instace as ItemSet bonus.
* --> Arguments:
* - itemCount : How many items are required to apply the ability.
* - abilityId : Which ability
*
* Only available if library ItemPower exists:
*  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
* method addItemPower takes integer itemCount, integer power, real value returns nothing
* --> Adds an ItemPower to the instace as ItemSet bonus.
* --> Arguments:
* - itemCount: How many items are required to apply the ItemPower.
* - power : Which ItemPower
* - value : The amount added to that units ItemPower.
*
* Only available if library Bonus exists:
*  ̄ ̄ ̄ ̄ ̄
* method addBonus takes integer itemCount, integer bonus, integer value returns nothing
* --> Adds an Bonus to the instance as ItemSet bonus.
* --> Arguments:
* - itemCount: How many items are required to apply the Bonus.
* - bonus : Which Bonus
* - value : The amount added to that units Bonus.
*
* method addBuffIndicator takes integer itemCount, integer abilityId, integer buffId returns nothing
* --> Adds a buff placer to the instance.
* --> Arguments:
* - itemCount : How many items are required to apply the buff.
* - abilityId : Ability id of the buff placer.
* - buffId : Ability id of the buff.
*
* static method onItemUnequip takes unit whichUnit, integer itemId returns nothing
* static method onItemEquip takes unit whichUnit, integer itemId returns nothing
* --> Run these two using your inventory system.
* --> Can use the normal warcraft inventory aswell.
*
* static method operator [] takes integer itemId returns thistype
* --> Returns the corresponding ItemSet instance for an item id.
*
* readonly string name
* --> ItemSet name
*
* Unit Indexer implementation: ( Optional )
*
* static method onUnitDeindex takes unit whichUnit returns nothing
* --> Run this function on unit deindex event for best hashtable cleanup.
*
* 3. Configuration
*  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
*/
globals
/**
* Identifies the type of bonus added to the ItemSet instance.
*/
key ITEM_SET_BONUS_TYPE_ABILITY
key ITEM_SET_BONUS_TYPE_ITEM_POWER
key ITEM_SET_BONUS_TYPE_BONUS
/**
* Should completed ItemSets add a special effect to the unit?
*/
private constant boolean ADD_SPECIAL_EFFECT_TARGET = true
endglobals
//ItemSet code. Edit on your own risk.
private struct ItemSetBonus extends array
// ItemSetBonus instances are constant data, so there is no need for a recycler.
private static integer alloc = 0
integer requiredItems
integer bonus // bonus can be of type ability, ItemPower or Bonus.
integer bonusType
//static if LIBRARY_ItemPower then
real itemPowerAmount
//endif
//static if LIBRARY_Bonus then
integer bonusAmount
//endif
// ItemSets are constant. Contact me, if you want to design them dynamically.
static method create takes integer counter, integer bonusTypeId, integer bonusId, real itemPowerValue, integer bonusValue returns ItemSetBonus
local ItemSetBonus this = ItemSetBonus(ItemSetBonus.alloc + 1)
set ItemSetBonus.alloc = integer(this)
static if LIBRARY_ErrorMessage then
debug call ThrowError((this == 8191), "ItemSetBonus", "create", "thistype", 8191, "Overflow!")
else
debug if (this == 8191) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., 10000. ,SCOPE_PREFIX + "FATAL ERROR: Overflow! Stopping Thread!")
debug set this = 1/0
debug endif
endif
set requiredItems = counter
set bonus = bonusId
set bonusType = bonusTypeId
set itemPowerAmount = itemPowerValue
set bonusAmount = bonusValue
return this
endmethod
endstruct
struct ItemSet extends array
// Event id's.
readonly static constant integer COMPLETE = 0
readonly static constant integer INCOMPLETE = 1
// Event response variables.
// Wrapper functions are located below struct ItemSet.
readonly static unit triggerUnit = null
readonly static integer triggerEventId = -1
readonly static ItemSet triggerItemSet = 0
// Allocation:
private static integer alloc = 0
// Members:
readonly string name // Name of the ItemSet
private integer bonuses // Keep track of how many Bonuses an ItemSet has.
private integer maxItemCount // Keep track of how many items an ItemSet has.
private string sfx
private string point
private static hashtable hash = InitHashtable()
private static trigger incompleted = CreateTrigger()
private static trigger completed = CreateTrigger()
private static constant integer BUFF_BUFF_ID_OFFSET = 20000
private static constant integer BUFF_ABILITY_ID_OFFSET = 10000
static method registerEvent takes integer whichEvent, boolexpr expression returns nothing
if (whichEvent == ItemSet.COMPLETE) then
call TriggerAddCondition(ItemSet.completed, expression)
elseif (whichEvent == ItemSet.INCOMPLETE) then
call TriggerAddCondition(ItemSet.incompleted, expression)
debug else
debug call BJDebugMsg(SCOPE_PREFIX + "Error: Invalid ItemSet event index [" + I2S(whichEvent) + "]!")
endif
endmethod
static method operator [] takes integer itemId returns ItemSet
return ItemSet(LoadInteger(ItemSet.hash, 0, itemId))
endmethod
private method fire takes trigger whichTrigger, unit whichUnit, integer id returns nothing
local ItemSet prevItemSet = ItemSet.triggerItemSet
local unit prevUnit = ItemSet.triggerUnit
local integer prevEv = ItemSet.triggerEventId
set ItemSet.triggerItemSet = this
set ItemSet.triggerUnit = whichUnit
set ItemSet.triggerEventId = id
call TriggerEvaluate(whichTrigger)
set ItemSet.triggerItemSet = prevItemSet
set ItemSet.triggerUnit = prevUnit
set ItemSet.triggerEventId = prevEv
set prevUnit = null
endmethod
private method itemSetComplete takes unit whichUnit returns nothing
if (sfx != null) then
static if ADD_SPECIAL_EFFECT_TARGET then
call SaveEffectHandle(hash, GetHandleId(whichUnit), this, AddSpecialEffectTarget(sfx, whichUnit, point))
else
call DestroyEffect(AddSpecialEffectTarget(sfx, whichUnit, point))
endif
endif
call fire(ItemSet.completed, whichUnit, ItemSet.COMPLETE)
endmethod
private method itemSetIncomplete takes unit whichUnit returns nothing
static if ADD_SPECIAL_EFFECT_TARGET then
local integer id = GetHandleId(whichUnit)
if HaveSavedHandle(hash, id, this) then
call DestroyEffect(LoadEffectHandle(hash, id, this))
call RemoveSavedHandle(hash, id, this)
endif
endif
call fire(ItemSet.incompleted, whichUnit, ItemSet.INCOMPLETE)
endmethod
private method remove takes unit whichUnit, integer itemCounter returns nothing
local integer index = 0
local ItemSetBonus toRemove
local integer child
loop
exitwhen index == bonuses
set toRemove = ItemSetBonus(LoadInteger(hash, this, index))
if (toRemove.requiredItems == itemCounter) then
if (toRemove.bonusType == ITEM_SET_BONUS_TYPE_ABILITY) then
call UnitRemoveAbility(whichUnit, toRemove.bonus)
// Impossible to exclude via optional textmacro/module, ....
elseif (toRemove.bonusType == ITEM_SET_BONUS_TYPE_ITEM_POWER) then
static if LIBRARY_ItemPower then
call ItemPower_UnitManipulate(whichUnit, toRemove.bonus, -toRemove.itemPowerAmount)
endif
elseif (toRemove.bonusType == ITEM_SET_BONUS_TYPE_BONUS) then
static if LIBRARY_Bonus then
call AddUnitBonus(whichUnit, toRemove.bonus, -toRemove.bonusAmount)
elseif LIBRARY_BonusMod then
call AddUnitBonus(whichUnit, toRemove.bonus, -toRemove.bonusAmount)
endif
endif
endif
set index = index + 1
endloop
set child = itemCounter + BUFF_ABILITY_ID_OFFSET
if HaveSavedInteger(hash, this, child) then
call UnitRemoveAbility(whichUnit, LoadInteger(hash, this, child))
call UnitRemoveAbility(whichUnit, LoadInteger(hash, this, itemCounter + BUFF_BUFF_ID_OFFSET))
endif
set child = itemCounter + BUFF_ABILITY_ID_OFFSET - 1
if HaveSavedInteger(hash, this, child) then
call UnitAddAbility(whichUnit, LoadInteger(hash, this, child))
call UnitMakeAbilityPermanent(whichUnit, true, LoadInteger(hash, this, itemCounter + BUFF_ABILITY_ID_OFFSET - 1))
endif
if (itemCounter == maxItemCount) then
call itemSetIncomplete(whichUnit)
endif
endmethod
static method onItemUnequip takes unit whichUnit, integer itemId returns nothing
local integer id = GetHandleId(whichUnit)
local ItemSet this
static if LIBRARY_ErrorMessage then
debug call ThrowWarning((id == 0), "ItemSet", "onItemUnequip", "id", id, "Invalid Unit Handle (null)!")
endif
if (HaveSavedInteger(hash, 0, itemId)) and (id != 0) then
call SaveInteger(hash, id, itemId, LoadInteger(hash, id, itemId) - 1)
if (LoadInteger(hash, id, itemId) == 0) then
call RemoveSavedInteger(hash, id, itemId)
set this = LoadInteger(ItemSet.hash, 0, itemId)
call remove(whichUnit, LoadInteger(hash, id, this))
call SaveInteger(hash, id, this, LoadInteger(hash, id, this) - 1)
endif
endif
endmethod
private method add takes unit whichUnit, integer itemCounter returns nothing
local integer index = 0
local ItemSetBonus toAdd
local integer child
loop
// Loop through all ItemSetBonuses created for this ItemSet.
exitwhen index == bonuses
//Load the current Bonus.
set toAdd = ItemSetBonus(LoadInteger(hash, this, index))
//A Bonus is only applied if the numer of carried items equals its counter.
if (toAdd.requiredItems == itemCounter) then
if (toAdd.bonusType == ITEM_SET_BONUS_TYPE_ABILITY) then
call UnitAddAbility(whichUnit, toAdd.bonus)
call UnitMakeAbilityPermanent(whichUnit, true, toAdd.bonus)
elseif (toAdd.bonusType == ITEM_SET_BONUS_TYPE_ITEM_POWER) then
static if LIBRARY_ItemPower then
call ItemPower_UnitManipulate(whichUnit, toAdd.bonus, toAdd.itemPowerAmount)
endif
elseif (toAdd.bonusType == ITEM_SET_BONUS_TYPE_BONUS) then
static if LIBRARY_Bonus then
call AddUnitBonus(whichUnit, toAdd.bonus, toAdd.bonusAmount)
elseif LIBRARY_BonusMod then
call AddUnitBonus(whichUnit, toAdd.bonus, toAdd.bonusAmount)
endif
endif
endif
//Move on to the next loop index.
set index = index + 1
endloop
set child = itemCounter + BUFF_ABILITY_ID_OFFSET
if HaveSavedInteger(hash, this, child) then
call UnitAddAbility(whichUnit, LoadInteger(hash, this, child))
call UnitMakeAbilityPermanent(whichUnit, true, LoadInteger(hash, this, child))
endif
// Check if prev item amount holds a buff.
set child = itemCounter + BUFF_ABILITY_ID_OFFSET - 1
if HaveSavedInteger(hash, this, child) then
call UnitRemoveAbility(whichUnit, LoadInteger(hash, this, child))
call UnitRemoveAbility(whichUnit, LoadInteger(hash, this, itemCounter + BUFF_BUFF_ID_OFFSET - 1))
endif
//Check if the ItemSet is completed.
if (itemCounter == maxItemCount) then
call itemSetComplete(whichUnit)
endif
endmethod
static method onItemEquip takes unit whichUnit, integer itemId returns nothing
local integer id = GetHandleId(whichUnit)
local ItemSet this
static if LIBRARY_ErrorMessage then
debug call ThrowWarning((id == 0), "ItemSet", "onItemEquip", "id", id, "Invalid Unit Handle ( null )!")
endif
// Is item in database and the unit exists.
if (HaveSavedInteger(hash, 0, itemId)) and (id != 0) then
// Keep track how often that item was equipped.
call SaveInteger(hash, id, itemId, LoadInteger(hash, id, itemId) + 1)
// Bonuses are only applied on the first item of that type.
if (LoadInteger(hash, id, itemId) == 1) then
set this = LoadInteger(hash, 0, itemId)
call SaveInteger(hash, id, this, LoadInteger(hash, id, this) + 1)
//Apply bonuses associated with that ItemSet counter.
call add(whichUnit, LoadInteger(hash, id, this))
endif
endif
endmethod
method addBuffIndicator takes integer itemCount, integer abilityId, integer buffId returns nothing
call SaveInteger(hash, this, itemCount + BUFF_ABILITY_ID_OFFSET, abilityId)
call SaveInteger(hash, this, itemCount + BUFF_BUFF_ID_OFFSET, buffId)
endmethod
method addBonus takes integer itemCount, integer bonusType, integer amount returns nothing
call SaveInteger(hash, this, bonuses, ItemSetBonus.create(itemCount, ITEM_SET_BONUS_TYPE_BONUS, bonusType, 0., amount))
set bonuses = bonuses + 1
endmethod
method addItemPower takes integer itemCount, integer power, real value returns nothing
call SaveInteger(hash, this, bonuses, ItemSetBonus.create(itemCount, ITEM_SET_BONUS_TYPE_ITEM_POWER, power, value, 0))
set bonuses = bonuses + 1
endmethod
method addAbility takes integer itemCount, integer abilityId returns nothing
call SaveInteger(hash, this, bonuses, ItemSetBonus.create(itemCount, ITEM_SET_BONUS_TYPE_ABILITY, abilityId, 0., 0))
set bonuses = bonuses + 1
endmethod
method addItem takes integer itemId returns nothing
static if LIBRARY_ErrorMessage then
debug call ThrowError(HaveSavedInteger(hash, 0, itemId), "ItemSet", "addItem", "itemId", this, "Adding Item Ids To Two Different ItemSets Is Not Allowed: " + GetObjectName(itemId))
debug call ThrowError(itemId == 0 , "ItemSet", "addItem", "itemId", this, "Invalid Item Id (0)!")
endif
call SaveInteger(hash, 0, itemId, this)
set maxItemCount = maxItemCount + 1
endmethod
static method create takes string itemSetName, string modelName, string attachPointName returns thistype
local ItemSet this = ItemSet(ItemSet.alloc + 1)
set ItemSet.alloc = integer(this)
static if LIBRARY_ErrorMessage then
debug call ThrowError((this == 8191), "ItemSet", "create", "thistype", 8191, "Overflow!")
else
debug if (this == 8191) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., 10000. ,SCOPE_PREFIX + "FATAL ERROR: Overflow! Stopping Thread!")
debug set this = 1/0
debug endif
endif
set name = itemSetName
set sfx = modelName
set point = attachPointName
return this
endmethod
/**
* Call this method for best hashtable cleanup.
*/
static method onUnitDeindex takes unit whichUnit returns nothing
local integer id = GetHandleId(whichUnit)
if (0 != GetUnitTypeId(whichUnit)) and (0 != id) then
call FlushChildHashtable(thistype.hash, id)
endif
endmethod
endstruct
/**
* Wrapper functions.
*/
function GetTriggerItemSetEventId takes nothing returns integer
return ItemSet.triggerEventId
endfunction
function GetTriggerItemSetUnit takes nothing returns unit
return ItemSet.triggerUnit
endfunction
function GetTriggerItemSet takes nothing returns ItemSet
return ItemSet.triggerItemSet
endfunction
function RegisterItemSetEvent takes integer whichEvent, code func returns nothing
call ItemSet.registerEvent(whichEvent, Condition(func))
endfunction
endlibrary
library ZLibrary //// by D.O.G. version 2.6 ////
///////////////////////////////////////////////
/////////////////// A P I ///////////////////
///////////////////////////////////////////////
// function GetSurfaceZ takes real x, real y returns real
// - Gets terrain Z if specified point is on the ground
// or water surface Z if specified point is in the water
///////////////////////////////////////////////
// function GetTerrainZ takes real x, real y returns real
// - Gets terrain Z regardless of specified point position
///////////////////////////////////////////////
// function GetUnitZ takes unit u returns real
// function SetUnitZ takes unit u, real z returns nothing
// - They work perfectly on ground units with
// pre-added and removed "Crow Form" ability,
// BUT inaccurately on flying units near and
// over cliffs due to War3 smooth flying over
// cliffs system
///////////////////////////////////////////////
// function CreateUnitZ takes player p, integer unitid, real x, real y, real z, real face returns unit
// - The same as "CreateUnit" but with extra parameter Z
///////////////////////////////////////////////
// function GetWaterDepth takes real x, real y returns real
// - gets water depth in specified point
// (returns 0 if no water else positive real number)
///////////////////////////////////////////////
// function GetWaterType takes real x, real y returns integer
// - returns WATER_TYPE_NONE, WATER_TYPE_SHALLOW or WATER_TYPE_DEEP
///////////////////////////////////////////////
///////////// C O N S T A N T S /////////////
///////////////////////////////////////////////
globals
constant integer WATER_TYPE_NONE = 0
constant integer WATER_TYPE_SHALLOW = 1
constant integer WATER_TYPE_DEEP = 2
constant real WATER_DEPTH_SHALLOW = 52.0
endglobals
///////////////////////////////////////////////
////////////////// C O D E //////////////////
///////////////////////////////////////////////
globals
private constant integer PLATFORM = 'GetZ'
private constant real PLATFORM_HEIGHT = 2745.46265
private constant location p = Location(0.0, 0.0)
endglobals
function GetSurfaceZ takes real x, real y returns real
call MoveLocation(p, x, y)
return GetLocationZ(p)
endfunction
function GetTerrainZ takes real x, real y returns real
local real z
local destructable d = CreateDestructable(PLATFORM, x, y, 0.0, 10.0, 0)
call MoveLocation(p, x, y)
set z = GetLocationZ(p) - PLATFORM_HEIGHT
call RemoveDestructable(d)
set d = null
return z
endfunction
function GetUnitZ takes unit u returns real
if IsUnitType(u, UNIT_TYPE_FLYING) then
return GetSurfaceZ(GetUnitX(u), GetUnitY(u)) + GetUnitFlyHeight(u)
endif
return GetTerrainZ(GetUnitX(u), GetUnitY(u)) + GetUnitFlyHeight(u)
endfunction
function SetUnitZ takes unit u, real z returns nothing
if IsUnitType(u, UNIT_TYPE_FLYING) then
call SetUnitFlyHeight(u, z - GetSurfaceZ(GetUnitX(u), GetUnitY(u)), 0.0)
else
call SetUnitFlyHeight(u, z - GetTerrainZ(GetUnitX(u), GetUnitY(u)), 0.0)
endif
endfunction
function CreateUnitZ takes player p, integer unitid, real x, real y, real z, real face returns unit
set bj_lastCreatedUnit = CreateUnit(p, unitid, x, y, face)
// Enable setting fly height for ground units
static if not LIBRARY_AutoFly then
if UnitAddAbility(bj_lastCreatedUnit, 'Amrf') then // "Crow Form"
call UnitRemoveAbility(bj_lastCreatedUnit, 'Amrf')
endif
endif
// Finally set Z
call SetUnitZ(bj_lastCreatedUnit, z)
return bj_lastCreatedUnit
endfunction
function GetWaterDepth takes real x, real y returns real
local real z
local destructable d
call MoveLocation(p, x, y)
set z = GetLocationZ(p)
set d = CreateDestructable(PLATFORM, x, y, 0.0, 10.0, 0)
set z = z + PLATFORM_HEIGHT - GetLocationZ(p)
call RemoveDestructable(d)
set d = null
if z >= 0.0 then // Small negative results may occur such as -0.0001
return z
endif
return 0.0
endfunction
function GetWaterType takes real x, real y returns integer
local real d = GetWaterDepth(x, y)
if d == 0.0 then
return WATER_TYPE_NONE
elseif d < WATER_DEPTH_SHALLOW then
return WATER_TYPE_SHALLOW
endif
return WATER_TYPE_DEEP
endfunction
endlibrary
library MissileRecycler initializer PreInit requires optional UnitIndexer, optional UnitDex, optional UnitIndexerGUI /*
MissileRecycler v 1.4.5.2
=========================================================================
Credits:
-------------------------------------------------------------------------
Written by Bribe
Vexorian, Anitarf and iNfraNe for the dummy.mdx model file
Nestharus for the Queue data structure and for finding that paused units
consume very few CPU resources.
=========================================================================
Introduction:
-------------------------------------------------------------------------
Recycling dummy units is important because the CreateUnit call is one of,
if not the, most processor-intensive native in the entire game. Creating
just a couple dozen dummy units in a single thread causes a visible frame
glitch for that instant. The overhead is even higher if you are using a
Unit Indexing library in the map which causes some extra evaluations per
new unit.
There are also reports of removed units leaving a little trail of RAM
surplus in their wake. I have not been able to reproduce this so I don't
know how serious it is.
I was motivated to create this system because removed units might be un-
safe in very large numbers and CreateUnit is a very heavy process.
The thing that makes this system different than others is the fact that
it considers the facing angle of the dummies being recycled, which I have
never seen another system even attempt before this. Since then,
MissileRecycler has inspired Anitarf to update XE with the same angle-retaining
capability and Nestharus has created Dummy. Considering the facing angle is
important because it takes 0.73 seconds for the unit to turn around,
which - when overlooked - looks especially weird if you are creating a unit-trail
or if you are shooting arrow-shaped objects as projectiles. For fireball effects or
effects that generally don't depend on facing angle, this system would be
a bit wasteful.
With default settings and the worst-case-scenario, it will take 0.09 seconds for
the projectile to turn to the angle you need. This is 1/8 of the normal worst case
scenario if you weren't recycling dummies considering facing. On average, it takes
roughly 0.045 seconds to turn to the angle you need (which is not noticable).
However, I have made this completely configurable and you are
able to change the values to whatever needs you have.
=========================================================================
Calibration Guide:
-------------------------------------------------------------------------
The thing that surprised me the most about this system was, no matter how
complex it turned out, it became very configurable. So I should let you
know what the constants do so you know if/how much you want to modify.
constant real DEATH_TIME = 2.0 //seconds
- Should not be less than the maximum time a death animation needs to play.
Should not be lower than .73 to ensure enough time to turn.
Should not be too high otherwise the dummies will take too long to recycle.
constant integer ANG_N = 8
- How many different angles are recognized by the system. Don't do
360 different angles because then you're going to have thousands of dummy
units stored and that's ridiculous, the game lags enough at 1000 units.
Increasing ANG_N increases realism but decreases the chance that a dummy
unit will be available to be recycled. I don't recommend making this any
lower, and the max I'd recommend would be 16.
constant integer ANG_STORAGE_MAX = 12
- How many dummy units are stored per angle. This limit is important
because you might have a spike at one point in the game where many units
are created, which could result in too high of a dummy population.
In general, I advise that the product of ANG_N x ANG_STORAGE_MAX does
not exceed 100 or 200. More than that is excessive, but you can
hypothetically have it up to 8190 if Warcraft 3's memory management
were better.
Preloads ANG_N x ANG_STORAGE_MAX dummy units. Preloading dummies is
useful as it dumps a lot of CreateUnit calls in initialization where you
won't see a frame glitch. In the 1.4 update, preloading is done 0 seconds
into the game to ensure any Indexers have already initialized.
private function ToggleIndexer takes boolean flag returns nothing
- Put what you need in here to disable/enable any indexer in your
map. if flag is true, enable indexer. If false, disable.
=========================================================================
API Guide:
-------------------------------------------------------------------------
You obviously need some functions so you can get a recycled dummy unit or
recycle it. Therefore I provide these:
function GetRecycledMissile
takes real x, real y, real z, real facing
returns unit
Returns a new dummy unit that acts as a projectile missile. The args
are simply the last three arguments you'd use for a CreateUnit call,
with the addition of a z parameter to represent the flying height -
it isn't the absolute z but relative to the ground because it uses
SetUnitFlyHeight on that value directly.
function RecycleMissile
takes unit u
returns nothing
When you are done with that dummy unit, recycle it via this function.
This function is pretty intelligent and resets that unit's animation
and its facing angle so you don't have to.
*/
//=======================================================================
// Save the map, then delete the exclaimation mark in the following line.
// Make sure that you don't have an object in your map with the rawcode
// 'dumi' and also configure the model path (war3mapImported\dummy.mdl)
// to the dummy.mdx model created by Vexorian.
//Thanks to Vexorian that Optimizer 5.0 no longer kills natives
native UnitAlive takes unit id returns boolean
globals
//-------------------------------------------------------------------
// You must configure the dummy unit with the one created from the
// ObjectMerger statement above.
//
private constant integer DUMMY_ID = 'e022' //The rawcode of the dummy unit.
private player OWNER = Player(bj_PLAYER_NEUTRAL_EXTRA) //The owner of the dummy unit.
private constant integer ANG_N = 8 //# of indexed angles. Higher value increases realism but decreases recycle frequency.
private constant integer ANG_STORAGE_MAX = 12 //Max dummies per indexed angle. I recommend lowering this if you increase ANG_N.
private constant real DEATH_TIME = 2. //Allow the special effect on
//the unit to complete its "death" animation in this timeframe. Must
//be higher than 0.74 seconds to allow the unit time to turn. This
//number should not be lower than the maximum death-animation time of
//your missile-units' effect attachments, just to be safe.
endglobals
private function ToggleIndexer takes boolean flag returns nothing
static if LIBRARY_UnitIndexer then
set UnitIndexer.enabled = flag
elseif LIBRARY_UnitIndexerGUI then
set udg_UnitIndexerEnabled = flag
elseif LIBRARY_UnitDex then
set UnitDex.Enabled = flag
endif
endfunction
globals
private constant integer ANG_VAL = 360 / ANG_N //Generate angle value from ANG_N.
private constant integer ANG_MID = ANG_VAL / 2 //The middle value of angle value.
//Misc vars
private unit array stack //Recycled dummy units.
private real array timeStamp //Prevents early recycling of units.
private integer array queueNext
private integer array queueLast
private integer recycle = 0
private timer gameTime = CreateTimer() //Used for visual continuity.
private integer array queueStack
private integer queueStackN = 0 //Used to avoid searching the queues.
endglobals
static if DEBUG_MODE then
private function Print takes string s returns nothing
//Un-comment this next line if you want to know how the system works:
//call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 999, "[MissileRecycler] " + s)
endfunction
endif
//=======================================================================
// Get a recycled dummy missile unit. If there are no recycled dummies
// that are already facing the angle you need, it creates a new dummy for
// you.
//
function GetRecycledMissile takes real x, real y, real z, real facing returns unit
local integer i = ModuloInteger(R2I(facing), 360) / ANG_VAL
local integer this = queueNext[i]
local unit u
if this != 0 and TimerGetElapsed(gameTime) >= timeStamp[this] then
//Dequeue this
set queueNext[i] = queueNext[this]
if queueNext[i] == 0 then
set queueLast[i] = i
endif
//Recycle this index
set queueLast[this] = recycle
set recycle = this
//Add queue index to available stack
set queueStack[queueStackN] = i
set queueStackN = queueStackN + 1
//Old unit will return as new
set u = stack[this]
call SetUnitFacing(u, facing)
call SetUnitUserData(u, 0)
//Reset the dummy's properties.
call SetUnitVertexColor(u, 255, 255, 255, 255)
call SetUnitAnimationByIndex(u, 90)
call SetUnitScale(u, 1, 0, 0)
//call PauseUnit(u, false) -- you can disable "resets" that you don't need to worry about.
debug call Print("Recycling")
else
debug call Print("Creating new")
call ToggleIndexer(false)
set u = CreateUnit(OWNER, DUMMY_ID, x, y, facing)
call ToggleIndexer(true)
call PauseUnit(u, true)
endif
call SetUnitX(u, x)
call SetUnitY(u, y)
call SetUnitFlyHeight(u, z, 0)
set bj_lastCreatedUnit = u
set u = null
return bj_lastCreatedUnit
endfunction
//=======================================================================
// You should recycle the dummy missile unit when its job is done.
//
function RecycleMissile takes unit u returns nothing
local integer i
local integer this = recycle
if GetUnitTypeId(u) == DUMMY_ID and UnitAlive(u) and GetUnitUserData(u) != -1 then
if queueStackN == 0 then
debug call Print("Stack is full - removing surplus unit")
call UnitApplyTimedLife(u, 'BTLF', DEATH_TIME)
return
endif
//Recycle this
set recycle = queueLast[this]
//Index the dummy unit to an available facing angle.
//Get the last vacant angle index.
set queueStackN = queueStackN - 1
set i = queueStack[queueStackN]
//Enqueue this
set queueNext[queueLast[i]] = this
set queueLast[i] = this
set queueNext[this] = 0
//Allow a time barrier for the effect to destroy/turn to complete.
set timeStamp[this] = TimerGetElapsed(gameTime) + DEATH_TIME
set stack[this] = u
call SetUnitFacing(u, i * ANG_VAL + ANG_MID)
call SetUnitOwner(u, OWNER, false)
//Prevent double-free of this unit.
call SetUnitUserData(u, -1)
debug else
debug call BJDebugMsg("[MissileRecycler] Error: Attempt to recycle invalid unit.")
endif
endfunction
//=======================================================================
// I didn't need this function after all
//
function RecycleMissileDelayed takes unit u, real r returns nothing
call RecycleMissile(u)
endfunction
//=======================================================================
// Map the dummy units to their facing angles (map below is if ANG_N is
// 4 and ANG_STORAGE_MAX is 3).
//
// angle[0] (0) - [4] [5] [6]
// angle[1] (90) - [7] [8] [9]
// angle[2] (180) - [10][11][12]
// angle[3] (270) - [13][14][15]
//
private function Init takes nothing returns nothing
local integer end
local integer i = ANG_N
local integer n = i
local integer angle
local real x = GetRectMaxX(bj_mapInitialPlayableArea)
local real y = GetRectMaxY(bj_mapInitialPlayableArea)
local unit u
call ToggleIndexer(false)
loop
set i = i - 1
set queueNext[i] = n
set angle = i * ANG_VAL + ANG_MID
set end = n + ANG_STORAGE_MAX
set queueLast[i] = end - 1
loop
set queueNext[n] = n + 1
set u = CreateUnit(OWNER, DUMMY_ID, x, y, angle)
set stack[n] = u
call PauseUnit(u, true)
call SetUnitUserData(u, -1)
set n = n + 1
exitwhen n == end
endloop
set queueNext[n - 1] = 0
exitwhen i == 0
endloop
call ToggleIndexer(true)
call TimerStart(gameTime, 1000000., false, null)
set u = null
endfunction
private function PreInit takes nothing returns nothing
static if LIBRARY_UnitIndexerGUI then
call OnUnitIndexerInitialized(function Init)
else
call Init()
endif
endfunction
endlibrary
//TESH.scrollpos=26188
//TESH.alwaysfold=0
globals
boolean RANDOMWAVEON = false
integer StartingLives = 100
trigger FLESHLESSARMOR
trigger BONESHED
unit array ToxiaShielder
unit array CabaShielder
unit array EntroShielder
boolean array IsFirelordAttack
real array MouseX
real array MouseY
constant integer CalloftheHaunted___ABIL_ID= 'A0AA'
constant integer CalloftheHaunted___ABIL_ID2= 'A0A9'
constant integer CalloftheHaunted___NOSTACK_ID= 'A0AB'
constant integer CalloftheHaunted___INV_ID= 'AInv'
constant integer CalloftheHaunted___TIMED_LIFE_ID= 'BTLF'
constant integer CalloftheHaunted___SUPER_HP= 'I021'
constant integer CalloftheHaunted___SUPER_DMG= 'I022'
constant integer CalloftheHaunted___HEALTH_TOME_1= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_2= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_3= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_4= 'I021'
constant integer CalloftheHaunted___DAMAGE_TOME_1= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_2= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_3= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_4= 'I022'
constant integer CalloftheHaunted___UNIT1= 'uske'
constant integer CalloftheHaunted___UNIT2= 'uskm'
constant integer CalloftheHaunted___UNIT3= 'nskm'
constant integer CalloftheHaunted___UNIT4= 'nskf'
constant integer CalloftheHaunted___UNIT1_INDEX= 9
constant integer CalloftheHaunted___UNIT2_INDEX= 6
constant integer CalloftheHaunted___UNIT3_INDEX= 7
constant integer CalloftheHaunted___UNIT4_INDEX= 7
constant integer CalloftheHaunted___UNIT1_ABILITY1= 'A0A0'
constant integer CalloftheHaunted___UNIT1_ABILITY2= 'A0A1'
constant integer CalloftheHaunted___UNIT2_ABILITY1= 'A0A6'
constant integer CalloftheHaunted___UNIT2_ABILITY2= 'A0K5'
constant integer CalloftheHaunted___UNIT3_ABILITY1= 'A09Z'
constant integer CalloftheHaunted___UNIT3_ABILITY2= 'A09W'
constant integer CalloftheHaunted___UNIT4_ABILITY1= 'A09Z'
constant integer CalloftheHaunted___UNIT4_ABILITY2= 'A09Z'
constant integer CalloftheHaunted___SUPER_UNIT= 'nsko'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY1= 'A0A4'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY2= 'A0A5'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY3= 'A0A2'
constant integer CalloftheHaunted___SUPER_BIRTH_INDEX= 9
constant string CalloftheHaunted___EFFECT= "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl"
constant string CalloftheHaunted___SUPER_EFFECT= "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl"
constant string CalloftheHaunted___ATTACH= "war3mapImported\\Soul Aura.mdx"
constant string CalloftheHaunted___ATTACH_POINT= "origin"
constant integer CalloftheHaunted___SUPER_UNIT_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___SUPER_UNIT_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT1_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT2_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT3_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT4_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT1_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT2_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT3_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT4_HP_PER_TOME= 25
constant boolean CalloftheHaunted___USE_UPGRADE_ABILITY= true
constant integer Chernobyliss__ABIL_ID= 'A03E'
constant integer Chernobyliss__SLOW_ID= 'A09U'
constant string Chernobyliss__EFFECT1= "war3mapImported\\Acid Ex.mdx"
constant string Chernobyliss__EFFECT2= "war3mapImported\\VenomousGaleV2_Portrait.mdx"
constant string Chernobyliss__EFFECT3= "Abilities\\Spells\\Other\\AcidBomb\\BottleMissile.mdl"
constant string Chernobyliss__ATTACH= "chest"
constant string Chernobyliss__ATTACH2= "chest"
constant string Chernobyliss__KB_SFX= ""
constant real Chernobyliss__TIMER_INTERVAL= 1.5
constant real Chernobyliss__KB_DURATION= .6
constant boolean Chernobyliss__CHANGE_VERTEX_COLOR= true
constant attacktype Chernobyliss__ATTACK_TYPE= ATTACK_TYPE_NORMAL
constant damagetype Chernobyliss__DAMAGE_TYPE= DAMAGE_TYPE_LIGHTNING
constant real Chernobyliss__TREE_AOE= 0.0
constant boolean Chernobyliss__ALLOW_MOVE= false
constant boolean Chernobyliss__CHECK_PATHING= false
constant group Chernobyliss__GROUP= CreateGroup()
unit Chernobyliss__CASTER
real Chernobyliss__SPELL_X
real Chernobyliss__SPELL_Y
constant integer si__Chernobyliss__Cbliss=419
integer si__Chernobyliss__Cbliss_F=0
integer si__Chernobyliss__Cbliss_I=0
integer array si__Chernobyliss__Cbliss_V
unit array s__Chernobyliss__Cbliss_cast
unit array s__Chernobyliss__Cbliss_t
real array s__Chernobyliss__Cbliss_x
real array s__Chernobyliss__Cbliss_y
real array s__Chernobyliss__Cbliss_dur
integer array s__Chernobyliss__Cbliss_lvl
effect array s__Chernobyliss__Cbliss_attach
constant integer si__CalloftheHaunted___CotH=420
integer si__CalloftheHaunted___CotH_F=0
integer si__CalloftheHaunted___CotH_I=0
integer array si__CalloftheHaunted___CotH_V
unit array s__CalloftheHaunted___CotH_cast
real array s__CalloftheHaunted___CotH_x
real array s__CalloftheHaunted___CotH_y
integer array s__CalloftheHaunted___CotH_lvl
integer array s__CalloftheHaunted___CotH_lvl2
effect array s__CalloftheHaunted___CotH_attach
constant integer si__DeathCall___DCall=421
integer si__DeathCall___DCall_F=0
integer si__DeathCall___DCall_I=0
integer array si__DeathCall___DCall_V
unit array s__DeathCall___DCall_cast
unit array s__DeathCall___DCall_t
effect array s__DeathCall___DCall_attach
constant integer si__ReviveSafe___revivec=422
integer si__ReviveSafe___revivec_F=0
integer si__ReviveSafe___revivec_I=0
integer array si__ReviveSafe___revivec_V
integer array s__ReviveSafe___revivec_i
integer array C_F_R_A_G_S
integer array W_I_N_S
integer array LOOOSES
unit V
boolean E=true
integer X=1
boolean O=true
real R=2.
boolean I=true
boolean A=true
boolean PRODICT=false
boolean SOCIALWELFARE=false
boolean TRUECOMMUNISM=false
boolean NOBOUNTY=false
boolean REDUCEDBOUNTY=false
boolean DOUBLEHEALTH=false
boolean BRTON=false
boolean TRUEENFOS=false
boolean ALLRANDOM=false
boolean NOOBM=false
boolean GAMEM=true
boolean LWMON=false
boolean FLAGREMATCH=true
boolean array LICHS
boolean array TIPST
string N="Sound\\Interface\\Error.wav"
unit array B
unit array C
item array D
item array F
item array G
real array H
integer J=0
integer K=0
timer L=CreateTimer()
destructable M
effect P
hashtable Q=InitHashtable()
integer S=0
integer T=0
integer array U
boolean array W
item array Y
integer Z=0
integer VV=0
real EV=.0
real XV=.0
real OV=.0
real RV=.0
rect IV=null
unit AV=null
item NV=null
timer BV=null
boolexpr CV=null
timer array DV
trigger array FV
integer array GV
integer array HV
triggercondition array JV
boolexpr array KV
integer array LV
integer array MV
integer array PV
integer QV=0
integer array SV
integer TV=1
integer array UV
triggercondition array WV
boolexpr array YV
boolean array ZV
integer VE=0
integer EE=-1
integer XE
integer OE
integer RE
integer IE
conditionfunc AE
conditionfunc NE
conditionfunc BE
integer array CE
boolexpr array DE
trigger array FE
integer GE=0
trigger array HE
integer array JE
integer KE
trigger LE
integer ME
integer PE
trigger QE
group SE=null
item TE=null
location UE=null
location HeroCreateLocation=null
location RandomCreateLocation=null
boolexpr WE=null
location YE=Location(.0,.0)
constant timer ZE=CreateTimer()
location VX=null
location EX=null
constant integer XX=255
constant integer OX=255
constant integer RX=255
constant integer IX=175
sound AX
integer NX=0
trigger BX=CreateTrigger()
hashtable CX
//hashtable FX
//integer GX=0
//constant integer HX=679645218
integer JX=0
integer array KX
integer LX=0
timer MX=CreateTimer()
integer PX=0
integer array QX
integer SX=0
timer TX=CreateTimer()
timer UX=CreateTimer()
integer WX=0
unit array YX
integer array ZX
integer array VO
integer EO=0
integer XO=0
integer array OO
integer RO=0
timer IO=CreateTimer()
integer array AO
integer NO=0
integer array BO
integer CO=0
integer DO=0
integer array FO
unit array GO
trigger HO=CreateTrigger()
trigger JO=CreateTrigger()
trigger KO=CreateTrigger()
integer MO
integer QO=0
integer SO=0
group array TO
boolexpr WO=null
boolexpr YO=null
hashtable ZO=InitHashtable()
boolean VR=false
group ER=null
group array XR
integer OR=0
real RR=.0
real IR=.0
real AR=.0
hashtable NR=InitHashtable()
unit BR
unit CR
unit DR
integer FR
rect GR=null
group JR=CreateGroup()
//group PATHING_GROUP = CreateGroup()
real KR
real LR
real MR
real PR
hashtable QR=InitHashtable()
constant real SR=200.*200.
constant trigger TR=CreateTrigger()
integer UR
integer WR
integer YR
string array ZR
integer VI=0
hashtable EI=InitHashtable()
integer XI=0
timer OI
timer RI
integer II
boolean AI=true
integer NI=0
damagetype array BI
boolean array CI
real array DI
unit array FI
integer GI=0
timer HI=CreateTimer()
real JI
unit KI
unit LI
real MI
trigger QI=null
trigger SI=null
group TI=null
group UI=null
unit WI=null
unit YI=null
real ZI=.0
real VA=1410065408.
real XA=VA
real OA=.0
real RA=.0
real IA=.0
destructable AA=null
item NA=null
unit BA
real CA
real DA
real FA
real GA
real HA
constant player JA=Player(PLAYER_NEUTRAL_PASSIVE)
integer KA=0
integer LA=0
integer MA=0
integer PA=0
integer QA=0
real TA=.0
real UA=.0
real WA=.0
real YA=.0
hashtable ZA=null
hashtable VN=null
real XN=.0
real ON=.0
real RN=.0
real IN=.0
real AN=.0
location NN=null
constant real BN=-5000
location CN=Location(.0,.0)
real array DN
real array FN
integer array GN
location HN=Location(.0,.0)
constant attacktype JN=ATTACK_TYPE_CHAOS
constant real KN=-.061875
constant damagetype LN=DAMAGE_TYPE_UNKNOWN
integer MN=0
integer PN=0
unit QN=null
unit SN=null
real TN=.0
integer array UN
location WN=Location(.0,.0)
location YN=Location(.0,.0)
constant integer ZN=20
location VB=Location(.0,.0)
location EB=Location(.0,.0)
location XB=Location(.0,.0)
constant group OB=CreateGroup()
unit RB
location IB=Location(.0,.0)
constant group AB=CreateGroup()
unit NB
location BB=Location(.0,.0)
location CB=Location(.0,.0)
location DB=Location(.0,.0)
location FB=Location(.0,.0)
location GB=Location(.0,.0)
location HB=Location(.0,.0)
location JB=Location(.0,.0)
constant group KB=CreateGroup()
unit LB
real MB
location PB=Location(.0,.0)
location QB=Location(.0,.0)
location SB=Location(.0,.0)
location TB=Location(.0,.0)
trigger UB=null
location WB=Location(.0,.0)
unit YB
location ZB=Location(.0,.0)
location VC=Location(.0,.0)
location EC=Location(.0,.0)
location XC=Location(.0,.0)
unit OC
boolean array RC
integer array IC
integer array AC
boolean array NC
integer array BC
integer array CC
boolean array DC
integer array FC
integer array GC
constant real HC=2*bj_PI
integer JC
group KC=CreateGroup()
group RANDOMGROUP=CreateGroup()
unit array LC
integer array MC
integer PC=0
integer QC=0
integer SC=0
integer TC=0
unit array UC
integer WC=0
dialog YC=null
button array ZC
integer array VD
real ED=0
timer array XD
boolean array OD
dialog RD=null
button array ID
integer array AD
integer ND=0
integer array BD
boolean DD=false
unit FD=null
rect array GD
boolean HD=false
boolean array KD
leaderboard LD=null
location array MD
location array PD
boolean array QD
group SD=null
integer array TD
string array UD
real WD=0
real YD=0
location NF=null
location BF=null
location CF=null
location DF=null
hashtable FF=null
integer GF=0
real HF=0
location JF=null
unit KF=null
integer LF=0
unit array MF
location array PF
integer array QF
integer array SF
real array TF
unit UF=null
group array WF
sound array YF
integer ZF=0
group VG=null
location EG=null
location XG=null
unit OG=null
location RG=null
group IG=null
integer AG=0
real NG=0
integer array BG
location array CG
unit DG=null
real array FG
location GG=null
real array HG
real array JG
real KG=0
unit array LG
real array MG
string array PG
string QG=""
string array SG
string TG=""
boolean array UG
boolean WG=false
real array YG
real ZG=0
real VH=0
group EH=null
real array XH
real array OH
boolean RH=false
location IH=null
group AH=null
integer NH=0
unit array BH
unit array CH
location array DH
location array FH
real array GH
real array HH
integer array JH
real array KH
real array LH
integer MH=0
group PH=null
integer QH=0
unit array SH
location array TH
integer array UH
real array WH
location array YH
real array ZH
real array VJ
integer EJ=0
group array XJ
group OJ=null
integer RJ=0
integer IJ=0
unit array AJ
location array NJ
real array BJ
real array CJ
real array DJ
group array FJ
integer GJ=0
location array HJ
integer JJ=0
unit array KJ
real array LJ
real array MJ
real PJ=0
real QJ=0
real SJ=0
location array TJ
unit array UJ
integer WJ=0
group array YJ
group ZJ=null
real VK=0
integer EK=0
location XK=null
location OK=null
location RK=null
location IK=null
group AK=null
group NK=null
group BK=null
group CK=null
location DK=null
location FK=null
group GK=null
integer HK=0
integer JK=0
integer KK=0
location LK=null
location MK=null
integer array PK
group QK=null
group SK=null
group TK=null
group UK=null
group WK=null
location YK=null
location ZK=null
location TempLocation=null
location TempLocation2=null
unit array VL
location EL=null
group XL=null
integer OL=0
unit RL=null
location IL=null
location AL=null
integer NL=0
unit BL=null
location CL=null
real DL=0
real FL=0
group GL=null
location HL=null
location JL=null
group KL=null
location LL=null
location ML=null
unit array PL
location QL=null
effect array SL
location TL=null
real ZL=0
boolean array EM
unit XM=null
unit OM=null
location array RM
integer array IM
real array AM
group NM=null
lightning BM=null
group CM=null
location DM=null
unit array FM
player GM=null
location array HM
integer array JM
boolean array KM
real array LM
real array MM
real array PM
unit array QM
unit array SM
group TM=null
effect array UM
effect array WM
effect array YM
effect array ZM
location array VP
location array EP
real array XP
real array OP
real array RP
real array IP
unit array AP
unit array NP
unit array BP
unit array CP
unit array DP
unit array FP
unit array GP
unit array HP
unit array JP
real array KP
real array LP
integer array MP
integer array PP
real array QP
location array SP
location array TP
location array UP
location array WP
location array YP
location array ZP
unit VQ=null
unit SpeedyGonzalez=null
location EQ=null
force XQ=null
real OQ=0
location RQ=null
location IQ=null
location AQ=null
location NQ=null
force BQ=null
real array CQ
integer array DQ
integer array FQ
integer array GQ
integer array HQ
integer array JQ
integer array KQ
integer array LQ
unit array MQ
string PQ=""
integer array QQ
string array SQ
integer TQ=0
integer array UQ
string WQ=""
string YQ=""
string ZQ=""
force array VS
force ES=null
string array XS
integer OS=0
string RS=""
integer array IS
multiboard array AS
leaderboard array NS
string array BS
integer CS=0
boolean DS=false
integer FS=0
real array GS
integer array HS
integer array JS
integer array KS
integer LS=0
force MS=null
integer PS=0
integer array QS
string array SS
integer array TS
integer array US
integer array WS
integer YS=0
real array ZS
integer array VT
integer array ET
integer XT=0
integer OT=0
string RT=""
real array IT
real array AT
string array NT
integer array BT
integer array CT
string array DT
integer array FT
integer array GT
integer array HT
boolean array JT
real array KT
integer array LT
integer array MT
integer array PT
integer array QT
boolean ST=false
boolean array TT
location UT=null
boolean array WT
location YT=null
integer ZT=0
integer VU=0
boolean array EU
unit array XU
real array OU
real array RU
integer IU=0
location AU=null
location NU=null
effect array BU
timer array CU
trigger DU=null
location FU=null
rect GU=null
rect HU=null
rect JU=null
rect KU=null
rect LU=null
rect MU=null
rect PU=null
rect QU=null
rect SU=null
rect TU=null
rect UU=null
rect WU=null
rect YU=null
rect ZU=null
rect VW=null
rect EW=null
rect XW=null
rect OW=null
rect RW=null
rect IW=null
rect AW=null
rect NW=null
rect BW=null
rect CW=null
rect DW=null
rect FW=null
rect GW=null
rect HW=null
rect JW=null
rect KW=null
rect LW=null
rect MW=null
rect PW=null
rect QW=null
rect SW=null
rect TW=null
rect UW=null
rect WW=null
rect YW=null
rect ZW=null
rect VY=null
rect EY=null
rect XY=null
rect OY=null
rect RY=null
rect IY=null
rect AY=null
rect NY=null
rect BY=null
rect CY=null
camerasetup DY=null
camerasetup FY=null
sound GY=null
sound HY=null
sound JY=null
sound KY=null
sound LY=null
sound MY=null
sound PY=null
sound QY=null
sound SY=null
sound TY=null
trigger UY=null
trigger WY=null
trigger YY=null
trigger ZY=null
trigger VZ=null
trigger EZ=null
trigger XZ=null
trigger OZ=null
trigger RZ=null
trigger IZ=null
trigger AZ=null
trigger NZ=null
trigger BZ=null
trigger CZ=null
trigger DZ=null
trigger FZ=null
trigger GZ=null
trigger HZ=null
trigger JZ=null
trigger KZ=null
trigger LZ=null
trigger MZ=null
trigger PZ=null
trigger QZ=null
trigger SZ=null
trigger TZ=null
trigger UZ=null
trigger WZ=null
trigger YZ=null
trigger ZZ=null
trigger V0=null
trigger E0=null
trigger X0=null
trigger O0=null
trigger R0=null
trigger I0=null
trigger A0=null
trigger N0=null
trigger B0=null
trigger C0=null
trigger D0=null
trigger F0=null
trigger G0=null
trigger H0=null
trigger J0=null
trigger J00=null
trigger K0=null
trigger K00=null
trigger K000=null
trigger L0=null
trigger M0=null
trigger P0=null
trigger Q0=null
trigger S0=null
trigger T0=null
trigger U0=null
trigger W0=null
trigger Y0=null
trigger Z0=null
trigger V1=null
trigger E1=null
trigger X1=null
trigger O1=null
trigger R1=null
trigger I1=null
trigger A1=null
trigger N1=null
trigger B1=null
trigger C1=null
trigger D1=null
trigger F1=null
trigger G1=null
trigger H1=null
trigger J1=null
trigger K1=null
trigger L1=null
trigger M1=null
trigger P1=null
trigger Q1=null
trigger S1=null
trigger T1=null
trigger RANDOMOVE=null
//trigger U1=null
trigger W1=null
trigger Y1=null
//trigger Z1=null
trigger V2=null
//trigger E2=null
trigger X2=null
trigger O2=null
trigger R2=null
trigger I2=null
trigger A2=null
trigger N2=null
trigger B2=null
trigger C2=null
trigger D2=null
trigger F2=null
//trigger G2=null
trigger H2=null
trigger J2=null
trigger K2=null
trigger L2=null
trigger M2=null
trigger P2=null
trigger Q2=null
trigger S2=null
trigger T2=null
trigger U2=null
trigger W2=null
trigger Y2=null
trigger E3=null
trigger X3=null
//trigger O3=null
trigger R3=null
trigger I3=null
trigger A3=null
trigger N3=null
//trigger B3=null
trigger C3=null
trigger D3=null
trigger F3=null
//trigger G3=null
trigger H3=null
trigger J3=null
trigger K3=null
//trigger L3=null
trigger M3=null
trigger P3=null
trigger Q3=null
trigger S3=null
trigger T3=null
trigger U3=null
trigger W3=null
trigger Y3=null
trigger Z3=null
trigger V4=null
trigger E4=null
trigger X4=null
trigger O4=null
trigger R4=null
trigger I4=null
trigger A4=null
trigger N4=null
trigger B4=null
trigger C4=null
trigger D4=null
trigger F4=null
trigger G4=null
trigger H4=null
trigger J4=null
trigger K4=null
trigger L4=null
trigger M4=null
trigger P4=null
trigger Q4=null
trigger S4=null
trigger T4=null
trigger U4=null
trigger W4=null
trigger Y4=null
trigger Z4=null
trigger V5=null
trigger E5=null
trigger X5=null
trigger O5=null
trigger R5=null
trigger I5=null
trigger A5=null
trigger N5=null
trigger B5=null
trigger C5=null
trigger D5=null
trigger F5=null
trigger G5=null
trigger H5=null
trigger J5=null
trigger K5=null
trigger L5=null
trigger M5=null
trigger P5=null
trigger Q5=null
trigger S5=null
trigger T5=null
trigger U5=null
trigger W5=null
trigger Y5=null
trigger Z5=null
trigger V6=null
trigger E6=null
trigger X6=null
//trigger O6=null
trigger R6=null
trigger I6=null
trigger A6=null
trigger N6=null
trigger B6=null
trigger C6=null
trigger D6=null
trigger F6=null
trigger G6=null
trigger H6=null
trigger J6=null
trigger K6=null
trigger L6=null
trigger M6=null
trigger P6=null
trigger Q6=null
trigger S6=null
trigger T6=null
trigger U6=null
//trigger W6=null
trigger Y6=null
trigger Z6=null
trigger E7=null
trigger X7=null
trigger O7=null
trigger R7=null
trigger I7=null
trigger A7=null
trigger N7=null
trigger B7=null
trigger C7=null
trigger D7=null
trigger F7=null
trigger G7=null
trigger H7=null
trigger J7=null
trigger K7=null
trigger L7=null
trigger M7=null
trigger P7=null
trigger Q7=null
trigger S7=null
trigger T7=null
trigger U7=null
trigger W7=null
trigger Z7=null
trigger V8=null
trigger E8=null
trigger X8=null
trigger O8=null
trigger R8=null
trigger I8=null
trigger A8=null
trigger N8=null
trigger B8=null
trigger C8=null
trigger D8=null
trigger F8=null
trigger G8=null
trigger H8=null
trigger J8=null
trigger K8=null
trigger L8=null
trigger M8=null
trigger P8=null
trigger Q8=null
trigger S8=null
trigger T8=null
trigger U8=null
trigger W8=null
trigger Y8=null
trigger Z8=null
trigger VVV=null
trigger VEV=null
trigger VXV=null
trigger VOV=null
trigger VRV=null
trigger VIV=null
trigger VAV=null
trigger VNV=null
trigger VBV=null
trigger VCV=null
trigger VDV=null
trigger QoBT=null
trigger PeHT=null
trigger VFV=null
trigger VGV=null
trigger VHV=null
trigger VJV=null
trigger VKV=null
trigger VLV=null
trigger VMV=null
trigger VPV=null
trigger VQV=null
trigger VSV=null
trigger VTV=null
trigger VUV=null
trigger VWV=null
trigger VYV=null
trigger VZV=null
trigger V_V=null
trigger V0V=null
trigger V1V=null
trigger V2V=null
trigger V3V=null
trigger V4V=null
trigger V7V=null
trigger V8V=null
trigger V9V=null
trigger EVV=null
trigger EEV=null
trigger EXV=null
trigger EOV=null
trigger ERV=null
trigger EIV=null
trigger EAV=null
trigger ENV=null
trigger EBV=null
trigger ECV=null
trigger EDV=null
trigger EFV=null
trigger EGV=null
trigger EHV=null
trigger EJV=null
trigger EKV=null
trigger ELV=null
trigger EMV=null
trigger EPV=null
trigger EQV=null
trigger ESV=null
trigger ETV=null
trigger EUV=null
//trigger EWV=null
//trigger EYV=null
trigger EZV=null
trigger E_V=null
trigger E0V=null
//trigger Z_Y= null
trigger P_9=null
//trigger Q_8=null
//trigger Q_7=null
//trigger Q_6=null
trigger Q_5=null
trigger Q_4=null
trigger Q_3=null
unit E1V=null
unit E2V=null
unit E3V=null
unit E4V=null
unit E5V=null
unit E6V=null
unit E7V=null
unit E8V=null
unit E9V=null
unit XVV=null
unit XEV=null
unit XXV=null
unit XOV=null
unit XRV=null
unit XIV=null
unit XAV=null
unit QoBC=null
unit XNV=null
unit XBV=null
unit XCV=null
unit XDV=null
unit XFV=null
unit XGV=null
unit XHV=null
unit XJV=null
unit XKV=null
unit XLV=null
unit XMV=null
unit XPV=null
unit XQV=null
unit XSV=null
unit XTV=null
unit XUV=null
unit XWV=null
unit XYV=null
unit XZV=null
unit X_V=null
unit X0V=null
unit X1V=null
unit X2V=null
unit X3V=null
unit X4V=null
unit X5V=null
unit X6V=null
unit X7V=null
unit X8V=null
unit X9V=null
unit OVV=null
unit OEV=null
unit OXV=null
unit OOV=null
unit PeHC=null
unit FIRELORDCIRCLE=null
unit TRITUSCIRCLE=null
unit MOLOCHCIRCLE=null
unit VERACIRCLE=null
unit NYXVIRCIRCLE=null
constant group ORV=CreateGroup()
unit OIV
constant group OAV=CreateGroup()
unit ONV
unit OBV
//constant group OCV=CreateGroup()
//unit ODV
constant real OFV=-420.
rect OGV=null
trigger OHV
integer OJV
location OKV=Location(.0,.0)
location OLV=Location(.0,.0)
location OMV=Location(.0,.0)
constant group OPV=CreateGroup()
group OQV
unit OSV
integer OTV
location OUV=Location(0,0)
group OWV=CreateGroup()
hashtable OYV
sound OZV
real array O_V
real array O0V
real array O1V
real array O2V
constant real O3V=175
constant group O4V=CreateGroup()
unit O5V
constant integer O6V=127
integer O7V
integer array O8V
constant group O9V=CreateGroup()
unit RVV
constant group REV=CreateGroup()
unit RXV
constant group ROV=CreateGroup()
unit RRV
constant group RIV=CreateGroup()
unit RAV
constant group RNV=CreateGroup()
group UNIT_SPAWNERS_GROUP=CreateGroup()
unit RBV
unit RCV
integer RDV=0
integer array RFV
integer RGV=0
timer RHV=CreateTimer()
integer array RJV
integer RKV=0
integer array RLV
integer RMV=0
integer RPV=0
integer array RQV
trigger array RSV
integer array RTV
integer array RUV
trigger RWV
integer RYV=0
integer RZV=0
integer array R_V
unit array R0V
real array R1V
real array R2V
real array R3V
real array R4V
real array R5V
integer array R6V
effect array R7V
boolean array R8V
boolean array R9V
boolean array IVV
boolean array IEV
integer IXV=0
integer IOV=0
integer array IRV
integer array IIV
integer array IAV
real array INV
real array IBV
real array ICV
real array IDV
real array IFV
real array IGV
real array IHV
real array IJV
real array IKV
boolean array ILV
boolean array IMV
boolean array IPV
real array IQV
real array ISV
real array ITV
boolean array IUV
boolean array IWV
boolean array IYV
integer IZV=1
integer I_V=0
integer I0V=0
integer array I1V
integer I2V=0
integer I3V=0
integer array I4V
unit array I5V
real array I6V
real array I7V
integer array I8V
integer I9V=0
integer AVV=0
integer array AEV
unit array AXV
real array AOV
real array ARV
integer array AIV
integer AAV=0
integer ANV=0
integer array ABV
unit array ACV
real array ADV
real array AFV
real array AGV
real array AHV
location array AJV
integer array AKV
integer ALV=0
integer AMV=0
integer array APV
integer array AQV
real array ASV
real array ATV
unit array AUV
timer AWV=CreateTimer()
integer AYV=0
boolean array AZV
boolean array A_V
integer A0V=0
integer A1V=0
integer array A2V
unit array A3V
real array A4V
real array A5V
real array A6V
real array A7V
real array A8V
real array A9V
real array NVV
real array NEV
integer array NXV
integer array NOV
integer array NRV
integer array NIV
boolean array NAV
boolean array NNV
integer NBV=1
timer NCV=CreateTimer()
integer NDV=0
integer NFV=0
integer array NGV
unit array NHV
real array NJV
real array NKV
real array NMV
real array NPV
real array NQV
real array NSV
real array NTV
real array NUV
integer array NWV
timer NYV=CreateTimer()
integer NZV=0
boolean array N_V
boolean array N0V
integer N1V=0
integer N2V=0
integer array N3V
unit array N4V
unit array N5V
unit array N6V
real array N7V
real array N8V
real array N9V
string array BVV
integer array BEV
timer BXV=CreateTimer()
integer BOV=0
boolean array BRV
boolean array BIV
integer BAV=0
integer BNV=0
integer array BBV
unit array BCV
unit array BDV
real array BFV
real array BGV
real array BHV
real array BJV
real array BKV
real array BLV
real array BMV
real array BPV
string array BQV
integer array BSV
timer BTV=CreateTimer()
integer BUV=0
boolean array BWV
boolean array BYV
integer BZV=0
integer B_V=0
integer array B0V
integer array B1V
trigger array B2V
trigger array B3V
trigger array B4V
trigger array B5V
trigger array B6V
real array B7V
real array B8V
unit array B9V
real array CVV
real array CEV
integer array CXV
integer array COV
real array CRV
real array CIV
real array CAV
real array CNV
boolean array CBV
real array CCV
string array CDV
player array CFV
real array CGV
boolean array CHV
real array CJV
attacktype array CKV
damagetype array CLV
real CMV
real CPV
integer CQV
integer CSV
integer CTV
unit CUV
integer array CWV
integer array CYV
integer CZV=0
integer C_V=0
integer array C0V
constant integer C1V=10
integer array C2V
integer C3V=0
integer C4V=0
integer array C5V
constant integer C6V=10
integer array C7V
integer C8V=0
integer C9V=0
integer array DVV
integer array DEV
integer array DXV
integer array DOV
integer array DRV
string array DIV
string array DAV
boolean array DNV
boolean array DBV
integer DCV
unit array DDV
real array DFV
integer DGV=0
integer DHV=0
integer DJV=0
integer DKV=0
integer array DLV
integer array DMV
unit array DPV
effect array DQV
real array DSV
integer array DTV
integer array DUV
integer array DWV
integer array DYV
integer array DZV
boolean array D_V
conditionfunc D0V
trigger array D1V
real array D2V
real array D3V
boolean array D4V
boolean array D5V
real array D6V
real array D7V
boolean array D8V
integer D9V=0
integer FVV=0
integer array FEV
integer array FXV
trigger array FOV
trigger array FRV
trigger array FIV
trigger array FAV
trigger array FNV
trigger array FBV
trigger array FCV
trigger array FDV
trigger array FFV
trigger array FGV
integer array FHV
string array FJV
integer array FKV
integer array FLV
integer array FMV
integer array FPV
real array FQV
real array FSV
real array FTV
real array FUV
real array FWV
unit array FYV
group array FZV
boolean array F_V
boolean array F0V
boolean array F1V
boolean array F2V
boolean array F3V
boolean array F4V
boolean array F5V
integer F6V=0
integer F7V=1
timer F8V=CreateTimer()
rect F9V
integer GVV
trigger GEV=CreateTrigger()
boolean GXV=true
boolexpr array GOV
boolean array GRV
boolean array GIV
boolean array GAV
boolean array GBV
boolean array GCV
integer array GDV
integer GFV=0
integer GGV=0
integer array GHV
unit array GJV
real array GKV
integer array GLV
integer array GMV
integer GPV=0
integer GQV=0
integer array GSV
integer array GTV
integer array GUV
integer array GWV
boolean array GYV
unit array GZV
player array G_V
real array G0V
real array G1V
real array G2V
real array G3V
real array G4V
real array G5V
real array G6V
boolean array G7V
boolean array G8V
boolean array G9V
boolean array HVV
boolean array HEV
boolean array HXV
boolean array HOV
integer array HRV
integer array HIV
integer array HAV
integer array HNV
integer array HBV
integer array HCV
integer array HDV
unit array HFV
real array HGV
real array HHV
real array HJV
real array HKV
real array HLV
real array HMV
real array HPV
real array HQV
real array HSV
real array HTV
real array HUV
real array HWV
real array HYV
unit array HZV
effect array H_V
string array H0V
boolean array H1V
boolean array H2V
boolean array H3V
real array H4V
real array H5V
real array H6V
real array H7V
real array H8V
real array H9V
group array JVV
rect JEV=null
group JXV=null
boolexpr JOV=null
boolexpr JRV=null
integer JIV=0
image array JAV
real array JNV
boolean array JBV
real array JCV
real array JDV
boolean array JFV
integer array JGV
integer array JHV
integer array JJV
integer array JKV
integer array JLV
integer array JMV
integer JPV=0
integer JQV=0
integer JSV=0
integer array JTV
integer array JUV
group array JWV
string array JYV
real array JZV
real array J_V
real array J0V
real array J1V
real array J2V
real array J3V
boolean array J4V
boolean array J5V
integer J6V=0
integer J7V=0
integer array J8V
lightning array J9V
unit array KVV
unit array KEV
real array KXV
real array KOV
boolean array KRV
real array KIV
integer KAV=1
timer KNV=CreateTimer()
integer array KBV
integer array KCV
unit array KDV
real array KFV
real array KGV
real array KHV
string array KJV
string array KKV
integer array KLV
boolean array KMV
boolean array KPV
boolean array KQV
unit array KSV
unit KTV=null
unit KUV=null
integer KWV=0
group KYV=CreateGroup()
integer KZV=0
integer K_V=0
integer K0V=0
integer array K1V
real array K2V
real array K3V
integer K4V=0
integer K5V=0
integer array K6V
real array K7V
real array K8V
unit array K9V
real array LVV
real array LEV
real array LXV
integer array LOV
integer LRV=0
integer LIV=0
integer array LAV
real array LNV
real array LBV
unit array LCV
real array LDV
real array LFV
real array LGV
integer array LHV
integer LJV=0
integer LKV=0
integer array LLV
unit array LMV
effect array LPV
integer LQV=0
integer LSV=0
integer array LTV
unit array LUV
effect array LWV
integer array LYV
real array LZV
integer L_V=0
integer L0V=0
integer array L1V
unit array L2V
real array L3V
integer array L4V
integer array L5V
integer L6V=0
integer L7V=0
integer array L8V
unit array L9V
unit array MVV
effect array MEV
real array MXV
real array MOV
real array MRV
real array MIV
real array MAV
integer array MNV
integer array MBV
integer array MCV
integer MDV=0
integer MFV=0
integer array MGV
boolean array MHV
boolean array MJV
boolean array MKV
boolean array MLV
boolean array MMV
boolean array MPV
boolean array MQV
boolean array MSV
boolean array MTV
damagetype array MUV
attacktype array MWV
weapontype array MYV
integer array MZV
boolean array M_V
real array M0V
boolean array M1V
unittype array M2V
boolean array M3V
unittype array M4V
unittype array M5V
integer array M6V
real array M7V
integer array M8V
integer array M9V
integer array PVV
integer array PEV
real array PXV
integer array POV
integer array PRV
boolean array PIV
string array PAV
string array PNV
damagetype PBV=null
attacktype PCV=null
integer PDV=0
integer PFV=0
boolean PGV=false
integer PHV
integer array PJV
unit array PKV
real array PLV
real array PMV
real array PPV
real array PQV
boolexpr PSV
boolexpr PTV
group PUV
rect PWV
integer PYV=0
integer PZV=0
integer array P_V
unit array P0V
unit array P1V
real array P2V
integer array P3V
integer array P4V
integer P5V=0
integer P6V=0
integer array P7V
unit array P8V
integer array P9V
integer array QVV
integer array QEV
integer array QXV
integer QOV=0
integer QRV=0
integer array QIV
unit array QAV
unit array QNV
real array QBV
integer array QCV
integer array QDV
integer QFV=0
integer QGV=0
integer array QHV
unit array QJV
integer array QKV
integer array QLV
integer array QMV
integer array QPV
integer QQV=0
integer QSV=0
integer array QTV
unit array QUV
unit array QWV
real array QYV
integer array QZV
integer array Q_V
integer Q0V=0
integer Q1V=0
integer array Q2V
unit array Q3V
integer array Q4V
integer array Q5V
integer array Q6V
integer array Q7V
integer Q8V=0
integer Q9V=0
integer array SVV
unit array SEV
unit array SXV
real array SOV
integer array SRV
integer array SIV
integer array SAV
integer array SNV
integer SBV=0
integer SCV=0
integer array SDV
unit array SFV
effect array SGV
real array SHV
integer array SJV
integer array SKV
integer SLV=0
integer SMV=0
integer array SPV
unit array SQV
unit array SSV
unit array STV
integer array SUV
integer array SWV
integer array SYV
boolean array SZV
integer array S_V
boolean array S0V
integer array S1V
boolean array S2V
integer array S3V
real array S4V
integer array S5V
real array S6V
integer array S7V
real array S8V
integer array S9V
real array TVV
boolean array TEV
integer array TXV
timer array TOV
integer array TRV
integer array TIV
integer TAV
integer TNV=0
integer TBV=0
integer array TCV
unit array TDV
integer TFV=0
integer TGV=0
integer array THV
unit array TJV
real array TKV
real array TLV
real array TMV
real array TPV
real array TQV
real array TSV
real array TTV
real array TUV
effect array TWV
integer TYV=0
integer TZV=0
integer array T_V
unit array T0V
integer array T1V
effect array T2V
integer T3V=0
integer T4V=0
integer array T5V
unit array T6V
effect array T7V
integer T8V=0
integer T9V=0
integer array UVV
unit array UEV
real array UXV
real array UOV
real array URV
integer UIV=0
integer UAV=0
integer array UNV
unit array UBV
unit array UCV
real array UDV
integer UFV=0
integer UGV=0
integer array UHV
unit array UJV
integer UKV=0
integer ULV=0
integer array UMV
unit array UPV
unit array UQV
integer array USV
integer UTV=0
integer UUV=0
integer array UWV
unit array UYV
unit array UZV
real array U_V
real array U0V
integer U1V=0
integer U2V=0
integer array U3V
unit array U4V
unit array U5V
effect array U6V
integer array U7V
integer U8V=0
integer U9V=0
integer array WVV
timer WEV=CreateTimer()
integer WXV=0
unit array WOV
real array WRV
real array WIV
integer WAV=0
integer WNV=0
integer array WBV
unit array WCV
unit array WDV
effect array WFV
lightning array WGV
real array WHV
real array WJV
real array WKV
real array WLV
real array WMV
real array WPV
real array WQV
real array WSV
integer array WTV
timer WUV=CreateTimer()
integer WWV=0
boolean array WYV
boolean array WZV
integer W_V=0
integer W0V=0
integer array W1V
unit array W2V
effect array W3V
lightning array W4V
real array W5V
real array W6V
real array W7V
real array W8V
real array W9V
real array YVV
real array YEV
real array YXV
timer YOV=CreateTimer()
integer YRV=0
boolean array YIV
boolean array YAV
integer YNV=0
integer YBV=0
integer array YCV
real array YDV
real array YFV
real array YGV
real array YHV
unit array YJV
unit array YKV
effect array YLV
lightning array YMV
timer YPV=CreateTimer()
integer YQV=0
boolean array YSV
boolean array YTV
real array YUV
real array YWV
integer array YYV
integer YZV=0
integer Y_V=0
integer array Y0V
unit array Y1V
unit array Y2V
player array Y3V
lightning array Y4V
integer array Y5V
real array Y6V
integer array Y7V
real array Y8V
integer array Y9V
real array ZVV
integer array ZEV
real array ZXV
integer array ZOV
unit array ZRV
unit array ZIV
real array ZAV
real array ZNV
real array ZBV
real array ZCV
real array ZDV
real array ZFV
real array ZGV
real array ZHV
real array ZJV
real array ZKV
real array ZLV
effect array ZMV
effect array ZPV
integer array ZQV
real array ZSV
real array ZTV
integer ZUV=0
integer ZWV=0
integer array ZYV
unit array ZZV
unit array Z_V
player array Z0V
lightning array Z1V
integer array Z2V
real array Z3V
integer array Z4V
real array Z5V
integer array Z6V
real array Z7V
integer array Z8V
real array Z9V
integer array VVE
unit array VEE
unit array VXE
real array VOE
real array VRE
real array VIE
real array VAE
real array VNE
real array VBE
real array VCE
real array VDE
real array VFE
real array VGE
real array VHE
effect array VJE
effect array VKE
integer array VLE
real array VME
real array VPE
integer VQE=0
integer VSE=0
integer array VTE
unit array VUE
unit array VWE
player array VYE
lightning array VZE
integer array V_E
real array V0E
integer array V1E
real array V2E
integer array V3E
real array V4E
integer array V5E
real array V6E
integer array V7E
unit array V8E
unit array V9E
real array EVE
real array EEE
real array EXE
real array EOE
real array ERE
real array EIE
real array EAE
real array ENE
real array EBE
real array ECE
real array EDE
effect array EFE
effect array EGE
integer array EHE
real array EJE
real array EKE
integer ELE=0
integer EME=0
integer array EPE
unit array EQE
unit array ESE
integer array ETE
integer array EUE
real array EWE
group array EYE
integer EZE=0
integer E_E=0
integer array E0E
unit array E1E
real array E2E
real array E3E
integer array E4E
effect array E5E
integer E6E=0
integer E7E=0
integer array E8E
unit array E9E
unit array XVE
unit array XEE
real array XXE
timer array XOE
effect array XRE
boolean array XIE
integer XAE=0
integer XNE=0
integer array XBE
real array XCE
real array XDE
real array XFE
integer array XGE
integer array XHE
integer array XJE
unit array XKE
unit array XLE
integer array XME
timer array XPE
integer XQE=0
integer XSE=0
integer array XTE
unit array XUE
integer array XWE
integer XYE=0
integer XZE=0
integer array X_E
unit array X0E
real array X1E
real array X2E
real array X3E
real array X4E
real array X5E
real array X6E
real array X7E
real array X8E
real array X9E
real array OVE
real array OEE
real array OXE
real array OOE
real array ORE
effect array OIE
effect array OAE
effect array ONE
effect array OBE
effect array OCE
effect array ODE
effect array OFE
real array OGE
integer OHE=0
integer OJE=0
integer array OKE
unit array OLE
unit array OME
effect array OPE
real array OQE
integer OSE=0
integer OTE=0
integer array OUE
real array OWE
unit array OYE
integer array OZE
integer O_E=0
integer O0E=0
integer array O1E
unit array O2E
unit array O3E
real array O4E
real array O5E
integer O6E=0
integer O7E=0
integer array O8E
unit array O9E
unit array RVE
integer array REE
effect array RXE
integer ROE=0
integer RRE=0
integer array RIE
unit array RAE
unit array RNE
effect array RBE
effect array RCE
integer RDE=0
integer RFE=0
integer array RGE
unit array RHE
integer RJE=0
integer RKE=0
integer array RLE
integer array RME
unit array RPE
effect array RQE
integer RSE=0
integer RTE=0
integer array RUE
unit array RWE
integer array RYE
integer RZE=0
integer R_E=0
integer array R0E
unit array R1E
real array R2E
real array R3E
integer array R4E
real array R5E
integer R6E=0
integer R7E=0
integer array R8E
unit array R9E
integer array IVE
integer IEE=0
integer IXE=0
integer array IOE
unit array IRE
integer IIE=0
integer IAE=0
integer array INE
unit array IBE
integer array ICE
integer IDE=0
integer IFE=0
integer array IGE
unit array IHE
integer array IJE
integer IKE=0
integer ILE=0
integer array IME
unit array IPE
unit array IQE
real array ISE
integer ITE=0
integer IUE=0
integer array IWE
unit array IYE
unit array IZE
real array I_E
real array I0E
integer I1E=0
integer I2E=0
integer array I3E
unit array I4E
unit array I5E
integer array I6E
integer I7E=0
integer I8E=0
integer array I9E
real array AVE
real array AEE
unit array AXE
integer AOE=0
integer ARE=0
integer array AIE
unit array AAE
timerdialog array ANE
integer ABE=0
integer ACE=0
integer array ADE
unit array AFE
integer array AGE
real array AHE
real array AJE
real array AKE
real array ALE
real array AME
effect array APE
integer AQE
integer ASE
integer ATE
integer AUE
integer AWE
integer AWEQQ
integer AWEQ1
integer AWEQ11
integer AWEQ2
integer AWEQ3
integer AWEQ4
integer AWEQ5
integer AWEQ6
integer AWEQ7
integer AWEQ8
integer AWEQ9
integer AWEQ99
integer AWEQ999
integer AWEQ9999
integer AWEQ99991234
integer array AYE
integer array AZE
//timer array A_E
integer array A0E
timer array A1E
boolexpr array A2E
unit array A3E
unit array A4E
real array A5E
real array A6E
integer array A7E
integer array A8E
integer array A9E
integer array NVE
integer array NEE
integer array NXE
integer array NOE
integer array NRE
integer array NIE
trigger array NAE
trigger array NNE
integer array NBE
trigger array NCE
trigger NDE
trigger NFE
trigger NGE
trigger NHE
trigger NJE
trigger NKE
trigger NLE
trigger NME
trigger NPE
trigger NQE
trigger NSE
trigger NTE
trigger NUE
trigger NWE
trigger NYE
trigger NZE
trigger N_E
trigger N0E
trigger N1E
trigger N2E
trigger N3E
trigger N4E
trigger N5E
trigger N6E
trigger N7E
trigger N8E
trigger N9E
trigger BVE
trigger BEE
trigger BXE
trigger BOE
trigger BRE
trigger BIE
trigger BAE
trigger BNE
trigger BBE
trigger BCE
trigger BDE
trigger BFE
trigger BGE
trigger array BHE
trigger array BJE
trigger array BKE
trigger array BLE
trigger array BME
trigger array BPE
trigger array BQE
real BSE
trigger array BTE
real BUE
real BWE
unit BYE
destructable BZE
integer B_E
trigger B0E
boolexpr B1E
group B2E
integer B3E
boolean B4E
integer B5E
timer B6E=null
real B8E=.0
real B9E=.0
group CVE=null
force CEE=null
boolexpr CXE=null
endglobals
native UnitAlive takes unit whichUnit returns boolean
function CRE takes real CIE returns nothing
local real CAE
local real st=TimerGetElapsed(B6E)
if st<=0 then
set B6E=CreateTimer()
call TimerStart(B6E,1000000,false,null)
endif
if(CIE>0)then
loop
set CAE=CIE-TimerGetElapsed(B6E)+st
exitwhen CAE<=0
if(CAE>bj_POLLED_WAIT_SKIP_THRESHOLD)then
call TriggerSleepAction(.1*CAE)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction
function CNE takes location CBE,real CCE,real CDE returns location
return Location(GetLocationX(CBE)+CCE*Cos(CDE*bj_DEGTORAD),GetLocationY(CBE)+CCE*Sin(CDE*bj_DEGTORAD))
endfunction
function CFE takes nothing returns boolean
local real dx=GetDestructableX(GetFilterDestructable())-B8E
local real dy=GetDestructableY(GetFilterDestructable())-B9E
return(dx*dx+dy*dy<=bj_enumDestructableRadius)
endfunction
function CGE takes real CHE,location CJE,code CKE returns nothing
local rect r
if(CHE>=0)then
set B8E=GetLocationX(CJE)
set B9E=GetLocationY(CJE)
set bj_enumDestructableRadius=CHE*CHE
set r=Rect(B8E-CHE,B9E-CHE,B8E+CHE,B9E+CHE)
call EnumDestructablesInRect(r,filterEnumDestructablesInCircleBJ,CKE)
call RemoveRect(r)
set r=null
endif
endfunction
function CLE takes rect r,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRect(CVE,r,CME)
call DestroyBoolExpr(CME)
return CVE
endfunction
function CPE takes rect r returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRect(CVE,r,CXE)
return CVE
endfunction
function CQE takes real CHE,location CSE,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(CVE,CSE,CHE,CME)
return CVE
endfunction
function CTE takes real CHE,location CSE returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(CVE,CSE,CHE,CXE)
return CVE
endfunction
function CUE takes player CWE,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsOfPlayer(CVE,CWE,CME)
call DestroyBoolExpr(CME)
return CVE
endfunction
function CountingAliveUnitsOfComputer takes nothing returns boolean
return UnitAlive(GetFilterUnit())
endfunction
function CYE takes player CWE returns group
set CVE=CreateGroup()
call GroupEnumUnitsOfPlayer(CVE,CWE,Filter(function CountingAliveUnitsOfComputer))
return CVE
endfunction
function CZE takes player CWE returns force
set CEE=CreateForce()
call ForceAddPlayer(CEE,CWE)
return CEE
endfunction
function C_E takes mapcontrol C0E returns force
local integer C1E
local player C2E
set CEE=CreateForce()
set C1E=0
loop
set C2E=Player(C1E)
if GetPlayerController(C2E)==C0E then
call ForceAddPlayer(CEE,C2E)
endif
set C1E=C1E+1
exitwhen C1E==16
endloop
return CEE
endfunction
function C3E takes player CWE returns force
set CEE=CreateForce()
call ForceEnumAllies(CEE,CWE,CXE)
return CEE
endfunction
function C4E takes boolexpr CME returns force
set CEE=CreateForce()
call ForceEnumPlayers(CEE,CME)
call DestroyBoolExpr(CME)
return CEE
endfunction
function C5E takes integer C6E,group C7E returns group
set bj_randomSubGroupGroup=CreateGroup()
set bj_randomSubGroupWant=C6E
set bj_randomSubGroupTotal=CountUnitsInGroup(C7E)
if(bj_randomSubGroupWant<=0 or bj_randomSubGroupTotal<=0)then
return bj_randomSubGroupGroup
endif
set bj_randomSubGroupChance=I2R(bj_randomSubGroupWant)/I2R(bj_randomSubGroupTotal)
call ForGroup(C7E,function GetRandomSubGroupEnum)
return bj_randomSubGroupGroup
endfunction
function C8E takes player CWE,playercolor C9E,boolean DVE returns nothing
local group g
call SetPlayerColor(CWE,C9E)
if DVE then
set bj_setPlayerTargetColor=C9E
set g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,CWE,CXE)
call ForGroup(g,function SetPlayerColorBJEnum)
call DestroyGroup(g)
set g=null
endif
endfunction
function DEE takes itemtype DXE,integer DOE returns nothing
local group g
set bj_stockPickedItemType=DXE
set bj_stockPickedItemLevel=DOE
set g=CreateGroup()
call GroupEnumUnitsOfType(g,"marketplace",CXE)
call ForGroup(g,function UpdateEachStockBuildingEnum)
call DestroyGroup(g)
set g=null
endfunction
function DRE takes nothing returns nothing
local integer pickedItemId
local itemtype DIE
local integer DAE=0
local integer DNE=0
local integer DOE
set DOE=1
loop
if(bj_stockAllowedPermanent[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_PERMANENT
set DAE=DOE
endif
endif
if(bj_stockAllowedCharged[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_CHARGED
set DAE=DOE
endif
endif
if(bj_stockAllowedArtifact[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_ARTIFACT
set DAE=DOE
endif
endif
set DOE=DOE+1
exitwhen DOE>10
endloop
if(DNE==0)then
set DIE=null
return
endif
call DEE(DIE,DAE)
set DIE=null
endfunction
function DBE takes nothing returns nothing
call DRE()
call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INTERVAL,true,function DRE)
endfunction
function DDE takes nothing returns boolean
return true
endfunction
function DJE takes integer i returns real
if(i<8191)then
return ICV[i]
elseif(i<16382)then
return INV[i-8191]
else
return IBV[i-16382]
endif
endfunction
function DKE takes integer i,real v returns nothing
if(i<8191)then
set ICV[i]=v
elseif(i<16382)then
set INV[i-8191]=v
else
set IBV[i-16382]=v
endif
endfunction
function DLE takes integer i returns real
if(i<8191)then
return IGV[i]
elseif(i<16382)then
return IDV[i-8191]
else
return IFV[i-16382]
endif
endfunction
function DME takes integer i,real v returns nothing
if(i<8191)then
set IGV[i]=v
elseif(i<16382)then
set IDV[i-8191]=v
else
set IFV[i-16382]=v
endif
endfunction
function DPE takes integer i returns real
if(i<8191)then
return IKV[i]
elseif(i<16382)then
return IHV[i-8191]
else
return IJV[i-16382]
endif
endfunction
function DQE takes integer i,real v returns nothing
if(i<8191)then
set IKV[i]=v
elseif(i<16382)then
set IHV[i-8191]=v
else
set IJV[i-16382]=v
endif
endfunction
function DSE takes integer i returns boolean
if(i<8191)then
return IPV[i]
elseif(i<16382)then
return ILV[i-8191]
else
return IMV[i-16382]
endif
endfunction
function DTE takes integer i,boolean v returns nothing
if(i<8191)then
set IPV[i]=v
elseif(i<16382)then
set ILV[i-8191]=v
else
set IMV[i-16382]=v
endif
endfunction
function DUE takes integer i returns real
if(i<8191)then
return ITV[i]
elseif(i<16382)then
return IQV[i-8191]
else
return ISV[i-16382]
endif
endfunction
function DWE takes integer i,real v returns nothing
if(i<8191)then
set ITV[i]=v
elseif(i<16382)then
set IQV[i-8191]=v
else
set ISV[i-16382]=v
endif
endfunction
function DYE takes integer i returns boolean
if(i<8191)then
return IYV[i]
elseif(i<16382)then
return IUV[i-8191]
else
return IWV[i-16382]
endif
endfunction
function DZE takes integer i,boolean v returns nothing
if(i<8191)then
set IYV[i]=v
elseif(i<16382)then
set IUV[i-8191]=v
else
set IWV[i-16382]=v
endif
endfunction
function D_E takes nothing returns integer
local integer D0E=ABE
if(D0E!=0)then
set ABE=ADE[D0E]
else
set ACE=ACE+1
set D0E=ACE
endif
if(D0E>8190)then
return 0
endif
set AGE[D0E]=0
set ADE[D0E]=-1
return D0E
endfunction
function D1E takes nothing returns integer
local integer D0E=AOE
if(D0E!=0)then
set AOE=AIE[D0E]
else
set ARE=ARE+1
set D0E=ARE
endif
if(D0E>8190)then
return 0
endif
set AIE[D0E]=-1
return D0E
endfunction
function D2E takes integer D0E returns nothing
if D0E==null then
return
elseif(AIE[D0E]!=-1)then
return
endif
set AIE[D0E]=AOE
set AOE=D0E
endfunction
function D3E takes nothing returns integer
local integer D0E=I7E
if(D0E!=0)then
set I7E=I9E[D0E]
else
set I8E=I8E+1
set D0E=I8E
endif
if(D0E>8190)then
return 0
endif
set I9E[D0E]=-1
return D0E
endfunction
function D4E takes integer D0E returns nothing
if D0E==null then
return
elseif(I9E[D0E]!=-1)then
return
endif
set I9E[D0E]=I7E
set I7E=D0E
endfunction
function D5E takes nothing returns integer
local integer D0E=I1E
if(D0E!=0)then
set I1E=I3E[D0E]
else
set I2E=I2E+1
set D0E=I2E
endif
if(D0E>8190)then
return 0
endif
set I3E[D0E]=-1
return D0E
endfunction
function D6E takes integer D0E returns nothing
if D0E==null then
return
elseif(I3E[D0E]!=-1)then
return
endif
set I3E[D0E]=I1E
set I1E=D0E
endfunction
function D7E takes nothing returns integer
local integer D0E=ITE
if(D0E!=0)then
set ITE=IWE[D0E]
else
set IUE=IUE+1
set D0E=IUE
endif
if(D0E>8190)then
return 0
endif
set IWE[D0E]=-1
return D0E
endfunction
function D8E takes integer D0E returns nothing
if D0E==null then
return
elseif(IWE[D0E]!=-1)then
return
endif
set IWE[D0E]=ITE
set ITE=D0E
endfunction
function D9E takes nothing returns integer
local integer D0E=IKE
if(D0E!=0)then
set IKE=IME[D0E]
else
set ILE=ILE+1
set D0E=ILE
endif
if(D0E>8190)then
return 0
endif
set IME[D0E]=-1
return D0E
endfunction
function FVE takes integer D0E returns nothing
if D0E==null then
return
elseif(IME[D0E]!=-1)then
return
endif
set IME[D0E]=IKE
set IKE=D0E
endfunction
function FEE takes nothing returns integer
local integer D0E=IDE
if(D0E!=0)then
set IDE=IGE[D0E]
else
set IFE=IFE+1
set D0E=IFE
endif
if(D0E>8190)then
return 0
endif
set IGE[D0E]=-1
return D0E
endfunction
function FXE takes integer D0E returns nothing
if D0E==null then
return
elseif(IGE[D0E]!=-1)then
return
endif
set IGE[D0E]=IDE
set IDE=D0E
endfunction
function FOE takes nothing returns integer
local integer D0E=IIE
if(D0E!=0)then
set IIE=INE[D0E]
else
set IAE=IAE+1
set D0E=IAE
endif
if(D0E>8190)then
return 0
endif
set INE[D0E]=-1
return D0E
endfunction
function FRE takes integer D0E returns nothing
if D0E==null then
return
elseif(INE[D0E]!=-1)then
return
endif
set INE[D0E]=IIE
set IIE=D0E
endfunction
function FIE takes nothing returns integer
local integer D0E=IEE
if(D0E!=0)then
set IEE=IOE[D0E]
else
set IXE=IXE+1
set D0E=IXE
endif
if(D0E>8190)then
return 0
endif
set IOE[D0E]=-1
return D0E
endfunction
function FAE takes integer D0E returns nothing
if D0E==null then
return
elseif(IOE[D0E]!=-1)then
return
endif
set IOE[D0E]=IEE
set IEE=D0E
endfunction
function FNE takes nothing returns integer
local integer D0E=R6E
if(D0E!=0)then
set R6E=R8E[D0E]
else
set R7E=R7E+1
set D0E=R7E
endif
if(D0E>8190)then
return 0
endif
set R8E[D0E]=-1
return D0E
endfunction
function FBE takes integer D0E returns nothing
if D0E==null then
return
elseif(R8E[D0E]!=-1)then
return
endif
set R8E[D0E]=R6E
set R6E=D0E
endfunction
function FCE takes nothing returns integer
local integer D0E=RZE
if(D0E!=0)then
set RZE=R0E[D0E]
else
set R_E=R_E+1
set D0E=R_E
endif
if(D0E>8190)then
return 0
endif
set R0E[D0E]=-1
return D0E
endfunction
function FDE takes integer D0E returns nothing
if D0E==null then
return
elseif(R0E[D0E]!=-1)then
return
endif
set R0E[D0E]=RZE
set RZE=D0E
endfunction
function FFE takes nothing returns integer
local integer D0E=RSE
if(D0E!=0)then
set RSE=RUE[D0E]
else
set RTE=RTE+1
set D0E=RTE
endif
if(D0E>8190)then
return 0
endif
set RUE[D0E]=-1
return D0E
endfunction
function FGE takes integer D0E returns nothing
if D0E==null then
return
elseif(RUE[D0E]!=-1)then
return
endif
set RUE[D0E]=RSE
set RSE=D0E
endfunction
function FHE takes nothing returns integer
local integer D0E=RJE
if(D0E!=0)then
set RJE=RLE[D0E]
else
set RKE=RKE+1
set D0E=RKE
endif
if(D0E>8190)then
return 0
endif
set RLE[D0E]=-1
return D0E
endfunction
function FJE takes integer D0E returns nothing
if D0E==null then
return
elseif(RLE[D0E]!=-1)then
return
endif
set RLE[D0E]=RJE
set RJE=D0E
endfunction
function FKE takes nothing returns integer
local integer D0E=RDE
if(D0E!=0)then
set RDE=RGE[D0E]
else
set RFE=RFE+1
set D0E=RFE
endif
if(D0E>8190)then
return 0
endif
set RGE[D0E]=-1
return D0E
endfunction
function FLE takes integer D0E returns nothing
if D0E==null then
return
elseif(RGE[D0E]!=-1)then
return
endif
set RGE[D0E]=RDE
set RDE=D0E
endfunction
function FME takes nothing returns integer
local integer D0E=ROE
if(D0E!=0)then
set ROE=RIE[D0E]
else
set RRE=RRE+1
set D0E=RRE
endif
if(D0E>8190)then
return 0
endif
set RIE[D0E]=-1
return D0E
endfunction
function FPE takes integer D0E returns nothing
if D0E==null then
return
elseif(RIE[D0E]!=-1)then
return
endif
set RIE[D0E]=ROE
set ROE=D0E
endfunction
function FQE takes nothing returns integer
local integer D0E=O6E
if(D0E!=0)then
set O6E=O8E[D0E]
else
set O7E=O7E+1
set D0E=O7E
endif
if(D0E>8190)then
return 0
endif
set O8E[D0E]=-1
return D0E
endfunction
function FSE takes integer D0E returns nothing
if D0E==null then
return
elseif(O8E[D0E]!=-1)then
return
endif
set O8E[D0E]=O6E
set O6E=D0E
endfunction
function FTE takes nothing returns integer
local integer D0E=O_E
if(D0E!=0)then
set O_E=O1E[D0E]
else
set O0E=O0E+1
set D0E=O0E
endif
if(D0E>8190)then
return 0
endif
set O1E[D0E]=-1
return D0E
endfunction
function FUE takes integer D0E returns nothing
if D0E==null then
return
elseif(O1E[D0E]!=-1)then
return
endif
set O1E[D0E]=O_E
set O_E=D0E
endfunction
function FWE takes nothing returns integer
local integer D0E=OSE
if(D0E!=0)then
set OSE=OUE[D0E]
else
set OTE=OTE+1
set D0E=OTE
endif
if(D0E>8190)then
return 0
endif
set OUE[D0E]=-1
return D0E
endfunction
function FYE takes integer D0E returns nothing
if D0E==null then
return
elseif(OUE[D0E]!=-1)then
return
endif
set OUE[D0E]=OSE
set OSE=D0E
endfunction
function FZE takes nothing returns integer
local integer D0E=OHE
if(D0E!=0)then
set OHE=OKE[D0E]
else
set OJE=OJE+1
set D0E=OJE
endif
if(D0E>8190)then
return 0
endif
set OKE[D0E]=-1
return D0E
endfunction
function F_E takes integer D0E returns nothing
if D0E==null then
return
elseif(OKE[D0E]!=-1)then
return
endif
set OKE[D0E]=OHE
set OHE=D0E
endfunction
function F0E takes nothing returns integer
local integer D0E=XYE
if(D0E!=0)then
set XYE=X_E[D0E]
else
set XZE=XZE+1
set D0E=XZE
endif
if(D0E>8190)then
return 0
endif
set X_E[D0E]=-1
return D0E
endfunction
function F1E takes integer D0E returns nothing
if D0E==null then
return
elseif(X_E[D0E]!=-1)then
return
endif
set X_E[D0E]=XYE
set XYE=D0E
endfunction
function F2E takes nothing returns integer
local integer D0E=XQE
if(D0E!=0)then
set XQE=XTE[D0E]
else
set XSE=XSE+1
set D0E=XSE
endif
if(D0E>8190)then
return 0
endif
set XTE[D0E]=-1
return D0E
endfunction
function F3E takes integer D0E returns nothing
if D0E==null then
return
elseif(XTE[D0E]!=-1)then
return
endif
set XTE[D0E]=XQE
set XQE=D0E
endfunction
function F4E takes nothing returns integer
local integer D0E=XAE
if(D0E!=0)then
set XAE=XBE[D0E]
else
set XNE=XNE+1
set D0E=XNE
endif
if(D0E>8190)then
return 0
endif
set XBE[D0E]=-1
return D0E
endfunction
function F5E takes integer D0E returns nothing
if D0E==null then
return
elseif(XBE[D0E]!=-1)then
return
endif
set XBE[D0E]=XAE
set XAE=D0E
endfunction
function F6E takes nothing returns integer
local integer D0E=E6E
if(D0E!=0)then
set E6E=E8E[D0E]
else
set E7E=E7E+1
set D0E=E7E
endif
if(D0E>8190)then
return 0
endif
set E8E[D0E]=-1
return D0E
endfunction
function F7E takes integer D0E returns nothing
if D0E==null then
return
elseif(E8E[D0E]!=-1)then
return
endif
set E8E[D0E]=E6E
set E6E=D0E
endfunction
function F8E takes nothing returns integer
local integer D0E=EZE
if(D0E!=0)then
set EZE=E0E[D0E]
else
set E_E=E_E+1
set D0E=E_E
endif
if(D0E>8190)then
return 0
endif
set E0E[D0E]=-1
return D0E
endfunction
function F9E takes integer D0E returns nothing
if D0E==null then
return
elseif(E0E[D0E]!=-1)then
return
endif
set E0E[D0E]=EZE
set EZE=D0E
endfunction
function GVE takes nothing returns integer
local integer D0E=ELE
if(D0E!=0)then
set ELE=EPE[D0E]
else
set EME=EME+1
set D0E=EME
endif
if(D0E>8190)then
return 0
endif
set EPE[D0E]=-1
return D0E
endfunction
function GEE takes nothing returns integer
local integer D0E=VQE
if(D0E!=0)then
set VQE=VTE[D0E]
else
set VSE=VSE+1
set D0E=VSE
endif
if(D0E>4094)then
return 0
endif
set V_E[D0E]=(D0E-1)*2
set V1E[D0E]=(D0E-1)*2
set V3E[D0E]=(D0E-1)*2
set V5E[D0E]=(D0E-1)*2
set V7E[D0E]=(D0E-1)*2
set EKE[D0E]=.0
set VTE[D0E]=-1
return D0E
endfunction
function GXE takes integer D0E returns nothing
if D0E==null then
return
elseif(VTE[D0E]!=-1)then
return
endif
set VTE[D0E]=VQE
set VQE=D0E
endfunction
function GOE takes nothing returns integer
local integer D0E=ZUV
if(D0E!=0)then
set ZUV=ZYV[D0E]
else
set ZWV=ZWV+1
set D0E=ZWV
endif
if(D0E>4094)then
return 0
endif
set Z2V[D0E]=(D0E-1)*2
set Z4V[D0E]=(D0E-1)*2
set Z6V[D0E]=(D0E-1)*2
set Z8V[D0E]=(D0E-1)*2
set VVE[D0E]=(D0E-1)*2
set VPE[D0E]=.0
set ZYV[D0E]=-1
return D0E
endfunction
function GRE takes integer D0E returns nothing
if D0E==null then
return
elseif(ZYV[D0E]!=-1)then
return
endif
set ZYV[D0E]=ZUV
set ZUV=D0E
endfunction
function GIE takes nothing returns integer
local integer D0E=YZV
if(D0E!=0)then
set YZV=Y0V[D0E]
else
set Y_V=Y_V+1
set D0E=Y_V
endif
if(D0E>4094)then
return 0
endif
set Y5V[D0E]=(D0E-1)*2
set Y7V[D0E]=(D0E-1)*2
set Y9V[D0E]=(D0E-1)*2
set ZEV[D0E]=(D0E-1)*2
set ZOV[D0E]=(D0E-1)*2
set ZTV[D0E]=.0
set Y0V[D0E]=-1
return D0E
endfunction
function GAE takes integer D0E returns nothing
if D0E==null then
return
elseif(Y0V[D0E]!=-1)then
return
endif
set Y0V[D0E]=YZV
set YZV=D0E
endfunction
function GBE takes nothing returns integer
local integer D0E=RMV
if(D0E!=0)then
set RMV=RQV[D0E]
else
set RPV=RPV+1
set D0E=RPV
endif
if(D0E>8190)then
return 0
endif
set RQV[D0E]=-1
return D0E
endfunction
function GCE takes integer D0E returns nothing
if D0E==null then
return
elseif(RQV[D0E]!=-1)then
return
endif
set RQV[D0E]=RMV
set RMV=D0E
endfunction
function GDE takes nothing returns integer
local integer D0E=YNV
if(D0E!=0)then
set YNV=YCV[D0E]
else
set YBV=YBV+1
set D0E=YBV
endif
if(D0E>8190)then
return 0
endif
set YCV[D0E]=-1
return D0E
endfunction
function GFE takes integer D0E returns nothing
if D0E==null then
return
elseif(YCV[D0E]!=-1)then
return
endif
set YCV[D0E]=YNV
set YNV=D0E
endfunction
function GGE takes nothing returns integer
local integer D0E=W_V
if(D0E!=0)then
set W_V=W1V[D0E]
else
set W0V=W0V+1
set D0E=W0V
endif
if(D0E>8190)then
return 0
endif
set W1V[D0E]=-1
return D0E
endfunction
function GHE takes integer D0E returns nothing
if D0E==null then
return
elseif(W1V[D0E]!=-1)then
return
endif
set W1V[D0E]=W_V
set W_V=D0E
endfunction
function GJE takes nothing returns integer
local integer D0E=WAV
if(D0E!=0)then
set WAV=WBV[D0E]
else
set WNV=WNV+1
set D0E=WNV
endif
if(D0E>2729)then
return 0
endif
set WTV[D0E]=(D0E-1)*3
set WBV[D0E]=-1
return D0E
endfunction
function GKE takes integer D0E returns nothing
if D0E==null then
return
elseif(WBV[D0E]!=-1)then
return
endif
set WBV[D0E]=WAV
set WAV=D0E
endfunction
function GLE takes nothing returns integer
local integer D0E=U8V
if(D0E!=0)then
set U8V=WVV[D0E]
else
set U9V=U9V+1
set D0E=U9V
endif
if(D0E>8190)then
return 0
endif
set WVV[D0E]=-1
return D0E
endfunction
function GME takes integer D0E returns nothing
if D0E==null then
return
elseif(WVV[D0E]!=-1)then
return
endif
set WVV[D0E]=U8V
set U8V=D0E
endfunction
/*function GPE takes nothing returns integer
local integer D0E=U1V
if(D0E!=0)then
set U1V=U3V[D0E]
else
set U2V=U2V+1
set D0E=U2V
endif
if(D0E>8190)then
return 0
endif
set U3V[D0E]=-1
return D0E
endfunction*/
function GQE takes integer D0E returns nothing
if D0E==null then
return
elseif(U3V[D0E]!=-1)then
return
endif
set U3V[D0E]=U1V
set U1V=D0E
endfunction
function GSE takes nothing returns integer
local integer D0E=UTV
if(D0E!=0)then
set UTV=UWV[D0E]
else
set UUV=UUV+1
set D0E=UUV
endif
if(D0E>8190)then
return 0
endif
set UWV[D0E]=-1
return D0E
endfunction
function GTE takes integer D0E returns nothing
if D0E==null then
return
elseif(UWV[D0E]!=-1)then
return
endif
set UWV[D0E]=UTV
set UTV=D0E
endfunction
function GUE takes nothing returns integer
local integer D0E=UKV
if(D0E!=0)then
set UKV=UMV[D0E]
else
set ULV=ULV+1
set D0E=ULV
endif
if(D0E>8190)then
return 0
endif
set UMV[D0E]=-1
return D0E
endfunction
function GWE takes integer D0E returns nothing
if D0E==null then
return
elseif(UMV[D0E]!=-1)then
return
endif
set UMV[D0E]=UKV
set UKV=D0E
endfunction
function GYE takes nothing returns integer
local integer D0E=UFV
if(D0E!=0)then
set UFV=UHV[D0E]
else
set UGV=UGV+1
set D0E=UGV
endif
if(D0E>8190)then
return 0
endif
set UHV[D0E]=-1
return D0E
endfunction
function GZE takes integer D0E returns nothing
if D0E==null then
return
elseif(UHV[D0E]!=-1)then
return
endif
set UHV[D0E]=UFV
set UFV=D0E
endfunction
function G_E takes nothing returns integer
local integer D0E=UIV
if(D0E!=0)then
set UIV=UNV[D0E]
else
set UAV=UAV+1
set D0E=UAV
endif
if(D0E>8190)then
return 0
endif
set UNV[D0E]=-1
return D0E
endfunction
function G0E takes integer D0E returns nothing
if D0E==null then
return
elseif(UNV[D0E]!=-1)then
return
endif
set UNV[D0E]=UIV
set UIV=D0E
endfunction
function G1E takes nothing returns integer
local integer D0E=T8V
if(D0E!=0)then
set T8V=UVV[D0E]
else
set T9V=T9V+1
set D0E=T9V
endif
if(D0E>8190)then
return 0
endif
set UVV[D0E]=-1
return D0E
endfunction
function G2E takes integer D0E returns nothing
if D0E==null then
return
elseif(UVV[D0E]!=-1)then
return
endif
set UVV[D0E]=T8V
set T8V=D0E
endfunction
function G3E takes nothing returns integer
local integer D0E=T3V
if(D0E!=0)then
set T3V=T5V[D0E]
else
set T4V=T4V+1
set D0E=T4V
endif
if(D0E>8190)then
return 0
endif
set T5V[D0E]=-1
return D0E
endfunction
function G4E takes integer D0E returns nothing
if D0E==null then
return
elseif(T5V[D0E]!=-1)then
return
endif
set T5V[D0E]=T3V
set T3V=D0E
endfunction
function G5E takes nothing returns integer
local integer D0E=TYV
if(D0E!=0)then
set TYV=T_V[D0E]
else
set TZV=TZV+1
set D0E=TZV
endif
if(D0E>8190)then
return 0
endif
set T_V[D0E]=-1
return D0E
endfunction
function G6E takes integer D0E returns nothing
if D0E==null then
return
elseif(T_V[D0E]!=-1)then
return
endif
set T_V[D0E]=TYV
set TYV=D0E
endfunction
function G7E takes nothing returns integer
local integer D0E=TFV
if(D0E!=0)then
set TFV=THV[D0E]
else
set TGV=TGV+1
set D0E=TGV
endif
if(D0E>8190)then
return 0
endif
set THV[D0E]=-1
return D0E
endfunction
function G8E takes integer D0E returns nothing
if D0E==null then
return
elseif(THV[D0E]!=-1)then
return
endif
set THV[D0E]=TFV
set TFV=D0E
endfunction
function G9E takes nothing returns integer
local integer D0E=TNV
if(D0E!=0)then
set TNV=TCV[D0E]
else
set TBV=TBV+1
set D0E=TBV
endif
if(D0E>8190)then
return 0
endif
set TCV[D0E]=-1
return D0E
endfunction
function HVE takes integer D0E returns nothing
if D0E==null then
return
elseif(TCV[D0E]!=-1)then
return
endif
set TCV[D0E]=TNV
set TNV=D0E
endfunction
function HEE takes nothing returns integer
local integer D0E=SLV
if(D0E!=0)then
set SLV=SPV[D0E]
else
set SMV=SMV+1
set D0E=SMV
endif
if(D0E>67)then
return 0
endif
set SUV[D0E]=(D0E-1)*120
set SYV[D0E]=(D0E-1)*120
set S_V[D0E]=(D0E-1)*120
set S1V[D0E]=(D0E-1)*120
set S3V[D0E]=(D0E-1)*120
set S5V[D0E]=(D0E-1)*120
set S7V[D0E]=(D0E-1)*120
set S9V[D0E]=(D0E-1)*120
set TXV[D0E]=(D0E-1)*120
set SPV[D0E]=-1
return D0E
endfunction
function HXE takes integer D0E returns nothing
if D0E==null then
return
elseif(SPV[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(BFE)
set SPV[D0E]=SLV
set SLV=D0E
endfunction
function HOE takes integer D0E returns nothing
set SJV[SKV[D0E]]=SJV[D0E]
set SKV[SJV[D0E]]=SKV[D0E]
endfunction
function HRE takes nothing returns integer
local integer D0E=SBV
if(D0E!=0)then
set SBV=SDV[D0E]
else
set SCV=SCV+1
set D0E=SCV
endif
if(D0E>8190)then
return 0
endif
set SFV[D0E]=null
set SGV[D0E]=null
set SHV[D0E]=.0
set SDV[D0E]=-1
return D0E
endfunction
function HIE takes integer D0E returns nothing
if D0E==null then
return
elseif(SDV[D0E]!=-1)then
return
endif
set SDV[D0E]=SBV
set SBV=D0E
endfunction
function HAE takes integer D0E returns nothing
set SAV[SNV[D0E]]=SAV[D0E]
set SNV[SAV[D0E]]=SNV[D0E]
endfunction
function HNE takes nothing returns integer
local integer D0E=Q8V
if(D0E!=0)then
set Q8V=SVV[D0E]
else
set Q9V=Q9V+1
set D0E=Q9V
endif
if(D0E>8190)then
return 0
endif
set SEV[D0E]=null
set SXV[D0E]=null
set SOV[D0E]=.0
set SRV[D0E]=0
set SIV[D0E]=0
set SVV[D0E]=-1
return D0E
endfunction
function HBE takes integer D0E returns nothing
if D0E==null then
return
elseif(SVV[D0E]!=-1)then
return
endif
set SVV[D0E]=Q8V
set Q8V=D0E
endfunction
function HCE takes integer D0E returns nothing
set Q6V[Q7V[D0E]]=Q6V[D0E]
set Q7V[Q6V[D0E]]=Q7V[D0E]
endfunction
function HDE takes nothing returns integer
local integer D0E=Q0V
if(D0E!=0)then
set Q0V=Q2V[D0E]
else
set Q1V=Q1V+1
set D0E=Q1V
endif
if(D0E>8190)then
return 0
endif
set Q3V[D0E]=null
set Q4V[D0E]=0
set Q5V[D0E]=0
set Q2V[D0E]=-1
return D0E
endfunction
function HFE takes integer D0E returns nothing
if D0E==null then
return
elseif(Q2V[D0E]!=-1)then
return
endif
set Q2V[D0E]=Q0V
set Q0V=D0E
endfunction
function HGE takes integer D0E returns nothing
set QZV[Q_V[D0E]]=QZV[D0E]
set Q_V[QZV[D0E]]=Q_V[D0E]
endfunction
function HHE takes nothing returns integer
local integer D0E=QQV
if(D0E!=0)then
set QQV=QTV[D0E]
else
set QSV=QSV+1
set D0E=QSV
endif
if(D0E>8190)then
return 0
endif
set QUV[D0E]=null
set QWV[D0E]=null
set QYV[D0E]=.0
set QTV[D0E]=-1
return D0E
endfunction
function HJE takes integer D0E returns nothing
if D0E==null then
return
elseif(QTV[D0E]!=-1)then
return
endif
set QTV[D0E]=QQV
set QQV=D0E
endfunction
function HKE takes integer D0E returns nothing
set QMV[QPV[D0E]]=QMV[D0E]
set QPV[QMV[D0E]]=QPV[D0E]
endfunction
function HLE takes nothing returns integer
local integer D0E=QFV
if(D0E!=0)then
set QFV=QHV[D0E]
else
set QGV=QGV+1
set D0E=QGV
endif
if(D0E>8190)then
return 0
endif
set QJV[D0E]=null
set QKV[D0E]=0
set QLV[D0E]=0
set QHV[D0E]=-1
return D0E
endfunction
function HME takes integer D0E returns nothing
if D0E==null then
return
elseif(QHV[D0E]!=-1)then
return
endif
set QHV[D0E]=QFV
set QFV=D0E
endfunction
function HPE takes integer D0E returns nothing
set QCV[QDV[D0E]]=QCV[D0E]
set QDV[QCV[D0E]]=QDV[D0E]
endfunction
function HQE takes nothing returns integer
local integer D0E=QOV
if(D0E!=0)then
set QOV=QIV[D0E]
else
set QRV=QRV+1
set D0E=QRV
endif
if(D0E>8190)then
return 0
endif
set QAV[D0E]=null
set QNV[D0E]=null
set QBV[D0E]=.0
set QIV[D0E]=-1
return D0E
endfunction
function HSE takes integer D0E returns nothing
if D0E==null then
return
elseif(QIV[D0E]!=-1)then
return
endif
set QIV[D0E]=QOV
set QOV=D0E
endfunction
function HTE takes integer D0E returns nothing
set QEV[QXV[D0E]]=QEV[D0E]
set QXV[QEV[D0E]]=QXV[D0E]
endfunction
function HUE takes nothing returns integer
local integer D0E=P5V
if(D0E!=0)then
set P5V=P7V[D0E]
else
set P6V=P6V+1
set D0E=P6V
endif
if(D0E>8190)then
return 0
endif
set P8V[D0E]=null
set P9V[D0E]=0
set QVV[D0E]=0
set P7V[D0E]=-1
return D0E
endfunction
function HWE takes integer D0E returns nothing
if D0E==null then
return
elseif(P7V[D0E]!=-1)then
return
endif
set P7V[D0E]=P5V
set P5V=D0E
endfunction
function HYE takes integer D0E returns nothing
set P3V[P4V[D0E]]=P3V[D0E]
set P4V[P3V[D0E]]=P4V[D0E]
endfunction
function HZE takes nothing returns integer
local integer D0E=PYV
if(D0E!=0)then
set PYV=P_V[D0E]
else
set PZV=PZV+1
set D0E=PZV
endif
if(D0E>8190)then
return 0
endif
set P0V[D0E]=null
set P1V[D0E]=null
set P2V[D0E]=.0
set P_V[D0E]=-1
return D0E
endfunction
function H_E takes integer D0E returns nothing
if D0E==null then
return
elseif(P_V[D0E]!=-1)then
return
endif
set P_V[D0E]=PYV
set PYV=D0E
endfunction
function H0E takes nothing returns integer
local integer D0E=MDV
if(D0E!=0)then
set MDV=MGV[D0E]
else
set MFV=MFV+1
set D0E=MFV
endif
if(D0E>2729)then
return 0
endif
set M6V[D0E]=(D0E-1)*3
set M8V[D0E]=(D0E-1)*3
set PEV[D0E]=(D0E-1)*3
set POV[D0E]=(D0E-1)*3
set MHV[D0E]=false
set MJV[D0E]=false
set MKV[D0E]=true
set MLV[D0E]=true
set MMV[D0E]=true
set MPV[D0E]=false
set MQV[D0E]=false
set MSV[D0E]=false
set MTV[D0E]=false
set MUV[D0E]=DAMAGE_TYPE_UNIVERSAL
set MWV[D0E]=ATTACK_TYPE_NORMAL
set MYV[D0E]=WEAPON_TYPE_WHOKNOWS
set MZV[D0E]=0
set M_V[D0E]=false
set M0V[D0E]=1.
set M1V[D0E]=false
set M2V[D0E]=null
set M3V[D0E]=false
set M4V[D0E]=null
set M9V[D0E]=0
set PRV[D0E]=0
set PIV[D0E]=false
set MGV[D0E]=-1
return D0E
endfunction
function H1E takes integer D0E returns nothing
set MBV[MCV[D0E]]=MBV[D0E]
set MCV[MBV[D0E]]=MCV[D0E]
endfunction
function H2E takes nothing returns integer
local integer D0E=L6V
if(D0E!=0)then
set L6V=L8V[D0E]
else
set L7V=L7V+1
set D0E=L7V
endif
if(D0E>8190)then
return 0
endif
set L9V[D0E]=null
set MVV[D0E]=null
set MEV[D0E]=null
set MXV[D0E]=.0
set MOV[D0E]=.0
set MRV[D0E]=.0
set MIV[D0E]=.0
set MAV[D0E]=.0
set MNV[D0E]=0
set L8V[D0E]=-1
return D0E
endfunction
function H3E takes integer D0E returns nothing
if D0E==null then
return
elseif(L8V[D0E]!=-1)then
return
endif
set L8V[D0E]=L6V
set L6V=D0E
endfunction
function H4E takes integer D0E returns nothing
set L4V[L5V[D0E]]=L4V[D0E]
set L5V[L4V[D0E]]=L5V[D0E]
endfunction
function H5E takes nothing returns integer
local integer D0E=L_V
if(D0E!=0)then
set L_V=L1V[D0E]
else
set L0V=L0V+1
set D0E=L0V
endif
if(D0E>8190)then
return 0
endif
set L2V[D0E]=null
set L3V[D0E]=.0
set L1V[D0E]=-1
return D0E
endfunction
function H6E takes integer D0E returns nothing
if D0E==null then
return
elseif(L1V[D0E]!=-1)then
return
endif
set L1V[D0E]=L_V
set L_V=D0E
endfunction
function H7E takes nothing returns integer
local integer D0E=LQV
if(D0E!=0)then
set LQV=LTV[D0E]
else
set LSV=LSV+1
set D0E=LSV
endif
if(D0E>8190)then
return 0
endif
set LTV[D0E]=-1
return D0E
endfunction
function H8E takes integer D0E returns nothing
if D0E==null then
return
elseif(LTV[D0E]!=-1)then
return
endif
set LTV[D0E]=LQV
set LQV=D0E
endfunction
function H9E takes nothing returns integer
local integer D0E=LJV
if(D0E!=0)then
set LJV=LLV[D0E]
else
set LKV=LKV+1
set D0E=LKV
endif
if(D0E>8190)then
return 0
endif
set LLV[D0E]=-1
return D0E
endfunction
function JVE takes integer D0E returns nothing
if D0E==null then
return
elseif(LLV[D0E]!=-1)then
return
endif
set LLV[D0E]=LJV
set LJV=D0E
endfunction
function JEE takes nothing returns integer
local integer D0E=LRV
if(D0E!=0)then
set LRV=LAV[D0E]
else
set LIV=LIV+1
set D0E=LIV
endif
if(D0E>8190)then
return 0
endif
set LAV[D0E]=-1
return D0E
endfunction
function JXE takes integer D0E returns nothing
if D0E==null then
return
elseif(LAV[D0E]!=-1)then
return
endif
set LAV[D0E]=LRV
set LRV=D0E
endfunction
function JOE takes nothing returns integer
local integer D0E=K4V
if(D0E!=0)then
set K4V=K6V[D0E]
else
set K5V=K5V+1
set D0E=K5V
endif
if(D0E>8190)then
return 0
endif
set K6V[D0E]=-1
return D0E
endfunction
function JRE takes integer D0E returns nothing
if D0E==null then
return
elseif(K6V[D0E]!=-1)then
return
endif
set K6V[D0E]=K4V
set K4V=D0E
endfunction
function JIE takes nothing returns integer
local integer D0E=K_V
if(D0E!=0)then
set K_V=K1V[D0E]
else
set K0V=K0V+1
set D0E=K0V
endif
if(D0E>8190)then
return 0
endif
set K2V[D0E]=.0
set K3V[D0E]=.0
set K1V[D0E]=-1
return D0E
endfunction
function JAE takes integer D0E returns nothing
if D0E==null then
return
elseif(K1V[D0E]!=-1)then
return
endif
set K1V[D0E]=K_V
set K_V=D0E
endfunction
function JNE takes nothing returns integer
local integer D0E=RYV
if(D0E!=0)then
set RYV=R_V[D0E]
else
set RZV=RZV+1
set D0E=RZV
endif
if(D0E>8190)then
return 0
endif
set R0V[D0E]=null
set R1V[D0E]=.0
set R2V[D0E]=.0
set R3V[D0E]=.0
set R4V[D0E]=.0
set R5V[D0E]=.0
set R6V[D0E]=0
set R7V[D0E]=null
set R8V[D0E]=false
set R9V[D0E]=false
set IVV[D0E]=false
set IEV[D0E]=false
set R_V[D0E]=-1
return D0E
endfunction
function JBE takes nothing returns integer
local integer D0E=J6V
if(D0E!=0)then
set J6V=J8V[D0E]
else
set J7V=J7V+1
set D0E=J7V
endif
if(D0E>8190)then
return 0
endif
set KXV[D0E]=.0
set KOV[D0E]=.0
set KIV[D0E]=1.
set J8V[D0E]=-1
return D0E
endfunction
function JCE takes integer D0E returns nothing
if D0E==null then
return
elseif(J8V[D0E]!=-1)then
return
endif
set J8V[D0E]=J6V
set J6V=D0E
endfunction
function JDE takes integer D0E,integer JFE returns boolean
set B3E=D0E
set B_E=JFE
call TriggerEvaluate(N9E)
return B4E
endfunction
function JGE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(BVE)
endfunction
function JHE takes nothing returns integer
local integer D0E=JQV
if(D0E!=0)then
set JQV=JTV[D0E]
else
set JSV=JSV+1
set D0E=JSV
endif
if(D0E>8190)then
return 0
endif
set JUV[D0E]=0
set JTV[D0E]=-1
return D0E
endfunction
function JJE takes integer D0E returns nothing
if D0E==null then
return
elseif(JTV[D0E]!=-1)then
return
endif
set JTV[D0E]=JQV
set JQV=D0E
endfunction
function JKE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N3E)
return B5E
endfunction
function JLE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N4E)
return B5E
endfunction
function JME takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N5E)
return B5E
endfunction
function JPE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N6E)
return B5E
endfunction
function JQE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(N7E)
endfunction
function JSE takes integer D0E returns nothing
set JHV[JJV[D0E]]=JHV[D0E]
set JJV[JHV[D0E]]=JJV[D0E]
endfunction
function JTE takes nothing returns integer
local integer D0E=GPV
if(D0E!=0)then
set GPV=GSV[D0E]
else
set GQV=GQV+1
set D0E=GQV
endif
if(D0E>8190)then
return 0
endif
set GTV[D0E]=0
set GUV[D0E]=0
set GWV[D0E]=0
set GYV[D0E]=false
set GZV[D0E]=null
set G_V[D0E]=null
set G0V[D0E]=64.
set G1V[D0E]=64.
set G2V[D0E]=.0
set G3V[D0E]=.0
set G4V[D0E]=.0
set G5V[D0E]=1.
set G6V[D0E]=2.
set G7V[D0E]=false
set G8V[D0E]=false
set G9V[D0E]=false
set HVV[D0E]=false
set HEV[D0E]=false
set HXV[D0E]=false
set HOV[D0E]=false
set HRV[D0E]=0
set HIV[D0E]=0
set HAV[D0E]=0
set HNV[D0E]=0
set HBV[D0E]=0
set HCV[D0E]=0
set HDV[D0E]=0
set HFV[D0E]=null
set HGV[D0E]=.0
set HHV[D0E]=.0
set HJV[D0E]=.0
set HKV[D0E]=.0
set HLV[D0E]=.0
set HMV[D0E]=.0
set HPV[D0E]=.0
set HQV[D0E]=.0
set HSV[D0E]=.0
set HTV[D0E]=.0
set HUV[D0E]=.0
set HWV[D0E]=.0
set HYV[D0E]=.0
set HZV[D0E]=null
set H_V[D0E]=null
set H0V[D0E]=""
set H1V[D0E]=false
set H2V[D0E]=false
set H3V[D0E]=true
set H4V[D0E]=.0
set H5V[D0E]=.0
set H6V[D0E]=.0
set H7V[D0E]=.0
set H8V[D0E]=.0
set H9V[D0E]=.0
set JAV[D0E]=null
set JNV[D0E]=.0
set JBV[D0E]=false
set JCV[D0E]=.0
set JDV[D0E]=1.
set JFV[D0E]=false
set JGV[D0E]=0
set GSV[D0E]=-1
return D0E
endfunction
function JUE takes integer D0E returns nothing
if D0E==null then
return
elseif(GSV[D0E]!=-1)then
return
endif
set GSV[D0E]=GPV
set GPV=D0E
endfunction
function JWE takes integer D0E returns nothing
set GLV[GMV[D0E]]=GLV[D0E]
set GMV[GLV[D0E]]=GMV[D0E]
endfunction
function JYE takes nothing returns integer
local integer D0E=GFV
if(D0E!=0)then
set GFV=GHV[D0E]
else
set GGV=GGV+1
set D0E=GGV
endif
if(D0E>8190)then
return 0
endif
set GJV[D0E]=null
set GKV[D0E]=.0
set GHV[D0E]=-1
return D0E
endfunction
function JZE takes integer D0E returns nothing
if D0E==null then
return
elseif(GHV[D0E]!=-1)then
return
endif
set GHV[D0E]=GFV
set GFV=D0E
endfunction
function J_E takes nothing returns integer
local integer D0E=IXV
if(D0E!=0)then
if(D0E<8191)then
set IXV=IRV[D0E]
elseif(D0E<16382)then
set IXV=IIV[D0E-8191]
else
set IXV=IAV[D0E-16382]
endif
else
set IOV=IOV+1
set D0E=IOV
endif
if(D0E>20000)then
return 0
endif
if(D0E<8191)then
set ICV[D0E]=.0
set IGV[D0E]=.0
set IKV[D0E]=.0
set IPV[D0E]=true
set ITV[D0E]=.0
set IYV[D0E]=false
elseif(D0E<16382)then
set INV[D0E-8191]=.0
set IDV[D0E-8191]=.0
set IHV[D0E-8191]=.0
set ILV[D0E-8191]=true
set IQV[D0E-8191]=.0
set IUV[D0E-8191]=false
else
set IBV[D0E-16382]=.0
set IFV[D0E-16382]=.0
set IJV[D0E-16382]=.0
set IMV[D0E-16382]=true
set ISV[D0E-16382]=.0
set IWV[D0E-16382]=false
endif
if(D0E<8191)then
set IRV[D0E]=-1
elseif(D0E<16382)then
set IIV[D0E-8191]=-1
else
set IAV[D0E-16382]=-1
endif
return D0E
endfunction
function J0E takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FRV[FXV[D0E]])
endfunction
function J1E takes integer D0E,unit J2E returns nothing
set B3E=D0E
set BYE=J2E
call TriggerEvaluate(FIV[FXV[D0E]])
endfunction
function J3E takes integer D0E,destructable J4E returns nothing
set B3E=D0E
set BZE=J4E
call TriggerEvaluate(FAV[FXV[D0E]])
endfunction
function J5E takes integer D0E,real x,real y returns nothing
set B3E=D0E
set BUE=x
set BWE=y
call TriggerEvaluate(FNV[FXV[D0E]])
endfunction
function J6E takes integer D0E,integer J7E returns nothing
set B3E=D0E
set B_E=J7E
call TriggerEvaluate(FBV[FXV[D0E]])
endfunction
function J8E takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FCV[FXV[D0E]])
endfunction
function J9E takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FDV[FXV[D0E]])
endfunction
function KVE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FFV[FXV[D0E]])
endfunction
function KEE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FGV[FXV[D0E]])
endfunction
function KXE takes integer D0E returns nothing
if D0E==null then
return
elseif(FEV[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(FOV[FXV[D0E]])
set FEV[D0E]=D9V
set D9V=D0E
endfunction
function KOE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(NUE)
endfunction
function sc__Damage___Detector_AIDS_onInit takes nothing returns nothing
call TriggerEvaluate(NYE)
endfunction
function KRE takes nothing returns integer
local integer D0E=DJV
if(D0E!=0)then
set DJV=DLV[D0E]
else
set DKV=DKV+1
set D0E=DKV
endif
if(D0E>8190)then
return 0
endif
set DMV[D0E]=0
set DQV[D0E]=null
set DSV[D0E]=.0
set DTV[D0E]=255
set DUV[D0E]=255
set DWV[D0E]=255
set DYV[D0E]=255
set DZV[D0E]=0
set DLV[D0E]=-1
return D0E
endfunction
function KIE takes nothing returns integer
local integer D0E=C8V
if(D0E!=0)then
set C8V=DVV[D0E]
else
set C9V=C9V+1
set D0E=C9V
endif
if(D0E>1364)then
return 0
endif
set DXV[D0E]=(D0E-1)*6
set DVV[D0E]=-1
return D0E
endfunction
function KAE takes integer D0E returns nothing
if D0E==null then
return
elseif(DVV[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(NSE)
set DVV[D0E]=C8V
set C8V=D0E
endfunction
function KNE takes nothing returns integer
local integer D0E=C4V
if(D0E!=0)then
set C4V=C7V[D0E]
else
set C3V=C3V+10
set D0E=C3V
endif
if(D0E>8181)then
return 0
endif
set C7V[D0E]=-1
return D0E
endfunction
function KBE takes integer D0E returns nothing
if D0E==null then
return
elseif(C7V[D0E]!=-1)then
return
endif
set C7V[D0E]=C4V
set C4V=D0E
endfunction
function KCE takes nothing returns integer
local integer D0E=C_V
if(D0E!=0)then
set C_V=C2V[D0E]
else
set CZV=CZV+10
set D0E=CZV
endif
if(D0E>8181)then
return 0
endif
set C2V[D0E]=-1
return D0E
endfunction
function KDE takes integer D0E returns nothing
if D0E==null then
return
elseif(C2V[D0E]!=-1)then
return
endif
set C2V[D0E]=C_V
set C_V=D0E
endfunction
function KFE takes nothing returns integer
local integer D0E=I_V
if(D0E!=0)then
set I_V=I1V[D0E]
else
set I0V=I0V+1
set D0E=I0V
endif
if(D0E>8100)then
return 0
endif
set NBE[D0E]=7
set I1V[D0E]=-1
return D0E
endfunction
function KGE takes integer D0E returns nothing
if D0E==null then
return
elseif(I1V[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(NCE[NBE[D0E]])
set I1V[D0E]=I_V
set I_V=D0E
endfunction
function KHE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(B3V[B1V[D0E]])
endfunction
function KJE takes integer D0E,unit u returns nothing
set B3E=D0E
set BYE=u
call TriggerEvaluate(B4V[B1V[D0E]])
endfunction
function KKE takes integer D0E,unit u returns nothing
set B3E=D0E
set BYE=u
call TriggerEvaluate(B5V[B1V[D0E]])
endfunction
function KLE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(B6V[B1V[D0E]])
endfunction
function KME takes integer D0E returns nothing
if D0E==null then
return
elseif(B0V[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(B2V[B1V[D0E]])
set B0V[D0E]=BZV
set BZV=D0E
endfunction
function KPE takes nothing returns integer
local integer D0E=BAV
if(D0E!=0)then
set BAV=BBV[D0E]
else
set BNV=BNV+1
set D0E=BNV
endif
if(D0E>8190)then
return 0
endif
set BBV[D0E]=-1
return D0E
endfunction
function KQE takes integer D0E returns nothing
if D0E==null then
return
elseif(BBV[D0E]!=-1)then
return
endif
set BBV[D0E]=BAV
set BAV=D0E
endfunction
function KSE takes nothing returns integer
local integer D0E=N1V
if(D0E!=0)then
set N1V=N3V[D0E]
else
set N2V=N2V+1
set D0E=N2V
endif
if(D0E>8190)then
return 0
endif
set N3V[D0E]=-1
return D0E
endfunction
function KTE takes integer D0E returns nothing
if D0E==null then
return
elseif(N3V[D0E]!=-1)then
return
endif
set N3V[D0E]=N1V
set N1V=D0E
endfunction
function KUE takes nothing returns integer
local integer D0E=NDV
if(D0E!=0)then
set NDV=NGV[D0E]
else
set NFV=NFV+1
set D0E=NFV
endif
if(D0E>2729)then
return 0
endif
set NWV[D0E]=(D0E-1)*3
set NGV[D0E]=-1
return D0E
endfunction
function KWE takes integer D0E returns nothing
if D0E==null then
return
elseif(NGV[D0E]!=-1)then
return
endif
set NGV[D0E]=NDV
set NDV=D0E
endfunction
function KYE takes integer D0E,real x returns nothing
set B3E=D0E
set BUE=x
call TriggerEvaluate(NJE)
endfunction
function KZE takes integer D0E,real y returns nothing
set B3E=D0E
set BUE=y
call TriggerEvaluate(NKE)
endfunction
function K_E takes integer D0E,real K0E returns nothing
set B3E=D0E
set BUE=K0E
call TriggerEvaluate(NLE)
endfunction
function K1E takes integer D0E,real K2E returns nothing
set B3E=D0E
set BUE=K2E
call TriggerEvaluate(NME)
endfunction
function K3E takes nothing returns integer
local integer D0E=A0V
if(D0E!=0)then
set A0V=A2V[D0E]
else
set A1V=A1V+1
set D0E=A1V
endif
if(D0E>8190)then
return 0
endif
set A4V[D0E]=.0
set A5V[D0E]=15.
set A6V[D0E]=.0
set A7V[D0E]=.0
set A8V[D0E]=.0
set A9V[D0E]=.0
set NVV[D0E]=1.
set NEV[D0E]=1.
set NXV[D0E]=255
set NOV[D0E]=255
set NRV[D0E]=255
set NIV[D0E]=0
set NAV[D0E]=true
set NNV[D0E]=false
set A2V[D0E]=-1
return D0E
endfunction
function K4E takes integer D0E returns nothing
if D0E==null then
return
elseif(A2V[D0E]!=-1)then
return
endif
set A2V[D0E]=A0V
set A0V=D0E
endfunction
function K5E takes nothing returns integer
local integer D0E=ALV
if(D0E!=0)then
set ALV=APV[D0E]
else
set AMV=AMV+1
set D0E=AMV
endif
if(D0E>8190)then
return 0
endif
set APV[D0E]=-1
return D0E
endfunction
function K6E takes integer D0E returns nothing
if D0E==null then
return
elseif(APV[D0E]!=-1)then
return
endif
set APV[D0E]=ALV
set ALV=D0E
endfunction
function K7E takes nothing returns integer
local integer D0E=AAV
if(D0E!=0)then
set AAV=ABV[D0E]
else
set ANV=ANV+1
set D0E=ANV
endif
if(D0E>8190)then
return 0
endif
set ABV[D0E]=-1
return D0E
endfunction
function K8E takes nothing returns integer
local integer D0E=I9V
if(D0E!=0)then
set I9V=AEV[D0E]
else
set AVV=AVV+1
set D0E=AVV
endif
if(D0E>8190)then
return 0
endif
set AEV[D0E]=-1
return D0E
endfunction
function K9E takes nothing returns integer
local integer D0E=I2V
if(D0E!=0)then
set I2V=I4V[D0E]
else
set I3V=I3V+1
set D0E=I3V
endif
if(D0E>8190)then
return 0
endif
set I4V[D0E]=-1
return D0E
endfunction
function LVE takes nothing returns integer
local integer D0E=KFE()
local integer LEE
if(D0E==0)then
return 0
endif
set NBE[D0E]=10
set LEE=D0E
return D0E
endfunction
function s__StringTable__allocate takes nothing returns integer
local integer D0E=KFE()
local integer LEE
if(D0E==0)then
return 0
endif
set NBE[D0E]=9
set LEE=D0E
return D0E
endfunction
function LXE takes nothing returns integer
local integer D0E=KFE()
local integer LEE
if(D0E==0)then
return 0
endif
set NBE[D0E]=8
set LEE=D0E
return D0E
endfunction
function LOE takes nothing returns integer
call TriggerEvaluate(NZE)
return B5E
endfunction
function LRE takes nothing returns integer
local integer LEE
local integer D0E=D9V
if(D0E!=0)then
set D9V=FEV[D0E]
else
set FVV=FVV+1
set D0E=FVV
endif
if(D0E>8190)then
return 0
endif
set FXV[D0E]=34
set LEE=D0E
set FQV[D0E]=.0
set FSV[D0E]=.0
set FTV[D0E]=.0
set FUV[D0E]=.0
set FWV[D0E]=1.
set FYV[D0E]=null
set FZV[D0E]=CreateGroup()
set F_V[D0E]=false
set F0V[D0E]=false
set F1V[D0E]=false
set F2V[D0E]=false
set F3V[D0E]=true
set F4V[D0E]=false
set F5V[D0E]=false
set FEV[D0E]=-1
return D0E
endfunction
function LIE takes integer D0E returns nothing
set CWV[CYV[D0E]]=CWV[D0E]
set CYV[CWV[D0E]]=CYV[D0E]
endfunction
function LAE takes nothing returns integer
local integer LEE
local integer D0E=BZV
if(D0E!=0)then
set BZV=B0V[D0E]
else
set B_V=B_V+1
set D0E=B_V
endif
if(D0E>8190)then
return 0
endif
set B1V[D0E]=22
set LEE=D0E
set CBV[D0E]=false
set B0V[D0E]=-1
return D0E
endfunction
function LNE takes integer D0E returns boolean
set B3E=D0E
call TriggerEvaluate(NAE[FXV[D0E]])
return B4E
endfunction
function LBE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(NNE[FXV[D0E]])
endfunction
function LCE takes nothing returns integer
local integer D0E=LOE()
local integer LEE
if(D0E==0)then
return 0
endif
set FXV[D0E]=43
set LEE=D0E
set KBV[D0E]=1
set KCV[D0E]=1
set KDV[D0E]=null
set KFV[D0E]=.0
set KGV[D0E]=.0
set KHV[D0E]=.0
set KJV[D0E]=""
set KKV[D0E]=""
set KMV[D0E]=false
set KPV[D0E]=false
set KQV[D0E]=false
set KSV[D0E]=null
return D0E
endfunction
function LDE takes nothing returns integer
local integer D0E=LCE()
local integer LEE
if(D0E==0)then
return 0
endif
set FXV[D0E]=91
set LEE=D0E
set YWV[D0E]=.0
set YYV[D0E]=0
return D0E
endfunction
function LFE takes nothing returns integer
local integer D0E=LCE()
local integer LEE
if(D0E==0)then
return 0
endif
set FXV[D0E]=89
set LEE=D0E
return D0E
endfunction
function LGE takes nothing returns integer
local integer D0E=LCE()
local integer LEE
if(D0E==0)then
return 0
endif
set FXV[D0E]=90
set LEE=D0E
set YUV[D0E]=.0
return D0E
endfunction
function LHE takes integer i,integer a1 returns nothing
set B_E=a1
call TriggerExecute(BHE[i])
endfunction
function LJE takes integer i,trigger a1,integer a2 returns nothing
set B0E=a1
set B_E=a2
call TriggerExecute(BKE[i])
endfunction
function LKE takes integer i,boolexpr a1 returns nothing
set B1E=a1
call TriggerEvaluate(BLE[i])
endfunction
function LLE takes integer i,integer a1,unit a2 returns nothing
set B_E=a1
set BYE=a2
call TriggerExecute(BME[i])
endfunction
function LME takes integer i,integer a1,destructable a2 returns nothing
set B_E=a1
set BZE=a2
call TriggerExecute(BPE[i])
endfunction
function LPE takes integer i,group a1,real a2,real a3 returns nothing
set B2E=a1
set BUE=a2
set BWE=a3
call TriggerExecute(BTE[i])
endfunction
function LQE takes boolexpr a0 returns nothing
call LKE(1,a0)
call DestroyBoolExpr(a0)
endfunction
//function LSE takes nothing returns nothing
//set V=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'zsmc',.0,.0,.0)
//call UnitApplyTimedLife(V,0,.001)
//call ShowUnit(V,false)
//call UnitAddAbility(V,'Aloc')
//endfunction
function LTE takes unit u returns boolean
local integer is=UnitInventorySize(u)
local integer s=0
loop
exitwhen s>=is
if UnitItemInSlot(u,s)==null then
return false
endif
set s=s+1
endloop
return true
endfunction
function LUE takes unit u,item i returns boolean
local integer ic=GetItemCharges(i)
local integer is
local integer il
local integer it
local item ii
local integer LWE
local integer s=0
local real px
local real py
local real ua
if IsItemPowerup(i)then
return false
endif
if GetItemType(i) != ITEM_TYPE_PURCHASABLE then
return false
endif
if ic<=0 then
call DisableTrigger(S1)
call UnitAddItem(u,i)
call EnableTrigger(S1)
else
set is=UnitInventorySize(u)
set il=GetItemLevel(i)
set it=GetItemTypeId(i)
call RemoveItem(i)
loop
set ii=UnitItemInSlot(u,s)
set LWE=GetItemCharges(ii)
if ii!=null and(not A or il==0 or LWE<il)and GetItemTypeId(ii)==it then
if A and il>0 and LWE+ic>il then
call SetItemCharges(ii,il)
set ic=LWE+ic-il
else
call SetItemCharges(ii,LWE+ic)
set ic=0
endif
endif
set s=s+1
exitwhen ic<=0 or s>=is
endloop
if ic>0 then
set px=GetUnitX(u)
set py=GetUnitY(u)
set s=0
loop
set ii=UnitItemInSlot(u,s)
if ii==null then
set ii=CreateItem(it,px,py)
if A and il>0 and ic>il then
call SetItemCharges(ii,il)
set ic=ic-il
else
call SetItemCharges(ii,ic)
set ic=0
endif
call DisableTrigger(S1)
call UnitAddItem(u,ii)
call EnableTrigger(S1)
endif
set s=s+1
exitwhen ic<=0 or s>=is
endloop
if ic>0 then
set ua=GetUnitFacing(u)
set px=GetUnitX(u)+100*Cos(ua*bj_DEGTORAD)
set py=GetUnitY(u)+100*Sin(ua*bj_DEGTORAD)
loop
if ic>il then
set LWE=il
set ic=ic-il
else
set LWE=ic
set ic=0
endif
set ii=CreateItem(it,px,py)
call SetItemCharges(ii,LWE)
exitwhen ic<=0
endloop
return true
endif
endif
endif
return false
endfunction
function LYE takes nothing returns nothing
local unit u
local item i
local item ii
local integer x=0
local integer o
local real px
local real py
local player p
local string LZE
local sound L_E
if J>0 then
loop
set u=B[x]
set i=D[x]
if u!=null and i!=null and not IsItemOwned(i)and GetWidgetLife(i)>0 and GetWidgetLife(u)>0 and GetItemType(i) == ITEM_TYPE_PURCHASABLE then
set o=GetUnitCurrentOrder(u)
set px=GetItemX(i)-GetUnitX(u)
set py=GetItemY(i)-GetUnitY(u)
if px*px+py*py<=22500 or o!=851986 then
if o==851986 then
set p=GetOwningPlayer(u)
set LZE="Sound\\Interface\\PickUpItem.wav"
if GetLocalPlayer()!=p then
set LZE=""
endif
set L_E=CreateSound(LZE,false,true,false,12700,12700,"")
call AttachSoundToUnit(L_E,u)
call SetSoundVolume(L_E,75)
call SetSoundDistances(L_E,600.,1024.)
call SetSoundDistanceCutoff(L_E,1536.)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
call IssueImmediateOrderById(u,851972)
call SetUnitFacing(u,bj_RADTODEG*Atan2(GetItemY(i)-GetUnitY(u),GetItemX(i)-GetUnitX(u)))
if LUE(u,i)then
set LZE="Sound\\Interface\\HeroDropItem1.wav"
if GetLocalPlayer()!=p then
set LZE=""
endif
set L_E=CreateSound(LZE,false,true,false,12700,12700,"")
call AttachSoundToUnit(L_E,u)
call SetSoundVolume(L_E,75)
call SetSoundDistances(L_E,600.,1024.)
call SetSoundDistanceCutoff(L_E,1536.)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
endif
endif
set J=J-1
if J>0 then
set B[x]=B[J]
set D[x]=D[J]
set x=x-1
endif
endif
elseif u!=null or i!=null then
call IssueImmediateOrderById(u,851972)
set J=J-1
if J>0 then
set B[x]=B[J]
set D[x]=D[J]
set x=x-1
endif
endif
set x=x+1
exitwhen x>=J
endloop
endif
if O and K>0 then
set x=0
loop
set u=C[x]
set i=F[x]
set ii=G[x]
set px=H[x]
if u!=null and i!=null and ii!=null and px>0 and UnitHasItem(u,i)and UnitHasItem(u,ii)then
set H[x]=px-.05
else
set K=K-1
if K>0 then
set C[x]=C[K]
set F[x]=F[K]
set G[x]=G[K]
set H[x]=H[K]
set x=x-1
endif
endif
set x=x+1
exitwhen x>=K
endloop
endif
if J<=0 and(not O or K<=0)then
call PauseTimer(L)
endif
set u=null
set i=null
set p=null
set L_E=null
endfunction
function L0E takes nothing returns boolean
local integer x=0
if J>0 then
loop
if B[x]==GetTriggerUnit()and(GetOrderPointX()!=GetItemX(D[x])or GetOrderPointY()!=GetItemY(D[x]))then
set J=J-1
if J>0 then
set B[x]=B[J]
set D[x]=D[J]
set x=x-1
elseif not O or K<=0 then
call PauseTimer(L)
endif
endif
set x=x+1
exitwhen x>=J
endloop
endif
return false
endfunction
function L1E takes nothing returns boolean
local item i=GetOrderTargetItem()
local integer o=GetIssuedOrderId()
local unit u
local player p
local item ii
local integer is
local integer L2E
local integer s
local integer ss
local boolean L3E
local real ua
local string LZE
local sound L_E
if i==null then
set i=GetManipulatedItem()
endif
set s=GetItemCharges(i)
if i!=null and GetItemType(i) == ITEM_TYPE_PURCHASABLE and(o==851971 or(s>0 and(o==0 or(o>852001 and o<852008))))then
set u=GetTriggerUnit()
set is=UnitInventorySize(u)
if is>0 then
if o>852001 and o<852008 then
if UnitHasItem(u,i)then
set o=o-852002
set ii=UnitItemInSlot(u,o)
if GetItemTypeId(ii)==GetItemTypeId(i) and GetItemType(i) == ITEM_TYPE_PURCHASABLE then
if ii==i then
if E then
set L3E=LTE(u)
if s>1 and(I or not L3E)then
if X>0 then
if X>=s then
set ss=s-1
else
set ss=X
endif
else
set ss=s/2
endif
call SetItemCharges(i,s-ss)
if O then
set ii=null
if K>0 then
set o=0
loop
if u==C[o]then
set ii=G[o]
set L2E=GetItemCharges(ii)
set s=GetItemLevel(ii)
exitwhen true
endif
set o=o+1
exitwhen o>=K
endloop
endif
endif
if O and GetItemTypeId(i) != 'I04I' and GetItemType(i) == ITEM_TYPE_PURCHASABLE and ii!=null and ii!=i and F[o]==i and(not A or s==0 or L2E<s)and UnitHasItem(u,ii)and GetItemTypeId(ii)==GetItemTypeId(i)then
call SetItemCharges(ii,L2E+ss)
set H[o]=R
else
if GetItemType(i) == ITEM_TYPE_PURCHASABLE then
set ua=GetUnitFacing(u)
set ii=CreateItem(GetItemTypeId(i),GetUnitX(u)+100*Cos(ua*bj_DEGTORAD),GetUnitY(u)+100*Sin(ua*bj_DEGTORAD))
call SetItemCharges(ii,ss)
endif
if not L3E then
call DisableTrigger(S1)
call UnitAddItem(u,ii)
call EnableTrigger(S1)
if O then
set o=0
if K>0 then
loop
if C[o]==u then
set F[o]=i
set G[o]=ii
set H[o]=R
set o=-1
else
set o=o+1
endif
exitwhen o>=K or o==-1
endloop
endif
if o>=0 then
if K==0 then
call TimerStart(L,.05,true,function LYE)
endif
set C[K]=u
set F[K]=i
set G[K]=ii
set H[K]=R
set K=K+1
endif
endif
else
set p=GetOwningPlayer(u)
set LZE="Sound\\Interface\\HeroDropItem1.wav"
if GetLocalPlayer()!=p then
set LZE=""
endif
set L_E=CreateSound(LZE,false,true,false,12700,12700,"")
call AttachSoundToUnit(L_E,u)
call SetSoundVolume(L_E,75)
call SetSoundDistances(L_E,600.,1024.)
call SetSoundDistanceCutoff(L_E,1536.)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
endif
endif
endif
endif
else
set is=GetItemLevel(i)
set L2E=GetItemCharges(ii)
if A and is>0 and L2E+s>is then
if o<is and L2E<GetItemLevel(ii)then
call SetItemCharges(ii,L2E+s-is)
call SetItemCharges(i,is)
endif
else
call SetItemCharges(ii,L2E+s)
call RemoveItem(i)
endif
endif
endif
endif
elseif o==851971 then
if LTE(u)then
set o=GetItemLevel(i)
set L2E=GetItemTypeId(i)
set s=0
loop
set ii=UnitItemInSlot(u,s)
if ii!=i and GetItemTypeId(ii)==L2E and(not A or o==0 or GetItemCharges(ii)<o)then
set s=is+1
else
set s=s+1
endif
exitwhen s>=is
endloop
if s>is and GetItemCharges(i)>0 then
set s=0
if J>0 then
loop
if B[s]==u then
set D[s]=i
set s=-1
else
set s=s+1
endif
exitwhen s>=J or s==-1
endloop
endif
if s>=0 then
if J==0 then
call TimerStart(L,.05,true,function LYE)
endif
set B[J]=u
set D[J]=i
set J=J+1
endif
call IssuePointOrderById(u,851986,GetItemX(i),GetItemY(i))
else
call IssueImmediateOrderById(u,851972)
set p=GetOwningPlayer(u)
if N!=null and N!="" then
set LZE=N
if GetLocalPlayer()!=p then
set LZE=""
endif
set L_E=CreateSound(LZE,false,false,false,12700,12700,"")
call SetSoundVolume(L_E,127)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
endif
endif
endif
else
if LUE(u,i)then
set p=GetOwningPlayer(u)
set LZE="Sound\\Interface\\Sound\\Interface\\HeroDropItem1.wav.wav"
if GetLocalPlayer()!=p then
set LZE=""
endif
set L_E=CreateSound(LZE,false,true,false,12700,12700,"")
call AttachSoundToUnit(L_E,u)
call SetSoundVolume(L_E,75)
call SetSoundDistances(L_E,600.,1024.)
call SetSoundDistanceCutoff(L_E,1536.)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
endif
endif
endif
endif
set u=null
set p=null
set i=null
set ii=null
set L_E=null
return false
endfunction
function L4E takes nothing returns boolean
local string array LZE
local sound L_E
local integer x=0
set LZE[0]="Sound\\Interface\\PickUpItem.wav"
set LZE[1]="Sound\\Interface\\HeroDropItem1.wav"
if N!=null and N!="" then
set LZE[2]=N
endif
loop
exitwhen LZE[x]==null
set L_E=CreateSound(LZE[x],false,false,false,12700,12700,"")
call SetSoundVolume(L_E,0)
call StartSound(L_E)
call KillSoundWhenDone(L_E)
set x=x+1
endloop
set L_E=null
call DestroyTrigger(GetTriggeringTrigger())
return false
endfunction
function L5E takes nothing returns nothing
local trigger L6E=CreateTrigger()
local trigger L7E=CreateTrigger()
local integer x=0
set S1=CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent(S1,Player(x),EVENT_PLAYER_UNIT_PICKUP_ITEM,null)
call TriggerRegisterPlayerUnitEvent(S1,Player(x),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
call TriggerRegisterPlayerUnitEvent(L6E,Player(x),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
set x=x+1
exitwhen x>=16
endloop
call TriggerRegisterTimerEvent(L7E,.0,false)
call TriggerAddCondition(S1,Condition(function L1E))
call TriggerAddCondition(L6E,Condition(function L0E))
call TriggerAddCondition(L7E,Condition(function L4E))
endfunction
function L8E takes string L9E,real x,real y,real z returns effect
set M=CreateDestructableZ('OTip',x,y,z,.0,1.,0)
set P=AddSpecialEffect(L9E,x,y)
call RemoveDestructable(M)
return P
endfunction
function s__Event___EventStack_increment takes nothing returns nothing
set RKV=(RKV+1)
endfunction
function s__Event___EventStack_decrement takes nothing returns nothing
set RKV=(RKV-1)
endfunction
function s__Event_getTriggeringEventReg takes nothing returns integer
return RLV[RKV]
endfunction
function MVE takes nothing returns integer
local integer D0E=GBE()
set RTV[D0E]=D0E
set RUV[D0E]=D0E
return D0E
endfunction
function MEE takes integer D0E returns nothing
local integer MXE=RTV[D0E]
set RKV=(RKV+1)
loop
exitwhen MXE==D0E
set RWV=RSV[MXE]
if IsTriggerEnabled(RWV)then
set RLV[RKV]=MXE
if TriggerEvaluate(RWV)then
call TriggerExecute(RWV)
endif
else
call EnableTrigger(RWV)
if IsTriggerEnabled(RWV)then
call DisableTrigger(RWV)
else
set RUV[RTV[MXE]]=RUV[MXE]
set RTV[RUV[MXE]]=RTV[MXE]
call GCE(MXE)
endif
endif
set MXE=RTV[MXE]
endloop
set RKV=(RKV-1)
endfunction
function MOE takes integer D0E,trigger t returns integer
local integer MRE=GBE()
set RUV[MRE]=RUV[D0E]
set RTV[RUV[D0E]]=MRE
set RUV[D0E]=MRE
set RTV[MRE]=D0E
set RSV[MRE]=t
set RJV[((MRE))]=0
return MRE
endfunction
function CreateEvent takes nothing returns integer
return MVE()
endfunction
function GetTriggeringEventReg takes nothing returns integer
return(RLV[RKV])
endfunction
function MAE takes handle h returns nothing
local integer id=GetHandleId(h)
local integer qi
if HaveSavedInteger(Q,id,0)then
set qi=LoadInteger(Q,id,0)
set AYE[qi]=AYE[qi]+1
elseif T>0 then
set T=T-1
set AYE[AZE[T]]=1
call SaveInteger(Q,id,0,AZE[T])
else
set AYE[S]=1
call SaveInteger(Q,id,0,S)
set S=S+1
endif
endfunction
function MNE takes handle h returns nothing
local integer id=GetHandleId(h)
local integer qi=LoadInteger(Q,id,0)
set AYE[qi]=AYE[qi]-1
if AYE[qi]==0 then
set AZE[T]=qi
set T=T+1
call FlushChildHashtable(Q,id)
endif
endfunction
function MBE takes nothing returns nothing
if IsItemVisible(GetEnumItem())then
set Y[Z]=GetEnumItem()
call SetItemVisible(Y[Z],false)
set Z=Z+1
endif
endfunction
function MCE takes real x1,real y1 returns boolean
local real x2=.0
local real y2=.0
call SetRect(IV,.0,.0,128.,128.)
call MoveRectTo(IV,x1,y1)
call EnumItemsInRect(IV,null,function MBE)
call SetItemPosition(NV,x1,y1)
set x2=GetItemX(NV)
set y2=GetItemY(NV)
call SetItemVisible(NV,false)
loop
exitwhen Z<=0
set Z=Z-1
call SetItemVisible(Y[Z],true)
set Y[Z]=null
endloop
return(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<10.*10.
endfunction
function MDE takes nothing returns nothing
if W[0]then
call KillDestructable(GetEnumDestructable())
else
set W[1]=true
endif
endfunction
function MFE takes nothing returns boolean
local destructable MGE=GetFilterDestructable()
local boolean MHE=false
if GetDestructableLife(MGE)>.405 then
call ShowUnit(AV,true)
call SetUnitX(AV,GetWidgetX(MGE))
call SetUnitY(AV,GetWidgetY(MGE))
set MHE=IssueTargetOrderById(AV,852018,MGE)
call IssueImmediateOrderById(AV,851972)
call ShowUnit(AV,false)
set MGE=null
return MHE
endif
set MGE=null
return MHE
endfunction
function MJE takes real x,real y returns boolean
return(x>EV or y>OV or x<XV or y<RV)
endfunction
function MKE takes integer D0E returns integer
local real x=GetUnitX(R0V[D0E])
local real y=GetUnitY(R0V[D0E])
if IsTerrainPathable(x,y,PATHING_TYPE_FLOATABILITY)then
return 1
elseif not IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)then
return 2
endif
return 0
endfunction
function MLE takes unit MME,real MPE,real MQE,real MSE,string MTE,real MUE,boolean MWE,boolean MYE returns integer
local integer d=JNE()
set R0V[d]=MME
set R1V[d]=(2.*MPE)/(MQE+1.)
set R2V[d]=R1V[d]/MQE
set R3V[d]=Sin(MSE)
set R4V[d]=Cos(MSE)
set R5V[d]=MUE
set R9V[d]=MWE
set IVV[d]=MYE
set R6V[d]=MKE(d)
if MTE!="" and MTE!=null then
set R8V[d]=true
endif
if R8V[d]then
set R7V[d]=AddSpecialEffectTarget(MTE,R0V[d],"chest")
else
if R6V[d]==1 then
set R7V[d]=AddSpecialEffectTarget("war3mapImported\\Dust.mdx",R0V[d],"chest")
elseif R6V[d]==2 then
set R7V[d]=AddSpecialEffectTarget("war3mapImported\\SlideWater.mdx",R0V[d],"chest")
endif
endif
return d
endfunction
function MZE takes integer D0E returns nothing
set R0V[D0E]=null
if R7V[D0E]!=null then
call DestroyEffect(R7V[D0E])
set R7V[D0E]=null
endif
set W[0]=false
set W[1]=false
endfunction
function M_E takes integer D0E returns nothing
if D0E==null then
return
elseif(R_V[D0E]!=-1)then
return
endif
call MZE(D0E)
set R_V[D0E]=RYV
set RYV=D0E
endfunction
function M0E takes nothing returns nothing
local integer i=1
local integer M1E=0
local integer M2E=0
local integer d=0
local real x=.0
local real y=.0
local real M3E=.0
local real M4E=.0
loop
exitwhen i>VV
set d=U[i]
set M1E=R6V[d]
set x=GetUnitX(R0V[d])
set y=GetUnitY(R0V[d])
if R5V[d]!=.0 then
set W[0]=R5V[d]>.0
call SetRect(IV,x-R5V[d],y-R5V[d],x+R5V[d],y+R5V[d])
call EnumDestructablesInRect(IV,CV,function MDE)
endif
if IVV[d]then
if MCE(x+50.*R4V[d],y+50.*R3V[d])==false then
set M2E=1
if true then
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
endif
endif
endif
if not R8V[d]then
set R6V[d]=MKE(d)
if R6V[d]==1 and M1E==2 then
call DestroyEffect(R7V[d])
set R7V[d]=AddSpecialEffectTarget("war3mapImported\\Dust.mdx",R0V[d],"chest")
elseif R6V[d]==2 and M1E==1 then
call DestroyEffect(R7V[d])
set R7V[d]=AddSpecialEffectTarget("war3mapImported\\SlideWater.mdx",R0V[d],"chest")
endif
endif
if R1V[d]<=0 or MJE(x,y)or W[1]or M2E==1 or IEV[d]then
call M_E(d)
set U[i]=U[VV]
set VV=VV-1
set i=i-1
set M2E=0
else
set M3E=x+R1V[d]*R4V[d]
set M4E=y+R1V[d]*R3V[d]
if R9V[d]then
call SetUnitX(R0V[d],M3E)
call SetUnitY(R0V[d],M4E)
else
call SetUnitPosition(R0V[d],M3E,M4E)
endif
set R1V[d]=R1V[d]-R2V[d]
endif
set i=i+1
endloop
if VV<=0 then
call PauseTimer(BV)
set VV=0
endif
endfunction
function M5E takes unit MME returns boolean
local integer i=1
loop
exitwhen i>VV
if R0V[U[i]]==MME then
return true
endif
set i=i+1
endloop
return false
endfunction
function M6E takes unit MME,real MPE,real MQE,real MSE,string MTE,real MUE,boolean MWE,boolean MYE returns boolean
local integer d=0
if MME==null or MPE<=.0 or MQE<=.0 then
return false
endif
set d=MLE(MME,MPE,(MQE/.04),(MSE*.01745328),MTE,MUE,MWE,MYE)
set VV=VV+1
if VV==1 then
call TimerStart(BV,.04,true,function M0E)
endif
set U[VV]=d
return true
endfunction
function M7E takes nothing returns nothing
set BV=CreateTimer()
set IV=Rect(.0,.0,1.,1.)
set CV=Filter(function MFE)
set EV=GetRectMaxX(bj_mapInitialPlayableArea)-64.
set OV=GetRectMaxY(bj_mapInitialPlayableArea)-64.
set XV=GetRectMinX(bj_mapInitialPlayableArea)+64.
set RV=GetRectMinY(bj_mapInitialPlayableArea)+64.
set W[0]=false
set W[1]=false
set AV=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h007',.0,.0,.0)
call SetUnitPathing(AV,false)
call ShowUnit(AV,false)
call UnitAddAbility(AV,'Ahrl')
//call UnitAddAbility(AV,'Aloc')
set NV=CreateItem('ciri',.0,.0)
call SetItemVisible(NV,false)
endfunction
function M8E takes nothing returns nothing
set EE=R2I(TimerGetTimeout(GetExpiredTimer())*800)
set XE=HV[EE]
call TriggerEvaluate(FV[EE])
set XE=0
loop
exitwhen XE==VE
set XE=XE+1
if ZV[XE]then
set JV[UV[XE]]=TriggerAddCondition(FV[EE],KV[UV[XE]])
else
call TriggerRemoveCondition(FV[EE],WV[XE])
call LQE(YV[XE])
endif
endloop
set VE=0
set EE=-1
endfunction
function M9E takes nothing returns boolean
set VE=VE+1
set ZV[VE]=false
set WV[VE]=JV[OE]
set YV[VE]=KV[OE]
if MV[OE]==0 then
set HV[EE]=PV[OE]
endif
set PV[MV[OE]]=PV[OE]
if PV[OE]==0 then
set GV[EE]=MV[OE]
if GV[EE]<1 then
call PauseTimer(DV[EE])
endif
else
set MV[PV[OE]]=MV[OE]
endif
set SV[TV]=OE
set TV=TV+1
return false
endfunction
function PVE takes code PEE,integer PXE,real POE returns nothing
set RE=R2I(POE*800)
if DV[RE]==null then
set DV[RE]=CreateTimer()
set FV[RE]=CreateTrigger()
endif
if TV==1 then
set QV=QV+1
set IE=QV
else
set TV=TV-1
set IE=SV[TV]
endif
set KV[IE]=And(Condition(PEE),AE)
if EE==RE then
set VE=VE+1
set ZV[VE]=true
set UV[VE]=IE
else
if GV[RE]<1 then
call TimerStart(DV[RE],RE/800.,true,function M8E)
set HV[RE]=IE
endif
set JV[IE]=TriggerAddCondition(FV[RE],KV[IE])
endif
set LV[IE]=PXE
set PV[IE]=0
set MV[IE]=GV[RE]
set PV[GV[RE]]=IE
set GV[RE]=IE
endfunction
function PRE takes nothing returns integer
set OE=XE
set XE=PV[XE]
return LV[OE]
endfunction
function KT__KTinit takes nothing returns nothing
set AE=Condition(function M9E)
endfunction
function PIE takes nothing returns boolean
set KE=PRE()
call TriggerExecute(HE[KE])
set JE[KE]=JE[KE]-1
if JE[KE]==0 then
set GE=GE+1
set FE[GE]=HE[KE]
return true
endif
return false
endfunction
function PAE takes nothing returns boolean
set LE=GetTriggeringTrigger()
set ME=GetTriggerExecCount(LE)
call DestroyTrigger(LE)
call LQE(DE[ME])
set HE[ME]=CreateTrigger()
set JE[ME]=ME
call PVE(function PIE,ME,.03125)
return false
endfunction
function PNE takes nothing returns boolean
set XE=8190
set LV[8190]=CE[GetTriggerExecCount(GetTriggeringTrigger())]
return false
endfunction
function PBE takes code PEE,integer PXE,real POE returns nothing
set QE=FE[GE]
set PE=GetTriggerExecCount(QE)
set GE=GE-1
set CE[PE]=PXE
set DE[PE]=And(Condition(PEE),BE)
call TriggerAddCondition(QE,NE)
call TriggerAddCondition(QE,DE[PE])
call TriggerRegisterTimerEvent(QE,POE,true)
endfunction
function PCE takes trigger t,integer d returns nothing
if d>64 then
call LJE(1,t,d-64)
set d=64
endif
loop
exitwhen d==0
set d=d-1
call TriggerExecute(t)
endloop
endfunction
function PDE takes nothing returns nothing
set NE=Condition(function PNE)
set BE=Condition(function PAE)
set MV[8190]=8190
set PV[8190]=8190
loop
set GE=GE+1
set FE[GE]=CreateTrigger()
call LJE(1,FE[GE],64+1-GE)
exitwhen GE==64
endloop
endfunction
function PFE takes code PEE,integer PXE,real POE returns nothing
if POE<.3 then
call PVE(PEE,PXE,POE)
else
call PBE(PEE,PXE,POE)
endif
endfunction
function PGE takes nothing returns nothing
set AE=Condition(function M9E)
call PDE()
endfunction
function PHE takes real x returns real
local real PJE=-88.
local real PKE=88.
local real PLE
local integer i=20
loop
set PLE=(PJE+PKE)/2
exitwhen(i<=0)
set i=i-1
if(Pow(bj_E,PLE)>=x)then
set PKE=PLE
else
set PJE=PLE
endif
endloop
return PLE
endfunction
function PME takes unit u returns nothing
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
endfunction
function PPE takes real x,real y,real xt,real yt returns real
local real dx=xt-x
local real dy=yt-y
return SquareRoot(dx*dx+dy*dy)
endfunction
function PQE takes nothing returns boolean
return true
endfunction
function PSE takes real CHE,real x,real y returns group
call GroupEnumUnitsInRange(SE,x,y,CHE,WE)
return SE
endfunction
function PTE takes real x,real y returns real
call MoveLocation(UE,x,y)
return GetLocationZ(UE)
endfunction
function PUE takes real PWE,real zs,real zt,real q returns real
return(PWE*Sin(q*bj_PI))+q*(zt-zs)
endfunction
function PYE takes unit c,unit u returns boolean
if IsUnitEnemy(u,GetOwningPlayer(c))then
if GetUnitState(u,UNIT_STATE_LIFE)>.0 then
if GetUnitAbilityLevel(u,'Avul')<=0 then
if IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE)==false then
return IsUnitType(u,UNIT_TYPE_STRUCTURE)==false
endif
endif
endif
endif
return false
endfunction
function PZE takes unit u returns boolean
if IsUnitType(u,UNIT_TYPE_RESISTANT)==false then
if IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE)==false then
if GetUnitState(u,UNIT_STATE_LIFE)>.0 then
if GetUnitAbilityLevel(u,'Avul')<=0 then
return GetUnitAbilityLevel(u,'Bprg')<=0
endif
endif
endif
endif
return false
endfunction
function P_E takes nothing returns nothing
set TE=CreateItem('sehr',0,0)
set UE=Location(0,0)
set SE=CreateGroup()
set WE=Filter(function PQE)
call SetItemVisible(TE,false)
endfunction
function P0E takes real CDE returns real
local real r=CDE
loop
exitwhen r>=0 and r<=360
if r<0 then
set r=r+360
elseif r>360 then
set r=r-360
endif
endloop
return r
endfunction
function P1E takes real x0,real y0,real x1,real y1 returns real
return Atan2((y1-y0),(x1-x0))
endfunction
function P4E takes real h,real d,real x returns real
return(4*h/d)*(d-x)*(x/d)
endfunction
function P5E takes real h,real d,real x,real z0,real z1 returns real
return(4*h/d)*(d-x)*(x/d)+(((z1-z0)/d)*x+z0)
endfunction
function P6E takes integer D0E returns nothing
call DZE(D0E,false)
call DWE(D0E,.0)
call DTE(D0E,true)
endfunction
function P7E takes integer D0E returns nothing
if D0E==null then
return
elseif(IRV[D0E]!=-1)then
return
endif
call P6E(D0E)
set IRV[D0E]=IXV
set IXV=D0E
endfunction
function P8E takes real x,real y,real z returns integer
local integer P9E=J_E()
call DKE(P9E,x)
call DME(P9E,y)
call DQE(P9E,z)
call DZE(P9E,true)
if P9E==IZV then
set IZV=IZV+1
endif
return P9E
endfunction
function QVE takes integer D0E returns real
return SquareRoot(DJE(D0E)*DJE(D0E)+DLE(D0E)*DLE(D0E)+DPE(D0E)*DPE(D0E))
endfunction
function QEE takes integer D0E returns real
return P1E(.0,.0,DJE(D0E),DLE(D0E))
endfunction
function QOE takes integer D0E,integer QRE returns nothing
call DKE(D0E,DJE(D0E)+DJE(QRE))
call DME(D0E,DLE(D0E)+DLE(QRE))
call DQE(D0E,DPE(D0E)+DPE(QRE))
endfunction
function QIE takes integer QAE,integer QNE returns integer
return P8E(DJE(QNE)-DJE(QAE),DLE(QNE)-DLE(QAE),DPE(QNE)-DPE(QAE))
endfunction
function QBE takes integer D0E,real QCE returns nothing
call DKE(D0E,DJE(D0E)*QCE)
call DME(D0E,DLE(D0E)*QCE)
call DQE(D0E,DPE(D0E)*QCE)
endfunction
function QDE takes integer a,real QCE returns integer
return P8E(DJE(a)*QCE,DLE(a)*QCE,DPE(a)*QCE)
endfunction
function QGE takes integer a returns integer
return QDE(a,1/QVE(a))
endfunction
function QHE takes integer D0E,real x,real y,real z,real CHE returns boolean
if DJE(D0E)>x-CHE and DJE(D0E)<x+CHE and DLE(D0E)>y-CHE and DLE(D0E)<y+CHE and DPE(D0E)>z-CHE and DPE(D0E)<z+CHE then
return true
else
return false
endif
endfunction
function QJE takes integer a,integer b,real CHE returns boolean
return QHE(a,DJE(b),DLE(b),DPE(b),CHE)
endfunction
function QKE takes nothing returns nothing
local integer i=0
loop
exitwhen i==IZV
if DSE((i))and DYE((i))then
if DUE((i))>=.1 then
call DZE((i),false)
call P7E((i))
endif
call DWE((i),DUE((i))+.05)
endif
set i=i+1
endloop
endfunction
function QLE takes nothing returns nothing
call TimerStart(ZE,.05,true,function QKE)
endfunction
function QME takes real x,real y returns real
call MoveLocation(YE,x,y)
return GetLocationZ(YE)
endfunction
function QPE takes nothing returns boolean
if(GetWidgetLife(GetManipulatedItem())==0)then
call RemoveItem(GetManipulatedItem())
endif
return false
endfunction
function QQE takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DROP_ITEM)
call TriggerAddCondition(t,Condition(function QPE))
endfunction
function QSE takes nothing returns nothing
set VX=Location(.0,.0)
set EX=Location(.0,.0)
endfunction
function QTE takes real x1,real y1,real x2,real y2 returns real
return SquareRoot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
endfunction
function QUE takes real x1,real y1,real x2,real y2 returns real
return bj_RADTODEG*(Atan2(y2-y1,x2-x1))
endfunction
function QWE takes real CDE,real x,real y,real QYE,real QZE returns real
return 2.*Atan2(QZE-y,QYE-x)+bj_PI-CDE*bj_DEGTORAD
endfunction
function Q_E takes player Q0E,string Q1E returns nothing
set Q1E="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+Q1E+"|r"
if(GetLocalPlayer()==Q0E)then
call ClearTextMessages()
call DisplayTimedTextToPlayer(Q0E,.52,.96,2.,Q1E)
call StartSound(AX)
endif
endfunction
function Q2E takes nothing returns nothing
set AX=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
endfunction
function Q3E takes nothing returns nothing
set NX=NX+1
call TriggerEvaluate(BX)
endfunction
function Q4E takes nothing returns nothing
call TimerStart(CreateTimer(),.03125,true,function Q3E)
endfunction
function Q5E takes nothing returns nothing
set CX=InitHashtable()
endfunction
function Q6E takes unit J2E,string Q7E,string C9E returns nothing
local texttag tt=CreateTextTag()
local real Q8E=RMinBJ(StringLength(Q7E)*5.5,200.)
call SetTextTagText(tt,C9E+Q7E,.024)
call SetTextTagPos(tt,GetUnitX(J2E)-Q8E,GetUnitY(J2E),16.)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.5)
call SetTextTagLifespan(tt,4.)
call SetTextTagPermanent(tt,false)
set tt=null
endfunction
function Q9E takes unit J2E,integer SVE returns nothing
local texttag tt=CreateTextTag()
local string Q7E="-"+I2S(SVE)
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(J2E)-16.,GetUnitY(J2E),.0)
call SetTextTagColor(tt,82,82,255,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
set Q7E=null
set tt=null
endfunction
function Q9999E takes unit J2E,integer SVE returns nothing
local texttag tt=CreateTextTag()
local string Q7E="+"+I2S(SVE)
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(J2E)-16.,GetUnitY(J2E),.0)
call SetTextTagColor(tt,82,82,255,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
set Q7E=null
set tt=null
endfunction
function SEE takes unit J2E,integer SVE returns nothing
local texttag tt=CreateTextTag()
local string Q7E=I2S(SVE)+"!"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(J2E),GetUnitY(J2E),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
set Q7E=null
set tt=null
endfunction
//function SRE takes nothing returns nothing
//local integer i=0
//local integer o=-1
//local boolean oops=false
//set FX=InitHashtable()
//loop
//exitwhen(i==256)
//set A_E[i]=CreateTimer()
//call SaveInteger(FX,0,GetHandleId((A_E[i])),(HX))
//set i=i+1
//endloop
//set GX=256
//endfunction
function SIE takes nothing returns nothing
local integer i=JX
local integer sw
loop
exitwhen i<=0
set sw=KX[i]
set I6V[sw]=I6V[sw]-I7V[sw]
call SetUnitVertexColor(I5V[sw],255,255,255,R2I(I6V[sw]))
set I8V[sw]=I8V[sw]-1
if I8V[sw]==0 then
set KX[i]=KX[JX]
set KX[JX]=sw
set JX=JX-1
call RemoveUnit(I5V[sw])
if JX==0 then
call PauseTimer(MX)
endif
endif
set i=i-1
endloop
endfunction
function SAE takes integer id,real x,real y,real K0E,real CIE,string SNE,real SBE returns nothing
local unit SCE=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),id,x,y,K0E)
call UnitAddAbility(SCE,'Aloc')
call PauseUnit(SCE,true)
call SetUnitX(SCE,x)
call SetUnitY(SCE,y)
call SetUnitAnimation(SCE,SNE)
call SetUnitTimeScale(SCE,SBE)
set JX=JX+1
if JX>LX then
set LX=LX+1
set KX[JX]=K9E()
endif
set I6V[KX[JX]]=255.
set I8V[KX[JX]]=R2I(CIE/.03125)
set I7V[KX[JX]]=255./I2R(I8V[KX[JX]])
set I5V[KX[JX]]=SCE
if JX==1 then
call TimerStart(MX,.03125,true,function SIE)
endif
endfunction
function SDE takes integer id,real x,real y,real K0E,real CIE,integer DGE,real SBE returns nothing
local unit SCE=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),id,x,y,K0E)
call UnitAddAbility(SCE,'Aloc')
call PauseUnit(SCE,true)
call SetUnitX(SCE,x)
call SetUnitY(SCE,y)
call SetUnitAnimationByIndex(SCE,DGE)
call SetUnitTimeScale(SCE,SBE)
set JX=JX+1
if JX>LX then
set LX=LX+1
set KX[JX]=K9E()
endif
set I6V[KX[JX]]=255.
set I8V[KX[JX]]=R2I(CIE/.03125)
set I7V[KX[JX]]=255./I2R(I8V[KX[JX]])
set I5V[KX[JX]]=SCE
if JX==1 then
call TimerStart(MX,.03125,true,function SIE)
endif
endfunction
function SFE takes nothing returns nothing
local integer i=PX
local integer sw
loop
exitwhen i<=0
set sw=QX[i]
set AOV[sw]=AOV[sw]-ARV[sw]
call SetUnitVertexColor(AXV[sw],50,50,50,R2I(AOV[sw]))
set AIV[sw]=AIV[sw]-1
if AIV[sw]==0 then
set QX[i]=QX[PX]
set QX[PX]=sw
set PX=PX-1
call RemoveUnit(AXV[sw])
if PX==0 then
call PauseTimer(TX)
endif
endif
set i=i-1
endloop
endfunction
function SGE takes integer id,real x,real y,real K0E,real CIE,string SNE,real SBE returns nothing
local unit SCE=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),id,x,y,K0E)
call UnitAddAbility(SCE,'Aloc')
call PauseUnit(SCE,true)
call SetUnitX(SCE,x)
call SetUnitY(SCE,y)
call SetUnitAnimation(SCE,SNE)
call SetUnitTimeScale(SCE,SBE)
set PX=PX+1
if PX>SX then
set SX=SX+1
set QX[PX]=K8E()
endif
set AOV[QX[PX]]=255.
set AIV[QX[PX]]=R2I(CIE/.03125)
set ARV[QX[PX]]=255./I2R(AIV[QX[PX]])
set AXV[QX[PX]]=SCE
if PX==1 then
call TimerStart(TX,.03125,true,function SFE)
endif
endfunction
function SHE takes integer id,real x,real y,real K0E,real CIE,integer DGE,real SBE returns nothing
local unit SCE=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),id,x,y,K0E)
call UnitAddAbility(SCE,'Aloc')
call PauseUnit(SCE,true)
call SetUnitX(SCE,x)
call SetUnitY(SCE,y)
call SetUnitAnimationByIndex(SCE,DGE)
call SetUnitTimeScale(SCE,SBE)
set PX=PX+1
if PX>SX then
set SX=SX+1
set QX[PX]=K8E()
endif
set AOV[QX[PX]]=255.
set AIV[QX[PX]]=R2I(CIE/.03125)
set ARV[QX[PX]]=255./I2R(AIV[QX[PX]])
set AXV[QX[PX]]=SCE
if PX==1 then
call TimerStart(TX,.03125,true,function SFE)
endif
endfunction
function SJE takes unit u1,location l1,real SKE,real SLE returns integer
local integer d=K7E()
local real dx=GetUnitX(u1)-GetLocationX(l1)
local real dy=GetUnitY(u1)-GetLocationY(l1)
set AJV[d]=l1
set ACV[d]=u1
set ADV[d]=SKE
set AFV[d]=SLE
set AGV[d]=SquareRoot(dx*dx+dy*dy)
set AHV[d]=0
set AKV[WX]=d
return d
endfunction
function SME takes integer D0E returns nothing
set ACV[D0E]=null
set AJV[D0E]=null
call RemoveLocation(AJV[D0E])
endfunction
function SPE takes integer D0E returns nothing
if D0E==null then
return
elseif(ABV[D0E]!=-1)then
return
endif
call SME(D0E)
set ABV[D0E]=AAV
set AAV=D0E
endfunction
function SQE takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function SSE takes unit u returns nothing
local rect r
local real STE=GetUnitX(u)
local real SUE=GetUnitY(u)
local real CHE=90
local location CJE=GetUnitLoc(u)
if(CHE>=0)then
set bj_enumDestructableCenter=CJE
set bj_enumDestructableRadius=CHE
set r=Rect(STE-CHE,SUE-CHE,STE+CHE,SUE+CHE)
call EnumDestructablesInRect(r,filterEnumDestructablesInCircleBJ,function SQE)
call RemoveRect(r)
call RemoveLocation(CJE)
endif
set r=null
set CJE=null
endfunction
function SWE takes nothing returns nothing
local integer i=0
local integer d
local real x
local real y
local real x1
local real y1
local real dx
local real dy
local real d2
local group g=CreateGroup()
local boolexpr CME
loop
exitwhen i>=WX
set d=AKV[i]
set x1=GetUnitX(ACV[d])
set y1=GetUnitY(ACV[d])
set dx=GetLocationX(AJV[d])-x1
set dy=GetLocationY(AJV[d])-y1
set d2=SquareRoot(dx*dx+dy*dy)
set x=x1+ADV[d]*dx/d2
set y=y1+ADV[d]*dy/d2
call SetUnitX(ACV[d],x)
call SetUnitY(ACV[d],y)
if true then
if IsTerrainPathable(x,y,PATHING_TYPE_FLOATABILITY)then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FlakTarget3.mdx",ACV[d],"origin"))
elseif not IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl",ACV[d],"origin"))
endif
endif
if true then
call SSE(ACV[d])
endif
set AHV[d]=AHV[d]+ADV[d]
if ADV[d]-AFV[d]>=.0 then
set ADV[d]=ADV[d]-AFV[d]
endif
if AHV[d]>=AGV[d]or AHV[d]<=1 or ADV[d]<=1 then
set WX=WX-1
set AKV[i]=AKV[WX]
set i=i-1
if WX<=0 then
call PauseTimer(UX)
set WX=0
endif
call SPE(d)
endif
set i=i+1
endloop
set g=null
set CME=null
endfunction
function SYE takes unit u,location l,real SZE,real S_E returns nothing
local integer d=SJE(u,l,SZE,S_E)
set WX=WX+1
if WX==1 then
call TimerStart(UX,.02,true,function SWE)
endif
endfunction
function S0E takes unit u returns boolean
//if GetUnitTypeId(u) == 'h007' or GetUnitTypeId(u) == 'h00W' or GetUnitTypeId(u) == 'h004' or GetUnitTypeId(u) == 'o016' or GetUnitTypeId(u) == 'o003' or GetUnitTypeId(u) == 'h00L' then
//return true
//endif
if GetUnitTypeId(u) == 'h018' then
return true
else
return GetUnitAbilityLevel(u,'Aloc') != 1 and GetUnitTypeId(u) != 'e005' and GetOwningPlayer(u) != Player(PLAYER_NEUTRAL_PASSIVE) and GetUnitAbilityLevel(u,'Avul') != 1 and GetUnitTypeId(u) != 'e022' and GetUnitTypeId(u) != 'e001'
endif
endfunction
function S1E takes nothing returns integer
if FO[DO]==0 then
if EO==0 then
set XO=XO+1
set FO[DO]=XO
else
set FO[DO]=VO[EO]
set EO=EO-1
endif
call SetUnitUserData(GO[DO],FO[DO])
set YX[FO[DO]]=GO[DO]
set RO=RO+1
set OO[RO]=FO[DO]
endif
return FO[DO]
endfunction
function S4E takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) or GetUnitAbilityLevel(GetFilterUnit(),'AIDS') == 0
endfunction
function S5E takes nothing returns nothing
loop
exitwhen NO==0
set NO=NO-1
set BO[0]=AO[NO]
if YX[BO[0]]!=null then
if GetUnitUserData(YX[BO[0]])==0 then
if ZX[BO[0]]==0 then
call TriggerEvaluate(KO)
set EO=EO+1
set VO[EO]=BO[0]
set YX[BO[0]]=null
endif
endif
endif
endloop
endfunction
function S6E takes nothing returns boolean
if GetIssuedOrderId()==852056 then
set MO=GetUnitUserData(GetOrderedUnit())
if AO[NO-1]!=MO then
set AO[NO]=MO
set NO=NO+1
call TimerStart(IO,0,false,function S5E)
endif
endif
return false
endfunction
function S7E takes nothing returns boolean
set DO=DO+1
set GO[DO]=GetFilterUnit()
if GetUnitUserData(GO[DO])==0 then
if S0E(GO[DO])then
if EO==0 then
set XO=XO+1
set FO[DO]=XO
else
set FO[DO]=VO[EO]
set EO=EO-1
endif
call SetUnitUserData(GO[DO],FO[DO])
set YX[FO[DO]]=GO[DO]
call UnitAddAbility(GO[DO],'AIDS')
call UnitMakeAbilityPermanent(GO[DO],true,'AIDS')
call TriggerEvaluate(HO)
else
set FO[DO]=0
call TriggerEvaluate(HO)
endif
endif
set DO=DO-1
return false
endfunction
function S8E takes nothing returns nothing
local region r=CreateRegion()
local group g=CreateGroup()
local integer n=15
local trigger t=CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent(t,Player(n),EVENT_PLAYER_UNIT_ISSUED_ORDER,Filter(function S4E))
call SetPlayerAbilityAvailable(Player(n),'AIDS',false)
exitwhen n==0
set n=n-1
endloop
set n=15
call TriggerAddCondition(t,Filter(function S6E))
set t=null
call RegionAddRect(r,GetWorldBounds())
call TriggerRegisterEnterRegion(CreateTrigger(),r,Filter(function S7E))
set r=null
loop
call GroupEnumUnitsOfPlayer(g,Player(n),Filter(function S7E))
exitwhen n==0
set n=n-1
endloop
call DestroyGroup(g)
set g=null
endfunction
function S9E takes nothing returns nothing
endfunction
function TVE takes integer D0E returns nothing
set ASV[D0E]=ASV[D0E]+.5
set AZV[D0E]=ASV[D0E]<=ATV[D0E]and GetUnitAbilityLevel(AUV[D0E],AQV[D0E])>0
endfunction
function TEE takes integer D0E returns nothing
call UnitRemoveAbility(AUV[D0E],AQV[D0E])
set AUV[D0E]=null
call K6E(D0E)
endfunction
function TXE takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==AYV
if not A_V[A7E[DGE]]then
if AZV[A7E[DGE]]then
call TVE(A7E[DGE])
set DGE=DGE+1
else
call TEE(A7E[DGE])
set AYV=AYV-1
set A7E[DGE]=A7E[AYV]
endif
else
set DGE=DGE+1
endif
endloop
if AYV==0 then
call PauseTimer(AWV)
endif
endfunction
function TRE takes nothing returns nothing
if GetDestructableLife(GetEnumDestructable())>0 then
set bj_forLoopAIndex=bj_forLoopAIndex+1
endif
endfunction
function TIE takes integer D0E returns nothing
set A4V[D0E]=.0
set NNV[D0E]=false
set NAV[D0E]=true
call ShowUnit(A3V[D0E],false)
call RemoveUnit(A3V[D0E])
call K4E(D0E)
endfunction
function TAE takes nothing returns nothing
local integer DGE=1
loop
exitwhen DGE==NBV
if NAV[(DGE)]and NNV[(DGE)]then
set A4V[(DGE)]=A4V[(DGE)]+.2
if A4V[(DGE)]>=A5V[(DGE)]then
call TIE((DGE))
endif
endif
set DGE=DGE+1
endloop
endfunction
function TNE takes real x,real y,real K0E returns integer
local integer TBE=K3E()
set A3V[TBE]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'face',x,y,K0E)
call K1E(TBE,GetUnitTurnSpeed(A3V[TBE]))
call KYE(TBE,x)
call KZE(TBE,y)
set A9V[TBE]=K0E
call K_E(TBE,0)
set NNV[TBE]=true
call UnitAddAbility(A3V[TBE],'Amrf')
call UnitRemoveAbility(A3V[TBE],'Amrf')
if TBE==NBV then
set NBV=NBV+1
endif
return TBE
endfunction
function TCE takes nothing returns nothing
call TimerStart(NCV,.2,true,function TAE)
endfunction
function TFE takes integer D0E returns real
set A4V[(D0E)]=.0
return A6V[D0E]
endfunction
function TGE takes integer D0E,real x returns nothing
set A6V[D0E]=x
call SetUnitX(A3V[D0E],x)
set A4V[(D0E)]=.0
endfunction
function THE takes integer D0E returns real
set A4V[(D0E)]=.0
return A7V[D0E]
endfunction
function TJE takes integer D0E,real y returns nothing
set A7V[D0E]=y
call SetUnitY(A3V[D0E],y)
set A4V[(D0E)]=.0
endfunction
function TKE takes integer D0E returns real
set A4V[(D0E)]=.0
return A8V[D0E]
endfunction
function TLE takes integer D0E,real z returns nothing
set A8V[D0E]=z
call SetUnitFlyHeight(A3V[D0E],z,.0)
set A4V[(D0E)]=.0
endfunction
function TME takes integer D0E,real K0E returns nothing
set A9V[D0E]=P0E(K0E)
call SetUnitFacing(A3V[D0E],K0E)
set A4V[(D0E)]=.0
endfunction
function TPE takes integer D0E,real K0E returns nothing
local integer z=R2I(K0E*.7)
loop
exitwhen z>=0 and z<=252
if z>252 then
set z=z-252
else
set z=z+252
endif
endloop
call SetUnitAnimationByIndex(A3V[D0E],z)
set A4V[(D0E)]=.0
endfunction
function TQE takes integer D0E,real K2E returns nothing
set NVV[D0E]=K2E
call SetUnitTurnSpeed(A3V[D0E],K2E)
set A4V[(D0E)]=.0
endfunction
function TSE takes integer D0E,string TTE,string TUE returns nothing
call AddSpecialEffectTarget(TTE,A3V[D0E],TUE)
set A4V[(D0E)]=.0
endfunction
function GetNextGroup takes nothing returns group
set SO=SO+1
if QO<SO then
set TO[SO]=CreateGroup()
set QO=SO
endif
call MAE(TO[SO])
set A0E[(LoadInteger(Q,GetHandleId((TO[SO])),0))]=SO
return TO[SO]
endfunction
function TWE takes nothing returns nothing
if VR then
call GroupClear(ER)
set VR=false
endif
call GroupAddUnit(ER,GetEnumUnit())
endfunction
function TYE takes nothing returns group
if OR==0 then
set XR[0]=CreateGroup()
else
set OR=OR-1
endif
call SaveInteger(ZO,0,GetHandleId(XR[OR]),1)
return XR[OR]
endfunction
function TZE takes group g returns boolean
local integer id=GetHandleId(g)
if g==null then
return false
elseif not HaveSavedInteger(ZO,0,id)then
return false
elseif LoadInteger(ZO,0,id)==2 then
return false
elseif OR==8191 then
call DestroyGroup(g)
return false
endif
call SaveInteger(ZO,0,id,2)
call GroupClear(g)
set XR[OR]=g
set OR=OR+1
return true
endfunction
function T_E takes nothing returns boolean
return IsUnitInRangeXY(GetFilterUnit(),RR,IR,AR)
endfunction
function T0E takes boolexpr b returns nothing
local integer T1E=GetHandleId(b)
if HaveSavedHandle(NR,0,T1E)then
call LQE(LoadBooleanExprHandle(NR,0,T1E))
call RemoveSavedHandle(NR,0,T1E)
endif
endfunction
function T2E takes group T3E,real x,real y,real CHE,boolexpr CME returns nothing
local real T4E=RR
local real T5E=IR
local real T6E=AR
local integer T1E=0
set RR=x
set IR=y
set AR=CHE
if CME==null then
set CME=Condition(function T_E)
else
set T1E=GetHandleId(CME)
if HaveSavedHandle(NR,0,T1E)then
set CME=LoadBooleanExprHandle(NR,0,T1E)
else
set CME=And(Condition(function T_E),CME)
call SaveBooleanExprHandle(NR,0,T1E,CME)
endif
endif
call GroupEnumUnitsInRange(T3E,x,y,(((CHE)*1.)+197.),CME)
set RR=T4E
set IR=T5E
set AR=T6E
endfunction
function T7E takes nothing returns boolean
return true
endfunction
function T8E takes nothing returns boolean
return false
endfunction
function T9E takes nothing returns nothing
set WO=Condition(function T7E)
set YO=Condition(function T8E)
endfunction
function UVE takes integer D0E returns nothing
local real UEE
local real x
local real y
local real z
set NJV[D0E]=NJV[D0E]+NMV[D0E]
if NJV[D0E]>NKV[D0E]then
call SetUnitFlyHeight(NHV[D0E],GetUnitDefaultFlyHeight(NHV[D0E]),0)
set N_V[D0E]=false
else
set x=NPV[D0E]+NSV[D0E]
set y=NQV[D0E]+NTV[D0E]
set z=PTE(x,y)
set UEE=PUE(NUV[NWV[D0E]+1],NUV[NWV[D0E]],NUV[NWV[D0E]+2],NJV[D0E]/NKV[D0E])+(NUV[NWV[D0E]]-z)
if RectContainsCoords(GR,x,y)then
call SetUnitPosition(NHV[D0E],x,y)
set NPV[D0E]=x
set NQV[D0E]=y
endif
call SetUnitFlyHeight(NHV[D0E],UEE,0)
endif
endfunction
function UXE takes integer D0E returns nothing
set NHV[D0E]=null
call KWE(D0E)
endfunction
function UOE takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==NZV
if not N0V[A8E[DGE]]then
if N_V[A8E[DGE]]then
call UVE(A8E[DGE])
set DGE=DGE+1
else
call UXE(A8E[DGE])
set NZV=NZV-1
set A8E[DGE]=A8E[NZV]
endif
else
set DGE=DGE+1
endif
endloop
if NZV==0 then
call PauseTimer(NYV)
endif
endfunction
function UIE takes integer D0E returns nothing
local real Ux=GetUnitX(N4V[D0E])
local real Uy=GetUnitY(N4V[D0E])
local real Tx=GetUnitX(N5V[D0E])
local real Ty=GetUnitY(N5V[D0E])
local real UAE=PPE(Ux,Uy,Tx,Ty)
local real CDE
if UAE>10. then
set CDE=Atan2(Ty-Uy,Tx-Ux)
set Ux=Ux+N7V[D0E]*Cos(CDE)
set Uy=Uy+N7V[D0E]*Sin(CDE)
call SetUnitPosition(N4V[D0E],Ux,Uy)
call SetUnitFlyHeight(N4V[D0E],N8V[D0E],N9V[D0E])
else
set BRV[D0E]=false
endif
endfunction
function UNE takes integer D0E returns nothing
set DR=N5V[D0E]
set BR=N4V[D0E]
set CR=N6V[D0E]
set FR=BEV[D0E]
call ExecuteFunc(BVV[D0E])
set N4V[D0E]=null
set N5V[D0E]=null
set N6V[D0E]=null
call KTE(D0E)
endfunction
function UBE takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==BOV
if not BIV[A9E[DGE]]then
if BRV[A9E[DGE]]then
call UIE(A9E[DGE])
set DGE=DGE+1
else
call UNE(A9E[DGE])
set BOV=BOV-1
set A9E[DGE]=A9E[BOV]
endif
else
set DGE=DGE+1
endif
endloop
if BOV==0 then
call PauseTimer(BXV)
endif
endfunction
function UDE takes integer D0E returns nothing
local unit a
local group g
local integer c
set BLV[D0E]=BLV[D0E]-BFV[D0E]
if BLV[D0E]>.0 then
set BMV[D0E]=BMV[D0E]+BFV[D0E]*Cos(BGV[D0E])
set BPV[D0E]=BPV[D0E]+BFV[D0E]*Sin(BGV[D0E])
call SetUnitPosition(BCV[D0E],BMV[D0E],BPV[D0E])
call SetUnitFlyHeight(BCV[D0E],BHV[D0E],BJV[D0E])
set g=PSE(BKV[D0E],BMV[D0E],BPV[D0E])
set c=0
loop
set a=FirstOfGroup(g)
exitwhen a==null
call GroupRemoveUnit(g,a)
if PYE(BDV[D0E],a)and a!=BCV[D0E]then
set c=c+1
endif
endloop
call GroupClear(g)
set g=null
set BWV[D0E]=c<=0
else
set BWV[D0E]=false
endif
endfunction
function UFE takes integer D0E returns nothing
set CR=BDV[D0E]
set BR=BCV[D0E]
set FR=BSV[D0E]
call ExecuteFunc(BQV[D0E])
set BCV[D0E]=null
set BDV[D0E]=null
call KQE(D0E)
endfunction
function UGE takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==BUV
if not BYV[NVE[DGE]]then
if BWV[NVE[DGE]]then
call UDE(NVE[DGE])
set DGE=DGE+1
else
call UFE(NVE[DGE])
set BUV=BUV-1
set NVE[DGE]=NVE[BUV]
endif
else
set DGE=DGE+1
endif
endloop
if BUV==0 then
call PauseTimer(BTV)
endif
endfunction
function UJE takes nothing returns nothing
set GR=bj_mapInitialPlayableArea
endfunction
function UKE takes integer D0E,unit u returns boolean
return(IsUnitEnemy(u,CFV[D0E])and GetWidgetLife(u)>=.405 and(IsUnitType(u,UNIT_TYPE_DEAD)!=true))
endfunction
function ULE takes nothing returns boolean
set CUV=GetFilterUnit()
if(B4V[B1V[CSV]]!=null)then
call KJE(CSV,CUV)
endif
if UKE(CSV,CUV)then
call UnitDamageTarget(B9V[CSV],CUV,CCV[CSV],false,false,CKV[CSV],CLV[CSV],null)
if(B5V[B1V[CSV]]!=null)then
call KKE(CSV,CUV)
endif
endif
return true
endfunction
function UME takes nothing returns nothing
set CTV=LoadInteger(QR,GetHandleId(GetTriggerUnit()),0)
if CTV!=0 then
set CAV[CTV]=.0
endif
endfunction
function UPE takes integer D0E returns nothing
local unit UQE=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'face',CMV,CPV,.0)
if UnitAddAbility(UQE,'Amrf')then
call UnitRemoveAbility(UQE,'Amrf')
endif
call SetUnitScale(UQE,CGV[D0E],CGV[D0E],CGV[D0E])
call SetUnitFlyHeight(UQE,CJV[D0E],.0)
call DestroyEffect(AddSpecialEffectTarget(CDV[D0E],UQE,"origin"))
call UnitApplyTimedLife(UQE,'BTLF',1.)
set CSV=D0E
call GroupEnumUnitsInRange(JR,CMV,CPV,CEV[D0E],Condition(function ULE))
set UQE=null
if(B3V[B1V[D0E]]!=null)then
call KHE(D0E)
endif
endfunction
function USE takes integer D0E returns real
local real tx=.0
loop
set tx=GetRandomReal(B7V[D0E]-CVV[D0E],B7V[D0E]+CVV[D0E])
exitwhen(tx>=MR and tx<=KR)
endloop
return tx
endfunction
function UTE takes integer D0E returns real
local real ty=.0
loop
set ty=GetRandomReal(B8V[D0E]-CVV[D0E],B8V[D0E]+CVV[D0E])
exitwhen(ty>=PR and ty<=LR)
endloop
return ty
endfunction
function UUE takes integer D0E returns nothing
local integer a=1
local integer b=0
set CQV=D0E
set CIV[CQV]=CIV[CQV]+.03
if CIV[CQV]>=CNV[CQV]then
set CNV[CQV]=CNV[CQV]+CRV[CQV]
set b=GetRandomInt(COV[CQV],CXV[CQV])
loop
exitwhen a>b
if CHV[CQV]then
set B7V[CQV]=GetUnitX(B9V[CQV])
set B8V[CQV]=GetUnitY(B9V[CQV])
endif
set CMV=USE(CQV)
set CPV=UTE(CQV)
call UPE(CQV)
set a=a+1
endloop
endif
if CIV[CQV]>=CAV[CQV]then
call LIE(CQV)
if(B6V[B1V[CQV]]!=null)then
call KLE(CQV)
endif
if CBV[CQV]then
call FlushChildHashtable(QR,GetHandleId(B9V[CQV]))
endif
call KME(CQV)
endif
endfunction
function UWE takes nothing returns boolean
local integer D0E=CWV[(0)]
loop
exitwhen D0E==0
call UUE(D0E)
set D0E=CWV[D0E]
endloop
return false
endfunction
function UYE takes integer D0E returns nothing
set CYV[CWV[(0)]]=D0E
set CWV[D0E]=CWV[(0)]
set CWV[(0)]=D0E
set CYV[D0E]=(0)
endfunction
function UZE takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function UWE))
endfunction
function U_E takes unit U0E,real x,real y,real U1E,real U2E,real M2E,integer U3E,integer U4E,real ni,real U5E,real U6E,real U7E,boolean U8E,boolean U9E,boolean WVE,string WEE,attacktype at,damagetype dt returns integer
local integer a=1
local integer b=GetRandomInt(U3E,U4E)
set CQV=LAE()
set B9V[CQV]=U0E
set CFV[CQV]=GetOwningPlayer(U0E)
set B7V[CQV]=x
set B8V[CQV]=y
set CHV[CQV]=WVE
set CJV[CQV]=M2E
set CVV[CQV]=U1E
set CCV[CQV]=U6E
set CBV[CQV]=U8E
set CDV[CQV]=WEE
set COV[CQV]=U3E
set CXV[CQV]=U4E
set CRV[CQV]=ni
set CNV[CQV]=ni
set CAV[CQV]=U5E
set CGV[CQV]=U7E
set CEV[CQV]=U2E
set CIV[CQV]=.0
set CKV[CQV]=at
set CLV[CQV]=dt
if U8E then
call SaveInteger(QR,GetHandleId(U0E),0,CQV)
endif
call UYE(CQV)
if U9E then
loop
exitwhen a>b
set CMV=USE(CQV)
set CPV=UTE(CQV)
call KHE(CQV)
set a=a+1
endloop
endif
return CQV
endfunction
function WXE takes nothing returns nothing
local trigger WOE=CreateTrigger()
local integer i=0
set KR=GetRectMaxX(bj_mapInitialPlayableArea)
set LR=GetRectMaxY(bj_mapInitialPlayableArea)
set MR=GetRectMinX(bj_mapInitialPlayableArea)
set PR=GetRectMinY(bj_mapInitialPlayableArea)
call TriggerAddAction(WOE,function UME)
loop
exitwhen i>15
call TriggerRegisterPlayerUnitEvent(WOE,Player(i),EVENT_PLAYER_UNIT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(WOE,Player(i),EVENT_PLAYER_UNIT_ISSUED_ORDER,null)
call TriggerRegisterPlayerUnitEvent(WOE,Player(i),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
call TriggerRegisterPlayerUnitEvent(WOE,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
set i=i+1
endloop
endfunction
function WRE takes integer i1,integer i2,integer i3,integer i4,integer i5,integer i6,integer MHE,string WIE,string WAE,boolean WNE,integer WBE returns integer
local integer i=KIE()
local integer WCE
local integer WDE
local boolean WFE=false
local boolean array b
local integer j=0
local integer k
local integer l=0
set DEV[DXV[i]]=i1
set DEV[DXV[i]+1]=i2
set DEV[DXV[i]+2]=i3
set DEV[DXV[i]+3]=i4
set DEV[DXV[i]+4]=i5
set DEV[DXV[i]+5]=i6
set DOV[i]=MHE
set DBV[i]=true
set DNV[i]=WNE
set DRV[i]=WBE
set b[0]=true
set b[1]=i2!=i1
set b[2]=i3!=i2 and i3!=i1
set b[3]=i4!=i3 and i4!=i2 and i4!=i1
set b[4]=i5!=i4 and i5!=i3 and i5!=i2 and i5!=i1
set b[5]=i6!=i5 and i6!=i4 and i6!=i3 and i6!=i2 and i6!=i1
if WIE=="" then
set DIV[i]="Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl"
else
set DIV[i]=WIE
endif
if WAE=="" then
set DAV[i]="origin"
else
set DAV[i]=WAE
endif
loop
if DEV[DXV[i]+j]!=0 and b[j]then
set k=(LoadInteger(CX,((UR)),(DEV[DXV[i]+j])))
if k!=0 then
set WCE=(k)
set k=0
loop
exitwhen WFE or C0V[WCE+k]==0
set k=k+1
if k==C1V then
set WFE=true
endif
endloop
else
set WCE=KCE()
set k=0
endif
exitwhen WFE
set C0V[WCE+k]=i
call SaveInteger(CX,((UR)),(DEV[DXV[i]+j]),((WCE)))
endif
set j=j+1
exitwhen j==6
endloop
if not WFE then
set k=(LoadInteger(CX,((WR)),(DOV[i])))
if k!=0 then
set WDE=(k)
set k=0
loop
exitwhen WFE or C5V[WDE+k]==0
set k=k+1
if k==C6V then
set WFE=true
endif
endloop
else
set WDE=KNE()
endif
if not WFE then
set C5V[WDE+k]=i
call SaveInteger(CX,((WR)),(DOV[i]),((WDE)))
endif
endif
if WFE then
call KAE(i)
return(0)
else
return i
endif
endfunction
function WGE takes integer D0E,integer it returns nothing
local integer i=0
local integer j=0
local integer k
local integer WCE=((LoadInteger(CX,((UR)),(it))))
if it==0 or(C0V[WCE])==0 then
return
endif
loop
exitwhen i==C1V
if C0V[WCE+i]==D0E then
set j=i+1
loop
exitwhen j==C1V or C0V[WCE+j]==0
set j=j+1
endloop
set j=j-1
set C0V[WCE+i]=C0V[WCE+j]
set C0V[WCE+j]=0
exitwhen true
endif
set i=i+1
endloop
if(C0V[WCE])==0 then
call RemoveSavedInteger(CX,((UR)),(it))
call KDE(WCE)
endif
endfunction
function WHE takes integer D0E,integer it returns nothing
local integer i=0
local integer j
local integer WDE=((LoadInteger(CX,((WR)),(it))))
if it==0 then
return
endif
loop
exitwhen i==C6V
if C5V[WDE+i]==D0E then
set j=i+1
loop
exitwhen j==C6V or C5V[WDE+j]==0
set j=j+1
endloop
set j=j-1
set C5V[WDE+i]=C5V[WDE+j]
set C5V[WDE+j]=0
exitwhen true
endif
set i=i+1
endloop
if C5V[WDE]==0 then
call RemoveSavedInteger(CX,((WR)),(it))
call KBE(WDE)
endif
endfunction
function ZSE takes nothing returns boolean
local integer D0E=(PRE())
if D4V[D0E]then
set D5V[D0E]=false
return true
endif
set BA=(YX[((D0E))])
set CA=GetUnitX(BA)
set DA=GetUnitY(BA)
if(not IsUnitPaused(BA))and GetUnitAbilityLevel(BA,'BSTN')==0 and GetUnitAbilityLevel(BA,'BPSE')==0 then
if CA!=D6V[D0E]or DA!=D7V[D0E]then
set FA=CA-D6V[D0E]
set GA=DA-D7V[D0E]
if D3V[D0E]!=.0 then
set CA=CA+FA*D3V[D0E]
set DA=DA+GA*D3V[D0E]
endif
if D2V[D0E]!=.0 then
set HA=SquareRoot(FA*FA+GA*GA)
set CA=CA+FA/HA*D2V[D0E]
set DA=DA+GA/HA*D2V[D0E]
endif
call SetUnitX(BA,CA)
call SetUnitY(BA,DA)
endif
endif
set D6V[D0E]=CA
set D7V[D0E]=DA
return false
endfunction
function ZTE takes integer D0E returns nothing
if not D5V[D0E]then
call PFE(function ZSE,D0E,.00625)
set D5V[D0E]=true
set D4V[D0E]=false
set D6V[D0E]=GetUnitX((YX[((D0E))]))
set D7V[D0E]=GetUnitY((YX[((D0E))]))
endif
if D2V[D0E]==.0 and D3V[D0E]==.0 then
set D4V[D0E]=true
endif
endfunction
function ZUE takes unit u,real SZE returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=D2V[d]+SZE*.00625
call ZTE(d)
endfunction
function ZWE takes unit u,real SZE returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=SZE*.00625
call ZTE(d)
endfunction
function ZYE takes unit u returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=.0
call ZTE(d)
endfunction
function ZZE takes unit u,real QCE returns nothing
local integer d=(GetUnitUserData(((u))))
set D3V[d]=D3V[d]+QCE
call ZTE(d)
endfunction
function WSE takes integer WTE,unit u,item WUE returns boolean
local integer array WWE
local integer WYE=GetItemTypeId(WUE)
local integer WZE
local integer W_E=0
local integer W0E=0
local integer i=0
local integer j=0
local item W1E
local item array W2E
loop
set WWE[i]=DEV[DXV[WTE]+i]
set i=i+1
exitwhen i==6
endloop
set i=0
loop
set WZE=GetItemTypeId(UnitItemInSlot(u,i))
loop
if WWE[j]==WYE and WUE!=null then
set W2E[j]=WUE
set WWE[j]=0
set WUE=null
exitwhen true
elseif WWE[j]==WZE and WZE!=0 then
set W2E[j]=UnitItemInSlot(u,i)
set WWE[j]=0
exitwhen true
endif
set j=j+1
exitwhen j==6
endloop
set j=0
set i=i+1
exitwhen i==6
endloop
set WUE=null
set i=0
set j=0
loop
if WWE[i]!=0 then
loop
set W2E[j]=null
set j=j+1
exitwhen j==6
endloop
return false
endif
set i=i+1
exitwhen i==6
endloop
set i=0
loop
set j=GetItemCharges(W2E[i])
set W0E=W0E+j
if j>W_E then
set W_E=j
endif
call RemoveSavedInteger(CX,((YR)),GetHandleId((W2E[i])))
call RemoveItem(W2E[i])
set W2E[i]=null
set i=i+1
exitwhen i==6
endloop
set W1E=UnitAddItemById(u,DOV[WTE])
call DestroyEffect(AddSpecialEffectTarget(DIV[WTE],u,DAV[WTE]))
if DNV[WTE]then
if DRV[WTE]==0 then
call SetItemCharges(W1E,W0E)
elseif DRV[WTE]==-1 then
call SetItemCharges(W1E,W_E)
else
call SetItemCharges(W1E,DRV[WTE])
endif
endif
call SaveInteger(CX,((YR)),GetHandleId((W1E)),((WTE)))
set bj_lastCreatedItem=W1E
if GetItemTypeId(W1E)=='I04I' then// and GetUnitAbilityLevel(u,'A078') != 1 then
call UnitDropItemPoint(u,W1E,GetUnitX(u),GetUnitY(u))
endif
set W1E=null
return true
endfunction
function W3E takes item W4E,unit u returns boolean
local boolean W5E=UnitHasItem(u,W4E)
local integer r=((LoadInteger(CX,((UR)),(GetItemTypeId(W4E)))))
local integer i=0
if W4E==null then
return false
endif
loop
exitwhen(C0V[r+i])==0 or i==C1V
if DBV[C0V[r+i]]then
if W5E then
if WSE(C0V[r+i],u,null)then
return true
endif
else
if WSE(C0V[r+i],u,W4E)then
return true
endif
endif
endif
set i=i+1
endloop
return false
endfunction
function W6E takes nothing returns boolean
local real dx
local real dy
if GetIssuedOrderId()==851971then
if GetOrderTargetItem()==null then
return false
endif
set dx=GetItemX(GetOrderTargetItem())-GetUnitX(GetTriggerUnit())
set dy=GetItemY(GetOrderTargetItem())-GetUnitY(GetTriggerUnit())
if dx*dx+dy*dy<=SR then
return W3E(GetOrderTargetItem(),GetTriggerUnit())
endif
return false
endif
return W3E(GetManipulatedItem(),GetTriggerUnit())
endfunction
function W7E takes nothing returns boolean
return true
endfunction
function W8E takes nothing returns nothing
local integer DGE=0
if true then
loop
call TriggerRegisterPlayerUnitEvent(TR,Player(DGE),EVENT_PLAYER_UNIT_PICKUP_ITEM,Filter(function W7E))
if not false then
call TriggerRegisterPlayerUnitEvent(TR,Player(DGE),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,Filter(function W7E))
endif
set DGE=DGE+1
exitwhen DGE==16
endloop
call TriggerAddCondition(TR,Condition(function W6E))
endif
set UR=LXE()
set WR=LXE()
set YR=LVE()
endfunction
function W9E takes nothing returns nothing
set DCV=LXE()
endfunction
function YVE takes string t returns integer
local integer i=StringHash(t)
if(LoadInteger(CX,((DCV)),(i)))==0 then
set VI=VI+1
call SaveInteger(CX,((DCV)),(i),(VI))
set ZR[VI]=t
return VI
endif
return(LoadInteger(CX,((DCV)),(i)))
endfunction
function YIE takes timer t returns nothing
local integer DGE=(LoadInteger(Q,GetHandleId((t)),0))
call PauseTimer(t)
call MNE(t)
set A1E[XI]=t
set XI=XI+1
endfunction
function YAE takes nothing returns nothing
call RemoveUnit(DDV[DHV])
set DDV[DHV]=null
set DHV=((DHV)+1)
if(DHV==DGV)then
set DHV=0
set DGV=0
else
call TimerStart(OI,DFV[DHV]-TimerGetElapsed(RI),false,function YAE)
endif
endfunction
function YNE takes nothing returns nothing
set OI=CreateTimer()
set RI=CreateTimer()
call TimerStart(RI,43200,true,null)
endfunction
function YBE takes real x,real y,real K0E returns integer
local integer D0E=KRE()
set DPV[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'e005',x,y,K0E*bj_RADTODEG)
call UnitAddAbility(DPV[D0E],'Amrf')
call UnitAddAbility(DPV[D0E],'Aloc')
call UnitRemoveAbility(DPV[D0E],'Amrf')
call SetUnitX(DPV[D0E],x)
call SetUnitY(DPV[D0E],y)
return D0E
endfunction
function YCE takes integer D0E,real YDE returns nothing
call SetUnitScale(DPV[D0E],YDE,YDE,YDE)
endfunction
function YHE takes integer D0E,string YJE returns nothing
if(DQV[D0E]!=null)then
call DestroyEffect(DQV[D0E])
endif
if(YJE=="")then
set DQV[D0E]=null
else
set DQV[D0E]=AddSpecialEffectTarget(YJE,DPV[D0E],"origin")
endif
endfunction
function YKE takes integer D0E returns nothing
if(DZV[D0E]!=0)then
call UnitRemoveAbility(DPV[D0E],DZV[D0E])
endif
if(DQV[D0E]!=null)then
call DestroyEffect(DQV[D0E])
set DQV[D0E]=null
endif
if(DGV==8190)then
call TimerStart(OI,0,false,function YAE)
call ExplodeUnitBJ(DPV[D0E])
else
set DDV[DGV]=DPV[D0E]
set DFV[DGV]=TimerGetElapsed(RI)+4.
set DGV=((DGV)+1)
if(DGV==1)then
call TimerStart(OI,4.,false,function YAE)
endif
call SetUnitOwner(DPV[D0E],Player(PLAYER_NEUTRAL_PASSIVE),false)
endif
set DPV[D0E]=null
endfunction
function YLE takes integer D0E returns nothing
if D0E==null then
return
elseif(DLV[D0E]!=-1)then
return
endif
call YKE(D0E)
set DLV[D0E]=DJV
set DJV=D0E
endfunction
function Damage_GetType takes nothing returns damagetype
return BI[NI]
endfunction
function Damage_IsAttack takes nothing returns boolean
return CI[NI]
endfunction
function Damage_BlockAll takes nothing returns nothing
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
endfunction
function YME takes nothing returns nothing
loop
exitwhen GI==0
set KI=FI[GI]
set JI=GetWidgetLife(KI)
call UnitRemoveAbility(KI,'dprv')
if JI>.405 then
call SetWidgetLife(KI,JI)
endif
set GI=GI-1
endloop
endfunction
function YPE takes nothing returns boolean
if AI and GetEventDamage()!=.0 then
call MEE(II)
if DI[NI]!=.0 then
set LI=GetTriggerUnit()
set MI=GetEventDamage()
if DI[NI]>=MI then
set MI=GetWidgetLife(LI)+MI
else
set MI=GetWidgetLife(LI)+DI[NI]
endif
call SetWidgetLife(LI,MI)
if GetWidgetLife(LI)<MI then
call UnitAddAbility(LI,'dprv')
call SetWidgetLife(LI,MI)
set GI=GI+1
set FI[GI]=LI
call ResumeTimer(HI)
endif
set DI[NI]=.0
endif
endif
return false
endfunction
function UnitDamageTargetEx takes unit J2E,widget YSE,real YTE,boolean YUE,boolean YWE,attacktype YYE,damagetype YZE,weapontype Y_E returns boolean
local boolean MHE
set NI=NI+1
set BI[NI]=YZE
set CI[NI]=YUE
set MHE=UnitDamageTarget(J2E,YSE,YTE,YUE,YWE,YYE,YZE,Y_E)
set NI=NI-1
return MHE
endfunction
function Damage_IsPure takes nothing returns boolean
return(BI[NI])==DAMAGE_TYPE_UNIVERSAL
endfunction
function Damage_IsSpell takes nothing returns boolean
return(BI[NI])==DAMAGE_TYPE_MAGIC
endfunction
function Y0E takes unit CBE,unit YSE,real YTE,attacktype Y1E,boolean YUE,boolean YWE returns boolean
return UnitDamageTargetEx(CBE,YSE,YTE,YUE,YWE,Y1E,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
function Damage_IsPhysical takes nothing returns boolean
return(BI[NI])==DAMAGE_TYPE_NORMAL
endfunction
function Y2E takes nothing returns boolean
if(S0E(((GO[DO]))))then
set D_V[(S1E())]=true
call KOE(((FO[DO])))
endif
return false
endfunction
function Y3E takes nothing returns boolean
if(S0E(((GO[DO]))))then
set D_V[((FO[DO]))]=true
call KOE(((FO[DO])))
endif
return false
endfunction
function Y4E takes nothing returns boolean
if D_V[((BO[CO]))]then
call DestroyTrigger(D1V[(((BO[CO])))])
set D_V[((BO[CO]))]=false
endif
return false
endfunction
function Y5E takes nothing returns nothing
call TriggerAddCondition(HO,(Filter(function Y2E)))
call TriggerAddCondition(JO,(Filter(function Y3E)))
call TriggerAddCondition(KO,(Filter(function Y4E)))
call TriggerEvaluate(NYE)
endfunction
function s__Damage___Detector_AIDS_onInit takes nothing returns nothing
set D0V=Condition(function YPE)
endfunction
function Y6E takes nothing returns nothing
local unit Y7E=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'uloc',0,0,0)
call UnitAddAbility(Y7E,'dprv')
call RemoveUnit(Y7E)
set Y7E=null
set II=MVE()
set BI[NI]=DAMAGE_TYPE_NORMAL
set CI[NI]=true
call TimerStart(HI,.0,false,function YME)
endfunction
function Y8E takes nothing returns boolean
return IsUnitInGroup(GetEventDamageSource(),TI)
endfunction
function Y9E takes nothing returns nothing
local integer id=(LoadInteger(Q,GetHandleId((GetEventDamageSource())),0))
local triggercondition tc
set WI=A3E[id]
set YI=A4E[id]
set ZI=GetEventDamage()
set tc=TriggerAddCondition(SI,A2E[id])
call TriggerEvaluate(SI)
call TriggerRemoveCondition(SI,tc)
call LQE(A2E[id])
call GroupRemoveUnit(TI,A3E[id])
call MNE(A3E[id])
set A2E[id]=null
set A3E[id]=null
set A4E[id]=null
set tc=null
endfunction
function ZVE takes nothing returns nothing
set TI=CreateGroup()
set UI=CreateGroup()
set QI=CreateTrigger()
set SI=CreateTrigger()
call TriggerAddAction(QI,function Y9E)
call TriggerAddCondition(QI,Condition(function Y8E))
endfunction
function ZEE takes unit ZXE,real x,real y,real CHE,boolexpr b returns unit
local group g=TYE()
local real ZOE=VA
local real CCE
local unit u
call T2E(g,x,y,CHE,b)
loop
set u=FirstOfGroup(g)
exitwhen u==null
set CCE=Pow(x-GetUnitX(u),2.)+Pow(y-GetUnitY(u),2.)
if CCE<ZOE then
set ZOE=CCE
set ZXE=u
endif
call GroupRemoveUnit(g,u)
endloop
call TZE(g)
return ZXE
endfunction
function ZRE takes nothing returns nothing
local real CCE=Pow(RA-GetDestructableX(GetEnumDestructable()),2.)+Pow(IA-GetDestructableY(GetEnumDestructable()),2.)
if CCE<=OA and CCE<XA then
set AA=GetEnumDestructable()
set XA=CCE
endif
endfunction
function ZFE takes nothing returns nothing
local real CCE=Pow(RA-GetItemX(GetEnumItem()),2.)+Pow(IA-GetItemY(GetEnumItem()),2.)
if CCE<=OA and CCE<XA then
set NA=GetEnumItem()
set XA=CCE
endif
endfunction
function ZJE takes unit u returns boolean
return GetUnitAbilityLevel(u,'Aloc')==0 and not IsUnitType(u,UNIT_TYPE_STRUCTURE)
endfunction
function ZKE takes integer D0E returns nothing
set D2V[D0E]=.0
set D3V[D0E]=.0
endfunction
function ZLE takes nothing returns boolean
if(ZJE(((GO[DO]))))then
set D8V[(S1E())]=true
call ZKE(((FO[DO])))
endif
return false
endfunction
function ZME takes nothing returns boolean
if(ZJE(((GO[DO]))))then
set D8V[((FO[DO]))]=true
call ZKE(((FO[DO])))
endif
return false
endfunction
function ZPE takes nothing returns boolean
if D8V[((BO[CO]))]then
set D4V[(((BO[CO])))]=true
set D8V[((BO[CO]))]=false
endif
return false
endfunction
function ZQE takes nothing returns nothing
call TriggerAddCondition(HO,(Filter(function ZLE)))
call TriggerAddCondition(JO,(Filter(function ZME)))
call TriggerAddCondition(KO,(Filter(function ZPE)))
call S9E()
endfunction
/*function ZSE takes nothing returns boolean
local integer D0E=(PRE())
if D4V[D0E]then
set D5V[D0E]=false
return true
endif
set BA=(YX[((D0E))])
set CA=GetUnitX(BA)
set DA=GetUnitY(BA)
if(not IsUnitPaused(BA))and GetUnitAbilityLevel(BA,'BSTN')==0 and GetUnitAbilityLevel(BA,'BPSE')==0 then
if CA!=D6V[D0E]or DA!=D7V[D0E]then
set FA=CA-D6V[D0E]
set GA=DA-D7V[D0E]
if D3V[D0E]!=.0 then
set CA=CA+FA*D3V[D0E]
set DA=DA+GA*D3V[D0E]
endif
if D2V[D0E]!=.0 then
set HA=SquareRoot(FA*FA+GA*GA)
set CA=CA+FA/HA*D2V[D0E]
set DA=DA+GA/HA*D2V[D0E]
endif
call SetUnitX(BA,CA)
call SetUnitY(BA,DA)
endif
endif
set D6V[D0E]=CA
set D7V[D0E]=DA
return false
endfunction*/
/*function ZTE takes integer D0E returns nothing
if not D5V[D0E]then
call PFE(function ZSE,D0E,.00625)
set D5V[D0E]=true
set D4V[D0E]=false
set D6V[D0E]=GetUnitX((YX[((D0E))]))
set D7V[D0E]=GetUnitY((YX[((D0E))]))
endif
if D2V[D0E]==.0 and D3V[D0E]==.0 then
set D4V[D0E]=true
endif
endfunction
function ZUE takes unit u,real SZE returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=D2V[d]+SZE*.00625
call ZTE(d)
endfunction
function ZWE takes unit u,real SZE returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=SZE*.00625
call ZTE(d)
endfunction
function ZYE takes unit u returns nothing
local integer d=(GetUnitUserData(((u))))
set D2V[d]=.0
call ZTE(d)
endfunction
function ZZE takes unit u,real QCE returns nothing
local integer d=(GetUnitUserData(((u))))
set D3V[d]=D3V[d]+QCE
call ZTE(d)
endfunction*/
function Z_E takes unit J2E returns integer
local integer i=1
loop
exitwhen i==F7V
if A3V[FHV[(i)]]==J2E then
return(i)
endif
set i=i+1
endloop
return 0
endfunction
function s__Missile_create takes nothing returns integer
local integer J7E=LRE()
set FKV[J7E]=P8E(.0,.0,.0)
set FLV[J7E]=P8E(.0,.0,.0)
set FMV[J7E]=P8E(.0,.0,.0)
set FPV[J7E]=P8E(.0,.0,.0)
call DTE((FKV[J7E]),false)
call DTE((FLV[J7E]),false)
call DTE((FPV[J7E]),false)
call DTE((FMV[J7E]),false)
set F4V[J7E]=true
call J9E(J7E)
if J7E==F7V then
set F7V=F7V+1
endif
return J7E
endfunction
function Z0E takes integer D0E returns nothing
set FHV[D0E]=TNE(DJE(FKV[D0E]),DLE(FKV[D0E]),QEE(FPV[D0E])*57.295779)
call TQE(FHV[D0E],10.)
call TLE(FHV[D0E],DPE(FKV[D0E])-QME(DJE(FKV[D0E]),DLE(FKV[D0E])))
call TSE(FHV[D0E],FJV[D0E],"origin")
set NAV[(FHV[D0E])]=false
endfunction
function Z1E takes integer D0E returns nothing
call KEE(D0E)
call TIE(FHV[D0E])
call P7E(FKV[D0E])
call P7E(FMV[D0E])
call P7E(FPV[D0E])
call P7E(FLV[D0E])
call DestroyGroup(FZV[D0E])
set F5V[D0E]=false
call KXE(D0E)
endfunction
function Z2E takes integer D0E,real x,real y,real z returns nothing
if not F5V[D0E]then
call DKE(FKV[D0E],x)
call DME(FKV[D0E],y)
call DQE(FKV[D0E],z+QME(x,y))
call DKE(FLV[D0E],x)
call DME(FLV[D0E],y)
call DQE(FLV[D0E],z+QME(x,y))
endif
endfunction
function Z3E takes integer D0E returns real
if not F4V[D0E]then
return DJE(FLV[D0E])
endif
return .0
endfunction
function Z4E takes integer D0E returns real
if not F4V[D0E]then
return DLE(FLV[D0E])
endif
return .0
endfunction
function Z5E takes integer D0E returns unit
if not F4V[D0E]then
return FYV[D0E]
endif
return null
endfunction
function Z6E takes integer D0E,real SZE returns nothing
set FWV[D0E]=FWV[D0E]*SZE*.0233333
call QBE(FPV[D0E],FWV[D0E])
endfunction
function Z7E takes integer D0E returns nothing
call Z0E(D0E)
call J8E(D0E)
set F5V[D0E]=true
endfunction
function Z8E takes integer D0E,unit J2E returns nothing
if not F3V[D0E]and not F4V[D0E]then
set FYV[D0E]=J2E
call DKE(FKV[D0E],TFE(FHV[D0E]))
call DME(FKV[D0E],THE(FHV[D0E]))
call DQE(FKV[D0E],TKE(FHV[D0E])+QME(TFE(FHV[D0E]),THE(FHV[D0E])))
call DKE(FMV[D0E],Z3E(D0E))
call DME(FMV[D0E],Z4E(D0E))
if GetUnitFlyHeight(J2E)==.0 then
call DQE(FMV[D0E],50.+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
else
call DQE(FMV[D0E],GetUnitFlyHeight(J2E)+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
endif
set FUV[D0E]=QVE(QIE(FKV[D0E],FMV[D0E]))
set FTV[D0E]=0
call P7E(FPV[D0E])
set FPV[D0E]=QGE(QIE(FKV[D0E],FMV[D0E]))
call QBE(FPV[D0E],FWV[D0E])
call DTE((FPV[D0E]),false)
set F4V[D0E]=true
endif
endfunction
function Z9E takes integer D0E,unit J2E returns nothing
if not F5V[D0E]then
set FYV[D0E]=J2E
call DKE(FMV[D0E],GetUnitX(J2E))
call DME(FMV[D0E],GetUnitY(J2E))
if GetUnitFlyHeight(J2E)==.0 then
call DQE(FMV[D0E],50.+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
else
call DQE(FMV[D0E],GetUnitFlyHeight(J2E)+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
endif
set FUV[D0E]=QVE(QIE(FKV[D0E],FMV[D0E]))
call P7E(FPV[D0E])
set FPV[D0E]=QGE(QIE(FKV[D0E],FMV[D0E]))
call QBE(FPV[D0E],FWV[D0E])
call DTE((FPV[D0E]),false)
endif
endfunction
function VVX takes integer D0E returns nothing
local real d
if FYV[D0E]!=null then
set d=QVE(QIE(FLV[D0E],FMV[D0E]))
call DKE(FMV[D0E],GetUnitX(FYV[D0E]))
call DME(FMV[D0E],GetUnitY(FYV[D0E]))
if GetUnitFlyHeight(FYV[D0E])==.0 then
call DQE(FMV[D0E],50.+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
else
call DQE(FMV[D0E],GetUnitFlyHeight(FYV[D0E])+QME(DJE(FMV[D0E]),DLE(FMV[D0E])))
endif
set d=QVE(QIE(FLV[D0E],FMV[D0E]))-d
set FUV[D0E]=FUV[D0E]+d
call P7E(FPV[D0E])
set FPV[D0E]=QGE(QIE(FLV[D0E],FMV[D0E]))
call QBE(FPV[D0E],FWV[D0E])
call DTE((FPV[D0E]),false)
endif
endfunction
function VEX takes integer D0E returns nothing
if FYV[D0E]!=null and GetWidgetLife(FYV[D0E])<.405 then
call Z1E(D0E)
endif
call QOE(FLV[D0E],FPV[D0E])
set FTV[D0E]=FTV[D0E]+QVE(FPV[D0E])
endfunction
function VXX takes integer D0E returns nothing
local real d=FUV[D0E]
local real x=FTV[D0E]
local real a=QEE(QIE(FLV[D0E],FMV[D0E]))
if FSV[D0E]!=.0 then
call DKE(GVV,DJE(FLV[D0E])+P4E(FSV[D0E],d,x)*Sin(a))
call DME(GVV,DLE(FLV[D0E])-P4E(FSV[D0E],d,x)*Cos(a))
endif
endfunction
function VOX takes integer D0E returns nothing
local real d=FUV[D0E]
local real x=FTV[D0E]
call DQE(FLV[D0E],P5E(FQV[D0E],d,x,DPE(FKV[D0E]),DPE(FMV[D0E])))
endfunction
function VRX takes integer D0E returns nothing
if FSV[D0E]!=.0 then
call TGE(FHV[D0E],DJE(GVV))
call TJE(FHV[D0E],DLE(GVV))
else
call TGE(FHV[D0E],DJE(FLV[D0E]))
call TJE(FHV[D0E],DLE(FLV[D0E]))
endif
call TLE(FHV[D0E],DPE(FLV[D0E])-QME(TFE(FHV[D0E]),THE(FHV[D0E])))
endfunction
function VIX takes integer D0E returns nothing
if QHE(FMV[D0E],TFE(FHV[D0E]),THE(FHV[D0E]),TKE(FHV[D0E]),32.)or FTV[D0E]>FUV[D0E]then
set F4V[D0E]=false
call J0E(D0E)
if F3V[D0E]then
set F5V[D0E]=false
call Z1E(D0E)
endif
endif
endfunction
function VAX takes integer D0E returns nothing
if TKE(FHV[D0E])<QME(TFE(FHV[D0E]),THE(FHV[D0E]))and F2V[D0E]then
call J5E(D0E,TFE(FHV[D0E]),THE(FHV[D0E]))
endif
endfunction
function VNX takes integer D0E returns nothing
local real d=FUV[D0E]
local real x=FTV[D0E]
local real s=QVE(FPV[D0E])
local real z0=P4E(FSV[D0E],d,x)
local real z1=P4E(FSV[D0E],d,x+s)
local real a=Atan2(z1-z0,s)*-1*57.295779
if FSV[D0E]!=0 then
call TME(FHV[D0E],a+QEE(FPV[D0E])*57.295779)
else
call TME(FHV[D0E],QEE(FPV[D0E])*57.295779)
endif
endfunction
function VBX takes integer D0E returns nothing
local real d=FUV[D0E]
local real x=FTV[D0E]
local real s=QVE(FPV[D0E])
local real z0=P5E(FQV[D0E],d,x,DPE(FKV[D0E]),DPE(FMV[D0E]))
local real z1=P5E(FQV[D0E],d,x+s,DPE(FKV[D0E]),DPE(FMV[D0E]))
call TPE(FHV[D0E],Atan2(z1-z0,s)*57.295779)
endfunction
function VCX takes nothing returns boolean
local integer TBE=F6V
local unit VDX=GetFilterUnit()
if Z_E(VDX)!=0 and F_V[TBE]and not IsUnitInGroup(VDX,FZV[TBE])and QJE(Z_E(VDX),TBE,32.)then
call J6E(TBE,Z_E(VDX))
call GroupAddUnit(FZV[TBE],VDX)
return false
endif
if not IsUnitInGroup(VDX,FZV[TBE])then
call GroupAddUnit(FZV[TBE],VDX)
call J1E(TBE,VDX)
return false
endif
return false
endfunction
function VFX takes nothing returns boolean
call J3E(F6V,GetFilterDestructable())
return false
endfunction
function VGX takes nothing returns nothing
local integer i=1
local integer TBE=0
loop
exitwhen i==F7V
if F5V[(i)]then
set TBE=(i)
call VVX(TBE)
call VEX(TBE)
call VXX(TBE)
call VOX(TBE)
call VRX(TBE)
call VIX(TBE)
call VAX(TBE)
call VNX(TBE)
call VBX(TBE)
set F6V=TBE
call GroupEnumUnitsInRange(FZV[TBE],TFE(FHV[TBE]),THE(FHV[TBE]),32.,Condition(function VCX))
if F1V[TBE]then
call SetRect(F9V,TFE(FHV[TBE])-32.,THE(FHV[TBE])-32.,TFE(FHV[TBE])+32.,THE(FHV[TBE])+32.)
call EnumDestructablesInRect(F9V,Condition(function VFX),null)
endif
call KVE(TBE)
endif
set i=i+1
endloop
endfunction
function VHX takes nothing returns nothing
set F9V=Rect(.0,.0,.0,.0)
set GVV=P8E(.0,.0,.0)
call DTE((GVV),false)
call TimerStart(F8V,.03,true,function VGX)
endfunction
function s__GameMode_enable takes nothing returns nothing
set GXV=true
endfunction
function s__GameMode_disable takes nothing returns nothing
set GXV=false
endfunction
function s__GameMode__get_enabled takes nothing returns boolean
return GXV
endfunction
function VJX takes string Q7E,boolean VKX,code c returns integer
local integer D0E=YVE(Q7E)
set GRV[D0E]=VKX
set GOV[D0E]=Filter(c)
set GBV[D0E]=true
return D0E
endfunction
function VLX takes string s returns string
local string MRE=""
local string VMX=""
local integer DGE=0
local integer VPX=StringLength(s)
loop
exitwhen DGE>=VPX
set VMX=SubString(s,DGE,DGE+1)
if" "!=VMX then
set MRE=MRE+VMX
endif
set DGE=DGE+1
endloop
return MRE
endfunction
function VQX takes nothing returns boolean
local integer D0E
local integer DGE=1
local integer id=GetPlayerId(GetTriggerPlayer())
local integer VPX
local string LZE
if GXV and not GAV[id]then
call TriggerClearConditions(GEV)
set LZE=VLX(StringCase(GetEventPlayerChatString(),false))
set VPX=StringLength(LZE)
loop
exitwhen DGE>=VPX
set D0E=(LoadInteger(CX,((DCV)),(StringHash((SubString(LZE,DGE,DGE+2))))))
if GIV[D0E*12+id]and GBV[D0E]then
if GRV[D0E]then
call TriggerAddCondition(GEV,GOV[D0E])
elseif not GRV[D0E]and DGE==1 then
call TriggerAddCondition(GEV,GOV[D0E])
exitwhen true
endif
endif
set DGE=DGE+2
endloop
return TriggerEvaluate(GEV)
endif
return false
endfunction
function VSX takes nothing returns nothing
local trigger t=CreateTrigger()
local integer i=11
local player p
loop
set p=Player(i)
if GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p)==MAP_CONTROL_USER then
call TriggerRegisterPlayerChatEvent(t,p,"-",false)
endif
exitwhen i==0
set i=i-1
endloop
call TriggerAddCondition(t,Condition(function VQX))
set t=null
set p=null
endfunction
function EnableGameModes takes nothing returns nothing
set GXV=true
endfunction
function DisableGameModes takes nothing returns nothing
set GXV=false
endfunction
function GameModesEnabled takes nothing returns boolean
return(GXV)
endfunction
function GetTotalProjectiles takes nothing returns integer
return JKE(QA)
endfunction
function VTX takes nothing returns boolean
if(GetUnitTypeId(((GO[DO])))=='e001')then
set GCV[(S1E())]=true
set GDV[(((FO[DO])))]=0
endif
return false
endfunction
function VUX takes nothing returns boolean
if(GetUnitTypeId(((GO[DO])))=='e001')then
set GCV[((FO[DO]))]=true
set GDV[(((FO[DO])))]=0
endif
return false
endfunction
function VWX takes nothing returns boolean
if GCV[((BO[CO]))]then
set GDV[(((BO[CO])))]=0
set GCV[((BO[CO]))]=false
endif
return false
endfunction
function VYX takes nothing returns nothing
call TriggerAddCondition(HO,(Filter(function VTX)))
call TriggerAddCondition(JO,(Filter(function VUX)))
call TriggerAddCondition(KO,(Filter(function VWX)))
call S9E()
endfunction
function VZX takes integer D0E returns nothing
call RemoveUnit(GJV[D0E])
set GJV[D0E]=null
call JZE(D0E)
endfunction
function V_X takes integer D0E returns nothing
if GKV[D0E]==NX then
call JWE(D0E)
call VZX(D0E)
endif
endfunction
function V0X takes nothing returns boolean
local integer D0E=GLV[(0)]
loop
exitwhen D0E==0
call V_X(D0E)
set D0E=GLV[D0E]
endloop
return false
endfunction
function V1X takes integer D0E returns nothing
set GMV[GLV[(0)]]=D0E
set GLV[D0E]=GLV[(0)]
set GLV[(0)]=D0E
set GMV[D0E]=(0)
endfunction
function V2X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function V0X))
endfunction
function V3X takes unit J2E,real V4X returns nothing
local integer D0E=JYE()
set GJV[D0E]=J2E
set GKV[D0E]=NX+R2I(V4X/.03125)
call V1X(D0E)
endfunction
function V5X takes integer D0E,integer V6X returns integer
set GUV[GTV[D0E]]=V6X
set GTV[V6X]=GTV[D0E]
set GTV[D0E]=V6X
if GUV[D0E]==0 then
set GUV[D0E]=V6X
endif
set GWV[V6X]=D0E
set GWV[D0E]=(GWV[D0E])+1
return V6X
endfunction
function V7X takes nothing returns integer
local integer D0E=JTE()
set GYV[D0E]=true
return D0E
endfunction
function V8X takes integer D0E,real YDE returns nothing
call SetUnitScale(HFV[D0E],YDE,.0,.0)
set H9V[D0E]=YDE
endfunction
function V9X takes integer D0E,string EVX returns nothing
if H_V[D0E]!=null then
call DestroyEffect(H_V[D0E])
set H0V[D0E]=""//Get Effect Path
endif
if EVX=="" then
set H_V[D0E]=null
set H0V[D0E]=""
else
set H_V[D0E]=AddSpecialEffectTarget(EVX,HFV[D0E],"origin")
set H0V[D0E]=EVX
endif
endfunction
function EEX takes integer D0E,unit EXX returns nothing
set H3V[D0E]=true
set HZV[D0E]=EXX
endfunction
function EOX takes integer D0E returns real
return Atan2((HJV[D0E]+HMV[D0E])-HJV[D0E],(HHV[D0E]+HLV[D0E])-HHV[D0E])
endfunction
function ERX takes integer D0E,real EIX,real EAX,real ENX,boolean EBX returns nothing
set HZV[D0E]=null
set HGV[D0E]=.0
set HQV[D0E]=EIX
set HSV[D0E]=EAX
call MoveLocation(NN,HQV[D0E],HSV[D0E])
set HTV[D0E]=ENX+GetLocationZ(NN)
set H3V[D0E]=EBX
endfunction
function ECX takes integer D0E,real EIX,real EAX,real ENX,boolean EBX returns nothing
set HHV[D0E]=EIX
set HJV[D0E]=EAX
set HKV[D0E]=ENX
set H3V[D0E]=EBX
endfunction
function EDX takes integer D0E returns nothing
set HZV[D0E]=null
set HEV[D0E]=false
endfunction
function EFX takes integer D0E,boolean EGX returns nothing
call JSE(D0E)
set H2V[D0E]=false
set H3V[D0E]=true
if not EGX then
set HRV[D0E]=0
endif
endfunction
function EHX takes integer D0E returns nothing
call V9X(D0E,"")
set H1V[D0E]=true
endfunction
function EJX takes integer D0E,unit J2E returns boolean
return IsUnitInGroup(J2E,JVV[D0E])
endfunction
function EKX takes integer D0E,unit J2E returns nothing
if IsUnitInGroup(J2E,JVV[D0E])then
call GroupRemoveUnit(JVV[D0E],J2E)
endif
endfunction
function ELX takes integer D0E returns nothing
if JAV[D0E]!=null then
call DestroyImage(JAV[D0E])
set JAV[D0E]=null
endif
set JBV[D0E]=false
endfunction
function EMX takes integer D0E,real EPX returns nothing
if JBV[D0E]then
call ELX(D0E)
endif
set JAV[D0E]=CreateImage("ReplaceableTextures\\Shadows\\ShadowFlyer.blp",EPX,EPX,EPX,HHV[D0E]-EPX*.5,HJV[D0E]-EPX*.5,.0,.0,.0,.0,2)
call SetImageColor(JAV[D0E],XX,OX,RX,IX)
call SetImageRenderAlways(JAV[D0E],IsUnitVisible(HFV[D0E],GetLocalPlayer()))
set JNV[D0E]=EPX*.5
set JBV[D0E]=true
endfunction
function EQX takes integer D0E returns nothing
call SetImagePosition(JAV[D0E],HHV[D0E]-JNV[D0E],HJV[D0E]-JNV[D0E],.0)
call SetImageRenderAlways(JAV[D0E],IsUnitVisible(HFV[D0E],GetLocalPlayer()))
endfunction
function ESX takes integer D0E returns nothing
local real ETX=.0
local real EUX=.0
local real EWX=.0
local real EYX=.0
local real M3E=.0
local real M4E=.0
local real EZX=.0
if JFV[D0E]then
call MoveLocation(VX,HHV[D0E]-16.,HJV[D0E])
call MoveLocation(EX,HHV[D0E]+16.,HJV[D0E])
set ETX=GetLocationZ(VX)-GetLocationZ(EX)
call MoveLocation(VX,HHV[D0E],HJV[D0E]-16.)
call MoveLocation(EX,HHV[D0E],HJV[D0E]+16.)
set EUX=GetLocationZ(VX)-GetLocationZ(EX)
set EWX=ETX*ETX+EUX*EUX+16.*16.
call MoveLocation(VX,HHV[D0E],HJV[D0E])
set EYX=G1V[D0E]/SquareRoot(EWX)-(HKV[D0E]-GetLocationZ(VX))*16./EWX
if EYX>=.0 then
set HHV[D0E]=HHV[D0E]+EYX*ETX
set HJV[D0E]=HJV[D0E]+EYX*EUX
set HKV[D0E]=HKV[D0E]+EYX*16.
set EWX=(HLV[D0E]*ETX+HMV[D0E]*EUX+HPV[D0E]*16.)/EWX
set M3E=ETX*EWX
set M4E=EUX*EWX
set EZX=16.*EWX
set HLV[D0E]=(HLV[D0E]-M3E)*(1.-JCV[D0E])-(M3E*JDV[D0E])
set HMV[D0E]=(HMV[D0E]-M4E)*(1.-JCV[D0E])-(M4E*JDV[D0E])
set HPV[D0E]=(HPV[D0E]-EZX)*(1.-JCV[D0E])-(EZX*JDV[D0E])
endif
if JGV[D0E]>0 then
set JGV[D0E]=JGV[D0E]-1
else
set JFV[D0E]=false
call EHX(D0E)
endif
endif
endfunction
function E_X takes nothing returns boolean
local integer D0E=JIV
local destructable MGE=GetFilterDestructable()
local real E0X=GetDestructableX(MGE)
local real E1X=GetDestructableY(MGE)
if GetWidgetLife(MGE)>.405 then
if(HHV[D0E]-E0X)*(HHV[D0E]-E0X)+(HJV[D0E]-E1X)*(HJV[D0E]-E1X)<=G0V[D0E]*G0V[D0E]then
call LME(HDV[D0E],D0E,MGE)
endif
endif
set MGE=null
return false
endfunction
function E2X takes nothing returns boolean
local integer D0E=JIV
local unit E3X=GetFilterUnit()
if not IsUnitInGroup(E3X,JVV[D0E])then
call GroupAddUnit(JVV[D0E],E3X)
call LLE(HCV[D0E],D0E,E3X)
endif
set E3X=null
return false
endfunction
function E4X takes integer D0E returns nothing
if H1V[D0E]then
call JSE(D0E)
call JQE(JLE((D0E)))
else
if HIV[D0E]!=0 then
call LHE(HIV[D0E],D0E)
endif
if HXV[D0E]then
set JIV=D0E
call SetRect(JEV,HHV[D0E]-G0V[D0E],HJV[D0E]-G0V[D0E],HHV[D0E]+G0V[D0E],HJV[D0E]+G0V[D0E])
call EnumDestructablesInRect(JEV,JOV,null)
endif
if HOV[D0E]then
set JIV=D0E
call GroupEnumUnitsInRange(JXV,HHV[D0E],HJV[D0E],G1V[D0E],JRV)
endif
if not G7V[D0E]then
if HZV[D0E]!=null and HEV[D0E]and UnitAlive(HZV[D0E])then
set XN=GetUnitX(HZV[D0E])
set ON=GetUnitY(HZV[D0E])
call MoveLocation(NN,XN,ON)
set RN=GetUnitFlyHeight(HZV[D0E])+GetLocationZ(NN)+G2V[D0E]
if HQV[D0E]!=XN or HSV[D0E]!=ON or HTV[D0E]!=RN then
set HQV[D0E]=XN
set HSV[D0E]=ON
set HTV[D0E]=RN
set H3V[D0E]=true
endif
endif
if H3V[D0E]then
set XN=HQV[D0E]-HHV[D0E]
set ON=HSV[D0E]-HJV[D0E]
set RN=HTV[D0E]-HKV[D0E]
set IN=SquareRoot(XN*XN+ON*ON+RN*RN)
set HLV[D0E]=XN/IN*H4V[D0E]
set HMV[D0E]=ON/IN*H4V[D0E]
set H7V[D0E]=IN/H4V[D0E]*.03125
if H7V[D0E]<=.0 then
set H7V[D0E]=.03125
endif
if HGV[D0E]!=.0 then
set H8V[D0E]=2.*(RN/H7V[D0E]/H7V[D0E]*.03125*.03125-(HPV[D0E]*.03125)/H7V[D0E])
else
set HPV[D0E]=RN/IN*H4V[D0E]
set H8V[D0E]=.0
endif
call SetUnitFacing(HFV[D0E],Atan2(ON,XN)*bj_RADTODEG)
set H3V[D0E]=false
endif
set AN=HKV[D0E]
set HPV[D0E]=HPV[D0E]+H8V[D0E]*G5V[D0E]
set HHV[D0E]=HHV[D0E]+HLV[D0E]*G5V[D0E]
set HJV[D0E]=HJV[D0E]+HMV[D0E]*G5V[D0E]
set HKV[D0E]=HKV[D0E]+HPV[D0E]*G5V[D0E]
call MoveLocation(NN,HHV[D0E],HJV[D0E])
set RN=GetLocationZ(NN)
call SetUnitX(HFV[D0E],HHV[D0E])
call SetUnitY(HFV[D0E],HJV[D0E])
call SetUnitFlyHeight(HFV[D0E],HKV[D0E]-RN,.0)
call SetUnitAnimationByIndex(HFV[D0E],R2I(bj_RADTODEG*Atan2((HKV[D0E]-AN),SquareRoot(HLV[D0E]*HLV[D0E]+HMV[D0E]*HMV[D0E])*G5V[D0E])+90.5))
if(JBV[(D0E)])then
call EQX(D0E)
endif
set G4V[D0E]=G4V[D0E]-.03125*G5V[D0E]
if G4V[D0E]<=.0 then
if G9V[D0E]then
set H1V[D0E]=true
endif
if HNV[D0E]!=0 then
call LHE(HNV[D0E],D0E)
endif
endif
if HKV[D0E]<=RN then
if JFV[D0E]then
call ESX(D0E)
endif
if HBV[D0E]!=0 then
call LHE(HBV[D0E],D0E)
endif
endif
endif
endif
endfunction
function E5X takes nothing returns boolean
local integer D0E=JHV[(0)]
loop
exitwhen D0E==0
call E4X(D0E)
set D0E=JHV[D0E]
endloop
return false
endfunction
function E6X takes integer D0E returns nothing
set JJV[JHV[(0)]]=D0E
set JHV[D0E]=JHV[(0)]
set JHV[(0)]=D0E
set JJV[D0E]=(0)
endfunction
function E7X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function E5X))
endfunction
function E8X takes integer D0E,real EIX,real EAX,real ENX,real SZE,real E9X returns nothing
local real XVX=EIX-HHV[D0E]
local real XEX=EAX-HJV[D0E]
local real XXX=ENX-HKV[D0E]
local real XOX=SquareRoot(XVX*XVX+XEX*XEX+XXX*XXX)
if SZE<=.0 or XOX<=.0 then
set HHV[D0E]=EIX
set HJV[D0E]=EAX
set HKV[D0E]=ENX
set H7V[D0E]=.0
else
set H7V[D0E]=XOX/SZE
endif
set H4V[D0E]=SZE*.03125
set H5V[D0E]=H4V[D0E]
set H6V[D0E]=H4V[D0E]
set HGV[D0E]=E9X
set HQV[D0E]=EIX
set HSV[D0E]=EAX
set HTV[D0E]=ENX
set HLV[D0E]=XVX/XOX*H4V[D0E]
set HMV[D0E]=XEX/XOX*H4V[D0E]
set HPV[D0E]=((XOX*E9X)/(H7V[D0E]/4.)+XXX/H7V[D0E])*.03125
if G4V[D0E]==.0 then
set G4V[D0E]=H7V[D0E]
endif
endfunction
function XRX takes integer D0E,real EIX,real EAX,real ENX,real SZE returns boolean
if not H2V[D0E]then
set H2V[D0E]=true
call E8X(D0E,EIX,EAX,ENX,SZE,.0)
call LHE(HRV[D0E],D0E)
call E6X(D0E)
return true
endif
return false
endfunction
function XIX takes integer D0E,real EIX,real EAX,real ENX,real SZE,real E9X returns boolean
if not H2V[D0E]then
set H2V[D0E]=true
call E8X(D0E,EIX,EAX,ENX,SZE,E9X)
call LHE(HRV[D0E],D0E)
call E6X(D0E)
return true
endif
return false
endfunction
function XAX takes real EIX,real EAX,real ENX,real K0E returns integer
local integer D0E=JTE()
set HFV[D0E]=CreateUnit(JA,'e001',EIX,EAX,K0E*bj_RADTODEG)
call UnitAddAbility(HFV[D0E],'Amrf')
call UnitRemoveAbility(HFV[D0E],'Amrf')
call SetUnitX(HFV[D0E],EIX)
call SetUnitY(HFV[D0E],EAX)
call MoveLocation(NN,EIX,EAX)
call SetUnitFlyHeight(HFV[D0E],ENX,.0)
set HHV[D0E]=EIX
set HJV[D0E]=EAX
set HKV[D0E]=ENX+GetLocationZ(NN)
set HUV[D0E]=EIX
set HWV[D0E]=EIX
set HYV[D0E]=ENX+GetLocationZ(NN)
set GDV[(GetUnitUserData(((HFV[D0E]))))]=D0E
set JVV[D0E]=TYE()
return V5X(QA,D0E)
endfunction
function XNX takes nothing returns nothing
set JXV=CreateGroup()
set JEV=Rect(.0,.0,.0,.0)
set JOV=Condition(function E_X)
set JRV=Condition(function E2X)
endfunction
function s__Projectile___ForGroupStack_increment takes nothing returns nothing
set JPV=(JPV+1)
endfunction
function s__Projectile___ForGroupStack_decrement takes nothing returns nothing
set JPV=(JPV-1)
endfunction
function XBX takes nothing returns nothing
set MA=GDV[(GetUnitUserData(((GetEnumUnit()))))]
set LA=JMV[JPV]
set PA=JLV[JPV]
call TriggerExecute(BJE[((JKV[JPV]))])
endfunction
function XCX takes nothing returns nothing
set MA=GDV[(GetUnitUserData(((GetEnumUnit()))))]
call TriggerExecute(BJE[((JKV[JPV]))])
endfunction
function XDX takes integer D0E returns nothing
call JGE(D0E)
call TZE(JWV[D0E])
set JWV[D0E]=null
call JJE(D0E)
endfunction
function XJX takes integer D0E,integer XGX returns nothing
set JPV=(JPV+1)
set JKV[JPV]=XGX
call ForGroup(JWV[D0E],function XCX)
set JPV=(JPV-1)
endfunction
function XKX takes integer D0E,integer JFE returns boolean
local integer i=0
local integer j=0
if JFE!=0 and IsUnitInGroup(HFV[JFE],JWV[D0E])then
call GroupRemoveUnit(JWV[D0E],HFV[JFE])
set JUV[D0E]=JUV[D0E]-1
set i=LoadInteger(ZA,(JFE),-1)-1
set j=LoadInteger(VN,(JFE),D0E)
call SaveInteger(ZA,(JFE),-1,i)
call SaveInteger(ZA,(JFE),j,LoadInteger(ZA,(JFE),i))
call SaveInteger(VN,(JFE),LoadInteger(ZA,(JFE),j),j)
if i<1 then
call FlushChildHashtable(ZA,(JFE))
call FlushChildHashtable(VN,(JFE))
endif
return true
endif
return false
endfunction
function XLX takes integer D0E,integer JFE returns boolean
local integer i=0
if JFE!=0 and not IsUnitInGroup(HFV[JFE],JWV[D0E])then
call GroupAddUnit(JWV[D0E],HFV[JFE])
set JUV[D0E]=JUV[D0E]+1
if HaveSavedInteger(ZA,(JFE),-1)then
set i=LoadInteger(ZA,(JFE),-1)
endif
call SaveInteger(ZA,(JFE),i,D0E)
call SaveInteger(VN,(JFE),D0E,i)
call SaveInteger(ZA,(JFE),-1,i+1)
return true
endif
return false
endfunction
function XMX takes integer D0E,integer JFE returns boolean
return IsUnitInGroup(HFV[JFE],JWV[D0E])
endfunction
function XPX takes integer D0E,real x,real y,real z,real r,integer i,integer e1,integer e2 returns nothing
local integer p=(GTV[(QA)])
loop
exitwhen p==0
if XMX(D0E,p)then
call XKX(D0E,p)
if e1!=0 then
set MA=p
set LA=D0E
set PA=i
call TriggerExecute(BJE[(e1)])
endif
endif
if r*r>((HHV[p]-x)*(HHV[p]-x)+(HJV[p]-y)*(HJV[p]-y)+(HKV[p]-z)*(HKV[p]-z))then
call XLX(D0E,p)
if e2!=0 then
set MA=p
set LA=D0E
set PA=i
call TriggerExecute(BJE[(e2)])
endif
endif
set p=(GTV[(p)])
endloop
endfunction
function XQX takes integer D0E,real x,real y,real z,real r,integer i,integer XSX returns nothing
local integer p=(GTV[(QA)])
call JGE(D0E)
loop
exitwhen p==0
if r*r>((HHV[p]-x)*(HHV[p]-x)+(HJV[p]-y)*(HJV[p]-y)+(HKV[p]-z)*(HKV[p]-z))then
call XLX(D0E,p)
if XSX!=0 then
set MA=p
set LA=D0E
set PA=i
call TriggerExecute(BJE[(XSX)])
endif
endif
set p=(GTV[(p)])
endloop
endfunction
function XUX takes integer D0E returns nothing
local unit u=null
loop
set u=FirstOfGroup(JWV[D0E])
exitwhen u==null
call XKX(D0E,GDV[(GetUnitUserData(((u))))])
endloop
call GroupClear(JWV[D0E])
set JUV[D0E]=0
set u=null
endfunction
function XWX takes nothing returns integer
local integer D0E=JHE()
set JWV[D0E]=TYE()
return D0E
endfunction
function CreateProjGroup takes nothing returns integer
return XWX()
endfunction
function GetEnumProjectile takes nothing returns integer
return MA
endfunction
function GetParentProjGroup takes nothing returns integer
return LA
endfunction
function GetForProjGroupData takes nothing returns integer
return PA
endfunction
function GetGlobalProjGroup takes nothing returns integer
return KA
endfunction
function XYX takes nothing returns boolean
local unit u=GetLeavingUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local integer p=GDV[(GetUnitUserData(((u))))]
if p!=0 then
call EHX(p)
else
if(x>TA)then
set x=TA
elseif(x<WA)then
set x=WA
endif
if(y>UA)then
set y=UA
elseif(y<YA)then
set y=YA
endif
call SetUnitX(u,x)
call SetUnitY(u,y)
endif
set u=null
return false
endfunction
function XZX takes nothing returns nothing
local trigger X_X=CreateTrigger()
local region X0X=CreateRegion()
local rect WTE=null
set QA=V7X()
set KA=XWX()
set ZA=InitHashtable()
set VN=InitHashtable()
set NN=Location(.0,.0)
set TA=GetRectMaxX(bj_mapInitialPlayableArea)-64.
set UA=GetRectMaxY(bj_mapInitialPlayableArea)-64.
set WA=GetRectMinX(bj_mapInitialPlayableArea)+64.
set YA=GetRectMinY(bj_mapInitialPlayableArea)+64.
set WTE=Rect(WA,YA,TA,UA)
call RegionAddRect(X0X,WTE)
call TriggerRegisterLeaveRegion(X_X,X0X,null)
call TriggerAddCondition(X_X,Condition(function XYX))
call RemoveRect(WTE)
set X_X=null
set WTE=null
set X0X=null
endfunction
function X1X takes nothing returns nothing
local timer t=GetExpiredTimer()
call RemoveUnit((LoadUnitHandle(EI,(LoadInteger(Q,GetHandleId(((t))),0)),0)))
call YIE(t)
set t=null
endfunction
function X2X takes nothing returns nothing
local timer t=GetExpiredTimer()
call DestroyEffect((LoadEffectHandle(EI,(LoadInteger(Q,GetHandleId(((t))),0)),0)))
call YIE(t)
set t=null
endfunction
function X3X takes nothing returns nothing
local timer t=GetExpiredTimer()
call DestroyLightning((LoadLightningHandle(EI,(LoadInteger(Q,GetHandleId(((t))),0)),0)))
call YIE(t)
set t=null
endfunction
function TT2Death takes nothing returns nothing
local timer t=GetExpiredTimer()
call DestroyTextTag((LoadTextTagHandle(EI,(LoadInteger(Q,GetHandleId(((t))),0)),0)))
call YIE(t)
set t=null
endfunction
function X4X takes integer i returns integer
local integer X5X=i-(i/8191)*8191
loop
exitwhen GN[X5X]==i
if GN[X5X]==0 then
set GN[X5X]=i
return X5X
endif
set X5X=X5X+53
if X5X>=8191 then
set X5X=X5X-8191
endif
endloop
return X5X
endfunction
function X6X takes integer X7X,real X8X,real X9X returns boolean
if X7X!=0 then
set DN[X4X(X7X)]=X8X
set FN[X4X(X7X)]=X9X
return true
endif
return false
endfunction
function OVX takes unit J2E returns real
call MoveLocation(CN,GetUnitX(J2E),GetUnitY(J2E))
return FN[X4X(GetUnitTypeId(J2E))]+GetLocationZ(CN)
endfunction
function OEX takes real M2E,unit J2E returns boolean
return(M2E<=OVX(J2E)and M2E>=(DN[X4X(GetUnitTypeId((J2E)))]))
endfunction
function OXX takes nothing returns nothing
call X6X('n021',BN,115.)
call X6X('n020',BN,115.)
call X6X('n03P',BN,155.)
call X6X('n030',BN,155.)
call X6X('n029',BN,155.)
call X6X('n028',BN,155.)
call X6X('n02V',BN,115.)
call X6X('n02U',BN,115.)
call X6X('n03A',BN,115.)
call X6X('n039',BN,115.)
call X6X('n02B',BN,155.)
call X6X('n02A',BN,155.)
call X6X('n031',BN,115.)
call X6X('n030',BN,115.)
call X6X('n02T',BN,155.)
call X6X('n02S',BN,155.)
call X6X('n02A',BN,155.)
call X6X('n02R',BN,155.)
call X6X('n02Q',BN,155.)
call X6X('n01X',BN,115.)
call X6X('n01W',BN,115.)
call X6X('n03N',BN,115.)
call X6X('n03L',BN,115.)
call X6X('n02H',BN,115.)
call X6X('n02G',BN,115.)
call X6X('n03S',BN,115.)
call X6X('n03Q',BN,115.)
call X6X('n02N',BN,155.)
call X6X('n02M',BN,155.)
call X6X('n02M',BN,155.)
call X6X('n03J',BN,155.)
call X6X('n03G',BN,155.)
//call X6X('n02L',BN,400.)
call X6X('n02K',BN,400.)
call X6X('u00Y',BN,400.)
call X6X('u00W',BN,400.)
call X6X('n03E',BN,155.)
call X6X('n03D',BN,155.)
//call X6X('n03E',BN,115.)
call X6X('n02J',BN,155.)
call X6X('n02I',BN,155.)
call X6X('n02D',BN,155.)
call X6X('n02C',BN,155.)
call X6X('n02Z',BN,155.)
call X6X('n02Y',BN,115.)
call X6X('n038',BN,155.)
call X6X('n037',BN,155.)
call X6X('n027',BN,155.)
call X6X('n026',BN,155.)
call X6X('n01Z',BN,115.)
call X6X('n01Y',BN,115.)
call X6X('n01V',BN,115.)
call X6X('n01Y',BN,115.)
call X6X('n03T',BN,155.)
call X6X('n03R',BN,155.)
call X6X('U00Z',BN,155.)
call X6X('U009',BN,155.)
call X6X('U00N',BN,155.)
call X6X('E01R',BN,155.)
call X6X('E00Y',BN,155.)
call X6X('E010',BN,155.)
call X6X('E011',BN,155.)
call X6X('O00E',BN,155.)
call X6X('E012',BN,155.)
call X6X('E013',BN,155.)
call X6X('E00R',BN,155.)
call X6X('E014',BN,155.)
call X6X('E015',BN,155.)
call X6X('E016',BN,155.)
call X6X('H01F',BN,155.)
call X6X('h01E',BN,115.)
call X6X('o007',BN,115.)
call X6X('h01D',BN,115.)
call X6X('h01B',BN,115.)
call X6X('E017',BN,155.)
call X6X('E018',BN,155.)
call X6X('E019',BN,155.)
call X6X('E01A',BN,155.)
call X6X('E01B',BN,155.)
call X6X('E000',BN,155.)
call X6X('O00B',BN,155.)
call X6X('E01C',BN,155.)
call X6X('E00U',BN,155.)
call X6X('N01O',BN,155.)
call X6X('E01D',BN,155.)
call X6X('E01E',BN,155.)
call X6X('E01F',BN,155.)
call X6X('E01G',BN,155.)
call X6X('E01H',BN,155.)
call X6X('E01J',BN,155.)
call X6X('E01K',BN,155.)
call X6X('E006',BN,155.)
call X6X('E01L',BN,155.)
call X6X('E020',BN,155.)
//call X6X('E01M',BN,155.)
call X6X('E01N',BN,155.)
call X6X('E01O',BN,155.)
call X6X('E01P',BN,155.)
call X6X('E01Q',BN,155.)
call X6X('H00F',BN,155.)
call X6X('U00O',BN,155.)
call X6X('N01T',BN,155.)
call X6X('N01S',BN,155.)
call X6X('N01Q',BN,155.)
call X6X('N032',BN,155.)
call X6X('N01M',BN,155.)
call X6X('N01L',BN,155.)
call X6X('n009',BN,155.)
call X6X('n033',BN,155.)
call X6X('n000',BN,155.)
call X6X('n001',BN,155.)
call X6X('n002',BN,155.)
call X6X('n003',BN,155.)
call X6X('n004',BN,155.)
call X6X('n005',BN,155.)
call X6X('n006',BN,155.)
call X6X('n007',BN,155.)
call X6X('n00B',BN,155.)
call X6X('H008',BN,155.)
call X6X('H005',BN,155.)
call X6X('H006',BN,155.)
call X6X('n03C',BN,115.)
call X6X('n03B',BN,115.)
call X6X('e00X',BN,115.)
call X6X('e00G',BN,115.)
call X6X('n02P',BN,115.)
call X6X('n02O',BN,115.)
call X6X('u00S',BN,155.)
call X6X('u00R',BN,155.)
call X6X('u00X',BN,155.)
call X6X('u00Q',BN,115.)
call X6X('u00P',BN,115.)
call X6X('u00T',BN,155.)
call X6X('u00U',BN,155.)
call X6X('n02X',BN,115.)
call X6X('n02W',BN,115.)
call X6X('n025',BN,115.)
call X6X('n024',BN,115.)
call X6X('n023',BN,115.)
call X6X('n022',BN,115.)
call X6X('n03H',BN,115.)
call X6X('n03B',BN,115.)
call X6X('n02F',BN,155.)
call X6X('n02R',BN,155.)
call X6X('e01S',BN,155.)
call X6X('e00Z',BN,155.)
call X6X('u00V',BN,155.)
call X6X('n03F',BN,115.)
call X6X('n03O',BN,115.)
call X6X('n01U',BN,115.)
call X6X('n02E',BN,115.)
call X6X('n03M',BN,115.)
call X6X('n041',BN,115.)
call X6X('H009',BN,155.)
call X6X('E00E',BN,155.)
call X6X('n01K',BN,155.)
call X6X('n02L',BN,155.)
call X6X('h00B',BN,155.)
call X6X('nhrh',190.,340.)
call X6X('nhar',190.,340.)
call X6X('nhrq',230.,380.)
call X6X('nsqa',BN,155.)
call X6X('nowk',BN,155.)
call X6X('nsbm',BN,155.)
call X6X('nmdr',BN,155.)
call X6X('nwld',BN,155.)
call X6X('ntrd',BN,155.)
call X6X('njgb',BN,155.)
call X6X('nfra',BN,155.)
call X6X('nmgr',BN,155.)
call X6X('nmgw',BN,155.)
call X6X('nlkl',BN,155.)
call X6X('nogl',BN,155.)
call X6X('nano',BN,155.)
call X6X('nsll',BN,155.)
call X6X('nsc3',BN,155.)
call X6X('nspb',BN,115.)
call X6X('nanc',BN,115.)
call X6X('njga',BN,115.)
call X6X('nfrg',BN,115.)
call X6X('nfre',BN,115.)
call X6X('nltl',BN,115.)
call X6X('nlds',BN,115.)
call X6X('nlsn',BN,115.)
call X6X('nomg',BN,115.)
call X6X('nogm',BN,115.)
call X6X('nrzb',BN,115.)
call X6X('ntrs',BN,115.)
call X6X('nssp',BN,115.)
call X6X('E003',BN,155.)
call X6X('E004',BN,155.)
call X6X('E00Q',BN,155.)
call X6X('nfel',BN,115.)
call X6X('n01N',BN,115.)
call X6X('o000',BN,115.)
call X6X('n00S',BN,115.)
call X6X('h00S',BN,115.)
call X6X('n03I',BN,155.)
call X6X('h020',BN,115.)
call X6X('n016',BN,155.)
call X6X('n03K',BN,155.)
call X6X('U003',BN,155.)
call X6X('U000',BN,450.)
call X6X('N00D',BN,155.)
call X6X('uskm',BN,115.)
call X6X('uske',BN,115.)
call X6X('nsko',BN,115.)
call X6X('nskm',BN,115.)
call X6X('nskf',BN,115.)
call X6X('U004',BN,155.)
call X6X('n013',BN,115.)
call X6X('n01B',BN,115.)
call X6X('e009',BN,155.)
call X6X('e008',BN,155.)
call X6X('e007',BN,155.)
call X6X('e023',190.,340.)
call X6X('e00A',190.,340.)
call X6X('e00C',190.,340.)
call X6X('e00I',190.,340.)
call X6X('u002',70.,380.)
call X6X('E00E',BN,175.)
call X6X('n01J',BN,115.)
call X6X('o008',BN,115.)
call X6X('n01I',BN,115.)
call X6X('u006',BN,155.)
call X6X('n03W',BN,155.)
call X6X('n03X',BN,155.)
call X6X('E01Z',BN,155.)
call X6X('n03Y',BN,155.)
call X6X('U007',BN,155.)
call X6X('n040',BN,155.)
call X6X('E024',BN,155.)
call X6X('n044',BN,115.)
call X6X('n042',BN,115.)
call X6X('n043',BN,115.)
call X6X('n046',BN,155.)
call X6X('n045',BN,155.)
endfunction
function OOX takes integer p,unit u returns nothing
local real x=HHV[p]
local real y=HJV[p]
//local unit su
if UnitAlive(u)and u!=GZV[p]and IsUnitEnemy(u,GetOwningPlayer(GZV[p]))then
//set su=CreateUnit(GetOwningPlayer(GZV[p]),'h007',x,y,.0)
//call UnitApplyTimedLife(su,'BTLF',1.)
//call UnitAddAbility(su,'A015')
//call IssueTargetOrderById(su,852226,u)
if GetHeroStr(GZV[p],true) >= 500 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlackFrost Frostbite.mdx",u,"origin"))
call UnitDamageTargetEx((GZV[p]),(u),((G3V[p])+(GetHeroInt(GZV[p],true)*GetUnitAbilityLevel(GZV[p],'A04O')*1.2)+(GetHeroStr(GZV[p],true)*GetUnitAbilityLevel(GZV[p],'A04O')*2.4))*(1.+(.03 * GetHeroLevel(GZV[p]))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",u,"origin"))
call UnitDamageTargetEx((GZV[p]),(u),((G3V[p])+(GetHeroInt(GZV[p],true)*GetUnitAbilityLevel(GZV[p],'A04O')*.9)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
//set su=null
endfunction
function AetherLance__ProjColl takes nothing returns nothing
local integer E3X=MA
local integer TBE=(PA)
if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
set G5V[E3X]=.5
call SetUnitVertexColor(HFV[E3X],25,100,150,255)
endif
endfunction
function ORX takes nothing returns nothing
local unit OIX=LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real a = bj_RADTODEG * Atan2(GetSpellTargetY() - ONX, GetSpellTargetX() - OAX)
local location NEWX=Location(GetUnitX(OIX),GetUnitY(OIX))
local location OBX=CNE(NEWX,80.,a)
local real OCX=GetLocationX(OBX)
local real ODX=GetLocationY(OBX)
local location OFX=GetUnitLoc(OIX)
local real OGX=1200.
local location OHX=CNE(OFX,OGX,a)
local real OJX=GetLocationX(OHX)
local real OKX=GetLocationY(OHX)
local real OLX=Atan2((OKX-ONX),(OJX-OAX))
local integer OMX=0
call MoveLocation(HN,OAX,ONX)
set OMX=XAX(OCX,ODX,75.,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
if GetHeroStr(OIX,true) >= 500 then
call V9X(OMX,"war3mapImported\\BlackFrost Frostbite.mdx")
call V8X(OMX,1.75)
//set G8V[OMX]=false
else
//call V9X(OMX,"war3mapImported\\FrozenOrb.mdx")
call V9X(OMX,"war3mapImported\\FrostBoltV1.mdx")
call V8X(OMX,1.0)
//set G8V[OMX]=true
endif
set G3V[OMX]=IT[GetUnitAbilityLevel(OIX,'A04O')]
set G2V[OMX]=50.
//set G4V[OMX]=1200./800.
set G4V[OMX]=1200./1300.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(1)
set HCV[OMX]=(1)
call MoveLocation(HN,OJX,OKX)
//call XRX(OMX,OJX,OKX,75.+GetLocationZ(HN),800.)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(HN),1300.)
call RemoveLocation(OFX)
call RemoveLocation(OHX)
call RemoveLocation(OBX)
call RemoveLocation(NEWX)
set OBX=null
set OFX=null
set OHX=null
set OIX=null
set NEWX = null
endfunction
/*function OPX takes nothing returns boolean
if GetSpellAbilityId()=='A04O' then
call ORX()
endif
return false
endfunction*/
function OQX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function OPX))
set X_X=null*/
call RegisterSpellEffectEvent('A04O', function ORX)
endfunction
function OSX takes nothing returns boolean
return(not IsUnitAlly(GetFilterUnit(),GM)and UnitAlive(GetFilterUnit())and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)and not(GetUnitAbilityLevel((GetFilterUnit()),'Avul')>0))!=null
endfunction
function OTX takes unit CBE,location OUX,real U6E,real CHE,damagetype OWX,attacktype OYX,boolean OZX returns nothing
local group O_X=CreateGroup()
local filterfunc O0X=null
local unit O1X=null
set GM=GetOwningPlayer(CBE)
if OZX==false then
set O0X=Filter(function OSX)
endif
call GroupEnumUnitsInRange(O_X,GetLocationX(OUX),GetLocationY(OUX),CHE+24.,O0X)
loop
set O1X=FirstOfGroup(O_X)
call UnitDamageTargetEx(CBE,O1X,U6E,false,true,OYX,OWX,WEAPON_TYPE_WHOKNOWS)
call GroupRemoveUnit(O_X,O1X)
exitwhen O1X==null
endloop
call DestroyGroup(O_X)
set GM=null
set O1X=null
set O_X=null
endfunction
function O2X takes unit CBE,location OUX,real U6E,real CHE,damagetype OWX,attacktype OYX,boolean OZX returns nothing
local group O_X=CreateGroup()
local filterfunc O0X=null
local unit O3X
local unit O1X=null
set GM=GetOwningPlayer(CBE)
if OZX==false then
set O0X=Filter(function OSX)
endif
call GroupEnumUnitsInRange(O_X,GetLocationX(OUX),GetLocationY(OUX),CHE,O0X)
loop
set O1X=FirstOfGroup(O_X)
call UnitDamageTargetEx(CBE,O1X,U6E,false,true,OYX,OWX,WEAPON_TYPE_WHOKNOWS)
set O3X=CreateUnit(GM,'h007',.0,.0,.0)
call UnitApplyTimedLife(O3X,'BTLF',1)
call UnitAddAbility(O3X,'A02R')
call IssueTargetOrderById(O3X,852226,O1X)
call GroupRemoveUnit(O_X,O1X)
exitwhen O1X==null
endloop
call DestroyGroup(O_X)
set O3X=null
set GM=null
set O1X=null
set O_X=null
endfunction
function O4X takes unit u returns real
local real O5X=GetWidgetLife(u)
local real O6X=O5X
local real O7X=.0
local boolean O8X=false
local trigger X_X=GetTriggeringTrigger()
if u!=null and O5X>=.405 then
if GetUnitState(u,UNIT_STATE_MAX_LIFE)<=16. then
call UnitAddAbility(u,'lif&')
endif
if O5X<=30. then
call SetWidgetLife(u,30.)
set O6X=30.
endif
if X_X!=null and IsTriggerEnabled(X_X)then
call DisableTrigger(X_X)
set O8X=true
endif
call UnitDamageTargetEx(u,u,16.,true,false,JN,DAMAGE_TYPE_NORMAL,null)
if O8X then
call EnableTrigger(X_X)
endif
set O7X=(16.-O6X+GetWidgetLife(u))/16.
call UnitRemoveAbility(u,'lif&')
call SetWidgetLife(u,O5X)
set X_X=null
if O7X>=1. then
return 917451.519
elseif O7X<.0 then
return-PHE(O7X+1.)/KN
else
return O7X/(.06*(1.-O7X))
endif
endif
set X_X=null
return .0
endfunction
function O9X takes real U6E,real RVX returns real
if RVX>=.0 then
return U6E/(1.-((RVX*.06)/(1.+.06*RVX)))
else
return U6E/(2.-Pow(.94,-RVX))
endif
endfunction
function REX takes integer p,unit J2E returns nothing
local unit u
local real x
local real y
local group g
local unit FoG
if J2E==(HZV[(p)])then
if OEX(HKV[p],J2E)then
if GetUnitAbilityLevel(GZV[p],'A0JL') == 1 then
set x = GetUnitX(J2E)
set y = GetUnitY(J2E)
set u = CreateUnit(GetOwningPlayer(GZV[p]),'h01R',x,y,0.)
call UnitApplyTimedLife(u,'BTLF',.5)
call IssuePointOrderById(u,852488,x,y)
set u = CreateUnit(GetOwningPlayer(GZV[p]),'h01Q',x,y,0.)
call UnitApplyTimedLife(u,'BTLF',2.1)
call IssueImmediateOrderById(u,852177)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Damnation Orange2.mdx",x,y))
endif
if GetUnitAbilityLevel(GZV[p],'A0HY') == 1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Damnation Orange2.mdx",GetUnitX(J2E),GetUnitY(J2E)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",GetUnitX(J2E),GetUnitY(J2E)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\OrbOfFire.mdx",GetUnitX(J2E),GetUnitY(J2E)))
set g = CreateGroup()
set x = GetUnitX(J2E)
set y = GetUnitY(J2E)
call GroupEnumUnitsInRange(g, x, y, 275., null)
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if IsUnitEnemy(FoG,GetOwningPlayer(GZV[p])) and UnitAlive(FoG) and FoG != J2E then
call UnitDamageTargetEx(GZV[p],FoG,G3V[p],false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebolt Rough Minor.mdx",FoG,"chest"))
endif
endloop
endif
call UnitDamageTargetEx(GZV[p],J2E,G3V[p],false,true,ATTACK_TYPE_CHAOS,LN,WEAPON_TYPE_WHOKNOWS)
call EHX(p)
else
call EKX(p,J2E)
endif
endif
set u = null
set g= null
set FoG = null
endfunction
function RXX takes integer p,unit J2E returns nothing
local unit u
local real x
local real y
if J2E==(HZV[(p)])then
if OEX(HKV[p],J2E)then
if GetUnitAbilityLevel(GZV[p],'A0JL') == 1 then
set x = GetUnitX(J2E)
set y = GetUnitY(J2E)
set u = CreateUnit(GetOwningPlayer(GZV[p]),'h01R',x,y,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
call IssuePointOrderById(u,852488,x,y)
set u = CreateUnit(GetOwningPlayer(GZV[p]),'h01Q',x,y,0.)
call UnitApplyTimedLife(u,'BTLF',2.1)
call IssueImmediateOrderById(u,852177)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Damnation Orange2.mdx",GetUnitX(J2E),GetUnitY(J2E)))
endif
call UnitDamageTargetEx(GZV[p],J2E,G3V[p],false,true,ATTACK_TYPE_CHAOS,LN,WEAPON_TYPE_WHOKNOWS)
call SEE(J2E,R2I(G3V[p]))
call EHX(p)
else
call EKX(p,J2E)
endif
endif
set u = null
endfunction
function ROX takes integer i returns integer
local integer X5X=i-(i/8191)*8191
loop
exitwhen UN[X5X]==i
if UN[X5X]==0 then
set UN[X5X]=i
return X5X
endif
set X5X=X5X+53
if X5X>=8191 then
set X5X=X5X-8191
endif
endloop
return X5X
endfunction
function Attack_GetSource takes nothing returns unit
return QN
endfunction
function Attack_GetTarget takes nothing returns unit
return SN
endfunction
function Attack_GetDamage takes nothing returns real
return TN
endfunction
function Attack_GetAttackData takes nothing returns integer
return PN
endfunction
function Attack_GetType takes nothing returns damagetype
return LN
endfunction
function RRX takes integer id,string RIX,real SZE,real RAX,real RNX,real RBX,real RCX,real RDX returns boolean
local integer ad=(ROX(id))
if J5V[ad]then
return false
else
set JYV[ad]=RIX
set JZV[ad]=SZE
set J0V[ad]=RNX
set J1V[ad]=RBX
set J2V[ad]=RCX
set J3V[ad]=RDX
set J5V[ad]=true
if RAX==.0 then
set J4V[ad]=true
else
set J_V[ad]=RAX
endif
return true
endif
endfunction
function RFX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
local unit RHX=GetTriggerUnit()
local real SVE=GetEventDamage()
local real ax=GetUnitX(RGX)
local real ay=GetUnitY(RGX)
local real tx=GetUnitX(RHX)
local real ty=GetUnitY(RHX)
local real OLX=Atan2((ty-ay),(tx-ax))
local integer ad=(ROX(GetUnitTypeId(RGX)))
local integer p=0
local integer ran
local real cooldown
local integer i = 0
local item it
local integer i2 = 0
local integer i3 = 0
local integer i4 = 0
local unit a=GetEventDamageSource()
loop
exitwhen i > 5
set it = UnitItemInSlot(a,i)
if GetItemTypeId(it) == 'I01R' then
set i2 = i2 + 35
endif
if GetItemTypeId(it) == 'I03E' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04A' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I05A' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I02Z' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I02V' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I053' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03F' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I037' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I05E' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I05C' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I04Y' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03D' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I049' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04P' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I03V' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I036' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I048' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I05J' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I05M' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I05I' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I02K' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I02Y' then
set i2 = i2 + 20
endif
set i = i + 1
if GetItemTypeId(it) == 'I05V' then
set i2 = i2 + 20
endif
endloop
if GetUnitAbilityLevel(a,'A0QQ') != 0 then
set i2 = i2 + 90
endif
if GetUnitAbilityLevel(a,'A0RU') != 0 then
set i2 = i2 + 20
endif
if GetUnitAbilityLevel(a,'B03V') != 0 then
if AETHER_BUFF_LVL[GetUnitUserData(a)] >= 40 then
set i2 = i2 + 80
else
set i2 = i2 + (AETHER_BUFF_LVL[GetUnitUserData(a)]*2)
endif
endif
if(CI[NI])and J5V[ad]and SVE>.5 and GetEventDamageSource()!=GetTriggerUnit() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) then
if GetUnitTypeId(RGX)=='E00E' then
set SVE=(((GetHeroStr(RGX,true)*.15*GetHeroLevel(RGX))+(GetHeroInt(RGX,true)*.1*GetHeroLevel(RGX))+(GetHeroAgi(RGX,true)*.05*GetHeroLevel(RGX)))*(1+.01*i2))
endif
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
set p=XAX(ax,ay,J0V[ad],OLX)
set GZV[p]=RGX
call EEX(p,RHX)
set G_V[p]=GetOwningPlayer(RGX)
if IsRangerUseless[GetUnitUserData(RGX)] or IsBardCustom[GetUnitUserData(RGX)] or IsRangerRat[GetUnitUserData(RGX)] or IsAMChonk[GetUnitUserData(RGX)] or IsRangerGreen[GetUnitUserData(RGX)] then
if IsAMChonk[GetUnitUserData(RGX)] then
call V9X(p,"war3mapImported\\ChomusukeWhite.mdx")
endif
if IsRangerUseless[GetUnitUserData(RGX)] then
call V9X(p,"units\\critters\\Sheep\\Sheep.mdl")
endif
if IsRangerRat[GetUnitUserData(RGX)] then
call V9X(p,"war3mapImported\\Shot Green.mdx")
endif
if IsRangerGreen[GetUnitUserData(RGX)] then
call V9X(p,"war3mapImported\\Shot Yellow.mdx")
endif
if IsBardCustom[GetUnitUserData(RGX)] then
set ran = GetRandomInt(0,99)
if ran < 10 then
call V9X(p,"war3mapImported\\Azul Arrow Defrosted.mdx")
endif
if ran >= 10 and ran <20 then
call V9X(p,"war3mapImported\\Azul Arrow.mdx")
endif
if ran >= 20 and ran <30 then
call V9X(p,"war3mapImported\\Bloodstone Arrow LSD 2.mdx")
endif
if ran >= 30 and ran <40 then
call V9X(p,"war3mapImported\\Bloodstone Arrow LSD.mdx")
endif
if ran >= 40 and ran <50 then
call V9X(p,"war3mapImported\\Bloodstone Arrow.mdx")
endif
if ran >= 50 and ran <60 then
call V9X(p,"war3mapImported\\BonefireArrow1.mdx")
endif
if ran >= 60 and ran <70 then
call V9X(p,"war3mapImported\\FirecrackerArrow.mdx")
endif
if ran >= 70 and ran <80 then
call V9X(p,"war3mapImported\\FirecrackerArrowFireless.mdx")
endif
if ran >= 80 and ran <90 then
call V9X(p,"war3mapImported\\SearingArrow.mdx")
endif
if ran >= 90 then
call V9X(p,"war3mapImported\\Maiz con Arrow.mdx")
endif
endif
else
call V9X(p,JYV[ad])
endif
if IsBardCustom[GetUnitUserData(RGX)]then
call V8X(p,1.5)
else
call V8X(p,J1V[ad])
endif
set G3V[p]=SVE
if IsBardCustom[GetUnitUserData(RGX)]then
set G2V[p]=100.
else
set G2V[p]=J3V[ad]
endif
set G1V[p]=J2V[ad]
set HEV[p]=true
set G8V[p]=true
set HOV[p]=true
set G4V[p]=20.
set G9V[p]=true
set HCV[p]=(2)
set HBV[p]=(2)
set HAV[p]=(3)
set HNV[p]=(4)
if J4V[ad]then
call XRX(p,tx,ty,GetUnitFlyHeight(RHX)+J0V[ad],JZV[ad])
else
call XIX(p,tx,ty,GetUnitFlyHeight(RHX)+J0V[ad],JZV[ad],J_V[ad])
endif
set QN=RGX
set SN=RHX
set TN=SVE
set PN=ad
call MEE(MN)
endif
set RGX=null
set RHX=null
return false
endfunction
function RJX takes nothing returns nothing
local trigger X_X=CreateTrigger()
set MN=MVE()
call MOE(II,(X_X))
call TriggerAddCondition(X_X,Condition(function RFX))
endfunction
function Blink___Disjoint takes nothing returns nothing
local integer p=(MA)
if HEV[p]then
call EDX(p)
endif
endfunction
function RKX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
//if GetSpellAbilityId()=='Albk' then
call XQX(KA,GetUnitX(OIX),GetUnitY(OIX),.0,400.,0,(2))
//endif
set OIX=null
//return false
endfunction
function RLX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function RKX))*/
call RegisterSpellEffectEvent('AIbk', function RKX)
endfunction
function RMX takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
if J2E==(HZV[(RPX)])and UnitAlive(J2E)then
if OEX(HKV[RPX],J2E)then
if not IsUnitType(J2E,UNIT_TYPE_ANCIENT) or BRTON then
call UnitDamageTargetEx((GZV[RPX]),(J2E),(((GetUnitState(J2E,UNIT_STATE_MAX_LIFE)*.025)+(GetHeroStr(GZV[RPX],true)))*5.)+(GetHeroStr(GZV[RPX],true)*.05*GetHeroLevel(GZV[RPX])),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx((GZV[RPX]),(J2E),(((GetUnitState(J2E,UNIT_STATE_LIFE)*.0375))+((GetHeroStr(GZV[RPX],true))*2.5))+(GetHeroStr(GZV[RPX],true)*.025*GetHeroLevel(GZV[RPX])),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
call IssueTargetOrderById(J2E,851983,GZV[RPX])
call EHX(RPX)
endif
endif
endfunction
function RTX takes nothing returns nothing
local unit OIX=BLOODHYDRANTCASTER
local unit EXX=BLOODHYDRANTTARGET
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(WN,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,(Deg2Rad(GetUnitFacing(OIX))))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\Blood Missile.mdx")
call V8X(OMX,.75)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(3)
call EMX(OMX,G1V[OMX])
call MoveLocation(WN,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,900.)
set OIX=null
set EXX=null
endfunction
/*function RUX takes nothing returns boolean
if GetSpellAbilityId()=='A03K' then
call RTX()
endif
return false
endfunction*/
function RWX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function RUX))
set X_X=null*/
call RegisterSpellEffectEvent('A03K', function RTX)
endfunction
function RYX takes integer RPX,unit J2E returns nothing
local unit u=J2E
local real x=GetUnitX(u)+150.*Cos((GetUnitFacing(u)-180.)*bj_DEGTORAD)
local real y=GetUnitY(u)+150.*Sin((GetUnitFacing(u)-180.)*bj_DEGTORAD)
local unit s
if J2E==(HZV[(RPX)])then
if IsSkaarUseless[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GZV[RPX]))])] or IsMechaSkaar[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GZV[RPX]))])] then
if IsSkaarUseless[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GZV[RPX]))])] then
set s=CreateUnit(GetOwningPlayer(GZV[RPX]),'n01N',x,y,GetUnitFacing(u))
endif
if IsMechaSkaar[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GZV[RPX]))])] then
if GetRandomInt(0,100)>=50 then
set s=CreateUnit(GetOwningPlayer(GZV[RPX]),'n03W',x,y,GetUnitFacing(u))
else
set s=CreateUnit(GetOwningPlayer(GZV[RPX]),'n03X',x,y,GetUnitFacing(u))
endif
endif
else
set s=CreateUnit(GetOwningPlayer(GZV[RPX]),'nfel',x,y,GetUnitFacing(u))
endif
call SetUnitAbilityLevel(s,'A05T',GetUnitAbilityLevel(GZV[RPX],'A05T')/2)
if GetUnitTypeId(GZV[RPX])== 'E00Q' or GetUnitTypeId(GZV[RPX])== 'E004' or GetUnitTypeId(GZV[RPX])== 'E01Y' then
call BlzSetUnitMaxHP(s,R2I(BlzGetUnitMaxHP(GZV[RPX])*.75*(1.+(.03*GetHeroLevel(GZV[RPX])))))
call BlzSetUnitBaseDamage(s,R2I(GetHeroStr(GZV[RPX],true)*3.*(1.+(.1*GetHeroLevel(GZV[RPX])))),0)
call UnitApplyTimedLife(s,'BTLF',10.+(I2R(GetHeroStr(GZV[RPX],true))/4.))
else
call BlzSetUnitMaxHP(s,R2I(GetWidgetLife(GZV[RPX])))
call BlzSetUnitBaseDamage(s,BlzGetUnitBaseDamage(GZV[RPX],0)/3*2,0)
call UnitApplyTimedLife(s,'BTLF',30.)
call SetUnitScale(s,BlzGetUnitRealField(s,UNIT_RF_SCALING_VALUE)/2.,BlzGetUnitRealField(s,UNIT_RF_SCALING_VALUE)/2.,BlzGetUnitRealField(s,UNIT_RF_SCALING_VALUE)/2.)
endif
call SetWidgetLife(s,GetUnitState(s,UNIT_STATE_MAX_LIFE))
call IssueTargetOrderById(s,851983,u)
call EHX(RPX)
endif
set u=null
set s=null
endfunction
function RZX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetEventDamageSource()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(YN,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
if IsMechaSkaar[GetUnitUserData(OIX)] or IsMechaSkaar[GetUnitUserData(LC[1+GetPlayerId(G_V[OMX])])] then
call V9X(OMX,"war3mapImported\\Big_ICM_Blue.mdx")
else
call V9X(OMX,"war3mapImported\\Blood Missile Blight.mdx")
endif
//call V9X(OMX,"war3mapImported\\PeeKay's Bonespirit.mdx")
call V8X(OMX,1.)
set G2V[OMX]=60.
set G3V[OMX]=0.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(4)
set G4V[OMX]=20.
set G9V[OMX]=true
call EMX(OMX,G1V[OMX])
call MoveLocation(YN,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XIX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,400.,.9)
call SetWidgetLife(OIX,GetWidgetLife(OIX)*.975)
if IsMechaSkaar[GetUnitUserData(OIX)] or IsMechaSkaar[GetUnitUserData(LC[1+GetPlayerId(G_V[OMX])])] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PlasmaGrenade.mdx",OIX,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Missile Blight.mdx",OIX,"chest"))
endif
set OIX=null
set EXX=null
endfunction
function R_X takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'S007')==1 and GetRandomInt(1,100)<=4. and GetTriggerUnit()!=GetEventDamageSource() and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())) and Damage_IsAttack() and BI[NI] != DAMAGE_TYPE_PLANT and BI[NI] != DAMAGE_TYPE_UNIVERSAL and GetEventDamageSource() != FLAMEDISCCASTER then
call RZX()
endif
return false
endfunction
function R0X takes nothing returns nothing
set BONESHED=CreateTrigger()
call TriggerAddCondition(BONESHED,Condition(function R_X))
call MOE(II,(BONESHED))
call DisableTrigger(BONESHED)
endfunction
function R1X takes integer D0E returns nothing
call DestroyLightning(J9V[D0E])
set KVV[D0E]=null
set KEV[D0E]=null
set KRV[D0E]=false
set KIV[D0E]=1.
set KXV[D0E]=.0
set KOV[D0E]=.0
call JCE(D0E)
endfunction
function R2X takes unit R3X,unit R4X,string WEE returns nothing
local integer PXE=JBE()
if PXE==KAV then
set KAV=KAV+1
endif
if GetUnitFlyHeight(R3X)==0 then
set KXV[PXE]=50.
else
set KXV[PXE]=GetUnitFlyHeight(R3X)
endif
if GetUnitFlyHeight(R4X)==0 then
set KOV[PXE]=50.
else
set KOV[PXE]=GetUnitFlyHeight(R4X)
endif
set KVV[PXE]=R3X
set KEV[PXE]=R4X
set KRV[PXE]=true
set J9V[PXE]=AddLightningEx(WEE,true,GetUnitX(R3X),GetUnitY(R3X),KXV[PXE],GetUnitX(R4X),GetUnitY(R4X),KOV[PXE])
endfunction
function R5X takes nothing returns nothing
local integer i=1
loop
exitwhen i==KAV
if KRV[(i)]then
call MoveLightningEx(J9V[(i)],true,GetUnitX(KVV[(i)]),GetUnitY(KVV[(i)]),KXV[(i)],GetUnitX(KEV[(i)]),GetUnitY(KEV[(i)]),KOV[(i)])
set KIV[(i)]=KIV[(i)]-.03
if KIV[(i)]<=.0 then
call R1X((i))
else
call SetLightningColor(J9V[(i)],1.,1.,1.,KIV[(i)])
endif
endif
set i=i+1
endloop
endfunction
function R6X takes nothing returns nothing
call TimerStart(KNV,.03,true,function R5X)
endfunction
function R7X takes integer D0E,unit CBE,unit YSE returns nothing
if GetUnitAbilityLevel(CBE,'A00D') !=0 then
call Z2E(D0E,GetUnitX(GLOBAL_CASTER),GetUnitY(GLOBAL_CASTER),GetUnitFlyHeight(GLOBAL_CASTER)+50.)
else
call Z2E(D0E,GetUnitX(CBE),GetUnitY(CBE),GetUnitFlyHeight(CBE)+50.)
endif
set FJV[(D0E)]=(KJV[D0E])
set FQV[(D0E)]=((KHV[D0E])*1.)*300.
call Z6E(D0E,KGV[D0E])
set KDV[D0E]=CBE
set KSV[D0E]=CBE
set KLV[D0E]=LVE()
call Z9E(D0E,YSE)
set F3V[(D0E)]=false
call Z7E(D0E)
endfunction
function R8X takes integer D0E,integer R9X returns nothing
set KBV[D0E]=R9X
set KCV[D0E]=R9X
endfunction
function IVX takes integer D0E returns nothing
call KGE(KLV[D0E])
call Z1E(D0E)
call KXE(D0E)
endfunction
function IEX takes nothing returns boolean
local integer TBE=KZV
local unit IXX=KUV
local boolean b
set KUV=GetFilterUnit()
set b=LNE(TBE)and IXX!=KUV and not(HaveSavedInteger(CX,((KLV[TBE])),GetHandleId((KUV))))and GetUnitTypeId(KUV)!='face'
set KUV=IXX
return b
endfunction
function IOX takes real x,real y returns integer
local integer D0E=JIE()
set K2V[D0E]=x
set K3V[D0E]=y
return D0E
endfunction
globals
group RAINBOW_GROUP=CreateGroup()
endglobals
function IRX takes integer RPX,unit J2E returns nothing//CLUSTER ROCKET
local unit u
local unit FoG
if UnitAlive(J2E)and J2E!=GZV[RPX] and IsUnitEnemy(J2E,GetOwningPlayer(GZV[RPX])) then
if OEX(HKV[RPX],J2E)then
set u = CreateUnit(GetOwningPlayer(GZV[RPX]),'h007',0.,0.,0.)
if H0V[RPX] == "war3mapImported\\CentaurArcherMissile.mdx" then
call UnitApplyTimedLife(u,'BTLF',15.)
else
call UnitApplyTimedLife(u,'BTLF',1.)
endif
if H0V[RPX] == "war3mapImported\\LightningArrow1.mdx" then
if not IsUnitType(J2E,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(J2E,'A0EQ')==0 then
call UnitAddAbility(J2E,'A0EQ')
endif
call AddUnitBonus(J2E,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(GZV[RPX],true)*.005)))
endif
call UnitDamageTargetEx(u,J2E,GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*3,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitAddAbility(u,'A0J7')
call IssueTargetOrder(u,"purge",J2E)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl",J2E,"chest"))
endif
if H0V[RPX] == "Abilities\\Weapons\\FlamingArrow\\FlamingArrowMissile.mdl" then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\BallsOfFireMissile\\BallsOfFireMissile.mdl",J2E,"chest"))
call GroupEnumUnitsInRange(RAINBOW_GROUP,GetUnitX(J2E),GetUnitY(J2E),160.,null)
loop
set FoG=FirstOfGroup(RAINBOW_GROUP)
exitwhen FoG==null
if IsUnitEnemy(FoG,GetOwningPlayer(GZV[RPX])) and UnitAlive(FoG) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\MagmaMissile2.mdx",FoG,"chest"))
if not IsUnitType(FoG,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(FoG,'A0EQ')==0 then
call UnitAddAbility(FoG,'A0EQ')
endif
call AddUnitBonus(FoG,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(GZV[RPX],true)*.005)))
endif
call UnitDamageTargetEx(u,FoG,GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*1.5,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit(RAINBOW_GROUP,FoG)
endloop
endif
if H0V[RPX] == "Abilities\\Weapons\\ColdArrow\\ColdArrowMissile.mdl" then
if not IsUnitType(J2E,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(J2E,'A0EQ')==0 then
call UnitAddAbility(J2E,'A0EQ')
endif
call AddUnitBonus(J2E,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(GZV[RPX],true)*.005)))
endif
call UnitDamageTargetEx(u,J2E,GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*2.5,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitAddAbility(u,'A0D3')
call IssueTargetOrder(u,"thunderbolt",J2E)
endif
if H0V[RPX] == "war3mapImported\\CentaurArcherMissile.mdx" then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl",J2E,"chest"))
if not IsUnitType(J2E,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(J2E,'A0EQ')==0 then
call UnitAddAbility(J2E,'A0EQ')
endif
call AddUnitBonus(J2E,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(GZV[RPX],true)*.005)))
endif
call UnitDamageTargetEx(u,J2E,GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*2.,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitAddAbility(u,'A0D1')
call SetUnitAbilityLevel(u,'A0D1',GetUnitAbilityLevel(GZV[RPX],'A021'))
call IssueTargetOrder(u,"acidbomb",J2E)
endif
if H0V[RPX] == "war3mapImported\\s_Enchanted Arrow.mdx" then
if not IsUnitType(J2E,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(J2E,'A0EQ')==0 then
call UnitAddAbility(J2E,'A0EQ')
endif
call AddUnitBonus(J2E,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(GZV[RPX],true)*.005)))
endif
call UnitDamageTargetEx(u,J2E,GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*1.5,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call GroupEnumUnitsInRange(RAINBOW_GROUP,GetUnitX(J2E),GetUnitY(J2E),175.,null)
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_Nature'sBloom Effect.mdx",GetUnitX(J2E),GetUnitY(J2E)))
loop
set FoG=FirstOfGroup(RAINBOW_GROUP)
exitwhen FoG==null
if IsUnitAlly(FoG,GetOwningPlayer(GZV[RPX])) and UnitAlive(FoG) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",FoG,"chest"))
if GetUnitState(FoG,UNIT_STATE_MAX_LIFE) >= GetWidgetLife(FoG) + (GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*1.5) then
call SetWidgetLife(FoG,GetUnitState(FoG,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(FoG,GetWidgetLife(FoG) + (GetHeroAgi(GZV[RPX],true)*GetUnitAbilityLevel(GZV[RPX],'A021')*1.))
endif
endif
call GroupRemoveUnit(RAINBOW_GROUP,FoG)
endloop
endif
else
call EKX(RPX,J2E)
endif
endif
set FoG=null
set u =null
endfunction
function IIX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX) + 50. * Cos(GetUnitFacing(OIX) * bj_DEGTORAD)
local real ONX=GetUnitY(OIX) + 50. * Sin(GetUnitFacing(OIX) * bj_DEGTORAD)
local real OJX=GetSpellTargetX()
local real OKX=GetSpellTargetY()
local real CCE=SquareRoot((OAX-OJX)*(OAX-OJX)+(ONX-OKX)*(ONX-OKX))
local real OLX=Atan2((OKX-ONX),(OJX-OAX))
local integer OMX=0
call MoveLocation(VB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\Magic Missile.mdx")
call V8X(OMX,1.)
set G2V[OMX]=0.
set G6V[OMX]=5.
set G8V[OMX]=true
set HVV[OMX]=true
set HNV[OMX]=(6)
call SaveInteger(ZA,0,((OMX)),(IOX(OJX,OKX)))
set OJX=OAX+(CCE*.5)*Cos(OLX)
set OKX=ONX+(CCE*.5)*Sin(OLX)
call MoveLocation(VB,OJX,OKX)
call XIX(OMX,OJX,OKX,GetLocationZ(VB)+600.,1000.,.15)
set OIX=null
endfunction
/*function IAX takes nothing returns boolean
if GetSpellAbilityId()=='A021' then
call IIX()
endif
return false
endfunction*/
globals
group NVGROUP = CreateGroup()
unit NVCASTER
real NVDAMAGE
endglobals
struct NVSTRUCT
unit t
unit c
real dmg
integer i
method destroy takes nothing returns nothing
set this.c = null
set this.t = null
call this.deallocate()
endmethod
endstruct
function NVFilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(NVCASTER)) and UnitAlive(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Green",u,"origin"))
call SetWidgetLife(u,GetWidgetLife(u)+NVDAMAGE)
endif
set u = null
return false
endfunction
function NVHandler takes nothing returns nothing
local timer t = GetExpiredTimer()
local NVSTRUCT data = GetTimerData(t)
if data.i == 0 or not UnitAlive(data.t) then
call ReleaseTimer(t)
call data.destroy()
else
call UnitDamageTargetEx(data.c,data.t,data.dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Seed Squirt Classic.mdx",data.t,"origin"))
set NVCASTER = data.t
set NVDAMAGE=data.dmg
call GroupEnumUnitsInRange(NVGROUP,GetUnitX(data.t),GetUnitY(data.t),225.,Filter(function NVFilterActions))
set data.i = data.i -1
call SetTimerData(t,data)
call TimerStart(t,1.,false,function NVHandler)
endif
set t = null
endfunction
function INX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function IAX))*/
call RegisterSpellEffectEvent('A021', function IIX)
endfunction
function IBX takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
local integer i
local texttag tt = null
local string s = null
local unit u
local timer t
local NVSTRUCT data
local real r
if H0V[RPX] == "war3mapImported\\Seed Shot.mdx" then
if J2E ==HZV[RPX] and UnitAlive(J2E) then
set u = CreateUnit(GetOwningPlayer(GZV[RPX]),'h007',RQX,RSX,0.)
call UnitAddAbility(u,'A0OW')
call IssueTargetOrderById(u,852095,J2E)
call UnitApplyTimedLife(u,'BTLF',1.)
set data = NVSTRUCT.create()
set data.c = GZV[RPX]
set data.t = J2E
set data.i = 5
set data.dmg = G3V[RPX]/5.
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.01,false,function NVHandler)
call EHX(RPX)
endif
endif
if H0V[RPX] == "war3mapImported\\BluefireBolt.mdx" then
if J2E ==HZV[RPX] and UnitAlive(J2E) then
call UnitDamageTargetEx((GZV[RPX]),(J2E),G3V[RPX],false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BluefireBolt.mdx",J2E,"origin"))
call EHX(RPX)
endif
endif
if H0V[RPX] == "war3mapImported\\GaiaMissle.mdx" then
if J2E ==HZV[RPX] then
if UnitAlive(J2E) then
call SetWidgetLife(J2E,GetWidgetLife(J2E)+G3V[RPX]/10.)
endif
if GetUnitTypeId(GZV[RPX]) == 'h00B' then
set i = 10 + ( GetUnitAbilityLevel(NaturesAbundanceC[GetUnitUserData(GZV[RPX])],'A0OS')*10000/50)
else
set i = 10 + ( GetUnitAbilityLevel(NaturesAbundanceC[GetUnitUserData(GZV[RPX])],'A0OS')*BlzGetUnitIntegerField(GZV[RPX], UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)/50)
endif
call SetPlayerState(GetOwningPlayer(J2E),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(J2E),PLAYER_STATE_RESOURCE_GOLD))+i)
set s = "|cffffcc00 +"+I2S(i)+"|r"
set tt = CreateTextTag()
call SetTextTagText(tt,s,0.023)
call SetTextTagPos(tt,GetUnitX(J2E),GetUnitY(J2E),10.)
call SetTextTagColor(tt,255,255,255,255)
call SetTextTagVelocity(tt,0.0355*Cos(90. * bj_DEGTORAD),0.0355*Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,1.5)
call SetTextTagLifespan(tt,2.)
call SetTextTagPermanent(tt,false)
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl",J2E,"origin"))
call EHX(RPX)
endif
endif
if H0V[RPX] == "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilMissile.mdl" then
if GetUnitTypeId(J2E) == 'e023' then
set StarlightCharge[GetUnitUserData(J2E)]= StarlightCharge[GetUnitUserData(J2E)] + 4
if StarlightCharge[GetUnitUserData(J2E)] > 100 then
set StarlightCharge[GetUnitUserData(J2E)] = 100
else
set r = (StarlightCharge[GetUnitUserData(J2E)]*.02) + 2.
call DestroyEffect(AddSpecialEffect("war3mapImported\\Void Rift II Purple.mdx",RQX,RSX))
call SetUnitScale(J2E,r,r,r)
endif
endif
if J2E!=GZV[RPX]and UnitAlive(J2E)and IsUnitEnemy(J2E,GetOwningPlayer(GZV[RPX]))and not IsUnitType(J2E,UNIT_TYPE_ANCIENT)then
if OEX(HKV[RPX],J2E)then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl",J2E,"origin"))
if IsUnitType(J2E,UNIT_TYPE_HERO) then
call UnitDamageTargetEx((GZV[RPX]),(J2E),.03*((ZS[GetUnitAbilityLevel(GZV[RPX],'A035')])*1.)+(GetUnitAbilityLevel(GZV[RPX],'A035')*.2*GetHeroInt(GZV[RPX],true)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx((GZV[RPX]),(J2E),((ZS[GetUnitAbilityLevel(GZV[RPX],'A035')])*1.)+(GetUnitAbilityLevel(GZV[RPX],'A035')*2.*GetHeroInt(GZV[RPX],true)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call EHX(RPX)
endif
endif
if J2E!=GZV[RPX]and UnitAlive(J2E)and IsUnitEnemy(J2E,GetOwningPlayer(GZV[RPX]))and IsUnitType(J2E,UNIT_TYPE_ANCIENT) and BRTON then
if OEX(HKV[RPX],J2E)then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl",J2E,"origin"))
if IsUnitType(J2E,UNIT_TYPE_HERO) then
call UnitDamageTargetEx((GZV[RPX]),(J2E),(((ZS[GetUnitAbilityLevel(GZV[RPX],'A035')])*1.)+(GetUnitAbilityLevel(GZV[RPX],'A035')*.2*GetHeroInt(GZV[RPX],true)))*.03,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx((GZV[RPX]),(J2E),(((ZS[GetUnitAbilityLevel(GZV[RPX],'A035')])*2.)+(GetUnitAbilityLevel(GZV[RPX],'A035')*4.*GetHeroInt(GZV[RPX],true))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call EHX(RPX)
endif
endif
endif
set t = null
set u = null
set tt=null
set s = null
endfunction
function ICX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
if GetSpellTargetUnit() !=null then
set EXX=GetSpellTargetUnit()
endif
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(GetUnitFacing(OIX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilMissile.mdl")
call V8X(OMX,1.)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
set G4V[OMX]=30.
set G9V[OMX]=true
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
if GetSpellTargetUnit() !=null then
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1000.)
else
set HEV[OMX]=false
set OJX=GetSpellTargetX()
set OKX=GetSpellTargetY()
call MoveLocation(EB,OJX,OKX)
call XRX(OMX,OJX,OKX,GetLocationZ(EB)+65.,1000.)
endif
set OIX=null
set EXX=null
endfunction
/*function IDX takes nothing returns boolean
if GetSpellAbilityId()=='A035' then
call ICX()
endif
return false
endfunction*/
function IFX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function IDX))
set X_X=null*/
call RegisterSpellEffectEvent('A035', function ICX)
endfunction
function IGX takes nothing returns nothing
local unit OIX=EntroShielder[GetUnitUserData(GetTriggerUnit())]
local unit EXX=GetEventDamageSource()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
local location IHX
local location IJX
set OJX=GetUnitX(EXX)
set OKX=GetUnitY(EXX)
set IHX=Location(OJX,OKX)
set IJX=CNE(IHX,GetRandomReal(150.,200.),GetRandomReal(.0,360.))
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(XB,OJX,OKX)
set OMX=XAX(GetLocationX(IJX),GetLocationY(IJX),1800.+GetLocationZ(XB),OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl")
call V8X(OMX,1.)
set G2V[OMX]=.0
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=false
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HBV[OMX]=(7)
set HCV[OMX]=(8)
call EMX(OMX,G1V[OMX])
call MoveLocation(XB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1500.)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosDone.mdl",EXX,"chest"))
call RemoveLocation(IHX)
call RemoveLocation(IJX)
set IHX=null
set IJX=null
set OIX=null
set EXX=null
endfunction
function IKX takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'B01S')!=0 and GetRandomInt(1,100)<=GetUnitAbilityLevel(GetTriggerUnit(),'A03M')*2 and GetTriggerUnit()!=GetEventDamageSource() and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())) and Damage_IsAttack() then
call IGX()
endif
return false
endfunction
function ILX takes nothing returns nothing
local trigger X_X=CreateTrigger()
call TriggerAddCondition(X_X,Condition(function IKX))
call MOE(II,(X_X))
set X_X=null
endfunction
function IMX takes nothing returns boolean
local unit IPX
local real x
local real y
local integer lvl
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RB))then
set x=GetUnitX(RB)
set y=GetUnitY(RB)
set lvl = GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(RB))],'A006')
set IPX=CreateUnit((GetOwningPlayer(RB)),'h007',x,y,.0)
call UnitApplyTimedLife(IPX,'BTLF',1.)
call UnitAddAbility(IPX,'A0CT')
call SetUnitAbilityLevel(IPX,'A0CT',lvl)
call IssueTargetOrderById(IPX,852231,GetFilterUnit())
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Flameshock.mdx",GetFilterUnit(),"chest"))
call UnitDamageTargetEx(LC[1+GetPlayerId(GetOwningPlayer(RB))],GetFilterUnit(),((GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(RB))],true)+GetHeroInt(LC[1+GetPlayerId(GetOwningPlayer(RB))],true))*2.*lvl*(1.+(.075 * GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(RB))])))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call UnitDamageTargetEx(LC[1+GetPlayerId(GetOwningPlayer(RB))],GetFilterUnit(),((GetUnitState(LC[1+GetPlayerId(GetOwningPlayer(RB))],UNIT_STATE_MAX_MANA)-GetUnitState(LC[1+GetPlayerId(GetOwningPlayer(RB))],UNIT_STATE_MANA))*.25)*(1.+(.05*GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(RB))]))),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set IPX=null
return false
endfunction
function IQX takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
if IsUnitEnemy(J2E,GetOwningPlayer(GZV[RPX]))and UnitAlive(J2E)then
if OEX(HKV[RPX],J2E)then
set RB=GZV[RPX]
call GroupEnumUnitsInRange(OB,RQX,RSX,225.,Filter(function IMX))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firaga.mdx",J2E,"origin"))
call EHX(RPX)
endif
endif
endfunction
function ISX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(IB,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,(Deg2Rad(GetUnitFacing(OIX))))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\OrbOfFire.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(7)
call EMX(OMX,G1V[OMX])
call MoveLocation(IB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,650.)
set OIX=null
set EXX=null
endfunction
/*function ITX takes nothing returns boolean
if GetSpellAbilityId()=='A006' then
call ISX()
endif
return false
endfunction*/
function IUX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function ITX))
set X_X=null*/
call RegisterSpellEffectEvent('A006', function ISX)
endfunction
function IWX takes nothing returns boolean
local unit u
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(NB))then
set u=CreateUnit(GetOwningPlayer(NB),'h007',GetUnitX(NB),GetUnitY(NB),.0)
call UnitAddAbility(u,'A028')
call SetUnitAbilityLevel(u,'A028',GetUnitAbilityLevel(NB,'A017'))
call UnitDamageTargetEx(NB,GetFilterUnit(),((GetHeroInt(NB,true))*.5*GetUnitAbilityLevel(NB,'A017')*GetUnitAbilityLevel(NB,'A017'))*(1. + (.1 * GetHeroLevel(NB))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call IssueTargetOrderById(u,852095,GetFilterUnit())
call UnitApplyTimedLife(u,'BTLF',1.)
endif
set u=null
return false
endfunction
function IYX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
local location IHX
local location IJX
set OJX=GetSpellTargetX()
set OKX=GetSpellTargetY()
set IHX=Location(OJX,OKX)
set IJX=CNE(IHX,GetRandomReal(800.,1000.),GetRandomReal(.0,360.))
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(BB,OJX,OKX)
set OMX=XAX(GetLocationX(IJX),GetLocationY(IJX),1200.+GetLocationZ(BB),OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\LivingMeteor.mdx")
call V8X(OMX,1.2)
set G2V[OMX]=.0
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=false
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HBV[OMX]=(9)
call MoveLocation(BB,OJX,OKX)
call XRX(OMX,OJX,OKX,GetLocationZ(BB),1200.)
call RemoveLocation(IHX)
call RemoveLocation(IJX)
set IHX=null
set IJX=null
set OIX=null
endfunction
/*function IZX takes nothing returns boolean
if GetSpellAbilityId()=='A017' then
call IYX()
endif
return false
endfunction*/
function I_X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function IZX))
set X_X=null*/
call RegisterSpellEffectEvent('A017', function IYX)
endfunction
function I0X takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
local unit IPX
if J2E==(HZV[(RPX)])and IsUnitAliveBJ(J2E)then
if OEX(HKV[RPX],J2E)then
set IPX=CreateUnit((GetOwningPlayer(GZV[RPX])),'h007',RQX,RSX,.0)
call UnitApplyTimedLife(IPX,'BTLF',1.)
call UnitAddAbility(IPX,'A09O')
call SetUnitAbilityLevel(IPX,'A09O',GetUnitAbilityLevel(GZV[RPX],'A02E'))
if IsUnitType(J2E,UNIT_TYPE_ANCIENT) then
if BRTON then
call UnitDamageTargetEx(GZV[RPX],J2E,(GetUnitAbilityLevel(GZV[RPX],'A02E')*1.6*GetUnitAbilityLevel(GZV[RPX],'A02E')*GetHeroInt(GZV[RPX],true)*(1.+(.05*GetHeroLevel(GZV[RPX]))))+40.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(GZV[RPX],J2E,(GetUnitAbilityLevel(GZV[RPX],'A02E')*.20*GetUnitAbilityLevel(GZV[RPX],'A02E')*GetHeroInt(GZV[RPX],true)*(1.+(.05*GetHeroLevel(GZV[RPX]))))+40.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
else
call UnitDamageTargetEx(GZV[RPX],J2E,GetUnitAbilityLevel(GZV[RPX],'A02E')*.40*GetUnitAbilityLevel(GZV[RPX],'A02E')*GetHeroInt(GZV[RPX],true)*(1.+(.05*GetHeroLevel(GZV[RPX]))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call IssueTargetOrderById(IPX,852095,J2E)
call EHX(RPX)
endif
endif
set IPX=null
endfunction
function I1X takes nothing returns nothing
local unit OIX=LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local real CDE=Atan2(GetUnitY(EXX)-GetUnitY(OIX),GetUnitX(EXX)-GetUnitX(OIX))
local integer OMX=0
call MoveLocation(CB,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,CDE)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
if IsAMChonk[GetUnitUserData(OIX)] then
call V9X(OMX,"war3mapImported\\ChomusukeBlue.mdx")
call V8X(OMX,1.5)
else
call V9X(OMX,"Abilities\\Spells\\Other\\FrostBolt\\FrostBoltMissile.mdl")
call V8X(OMX,1.)
endif
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(8)
set G4V[OMX]=20.
set G9V[OMX]=true
call EMX(OMX,G1V[OMX])
call MoveLocation(CB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1500.)
set OIX=null
set EXX=null
endfunction
/*function I2X takes nothing returns boolean
if GetSpellAbilityId()=='A02E' then
call I1X()
endif
return false
endfunction*/
function I3X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function I2X))
set X_X=null*/
call RegisterSpellEffectEvent('A02E', function I1X)
endfunction
function I4X takes integer RPX,unit uu returns nothing
local unit u2=uu
local unit su
if UnitAlive(u2)and IsUnitEnemy(u2,G_V[RPX])then
call UnitDamageTargetEx((GZV[RPX]),(u2),((G3V[RPX])*1.),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
if IsUnitType(u2,UNIT_TYPE_ANCIENT)==false then
set su=CreateUnit(G_V[RPX],'h007',HHV[RPX],HJV[RPX],.0)
call UnitApplyTimedLife(su,'BTLF',1.)
call UnitAddAbility(su,'A040')
call IssueTargetOrderById(su,852226,u2)
endif
call EHX(RPX)
endif
set u2=null
set su=null
endfunction
function I5X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local integer p=0
local real tx
local real ty
local real a
local real tf
local real I6X
local integer i = GetUnitAbilityLevel(K9V[PXE],'A041')
if LOV[PXE]==0 then
call JRE(PXE)
call ReleaseTimer(t)
call EHX(p)
else
set tf=GetRandomReal(LVV[PXE]-K8V[PXE],LVV[PXE]+K8V[PXE])
set tx=(((LEV[PXE])*1.)+((3000.)*1.)*Cos(((tf)*1.)*bj_DEGTORAD))
set ty=(((LXV[PXE])*1.)+((3000.)*1.)*Sin(((tf)*1.)*bj_DEGTORAD))
set a=tf*bj_DEGTORAD
call MoveLocation(DB,LEV[PXE],LXV[PXE])
set p=XAX(LEV[PXE],LXV[PXE],65.,a)
set GZV[p]=K9V[PXE]
set G_V[p]=GetOwningPlayer(K9V[PXE])
if IsAMChonk[GetUnitUserData(K9V[PXE])] then
call V9X(p,"war3mapImported\\Chomusuke.mdx")
call V8X(p,2.)
else
//call V9X(p,"war3mapImported\\BlizMissile.mdx")
call V9X(p,"war3mapImported\\FrostBoltV1.mdx")
call V8X(p,.8)
endif
set G3V[p]=AT[i] + (i*i*i*.25*GetHeroInt(K9V[PXE],true))
set G2V[p]=60.
set G8V[p]=true
set HVV[p]=true
set HOV[p]=true
set G1V[p]=72.
set HCV[p]=(9)
set HBV[p]=(10)
call MoveLocation(DB,tx,ty)
set I6X=GetLocationZ(DB)
if I6X<=0 then
set I6X=-I6X
endif
call XRX(p,tx,ty,65.+I6X,800.)
set LOV[PXE]=LOV[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function I5X)
endif
set t=null
endfunction
function I7X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local integer I8X=20+(3*GetUnitAbilityLevel(OIX,'A041'))
local real cx=(((GetUnitX(OIX))*1.)+((80.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real cy=(((GetUnitY(OIX))*1.)+((80.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local real UAE=QTE(GetUnitX(OIX),GetUnitY(OIX),x,y)-180.
local real CDE
local real K0E=GetUnitFacing(OIX)
local real tx
local real ty
local real tf
local real a
local timer t=NewTimer()
local integer PXE=JOE()
if UAE>=820 then
set UAE=820.
endif
if UAE<=.0 then
set UAE=.0
endif
set CDE=(180.-UAE*.213414634)/2.
set K7V[PXE]=UAE
set K8V[PXE]=CDE
set K9V[PXE]=OIX
set LVV[PXE]=K0E
set LEV[PXE]=cx
set LXV[PXE]=cy
set LOV[PXE]=I8X
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function I5X)
set t=null
set OIX=null
endfunction
/*function I9X takes nothing returns boolean
if GetSpellAbilityId()=='A041' then
call I7X()
endif
return false
endfunction*/
function AVX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function I9X))
set X_X=null*/
call RegisterSpellEffectEvent('A041', function I7X)
endfunction
function AEX takes integer p,unit u returns nothing
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real a
if UnitAlive(u)and u!=GZV[p] and IsUnitEnemy(u,GetOwningPlayer(GZV[p])) then
call UnitDamageTargetEx((GZV[p]),(u),((G3V[p])*1.),false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
set a = Atan2(HJV[p] - y, HHV[p] - x)
call SetUnitX(u,x+(425.*.03125)*Cos(a))
call SetUnitY(u,y+(425.*.03125)*Sin(a))
call EKX(p,u)
endif
endfunction
function AXX takes integer p,destructable d returns nothing
call KillDestructable(d)
endfunction
function GravityBall___ProjColl takes nothing returns nothing
local integer E3X=MA
local integer TBE=(PA)
//if GZV[E3X]!=GZV[TBE]then
//call ECX(E3X,HHV[E3X]+((425.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((425.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
//endif
endfunction
function AOX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetSpellTargetX()
local real ONX=GetSpellTargetY()
local real OJX=GetUnitX(OIX)
local real OKX=GetUnitY(OIX)
local real OLX=Atan2((OKX-ONX),(OJX-OAX))
local integer lvl = GetUnitAbilityLevel(OIX,GetSpellAbilityId())
local integer OMX=0
local unit d = CreateUnit(GetOwningPlayer(OIX),'h025',OAX,ONX,GetUnitFacing(OIX)-180.)
call UnitApplyTimedLife(d,'BTLF',(SquareRoot((OJX - OAX) * (OJX - OAX) + (OKX-ONX) * (OKX-ONX)))/300.)
set d = CreateUnit(GetOwningPlayer(OIX),'h025',OJX,OKX,GetUnitFacing(OIX))
call UnitApplyTimedLife(d,'BTLF',(SquareRoot((OJX - OAX) * (OJX - OAX) + (OKX-ONX) * (OKX-ONX)))/300.)
call MoveLocation(FB,OAX,ONX)
set OMX=XAX(OAX,ONX,GetUnitFlyHeight(OIX)+50.+GetLocationZ(FB),OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\Void2.mdx")
set G3V[OMX]=((GetHeroAgi(OIX,true)*.25*lvl)+(GetHeroInt(OIX,true)*.5*lvl))*.03125
call V8X(OMX,2.5)
set G2V[OMX]=50.
set G4V[OMX]=(SquareRoot((OJX - OAX) * (OJX - OAX) + (OKX-ONX) * (OKX-ONX)))/300.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=true
set G1V[OMX]=225.
set G0V[OMX]=225.
set HIV[OMX]=(11)
set HCV[OMX]=(10)
//set HBV[OMX]=(12)
set HDV[OMX]=(1)
set HNV[OMX]=(666)
call MoveLocation(FB,OJX,OKX)
call XRX(OMX,OJX,OKX,50.+GetLocationZ(FB),300.)
set d = null
set OIX=null
endfunction
/*function ARX takes nothing returns boolean
if GetSpellAbilityId()=='A005' then
call AOX()
endif
return false
endfunction*/
function AIX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function ARX))*/
call RegisterSpellEffectEvent('A0N6', function AOX)
endfunction
function AAX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local location IHX=GetSpellTargetLoc()
local location IJX=CNE(IHX,400.,GetUnitFacing(OIX)-90.)
local location ANX=CNE(IHX,400.,GetUnitFacing(OIX)+90.)
local integer OMX=0
local integer ABX=0
local integer ACX=0
if EXX==null then
set OJX=GetSpellTargetX()
set OKX=GetSpellTargetY()
else
set OJX=GetUnitX(EXX)
set OKX=GetUnitY(EXX)
endif
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(GB,OAX,ONX)
set OMX=XAX(OAX,ONX,GetUnitFlyHeight(OIX)+50.+GetLocationZ(GB),OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
set G3V[OMX]=(500*GetUnitAbilityLevel(OIX,'A022')*GetUnitAbilityLevel(OIX,'A022'))+((1.+(.05 * GetHeroLevel(OIX)))*2*GetHeroStr(OIX,true)* GetUnitAbilityLevel(OIX,'A022'))
call V8X(OMX,2.)
set G2V[OMX]=50.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=false
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HBV[OMX]=(13)
call EMX(OMX,G1V[OMX])
call MoveLocation(GB,OJX,OKX)
if EXX!=null then
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+50.+GetLocationZ(GB),1000.)
else
set JFV[OMX]=true
set JGV[OMX]=40+(GetUnitAbilityLevel(OIX,'A022')*5)
set JCV[OMX]=.01
set JDV[OMX]=.01
call XIX(OMX,OJX,OKX,GetLocationZ(GB),1000.,.35)
endif
set ABX=XAX(OAX,ONX,GetUnitFlyHeight(OIX)+50.+GetLocationZ(GB),OLX)
set GZV[ABX]=OIX
set G_V[ABX]=GetOwningPlayer(OIX)
call V9X(ABX,"Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
set G3V[ABX]=(500*GetUnitAbilityLevel(OIX,'A022')*GetUnitAbilityLevel(OIX,'A022'))+((1.+(.05 * GetHeroLevel(OIX)))*2*GetHeroStr(OIX,true)* GetUnitAbilityLevel(OIX,'A022'))
call V8X(ABX,2.)
set G2V[ABX]=50.
set G8V[ABX]=true
set HVV[ABX]=true
set HOV[ABX]=false
set HXV[ABX]=false
set G1V[ABX]=64.
set G0V[ABX]=64.
set HBV[ABX]=(13)
call EMX(ABX,G1V[ABX])
call MoveLocation(GB,OJX,OKX)
if EXX!=null then
call EEX(ABX,EXX)
set HEV[ABX]=true
call XRX(ABX,OJX,OKX,GetUnitFlyHeight(EXX)+50.+GetLocationZ(GB),1000.)
else
set JFV[ABX]=true
set JGV[ABX]=30+(GetUnitAbilityLevel(OIX,'A022')*5)
set JCV[ABX]=.0
set JDV[ABX]=.0
call XIX(ABX,GetLocationX(IJX),GetLocationY(IJX),GetLocationZ(GB),1000.,.35)
endif
set ACX=XAX(OAX,ONX,GetUnitFlyHeight(OIX)+50.+GetLocationZ(GB),OLX)
set GZV[ACX]=OIX
set G_V[ACX]=GetOwningPlayer(OIX)
call V9X(ACX,"Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
set G3V[ACX]=(500*GetUnitAbilityLevel(OIX,'A022')*GetUnitAbilityLevel(OIX,'A022'))+((1.+(.05 * GetHeroLevel(OIX)))*2*GetHeroStr(OIX,true)* GetUnitAbilityLevel(OIX,'A022'))
call V8X(ACX,2.)
set G2V[ACX]=50.
set G8V[ACX]=true
set HVV[ACX]=true
set HOV[ACX]=false
set HXV[ACX]=false
set G1V[ACX]=64.
set G0V[ACX]=64.
set HBV[ACX]=(13)
call EMX(ACX,G1V[ACX])
call MoveLocation(GB,OJX,OKX)
if EXX!=null then
call EEX(ACX,EXX)
set HEV[ACX]=true
call XRX(ACX,OJX,OKX,GetUnitFlyHeight(EXX)+50.+GetLocationZ(GB),1000.)
else
set JFV[ACX]=true
set JGV[ACX]=30+(GetUnitAbilityLevel(OIX,'A022')*5)
set JCV[ACX]=.0
set JDV[ACX]=.0
call XIX(ACX,GetLocationX(ANX),GetLocationY(ANX),GetLocationZ(GB),1000.,.35)
endif
call RemoveLocation(IHX)
call RemoveLocation(IJX)
call RemoveLocation(ANX)
set IHX=null
set IJX=null
set ANX=null
set OIX=null
set EXX=null
endfunction
/*function ADX takes nothing returns boolean
if GetSpellAbilityId()=='A022' then
call AAX()
endif
return false
endfunction*/
function AFX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function ADX))
set X_X=null*/
call RegisterSpellEffectEvent('A022', function AAX)
endfunction
function AGX takes integer RPX,unit uu returns nothing
local unit u2=uu
local real a=bj_RADTODEG*Atan2(GetUnitY(u2)-HJV[RPX],GetUnitX(u2)-HHV[RPX])
if UnitAlive(u2)and IsUnitEnemy(u2,G_V[RPX]) and not IsUnitType(u2,UNIT_TYPE_STRUCTURE)then
if IsUnitType(u2,UNIT_TYPE_ANCIENT) and not BRTON then
call UnitDamageTargetEx((GZV[RPX]),(u2),((G3V[RPX])/3.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
if BRTON and IsUnitType(u2,UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx((GZV[RPX]),(u2),((G3V[RPX])*6.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx((GZV[RPX]),(u2),((G3V[RPX])*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
call M6E(u2,25.+(5.*GetUnitAbilityLevel(GZV[RPX],'A06S'))+(((H4V[(RPX)]/.03125)-1300.)/20.),.2,a,"war3mapImported\\SlideWater.mdx",.0,false,false)
call EHX(RPX)
endif
set u2=null
endfunction
function AHX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local integer p=0
local real tx
local real ty
local real a
local real tf
local real I6X
local real cx=(((GetUnitX(LCV[PXE]))*1.)+((80.)*1.)*Cos(((GetUnitFacing(LCV[PXE]))*1.)*bj_DEGTORAD))
local real cy=(((GetUnitY(LCV[PXE]))*1.)+((80.)*1.)*Sin(((GetUnitFacing(LCV[PXE]))*1.)*bj_DEGTORAD))
if LHV[PXE]==0 then
call JXE(PXE)
call ReleaseTimer(t)
call EHX(p)
else
set tf=GetRandomReal(LDV[PXE]-LBV[PXE],LDV[PXE]+LBV[PXE])
set tx=(((LFV[PXE])*1.)+((3000.)*1.)*Cos(((tf)*1.)*bj_DEGTORAD))
set ty=(((LGV[PXE])*1.)+((3000.)*1.)*Sin(((tf)*1.)*bj_DEGTORAD))
set a=tf*bj_DEGTORAD
call MoveLocation(HB,LFV[PXE],LGV[PXE])
set p=XAX(cx,cy,65.,a)
set GZV[p]=LCV[PXE]
set G_V[p]=GetOwningPlayer(LCV[PXE])
call V9X(p,"Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl")
set G3V[p]=GetHeroInt(LCV[PXE],true)*GetUnitAbilityLevel(LCV[PXE],'A06S')*(1. + (.05 * GetHeroLevel(LCV[PXE])))
call V8X(p,1.)
set G2V[p]=60.
set G8V[p]=true
set HVV[p]=true
set HOV[p]=true
set G1V[p]=72.
set HIV[p]=(14)
set HCV[p]=(11)
set HBV[p]=(15)
set JGV[p]=1300
call MoveLocation(HB,tx,ty)
set I6X=GetLocationZ(HB)
if I6X<=0 then
set I6X=-I6X
endif
call XRX(p,tx,ty,65.+I6X,1300.)
call M6E(LCV[PXE],5.,.02,GetUnitFacing(LCV[PXE])-180.,"war3mapImported\\SlideWater.mdx",.0,false,false)
set LHV[PXE]=LHV[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function AHX)
endif
set t=null
endfunction
function AJX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local integer I8X=30
local real cx=(((GetUnitX(OIX))*1.)+((80.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real cy=(((GetUnitY(OIX))*1.)+((80.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local real UAE=QTE(GetUnitX(OIX),GetUnitY(OIX),x,y)-180.
local real CDE
local real K0E=GetUnitFacing(OIX)
local real tx
local real ty
local real tf
local real a
local timer t=NewTimer()
local integer PXE=JEE()
if UAE>=820 then
set UAE=820.
endif
if UAE<=.0 then
set UAE=.0
endif
set CDE=(180.-UAE*.213414634)/2.
set LNV[PXE]=UAE
set LBV[PXE]=CDE
set LCV[PXE]=OIX
set LDV[PXE]=K0E
set LFV[PXE]=cx
set LGV[PXE]=cy
set LHV[PXE]=I8X
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function AHX)
set t=null
set OIX=null
endfunction
/*function AKX takes nothing returns boolean
if GetSpellAbilityId()=='A06S' then
call AJX()
endif
return false
endfunction*/
function ALX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function AKX))
set X_X=null*/
call RegisterSpellEffectEvent('A06S', function AJX)
endfunction
function AMX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call UnitPauseTimedLife(LMV[PXE],false)
call UnitRemoveAbility(LMV[PXE],'A05H')
call DestroyEffect(LPV[PXE])
call ReleaseTimer(GetExpiredTimer())
call JVE(PXE)
set t=null
endfunction
function APX takes integer RPX,unit J2E returns nothing
local timer t
local integer i
local integer PXE=0
if J2E==(HZV[(RPX)])then
if UnitAlive(J2E)and GetUnitAbilityLevel(J2E,'A05H')!=1 then
call UnitPauseTimedLife(J2E,true)
call UnitAddAbility(J2E,'A05H')
set t=NewTimer()
set PXE=H9E()
set LMV[PXE]=J2E
set LPV[PXE]=AddSpecialEffectTarget("war3mapImported\\AirEssence.mdx",J2E,"origin")
call SetTimerData(t,PXE)
call TimerStart(t,10.*I2R(GetUnitAbilityLevel(GZV[RPX],'A04Y')),false,function AMX)
if GetRandomInt(1,100)<=2*GetUnitAbilityLevel(GZV[RPX],'A04Y')then
call UnitRemoveAbility(GZV[RPX],'A04W')
call UnitAddAbility(GZV[RPX],'A04W')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",GZV[RPX],"chest"))
endif
if GetRandomInt(1,100)<=GetUnitAbilityLevel(GZV[RPX],'A04Y')and GetUnitAbilityLevel(GZV[RPX],'A04X')!=0 then
set i=GetUnitAbilityLevel(GZV[RPX],'A04X')
call UnitRemoveAbility(GZV[RPX],'A04X')
call UnitAddAbility(GZV[RPX],'A04X')
call SetUnitAbilityLevel(GZV[RPX],'A04X',i)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\s_Nature'sBloom Effect.mdx",GZV[RPX],"chest"))
endif
endif
call EHX(RPX)
elseif GetOwningPlayer(J2E)==GetOwningPlayer(GZV[RPX])and not IsUnitType(J2E,UNIT_TYPE_HERO)and UnitAlive(J2E)and GetUnitAbilityLevel(J2E,'A05H')!=1 then
call UnitPauseTimedLife(J2E,true)
call UnitAddAbility(J2E,'A05H')
set t=NewTimer()
set PXE=H9E()
set LMV[PXE]=J2E
set LPV[PXE]=AddSpecialEffectTarget("war3mapImported\\AirEssence.mdx",J2E,"origin")
call SetTimerData(t,PXE)
call TimerStart(t,5.*I2R(GetUnitAbilityLevel(GZV[RPX],'A04Y')),false,function AMX)
endif
set t=null
endfunction
function AQX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(JB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(GetUnitFacing(OIX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Weapons\\SorceressMissile\\SorceressMissile.mdl")
call V8X(OMX,3.5)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=128.
set G0V[OMX]=64.
set HCV[OMX]=(12)
call EMX(OMX,G1V[OMX])
call MoveLocation(JB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1000.)
set OIX=null
set EXX=null
endfunction
/*function ASX takes nothing returns boolean
if GetSpellAbilityId()=='A04Y' then
call AQX()
endif
return false
endfunction*/
function ATX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function ASX))
set X_X=null*/
call RegisterSpellEffectEvent('A04Y', function AQX)
endfunction
function AUX takes nothing returns boolean
if GetOwningPlayer(GetFilterUnit())==GetOwningPlayer(LB)and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)and UnitAlive(GetFilterUnit())then
if MB+GetWidgetLife(GetFilterUnit())>=GetUnitState(GetFilterUnit(),UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(GetFilterUnit(),GetUnitState(GetFilterUnit(),UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(GetFilterUnit(),GetWidgetLife(GetFilterUnit())+MB)
endif
endif
return false
endfunction
function AWX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if LYV[PXE]==1000 then
call DestroyEffect(LWV[PXE])
call ReleaseTimer(GetExpiredTimer())
call H8E(PXE)
else
set LB=LUV[PXE]
set MB=LZV[PXE]
call GroupEnumUnitsInRange(KB,GetUnitX(LUV[PXE]),GetUnitY(LUV[PXE]),600.,Filter(function AUX))
set LYV[PXE]=LYV[PXE]+1
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function AWX)
endif
set t=null
endfunction
function AYX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if LYV[PXE]==1000 then
call DestroyEffect(LWV[PXE])
call ReleaseTimer(GetExpiredTimer())
call H8E(PXE)
else
if LZV[PXE]+GetWidgetLife(LUV[PXE])>=GetUnitState(LUV[PXE],UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(LUV[PXE],GetUnitState(LUV[PXE],UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(LUV[PXE],GetWidgetLife(LUV[PXE])+LZV[PXE])
endif
set LYV[PXE]=LYV[PXE]+1
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function AYX)
endif
set t=null
endfunction
function AZX takes integer RPX,unit J2E returns nothing
local integer li=0
local integer hp=(7*GetUnitAbilityLevel(GZV[RPX],'A05B')) + 2*PC
local timer t
local integer PXE=0
if LWMON and not GAMEM then
set hp=(7*GetUnitAbilityLevel(GZV[RPX],'A05B')) + (GetHeroLevel(GZV[RPX])/3)
endif
if J2E==(HZV[(RPX)])and UnitAlive(J2E)then
if GetRandomInt(1,100)<=GetUnitAbilityLevel(GZV[RPX],'A05B')then
set t=NewTimer()
set PXE=H7E()
set LUV[PXE]=J2E
set LWV[PXE]=AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.mdl",J2E,"origin")
set LYV[PXE]=0
set LZV[PXE]=I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))*20.*I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))/2000.
if(LZV[PXE]*2000.)+GetWidgetLife(J2E)>=GetUnitState(J2E,UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(J2E,GetUnitState(J2E,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(J2E,GetWidgetLife(J2E)+(LZV[PXE]*2000.))
endif
loop
exitwhen li==hp
if GetUnitAbilityLevel(J2E,'BTLF') != 0 then
call UnitAddItemById(J2E,'I021')
endif
set li=li+1
endloop
set li=0
call UnitAddAbility(J2E,'A04Z')
call SetUnitAbilityLevel(J2E,'A04Z',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call UnitAddAbility(J2E,'A052')
call SetUnitAbilityLevel(J2E,'A052',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ForestBolt.mdx",J2E,"origin"))
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function AWX)
call EHX(RPX)
else
set t=NewTimer()
set PXE=H7E()
set LUV[PXE]=J2E
set LWV[PXE]=AddSpecialEffectTarget("war3mapImported\\EmeraldPortal.mdx",J2E,"origin")
set LYV[PXE]=0
set LZV[PXE]=I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))*20.*I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))/2000.
if(LZV[PXE]*2000.)+GetWidgetLife(J2E)>=GetUnitState(J2E,UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(J2E,GetUnitState(J2E,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(J2E,GetWidgetLife(J2E)+(LZV[PXE]*2000.))
endif
loop
exitwhen li==hp
if GetUnitAbilityLevel(J2E,'BTLF') != 0 then
call UnitAddItemById(J2E,'I021')
endif
set li=li+1
endloop
set li=0
call UnitAddAbility(J2E,'A04Z')
call SetUnitAbilityLevel(J2E,'A04Z',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call UnitAddAbility(J2E,'A052')
call SetUnitAbilityLevel(J2E,'A052',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ForestBolt.mdx",J2E,"origin"))
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function AYX)
call EHX(RPX)
endif
else
if GetOwningPlayer(J2E)==GetOwningPlayer(GZV[RPX])and not IsUnitType(J2E,UNIT_TYPE_HERO)and UnitAlive(J2E) and GetUnitTypeId(J2E) != 'n01C' and GetUnitTypeId(J2E) != 'n01G' then
set t=NewTimer()
set PXE=H7E()
set LUV[PXE]=J2E
set LWV[PXE]=AddSpecialEffectTarget("war3mapImported\\EmeraldPortal.mdx",J2E,"origin")
set LYV[PXE]=0
set LZV[PXE]=I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))*10.*I2R(GetUnitAbilityLevel(GZV[RPX],'A05B'))/2000.
if(LZV[PXE]*2000.)+GetWidgetLife(J2E)>=GetUnitState(J2E,UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(J2E,GetUnitState(J2E,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(J2E,GetWidgetLife(J2E)+(LZV[PXE]*2000.))
endif
call UnitAddAbility(J2E,'A050')
call SetUnitAbilityLevel(J2E,'A050',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call UnitAddAbility(J2E,'A053')
call SetUnitAbilityLevel(J2E,'A053',GetUnitAbilityLevel(GZV[RPX],'A05B'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ForestBolt.mdx",J2E,"origin"))
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function AYX)
endif
endif
set t=null
endfunction
function A_X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(PB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(GetUnitFacing(OIX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Weapons\\KeeperGroveMissile\\KeeperGroveMissile.mdl")
call V8X(OMX,2.5)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=128.
set G0V[OMX]=64.
set HCV[OMX]=(13)
call EMX(OMX,G1V[OMX])
call MoveLocation(PB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1000.)
set OIX=null
set EXX=null
endfunction
/*function A0X takes nothing returns boolean
if GetSpellAbilityId()=='A05B' then
call A_X()
endif
return false
endfunction*/
function A1X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function A0X))
set X_X=null*/
call RegisterSpellEffectEvent('A05B', function A_X)
endfunction
function A2X takes integer RPX,unit J2E returns nothing
local unit u
local integer li=0
local integer SVE=(2*GetUnitAbilityLevel(GZV[RPX],'A054')) + PC
if LWMON and not GAMEM then
set SVE=(2*GetUnitAbilityLevel(GZV[RPX],'A054')) + (GetHeroLevel(GZV[RPX])*3/2)
endif
if J2E==(HZV[(RPX)])and UnitAlive(J2E)then
if GetRandomInt(1,100)<=GetUnitAbilityLevel(GZV[RPX],'A054')then
call UnitAddAbility(J2E,'A056')
call SetUnitAbilityLevel(J2E,'A056',GetUnitAbilityLevel(GZV[RPX],'A054'))
call UnitAddAbility(J2E,'A058')
call SetUnitAbilityLevel(J2E,'A058',GetUnitAbilityLevel(GZV[RPX],'A054'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlessingofElun.mdx",J2E,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\RedCharkaExplosion.mdx",J2E,"origin"))
loop
exitwhen li==SVE
if GetUnitAbilityLevel(J2E,'BTLF') != 0 then
call UnitAddItemById(J2E,'I022')
endif
set li=li+1
endloop
set li=0
set u=CreateUnit(GetOwningPlayer(J2E),'h007',GetUnitX(J2E),GetUnitY(J2E),.0)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,'A055')
call SetUnitAbilityLevel(u,'A055','A054')
call IssueImmediateOrderById(u,852164)
call EHX(RPX)
else
call UnitAddAbility(J2E,'A056')
call SetUnitAbilityLevel(J2E,'A056',GetUnitAbilityLevel(GZV[RPX],'A054'))
call UnitAddAbility(J2E,'A058')
call SetUnitAbilityLevel(J2E,'A058',GetUnitAbilityLevel(GZV[RPX],'A054'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlessingofElun.mdx",J2E,"origin"))
loop
exitwhen li==SVE
if GetUnitAbilityLevel(J2E,'BTLF') != 0 then
call UnitAddItemById(J2E,'I022')
endif
set li=li+1
endloop
set li=0
call EHX(RPX)
endif
else
if GetOwningPlayer(J2E)==GetOwningPlayer(GZV[RPX])and not IsUnitType(J2E,UNIT_TYPE_HERO)and UnitAlive(J2E)then
call UnitAddAbility(J2E,'A057')
call SetUnitAbilityLevel(J2E,'A057',GetUnitAbilityLevel(GZV[RPX],'A054'))
call UnitAddAbility(J2E,'A059')
call SetUnitAbilityLevel(J2E,'A059',GetUnitAbilityLevel(GZV[RPX],'A054'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlessingofElun.mdx",J2E,"origin"))
endif
endif
endfunction
function A3X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(QB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(GetUnitFacing(OIX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Weapons\\BlackKeeperMissile\\BlackKeeperMissile.mdl")
call V8X(OMX,2.5)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=128.
set G0V[OMX]=64.
set HCV[OMX]=(14)
call EMX(OMX,G1V[OMX])
call MoveLocation(QB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1000.)
set OIX=null
set EXX=null
endfunction
/*function A4X takes nothing returns boolean
if GetSpellAbilityId()=='A054' then
call A3X()
endif
return false
endfunction*/
function A5X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function A4X))
set X_X=null*/
call RegisterSpellEffectEvent('A054', function A3X)
endfunction
function A6X takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
local unit IPX
if J2E==(HZV[(RPX)])and IsUnitAliveBJ(J2E)then
if OEX(HKV[RPX],J2E)then
set IPX=CreateUnit((GetOwningPlayer(GZV[RPX])),'h007',RQX,RSX,.0)
call UnitApplyTimedLife(IPX,'BTLF',1.)
call UnitAddAbility(IPX,'A08A')
call IssueTargetOrderById(IPX,852585,J2E)
call EHX(RPX)
endif
endif
set IPX=null
endfunction
function A7X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
call MoveLocation(SB,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,(Deg2Rad(GetUnitFacing(OIX))))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\StrongDrink\\BrewmasterMissile.mdl")
call V8X(OMX,1.)
set G2V[OMX]=60.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(15)
call EMX(OMX,G1V[OMX])
call MoveLocation(SB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XIX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1500.,.15)
set OIX=null
set EXX=null
endfunction
/*function A8X takes nothing returns boolean
if GetSpellAbilityId()=='A02R' then
call A7X()
endif
return false
endfunction*/
function A9X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function A8X))
set X_X=null*/
call RegisterSpellEffectEvent('A02R', function A7X)
endfunction
function NVX takes integer RPX,unit J2E returns nothing
if UnitAlive(J2E)and J2E!=GZV[RPX]and GetUnitTypeId(J2E)!='hpea' then
if OEX(HKV[RPX],J2E)then
if J2E==(HZV[(RPX)])then
call UnitDamageTargetEx((GZV[RPX]),(J2E),((G3V[RPX])*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx((GZV[RPX]),(J2E),((G3V[RPX]/2.)*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
call EHX(RPX)
else
call EKX(RPX,J2E)
endif
endif
endfunction
function NEX takes integer RPX,destructable MGE returns nothing
call KillDestructable(MGE)
call EHX(RPX)
endfunction
function NXX takes nothing returns nothing
local integer OMX=0
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local unit EXX=GetOrderTargetUnit()
local real OJX=GetOrderPointX()
local real OKX=GetOrderPointY()
local real angl=.0
if EXX!=null then
set OJX=GetUnitX(EXX)
set OKX=GetUnitY(EXX)
elseif GetOrderTargetDestructable()!=null then
set OJX=GetDestructableX(GetOrderTargetDestructable())
set OKX=GetDestructableY(GetOrderTargetDestructable())
endif
set OMX=XAX(OAX,ONX,GetUnitFlyHeight(OIX)+50.,Atan2((OKX-ONX),(OJX-OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
set G3V[OMX]=10.
call V9X(OMX,"Abilities\\Weapons\\WyvernSpear\\WyvernSpearMissile.mdl")
call V8X(OMX,.75)
set G2V[OMX]=50.
set G1V[OMX]=32.
set G8V[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set HCV[OMX]=(16)
set HBV[OMX]=(16)
set HDV[OMX]=(2)
set HNV[OMX]=(17)
call EMX(OMX,G1V[OMX]*.5)
call MoveLocation(TB,OJX,OKX)
if EXX!=null then
call EEX(OMX,EXX)
set HEV[OMX]=true
call XIX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+50.+GetLocationZ(TB),600.,.2)
else
set OJX=OJX+GetRandomReal(.0,200.)*Cos(GetRandomReal(.0,2.*bj_PI))
set OKX=OKX+GetRandomReal(.0,200.)*Cos(GetRandomReal(.0,2.*bj_PI))
call XIX(OMX,OJX,OKX,GetLocationZ(TB),600.,.2)
endif
if GetUnitTypeId(OIX)=='hpea' then
call DisableTrigger(UB)
call PauseUnit(OIX,true)
call IssueImmediateOrderById(OIX,851972)
call PauseUnit(OIX,false)
call EnableTrigger(UB)
endif
set EXX=null
set OIX=null
endfunction
function NOX takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit())=='hpea' or GetUnitTypeId(GetTriggerUnit())=='hgry' then
call NXX()
endif
return false
endfunction
function NRX takes nothing returns nothing
set UB=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(UB,Player(0),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
call TriggerRegisterPlayerUnitEvent(UB,Player(0),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
call TriggerAddCondition(UB,Condition(function NOX))
endfunction
function NIX takes integer p,unit u returns nothing
local real x=HHV[p]
local real y=HJV[p]
local location NAX=Location(x,y)
local location NNX=GetUnitLoc(u)
if UnitAlive(u)and u!=GZV[p]and IsUnitEnemy(u,GetOwningPlayer(GZV[p]))and not(GetUnitAbilityLevel((u),'Avul')>0)and not IsUnitType(u,UNIT_TYPE_STRUCTURE)then
call UnitDamageTargetEx((GZV[p]),(u),((G3V[p])*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call M6E((u),((400.)*1.),((1.)*1.),((AngleBetweenPoints(NAX,NNX))*1.),null,150.,false,false)
call EKX(p,u)
endif
call RemoveLocation(NAX)
call RemoveLocation(NNX)
set NAX=null
set NNX=null
endfunction
function NBX takes integer p,destructable d returns nothing
local real NCX=HHV[p]
local real NDX=HJV[p]
local location NFX=Location(NCX,NDX)
local real NGX=.0
local unit u
local unit u2
local unit u3
local unit CBE=GZV[p]
local real SVE=G3V[p]
local real tx=GetDestructableX(d)
local real ty=GetDestructableY(d)
local real a=QWE(EOX(p),HHV[p],HJV[p],tx,ty)*bj_RADTODEG
local real nx=(((HHV[p])*1.)+((500.)*1.)*Cos(((a)*1.)*bj_DEGTORAD))
local real ny=(((HJV[p])*1.)+((500.)*1.)*Sin(((a)*1.)*bj_DEGTORAD))
if JGV[p]>=(501.+(I2R(GetUnitAbilityLevel(CBE,'A04C'))*100.))then
call EHX(p)
call O2X(CBE,NFX,(SVE*I2R(GetUnitAbilityLevel(CBE,'A04C'))),300.,DAMAGE_TYPE_NORMAL,ATTACK_TYPE_NORMAL,false)
set u=CreateUnit(GetOwningPlayer(CBE),'h00M',NCX,NDX,.0)
call KillUnit(u)
loop
exitwhen NGX==360.
call O2X(CBE,CNE(NFX,500.,NGX),(SVE*I2R(GetUnitAbilityLevel(CBE,'A04C'))),300.,DAMAGE_TYPE_NORMAL,ATTACK_TYPE_NORMAL,false)
set u=CreateUnitAtLoc(GetOwningPlayer(CBE),'h00M',CNE(NFX,500.,NGX),.0)
call KillUnit(u)
set u2=CreateUnitAtLoc(GetOwningPlayer(CBE),'h00M',CNE(NFX,300.,NGX),.0)
call KillUnit(u2)
set u3=CreateUnitAtLoc(GetOwningPlayer(CBE),'h00M',CNE(NFX,150.,NGX),.0)
call KillUnit(u3)
set NGX=NGX+(360./18.)
endloop
else
set JGV[p]=JGV[p]+50
call MoveLocation(WB,nx,ny)
call EFX(p,false)
call XRX(p,nx,ny,30.+GetLocationZ(WB),I2R(JGV[p]))
endif
set CBE=null
set u=null
set u2=null
set u3=null
call RemoveLocation(NFX)
set NFX=null
endfunction
function Shockwave__ProjColl takes nothing returns nothing
local integer E3X=MA
local integer TBE=(PA)
if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
call ECX(E3X,HHV[E3X]+((700.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((700.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
endif
endfunction
function NHX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local location OFX=GetUnitLoc(OIX)
local real OGX=(I2R(GetUnitAbilityLevelSwapped('A04C',OIX))*(2250.+(125.*I2R(GetUnitAbilityLevelSwapped('A04C',OIX)))))
local location OHX=CNE(OFX,OGX,GetUnitFacing(OIX))
local real OJX=GetLocationX(OHX)
local real OKX=GetLocationY(OHX)
local real OLX=Atan2((OKX-ONX),(OJX-OAX))
local integer OMX=0
call DestroyEffect(AddSpecialEffect("war3mapImported\\FireNova2.mdx",OAX,ONX))
call MoveLocation(WB,OAX,ONX)
set OMX=XAX(OAX,ONX,30.,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\Tectonicfury.mdx")
set G3V[OMX]=((I2R(GetUnitAbilityLevelSwapped('A04C',OIX)))*4000.)*.03125
call V8X(OMX,.9)
set G2V[OMX]=30.
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=true
set G1V[OMX]=172.
set G0V[OMX]=172.
set HIV[OMX]=(18)
set HCV[OMX]=(17)
set HDV[OMX]=(3)
set JFV[OMX]=false
set JGV[OMX]=350
set JCV[OMX]=.0
set JDV[OMX]=1.
call MoveLocation(WB,OJX,OKX)
call XRX(OMX,OJX,OKX,30.+GetLocationZ(WB),350.)
call RemoveLocation(OFX)
call RemoveLocation(OHX)
set OFX=null
set OHX=null
set OIX=null
endfunction
/*function NJX takes nothing returns boolean
if GetSpellAbilityId()=='A04C' then
call NHX()
endif
return false
endfunction*/
function NKX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function NJX))
set X_X=null*/
call RegisterSpellEffectEvent('A04C', function NHX)
endfunction
function NLX takes integer D0E returns nothing
call RemoveUnit(L2V[D0E])
set L2V[D0E]=null
call H6E(D0E)
endfunction
function NMX takes integer D0E returns nothing
if L3V[D0E]==NX then
call H4E(D0E)
call NLX(D0E)
endif
endfunction
function NPX takes nothing returns boolean
local integer D0E=L4V[(0)]
loop
exitwhen D0E==0
call NMX(D0E)
set D0E=L4V[D0E]
endloop
return false
endfunction
function NQX takes integer D0E returns nothing
set L5V[L4V[(0)]]=D0E
set L4V[D0E]=L4V[(0)]
set L4V[(0)]=D0E
set L5V[D0E]=(0)
endfunction
function NSX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function NPX))
endfunction
function NTX takes unit J2E returns nothing
local integer D0E=H5E()
set L2V[D0E]=J2E
set L3V[D0E]=NX+R2I(3./.03125)
call NQX(D0E)
endfunction
function SlowProjectiles___ResetFunc takes nothing returns nothing
local integer p=MA
set G5V[p]=1.
endfunction
function SlowProjectiles___SlowFunc takes nothing returns nothing
local integer p=MA
set HEV[p]=false
set G5V[p]=.1
endfunction
function NUX takes integer D0E returns nothing
call XJX(MNV[D0E],(5))
call NTX(MVV[D0E])
call DestroyEffect(MEV[D0E])
set L9V[D0E]=null
set MVV[D0E]=null
set MEV[D0E]=null
call XDX(MNV[D0E])
call H3E(D0E)
endfunction
function NWX takes integer D0E returns nothing
if MOV[D0E]==NX then
call H1E(D0E)
call NUX(D0E)
else
if MXV[D0E]==.0 then
call SetUnitTimeScale(MVV[D0E],.0)
else
set MXV[D0E]=MXV[D0E]-.03125
endif
set YB=L9V[D0E]
call XPX(MNV[D0E],MRV[D0E],MIV[D0E],MAV[D0E],700.,D0E,(5),(6))
endif
endfunction
function NYX takes nothing returns boolean
local integer D0E=MBV[(0)]
loop
exitwhen D0E==0
call NWX(D0E)
set D0E=MBV[D0E]
endloop
return false
endfunction
function NZX takes integer D0E returns nothing
set MCV[MBV[(0)]]=D0E
set MBV[D0E]=MBV[(0)]
set MBV[(0)]=D0E
set MCV[D0E]=(0)
endfunction
function N_X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function NYX))
endfunction
function N0X takes unit OIX,real x,real y returns integer
local integer D0E=H2E()
call MoveLocation(ZB,x,y)
set L9V[D0E]=OIX
set MVV[D0E]=CreateUnit(GetOwningPlayer(OIX),'u001',x,y,.0)
set MEV[D0E]=AddSpecialEffectTarget("SlowTime.mdl",MVV[D0E],"origin")
set MOV[D0E]=NX+R2I(15./.03125)
set MNV[D0E]=XWX()
set MXV[D0E]=1.
set MRV[D0E]=x
set MIV[D0E]=y
set MAV[D0E]=40.+GetLocationZ(ZB)
call SetUnitX(MVV[D0E],x)
call SetUnitY(MVV[D0E],y)
call UnitAddAbility(MVV[D0E],'Amrf')
call UnitRemoveAbility(MVV[D0E],'Amrf')
call SetUnitScale(MVV[D0E],1.66,.0,.0)
call SetUnitFlyHeight(MVV[D0E],170.,.0)
call NZX(D0E)
return D0E
endfunction
function N1X takes nothing returns nothing
//if GetSpellAbilityId()=='A020' then
call N0X(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY())
//endif
//return false
endfunction
function N2X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function N1X))*/
call RegisterSpellEffectEvent('A020', function N1X)
endfunction
function N3X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
local location IHX
local location IJX
set OJX=GetSpellTargetX()
set OKX=GetSpellTargetY()
set IHX=Location(OJX,OKX)
set IJX=CNE(IHX,GetRandomReal(800.,1000.),GetRandomReal(.0,360.))
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(VC,OJX,OKX)
set OMX=XAX(GetLocationX(IJX),GetLocationY(IJX),900.+GetLocationZ(VC),OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\RollingKegMissle.mdx")
call V8X(OMX,2.5)
set G2V[OMX]=.0
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=false
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HBV[OMX]=(19)
call MoveLocation(VC,OJX,OKX)
call XRX(OMX,OJX,OKX,GetLocationZ(VC),1000.)
call RemoveLocation(IHX)
call RemoveLocation(IJX)
set IHX=null
set IJX=null
set OIX=null
endfunction
/*function N4X takes nothing returns boolean
if GetSpellAbilityId()=='A03J' then
call N3X()
endif
return false
endfunction*/
function N5X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function N4X))
set X_X=null*/
call RegisterSpellEffectEvent('A03J', function N3X)
endfunction
function N6X takes integer RPX,unit J2E returns nothing
local real RQX=GetUnitX(J2E)
local real RSX=GetUnitY(J2E)
local unit IPX
if J2E==(HZV[(RPX)])and UnitAlive(J2E)then
if OEX(HKV[RPX],J2E)then
if GetUnitAbilityLevel(J2E,'BEsh')!=1 then
set IPX=CreateUnit((GetOwningPlayer(GZV[RPX])),'h007',RQX,RSX,.0)
call UnitApplyTimedLife(IPX,'BTLF',21.)
call UnitAddAbility(IPX,'A0FA')
call SetUnitAbilityLevel(IPX,'A0FA',R2I(G3V[RPX]))
call IssueTargetOrderById(IPX,852527,J2E)
endif
call EHX(RPX)
endif
endif
set IPX=null
endfunction
function N7X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
set OLX=Atan2((OKX-ONX),(OJX-OAX))
call MoveLocation(EC,OAX,ONX)
set OMX=XAX(OAX,ONX,65.,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\EvilMissileofShadowyDOOMV3.mdx")
call V8X(OMX,1.)
set G2V[OMX]=60.
set G3V[OMX]=I2R(GetUnitAbilityLevel(OIX,'A088'))
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(18)
set G4V[OMX]=20.
set G9V[OMX]=true
call EMX(OMX,G1V[OMX])
call MoveLocation(EC,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,500.)
set OIX=null
set EXX=null
endfunction
/*function N8X takes nothing returns boolean
if GetSpellAbilityId()=='A088' then
call N7X()
endif
return false
endfunction*/
function N9X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function N8X))
set X_X=null*/
call RegisterSpellEffectEvent('A088', function N7X)
endfunction
function BVX takes integer p,unit u returns nothing
local real x=HHV[p]
local real y=HJV[p]
local unit su
if UnitAlive(u)and u!=GZV[p]and IsUnitEnemy(u,GetOwningPlayer(GZV[p])) and GetUnitAbilityLevel(u,'Bcyc') != 1 then
set su=CreateUnit(GetOwningPlayer(GZV[p]),'h007',x,y,.0)
call UnitApplyTimedLife(su,'BTLF',1.)
call UnitAddAbility(su,'A047')
call SetUnitAbilityLevel(su,'A047',GetUnitAbilityLevel(GZV[p],'A046'))
call IssueTargetOrderById(su,852144,u)
call UnitDamageTargetEx((GZV[p]),(u),(((G3V[p])+(GetHeroInt(GZV[p],true)*7.5*GetUnitAbilityLevel(GZV[p],'A046')))*(1.+(.075 * GetHeroLevel(GZV[p])))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
set su=null
endfunction
function Vertigo__ProjColl takes nothing returns nothing
local integer E3X=MA
local integer TBE=(PA)
//if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
//call ECX(E3X,HHV[E3X]+((700.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((700.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
//endif
endfunction
function BEX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real BXX=(((OAX)*1.)+((500.)*1.)*Cos(((GetUnitFacing(OIX)-180.)*1.)*bj_DEGTORAD))
local real BOX=(((ONX)*1.)+((500.)*1.)*Sin(((GetUnitFacing(OIX)-180.)*1.)*bj_DEGTORAD))
local real BRX
local real BIX
local real OJX=(((BXX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real OKX=(((BOX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
local real OLX=Atan2((OKX-BOX),(OJX-BXX))
local real I6X
local integer OMX=0
call MoveLocation(XC,OAX,ONX)
set I6X=GetLocationZ(XC)
call MoveLocation(XC,BXX,BOX)
set OMX=XAX(BXX,BOX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=600*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((125.)*1.)*Cos(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((125.)*1.)*Sin(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=2*50*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((250.)*1.)*Cos(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((250.)*1.)*Sin(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=2*50*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((375.)*1.)*Cos(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((375.)*1.)*Sin(((GetUnitFacing(OIX)-90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((375.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((375.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=2*50*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((125.)*1.)*Cos(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((125.)*1.)*Sin(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=2*50*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((250.)*1.)*Cos(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((250.)*1.)*Sin(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=2*50*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set BRX=(((BXX)*1.)+((375.)*1.)*Cos(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set BIX=(((BOX)*1.)+((375.)*1.)*Sin(((GetUnitFacing(OIX)+90.)*1.)*bj_DEGTORAD))
set OJX=(((BRX)*1.)+((4500.)*1.)*Cos(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OKX=(((BIX)*1.)+((4500.)*1.)*Sin(((GetUnitFacing(OIX))*1.)*bj_DEGTORAD))
set OLX=Atan2((OKX-BIX),(OJX-BRX))
set OMX=XAX(BRX,BIX,75.+I6X,OLX)
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl")
set G3V[OMX]=400*(I2R(GetUnitAbilityLevel(OIX,'A046')))*(I2R(GetUnitAbilityLevel(OIX,'A046')))
call V8X(OMX,1.)
set G2V[OMX]=50.
set G4V[OMX]=5000./1100.
set G9V[OMX]=true
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set G1V[OMX]=125.
set G0V[OMX]=125.
//set HIV[OMX]=(20)
set HCV[OMX]=(19)
set HBV[OMX]=(21)
call MoveLocation(XC,OJX,OKX)
call XRX(OMX,OJX,OKX,75.+GetLocationZ(XC),1100.)
set OIX=null
endfunction
/*function BAX takes nothing returns boolean
if GetSpellAbilityId()=='A046' then
call BEX()
endif
return false
endfunction*/
function BNX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function BAX))
set X_X=null*/
call RegisterSpellEffectEvent('A046', function BEX)
endfunction
function BBX takes integer D0E,unittype ut returns nothing
set M1V[D0E]=true
set M2V[D0E]=ut
endfunction
function BCX takes integer D0E,string WEE,string TUE returns nothing
set PIV[D0E]=true
set PAV[D0E]=WEE
set PNV[D0E]=TUE
endfunction
function s__xedamage_isInUse takes nothing returns boolean
return(PFV>0)
endfunction
function BDX takes unit u,attacktype a,damagetype d returns real
local real hp=GetWidgetLife(u)
local real BFX=GetUnitState(u,UNIT_STATE_MANA)
local real r
local real fc=.01
call SetUnitX(OC,GetUnitX(u))
call SetUnitY(OC,GetUnitY(u))
call SetUnitOwner(OC,GetOwningPlayer(u),false)
set r=hp
if(hp<.01*3.)then
call SetWidgetLife(u,hp+.01*3.)
set r=hp+.01*3.
set fc=GetWidgetLife(u)-hp+.000000001
endif
set PGV=true
call UnitDamageTarget(OC,u,fc,false,false,a,d,null)
set PGV=false
call SetUnitOwner(OC,Player(PLAYER_NEUTRAL_PASSIVE),false)
if(BFX>GetUnitState(u,UNIT_STATE_MANA))then
call SetUnitState(u,UNIT_STATE_MANA,BFX)
set r=1
else
set r=(r-GetWidgetLife(u))/fc
endif
call SetWidgetLife(u,hp)
return r
endfunction
function BGX takes integer D0E,unit CBE,unit YSE,boolean BHX returns real
local player p=GetOwningPlayer(CBE)
local boolean BJX=IsUnitAlly(YSE,p)
local boolean BKX=IsUnitEnemy(YSE,p)
local boolean BLX=BJX
local real f
local real BMX=1.
local integer i
if(MJV[D0E]!=MLV[D0E])then
set BLX=BJX and not(GetPlayerAlliance(GetOwningPlayer(YSE),p,ALLIANCE_HELP_REQUEST))
set BJX=BJX and not(BLX)
endif
if(not MJV[D0E])and BJX then
return .0
elseif(not MKV[D0E])and BKX then
return .0
elseif((not MHV[D0E])and(CBE==YSE))then
return .0
elseif(not MLV[D0E])and BLX then
return .0
elseif(M1V[D0E]and IsUnitType(YSE,M2V[D0E]))then
return .0
elseif(MPV[D0E]and not IsUnitVisible(YSE,p))then
return .0
elseif(MQV[D0E]and not IsUnitType(YSE,UNIT_TYPE_DEAD))then
return .0
elseif(not(MSV[D0E])and IsUnitType(YSE,UNIT_TYPE_DEAD))then
return .0
endif
set f=1.
if(IsUnitAlly(YSE,p))then
set f=f*M0V[D0E]
if(f<=-.000000001)then
set f=-f
set BMX=-1.
endif
endif
if(M3V[D0E]and not IsUnitType(YSE,M4V[D0E]))then
return .0
endif
set i=M9V[D0E]-1
loop
exitwhen(i<0)
if(IsUnitType(YSE,M5V[M6V[D0E]+i]))then
set f=f*M7V[M8V[D0E]+i]
if(f<=-.000000001)then
set f=-f
set BMX=-1.
endif
endif
set i=i-1
endloop
set i=PRV[D0E]-1
loop
exitwhen(i<0)
if(GetUnitAbilityLevel(YSE,PVV[PEV[D0E]+i])>0)then
set f=f*PXV[POV[D0E]+i]
if(f<=-.000000001)then
set f=-f
set BMX=-1.
endif
endif
set i=i-1
endloop
set f=f*BMX
if(f<.000000001)and(f>-.000000001)then
return .0
endif
if(M_V[D0E]or not BHX)then
return f
endif
set f=f*BDX(YSE,MWV[D0E],MUV[D0E])
if(f<.000000001)and(f>-.000000001)then
return .0
endif
return f
endfunction
function BPX takes integer D0E,unit CBE,unit YSE,real U6E returns boolean
local damagetype dt=PBV
local attacktype at=PCV
local integer tg=PDV
local real f=BGX(D0E,CBE,YSE,false)
local real pl
if(f!=.0)then
set PBV=MUV[D0E]
set PCV=MWV[D0E]
set PDV=MZV[D0E]
set PFV=PFV+1
set pl=GetWidgetLife(YSE)
call UnitDamageTargetEx(CBE,YSE,f*U6E,false,MMV[D0E],MWV[D0E],MUV[D0E],MYV[D0E])
set PFV=PFV-1
set PDV=tg
set PBV=dt
set PCV=at
if(pl!=GetWidgetLife(YSE))then
if(PIV[D0E])then
call DestroyEffect(AddSpecialEffectTarget(PAV[D0E],YSE,PNV[D0E]))
endif
return true
endif
endif
return false
endfunction
function BQX takes nothing returns boolean
local unit YSE=GetFilterUnit()
local integer D0E=PHV
local real f
local real hp
if(not IsUnitInRangeXY(YSE,PLV[D0E],PMV[D0E],PPV[D0E]))then
set YSE=null
return false
endif
set f=BGX(D0E,PKV[D0E],YSE,false)
if(f!=.0)then
set PJV[D0E]=PJV[D0E]+1
if(PIV[D0E])then
set hp=GetWidgetLife(YSE)
endif
call UnitDamageTargetEx(PKV[D0E],YSE,f*PQV[D0E],false,MMV[D0E],MWV[D0E],MUV[D0E],MYV[D0E])
if(PIV[D0E]and(hp>GetWidgetLife(YSE)))then
call DestroyEffect(AddSpecialEffectTarget(PAV[D0E],YSE,PNV[D0E]))
endif
endif
set PHV=D0E
set YSE=null
return false
endfunction
function BSX takes nothing returns boolean
local destructable YSE=GetFilterDestructable()
local integer D0E=PHV
local real dx=PLV[D0E]-GetDestructableX(YSE)
local real dy=PMV[D0E]-GetDestructableY(YSE)
if(dx*dx+dy*dy>=PPV[D0E]+.000000001)then
set YSE=null
return false
endif
set PJV[D0E]=PJV[D0E]+1
if(PIV[D0E])then
call DestroyEffect(AddSpecialEffectTarget(PAV[D0E],YSE,PNV[D0E]))
endif
call UnitDamageTargetEx(PKV[D0E],YSE,PQV[D0E],false,MMV[D0E],MWV[D0E],MUV[D0E],MYV[D0E])
set PHV=D0E
set YSE=null
return false
endfunction
function BWX takes nothing returns nothing
set PWV=Rect(0,0,0,0)
set PSV=Condition(function BQX)
set PTV=Condition(function BSX)
set PUV=CreateGroup()
endfunction
function BYX takes nothing returns nothing
set OC=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'e005',.0,.0,.0)
call UnitAddAbility(OC,'Aloc')
call BWX()
endfunction
function BZX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
local unit SVE=GetTriggerUnit()
if GetUnitAbilityLevel(RGX,'A05P')==1 then
if bj_RADTODEG*Atan2(GetUnitY(SVE)-GetUnitY(RGX),GetUnitX(SVE)-GetUnitX(RGX))<=(GetUnitFacing(SVE)-340.)or bj_RADTODEG*Atan2(GetUnitY(SVE)-GetUnitY(RGX),GetUnitX(SVE)-GetUnitX(RGX))>=(GetUnitFacing(SVE)-20.)then
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN)then
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(RGX,SVE,GetEventDamage(),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",SVE,"chest"))
endif
else
if(CI[NI])then
call DisableTrigger(GetTriggeringTrigger())
call Y0E(RGX,SVE,GetEventDamage(),ATTACK_TYPE_CHAOS,false,false)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",SVE,"chest"))
endif
endif
endif
endif
set RGX=null
set SVE=null
return false
endfunction
function B_X takes nothing returns nothing
local trigger X_X=CreateTrigger()
call MOE(II,(X_X))
call TriggerAddCondition(X_X,Condition(function BZX))
endfunction
function B0X takes integer D0E returns nothing
call ShowUnit(P1V[D0E],false)
call KillUnit(P1V[D0E])
set P1V[D0E]=null
set P0V[D0E]=null
call H_E(D0E)
endfunction
function B1X takes integer D0E returns nothing
if P2V[D0E]==NX then
call HYE(D0E)
call B0X(D0E)
else
call SetUnitX(P1V[D0E],GetUnitX(P0V[D0E]))
call SetUnitY(P1V[D0E],GetUnitY(P0V[D0E]))
endif
endfunction
function B2X takes nothing returns boolean
local integer D0E=P3V[(0)]
loop
exitwhen D0E==0
call B1X(D0E)
set D0E=P3V[D0E]
endloop
return false
endfunction
function B3X takes integer D0E returns nothing
set P4V[P3V[(0)]]=D0E
set P3V[D0E]=P3V[(0)]
set P3V[(0)]=D0E
set P4V[D0E]=(0)
endfunction
function B4X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function B2X))
endfunction
function B5X takes unit J2E,real CDE returns integer
local integer D0E=HZE()
set P0V[D0E]=J2E
set P1V[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),GetUnitTypeId(J2E),GetUnitX(J2E),GetUnitY(J2E),CDE)
call UnitAddAbility(P1V[D0E],'Aloc')
call SetUnitPathing(P1V[D0E],false)
call SetUnitTimeScale(P1V[D0E],3.)
call SetUnitVertexColor(P1V[D0E],255,255,255,80)
call SetUnitScale(P1V[D0E],1.5,.0,.0)
call SetUnitX(P1V[D0E],GetUnitX(J2E))
call SetUnitY(P1V[D0E],GetUnitY(J2E))
call SetUnitAnimation(P1V[D0E],"attack")
call SetUnitOwner(P1V[D0E],GetOwningPlayer(P0V[D0E]),true)
call SetUnitOwner(P1V[D0E],Player(PLAYER_NEUTRAL_PASSIVE),false)
call UnitDamageTargetEx(P1V[D0E],P1V[D0E],.0,false,false,null,null,WEAPON_TYPE_METAL_LIGHT_SLICE)
set P2V[D0E]=NX+R2I(.2/.03125)
call B3X(D0E)
return D0E
endfunction
function Defend___OnImpact takes nothing returns nothing
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(P8V[d])
local real y=GetUnitY(P8V[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((P8V[d])))
if GetRandomReal(.0,1.)<=.5 and not IsUnitAlly(GZV[p],GetOwningPlayer(P8V[d]))and UnitAlive(P8V[d])then
if not XMX(AC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",P8V[d],"origin"))
call B5X(P8V[d],a*bj_RADTODEG)
endif
endif
call XLX(AC[j],p)
endfunction
function B6X takes integer D0E returns nothing
call XUX(AC[(GetUnitUserData((P8V[D0E])))])
call XDX(QVV[D0E])
set RC[(GetUnitUserData((P8V[D0E])))]=false
set IC[(GetUnitUserData((P8V[D0E])))]=0
set P8V[D0E]=null
call HWE(D0E)
endfunction
function B7X takes integer D0E returns nothing
if P9V[D0E]==NX then
call HTE(D0E)
call B6X(D0E)
else
call XQX(QVV[D0E],GetUnitX(P8V[D0E]),GetUnitY(P8V[D0E]),.0,200.,D0E,(8))
endif
endfunction
function B8X takes nothing returns boolean
local integer D0E=QEV[(0)]
loop
exitwhen D0E==0
call B7X(D0E)
set D0E=QEV[D0E]
endloop
return false
endfunction
function B9X takes integer D0E returns nothing
set QXV[QEV[(0)]]=D0E
set QEV[D0E]=QEV[(0)]
set QEV[(0)]=D0E
set QXV[D0E]=(0)
endfunction
function CVX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function B8X))
endfunction
function CEX takes unit J2E,integer id returns integer
local integer D0E=HUE()
set P8V[D0E]=J2E
set P9V[D0E]=NX+R2I(15./.03125)
set QVV[D0E]=XWX()
set RC[id]=true
set IC[id]=D0E
if AC[id]==0 then
set AC[id]=XWX()
endif
call B9X(D0E)
return D0E
endfunction
function CXX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local integer id=(GetUnitUserData((OIX)))
//if GetSpellAbilityId()=='A01Z' then
if not RC[id]then
call CEX(OIX,id)
else
call XUX(AC[id])
set P9V[IC[id]]=NX+R2I(15./.03125)
endif
//endif
set OIX=null
//return false
endfunction
function COX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function CXX))*/
call RegisterSpellEffectEvent('A01Z', function CXX)
endfunction
function CRX takes integer D0E returns nothing
call ShowUnit(QNV[D0E],false)
call KillUnit(QNV[D0E])
set QNV[D0E]=null
set QAV[D0E]=null
call HSE(D0E)
endfunction
function CIX takes integer D0E returns nothing
if QBV[D0E]==NX then
call HPE(D0E)
call CRX(D0E)
else
call SetUnitX(QNV[D0E],GetUnitX(QAV[D0E]))
call SetUnitY(QNV[D0E],GetUnitY(QAV[D0E]))
endif
endfunction
function CAX takes nothing returns boolean
local integer D0E=QCV[(0)]
loop
exitwhen D0E==0
call CIX(D0E)
set D0E=QCV[D0E]
endloop
return false
endfunction
function CNX takes integer D0E returns nothing
set QDV[QCV[(0)]]=D0E
set QCV[D0E]=QCV[(0)]
set QCV[(0)]=D0E
set QDV[D0E]=(0)
endfunction
function CBX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function CAX))
endfunction
function CCX takes unit J2E,real CDE returns integer
local integer D0E=HQE()
set QAV[D0E]=J2E
set QNV[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),GetUnitTypeId(J2E),GetUnitX(J2E),GetUnitY(J2E),CDE)
call UnitAddAbility(QNV[D0E],'Aloc')
call SetUnitPathing(QNV[D0E],false)
call SetUnitTimeScale(QNV[D0E],3.)
call SetUnitVertexColor(QNV[D0E],255,255,255,80)
call SetUnitScale(QNV[D0E],1.5,.0,.0)
call SetUnitX(QNV[D0E],GetUnitX(J2E))
call SetUnitY(QNV[D0E],GetUnitY(J2E))
call SetUnitAnimation(QNV[D0E],"attack")
call SetUnitOwner(QNV[D0E],GetOwningPlayer(QAV[D0E]),true)
call SetUnitOwner(QNV[D0E],Player(PLAYER_NEUTRAL_PASSIVE),false)
call UnitDamageTargetEx(QNV[D0E],QNV[D0E],.0,false,false,null,null,WEAPON_TYPE_METAL_LIGHT_SLICE)
set QBV[D0E]=NX+R2I(.2/.03125)
call CNX(D0E)
return D0E
endfunction
function DefendItem___OnImpact takes nothing returns nothing
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(QJV[d])
local real y=GetUnitY(QJV[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((QJV[d])))
if GetRandomReal(.0,1.)<=.5 and not IsUnitAlly(GZV[p],GetOwningPlayer(QJV[d]))and UnitAlive(QJV[d])then
if not XMX(CC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",QJV[d],"origin"))
call CCX(QJV[d],a*bj_RADTODEG)
endif
endif
call XLX(CC[j],p)
endfunction
function CDX takes integer D0E returns nothing
call XUX(CC[(GetUnitUserData((QJV[D0E])))])
call XDX(QLV[D0E])
set NC[(GetUnitUserData((QJV[D0E])))]=false
set BC[(GetUnitUserData((QJV[D0E])))]=0
set QJV[D0E]=null
call HME(D0E)
endfunction
function CFX takes integer D0E returns nothing
if QKV[D0E]==NX then
call HKE(D0E)
call CDX(D0E)
else
call XQX(QLV[D0E],GetUnitX(QJV[D0E]),GetUnitY(QJV[D0E]),.0,200.,D0E,(9))
endif
endfunction
function CGX takes nothing returns boolean
local integer D0E=QMV[(0)]
loop
exitwhen D0E==0
call CFX(D0E)
set D0E=QMV[D0E]
endloop
return false
endfunction
function CHX takes integer D0E returns nothing
set QPV[QMV[(0)]]=D0E
set QMV[D0E]=QMV[(0)]
set QMV[(0)]=D0E
set QPV[D0E]=(0)
endfunction
function CJX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function CGX))
endfunction
function CKX takes unit J2E,integer id returns integer
local integer D0E=HLE()
set QJV[D0E]=J2E
set QKV[D0E]=NX+R2I(20./.03125)
set QLV[D0E]=XWX()
set NC[id]=true
set BC[id]=D0E
if CC[id]==0 then
set CC[id]=XWX()
endif
call CHX(D0E)
return D0E
endfunction
function CLX takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local integer id=(GetUnitUserData((OIX)))
//if GetSpellAbilityId()=='A04E' then
if not NC[id]then
call CKX(OIX,id)
else
call XUX(CC[id])
set QKV[BC[id]]=NX+R2I(20./.03125)
endif
//endif
set OIX=null
//return false
endfunction
function CMX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function CLX))*/
call RegisterSpellEffectEvent('A04E', function CLX)
endfunction
function CPX takes integer D0E returns nothing
call ShowUnit(QWV[D0E],false)
call KillUnit(QWV[D0E])
set QWV[D0E]=null
set QUV[D0E]=null
call HJE(D0E)
endfunction
function CQX takes integer D0E returns nothing
if QYV[D0E]==NX then
call HGE(D0E)
call CPX(D0E)
else
call SetUnitX(QWV[D0E],GetUnitX(QUV[D0E]))
call SetUnitY(QWV[D0E],GetUnitY(QUV[D0E]))
endif
endfunction
function CSX takes nothing returns boolean
local integer D0E=QZV[(0)]
loop
exitwhen D0E==0
call CQX(D0E)
set D0E=QZV[D0E]
endloop
return false
endfunction
function CTX takes integer D0E returns nothing
set Q_V[QZV[(0)]]=D0E
set QZV[D0E]=QZV[(0)]
set QZV[(0)]=D0E
set Q_V[D0E]=(0)
endfunction
function CUX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function CSX))
endfunction
function CWX takes unit J2E,real CDE returns integer
local integer D0E=HHE()
set QUV[D0E]=J2E
set QWV[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),GetUnitTypeId(J2E),GetUnitX(J2E),GetUnitY(J2E),CDE)
call UnitAddAbility(QWV[D0E],'Aloc')
call SetUnitPathing(QWV[D0E],false)
call SetUnitTimeScale(QWV[D0E],3.)
call SetUnitVertexColor(QWV[D0E],255,255,255,80)
call SetUnitScale(QWV[D0E],1.5,.0,.0)
call SetUnitX(QWV[D0E],GetUnitX(J2E))
call SetUnitY(QWV[D0E],GetUnitY(J2E))
call SetUnitAnimation(QWV[D0E],"attack")
call SetUnitOwner(QWV[D0E],GetOwningPlayer(QUV[D0E]),true)
call SetUnitOwner(QWV[D0E],Player(PLAYER_NEUTRAL_PASSIVE),false)
call UnitDamageTargetEx(QWV[D0E],QWV[D0E],.0,false,false,null,null,WEAPON_TYPE_METAL_LIGHT_SLICE)
set QYV[D0E]=NX+R2I(.2/.03125)
call CTX(D0E)
return D0E
endfunction
function DefendRockTrolls___OnImpact takes nothing returns nothing
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(Q3V[d])
local real y=GetUnitY(Q3V[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((Q3V[d])))
if GetRandomReal(.0,1.)<=.25+(I2R(XT)/10.)and not IsUnitAlly(GZV[p],GetOwningPlayer(Q3V[d]))and UnitAlive(Q3V[d])then
if not XMX(GC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",Q3V[d],"origin"))
call CWX(Q3V[d],a*bj_RADTODEG)
endif
endif
call XLX(GC[j],p)
endfunction
function CYX takes integer D0E returns nothing
call XUX(GC[(GetUnitUserData((Q3V[D0E])))])
call XDX(Q5V[D0E])
set DC[(GetUnitUserData((Q3V[D0E])))]=false
set FC[(GetUnitUserData((Q3V[D0E])))]=0
set Q3V[D0E]=null
call HFE(D0E)
endfunction
function CZX takes integer D0E returns nothing
if Q4V[D0E]==NX then
call HCE(D0E)
call CYX(D0E)
else
call XQX(Q5V[D0E],GetUnitX(Q3V[D0E]),GetUnitY(Q3V[D0E]),.0,200.,D0E,(10))
endif
endfunction
function C_X takes nothing returns boolean
local integer D0E=Q6V[(0)]
loop
exitwhen D0E==0
call CZX(D0E)
set D0E=Q6V[D0E]
endloop
return false
endfunction
function C0X takes integer D0E returns nothing
set Q7V[Q6V[(0)]]=D0E
set Q6V[D0E]=Q6V[(0)]
set Q6V[(0)]=D0E
set Q7V[D0E]=(0)
endfunction
function C1X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function C_X))
endfunction
function C2X takes unit J2E,integer id returns integer
local integer D0E=HDE()
set Q3V[D0E]=J2E
set Q4V[D0E]=NX+R2I(30./.03125)
set Q5V[D0E]=XWX()
set DC[id]=true
set FC[id]=D0E
if GC[id]==0 then
set GC[id]=XWX()
endif
call C0X(D0E)
return D0E
endfunction
function C3X takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local integer id=(GetUnitUserData((OIX)))
//if GetSpellAbilityId()=='A08C' then
if not DC[id]then
call C2X(OIX,id)
else
call XUX(GC[id])
set Q4V[FC[id]]=NX+R2I(30./.03125)
endif
//endif
set OIX=null
//return false
endfunction
function C4X takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function C3X))*/
call RegisterSpellEffectEvent('A08C', function C3X)
endfunction
function C5X takes integer D0E returns nothing
local real sx=GetUnitX(SEV[D0E])
local real sy=GetUnitY(SEV[D0E])
local real tx=GetUnitX(SXV[D0E])
local real ty=GetUnitY(SXV[D0E])
local real OLX=Atan2((ty-sy),(tx-sx))
local integer OMX=0
if IsRangerUseless[GetUnitUserData(SEV[D0E])] then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl",SEV[D0E],"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",SEV[D0E],"origin"))
endif
set OMX=XAX(sx,sy,J0V[SIV[D0E]],OLX)
set GZV[OMX]=SEV[D0E]
call EEX(OMX,SXV[D0E])
set G_V[OMX]=GetOwningPlayer(SEV[D0E])
call V8X(OMX,J1V[SIV[D0E]])
set G1V[OMX]=J2V[SIV[D0E]]
set G2V[OMX]=J3V[SIV[D0E]]
set HEV[OMX]=true
set G8V[OMX]=true
set HOV[OMX]=true
set G4V[OMX]=20.
set G9V[OMX]=true
if GetRandomReal(.0,1.)<=I2R(GetUnitAbilityLevel(GZV[OMX],'A026'))*.05 then
if IsRangerUseless[GetUnitUserData(SEV[D0E])] or IsRangerRat[GetUnitUserData(SEV[D0E])]or IsRangerGreen[GetUnitUserData(SEV[D0E])] then
if IsRangerUseless[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"war3mapImported\\MoutonCape.mdx")
endif
if IsRangerRat[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"war3mapImported\\Shot Green Double.mdx")
endif
if IsRangerGreen[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"war3mapImported\\Shot Yellow Double.mdx")
endif
else
call V9X(OMX,"war3mapImported\\s_Enchanted Arrow.mdl")
endif
set G3V[OMX]=SOV[D0E]*((GetUnitAbilityLevel(SEV[D0E],'A026'))*2)
set HCV[OMX]=(20)
else
if IsRangerUseless[GetUnitUserData(SEV[D0E])] or IsRangerRat[GetUnitUserData(SEV[D0E])] or IsRangerGreen[GetUnitUserData(SEV[D0E])] then
if IsRangerUseless[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"units\\critters\\Sheep\\Sheep.mdl")
endif
if IsRangerRat[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"war3mapImported\\Shot Green.mdx")
endif
if IsRangerGreen[GetUnitUserData(SEV[D0E])] then
call V9X(OMX,"war3mapImported\\Shot Yellow.mdx")
endif
else
call V9X(OMX,JYV[SIV[D0E]])
endif
set G3V[OMX]=SOV[D0E]
set HCV[OMX]=(2)
endif
set HBV[OMX]=(2)
set HAV[OMX]=(3)
set HNV[OMX]=(4)
if J4V[SIV[D0E]]then
call XRX(OMX,tx,ty,GetUnitFlyHeight(SXV[D0E])+J0V[SIV[D0E]],JZV[SIV[D0E]])
else
call XIX(OMX,tx,ty,GetUnitFlyHeight(SXV[D0E])+J0V[SIV[D0E]],JZV[SIV[D0E]],J_V[SIV[D0E]])
endif
set SEV[D0E]=null
set SXV[D0E]=null
call HBE(D0E)
endfunction
function C6X takes integer D0E returns nothing
if SRV[D0E]==NX then
call HAE(D0E)
call C5X(D0E)
endif
endfunction
function C7X takes nothing returns boolean
local integer D0E=SAV[(0)]
loop
exitwhen D0E==0
call C6X(D0E)
set D0E=SAV[D0E]
endloop
return false
endfunction
function C8X takes integer D0E returns nothing
set SNV[SAV[(0)]]=D0E
set SAV[D0E]=SAV[(0)]
set SAV[(0)]=D0E
set SNV[D0E]=(0)
endfunction
function C9X takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function C7X))
endfunction
function DVX takes unit DEX,unit DXX,real DOX,integer XHX returns integer
local integer D0E=HNE()
set SEV[D0E]=DEX
set SXV[D0E]=DXX
set SOV[D0E]=DOX
set SIV[D0E]=XHX
set SRV[D0E]=NX+R2I(.15/.03125)
call C8X(D0E)
return D0E
endfunction
function DRX takes nothing returns boolean
local unit CBE=(QN)
local unit YSE=(SN)
local real U6E=(TN)
local integer ad=(PN)
if GetUnitAbilityLevel(CBE,'A026')>=1 and IsUnitEnemy(CBE,GetOwningPlayer(YSE)) then
if GetRandomReal(.0,1.)<=(.1+(I2R(GetUnitAbilityLevel(CBE,'A026'))*.08))then
call DVX(CBE,YSE,U6E,ad)
endif
endif
set CBE=null
set YSE=null
return false
endfunction
function DIX takes nothing returns nothing
local trigger X_X=CreateTrigger()
call MOE(MN,(X_X))
call TriggerAddCondition(X_X,Condition(function DRX))
endfunction
function DAX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
if GetUnitAbilityLevel(RGX,'B049')==1 and GetUnitTypeId(RGX) != 'U00Z' and IsUnitEnemy(RGX,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() >0 then
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN)then
call SetUnitState(RGX,UNIT_STATE_MANA,GetUnitState(RGX,UNIT_STATE_MANA)+(GetUnitState(RGX,UNIT_STATE_MAX_MANA)*.005))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",RGX,"origin"))
call BJDebugMsg("Damage:" + R2S(GetEventDamage()))
endif
else
if(CI[NI]) and BlzGetEventIsAttack() then
call SetUnitState(RGX,UNIT_STATE_MANA,GetUnitState(RGX,UNIT_STATE_MANA)+(GetUnitState(RGX,UNIT_STATE_MAX_MANA)*.005))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",RGX,"origin"))
call BJDebugMsg("Damage:" + R2S(GetEventDamage()))
endif
endif
endif
set RGX=null
return false
endfunction
//function DNX takes nothing returns nothing
//local trigger X_X=CreateTrigger()
//call MOE(II,(X_X))
//call TriggerAddCondition(X_X,Condition(function DAX))
//endfunction
function DBX takes nothing returns nothing
call RRX('n03A',"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl",1200.,0.,65.,1.,64.,60.)
call RRX('n03N',"Abilities\\Weapons\\BristleBackMissile\\BristleBackMissile.mdl",1500.,.15,65.,1.,64.,60.)
call RRX('n039',"abilities\\weapons\\TuskarSpear\\TuskarSpear.mdl",1200.,.15,65.,1.,64.,60.)
call RRX('n03S',"war3mapImported\\Firebrand Shot Green.mdx",1750.,.0,65.,1.,64.,60.)
call RRX('n03Q',"war3mapImported\\Firebrand Shot Red.mdx",1750.,.0,65.,1.,64.,60.)
call RRX('E01R',"Abilities\\Weapons\\KeeperGroveMissile\\KeeperGroveMissile.mdl",1200.,.1,65.,1.,64.,60.)
call RRX('E011',"Abilities\\Weapons\\ZigguratFrostMissile\\ZigguratFrostMissile.mdl",900.,.15,65.,1.,64.,60.)
call RRX('E013',"Abilities\\Spells\\Other\\FrostArrows\\NagaColdArrowMissile.mdl",1500.,.15,65.,1.,64.,60.)
call RRX('n02Z',"war3mapImported\\Bloodstone Arrow.mdx",1500.,.15,45.,1.,64.,60.)
call RRX('E00R',"war3mapImported\\Bloodstone Arrow LSD 2.mdx",1500.,.15,65.,1.,64.,60.)
call RRX('N01O',"war3mapImported\\Rain of Fire Vol. II Missile.mdx",900.,.25,75.,1.,64.,90.)
//call RRX('E01B',"war3mapImported\\OrbOfLightning.mdx",1200.,.15,65.,1.,64.,60.)
//call RRX('E01D',"Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl",900.,.15,65.,1.,64.,60.)
call RRX('E01F',"Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl",900.,.15,65.,1.,64.,60.)
call RRX('E01K',"Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",900.,.15,65.,1.,64.,60.)
call RRX('E01Q',"Abilities\\Weapons\\GyroCopter\\GyroCopterMissile.mdl",1500.,.1,65.,1.,64.,60.)
call RRX('U00O',"darkmissile.mdx",900.,.0,65.,1.,64.,60.)
call RRX('N01T',"Abilities\\Weapons\\MoonPriestessMissile\\MoonPriestessMissile.mdl",1600.,.15,65.,1.,64.,60.)
call RRX('N01S',"Abilities\\Weapons\\MoonPriestessMissile\\MoonPriestessMissile.mdl",1600.,.15,65.,1.,64.,60.)
call RRX('N032',"war3mapImported\\Shot Green.mdx",1600.,.15,65.,1.,64.,60.)
call RRX('N01Q',"war3mapImported\\Shot Green.mdx",1600.,.15,65.,1.,64.,60.)
call RRX('N01M',"units\\critters\\Sheep\\Sheep.mdl",1600.,.15,65.,1.,64.,60.)
call RRX('N01L',"units\\critters\\Sheep\\Sheep.mdl",1600.,.15,65.,1.,64.,60.)
call RRX('n02H',"Abilities\\Weapons\\PoisonArrow\\PoisonArrowMissile.mdl",900.,.15,65.,1.,64.,60.)
call RRX('n03I',"war3mapImported\\Carrion Bat Blood HD.mdx",1200.,.15,65.,.8,64.,60.)
call RRX('n01Z',"war3mapImported\\RuneSpear.mdx",1250.,.2,90.,1.,64.,60.)
call RRX('E01Z',"war3mapImported\\SpearOfMars.mdx",1000.,.15,90.,.8,64.,60.)
call RRX('n03Y',"war3mapImported\\SpearOfMars.mdx",1000.,.15,90.,.8,64.,60.)
call RRX('e00X',"Abilities\\Weapons\\Dryadmissile\\Dryadmissile.mdl",1000.,.15,65.,1.3,64.,60.)
call RRX('e00G',"Abilities\\Weapons\\Dryadmissile\\Dryadmissile.mdl",1000.,.15,65.,1.1,64.,60.)
call RRX('n03B',"war3mapImported\\Carrion Bat Blood HD.mdx",1200.,.15,65.,1.4,64.,60.)
call RRX('n03C',"war3mapImported\\Carrion Bat Jade HD.mdx",1200.,.15,65.,1.4,64.,60.)
call RRX('n031',"war3mapImported\\Enchanted Knife.mdl",900.,.0,65.,1.,64.,60.)
//call RRX('nwgs',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('E01G',"Abilities\\Weapons\\SentinelMissile\\SentinelMissile.mdl",900.,.1,65.,1.,64.,60.)
//call RRX('n02L',"Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl",800.,.1,385.,.8,64.,115.)
call RRX('n02K',"Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl",800.,.1,385.,.8,64.,115.)
call RRX('H009',"Abilities\\Spells\\NightElf\\SpiritOfVengeance\\SpiritOfVengeanceBirthMissile.mdl",900.,.15,65.,1.,64.,60.)
call RRX('nhrq',"Abilities\\Weapons\\GargoyleMissile\\GargoyleMissile.mdl",1000.,.0,240.,1.,64.,50.)
call RRX('nhar',"Abilities\\Weapons\\HarpyMissile\\HarpyMissile.mdl",1500.,.15,240.,1.,64.,50.)
call RRX('nhrh',"Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",1200.,.15,240.,1.,64.,50.)
call RRX('nfre',"Abilities\\Weapons\\LichMissile\\LichMissile.mdl",1200.,.15,65.,1.,64.,60.)
call RRX('nlds',"Abilities\\Weapons\\MakuraMissile\\MakuraMissile.mdl",900.,.0,65.,1.,64.,60.)
call RRX('nsll',"Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl",900.,.15,65.,1.,64.,128.)
call RRX('nssp',"Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl",1200.,.15,65.,1.,64.,60.)
call RRX('h01D',"war3mapImported\\Prismatic Missile Fixed.mdx",1100.,.15,65.,1.,64.,60.)
call RRX('E003',"Abilities\\Weapons\\DemonHunterMissile\\DemonHunterMissile.mdl",900.,.0,65.,1.,64.,60.)
//call RRX('n00G',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00R',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00H',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00I',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00J',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00K',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00N',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00O',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00P',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
//call RRX('n00Q',"Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",1400.,.0,270.,1.,64.,50.)
call RRX('u00U',"Abilities\\Weapons\\ColdArrow\\ColdArrowMissile.mdl",1500.,.15,65.,1.,64.,60.)
call RRX('u00T',"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl",1050.,.0,65.,1.,64.,60.)
call RRX('U003',"war3mapImported\\BlueBasiliskMissile.mdx",700.,.15,65.,1.,64.,60.)
call RRX('U000',"Abilities\\Spells\\NightElf\\SpiritOfVengeance\\SpiritOfVengeanceBirthMissile.mdl",1000.,.05,110.,1.2,64.,80.)
//call RRX('nskf',"Abilities\\Weapons\\FlamingArrow\\FlamingArrowMissile.mdl",900.,.15,65.,1.,64.,60.)
//call RRX('nskm',"Abilities\\Weapons\\Arrow\\ArrowMissile.mdl",900.,.15,65.,1.,64.,60.)
//call RRX('uskm',"Abilities\\Weapons\\SkeletalMageMissile\\SkeletalMageMissile.mdl",900.,.1,65.,1.,64.,60.)
call RRX('E00E',"war3mapImported\\Firebolt Rough Major.mdx",1200.,.45,65.,1.,64.,60.)
call RRX('n03E',"war3mapImported\\Voidbolt Rough Medium.mdx",1000.,.2,65.,1.,64.,60.)
endfunction
function DCX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL) then
if GetUnitAbilityLevel(GetTriggerUnit(),'A0LA')> 0 and (BI[NI]) != DAMAGE_TYPE_UNIVERSAL then
//set DI[NI]=DI[NI]+(GetEventDamage()*.8)
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*.8))
endif
if (GetUnitAbilityLevel(GetTriggerUnit(),'A09D')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'A0N9')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'B04X')>0) then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
endif
endif
else
if GetUnitAbilityLevel(GetTriggerUnit(),'A0LA')> 0 and (BI[NI]) != DAMAGE_TYPE_UNIVERSAL then
//set DI[NI]=DI[NI]+(GetEventDamage()*.8)
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*.8))
endif
if (GetUnitAbilityLevel(GetTriggerUnit(),'A09D')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'A0N9')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'B04X')>0) then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
endif
endif
set RGX=null
return false
endfunction
function DDX takes nothing returns boolean
if (GetUnitAbilityLevel(GetTriggerUnit(),'A09D')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'A0LA')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'A0N9')>0 or GetUnitAbilityLevel(GetTriggerUnit(),'B04X')>0) and GetTriggerUnit() != GetEventDamageSource() then
call DCX()
endif
return false
endfunction
function DFX takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerAddCondition(t,Condition(function DDX))
call MOE(II,(t))
set t=null
endfunction
function DGX takes integer D0E returns nothing
if SGV[D0E]!=null then
call DestroyEffect(SGV[D0E])
endif
call NTX(SFV[D0E])
set SFV[D0E]=null
set SGV[D0E]=null
call HIE(D0E)
endfunction
function DHX takes integer D0E returns nothing
if SHV[D0E]==NX then
call HOE(D0E)
call DGX(D0E)
endif
endfunction
function DJX takes nothing returns boolean
local integer D0E=SJV[(0)]
loop
exitwhen D0E==0
call DHX(D0E)
set D0E=SJV[D0E]
endloop
return false
endfunction
function DKX takes integer D0E returns nothing
set SKV[SJV[(0)]]=D0E
set SJV[D0E]=SJV[(0)]
set SJV[(0)]=D0E
set SKV[D0E]=(0)
endfunction
function DLX takes nothing returns nothing
call TriggerAddCondition(BX,Condition(function DJX))
endfunction
function DMX takes real x,real y returns integer
local integer D0E=HRE()
set SFV[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'e001',x,y,.0)
set SGV[D0E]=AddSpecialEffectTarget("Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl",SFV[D0E],"origin")
set SHV[D0E]=NX+R2I(.1/.03125)
call SetUnitScale(SFV[D0E],1.5,.0,.0)
call UnitAddAbility(SFV[D0E],'Amrf')
call UnitRemoveAbility(SFV[D0E],'Amrf')
call SetUnitFlyHeight(SFV[D0E],100.,.0)
call SetUnitPathing(SFV[D0E],false)
call PauseUnit(SFV[D0E],true)
call SetUnitX(SFV[D0E],x)
call SetUnitY(SFV[D0E],y)
call DKX(D0E)
return D0E
endfunction
function TimeWarp___WarpProjectiles takes nothing returns nothing
local integer p=(MA)
local real x=.0
local real y=.0
set HEV[p]=true
call DestroyEffect(L8E("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",HHV[p],HJV[p],HKV[p]-30.))
set x=HHV[p]+500.*Cos(EOX(p))
set y=HJV[p]+500.*Sin(EOX(p))
call ECX(p,x,y,HKV[p],false)
set x=HQV[p]+500.*Cos(EOX(p))
set y=HSV[p]+500.*Sin(EOX(p))
call ERX(p,x,y,HTV[p],false)
call DestroyEffect(L8E("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",HHV[p],HJV[p],HKV[p]-30.))
endfunction
function DPX takes nothing returns nothing
//if GetSpellAbilityId()=='A025' then
call DMX(GetSpellTargetX(),GetSpellTargetY())
call XQX(KA,GetSpellTargetX(),GetSpellTargetY(),.0,400.,0,(11))
//endif
//return false
endfunction
function DQX takes nothing returns nothing
/*local trigger X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function DPX))*/
call RegisterSpellEffectEvent('A025', function DPX)
endfunction
function DSX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
if GetUnitAbilityLevel(RGX,'A094')!=0 and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(RGX)) then
if(CI[NI])then
call UnitRemoveAbility(RGX,'A096')
call UnitRemoveAbility(RGX,'B02N')
call UnitRemoveAbility(RGX,'A094')
call BlzSetUnitAttackCooldown(RGX,1.4,0)
endif
endif
set RGX=null
return false
endfunction
function DTX takes nothing returns nothing
local trigger X_X=CreateTrigger()
call MOE(II,(X_X))
call TriggerAddCondition(X_X,Condition(function DSX))
endfunction
function DUX takes nothing returns boolean
local unit RGX=GetEventDamageSource()
local unit SVE=GetTriggerUnit()
local real r
if GetUnitAbilityLevel(RGX,'A093')!=0 and IsUnitEnemy(SVE,GetOwningPlayer(RGX)) and SVE != RGX and (BI[NI]) != DAMAGE_TYPE_UNIVERSAL then
if GetRandomInt(0,100)<=8+2*GetUnitAbilityLevel(RGX,'A093') then
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN)then
set r=GetUnitAbilityLevel(RGX,'A093')*.001*GetEventDamage()
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(RGX,RGX,r,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\BrewmasterMissile\\BrewmasterMissile.mdl",RGX,"chest"))
call UnitAddAbility(RGX,'A094')
call UnitAddAbility(RGX,'A096')
call BlzSetUnitAttackCooldown(RGX,.15,0)
endif
else
if(CI[NI])then
set r=GetUnitAbilityLevel(RGX,'A093')*.001*GetEventDamage()
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(RGX,RGX,r,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\BrewmasterMissile\\BrewmasterMissile.mdl",RGX,"chest"))
call UnitAddAbility(RGX,'A094')
call UnitAddAbility(RGX,'A096')
call BlzSetUnitAttackCooldown(RGX,.15,0)
endif
endif
endif
else
if GetUnitAbilityLevel(SVE,'A093')!=0 and (BI[NI]) != DAMAGE_TYPE_UNIVERSAL and (BI[NI]) != DAMAGE_TYPE_PLANT and BI[NI] != DAMAGE_TYPE_UNIVERSAL and RGX!= FLAMEDISCCASTER and SVE != RGX then
if GetRandomInt(0,100)<=8+2*GetUnitAbilityLevel(SVE,'A093') then
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN)then
set r=GetUnitAbilityLevel(SVE,'A093')*10
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(SVE,SVE,r,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\BrewmasterMissile\\BrewmasterMissile.mdl",SVE,"chest"))
call UnitAddAbility(SVE,'A094')
call UnitAddAbility(SVE,'A096')
call BlzSetUnitAttackCooldown(SVE,.15,0)
endif
else
if(CI[NI])then
set r=GetUnitAbilityLevel(SVE,'A093')*10
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(SVE,SVE,r,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\BrewmasterMissile\\BrewmasterMissile.mdl",SVE,"chest"))
call UnitAddAbility(SVE,'A094')
call UnitAddAbility(SVE,'A096')
call BlzSetUnitAttackCooldown(SVE,.15,0)
endif
endif
endif
endif
endif
set RGX=null
set SVE=null
return false
endfunction
function DWX takes nothing returns nothing
local trigger X_X=CreateTrigger()
call MOE(II,(X_X))
call TriggerAddCondition(X_X,Condition(function DUX))
endfunction
constant function DYX takes integer DZX,integer D_X returns real
return(D_X*DZX*.5)
endfunction
function D0X takes integer D1X returns nothing
set MUV[D1X]=DAMAGE_TYPE_MAGIC
set MWV[D1X]=ATTACK_TYPE_NORMAL
call BBX(D1X,UNIT_TYPE_STRUCTURE)
set MPV[D1X]=true
set MHV[D1X]=true
set MJV[D1X]=true
set M0V[D1X]=-1.
endfunction
function D2X takes unit u,integer s returns boolean
return not IsUnitType(u,UNIT_TYPE_DEAD)and GetUnitTypeId(u)!=0 and IsUnitType(u,UNIT_TYPE_STRUCTURE)==false and IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitEnemy(u,GetOwningPlayer(SQV[s]))and IsUnitVisible(u,GetOwningPlayer(SQV[s]))
endfunction
function D3X takes unit c,unit o returns integer
local integer D0E=HEE()
local integer i=0
local real x=GetUnitX(c)
local real y=GetUnitY(c)
local real a
set TIV[D0E]=GetUnitAbilityLevel(o,'A08L')
set TRV[D0E]=12
set TVV[D0E]=(25.+(2.*TIV[D0E]))
set SQV[D0E]=c
set SSV[D0E]=o
set TOV[D0E]=NewTimer()
loop
exitwhen i==TRV[D0E]
set a=i*HC/TRV[D0E]
set SWV[SYV[D0E]+i]=YBE(x,y,a)
call YHE(SWV[SYV[D0E]+i],"Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl")
call YCE(SWV[SYV[D0E]+i],1.4)
call SetUnitFlyHeight(DPV[(SWV[SYV[D0E]+i])],((100.)*1.),0)
set S4V[S5V[D0E]+i]=a
set i=i+1
endloop
call GroupAddUnit(KC,c)
return D0E
endfunction
function D4X takes nothing returns boolean
return D2X(GetFilterUnit(),TAV)
endfunction
function D5X takes nothing returns nothing
local integer D0E=GetTimerData(GetExpiredTimer())
local real x=GetUnitX(SQV[D0E])
local real y=GetUnitY(SQV[D0E])
local integer i=0
local real x1
local real y1
local real x2
local real y2
local real OLX
local real M3E
local real M4E
local real dx
local real dy
local real CCE
if TVV[D0E]>.0 and not IsUnitType(SQV[D0E],UNIT_TYPE_DEAD)then
set TVV[D0E]=TVV[D0E]-.025
loop
exitwhen i==TRV[D0E]
set S4V[S5V[D0E]+i]=S4V[S5V[D0E]+i]+.15
set S6V[S7V[D0E]+i]=x+(150.+(TIV[D0E])*0)*Cos(S4V[S5V[D0E]+i])
set S8V[S9V[D0E]+i]=y+(150.+(TIV[D0E])*0)*Sin(S4V[S5V[D0E]+i])
if not SZV[S_V[D0E]+i]then
call SetUnitX(DPV[(SWV[SYV[D0E]+i])],((S6V[S7V[D0E]+i])*1.))
call SetUnitY(DPV[(SWV[SYV[D0E]+i])],((S8V[S9V[D0E]+i])*1.))
set TAV=D0E
set STV[SUV[D0E]+i]=(ZEE(null,(((GetUnitX(DPV[(SWV[SYV[D0E]+i])])))*1.),(((GetUnitY(DPV[(SWV[SYV[D0E]+i])])))*1.),(((500.+(TIV[D0E])*0))*1.),(Condition(function D4X))))
if STV[SUV[D0E]+i]!=null then
set SZV[S_V[D0E]+i]=true
endif
else
if not S0V[S1V[D0E]+i]then
set x1=(GetUnitX(DPV[(SWV[SYV[D0E]+i])]))
set y1=(GetUnitY(DPV[(SWV[SYV[D0E]+i])]))
set x2=GetUnitX(STV[SUV[D0E]+i])
set y2=GetUnitY(STV[SUV[D0E]+i])
set dx=x2-x1
set dy=y2-y1
set OLX=Atan2(dy,dx)
set M3E=x1+(800.*.025+(TIV[D0E])*.0)*Cos(OLX)
set M4E=y1+(800.*.025+(TIV[D0E])*.0)*Sin(OLX)
set CCE=SquareRoot(dx*dx+dy*dy)
if(CCE>80.)then
call SetUnitX(DPV[(SWV[SYV[D0E]+i])],((M3E)*1.))
call SetUnitY(DPV[(SWV[SYV[D0E]+i])],((M4E)*1.))
call SetUnitFacing(DPV[(SWV[SYV[D0E]+i])],((OLX)*1.)*bj_RADTODEG)
if CCE>1000. or IsUnitType(STV[SUV[D0E]+i],UNIT_TYPE_DEAD)then
set S0V[S1V[D0E]+i]=true
set STV[SUV[D0E]+i]=null
endif
else
if not IsUnitType(STV[SUV[D0E]+i],UNIT_TYPE_DEAD)then
call BCX(JC,"","origin")
call BPX(JC,SSV[D0E],STV[SUV[D0E]+i],DYX(TIV[D0E],GetHeroInt(SSV[D0E],true)))
set TEV[TXV[D0E]+i]=true
endif
set S0V[S1V[D0E]+i]=true
set STV[SUV[D0E]+i]=null
endif
else
if not S2V[S3V[D0E]+i]then
set x1=(GetUnitX(DPV[(SWV[SYV[D0E]+i])]))
set y1=(GetUnitY(DPV[(SWV[SYV[D0E]+i])]))
set x2=GetUnitX(SQV[D0E])
set y2=GetUnitY(SQV[D0E])
set dx=x2-x1
set dy=y2-y1
set OLX=Atan2(dy,dx)
set M3E=x1+(800.*.025+(TIV[D0E])*.0)*Cos(OLX)
set M4E=y1+(800.*.025+(TIV[D0E])*.0)*Sin(OLX)
set CCE=SquareRoot(dx*dx+dy*dy)
if(CCE>80.)then
call SetUnitX(DPV[(SWV[SYV[D0E]+i])],((M3E)*1.))
call SetUnitY(DPV[(SWV[SYV[D0E]+i])],((M4E)*1.))
call SetUnitFacing(DPV[(SWV[SYV[D0E]+i])],((OLX)*1.)*bj_RADTODEG)
else
if not IsUnitType(SQV[D0E],UNIT_TYPE_DEAD)and TEV[TXV[D0E]+i]then
call BCX(JC,"","origin")
call BPX(JC,SSV[D0E],SQV[D0E],DYX(TIV[D0E],GetHeroInt(SSV[D0E],true))*(.05+(TIV[D0E])*.01))
endif
set S2V[S3V[D0E]+i]=true
endif
else
set x1=(GetUnitX(DPV[(SWV[SYV[D0E]+i])]))
set y1=(GetUnitY(DPV[(SWV[SYV[D0E]+i])]))
set x2=S6V[S7V[D0E]+i]
set y2=S8V[S9V[D0E]+i]
set dx=x2-x1
set dy=y2-y1
set OLX=Atan2(dy,dx)
set M3E=x1+(800.*.025+(TIV[D0E])*.0)*Cos(OLX)
set M4E=y1+(800.*.025+(TIV[D0E])*.0)*Sin(OLX)
set CCE=SquareRoot(dx*dx+dy*dy)
if(CCE>80.)then
call SetUnitX(DPV[(SWV[SYV[D0E]+i])],((M3E)*1.))
call SetUnitY(DPV[(SWV[SYV[D0E]+i])],((M4E)*1.))
call SetUnitFacing(DPV[(SWV[SYV[D0E]+i])],((OLX)*1.)*bj_RADTODEG)
else
set S2V[S3V[D0E]+i]=false
set S0V[S1V[D0E]+i]=false
set SZV[S_V[D0E]+i]=false
set TEV[TXV[D0E]+i]=false
call SetUnitX(DPV[(SWV[SYV[D0E]+i])],((S6V[S7V[D0E]+i])*1.))
call SetUnitY(DPV[(SWV[SYV[D0E]+i])],((S8V[S9V[D0E]+i])*1.))
endif
endif
endif
endif
set i=i+1
endloop
else
call HXE(D0E)
endif
endfunction
function D7X takes nothing returns nothing
local integer D0E
//if(GetSpellAbilityId()=='A08L')then
set D0E=D3X(GetSpellTargetUnit(),GetTriggerUnit())
call SetTimerData(((TOV[D0E])),(D0E))
call TimerStart(TOV[D0E],.025,true,function D5X)
//endif
//return false
endfunction
function D8X takes nothing returns boolean
local unit c=GetSpellTargetUnit()
local unit u=GetTriggerUnit()
if GetSpellAbilityId()=='A08L' and IsUnitInGroup(c,KC)then
call Q_E(GetOwningPlayer(u),"Another instance is running for this unit.")
call PauseUnit(u,true)
call IssueImmediateOrderById(u,851972)
call PauseUnit(u,false)
endif
set c=null
set u=null
return false
endfunction
function D9X takes nothing returns nothing
local trigger t
/*call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function D7X))*/
call RegisterSpellEffectEvent('A08L', function D7X)
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(t,Condition(function D8X))
set JC=H0E()
call D0X(JC)
endfunction
function FVX takes nothing returns nothing
local player p=Player(0)
local unit u
local integer unitID
local trigger t
local real O5X
set X6V=CreateUnit(p,'h007',-508.6,-4608.7,139.575)
endfunction
function FEX takes nothing returns nothing
local player p=Player(PLAYER_NEUTRAL_PASSIVE)
local unit u
local integer unitID
local trigger t
local real O5X
set XZV=CreateUnit(p,'ncop',8000.,-4480.,270.)
set X_V=CreateUnit(p,'ncop',4800.,-4480.,270.)
set OVV=CreateUnit(p,'ncop',1280.,-3840.,270.)
set XQV=CreateUnit(p,'ncop',-1280.,-6400.,270.)
set X0V=CreateUnit(p,'ncop',-4800.,-4480.,270.)
set X1V=CreateUnit(p,'ncop',-8000.,-4480.,270.)
set X2V=CreateUnit(p,'ncop',-8704.,576.,270.)
set X3V=CreateUnit(p,'ncop',-4096.,576.,270.)
set X4V=CreateUnit(p,'ncop',4096.,576.,270.)
set XYV=CreateUnit(p,'ncop',8704.,576.,270.)
set X7V=CreateUnit(p,'ncop',1280.,-4864.,270.)
set X8V=CreateUnit(p,'ncop',.0,-6400.,270.)
set X9V=CreateUnit(p,'ncop',-1280.,-4928.,270.)
set u=CreateUnit(p,'ncp3',-6400.,-3072.,270.)
set u=CreateUnit(p,'ncp3',6400.,-3072.,270.)
set XDV=CreateUnit(p,'ncop',-256.,-3840.,270.)
//set XCV=CreateUnit(p,'ncop',1280.,-6400.,270.)
set XBV=CreateUnit(p,'ncop',1280.,-4608.,270.)
set XNV=CreateUnit(p,'ncop',-1280.,-4672.,270.)
set XAV=CreateUnit(p,'ncop',-1280.,-4416.,270.)
set QoBC=CreateUnit(p,'ncop',-1280.,-3950.,270.)
set XIV=CreateUnit(p,'ncop',-1280.,-5440.,270.)
set XRV=CreateUnit(p,'ncop',-1280.,-5952.,270.)
set XOV=CreateUnit(p,'ncop',-1280.,-6208.,270.)
set XXV=CreateUnit(p,'ncop',-512.,-3840.,270.)
set XFV=CreateUnit(p,'ncop',-768.,-3840.,270.)
set XJV=CreateUnit(p,'ncop',.0,-3840.,270.)
set XKV=CreateUnit(p,'ncop',256.,-3840.,270.)
set XLV=CreateUnit(p,'ncop',256.,-6400.,270.)
set XUV=CreateUnit(p,'ncop',-512.,-6400.,270.)
set XTV=CreateUnit(p,'ncop',-768.,-6400.,270.)
set XSV=CreateUnit(p,'ncop',512.,-6400.,270.)
set XEV=CreateUnit(p,'ncop',1280.,-4352.,270.)
set XVV=CreateUnit(p,'ncop',1280.,-5632.,270.)
set E9V=CreateUnit(p,'ncop',1280.,-4096.,270.)
set E8V=CreateUnit(p,'ncop',1280.,-5120.,270.)
set E6V=CreateUnit(p,'ncop',-256.,-6400.,270.)
set E5V=CreateUnit(p,'ncop',768.,-6400.,270.)
set E1V=CreateUnit(p,'ncop',-1280.,-5696.,270.)
set XGV=CreateUnit(p,'ncop',1280.,-5376.,270.)
set E3V=CreateUnit(p,'ncop',-1280.,-4160.,270.)
set XHV=CreateUnit(p,'ncop',-1024.,-3840.,270.)
set OXV=CreateUnit(p,'ncop',1280.,-5888.,270.)
set OEV=CreateUnit(p,'ncop',1024.,-3840.,270.)
set E2V=CreateUnit(p,'ncop',768.,-3840.,270.)
set OOV=CreateUnit(p,'ncop',1024.,-6400.,270.)
set XPV=CreateUnit(p,'ncop',512.,-3840.,270.)
set X5V=CreateUnit(p,'ncop',-1280.,-5184.,270.)
set XWV=CreateUnit(p,'ncop',-1024.,-6400.,270.)
set PeHC=CreateUnit(p,'ncop',1280.,-6400.,270.)
set FIRELORDCIRCLE=CreateUnit(p,'ncop',-10.,-6118.9,270.)
set TRITUSCIRCLE=CreateUnit(p,'ncop',-1050.,-5125.,270.)
set MOLOCHCIRCLE=CreateUnit(p,'ncop',-10.,-4100.,270.)
set VERACIRCLE=CreateUnit(p,'ncop',1285.713,-6183.044,270.)
set NYXVIRCIRCLE = CreateUnit(p,'ncop',660.4,-4100.,270.)
call SetUnitVertexColor(NYXVIRCIRCLE,160,32,240,255)
endfunction
function FXX takes nothing returns nothing
local player p=Player(PLAYER_NEUTRAL_PASSIVE)
local unit u
local integer unitID
local trigger t
local real O5X
set u=CreateUnit(p,'n014',-4930.,-256.,270.)
set u=CreateUnit(p,'n014',7890.,-256.,270.)
set u=CreateUnit(p,'n015',5056.,-256.,270.)
set u=CreateUnit(p,'n015',-7776.,-256.,270.)
set u=CreateUnit(p,'n00X',5912.6,-2795.3,270.)
set u=CreateUnit(p,'n00F',-7424.,-2816.,270.)
set u=CreateUnit(p,'n00F',5376.,-2816.,270.)
set u=CreateUnit(p,'n008',-5376.,-2752.,270.)
set u=CreateUnit(p,'n008',7424.,-2752.,270.)
set u=CreateUnit(p,'h00P',4343.7,6583.3,99.03)
set u=CreateUnit(p,'n00V',-6400.,-2752.,270.)
set u=CreateUnit(p,'n00V',6400.,-2752.,270.)
set u=CreateUnit(p,'n00A',-5888.,-2752.,270.)
set u=CreateUnit(p,'n00A',6912.,-2752.,270.)
set u=CreateUnit(p,'h00P',8451.6,6568.6,81.35)
set u=CreateUnit(p,'h00P',-4345.3,6549.4,87.75)
set u=CreateUnit(p,'h00P',-8443.3,6562.7,175.83)
set E4V=CreateUnit(p,'n00T',-5461.8,-2841.6,154.164)
set u=CreateUnit(p,'n00W',7005.1,-2668.5,332.152)
set u=CreateUnit(p,'n00W',6678.2,-2753.6,33.242)
set E7V=CreateUnit(p,'n00T',7347.9,-2833.5,152.812)
set u=CreateUnit(p,'n00X',-6935.7,-2761.4,270.)
set u=CreateUnit(p,'n012',6392.1,-2714.8,269.43)
set u=CreateUnit(p,'n00W',-5797.1,-2695.3,335.062)
set u=CreateUnit(p,'n00W',-6121.,-2800.,41.582)
set u=CreateUnit(p,'n00Y',-7446.6,-2740.8,285.488)
set u=CreateUnit(p,'n00Y',5355.3,-2720.5,284.201)
set u=CreateUnit(p,'n00Z',5371.6,-2765.2,270.031)
set u=CreateUnit(p,'n00Z',-7444.1,-2767.1,358.778)
set u=CreateUnit(p,'n00Z',-6914.4,-2767.4,107.362)
set u=CreateUnit(p,'n00Z',-6403.8,-2765.,179.154)
set u=CreateUnit(p,'n00Z',-5891.9,-2759.2,90.267)
set u=CreateUnit(p,'n00Z',-5392.2,-2762.2,87.966)
set u=CreateUnit(p,'n00Z',5888.9,-2756.6,276.534)
set u=CreateUnit(p,'n00Z',6388.4,-2774.7,.755)
set u=CreateUnit(p,'n00Z',7415.7,-2761.2,269.231)
set u=CreateUnit(p,'n00Z',6899.3,-2767.3,359.794)
set u=CreateUnit(p,'n00Z',7846.5,-277.1,180.02)
set u=CreateUnit(p,'n00Z',4970.6,-259.2,180.725)
set u=CreateUnit(p,'n00Z',-7837.4,-246.7,270.19)
set u=CreateUnit(p,'n00Z',-4952.,-276.,89.753)
set u=CreateUnit(p,'n00Z',-2.,-5120.6,41.12)
set u=CreateUnit(p,'n010',-7734.4,-262.8,269.539)
set u=CreateUnit(p,'n010',5069.8,-256.6,271.808)
set u=CreateUnit(p,'n010',4902.1,-259.2,271.494)
set u=CreateUnit(p,'n010',-7899.7,-260.6,268.611)
set u=CreateUnit(p,'n011',-7038.8,-2701.4,302.079)
set u=CreateUnit(p,'n011',5979.9,-2711.2,215.388)
set u=CreateUnit(p,'n011',-6804.6,-2671.9,234.768)
set u=CreateUnit(p,'n011',5779.5,-2716.4,311.923)
set u=CreateUnit(p,'n012',-6410.5,-2712.7,269.43)
set u=null
endfunction
function FOX takes nothing returns nothing
local player p
local unit u
local integer unitID
local trigger t
local real O5X
set p=Player(0)
set u=CreateUnit(p,'h000',6400.,2816.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(1)
set u=CreateUnit(p,'h000',6400.,3328.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(2)
set u=CreateUnit(p,'h000',6400.,3840.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(3)
set u=CreateUnit(p,'h000',6400.,4352.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(4)
set u=CreateUnit(p,'h000',6400.,4864.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(5)
set u=CreateUnit(p,'h000',-6400.,2816.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(6)
set u=CreateUnit(p,'h000',-6400.,3328.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(7)
set u=CreateUnit(p,'h000',-6400.,3840.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(8)
set u=CreateUnit(p,'h000',-6400.,4352.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p=Player(9)
set u=CreateUnit(p,'h000',-6400.,4864.,270.)
call UnitAddItemToSlotById(u,'wcyc',0)
call UnitAddItemToSlotById(u,'wshs',1)
call UnitAddItemToSlotById(u,'woms',2)
call UnitAddItemToSlotById(u,'wlsd',3)
call UnitAddItemToSlotById(u,'I059',4)
set p = null
set u = null
endfunction
function FRX takes nothing returns nothing
local weathereffect we
set GU=Rect(-6592.,-3264.,-6208.,-2880.)
set HU=Rect(6208.,-3264.,6592.,-2880.)
set JU=Rect(-9088.,6528.,-7808.,6784.)
set KU=Rect(-4992.,6528.,-3712.,6784.)
set LU=Rect(3712.,6528.,4992.,6784.)
set MU=Rect(7808.,6528.,9088.,6784.)
set PU=Rect(-1536.,-6656.,1536.,-3584.)
set QU=Rect(-9472.,-6912.,-3328.,7520.)
set SU=Rect(3328.,-6880.,9472.,7552.)
set TU=Rect(-7168.,2560.,-5632.,6880.)
set UU=Rect(5632.,2688.,7168.,7008.)
set WU=Rect(-1472.,-3808.,-1344.,-3680.)
set YU=Rect(-1088.,-3776.,-960.,-3648.)
set ZU=Rect(-832.,-3776.,-704.,-3648.)
set VW=Rect(-576.,-3776.,-448.,-3648.)
set EW=Rect(-320.,-3776.,-192.,-3648.)
set XW=Rect(-64.,-3776.,64.,-3648.)
set OW=Rect(192.,-3776.,320.,-3648.)
set RW=Rect(448.,-3776.,576.,-3648.)
set IW=Rect(704.,-3776.,832.,-3648.)
set AW=Rect(960.,-3776.,1088.,-3648.)
set NW=Rect(1344.,-3808.,1472.,-3680.)
set BW=Rect(1344.,-4160.,1472.,-4032.)
set CW=Rect(1344.,-4416.,1472.,-4288.)
set DW=Rect(1344.,-4672.,1472.,-4544.)
set FW=Rect(1344.,-4928.,1472.,-4800.)
set GW=Rect(1344.,-5184.,1472.,-5056.)
set HW=Rect(1344.,-5440.,1472.,-5312.)
set JW=Rect(1344.,-5696.,1472.,-5568.)
set KW=Rect(1344.,-5952.,1472.,-5824.)
set LW=Rect(1344.,-6560.,1472.,-6432.)
set MW=Rect(960.,-6592.,1088.,-6464.)
set PW=Rect(704.,-6592.,832.,-6464.)
set QW=Rect(448.,-6592.,576.,-6464.)
set SW=Rect(192.,-6592.,320.,-6464.)
set TW=Rect(-64.,-6592.,64.,-6464.)
set UW=Rect(-320.,-6622.,-192.,-6584.)
set WW=Rect(-576.,-6592.,-448.,-6464.)
set YW=Rect(-832.,-6592.,-704.,-6464.)
set ZW=Rect(-1088.,-6592.,-960.,-6464.)
set VY=Rect(-1440.,-6624.,-1312.,-6496.)
set EY=Rect(-1472.,-6304.,-1344.,-6176.)
set XY=Rect(-1472.,-6016.,-1344.,-5888.)
set OY=Rect(-1472.,-5760.,-1344.,-5632.)
set RY=Rect(-1472.,-5504.,-1344.,-5376.)
set IY=Rect(-1472.,-5248.,-1344.,-5120.)
set AY=Rect(-1472.,-4992.,-1344.,-4864.)
set NY=Rect(-1472.,-4736.,-1344.,-4608.)
set BY=Rect(-1472.,-4480.,-1344.,-4320.)
set CY=Rect(-1472.,-4256.,-1344.,-4096.)
endfunction
function FIX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[1])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function FAX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==1)
endfunction
function FNX takes nothing returns boolean
return(ST==false)
endfunction
function FBX takes nothing returns boolean
return(FNX())
endfunction
function FCX takes nothing returns nothing
if(FBX())then
call SetUnitAbilityLevelSwapped('A00O',GetTriggerUnit(),XT)
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'SCae')
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',XT)
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'SCae')
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',XT)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
call UnitAddAbility(GetTriggerUnit(),'A04K')
call UnitAddAbility(GetTriggerUnit(),'A01R')
call SetUnitAbilityLevel(GetTriggerUnit(),'A01R',5)
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'A00O')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FAX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function FFX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[2])
endfunction
function FGX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==2)
endfunction
function FHX takes nothing returns boolean
return(ST==false)
endfunction
function FJX takes nothing returns boolean
return(FHX())
endfunction
function FKX takes nothing returns nothing
if(FJX())then
call SetUnitAbilityLevelSwapped('AIcb',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'AIcb')
call UnitRemoveAbility(GetTriggerUnit(),'Afzy')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FGX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function FMX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[3])
endfunction
function FPX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==3)
endfunction
function FQX takes nothing returns boolean
return(ST==false)
endfunction
function FSX takes nothing returns boolean
return(FQX())
endfunction
function FTX takes nothing returns nothing
if(FSX())then
call SetUnitAbilityLevelSwapped('AEar',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'AEar')
endif
if XT ==2 then
call SetUnitAbilityLevelSwapped('AEar',GetTriggerUnit(),1)
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('AEar',GetTriggerUnit(),2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'SCae')
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',XT)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
call UnitAddAbility(GetTriggerUnit(),'SCae')
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',XT)
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'AEar')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FPX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function FWX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[4])
endfunction
function FYX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==4)
endfunction
function FZX takes nothing returns boolean
return(ST==false)
endfunction
function F_X takes nothing returns boolean
return(FZX())
endfunction
function F0X takes nothing returns nothing
if(F_X())then
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),XT)
call SetUnitAbilityLevel(GetTriggerUnit(),'AChv',XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
call UnitRemoveAbility(GetTriggerUnit(),'A03R')
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT ==2 then
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),1)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),1)
call SetUnitAbilityLevel(GetTriggerUnit(),'AChv',1)
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),2)
call SetUnitAbilityLevel(GetTriggerUnit(),'AChv',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A08F')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A08F')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
call UnitRemoveAbility(GetTriggerUnit(),'A03R')
call UnitRemoveAbility(GetTriggerUnit(),'AChv')
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FYX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function F2X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[5])
endfunction
function F3X takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==5)
endfunction
function F4X takes nothing returns boolean
return(ST==false)
endfunction
function F5X takes nothing returns boolean
return(F4X())
endfunction
function F6X takes nothing returns nothing
local unit u
local real x
local real y
local integer playern
if(F5X())then
//call SetUnitAbilityLevelSwapped('Aenr',GetTriggerUnit(),XT)
if BRTON then
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
set playern = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call RemoveUnit(GetTriggerUnit())
set u = CreateUnit(Player(playern),'n01B',x,y,270.)
call RemoveGuardPosition(u)
call SetUnitPathing(u,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,u,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,u)
call SetUnitAcquireRange(u,900.)
if XT ==4 then
call SetUnitScale(u,1.1,1.1,1.1)
call UnitAddAbility(u,'A0BH')
call UnitAddAbility(u,'A01X')
endif
if XT ==5 then
call SetUnitScale(u,1.3,1.3,1.3)
call UnitAddAbility(u,'A0BH')
call SetUnitAbilityLevel(u,'A0BH',2)
call UnitAddAbility(u,'Absk')
call UnitAddAbility(u,'A01X')
endif
call UnitAddAbility(u,'A06Q')
else
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A034')
endif
if XT ==2 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A034',1)
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A034',2)
endif
if XT ==4 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A034',3)
endif
if XT ==5 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A034',3)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endif
else
//call UnitRemoveAbility(GetTriggerUnit(),'Aenr')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(F3X())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
set u =null
endfunction
function F8X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[6])
endfunction
function F9X takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==6)
endfunction
function GVX takes nothing returns boolean
return(ST==false)
endfunction
function GEX takes nothing returns boolean
return(GVX())
endfunction
function GXX takes nothing returns nothing
if(GEX())then
call SetUnitAbilityLevelSwapped('Afbt',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('AIcb',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACct',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'ACct')
call UnitRemoveAbility(GetTriggerUnit(),'Afbt')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call SetUnitAbilityLevel(GetTriggerUnit(),'ACct',1)
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'ACct',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BH',2)
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'Afbt')
call UnitRemoveAbility(GetTriggerUnit(),'AIcb')
call UnitRemoveAbility(GetTriggerUnit(),'ACvp')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'Apiv')
call UnitRemoveAbility(GetTriggerUnit(),'A0EV')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(F9X())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function GRX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[7])
endfunction
function GIX takes nothing returns boolean
return(bj_forLoopAIndex==ModuloInteger(bj_forLoopAIndex,40))and(ModuloInteger(bj_forLoopAIndex,40)==7)
endfunction
function GAX takes nothing returns boolean
return(ST==false)
endfunction
function GNX takes nothing returns boolean
return(GAX())
endfunction
function GBX takes nothing returns nothing
if(GNX())then
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A01R',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Afbt',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'Afbt')
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call SetUnitAbilityLevel(GetTriggerUnit(),'A01R',1)
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A01R',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A0BD')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'Afbt')
call UnitRemoveAbility(GetTriggerUnit(),'AIcb')
call UnitRemoveAbility(GetTriggerUnit(),'ACvp')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'Apiv')
call UnitRemoveAbility(GetTriggerUnit(),'A0EV')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GIX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function GDX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[8])
endfunction
function GFX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==8)
endfunction
function GGX takes nothing returns boolean
return(ST==false)
endfunction
function GHX takes nothing returns boolean
return(GGX())
endfunction
function GJX takes nothing returns nothing
if(GHX())then
call SetUnitAbilityLevelSwapped('ACen',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A06A')
call UnitRemoveAbility(GetTriggerUnit(),'Aspd')
endif
if TRUEENFOS and not RANDOMWAVEON then
call UnitAddAbility(GetTriggerUnit(),'A06A')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A06A')
call UnitAddAbility(GetTriggerUnit(),'A0BK')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A06A')
call UnitAddAbility(GetTriggerUnit(),'A0BK')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BK',2)
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'ACen',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A08K')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A08E')
call UnitAddAbility(GetTriggerUnit(),'A08K')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'A03R')
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'ACen')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GFX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function GLX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and((GetUnitTypeId(GetTriggerUnit())==PK[10] and not TRUEENFOS) or(GetUnitTypeId(GetTriggerUnit())==PK[9] and TRUEENFOS))
endfunction
function GMX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==10)
endfunction
function GPX takes nothing returns boolean
return(ST==false)
endfunction
function GQX takes nothing returns boolean
return(GPX())
endfunction
function GSX takes nothing returns nothing
if(GQX())then
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACav',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A08C')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A03R')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'Ansk',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'ACav',2)
endif
if XT ==4 then
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'ACav')
call UnitRemoveAbility(GetTriggerUnit(),'A03R')
call UnitRemoveAbility(GetTriggerUnit(),'A01Z')
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GMX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function GUX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and((GetUnitTypeId(GetTriggerUnit())==PK[9] and not TRUEENFOS) or(GetUnitTypeId(GetTriggerUnit())==PK[10] and TRUEENFOS))
endfunction
function GWX takes nothing returns boolean
return(ModuloInteger(bj_forLoopAIndex,40)==9)
endfunction
function GYX takes nothing returns boolean
return(ST==false)
endfunction
function GZX takes nothing returns boolean
return(GYX())
endfunction
function G_X takes nothing returns nothing
if(GZX())then
call SetUnitAbilityLevelSwapped('Ahea',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A0L0',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
call UnitRemoveAbility(GetTriggerUnit(),'Ahea')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
call SetUnitAbilityLevel(GetTriggerUnit(),'Ahea',1)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',1)
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'Ahea',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'ANic')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'ANic')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A01X')
endif
else
call UnitRemoveAbility(GetTriggerUnit(),'Ahea')
call UnitRemoveAbility(GetTriggerUnit(),'SCae')
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GWX())then
call UnitAddAbility(GetTriggerUnit(),PT[bj_forLoopAIndex])
call SetUnitAbilityLevelSwapped(PT[bj_forLoopAIndex],GetTriggerUnit(),XT)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function G1X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[11])
endfunction
function G2X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACua',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Ambd',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'Ambd',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function G4X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[12])
endfunction
function G5X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'ANic')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT == 3 then
call SetUnitAbilityLevel(GetTriggerUnit(),'Ansk',2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BH',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function G7X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[13])
endfunction
function G8X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A01T')
endif
if XT ==2 then
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),2)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',2)
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),3)
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),3)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',3)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'S009')
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),4)
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),4)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',4)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'S009')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',3)
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),5)
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),5)
call SetUnitAbilityLevel(GetTriggerUnit(),'SCae',5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HVX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[14])
endfunction
function HEX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ANbh',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A06P',GetTriggerUnit(),100)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A06O')
call UnitRemoveAbility(GetTriggerUnit(),'ANic')
call UnitRemoveAbility(GetTriggerUnit(),'ANbh')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A06O')
endif
if XT ==4 then
call UnitRemoveAbility(GetTriggerUnit(),'A06P')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'A04H')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitRemoveAbility(GetTriggerUnit(),'A06P')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HOX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[15])
endfunction
function HRX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A01W',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A01T')
call UnitRemoveAbility(GetTriggerUnit(),'A01W')
endif
if XT ==2 then
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A01W',GetTriggerUnit(),2)
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),3)
call SetUnitAbilityLevelSwapped('A01W',GetTriggerUnit(),3)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'S009')
call UnitAddAbility(GetTriggerUnit(),'A0BM')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'S009')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BM',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HAX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[16])
endfunction
function HNX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACav',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A03R')
//call UnitRemoveAbility(GetTriggerUnit(),'A04H')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
//call UnitRemoveAbility(GetTriggerUnit(),'A04H')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),3)
call SetUnitAbilityLevelSwapped('ACav',GetTriggerUnit(),3)
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
call UnitAddAbility(GetTriggerUnit(),'A04H')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HCX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)and(GetUnitTypeId(GetTriggerUnit())==PK[17])
endfunction
function HDX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACav',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A04K')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A04K')
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),2)
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),3)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),3)
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',4)
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),4)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),4)
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BH',5)
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',5)
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',5)
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),5)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HGX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[18])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function HHX takes nothing returns boolean
return(XT==1)
endfunction
function HJX takes nothing returns nothing
if TRUEENFOS then
call UnitAddType(GetTriggerUnit(),UNIT_TYPE_TAUREN)
endif
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A01R',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'SCae')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('A01R',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),3)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'ANic')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'ANic')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
if(HHX())then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HLX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[19])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function HMX takes nothing returns boolean
return(XT==1)
endfunction
function HPX takes nothing returns boolean
return(XT==1)
endfunction
function HQX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACev')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACev')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),3)
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),3)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
if(HMX())then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if(HPX())then
call UnitRemoveAbility(GetTriggerUnit(),'A04R')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HTX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[20])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function HUX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'ACbn')
call UnitRemoveAbility(GetTriggerUnit(),'A06N')
call UnitRemoveAbility(GetTriggerUnit(),'Aspo')
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A06N')
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),3)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A01X')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'Ambd')
call SetUnitAbilityLevelSwapped('Ambd',GetTriggerUnit(),5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function HYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[21])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function HZX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACcb',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACba',GetTriggerUnit(),XT)
if BRTON then
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
endif
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'ACnr')
call UnitRemoveAbility(GetTriggerUnit(),'A08I')
call UnitRemoveAbility(GetTriggerUnit(),'A08J')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'A04P')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),5)
call SetUnitAbilityLevelSwapped('A0BC',GetTriggerUnit(),2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function H0X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[22])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function H1X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Afbt',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A01R',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'Afbt')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A01R')
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT == 3 then
call SetUnitAbilityLevelSwapped('A01R',GetTriggerUnit(),2)
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call SetUnitAbilityLevelSwapped('A0BH',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function H3X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[23])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function H4X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A0KP',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A0KP')
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
call UnitRemoveAbility(GetTriggerUnit(),'ACcs')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A0KP')
call UnitRemoveAbility(GetTriggerUnit(),'A04H')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'Absk')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A01X')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function H6X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[24])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function H7X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACf2',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACcw',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A06N')
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A06N')
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BM')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call UnitAddAbility(GetTriggerUnit(),'A0BM')
call SetUnitAbilityLevelSwapped('A0BM',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function H9X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[26])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JVX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACpv',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'ANic')
call UnitRemoveAbility(GetTriggerUnit(),'ACpv')
call UnitRemoveAbility(GetTriggerUnit(),'Afzy')
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'ANic')
call UnitRemoveAbility(GetTriggerUnit(),'ACpv')
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call SetUnitAbilityLevelSwapped('A0BH',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A0BC',GetTriggerUnit(),2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JXX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[27])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JOX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Afbt',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACcs')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACcs')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A04H')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'Absk')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JIX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[28])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JAX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A037',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A037')
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A037')
call UnitRemoveAbility(GetTriggerUnit(),'Ansk')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A03Z')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A01Z')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A03Z')
call UnitAddAbility(GetTriggerUnit(),'A01Z')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',5)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JBX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[29])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JCX takes nothing returns boolean
return(XT==1)
endfunction
function JDX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Apoi',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Ambd',GetTriggerUnit(),XT)
if XT ==1 then
call UnitAddAbility(GetTriggerUnit(),'A0BK')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BK',2)
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'Apoi')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'Apoi')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call UnitAddAbility(GetTriggerUnit(),'Absk')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',3)
endif
if(JCX())then
call UnitRemoveAbility(GetTriggerUnit(),'A04R')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JGX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[30])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JHX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A01T')
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A01T')
call UnitRemoveAbility(GetTriggerUnit(),'A08K')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',2)
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BD')
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BD',3)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JKX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[31])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JLX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Ambd',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'ACcs')
call UnitRemoveAbility(GetTriggerUnit(),'ACuf')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
call UnitRemoveAbility(GetTriggerUnit(),'ACcs')
call UnitRemoveAbility(GetTriggerUnit(),'ACuf')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'S009')
call UnitAddAbility(GetTriggerUnit(),'A0BM')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A0BM')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A04H')
call UnitAddAbility(GetTriggerUnit(),'S009')
call UnitAddAbility(GetTriggerUnit(),'A01X')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BM',2)
call SetUnitAbilityLevel(GetTriggerUnit(),'A04P',3)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JPX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[32])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JQX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACat',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'SCae')
call UnitRemoveAbility(GetTriggerUnit(),'A0F6')
call UnitRemoveAbility(GetTriggerUnit(),'ACuf')
call UnitRemoveAbility(GetTriggerUnit(),'ACbl')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
call UnitRemoveAbility(GetTriggerUnit(),'A0F6')
call UnitRemoveAbility(GetTriggerUnit(),'ACuf')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'AEar')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'AEar')
call SetUnitAbilityLevel(GetTriggerUnit(),'AEar',3)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JTX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[33])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JUX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACac',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('SCae',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A04K')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACac')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A04K')
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'ACac')
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Afzy')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function JYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[35])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function JZX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACvp',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'S009')
call UnitRemoveAbility(GetTriggerUnit(),'ACvp')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'S009')
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
if XT == 5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Afzy')
call UnitAddAbility(GetTriggerUnit(),'A04K')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BC',2)
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function J0X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[36])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function J1X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A037',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('AIcb',GetTriggerUnit(),XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
call UnitRemoveAbility(GetTriggerUnit(),'A037')
call UnitRemoveAbility(GetTriggerUnit(),'AIcb')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
call UnitRemoveAbility(GetTriggerUnit(),'A037')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
call UnitAddAbility(GetTriggerUnit(),'A04S')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function J3X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[37])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function J4X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A0EJ',GetTriggerUnit(),XT)
call SetUnitAbilityLevel(GetTriggerUnit(),'A01R',XT)
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
call UnitRemoveAbility(GetTriggerUnit(),'A0EJ')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'AIsr')
call UnitRemoveAbility(GetTriggerUnit(),'A0EJ')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function J6X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[39])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function J7X takes nothing returns nothing
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'A0EJ')
call UnitRemoveAbility(GetTriggerUnit(),'ACev')
call UnitRemoveAbility(GetTriggerUnit(),'ACct')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A04S')
call UnitRemoveAbility(GetTriggerUnit(),'A0EJ')
call UnitRemoveAbility(GetTriggerUnit(),'ACev')
call UnitRemoveAbility(GetTriggerUnit(),'ACct')
call UnitRemoveAbility(GetTriggerUnit(),'Ambd')
endif
if XT ==4 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
if XT ==5 then
call UnitAddAbility(GetTriggerUnit(),'A04K')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function J9X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==PK[25])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KVX takes nothing returns boolean
return(XT==1)
endfunction
function KEX takes nothing returns nothing
if XT ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACmi')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT ==2 then
call UnitRemoveAbility(GetTriggerUnit(),'A08F')
call UnitRemoveAbility(GetTriggerUnit(),'A083')
call UnitRemoveAbility(GetTriggerUnit(),'ACmi')
call UnitRemoveAbility(GetTriggerUnit(),'A08E')
endif
if XT ==4 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BH')
call UnitAddAbility(GetTriggerUnit(),'A04S')
endif
if XT ==5 then
call SetUnitScale(GetTriggerUnit(),1.5,1.5,1.5)
call UnitAddAbility(GetTriggerUnit(),'Absk')
call UnitAddAbility(GetTriggerUnit(),'A04S')
call UnitAddAbility(GetTriggerUnit(),'A04P')
call UnitAddAbility(GetTriggerUnit(),'A0BC')
call SetUnitAbilityLevelSwapped('A0BC',GetTriggerUnit(),2)
call SetUnitAbilityLevelSwapped('A04P',GetTriggerUnit(),3)
endif
if(KVX())then
call UnitRemoveAbility(GetTriggerUnit(),'A04R')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KOX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[4])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KRX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ANak',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KAX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[5])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KNX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KCX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[7])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KDX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACct',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KGX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[13])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KHX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A0EG',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KKX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[14])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KLX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACbh',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KPX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[15])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KQX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KTX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[16])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KUX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[17])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KYYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[8])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function KZZX takes nothing returns nothing
if XT==1 or XT == 2 then
call UnitRemoveAbility(GetTriggerUnit(),'A0K9')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function KZX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACpv',GetTriggerUnit(),XT)
if XT==1 then
call UnitRemoveAbility(GetTriggerUnit(),'ACpv')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function K0X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[18])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function K0XX takes nothing returns boolean
return((GetUnitTypeId(GetTriggerUnit())==MC[9] and not TRUEENFOS) or(GetUnitTypeId(GetTriggerUnit())==MC[10] and TRUEENFOS))and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function K0XXX takes nothing returns boolean
return((GetUnitTypeId(GetTriggerUnit())==MC[10] and not TRUEENFOS) or(GetUnitTypeId(GetTriggerUnit())==MC[9] and TRUEENFOS))and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function K1X takes nothing returns boolean
return(XT<=2)
endfunction
function K2X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACbh',GetTriggerUnit(),XT)
if(K1X())then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function K2XX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A0L0',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function K2XXX takes nothing returns nothing
if TRUEENFOS then
call UnitAddAbility(GetTriggerUnit(),'A0HS')
endif
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function K4X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[20])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function K5X takes nothing returns nothing
if XT <= 2 then
call UnitAddAbility(GetTriggerUnit(),'A0BK')
call SetUnitAbilityLevel(GetTriggerUnit(),'A0BK',2)
endif
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function K7X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[21])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function K8X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACcb',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LVX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[22])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LEX takes nothing returns nothing
if XT<=2 then
call UnitRemoveAbility(GetTriggerUnit(),'Absk')
endif
call SetUnitAbilityLevelSwapped('ACct',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LOX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[24])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LRX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AChv',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('ACcw',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LAX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[26])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LNX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACpv',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LCX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[27])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LDX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Afbt',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LGX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[28])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LHX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A037',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Ansk',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LKX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[29])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LLX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Apoi',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LPX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[30])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LQX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A01T',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LTX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[32])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LUX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function LYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[36])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function LZX takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A037',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function L0X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[37])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function L1X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('AIsr',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('A0EJ',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function L3X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[38])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function L4X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('ACsw',GetTriggerUnit(),XT)
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function L6X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==MC[39])and(GetUnitAbilityLevelSwapped('A06Q',GetTriggerUnit())==0)
endfunction
function L7X takes nothing returns nothing
call SetUnitAbilityLevelSwapped('Aspo',GetTriggerUnit(),XT)
call UnitAddAbility(GetTriggerUnit(),'A06Q')
endfunction
function Trig_AMSettings_Func080002001001001 takes nothing returns boolean
return(GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER)
endfunction
function Trig_AMSettings_Func080002001001002 takes nothing returns boolean
return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_AMSettings_Func080002001001 takes nothing returns boolean
return GetBooleanAnd((GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER),(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING))
endfunction
function Trig_AMSettings_Func080002001002 takes nothing returns boolean
return(IsPlayerAlly(GetFilterPlayer(),Player(0)))
endfunction
function MVX takes nothing returns boolean
return GetBooleanAnd((GetBooleanAnd((GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER),(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING))),(IsPlayerAlly(GetFilterPlayer(),Player(0))))
endfunction
function Trig_AMSettings_Func081002001001001 takes nothing returns boolean
return(GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER)
endfunction
function Trig_AMSettings_Func081002001001002 takes nothing returns boolean
return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_AMSettings_Func081002001001 takes nothing returns boolean
return GetBooleanAnd((GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER),(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING))
endfunction
function Trig_AMSettings_Func081002001002 takes nothing returns boolean
return(IsPlayerAlly(GetFilterPlayer(),Player(5)))
endfunction
function MEX takes nothing returns boolean
return GetBooleanAnd((GetBooleanAnd((GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER),(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING))),(IsPlayerAlly(GetFilterPlayer(),Player(5))))
endfunction
function Trig_AMSettings_Func082002001001 takes nothing returns boolean
return(GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER)
endfunction
function Trig_AMSettings_Func082002001002 takes nothing returns boolean
return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
function MXX takes nothing returns boolean
return GetBooleanAnd((GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER),(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING))
endfunction
function MOX takes nothing returns nothing
call LeaderboardAddItemBJ(GetEnumPlayer(),NS[1],GetPlayerName(GetEnumPlayer()),0)
endfunction
function MRX takes nothing returns nothing
call LeaderboardAddItemBJ(GetEnumPlayer(),NS[2],GetPlayerName(GetEnumPlayer()),0)
endfunction
function MIX takes nothing returns nothing
set PQ="% Badassery: "
set QQ[1]='E00Y'
set QQ[2]='E010'
set QQ[3]='E011'
set QQ[4]='E012'
set QQ[5]='E013'
set QQ[6]='E014'
set QQ[7]='E015'
set QQ[8]='E016'
set QQ[9]='E017'
set QQ[10]='E018'
set QQ[11]='E019'
set QQ[12]='E01A'
set QQ[13]='E01B'
set QQ[14]='E000'
set QQ[15]='E01C'
set QQ[16]='E01D'
set QQ[17]='E01E'
set QQ[18]='E01F'
set QQ[19]='E01G'
set QQ[20]='E01H'
set QQ[21]='E01J'
set QQ[22]='E01K'
set QQ[23]='E01L'
set QQ[24]='E01M'
set QQ[25]='E01N'
set QQ[26]='E01O'
set QQ[27]='E01P'
set QQ[28]='E01Q'
set QQ[29]='H00F'
set QQ[30]='U00Z'
set QQ[31]='U00O'
set QQ[32]='U003'
set QQ[33]='U00N'
set QQ[34]='N00D'
set QQ[35]='N01S'
set QQ[36]='E00E'
set QQ[37]='E004'
set QQ[38]='E006'
set QQ[39]='U004'
set QQ[40]='U000'
set QQ[41]='H01F'
set QQ[42]='N01M'
set QQ[43]='E00Q'
set QQ[44]='E00R'
set QQ[45]='E00U'
set QQ[46]='N01O'
set QQ[47]='N01Q'
set QQ[48]='O00B'
set QQ[49]='E01M'
set QQ[50]='E01I'
set QQ[51]='E01R'
set QQ[52]='O00E'
set QQ[53]='N03U'
set QQ[54]='E01X'
set QQ[55]='E01Y'
set QQ[56]='E01Z'
set QQ[57]='E020'
set QQ[58]='U007'
set QQ[59]='E024'
set QQ[60]='U009'
set SQ[1]="ReplaceableTextures\\CommandButtons\\BTNProudmoore.blp"
set SQ[2]="ReplaceableTextures\\CommandButtons\\BTNArthas.tga"
set SQ[3]="ReplaceableTextures\\CommandButtons\\BTNSorceress.tga"
set SQ[4]="ReplaceableTextures\\CommandButtons\\BTNBeastMaster.tga"
set SQ[5]="ReplaceableTextures\\CommandButtons\\BTNNagaSeaWitch.blp"
set SQ[6]="ReplaceableTextures\\CommandButtons\\BTNDwarfMonkPilgrim.blp"
set SQ[7]="ReplaceableTextures\\CommandButtons\\BTNChaosBlademaster.blp"
set SQ[8]="ReplaceableTextures\\CommandButtons\\BTNFireBrewmaster.blp"
set SQ[9]="ReplaceableTextures\\CommandButtons\\BTNAscensionBlade.blp"
set SQ[10]="ReplaceableTextures\\CommandButtons\\BTNGarithos.blp"
set SQ[11]="ReplaceableTextures\\CommandButtons\\BTNJaina.tga"
set SQ[12]="ReplaceableTextures\\CommandButtons\\BTNEarthBrewmaster.blp"
set SQ[13]="ReplaceableTextures\\CommandButtons\\BTNStormBrewmaster.blp"
set SQ[14]="ReplaceableTextures\\CommandButtons\\BTN_EyeOfShadows.blp"
set SQ[15]="ReplaceableTextures\\CommandButtons\\BTNTheCaptain.tga"
set SQ[16]="ReplaceableTextures\\CommandButtons\\BTNDarkTrollWarlord.blp"
set SQ[17]="ReplaceableTextures\\CommandButtons\\BTNSpellBreaker.tga"
set SQ[18]="ReplaceableTextures\\CommandButtons\\BTNAssassin.tga"
set SQ[19]="ReplaceableTextures\\CommandButtons\\BTNHuntress.blp"
set SQ[20]="ReplaceableTextures\\CommandButtons\\BTNHeroWarden.tga"
set SQ[21]="ReplaceableTextures\\CommandButtons\\BTNTauren.blp"
set SQ[22]="ReplaceableTextures\\CommandButtons\\BTNDruidOfTheTalon.blp"
set SQ[23]="ReplaceableTextures\\CommandButtons\\BTNHeroDemonHunter.tga"
set SQ[24]="ReplaceableTextures\\CommandButtons\\BTNEredarRed.blp"
set SQ[25]="ReplaceableTextures\\CommandButtons\\BTNMilitia.tga"
set SQ[26]="ReplaceableTextures\\CommandButtons\\BTNChaosWarlockGreen.tga"
set SQ[27]="ReplaceableTextures\\CommandButtons\\BTNHeroPaladin.blp"
set SQ[28]="ReplaceableTextures\\CommandButtons\\BTNHeroTinker.blp"
set SQ[29]="ReplaceableTextures\\CommandButtons\\BTNHeroMountainKing.blp"
set SQ[30]="ReplaceableTextures\\CommandButtons\\BTNRedDemon.blp"
set SQ[31]="ReplaceableTextures\\CommandButtons\\BTNLichVersion2.blp"
set SQ[32]="ReplaceableTextures\\CommandButtons\\BTNnagaWow1.blp"
set SQ[33]="ReplaceableTextures\\CommandButtons\\BTNWraith2.blp"
set SQ[34]="ReplaceableTextures\\CommandButtons\\BTNBansheeRanger.blp"
set SQ[35]="ReplaceableTextures\\CommandButtons\\BTNSylvanusWindrunner.blp"
set SQ[36]="ReplaceableTextures\\CommandButtons\\BTNTier1.blp"
set SQ[37]="ReplaceableTextures\\CommandButtons\\BTNbonecrusherGS.blp"
set SQ[38]="ReplaceableTextures\\CommandButtons\\BTNicons_4202_btn.blp"
set SQ[39]="ReplaceableTextures\\CommandButtons\\BTNicons_4953_btn.blp"
set SQ[40]="ReplaceableTextures\\CommandButtons\\BTNAetherConstructIcon.blp"
set SQ[41]="ReplaceableTextures\\CommandButtons\\BTNDragonKnight.blp"
set SQ[42]="ReplaceableTextures\\CommandButtons\\BTNBanshee.blp"
set SQ[43]="ReplaceableTextures\\CommandButtons\\BTNPitLord.blp"
set SQ[44]="ReplaceableTextures\\CommandButtons\\BTNvashjnew.blp"
set SQ[45]="ReplaceableTextures\\CommandButtons\\BTNHeroDullahanOmega.blp"
set SQ[46]="ReplaceableTextures\\CommandButtons\\BTN_CW_MagmaLord.blp"
set SQ[47]="ReplaceableTextures\\CommandButtons\\BTNratling.blp"
set SQ[48]="ReplaceableTextures\\CommandButtons\\BTNjezzail.blp"
set SQ[49]="ReplaceableTextures\\CommandButtons\\BTNclanicon.blp"
set SQ[50]="ReplaceableTextures\\CommandButtons\\BTNNzothIcon.blp"
set SQ[51]="ReplaceableTextures\\CommandButtons\\BTNT90SM.blp"
set SQ[52]="ReplaceableTextures\\CommandButtons\\BTNChomosuke.blp"
set SQ[53]="ReplaceableTextures\\CommandButtons\\BTNgreenarmysniper.blp"
set SQ[54]="ReplaceableTextures\\CommandButtons\\BTNTyrael.blp"
set SQ[55]="ReplaceableTextures\\CommandButtons\\BTNUntitledmecha.blp"
set SQ[56]="ReplaceableTextures\\CommandButtons\\BTNspartan.blp"
set SQ[57]="ReplaceableTextures\\CommandButtons\\BTNLordOfDarknessPurple1.blp"
set SQ[58]="ReplaceableTextures\\CommandButtons\\BTNVeraHero.blp"
set SQ[59]="ReplaceableTextures\\CommandButtons\\BTNachievement_boss_heraldofnzoth.blp"
set SQ[60]="ReplaceableTextures\\CommandButtons\\BTNRedDemon.blp"
set TQ=60
set WQ="Enfo FFB"
set YQ="West Side"
set ZQ="East Side"
call DestroyTrigger(R1)
endfunction
function MNX takes nothing returns nothing
if GetPlayerName(GetEnumPlayer()) == "Strikest#1504" or GetPlayerName(GetEnumPlayer()) == "Coffee#0217" or GetPlayerName(GetEnumPlayer()) == "tyreal#11180" or GetPlayerName(GetEnumPlayer()) == "Waffle(est)" or GetPlayerName(GetEnumPlayer()) == "Mike#22559" or GetPlayerName(GetEnumPlayer()) == "kicka55#21791" or GetPlayerName(GetEnumPlayer()) == "MokT#1639" or GetPlayerName(GetEnumPlayer()) == "Fabs#1762" or GetPlayerName(GetEnumPlayer()) == "dkang#1347" or GetPlayerName(GetEnumPlayer()) == "Vision#2578" or GetPlayerName(GetEnumPlayer()) == "SpeedMachine#11873" or GetPlayerName(GetEnumPlayer()) == "useless#1203" or GetPlayerName(GetEnumPlayer()) == "KindInMind#2657" or GetPlayerName(GetEnumPlayer()) == "DrunkPenguin#21498" or GetPlayerName(GetEnumPlayer()) == "Rat#21173" or GetPlayerName(GetEnumPlayer()) == "Fumandra#2247" or GetPlayerName(GetEnumPlayer()) == "UraharaNZ#1467" or GetPlayerName(GetEnumPlayer()) == "Loona#1398" or GetPlayerName(GetEnumPlayer()) == "DrunkCat#1765" or GetPlayerName(GetEnumPlayer()) == "Issei#2618" then
if GetPlayerName(GetEnumPlayer()) == "Coffee#0217" then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFFFF0303C|r|cFFFF1603o|r|cFFFF2903f|r|cFFFF3C03f|r|cFFFF5002e|r|cFFFF6302e|r|cFFFF7602_|r|cFFFF8902C|r|cFFFF9C02u|r|cFFFFAF02l|r|cFFFFC301t|r|cFFFFD601u|r|cFFFFE901r|r|cFFFFFC01e|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFFFF0303C|r|cFFFF1603o|r|cFFFF2903f|r|cFFFF3C03f|r|cFFFF5002e|r|cFFFF6302e|r|cFFFF7602_|r|cFFFF8902C|r|cFFFF9C02u|r|cFFFFAF02l|r|cFFFFC301t|r|cFFFFD601u|r|cFFFFE901r|r|cFFFFFC01e|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Fabs#1762"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c000041A4F|r|c005580C2a|r|c00AAC0E1b|r|c00FFFFFFs|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c000041A4F|r|c005580C2a|r|c00AAC0E1b|r|c00FFFFFFs|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Fumandra#2247"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00F2AED8F|r|c00F49ED3u|r|c00F68FCFm|r|c00F87FCAa|r|c00F970C5n|r|c00FB60C0d|r|c00FD51BCr|r|c00FF41B7a|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00F2AED8F|r|c00F49ED3u|r|c00F68FCFm|r|c00F87FCAa|r|c00F970C5n|r|c00FB60C0d|r|c00FD51BCr|r|c00FF41B7a|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Rat#21173"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
if GetPlayerName(GetEnumPlayer()) == "DrunkCat#1765"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Loona#1398"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c02015DFFL|r|c01804A9Bo|r|c00FF3737o|r|c31FF2C71n|r|c62FF21ABa|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c02015DFFL|r|c01804A9Bo|r|c00FF3737o|r|c31FF2C71n|r|c62FF21ABa|r")
endif
if GetPlayerName(GetEnumPlayer()) == "UraharaNZ#1467"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0001FF90U|r|c000AF99Dr|r|c0013F3AAa|r|c001BEDB7h|r|c0024E6C4a|r|c002DE0D0r|r|c0036DADDa|r|c003ED4EAN|r|c0047CEF7Z|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0001FF90U|r|c000AF99Dr|r|c0013F3AAa|r|c001BEDB7h|r|c0024E6C4a|r|c002DE0D0r|r|c0036DADDa|r|c003ED4EAN|r|c0047CEF7Z|r")
endif
if GetPlayerName(GetEnumPlayer()) == "KindInMind#2657"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0007EAFFK|r|c0023ECFFi|r|c003EEFFFn|r|c005AF1FFd|r|c0075F3FFI|r|c0091F6FFn|r|c00ACF8FFM|r|c00C8FAFFi|r|c00E3FDFFn|r|c00FFFFFFd|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0007EAFFK|r|c0023ECFFi|r|c003EEFFFn|r|c005AF1FFd|r|c0075F3FFI|r|c0091F6FFn|r|c00ACF8FFM|r|c00C8FAFFi|r|c00E3FDFFn|r|c00FFFFFFd|r")
endif
if GetPlayerName(GetEnumPlayer()) == "DrunkPenguin#21498"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c002DFF01D|r|c002AFD18r|r|c0026FB2Fu|r|c0023F946n|r|c001FF75Dk|r|c001CF574P|r|c0018F48Ce|r|c0015F2A3n|r|c0011F0BAg|r|c000EEED1u|r|c000AECE8i|r|c0007EAFFn|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c002DFF01D|r|c002AFD18r|r|c0026FB2Fu|r|c0023F946n|r|c001FF75Dk|r|c001CF574P|r|c0018F48Ce|r|c0015F2A3n|r|c0011F0BAg|r|c000EEED1u|r|c000AECE8i|r|c0007EAFFn|r")
endif
if GetPlayerName(GetEnumPlayer()) == "tyreal#11180"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF20C000t|r|cFF44DA05y|r|cFF68F40Are|r|cFF44DA05a|r|cFF20C0001|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF20C000t|r|cFF44DA05y|r|cFF68F40Are|r|cFF44DA05a|r|cFF20C0001|r")
endif
if GetPlayerName(GetEnumPlayer()) == "MokT#1639"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FF0101D|r|c00EA0116a|r|c00D4012Br|r|c00BF0041A|r|c00AA0056i|r|c0094006Be|r|c007F0080l|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FF0101D|r|c00EA0116a|r|c00D4012Br|r|c00BF0041A|r|c00AA0056i|r|c0094006Be|r|c007F0080l|r")
endif
if GetPlayerName(GetEnumPlayer()) == "useless#1203"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00800000U|r|c00550000s|r|c002B0000e|r|c00000000l|r|c00320000e|r|c00640000s|r|c00960000s|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00800000U|r|c00550000s|r|c002B0000e|r|c00000000l|r|c00320000e|r|c00640000s|r|c00960000s|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Vision#2578"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00EC88C6V|r|c00BBA5FBi|r|c00C0B8FCs|r|c00C5CAFDi|r|c00CADDFEo|r|c00CFEFFFn|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00EC88C6V|r|c00BBA5FBi|r|c00C0B8FCs|r|c00C5CAFDi|r|c00CADDFEo|r|c00CFEFFFn|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Waffle(est)"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF214BF6W|r|cFF1C6AF6a|r|cFF1788F7f|r|cFF12A7F7f|r|cFF0DC5F8l|r|cFF08E4F8e|r|cFF0DC5F8(|r|cFF12A7F7e|r|cFF1788F7s|r|cFF1C6AF6t|r|cFF214BF6)|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF214BF6W|r|cFF1C6AF6a|r|cFF1788F7f|r|cFF12A7F7f|r|cFF0DC5F8l|r|cFF08E4F8e|r|cFF0DC5F8(|r|cFF12A7F7e|r|cFF1788F7s|r|cFF1C6AF6t|r|cFF214BF6)|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Mike#22559"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c006f0000C|r|c007e0034a|r|c008d0068l|r|c00800080uh|r|c00ab5556a|r|c00d5aa2bl|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c006f0000C|r|c007e0034a|r|c008d0068l|r|c00800080uh|r|c00ab5556a|r|c00d5aa2bl|r")
endif
if GetPlayerName(GetEnumPlayer()) == "kicka55#21791"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0000ff00k|r|c0025ff00i|r|c0049ff00c|r|c006eff00k|r|c0092ff00a|r|c00b7ff005|r|c00dbff005|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c0000ff00k|r|c0025ff00i|r|c0049ff00c|r|c006eff00k|r|c0092ff00a|r|c00b7ff005|r|c00dbff005|r")
endif
if GetPlayerName(GetEnumPlayer()) == "dkang#1347"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00ff9900D|r|c00c0a640a|r|c0080b380n|r|c0040c0c0k|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00ff9900D|r|c00c0a640a|r|c0080b380n|r|c0040c0c0k|r")
endif
if GetPlayerName(GetEnumPlayer()) == "SpeedMachine#11873"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FF0101S|r|c00FF1E04p|r|c00FF3A07e|r|c00FF5709e|r|c00FF730Ce|r|c00FF900Fe|r|c00EAB007e|r|c00D6D000e|r|c006B6800e|r|c00000000d|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FF0101S|r|c00FF1E04p|r|c00FF3A07e|r|c00FF5709e|r|c00FF730Ce|r|c00FF900Fe|r|c00EAB007e|r|c00D6D000e|r|c006B6800e|r|c00000000d|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Issei#2618"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FEFF7BI|r|c00FFF183s|r|c01FFF8B3s|r|c6DFFF80Fe|r|c00FFEE63i|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|c00FEFF7BI|r|c00FFF183s|r|c01FFF8B3s|r|c6DFFF80Fe|r|c00FFEE63i|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Strikest#1504" then
if GetRandomInt(0,100) >= 50 then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF08B7F2S|r|cFF2B9DF3t|r|cFF4D83F3r|r|cFF7069F4i|r|cFF934EF5k|r|cFFB634F6e|r|cFFD81AF6s|r|cFFFB00F7t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF08B7F2S|r|cFF2B9DF3t|r|cFF4D83F3r|r|cFF7069F4i|r|cFF934EF5k|r|cFFB634F6e|r|cFFD81AF6s|r|cFFFB00F7t|r")
else
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF540081S|r|cFF6B0082t|r|cFF830082r|r|cFF9A0083i|r|cFFB20183k|r|cFFC90184e|r|cFFE10184s|r|cFFF80185t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),"|cFF540081S|r|cFF6B0082t|r|cFF830082r|r|cFF9A0083i|r|cFFB20183k|r|cFFC90184e|r|cFFE10184s|r|cFFF80185t|r")
endif
endif
else
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),(BS[(1+GetPlayerId(GetEnumPlayer()))]+(GetPlayerName(GetEnumPlayer())+"|r")))
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[1])+2),(BS[(1+GetPlayerId(GetEnumPlayer()))]+(GetPlayerName(GetEnumPlayer())+"|r")))
endif
set WS[(1+GetPlayerId(GetEnumPlayer()))]=YS
set CT[(1+GetPlayerId(GetEnumPlayer()))]=(YS+2)
set YS=(YS+1)
endfunction
function MBX takes nothing returns nothing
if GetPlayerName(GetEnumPlayer()) != "Strikest#1504" and GetPlayerName(GetEnumPlayer()) != "Coffee#0217" and GetPlayerName(GetEnumPlayer()) != "tyreal#11180" and GetPlayerName(GetEnumPlayer()) != "Waffle(est)" and GetPlayerName(GetEnumPlayer()) != "Mike#22559" and GetPlayerName(GetEnumPlayer()) != "kicka55#21791" and GetPlayerName(GetEnumPlayer()) != "MokT#1639" and GetPlayerName(GetEnumPlayer()) != "Fabs#1762" and GetPlayerName(GetEnumPlayer()) != "dkang#1347" and GetPlayerName(GetEnumPlayer()) != "MokT#1639" and GetPlayerName(GetEnumPlayer()) != "Fabs#1762" and GetPlayerName(GetEnumPlayer()) != "Vision#2578" and GetPlayerName(GetEnumPlayer()) != "SpeedMachine#11873" and GetPlayerName(GetEnumPlayer()) != "useless#1203" and GetPlayerName(GetEnumPlayer()) != "KindInMind#2657" and GetPlayerName(GetEnumPlayer()) != "DrunkPenguin#21498" and GetPlayerName(GetEnumPlayer()) != "Rat#21173" and GetPlayerName(GetEnumPlayer()) != "Fumandra#2247" and GetPlayerName(GetEnumPlayer()) != "UraharaNZ#1467" and GetPlayerName(GetEnumPlayer()) != "Loona#1398" and GetPlayerName(GetEnumPlayer()) != "DrunkCat#1765" and GetPlayerName(GetEnumPlayer()) != "Issei#2618" then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),(BS[(1+GetPlayerId(GetEnumPlayer()))]+(GetPlayerName(GetEnumPlayer())+"|r")))
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),(BS[(1+GetPlayerId(GetEnumPlayer()))]+(GetPlayerName(GetEnumPlayer())+"|r")))
else
if GetPlayerName(GetEnumPlayer()) == "Coffee#0217" then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFFFF0303C|r|cFFFF1603o|r|cFFFF2903f|r|cFFFF3C03f|r|cFFFF5002e|r|cFFFF6302e|r|cFFFF7602_|r|cFFFF8902C|r|cFFFF9C02u|r|cFFFFAF02l|r|cFFFFC301t|r|cFFFFD601u|r|cFFFFE901r|r|cFFFFFC01e|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFFFF0303C|r|cFFFF1603o|r|cFFFF2903f|r|cFFFF3C03f|r|cFFFF5002e|r|cFFFF6302e|r|cFFFF7602_|r|cFFFF8902C|r|cFFFF9C02u|r|cFFFFAF02l|r|cFFFFC301t|r|cFFFFD601u|r|cFFFFE901r|r|cFFFFFC01e|r")
endif
if GetPlayerName(GetEnumPlayer()) == "tyreal#11180"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF20C000t|r|cFF44DA05y|r|cFF68F40Are|r|cFF44DA05a|r|cFF20C0001|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF20C000t|r|cFF44DA05y|r|cFF68F40Are|r|cFF44DA05a|r|cFF20C0001|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Issei#2618"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FEFF7BI|r|c00FFF183s|r|c01FFF8B3s|r|c6DFFF80Fe|r|c00FFEE63i|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FEFF7BI|r|c00FFF183s|r|c01FFF8B3s|r|c6DFFF80Fe|r|c00FFEE63i|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Rat#21173"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
if GetPlayerName(GetEnumPlayer()) == "DrunkCat#1765"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Loona#1398"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c02015DFFL|r|c01804A9Bo|r|c00FF3737o|r|c31FF2C71n|r|c62FF21ABa|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c02015DFFL|r|c01804A9Bo|r|c00FF3737o|r|c31FF2C71n|r|c62FF21ABa|r")
endif
if GetPlayerName(GetEnumPlayer()) == "UraharaNZ#1467"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0001FF90U|r|c000AF99Dr|r|c0013F3AAa|r|c001BEDB7h|r|c0024E6C4a|r|c002DE0D0r|r|c0036DADDa|r|c003ED4EAN|r|c0047CEF7Z|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0001FF90U|r|c000AF99Dr|r|c0013F3AAa|r|c001BEDB7h|r|c0024E6C4a|r|c002DE0D0r|r|c0036DADDa|r|c003ED4EAN|r|c0047CEF7Z|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Fumandra#2247"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00F2AED8F|r|c00F49ED3u|r|c00F68FCFm|r|c00F87FCAa|r|c00F970C5n|r|c00FB60C0d|r|c00FD51BCr|r|c00FF41B7a|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00F2AED8F|r|c00F49ED3u|r|c00F68FCFm|r|c00F87FCAa|r|c00F970C5n|r|c00FB60C0d|r|c00FD51BCr|r|c00FF41B7a|r")
endif
if GetPlayerName(GetEnumPlayer()) == "DrunkPenguin#21498"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c002DFF01D|r|c002AFD18r|r|c0026FB2Fu|r|c0023F946n|r|c001FF75Dk|r|c001CF574P|r|c0018F48Ce|r|c0015F2A3n|r|c0011F0BAg|r|c000EEED1u|r|c000AECE8i|r|c0007EAFFn|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c002DFF01D|r|c002AFD18r|r|c0026FB2Fu|r|c0023F946n|r|c001FF75Dk|r|c001CF574P|r|c0018F48Ce|r|c0015F2A3n|r|c0011F0BAg|r|c000EEED1u|r|c000AECE8i|r|c0007EAFFn|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Waffle(est)"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF214BF6W|r|cFF1C6AF6a|r|cFF1788F7f|r|cFF12A7F7f|r|cFF0DC5F8l|r|cFF08E4F8e|r|cFF0DC5F8(|r|cFF12A7F7e|r|cFF1788F7s|r|cFF1C6AF6t|r|cFF214BF6)|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF214BF6W|r|cFF1C6AF6a|r|cFF1788F7f|r|cFF12A7F7f|r|cFF0DC5F8l|r|cFF08E4F8e|r|cFF0DC5F8(|r|cFF12A7F7e|r|cFF1788F7s|r|cFF1C6AF6t|r|cFF214BF6)|r")
endif
if GetPlayerName(GetEnumPlayer()) == "KindInMind#2657"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0007EAFFK|r|c0023ECFFi|r|c003EEFFFn|r|c005AF1FFd|r|c0075F3FFI|r|c0091F6FFn|r|c00ACF8FFM|r|c00C8FAFFi|r|c00E3FDFFn|r|c00FFFFFFd|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0007EAFFK|r|c0023ECFFi|r|c003EEFFFn|r|c005AF1FFd|r|c0075F3FFI|r|c0091F6FFn|r|c00ACF8FFM|r|c00C8FAFFi|r|c00E3FDFFn|r|c00FFFFFFd|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Mike#22559"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c006f0000C|r|c007e0034a|r|c008d0068l|r|c00800080uh|r|c00ab5556a|r|c00d5aa2bl|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c006f0000C|r|c007e0034a|r|c008d0068l|r|c00800080uh|r|c00ab5556a|r|c00d5aa2bl|r")
endif
if GetPlayerName(GetEnumPlayer()) == "kicka55#21791"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0000ff00k|r|c0025ff00i|r|c0049ff00c|r|c006eff00k|r|c0092ff00a|r|c00b7ff005|r|c00dbff005|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c0000ff00k|r|c0025ff00i|r|c0049ff00c|r|c006eff00k|r|c0092ff00a|r|c00b7ff005|r|c00dbff005|r")
endif
if GetPlayerName(GetEnumPlayer()) == "useless#1203"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00800000U|r|c00550000s|r|c002B0000e|r|c00000000l|r|c00320000e|r|c00640000s|r|c00960000s|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00800000U|r|c00550000s|r|c002B0000e|r|c00000000l|r|c00320000e|r|c00640000s|r|c00960000s|r")
endif
if GetPlayerName(GetEnumPlayer()) == "MokT#1639"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FF0101D|r|c00EA0116a|r|c00D4012Br|r|c00BF0041A|r|c00AA0056i|r|c0094006Be|r|c007F0080l|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FF0101D|r|c00EA0116a|r|c00D4012Br|r|c00BF0041A|r|c00AA0056i|r|c0094006Be|r|c007F0080l|r")
endif
if GetPlayerName(GetEnumPlayer()) == "dkang#1347"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00ff9900D|r|c00c0a640a|r|c0080b380n|r|c0040c0c0k|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00ff9900D|r|c00c0a640a|r|c0080b380n|r|c0040c0c0k|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Vision#2578"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00EC88C6V|r|c00BBA5FBi|r|c00C0B8FCs|r|c00C5CAFDi|r|c00CADDFEo|r|c00CFEFFFn|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00EC88C6V|r|c00BBA5FBi|r|c00C0B8FCs|r|c00C5CAFDi|r|c00CADDFEo|r|c00CFEFFFn|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Fabs#1762"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c000041A4F|r|c005580C2a|r|c00AAC0E1b|r|c00FFFFFFs|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c000041A4F|r|c005580C2a|r|c00AAC0E1b|r|c00FFFFFFs|r")
endif
if GetPlayerName(GetEnumPlayer()) == "SpeedMachine#11873"then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FF0101S|r|c00FF1E04p|r|c00FF3A07e|r|c00FF5709e|r|c00FF730Ce|r|c00FF900Fe|r|c00EAB007e|r|c00D6D000e|r|c006B6800e|r|c00000000d|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|c00FF0101S|r|c00FF1E04p|r|c00FF3A07e|r|c00FF5709e|r|c00FF730Ce|r|c00FF900Fe|r|c00EAB007e|r|c00D6D000e|r|c006B6800e|r|c00000000d|r")
endif
if GetPlayerName(GetEnumPlayer()) == "Strikest#1504" then
if GetRandomInt(0,100) >= 50 then
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF08B7F2S|r|cFF2B9DF3t|r|cFF4D83F3r|r|cFF7069F4i|r|cFF934EF5k|r|cFFB634F6e|r|cFFD81AF6s|r|cFFFB00F7t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF08B7F2S|r|cFF2B9DF3t|r|cFF4D83F3r|r|cFF7069F4i|r|cFF934EF5k|r|cFFB634F6e|r|cFFD81AF6s|r|cFFFB00F7t|r")
else
call MultiboardSetItemValueBJ(AS[1],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF540081S|r|cFF6B0082t|r|cFF830082r|r|cFF9A0083i|r|cFFB20183k|r|cFFC90184e|r|cFFE10184s|r|cFFF80185t|r")
call MultiboardSetItemValueBJ(AS[2],1,(LeaderboardGetPlayerIndexBJ(GetEnumPlayer(),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),"|cFF540081S|r|cFF6B0082t|r|cFF830082r|r|cFF9A0083i|r|cFFB20183k|r|cFFC90184e|r|cFFE10184s|r|cFFF80185t|r")
endif
endif
endif
set WS[(1+GetPlayerId(GetEnumPlayer()))]=YS
set CT[(1+GetPlayerId(GetEnumPlayer()))]=(YS+2)
set YS=(YS+1)
endfunction
function MCX takes nothing returns nothing
call TriggerRegisterPlayerEventLeave(N1,GetEnumPlayer())
endfunction
function MDX takes nothing returns nothing
set VS[1]=C4E(Condition(function MVX))
set VS[2]=C4E(Condition(function MEX))
set ES=C4E(Condition(function MXX))
set XS[1]="|cffff0303"
set XS[2]="|cff999999"
set OS=10
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=OS
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set RS=(RS+"l")
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CreateLeaderboardBJ(VS[1],"T1 LEADERBOARD")
call LeaderboardDisplayBJ(false,bj_lastCreatedLeaderboard)
set NS[1]=bj_lastCreatedLeaderboard
call CreateLeaderboardBJ(VS[2],"T2 LEADERBOARD")
call LeaderboardDisplayBJ(false,bj_lastCreatedLeaderboard)
set NS[2]=bj_lastCreatedLeaderboard
call ForForce(VS[1],function MOX)
call ForForce(VS[2],function MRX)
//call CreateMultiboardBJ(4,(CountPlayersInForceBJ(ES)+6),(WQ+(" [ "+((BS[1]+("0|r : "+(BS[7]+"00|r")))+("]"+("- "+RT))))))
call CreateMultiboardBJ(4,(CountPlayersInForceBJ(ES)+4),(WQ+(" [ "+((BS[1]+("0|r : "+(BS[7]+"00|r")))+("]"+("- "+RT))))))
call MultiboardDisplay(bj_lastCreatedMultiboard,false)
set AS[1]=bj_lastCreatedMultiboard
//call CreateMultiboardBJ(4,(CountPlayersInForceBJ(ES)+6),(WQ+(" [ "+((BS[1]+("0|r : "+(BS[7]+"00|r")))+("]"+("- "+RT))))))
call CreateMultiboardBJ(4,(CountPlayersInForceBJ(ES)+4),(WQ+(" [ "+((BS[1]+("0|r : "+(BS[7]+"00|r")))+("]"+("- "+RT))))))
call MultiboardDisplay(bj_lastCreatedMultiboard,false)
set AS[2]=bj_lastCreatedMultiboard
call MultiboardSetItemStyleBJ(AS[1],0,0,true,false)
call MultiboardSetItemStyleBJ(AS[2],0,0,true,false)
call MultiboardSetItemWidthBJ(AS[1],0,0,9.)
call MultiboardSetItemWidthBJ(AS[2],0,0,9.)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemColorBJ(AS[bj_forLoopAIndex],2,0,80.,80.,80.,0)
call MultiboardSetItemColorBJ(AS[bj_forLoopAIndex],3,0,80.,25.,15.,0)
call MultiboardSetItemColorBJ(AS[bj_forLoopAIndex],4,0,10.,55.,10.,0)
call MultiboardSetItemColorBJ(AS[bj_forLoopAIndex],0,2,100,70.,70.,0)
call MultiboardSetItemColorBJ(AS[bj_forLoopAIndex],0,(CountPlayersInForceBJ(VS[1])+4),70.,70.,100.,0)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call MultiboardSetItemValueBJ(AS[1],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[1],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if not LWMON then
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],2,1,(BS[9]+"L|r"))
else
//call MultiboardSetItemWidthBJ(AS[bj_forLoopAIndex], 2, 1, 12. )
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],2,1,(BS[9]+"$$$|r"))
endif
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],3,1,(BS[15]+"Kills|r"))
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],4,1,(BS[15]+"D|r"))
//call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],1,(CountPlayersInForceBJ(ES)+6),PQ)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call ForForce(VS[1],function MNX)
set YS=(YS+2)
call ForForce(VS[2],function MBX)
set bj_forLoopBIndex=2
set bj_forLoopBIndexEnd=4
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemWidthBJ(AS[1],bj_forLoopBIndex,0,2)
call MultiboardSetItemWidthBJ(AS[2],bj_forLoopBIndex,0,2)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call MultiboardSetItemWidthBJ(AS[1],3,0,3)
call MultiboardSetItemWidthBJ(AS[2],3,0,3)
//call MultiboardSetItemValueBJ(AS[1],2,(CountPlayersInForceBJ(ES)+6),"0%")
//call MultiboardSetItemValueBJ(AS[2],2,(CountPlayersInForceBJ(ES)+6),"0%")
set bj_forLoopBIndex=2
set bj_forLoopBIndexEnd=(2+CountPlayersInForceBJ(VS[1]))
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemValueBJ(AS[1],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],4,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],4,bj_forLoopBIndex,"0")
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopBIndex=(CountPlayersInForceBJ(VS[1])+4)
set bj_forLoopBIndexEnd=(CountPlayersInForceBJ(ES)+4)
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemValueBJ(AS[1],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],4,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],4,bj_forLoopBIndex,"0")
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=4
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GetLocalPlayer()==Player(bj_forLoopAIndex))then
call MultiboardDisplay(AS[1],true)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=5
set bj_forLoopAIndexEnd=8
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GetLocalPlayer()==Player(bj_forLoopAIndex))then
call MultiboardDisplay(AS[2],true)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call ForForce(ES,function MCX)
call EnableTrigger(A1)
call EnableTrigger(N1)
call EnableTrigger(B1)
call DestroyTrigger(I1)
call MultiboardDisplay(AS[1],true)
endfunction
function MGX takes nothing returns boolean
return(DS)
endfunction
function MHX takes nothing returns boolean
return(CS==60)
endfunction
function MJX takes nothing returns boolean
return(CS>=10)
endfunction
function MKX takes nothing returns boolean
return(GetUnitTypeId(MQ[(1+GetPlayerId(GetEnumPlayer()))])==QQ[bj_forLoopAIndex])
endfunction
function MLX takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=TQ
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(MKX())then
set IS[(1+GetPlayerId(GetEnumPlayer()))]=bj_forLoopAIndex
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function MMX takes nothing returns nothing
if(MGX())then
set CS=(CS+1)
endif
if(MHX())then
set CS=0
set FS=(FS+1)
endif
if(MJX())then
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetTitleText(AS[bj_forLoopAIndex],(WQ+(" ["+((BS[14]+((I2S(FS)+"|r : ")+(BS[14]+((I2S(CS)+"|r")+("] - "+RT)))))+""))))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
else
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetTitleText(AS[bj_forLoopAIndex],(WQ+(" ["+((BS[14]+((I2S(FS)+"|r : ")+(BS[14]+((I2S(CS)+"|r")+("] - "+RT)))))+""))))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call ForForce(ES,function MLX)
endfunction
function MQX takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=4
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemColorBJ(AS[1],bj_forLoopAIndex,CT[(1+GetPlayerId(GetTriggerPlayer()))],20.,20.,20,0)
call MultiboardSetItemColorBJ(AS[2],bj_forLoopAIndex,CT[(1+GetPlayerId(GetTriggerPlayer()))],20.,20.,20,0)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call MultiboardSetItemValueBJ(AS[1],1,CT[(1+GetPlayerId(GetTriggerPlayer()))],(("|cff333333"+GetPlayerName(GetTriggerPlayer()))+"|r"))
call MultiboardSetItemValueBJ(AS[2],1,CT[(1+GetPlayerId(GetTriggerPlayer()))],(("|cff333333"+GetPlayerName(GetTriggerPlayer()))+"|r"))
endfunction
function MTX takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))!=null
endfunction
function MUX takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(0)))
endfunction
function MWX takes nothing returns nothing
if not LWMON then
if(MUX())then
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],2,(LeaderboardGetPlayerIndexBJ(GetOwningPlayer(GetTriggerUnit()),NS[1])+2),I2S(GetHeroLevel(GetTriggerUnit())))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
else
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],2,(LeaderboardGetPlayerIndexBJ(GetOwningPlayer(GetTriggerUnit()),NS[2])+(CountPlayersInForceBJ(VS[1])+4)),I2S(GetHeroLevel(GetTriggerUnit())))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endif
endfunction
function MZX takes nothing returns boolean
return((IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))and((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<=10))!=null
endfunction
function M_X takes nothing returns boolean
return(MZX())
endfunction
function M0X takes nothing returns boolean
return((1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))<=5)
endfunction
function M1X takes nothing returns nothing
if(M0X())then
set HT[1]=(HT[1]+1)
else
set HT[2]=(HT[2]+1)
endif
set BT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(BT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+1)
call MultiboardSetItemValueBJ(AS[1],4,CT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],I2S(BT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))
call MultiboardSetItemValueBJ(AS[2],4,CT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],I2S(BT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],4,2,I2S(HT[1]))
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],4,(CountPlayersInForceBJ(VS[1])+4),I2S(HT[2]))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function M3X takes nothing returns boolean
return((GetOwningPlayer(GetTriggerUnit())==Player(10))or(GetOwningPlayer(GetTriggerUnit())==Player(11))) and GetPlayerController(GetOwningPlayer(GetKillingUnit()))==MAP_CONTROL_USER and GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetKillingUnit()) and GetKillingUnit() != null
endfunction
function M4X takes nothing returns boolean
return(M3X())
endfunction
function M5X takes nothing returns boolean
return((1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))<=5)
endfunction
function M6X takes nothing returns boolean
return((1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))<=10)
endfunction
function M7X takes nothing returns nothing
if(M6X())then
if(M5X())then
set GT[1]=(GT[1]+1)
else
set GT[2]=(GT[2]+1)
endif
set FT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]=(FT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]+1)
call MultiboardSetItemValueBJ(AS[1],3,CT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))],I2S(FT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))
call MultiboardSetItemValueBJ(AS[2],3,CT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))],I2S(FT[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],3,2,I2S(GT[1]))
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],3,(CountPlayersInForceBJ(VS[1])+4),I2S(GT[2]))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction
function M9X takes nothing returns boolean
return(SubStringBJ(GetEventPlayerChatString(),10,11)==I2S((1+GetPlayerId(GetTriggerPlayer()))))
endfunction
function PVX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function PEX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function PXX takes nothing returns boolean
return(WT[(1+GetPlayerId(GetTriggerPlayer()))]==false)
endfunction
function POX takes nothing returns nothing
if(PXX())then
set WT[(1+GetPlayerId(GetTriggerPlayer()))]=true
call DisplayTimedTextToForce(C4E(Condition(function PEX)),10.,"|cffffcc00You have been promoted to pick advanced heroes.|r")
else
call DisplayTimedTextToForce(C4E(Condition(function PVX)),10.,"|cffffcc00You already are promoted.|r")
endif
endfunction
function PIX takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function PAX takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function PNX takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function PBX takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function PCX takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("West Side: "+I2S(CountUnitsInGroup(CUE(Player(11),Condition(function PIX))))))
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("West 2: "+I2S(CountUnitsInGroup(CUE(Player(11),Condition(function PAX))))))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("East Side: "+I2S(CountUnitsInGroup(CUE(Player(10),Condition(function PNX))))))
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("East 2: "+I2S(CountUnitsInGroup(CUE(Player(9),Condition(function PBX))))))
endfunction
function PFX takes nothing returns boolean
return(IsUnitAliveBJ(LC[(1+GetPlayerId(GetTriggerPlayer()))]))and(OD[(1+GetPlayerId(GetTriggerPlayer()))]==false)and(JT[(1+GetPlayerId(GetTriggerPlayer()))]==false)
endfunction
function PGX takes nothing returns boolean
return(VL[(1+GetPlayerId(GetTriggerPlayer()))]!=null)
endfunction
function PHX takes nothing returns boolean
return(PL[(1+GetPlayerId(GetTriggerPlayer()))]!=null)
endfunction
function PJX takes nothing returns nothing
call RemoveUnit(LC[(1+GetPlayerId(GetTriggerPlayer()))])
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=null
set MT[(1+GetPlayerId(GetTriggerPlayer()))]=0
set LC[(1+GetPlayerId(GetTriggerPlayer()))]=null
call CreateNUnitsAtLoc(1,'ushd',GetTriggerPlayer(),GetPlayerStartLocationLoc(GetTriggerPlayer()),bj_UNIT_FACING)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),GetPlayerStartLocationLoc(GetTriggerPlayer()),.3)
if(PGX())then
call KillUnit(VL[(1+GetPlayerId(GetTriggerPlayer()))])
set VL[(1+GetPlayerId(GetTriggerPlayer()))]=null
endif
if(PHX())then
call KillUnit(PL[(1+GetPlayerId(GetTriggerPlayer()))])
set PL[(1+GetPlayerId(GetTriggerPlayer()))]=null
endif
endfunction
function PLX takes nothing returns boolean
return(SubStringBJ(GetEventPlayerChatString(),1,5)=="-zoom")
endfunction
function PMX takes nothing returns boolean
return(SubStringBJ(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString()))=="")
endfunction
function PPX takes nothing returns boolean
return(WD>=3000.)
endfunction
function PQX takes nothing returns boolean
return(WD<=500.)
endfunction
function PSX takes nothing returns nothing
if(PMX())then
return
endif
set WD=S2R(SubStringBJ(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString())))
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,WD,.2)
if(PPX())then
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,3000.,.2)
set WD=3000.
endif
if(PQX())then
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,500.,.2)
set WD=500.
endif
endfunction
function PUX takes nothing returns boolean
return(not(SubStringBJ(GetEventPlayerChatString(),5,StringLength(GetEventPlayerChatString()))=="" or GetUnitTypeId(LC[(1+GetPlayerId(GetTriggerPlayer()))])!='E011'))
endfunction
function PWX takes nothing returns nothing
local real r=S2R(SubStringBJ(GetEventPlayerChatString(),5,StringLength(GetEventPlayerChatString())))
local real PYX=(I2R(GetUnitAbilityLevel(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A02E'))*100.)+500.
if r<=300. then
set r=300.
endif
if r>=PYX then
set r=PYX
endif
set CQ[(1+GetPlayerId(GetTriggerPlayer()))]=r
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"Targeting range of Targeted Magic set to "+I2S(R2I(r)))
endfunction
function P_X takes nothing returns boolean
return(SubStringBJ(GetEventPlayerChatString(),8,StringLength(GetEventPlayerChatString()))=="")
endfunction
function P0X takes nothing returns nothing
call SetUnitAcquireRange(GetEnumUnit(),YD)
endfunction
function P1X takes nothing returns nothing
call SetUnitAcquireRange(GetEnumUnit(),60.)
endfunction
function P2X takes nothing returns boolean
return(YD<=60.)
endfunction
function P3X takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function P4X takes nothing returns nothing
if(P_X())then
return
endif
set YD=S2R(SubStringBJ(GetEventPlayerChatString(),8,StringLength(GetEventPlayerChatString())))
set BK=CYE(GetTriggerPlayer())
call ForGroupBJ(BK,function P0X)
if(P2X())then
call ForGroupBJ(BK,function P1X)
set YD=60.
endif
call DisplayTextToForce(C4E(Condition(function P3X)),("Acquisition Range set to "+R2S(YD)))
call DestroyGroup(BK)
endfunction
function P6X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if UnitAlive(TDV[PXE])then
call KillUnit(TDV[PXE])
endif
call HVE(PXE)
call ReleaseTimer(GetExpiredTimer())
set t=null
endfunction
function P7X takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=G9E()
set TDV[PXE]=LC[(1+GetPlayerId(GetTriggerPlayer()))]
call SetTimerData(t,PXE)
call TimerStart(t,10.,false,function P6X)
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"Your hero will be killed in ten seconds.")
set t=null
endfunction
function P9X takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QVX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QEX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QXX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QOX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QRX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QIX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QAX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QNX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QBX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QCX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QDX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QFX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QGX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QHX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QJX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QKX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QLX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QMX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QPX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QQX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QSX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QTX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QUX takes nothing returns boolean
return(GetTriggerPlayer()==GetFilterPlayer())
endfunction
function QWX takes nothing returns nothing
call DisplayTimedTextToForce(C4E(Condition(function P9X)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QVX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QEX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QXX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QOX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QRX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QIX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QAX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QNX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QBX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QCX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QDX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QFX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QGX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QHX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QJX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QKX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QLX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QMX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QPX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QQX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QSX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QTX)),.01," ")
call DisplayTimedTextToForce(C4E(Condition(function QUX)),.01," ")
endfunction
function QZX takes nothing returns nothing
set DQ[1]='I009'
set FQ[1]='I008'
set HQ[1]='I007'
set GQ[1]='I000'
set DQ[2]='I00I'
set FQ[2]='I00H'
set HQ[2]='I00F'
set GQ[2]='I00W'
set DQ[3]='I00O'
set FQ[3]='I00O'
set HQ[3]='I00O'
set JQ[3]='I00O'
set GQ[3]='I012'
set DQ[4]='I00X'
set FQ[4]='I00Y'
set GQ[4]='I01L'
set DQ[5]='I00I'
set FQ[5]='I01M'
set GQ[5]='I01N'
set DQ[6]='I00S'
set FQ[6]='I002'
set HQ[6]='I00Q'
set JQ[6]='I00P'
set GQ[6]='I01Q'
set DQ[7]='I01Q'
set FQ[7]='I012'
set GQ[7]='I01R'
set DQ[8]='I007'
set FQ[8]='I007'
set HQ[8]='I007'
set GQ[8]='I01T'
set DQ[9]='I01T'
set FQ[9]='I000'
set GQ[9]='I01S'
set DQ[10]='I01S'
set FQ[10]='I024'
set GQ[10]='I01U'
set DQ[11]='I00Q'
set FQ[11]='I00Q'
set GQ[11]='I01V'
set DQ[12]='I01V'
set FQ[12]='I01V'
set GQ[12]='I01W'
set DQ[13]='I01L'
set FQ[13]='I012'
set GQ[13]='I01X'
set DQ[14]='I003'
set FQ[14]='I004'
set HQ[14]='I001'
set GQ[14]='I01Z'
set DQ[15]='I00M'
set FQ[15]='I00M'
set HQ[15]='I00M'
set JQ[15]='I00M'
set GQ[15]='I00Q'
set DQ[16]='I00N'
set FQ[16]='I00N'
set HQ[16]='I00N'
set JQ[16]='I00N'
set GQ[16]='I00P'
set DQ[17]='I00L'
set FQ[17]='I00L'
set HQ[17]='I00L'
set JQ[17]='I00L'
set GQ[17]='I002'
set DQ[18]='I00R'
set FQ[18]='I00R'
set HQ[18]='I00R'
set JQ[18]='I00R'
set GQ[18]='I00S'
set DQ[19]='I00E'
set FQ[19]='I01Y'
set GQ[19]='I020'
set DQ[20]='I00J'
set FQ[20]='I01Y'
set GQ[20]='I023'
set DQ[21]='I00F'
set FQ[21]='I028'
set GQ[21]='I027'
set DQ[22]='I00J'
set FQ[22]='I00N'
set HQ[22]='I00E'
set GQ[22]='I029'
set DQ[23]='I00H'
set FQ[23]='I002'
set HQ[23]='I00J'
set GQ[23]='I02A'
set DQ[24]='I00J'
set FQ[24]='I00Q'
set HQ[24]='I00J'
set GQ[24]='I02C'
set DQ[25]='I01S'
set FQ[25]='I00Q'
set GQ[25]='I02D'
set DQ[26]='I02D'
set FQ[26]='I02C'
set GQ[26]='I02E'
set DQ[27]='I02D'
set FQ[27]='I02D'
set GQ[27]='I02F'
set DQ[28]='I02E'
set FQ[28]='I00X'
set GQ[28]='I02G'
set DQ[29]='I005'
set FQ[29]='I009'
set HQ[29]='I02B'
set GQ[29]='I02H'
set DQ[30]='I00Z'
set FQ[30]='I02H'
set GQ[30]='I02I'
set DQ[31]='I01O'
set FQ[31]='I01O'
set HQ[31]='I00Z'
set JQ[31]='I010'
set KQ[31]='I010'
set GQ[31]='I02J'
set DQ[32]='I01Q'
set FQ[32]='I00Z'
set GQ[32]='I02K'
set DQ[33]='I01W'
set FQ[33]='I02L'
set HQ[33]='I00Q'
set GQ[33]='I02M'
set DQ[34]='I02M'
set FQ[34]='I00H'
set GQ[34]='I02N'
set DQ[35]='I02N'
set FQ[35]='I02N'
set HQ[35]='I02D'
set GQ[35]='I02O'
set DQ[36]='I002'
set FQ[36]='I002'
set HQ[36]='I002'
set JQ[36]='I00O'
set GQ[36]='I02S'
set DQ[37]='I01Z'
set FQ[37]='I002'
set GQ[37]='I02R'
set DQ[38]='I02R'
set FQ[38]='I02S'
set HQ[38]='I02S'
set JQ[38]='I010'
set KQ[38]='I010'
set GQ[38]='I02T'
set DQ[39]='I030'
set FQ[39]='I02T'
set HQ[39]='I00W'
set GQ[39]='I02V'
set DQ[40]='I00X'
set FQ[40]='I00X'
set HQ[40]='I02S'
set JQ[40]='I00W'
set GQ[40]='I02U'
set DQ[41]='I01N'
set FQ[41]='I01N'
set HQ[41]='I02A'
set JQ[41]='I052'
set GQ[41]='I02W'
set DQ[42]='I00D'
set HQ[42]='I051'
set JQ[42]='I00P'
set GQ[42]='I05V'
set DQ[43]='I02S'
set FQ[43]='I02T'
set HQ[43]='I012'
set GQ[43]='I02Z'
set DQ[44]='I02S'
set FQ[44]='I00I'
set HQ[44]='I00I'
set GQ[44]='I030'
set DQ[45]='I00R'
set FQ[45]='I029'
set HQ[45]='I027'
set GQ[45]='I032'
set DQ[46]='I02R'
set FQ[46]='I01Q'
set HQ[46]='I00X'
set GQ[46]='I036'
set DQ[47]='I051'
set FQ[47]='I00R'
set HQ[47]='I00S'
set JQ[47]='I051'
set GQ[47]='I037'
set DQ[48]='I002'
set FQ[48]='I02A'
set HQ[48]='I02A'
set GQ[48]='I038'
set DQ[49]='I002'
set FQ[49]='I03A'
set HQ[49]='I00L'
set GQ[49]='I039'
set DQ[50]='I039'
set FQ[50]='I039'
set HQ[50]='I012'
set GQ[50]='I03B'
set DQ[51]='I033'
set FQ[51]='I035'
set HQ[51]='I034'
set GQ[51]='I03C'
set DQ[52]='I02F'
set FQ[52]='I029'
set HQ[52]='I01Q'
set GQ[52]='I03D'
set DQ[53]='I00M'
set FQ[53]='I02D'
set HQ[53]='I02B'
set GQ[53]='I03E'
set DQ[54]='I00P'
set FQ[54]='I04N'
set HQ[54]='I052'
set GQ[54]='I03F'
set DQ[55]='I002'
set FQ[55]='I00D'
set HQ[55]='I00H'
set GQ[55]='I03V'
set DQ[56]='I027'
set FQ[56]='I023'
set HQ[56]='I00H'
set JQ[56]='I00Q'
set KQ[56]='I00P'
set GQ[56]='I040'
set DQ[57]='I01M'
set FQ[57]='I023'
set HQ[57]='I00X'
set GQ[57]='I041'
set DQ[58]='I027'
set FQ[58]='I00N'
set HQ[58]='I00E'
set GQ[58]='I045'
set DQ[59]='I036'
set FQ[59]='I02S'
set HQ[59]='I02S'
set GQ[59]='I048'
set DQ[60]='I039'
set FQ[60]='I039'
set HQ[60]='I039'
set JQ[60]='I039'
set GQ[60]='I049'
set DQ[61]='I041'
set FQ[61]='I00X'
set HQ[61]='I00X'
set GQ[61]='I04A'
set DQ[62]='I02F'
set FQ[62]='I01W'
set HQ[62]='I01W'
set GQ[62]='I04B'
set DQ[63]='I00X'
set FQ[63]='I04B'
set HQ[63]='I04B'
set JQ[63]='I02F'
set GQ[63]='I04C'
set DQ[64]='I04F'
set FQ[64]='I04F'
set HQ[64]='I04F'
set JQ[64]='I04F'
set GQ[64]='I04H'
set DQ[65]='I04B'
set FQ[65]='I01U'
set HQ[65]='I054'
set GQ[65]='I04I'
set DQ[66]='I04F'
set FQ[66]='I00N'
set HQ[66]='I00N'
set JQ[66]='I00N'
set GQ[66]='I04N'
set DQ[67]='I005'
set FQ[67]='I00L'
set HQ[67]='I00L'
set JQ[67]='I04H'
set GQ[67]='I04O'
set DQ[68]='I02S'
set FQ[68]='I01O'
set HQ[68]='I01O'
set JQ[68]='I04O'
set GQ[68]='I04P'
set DQ[69]='I00J'
set FQ[69]='I00M'
set HQ[69]='I00L'
set JQ[69]='I04F'
set GQ[69]='I04Q'
set DQ[70]='I02A'
set FQ[70]='I04Q'
set HQ[70]='I04Q'
set GQ[70]='I04R'
set DQ[71]='I020'
set FQ[71]='I051'
set HQ[71]='I04N'
set GQ[71]='I04T'
set DQ[72]='I02E'
set FQ[72]='I04Q'
set HQ[72]='I04Q'
set JQ[72]='I052'
set GQ[72]='I04U'
set DQ[73]='I02E'
set FQ[73]='I01M'
set HQ[73]='I04B'
set JQ[73]='I054'
set GQ[73]='I04V'
set DQ[74]='I038'
set FQ[74]='I052'
set HQ[74]='I04R'
set GQ[74]='I04W'
set DQ[75]='I03D'
set FQ[75]='I01Q'
set HQ[75]='I01Q'
set JQ[75]='I01Q'
set GQ[75]='I04Y'
set DQ[76]='I051'
set FQ[76]='I046'
set HQ[76]='I046'
set JQ[76]='I00D'
set KQ[76]='I054'
set GQ[76]='I053'
set DQ[77]='I046'
set FQ[77]='I046'
set HQ[77]='I052'
set JQ[77]='I052'
set GQ[77]='I05A'
set DQ[78]='I046'
set FQ[78]='I046'
set HQ[78]='I046'
set JQ[78]='I02T'
set KQ[78]='I047'
set GQ[78]='I05C'
set DQ[79]='I046'
set FQ[79]='I046'
set HQ[79]='I046'
set JQ[79]='I02T'
set KQ[79]='I02T'
set GQ[79]='I05E'
set DQ[80]='I02A'
set FQ[80]='I02A'
set HQ[80]='I041'
set GQ[80]='I05G'
set DQ[81]='I037'
set FQ[81]='I01Q'
set HQ[81]='I01Q'
set GQ[81]='I05I'
set DQ[82]='I04H'
set FQ[82]='I04H'
set HQ[82]='I010'
set GQ[82]='I05J'
set DQ[83]='I05J'
set FQ[83]='I02T'
set HQ[83]='I010'
set JQ[83]='I010'
set GQ[83]='I05M'
set DQ[84]='I051'
set FQ[84]='I00P'
set HQ[84]='I00S'
set GQ[84]='I05P'
set DQ[85]='I05P'
set FQ[85]='I046'
set HQ[85]='I01Q'
set JQ[85]='I01Q'
set KQ[85]='I052'
set GQ[85]='I05O'
set DQ[86]='I02G'
set FQ[86]='I00I'
set HQ[86]='I00I'
set JQ[86]='I00X'
set GQ[86]='I05R'
set DQ[87]='I04B'
set FQ[87]='I02F'
set HQ[87]='I052'
set GQ[87]='I05U'
set DQ[88]='I00X'
set FQ[88]='I00D'
set HQ[88]='I00D'
set JQ[88]='I00D'
set GQ[88]='I02Y'
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=88
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call WRE((DQ[bj_forLoopAIndex]),(FQ[bj_forLoopAIndex]),(HQ[bj_forLoopAIndex]),(JQ[bj_forLoopAIndex]),(KQ[bj_forLoopAIndex]),(LQ[bj_forLoopAIndex]),(GQ[bj_forLoopAIndex]),"","",false,0)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function SEX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if TTV[PXE]<=.0 then
call IssueImmediateOrderById(TJV[PXE],851972)
call SetUnitAnimation(TJV[PXE],"stand")
call DestroyEffect(TWV[PXE])
call G8E(PXE)
call ReleaseTimer(t)
else
if QTE(TKV[PXE],TLV[PXE],TQV[PXE],TSV[PXE])<80. then
set TMV[PXE]=((TKV[PXE])*1.)+((QTE(TKV[PXE],TLV[PXE],TQV[PXE],TSV[PXE])*1.)*Cos(((TUV[PXE])*1.)*bj_DEGTORAD))
set TPV[PXE]=((TLV[PXE])*1.)+((QTE(TKV[PXE],TLV[PXE],TQV[PXE],TSV[PXE])*1.)*Sin(((TUV[PXE])*1.)*bj_DEGTORAD))
call SetUnitX(TJV[PXE],TMV[PXE])
call SetUnitY(TJV[PXE],TPV[PXE])
call IssueImmediateOrderById(TJV[PXE],851972)
call SetUnitAnimation(TJV[PXE],"stand")
call DestroyEffect(TWV[PXE])
call G8E(PXE)
call ReleaseTimer(t)
else
set TMV[PXE]=(((TKV[PXE])*1.)+((80.)*1.)*Cos(((TUV[PXE])*1.)*bj_DEGTORAD))
set TPV[PXE]=(((TLV[PXE])*1.)+((80.)*1.)*Sin(((TUV[PXE])*1.)*bj_DEGTORAD))
call SetUnitX(TJV[PXE],TMV[PXE])
call SetUnitY(TJV[PXE],TPV[PXE])
set TKV[PXE]=GetUnitX(TJV[PXE])
set TLV[PXE]=GetUnitY(TJV[PXE])
set TTV[PXE]=TTV[PXE]-80.
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function SEX)
endif
endif
set t=null
endfunction
function SXX takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=G7E()
local real d
set TJV[PXE]=GetTriggerUnit()
set TKV[PXE]=GetUnitX(TJV[PXE])
set TLV[PXE]=GetUnitY(TJV[PXE])
set TMV[PXE]=MouseX[GetPlayerId(GetOwningPlayer(TJV[PXE]))]
set TPV[PXE]=MouseY[GetPlayerId(GetOwningPlayer(TJV[PXE]))]
set TQV[PXE]=MouseX[GetPlayerId(GetOwningPlayer(TJV[PXE]))]
set TSV[PXE]=MouseY[GetPlayerId(GetOwningPlayer(TJV[PXE]))]
set d = 800. + (100.*GetUnitAbilityLevel(TJV[PXE],'A0PA'))
set TTV[PXE]=QTE(TKV[PXE],TLV[PXE],TMV[PXE],TPV[PXE])
if TTV[PXE] > d then
set TTV[PXE] = d
endif
set TUV[PXE]=QUE(TKV[PXE],TLV[PXE],TMV[PXE],TPV[PXE])
call BlzSetUnitFacingEx(TJV[PXE],TUV[PXE])
set TWV[PXE]=AddSpecialEffectTarget("war3mapImported\\ShadowRibbon.mdx",TJV[PXE],"chest")
call SetUnitAnimation(TJV[PXE],"spell")
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function SEX)
set t=null
endfunction
/*function SOX takes nothing returns boolean
if GetSpellAbilityId()=='A0PA' then
call SXX()
endif
return false
endfunction*/
function SRX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call SetUnitVertexColor(T0V[PXE],255,255,255,255)
call SetHeroAgi(T0V[PXE],GetHeroAgi(T0V[PXE],false)-T1V[PXE],true)
call UnitRemoveAbility(T0V[PXE],'A09N')
call DestroyEffect(T2V[PXE])
call G6E(PXE)
call ReleaseTimer(t)
set t=null
endfunction
function SIX takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=G5E()
set T0V[PXE]=GetTriggerUnit()
set T1V[PXE]=GetHeroAgi(T0V[PXE],true)*GetUnitAbilityLevel(T0V[PXE],'A09K')
set T2V[PXE]=AddSpecialEffectTarget("war3mapImported\\void.mdx",T0V[PXE],"chest")
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"hand left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"hand right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"head"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"foot left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadeMissile.mdx",T0V[PXE],"foot right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadowCannon.mdx",T0V[PXE],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PeterifyVer.2.mdx",T0V[PXE],"chest"))
call SetHeroAgi(T0V[PXE],GetHeroAgi(T0V[PXE],false)+T1V[PXE],true)
call SetUnitVertexColor(T0V[PXE],50,50,50,100)
call UnitAddAbility(T0V[PXE],'A09N')
call SetTimerData(t,PXE)
call TimerStart(t,10.+(3*GetUnitAbilityLevel(T0V[PXE],'A09K')),false,function SRX)
set t=null
endfunction
function SAX takes nothing returns nothing
//if GetSpellAbilityId()=='A09K' and
if GetUnitAbilityLevel(GetTriggerUnit(),'A09N')!=1 then
call SIX()
endif
//return false
endfunction
/*function SNX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call UnitRemoveAbility(T6V[PXE],'A09D')
call DestroyEffect(T7V[PXE])
call ReleaseTimer(t)
call G4E(PXE)
set t=null
endfunction
function SBX takes nothing returns boolean
local unit u=GetTriggerUnit()
local unit RGX=GetEventDamageSource()
local real d=GetEventDamage()*2
local timer t
local integer PXE
if(J5V[(ROX((GetUnitTypeId(RGX))))])then
if(BI[NI])==(LN)then
set DI[NI]=DI[NI]+GetEventDamage()
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",u,"origin"))
call UnitAddAbility(u,'A09D')
set t=NewTimer()
set PXE=G3E()
set T6V[PXE]=u
set T7V[PXE]=AddSpecialEffectTarget("Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl",T6V[PXE],"chest")
call SetTimerData(t,PXE)
call TimerStart(t,10.,false,function SNX)
endif
else
set DI[NI]=DI[NI]+GetEventDamage()
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",u,"origin"))
call UnitAddAbility(u,'A09D')
set t=NewTimer()
set PXE=G3E()
set T6V[PXE]=u
set T7V[PXE]=AddSpecialEffectTarget("Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl",T6V[PXE],"chest")
call SetTimerData(t,PXE)
call TimerStart(t,10.,false,function SNX)
endif
set u=null
set RGX=null
set t=null
return false
endfunction*/
/*function SCX takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A09B')>0 and GetTriggerUnit()!=GetEventDamageSource()and GetRandomInt(1,100)<=40 and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<=GetEventDamage()and GetUnitAbilityLevel(GetTriggerUnit(),'A09D')!=1 and GetEventDamage() > 0 then
call SBX()
endif
return false
endfunction*/
/*function SDX takes nothing returns boolean
return(GetSpellAbilityId()=='A06I')
endfunction*/
function SFX takes nothing returns boolean
return(ZT==0)
endfunction
function SGX takes nothing returns boolean
return(GetSpellTargetUnit()==null)
endfunction
function SHX takes nothing returns nothing
if GetUnitTypeId(GetSpellTargetUnit()) != 'E00E' then
if(SFX())then
call EnableTrigger(W1)
endif
if(SGX())then
set VU=(VU+1)
set ZT=(ZT+1)
set EU[VU]=true
set XU[VU]=GetTriggerUnit()
call SetUnitPathing(XU[VU],false)
set OU[VU]=1200.
set RU[VU]=GetUnitFacing(XU[VU])
else
set VU=(VU+1)
set ZT=(ZT+1)
set EU[VU]=true
set XU[VU]=GetSpellTargetUnit()
call SetUnitPathing(XU[VU],false)
if IsUnitEnemy(GetSpellTargetUnit(),GetOwningPlayer(GetTriggerUnit())) and IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_HERO) then
set OU[VU]=425.
else
set OU[VU]=1200.
endif
set RU[VU]=GetUnitFacing(XU[VU])
endif
endif
endfunction
function SKX takes nothing returns boolean
return(OU[IU]<=.0)or(IsTerrainPathableBJ(NU,PATHING_TYPE_WALKABILITY))
endfunction
function SLX takes nothing returns boolean
return(ZT==0)
endfunction
function SMX takes nothing returns boolean
return(SKX())
endfunction
function SPX takes nothing returns boolean
return(EU[IU])
endfunction
function SQX takes nothing returns nothing
set IU=1
loop
exitwhen IU>VU
if(SPX())then
set AU=GetUnitLoc(XU[IU])
set NU=CNE(AU,20.,RU[IU])
if(SMX())then
call SetUnitPathing(XU[IU],true)
set EU[IU]=false
set ZT=(ZT-1)
if(SLX())then
set VU=0
call DisableTrigger(GetTriggeringTrigger())
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl",GetUnitX(XU[IU]),GetUnitY(XU[IU])))
call RemoveLocation(AU)
call RemoveLocation(NU)
else
call SetUnitX(XU[IU],GetLocationX(NU))
call SetUnitY(XU[IU],GetLocationY(NU))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl",GetUnitX(XU[IU]),GetUnitY(XU[IU])))
set OU[IU]=(OU[IU]-20.)
call RemoveLocation(AU)
call RemoveLocation(NU)
endif
endif
set IU=IU+1
endloop
endfunction
function STX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='E000')
endfunction
function SUX takes nothing returns nothing
call KillUnit(PL[(1+GetPlayerId(GetTriggerPlayer()))])
set PL[bj_forLoopAIndex]=null
set TT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=false
endfunction
function SYX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if not UnitAlive(UCV[PXE])then
call G0E(PXE)
call ReleaseTimer(GetExpiredTimer())
endif
if UDV[PXE]==.0 then
call SetUnitFlyHeight(UCV[PXE],.0,.0)
call UnitDamageTargetEx(UBV[PXE],UCV[PXE],(I2R(GetUnitAbilityLevel(UBV[PXE],'A062'))*3*GetHeroStr(UBV[PXE],true))+250.+(650.*I2R(GetUnitAbilityLevel(UBV[PXE],'A062'))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call G0E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set UDV[PXE]=UDV[PXE]-20.
call SetUnitFlyHeight(UCV[PXE],UDV[PXE],.0)
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function SYX)
endif
set t=null
endfunction
function SZX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if not UnitAlive(UCV[PXE])then
call G0E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
if UDV[PXE]==400. then
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function SYX)
else
if UDV[PXE]==.0 then
call UnitDamageTargetEx(UBV[PXE],UCV[PXE],(I2R(GetUnitAbilityLevel(UBV[PXE],'A062'))*GetHeroStr(UBV[PXE],true)*1.)+200.+(350.*I2R(GetUnitAbilityLevel(UBV[PXE],'A062'))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set UDV[PXE]=UDV[PXE]+20.
call SetUnitFlyHeight(UCV[PXE],UDV[PXE],.0)
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function SZX)
endif
endif
set t=null
endfunction
function S_X takes nothing returns boolean
local timer t
local integer PXE=G_E()
local unit u
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(OIV))then
set u=CreateUnit(GetOwningPlayer(OIV),'h007',GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit()),.0)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,'A05X')
call SetUnitAbilityLevel(u,'A05X',GetUnitAbilityLevel(OIV,'A062'))
call IssueTargetOrderById(u,852095,GetFilterUnit())
set t=NewTimer()
set UBV[PXE]=OIV
set UCV[PXE]=GetFilterUnit()
set UDV[PXE]=.0
if GetUnitAbilityLevel(UCV[PXE],'Amrf')==0 then
call UnitAddAbility(UCV[PXE],'Amrf')
call UnitRemoveAbility(UCV[PXE],'Amrf')
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdx",GetUnitX(UCV[PXE]),GetUnitY(UCV[PXE])))
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function SZX)
else
call G0E(PXE)
endif
set t=null
set u=null
return false
endfunction
function S0X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real r=.0
local real x2
local real y2
if UXV[PXE]>=1200. then
call G2E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
loop
exitwhen r==360.
set x2=UOV[PXE]+UXV[PXE]*Cos(r*bj_DEGTORAD)
set y2=URV[PXE]+UXV[PXE]*Sin(r*bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget.mdx",x2,y2))
set OIV=UEV[PXE]
call GroupEnumUnitsInRange(ORV,x2,y2,150.,Filter(function S_X))
set r=r+(360./12.)
endloop
set UXV[PXE]=UXV[PXE]+150.
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function S0X)
endif
set t=null
endfunction
function S1X takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local integer PXE=G1E()
local timer t=NewTimer()
set UEV[PXE]=u
set UXV[PXE]=150.
set UOV[PXE]=x
set URV[PXE]=y
set OIV=u
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget.mdx",x,y))
call GroupEnumUnitsInRange(ORV,x,y,150.,Filter(function S_X))
call SetTimerData(t,PXE)
call TimerStart(t,.03,false,function S0X)
set t=null
set u=null
endfunction
/*function S2X takes nothing returns boolean
if GetSpellAbilityId()=='A062' then
call S1X()
endif
return false
endfunction*/
function S3X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call SetUnitAbilityLevel(UJV[PXE],'A05T',GetUnitAbilityLevel(UJV[PXE],'A05T')-1)
call GZE(PXE)
call ReleaseTimer(GetExpiredTimer())
set t=null
endfunction
function S4X takes nothing returns nothing
local timer t
local integer PXE
local unit u=GetTriggerUnit()
if GetRandomInt(0,100)<=33 then
if IsMechaSkaar[GetUnitUserData(u)] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\LightningSphere_FX.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\LightningShield\\LightningShieldBuff.mdl",u,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EvilMissileofShadowyDOOMV3.mdx",u,"chest"))
endif
endif
if GetUnitAbilityLevel(u,'A05T')<((GetUnitAbilityLevel(u,'A05Z')*10)+1)then
call SetUnitAbilityLevel(u,'A05T',GetUnitAbilityLevel(u,'A05T')+1)
set t=NewTimer()
set PXE=GYE()
set UJV[PXE]=u
call SetTimerData(t,PXE)
call TimerStart(t,I2R(GetUnitAbilityLevel(u,'A05Z'))*2.,false,function S3X)
endif
set t=null
set u=null
endfunction
function S5X takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A05Z')!=0 and GetTriggerUnit()!=GetEventDamageSource()and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and GetUnitAbilityLevel(GetTriggerUnit(),'A05T')<101 and Damage_IsAttack() and BI[NI] != DAMAGE_TYPE_PLANT and BI[NI] != DAMAGE_TYPE_UNIVERSAL and GetEventDamageSource() != FLAMEDISCCASTER then
call S4X()
endif
return false
endfunction
function S6X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real x1
local real x2
local real y1
local real y2
local real dx
local real dy
local real d
local real a
local real nx
local real ny
if not UnitAlive(UPV[PXE])or not UnitAlive(UQV[PXE])then
call UnitRemoveAbility(UQV[PXE],'A05U')
call GWE(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set x1=GetUnitX(UPV[PXE])
set y1=GetUnitY(UPV[PXE])
set x2=GetUnitX(UQV[PXE])
set y2=GetUnitY(UQV[PXE])
set dx=x2-x1
set dy=y2-y1
set d=SquareRoot(dx*dx+dy*dy)
set a=Atan2(y2-y1,x2-x1)*bj_RADTODEG
if d<=15. then
set nx=x1+d*Cos((a+1.)*bj_DEGTORAD)
set ny=y1+d*Sin((a+1.)*bj_DEGTORAD)
else
set nx=x1+(d-(1.))*Cos((a+1.)*bj_DEGTORAD)
set ny=y1+(d-(1.))*Sin((a+1.)*bj_DEGTORAD)
endif
call SetUnitPathing(UQV[PXE],false)
call SetUnitX(UQV[PXE],nx)
call SetUnitY(UQV[PXE],ny)
call SetUnitPathing(UQV[PXE],true)
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function S6X)
endif
set t=null
endfunction
function S7X takes nothing returns boolean
local timer t
local integer PXE
local unit S8X=GetFilterUnit()
if IsUnitEnemy(S8X,GetOwningPlayer(OBV))and UnitAlive(S8X)and GetUnitAbilityLevel(S8X,'A05U')!=1 then
set t=NewTimer()
set PXE=GUE()
set UPV[PXE]=OBV
set UQV[PXE]=S8X
set USV[PXE]=GetUnitAbilityLevel(ONV,'A060')
call UnitAddAbility(S8X,'A05U')
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function S6X)
endif
set S8X=null
set t=null
return false
endfunction
function S9X takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if not UnitAlive(UYV[PXE])then
call GTE(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set OBV=UYV[PXE]
set ONV=UZV[PXE]
call GroupEnumUnitsInRange(OAV,U_V[PXE],U0V[PXE],449.,Filter(function S7X))
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function S9X)
endif
set t=null
endfunction
function TVX takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit s
local timer t=NewTimer()
local integer PXE=GSE()
if IsMechaSkaar[GetUnitUserData(u)]then
set s=CreateUnit(GetOwningPlayer(u),'h021',GetUnitX(u),GetUnitY(u),.0)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Stormfall.mdx",GetUnitX(u),GetUnitY(u)))
else
set s=CreateUnit(GetOwningPlayer(u),'h00R',GetUnitX(u),GetUnitY(u),.0)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Desecrate2.mdx",GetUnitX(u),GetUnitY(u)))
endif
call SetUnitAbilityLevel(s,'A05V',GetUnitAbilityLevel(u,'A060'))
call UnitApplyTimedLife(s,'BTLF',(GetUnitAbilityLevel(u,'A060')*2)+5.)
set ONV=u
set OBV=s
call GroupEnumUnitsInRange(OAV,GetUnitX(s),GetUnitY(s),449.,Filter(function S7X))
set UYV[PXE]=s
set UZV[PXE]=u
set U_V[PXE]=GetUnitX(s)
set U0V[PXE]=GetUnitY(s)
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function S9X)
set t=null
set u=null
set s=null
endfunction
/*function TEX takes nothing returns boolean
if GetSpellAbilityId()=='A060' then
call TVX()
endif
return false
endfunction*/
/*function TAX takes nothing returns boolean
return(GetSpellAbilityId()=='A05I')
endfunction*/
function TNX takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A09C')
call SetUnitAbilityLevelSwapped('A09C',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetTriggerUnit())
endfunction
function Trig_Eggsacks_Func004001 takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='h00S')
endfunction
function Trig_Eggsacks_Func004002 takes nothing returns boolean
return(IsUnitEnemy(GetKillingUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function TCX takes nothing returns boolean
return(GetBooleanAnd((GetUnitTypeId(GetTriggerUnit())=='h00S'),(IsUnitEnemy(GetKillingUnit(),GetOwningPlayer(GetTriggerUnit())))))
endfunction
function TDX takes nothing returns nothing
set XK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'n03M',GetOwningPlayer(GetTriggerUnit()),XK,bj_UNIT_FACING)
call RemoveLocation(XK)
endfunction
/*function TGX takes nothing returns boolean
return(GetSpellAbilityId()=='A06A')
endfunction*/
function THX takes nothing returns nothing
local real x1=GetUnitX(GetSpellTargetUnit())+150.*Cos(.0*bj_DEGTORAD)
local real y1=GetUnitY(GetSpellTargetUnit())+150.*Sin(.0*bj_DEGTORAD)
local real x2=GetUnitX(GetSpellTargetUnit())+150.*Cos(45.*bj_DEGTORAD)
local real y2=GetUnitY(GetSpellTargetUnit())+150.*Sin(45.*bj_DEGTORAD)
local real x3=GetUnitX(GetSpellTargetUnit())+150.*Cos(90.*bj_DEGTORAD)
local real y3=GetUnitY(GetSpellTargetUnit())+150.*Sin(90.*bj_DEGTORAD)
local real x4=GetUnitX(GetSpellTargetUnit())+150.*Cos(135.*bj_DEGTORAD)
local real y4=GetUnitY(GetSpellTargetUnit())+150.*Sin(135.*bj_DEGTORAD)
local real x5=GetUnitX(GetSpellTargetUnit())+150.*Cos(180.*bj_DEGTORAD)
local real y5=GetUnitY(GetSpellTargetUnit())+150.*Sin(180.*bj_DEGTORAD)
local real x6=GetUnitX(GetSpellTargetUnit())+150.*Cos(225.*bj_DEGTORAD)
local real y6=GetUnitY(GetSpellTargetUnit())+150.*Sin(225.*bj_DEGTORAD)
local real x7=GetUnitX(GetSpellTargetUnit())+150.*Cos(270.*bj_DEGTORAD)
local real y7=GetUnitY(GetSpellTargetUnit())+150.*Sin(270.*bj_DEGTORAD)
local real x8=GetUnitX(GetSpellTargetUnit())+150.*Cos(315.*bj_DEGTORAD)
local real y8=GetUnitY(GetSpellTargetUnit())+150.*Sin(315.*bj_DEGTORAD)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x1,y1,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x2,y2,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x3,y3,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x4,y4,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x5,y5,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x6,y6,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x7,y7,270.)
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h00S',x8,y8,270.)
endfunction
constant function TKX takes integer DZX returns real
return 3.
endfunction
function TLX takes unit c,unit u returns boolean
if GetUnitState(u,UNIT_STATE_LIFE)>.0 then
if IsUnitType(u,UNIT_TYPE_FLYING)==false then
if GetUnitAbilityLevel(u,'Avul')<=0 then
if IsUnitEnemy(u,GetOwningPlayer(c))then
return IsUnitType(u,UNIT_TYPE_STRUCTURE)==false
endif
endif
endif
endif
return false
endfunction
function TMX takes nothing returns boolean
return GetUnitTypeId(GetAttacker())=='n02F'
endfunction
function TPX takes nothing returns nothing
local integer DGE=0
local integer id
loop
exitwhen DGE==WXV
set id=NEE[DGE]
set WIV[NXE[id]]=WIV[NXE[id]]+.5
if WIV[NXE[id]]>=WRV[NXE[id]]then
call UnitRemoveAbility(WOV[NXE[id]],'A068')
call MNE(WOV[NXE[id]])
set WOV[NXE[id]]=null
call GME(NXE[id])
set WXV=WXV-1
set NEE[DGE]=NEE[WXV]
elseif not PZE(WOV[NXE[id]])then
call UnitRemoveAbility(WOV[NXE[id]],'A068')
call MNE(WOV[NXE[id]])
set WOV[NXE[id]]=null
call GME(NXE[id])
set WXV=WXV-1
set NEE[DGE]=NEE[WXV]
else
set DGE=DGE+1
endif
endloop
if WXV==0 then
call PauseTimer(WEV)
endif
endfunction
function TQX takes unit TSX,real CIE,integer DZX returns nothing
local integer DGE
if WXV==0 then
call TimerStart(WEV,.5,true,function TPX)
endif
if GetUnitAbilityLevel(TSX,'A068')>0 then
set DGE=(LoadInteger(Q,GetHandleId((TSX)),0))
call UnitRemoveAbility(TSX,'A068')
else
call MAE(TSX)
set DGE=(LoadInteger(Q,GetHandleId((TSX)),0))
set NXE[DGE]=GLE()
set NEE[WXV]=DGE
set WXV=WXV+1
endif
set WOV[NXE[DGE]]=TSX
set WRV[NXE[DGE]]=CIE
set WIV[NXE[DGE]]=.0
call UnitAddAbility(TSX,'A068')
call SetUnitAbilityLevel(TSX,'A068',DZX)
endfunction
function TTX takes integer D0E returns nothing
local integer DZX
local real z
local real cx
local real cy
local real cz
local real UEE
set WJV[D0E]=WJV[D0E]+40.
if WKV[D0E]>=WJV[D0E]and GetUnitState(WDV[D0E],UNIT_STATE_LIFE)>.0 then
set cx=GetUnitX(WDV[D0E])
set cy=GetUnitY(WDV[D0E])
set cz=PTE(cx,cy)
set WLV[D0E]=WLV[D0E]+WPV[D0E]
set WMV[D0E]=WMV[D0E]+WQV[D0E]
set z=PTE(WLV[D0E],WMV[D0E])
set UEE=PUE(WSV[WTV[D0E]+1],WSV[WTV[D0E]],WSV[WTV[D0E]+2],WJV[D0E]/WKV[D0E])+(WSV[WTV[D0E]]-z)
call MoveLightningEx(WGV[D0E],true,cx,cy,cz+100.,WLV[D0E],WMV[D0E],UEE+55.+z)
call SetUnitPosition(WCV[D0E],WLV[D0E],WMV[D0E])
call SetUnitFlyHeight(WCV[D0E],UEE,0)
else
if IsUnitEnemy(WCV[D0E],GetOwningPlayer(WDV[D0E]))then
set DZX=GetUnitAbilityLevel(WDV[D0E],'A069')
call TQX(WCV[D0E],TKX(1),1)
call UnitDamageTarget(WDV[D0E],WCV[D0E],GetUnitState(WCV[D0E],UNIT_STATE_LIFE)/5.,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call SpiderPoison_PoisonUnit(WDV[D0E],WCV[D0E])
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",WLV[D0E],WMV[D0E]))
//call DestroyEffect(AddSpecialEffect("Doodads\\Dungeon\\Terrain\\EggSack\\EggSack1.mdl",WLV[D0E],WMV[D0E]))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Massacre.mdx",WLV[D0E],WMV[D0E]))
call SetUnitPathing(WCV[D0E],true)
if GetUnitTypeId(WCV[D0E]) != 'U003' then
call SetUnitFlyHeight(WCV[D0E],GetUnitDefaultFlyHeight(WCV[D0E]),250.)
else
call SetUnitFlyHeight(WCV[D0E],0.,250.)
endif
set WYV[D0E]=false
endif
endfunction
function TUX takes integer D0E returns nothing
call DestroyEffect(WFV[D0E])
call DestroyLightning(WGV[D0E])
set WCV[D0E]=null
set WDV[D0E]=null
set WFV[D0E]=null
call GKE(D0E)
endfunction
function TWX takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==WWV
if not WZV[NOE[DGE]]then
if WYV[NOE[DGE]]then
call TTX(NOE[DGE])
set DGE=DGE+1
else
call TUX(NOE[DGE])
set WWV=WWV-1
set NOE[DGE]=NOE[WWV]
endif
else
set DGE=DGE+1
endif
endloop
if WWV==0 then
call PauseTimer(WUV)
endif
endfunction
function TYX takes integer PXE returns integer
if WWV==0 then
call TimerStart(WUV,.03,true,function TWX)
endif
set NOE[WWV]=PXE
set WYV[NOE[WWV]]=true
set WZV[NOE[WWV]]=false
set WWV=WWV+1
return WWV
endfunction
function TZX takes integer D0E returns nothing
if YXV[D0E]>0 then
set W5V[D0E]=W5V[D0E]+W9V[D0E]
set W6V[D0E]=W6V[D0E]+YVV[D0E]
if TRUEENFOS then
set YXV[D0E]=YXV[D0E]-25.
else
set YXV[D0E]=YXV[D0E]-20.
endif
call MoveLightningEx(W4V[D0E],true,W5V[D0E],W6V[D0E],YEV[D0E],W7V[D0E],W8V[D0E],YEV[D0E])
call DestroyEffect(W3V[D0E])
set W3V[D0E]=AddSpecialEffectTarget("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl",W2V[D0E],"chest")
else
set YIV[D0E]=false
endif
endfunction
function T_X takes integer D0E returns nothing
call DestroyEffect(W3V[D0E])
call RemoveUnit(W2V[D0E])
call DestroyLightning(W4V[D0E])
set W3V[D0E]=null
set W2V[D0E]=null
set W4V[D0E]=null
call GHE(D0E)
endfunction
function T0X takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==YRV
if not YAV[NRE[DGE]]then
if YIV[NRE[DGE]]then
call TZX(NRE[DGE])
set DGE=DGE+1
else
call T_X(NRE[DGE])
set YRV=YRV-1
set NRE[DGE]=NRE[YRV]
endif
else
set DGE=DGE+1
endif
endloop
if YRV==0 then
call PauseTimer(YOV)
endif
endfunction
function T1X takes integer PXE returns integer
if YRV==0 then
call TimerStart(YOV,.03,true,function T0X)
endif
set NRE[YRV]=PXE
set YIV[NRE[YRV]]=true
set YAV[NRE[YRV]]=false
set YRV=YRV+1
return YRV
endfunction
function T2X takes integer D0E returns nothing
local integer T3X
local integer T4X
local real x=GetUnitX(YJV[D0E])
local real y=GetUnitY(YJV[D0E])
local real tx
local real ty
local real z
local real CDE=Atan2(YFV[D0E]-y,YDV[D0E]-x)
local boolean T5X=false
local unit t
local unit a
local group g
if TRUEENFOS then
set YDV[D0E]=YDV[D0E]+25.*Cos(CDE)
set YFV[D0E]=YFV[D0E]+25.*Sin(CDE)
else
set YDV[D0E]=YDV[D0E]+20.*Cos(CDE)
set YFV[D0E]=YFV[D0E]+20.*Sin(CDE)
endif
set YHV[D0E]=PPE(YDV[D0E],YFV[D0E],x,y)
set z=PTE(YDV[D0E],YFV[D0E])
call MoveLightningEx(YMV[D0E],true,x,y,YGV[D0E],YDV[D0E],YFV[D0E],YGV[D0E])
call PME(YKV[D0E])
call SetUnitFlyHeight(YKV[D0E],YGV[D0E]-z,0)
call SetUnitX(YKV[D0E],YDV[D0E])
call SetUnitY(YKV[D0E],YFV[D0E])
call SetUnitFacing(YKV[D0E],CDE*57.2957795)
set g=PSE(150.,YDV[D0E],YFV[D0E])
call GroupRemoveUnit(g,YJV[D0E])
call GroupRemoveUnit(g,YKV[D0E])
loop
set a=FirstOfGroup(g)
exitwhen a==null
call GroupRemoveUnit(g,a)
if TLX(YJV[D0E],a)then
set t=a
set T5X=true
endif
endloop
if YHV[D0E]>=1350. or not RectContainsCoords(OGV,YDV[D0E],YFV[D0E])or UnitAlive(YJV[D0E])==false then
set T3X=GGE()
set W2V[T3X]=YKV[D0E]
set W3V[T3X]=AddSpecialEffectTarget("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl",YKV[D0E],"chest")
set W4V[T3X]=YMV[D0E]
set W5V[T3X]=x
set W6V[T3X]=y
if TRUEENFOS then
set W9V[T3X]=25.*Cos(CDE)
set YVV[T3X]=25.*Sin(CDE)
else
set W9V[T3X]=20.*Cos(CDE)
set YVV[T3X]=20.*Sin(CDE)
endif
set W7V[T3X]=YDV[D0E]
set W8V[T3X]=YFV[D0E]
set YEV[T3X]=YGV[D0E]
set YXV[T3X]=PPE(x,y,YDV[D0E],YFV[D0E])
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl",YJV[D0E],"origin"))
call SetUnitFlyHeight(YKV[D0E],YGV[D0E]-z,0)
call SetUnitX(YKV[D0E],YDV[D0E])
call SetUnitY(YKV[D0E],YFV[D0E])
call T1X(T3X)
set YSV[D0E]=false
elseif T5X then
set T4X=GJE()
set WCV[T4X]=t
set WDV[T4X]=YJV[D0E]
set WJV[T4X]=.0
set WGV[T4X]=YMV[D0E]
set WHV[T4X]=GetUnitState(t,UNIT_STATE_LIFE)/4
set WLV[T4X]=GetUnitX(t)
set WMV[T4X]=GetUnitY(t)
set tx=x+OFV*Cos(CDE)
set ty=y+OFV*Sin(CDE)
set CDE=Atan2(ty-WMV[T4X],tx-WLV[T4X])
set WPV[T4X]=40.*Cos(CDE)
set WQV[T4X]=40.*Sin(CDE)
set WKV[T4X]=PPE(WLV[T4X],WMV[T4X],tx,ty)
set WSV[WTV[T4X]]=GetUnitDefaultFlyHeight(t)+PTE(WLV[T4X],WMV[T4X])
set WSV[WTV[T4X]+1]=(((WKV[T4X])*1.)*.2)
set WSV[WTV[T4X]+2]=PTE(tx,ty)
set WFV[T4X]=AddSpecialEffectTarget("Abilities\\Spells\\Undead\\Web\\Web_AirTarget.mdl",t,"chest")
call PME(t)
call TYX(T4X)
call RemoveUnit(YKV[D0E])
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl",YJV[D0E],"origin"))
call SetUnitPathing(t,false)
set YSV[D0E]=false
set t=null
endif
set g=null
endfunction
function T6X takes integer D0E returns nothing
call DestroyEffect(YLV[D0E])
set YJV[D0E]=null
set YKV[D0E]=null
set YLV[D0E]=null
set YMV[D0E]=null
call GFE(D0E)
endfunction
function T7X takes nothing returns nothing
local integer DGE=0
loop
exitwhen DGE==YQV
if not YTV[NIE[DGE]]then
if YSV[NIE[DGE]]then
call T2X(NIE[DGE])
set DGE=DGE+1
else
call T6X(NIE[DGE])
set YQV=YQV-1
set NIE[DGE]=NIE[YQV]
endif
else
set DGE=DGE+1
endif
endloop
if YQV==0 then
call PauseTimer(YPV)
endif
endfunction
function T8X takes integer PXE returns integer
if YQV==0 then
call TimerStart(YPV,.03,true,function T7X)
endif
set NIE[YQV]=PXE
set YSV[NIE[YQV]]=true
set YTV[NIE[YQV]]=false
set YQV=YQV+1
return YQV
endfunction
function T9X takes nothing returns nothing
local real a = GetUnitFacing(GetTriggerUnit())
local real lx=GetUnitX(GetTriggerUnit()) + 70. * Cos(a * bj_DEGTORAD)
local real ly=GetUnitY(GetTriggerUnit()) + 70. * Sin(a * bj_DEGTORAD)
local integer YXE=GDE()
local real CDE
local real x
local real y
local real z
set YJV[YXE]=GetAttacker()
set x=GetUnitX(YJV[YXE])
set y=GetUnitY(YJV[YXE])
set CDE=Atan2(ly-y,lx-x)
if TRUEENFOS then
set YDV[YXE]=x+25.*Cos(CDE)
set YFV[YXE]=y+25.*Sin(CDE)
else
set YDV[YXE]=x+20.*Cos(CDE)
set YFV[YXE]=y+20.*Sin(CDE)
endif
set z=PTE(YDV[YXE],YFV[YXE])
set YGV[YXE]=GetUnitDefaultFlyHeight(YJV[YXE])+100.+z
set YHV[YXE]=.0
set YMV[YXE]=AddLightningEx("LEAS",true,YDV[YXE],YFV[YXE],YGV[YXE],YDV[YXE],YFV[YXE],YGV[YXE])
call SetLightningColor(YMV[YXE],1.,.1,.15,.82)
set YKV[YXE]=CreateUnit(Player(14),'h007',YDV[YXE],YFV[YXE],CDE*57.2957795)
set YLV[YXE]=AddSpecialEffectTarget("Abilities\\Spells\\Undead\\Web\\Webmissile.mdl",YKV[YXE],"chest")
call PME(YKV[YXE])
call SetUnitFlyHeight(YKV[YXE],YGV[YXE]-z,0)
call SetUnitX(YKV[YXE],YDV[YXE])
call SetUnitY(YKV[YXE],YFV[YXE])
call T8X(YXE)
endfunction
function UVX takes nothing returns boolean
return(GetUnitTypeId(GetAttacker())=='H009')
endfunction
function UEX takes nothing returns boolean
return(GetRandomInt(1,100)>=50)
endfunction
function UXX takes nothing returns nothing
if(UEX())then
set XK=GetUnitLoc(GetTriggerUnit())
call IssuePointOrderByIdLoc(GetAttacker(),852555,XK)
call RemoveLocation(XK)
else
call IssueImmediateOrderById(GetAttacker(),852599)
endif
endfunction
function URX takes nothing returns nothing
local unit k=GetKillingUnit()
local real x=GetUnitX(k)
local real y=GetUnitY(k)
local integer i=1
local integer p
local real f=GetUnitFacing(k)
local unit u
loop
exitwhen i==41
if MC[i]==GetUnitTypeId(k)then
set p=GetPlayerId(GetOwningPlayer(k))
call SetUnitOwner(k,Player(PLAYER_NEUTRAL_PASSIVE),true)
call ShowUnit(k,false)
call KillUnit(k)
set u=CreateUnit(Player(p),PK[i],x,y,f)
call DestroyEffect(AddSpecialEffect("war3mapImported\\ChaosExplosion.mdx",x,y))
call UnitAddAbility(u,'S004')
endif
set i=i+1
endloop
set i=0
loop
exitwhen i==41
if PK[i]==GetUnitTypeId(k)then
call ZUE(k,100.)
call DestroyEffect(AddSpecialEffect("BigBloodEX-NoSplat-NoGutz.mdx",x,y))
//call UnitAddAbility(k,'S004')
endif
set i=i+1
endloop
if GetUnitAbilityLevel(k,'S004')>0 then
call SetUnitAbilityLevel(k,'S004',GetUnitAbilityLevel(k,'S004')+1)
else
call UnitAddAbility(k,'S004')
endif
//if GetUnitAbilityLevel(k,'S004')==4 then
//call ZWE(k,500.)
//call ZZE(k,1.)
//endif
set k=null
set u=null
endfunction
function UIX takes nothing returns boolean
if not IsUnitType(GetKillingUnit(),UNIT_TYPE_HERO)and IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)and GetPlayerController(GetOwningPlayer(GetKillingUnit()))==MAP_CONTROL_COMPUTER and NOOBM then
call URX()
endif
return false
endfunction
function UAX takes nothing returns nothing
local unit a=GetEventDamageSource()
local unit u=GetTriggerUnit()
local real RVX=BlzGetUnitArmor(u)
local real SVE=O9X(GetEventDamage(),RVX)
if RVX>0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if(BI[NI])==(LN)then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx((a),(u),((SVE)*1.),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
endif
else
if(CI[NI])then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx((a),(u),((SVE)*1.),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
endif
endif
endif
set a=null
set u=null
endfunction
function UNX takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'B00T')>0 and((BI[NI])==DAMAGE_TYPE_NORMAL)and GetTriggerUnit()!=GetEventDamageSource() and GetUnitAbilityLevel(GetTriggerUnit(),'B04X')!=1 and GetUnitAbilityLevel(GetTriggerUnit(),'A09D')!=1 and GetUnitAbilityLevel(GetTriggerUnit(),'A0LA')!=1 and GetUnitAbilityLevel(GetTriggerUnit(),'A0N9')!=1 then
call UAX()
endif
return false
endfunction
function UBX takes nothing returns nothing
local unit a=GetEventDamageSource()
local unit u=GetTriggerUnit()
local real d=GetEventDamage()*2
if(J5V[(ROX((GetUnitTypeId(a))))])then
if(BI[NI])==(LN) or (BI[NI])==(DAMAGE_TYPE_LIGHTNING) or (BI[NI])==(DAMAGE_TYPE_MAGIC) or (BI[NI])==(DAMAGE_TYPE_COLD) or (BI[NI])==(DAMAGE_TYPE_UNIVERSAL) or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL)then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
if GetUnitTypeId(u)=='n016' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
endif
endif
else
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
if GetUnitTypeId(u)=='n016' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
endif
endif
set u=null
set a=null
endfunction
function UCX takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A08B')>0 and GetTriggerUnit()!=GetEventDamageSource()and GetRandomInt(1,100)<=40 and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<=GetEventDamage()then
call UBX()
endif
return false
endfunction
function UDX takes nothing returns nothing
local unit att=GetEventDamageSource()
local unit u=GetTriggerUnit()
local real d=GetEventDamage()*5
local unit a = LC[(1+GetPlayerId(GetOwningPlayer(att)))]
if(J5V[(ROX((GetUnitTypeId(att))))])then
if(BI[NI])==(LN)or(BI[NI])==(DAMAGE_TYPE_LIGHTNING) or(BI[NI])==(DAMAGE_TYPE_MAGIC) or(BI[NI])==(DAMAGE_TYPE_COLD)or(BI[NI])==(DAMAGE_TYPE_UNIVERSAL)or(CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL)then
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
if GetUnitAbilityLevel(u,'A08K') !=0 then //GetUnitTypeId(u)=='n029' or GetUnitTypeId(u)=='n01V' or GetUnitTypeId(u)=='n03K' or GetUnitTypeId(u)=='n027' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
endif
if UnitHasItemOfTypeBJ(a,'I033') or UnitHasItemOfTypeBJ(a,'I03C') then
call UnitRemoveAbility(u,'A08E')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Dark Execution.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\OrbOfDeath\\OrbOfDeathMissile.mdl",a,"chest"))
if GetUnitAbilityLevel(u,'A08K') !=0 then
call UnitRemoveAbility(u,'A08K')
if UnitHasItemOfTypeBJ(a,'I033') then
call RemoveItem( GetItemOfTypeFromUnitBJ(a, 'I033') )
call UnitAddItemByIdSwapped( 'I035',a )
endif
else
call UnitRemoveAbility(u,'A08F')
if UnitHasItemOfTypeBJ(a,'I033') then
call RemoveItem( GetItemOfTypeFromUnitBJ(a, 'I033') )
call UnitAddItemByIdSwapped( 'I034',a )
endif
endif
endif
endif
else
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
if GetUnitState(u,UNIT_STATE_LIFE)>=GetUnitState(u,UNIT_STATE_MAX_LIFE)then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+d)
endif
if GetUnitAbilityLevel(u,'A08K') !=0 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",u,"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
endif
if UnitHasItemOfTypeBJ(a,'I033') or UnitHasItemOfTypeBJ(a,'I03C') then
call UnitRemoveAbility(u,'A08E')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Dark Execution.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\OrbOfDeath\\OrbOfDeathMissile.mdl",a,"chest"))
if GetUnitAbilityLevel(u,'A08K') !=0 then
call UnitRemoveAbility(u,'A08K')
if UnitHasItemOfTypeBJ(a,'I033') then
call RemoveItem( GetItemOfTypeFromUnitBJ(a, 'I033') )
call UnitAddItemByIdSwapped( 'I035',a )
endif
else
call UnitRemoveAbility(u,'A08F')
if UnitHasItemOfTypeBJ(a,'I033') then
call RemoveItem( GetItemOfTypeFromUnitBJ(a, 'I033') )
call UnitAddItemByIdSwapped( 'I034',a )
endif
endif
endif
endif
set u=null
set a=null
set att = null
endfunction
function UFX takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A08E')>0 and GetTriggerUnit()!=GetEventDamageSource()and GetRandomInt(1,100)<=60+5*XT and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<=GetEventDamage()then
call UDX()
endif
return false
endfunction
function UJX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n038')and(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function Trig_Turtle_Boss_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n037')
endfunction
function Trig_Turtle_Boss_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(10)))
endfunction
function UKX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n037'),(IsUnitAlly(GetFilterUnit(),Player(10))))
endfunction
function ULX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A037')
endfunction
function UMX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function UKX)),function ULX)
endfunction
function UQX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n038')and(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function Trig_Turtle_Boss_2_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n037')
endfunction
function Trig_Turtle_Boss_2_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(11)))
endfunction
function USX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n037'),(IsUnitAlly(GetFilterUnit(),Player(11))))
endfunction
function UTX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A037')
endfunction
function UUX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function USX)),function UTX)
endfunction
function UYX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n025')and(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function Trig_Tree_Poison_Boss_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n024')
endfunction
function Trig_Tree_Poison_Boss_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(11)))
endfunction
function UZX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n024'),(IsUnitAlly(GetFilterUnit(),Player(11))))
endfunction
function U_X takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'Aspo')
endfunction
function U0X takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function UZX)),function U_X)
endfunction
function U2X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02F')and(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function Trig_Spider_Boss_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='h00S')
endfunction
function Trig_Spider_Boss_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(11)))
endfunction
function U3X takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='h00S'),(IsUnitAlly(GetFilterUnit(),Player(11))))
endfunction
function U4X takes nothing returns nothing
call ExplodeUnitBJ(GetEnumUnit())
endfunction
function U5X takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function U3X)),function U4X)
endfunction
function U7X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02F')and(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function Trig_Spider_Boss_2_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='h00S')
endfunction
function Trig_Spider_Boss_2_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(10)))
endfunction
function U8X takes nothing returns boolean
if not BRTON then
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='h00S'),(IsUnitAlly(GetFilterUnit(),Player(10))))
else
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n00S'),(IsUnitAlly(GetFilterUnit(),Player(10))))
endif
endfunction
function U9X takes nothing returns nothing
call ExplodeUnitBJ(GetEnumUnit())
endfunction
function WVX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function U8X)),function U9X)
endfunction
function WXX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n025')and(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function Trig_Tree_Poison_Boss_2_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n024')
endfunction
function Trig_Tree_Poison_Boss_2_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(10)))
endfunction
function WOX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n024'),(IsUnitAlly(GetFilterUnit(),Player(10))))
endfunction
function WRX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'Aspo')
endfunction
function WIX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function WOX)),function WRX)
endfunction
function WNX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n023')and(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function Trig_Invis_Boss_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n022')
endfunction
function Trig_Invis_Boss_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(11)))
endfunction
function WBX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n022'),(IsUnitAlly(GetFilterUnit(),Player(11))))
endfunction
function WCX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A0EV')
endfunction
function WDX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function WBX)),function WCX)
endfunction
function WGX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n023')and(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function Trig_Invis_Boss_2_Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n022')
endfunction
function Trig_Invis_Boss_2_Func002001002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),Player(10)))
endfunction
function WHX takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())=='n022'),(IsUnitAlly(GetFilterUnit(),Player(10))))
endfunction
function WJX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A0EV')
endfunction
function WKX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function WHX)),function WJX)
endfunction
/*function WMX takes nothing returns boolean
return(((GetSpellAbilityId()=='Absk' or GetSpellAbilityId()=='A0KQ'))and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false))!=null
endfunction*/
function WPX takes nothing returns nothing
call SetUnitPathing(GetTriggerUnit(),false)
endfunction
/*function WSX takes nothing returns boolean
return(GetSpellAbilityId()=='A06O')
endfunction*/
function WTX takes nothing returns nothing
call SetUnitPathing(GetTriggerUnit(),false)
endfunction
function WWX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='e00X')and(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function Trig_Ranger_Boss_Armor_Remove_2_Func002001002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))!=null
endfunction
function Trig_Ranger_Boss_Armor_Remove_2_Func002001002002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),Player(11)))
endfunction
function WYX takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)),(IsUnitEnemy(GetFilterUnit(),Player(11)))))!=null
endfunction
function WZX takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A0EQ')
endfunction
function W_X takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function WYX)),function WZX)
endfunction
function W1X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04S',GetEventDamageSource())==1)and(GetEventDamage()>=1.)and(not((BI[NI])!=(LN)))and(J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))])
endfunction
function W2X takes nothing returns nothing
set FK=GetUnitLoc(GetEventDamageSource())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetEventDamageSource()),FK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0D5')
call IssueTargetOrder(bj_lastCreatedUnit,"acidbomb",GetTriggerUnit())
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\Shield Breaker1.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(FK)
endfunction
function W4X takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04S',GetEventDamageSource())==1)and(GetEventDamage()>=1.)and(not(J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))]))
endfunction
function W5X takes nothing returns nothing
set FK=GetUnitLoc(GetEventDamageSource())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetEventDamageSource()),FK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0D5')
call IssueTargetOrder(bj_lastCreatedUnit,"acidbomb",GetTriggerUnit())
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\Shield Breaker1.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(FK)
endfunction
function W7X takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='e00X')and(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function Trig_Ranger_Boss_Armor_Remove_Func002001002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))!=null
endfunction
function Trig_Ranger_Boss_Armor_Remove_Func002001002002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),Player(10)))
endfunction
function W8X takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)),(IsUnitEnemy(GetFilterUnit(),Player(10)))))!=null
endfunction
function W9X takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'A0EQ')
endfunction
function YVX takes nothing returns nothing
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function W8X)),function W9X)
endfunction
function YXX takes nothing returns boolean
return(GetUnitTypeId(GetAttacker())=='h00B')
endfunction
function Trig_Tank_AI_Func001Func001Func002C takes nothing returns boolean
return true
endfunction
function YOX takes nothing returns boolean
return(GetRandomInt(1,100)>=25)
endfunction
function YRX takes nothing returns boolean
return(GetRandomInt(1,100)>=50)
endfunction
function YIX takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
if(YRX())then
//set XK=GetUnitLoc(GetTriggerUnit())
//set LK=CNE(XK,256.,GetUnitFacing(GetAttacker()))
call IssueImmediateOrderById(GetAttacker(),851972)
call IssuePointOrderById(GetAttacker(),852580,x,y)
//call RemoveLocation(XK)
//call RemoveLocation(LK)
else
if(YOX())then
//set XK=GetUnitLoc(GetTriggerUnit())
//set LK=CNE(XK,256.,GetUnitFacing(GetAttacker()))
call IssueImmediateOrderById(GetAttacker(),851972)
call IssuePointOrderById(GetAttacker(),852592,x,y)
//call RemoveLocation(XK)
//call RemoveLocation(LK)
else
if((true))then
//set XK=GetUnitLoc(GetTriggerUnit())
call IssueImmediateOrderById(GetAttacker(),851972)
call IssuePointOrderById(GetAttacker(),852232,x,y)
//call RemoveLocation(XK)
endif
endif
endif
endfunction
function YNX takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='h00B')
endfunction
function YBX takes nothing returns nothing
call SetUnitAcquireRange(GetTriggerUnit(),1000.)
endfunction
function YDX takes nothing returns boolean
return(not(GetUnitAbilityLevel(GetTriggerUnit(),'A000')!=1))and(not(GetRandomInt(1,100)>1))
endfunction
function YFX takes nothing returns nothing
local item i=(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),'I01O'))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Shield Breaker1.mdx",GetTriggerUnit(),"origin"))
call RemoveItem(i)
call UnitAddItemById(GetTriggerUnit(),'I046')
call SetWidgetLife(GetTriggerUnit(),GetWidgetLife(GetTriggerUnit())/4.)
set i=null
endfunction
function YHX takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I01U')or (GetItemTypeId(GetManipulatedItem())=='I04I')
endfunction
function YJX takes nothing returns nothing
call ZWE(GetTriggerUnit(),500.)
endfunction
function YLX takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I01U')or (GetItemTypeId(GetManipulatedItem())=='I04I')
endfunction
function YMX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A078',GetTriggerUnit())!=1)
endfunction
function YPX takes nothing returns nothing
if(YMX())then
call ZYE(GetTriggerUnit())
endif
endfunction
function YTX takes nothing returns nothing
local integer YUX
//if GetSpellAbilityId()=='A00J' then
set YUX=LFE()
set KHV[(YUX)]=((.0)*1.)
set KJV[(YUX)]=("war3mapImported\\Psionic Shot Teal.mdx")
set KGV[(YUX)]=((2500)*1.)
set KFV[(YUX)]=((9999)*1.)
set KMV[(YUX)]=(false)
set KPV[(YUX)]=(false)
call R8X(YUX,5)
call R7X(YUX,GetSpellAbilityUnit(),GetSpellTargetUnit())
//endif
endfunction
function YWX takes nothing returns nothing
local integer YUX
//if GetSpellAbilityId()=='A014' then
set YUX=LGE()
set KHV[(YUX)]=((.6)*1.)
set KJV[(YUX)]=("war3mapImported\\Psionic Shot Teal.mdx")
set KGV[(YUX)]=((2500)*1.)
set KFV[(YUX)]=((900)*1.)
set KMV[(YUX)]=(false)
set KPV[(YUX)]=(true)
call R8X(YUX,6)
call R7X(YUX,GetSpellAbilityUnit(),GetSpellTargetUnit())
//endif
endfunction
function Y_X takes nothing returns nothing
local effect Y0X
set Y0X=bj_lastCreatedEffect
call CRE(2.5)
call DestroyEffect(Y0X)
set Y0X = null
endfunction
function Y2X takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='o001')
endfunction
function Trig_FocusMoonbeam_Func001001 takes nothing returns boolean
return(GetUnitTypeId(UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])=='o001')
endfunction
function Y3X takes nothing returns nothing
if((GetUnitTypeId(UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])=='o001'))then
call RemoveUnit(UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endif
set UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetSummonedUnit()
endfunction
/*function ZEX takes nothing returns boolean
return GetSpellAbilityId()=='A07U'
endfunction*/
function ZXX takes nothing returns nothing
local unit ZOX=GetTriggerUnit()
local unit ZRX=GetSpellTargetUnit()
local real ZIX=KT[GetUnitAbilityLevel(ZOX,'A07U')]
local trigger ZAX
local integer loc_integer01
local real ZNX=GetUnitX(ZRX)-75*Cos(GetUnitFacing(ZRX)*bj_DEGTORAD)
local real ZBX=GetUnitY(ZRX)-75*Sin(GetUnitFacing(ZRX)*bj_DEGTORAD)
call SetUnitX(ZOX,ZNX)
call SetUnitY(ZOX,ZBX)
call SetUnitFacing(ZOX,GetUnitFacing(ZRX))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",ZOX,"origin"))
if IsUnitEnemy(ZRX,GetOwningPlayer(ZOX))then
call UnitDamageTarget(ZOX,ZRX,ZIX,true,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call IssueTargetOrderById(ZOX,851983,ZRX)
endif
set ZOX=null
set ZRX=null
set ZAX=null
endfunction
function ZCX takes nothing returns boolean
return GetSpellAbilityId()=='A07U'
endfunction
function ZDX takes nothing returns nothing
local unit ZFX=GetTriggerUnit()
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",ZFX,"origin"))
call SAE('h00J',GetUnitX(ZFX),GetUnitY(ZFX),GetUnitFacing(ZFX),.5,"spell",2.)
set ZFX=null
endfunction
constant function ZGX takes integer ZHX returns boolean
local boolean array ZJX
set ZJX[1]=true
set ZJX[2]=true
return ZJX[ZHX]
endfunction
constant function ZKX takes integer ZHX returns integer
local integer array ZLX
set ZLX[1]='A07R'
set ZLX[2]=10
set ZLX[3]=900
set ZLX[4]=4
set ZLX[5]='A07S'
return ZLX[ZHX]
endfunction
constant function ZMX takes integer ZHX returns string
local string array ZPX
set ZPX[1]="war3mapImported\\ShadowRibbon.mdx"
set ZPX[2]="war3mapImported\\Doomsday.mdx"
set ZPX[3]=""
set ZPX[4]="war3mapImported\\ShadowbindTarget.mdx"
return ZPX[ZHX]
endfunction
function ZQX takes unit ZSX,unit MME returns boolean
return IsUnitEnemy(MME,GetOwningPlayer(ZSX))and GetWidgetLife(MME)>.405 and not IsUnitType(MME,UNIT_TYPE_STRUCTURE)and not IsUnitType(MME,UNIT_TYPE_MECHANICAL)and not IsUnitType(MME,UNIT_TYPE_MAGIC_IMMUNE)and IsUnitVisible(MME,GetOwningPlayer(ZSX))and not(GetUnitAbilityLevel((MME),'Avul')>0)
endfunction
function ZTX takes nothing returns boolean
return GetSpellAbilityId()==ZKX(1)
endfunction
function ZUX takes nothing returns boolean
return R2I(GetEventDamage())>.0 and GetOwningPlayer(GetEventDamageSource())!=GetOwningPlayer(GetTriggerUnit()) and LoadUnitHandle(FF,GetHandleId(GetEventDamageSource()),1) == GetEventDamageSource()
endfunction
function ZWX takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),ZKX(1))>0 and GetTriggerUnit()==LoadUnitHandle(FF,GetHandleId(GetAttacker()),StringHash("Omnislash Caster Target"))
endfunction
function ZYX takes nothing returns nothing
local unit ZSX=GetEventDamageSource()
local unit MME=GetTriggerUnit()
local integer ZZX=GetHandleId(ZSX)
local unit Z_X=null
local group Z0X=CreateGroup()
local integer Z1X=LoadInteger(FF,ZZX,StringHash("Omnislash Caster Now"))
local trigger Z2X=null
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call DestroyEffect(AddSpecialEffectTarget(ZMX(4),MME,"origin"))
call GroupEnumUnitsInRange(Z0X,GetUnitX(ZSX),GetUnitY(ZSX),I2R(ZKX(3)),null)
loop
set Z_X=GroupPickRandomUnit(Z0X)
exitwhen ZQX(ZSX,Z_X)or Z_X==null
call GroupRemoveUnit(Z0X,Z_X)
endloop
if(Z_X!=null and GetWidgetLife(Z_X)>.405)or ZQX(ZSX,LoadUnitHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Target")))then
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call SaveUnitHandle(FF,ZZX,StringHash("Omnislash Caster Target"),Z_X)
call SaveInteger(FF,ZZX,StringHash("Omnislash Caster Now"),Z1X+1)
call SaveReal(FF,ZZX,StringHash("Omnislash Caster Time"),.0)
call DestroyEffect(AddSpecialEffect(ZMX(2),GetUnitX(ZSX),GetUnitY(ZSX)))
if Z_X!=null then
call SetUnitX(ZSX,(GetUnitX(Z_X)-75*Cos(GetUnitFacing(Z_X)*bj_DEGTORAD)))
call SetUnitY(ZSX,(GetUnitY(Z_X)-75*Sin(GetUnitFacing(Z_X)*bj_DEGTORAD)))
endif
call DestroyEffect(AddSpecialEffect(ZMX(3),GetUnitX(ZSX),GetUnitY(ZSX)))
set Z2X=CreateTrigger()
set OHV=Z2X
set OJV=ZZX
call TriggerRegisterUnitEvent(Z2X,Z_X,EVENT_UNIT_ATTACKED)
call SaveTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger"),Z2X)
call TriggerAddCondition(Z2X,Condition(function ZWX))
call ExecuteFunc("Z3X")
else
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Target"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Actions"))
call SaveInteger(FF,ZZX,StringHash("Omnislash Caster Now"),Z1X+990)
call DestroyEffect(LoadEffectHandle(FF,ZZX,StringHash("Omnislash Caster Effect")))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Effect"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Time"))
call SetUnitVertexColor(ZSX,112,128,144,255)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,false)
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02A',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I038',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02A',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I038',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02A',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I038',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02A',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I038',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02A',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I038',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02A',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I038',5)
endif
endif
set ZSX=null
set MME=null
set Z_X=null
call DestroyGroup(Z0X)
set Z0X=null
set Z2X=null
endfunction
function Z4X takes nothing returns nothing
local unit ZSX=GetAttacker()
local integer ZZX=GetHandleId(ZSX)
local trigger Z2X=CreateTrigger()
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call TriggerRegisterUnitEvent(Z2X,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call SaveTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger"),Z2X)
call TriggerAddCondition(Z2X,Condition(function ZUX))
call SaveTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action"),TriggerAddAction(Z2X,function ZYX))
set ZSX=null
set Z2X=null
endfunction
function Z3X takes nothing returns nothing
call SaveTriggerActionHandle(FF,OJV,StringHash("Omnislash Caster Trigger Action"),TriggerAddAction(OHV,function Z4X))
endfunction
function Z5X takes unit ZSX,boolean Z6X returns nothing
local unit Z_X=null
local group Z0X=CreateGroup()
local integer ZZX=GetHandleId(ZSX)
local integer Z7X=0
local integer Z1X=LoadInteger(FF,ZZX,StringHash("Omnislash Caster Now"))
local trigger Z2X=null
if Z6X==false then
call GroupEnumUnitsInRange(Z0X,GetUnitX(ZSX),GetUnitY(ZSX),I2R(ZKX(3)),null)
loop
set Z_X=GroupPickRandomUnit(Z0X)
exitwhen ZQX(ZSX,Z_X)or Z_X==null
call GroupRemoveUnit(Z0X,Z_X)
endloop
if(Z_X!=null and GetWidgetLife(Z_X)>.405)or ZQX(ZSX,LoadUnitHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Target")))then
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call SaveUnitHandle(FF,ZZX,StringHash("Omnislash Caster Target"),Z_X)
call SaveInteger(FF,ZZX,StringHash("Omnislash Caster Now"),Z1X+1)
call SaveReal(FF,ZZX,StringHash("Omnislash Caster Time"),.0)
set Z2X=CreateTrigger()
call TriggerRegisterUnitEvent(Z2X,Z_X,EVENT_UNIT_ATTACKED)
call SaveTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger"),Z2X)
call TriggerAddCondition(Z2X,Condition(function ZWX))
call SaveTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action"),TriggerAddAction(Z2X,function Z4X))
call DestroyEffect(AddSpecialEffect(ZMX(2),GetUnitX(ZSX),GetUnitY(ZSX)))
call SetUnitX(ZSX,(GetUnitX(Z_X)-75*Cos(GetUnitFacing(Z_X)*bj_DEGTORAD)))
call SetUnitY(ZSX,(GetUnitY(Z_X)-75*Sin(GetUnitFacing(Z_X)*bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect(ZMX(3),GetUnitX(ZSX),GetUnitY(ZSX)))
else
call TriggerRemoveAction(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,ZZX,StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,ZZX,StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Target"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Actions"))
call SaveInteger(FF,ZZX,StringHash("Omnislash Caster Now"),Z1X+990)
call DestroyEffect(LoadEffectHandle(FF,ZZX,StringHash("Omnislash Caster Effect")))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Effect"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Time"))
call SetUnitVertexColor(ZSX,112,128,144,100)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,false)
call SetUnitPathing(ZSX,true)
call SetUnitVertexColor(ZSX,112,128,144,255)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,false)
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02A',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I038',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02A',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I038',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02A',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I038',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02A',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I038',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02A',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I038',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02A',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I038',5)
endif
call Z5X(ZSX,true)
endif
else
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Target"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Actions"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Now"))
call DestroyEffect(LoadEffectHandle(FF,ZZX,StringHash("Omnislash Caster Effect")))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Effect"))
call RemoveSavedHandle(FF,ZZX,StringHash("Omnislash Caster Time"))
call SetUnitVertexColor(ZSX,112,128,144,255)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,false)
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02A',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I038',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02A',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I038',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02A',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I038',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02A',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I038',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02A',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I038',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02A',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I038',5)
endif
call SetUnitPathing(ZSX,true)
call UnitRemoveAbility(ZSX,ZKX(5))
call UnitRemoveAbility(ZSX,'A0K6')
if GetLocalPlayer()==GetOwningPlayer(ZSX)then
call ClearSelection()
call SelectUnit(ZSX,true)
endif
endif
set Z_X=null
call DestroyGroup(Z0X)
set Z0X=null
set Z2X=null
endfunction
function Z8X takes nothing returns nothing
local timer Z9X=GetExpiredTimer()
local integer ZZX=GetHandleId(Z9X)
local unit ZSX=LoadUnitHandle(FF,ZZX,1)
local integer VVO=GetHandleId(ZSX)
local integer VEO=LoadInteger(FF,VVO,StringHash("Omnislash Caster Actions"))
local integer Z1X=LoadInteger(FF,VVO,StringHash("Omnislash Caster Now"))
local real VXO=LoadReal(FF,VVO,StringHash("Omnislash Caster Time"))+.025
local integer Z7X=0
call SetUnitPathing(ZSX,false)
call SetUnitVertexColor(ZSX,112,128,144,100)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,true)
call IssueTargetOrderById(ZSX,851983,LoadUnitHandle(FF,VVO,StringHash("Omnislash Caster Target")))
loop
if IsUnitSelected(ZSX,Player(Z7X))and ZGX(1)then
if GetLocalPlayer()==Player(Z7X)then
call SelectUnit(ZSX,false)
endif
endif
exitwhen Z7X>12
set Z7X=Z7X+1
endloop
if VXO<2.2 then
call SaveReal(FF,VVO,StringHash("Omnislash Caster Time"),VXO)
else
call SaveReal(FF,VVO,StringHash("Omnislash Caster Time"),0)
if Z1X<VEO then
call Z5X(ZSX,false)
endif
endif
if ZQX(ZSX,LoadUnitHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Target")))==false then
call Z5X(ZSX,false)
endif
if Z1X>=VEO then
call SetUnitPathing(ZSX,true)
call SetUnitVertexColor(ZSX,112,128,144,255)
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,false)
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02A',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I038',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02A',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I038',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02A',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I038',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02A',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I038',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02A',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I038',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I042' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02A',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I043' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I044' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I038',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I04W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I04W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I04W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I04W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I04W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I04X' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I04W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I04R',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I04R',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I04R',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I04R',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I04R',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I04S' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I04R',5)
endif
call Z5X(ZSX,true)
call DestroyTimer(Z9X)
call FlushChildHashtable(FF,ZZX)
endif
set Z9X=null
set ZSX=null
endfunction
function VOO takes nothing returns nothing
local timer Z9X=CreateTimer()
local integer ZZX=GetHandleId(Z9X)
local unit ZSX=GetSpellAbilityUnit()
local unit MME=GetSpellTargetUnit()
local integer VRO=GetUnitAbilityLevel(ZSX,ZKX(1))
local integer VEO=ZKX(2)*VRO
local effect VIO=AddSpecialEffectTarget(ZMX(1),ZSX,"weapon")
local trigger Z2X=CreateTrigger()
call UnitAddAbility(ZSX,ZKX(5))
call UnitAddAbility(ZSX,'A0K6')
call SetUnitAbilityLevel(ZSX,'A0K6',GetUnitAbilityLevel(ZSX,'A07R'))
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I042',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I043',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I044',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I042',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I043',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I044',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I042',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I043',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I044',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I042',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I043',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I044',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I042',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I043',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I044',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I02A' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I042',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I02W' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I043',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I038' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I044',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I04X',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I04X',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I04X',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I04X',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I04X',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I04W' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I04X',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I04S',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I04S',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I04S',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I04S',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I04S',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I04R' then
call RemoveItem(UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I04S',5)
endif
call UnitRemoveBuffs(ZSX,false,true)
call SetUnitInvulnerable(ZSX,true)
call SetUnitPathing(ZSX,false)
call SetUnitVertexColor(ZSX,112,128,144,100)
call TriggerSleepAction(0)
call TriggerRemoveAction(LoadTriggerHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger")),LoadTriggerActionHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action")))
call DestroyTrigger(LoadTriggerHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Target"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Actions"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Now"))
call DestroyEffect(LoadEffectHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Effect")))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Effect"))
call RemoveSavedHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Time"))
call SaveUnitHandle(FF,ZZX,1,ZSX)
call SaveUnitHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Target"),MME)
call SaveInteger(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Actions"),VEO)
call SaveInteger(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Now"),0)
call SaveEffectHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Effect"),VIO)
call SaveReal(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Time"),0)
call TriggerRegisterUnitEvent(Z2X,MME,EVENT_UNIT_ATTACKED)
call SaveTriggerHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger"),Z2X)
call TriggerAddCondition(Z2X,Condition(function ZWX))
call SaveTriggerActionHandle(FF,GetHandleId(ZSX),StringHash("Omnislash Caster Trigger Action"),TriggerAddAction(Z2X,function Z4X))
call SetUnitX(ZSX,(GetUnitX(MME)-75*Cos(GetUnitFacing(MME)*bj_DEGTORAD)))
call SetUnitY(ZSX,(GetUnitY(MME)-75*Sin(GetUnitFacing(MME)*bj_DEGTORAD)))
call TimerStart(Z9X,.025,true,function Z8X)
set Z9X=null
set ZSX=null
set MME=null
set VIO=null
set Z2X=null
endfunction
function VNO takes integer VRO returns real
if VRO==1 then
return 650.
elseif VRO==2 then
return 625.
elseif VRO==3 then
return 600.
elseif VRO==4 then
return 575.
elseif VRO==5 then
return 550.
elseif VRO==6 then
return 525.
elseif VRO==7 then
return 500.
elseif VRO==8 then
return 475.
elseif VRO==9 then
return 450.
elseif VRO==10 then
return 425.
endif
return .0
endfunction
function VBO takes nothing returns integer
local integer d=GIE()
local real CDE=90
local integer i=0
local real x
local real y
local location as=GetUnitLoc(GetSpellTargetUnit())
local location VCO=CNE(as,GetRandomReal(450.,800.),GetRandomReal(.0,360.))
set Y1V[d]=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h007',VCO,.0)
call UnitApplyTimedLife(Y1V[d],'BTLF',(1))
call RemoveLocation(as)
call RemoveLocation(VCO)
set as=null
set VCO=null
set ZRV[d]=GetSpellTargetUnit()
set Y3V[d]=GetOwningPlayer(Y1V[d])
set ZAV[d]=GetUnitX(ZRV[d])
set ZNV[d]=GetUnitY(ZRV[d])
set ZBV[d]=GetUnitX(Y1V[d])
set ZCV[d]=GetUnitY(Y1V[d])
set ZQV[d]=GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(Y1V[d])))],'A004')
set ZSV[d]=Atan2(ZNV[d]-ZCV[d],ZAV[d]-ZBV[d])
set Y6V[Y7V[d]]=ZBV[d]+45*Cos(ZSV[d]+(bj_DEGTORAD*90))
set ZVV[ZEV[d]]=ZCV[d]+45*Sin(ZSV[d]+(bj_DEGTORAD*-90))
call MoveLocation(OKV,ZBV[d],ZCV[d])
set x=ZBV[d]+20*Cos(ZSV[d]+(180*bj_DEGTORAD))
set y=ZCV[d]+20*Sin(ZSV[d]+(180*bj_DEGTORAD))
set Y2V[d]=CreateUnit(Y3V[d],'h00K',x,y,ZSV[d]*bj_RADTODEG)
set ZLV[d]=GetUnitFlyHeight(Y2V[d])
set ZJV[d]=-200.
//call UnitAddAbility(Y2V[d],'Aloc')
set ZIV[d]=CreateUnit(Y3V[d],'h001',ZBV[d],ZCV[d],bj_UNIT_FACING)
call IssueTargetOrder(ZIV[d],"slow",ZRV[d])
set ZMV[d]=AddSpecialEffectTarget("war3mapImported\\ShadowbindTarget.mdx",Y2V[d],"hand, left")
set ZPV[d]=AddSpecialEffectTarget("war3mapImported\\ShadowbindTarget.mdx",Y2V[d],"hand, right")
set Y6V[Y7V[d]]=ZBV[d]+45*Cos(ZSV[d]+(bj_DEGTORAD*CDE))
set ZVV[ZEV[d]]=ZCV[d]+45*Sin(ZSV[d]+(bj_DEGTORAD*CDE))
set Y6V[Y7V[d]+1]=ZBV[d]+45*Cos(ZSV[d]-(bj_DEGTORAD*CDE))
set ZVV[ZEV[d]+1]=ZCV[d]+45*Sin(ZSV[d]-(bj_DEGTORAD*CDE))
set Y8V[Y9V[d]]=ZAV[d]+45*Cos(ZSV[d]+(bj_DEGTORAD*CDE))
set ZXV[ZOV[d]]=ZNV[d]+45*Sin(ZSV[d]+(bj_DEGTORAD*CDE))
set Y8V[Y9V[d]+1]=ZAV[d]+45*Cos(ZSV[d]-(bj_DEGTORAD*CDE))
set ZXV[ZOV[d]+1]=ZNV[d]+45*Sin(ZSV[d]-(bj_DEGTORAD*CDE))
loop
exitwhen i==2
set CDE=-90.
set Y4V[Y5V[d]+i]=AddLightningEx("SPLK",true,Y6V[Y7V[d]+i],ZVV[ZEV[d]+i],ZJV[d],Y8V[Y9V[d]+i],ZXV[ZOV[d]+i],ZKV[d])
set i=i+1
endloop
set ZHV[d]=((ZQV[d])*9999.)
set ZDV[d]=VNO(ZQV[d])
set ZGV[d]=(((ZQV[d])*1.5)+10.)
set ZFV[d]=((ZQV[d])*15.)
return d
endfunction
function VDO takes nothing returns boolean
local integer d=PRE()
local integer i=0
local real CDE=90
local real x
local real y
local real dx
local real dy
local boolean b=false
local real UAE
local real r
set ZTV[d]=ZTV[d]+.04
call IssueTargetOrder(ZIV[d],"slow",ZRV[d])
set ZSV[d]=Atan2(ZNV[d]-ZCV[d],ZAV[d]-ZBV[d])
call SetUnitFacingTimed(Y2V[d],ZSV[d]*bj_RADTODEG,.0)
call QueueUnitAnimation(Y2V[d],"stand, channel")
set ZAV[d]=GetUnitX(ZRV[d])
set ZNV[d]=GetUnitY(ZRV[d])
set dx=ZAV[d]-ZBV[d]
set dy=ZNV[d]-ZCV[d]
if false then
set ZBV[d]=GetUnitX(Y1V[d])
set ZCV[d]=GetUnitY(Y1V[d])
endif
set x=ZBV[d]+20*Cos(ZSV[d]+(180*bj_DEGTORAD))
set y=ZCV[d]+20*Sin(ZSV[d]+(180*bj_DEGTORAD))
call SetUnitX(Y2V[d],x)
call SetUnitY(Y2V[d],y)
set Y6V[Y7V[d]]=ZBV[d]+45*Cos(ZSV[d]+(bj_DEGTORAD*CDE))
set ZVV[ZEV[d]]=ZCV[d]+45*Sin(ZSV[d]+(bj_DEGTORAD*CDE))
set Y6V[Y7V[d]+1]=ZBV[d]+45*Cos(ZSV[d]-(bj_DEGTORAD*CDE))
set ZVV[ZEV[d]+1]=ZCV[d]+45*Sin(ZSV[d]-(bj_DEGTORAD*CDE))
set Y8V[Y9V[d]]=ZAV[d]+45*Cos(ZSV[d]+(bj_DEGTORAD*CDE))
set ZXV[ZOV[d]]=ZNV[d]+45*Sin(ZSV[d]+(bj_DEGTORAD*CDE))
set Y8V[Y9V[d]+1]=ZAV[d]+45*Cos(ZSV[d]-(bj_DEGTORAD*CDE))
set ZXV[ZOV[d]+1]=ZNV[d]+45*Sin(ZSV[d]-(bj_DEGTORAD*CDE))
set UAE=(dx*dx+dy*dy)
call MoveLocation(OKV,ZAV[d],ZNV[d])
set ZKV[d]=GetLocationZ(OKV)+GetUnitFlyHeight(ZRV[d])+45
call MoveLocation(OKV,GetUnitX(Y2V[d]),GetUnitY(Y2V[d]))
set ZJV[d]=(GetLocationZ(OKV)+ZLV[d])+.0
loop
exitwhen i==2
set CDE=-90.
call MoveLightningEx(Y4V[Y5V[d]+i],true,Y6V[Y7V[d]+i],ZVV[ZEV[d]+i],ZJV[d],Y8V[Y9V[d]+i],ZXV[ZOV[d]+i],ZKV[d])
set i=i+1
endloop
set r=ZDV[d]+400
set r=r*r
if UAE>ZDV[d]*ZDV[d]and UAE<r and not M5E(ZRV[d])and not IsUnitType(ZRV[d],UNIT_TYPE_MAGIC_IMMUNE) and GetUnitTypeId(ZRV[d]) != 'E00E' then
call M6E(ZRV[d],400,.4,(bj_RADTODEG*ZSV[d])+180,"none.mdl",0,true,false)
set b=true
endif
if GetUnitTypeId(ZRV[d]) != 'E00E' and not b and(dx*dx+dy*dy)>ZDV[d]*ZDV[d]then
call M6E(ZRV[d],ZFV[d],.4,(bj_RADTODEG*ZSV[d])+180,"none.mdl",0,true,false)
endif
if ZTV[d]>=ZGV[d]or(dx*dx+dy*dy)>ZHV[d]*ZHV[d]or not UnitAlive(ZRV[d])or ZRV[d]==null then
call UnitRemoveAbility(ZRV[d],'B02X')
call UnitRemoveAbility(ZRV[d],'B02X')
call DestroyLightning(Y4V[Y5V[d]])
call DestroyLightning(Y4V[Y5V[d]+1])
call DestroyEffect(ZMV[d])
call DestroyEffect(ZPV[d])
call KillUnit(Y2V[d])
call KillUnit(ZIV[d])
call GAE(d)
return true
endif
return false
endfunction
/*function VFO takes nothing returns boolean
return GetSpellAbilityId()=='A004'
endfunction*/
function VGO takes nothing returns nothing
call PFE(function VDO,VBO(),.04)
call PFE(function VDO,VBO(),.04)
endfunction
function VHO takes integer VRO returns real
if VRO==1 then
return 400.
elseif VRO==2 then
return 500.
elseif VRO==3 then
return 600.
elseif VRO==4 then
return 700.
elseif VRO==5 then
return 800.
elseif VRO==6 then
return 1000.
elseif VRO==7 then
return 1200.
elseif VRO==8 then
return 1500.
elseif VRO==9 then
return 1800.
elseif VRO==10 then
return 2000.
endif
return .0
endfunction
function VJO takes integer VRO returns real
return 200.
endfunction
function VKO takes nothing returns integer
local integer d=GOE()
local real CDE=90
local integer i=0
local real x
local real y
local location as=GetUnitLoc(GetTriggerUnit())
local location VCO=CNE(as,150.,GetUnitFacing(GetTriggerUnit()))
set ZZV[d]=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h007',VCO,.0)
call UnitApplyTimedLife(ZZV[d],'BTLF',(2))
call RemoveLocation(as)
call RemoveLocation(VCO)
set as=null
set VCO=null
set VEE[d]=GetSpellTargetUnit()
set Z0V[d]=GetOwningPlayer(ZZV[d])
set VOE[d]=GetUnitX(VEE[d])
set VRE[d]=GetUnitY(VEE[d])
set VIE[d]=GetUnitX(ZZV[d])
set VAE[d]=GetUnitY(ZZV[d])
set VLE[d]=GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(ZZV[d])))],'A09F')
set VME[d]=Atan2(VRE[d]-VAE[d],VOE[d]-VIE[d])
set Z3V[Z4V[d]]=VIE[d]+45*Cos(VME[d]+(bj_DEGTORAD*90))
set Z7V[Z8V[d]]=VAE[d]+45*Sin(VME[d]+(bj_DEGTORAD*-90))
call MoveLocation(OLV,VIE[d],VAE[d])
set x=VIE[d]+20*Cos(VME[d]+(180*bj_DEGTORAD))
set y=VAE[d]+20*Sin(VME[d]+(180*bj_DEGTORAD))
set Z_V[d]=CreateUnit(Z0V[d],'h00K',x,y,VME[d]*bj_RADTODEG)
set VHE[d]=GetUnitFlyHeight(Z_V[d])
set VFE[d]=-200.
//call UnitAddAbility(Z_V[d],'Aloc')
set VXE[d]=CreateUnit(Z0V[d],'h001',VIE[d],VAE[d],bj_UNIT_FACING)
call IssueTargetOrder(VXE[d],"stop",VEE[d])
set VJE[d]=AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",Z_V[d],"hand, left")
set VKE[d]=AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx",Z_V[d],"hand, right")
set Z3V[Z4V[d]]=VIE[d]+45*Cos(VME[d]+(bj_DEGTORAD*CDE))
set Z7V[Z8V[d]]=VAE[d]+45*Sin(VME[d]+(bj_DEGTORAD*CDE))
set Z3V[Z4V[d]+1]=VIE[d]+45*Cos(VME[d]-(bj_DEGTORAD*CDE))
set Z7V[Z8V[d]+1]=VAE[d]+45*Sin(VME[d]-(bj_DEGTORAD*CDE))
set Z5V[Z6V[d]]=VOE[d]+45*Cos(VME[d]+(bj_DEGTORAD*CDE))
set Z9V[VVE[d]]=VRE[d]+45*Sin(VME[d]+(bj_DEGTORAD*CDE))
set Z5V[Z6V[d]+1]=VOE[d]+45*Cos(VME[d]-(bj_DEGTORAD*CDE))
set Z9V[VVE[d]+1]=VRE[d]+45*Sin(VME[d]-(bj_DEGTORAD*CDE))
loop
exitwhen i==2
set CDE=-90.
set Z1V[Z2V[d]+i]=AddLightningEx("SPLK",true,Z3V[Z4V[d]+i],Z7V[Z8V[d]+i],VFE[d],Z5V[Z6V[d]+i],Z9V[VVE[d]+i],VGE[d])
set i=i+1
endloop
set VDE[d]=((VLE[d])*9999.)
set VNE[d]=VHO(VLE[d])
set VCE[d]=(20.+(10.*(VLE[d])))
set VBE[d]=VJO(VLE[d])
return d
endfunction
function VLO takes nothing returns boolean
local integer d=PRE()
local integer i=0
local real CDE=90
local real x
local real y
local real dx
local real dy
local boolean b=false
local real UAE
local real r
set VPE[d]=VPE[d]+.04
call IssueTargetOrder(VXE[d],"stop",VEE[d])
set VME[d]=Atan2(VRE[d]-VAE[d],VOE[d]-VIE[d])
call SetUnitFacingTimed(Z_V[d],VME[d]*bj_RADTODEG,.0)
call QueueUnitAnimation(Z_V[d],"stand, channel")
set VOE[d]=GetUnitX(VEE[d])
set VRE[d]=GetUnitY(VEE[d])
set dx=VOE[d]-VIE[d]
set dy=VRE[d]-VAE[d]
if false then
set VIE[d]=GetUnitX(ZZV[d])
set VAE[d]=GetUnitY(ZZV[d])
endif
set x=VIE[d]+20*Cos(VME[d]+(180*bj_DEGTORAD))
set y=VAE[d]+20*Sin(VME[d]+(180*bj_DEGTORAD))
call SetUnitX(Z_V[d],x)
call SetUnitY(Z_V[d],y)
set Z3V[Z4V[d]]=VIE[d]+45*Cos(VME[d]+(bj_DEGTORAD*CDE))
set Z7V[Z8V[d]]=VAE[d]+45*Sin(VME[d]+(bj_DEGTORAD*CDE))
set Z3V[Z4V[d]+1]=VIE[d]+45*Cos(VME[d]-(bj_DEGTORAD*CDE))
set Z7V[Z8V[d]+1]=VAE[d]+45*Sin(VME[d]-(bj_DEGTORAD*CDE))
set Z5V[Z6V[d]]=VOE[d]+45*Cos(VME[d]+(bj_DEGTORAD*CDE))
set Z9V[VVE[d]]=VRE[d]+45*Sin(VME[d]+(bj_DEGTORAD*CDE))
set Z5V[Z6V[d]+1]=VOE[d]+45*Cos(VME[d]-(bj_DEGTORAD*CDE))
set Z9V[VVE[d]+1]=VRE[d]+45*Sin(VME[d]-(bj_DEGTORAD*CDE))
set UAE=(dx*dx+dy*dy)
call MoveLocation(OLV,VOE[d],VRE[d])
set VGE[d]=GetLocationZ(OLV)+GetUnitFlyHeight(VEE[d])+45
call MoveLocation(OLV,GetUnitX(Z_V[d]),GetUnitY(Z_V[d]))
set VFE[d]=(GetLocationZ(OLV)+VHE[d])+.0
loop
exitwhen i==2
set CDE=-90.
call MoveLightningEx(Z1V[Z2V[d]+i],true,Z3V[Z4V[d]+i],Z7V[Z8V[d]+i],VFE[d],Z5V[Z6V[d]+i],Z9V[VVE[d]+i],VGE[d])
set i=i+1
endloop
set r=VNE[d]+400
set r=r*r
if UAE>VNE[d]*VNE[d]and UAE<r and not M5E(VEE[d])then
call M6E(VEE[d],400,.4,(bj_RADTODEG*VME[d])+180,"none.mdl",0,true,false)
set b=true
endif
if not b and(dx*dx+dy*dy)>VNE[d]*VNE[d]then
call M6E(VEE[d],VBE[d],.4,(bj_RADTODEG*VME[d])+180,"none.mdl",0,true,false)
endif
if VPE[d]>=VCE[d]or(dx*dx+dy*dy)>VDE[d]*VDE[d]or not UnitAlive(VEE[d])or VEE[d]==null then
call UnitRemoveAbility(VEE[d],'B02X')
call UnitRemoveAbility(VEE[d],'B02X')
call DestroyLightning(Z1V[Z2V[d]])
call DestroyLightning(Z1V[Z2V[d]+1])
call DestroyEffect(VJE[d])
call DestroyEffect(VKE[d])
call KillUnit(Z_V[d])
call KillUnit(VXE[d])
call GRE(d)
return true
endif
return false
endfunction
/*function VMO takes nothing returns boolean
return GetSpellAbilityId()=='A09F'
endfunction*/
function VPO takes nothing returns nothing
call PFE(function VLO,VKO(),.04)
call UnitAddAbility(GetSpellTargetUnit(),'A09G')
call UnitAddAbility(GetSpellTargetUnit(),'A09H')
call SetUnitAbilityLevel(GetSpellTargetUnit(),'A09G',GetUnitAbilityLevel(GetTriggerUnit(),'A09F'))
call SetUnitAbilityLevel(GetSpellTargetUnit(),'A09H',GetUnitAbilityLevel(GetTriggerUnit(),'A09F'))
call SetUnitVertexColor(GetSpellTargetUnit(),50,50,50,100)
if GetUnitAbilityLevel(GetSpellTargetUnit(),'A04P')!=0 then
call UnitRemoveAbility(GetSpellTargetUnit(),'A04P')
endif
if GetUnitAbilityLevel(GetSpellTargetUnit(),'A0E0')!=0 then
call UnitRemoveAbility(GetSpellTargetUnit(),'A0E0')
endif
if GetUnitAbilityLevel(GetSpellTargetUnit(),'A04S')!=0 then
call UnitRemoveAbility(GetSpellTargetUnit(),'A04S')
endif
call UnitApplyTimedLife(GetSpellTargetUnit(),'BTLF',20.+(10.*GetUnitAbilityLevel(GetTriggerUnit(),'A09F')))
endfunction
function VQO takes integer VRO returns real
if VRO==1 then
return 700.
elseif VRO==2 then
return 800.
elseif VRO==3 then
return 700.
elseif VRO==4 then
return 600.
endif
return .0
endfunction
function VSO takes nothing returns integer
local integer d=GEE()
local real CDE=90
local integer i=0
local real x
local real y
set VUE[d]=GetTriggerUnit()
set V8E[d]=GetSpellTargetUnit()
set VYE[d]=GetOwningPlayer(VUE[d])
set EVE[d]=GetUnitX(V8E[d])
set EEE[d]=GetUnitY(V8E[d])
set EXE[d]=GetUnitX(VUE[d])
set EOE[d]=GetUnitY(VUE[d])
set EHE[d]=GetUnitAbilityLevel(VUE[d],'A00F')
set EJE[d]=Atan2(EEE[d]-EOE[d],EVE[d]-EXE[d])
set V0E[V1E[d]]=EXE[d]+45*Cos(EJE[d]+(bj_DEGTORAD*90))
set V4E[V5E[d]]=EOE[d]+45*Sin(EJE[d]+(bj_DEGTORAD*-90))
call MoveLocation(OMV,EXE[d],EOE[d])
set x=EXE[d]+20*Cos(EJE[d]+(180*bj_DEGTORAD))
set y=EOE[d]+20*Sin(EJE[d]+(180*bj_DEGTORAD))
set VWE[d]=CreateUnit(VYE[d],'h007',x,y,EJE[d]*bj_RADTODEG)
set EDE[d]=GetUnitFlyHeight(VWE[d])
set EBE[d]=-150.
//call UnitAddAbility(VWE[d],'Aloc')
set V9E[d]=CreateUnit(VYE[d],'h007',EXE[d],EOE[d],bj_UNIT_FACING)
call IssueTargetOrder(V9E[d],"",V8E[d])
set EFE[d]=AddSpecialEffectTarget("",VWE[d],"hand, left")
set EGE[d]=AddSpecialEffectTarget("",VWE[d],"hand, right")
set V0E[V1E[d]]=EXE[d]+45*Cos(EJE[d]+(bj_DEGTORAD*CDE))
set V4E[V5E[d]]=EOE[d]+45*Sin(EJE[d]+(bj_DEGTORAD*CDE))
set V0E[V1E[d]+1]=EXE[d]+45*Cos(EJE[d]-(bj_DEGTORAD*CDE))
set V4E[V5E[d]+1]=EOE[d]+45*Sin(EJE[d]-(bj_DEGTORAD*CDE))
set V2E[V3E[d]]=EVE[d]+45*Cos(EJE[d]+(bj_DEGTORAD*CDE))
set V6E[V7E[d]]=EEE[d]+45*Sin(EJE[d]+(bj_DEGTORAD*CDE))
set V2E[V3E[d]+1]=EVE[d]+45*Cos(EJE[d]-(bj_DEGTORAD*CDE))
set V6E[V7E[d]+1]=EEE[d]+45*Sin(EJE[d]-(bj_DEGTORAD*CDE))
loop
exitwhen i==2
set CDE=-90.
set VZE[V_E[d]+i]=AddLightningEx("PONC",true,V0E[V1E[d]+i],V4E[V5E[d]+i],EBE[d],V2E[V3E[d]+i],V6E[V7E[d]+i],ECE[d])
set i=i+1
endloop
set ENE[d]=((EHE[d])*9999.)
set ERE[d]=VQO(EHE[d])
set EAE[d]=((EHE[d])*99999.)
set EIE[d]=((EHE[d])*200.)
return d
endfunction
function VTO takes nothing returns boolean
local integer d=PRE()
local integer i=0
local real CDE=90
local real x
local real y
local real dx
local real dy
local boolean b=false
local real UAE
local real r
set EKE[d]=EKE[d]+.04
call IssueTargetOrder(V9E[d],"",V8E[d])
set EJE[d]=Atan2(EEE[d]-EOE[d],EVE[d]-EXE[d])
call SetUnitFacingTimed(VWE[d],EJE[d]*bj_RADTODEG,.0)
call QueueUnitAnimation(VWE[d],"spell")
set EVE[d]=GetUnitX(V8E[d])
set EEE[d]=GetUnitY(V8E[d])
set dx=EVE[d]-EXE[d]
set dy=EEE[d]-EOE[d]
if false then
set EXE[d]=GetUnitX(VUE[d])
set EOE[d]=GetUnitY(VUE[d])
endif
set x=EXE[d]+20*Cos(EJE[d]+(180*bj_DEGTORAD))
set y=EOE[d]+20*Sin(EJE[d]+(180*bj_DEGTORAD))
call SetUnitX(VWE[d],x)
call SetUnitY(VWE[d],y)
set V0E[V1E[d]]=EXE[d]+45*Cos(EJE[d]+(bj_DEGTORAD*CDE))
set V4E[V5E[d]]=EOE[d]+45*Sin(EJE[d]+(bj_DEGTORAD*CDE))
set V0E[V1E[d]+1]=EXE[d]+45*Cos(EJE[d]-(bj_DEGTORAD*CDE))
set V4E[V5E[d]+1]=EOE[d]+45*Sin(EJE[d]-(bj_DEGTORAD*CDE))
set V2E[V3E[d]]=EVE[d]+45*Cos(EJE[d]+(bj_DEGTORAD*CDE))
set V6E[V7E[d]]=EEE[d]+45*Sin(EJE[d]+(bj_DEGTORAD*CDE))
set V2E[V3E[d]+1]=EVE[d]+45*Cos(EJE[d]-(bj_DEGTORAD*CDE))
set V6E[V7E[d]+1]=EEE[d]+45*Sin(EJE[d]-(bj_DEGTORAD*CDE))
set UAE=(dx*dx+dy*dy)
call MoveLocation(OMV,EVE[d],EEE[d])
set ECE[d]=GetLocationZ(OMV)+GetUnitFlyHeight(V8E[d])+45
call MoveLocation(OMV,GetUnitX(VWE[d]),GetUnitY(VWE[d]))
set EBE[d]=(GetLocationZ(OMV)+EDE[d])+.0
loop
exitwhen i==2
set CDE=-90.
call MoveLightningEx(VZE[V_E[d]+i],true,V0E[V1E[d]+i],V4E[V5E[d]+i],EBE[d],V2E[V3E[d]+i],V6E[V7E[d]+i],ECE[d])
set i=i+1
endloop
set r=ERE[d]+400
set r=r*r
if UAE>ERE[d]*ERE[d]and UAE<r and not M5E(V8E[d])then
call M6E(V8E[d],400,.4,(bj_RADTODEG*EJE[d])+180,"war3mapImported\\SpiritWalkerChange3.mdx",0,true,false)
set b=true
endif
if not b and(dx*dx+dy*dy)>ERE[d]*ERE[d]then
call M6E(V8E[d],EIE[d],.4,(bj_RADTODEG*EJE[d])+180,"war3mapImported\\SpiritWalkerChange3.mdx",0,true,false)
endif
if EKE[d]>=EAE[d]or(dx*dx+dy*dy)>ENE[d]*ENE[d]or not UnitAlive(V8E[d])or V8E[d]==null then
call UnitRemoveAbility(V8E[d],'B000')
call UnitRemoveAbility(V8E[d],'B000')
call DestroyLightning(VZE[V_E[d]])
call DestroyLightning(VZE[V_E[d]+1])
call DestroyEffect(EFE[d])
call DestroyEffect(EGE[d])
call KillUnit(VWE[d])
call KillUnit(V9E[d])
call GXE(d)
return true
endif
return false
endfunction
/*function VUO takes nothing returns boolean
return GetSpellAbilityId()=='A00F'
endfunction*/
function VWO takes nothing returns nothing
call PFE(function VTO,VSO(),.04)
endfunction
function VYO takes nothing returns integer
local integer PXE=GVE()
if EYE[PXE]==null then
set EYE[PXE]=CreateGroup()
endif
return PXE
endfunction
function VZO takes integer D0E returns nothing
if D0E==null then
return
elseif(EPE[D0E]!=-1)then
return
endif
call GroupClear(EYE[(D0E)])
set EPE[D0E]=ELE
set ELE=D0E
endfunction
function V_O takes nothing returns boolean
local unit u=GetFilterUnit()
if UnitAlive(u)and IsUnitEnemy(u,GetOwningPlayer(OSV))and not IsUnitInGroup(u,OQV)then
if GetUnitAbilityLevel(u,'A06V')!=1 then
call UnitAddAbility(u,'A06V')
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,-1.*(.15+(.01*GetHeroLevel(OSV))) )
endif
call UnitDamageTargetEx((OSV),(u),((I2R(OTV*GetHeroInt(OSV,true)))*.4),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call GroupAddUnit(OQV,u)
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",u,"origin"))
endif
set u=null
return false
endfunction
function V0O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real x
local real y
if EUE[PXE]<=0 then
call RemoveUnit(ESE[PXE])
call VZO(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set EWE[PXE]=EWE[PXE]+4.
set x=(((GetUnitX(EQE[PXE]))*1.)+((400.)*1.)*Cos(((EWE[PXE])*1.)*bj_DEGTORAD))
set y=(((GetUnitY(EQE[PXE]))*1.)+((400.)*1.)*Sin(((EWE[PXE])*1.)*bj_DEGTORAD))
call SetUnitX(ESE[PXE],x)
call SetUnitY(ESE[PXE],y)
if GetUnitFlyHeight(EQE[PXE])>0 then
call SetUnitFlyHeight(ESE[PXE],GetUnitFlyHeight(EQE[PXE]),0)
endif
set OSV=EQE[PXE]
set OTV=ETE[PXE]
set OQV=EYE[PXE]
call GroupEnumUnitsInRange(OPV,x,y,116.,Filter(function V_O))
set EUE[PXE]=EUE[PXE]-4
call SetTimerData(t,PXE)
call TimerStart(t,.0325,false,function V0O)
endif
set t=null
endfunction
function V1O takes nothing returns nothing
local unit OIX=GetTriggerUnit()
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local integer i
local real a
local real OJX
local real OKX
local timer t=NewTimer()
local integer PXE=VYO()
if GetSpellAbilityId()=='A06S' then
set i=GetUnitAbilityLevel(OIX,'A06S')
set a=.0
elseif GetSpellAbilityId()=='A07V' then
set i=GetUnitAbilityLevel(OIX,'A07V')
set a=90.
elseif GetSpellAbilityId()=='A0J3' then
set i=GetUnitAbilityLevel(OIX,'A0J3')
set a=180.
elseif GetSpellAbilityId()=='A08L' then
set i=GetUnitAbilityLevel(OIX,'A08L')
set a=270.
endif
set a=a+GetUnitFacing(OIX)
set OJX=(((OAX)*1.)+((400.)*1.)*Cos(((a)*1.)*bj_DEGTORAD))
set OKX=(((ONX)*1.)+((400.)*1.)*Sin(((a)*1.)*bj_DEGTORAD))
set EQE[PXE]=OIX
set ETE[PXE]=i
set EUE[PXE]=360*i
set EWE[PXE]=a
set ESE[PXE]=CreateUnit(GetOwningPlayer(OIX),'h00T',OJX,OKX,.0)
call SetUnitPathing(ESE[PXE],false)
call UnitAddAbility(ESE[PXE],'Amrf')
call SetTimerData(t,PXE)
call TimerStart(t,.0325,false,function V0O)
set OIX=null
set t=null
endfunction
/*function V2O takes nothing returns boolean
if GetSpellAbilityId()=='A06S' or GetSpellAbilityId()=='A07V' or GetSpellAbilityId()=='A0J3' or GetSpellAbilityId()=='A08L' then
call V1O()
endif
return false
endfunction*/
function V4O takes unit U0E,unit YSE returns boolean
return IsUnitEnemy(YSE,GetOwningPlayer(U0E))and not(IsUnitType(YSE,UNIT_TYPE_STRUCTURE))and not(IsUnitType(YSE,UNIT_TYPE_MAGIC_IMMUNE))
endfunction
function V5O takes unit U0E,unit YSE returns boolean
return IsUnitEnemy(YSE,GetOwningPlayer(U0E))and not(IsUnitType(YSE,UNIT_TYPE_STRUCTURE))and not(IsUnitType(YSE,UNIT_TYPE_MAGIC_IMMUNE))
endfunction
function V6O takes real x,real y returns real
call MoveLocation(OUV,x,y)
return GetLocationZ(OUV)
endfunction
function V7O takes nothing returns nothing
local timer t=GetExpiredTimer()
call RemoveUnit(LoadUnitHandle(OYV,GetHandleId(t),0))
call FlushChildHashtable(OYV,GetHandleId(t))
call DestroyTimer(t)
set t=null
endfunction
function V8O takes unit J2E,real V9O returns nothing
local timer t=CreateTimer()
call SaveUnitHandle(OYV,GetHandleId(t),0,J2E)
call TimerStart(t,V9O,false,function V7O)
set t=null
endfunction
function EVO takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=LoadUnitHandle(OYV,GetHandleId(t),0)
call PauseUnit(u,true)
call SetUnitX(u,LoadReal(OYV,GetHandleId(t),1))
call SetUnitY(u,LoadReal(OYV,GetHandleId(t),2))
call SetUnitAnimation(u,"spell")
call QueueUnitAnimation(u,"spell")
call FlushChildHashtable(OYV,GetHandleId(t))
call DestroyTimer(t)
set t=null
set u=null
endfunction
function EEO takes unit J2E returns nothing
local timer t=CreateTimer()
call SaveUnitHandle(OYV,GetHandleId(t),0,J2E)
call SaveReal(OYV,GetHandleId(t),1,GetUnitX(J2E))
call SaveReal(OYV,GetHandleId(t),2,GetUnitY(J2E))
call TimerStart(t,0,false,function EVO)
set t=null
endfunction
function EXO takes timer t returns nothing
local integer Id=GetHandleId(t)
call V8O(LoadUnitHandle(OYV,Id,2),2)
call DestroyGroup(LoadGroupHandle(OYV,Id,5))
call DestroyGroup(LoadGroupHandle(OYV,Id,6))
call RemoveDestructable(LoadDestructableHandle(OYV,Id,10))
call RemoveDestructable(LoadDestructableHandle(OYV,Id,11))
call RemoveDestructable(LoadDestructableHandle(OYV,Id,12))
call RemoveDestructable(LoadDestructableHandle(OYV,Id,13))
call FlushChildHashtable(OYV,Id)
call DestroyTimer(t)
endfunction
function EOO takes unit U0E,group ERO returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local unit O3X
local unit u
local timer t
loop
set u=FirstOfGroup(ERO)
exitwhen u==null
call GroupRemoveUnit(ERO,u)
if IsUnitInGroup(u,LoadGroupHandle(OYV,Id,5))then
set t=LoadTimerHandle(OYV,Id,GetHandleId(u))
call PauseUnit(u,false)
call SetUnitTimeScale(u,1)
call GroupRemoveUnit(LoadGroupHandle(OYV,Id,5),u)
call RemoveUnit(LoadUnitHandle(OYV,GetHandleId(t),2))
call DestroyEffect(LoadEffectHandle(OYV,GetHandleId(t),4))
call FlushChildHashtable(OYV,GetHandleId(t))
call DestroyTimer(t)
set t=null
endif
if not IsUnitInGroup(u,LoadGroupHandle(OYV,Id,6))and GetWidgetLife(u)>.405 and V6O(GetUnitX(u),GetUnitY(u))+GetUnitFlyHeight(u)<=LoadReal(OYV,Id,3)+O3V and V5O(U0E,u)then
set O3X=CreateUnit(GetOwningPlayer(U0E),'h007',GetUnitX(u),GetUnitY(u),0)
call UnitAddAbility(O3X,'A06U')
call SetUnitAbilityLevel(O3X,'A06U',LoadInteger(OYV,Id,1))
call IssueTargetOrder(O3X,"frostnova",u)
call V8O(O3X,1)
call GroupAddUnit(LoadGroupHandle(OYV,Id,6),u)
endif
endloop
set O3X=null
endfunction
function EIO takes nothing returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local real EAO=LoadReal(OYV,Id,4)-.04
local unit U0E
local unit u
call SaveReal(OYV,Id,4,EAO)
call GroupEnumUnitsInRange(OWV,GetUnitX(LoadUnitHandle(OYV,Id,2)),GetUnitY(LoadUnitHandle(OYV,Id,2)),(1-EAO/1.4)*O2V[LoadInteger(OYV,Id,1)]*1.3,null)
call EOO(LoadUnitHandle(OYV,Id,0),OWV)
if EAO<=0 then
call EOO(LoadUnitHandle(OYV,Id,0),LoadGroupHandle(OYV,Id,5))
call EXO(GetExpiredTimer())
endif
endfunction
function ENO takes nothing returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local unit U0E=LoadUnitHandle(OYV,Id,0)
local real x=GetUnitX(U0E)
local real y=GetUnitY(U0E)
local real K0E=GetUnitFacing(U0E)*bj_DEGTORAD
local real EBO=O2V[LoadInteger(OYV,Id,1)]*1.18/450
local real EAO=LoadReal(OYV,Id,4)-.04
call SaveReal(OYV,Id,4,EAO)
if EAO>=.78 then
if EAO>=2 then
call SaveReal(OYV,Id,4,1.04)
call TimerStart(GetExpiredTimer(),.04,true,function ENO)
return
endif
call SetUnitX(U0E,x+770*EBO*.04*Cos(K0E))
call SetUnitY(U0E,y+770*EBO*.04*Sin(K0E))
call SetUnitFlyHeight(U0E,280+LoadReal(OYV,Id,3)-V6O(x,y)+(1.04-EAO)*231*EBO,0)
elseif EAO>=.52 then
call SetUnitTimeScale(U0E,1)
call SetUnitX(U0E,x+461*EBO*.04*Cos(K0E))
call SetUnitY(U0E,y+461*EBO*.04*Sin(K0E))
call SetUnitFlyHeight(U0E,280+LoadReal(OYV,Id,3)-V6O(x,y)+(240-EAO*231)*EBO,0)
elseif EAO>=.26 then
call SetUnitX(U0E,x+309*EBO*.04*Cos(K0E))
call SetUnitY(U0E,y+309*EBO*.04*Sin(K0E))
call SetUnitFlyHeight(U0E,280+LoadReal(OYV,Id,3)-V6O(x,y)+(EAO*77+80)*EBO,0)
elseif EAO>=0 then
call SetUnitX(U0E,x+193*EBO*.04*Cos(K0E))
call SetUnitY(U0E,y+193*EBO*.04*Sin(K0E))
call SetUnitFlyHeight(U0E,280+LoadReal(OYV,Id,3)-V6O(x,y)+(EAO*461-20)*EBO,0)
elseif EAO>-.4 then
call SetUnitFlyHeight(U0E,280+LoadReal(OYV,Id,3)-V6O(x,y)+EAO*650,0)
else
call SetUnitFlyHeight(U0E,30.,0)
call PauseUnit(U0E,false)
call SetUnitInvulnerable(U0E,false)
call SetUnitPosition(U0E,x,y)
call SaveReal(OYV,Id,4,1.4)
call SaveGroupHandle(OYV,Id,6,CreateGroup())
call TimerStart(GetExpiredTimer(),.04,true,function EIO)
endif
set U0E=null
endfunction
function ECO takes nothing returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local unit U0E=LoadUnitHandle(OYV,Id,0)
call SetUnitAnimation(U0E,"attack")
call QueueUnitAnimation(U0E,"stand")
call SetUnitTimeScale(U0E,.5)
call SetUnitAnimation(LoadUnitHandle(OYV,Id,2),"death")
call FlushChildHashtable(OYV,GetHandleId(LoadTimerHandle(OYV,Id,6)))
call DestroyTimer(LoadTimerHandle(OYV,Id,6))
call SaveReal(OYV,Id,4,3)
call TimerStart(GetExpiredTimer(),1.26,false,function ENO)
endfunction
function EDO takes nothing returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local integer EFO=LoadInteger(OYV,Id,0)
local unit YSE=LoadUnitHandle(OYV,Id,1)
local real x
local real y
if LoadBoolean(OYV,Id,3)then
set x=GetUnitX(LoadUnitHandle(OYV,Id,2))-GetUnitX(YSE)
set y=GetUnitY(LoadUnitHandle(OYV,Id,2))-GetUnitY(YSE)
if x*x+y*y<=90000 and not IsUnitHidden(YSE)then
call SaveBoolean(OYV,Id,3,false)
call PauseUnit(YSE,true)
call SetUnitTimeScale(YSE,0)
call TimerStart(GetExpiredTimer(),.04,true,function EDO)
else
call DestroyEffect(LoadEffectHandle(OYV,Id,4))
call RemoveUnit(LoadUnitHandle(OYV,Id,2))
call GroupRemoveUnit(LoadGroupHandle(OYV,EFO,5),YSE)
call FlushChildHashtable(OYV,Id)
call DestroyTimer(GetExpiredTimer())
endif
elseif GetWidgetLife(YSE)>O_V[LoadInteger(OYV,EFO,1)]*2 then
call UnitDamageTargetEx(LoadUnitHandle(OYV,EFO,0),YSE,O_V[LoadInteger(OYV,EFO,1)],false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
set YSE=null
endfunction
function EGO takes nothing returns nothing
call SaveEffectHandle(OYV,GetHandleId(GetExpiredTimer()),4,AddSpecialEffectTarget("war3mapImported\\SeaAura.mdx",LoadUnitHandle(OYV,GetHandleId(GetExpiredTimer()),1),"origin"))
call TimerStart(GetExpiredTimer(),.3,false,function EDO)
endfunction
function EHO takes nothing returns nothing
local integer Id=LoadInteger(OYV,GetHandleId(GetExpiredTimer()),0)
local group g=LoadGroupHandle(OYV,Id,5)
local real x
local real y
local unit YSE
local unit EJO
local timer t
call GroupEnumUnitsInRange(OWV,GetUnitX(LoadUnitHandle(OYV,Id,2)),GetUnitY(LoadUnitHandle(OYV,Id,2)),O2V[LoadInteger(OYV,Id,1)],null)
loop
set YSE=FirstOfGroup(OWV)
exitwhen YSE==null or(not IsUnitInGroup(YSE,g)and GetWidgetLife(YSE)>.405 and V6O(GetUnitX(YSE),GetUnitY(YSE))+GetUnitFlyHeight(YSE)<=LoadReal(OYV,Id,3)+O3V and V4O(LoadUnitHandle(OYV,Id,0),YSE))
call GroupRemoveUnit(OWV,YSE)
endloop
call GroupClear(OWV)
if YSE!=null then
set x=GetUnitX(YSE)
set y=GetUnitY(YSE)
call GroupAddUnit(g,YSE)
call SetSoundPosition(OZV,x,y,200)
call StartSound(OZV)
set EJO=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'n018',x,y,0)
call UnitAddAbility(EJO,'Amrf')
call UnitRemoveAbility(EJO,'Amrf')
call SetUnitX(EJO,x)
call SetUnitY(EJO,y)
call SetUnitFlyHeight(EJO,LoadReal(OYV,Id,3)-V6O(x,y),0)
call SetUnitAnimation(EJO,"death")
set t=CreateTimer()
call SaveInteger(OYV,GetHandleId(t),0,Id)
call SaveUnitHandle(OYV,GetHandleId(t),1,YSE)
call SaveUnitHandle(OYV,GetHandleId(t),2,EJO)
call SaveBoolean(OYV,GetHandleId(t),3,true)
call SaveTimerHandle(OYV,Id,GetHandleId(YSE),t)
call TimerStart(t,.4,false,function EGO)
set t=null
set EJO=null
set YSE=null
endif
set g=null
endfunction
function EKO takes nothing returns nothing
local timer t=CreateTimer()
local integer Id=GetHandleId(GetExpiredTimer())
local integer ELO=LoadInteger(OYV,Id,1)
call SaveGroupHandle(OYV,Id,5,CreateGroup())
call SaveTimerHandle(OYV,Id,6,t)
call SaveInteger(OYV,GetHandleId(t),0,Id)
call TimerStart(t,O1V[ELO],true,function EHO)
call TimerStart(GetExpiredTimer(),O0V[ELO],false,function ECO)
set t=null
endfunction
function EMO takes nothing returns nothing
local integer Id=GetHandleId(GetExpiredTimer())
local unit U0E=LoadUnitHandle(OYV,Id,0)
local real QCE=O2V[LoadInteger(OYV,Id,1)]*1.18/450
local real EAO=LoadReal(OYV,Id,4)-.04
call SetUnitFlyHeight(U0E,RMaxBJ(0,280+LoadReal(OYV,Id,3)-V6O(GetUnitX(U0E),GetUnitY(U0E))-EAO*200*QCE),0)
if EAO>0 then
call SaveReal(OYV,Id,4,EAO)
else
call SetUnitAnimation(U0E,"stand channel")
call QueueUnitAnimation(U0E,"stand channel")
call QueueUnitAnimation(U0E,"stand channel")
call TimerStart(GetExpiredTimer(),1.8,false,function EKO)
endif
set U0E=null
endfunction
function EPO takes unit U0E,integer ELO returns nothing
local timer t=CreateTimer()
local integer Id=GetHandleId(t)
local real ux=GetUnitX(U0E)
local real uy=GetUnitY(U0E)
local real CHE=O2V[ELO]*1.18
local real CDE=GetUnitFacing(U0E)*bj_DEGTORAD
local real x=ux+CHE*Cos(CDE)
local real y=uy+CHE*Sin(CDE)
local unit EQO=CreateUnit(GetOwningPlayer(U0E),'n019',x,y,CDE*bj_RADTODEG+180)
call UnitAddAbility(EQO,'Amrf')
call UnitRemoveAbility(EQO,'Amrf')
call SetUnitX(EQO,x)
call SetUnitY(EQO,y)
call SetUnitFlyHeight(EQO,260,0)
call SetUnitScale(EQO,CHE/450,1,1)
call SetUnitAnimation(EQO,"birth")
call SetUnitInvulnerable(U0E,true)
call EEO(U0E)
call UnitAddAbility(U0E,'Amrf')
call UnitRemoveAbility(U0E,'Amrf')
call SaveUnitHandle(OYV,Id,0,U0E)
call SaveInteger(OYV,Id,1,ELO)
call SaveUnitHandle(OYV,Id,2,EQO)
call SaveReal(OYV,Id,3,V6O(x,y))
call SaveReal(OYV,Id,4,2)
call SaveDestructableHandle(OYV,Id,10,CreateDestructable('YTfc',ux,uy,0,1,0))
call SaveDestructableHandle(OYV,Id,11,CreateDestructable('YTfc',x+CHE*Cos(CDE),y+CHE*Sin(CDE),0,1,0))
call SaveDestructableHandle(OYV,Id,12,CreateDestructable('YTfc',x+CHE*Cos(CDE+bj_PI*.5),y+CHE*Sin(CDE+bj_PI*.5),0,1,0))
call SaveDestructableHandle(OYV,Id,13,CreateDestructable('YTfc',x+CHE*Cos(CDE-bj_PI*.5),y+CHE*Sin(CDE-bj_PI*.5),0,1,0))
call TimerStart(t,.04,true,function EMO)
set EQO=null
set t=null
endfunction
function ESO takes nothing returns nothing
//if GetSpellAbilityId()=='A06T' then
call EPO(GetTriggerUnit(),GetUnitAbilityLevel(GetTriggerUnit(),'A06T'))
//endif
//return false
endfunction
function ETO takes nothing returns boolean
local real x1=GetUnitX(O5V)
local real y1=GetUnitY(O5V)
local real x2=GetUnitX(GetFilterUnit())
local real y2=GetUnitY(GetFilterUnit())
local real a=bj_RADTODEG*Atan2(y2-y1,x2-x1)
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(O5V))then
call M6E(GetFilterUnit(),124.,.6,a,"war3mapImported\\SlideWater.mdx",.0,false,false)
endif
return false
endfunction
function EUO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real x1=E2E[PXE]
local real y1=E3E[PXE]
local real x2=GetUnitX(E1E[PXE])
local real y2=GetUnitY(E1E[PXE])
local real d=SquareRoot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
local unit u
if E4E[PXE]<=0 then
call DestroyEffect(E5E[PXE])
if GetUnitAbilityLevel(E1E[PXE],'B00R')!=1 then
call ZYE(E1E[PXE])
endif
call UnitRemoveAbility(E1E[PXE],'A078')
call F9E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set O5V=E1E[PXE]
call GroupEnumUnitsInRange(O4V,GetUnitX(E1E[PXE]),GetUnitY(E1E[PXE]),175.,Filter(function ETO))
if d>=30. then
set u=CreateUnit(GetOwningPlayer(E1E[PXE]),'n01A',x2,y2,.0)
call SetUnitAbilityLevel(u,'S008',GetUnitAbilityLevel(E1E[PXE],'A07V'))
call SetUnitAbilityLevel(u,'A080',GetUnitAbilityLevel(E1E[PXE],'A07V'))
call IssueImmediateOrderById(u,852177)
//call UnitApplyTimedLife(u,'BTLF',(I2R(E4E[PXE])*.02))
call UnitApplyTimedLife(u,'BTLF',8.)
set E2E[PXE]=x2
set E3E[PXE]=y2
endif
call ZWE(E1E[PXE],500.)
set E4E[PXE]=E4E[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function EUO)
endif
set t=null
set u=null
endfunction
function EWO takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=F8E()
set E1E[PXE]=GetTriggerUnit()
set E2E[PXE]=GetUnitX(E1E[PXE])
set E3E[PXE]=GetUnitY(E1E[PXE])
set E5E[PXE]=AddSpecialEffectTarget("Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveMissile.mdl",E1E[PXE],"origin")
set E4E[PXE]=500+50*GetUnitAbilityLevel(E1E[PXE],'A07V')
call UnitAddAbility(E1E[PXE],'A078')
call ZWE(E1E[PXE],500.)
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function EUO)
set t=null
endfunction
/*function EYO takes nothing returns boolean
if GetSpellAbilityId()=='A07V' then
call EWO()
endif
return false
endfunction*/
function EZO takes nothing returns nothing
set O8V[1]=7
set O8V[2]=7
set O7V=2
endfunction
constant function E_O takes integer DZX,integer LZE returns real
return 50.+(LZE*2.5*DZX)
endfunction
function E0O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer D0E=GetTimerData(t)
if XIE[D0E]then
call RemoveUnit(E9E[D0E])
else
call SetUnitTimeScale(E9E[D0E],1.5)
endif
call DestroyEffect(XRE[D0E])
call ReleaseTimer(t)
call F7E(D0E)
set t=null
endfunction
function E1O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer D0E=GetTimerData(t)
local location CJE=Location(GetUnitX(XEE[D0E]),GetUnitY(XEE[D0E]))
local real cooldown
call Y0E(XVE[D0E],XEE[D0E],(XXE[D0E]*.75),ATTACK_TYPE_CHAOS,false,true)
call OTX(XVE[D0E],CJE,(XXE[D0E]*.25),256.,DAMAGE_TYPE_NORMAL,ATTACK_TYPE_CHAOS,false)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\NewDirtEXNofire.mdx",XEE[D0E],"origin"))
if GetUnitAbilityLevel(XVE[D0E], 'A0DA' )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(XVE[D0E], 'A0DA' )
if cooldown > 0 then
if cooldown - .35 <= 0 then
call BlzEndUnitAbilityCooldown(XVE[D0E], 'A0DA' )
else
call BlzStartUnitAbilityCooldown(XVE[D0E], 'A0DA' , cooldown - .35)
endif
endif
endif
if GetUnitAbilityLevel(XVE[D0E], 'A0NZ' )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(XVE[D0E], 'A0NZ' )
if cooldown > 0 then
if cooldown - .35 <= 0 then
call BlzEndUnitAbilityCooldown(XVE[D0E], 'A0NZ' )
else
call BlzStartUnitAbilityCooldown(XVE[D0E], 'A0NZ' , cooldown - .35)
endif
endif
endif
call TimerStart(XOE[D0E],.25,false,function E0O)
call RemoveLocation(CJE)
set t=null
set CJE=null
endfunction
function E2O takes boolean b,integer E3O,unit U0E,unit S8X,real SVE,real x,real y returns nothing
local integer D0E=F6E()
if b then
set E9E[D0E]=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'E002',x,y,GetUnitFacing(U0E))
call UnitApplyTimedLife(E9E[D0E],1,2)
call SetUnitColor(E9E[D0E],GetPlayerColor(GetOwningPlayer(U0E)))
call SetUnitVertexColor(E9E[D0E],255,255,255,O6V)
call SetUnitAnimationByIndex(E9E[D0E],E3O)
if GetRandomInt(0,100) >= 50 then
call SetUnitAnimationByIndex(U0E,E3O)
endif
else
set E9E[D0E]=U0E
endif
set XIE[D0E]=b
set XVE[D0E]=U0E
set XEE[D0E]=S8X
set XXE[D0E]=SVE
set XOE[D0E]=NewTimer()
call SetUnitTimeScale(E9E[D0E],1.5)
set XRE[D0E]=AddSpecialEffectTarget("war3mapImported\\BeneficAura.MDX",E9E[D0E],"weapon")
call SetTimerData(((XOE[D0E])),(D0E))
call TimerStart(XOE[D0E],.5,false,function E1O)
endfunction
function E4O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer D0E=GetTimerData(t)
if not(IsUnitType(XKE[D0E],UNIT_TYPE_DEAD)or GetUnitTypeId(XKE[D0E])==0)and not(IsUnitType(XLE[D0E],UNIT_TYPE_DEAD)or GetUnitTypeId(XLE[D0E])==0)and XHE[D0E]!=XJE[D0E]and XCE[D0E]==GetUnitX(XKE[D0E])and XDE[D0E]==GetUnitY(XKE[D0E])then
if XHE[D0E]==0 then
set bj_lastCreatedUnit=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h007',XCE[D0E],XDE[D0E],GetUnitFacing(XKE[D0E]))
call UnitApplyTimedLife(bj_lastCreatedUnit,1,1)
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A02B',XGE[D0E])
call IssueTargetOrderById(bj_lastCreatedUnit,852095,XLE[D0E])
call E2O(false,XME[D0E],XKE[D0E],XLE[D0E],XFE[D0E],XCE[D0E],XDE[D0E])
else
call E2O(true,XME[D0E],XKE[D0E],XLE[D0E],XFE[D0E],XCE[D0E],XDE[D0E])
endif
set XHE[D0E]=XHE[D0E]+1
else
call ReleaseTimer(t)
call F5E(D0E)
endif
set t=null
endfunction
function E5O takes nothing returns nothing
local integer D0E=F4E()
local integer LZE=GetHeroStr(GetTriggerUnit(),true)
set XGE[D0E]=GetUnitAbilityLevel(GetTriggerUnit(),'A027')
set XPE[D0E]=NewTimer()
set XHE[D0E]=0
set XJE[D0E]=((XGE[D0E])+5)
set XFE[D0E]=E_O(XGE[D0E],LZE)
set XKE[D0E]=GetTriggerUnit()
set XLE[D0E]=GetSpellTargetUnit()
set XCE[D0E]=GetUnitX(XKE[D0E])
set XDE[D0E]=GetUnitY(XKE[D0E])
set XME[D0E]=O8V[GetRandomInt(1,O7V)]
call SetTimerData(((XPE[D0E])),(D0E))
call SetUnitAnimationByIndex(XKE[D0E],XME[D0E])
call TimerStart(XPE[D0E],.15,true,function E4O)
endfunction
/*function E6O takes nothing returns boolean
if GetSpellAbilityId()=='A027' then
call E5O()
endif
return false
endfunction*/
function E7O takes nothing returns nothing
/*local trigger t=CreateTrigger()
call EZO()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function E6O))
set t=null*/
call EZO()
call RegisterSpellEffectEvent('A027', function E5O)
endfunction
function E8O takes nothing returns boolean
return(GetSpellAbilityId()=='A0AX')
endfunction
function E9O takes nothing returns nothing
local unit c = GetTriggerUnit()
local real XVO=GetUnitX(c)
local real XEO=GetUnitY(c)
local unit XXO=CreateUnit(GetOwningPlayer(c),'h007',XVO,XEO,.0)
local effect fx
local effect fx2
local effect fx3
local integer level
if IsAMChonk[GetUnitUserData(c)] then
set fx = AddSpecialEffect("war3mapImported\\ChomusukeRed.mdx",GetSpellTargetX(),GetSpellTargetY())
set fx2 = AddSpecialEffect("war3mapImported\\NuclearExplosion.mdx",GetSpellTargetX(),GetSpellTargetY())
set fx3 = AddSpecialEffect("war3mapImported\\SHIVA Nuclear warhead V6.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectScale(fx,10.)
call BlzSetSpecialEffectScale(fx2,1.5)
call BlzSetSpecialEffectScale(fx3,2.)
call DestroyEffect(fx)
call DestroyEffect(fx2)
call DestroyEffect(fx3)
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",GetSpellTargetUnit(),"origin"))
set fx = AddSpecialEffect("war3mapImported\\Winter Blast HD.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
endif
call UnitApplyTimedLife(XXO,'BTLF',1.)
call UnitAddAbility(XXO,'A02Z')
set level = GetUnitAbilityLevel(c,'A0AX')
call SetUnitAbilityLevel(XXO,'A02Z',level)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A02Z'),ABILITY_RLF_AREA_OF_EFFECT_DAMAGE,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A02Z'),ABILITY_RLF_AREA_OF_EFFECT_DAMAGE,level-1)+(GetHeroInt(c,true)*level*level*.175*(1.+(.05*GetHeroLevel(c)))))
call IssueTargetOrderById(XXO,852226,GetSpellTargetUnit())
set c = null
set XXO=null
set fx = null
set fx2 = null
set fx3 = null
endfunction
//function XRO takes nothing returns boolean
//return(GetSpellAbilityId()=='A03H')
//endfunction
//function XIO takes nothing returns nothing
//call SetWidgetLife(GetTriggerUnit(),GetWidgetLife(GetTriggerUnit())-(GetWidgetLife(GetTriggerUnit())/5.))
//call U_E(GetTriggerUnit(),GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),200.,110.,.0,1,5+(GetUnitAbilityLevel(GetTriggerUnit(),'A03H')),.33,(4+I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A03H'))),(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE)*.1),.8,false,true,true,"war3mapImported\\ChaosExplosion.mdx",ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL)
//endfunction
function XNO takes nothing returns boolean
return(GetSpellAbilityId()=='A0AY')
endfunction
function XBO takes nothing returns nothing
local unit c = GetTriggerUnit()
local real XVO=GetUnitX(c)
local real XEO=GetUnitY(c)
local unit XXO=CreateUnit(GetOwningPlayer(c),'h007',XVO,XEO,.0)
local integer level = GetUnitAbilityLevel(c,'A0AY')
call UnitApplyTimedLife(XXO,'BTLF',1.)
call UnitAddAbility(XXO,'A030')
call SetUnitAbilityLevel(XXO,'A030',level)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A030'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A030'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(c,true)*level*level*.05*(1.+(.04*GetHeroLevel(c)))))
call IssueTargetOrderById(XXO,852587,GetSpellTargetUnit())
set XXO=null
set c = null
endfunction
function XDO takes nothing returns boolean
return(GetSpellAbilityId()=='A01L')
endfunction
function XFO takes nothing returns nothing
local unit c = GetTriggerUnit()
local real XVO=GetUnitX(c)
local real XEO=GetUnitY(c)
local unit XXO=CreateUnit(GetOwningPlayer(c),'h007',XVO,XEO,.0)
local integer level = GetUnitAbilityLevel(c,'A01L')
call UnitApplyTimedLife(XXO,'BTLF',10.)
call UnitAddAbility(XXO,'A031')
call SetUnitAbilityLevel(XXO,'A031',level)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A031'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(XXO,'A031'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(c,true)*level*level*.2*(1.+(.075*GetHeroLevel(c)))))
call IssueTargetOrderById(XXO,852119,GetSpellTargetUnit())
set XXO=null
set c = null
endfunction
function XHO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A03A',GetAttacker())>0)
endfunction
function XJO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local unit u=XUE[PXE]
local integer i=XWE[PXE]
if GetUnitAbilityLevel(u,'A01J')==1 then
call SetHeroAgi(u,GetHeroAgi(u,false)+i,true)
elseif GetUnitAbilityLevel(u,'A038')==1 then
call SetHeroInt(u,GetHeroInt(u,false)+i,true)
elseif GetUnitAbilityLevel(u,'A039')==1 then
call SetHeroStr(u,GetHeroStr(u,false)+i,true)
endif
call ReleaseTimer(GetExpiredTimer())
call F3E(PXE)
set t=null
set u=null
endfunction
function XKO takes nothing returns nothing
local unit u=GetAttacker()
local timer t
local integer i=GetUnitAbilityLevel(u,'A03A')
local real CIE=(I2R(i)*2) +5.
local integer PXE=F2E()
set XUE[PXE]=u
set XWE[PXE]=i
if GetUnitAbilityLevel(u,'A01J')==1 then
call SetHeroAgi(u,GetHeroAgi(u,false)-i,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosDone.mdl",u,"chest"))
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,CIE,false,function XJO)
elseif GetUnitAbilityLevel(u,'A038')==1 then
call SetHeroInt(u,GetHeroInt(u,false)-i,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosDone.mdl",u,"chest"))
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,CIE,false,function XJO)
elseif GetUnitAbilityLevel(u,'A039')==1 and GetHeroStr(u,false)>=i then
call SetHeroStr(u,GetHeroStr(u,false)-i,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosDone.mdl",u,"chest"))
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,CIE,false,function XJO)
else
call F3E(PXE)
endif
set u=null
set t=null
endfunction
function XMO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if OQE[PXE]==.0 then
call DestroyEffect(OPE[PXE])
call F_E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
call UnitDamageTargetEx((OLE[PXE]),(OME[PXE]),((I2R(GetUnitAbilityLevel(OLE[PXE],'A042'))*5.)*1.),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set OQE[PXE]=OQE[PXE]-.5
call SetTimerData(t,PXE)
call TimerStart(t,.25,false,function XMO)
endif
set t=null
endfunction
function XPO takes nothing returns boolean
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RVV))and OrderId2String(GetUnitCurrentOrder(RVV))=="stampede" then
call UnitDamageTargetEx((RVV),(GetFilterUnit()),(((I2R(GetUnitAbilityLevel(RVV,'A042'))*150.*I2R(GetUnitAbilityLevel(RVV,'A042')))*1.)+(I2R(GetUnitAbilityLevel(RVV,'A042'))*I2R(GetUnitAbilityLevel(RVV,'A042'))*GetHeroInt(RVV,true))),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
return false
endfunction
function XQO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
set RVV=X0E[PXE]
if OrderId2String(GetUnitCurrentOrder(X0E[PXE]))!="stampede" or OGE[PXE]<=.0 or not UnitAlive(X0E[PXE]) then
call ReleaseTimer(GetExpiredTimer())
call DestroyEffect(OIE[PXE])
call DestroyEffect(OAE[PXE])
call DestroyEffect(ONE[PXE])
call DestroyEffect(OBE[PXE])
call DestroyEffect(OCE[PXE])
call DestroyEffect(ODE[PXE])
call DestroyEffect(OFE[PXE])
call F1E(PXE)
else
call GroupEnumUnitsInRange(O9V,X1E[PXE],X2E[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X3E[PXE],X4E[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X5E[PXE],X6E[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X7E[PXE],X8E[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X9E[PXE],OVE[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,OEE[PXE],OXE[PXE],174.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,OOE[PXE],ORE[PXE],174.,Filter(function XPO))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X1E[PXE],X2E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X3E[PXE],X4E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X5E[PXE],X6E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X7E[PXE],X8E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X9E[PXE],OVE[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",OEE[PXE],OXE[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",OOE[PXE],ORE[PXE]))
set OGE[PXE]=OGE[PXE]-.5
call SetTimerData(t,PXE)
call TimerStart(t,.5,false,function XQO)
endif
set t=null
endfunction
function XSO takes nothing returns nothing
local real CDE=GetUnitFacing(GetTriggerUnit())
local timer t=NewTimer()
local integer PXE=F0E()
set X0E[PXE]=GetTriggerUnit()
set X1E[PXE]=GetSpellTargetX()
set X2E[PXE]=GetSpellTargetY()
set OIE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",X1E[PXE],X2E[PXE])
set X3E[PXE]=X1E[PXE]+300.*Cos((CDE+90.)*bj_DEGTORAD)
set X4E[PXE]=X2E[PXE]+300.*Sin((CDE+90.)*bj_DEGTORAD)
set OAE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",X3E[PXE],X4E[PXE])
set X5E[PXE]=X1E[PXE]+600.*Cos((CDE+90.)*bj_DEGTORAD)
set X6E[PXE]=X2E[PXE]+600.*Sin((CDE+90.)*bj_DEGTORAD)
set ONE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",X5E[PXE],X6E[PXE])
set X7E[PXE]=X1E[PXE]+900.*Cos((CDE+90.)*bj_DEGTORAD)
set X8E[PXE]=X2E[PXE]+900.*Sin((CDE+90.)*bj_DEGTORAD)
set OBE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",X7E[PXE],X8E[PXE])
set X9E[PXE]=X1E[PXE]+300.*Cos((CDE-90.)*bj_DEGTORAD)
set OVE[PXE]=X2E[PXE]+300.*Sin((CDE-90.)*bj_DEGTORAD)
set OCE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",X9E[PXE],OVE[PXE])
set OEE[PXE]=X1E[PXE]+600.*Cos((CDE-90.)*bj_DEGTORAD)
set OXE[PXE]=X2E[PXE]+600.*Sin((CDE-90.)*bj_DEGTORAD)
set ODE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",OEE[PXE],OXE[PXE])
set OOE[PXE]=X1E[PXE]+900.*Cos((CDE-90.)*bj_DEGTORAD)
set ORE[PXE]=X2E[PXE]+900.*Sin((CDE-90.)*bj_DEGTORAD)
set OFE[PXE]=AddSpecialEffect("war3mapImported\\FireAura.mdx",OOE[PXE],ORE[PXE])
set OGE[PXE]=5.+GetUnitAbilityLevel(X0E[PXE],'A042')
set RVV=X0E[PXE]
call GroupEnumUnitsInRange(O9V,X1E[PXE],X2E[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X3E[PXE],X4E[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X5E[PXE],X6E[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X7E[PXE],X8E[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,X9E[PXE],OVE[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,OEE[PXE],OXE[PXE],150.,Filter(function XPO))
call GroupEnumUnitsInRange(O9V,OOE[PXE],ORE[PXE],150.,Filter(function XPO))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X1E[PXE],X2E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X3E[PXE],X4E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X5E[PXE],X6E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X7E[PXE],X8E[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",X9E[PXE],OVE[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",OEE[PXE],OXE[PXE]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",OOE[PXE],ORE[PXE]))
call SetTimerData(t,PXE)
call TimerStart(t,.5,false,function XQO)
set t=null
endfunction
/*function XTO takes nothing returns boolean
if GetSpellAbilityId()=='A042' then
call XSO()
endif
return false
endfunction*/
function XUO takes nothing returns nothing
set VT[1]='nspb'
set VT[2]='nanc'
set VT[3]='njga'
set VT[4]='nfrg'
set VT[5]='nfre'
set VT[6]='nhar'
set VT[7]='nhrh'
set VT[8]='nltl'
set VT[9]='nlds'
set VT[10]='nlsn'
set VT[11]='nomg'
set VT[12]='nogm'
set VT[13]='nrzb'
set VT[14]='ntrs'
set VT[15]='nssp'
set ET[1]='nsqa'
set ET[2]='nowk'
set ET[3]='nsbm'
set ET[4]='nmdr'
set ET[5]='nwld'
set ET[6]='ntrd'
set ET[7]='njgb'
set ET[8]='nfra'
set ET[9]='nhrq'
set ET[10]='nmgr'
set ET[11]='nmgw'
set ET[12]='nlkl'
set ET[13]='nogl'
set ET[14]='nano'
set ET[15]='nsll'
set ET[16]='nsc3'
endfunction
function XYO takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=GetRandomInt(1,15)
local real x=GetUnitX(u)+150.*Cos(GetUnitFacing(u)*bj_DEGTORAD)
local real y=GetUnitY(u)+150.*Sin(GetUnitFacing(u)*bj_DEGTORAD)
local unit s1=null
local unit s2=null
local unit s3=null
local unit s4=null
local integer li=0
local integer hp=(PC*PC)/3
local integer SVE=PC
local integer XZO=GetUnitAbilityLevel(u,'A05B')*5
local integer X_O=GetUnitAbilityLevel(u,'A054')*2
local integer X0O
local integer X1O=0
local integer hpleft
local integer dmgleft
local integer hp2
local integer SVE2
local integer XZO2
local integer X_O2
local real X2O=15.+(30.*GetUnitAbilityLevel(u,'A04Y'))+(I2R(PC)/2.)
set s1=CreateUnit(GetOwningPlayer(u),VT[i],x,y,GetUnitFacing(u))
if PC>30 then
set SVE=PC*(PC/5)
set hp=R2I((PC*PC)/1.5)
endif
if LWMON and not GAMEM then
set SVE=(GetHeroLevel(u)*3/2)
set hp=(GetHeroLevel(u)*GetHeroLevel(u)/9)
endif
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s1, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s1, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s1, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s1, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s1, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s1, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s1, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s1, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s1, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s1, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s1, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s1, 'I022')
set li=li + 1
endloop
endif
set li=0
if i==1 or i==15 then
if GetRandomInt(1,2)==1 then
set s2=CreateUnit(GetOwningPlayer(u),VT[1],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
else
set s2=CreateUnit(GetOwningPlayer(u),VT[15],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
endif
if i==6 or i==7 then
if GetRandomInt(1,2)==1 then
set s2=CreateUnit(GetOwningPlayer(u),VT[6],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
else
set s2=CreateUnit(GetOwningPlayer(u),VT[7],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
endif
if i==2 then
set s2=CreateUnit(GetOwningPlayer(u),VT[2],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
if i==13 then
set s2=CreateUnit(GetOwningPlayer(u),VT[13],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
if GetUnitAbilityLevel(u,'B01D')==1 then
if i==1 or i==2 or i==6 or i==7 or i==13 or i==15 then
set s3=CreateUnit(GetOwningPlayer(u),VT[i],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s3, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s3, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s3, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s3, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s3, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s3, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s3, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s3, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s3, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s3, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s3, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s3, 'I022')
set li=li + 1
endloop
endif
set li=0
if i==2 or i==13 then
set s4=CreateUnit(GetOwningPlayer(u),VT[i],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
if i==1 or i==15 then
if GetRandomInt(1,2)==1 then
set X0O=1
else
set X0O=15
endif
set s4=CreateUnit(GetOwningPlayer(u),VT[X0O],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
if i==6 or i==7 then
if GetRandomInt(1,2)==1 then
set X0O=6
else
set X0O=7
endif
set s4=CreateUnit(GetOwningPlayer(u),VT[X1O],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s4, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s4, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s4, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s4, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s4, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s4, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
else
set s3=CreateUnit(GetOwningPlayer(u),VT[i],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s3, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s3, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s3, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s3, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s3, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s3, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s3, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s3, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s3, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s3, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s3, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s3, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",s1,"origin"))
call UnitApplyTimedLife(s1,'BTLF',X2O)
if s2!=null then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",s2,"origin"))
call UnitApplyTimedLife(s2,'BTLF',X2O)
endif
if s3!=null then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",s3,"origin"))
call UnitApplyTimedLife(s3,'BTLF',X2O)
endif
if s4!=null then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdx",s4,"origin"))
call UnitApplyTimedLife(s4,'BTLF',X2O)
endif
if GetUnitAbilityLevel(u,'B01D')==1 then
call UnitRemoveAbility(u,'B01D')
endif
set u=null
set s1=null
set s2=null
set s3=null
set s4=null
endfunction
/*function X3O takes nothing returns boolean
if GetSpellAbilityId()=='A04W' then
call XYO()
endif
return false
endfunction*/
function X4O takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=GetRandomInt(1,16)
local real x=GetUnitX(u)+150.*Cos(GetUnitFacing(u)*bj_DEGTORAD)
local real y=GetUnitY(u)+150.*Sin(GetUnitFacing(u)*bj_DEGTORAD)
local unit s1=null
local unit s2=null
local unit s3=null
local unit s4=null
local integer li=0
local integer hp=R2I((PC*PC)/1.5)
local integer SVE=PC*2
local integer XZO=GetUnitAbilityLevel(u,'A05B')*10
local integer X_O=GetUnitAbilityLevel(u,'A054')*3
local integer X0O
local integer X1O
local integer hpleft
local integer dmgleft
local integer hp2
local integer SVE2
local integer XZO2
local integer X_O2
local real X2O=15.+(40.*GetUnitAbilityLevel(u,'A04Y'))+I2R(PC)
if PC>=30 then
set SVE=PC*(PC/3)
set hp=(PC*PC)
endif
if LWMON and not GAMEM then
set SVE=(GetHeroLevel(u))
set hp=(GetHeroLevel(u)*GetHeroLevel(u)/5)
endif
set s1=CreateUnit(GetOwningPlayer(u),ET[i],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s1, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s1, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s1, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s1, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s1, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s1, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s1, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s1, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s1, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s1, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s1, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s1, 'I022')
set li=li + 1
endloop
endif
set li=0
if GetUnitAbilityLevel(u,'B01D')==1 then
set s2=CreateUnit(GetOwningPlayer(u),ET[i],x,y,GetUnitFacing(u))
if hp >= 200 then
set hpleft=ModuloInteger(hp,100)
set hp2 = hp/100
loop
exitwhen li > hp2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > hp
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if SVE >= 30 then
set dmgleft= ModuloInteger(SVE,10)
set SVE2 = SVE/10
loop
exitwhen li > SVE2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > SVE
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li = 0
if XZO >= 200 then
set hpleft=ModuloInteger(XZO,100)
set XZO2 = XZO/100
loop
exitwhen li > XZO2
call UnitAddItemById(s2, 'I02Q')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> hpleft
call UnitAddItemById(s2, 'I021')
set li=li+1
endloop
else
loop
exitwhen li > XZO
call UnitAddItemById(s2, 'I021')
set li=li + 1
endloop
endif
set li=0
if X_O >= 30 then
set dmgleft= ModuloInteger(X_O,10)
set X_O2 = X_O/10
loop
exitwhen li > X_O2
call UnitAddItemById(s2, 'I02P')
set li=li + 1
endloop
set li = 0
loop
exitwhen li> dmgleft
call UnitAddItemById(s2, 'I022')
set li=li+1
endloop
else
loop
exitwhen li > X_O
call UnitAddItemById(s2, 'I022')
set li=li + 1
endloop
endif
set li=0
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\s_Nature'sBloom Effect.mdx",s1,"origin"))
call UnitApplyTimedLife(s1,'BTLF',X2O)
if s2!=null then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\s_Nature'sBloom Effect.mdx",s2,"origin"))
call UnitApplyTimedLife(s2,'BTLF',X2O)
endif
if GetUnitAbilityLevel(u,'B01D')==1 then
call UnitRemoveAbility(u,'B01D')
endif
set u=null
set s1=null
set s2=null
endfunction
/*function X5O takes nothing returns boolean
if GetSpellAbilityId()=='A04X' then
call X4O()
endif
return false
endfunction*/
//function X6O takes nothing returns boolean
//return(GetSpellAbilityId()=='A05N')
//endfunction
//function X7O takes nothing returns nothing
//call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
//call UnitAddAbility(bj_lastCreatedUnit,'A05M')
//call SetUnitAbilityLevelSwapped('A05M',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A05N',GetTriggerUnit()))
//call UnitAddAbility(bj_lastCreatedUnit,'A05O')
//call SetUnitAbilityLevelSwapped('A05O',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A05N',GetTriggerUnit()))
//call UnitApplyTimedLifeBJ(30.,'BTLF',bj_lastCreatedUnit)
//endfunction
function X9O takes nothing returns boolean
return(GetSpellAbilityId()=='A09M')
endfunction
function OVO takes nothing returns nothing
call ModifyHeroStat(1,GetTriggerUnit(),0,(3*GetUnitAbilityLevelSwapped('A09M',GetTriggerUnit())))
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\DarkForce.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function OXO takes nothing returns boolean
return(GetSpellAbilityId()=='A09K')
endfunction
function OOO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A09N',GetTriggerUnit())==1)
endfunction
function ORO takes nothing returns nothing
if(OOO())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Shadow Blend is already active.")
endif
endfunction
function OAO takes nothing returns boolean
local real x1=GetUnitX(RXV)
local real y1=GetUnitY(RXV)
local real x2=GetUnitX(GetFilterUnit())
local real y2=GetUnitY(GetFilterUnit())
local real SVE=I2R(GetHeroStr(RXV,true))*I2R((GetUnitAbilityLevel(RXV,'A0FD')))*3+(5*BlzGetUnitArmor(RXV)*(1.+(.1*GetHeroLevel(RXV))*I2R((GetUnitAbilityLevel(RXV,'A0FD')))))
local unit s=CreateUnit(GetOwningPlayer(RXV),'h007',x1,y1,.0)
local real a=bj_RADTODEG*(Atan2(y2-y1,x2-x1))
local real d=300.+(10.*I2R(GetUnitAbilityLevel(RXV,'A0FD')))
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RXV))then
call M6E(GetFilterUnit(),d,1.,a,"war3mapImported\\Dust.mdx",.0,true,false)
call Y0E(s,GetFilterUnit(),SVE,ATTACK_TYPE_SIEGE,false,false)
call SEE(GetFilterUnit(),R2I(SVE))
call IssueTargetOrderById(GetFilterUnit(),851983,RXV)
endif
call UnitApplyTimedLife(s,'BTLF',1.)
set s=null
return false
endfunction
function ONO takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
set RXV=u
call GroupEnumUnitsInRange(REV,x,y,225.+(20.*I2R(GetUnitAbilityLevel(u,'A0FD'))),Filter(function OAO))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Explosion.mdx",x,y))
set u=null
endfunction
/*function OBO takes nothing returns boolean
if GetSpellAbilityId()=='A0FD' then
call ONO()
endif
return false
endfunction*/
function OCO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real h
if OWE[PXE]<=0 then
call ReleaseTimer(GetExpiredTimer())
call FYE(PXE)
else
set h=((3.*OZE[PXE])*(1.+(.1*OZE[PXE]))+(GetWidgetLife(OYE[PXE])*.0007*OZE[PXE]))
if GetWidgetLife(OYE[PXE])+h>=GetUnitState(OYE[PXE],UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(OYE[PXE],GetUnitState(OYE[PXE],UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(OYE[PXE],GetWidgetLife(OYE[PXE])+h)
endif
if GetRandomInt(0,100)<=33 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Resurrecttarget.mdx",OYE[PXE],"origin"))
endif
set OWE[PXE]=OWE[PXE]-.1
call SetTimerData(t,PXE)
call TimerStart(t,.1,false,function OCO)
endif
set t=null
endfunction
function ODO takes nothing returns nothing
local unit u=GetTriggerUnit()
local timer t=NewTimer()
local integer PXE=FWE()
set OYE[PXE]=GetSpellTargetUnit()
set OZE[PXE]=GetUnitAbilityLevel(u,'A0DF')
set OWE[PXE]=3.5+(.25*OZE[PXE])
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function OCO)
set u=null
set t=null
endfunction
/*function OFO takes nothing returns boolean
if GetSpellAbilityId()=='A0DF' then
call ODO()
endif
return false
endfunction*/
function OGO takes nothing returns nothing
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local unit OIX=GetTriggerUnit()
local unit u=CreateUnit(GetOwningPlayer(OIX),'o016',x,y,.0)
call SetUnitAbilityLevel(u,'A049',GetUnitAbilityLevel(OIX,'A0HK'))
call SetUnitAbilityLevel(u,'S000',GetUnitAbilityLevel(OIX,'A0HK'))
call UnitApplyTimedLife(u,'BTLF',20.)
call IssueImmediateOrderById(u,852177)
set OIX=null
set u=null
endfunction
/*function OHO takes nothing returns boolean
if GetSpellAbilityId()=='A0HK' then
call OGO()
endif
return false
endfunction*/
/*function OJO takes nothing returns boolean
local unit u
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RRV))then
//set u=CreateUnit(GetOwningPlayer(RRV),'h007',GetUnitX(RRV),GetUnitY(RRV),.0)
call UnitAddAbility(u,'A0GG')
//call SetUnitAbilityLevel(u,'A01N',GetUnitAbilityLevel(RRV,'A0BX'))
//call IssueTargetOrderById(u,852189,GetFilterUnit())
//call UnitApplyTimedLife(u,'BTLF',1.)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",GetFilterUnit(),"origin"))
endif
set u=null
return false
endfunction
function OKO takes nothing returns nothing
local real U1E=145+(55*GetUnitAbilityLevel(GetTriggerUnit(),'A0BX'))
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
set RRV=GetTriggerUnit()
call GroupEnumUnitsInRange(ROV,x,y,U1E,Filter(function OJO))
endfunction
function OLO takes nothing returns boolean
if GetSpellAbilityId()=='A0BX' then
call OKO()
endif
return false
endfunction*/
function OZO takes nothing returns boolean
return(GetSpellAbilityId()=='A03L')
endfunction
function O_O takes nothing returns nothing
set AQ=GetUnitLoc(GetTriggerUnit())
set NQ=GetSpellTargetLoc()
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetSpellAbilityUnit()),AQ,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0DL')
call SetUnitAbilityLevelSwapped('A0DL',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call UnitApplyTimedLifeBJ(22.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852473,NQ)
call RemoveLocation(AQ)
call RemoveLocation(NQ)
endfunction
function O1O takes nothing returns boolean
local unit u
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RAV))then
set u=CreateUnit(GetOwningPlayer(RAV),'h007',GetUnitX(RAV),GetUnitY(RAV),.0)
call UnitAddAbility(u,'A00S')
call SetUnitAbilityLevel(u,'A00S',GetUnitAbilityLevel(RAV,'A03B'))
call IssueTargetOrderById(u,852095,GetFilterUnit())
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitDamageTargetEx(RAV,GetFilterUnit(),GetHeroStr(RAV,true)*GetUnitAbilityLevel(RAV,'A03B'),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set u=null
return false
endfunction
function O2O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real ux=GetUnitX(RVE[PXE])
local real uy=GetUnitY(RVE[PXE])
local unit u
local real D_X=GetRandomReal(.5,5.-(I2R(GetUnitAbilityLevel(O9E[PXE],'A03B'))*.3))
if REE[PXE]==0 or UnitAlive(O9E[PXE])==false then
call DestroyEffect(RXE[PXE])
call FSE(PXE)
call ReleaseTimer(GetExpiredTimer())
else
set RAV=O9E[PXE]
call GroupEnumUnitsInRange(RIV,ux,uy,250.,Filter(function O1O))
call DestroyEffect(AddSpecialEffect("war3mapImported\\EarthDetonation.mdx",ux,uy))
set REE[PXE]=REE[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,D_X,false,function O2O)
endif
set t=null
set u=null
endfunction
function O3O takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit EXX=GetSpellTargetUnit()
local integer ELO=GetUnitAbilityLevel(u,'A03B')
local real O4O=GetRandomReal(.5,5.-(I2R(ELO)*.3))
local timer t
local integer PXE=FQE()
set O9E[PXE]=u
set RVE[PXE]=EXX
set REE[PXE]=2+ELO
set RXE[PXE]=AddSpecialEffectTarget("war3mapImported\\HolyBlessing.mdx",EXX,"origin")
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,O4O,false,function O2O)
set u=null
set EXX=null
set t=null
endfunction
/*function O5O takes nothing returns boolean
if GetSpellAbilityId()=='A03B' then
call O3O()
endif
return false
endfunction*/
function O6O takes nothing returns boolean
return(GetSpellAbilityId()=='A01I')
endfunction
function O7O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call UnitRemoveAbility(RAE[PXE],'A03A')
call UnitRemoveAbility(RNE[PXE],'A03A')
call DestroyEffect(RBE[PXE])
call DestroyEffect(RCE[PXE])
call ReleaseTimer(GetExpiredTimer())
call FPE(PXE)
set t=null
endfunction
function O8O takes nothing returns nothing
local unit EXX=GetSpellTargetUnit()
local unit U0E=GetTriggerUnit()
local real X2O=I2R(GetUnitAbilityLevel(U0E,'A01I'))+10.
local integer ELO=GetUnitAbilityLevel(U0E,'A01I')
local timer t
local integer PXE=FME()
set RAE[PXE]=U0E
set RNE[PXE]=EXX
set RBE[PXE]=AddSpecialEffectTarget("war3mapImported\\Duel.mdx",U0E,"overhead")
set RCE[PXE]=AddSpecialEffectTarget("war3mapImported\\Duel.mdx",EXX,"overhead")
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\ANsa\\ANsaTarget.mdl",U0E,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\ANsa\\ANsaTarget.mdl",U0E,"origin"))
call UnitAddAbility(U0E,'A03A')
call UnitAddAbility(EXX,'A03A')
call SetUnitAbilityLevel(U0E,'A03A',ELO)
call SetUnitAbilityLevel(EXX,'A03A',ELO)
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,X2O,false,function O7O)
set EXX=null
set U0E=null
set t=null
endfunction
/*function RVO takes nothing returns boolean
return GetSpellAbilityId()=='A01N'
endfunction
function REO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call SetUnitVertexColor(RHE[PXE],255,255,255,255)
call UnitRemoveAbility(RHE[PXE],'A023')
call FLE(PXE)
call ReleaseTimer(GetExpiredTimer())
set t=null
endfunction
function RXO takes nothing returns nothing
local unit u=GetSpellTargetUnit()
local real X2O=GetUnitAbilityLevel(GetTriggerUnit(),'A01N')+20.
local timer t
local integer PXE=FKE()
set RHE[PXE]=u
call SetUnitVertexColor(u,65,130,65,160)
call UnitAddAbility(u,'A023')
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,X2O,false,function REO)
set u=null
set t=null
endfunction*/
function RRO takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='o00C')
endfunction
function RIO takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A045',GetSummonedUnit(),GetUnitAbilityLevelSwapped('A0CD',GetSummoningUnit()))
endfunction
function RNO takes nothing returns boolean
return GetSpellAbilityId()=='A036'
endfunction
function RBO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if RME[PXE]==0 then
call ReleaseTimer(GetExpiredTimer())
call FJE(PXE)
call DestroyEffect(RQE[PXE])
else
call SetWidgetLife(RPE[PXE],(GetWidgetLife(RPE[PXE])+((.04+(.01*I2R(GetUnitAbilityLevel(RPE[PXE],'A036'))))*GetHeroStr(RPE[PXE],true))))
set RME[PXE]=RME[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,.1,false,function RBO)
endif
set t=null
endfunction
function RCO takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=(15+GetUnitAbilityLevel(u,'A036'))*10
local timer t
local integer PXE=FHE()
set RME[PXE]=i
set RPE[PXE]=u
set RQE[PXE]=AddSpecialEffectTarget("war3mapImported\\DevilAura.mdx",u,"origin")
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,.1,false,function RBO)
set u=null
set t=null
endfunction
function RFO takes nothing returns boolean
return(GetSpellAbilityId()=='A032')
endfunction
function RGO takes nothing returns boolean
return(JM[1]==0)
endfunction
function RHO takes nothing returns boolean
return(IsUnitInGroup(SM[JM[2]],TM)==false)and(IsUnitInGroup(QM[JM[2]],TM)==false)
endfunction
function RJO takes nothing returns nothing
if(RGO())then
call EnableTrigger(S3)
endif
set JM[1]=(JM[1]+1)
set JM[2]=(JM[2]+1)
set KM[JM[2]]=true
set LM[JM[2]]=1000.
set MM[JM[2]]=45.
set PM[JM[2]]=7.
set QM[JM[2]]=GetTriggerUnit()
set SM[JM[2]]=GetSpellTargetUnit()
if TM==null then
set TM=CreateGroup()
endif
if(RHO())then
call GroupAddUnit(TM,QM[JM[2]])
call GroupAddUnit(TM,SM[JM[2]])
call UnitAddAbility(QM[JM[2]],'A033')
call UnitAddAbility(SM[JM[2]],'A033')
endif
call AddSpecialEffectTargetUnitBJ("weapon",GetTriggerUnit(),"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
set UM[JM[2]]=bj_lastCreatedEffect
call AddSpecialEffectTargetUnitBJ("weapon",GetTriggerUnit(),"Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl")
set WM[JM[2]]=bj_lastCreatedEffect
call AddSpecialEffectTargetUnitBJ("weapon",GetSpellTargetUnit(),"Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl")
set YM[JM[2]]=bj_lastCreatedEffect
call AddSpecialEffectTargetUnitBJ("weapon",GetSpellTargetUnit(),"Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl")
set ZM[JM[2]]=bj_lastCreatedEffect
set VP[JM[2]]=GetUnitLoc(QM[JM[2]])
set EP[JM[2]]=GetUnitLoc(SM[JM[2]])
set XP[JM[2]]=GetLocationX(VP[JM[2]])
set OP[JM[2]]=GetLocationY(VP[JM[2]])
set RP[JM[2]]=GetLocationX(EP[JM[2]])
set IP[JM[2]]=GetLocationY(EP[JM[2]])
set HM[JM[2]]=Location(((XP[JM[2]]+RP[JM[2]])/2.),((OP[JM[2]]+IP[JM[2]])/2.))
call CreateNUnitsAtLoc(1,'h00G',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],150.)
set AP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00G',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],270.)
set NP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00G',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],30.)
set BP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00H',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],210.)
set CP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00H',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],330.)
set DP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00H',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],90.)
set FP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00I',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],210.)
set GP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00I',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],330.)
set HP[JM[2]]=bj_lastCreatedUnit
call CreateNUnitsAtLoc(1,'h00I',GetOwningPlayer(GetTriggerUnit()),HM[JM[2]],90.)
set JP[JM[2]]=bj_lastCreatedUnit
call RemoveLocation(VP[JM[2]])
call RemoveLocation(EP[JM[2]])
call RemoveLocation(HM[JM[2]])
endfunction
function RLO takes nothing returns boolean
return(LP[JM[3]]>=360.)
endfunction
function RMO takes nothing returns boolean
return(MP[JM[3]]>4)
endfunction
function RPO takes nothing returns boolean
return(IsUnitInGroup(QM[JM[3]],TM)==false)and(IsUnitInGroup(SM[JM[3]],TM)==false)
endfunction
function RQO takes nothing returns boolean
return(PP[JM[3]]<=0)
endfunction
function RSO takes nothing returns boolean
return(KP[JM[3]]>=1.98)
endfunction
function RTO takes nothing returns boolean
return(JM[1]==0)
endfunction
function RUO takes nothing returns boolean
return(DistanceBetweenPoints(VP[JM[3]],EP[JM[3]])>LM[JM[3]])or(KP[JM[3]]>=MM[JM[3]])or(IsUnitDeadBJ(QM[JM[3]]))or(IsUnitDeadBJ(SM[JM[3]]))or(IsUnitPaused(QM[JM[3]]))or(IsUnitPaused(SM[JM[3]]))or(SM[JM[3]]==null)or(QM[JM[3]]==null)
endfunction
function RWO takes nothing returns boolean
return(RUO())
endfunction
function RYO takes nothing returns boolean
return(KM[JM[3]])
endfunction
function RZO takes nothing returns nothing
set JM[3]=1
loop
exitwhen JM[3]>JM[2]
if(RYO())then
set KP[JM[3]]=(KP[JM[3]]+.03)
set LP[JM[3]]=(LP[JM[3]]+PM[JM[3]])
if(RLO())then
set LP[JM[3]]=.0
endif
set VP[JM[3]]=GetUnitLoc(QM[JM[3]])
set EP[JM[3]]=GetUnitLoc(SM[JM[3]])
set MP[JM[3]]=(R2I(LM[JM[3]])/R2I(DistanceBetweenPoints(VP[JM[3]],EP[JM[3]])))
if(RMO())then
set MP[JM[3]]=4
endif
if(RPO())then
call GroupAddUnit(TM,QM[JM[3]])
call GroupAddUnit(TM,SM[JM[3]])
call UnitAddAbility(QM[JM[3]],'A033')
call UnitAddAbility(SM[JM[3]],'A033')
endif
set PP[JM[3]]=(MP[JM[3]]+((GetUnitAbilityLevelSwapped('A032',QM[JM[3]])-3)*4))
if(RQO())then
set PP[JM[3]]=1
endif
if GetUnitAbilityLevelSwapped('A032',QM[JM[3]]) == 2 then
call SetUnitAbilityLevelSwapped('A033',QM[JM[3]],41)
call SetUnitAbilityLevelSwapped('A033',SM[JM[3]],41)
else
call SetUnitAbilityLevelSwapped('A033',QM[JM[3]],PP[JM[3]])
call SetUnitAbilityLevelSwapped('A033',SM[JM[3]],PP[JM[3]])
endif
set XP[JM[3]]=GetLocationX(VP[JM[3]])
set RP[JM[3]]=GetLocationX(EP[JM[3]])
set OP[JM[3]]=GetLocationY(VP[JM[3]])
set IP[JM[3]]=GetLocationY(EP[JM[3]])
set HM[JM[3]]=Location(((XP[JM[3]]+RP[JM[3]])/2.),((OP[JM[3]]+IP[JM[3]])/2.))
if(RSO())then
set SP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+60.))
set TP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+120.))
set UP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+180.))
set WP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+240.))
set YP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+300.))
set ZP[JM[3]]=CNE(HM[JM[3]],(LM[JM[3]]/2.),(LP[JM[3]]+360.))
else
set QP[JM[3]]=(KP[JM[3]]/1.98)
set SP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+60.))
set TP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+120.))
set UP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+180.))
set WP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+240.))
set YP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+300.))
set ZP[JM[3]]=CNE(HM[JM[3]],((LM[JM[3]]/2.)*QP[JM[3]]),(LP[JM[3]]+360.))
endif
if(RWO())then
set KM[JM[3]]=false
call UnitRemoveAbility(QM[JM[3]],'A033')
call UnitRemoveAbility(SM[JM[3]],'A033')
call GroupRemoveUnit(TM,QM[JM[3]])
call GroupRemoveUnit(TM,SM[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',AP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',CP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',NP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',DP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',BP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',FP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',GP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',HP[JM[3]])
call UnitApplyTimedLifeBJ(.01,'BTLF',JP[JM[3]])
call DestroyEffect(UM[JM[3]])
call DestroyEffect(WM[JM[3]])
call DestroyEffect(YM[JM[3]])
call DestroyEffect(ZM[JM[3]])
set KP[JM[3]]=.0
set LP[JM[3]]=.0
set JM[1]=(JM[1]-1)
if(RTO())then
call DestroyGroup(TM)
set TM=null
set JM[2]=0
call DisableTrigger(GetTriggeringTrigger())
endif
else
call SetUnitPositionLocFacingBJ(AP[JM[3]],SP[JM[3]],(LP[JM[3]]+150.))
call SetUnitPositionLocFacingBJ(CP[JM[3]],TP[JM[3]],(LP[JM[3]]+210.))
call SetUnitPositionLocFacingBJ(NP[JM[3]],UP[JM[3]],(LP[JM[3]]+270.))
call SetUnitPositionLocFacingBJ(DP[JM[3]],WP[JM[3]],(LP[JM[3]]+330.))
call SetUnitPositionLocFacingBJ(BP[JM[3]],YP[JM[3]],(LP[JM[3]]+30.))
call SetUnitPositionLocFacingBJ(FP[JM[3]],ZP[JM[3]],(LP[JM[3]]+90.))
call SetUnitPositionLocFacingBJ(GP[JM[3]],TP[JM[3]],(LP[JM[3]]+210.))
call SetUnitPositionLocFacingBJ(HP[JM[3]],WP[JM[3]],(LP[JM[3]]+330.))
call SetUnitPositionLocFacingBJ(JP[JM[3]],ZP[JM[3]],(LP[JM[3]]+90.))
endif
call RemoveLocation(VP[JM[3]])
call RemoveLocation(EP[JM[3]])
call RemoveLocation(HM[JM[3]])
call RemoveLocation(SP[JM[3]])
call RemoveLocation(TP[JM[3]])
call RemoveLocation(UP[JM[3]])
call RemoveLocation(WP[JM[3]])
call RemoveLocation(YP[JM[3]])
call RemoveLocation(ZP[JM[3]])
endif
set JM[3]=JM[3]+1
endloop
endfunction
function R0O takes nothing returns boolean
return(GetSpellAbilityId()=='A02M')
endfunction
function R1O takes nothing returns boolean
return(FM[(1+GetPlayerId(GetTriggerPlayer()))]!=null)
endfunction
function R2O takes nothing returns nothing
if(R1O())then
call RemoveUnit(FM[(1+GetPlayerId(GetTriggerPlayer()))])
set FM[(1+GetPlayerId(GetTriggerPlayer()))]=null
endif
set ML=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(ML,"war3mapImported\\EagleSpirit.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call CreateNUnitsAtLoc(1,'o000',GetOwningPlayer(GetTriggerUnit()),ML,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(((I2R(GetUnitAbilityLevelSwapped('A02M',GetTriggerUnit()))*5.)+10.),'BTLF',bj_lastCreatedUnit)
set FM[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call RemoveLocation(ML)
endfunction
function R4O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='o000')
endfunction
function R5O takes nothing returns nothing
set FM[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=null
endfunction
function R7O takes nothing returns boolean
return(FM[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]!=null)and(GetUnitTypeId(GetDyingUnit())!='o000')
endfunction
function R8O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call SetHeroAgi(RWE[PXE],GetHeroAgi(RWE[PXE],false)-RYE[PXE],true)
call ReleaseTimer(GetExpiredTimer())
call FGE(PXE)
set t=null
endfunction
function R9O takes nothing returns nothing
local unit u=LC[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]
local integer i=GetUnitAbilityLevel(u,'A02M')*2
local real r=20.
local timer t
local integer PXE=FFE()
set RWE[PXE]=u
set RYE[PXE]=i
call SetWidgetLife(FM[(1+GetPlayerId(GetOwningPlayer(u)))],(GetUnitState(FM[(1+GetPlayerId(GetOwningPlayer(u)))],UNIT_STATE_LIFE)+(5.+(I2R(GetUnitAbilityLevel(u,'A02M'))/2.))))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EvilMissileofShadowyDOOMV3.mdx",FM[(1+GetPlayerId(GetOwningPlayer(u)))],"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EvilMissileofShadowyDOOMV3.mdx",u,"origin"))
call SetHeroAgi(u,GetHeroAgi(u,false)+i,true)
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,r,false,function R8O)
set u=null
set t=null
endfunction
function IEO takes nothing returns boolean
return(GetSpellAbilityId()=='A02L')
endfunction
function IXO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local location l=Location(R2E[PXE],R3E[PXE])
local location l2=CNE(l,(275.+((I2R(GetUnitAbilityLevel(R1E[PXE],'A02L')))*5.)),R5E[PXE])
local unit u
local unit u2
if R4E[PXE]==0 then
call ReleaseTimer(t)
call FDE(PXE)
else
call CreateNUnitsAtLocFacingLocBJ(1,'h004',GetOwningPlayer(R1E[PXE]),l2,l)
set u=bj_lastCreatedUnit
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",l2))
call UnitAddAbility(u,'A02K')
call SetUnitAbilityLevel(u,'A02K',GetUnitAbilityLevel(R1E[PXE],'A02L'))
call IssueImmediateOrderById(u,852177)
call SetTerrainPathable(GetUnitX(u),GetUnitY(u),PATHING_TYPE_WALKABILITY,false)
call UnitApplyTimedLife(u,'BTLF',(6.+(2.*I2R(GetUnitAbilityLevel(R1E[PXE],'A02L')))))
set u2=CreateUnitAtLoc(GetOwningPlayer(R1E[PXE]),'h00N',l2,.0)
call UnitApplyTimedLife(u2,'BTLF',(6.+(2.*I2R(GetUnitAbilityLevel(R1E[PXE],'A02L')))))
set R4E[PXE]=(R4E[PXE]-1)
set R5E[PXE]=(R5E[PXE]+10.)
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function IXO)
endif
call RemoveLocation(l)
call RemoveLocation(l2)
set t=null
set l=null
set l2=null
set u=null
set u2=null
endfunction
function IOO takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local unit S8X=GetSpellTargetUnit()
local location l=GetSpellTargetLoc()
local integer PXE=FCE()
local timer t=NewTimer()
set R1E[PXE]=u
set R2E[PXE]=GetUnitX(S8X)
set R3E[PXE]=GetUnitY(S8X)
set R4E[PXE]=36
set R5E[PXE]=(GetUnitFacing(S8X)+140.)
call SetTimerData(t,PXE)
call TimerStart(t,.04,false,function IXO)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",S8X,"origin"))
call RemoveLocation(l)
set u=null
set t=null
set l=null
set t=null
endfunction
function IIO takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='h004')
endfunction
function IAO takes nothing returns nothing
set DM=GetUnitLoc(GetDyingUnit())
call SetTerrainPathableBJ(DM,PATHING_TYPE_WALKABILITY,true)
call RemoveLocation(DM)
endfunction
function IBO takes nothing returns boolean
return(GetSpellAbilityId()=='A01G')
endfunction
function ICO takes nothing returns boolean
return(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==null)
endfunction
function IDO takes nothing returns boolean
return(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!=null)
endfunction
function IFO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==1)
endfunction
function IGO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==2)
endfunction
function IHO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==3)
endfunction
function IJO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==4)
endfunction
function IKO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==5)
endfunction
function ILO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==6)
endfunction
function IMO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==7)
endfunction
function IPO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==8)
endfunction
function IQO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==9)
endfunction
function ISO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())==10)
endfunction
function ITO takes nothing returns nothing
local unit u = GetTriggerUnit()
if(ICO())then
return
call Q_E(GetOwningPlayer(u),"No Spatial Rend to summon Terror from")
endif
if(IDO())then
call KillUnit(PL[(1+GetPlayerId(GetOwningPlayer(u)))])
set PL[(1+GetPlayerId(GetOwningPlayer(u)))]=null
endif
set ML=GetUnitLoc(VL[(1+GetPlayerId(GetOwningPlayer(u)))])
call AddSpecialEffectLocBJ(ML,"war3mapImported\\DarkLightning.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(ML,"war3mapImported\\DarkLightningNova.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(ML,"war3mapImported\\Portal.mdx")
call DestroyEffect(bj_lastCreatedEffect)
if(IFO())then
call CreateNUnitsAtLoc(1,'n009',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IGO())then
call CreateNUnitsAtLoc(1,'n000',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IHO())then
call CreateNUnitsAtLoc(1,'n001',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IJO())then
call CreateNUnitsAtLoc(1,'n002',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IKO())then
call CreateNUnitsAtLoc(1,'n003',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(ILO())then
call CreateNUnitsAtLoc(1,'n004',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IMO())then
call CreateNUnitsAtLoc(1,'n005',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IPO())then
call CreateNUnitsAtLoc(1,'n006',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(IQO())then
call CreateNUnitsAtLoc(1,'n007',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
if(ISO())then
call CreateNUnitsAtLoc(1,'n00B',GetOwningPlayer(u),ML,bj_UNIT_FACING)
endif
set PL[(1+GetPlayerId(GetOwningPlayer(u)))]=bj_lastCreatedUnit
if IsEyeRat[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(u))])] then
call BlzSetUnitSkin(bj_lastCreatedUnit, 'n033' )
call BlzSetUnitName(bj_lastCreatedUnit,"|c000100E2T|r|c000C00DFe|r|c001800DCr|r|c002300DAr|r|c002E00D7o|r|c003900D4r|r|c004500D1 |r|c005000CFo|r|c005B00CCf|r|c006600C9 |r|c007200C6t|r|c007D00C4h|r|c008800C1e|r|c009300BE |r|c009F00BBR|r|c00AA00B9a|r|c00B500B6t|r")
endif
call BlzSetUnitArmor(bj_lastCreatedUnit,BlzGetUnitArmor(bj_lastCreatedUnit)+((GetHeroAgi(u,true)*.1)*(1.+(GetHeroLevel(u)*.025))))
call BlzSetUnitMaxHP(bj_lastCreatedUnit,BlzGetUnitMaxHP(bj_lastCreatedUnit)+R2I((GetHeroAgi(u,true)*5.)*(1.+(GetHeroLevel(u)*.15)))+MeatHealth[GetUnitUserData(u)])
call BlzSetUnitBaseDamage(bj_lastCreatedUnit,BlzGetUnitBaseDamage(bj_lastCreatedUnit,0)+R2I((GetHeroAgi(u,true)*2.)*(1.+(GetHeroLevel(u)*.05))),0)
call SetWidgetLife(bj_lastCreatedUnit,BlzGetUnitMaxHP(bj_lastCreatedUnit))
call RemoveLocation(ML)
call IssueTargetOrderById(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],852179,PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call PauseUnit(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
call SetUnitVertexColorBJ(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],20.,.0,20.,50.)
set TT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=false
set u = null
endfunction
function IWO takes nothing returns boolean
return(GetSpellAbilityId()=='A00P')
endfunction
function IYO takes nothing returns boolean
return(IsUnitGroupEmptyBJ(NM))
endfunction
function IZO takes nothing returns nothing
local integer level
set XM=GetTriggerUnit()
set level = GetUnitAbilityLevelSwapped('A00P',XM)
set OM=GetSpellTargetUnit()
set RM[1]=GetUnitLoc(XM)
set RM[2]=GetUnitLoc(GetSpellTargetUnit())
set IM[1]=(21+(3*level))
set AM[1]=30.
set AM[2]=(100.+(300.*I2R(level))) + (GetHeroInt(XM,true)*level*(1.+(.05*GetHeroLevel(XM))))
set AM[3]=GetLocationX(RM[1])
set AM[4]=GetLocationY(RM[1])
set AM[5]=GetLocationZ(RM[1])
call ShowUnitHide(XM)
call SetUnitInvulnerable(XM,true)
call SetUnitPathing(XM,false)
call AddSpecialEffectLocBJ(RM[1],"war3mapImported\\Lightning Slam.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call CreateNUnitsAtLoc(1,'h002',GetOwningPlayer(XM),RM[1],AngleBetweenPoints(RM[1],RM[2]))
call SetUnitPathing(bj_lastCreatedUnit,false)
call SaveUnitHandleBJ(OM,0,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveUnitHandleBJ(XM,1,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveRealBJ(AM[1],2,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveRealBJ(AM[2],3,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveRealBJ(AM[3],4,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveRealBJ(AM[4],5,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveRealBJ(AM[5],6,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call AddLightningLoc("FORK",RM[1],RM[1])
call SaveLightningHandleBJ(bj_lastCreatedLightning,7,GetHandleIdBJ(bj_lastCreatedUnit),FF)
call SaveIntegerBJ(IM[1],8,GetHandleIdBJ(bj_lastCreatedUnit),FF)
if(IYO())then
call EnableTrigger(X4)
endif
call GroupAddUnit(NM,bj_lastCreatedUnit)
call RemoveLocation(RM[1])
call RemoveLocation(RM[2])
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003001001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)!=true)!=null
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003001002 takes nothing returns boolean
return(GetFilterUnit()!=OM)
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)!=true),(GetFilterUnit()!=OM)))!=null
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)!=true)!=null
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)!=true)!=null
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002001 takes nothing returns boolean
return(IsUnitDeadBJ(GetFilterUnit())!=true)
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM)))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002001 takes nothing returns boolean
return(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM)))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='n00L')
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='n00M')
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='n00U')
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002002002002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='n017')
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))))))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002002 takes nothing returns boolean
return GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))))))))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002002 takes nothing returns boolean
return GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))))))))))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002002 takes nothing returns boolean
return GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())!=true),(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017'))))))))))))
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)!=true),(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())!=true),(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017')))))))))))))))!=null
endfunction
function Trig_Ball_Lightning_Slide_Func001Func019Func019Func023002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)!=true),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)!=true),(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())!=true),(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017')))))))))))))))))!=null
endfunction
function I0O takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)!=true),(GetFilterUnit()!=OM))),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)!=true),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)!=true),(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())!=true),(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((IsUnitVisible(GetFilterUnit(),GetOwningPlayer(XM))),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00L'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00M'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='n00U'),(GetUnitTypeId(GetFilterUnit())!='n017')))))))))))))))))))!=null
endfunction
function I1O takes nothing returns nothing
set OM=GetEnumUnit()
endfunction
function I2O takes nothing returns boolean
return(IsUnitGroupEmptyBJ(CM)!=true)
endfunction
function I3O takes nothing returns boolean
return(IM[1]>0)
endfunction
function I4O takes nothing returns boolean
return(DistanceBetweenPoints(RM[1],RM[2])>=100.)
endfunction
function I5O takes nothing returns nothing
set OM=LoadUnitHandleBJ(0,GetHandleIdBJ(GetEnumUnit()),FF)
set XM=LoadUnitHandleBJ(1,GetHandleIdBJ(GetEnumUnit()),FF)
set RM[1]=GetUnitLoc(GetEnumUnit())
set RM[2]=GetUnitLoc(OM)
set RM[3]=CNE(RM[1],AM[1],AngleBetweenPoints(RM[1],RM[2]))
set AM[1]=LoadRealBJ(2,GetHandleIdBJ(GetEnumUnit()),FF)
set AM[2]=LoadRealBJ(3,GetHandleIdBJ(GetEnumUnit()),FF)
set AM[3]=LoadRealBJ(4,GetHandleIdBJ(GetEnumUnit()),FF)
set AM[4]=LoadRealBJ(5,GetHandleIdBJ(GetEnumUnit()),FF)
set AM[5]=LoadRealBJ(6,GetHandleIdBJ(GetEnumUnit()),FF)
set AM[6]=GetLocationZ(RM[1])+40.
set BM=LoadLightningHandleBJ(7,GetHandleIdBJ(GetEnumUnit()),FF)
if(I4O())then
call SetUnitPositionLocFacingBJ(GetEnumUnit(),RM[3],AngleBetweenPoints(RM[1],RM[2]))
call MoveLightningEx(BM,true,AM[3],AM[4],AM[5],GetLocationX(RM[1]),GetLocationY(RM[1]),AM[6])
else
call CreateTextTagLocBJ(I2S(R2I(AM[2])),RM[1],0,10,100,100,100,0)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64.,90)
call UnitDamageTargetEx(XM,OM,AM[2],false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call AddSpecialEffectTargetUnitBJ("origin",OM,"war3mapImported\\Lightning Slam.mdx")
call DestroyEffect(bj_lastCreatedEffect)
set IM[1]=LoadIntegerBJ(8,GetHandleIdBJ(GetEnumUnit()),FF)
set IM[1]=(IM[1]-1)
if(I3O())then
set CM=CQE(1000.,RM[1],Condition(function I0O))
if(I2O())then
set AM[1]=(AM[1]+3.)
set AM[2]=(AM[2]+(AM[2]*.22))
set AM[3]=GetLocationX(RM[1])
set AM[4]=GetLocationY(RM[1])
set AM[5]=GetLocationZ(RM[1])
call DestroyLightning(BM)
call AddLightningLoc("FORK",RM[1],RM[1])
call ForGroupBJ(C5E(1,CM),function I1O)
call SaveUnitHandleBJ(OM,0,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveRealBJ(AM[1],2,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveRealBJ(AM[2],3,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveRealBJ(AM[3],4,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveRealBJ(AM[4],5,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveRealBJ(AM[5],6,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveLightningHandleBJ(bj_lastCreatedLightning,7,GetHandleIdBJ(GetEnumUnit()),FF)
call SaveIntegerBJ(IM[1],8,GetHandleIdBJ(GetEnumUnit()),FF)
else
call DestroyLightning(BM)
call SetUnitPositionLocFacingBJ(XM,RM[1],AngleBetweenPoints(RM[1],RM[2]))
call ShowUnitShow(XM)
call SetUnitInvulnerable(XM,false)
call SetUnitPathing(XM,true)
call SelectUnitAddForPlayer(XM,GetOwningPlayer(XM))
call UnitAddItemByIdSwapped('I00K',XM)
call FlushChildHashtableBJ(GetHandleIdBJ(GetEnumUnit()),FF)
call GroupRemoveUnit(NM,GetEnumUnit())
call RemoveUnit(GetEnumUnit())
endif
call DestroyGroup(CM)
else
call DestroyLightning(BM)
call SetUnitPositionLocFacingBJ(XM,RM[1],AngleBetweenPoints(RM[1],RM[2]))
call ShowUnitShow(XM)
call SetUnitInvulnerable(XM,false)
call SetUnitPathing(XM,true)
call SelectUnitAddForPlayer(XM,GetOwningPlayer(XM))
call UnitAddItemByIdSwapped('I00K',XM)
call FlushChildHashtableBJ(GetHandleIdBJ(GetEnumUnit()),FF)
call GroupRemoveUnit(NM,GetEnumUnit())
call RemoveUnit(GetEnumUnit())
endif
endif
call RemoveLocation(RM[1])
call RemoveLocation(RM[2])
call RemoveLocation(RM[3])
endfunction
function I6O takes nothing returns boolean
return(IsUnitGroupEmptyBJ(NM))
endfunction
function I7O takes nothing returns nothing
call ForGroupBJ(NM,function I5O)
if(I6O())then
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function I9O takes nothing returns boolean
return(GetSpellAbilityId()=='A01Q')
endfunction
function AVO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A01P')
call SetUnitAbilityLevelSwapped('A01P',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A01Q',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852565,GetTriggerUnit())
endfunction
function AXO takes nothing returns boolean
return(GetSpellAbilityId()=='A001')
endfunction
function AOO takes nothing returns boolean
return(IsUnitAliveBJ(LC[(1+GetPlayerId(GetEnumPlayer()))]))
endfunction
function ARO takes nothing returns nothing
if(AOO())then
call SetWidgetLife(LC[(1+GetPlayerId(GetEnumPlayer()))],GetUnitState(LC[(1+GetPlayerId(GetEnumPlayer()))],UNIT_STATE_MAX_LIFE))
call SetUnitState(LC[(1+GetPlayerId(GetEnumPlayer()))],UNIT_STATE_MANA,GetUnitState(LC[(1+GetPlayerId(GetEnumPlayer()))],UNIT_STATE_MAX_MANA))
call AddSpecialEffectTargetUnitBJ("origin",LC[(1+GetPlayerId(GetEnumPlayer()))],"war3mapImported\\HolyAwakening.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endif
endfunction
function AIO takes nothing returns nothing
set BQ=C3E(GetOwningPlayer(GetTriggerUnit()))
call ForForce(BQ,function ARO)
call DestroyForce(BQ)
endfunction
function ANO takes nothing returns boolean
if IsUnitAlly(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) then
return false
endif
return(UnitHasBuffBJ(GetEventDamageSource(),'B04N'))
endfunction
function ABO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
call SetHeroInt(R9E[PXE],GetHeroInt(R9E[PXE],false)-IVE[PXE],true)
call ReleaseTimer(GetExpiredTimer())
call FBE(PXE)
set t=null
endfunction
function ACO takes nothing returns nothing
local unit u=GetEventDamageSource()
local timer t
local real r=(I2R(GetUnitAbilityLevel(u,'A01Q'))*1)+10.
local integer PXE=FNE()
set R9E[PXE]=u
set IVE[PXE]=GetUnitAbilityLevel(u,'A01Q')
call SetHeroInt(u,GetHeroInt(u,false)+(GetUnitAbilityLevel(u,'A01Q')),true)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FrozenOrb.mdl",u,"chest"))
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,r,false,function ABO)
set u=null
set t=null
endfunction
function AFO takes nothing returns boolean
return(GetSpellAbilityId()=='A00E')
endfunction
function AGO takes nothing returns nothing
set BL=GetSpellTargetUnit()
set CL=GetUnitLoc(GetTriggerUnit())
set DL=40.
set FL=.0
call SYE(BL,CL,DL,FL)
endfunction
function AJO takes nothing returns boolean
return(GetLearnedSkill()=='A01G')
endfunction
function AKO takes nothing returns nothing
if GetUnitAbilityLevel(GetTriggerUnit(),'A00W') != 1 then
call UnitAddAbility(GetTriggerUnit(),'A00W')
endif
endfunction
function AMO takes nothing returns boolean
return(GetSpellAbilityId()=='A01G')
endfunction
function APO takes nothing returns boolean
return(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==null)
endfunction
function AQO takes nothing returns nothing
if(APO())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"No Spatial Rend to summon Terror from")
endif
endfunction
function AZO takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A00A',LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))])!=0)and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false)and(UnitHasBuffBJ(GetTriggerUnit(),'B02K')))!=null
endfunction
function A_O takes nothing returns nothing
call IssueTargetOrderById(VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))],852149,GetTriggerUnit())
endfunction
function A1O takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B02K'))and(GetEventDamage()>=1.)and(not(J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))]))
endfunction
function A2O takes nothing returns nothing
//call DisableTrigger(GetTriggeringTrigger())
//call UnitDamageTargetEx(GetEventDamageSource(),GetTriggerUnit(),(GetEventDamage()*.3),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call EnableTrigger(GetTriggeringTrigger())
call BlzSetEventDamage(GetEventDamage()*1.3)
set OK=GetUnitLoc(GetTriggerUnit())
call CreateTextTagLocBJ((I2S(R2I((GetEventDamage()*1.3)))+"!"),OK,0,10.,20.,.0,20.,0)
call RemoveLocation(OK)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,5.)
call SetTextTagFadepointBJ(bj_lastCreatedTextTag,4)
endfunction
function A4O takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B02K'))and(GetEventDamage()>=1.)and(BI[NI]==LN or BI[NI]==DAMAGE_TYPE_LIGHTNING or BI[NI]==DAMAGE_TYPE_COLD or BI[NI]==DAMAGE_TYPE_MAGIC or BI[NI]==DAMAGE_TYPE_PLANT or BI[NI]==DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL))and(J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))])
endfunction
function A5O takes nothing returns nothing
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(GetEventDamageSource(),GetTriggerUnit(),(GetEventDamage()*.3),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
set OK=GetUnitLoc(GetTriggerUnit())
call CreateTextTagLocBJ((I2S(R2I((GetEventDamage()*1.3)))+"!"),OK,0,10.,20.,.0,20.,0)
call RemoveLocation(OK)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,5.)
call SetTextTagFadepointBJ(bj_lastCreatedTextTag,4)
endfunction
function A7O takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B042'))and(GetUnitAbilityLevelSwapped('A00D',GetEventDamageSource())!=0)
endfunction
function Trig_Bouncy_Attack_Func003002003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetEventDamageSource())))
endfunction
function Trig_Bouncy_Attack_Func003002003002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Bouncy_Attack_Func003002003002002001 takes nothing returns boolean
return(IsUnitDeadBJ(GetFilterUnit())==false)
endfunction
function Trig_Bouncy_Attack_Func003002003002002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)!=null
endfunction
function Trig_Bouncy_Attack_Func003002003002002002002 takes nothing returns boolean
return(GetFilterUnit()!=GetTriggerUnit())
endfunction
function Trig_Bouncy_Attack_Func003002003002002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetFilterUnit()!=GetTriggerUnit())))!=null
endfunction
function Trig_Bouncy_Attack_Func003002003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetFilterUnit()!=GetTriggerUnit())))))!=null
endfunction
function Trig_Bouncy_Attack_Func003002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetFilterUnit()!=GetTriggerUnit())))))))!=null
endfunction
function A8O takes nothing returns boolean
return(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetEventDamageSource()))),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetFilterUnit()!=GetTriggerUnit())))))))))!=null
endfunction
function A9O takes nothing returns nothing
local unit t = GetTriggerUnit()
local unit u = GetEventDamageSource()
local group g
local integer YUX
call UnitRemoveAbility(t,'B042')
set GLOBAL_CASTER=t
set g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(t),GetUnitY(t),600.,Condition(function A8O))
set t = GroupPickRandomUnit(g)
if t != null then
//if GetSpellAbilityId()=='A00C' then
set YUX=LDE()
set KHV[(YUX)]=((.4)*1.)
if IsEyeRat[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(u))])] then
set KJV[(YUX)]=("war3mapImported\\CheeseItem.mdx")
else
set KJV[(YUX)]=("war3mapImported\\ArcaneMissileComplete.mdx")
endif
set KGV[(YUX)]=((1400)*1.)
set KFV[(YUX)]=((750)*1.)
set KMV[(YUX)]=(true)
set KPV[(YUX)]=(false)
call R8X(YUX,GetUnitAbilityLevel(u,'A00D')+5)
set YYV[YUX]=GetUnitAbilityLevel(u,'A00D')-1
call R7X(YUX,u,t)
endif
call DestroyGroup(g)
set u = null
set g = null
set t = null
endfunction
function NEO takes nothing returns boolean
return(GetUnitAbilityLevel(GetTriggerUnit(),'B04M')!=0)and(GetUnitAbilityLevel(GetEventDamageSource(),'A013')!=0)
endfunction
function NOO takes nothing returns boolean
local unit u = GetFilterUnit()
local texttag tt
local string Q7E
local effect fx
if IsUnitEnemy(u,GetOwningPlayer(MOONBLADECASTER)) and IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE)==false and UnitAlive(u) and IsUnitType(u,UNIT_TYPE_STRUCTURE)==false and u != null then
set tt = CreateTextTag()
set Q7E = I2S(R2I(ZL))+"!"
call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
call SetTextTagText(tt,Q7E,.023)
call SetTextTagVelocity(tt,0.0355 * Cos(90. * bj_DEGTORAD), 0.0355 * Sin(90. * bj_DEGTORAD))
call SetTextTagColor(tt,0,0,200,255)
call SetTextTagPermanent(tt,false)
call SetTextTagLifespan(tt,5.)
call SetTextTagFadepoint(tt,4.)
call UnitDamageTargetEx(MOONBLADECASTER,u,ZL,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
set fx = AddSpecialEffectTarget("Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl",u,"chest")
call DestroyEffect(fx)
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,-.03)
if GetUnitAbilityLevel(u,'A0O5') != 1 then
call UnitAddAbility(u,'A0O5')
endif
endif
set fx = null
set Q7E = null
set tt = null
set u = null
return false
endfunction
globals
constant group MOONBLADEGROUP = CreateGroup()
unit MOONBLADECASTER
endglobals
function NRO takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit d = GetTriggerUnit()
local real a = GetUnitFacing(u)
local integer lvl = GetUnitAbilityLevel(u,'A013')
call UnitRemoveAbility(d,'B04M')
set ZL=((GetEventDamage()*(.3+(.2*lvl)))+(GetUnitState(u,UNIT_STATE_MANA)*(.02*lvl)))
set MOONBLADECASTER = u
call GroupEnumUnitsInRange(MOONBLADEGROUP,GetUnitX(u) + (150. + (10.*lvl)) * Cos(a * bj_DEGTORAD),GetUnitY(u) + (150. + (10.*lvl)) * Sin(a * bj_DEGTORAD),180.+(10.*lvl),Filter(function NOO))
set d = null
set u = null
endfunction
function NAO takes nothing returns boolean
return(GetSpellAbilityId()=='A00H')
endfunction
function Trig_Desolation_Cast_Func005001003001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Desolation_Cast_Func005001003002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function NNO takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))))
endfunction
function NBO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),HL,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A03C')
call SetUnitAbilityLevelSwapped('A03C',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852668,GetEnumUnit())
endfunction
function Trig_Desolation_Cast_Func008001003001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Desolation_Cast_Func008001003002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function NCO takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))))
endfunction
function NDO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),JL,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A03C')
call SetUnitAbilityLevelSwapped('A03C',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852668,GetEnumUnit())
endfunction
function Trig_Desolation_Cast_Func011002003001 takes nothing returns boolean
return(IsUnitDeadBJ(GetFilterUnit())==false)
endfunction
function Trig_Desolation_Cast_Func011002003002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Desolation_Cast_Func011002003002002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_Desolation_Cast_Func011002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))!=null
endfunction
function NFO takes nothing returns boolean
return(GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))!=null
endfunction
function NGO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetEnumUnit(),851986,JL)
endfunction
function NHO takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A00M',VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],GetUnitAbilityLevelSwapped('A00H',GetTriggerUnit()))
call IssueImmediateOrderById(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],852164)
set HL=GetUnitLoc(GetTriggerUnit())
//set bj_wantDestroyGroup=true
//call ForGroupBJ(CQE((425.+(I2R(GetUnitAbilityLevelSwapped('A00H',GetTriggerUnit()))*25.)),HL,Condition(function NNO)),function NBO)
set JL=GetUnitLoc(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE((425.+(I2R(GetUnitAbilityLevelSwapped('A00H',GetTriggerUnit()))*25.)),JL,Condition(function NCO)),function NDO)
call AddSpecialEffectLocBJ(JL,"war3mapImported\\DarkForce.mdx")
call DestroyEffect(bj_lastCreatedEffect)
set GL=CQE((400.+(25.*I2R(GetUnitAbilityLevelSwapped('A00H',GetTriggerUnit())))),HL,Condition(function NFO))
call ForGroupBJ(GL,function NGO)
call RemoveLocation(HL)
call RemoveLocation(JL)
call DestroyGroup(GL)
endfunction
function NKO takes nothing returns boolean
return(GetSpellAbilityId()=='A00B')and(GetEventDamage()!=.0)
endfunction
function NLO takes nothing returns nothing
//call DisplayTextToPlayer(Player(0),0.,0.,"KB Dummy Cast")
set RL=GetSpellTargetUnit()
set AL=GetUnitLoc(GetTriggerUnit())
set IL=GetUnitLoc(GetSpellTargetUnit())
set NL=(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())*40)
call M6E(RL,NL,.3,AngleBetweenPoints(IL,AL),"war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",0,false,false)
call RemoveLocation(IL)
call RemoveLocation(AL)
endfunction
function NPO takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='o015')
endfunction
function NQO takes nothing returns boolean
return(GetUnitTypeId(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])=='o015')
endfunction
function NSO takes nothing returns boolean
return(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!=null)
endfunction
function NTO takes nothing returns nothing
if(NQO())then
call KillUnit(VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
set VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=null
endif
if(NSO())then
call KillUnit(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
set PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=null
endif
set VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetSummonedUnit()
endfunction
function NWO takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A00A',LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))])!=0)and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false)and(UnitHasBuffBJ(GetTriggerUnit(),'B02K')==false))!=null
endfunction
function NYO takes nothing returns nothing
local real x1 = GetUnitX(GetTriggerUnit())
local real y1 = GetUnitY(GetTriggerUnit())
local real x2 = GetUnitX(VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))])
local real y2 = GetUnitY(VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))])
local integer i = GetUnitAbilityLevelSwapped('A00A',LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))])
local real a = bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
if VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))] != null then
call M6E(GetTriggerUnit(),(i*25.)+50.,.3,a,"war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",0,false,false)
endif
//call SetUnitAbilityLevelSwapped('A00B',VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))],GetUnitAbilityLevelSwapped('A00A',LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))]))
//call DisplayTextToPlayer(Player(0),0.,0.,"I'm castin")
//call IssueTargetOrderBJ( VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))], "slow", GetTriggerUnit() )
//call IssueTargetOrderById(VL[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))],852075,GetTriggerUnit())
endfunction
function N_O takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B04I'))and(GetRandomInt(1,100)<=(10+(2*GetUnitAbilityLevelSwapped('A04F',GetTriggerUnit())))) and BI[NI] != DAMAGE_TYPE_PLANT and BI[NI] != DAMAGE_TYPE_UNIVERSAL and Damage_IsAttack() and GetEventDamageSource() != FLAMEDISCCASTER
endfunction
function N0O takes nothing returns boolean
return((GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())+GetEventDamage())>=GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit()))
endfunction
function N1O takes nothing returns boolean
return(GetRandomInt(1,100)<=(2*GetUnitAbilityLevelSwapped('A04F',GetTriggerUnit())))
endfunction
function N2O takes nothing returns nothing
if GetTriggerUnit()!=GetEventDamageSource() then
if(N0O())then
call SetWidgetLife(GetTriggerUnit(),GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit()))
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())+GetEventDamage()))
endif
call AddSpecialEffectTargetUnitBJ("chest",GetTriggerUnit(),"war3mapImported\\BloodbathTarget.mdx")
call DestroyEffect(bj_lastCreatedEffect)
if(N1O())then
set YK=GetUnitLoc(GetEventDamageSource())
set ZK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),ZK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A04I')
call SetUnitAbilityLevelSwapped('A04I',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A04F',GetTriggerUnit()))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852560,YK)
call RemoveLocation(YK)
call RemoveLocation(ZK)
endif
endif
endfunction
function N4O takes nothing returns boolean
return(GetSpellAbilityId()=='A03K')
endfunction
function N5O takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=1.)
endfunction
function N6O takes nothing returns nothing
if(N5O())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Not enough health to cast")
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-(GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)*.25)))
endif
endfunction
function N8O takes nothing returns boolean
return(GetLearnedSkill()=='A02E')
endfunction
function N9O takes nothing returns nothing
set CQ[(1+GetPlayerId(GetTriggerPlayer()))]=(500.+(100.*I2R(GetUnitAbilityLevelSwapped('A02E',GetTriggerUnit()))))
endfunction
function BEO takes nothing returns boolean
return(GetSpellAbilityId()=='A00W')
endfunction
function BOO takes nothing returns nothing
if PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!=null then
call PauseUnit(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],false)
set TT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitVertexColorBJ(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,90.,100.,25.)
call AddSpecialEffectTargetUnitBJ("chest",PL[(1+GetPlayerId(GetTriggerPlayer()))],"war3mapImported\\COD Ball.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\ShadeAura.mdx")
set SL[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedEffect
else
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"No unit found")
endif
endfunction
function BIO takes nothing returns boolean
return(GetSpellAbilityId()=='A00W')
endfunction
function BNO takes nothing returns nothing
if PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!=null then
call PauseUnit(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
set TT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=false
call SetUnitVertexColorBJ(PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],20.,.0,20.,50.)
call AddSpecialEffectTargetUnitBJ("chest",PL[(1+GetPlayerId(GetTriggerPlayer()))],"war3mapImported\\PeterifyVer.2.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call DestroyEffect(SL[(1+GetPlayerId(GetTriggerPlayer()))])
else
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"No unit found")
endif
endfunction
function BCO takes nothing returns boolean
return(GetSpellAbilityId()=='A0F2')
endfunction
globals
integer array ClericInnateStacks
endglobals
function BDO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
set ClericInnateStacks[GetUnitUserData(IRE[PXE])] = ClericInnateStacks[GetUnitUserData(IRE[PXE])] - 1
if ClericInnateStacks[GetUnitUserData(IRE[PXE])] == 0 then
call GroupRemoveUnit(WK,IRE[PXE])
endif
call FAE(PXE)
call ReleaseTimer(GetExpiredTimer())
set t=null
endfunction
function BFO takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=FIE()
set IRE[PXE]=GetSpellTargetUnit()
if ClericInnateStacks[GetUnitUserData(IRE[PXE])] == 0 then
call GroupAddUnit(WK,GetSpellTargetUnit())
endif
set ClericInnateStacks[GetUnitUserData(IRE[PXE])] = ClericInnateStacks[GetUnitUserData(IRE[PXE])] + 1
call SetTimerData(t,PXE)
call TimerStart(t,10.,false,function BDO)
set t=null
endfunction
function BHO takes nothing returns boolean
return(GetSpellAbilityId()=='A002')
endfunction
function BJO takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit())/100.))
endfunction
function BKO takes nothing returns nothing
if(BJO())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Not enough health to cast")
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit())/100.)))
endif
endfunction
function BMO takes nothing returns boolean
return(GetSpellAbilityId()=='A04F')
endfunction
function BPO takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit())*.15))
endfunction
function BQO takes nothing returns nothing
if(BPO())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Not enough health to cast")
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit())*.15)))
endif
endfunction
function BTO takes nothing returns boolean
return(GetSpellAbilityId()=='A036')
endfunction
function BUO takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=1.)
endfunction
function BWO takes nothing returns nothing
if(BUO())then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call PauseUnit(GetTriggerUnit(),false)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Not enough health to cast")
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())*.15)))
endif
endfunction
function BZO takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B04G'))and(GetUnitAbilityLevelSwapped('A002',GetEventDamageSource())>0)and(GetRandomInt(1,100)<=(5+(2*GetUnitAbilityLevelSwapped('A002',GetEventDamageSource()))))
endfunction
function B_O takes nothing returns boolean
return(GetEventDamage()>.5)
endfunction
function B0O takes nothing returns nothing
local unit u = GetEventDamageSource()
if(B_O())then
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetBJ(u,GetTriggerUnit(),((1.5*I2R(GetHeroStr(u,true)))*I2R(GetUnitAbilityLevelSwapped('A002',u)))* (1. + (.05 * GetHeroLevel(u))),ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL)
call EnableTrigger(GetTriggeringTrigger())
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\BloodEX-Special.mdx")
call DestroyEffect(bj_lastCreatedEffect)
set u = null
endif
endfunction
function B2O takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A0FM',GetEventDamageSource())==1)
endfunction
function B3O takes nothing returns boolean
return(GetEventDamage()>=.5)
endfunction
function B4O takes nothing returns nothing
if(B3O())then
if GetEventDamageSource() !=GetTriggerUnit() then
call SetWidgetLife(GetEventDamageSource(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetEventDamageSource())+(GetEventDamage()*.15)))
call AddSpecialEffectTargetUnitBJ("origin",GetEventDamageSource(),"war3mapImported\\VampiricAuraTarget.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endif
endif
endfunction
function B6O takes nothing returns boolean
return(GetSpellAbilityId()=='A03Q')
endfunction
function Trig_Trothfangs_Butchery_Short_Func003001003001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Trothfangs_Butchery_Short_Func003001003002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function B7O takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))))
endfunction
function B8O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),QL,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A03P')
call SetUnitAbilityLevelSwapped('A03P',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
endfunction
function B9O takes nothing returns nothing
set QL=GetUnitLoc(GetTriggerUnit())
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(350.,QL,Condition(function B7O)),function B8O)
call RemoveLocation(QL)
endfunction
function CEO takes nothing returns boolean
return(GetSpellAbilityId()=='A03Q')
endfunction
function Trig_Trothfangs_Butchery_Medium_Func003001003001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Trothfangs_Butchery_Medium_Func003001003002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function CXO takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))))
endfunction
function COO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),RQ,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A03N')
call SetUnitAbilityLevelSwapped('A03N',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
endfunction
function CRO takes nothing returns nothing
set RQ=GetUnitLoc(GetTriggerUnit())
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(600.,RQ,Condition(function CXO)),function COO)
call RemoveLocation(RQ)
endfunction
function CAO takes nothing returns boolean
return(GetSpellAbilityId()=='A03Q')
endfunction
function Trig_Trothfangs_Butchery_Long_Func003001003001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Trothfangs_Butchery_Long_Func003001003002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function CNO takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))))
endfunction
function CBO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),IQ,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A03O')
call SetUnitAbilityLevelSwapped('A03O',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
call AddSpecialEffectTargetUnitBJ("chest",GetEnumUnit(),"Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnBirthMissile.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function CCO takes nothing returns nothing
set IQ=GetUnitLoc(GetTriggerUnit())
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(800.,IQ,Condition(function CNO)),function CBO)
call RemoveLocation(IQ)
endfunction
function CFO takes nothing returns boolean
return(GetSpellAbilityId()=='A0FE')
endfunction
function CGO takes nothing returns boolean
return(CountUnitsInGroup(AH)==0)
endfunction
function CHO takes nothing returns boolean
return(JH[NH]==3)
endfunction
function CJO takes nothing returns boolean
return(JH[NH]==2)
endfunction
function CKO takes nothing returns boolean
return(JH[NH]==1)
endfunction
function CLO takes nothing returns nothing
if(CGO())then
call EnableTrigger(ELV)
endif
call AddSpecialEffectTargetUnitBJ("chest",GetSpellTargetUnit(),"war3mapImported\\DoubleEdgeTarget.mdx")
call DestroyEffect(bj_lastCreatedEffect)
set NH=(NH+1)
set BH[NH]=GetTriggerUnit()
set CH[NH]=GetSpellTargetUnit()
call GroupAddUnit(AH,CH[NH])
set DH[NH]=GetUnitLoc(BH[NH])
set FH[1]=GetUnitLoc(CH[NH])
set GH[NH]=AngleBetweenPoints(DH[NH],FH[1])
set HH[NH]=25.
set JH[NH]=3
if(CKO())then
set KH[NH]=150.
set LH[NH]=(KH[NH]/HH[NH])
else
if(CJO())then
set KH[NH]=250.
set LH[NH]=(KH[NH]/HH[NH])
else
if(CHO())then
set KH[NH]=350.
set LH[NH]=(KH[NH]/HH[NH])
endif
endif
endif
set BH[NH]=null
call RemoveLocation(DH[1])
endfunction
function CPO takes nothing returns boolean
return(GetSpellAbilityId()=='A0A3')
endfunction
function CQO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A099')
call SetUnitAbilityLevelSwapped('A099',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0A3',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852160,GetTriggerUnit())
endfunction
function CTO takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A0DV',GetTriggerUnit())>0)and(GetRandomInt(1,100)<=(10+(2*GetUnitAbilityLevelSwapped('A0DV',GetTriggerUnit()))))and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null
endfunction
function CUO takes nothing returns nothing
local unit u=GetTriggerUnit()
local real SVE=(((I2R(GetHeroStr(u,true))*I2R(GetUnitAbilityLevel(u,'A0DV')))+(BlzGetUnitArmor(u)*12*I2R(GetUnitAbilityLevel(u,'A0DV'))))/2.)*(1.+(.05*GetHeroLevel(u)))
if IsUnitEnemy(u,GetOwningPlayer(GetEventDamageSource())) and not IsUnitType(GetEventDamageSource(),UNIT_TYPE_HERO) then
set LK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),LK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(LK)
call UnitAddAbility(bj_lastCreatedUnit,'A0FE')
call SetUnitAbilityLevelSwapped('A0FE',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0DV',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEventDamageSource())
call Y0E(u,GetEventDamageSource(),SVE,ATTACK_TYPE_HERO,false,true)
call IssueTargetOrderById(GetEventDamageSource(),851983,u)
endif
set u=null
endfunction
function CYO takes nothing returns nothing
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
if GetWidgetLife(GetTriggerUnit())+(GetEventDamage())>=GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE)then
call SetWidgetLife(GetTriggerUnit(),GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(GetTriggerUnit(),GetWidgetLife(GetTriggerUnit())+GetEventDamage())
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",GetTriggerUnit(),"origin"))
endfunction
function CZO takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'B044')!=0 and GetRandomInt(1,100)<=(10+(3*GetUnitAbilityLevel(GetTriggerUnit(),'A00N'))) and GetTriggerUnit() != GetEventDamageSource() then
call CYO()
endif
return false
endfunction
function C_O takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A0FK',GetTriggerUnit())==1) and GetEventDamage() >= 10.
endfunction
function C1O takes nothing returns nothing
local real r = (GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE)*.005)
if r >= GetEventDamage() then
set r = GetEventDamage()
endif
if (BI[NI]==LN or BI[NI]==DAMAGE_TYPE_LIGHTNING or BI[NI]==DAMAGE_TYPE_COLD or BI[NI]==DAMAGE_TYPE_MAGIC or BI[NI]==DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL))and(J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))]) then
//call SetWidgetLife(GetTriggerUnit(),GetWidgetLife(GetTriggerUnit())+r)
call BlzSetEventDamage(GetEventDamage()-r)
else
if not J5V[(ROX((GetUnitTypeId(GetEventDamageSource()))))] then
//call SetWidgetLife(GetTriggerUnit(),GetWidgetLife(GetTriggerUnit())+r)
call BlzSetEventDamage(GetEventDamage()-r)
endif
endif
endfunction
function C3O takes nothing returns boolean
return(((not(GetUnitAbilityLevel(GetTriggerUnit(),'B01K')!=1))and(not(GetUnitAbilityLevel(GetEventDamageSource(),'B00K')==1))and(not(GetUnitAbilityLevel(GetEventDamageSource(),'B00J')==1))and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null) and GetUnitAbilityLevel(GetEventDamageSource(),'BEsh') != 1 and(GetRandomInt(1,100)<=(10+(5*GetUnitAbilityLevel(ToxiaShielder[GetUnitUserData(GetTriggerUnit())],'A0FC'))))//and GetUnitTypeId(GetEventDamageSource()) != 'e00X'
endfunction
function C4O takes nothing returns nothing
set LK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(ToxiaShielder[GetUnitUserData(GetTriggerUnit())]),LK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(LK)
call UnitAddAbility(bj_lastCreatedUnit,'A088')
call SetUnitAbilityLevelSwapped('A088',bj_lastCreatedUnit,GetUnitAbilityLevel(ToxiaShielder[GetUnitUserData(GetTriggerUnit())],'A088'))
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEventDamageSource())
endfunction
function C6O takes nothing returns boolean
return((UnitHasBuffBJ(GetTriggerUnit(),'B01U'))and(GetRandomInt(0,99)<=(2+(1*GetUnitAbilityLevel(CabaShielder[GetUnitUserData(GetTriggerUnit())],'A0CS'))))and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null
endfunction
function C7O takes nothing returns nothing
set LK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(CabaShielder[GetUnitUserData(GetTriggerUnit())]),LK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(LK)
call UnitAddAbility(bj_lastCreatedUnit,'A006')
call SetUnitAbilityLevelSwapped('A006',bj_lastCreatedUnit,GetUnitAbilityLevel(CabaShielder[GetUnitUserData(GetTriggerUnit())],'A006'))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEventDamageSource())
endfunction
function C9O takes nothing returns boolean
return(GetSpellAbilityId()=='A0FC')
endfunction
function DVO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A0FL',GetSpellTargetUnit())==0)
endfunction
function DEO takes nothing returns nothing
//if(DVO())then
//call UnitAddAbility(GetSpellTargetUnit(),'A0FL')
//call SetUnitAbilityLevelSwapped('A0FL',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A088',GetTriggerUnit()))
//else
//call SetUnitAbilityLevelSwapped('A0FL',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A088',GetTriggerUnit()))
//endif
set ToxiaShielder[GetUnitUserData(GetSpellTargetUnit())] = GetTriggerUnit()
endfunction
function DOO takes nothing returns boolean
return(GetSpellAbilityId()=='A0F1')
endfunction
function DRO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A00N',GetSpellTargetUnit())==0)
endfunction
function DIO takes nothing returns nothing
if(DRO())then
call UnitAddAbility(GetSpellTargetUnit(),'A00N')
call SetUnitAbilityLevelSwapped('A00N',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0F1',GetTriggerUnit()))
else
call SetUnitAbilityLevelSwapped('A00N',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0F1',GetTriggerUnit()))
endif
endfunction
function DNO takes nothing returns boolean
return(GetSpellAbilityId()=='A0CS')
endfunction
function DBO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04D',GetSpellTargetUnit())==0)
endfunction
function DCO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A09E',GetSpellTargetUnit())==0)
endfunction
function DDO takes nothing returns nothing
//if(DBO())then
//call UnitAddAbility(GetSpellTargetUnit(),'A04D')
//call SetUnitAbilityLevelSwapped('A04D',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A006',GetTriggerUnit()))
//else
//call SetUnitAbilityLevelSwapped('A04D',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A006',GetTriggerUnit()))
//endif
//if(DCO())then
//call UnitAddAbility(GetSpellTargetUnit(),'A09E')
//call SetUnitAbilityLevelSwapped('A09E',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CS',GetTriggerUnit()))
//else
//call SetUnitAbilityLevelSwapped('A09E',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CS',GetTriggerUnit()))
//endif
set CabaShielder[GetUnitUserData(GetSpellTargetUnit())] = GetTriggerUnit()
endfunction
function DGO takes nothing returns boolean
return(GetSpellAbilityId()=='A0CM')
endfunction
function DHO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A03M',GetSpellTargetUnit())==0)
endfunction
function DJO takes nothing returns nothing
if(DHO())then
call UnitAddAbility(GetSpellTargetUnit(),'A03M')
call SetUnitAbilityLevelSwapped('A03M',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CM',GetTriggerUnit()))
else
call SetUnitAbilityLevelSwapped('A03M',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CM',GetTriggerUnit()))
endif
set EntroShielder[GetUnitUserData(GetSpellTargetUnit())] = GetTriggerUnit()
endfunction
function DLO takes nothing returns boolean
return(GetSpellAbilityId()=='A0CN')
endfunction
function DMO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A024',GetSpellTargetUnit())==0)
endfunction
function DPO takes nothing returns nothing
if(DMO())then
call UnitAddAbility(GetSpellTargetUnit(),'A024')
call SetUnitAbilityLevelSwapped('A024',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CN',GetTriggerUnit()))
else
call SetUnitAbilityLevelSwapped('A024',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0CN',GetTriggerUnit()))
endif
endfunction
function DSO takes nothing returns boolean
return((UnitHasBuffBJ(GetTriggerUnit(),'B01T'))and(GetRandomInt(1,100)<=(5+(2*GetUnitAbilityLevelSwapped('A024',GetTriggerUnit()))))and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null
endfunction
function DTO takes nothing returns nothing
set LK=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),LK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(LK)
call UnitAddAbility(bj_lastCreatedUnit,'A0FH')
call IssueTargetOrderById(bj_lastCreatedUnit,852149,GetEventDamageSource())
endfunction
function DWO takes nothing returns boolean
return(GetSpellAbilityId()=='A030')and(UnitHasBuffBJ(GetSpellTargetUnit(),'B04D'))
endfunction
function DYO takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(c,'A030')
set MK=GetUnitLoc(GetSpellTargetUnit())
call UnitRemoveAbility(GetSpellTargetUnit(),'B04D')
call CreateNUnitsAtLoc(1,'h00L',GetOwningPlayer(c),MK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(MK)
call UnitAddAbility(bj_lastCreatedUnit,'A030')
call SetUnitAbilityLevelSwapped('A030',bj_lastCreatedUnit,level)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(bj_lastCreatedUnit,'A030'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(bj_lastCreatedUnit,'A030'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(c,true)*level*level*.05*(1.+(.04*GetHeroLevel(c)))))
call IssueTargetOrderById(bj_lastCreatedUnit,852587,GetSpellTargetUnit())
set c =null
endfunction
function D_O takes nothing returns boolean
return(GetSpellAbilityId()=='A031')and(UnitHasBuffBJ(GetSpellTargetUnit(),'B04D'))
endfunction
function D0O takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(c,'A031')
set MK=GetUnitLoc(GetSpellTargetUnit())
call UnitRemoveAbility(GetSpellTargetUnit(),'B04D')
call CreateNUnitsAtLoc(1,'h00L',GetOwningPlayer(GetTriggerUnit()),MK,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(10.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(MK)
call UnitAddAbility(bj_lastCreatedUnit,'A031')
call SetUnitAbilityLevelSwapped('A031',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A031',GetTriggerUnit()))
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(bj_lastCreatedUnit,'A031'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(bj_lastCreatedUnit,'A031'),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(c,true)*level*level*.2*(1.+(.075*GetHeroLevel(c)))))
call IssueTargetOrderById(bj_lastCreatedUnit,852119,GetSpellTargetUnit())
set c = null
endfunction
function D2O takes nothing returns boolean
return(GetSpellAbilityId()=='A0F4')
endfunction
function D3O takes nothing returns boolean
return((IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_ANCIENT)==false)and(IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_SUMMONED)==false))!=null
endfunction
function D4O takes nothing returns nothing
//if(D3O())then
//call UnitAddAbility(GetSpellTargetUnit(),'A0F5')
//call SetUnitAbilityLevelSwapped('A0F5',GetSpellTargetUnit(),GetUnitAbilityLevelSwapped('A0F4',GetTriggerUnit()))
//endif
if (GetPlayerController(GetOwningPlayer(GetSpellTargetUnit())) == MAP_CONTROL_COMPUTER) or IsUnitIllusion(GetSpellTargetUnit()) then
call SetUnitPathing(GetSpellTargetUnit(),false)
endif
call ZUE(GetSpellTargetUnit(),50*I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A0F4')))
endfunction
function D6O takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit a = GetEventDamageSource()
if GetUnitAbilityLevel(u,'A0EQ')==0 then
call UnitAddAbility(u,'A0EQ')
endif
call AddUnitBonus(u,BONUS_ARMOR,-1.*(3.+(GetHeroAgi(a,true)*.005)))
if IsRangerRat[GetUnitUserData(a)] or IsRangerGreen[GetUnitUserData(a)] then
if IsRangerRat[GetUnitUserData(a)] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfVenom.mdx",u,"origin"))
endif
if IsRangerGreen[GetUnitUserData(a)] then
call DestroyEffect(AddSpecialEffectTarget("RocketWithoutCrater.mdl",u,"chest"))
endif
else
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Shield Breaker1.mdx",u,"origin"))
endif
set u = null
set a = null
endfunction
function D7O takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),'A0F6')==1 and(BI[NI])==(LN)and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())) and not IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) and GetEventDamage() > 0 then
call D6O()
endif
return false
endfunction
function D8O takes nothing returns boolean
//local unit u
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RBV))then
//set u=CreateUnit(GetOwningPlayer(RBV),'h007',GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit()),.0)
//call UnitAddAbility(u,'A044')
//call UnitApplyTimedLife(u,'BTLF',1.)
//call SetUnitAbilityLevel(u,'A044',GetUnitAbilityLevel(RBV,'A043'))
//call IssueTargetOrderById(u,852075,GetFilterUnit())
call UnitDamageTargetEx(RBV,GetFilterUnit(),(40+(GetHeroStr(RBV,true)*GetUnitAbilityLevel(RBV,'A043')*(1.+(.05*GetHeroLevel(RBV))))),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
//set u=null
return false
endfunction
function D9O takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real r=(GetUnitAbilityLevel(GetEventDamageSource(),'A043')*20)+200.
local unit d = CreateUnit(GetOwningPlayer(GetEventDamageSource()),'h007',x,y,.0)
call UnitRemoveAbility(u,'B00M')
call DestroyEffect(AddSpecialEffect("war3mapImported\\Explosion.mdx",x,y))
call UnitAddAbility(d,'A0J2')
call UnitApplyTimedLife(d,'BTLF',1.)
set RBV=GetEventDamageSource()
call SetUnitAbilityLevel(d,'A0J2',GetUnitAbilityLevel(RBV,'A043'))
call IssuePointOrderById(d,852592,x,y)
call GroupEnumUnitsInRange(RNV,x,y,r,Filter(function D8O))
set u=null
set d = null
endfunction
function FVO takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'B00M')!=0 then
call D9O()
endif
return false
endfunction
function FEO takes nothing returns boolean
return(GetSpellAbilityId()=='A0BJ')
endfunction
function Trig_Remove_Summon_Func002002003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_Remove_Summon_Func002002003002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n00L')
endfunction
function Trig_Remove_Summon_Func002002003002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n00M')
endfunction
function Trig_Remove_Summon_Func002002003002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n00U')
endfunction
function Trig_Remove_Summon_Func002002003002002002002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n017')
endfunction
function Trig_Remove_Summon_Func002002003002002002 takes nothing returns boolean
return GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00U'),(GetUnitTypeId(GetFilterUnit())=='n017'))
endfunction
function Trig_Remove_Summon_Func002002003002002 takes nothing returns boolean
return GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00M'),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00U'),(GetUnitTypeId(GetFilterUnit())=='n017'))))
endfunction
function Trig_Remove_Summon_Func002002003002 takes nothing returns boolean
return GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00L'),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00M'),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00U'),(GetUnitTypeId(GetFilterUnit())=='n017'))))))
endfunction
function FXO takes nothing returns boolean
return GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00L'),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00M'),(GetBooleanOr((GetUnitTypeId(GetFilterUnit())=='n00U'),(GetUnitTypeId(GetFilterUnit())=='n017'))))))))
endfunction
function FOO takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
function FRO takes nothing returns nothing
set DK=GetSpellTargetLoc()
set CK=CQE(224.,DK,Condition(function FXO))
call AddSpecialEffectTargetUnitBJ("origin",GetEnumUnit(),"Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call ForGroupBJ(CK,function FOO)
call RemoveLocation(DK)
call DestroyGroup(CK)
endfunction
function FAO takes nothing returns boolean
return(GetSpellAbilityId()=='A02Y')and(UnitHasBuffBJ(GetSpellTargetUnit(),'B02P'))
endfunction
function FNO takes nothing returns nothing
call IssueImmediateOrderById(GetTriggerUnit(),851972)
call Q_E(GetOwningPlayer(GetTriggerUnit()),"This unit is Protected, it cannot be stunned.")
endfunction
function FCO takes nothing returns boolean
return(GetSpellAbilityId()=='A0BI')
endfunction
function FDO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A09T')
call SetUnitAbilityLevelSwapped('A09T',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0BI',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852160,GetTriggerUnit())
endfunction
function FGO takes nothing returns boolean
return(GetSpellAbilityId()=='A098')
endfunction
function FHO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A02E',GetTriggerUnit())==0)
endfunction
function Trig_Targeted_Magic_Func003002003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer()))
endfunction
function Trig_Targeted_Magic_Func003002003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Targeted_Magic_Func003002003002002001 takes nothing returns boolean
return true
endfunction
function Trig_Targeted_Magic_Func003002003002002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Targeted_Magic_Func003002003002002002002 takes nothing returns boolean
return(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_Targeted_Magic_Func003002003002002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))!=null
endfunction
function Trig_Targeted_Magic_Func003002003002002 takes nothing returns boolean
return(GetBooleanAnd(true,(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))!=null
endfunction
function Trig_Targeted_Magic_Func003002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd(true,(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))))!=null
endfunction
function FJO takes nothing returns boolean
return(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer())),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd(true,(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))))))!=null
endfunction
function FKO takes nothing returns nothing
set YT=GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLocFacingLocBJ(1,'h007',GetOwningPlayer(GetTriggerUnit()),IK,IK)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A02E')
call SetUnitAbilityLevelSwapped('A02E',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A02E',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEnumUnit())
call GroupAddUnit(NK,GetEnumUnit())
call GroupRemoveUnit(AK,GetEnumUnit())
call RemoveLocation(YT)
endfunction
function FLO takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit())>=8.)and(CountUnitsInGroup(AK)>0)
endfunction
function FMO takes nothing returns nothing
if(FHO())then
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Frost Scythe has not been learned")
return
endif
set IK=GetUnitLoc(GetTriggerUnit())
set AK=CQE(CQ[(1+GetPlayerId(GetTriggerPlayer()))],IK,Condition(function FJO))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FLO())then
call SetUnitManaBJ(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit())-8.))
call ForGroupBJ(C5E(1,AK),function FKO)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveLocation(IK)
call DestroyGroup(AK)
call DestroyGroup(NK)
endfunction
/*function FQO takes nothing returns boolean
return(GetSpellAbilityId()=='A0FB')
endfunction*/
/*function FSO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A088',GetTriggerUnit())==0)
endfunction
function Trig_Nightblade_Innate_Func003002003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer()))
endfunction
function Trig_Nightblade_Innate_Func003002003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Nightblade_Innate_Func003002003002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)!=null
endfunction
function Trig_Nightblade_Innate_Func003002003002002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Nightblade_Innate_Func003002003002002002002 takes nothing returns boolean
return(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_Nightblade_Innate_Func003002003002002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))!=null
endfunction
function Trig_Nightblade_Innate_Func003002003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))!=null
endfunction
function Trig_Nightblade_Innate_Func003002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))))!=null
endfunction
function FTO takes nothing returns boolean
return(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer())),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))))))))))!=null
endfunction*/
/*function FUO takes nothing returns nothing
set YT=GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLocFacingLocBJ(1,'h007',GetOwningPlayer(GetTriggerUnit()),IK,IK)
call UnitApplyTimedLifeBJ(21.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A088')
call SetUnitAbilityLevelSwapped('A088',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A088',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEnumUnit())
call GroupAddUnit(NK,GetEnumUnit())
call GroupRemoveUnit(AK,GetEnumUnit())
call RemoveLocation(YT)
endfunction*/
/*function FWO takes nothing returns boolean
return(GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit())>=8.)and(CountUnitsInGroup(AK)>0)
endfunction*/
/*function FYO takes nothing returns nothing
if(FSO())then
call Q_E(GetOwningPlayer(GetTriggerUnit()),"Venom Thrust has not been learned")
return
endif
set IK=GetUnitLoc(GetTriggerUnit())
set AK=CQE(900.,IK,Condition(function FTO))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(FWO())then
call SetUnitManaBJ(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit())-8.))
call ForGroupBJ(C5E(1,AK),function FUO)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveLocation(IK)
call DestroyGroup(AK)
call DestroyGroup(NK)
endfunction
*/
function F_O takes nothing returns boolean
return(GetSpellAbilityId()=='A01Y')and(RectContainsUnit(bj_mapInitialPlayableArea,UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))
endfunction
function F0O takes nothing returns nothing
set TempLocation = GetUnitLoc(UC[(1+GetPlayerId(GetTriggerPlayer()))])
call SetUnitPositionLoc(GetSpellTargetUnit(),TempLocation)
call RemoveLocation(TempLocation)
set TempLocation = GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function F2O takes nothing returns boolean
return(GetSpellAbilityId()=='A0C0')
endfunction
function F3O takes nothing returns nothing
call ModifyHeroSkillPoints(GetSpellTargetUnit(),0,1)
endfunction
function F5O takes nothing returns boolean
return(GetSpellAbilityId()=='A0CH')
endfunction
function F6O takes nothing returns nothing
call AdjustPlayerStateBJ((2+(GetHeroLevel(GetTriggerUnit())/4)),GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Objects\\Spawnmodels\\Other\\ToonBoom\\ToonBoom.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Weapons\\GryphonRiderMissile\\GryphonRiderMissileTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(TempLocation)
endfunction
function F8O takes nothing returns boolean
return(GetSpellAbilityId()=='A01V')
endfunction
function F9O takes nothing returns nothing
call AddSpecialEffect("war3mapImported\\Arcane Explosion.mdx",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function GEO takes nothing returns boolean
return(GetSpellAbilityId()=='A0AQ')
endfunction
function GXO takes nothing returns nothing
call PlaySoundOnUnitBJ(KY,100,GetSpellAbilityUnit())
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\RedCharkaExplosion.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(TempLocation)
endfunction
function GRO takes nothing returns boolean
return(GetSpellAbilityId()=='A08V')and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))!=MAP_CONTROL_CREEP)
endfunction
function GIO takes nothing returns nothing
local real x = GetUnitX(GetSpellTargetUnit()) - 100. * Cos(GetUnitFacing(GetSpellTargetUnit()) * bj_DEGTORAD)
local real y = GetUnitY(GetSpellTargetUnit()) - 100. * Sin(GetUnitFacing(GetSpellTargetUnit()) * bj_DEGTORAD)
call PlaySoundBJ(HY)
if GetUnitTypeId(GetSpellTargetUnit()) == 'H01F' then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,BS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+(GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"|r")+" has stolen "+I2S(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10)+" gold and "+I2S(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_LUMBER)/5)+" lumber from "+(BS[(1+GetPlayerId(GetOwningPlayer(GetSpellTargetUnit())))])+(GetPlayerName(GetOwningPlayer(GetSpellTargetUnit()))+"|r"+"; has the Merchant Lord let his greed get the better of him?"))
set THIEFSWAG[GetUnitUserData(GetTriggerUnit())]= THIEFSWAG[GetUnitUserData(GetTriggerUnit())] + GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10.
call SetPlayerStateBJ(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)+(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10)))
call SetPlayerStateBJ(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)-(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10)))
call SetPlayerStateBJ(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER,(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)+(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_LUMBER)/5)))
call SetPlayerStateBJ(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_LUMBER,(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_LUMBER)-(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_LUMBER)/5)))
if IsThiefRat[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] then
call SGE('h01U',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack two",1.0)
else
call SGE('h00Y',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack one",1.0)
endif
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+(GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"|r"))+(" has stolen "+(I2S((GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10))+((" gold from "+BS[(1+GetPlayerId(GetOwningPlayer(GetSpellTargetUnit())))])+(GetPlayerName(GetOwningPlayer(GetSpellTargetUnit()))+"|r!"))))))
set THIEFSWAG[GetUnitUserData(GetTriggerUnit())]= THIEFSWAG[GetUnitUserData(GetTriggerUnit())] + GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10.
call SetPlayerStateBJ(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)+(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10)))
call SetPlayerStateBJ(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)-(GetPlayerState(GetOwningPlayer(GetSpellTargetUnit()),PLAYER_STATE_RESOURCE_GOLD)/10)))
if IsThiefRat[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] then
call SGE('h01U',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack two",1.0)
else
call SGE('h00Y',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack one",1.0)
endif
endif
endfunction
function GNO takes nothing returns boolean
return(GetUnitTypeId(GetSpellTargetUnit())!='o001')and(GetSpellAbilityId()=='A0BG')
endfunction
function GBO takes nothing returns nothing
set JK=GetRandomInt(0,(GetUnitAbilityLevelSwapped('A0BG',GetTriggerUnit())+5))
set KK=GetRandomInt(0,(GetUnitAbilityLevelSwapped('A0BG',GetTriggerUnit())+5))
set HK=GetRandomInt(0,(GetUnitAbilityLevelSwapped('A0BG',GetTriggerUnit())+5))
call ModifyHeroStat(0,GetSpellTargetUnit(),0,HK)
call ModifyHeroStat(1,GetSpellTargetUnit(),0,JK)
call ModifyHeroStat(2,GetSpellTargetUnit(),0,KK)
call ModifyHeroStat(0,GetTriggerUnit(),0,HK*7/2)
call ModifyHeroStat(1,GetTriggerUnit(),0,JK*7/2)
call ModifyHeroStat(2,GetTriggerUnit(),0,KK*7/2)
call DisplayTextToForce(C3E(GetOwningPlayer(GetTriggerUnit())),((BS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+(GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"|r"))+(" has increased "+(GetPlayerName(GetOwningPlayer(GetSpellTargetUnit()))+("'s "+("Strength by "+(I2S(HK)+(", "+("Agility by "+(I2S(JK)+(", "+(" Intelligence by "+(I2S(KK)+", and their own stats by 350% that amount.")))))))))))))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",GetTriggerUnit(),"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",GetSpellTargetUnit(),"origin"))
endfunction
function GDO takes nothing returns boolean
return(GetUnitTypeId(GetSpellAbilityUnit())=='E01O')and(GetSpellAbilityId()=='A08X')and not IsUnitIllusion(GetSpellTargetUnit())
endfunction
function GFO takes nothing returns boolean
return(IsItemOwned(UnitItemInSlotBJ(FD,bj_forLoopAIndex)))and(DD==false)
endfunction
function GGO takes nothing returns nothing
set FD=GetSpellTargetUnit()
set DD=false
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(GFO())then
call UnitRemoveItemFromSlotSwapped(bj_forLoopAIndex,FD)
set DD=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set TempLocation = GetUnitLoc(GetSpellTargetUnit())
call AddSpecialEffectLocBJ(TempLocation,"Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function GJO takes nothing returns boolean
return(GetSpellAbilityId()=='A0BE')
endfunction
function GKO takes nothing returns nothing
local integer lvl
call PlaySoundOnUnitBJ(QY,100,GetTriggerUnit())
call PlaySoundOnUnitBJ(QY,100,GetSpellTargetUnit())
if GetUnitTypeId(GetSpellTargetUnit()) == 'E014' and GetTriggerUnit() != GetSpellTargetUnit() then
call UnitRemoveAbility(GetSpellTargetUnit(),'A089')
call UnitAddAbility(GetSpellTargetUnit(),'A089')
set lvl = GetUnitAbilityLevel(GetSpellTargetUnit(),'A0C3')
if lvl != 0 then
call UnitRemoveAbility(GetSpellTargetUnit(),'A0C3')
call UnitAddAbility(GetSpellTargetUnit(),'A0C3')
call SetUnitAbilityLevel(GetSpellTargetUnit(),'A0C3',lvl)
endif
else
call UnitResetCooldown(GetSpellTargetUnit())
endif
call AddSpecialEffectTargetUnitBJ("chest",GetSpellTargetUnit(),"war3mapImported\\BlinkTarget.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function GMO takes nothing returns boolean
return(GetSpellAbilityId()=='A0DA')
endfunction
function GPO takes nothing returns nothing
call ModifyHeroStat(0,GetTriggerUnit(),0,(2*GetUnitAbilityLevelSwapped('A0DA',GetTriggerUnit())))
call AddUnitBonus(GetTriggerUnit(),BONUS_HEALTH,(BlzGetUnitMaxHP(GetTriggerUnit())*.005))
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function GSO takes nothing returns boolean
return(GetSpellAbilityId()=='A08Y')
endfunction
function GTO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
if ICE[PXE]==2 then
call UnitRemoveAbility(IBE[PXE],'A08Y')
call UnitAddAbility(IBE[PXE],'A09Y')
call PlaySoundOnUnitBJ(SY,100,IBE[PXE])
call AddSpecialEffectTargetUnitBJ("weapon",IBE[PXE],"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call ReleaseTimer(GetExpiredTimer())
call FRE(PXE)
else
if(not(GetUnitCurrentOrder(IBE[PXE])==852184))then
call UnitRemoveAbility(IBE[PXE],'A0RT')
call ReleaseTimer(GetExpiredTimer())
call FRE(PXE)
else
set ICE[PXE]=ICE[PXE]+1
call PlaySoundOnUnitBJ(SY,100,IBE[PXE])
call AddSpecialEffectTargetUnitBJ("weapon",IBE[PXE],"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call SetTimerData(t,PXE)
call TimerStart(t,.7,false,function GTO)
endif
endif
set t=null
endfunction
function GUO takes nothing returns nothing
local timer t
local integer PXE=FOE()
set IBE[PXE]=GetSpellAbilityUnit()
set ICE[PXE]=1
set t=NewTimer()
call PlaySoundOnUnitBJ(SY,100,GetSpellAbilityUnit())
call UnitAddAbility(IBE[PXE],'A0RT')
call AddSpecialEffectTargetUnitBJ("weapon",GetSpellAbilityUnit(),"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call SetTimerData(t,PXE)
call TimerStart(t,.7,false,function GTO)
set t=null
endfunction
function GYO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A09Y',GetAttacker())==1)
endfunction
function GZO takes nothing returns nothing
call UnitRemoveAbility(GetAttacker(),'A09Y')
call UnitRemoveAbility(GetAttacker(),'A0RT')
call UnitAddAbility(GetAttacker(),'A08Y')
set TempLocation = GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function G0O takes nothing returns boolean
return(GetSpellAbilityId()=='A03Y')
endfunction
function Trig_ThunderMaul_Func004001003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_ThunderMaul_Func004001003002 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function G1O takes nothing returns boolean
return GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))),(IsUnitAliveBJ(GetFilterUnit())))
endfunction
function G2O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),AQ,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A03S')
call SetUnitAbilityLevelSwapped('A03S',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
endfunction
function Trig_ThunderMaul_Func005Func008001003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_ThunderMaul_Func005Func008001003002 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function G3O takes nothing returns boolean
return GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))),(IsUnitAliveBJ(GetFilterUnit())))
endfunction
function G4O takes nothing returns nothing
set NQ=GetUnitLoc(GetEnumUnit())
call AddSpecialEffectLocBJ(NQ,"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call CreateNUnitsAtLoc(1,'o005',GetOwningPlayer(GetTriggerUnit()),AQ,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852075,GetEnumUnit())
call RemoveLocation(NQ)
endfunction
function G5O takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A09Y',LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])==1)or GetUnitAbilityLevelSwapped('BEar',LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])==1)
endfunction
function G6O takes nothing returns nothing
set AQ=GetUnitLoc(GetTriggerUnit())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",GetTriggerUnit(),"origin"))
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(300.,GetUnitLoc(GetTriggerUnit()),Condition(function G1O)),function G2O)
if(G5O())then
call PlaySoundBJ(SY)
call PlaySoundBJ(MY)
call AddSpecialEffectTargetUnitBJ("weapon",GetTriggerUnit(),"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",GetTriggerUnit(),"origin"))
set OQ=(400.+(100.*I2R(GetUnitAbilityLevelSwapped('A03Y',GetTriggerUnit()))))
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(OQ,AQ,Condition(function G3O)),function G4O)
if GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],'A09Y')==1 then
call UnitRemoveAbility(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],'A09Y')
call UnitRemoveAbility(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],'A0RT')
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],'A08Y')
endif
endif
call RemoveLocation(AQ)
endfunction
function G8O takes nothing returns boolean
return(GetSpellAbilityId()=='A04Q')
endfunction
function G9O takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A09Y',LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])==1)or GetUnitAbilityLevelSwapped('BEar',LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])==1)
endfunction
function HVO takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(u,'A04Q')
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+(24*i)+(BlzGetUnitBaseDamage(u,0)/33),0)
if(G9O())then
if GetUnitAbilityLevel(u,'A09Y')==1 then
call UnitRemoveAbility(u,'A09Y')
call UnitRemoveAbility(u,'A0RT')
call UnitAddAbility(u,'A08Y')
endif
call PlaySoundOnUnitBJ(SY,100,u)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+(24*i)+(BlzGetUnitBaseDamage(u,0)/33),0)
call AddSpecialEffectTargetUnitBJ("weapon",u,"Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectTargetUnitBJ("weapon",u,"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set u = null
endif
endfunction
function HXO takes nothing returns boolean
return(GetSpellAbilityId()=='A0F3')
endfunction
function HOO takes nothing returns nothing
call UnitAddItemByIdSwapped('tret',GetSpellTargetUnit())
endfunction
function HIO takes nothing returns boolean
return(GetSpellAbilityId()=='A0BF')
endfunction
function HAO takes nothing returns boolean
local boolean b
set TempLocation = GetUnitLoc(GetEnumUnit())
set b =((IsUnitAliveBJ(GetEnumUnit()))and(RectContainsLoc(bj_mapInitialPlayableArea,CNE(TempLocation,80.,GetUnitFacing(GetTriggerUnit()))))and(IsUnitEnemy(GetEnumUnit(),GetOwningPlayer(GetTriggerUnit())))and(IsUnitAliveBJ(GetEnumUnit()))and(GetUnitTypeId(GetEnumUnit())!='n017')and(GetUnitTypeId(GetEnumUnit())!='n00U')and(GetUnitTypeId(GetEnumUnit())!='n00L')and(GetUnitTypeId(GetEnumUnit())!='n00M')and(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)==false))!=null
call RemoveLocation(TempLocation)
return b
endfunction
function HNO takes nothing returns nothing
if(HAO())then
call SetWidgetLife(GetEnumUnit(),(.94*GetUnitStateSwap(UNIT_STATE_LIFE,GetEnumUnit())))
set TempLocation = GetUnitLoc(GetEnumUnit())
call SetUnitPositionLoc(GetEnumUnit(),CNE(TempLocation,80.,GetUnitFacing(GetSpellAbilityUnit())))
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endif
endfunction
function HBO takes nothing returns nothing
call SetUnitFacingToFaceUnitTimed(GetTriggerUnit(),GetSpellTargetUnit(),0)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=(5+GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set TempLocation=GetUnitLoc(GetSpellTargetUnit())
set bj_wantDestroyGroup=true
call ForGroupBJ(CTE(400.,TempLocation),function HNO)
call RemoveLocation(TempLocation)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function HDO takes nothing returns boolean
return(GetSpellAbilityId()=='A0CR')
endfunction
function HFO takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_MAGIC_IMMUNE))!=null
endfunction
function HGO takes nothing returns boolean
return(UnitAlive(GetEnumUnit()))and(IsUnitEnemy(GetEnumUnit(),GetOwningPlayer(GetTriggerUnit())))and not IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)
endfunction
function HHO takes nothing returns nothing
if(HGO())then
call SetWidgetLife(GetEnumUnit(),1.)
set TempLocation = GetUnitLoc(GetEnumUnit())
if IsFallenOne[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] or IsGrakeTank[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] then
if IsFallenOne[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] then
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\Soul Beam Red.mdx")
endif
if IsGrakeTank[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])] then
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\Artillery.mdx")
endif
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Resurrecttarget.mdx",GetEnumUnit(),"origin"))
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\Resurrecttarget.mdx")
endif
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
set TempLocation = GetRectCenter(bj_mapInitialPlayableArea)
call CreateNUnitsAtLocFacingLocBJ(1,'o005',GetOwningPlayer(GetTriggerUnit()),TempLocation,TempLocation)
call RemoveLocation(TempLocation)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
endif
endfunction
function HJO takes nothing returns nothing
if(HFO())then
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit())/100.))
else
call SetWidgetLife(GetTriggerUnit(),1.)
endif
set bj_wantDestroyGroup=true
call ForGroupBJ(CTE(750.,GetUnitLoc(GetTriggerUnit())),function HHO)
endfunction
function HLO takes nothing returns boolean
return(GetSpellAbilityId()=='A0CC')
endfunction
function HMO takes nothing returns nothing
set TempLocation=GetRectCenter(bj_mapInitialPlayableArea)
call CreateNUnitsAtLoc(1,'o00M',GetEnumPlayer(),TempLocation,bj_UNIT_FACING)
call RemoveLocation(TempLocation)
call UnitApplyTimedLifeBJ(20.,'BTLF',bj_lastCreatedUnit)
endfunction
function HPO takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B005'))
endfunction
function HQO takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'B005'))
endfunction
function Trig_Burn_Func017001 takes nothing returns boolean
return(WC==0)
endfunction
function HSO takes nothing returns nothing
set TempLocation=GetUnitLoc(UC[(1+GetPlayerId(GetTriggerPlayer()))])
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call ForForce(bj_FORCE_ALL_PLAYERS,function HMO)
set WC=(WC+1)
call SetTimeOfDay(24.)
call CreateNUnitsAtLoc(1,'o003',GetOwningPlayer(GetTriggerUnit()),GetUnitLoc(UC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(20.,'BTLF',bj_lastCreatedUnit)
call KillUnit(UC[(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))])
set UC[(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))]=bj_lastCreatedUnit
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(HPO())then
else
call CameraSetEQNoiseForPlayer(Player(-1+(bj_forLoopAIndex)),10.)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call TriggerSleepAction(1.)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(HQO())then
else
call CameraClearNoiseForPlayer(Player(-1+(bj_forLoopAIndex)))
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call TriggerSleepAction(19.)
set WC=(WC-1)
if((WC==0))then
call SetTimeOfDay(12)
endif
endfunction
function HUO takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B03U'))and(GetRandomInt(1,100)<=20)
endfunction
function HWO takes nothing returns nothing
call CreateNUnitsAtLoc(1,GetUnitTypeId(GetTriggerUnit()),GetOwningPlayer(GetTriggerUnit()),RK,(GetUnitFacing(GetEventDamageSource())+180.))
call RemoveLocation(RK)
call SetUnitLifePercentBJ(bj_lastCreatedUnit,5.)
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,"war3mapImported\\CurseBolt.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
//function HZO takes nothing returns boolean
//return(UnitHasBuffBJ(GetEventDamageSource(),'B03V'))and(GetRandomInt(1,100)<=2)
//endfunction
//function H_O takes nothing returns nothing
//call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetEventDamageSource()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
//call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
//call UnitAddAbility(bj_lastCreatedUnit,'A0E0')
//call IssueTargetOrderById(bj_lastCreatedUnit,852581,GetTriggerUnit())
//endfunction
function H1O takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B03T'))
endfunction
function H2O takes nothing returns nothing
call SetWidgetLife(GetEventDamageSource(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetEventDamageSource())+GetEventDamage()))
call AddSpecialEffectTargetUnitBJ("origin",GetEventDamageSource(),"Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function H4O takes nothing returns boolean
return(AngleBetweenPoints(GetUnitLoc(GetEventDamageSource()),GetUnitLoc(GetTriggerUnit()))<=(GetUnitFacing(GetTriggerUnit())-340.))or(AngleBetweenPoints(GetUnitLoc(GetEventDamageSource()),GetUnitLoc(GetTriggerUnit()))>=(GetUnitFacing(GetTriggerUnit())-20.))or(IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())))
endfunction
function H5O takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A07T',GetEventDamageSource())>0)and(H4O())and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())) and GetEventDamage() > 0
endfunction
function H6O takes nothing returns nothing
local real x1=GetUnitX(GetEventDamageSource())
local real y1=GetUnitY(GetEventDamageSource())
local real x2=GetUnitX(GetTriggerUnit())
local real y2=GetUnitY(GetTriggerUnit())
local real d=SquareRoot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
local unit u = CreateUnit(GetOwningPlayer(GetEventDamageSource()),'h007',0.,0.,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
if bj_RADTODEG*Atan2(GetUnitY(GetTriggerUnit())-GetUnitY(GetEventDamageSource()),GetUnitX(GetTriggerUnit())-GetUnitX(GetEventDamageSource()))<=(GetUnitFacing(GetTriggerUnit())-340.)or bj_RADTODEG*Atan2(GetUnitY(GetTriggerUnit())-GetUnitY(GetEventDamageSource()),GetUnitX(GetTriggerUnit())-GetUnitX(GetEventDamageSource()))>=(GetUnitFacing(GetTriggerUnit())-20.)then
call AddSpecialEffectTargetUnitBJ("chest",GetTriggerUnit(),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetBJ(u,GetTriggerUnit(),((.5*I2R(GetUnitAbilityLevelSwapped('A07T',GetEventDamageSource())))*I2R(GetHeroStatBJ(1,GetEventDamageSource(),true))),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call EnableTrigger(GetTriggeringTrigger())
endif
set u = null
endfunction
function H8O takes unit J2E,integer H9O returns integer
local integer JVO=FEE()
set IHE[JVO]=J2E
set IJE[JVO]=H9O
return JVO
endfunction
function JAO takes nothing returns boolean
return BI[NI] != DAMAGE_TYPE_PLANT and BI[NI] != DAMAGE_TYPE_UNIVERSAL and GetEventDamage() > 0 and ((GetUnitAbilityLevelSwapped('A02X',GetEventDamageSource())>0)and(GetRandomInt(1,100)<=(GetUnitAbilityLevelSwapped('A02X',GetEventDamageSource())*2+10))and(not(GetTriggerUnit()==GetEventDamageSource() or IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource()))or GetEventDamage()<=10. or IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))))!=null
endfunction
function JNO takes nothing returns boolean
return(AngleBetweenPoints(GetUnitLoc(GetEventDamageSource()),GetUnitLoc(GetTriggerUnit()))<=(GetUnitFacing(GetTriggerUnit())-340.))or(AngleBetweenPoints(GetUnitLoc(GetEventDamageSource()),GetUnitLoc(GetTriggerUnit()))>=(GetUnitFacing(GetTriggerUnit())-20.))
endfunction
function JBO takes nothing returns boolean
return(JNO())
endfunction
function JCO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local location JDO=GetUnitLoc(IZE[PXE])
local location JFO=CNE(JDO,128.,I0E[PXE])
local unit u = CreateUnit(GetOwningPlayer(IYE[PXE]),'h007',0.,0.,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
if M5E(IZE[PXE])then
call SAE('h00J',GetLocationX(JFO),GetLocationY(JFO),(I0E[PXE]+180.),.5,"attack two",2.)
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(u,IZE[PXE],((GetUnitAbilityLevel(IYE[PXE],'A02X')*.02*I_E[PXE]*2.5)+2.5*(GetHeroAgi(IYE[PXE],true)*GetUnitAbilityLevel(IYE[PXE],'A07T'))),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",IZE[PXE],"chest"))
call SetTimerData(t,PXE)
call TimerStart(t,.2,false,function JCO)
else
call ReleaseTimer(GetExpiredTimer())
call D8E(PXE)
endif
call RemoveLocation(JDO)
call RemoveLocation(JFO)
set JDO=null
set JFO=null
set t=null
set u=null
endfunction
function JGO takes unit JHO,unit JJO,real JKO returns nothing
local unit u=JHO
local unit t=JJO
local real d=JKO
local timer t2
local integer PXE=D7E()
set IYE[PXE]=u
set IZE[PXE]=t
set I_E[PXE]=d
set I0E[PXE]=(GetUnitFacing(u)-180.)
call M6E(t,450.,2.,GetUnitFacing(u),"none.mdl",.0,false,false)
set t2=NewTimer()
call SetTimerData(((t2)),(PXE))
call TimerStart(t2,.2,false,function JCO)
set t=null
set u=null
set t2=null
endfunction
function JLO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local unit u = CreateUnit(GetOwningPlayer(IPE[PXE]),'h007',0.,0.,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
call ReleaseTimer(GetExpiredTimer())
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(u,IQE[PXE],((GetUnitAbilityLevel(IPE[PXE],'A02X')*.6*ISE[PXE])+(GetHeroAgi(IPE[PXE],true)*GetUnitAbilityLevel(IPE[PXE],'A07T'))),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",IQE[PXE],"chest"))
call FVE(PXE)
set t=null
set u = null
endfunction
function JMO takes unit JPO,unit JQO,real SVE returns nothing
local location IHX
local location IJX
local location ANX
local unit JSO=JPO
local unit JTO=JQO
local timer t
local integer PXE=D9E()
set IPE[PXE]=JSO
set IQE[PXE]=JTO
set ISE[PXE]=SVE
set IHX=CNE(GetUnitLoc(JTO),128.,(GetUnitFacing(JTO)+180.))
set IJX=CNE(GetUnitLoc(JTO),128.,(GetUnitFacing(JTO)+90.))
set ANX=CNE(GetUnitLoc(JTO),128.,(GetUnitFacing(JTO)-90.))
call SAE('h00J',GetLocationX(IHX),GetLocationY(IHX),GetUnitFacing(JTO),1.,"attack unarmed",1.)
call SAE('h00J',GetLocationX(IJX),GetLocationY(IHX),(GetUnitFacing(JTO)-90.),1.,"attack unarmed",1.)
call SAE('h00J',GetLocationX(IJX),GetLocationY(IHX),(GetUnitFacing(JTO)+90.),1.,"attack unarmed",1.)
call RemoveLocation(IHX)
call RemoveLocation(IJX)
call RemoveLocation(ANX)
set t=NewTimer()
call SetTimerData(t,PXE)
call TimerStart(t,.5,false,function JLO)
set t=null
set JSO=null
set JTO=null
set IHX=null
set IJX=null
set ANX=null
endfunction
function JUO takes nothing returns nothing
local unit u=GetEventDamageSource()
local unit t=GetTriggerUnit()
local real d=GetEventDamage()
if(JBO())then
call JGO(u,t,d)
else
call JMO(u,t,d)
endif
set u=null
set t=null
endfunction
function JYO takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B03P'))
endfunction
function JZO takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetEventDamageSource()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0E8')
call IssueTargetOrderById(bj_lastCreatedUnit,852066,GetTriggerUnit())
endfunction
function J0O takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B03S'))and(GetRandomInt(1,100)<=5)
endfunction
function J1O takes nothing returns nothing
set XK=GetUnitLoc(GetEventDamageSource())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),XK,bj_UNIT_FACING)
call RemoveLocation(XK)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0E6')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetTriggerUnit())
endfunction
function J3O takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B03R'))and(GetRandomInt(1,100)<=25)and(GetEventDamage()>.0)and(IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetEventDamageSource())))
endfunction
function J4O takes nothing returns nothing
//call DisableTrigger(GetTriggeringTrigger())
//call UnitDamageTargetBJ(GetEventDamageSource(),GetTriggerUnit(),(GetEventDamage()*2.),ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL)
//call EnableTrigger(GetTriggeringTrigger())
call BlzSetEventDamage(GetEventDamage()*3.)
set OK=GetUnitLoc(GetTriggerUnit())
call CreateTextTagLocBJ((I2S(R2I((GetEventDamage()*3.)))+"!"),OK,0,10.,100.,.0,.0,0)
call RemoveLocation(OK)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,5.)
call SetTextTagFadepointBJ(bj_lastCreatedTextTag,4)
endfunction
function J6O takes nothing returns nothing
local timer t=GetExpiredTimer()
local real x = 0
local real y = 0
local integer PXE=GetTimerData(t)
if I6E[PXE]==0 then
call UnitDamageTargetEx((I4E[PXE]),(I5E[PXE]),((9999999.)*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Deadline.mdx",x,y))
call ReleaseTimer(GetExpiredTimer())
call D6E(PXE)
else
set I6E[PXE]=I6E[PXE]-1
call Q6E(I5E[PXE],I2S(I6E[PXE])+"!","|cFF800080")
call SetTimerData(t,PXE)
call TimerStart(t,1.,false,function J6O)
endif
set t=null
endfunction
function J7O takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit u3=CreateUnit((GetOwningPlayer(u)),'h007',.0,.0,.0)
local timer t=NewTimer()
local integer PXE=D5E()
set I4E[PXE]=GetEventDamageSource()
set I5E[PXE]=u
set I6E[PXE]=11
call UnitApplyTimedLife(u3,'BTLF',1.)
call UnitAddAbility(u3,'A01O')
call IssueTargetOrderById(u3,852066,u)
call Q6E(I5E[PXE],I2S(I6E[PXE])+"!","|cFF800080")
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function J6O)
set t=null
set u=null
set u3=null
endfunction
function J8O takes nothing returns boolean
//Cool death touch ability
return false
endfunction
function J9O takes nothing returns boolean
return(GetSpellAbilityId()=='A086')
endfunction
function KVO takes nothing returns nothing
set JJ=(JJ+1)
set YJ[JJ]=CreateGroup()
set KJ[JJ]=GetTriggerUnit()
set LJ[JJ]=(10.+(1.5*I2R(GetUnitAbilityLevelSwapped('A086',KJ[JJ]))))
set MJ[JJ]=(I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),KJ[JJ]))*(50.+I2R(GetUnitAbilityLevelSwapped('A086',KJ[JJ]))))
set MJ[JJ]=(MJ[JJ]+((I2R(GetHeroStatBJ(0,KJ[JJ],true))/25.)*3.*I2R(GetUnitAbilityLevelSwapped('A086',KJ[JJ]))))
set PJ=230.
set QJ=220.
set SJ=(PJ/1.53)
set TJ[1]=GetUnitLoc(KJ[JJ])
call CreateNUnitsAtLoc(1,'h00E',GetOwningPlayer(KJ[JJ]),TJ[1],bj_UNIT_FACING)
set UJ[JJ]=bj_lastCreatedUnit
call SetUnitScalePercent(UJ[JJ],(100.*(PJ/230.)),(100.*(PJ/230.)),(100.*(PJ/230.)))
call UnitApplyTimedLifeBJ(LJ[JJ],'BTLF',UJ[JJ])
call RemoveLocation(TJ[1])
call EnableTrigger(N7)
endfunction
function Trig_Hurricane_Loop_Func001Func004001003001001001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Hurricane_Loop_Func001Func004001003001001002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ])))
endfunction
function Trig_Hurricane_Loop_Func001Func004001003001001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ])))))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func004001003001002 takes nothing returns boolean
return(0==0)
endfunction
function Trig_Hurricane_Loop_Func001Func004001003001 takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ]))))),(0==0)))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func004001003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Hurricane_Loop_Func001Func004001003002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)!=null
endfunction
function Trig_Hurricane_Loop_Func001Func004001003002002002 takes nothing returns boolean
return(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)
endfunction
function Trig_Hurricane_Loop_Func001Func004001003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func004001003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))))!=null
endfunction
function KXO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ]))))),(0==0))),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))))))!=null
endfunction
function KOO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A02C',GetEnumUnit())==0)
endfunction
function KRO takes nothing returns nothing
if(KOO())then
call UnitAddAbility(GetEnumUnit(),'A02C')
endif
endfunction
function Trig_Hurricane_Loop_Func001Func006001003001001001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Hurricane_Loop_Func001Func006001003001001002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ])))
endfunction
function Trig_Hurricane_Loop_Func001Func006001003001001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ])))))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func006001003001002 takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A02C',GetFilterUnit())==1)
endfunction
function Trig_Hurricane_Loop_Func001Func006001003001 takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ]))))),(GetUnitAbilityLevelSwapped('A02C',GetFilterUnit())==1)))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func006001003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Hurricane_Loop_Func001Func006001003002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)!=null
endfunction
function Trig_Hurricane_Loop_Func001Func006001003002002002 takes nothing returns boolean
return(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false and not BlzIsUnitInvulnerable(GetFilterUnit()))
endfunction
function Trig_Hurricane_Loop_Func001Func006001003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))!=null
endfunction
function Trig_Hurricane_Loop_Func001Func006001003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))))!=null
endfunction
function KIO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(KJ[WJ]))))),(GetUnitAbilityLevelSwapped('A02C',GetFilterUnit())==1))),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitInGroup(GetFilterUnit(),YJ[WJ])==false)))))))!=null
endfunction
function KAO takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A02C',GetEnumUnit(),2)
call GroupAddUnit(YJ[WJ],GetEnumUnit())
call UnitAddAbility(GetEnumUnit(),'Aave')
call UnitRemoveAbility(GetEnumUnit(),'Aave')
call SetUnitPathing(GetEnumUnit(),false)
call SetUnitVertexColorBJ(GetEnumUnit(),100,50.,50.,30.)
endfunction
function KNO takes nothing returns boolean
return(GetUnitFlyHeight(GetEnumUnit())<=30.)
endfunction
function KBO takes nothing returns boolean
return(GetUnitFlyHeight(GetEnumUnit())>=QJ)
endfunction
function KCO takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A02C',GetEnumUnit())==3)
endfunction
function KDO takes nothing returns boolean
return(UnitAlive(GetEnumUnit()))
endfunction
function KFO takes nothing returns nothing
call UnitDamageTargetEx(KJ[WJ],GetEnumUnit(),MJ[WJ]+(GetUnitState(GetEnumUnit(),UNIT_STATE_MAX_LIFE)*.16*.04),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
if(KDO())then
set TJ[3]=GetUnitLoc(GetEnumUnit())
set TJ[2]=CNE(TJ[1],SJ,(AngleBetweenPoints(TJ[1],TJ[3])+11.))
call SetUnitPositionLoc(GetEnumUnit(),TJ[2])
call SetUnitFacingTimed(GetEnumUnit(),(AngleBetweenPoints(TJ[1],TJ[3])+11.),0)
if(KCO())then
call SetUnitFlyHeight(GetEnumUnit(),(GetUnitFlyHeight(GetEnumUnit())-GetRandomReal(10.,20.)),.0)
if(KNO())then
call SetUnitAbilityLevelSwapped('A02C',GetEnumUnit(),2)
endif
else
call SetUnitFlyHeight(GetEnumUnit(),(GetUnitFlyHeight(GetEnumUnit())+GetRandomReal(10.,20.)),.0)
if(KBO())then
call SetUnitAbilityLevelSwapped('A02C',GetEnumUnit(),3)
endif
endif
call RemoveLocation(TJ[2])
call RemoveLocation(TJ[3])
else
call SetUnitVertexColorBJ(GetEnumUnit(),100,100.,100.,0)
call SetUnitAbilityLevelSwapped('A02C',GetEnumUnit(),1)
call GroupRemoveUnit(YJ[WJ],GetEnumUnit())
call GroupAddUnit(ZJ,GetEnumUnit())
call AddSpecialEffectTargetUnitBJ("chest",GetEnumUnit(),"BigBloodEX-NoSplat-NoGutz.mdx")
call DestroyEffect(bj_lastCreatedEffect)
if GetRandomInt(0,100)<=20+GetUnitAbilityLevel(KJ[WJ],'A086') and RESSEDTROLL[GetUnitUserData(GetEnumUnit())] == false then
call ModifyHeroStat(0,KJ[WJ],0,1)
call DestroyEffect(AddSpecialEffectTarget("BigBloodEX-NoSplat-NoGutz.mdx",KJ[WJ],"chest"))
endif
endif
endfunction
function KGO takes nothing returns nothing
call SetUnitVertexColorBJ(GetEnumUnit(),100,100.,100.,0)
call SetUnitAbilityLevelSwapped('A02C',GetEnumUnit(),1)
call SetUnitFlyHeight(GetEnumUnit(),GetUnitDefaultFlyHeight(GetEnumUnit()),.0)
call SetUnitPathing(GetEnumUnit(),true)
endfunction
function KHO takes nothing returns boolean
return(IsUnitDeadBJ(UJ[WJ]))
endfunction
function KJO takes nothing returns boolean
return(GetUnitFlyHeight(GetEnumUnit())>5.)
endfunction
function KKO takes nothing returns nothing
if(KJO())then
set TJ[2]=GetUnitLoc(GetEnumUnit())
set TJ[3]=CNE(TJ[2],20.,GetUnitFacing(GetEnumUnit()))
call SetUnitPositionLoc(GetEnumUnit(),TJ[3])
call SetUnitFlyHeight(GetEnumUnit(),(GetUnitFlyHeight(GetEnumUnit())-GetRandomReal(5.,10.)),.0)
call RemoveLocation(TJ[2])
call RemoveLocation(TJ[3])
else
call GroupRemoveUnit(ZJ,GetEnumUnit())
endif
endfunction
function Trig_Hurricane_Loop_Func003Func003001 takes nothing returns boolean
return(JJ==0)
endfunction
function Trig_Hurricane_Loop_Func003Func003002 takes nothing returns boolean
return(CountUnitsInGroup(ZJ)==0)
endfunction
function KLO takes nothing returns boolean
return(GetBooleanAnd((JJ==0),(CountUnitsInGroup(ZJ)==0)))
endfunction
function KMO takes nothing returns nothing
set WJ=1
loop
exitwhen WJ>JJ
set TJ[1]=GetUnitLoc(KJ[WJ])
call SetUnitPositionLoc(UJ[WJ],TJ[1])
set bj_wantDestroyGroup=false
if CountUnitsInGroup(YJ[WJ]) <= 6 then
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(PJ,TJ[1],Condition(function KXO)),function KRO)
set bj_wantDestroyGroup=true
call ForGroupBJ(CQE(PJ,TJ[1],Condition(function KIO)),function KAO)
endif
call ForGroupBJ(YJ[WJ],function KFO)
call RemoveLocation(TJ[1])
if(KHO())then
call ForGroupBJ(YJ[WJ],function KGO)
call GroupClear(YJ[WJ])
call GroupAddGroup(YJ[JJ],YJ[WJ])
call DestroyGroup(YJ[JJ])
call DestroyGroup(YJ[WJ])
set KJ[WJ]=KJ[JJ]
set UJ[WJ]=UJ[JJ]
set MJ[WJ]=MJ[JJ]
set LJ[WJ]=LJ[JJ]
set JJ=(JJ-1)
endif
set WJ=WJ+1
endloop
call ForGroupBJ(ZJ,function KKO)
if(KLO())then
call DestroyGroup(ZJ)
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function KQO takes nothing returns boolean
return(GetSpellAbilityId()=='A0DY')
endfunction
function KSO takes nothing returns boolean
return(EK<=18)
endfunction
function Trig_Imbue_Weapon_Func005Func002001 takes nothing returns boolean
return(EK>18)
endfunction
function Trig_Imbue_Weapon_Func005Func002002 takes nothing returns boolean
return(EK<=36)
endfunction
function KTO takes nothing returns boolean
return(GetBooleanAnd((EK>18),(EK<=36)))
endfunction
function Trig_Imbue_Weapon_Func006Func002001 takes nothing returns boolean
return(EK>36)
endfunction
function Trig_Imbue_Weapon_Func006Func002002 takes nothing returns boolean
return(EK<=54)
endfunction
function KUO takes nothing returns boolean
return(GetBooleanAnd((EK>36),(EK<=54)))
endfunction
function Trig_Imbue_Weapon_Func007Func002001 takes nothing returns boolean
return(EK>54)
endfunction
function Trig_Imbue_Weapon_Func007Func002002 takes nothing returns boolean
return(EK<=72)
endfunction
function KWO takes nothing returns boolean
return(GetBooleanAnd((EK>54),(EK<=72)))
endfunction
function Trig_Imbue_Weapon_Func008Func002001 takes nothing returns boolean
return(EK>72)
endfunction
function Trig_Imbue_Weapon_Func008Func002002 takes nothing returns boolean
return(EK<=90)
endfunction
function KYO takes nothing returns boolean
return(GetBooleanAnd((EK>72),(EK<=90)))
endfunction
function Trig_Imbue_Weapon_Func009Func002001 takes nothing returns boolean
return(EK>90)
endfunction
function Trig_Imbue_Weapon_Func009Func002002 takes nothing returns boolean
return(EK<=95)
endfunction
function KZO takes nothing returns boolean
return(GetBooleanAnd((EK>90),(EK<=95)))
endfunction
function K_O takes nothing returns boolean
return(EK>95)
endfunction
function K0O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
set EK=GetRandomInt(1,101)
if(KSO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0E2')
endif
if(KTO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0DZ')
endif
if(KUO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0DZ')
endif
if(KWO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0E2')
endif
if(KYO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0E1')
endif
if(KZO())then
call UnitAddAbility(bj_lastCreatedUnit,'A0E2')
endif
if(K_O())then
call UnitAddAbility(bj_lastCreatedUnit,'A0E1')
endif
endfunction
function K2O takes nothing returns nothing
//set DI[NI]=DI[NI]+GetEventDamage()
call BlzSetEventDamage(0.)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",GetEventDamageSource(),"origin"))
endfunction
function K3O takes nothing returns boolean
if GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))],'B047')!=0 and GetTriggerUnit()!=GetEventDamageSource()then
call K2O()
endif
return false
endfunction
function K8O takes nothing returns boolean
return(GetSpellAbilityId()=='AIxs')
endfunction
function K9O takes nothing returns nothing
call CameraClearNoiseForPlayer(GetOwningPlayer(GetTriggerUnit()))
endfunction
function LEO takes nothing returns boolean
return(GetSpellAbilityId()=='A02F')
endfunction
function LXO takes nothing returns nothing
set TL=GetSpellTargetLoc()
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(GetTriggerUnit()),TL,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(.01,'BTLF',bj_lastCreatedUnit)
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),TL,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A02D')
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852057,TL)
call RemoveLocation(TL)
endfunction
function LRO takes nothing returns boolean
return(GetSpellAbilityId()=='A03V')and(GetPlayerController(GetOwningPlayer(GetSpellTargetUnit()))==MAP_CONTROL_COMPUTER)
endfunction
function Trig_Whole_Displacement_Func003001 takes nothing returns boolean
return((1+GetPlayerId(GetOwningPlayer(GetSpellTargetUnit())))==6)
endfunction
function LIO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetSpellTargetUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
if IsUnitAlly(GetSpellTargetUnit(),Player(0)) then
call SetUnitPositionLoc(GetSpellTargetUnit(),MD[GetRandomInt(1,2)])
else
call SetUnitPositionLoc(GetSpellTargetUnit(),MD[GetRandomInt(3,4)])
endif
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function LNO takes nothing returns boolean
return(GetSpellAbilityId()=='A02A')
endfunction
function LBO takes nothing returns nothing
set TempLocation = GetSpellTargetLoc()
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\TrinusTenebrae.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call CreateNUnitsAtLoc(1,MC[(PC+5)],GetOwningPlayer(GetTriggerUnit()),TempLocation,bj_UNIT_FACING)
call TriggerExecute(K7)
call RemoveLocation(TempLocation)
endfunction
function LDO takes nothing returns nothing
local unit LFO
set LFO=bj_lastCreatedUnit
call ShowUnitHide(LFO)
call TriggerSleepAction(1.)
call ShowUnitShow(LFO)
call UnitApplyTimedLifeBJ(60,'BTLF',LFO)
set TempLocation=GetUnitLoc(LFO)
call AddSpecialEffectLocBJ(TempLocation,"war3mapImported\\Doomsday.mdx")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function LHO takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='n00U')
endfunction
function LJO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetDyingUnit())
endfunction
function LLO takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='n017')
endfunction
function LMO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetDyingUnit())
endfunction
function LQO takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='n00M')
endfunction
function LSO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetDyingUnit())
endfunction
function LUO takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='n00L')
endfunction
function LWO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetDyingUnit())
endfunction
function LZO takes nothing returns nothing
set FF=InitHashtable()
endfunction
function L0O takes nothing returns nothing
call SetCameraFieldForPlayer(GetEnumPlayer(),CAMERA_FIELD_TARGET_DISTANCE,2350.,.2)
endfunction
function L1O takes nothing returns nothing
call FogEnableOff()
call FogMaskEnableOff()
endfunction
function Trig_General_Map_Initialization_Func015Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_General_Map_Initialization_Func016Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function L2O takes nothing returns boolean
return(ST)
endfunction
function L3O takes nothing returns nothing
call DialogDisplayBJ(true,YC,GetEnumPlayer())
endfunction
function L4O takes nothing returns nothing
call DialogDisplayBJ(false,YC,GetEnumPlayer())
endfunction
function L5O takes nothing returns boolean
return(VD[1]>VD[2])and(VD[1]>=VD[3])and(VD[1]>=VD[4])and(VD[1]>=VD[5])
endfunction
function L6O takes nothing returns boolean
return(VD[2]>=VD[1])and(VD[2]>=VD[3])and(VD[2]>=VD[4])and(VD[2]>=VD[5])
endfunction
function L7O takes nothing returns boolean
return(VD[3]>VD[1])and(VD[3]>VD[2])and(VD[3]>=VD[4])and(VD[3]>=VD[5])
endfunction
function L8O takes nothing returns boolean
return(VD[4]>VD[1])and(VD[4]>VD[2])and(VD[4]>VD[3])and(VD[4]>=VD[5])
endfunction
function L9O takes nothing returns boolean
return(VD[5]>VD[1])and(VD[5]>VD[2])and(VD[5]>VD[3])and(VD[5]>VD[4])
endfunction
function MVO takes nothing returns boolean
return(XT==0)
endfunction
function MEO takes nothing returns boolean
return(XT==1)
endfunction
function MXO takes nothing returns boolean
return(XT==2)
endfunction
function MOO takes nothing returns boolean
return(XT==3)
endfunction
function MRO takes nothing returns boolean
return(XT==4)
endfunction
function MIO takes nothing returns boolean
return(XT==5)
endfunction
function MAO takes nothing returns nothing
if SOCIALWELFARE == false and TRUECOMMUNISM == false and PRODICT == false and NOBOUNTY == false then
call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,true,GetEnumPlayer())
else
call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,false,GetEnumPlayer())
endif
endfunction
function Trig_General_Map_Initialization_Func048Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function DisableEasyFunc takes nothing returns nothing
if XT==1 then
call SetPlayerAbilityAvailableBJ(false,'A02Y',GetEnumPlayer())
endif
call SetPlayerAbilityAvailableBJ(false,'A019',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A03X',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A00J',GetEnumPlayer())
endfunction
function CaptureMouseXY takes nothing returns boolean
local integer mousexyi = GetPlayerId(GetTriggerPlayer())
set MouseX[mousexyi] = BlzGetTriggerPlayerMouseX()
set MouseY[mousexyi] = BlzGetTriggerPlayerMouseY()
return false
endfunction
function MSO999 takes nothing returns nothing
local integer i = 0
local Savecode loadcode
local string s
local player p
local integer i1
local integer i2
local integer i3
loop
exitwhen i > 9
set p = Player(i)
if SAVEDATA[i]!= null and StringLength(SAVEDATA[i])> 1 then
set s = SubString(SAVEDATA[i],StringLength(GetPlayerName(p))+2,StringLength(SAVEDATA[i]))
set loadcode = Savecode.create()
if loadcode.Load(p,s,1) then
set i3 = loadcode.Decode(1000000)
set i2 = loadcode.Decode(1000000)
set i1 = loadcode.Decode(1000000)
set C_F_R_A_G_S[i] = i1
set W_I_N_S[i] = i2
set LOOOSES[i] = i3
else
//call BJDebugMsg("load failed")
endif
//Must decode in reverse order of encodes
call loadcode.destroy()
endif
set i = i + 1
endloop
call ReleaseTimer(GetExpiredTimer())
set p = null
set s = null
endfunction
function MNO takes nothing returns nothing
local trigger mousetrigger
local integer mousexyid = 0
local player p
local string s
local integer i
local integer i2
local integer i3
call CRE(.01)
call CameraSetSmoothingFactor(3.)
set GF=18
set HF=15.
call SetUnitAnimationByIndex(E4V,1)
call SetUnitAnimationByIndex(E7V,1)
call ForForce(bj_FORCE_ALL_PLAYERS,function L0O)
//call C8E(Player(8),PLAYER_COLOR_LIGHT_BLUE,true)
//call C8E(Player(9),PLAYER_COLOR_LIGHT_BLUE,true)
call C8E(Player(10),PLAYER_COLOR_LIGHT_BLUE,true)
call C8E(Player(11),PLAYER_COLOR_LIGHT_BLUE,true)
call ForForce(bj_FORCE_ALL_PLAYERS,function L1O)
call CRE(1.)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[1]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[2]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,"Red is now picking modes. Please wait.")
call TriggerExecute(EUV)
call StartTimerBJ(CreateTimerBJ(false,20.),false,20.)
call CreateTimerDialogBJ(bj_lastStartedTimer,"Game modes")
call CRE(20.)
call DestroyTimerDialog(bj_lastCreatedTimerDialog)
set GAMEM = false
if(L2O())then
call TriggerExecute(ETV)
endif
if(MVO())then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,"Players are now voting on the difficulty setting. Please be patient.")
call ForForce(bj_FORCE_ALL_PLAYERS,function L3O)
call CRE(9.)
call ForForce(bj_FORCE_ALL_PLAYERS,function L4O)
if(L5O())then
set XT=3
endif
if(L6O())then
set XT=1
endif
if(L7O())then
set XT=2
endif
if(L8O())then
set XT=4
endif
if(L9O())then
set XT=5
endif
endif
if(MEO())then
set ED=90.
set RT="|cff00baffEasy|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,(RT+" has been initiated; monsters are at 90% health and damage, Commanders are very easy, and almost all offense is disabled."))
endif
if(MXO())then
set ED=100.
set RT="|cff1ab700Normal|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,(RT+" has been initiated; monsters are at 100% health and damage, Commanders are easy, and most offense is disabled."))
endif
if(MOO())then
set ED=100.
set RT="|cfff6ff00Hard|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,(RT+" has been initiated; monsters are at 100% health and damage, Commanders are normal, and offense is enabled."))
endif
if(MRO())then
set ED=100.
set RT="|cffff6000Nightmare|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,(RT+" has been initiated; monsters are at 100% health and damage, Commanders are nightmarish, and offense is enabled. Commanders also cost 25 lives."))
endif
if(MIO())then
set ED=105.
set RT="|cffaa0000Hell|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.,(RT+" has been initiated; monsters are at 105% health and damage, Commanders are impossible, and offense is enabled. Commanders also cost 25 lives."))
endif
call FOX()
if XT <= 2 then
call ForForce(bj_FORCE_ALL_PLAYERS,function DisableEasyFunc)
endif
call TriggerExecute(I1)
call PlaySoundBJ(GY)
set DS=true
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00Welcome to Enfo's TS: FFB Edition, presented to you by Strikest.|r\n")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00For |cFFE82618basic information|r|cffffcc00, including a list of |cFFE82618item recipes|r |cffffcc00and |cFFFF0000RECOMM
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00For |cFFE82618basic information|r|cffffcc00, including a list of |cFFFF0000RECOMMENDED ITEMS|r, |cffffcc00please press |cFFE82618F9|r. |cffffcc00Be aware that there is also a |cFFE82618Recipe Shop|r |cffffcc00located on your Team Goal.|r")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00Please stay even if you have lost, the game will |cFFFF0000automatically remake|r.|r")ENDED ITEMS|r, |cffffcc00please press |cFFE82618F9|r. |cffffcc00Be aware that there is also a |cFFE82618Recipe Shop|r |cffffcc00located on your Team Goal.|r")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00Visit the official wiki at enfosffb.wikia.com for map information and strategy tips.|r")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cFF1B9BE0Join the official discord at https://discord.gg/PGub8vzzf4 to find games, report bugs, or suggest things for the map!|r")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cFF1B9BE0Special thanks to all my patreons, without you guys there would be no new versions <3|r")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"|cffffcc00Visit www.clan-ffb.com for news, bug report, tips or suggestions!|r")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,60.,"Announcing the first ever Enfo's TS FFB Edition tournament, with a cash prize of 250+ usd, taking place in August.Please out our discord for more info: https://discord.gg/PGub8vzzf4. Also thank you to the patrons at https://www.patreon.com/EnfosFFB for contrubiting to the prize money so I don't have to pay too much out of pocket. GLHF!")
call SetTimeOfDay(12)
set mousetrigger=CreateTrigger()
loop
exitwhen mousexyid>9
set p = Player(mousexyid)
if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
call TriggerRegisterPlayerEvent( mousetrigger,p, EVENT_PLAYER_MOUSE_MOVE )
call TriggerAddCondition( mousetrigger, Condition( function CaptureMouseXY ) )
if (GetLocalPlayer() == p) then
set s = FileIO_Read("Enfos FFB\\"+GetPlayerName(p)+".pld")
if s!= null then
call BlzSendSyncData(I2S(mousexyid),s)
endif
endif
//call BJDebugMsg(s)
endif
set mousexyid = mousexyid + 1
endloop
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
call CreateNUnitsAtLoc(1,'ushd',Player(-1+(bj_forLoopAIndex)),GetPlayerStartLocationLoc(Player(-1+(bj_forLoopAIndex))),bj_UNIT_FACING)
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CreateTextTagLocBJ("North: Advanced/Hybrid Heroes",CNE(CNE(GetRectCenter(PU),150.,180.),450.,90.),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("East: Support Heroes",CNE(CNE(GetRectCenter(PU),150.,180.),450.,.0),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("West: Tank Heroes",CNE(CNE(GetRectCenter(PU),150.,180.),450.,180.),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("South: Spellcaster Heroes",CNE(CNE(GetRectCenter(PU),150.,180.),450.,270.),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("Presented to you by: |cFF540081S|r|cFF670675t|r|cFF790C69r|r|cFF8C125Di|r|cFF9E1750k|r|cFFB11D44e|r|cFFC32338s|r|cFFD6292Ct|r,",CNE(GetRectCenter(PU),150.,180.),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("DrunkPenguin.",CNE(CNE(GetRectCenter(PU),50.,270.),150.,180.),0,8.,80.,80.,80.,0)
call CreateTextTagLocBJ("|cFF2380DC Discord: https://discord.gg/PGub8vzzf4|r",CNE(CNE(GetRectCenter(PU),-50.,270.),150.,180.),0,8.,80.,80.,80.,0)
call CreateQuestBJ(0,"Enfo's Team Survival:FFB","Welcome to Enfo's Team Survival: FFB Edition, by Strikest and DrunkPenguin.|n|nJoin our discord! https://discord.gg/PGub8vzzf4|n|nVisit the official wiki at www.enfosffb.wikia.com for map information, tips, and strategy.","ReplaceableTextures\\CommandButtons\\BTNCombat1.blp")
call CreateQuestBJ(0,"Recommended Items","|cFFB6488FAll Heroes|r: |cFFFF0000Winged Leather Boots|r, |cFFFF0000Elven Plate Mail|r, Health Potions.|n|n|cFF0EA8F1Caster Heroes|r|nHisan Salves, Staff of Peace(Tranquil Blade + Elder Staff + Sapphire-inset Ring)|nIndulgence(Lategame, after tank has items.), Tranquil Warfare Set(Again, lategame.)|nUthmor's Skullcleaver(Criticals work on spells, but only get this SUPER lategame, after tank has good items; it's very expensive and the tank needs the gold more.)|n|n|cFFE6691ATank Heroes|r|nThe Eternal Core(Ruby-inset Ring + Bloodstone-inset Ring + Recipe(Found in Ezara's Runewords, NOT Venus.)), Shard of Ragnaros(Mid-lategame)|nReinforced Crystal Armor/Shadowbark Leathers(Only if your hero does not have Evasion, it does not stack)/Victory Mail(Anti-Magic Shield, useful for preventing Armor Crush and Knockback)|nRagnarok/Immortal Escutcheon(Lategame)|n|n|cFFB3CC33Melee DPS|r|nThe Brutalizer(Bloodstone-inset Ring + Polished Elven Telo + Spineripper)|nRagnarok(Strength heroes, lategame), The Ravager(Lategame)","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
call CreateQuestBJ(0,"Commands","|cffffcc00-monsters|r - Shows how many monsters there are on each side.|n|cffffcc00-repick|r - Repicks your hero.|n|cffffcc00-tips|r - Toggles wave tips.|n|cffffcc00-autosend x|r - Autosends player x your resources every 10 seconds.|n|cffffcc00-autopool off|r - Turns off autosend.|n|cffffcc00-zoom xxxx|r - zooms from 0 to 3000.|n|cffffcc00-range xxxx|r - Sets Acquisition Range.|n|cffffcc00-clear or -c|r - Clears all text on the display.|n|cffffcc00-tm xxxx|r - Sets Targeted Magic range (AM only).|n|cffffcc00-toggleautoselect|r - Toggles auto-selection of minions (Unliving Only).|n|cffffcc00-suicide|r - Kills your hero after 10 seconds(use if your hero is stuck).|n|cffffcc00-sr|r - Allows stats to be recorded for the current round(Red only).|n|cffffcc00-revivefix|r - Revives your hero after a certain period of time(WARNING!!! - Only use this if your hero did not revive due to a bug. This is untested and may bug your hero otherwise).","ReplaceableTextures\\CommandButtons\\BTNEngineeringUpgrade.blp")
call CreateQuestBJ(0,"Credits","SPECIAL THANKS|n|nVexorian for JassHelper and his dummy.mdl.|nkenny for his Projectile System and Knockback System|nJesus4Lyfe for AIDS and Damage.|nMythic, for his amazing special effects models|n-Grendel as well, for his awesome models which are featured everywhere on this map!|n|nTank-Commander, JC Helas, and nhocklanhox6 for Devastation Envoy, Frost Bite, and Shadow Image Blink respectively. |","ReplaceableTextures\\CommandButtons\\BTNTomeOfRetraining.blp")
call CreateQuestBJ(0,"Credits Part 2","Waffle(est) - Improved autopool system.|nkicka55 for his new and improved map preview!|nKindinMind, tyrea1, Istaryu, and Yhevi for QA testing. |ndickxunder and General Frank for Prime Matron and Demonish Bulwark.|nMurlocologist for his Mo'arg Overlord and Mannoroth models, as well as his Flame Lord Skin.|nExplobomb for his N'Zoth and N'yalothan Naga models.|n|nIF I MISSED ANYONE ELSE, I'm SORRY. I LOST THE PROTECTED VERSION AND WHEN I DEPROTECTED IT THE CREDITS WERE MISSING. IF I USED YOUR RESOURCE AND YOU ARE NOT CREDITED, CONTACT ME ON DISCORD @Strikest#2626.","ReplaceableTextures\\CommandButtons\\BTNTomeOfRetraining.blp")
call CreateQuestBJ(2,"Projectile System","Unlike any other Enfo map you've encountered, our version features a projectile system.|n This means all projectile spells and attacks can be modified in mid-air, and they can't collide with creeps, walls, etc. If you shoot a straight forward going spell on a target in the middle of a crowd, it won't go past the first units there to reach the target. It will collide with the first one in its path instead.|n This also means there are spells that remove a spell that you shot towards an enemy before it actually reached its target.\n","ReplaceableTextures\\CommandButtons\\BTNMarksmanship.blp")
call CreateQuestBJ(2,"Bosses and Commanders","Our version features bosses and commanders.|n A Commander comes with every wave, and usually have either some global affect or aura; or they do a lot of damage.|n An example can be the Fanrae commander. He keeps all fanraes permanent invisible while he's alive - so even when they're attacking, they can't be seen with normal means.|n|n Bosses are harder than commanders, and will show up at certain events in the map. You will know once you see one.","ReplaceableTextures\\CommandButtons\\BTNEtheral1.blp")
//call CreateQuestBJ(2,"Item Recipes Part 1"," Recipe 1: Elite Elven Boots\n Arbelog Paw Boots + Elven Hunting Boots + Winged Leather Boots\n\n Recipe 2: Thirsting Blade\n Bloodthirst + Gleaming Longsword + Spineripper\n\n Recipe 3: Obsidian Ring\n Grimstone-inset Ring * 4\n\n Recipe 4: Uthmor's Mirror Blade\n T'kashi Mirror Blade + Uthmor's Skullcleaver\n\n Recipe 5: Savage Blade\n Bloodthirst + Nimsha\n\n Recipe 6: Ring Of Victory\n Bloodstone-inset Ring + Diamond-etched Ring + Moonstone-inset Ring + Zircon-inset Ring\n\n Recipe 7: Ring Of Supremacy\n Obsidian Ring + Ring of Victory\n\n Recipe 8: Elven Stalking Boots\n Elven Hunting Boots *3\n\n Recipe 9: Supreme Elven Boots\n Elite Elven Boots + Elven Stalking Boots\n\n Recipe 10: Hermes' Treads\n Supreme Elven Boots + Hermes' Treads Recipe","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
//call CreateQuestBJ(2,"Item Recipes Part 2"," Recipe 11: Feather Ring\n Zircon-inset Ring * 2\n\n Recipe 12: Lightning Ring\n Feather Ring * 2\n\n Recipe 13: Uthmor's Sinister Blade\n Obsidian-inset Ring + Uthmor's Mirror Blade\n\n Recipe 14: Rampart Shield\n Kite Shield + Small Round Shield + Tower Shield\n\n Recipe 15: Zircon-inset Ring\n Emerald-inset Ring * 4\n\n Recipe 16: Moonstone-inset Ring\n Sapphire-inset Ring * 4\n\n Recipe 17: Bloodstone-inset Ring\n Ruby-inset Ring * 4\n\n Recipe 18: Diamond-etched Ring\n Crystal-etched Ring * 4\n\n Recipe 19: Wand of the West Wind\n Elder Staff + Tribal Staff\n\n Recipe 20: Fragarach\n Polished Elven Telo + Tribal Staff","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
//call CreateQuestBJ(2,"Item Recipes Part 3"," Recipe 21: Tranquil Blade\n Gleaming Longsword + Tranquil Blade Recipe\n\n Recipe 22: Force Edge\n Elder Staff + Sapphire-inset Ring + Polished Elven Telo\n\n Recipe 23: The Brutalizer\n Bloodstone-inset Ring + Polished Elven Telo + Spineripper\n\n Recipe 24: Brisker\n Polished Elven Telo + Polished Elven Telo + Zircon-inset Ring\n\n Recipe 25: Zirconium Crystal\n Zircon-inset Ring + Supreme Elven Boots\n\n Recipe 26: Phantom Dancer\n Zirconium Crystal + Brisker\n\n Recipe 27: Concentrated Zircon\n Zirconium Crystal + Zirconium Crystal \n\n Recipe 28: Phantom Shredder\n Phantom Dancer + T'kashi Mirror Blade\n\n Recipe 29: Tainted Leather\n Argelog Paw Boots + Shroud of Shadows + Elven Plate Mail\n\n Recipe 30: Shadowbark Leathers\n Tainted Leather + Ironbark Leathers","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
//call CreateQuestBJ(2,"Item Recipes Part 4"," Recipe 31: Reinforced Crystal Armor\n Crystal Armor + Crystal Armor + Ironbark Leathers\n\n Recipe 32: Victory Mail\n Ring of Victory + Ironbark Leathers\n\n Recipe 33: Lightning Bow\n Lightning Ring + Zircon-inset Ring + Lightning Bow Recipe\n\n Recipe 34: Bow of Tears\n Lightning Bow + Spineripper\n\n Recipe 35: Agony\n Bow of Tears + Bow of Tears + Zirconium Crystal\n\n Recipe 36: Bloodstone\n Bloodstone-inset Ring * 3 + Grimstone-inset Ring\n\n Recipe 37: Titan Shield\n Rampart Shield + Bloodstone-inset Ring\n\n Recipe 38: Aegis\n Titan Shield + Bloodstone * 2 + Dragon-scale Shield * 2\n\n Recipe 39: Ragnarok\n Thirsting Blade + Aegis + Shard of Ragnaros\n\n Recipe 40: Eternal Thirst\n T'kashi Mirror Blade * 2 + Thirsting Blade + Bloodstone","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
//call CreateQuestBJ(2,"Item Recipes Part 5"," Recipe 41: The Ravager\n The Brutalizer + Savage Blade * 2\n Recipe 42: Pride's Downfall\n Agani Tayeu'a * 2 + Elder Staff * 2\n Recipe 43: Immortal Escutcheon\n Aegis + Bloodstone + Obsidian-inset Ring\n Recipe 44: Shard of Ragnaros\n Bloodthirst*2 + Bloodstone\n Recipe 45: Tranquil Force\n Tranquil Blade + Force Edge + Crystal-etched Ring\n Recipe 46: The Witch's Fate\n T'kashi Mirror Blade + Ring of Victory + Titan Shield\n Recipe 47: Dementia's Door\n Diamond-etched Ring + Crystal-etched Ring + Elder Staff\n Recipe 48: Callous Mutilator\n The Brutalizer * 2 + Bloodstone-inset Ring\n Recipe 49: The Eternal Core\n Bloodstone-inset Ring + Ruby-inset Ring + Recipe\n Recipe 50: Eternity's End\n The Eternal Core * 2 + Obsidian-inset Ring","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
//call CreateQuestBJ(2,"Item Recipes Part 6"," Recipe 51: Angel Crucible\n Sinister Urn + Sinister Urn(Light) + Sinister Urn(Dark)\n Recipe 52: Daedalus\n Concentrated Zirconium + Force Edge + Ring of Victory\n Recipe 53: Night's Veil\n Zirconium Crystal + Emerald-inset Ring + Shroud of Shadows\n Recipe 54: Indulgence\n Agani Tayeu'a + Moonstone-inset Ring * 2\n Recipe 55: Tyranny\n Agani Tayeu'a + Bloodstone-inset Ring + Spineripper\n Recipe 56: Paradox Blade\n Fragarach + Tranquil Blade + Spineripper + Zircon-inset Ring + Moonstone-inset Ring\n Recipe 57: Soulrend\n Fragarach + Nimsha + T'kashi Mirror Blade\n Recipe 58: Staff of Peace\n Tranquil Blade + Elder Staff + Sapphire-inset Ring","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
call CreateQuestBJ(2,"Item Recipes","Recipe items are sold by Venus, the Recipe Shop located in your Team Goal. Each recipe item sold by Venus also lists its component items, at the bottom of the tooltip. You can additionally purchase the completed recipe item, but it will cost 10% more than if you had combined it yourself.","ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp")
set QC=8
if not LWMON then
call TriggerExecute(V4V)
else
call ExecuteFunc("IncomeTrigger")
endif
call DestroyTrigger(GetTriggeringTrigger())
call TimerStart(NewTimer(),1.,false,function MSO999)
set s= null
set p = null
endfunction
function MCO takes nothing returns nothing
set DT[1]="|cff00baffCrabs|r"
set MD[1]=GetRectCenter(LU)
set MD[2]=GetRectCenter(MU)
set MD[3]=GetRectCenter(JU)
set MD[4]=GetRectCenter(KU)
set PD[1]=GetRectCenter(GU)
set PD[2]=GetRectCenter(HU)
set LT[1]='Aspo'
set LT[2]='A04S'
set LT[3]='ANbh'
set LT[4]='Absk'
set LT[5]='A01X'
set LT[6]='Afzy'
set LT[7]='Acht'
set LT[8]='ACcs'
set LT[10]='A01Z'
set LT[11]='A01R'
set LT[12]='A04H'
set LT[13]='SCae'
set LT[14]='ACvp'
set LT[15]='ACua'
set LT[16]='AEar'
set LT[17]='A00O'
set LT[18]='A01W'
set LT[19]='ACav'
set LT[20]='ACac'
set LT[21]='A01T'
set LT[22]='A01M'
set LT[23]='ACbb'
set LT[24]='AIcb'
set LT[25]='Ambd'
set LT[26]='Apiv'
set LT[27]='Afbt'
set LT[28]='A037'
set KT[1]=100.
set KT[2]=250.
set KT[3]=420.
set KT[4]=690.
set KT[5]=1100.
set KT[6]=1600.
set KT[7]=2400.
set KT[8]=3600.
set KT[9]=5400.
set KT[10]=6900.
set ZS[1]=40.
set ZS[2]=78.6
set ZS[3]=143.83
set ZS[4]=254.08
set ZS[5]=440.39
set ZS[6]=755.27
set ZS[7]=1287.4
set ZS[8]=2186.71
set ZS[9]=3706.53
set ZS[10]=6275.04
set IT[1]=60.
set IT[2]=120.
set IT[3]=270.
set IT[4]=480.
set IT[5]=840.
set IT[6]=1500.
set IT[7]=2400.
set IT[8]=3600.
set IT[9]=6000.
set IT[10]=9000.
set AT[1]=729.
set AT[2]=1652.25
set AT[3]=2888.
set AT[4]=5050.
set AT[5]=9625.
set AT[6]=15625.
set AT[7]=25276.
set AT[8]=39402.
set AT[9]=49726.
set AT[10]=61256.
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set GD[bj_forLoopAIndex]=GU
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set GD[bj_forLoopAIndex]=HU
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set GD[12]=GU
set MC[1]='n020'
set MC[2]='n02G'
set MC[3]='n01Y'
set MC[4]='n02W'
set MC[5]='n024'
set MC[6]='n022'
set MC[7]='n03F'
set MC[8]='n02E'
set MC[9]='e00Z'
set MC[11]='n028'
set MC[12]='n02U'
set MC[13]='n039'
set MC[14]='n02A'
set MC[15]='n030'
set MC[16]='n02S'
set MC[17]='n02Q'
set MC[18]='n01W'
set MC[19]='n03L'
set MC[20]='n03Q'
set MC[21]='n02M'
set MC[22]='n03G'
set MC[23]='n02K'
set MC[24]='n03D'
set MC[25]='n02I'
set MC[26]='n02C'
set MC[27]='n02Y'
set MC[28]='n037'
set MC[29]='n026'
set MC[30]='n01U'
set MC[31]='n03B'
set MC[32]='e00G'
set MC[33]='n03R'
set MC[34]='n02O'
set MC[35]='u00R'
set MC[36]='u00V'
set MC[37]='u00W'
set MC[38]='u00P'
set MC[39]='u00U'
set MC[41]='n016'
set MC[42]='n016'
set MC[43]='n016'
set MC[44]='n016'
set MC[45]='n016'
set MC[46]='n016'
set UD[1]="GlowRed.mdl"
set UD[2]="GlowBlue.mdl"
set UD[3]="GlowTeal.mdl"
set UD[4]="GlowPurple.mdl"
set UD[5]="GlowYellow.mdl"
set UD[6]="GlowOrange.mdl"
set UD[7]="GlowGreen.mdl"
set UD[8]="GlowPink.mdl"
set PK[1]='n021'
set PK[2]='n02H'
set PK[3]='n01Z'
set PK[4]='n02X'
set PK[5]='n025'
set PK[6]='n023'
set PK[7]='n03H'
set PK[8]='n02F'
set PK[9]='e01S'
set PK[11]='n029'
set PK[12]='n02V'
set PK[13]='n03A'
set PK[14]='n02B'
set PK[15]='n031'
set PK[16]='n02T'
set PK[17]='n02R'
set PK[18]='n01X'
set PK[19]='n03N'
set PK[20]='n03S'
set PK[21]='n02N'
set PK[22]='n03J'
set PK[23]='n02L'
set PK[24]='n03E'
set PK[25]='n02J'
set PK[26]='n02D'
set PK[27]='n02Z'
set PK[28]='n038'
set PK[29]='n027'
set PK[30]='n01V'
set PK[31]='n03C'
set PK[32]='e00X'
set PK[33]='n03T'
set PK[34]='n02P'
set PK[35]='u00S'
set PK[36]='u00X'
set PK[37]='u00Y'
set PK[38]='u00Q'
set PK[39]='u00T'
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function MFO takes nothing returns boolean
return(HD==false)
endfunction
function MGO takes nothing returns nothing
call PauseUnit(GetEnumUnit(),true)
endfunction
function Trig_Initialize_Rematch_Func006001 takes nothing returns boolean
return(SC==0)
endfunction
function Trig_Initialize_Rematch_Func011Func002001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h000')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00P')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h004')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00G')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00H')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00I')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002002002002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))))
endfunction
function Trig_Initialize_Rematch_Func011Func002001002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00P'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))))))
endfunction
function MHO takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit())!='h011')and GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h000'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00P'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007')))))))))))) and GetUnitTypeId(GetFilterUnit())!='H013' and GetUnitTypeId(GetFilterUnit())!='H014' and GetUnitTypeId(GetFilterUnit())!='H015' and GetUnitTypeId(GetFilterUnit())!='H016' and GetUnitTypeId(GetFilterUnit())!='o006' and GetUnitTypeId(GetFilterUnit())!='n01G' and GetUnitTypeId(GetFilterUnit())!='n01C' and GetUnitTypeId(GetFilterUnit())!='h01I'
endfunction
function MJO takes nothing returns nothing
if NaturesAbundanceS[GetUnitUserData(GetEnumUnit())]>= 1 then
set NaturesAbundanceS[GetUnitUserData(GetEnumUnit())] = 0
endif
call RemoveUnit(GetEnumUnit())
endfunction
function Trig_Initialize_Rematch_Func011Func003001001 takes nothing returns boolean
return(GetPlayerController(Player(-1+(bj_forLoopAIndex)))==MAP_CONTROL_USER)
endfunction
function Trig_Initialize_Rematch_Func011Func003001002 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_Initialize_Rematch_Func011Func003001 takes nothing returns boolean
return GetBooleanAnd((GetPlayerController(Player(-1+(bj_forLoopAIndex)))==MAP_CONTROL_USER),(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))
endfunction
function MKO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='h000')
endfunction
function MLO takes nothing returns nothing
call SetUnitManaBJ(GetEnumUnit(),50.)
call UnitResetCooldown(GetEnumUnit())
endfunction
function MMO takes nothing returns nothing
if GetItemTypeId(GetEnumItem()) != 'ciri' then
call RemoveItem(GetEnumItem())
endif
endfunction
function MPO takes nothing returns nothing
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function MQO takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(true,'A02A',GetEnumPlayer())
endfunction
function Trig_Initialize_Rematch_Func039Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_Initialize_Rematch_Func040Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function RemoveUnitSpawners takes nothing returns boolean
local integer i = GetUnitTypeId(GetFilterUnit())
if i == 'H013' or i == 'H014' or i == 'H015' or i == 'H016' then
call RemoveUnit(GetFilterUnit())
endif
return false
endfunction
globals
timerdialog GameModeDialog
integer array CommanderCount
endglobals
function MSO666 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = 0
local integer i2 = 1
local integer loopi=0
local unit u
local integer p = 0
loop
exitwhen p>9
set CorruptAmount[p] = 0
//set CorruptionRaised[p] = 0
call SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_FOOD_USED,0)
set p = p + 1
endloop
call ReleaseTimer(t)
set GAMEM=false
call DestroyTimerDialog(GameModeDialog)
if not LWMON then
call TriggerExecute(V4V)
else
call GroupEnumUnitsInRange(UNIT_SPAWNERS_GROUP,0.,0.,99999.,function RemoveUnitSpawners)
loop
exitwhen loopi==12
set Income[loopi] = StartingIncomeVar
if GetPlayerSlotState(Player(loopi)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(loopi)) != MAP_CONTROL_COMPUTER then
set u = CreateUnit(Player(loopi),'H014',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(loopi),'H015',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(loopi),'H016',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(loopi),'H013',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
endif
set loopi=loopi+1
endloop
loop
exitwhen i==12
loop
exitwhen i2==41
set CommanderCount[i2*12+i] = 0
set i2 = i2 + 1
endloop
set i2=1
set i = i +1
endloop
call ExecuteFunc("IncomeTrigger")
endif
set u = null
set t= null
endfunction
function MSO takes nothing returns nothing
local timer t
local integer i = 0
local integer i2 = 1
local integer p = 0
local integer li = 0
local integer ii
local player pp
local string s = null
local Savecode savecode
local integer i3 = 0
//call BJDebugMsg("Does this run?")
set HD=true
set ScreamStacks[0] = 0
set ScreamStacks[1] = 0
call GroupClear(PATHING_GROUP)
//call BJDebugMsg("Pathing Group Cleared")
set bj_wantDestroyGroup=true
call ForGroupBJ(CPE(bj_mapInitialPlayableArea),function MGO)
call PauseAllUnitsBJ(true)
if((SC<=0))then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"East Side has won! Congratulations! |cFFFF0000Please stay for the rematch.|r")
set ii = 5
loop
exitwhen ii >9
set pp = Player(ii)
if GetPlayerSlotState(pp) == PLAYER_SLOT_STATE_PLAYING then
set i3 = i3 + 1
endif
set W_I_N_S[ii] = W_I_N_S[ii] + 1
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[ii] ,1000000 )
call savecode.Encode(W_I_N_S[ii],1000000)
call savecode.Encode(LOOOSES[ii],1000000)
set s = savecode.Save(pp,1)
call savecode.destroy()
if (GetLocalPlayer() == pp) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(pp)+".pld",GetPlayerName(pp)+": "+s)
endif
set ii = ii + 1
endloop
if i3 > 0 then
set ii = 0
loop
exitwhen ii >4
set pp = Player(ii)
set LOOOSES[ii] = LOOOSES[ii] + 1
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[ii] ,1000000 )
call savecode.Encode(W_I_N_S[ii],1000000)
call savecode.Encode(LOOOSES[ii],1000000)
set s = savecode.Save(pp,1)
call savecode.destroy()
if (GetLocalPlayer() == pp) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(pp)+".pld",GetPlayerName(pp)+": "+s)
endif
set ii = ii + 1
endloop
endif
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"West Side has won! Congratulations! |cFFFF0000Please stay for the rematch.|r")
set ii = 0
loop
exitwhen ii >4
set pp = Player(ii)
if GetPlayerSlotState(pp) == PLAYER_SLOT_STATE_PLAYING then
set i3 = i3 + 1
endif
set W_I_N_S[ii] = W_I_N_S[ii] + 1
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[ii] ,1000000 )
call savecode.Encode(W_I_N_S[ii],1000000)
call savecode.Encode(LOOOSES[ii],1000000)
set s = savecode.Save(pp,1)
call savecode.destroy()
if (GetLocalPlayer() == pp) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(pp)+".pld",GetPlayerName(pp)+": "+s)
endif
set ii = ii + 1
endloop
if i3 > 0 then
set ii = 5
loop
exitwhen ii >9
set pp = Player(ii)
set LOOOSES[ii] = LOOOSES[ii] + 1
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[ii] ,1000000 )
call savecode.Encode(W_I_N_S[ii],1000000)
call savecode.Encode(LOOOSES[ii],1000000)
set s = savecode.Save(pp,1)
call savecode.destroy()
if (GetLocalPlayer() == pp) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(pp)+".pld",GetPlayerName(pp)+": "+s)
endif
set ii = ii + 1
endloop
endif
endif
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call KillUnit(PL[bj_forLoopAIndex])
set PL[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CRE(15.)
set HD=false
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call RemoveUnit(LC[bj_forLoopAIndex])
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set bj_wantDestroyGroup=true
call ForGroupBJ(CUE(Player(-1+(bj_forLoopAIndex)),Condition(function MHO)),function MJO)
if((GetBooleanAnd((GetPlayerController(Player(-1+(bj_forLoopAIndex)))==MAP_CONTROL_USER),(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))))then
call CreateNUnitsAtLoc(1,'ushd',Player(-1+(bj_forLoopAIndex)),GetPlayerStartLocationLoc(Player(-1+(bj_forLoopAIndex))),bj_UNIT_FACING)
endif
set OD[bj_forLoopAIndex]=false
set FM[bj_forLoopAIndex]=null
set VL[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_wantDestroyGroup=true
call ForGroupBJ(CLE(bj_mapInitialPlayableArea,Condition(function MKO)),function MLO)
call EnumItemsInRectBJ(bj_mapInitialPlayableArea,function MMO)
call PauseAllUnitsBJ(false)
call ForForce(bj_FORCE_ALL_PLAYERS,function MPO)
loop
exitwhen li == 12
set Fervor[GetUnitUserData(LC[li])] = 0
set Barbarism[GetUnitUserData(LC[li])] = 0
set DeathStacks[GetUnitUserData(LC[li])] = 0
set Diablerie[GetUnitUserData(LC[li])] = 0
set CORE_LVL[GetUnitUserData(LC[li])] = 0
set MeatHealth[GetUnitUserData(LC[li])] = 0
set MeatCollected[GetUnitUserData(LC[li])] = 0
set PremiumMeatCollected[GetUnitUserData(LC[li])] = 0
if SpellStealStolenID[GetUnitUserData(LC[li])] != 0 then
if GetLocalPlayer() == Player((li-1)) then
call BlzSetAbilityPosX(SpellStealStolenID[GetUnitUserData(LC[li])],SpellStealStolenX[GetUnitUserData(LC[li])])
call BlzSetAbilityPosY(SpellStealStolenID[GetUnitUserData(LC[li])],SpellStealStolenY[GetUnitUserData(LC[li])])
endif
endif
set SpellStealStolenID[GetUnitUserData(LC[li])] = 0
set SpellStealStolenID2[GetUnitUserData(LC[li])] = 0
set SpellStealStolenX[GetUnitUserData(LC[li])] = 0
set SpellStealStolenY[GetUnitUserData(LC[li])] = 0
set li = li + 1
endloop
set SC=StartingLives
set TC=StartingLives
set CS=0
set FS=0
//call MultiboardSetItemValueBJ(AS[1],2,(CountPlayersInForceBJ(ES)+6),"0%")
//call MultiboardSetItemValueBJ(AS[2],2,(CountPlayersInForceBJ(ES)+6),"0%")
call MultiboardSetItemValueBJ(AS[1],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[1],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
set bj_forLoopBIndex=2
set bj_forLoopBIndexEnd=(2+CountPlayersInForceBJ(VS[1]))
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemValueBJ(AS[1],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],2,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],2,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],4,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],4,bj_forLoopBIndex,"0")
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopBIndex=(CountPlayersInForceBJ(VS[1])+4)
set bj_forLoopBIndexEnd=(CountPlayersInForceBJ(ES)+4)
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemValueBJ(AS[1],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],3,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],2,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],2,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[1],4,bj_forLoopBIndex,"0")
call MultiboardSetItemValueBJ(AS[2],4,bj_forLoopBIndex,"0")
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopBIndex=2
set bj_forLoopBIndexEnd=(2+CountPlayersInForceBJ(VS[1]))
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemStyleBJ(AS[1],1,bj_forLoopBIndex,true,false)
call MultiboardSetItemStyleBJ(AS[2],1,bj_forLoopBIndex,true,false)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopBIndex=(CountPlayersInForceBJ(VS[1])+4)
set bj_forLoopBIndexEnd=(CountPlayersInForceBJ(ES)+4)
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call MultiboardSetItemStyleBJ(AS[1],1,bj_forLoopBIndex,true,false)
call MultiboardSetItemStyleBJ(AS[2],1,bj_forLoopBIndex,true,false)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set BT[bj_forLoopAIndex]=0
set FT[bj_forLoopAIndex]=0
set JT[bj_forLoopAIndex]=false
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set HT[bj_forLoopAIndex]=0
set GT[bj_forLoopAIndex]=0
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set QC=8
set MT[(1+GetPlayerId(GetTriggerPlayer()))]=0
set OT=0
set QD[1]=false
set QD[2]=false
call ForForce(bj_FORCE_ALL_PLAYERS,function MQO)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[1]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[2]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
loop
exitwhen p>9
set CorruptAmount[p] = 0
set OverloadCharges[p] = 0
//set CorruptionRaised[p] = 0
call SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_FOOD_USED,0)
set p = p + 1
endloop
if GetRandomInt(1,100) <= 50 then
set DT[10]="|cff00baffDiseased Bear|r"
set MC[10]='n03O'
set PK[10]='n03P'
set NT[10]="Diseased Bears have a tendency to |cffee0000Maul|r enemies in a line. They also have |cffee0000Evasion|r and |cffee0000Disease Cloud|r, and their Commander has |cffee000080% Evasion|r and |cffee000020% Max Health Regeneration|r. It also has |cffee0000Endurance Aura|r and |cffee0000Flat Thorns|r."
else
set DT[10]="|cff00baffPenguin Cutpurse|r"
set MC[10]='n042'
set PK[10]='n043'
set NT[10]="Penguin Cutpurses possess |cffee0000Pilfering Paws|r, allowing them to steal gold on hit. After stealing enough gold, they will attempt to escape into the goal. Kill them to reclaim your gold! Their commander possess |cffee000080% Evasion|r, |cffee0000Unholy Aura|r, |cffee0000Endurance Aura|r, and |cffee0000throws very tasty fish|r at you, how kind of them! Unfortunately, this fish tends to |cffee0000attract sharks|r..."
endif
set GAMEM = true
set t = NewTimer()
set GameModeDialog=CreateTimerDialog(t)
call TimerDialogSetTitle(GameModeDialog, "Game Modes:")
call TimerDialogDisplay(GameModeDialog, true)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Red has 20 seconds to change the mode. (Difficulty can not be changed.)")
call TimerStart(t,20.,false,function MSO666)
set s = null
set pp = null
set t = null
endfunction
function MUO takes nothing returns nothing
call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction
function MZO takes nothing returns nothing
call DialogSetMessage(YC,"Difficulty Votage")
call DialogAddButtonBJ(YC,"|cfff6ff00Hard|n(100%, Hard Commanders, All Offense)|r")
set ZC[1]=bj_lastCreatedButton
call DialogAddButtonBJ(YC,"|cff00baffEasy|n(90%, Easy Commanders, Almost No Offense)|r")
set ZC[2]=bj_lastCreatedButton
call DialogAddButtonBJ(YC,"|cff1ab700Normal|n(100%,Normal Commanders, Some Offense)|r")
set ZC[3]=bj_lastCreatedButton
call DialogAddButtonBJ(YC,"|cffff6000Nightmare|n(100%,Nightmarish Commanders, All Offense)|r")
set ZC[4]=bj_lastCreatedButton
call DialogAddButtonBJ(YC,"|cffaa0000Hell|n(105%,Hellish Commanders, All Offense)|r")
set ZC[5]=bj_lastCreatedButton
call DialogSetMessage(RD,"Rematch Votage")
call DialogAddButtonBJ(RD,"Yes")
set ID[1]=bj_lastCreatedButton
call DialogAddButtonBJ(RD,"No")
set ID[2]=bj_lastCreatedButton
call DialogAddButtonBJ(RD,"Undecided")
set ID[3]=bj_lastCreatedButton
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function M0O takes nothing returns boolean
return(GetClickedButton()==ZC[1])
endfunction
function M1O takes nothing returns boolean
return(GetClickedButton()==ZC[2])
endfunction
function M2O takes nothing returns boolean
return(GetClickedButton()==ZC[3])
endfunction
function M3O takes nothing returns boolean
return(GetClickedButton()==ZC[4])
endfunction
function M4O takes nothing returns boolean
return(GetClickedButton()==ZC[5])
endfunction
function M5O takes nothing returns nothing
if(M0O())then
set VD[1]=(VD[1]+1)
call DialogDisplayBJ(false,YC,GetTriggerPlayer())
endif
if(M1O())then
set VD[2]=(VD[2]+1)
call DialogDisplayBJ(false,YC,GetTriggerPlayer())
endif
if(M2O())then
set VD[3]=(VD[3]+1)
call DialogDisplayBJ(false,YC,GetTriggerPlayer())
endif
if(M3O())then
set VD[4]=(VD[4]+1)
call DialogDisplayBJ(false,YC,GetTriggerPlayer())
endif
if(M4O())then
set VD[5]=(VD[5]+1)
call DialogDisplayBJ(false,YC,GetTriggerPlayer())
endif
endfunction
function M7O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function M8O takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function M9O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PVO takes nothing returns nothing
call EnableTrigger(DEATHSFAVOR)
call EnableTrigger(SKELECM)
call EnableTrigger(SKELEEVASION)
call EnableTrigger(DEATHSTACKS)
call EnableTrigger(SKELETONAI)
call EnableTrigger(SKELETONAI2)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U00O',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
set LICHS[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
if(M9O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[31])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[31])
call RemoveLocation(HeroCreateLocation)
endfunction
function PXO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function POO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function PRO takes nothing returns nothing
set RandomCreateLocation = GetRectCenter(PU)
set OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function POO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
endfunction
function PAO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function PNO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PBO takes nothing returns nothing
call EnableTrigger(Q5)
call EnableTrigger(I3)
call EnableTrigger(R3)
call EnableTrigger(S5)
call EnableTrigger(T5)
call EnableTrigger(E4)
call EnableTrigger(P5)
call EnableTrigger(GARZENGONHIT)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01B',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(PNO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[13])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[13])
call RemoveLocation(HeroCreateLocation)
endfunction
function PDO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')and(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PFO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PGO takes nothing returns nothing
call EnableTrigger(X5)
call EnableTrigger(Z4)
call EnableTrigger(S4)
//call EnableTrigger(O3)
call EnableTrigger(O5)
call EnableTrigger(Q4)
call EnableTrigger(P3)
call EnableTrigger(E5)
call EnableTrigger(V5)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U00Z',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(PFO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[30])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[30])
call RemoveLocation(HeroCreateLocation)
endfunction
function PJO takes nothing returns boolean
return(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==false)and(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function PKO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function PLO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PMO takes nothing returns nothing
if(PLO())then
set RandomCreateLocation = GetRectCenter(PU)
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function PKO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endfunction
function PQO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function PSO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PTO takes nothing returns nothing
call EnableTrigger(P4)
call EnableTrigger(D4)
call EnableTrigger(A4)
call EnableTrigger(L4)
call EnableTrigger(M4)
call EnableTrigger(H4)
call EnableTrigger(K4)
call EnableTrigger(C4)
call EnableTrigger(F4)
call EnableTrigger(V4)
call EnableTrigger(B4)
call EnableTrigger(U4)
call EnableTrigger(W4)
call EnableTrigger(N4)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E000',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(PSO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
set PL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=null
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[14])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[14])
call RemoveLocation(HeroCreateLocation)
endfunction
function PWO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function PYO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PZO takes nothing returns nothing
call EnableTrigger(G6)
call EnableTrigger(MUSEONHIT)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E014',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(PYO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[6])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[6])
call RemoveLocation(HeroCreateLocation)
endfunction
function P0O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function P1O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function P2O takes nothing returns nothing
call EnableTrigger(N5)
call EnableTrigger(C5)
call EnableTrigger(H6)
call EnableTrigger(ENFORCETAXES)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'H00F',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(P1O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[29])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[29])
call RemoveLocation(HeroCreateLocation)
endfunction
function P4O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function P5O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function P6O takes nothing returns nothing
local location l
if WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call EnableTrigger(INFERNALMARTYR)
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'E00E',CitadelSpawnX[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],CitadelSpawnY[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],270.)
if(P5O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
call UnitAddAbility(bj_lastCreatedUnit,'Sch2')
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set l = Location(CitadelSpawnX[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))],CitadelSpawnY[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),l,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[36])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[36])
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
call RemoveLocation(l)
set l = null
endfunction
function P8O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')and(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function P9O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QVO takes nothing returns nothing
call EnableTrigger(I6)
call EnableTrigger(Q3)
call EnableTrigger(V6)
call EnableTrigger(K3)
call EnableTrigger(J3)
call EnableTrigger(A3)
call EnableTrigger(SANCTITY)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E018',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(P9O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[10])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[10])
call RemoveLocation(HeroCreateLocation)
endfunction
function QXO takes nothing returns boolean
return(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==false)and(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function QOO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function QRO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QIO takes nothing returns nothing
if(QRO())then
set RandomCreateLocation = GetRectCenter(PU)
set OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function QOO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endfunction
function QNO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function QBO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QCO takes nothing returns nothing
call EnableTrigger(F6)
call EnableTrigger(Y3)
call EnableTrigger(Z3)
call EnableTrigger(FROSTSHARDHIT)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01O',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(QBO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[26])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[26])
call RemoveLocation(HeroCreateLocation)
endfunction
function QFO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function QGO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QHO takes nothing returns nothing
call EnableTrigger(T6)
call EnableTrigger(N6)
call EnableTrigger(R6)
call EnableTrigger(STARLIGHTINTGAIN)
call EnableTrigger(STARLIGHTLEARN)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01F',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(QGO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[18])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[18])
call RemoveLocation(HeroCreateLocation)
endfunction
function QKO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')and(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QLO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QMO takes nothing returns nothing
if XT>=3 then
call EnableTrigger(P6)
call EnableTrigger(C7)
call EnableTrigger(U5)
call EnableTrigger(HALLUCINATIONDAMAGE)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01D',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(QLO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[16])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[16])
call RemoveLocation(HeroCreateLocation)
else
call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0.,0.,"Hypnotist can only be picked on Hard difficulty and above.")
endif
endfunction
function QQO takes nothing returns boolean
return(WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==false)and(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function QSO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function QTO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function QUO takes nothing returns nothing
if(QTO())then
set RandomCreateLocation = GetRectCenter(PU)
set OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function QSO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endfunction
function QYO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function QZO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function Q_O takes nothing returns nothing
call EnableTrigger(M5)
call EnableTrigger(Y5)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01A',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(QZO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[12])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[12])
call RemoveLocation(HeroCreateLocation)
endfunction
function Q1O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function Q2O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function Q3O takes nothing returns nothing
call EnableTrigger(J4)
call EnableTrigger(I4)
call EnableTrigger(O4)
call EnableTrigger(B5)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01E',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(Q2O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[17])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[17])
call RemoveLocation(HeroCreateLocation)
endfunction
function Q5O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function Q6O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function Q7O takes nothing returns nothing
//call EnableTrigger(L3)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E013',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(Q6O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[5])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[5])
call RemoveLocation(HeroCreateLocation)
endfunction
function Q9O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SVO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SEO takes nothing returns nothing
call EnableTrigger(H5)
call EnableTrigger(L5)
call EnableTrigger(UNDYINGFLAME)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E016',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SVO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[8])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[8])
call RemoveLocation(HeroCreateLocation)
endfunction
function SOO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SRO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SIO takes nothing returns nothing
call EnableTrigger(E6)
call EnableTrigger(Z5)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E019',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SRO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[11])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[11])
call RemoveLocation(HeroCreateLocation)
endfunction
function SNO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SBO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SCO takes nothing returns nothing
call EnableTrigger(X6)
call EnableTrigger(X3)
call EnableTrigger(T4)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E011',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SBO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[3])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[3])
call RemoveLocation(HeroCreateLocation)
endfunction
function SFO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SGO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SHO takes nothing returns nothing
call EnableTrigger(Q6)
call EnableTrigger(M3)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01K',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SGO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[22])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[22])
call RemoveLocation(HeroCreateLocation)
endfunction
function SKO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SLO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SMO takes nothing returns nothing
call EnableTrigger(BONESHED)
call EnableTrigger(FLESHLESSARMOR)
call EnableTrigger(CRUSHINGBLOWS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E004',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SLO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[37])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[37])
call RemoveLocation(HeroCreateLocation)
endfunction
function SQO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SSO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function STO takes nothing returns nothing
call EnableTrigger(C6)
call EnableTrigger(THIEFCOLL)
call EnableTrigger(VENOM)
call EnableTrigger(THIEFPOISON)
call EnableTrigger(THIEFSWAG2)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01L',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SSO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call UnitAddAbility(bj_lastCreatedUnit,'Sch2')
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[23])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[23])
call RemoveLocation(HeroCreateLocation)
endfunction
function SWO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function SYO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function SZO takes nothing returns nothing
//call EnableTrigger(O6)
call EnableTrigger(G5)
call EnableTrigger(J5)
call EnableTrigger(TOXIAPOISON)
call EnableTrigger(CORROSIONKILL)
call EnableTrigger(CORROSIONSTACKS)
call UnitAddAbility(GetTriggerUnit(),'A09U')
call UnitRemoveAbility(GetTriggerUnit(),'A09U')
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01G',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(SYO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[19])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[19])
call RemoveLocation(HeroCreateLocation)
endfunction
function S0O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function S1O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function S2O takes nothing returns nothing
call EnableTrigger(A7)
call EnableTrigger(F3)
call EnableTrigger(REVENGEBLEED)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E015',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(S1O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[7])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[7])
call RemoveLocation(HeroCreateLocation)
endfunction
function S4O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function S5O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function S6O takes nothing returns nothing
call EnableTrigger(B6)
call EnableTrigger(I5)
call EnableTrigger(R5)
call EnableTrigger(A5)
call EnableTrigger(SAVAGESTRIKE)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E012',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(S5O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[4])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[4])
call RemoveLocation(HeroCreateLocation)
endfunction
function S8O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function S9O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TVO takes nothing returns nothing
call EnableTrigger(J6)
call EnableTrigger(K6)
call EnableTrigger(L6)
call EnableTrigger(M6)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01P',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(S9O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[27])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[27])
call RemoveLocation(HeroCreateLocation)
endfunction
function TXO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function TOO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function TRO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TIO takes nothing returns nothing
//(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
if(TRO())then
set RandomCreateLocation = GetRectCenter(PU)
set OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function POO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"This hero is not available yet. Please choose another hero.")
endif
endfunction
function TNO takes integer p,unit J2E returns nothing
if J2E==(HZV[(p)])then
if OEX(HKV[p],J2E)then
call Y0E(GZV[p],J2E,G3V[p],ATTACK_TYPE_HERO,true,true)
call EHX(p)
else
call EKX(p,J2E)
endif
endif
endfunction
scope RemArrow
struct RemnantArrow extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local unit u
local thistype this = thistype(missile)
if hit == missile.target then
call UnitDamageTargetEx(missile.source, hit, missile.damage, true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
if not IsUnitType(hit,UNIT_TYPE_MAGIC_IMMUNE) and IsUnitVisible(hit,GetOwningPlayer(missile.source)) and GetUnitTypeId(hit) != 'h00S' and GetUnitAbilityLevel(missile.source,'A09N')==1 and GetRandomInt(0,99)<=3 then
set u = CreateUnit(GetOwningPlayer(missile.source),'h018',0.,0.,0.)
call SetUnitAbilityLevel(u,'A0FF',GetUnitAbilityLevel(missile.source,'A0FI'))
call UnitApplyTimedLife(u,'BTLF',1.)
call IssueTargetOrderById(u,852274,hit)
set ShatteredVeil[GetUnitUserData(u)] = hit
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\WarpDarkTargetPurple.mdx",hit,"origin"))
set u = null
endif
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
function TBO takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(RCV))and IsUnitVisible(GetFilterUnit(),GetOwningPlayer(RCV))and not(GetUnitAbilityLevel((GetFilterUnit()),'Avul')>0))
endfunction
function TCO takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real x1=AVE[PXE]
local real y1=AEE[PXE]
local real x2=GetUnitX(AXE[PXE])
local real y2=GetUnitY(AXE[PXE])
local real d=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)
local timer t2
//local integer p=0
local real OLX
local unit u
local Misssile m
if GetUnitTypeId(LC[(1+GetPlayerId(GetOwningPlayer(AXE[PXE])))])!='N00D' then
call D4E(PXE)
call ReleaseTimer(t)
else
if d>=3600. then
set RCV=AXE[PXE]
set u=(ZEE(null,((x1)*1.),((y1)*1.),((700.)*1.),(Condition(function TBO))))
set AVE[PXE]=x2
set AEE[PXE]=y2
if u!=null then
set OLX=QUE(x1,y1,GetUnitX(u),GetUnitY(u))
if GetUnitAbilityLevel(AXE[PXE],'A09N')==1 then
if GetRandomInt(0,100)<=50 then
call SGE('h00V',AVE[PXE],AEE[PXE],OLX,1.0672,"attack one",1.2)
else
call SGE('h00V',AVE[PXE],AEE[PXE],OLX,1.0672,"attack two",1.2)
endif
else
if GetRandomInt(0,100)<=50 then
call SAE('h00U',AVE[PXE],AEE[PXE],OLX,1.0672,"attack one",1.2)
else
call SAE('h00U',AVE[PXE],AEE[PXE],OLX,1.0672,"attack two",1.2)
endif
endif
set m = Misssile.create(AVE[PXE], AEE[PXE], 65., OLX*bj_DEGTORAD, OLX, 65.)
//set p=XAX(AVE[PXE],AEE[PXE],65.,OLX)
//set GZV[p]=AXE[PXE]
//call EEX(p,u)
//set G_V[p]=GetOwningPlayer(AXE[PXE])
//call V9X(p,"Abilities\\Weapons\\Arrow\\ArrowMissile.mdl")
//call V8X(p,1.4)
//if IsUnitType(u,UNIT_TYPE_HERO) then
//set G3V[p]=I2R(GetHeroAgi(AXE[PXE],true))*.2
//else
//set G3V[p]=I2R(GetHeroAgi(AXE[PXE],true))*.9
//endif
//set G2V[p]=60.
//set G1V[p]=60.
//set HEV[p]=true
//set G8V[p]=true
//set HOV[p]=true
//set HCV[p]=(21)
//set HBV[p]=(22)
//set G4V[p]=20.
//set G9V[p]=true
//call XIX(p,GetUnitX(u),GetUnitY(u),GetUnitFlyHeight(u)+65.,900.,.15)
set m.source = AXE[PXE]
set m.target = u
set m.speed = 28.125
set m.scale = 1.4
set m.model = "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl"
set m.arc = 15*bj_DEGTORAD
set m.collision = 24.
// set m.curve = GetRandomReal(-bj_PI/4, bj_PI/4)
set m.owner = GetOwningPlayer(m.source)
if IsUnitType(u,UNIT_TYPE_HERO) then
set m.damage=(GetHeroAgi(AXE[PXE],true)*.05)*(1.+(.03*GetHeroLevel(AXE[PXE])))
else
set m.damage=(GetHeroAgi(AXE[PXE],true)*1.)*(1.+(.03*GetHeroLevel(AXE[PXE])))
endif
call RemnantArrow.launch(m)// Launch is implemented via module MissileStruct
else
if GetUnitAbilityLevel(AXE[PXE],'A09N')==1 then
call SHE('h00V',AVE[PXE],AEE[PXE],GetUnitFacing(AXE[PXE]),.834,8,1.)
else
call SDE('h00U',AVE[PXE],AEE[PXE],GetUnitFacing(AXE[PXE]),.834,8,1.)
endif
endif
endif
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function TCO)
endif
set t=null
set t2=null
set u=null
endfunction
endscope
function TDO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function TFO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TGO takes nothing returns nothing
local timer t=NewTimer()
local integer PXE=D3E()
call EnableTrigger(SHATTEREDSUMMON)
call EnableTrigger(SHATTEREDKILL)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'N00D',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,180.)
if(TFO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetTriggerPlayer()))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[34])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[34])
set AXE[PXE]=LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
set AVE[PXE]=GetUnitX(AXE[PXE])
set AEE[PXE]=GetUnitY(AXE[PXE])
call SetTimerData(t,PXE)
call TimerStart(t,.02,false,function TCO)
call RemoveLocation(HeroCreateLocation)
set t=null
endfunction
function THO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function TJO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TKO takes nothing returns nothing
call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0.,0.,"Predator has been disabled this patch due to bugs.")
/*
call EnableTrigger(O7)
call EnableTrigger(U6)
call EnableTrigger(Z6)
call EnableTrigger(Y6)
//call EnableTrigger(W6)
call EnableTrigger(R7)
call EnableTrigger(I7)
call EnableTrigger(X7)
call EnableTrigger(B7)
call EnableTrigger(E7)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U00N',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(TJO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[33])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[33])
call RemoveLocation(HeroCreateLocation)
*/
endfunction
function TMO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function TPO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TQO takes nothing returns nothing
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E00Y',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,240.)
if(TPO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
call UnitAddAbility(bj_lastCreatedUnit,'Sch2')
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[1])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[1])
call RemoveLocation(HeroCreateLocation)
endfunction
function TTO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function TUO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function TWO takes nothing returns nothing
call EnableTrigger(PUDDLESPLASHING)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U003',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,90.)
if(TUO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[32])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[32])
call RemoveLocation(HeroCreateLocation)
call UnitAddAbility(bj_lastCreatedUnit,'Amrf')
call UnitRemoveAbility(bj_lastCreatedUnit,'Amrf')
endfunction
function TZO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function T_O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function T0O takes nothing returns nothing
call EnableTrigger(H6)
call EnableTrigger(F5)
call EnableTrigger(PULVERIZEONHIT)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01J',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.0)
if(T_O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[21])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[21])
call RemoveLocation(HeroCreateLocation)
endfunction
function T2O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function T3O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function T4O takes nothing returns nothing
call EnableTrigger(INDOMMIGHT)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01H',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.0)
if(T3O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[20])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[20])
call RemoveLocation(HeroCreateLocation)
endfunction
function T6O takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function T7O takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function PeHPT takes nothing returns nothing
if WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U004',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(T7O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[39])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[39])
call RemoveLocation(HeroCreateLocation)
else
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
set RandomCreateLocation = GetRectCenter(PU)
set OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
set bj_wantDestroyGroup = true
set RandomCreateLocation = GetUnitLoc(GroupPickRandomUnit(CLE(PU,Condition(function QSO))))
call SetUnitPositionLoc(GetTriggerUnit(),RandomCreateLocation)
call RemoveLocation(RandomCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endif
endfunction
function QoBPT takes nothing returns nothing
call EnableTrigger(VORACITYP)
call EnableTrigger(GLUTTONYP)
call EnableTrigger(TEMPERANCEP)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E006',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(T7O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[38])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[38])
call RemoveLocation(HeroCreateLocation)
endfunction
function T8O takes nothing returns nothing
call EnableTrigger(S6)
call EnableTrigger(CTATAUNT)
call EnableTrigger(CRUSHINGBLOWS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01C',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(T7O())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
call UnitAddAbility(bj_lastCreatedUnit,'Sch2')
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[15])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[15])
call RemoveLocation(HeroCreateLocation)
endfunction
function UVO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function UEO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function UXO takes nothing returns nothing
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E017',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
call EnableTrigger(D5)
call EnableTrigger(Y4)
call EnableTrigger(K5)
call EnableTrigger(H3)
call EnableTrigger(D6)
call EnableTrigger(R4)
if(UEO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[9])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[9])
call RemoveLocation(HeroCreateLocation)
endfunction
function URO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function UIO takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='ncop')
endfunction
function UAO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function UNO takes nothing returns nothing
if WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call EnableTrigger(ARCANEDRAIN)
call EnableTrigger(LUCKYSHOT)
call EnableTrigger(SINISTERC)
call EnableTrigger(SANCTIFIEDARMOR)
call EnableTrigger(ETERNALBATTLE)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'H01F',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[41])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[41])
call RemoveLocation(HeroCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endfunction
function UCO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='ushd')
endfunction
function UDO takes nothing returns boolean
return(OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction
function UFO takes nothing returns nothing
if WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call EnableTrigger(W5)
call EnableTrigger(T3)
call EnableTrigger(U3)
call EnableTrigger(W3)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'N01S',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if(UDO())then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call UnitAddAbility(GetTriggerUnit(),'A0EQ')
call UnitRemoveAbility(GetTriggerUnit(),'A0EQ')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[35])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[35])
call RemoveLocation(HeroCreateLocation)
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
endfunction
function UHO takes nothing returns boolean
return(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))
endfunction
function UJO takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'BUsl')==false)
endfunction
function UKO takes nothing returns nothing
if(UJO())then
call IssueImmediateOrderById(GetAttacker(),851972)
endif
endfunction
function UMO takes nothing returns boolean
return((GetUnitTypeId(GetTriggerUnit())=='E01A')or(GetUnitTypeId(GetTriggerUnit())=='E01B')or(GetUnitTypeId(GetTriggerUnit())=='E016'))
endfunction
function UPO takes nothing returns nothing
local unit u=GetTriggerUnit()
if not IsUnitInGroup(u,WK) then
call SetUnitAnimationByIndex(u,7)
call CRE(2.1)
call SetUnitAnimationByIndex(u,8)
call CRE(1)
call ShowUnit(u,false)
endif
set u=null
endfunction
function USO takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(0)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function UTO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),OffsetLocation(GetUnitLoc(X2V),.0,-200.),270.)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitTypeId(GetTriggerUnit())!= 'e00H' and GetUnitTypeId(GetTriggerUnit())!= 'e00F' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function UWO takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(5)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function UYO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(X4V)
set TempLocation=OffsetLocation(TempLocation2,.0,-200.)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,270.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitTypeId(GetTriggerUnit())!= 'e00H' and GetUnitTypeId(GetTriggerUnit())!= 'e00F' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function U_O takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(0)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function U0O takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(X1V)
set TempLocation=OffsetLocation(TempLocation2,200.,0)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,.0)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function U2O takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(5)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function U3O takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(X_V)
set TempLocation=OffsetLocation(TempLocation2,200.,0)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,0.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function U5O takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(0)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function U6O takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(X3V)
set TempLocation=OffsetLocation(TempLocation2,0.,-200.)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,270.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function U8O takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(5)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function U9O takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(XYV)
set TempLocation=OffsetLocation(TempLocation2,.0,-200.)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,270.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function WEO takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(0)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function WXO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(X0V)
set TempLocation=OffsetLocation(TempLocation2,-200.,0)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,180.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function WRO takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(5)))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function WIO takes nothing returns nothing
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitInvulnerable(GetTriggerUnit(),true)
set TempLocation2=GetUnitLoc(XZV)
set TempLocation=OffsetLocation(TempLocation2,-200.,0)
call SetUnitPositionLocFacingBJ(GetTriggerUnit(),TempLocation,180.)
call RemoveLocation(TempLocation)
call RemoveLocation(TempLocation2)
if GetUnitTypeId(GetTriggerUnit())!= 'e00A' and GetUnitTypeId(GetTriggerUnit())!= 'e00C' and GetUnitTypeId(GetTriggerUnit())!= 'e00I' and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call SetUnitInvulnerable(GetTriggerUnit(),false)
endif
set TempLocation=GetUnitLoc(GetTriggerUnit())
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function WNO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function WBO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))and GetUnitTypeId(GetFilterUnit())!='h00S' and GetUnitAbilityLevel(GetFilterUnit(),'Aloc')!=1
endfunction
function WCO takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(11),Condition(function WBO)))>=150)
endfunction
function WDO takes nothing returns boolean
return(WCO())
endfunction
function WFO takes nothing returns nothing
call PlaySoundBJ(JY)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffffcc00West Side is not killing fast enough! Overflow of 180 will cause teleporting of monsters of to goal!|r")
endfunction
function WHO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function WJO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))and GetUnitTypeId(GetFilterUnit())!='h00S' and GetUnitAbilityLevel(GetFilterUnit(),'Aloc')!=1
endfunction
function WKO takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(10),Condition(function WJO)))>=150)
endfunction
function WLO takes nothing returns boolean
return(WKO())
endfunction
function WMO takes nothing returns nothing
call PlaySoundBJ(JY)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffffcc00East Side is not killing fast enough! Overflow of 180 will cause teleporting of monsters of to goal|r")
endfunction
function WQO takes nothing returns boolean
return(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING)and(GetPlayerController(GetEnumPlayer())==MAP_CONTROL_USER)
endfunction
function WSO takes nothing returns nothing
if(WQO())then
set ND=(ND+1)
endif
endfunction
function WTO takes nothing returns boolean
return(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING)and(GetPlayerController(GetEnumPlayer())==MAP_CONTROL_USER)
endfunction
function WUO takes nothing returns nothing
if(WTO())then
call AdjustPlayerStateBJ((GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)/ND),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ((GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER)/ND),GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER)
call AddHeroXPSwapped((GetHeroXP(LC[(1+GetPlayerId(GetTriggerPlayer()))])/ND),LC[(1+GetPlayerId(GetEnumPlayer()))],true)
endif
endfunction
function Trig_Player_Leaves_Func006Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_Player_Leaves_Func007Func001001 takes nothing returns boolean
return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction
function Trig_Player_Leaves_Func017001002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h000')
endfunction
function Trig_Player_Leaves_Func017001002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00P')
endfunction
function Trig_Player_Leaves_Func017001002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h004')
endfunction
function Trig_Player_Leaves_Func017001002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00G')
endfunction
function Trig_Player_Leaves_Func017001002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00H')
endfunction
function Trig_Player_Leaves_Func017001002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h00I')
endfunction
function Trig_Player_Leaves_Func017001002002002002002002002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Player_Leaves_Func017001002002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))
endfunction
function Trig_Player_Leaves_Func017001002002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))
endfunction
function Trig_Player_Leaves_Func017001002002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))
endfunction
function Trig_Player_Leaves_Func017001002002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))))
endfunction
function Trig_Player_Leaves_Func017001002002 takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00P'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007'))))))))))
endfunction
function WWO takes nothing returns boolean
return GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h000'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00P'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h004'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00G'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00H'),(GetBooleanAnd((GetUnitTypeId(GetFilterUnit())!='h00I'),(GetUnitTypeId(GetFilterUnit())!='h007')))))))))))) and GetUnitTypeId(GetFilterUnit()) != 'o006' and GetUnitTypeId(GetFilterUnit()) != 'H016' and GetUnitTypeId(GetFilterUnit()) != 'H015' and GetUnitTypeId(GetFilterUnit()) != 'H014' and GetUnitTypeId(GetFilterUnit()) != 'H013' and GetUnitTypeId(GetFilterUnit())!='n01G' and GetUnitTypeId(GetFilterUnit())!='n01C'
endfunction
function WYO takes nothing returns nothing
if NaturesAbundanceS[GetUnitUserData(GetEnumUnit())]>= 1 then
set NaturesAbundanceS[GetUnitUserData(GetEnumUnit())] = 0
endif
call RemoveUnit(GetEnumUnit())
endfunction
function WZO takes nothing returns nothing
set ND=0
call ForForce(C3E(GetTriggerPlayer()),function WSO)
call ForForce(C3E(GetTriggerPlayer()),function WUO)
set QD[1]=false
set QD[2]=false
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[1]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[2]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call PlaySoundBJ(JY)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,(GetPlayerName(GetTriggerPlayer())+" has left the game!"))
call DisplayTimedTextToForce(C3E(GetTriggerPlayer()),30,("Your share of gold: "+I2S((GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)/ND))))
call DisplayTimedTextToForce(C3E(GetTriggerPlayer()),30,("Your share of lumber: "+I2S((GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER)/ND))))
call DisplayTimedTextToForce(C3E(GetTriggerPlayer()),30,("Your share of experience: "+I2S((GetHeroXP(LC[(1+GetPlayerId(GetTriggerPlayer()))])/ND))))
call MultiboardSetItemColorBJ(bj_lastCreatedMultiboard,0,QS[(1+GetPlayerId(GetTriggerPlayer()))],20.,20.,20,0)
call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,1,QS[(1+GetPlayerId(GetTriggerPlayer()))],true,false)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call UnitRemoveItemFromSlotSwapped(bj_forLoopAIndex,LC[(1+GetPlayerId(GetTriggerPlayer()))])
call UnitRemoveItemFromSlotSwapped(bj_forLoopAIndex,Courier[(GetPlayerId(GetTriggerPlayer()))])
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveUnit(LC[(1+GetPlayerId(GetTriggerPlayer()))])
call ForGroupBJ(CUE(GetTriggerPlayer(),Condition(function WWO)),function WYO)
endfunction
function W0O takes nothing returns boolean
return(GetPlayerController(GetOwningPlayer(GetKillingUnit()))==MAP_CONTROL_USER) and GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetKillingUnit()) and GetKillingUnit() != null
endfunction
function W1O takes nothing returns boolean
return(UnitHasBuffBJ(LC[(1+GetPlayerId(GetEnumPlayer()))],'B004'))
endfunction
function W2O takes nothing returns nothing
if(W1O())then
call AddHeroXP(LC[(1+GetPlayerId(GetEnumPlayer()))],R2I((I2R(GetUnitLevel(GetDyingUnit()))*6.)),true)
if LWMON then
call AddHeroXP(LC[(1+GetPlayerId(GetEnumPlayer()))],R2I((I2R(GetUnitLevel(GetDyingUnit()))*24.)),true)
endif
endif
if LWMON then
call AddHeroXP(LC[(1+GetPlayerId(GetEnumPlayer()))],R2I((I2R(GetUnitLevel(GetDyingUnit()))*48.)),true)
endif
endfunction
function W3O takes nothing returns nothing
set XQ=C3E(GetOwningPlayer(GetKillingUnit()))
call ForForce(XQ,function W2O)
call DestroyForce(XQ)
call LeaderboardSetPlayerItemValueBJ(GetOwningPlayer(GetKillingUnit()),LD,GetPlayerScore(GetOwningPlayer(GetKillingUnit()),PLAYER_SCORE_UNITS_KILLED))
set TS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]=(TS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]+1)
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,3,QS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))],I2S(TS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))
endfunction
function W5O takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real x = GetRectCenterX(GD[(1+GetPlayerId(GetOwningPlayer(AAE[PXE])))])
local real y = GetRectCenterY(GD[(1+GetPlayerId(GetOwningPlayer(AAE[PXE])))])
if not HD and IsUnitType(AAE[PXE],UNIT_TYPE_HERO) then
if GetUnitTypeId(AAE[PXE])=='E00E' then
set x = CitadelSpawnX[GetPlayerId(GetOwningPlayer(AAE[PXE]))]
set y = CitadelSpawnY[GetPlayerId(GetOwningPlayer(AAE[PXE]))]
endif
call ReviveHero(AAE[PXE],x,y,true)
call UnitAddItemById(AAE[PXE],'I00K')
call SetUnitState(AAE[PXE],UNIT_STATE_MANA,GetUnitState(AAE[PXE],UNIT_STATE_MAX_MANA))
call DestroyTimerDialog(ANE[PXE])
call D2E(PXE)
call ReleaseTimer(GetExpiredTimer())
else
call DestroyTimerDialog(ANE[PXE])
call D2E(PXE)
call ReleaseTimer(GetExpiredTimer())
endif
set t = null
endfunction
function TyrannyFilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(GLOBAL_CASTER)) and UnitAlive(u) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
call UnitDamageTargetEx(GLOBAL_CASTER,u,GLOBALINTEGER*((BlzGetUnitMaxHP(u)*.45)+GLOBALDAMAGE),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",GetUnitX(u),GetUnitY(u)))
endif
set u = null
return false
endfunction
function W7O takes nothing returns nothing
local unit u=GetTriggerUnit()
local real r
local integer id = GetPlayerId(GetOwningPlayer(u))
local real x = GetRectCenterX(GD[1+id])
local real y = GetRectCenterY(GD[1+id])
local timer t
local integer PXE=D1E()
local real x2
local real y2
local integer i = 0
local integer i2 = 0
local integer i3 = 0
local item it
if GetUnitTypeId(u) == 'E00E' then
set x = CitadelSpawnX[id]
set y = CitadelSpawnY[id]
endif
if XT==1 then
set r=10.+(I2R(GetHeroLevel(u))/2.)
if r >= 90. then
set r = 90.
endif
else
if id <5 then
loop
exitwhen i > 4
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[1+i],i2)
if GetItemTypeId(it) == 'I03V' then
set i3 = i3 + 1
endif
set i2 = i2 + 1
endloop
set i2 = 0
set i = i + 1
endloop
else
set i = 5
loop
exitwhen i > 9
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[1+i],i2)
if GetItemTypeId(it) == 'I03V' then
set i3 = i3 + 1
endif
set i2 = i2 + 1
endloop
set i2 = 0
set i = i + 1
endloop
endif
if i3 > 0 then
set GLOBAL_CASTER = u
set GLOBALINTEGER = i3*1
set GLOBALDAMAGE = BlzGetUnitMaxHP(u)*.5
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
call DestroyEffect(AddSpecialEffect("war3mapImported\\NuclearExplosion5.mdx",x2,y2))
call KillUnit(CreateUnit(Player(15),'h019',x2,y2,0.))
call GroupEnumUnitsInRange(GLOBALGROUP,x2,y2,924.,Filter(function TyrannyFilterActions))
endif
set r=10.+(I2R(GetHeroLevel(u)))
if r >= 90. then
set r = 90.
endif
endif
if IsUnitInGroup(u,WK)then
call ReviveHero(u,x,y,true)
call UnitAddItemById(u,'I00K')
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MAX_MANA))
call D2E(PXE)
else
if SinisterCreed_TraderResBonus[id] then
set r = r*.3
endif
if GetPlayerName(GetOwningPlayer(u))=="Coffee#0217" then
if GetRandomInt(0,100)>=50 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cFFFD0260C|r|cFFF10E62o|r|cFFE51A64f|r|cFFDA2765f|r|cFFCE3367e|r|cFFC23F69e|r|cFFB64B6B_|r|cFFAB586CC|r|cFF9F646Eu|r|cFF937070l|r|cFF877C72t|r|cFF7B8874u|r|cFF709575r|r|cFF64A177e|r|cFF58AD79 |r|cFF4CB97Bh|r|cFF41C67Ca|r|cFF35D27Es|r|cFF29DE80 |r|cFF35D27Ed|r|cFF41C67Ci|r|cFF4CB97Be|r|cFF58AD79d|r|cFF64A177,|r|cFF709575 |r|cFF7B8874w|r|cFF877C72h|r|cFF937070a|r|cFF9F646Et|r|cFFAB586C |r|cFFB64B6Ba|r|cFFC23F69 |r|cFFCE3367n|r|cFFDA2765o|r|cFFE51A64o|r|cFFF10E62b|r|cFFFD0260.|r"))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cFFFA0383C|r|cFFFA0880o|r|cFFFA0D7Ef|r|cFFFA127Bf|r|cFFF91778e|r|cFFF91C75e|r|cFFF92173_|r|cFFF92670C|r|cFFF92B6Du|r|cFFF9306Bl|r|cFFF83568t|r|cFFF83A65u|r|cFFF83E62r|r|cFFF84360e|r|cFFF8485D |r|cFFF84D5Ah|r|cFFF85258a|r|cFFF75755s|r|cFFF75C52 |r|cFFF7614Fd|r|cFFF7664Di|r|cFFF76B4Ae|r|cFFF77047d|r|cFFF67544,|r|cFFF67A42 |r|cFFF67F3Fw|r|cFFF6843Ch|r|cFFF6893Aa|r|cFFF68E37t|r|cFFF69334 |r|cFFF59831a|r|cFFF59D2F |r|cFFF5A22Cd|r|cFFF5A729i|r|cFFF5AC27s|r|cFFF5B024a|r|cFFF5B521p|r|cFFF4BA1Ep|r|cFFF4BF1Co|r|cFFF4C419i|r|cFFF4C916n|r|cFFF4CE14t|r|cFFF4D311m|r|cFFF3D80Ee|r|cFFF3DD0Bn|r|cFFF3E209t|r|cFFF3E706.|r"))
endif
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,(GetPlayerName(GetOwningPlayer(u))+" has died!"))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cffffcc00Time to revival:|r "+I2S(R2I(r))))
endif
set t=NewTimer()
set ANE[PXE]=CreateTimerDialog(t)
call TimerDialogSetTitle(ANE[PXE],(GetPlayerName(GetOwningPlayer(u)))+"'s Hero Revives In:")
call TimerDialogDisplay(ANE[PXE],true)
call TimerDialogSetRealTimeRemaining(ANE[PXE],r)
set AAE[PXE]=u
call SetTimerData(t,PXE)
call TimerStart(t,r,false,function W5O)
endif
set u=null
set t=null
set it = null
endfunction
function W8O takes nothing returns boolean
if GetDyingUnit()==LC[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))]then
call W7O()
endif
return false
endfunction
function W9O takes nothing returns boolean
return(GetOwningPlayer(GetTriggerUnit())==Player(11))
endfunction
function YVO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())!='h00S')and(GetUnitTypeId(GetTriggerUnit())!='h007')and(W9O())
endfunction
function YEO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02X')
endfunction
function YXO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n029')
endfunction
function YOO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02F')
endfunction
function YRO takes nothing returns boolean
return(SC==25)
endfunction
function Trig_Goal_1_Func001Func021001 takes nothing returns boolean
return(SC==0)
endfunction
function YIO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())!='H009')and(GetUnitTypeId(GetTriggerUnit())!='h00B')and(GetUnitTypeId(GetTriggerUnit())!='n00S')
endfunction
function YAO takes nothing returns nothing
if(YIO())then
if (IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT) and XT>=4) or GetUnitTypeId(GetTriggerUnit()) == 'u002' then
set SC=(SC-25)
else
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set SC=(SC-2)
else
set SC=(SC-1)
endif
endif
if GetUnitAbilityLevel(GetTriggerUnit(),'A04P') != 0 then
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
endif
if(YOO())then
call UnitRemoveAbility(GetTriggerUnit(),'Aspd')
endif
if GetUnitAbilityLevel(GetTriggerUnit(),'A0E0') == 1 then
call UnitRemoveAbility(GetTriggerUnit(),'A0E0')
endif
call DisplayTimedTextToForce(C3E(Player(0)),3.,("* Life Lost! Lives: "+I2S(SC)))
set TempLocation=GetRectCenter(GU)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitOwner(GetTriggerUnit(),Player(PLAYER_NEUTRAL_PASSIVE),false)
call KillUnit(GetTriggerUnit())
call ShowUnitHide(GetTriggerUnit())
if(YRO())then
call DisplayTimedTextToForce(C3E(Player(0)),10.,"|cFFFF0000Please stay, even if you are losing; the game will automatically remake.|r")
endif
if((SC<=0))then
call ConditionalTriggerExecute(W7)
endif
call MultiboardSetItemValueBJ(AS[1],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,2,(YQ+(" - "+(I2S(SC)+" Lives"))))
else
if GetUnitAbilityLevel(GetTriggerUnit(),'A0E0') == 1 then
call UnitRemoveAbility(GetTriggerUnit(),'A0E0')
endif
set TempLocation=GetRectCenter(GU)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitOwner(GetTriggerUnit(),Player(PLAYER_NEUTRAL_PASSIVE),false)
call KillUnit(GetTriggerUnit())
call ShowUnitHide(GetTriggerUnit())
endif
endfunction
function YBO takes nothing returns boolean
return(GetOwningPlayer(GetTriggerUnit())==Player(10))
endfunction
function YCO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())!='h00S')and(GetUnitTypeId(GetTriggerUnit())!='h007')and(YBO())
endfunction
function YDO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02X')
endfunction
function YFO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n029')
endfunction
function YGO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n02F')
endfunction
function YHO takes nothing returns boolean
return(TC==25)
endfunction
function Trig_Goal_2_Func001Func021001 takes nothing returns boolean
return(TC==0)
endfunction
function YJO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())!='H009')and(GetUnitTypeId(GetTriggerUnit())!='h00B')and(GetUnitTypeId(GetTriggerUnit())!='n00S')
endfunction
function YKO takes nothing returns nothing
if(YJO())then
if (IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT) and XT>=4) or GetUnitTypeId(GetTriggerUnit()) == 'u002' then
set TC=(TC-25)
else
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set TC=(TC-2)
else
set TC=(TC-1)
endif
endif
if GetUnitAbilityLevel(GetTriggerUnit(),'A04P') != 0 then
call UnitRemoveAbility(GetTriggerUnit(),'A04P')
endif
if(YGO())then
call UnitRemoveAbility(GetTriggerUnit(),'Aspd')
endif
if GetUnitAbilityLevel(GetTriggerUnit(),'A0E0') == 1 then
call UnitRemoveAbility(GetTriggerUnit(),'A0E0')
endif
call DisplayTimedTextToForce(C3E(Player(5)),3.,("* Life lost. Lives: "+I2S(TC)))
set TempLocation=GetRectCenter(HU)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(TempLocation,"Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitOwner(GetTriggerUnit(),Player(PLAYER_NEUTRAL_PASSIVE),false)
call KillUnit(GetTriggerUnit())
call ShowUnitHide(GetTriggerUnit())
if(YHO())then
call DisplayTimedTextToForce(C3E(Player(5)),10.,"|cFFFF0000Please stay, even if you are losing; the game will automatically remake.|r")
endif
if((TC<=0))then
call ConditionalTriggerExecute(W7)
endif
call MultiboardSetItemValueBJ(AS[1],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
call MultiboardSetItemValueBJ(AS[2],1,(CountPlayersInForceBJ(VS[1])+4),(ZQ+(" - "+(I2S(TC)+" Lives"))))
else
if GetUnitAbilityLevel(GetTriggerUnit(),'A0E0') == 1 then
call UnitRemoveAbility(GetTriggerUnit(),'A0E0')
endif
set TempLocation=GetRectCenter(HU)
call AddSpecialEffectLocBJ(GetRectCenter(HU),"Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ(GetRectCenter(HU),"Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call RemoveLocation(TempLocation)
call DestroyEffect(bj_lastCreatedEffect)
call SetUnitOwner(GetTriggerUnit(),Player(PLAYER_NEUTRAL_PASSIVE),false)
call KillUnit(GetTriggerUnit())
call ShowUnitHide(GetTriggerUnit())
endif
endfunction
function Trig_Anti_Stuck_Func001002002001 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=851983)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007') // and GetUnitCurrentOrder(GetFilterUnit())!=851986)
endfunction
function Trig_Anti_Stuck_Func001002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B03D')==false)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func001002002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func001002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007') and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func001002002002002002002 takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func001002002002002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit())!='h007') and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func001002002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func001002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function YMO takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=851983) and(UnitHasBuffBJ(GetFilterUnit(),'B03D')==false)and((UnitHasBuffBJ(GetFilterUnit(),'B04F')==false)) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func002002002001 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=851983)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007') // and GetUnitCurrentOrder(GetFilterUnit())!=851986)
endfunction
function Trig_Anti_Stuck_Func002002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func002002002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func002002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007')and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func002002002002002002002 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func002002002002002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit())!='h007') and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func002002002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false)and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func002002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function YPO takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=851983) and (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func003002002001 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=851983)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007') //and GetUnitCurrentOrder(GetFilterUnit())!=851986)
endfunction
function Trig_Anti_Stuck_Func003002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B03D')==false)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func003002002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func003002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007')and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func003002002002002002002 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func003002002002002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit())!='h007') and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func003002002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func003002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function YQO takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=851983) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func004002002001 takes nothing returns boolean
return(GetUnitCurrentOrder(GetFilterUnit())!=851983)and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007') //and GetUnitCurrentOrder(GetFilterUnit())!=851986)
endfunction
function Trig_Anti_Stuck_Func004002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func004002002002002001 takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func004002002002002002001 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())!='h007')and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func004002002002002002002 takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=852230) and (GetUnitTypeId(GetFilterUnit())!='h007')
endfunction
function Trig_Anti_Stuck_Func004002002002002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit())!='h007') and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func004002002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function Trig_Anti_Stuck_Func004002002002 takes nothing returns boolean
return (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function YSO takes nothing returns boolean
return (GetUnitCurrentOrder(GetFilterUnit())!=851983) and (UnitHasBuffBJ(GetFilterUnit(),'B03D')==false) and (UnitHasBuffBJ(GetFilterUnit(),'B04F')==false) and (GetUnitTypeId(GetFilterUnit())!='h007') and not Fear.isFeared(GetFilterUnit()) and (GetUnitCurrentOrder(GetFilterUnit())!=852230)
endfunction
function YTO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,PD[2])
endfunction
function YUO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,PD[2])
endfunction
function YWO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,PD[1])
endfunction
function YYO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,PD[1])
endfunction
function YZO takes nothing returns nothing
set QK=CUE(Player(10),Condition(function YMO))
//set SK=CUE(Player(9),Condition(function YPO))
//set TK=CUE(Player(10),Condition(function YQO))
set UK=CUE(Player(11),Condition(function YSO))
call ForGroupBJ(QK,function YTO)
//call ForGroupBJ(SK,function YUO)
//call ForGroupBJ(TK,function YWO)
call ForGroupBJ(UK,function YYO)
call DestroyGroup(QK)
//call DestroyGroup(SK)
//call DestroyGroup(TK)
call DestroyGroup(UK)
endfunction
function Y0O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'o014',GetEnumPlayer(),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A051')
endfunction
function Y1O takes nothing returns boolean
return(XT==1)
endfunction
function Y2O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'o014',GetEnumPlayer(),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A05D')
endfunction
function Y3O takes nothing returns boolean
return(XT==3)
endfunction
function Y4O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'o014',GetEnumPlayer(),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A05E')
endfunction
function Y5O takes nothing returns boolean
return(XT==4)
endfunction
function Y6O takes nothing returns nothing
call CreateNUnitsAtLoc(1,'o014',GetEnumPlayer(),GetRectCenter(bj_mapInitialPlayableArea),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A05F')
endfunction
function Y7O takes nothing returns boolean
return(XT==5)
endfunction
function Y8O takes nothing returns boolean
return(PC==4)
endfunction
function Y9O takes nothing returns nothing
if OD[(1+GetPlayerId(GetEnumPlayer()))] then
call AdjustPlayerStateBJ((PC*1200),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
else
call AdjustPlayerStateBJ((PC*600),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endif
endfunction
function ZVO takes nothing returns boolean
return((CountUnitsInGroup(CYE(Player(11))))>=180)
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function ZEO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((UnitAlive(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function BRTELE takes nothing returns boolean
return UnitAlive(GetFilterUnit()) and IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false
endfunction
function ZXO takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func001Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function ZOO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function ZRO takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function ZIO takes nothing returns boolean
return(ZVO())
endfunction
function ZAO takes nothing returns boolean
return((CountUnitsInGroup(CYE(Player(10))))>=180)
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function ZNO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function ZBO takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func011Func008Func002Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function ZCO takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function ZDO takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function ZFO takes nothing returns boolean
return(ZAO())
endfunction
function Trig_Spawn_Units_Func011Func008Func003001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func004Func009001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func004Func017001 takes nothing returns boolean
return(HD)
endfunction
function ZGO takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func011Func008Func004Func026001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func004Func027001 takes nothing returns boolean
return(QD[1])
endfunction
function Trig_Spawn_Units_Func011Func008Func004Func027002 takes nothing returns boolean
return(QD[2]==false)
endfunction
function ZHO takes nothing returns boolean
return(GetBooleanAnd((QD[1]),(QD[2]==false)))
endfunction
function Trig_Spawn_Units_Func011Func008Func005Func009001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func005Func017001 takes nothing returns boolean
return(HD)
endfunction
function ZJO takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func011Func008Func005Func026001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func005Func027001 takes nothing returns boolean
return(QD[1]==false)
endfunction
function Trig_Spawn_Units_Func011Func008Func005Func027002 takes nothing returns boolean
return(QD[2])
endfunction
function ZKO takes nothing returns boolean
return(GetBooleanAnd((QD[1]==false),(QD[2])))
endfunction
function Trig_Spawn_Units_Func011Func008Func006Func015001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func006Func029001 takes nothing returns boolean
return(HD)
endfunction
function ZLO takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func011Func008Func006Func044001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func011Func008Func006Func045001 takes nothing returns boolean
return(QD[1])
endfunction
function Trig_Spawn_Units_Func011Func008Func006Func045002 takes nothing returns boolean
return(QD[2])
endfunction
function ZMO takes nothing returns boolean
return(GetBooleanAnd((QD[1]),(QD[2])))
endfunction
function Trig_Spawn_Units_Func011Func011001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func013001 takes nothing returns boolean
return(HD)
endfunction
function ZPO takes nothing returns boolean
return(QD[1])
endfunction
function ZQO takes nothing returns boolean
return(QD[2])
endfunction
function Trig_Spawn_Units_Func018001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func020001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func022001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func024001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func026001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func028001 takes nothing returns boolean
return(HD)
endfunction
function ZSO takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(false,'A02A',GetEnumPlayer())
endfunction
function ZTO takes nothing returns boolean
return(PC==30)
endfunction
function ZUO takes nothing returns nothing
if OD[(1+GetPlayerId(GetEnumPlayer()))] then
call AdjustPlayerStateBJ((PC*1200),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
else
call AdjustPlayerStateBJ((PC*600),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endif
endfunction
function ZWO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function ZYO takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function ZZO takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(11),Condition(function ZYO)))>=180)
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function Z_O takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function Z0O takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func001Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function Z1O takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function Z2O takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function Z3O takes nothing returns boolean
return(ZZO())
endfunction
function Z4O takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Z5O takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Z6O takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(10),Condition(function Z5O)))>=180)
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function Z7O takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function Z8O takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func029Func008Func002Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function Z9O takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function VVR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function VER takes nothing returns boolean
return(Z6O())
endfunction
function Trig_Spawn_Units_Func029Func008Func003001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func004Func009001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func004Func017001 takes nothing returns boolean
return(HD)
endfunction
function VXR takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func029Func008Func004Func026001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func004Func027001 takes nothing returns boolean
return(QD[1])
endfunction
function Trig_Spawn_Units_Func029Func008Func004Func027002 takes nothing returns boolean
return(QD[2]==false)
endfunction
function VOR takes nothing returns boolean
return(GetBooleanAnd((QD[1]),(QD[2]==false)))
endfunction
function Trig_Spawn_Units_Func029Func008Func005Func009001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func005Func017001 takes nothing returns boolean
return(HD)
endfunction
function VRR takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func029Func008Func005Func026001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func005Func027001 takes nothing returns boolean
return(QD[1]==false)
endfunction
function Trig_Spawn_Units_Func029Func008Func005Func027002 takes nothing returns boolean
return(QD[2])
endfunction
function VIR takes nothing returns boolean
return(GetBooleanAnd((QD[1]==false),(QD[2])))
endfunction
function Trig_Spawn_Units_Func029Func008Func006Func015001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func006Func029001 takes nothing returns boolean
return(HD)
endfunction
function Trig_Spawn_Units_Func029Func008Func006Func043001 takes nothing returns boolean
return(HD)
endfunction
function VAR takes nothing returns boolean
return(OT==3)
endfunction
function Trig_Spawn_Units_Func029Func008Func006Func045001 takes nothing returns boolean
return(QD[1])
endfunction
function Trig_Spawn_Units_Func029Func008Func006Func045002 takes nothing returns boolean
return(QD[2])
endfunction
function VNR takes nothing returns boolean
return(GetBooleanAnd((QD[1]),(QD[2])))
endfunction
function Trig_Spawn_Units_Func029Func011001 takes nothing returns boolean
return(HD)
endfunction
function VBR takes nothing returns nothing
if OD[(1+GetPlayerId(GetEnumPlayer()))] then
call AdjustPlayerStateBJ((PC*1200),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
else
call AdjustPlayerStateBJ((PC*600),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endif
endfunction
function VCR takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function VDR takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function VFR takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(11),Condition(function VDR)))>=180)
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function VGR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function VHR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func001Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function VJR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function VKR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function VLR takes nothing returns boolean
return(VFR())
endfunction
function VMR takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function VPR takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function VQR takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(10),Condition(function VPR)))>=180)
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function VSR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function VTR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func030Func003Func002Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function VUR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function VWR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function VYR takes nothing returns boolean
return(VQR())
endfunction
function Trig_Spawn_Units_Func030Func003Func003001 takes nothing returns boolean
return(HD)
endfunction
function VZR takes nothing returns boolean
return(QD[1])
endfunction
function V_R takes nothing returns boolean
return(QD[2])
endfunction
function Trig_Spawn_Units_Func030Func003Func007001 takes nothing returns boolean
return(HD)
endfunction
function V0R takes nothing returns boolean
return(QD[1])
endfunction
function V1R takes nothing returns boolean
return(QD[2])
endfunction
function Trig_Spawn_Units_Func030Func007001 takes nothing returns boolean
return(HD)
endfunction
function V2R takes nothing returns nothing
if OD[(1+GetPlayerId(GetEnumPlayer()))] then
call AdjustPlayerStateBJ((PC*1200),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
else
call AdjustPlayerStateBJ((PC*600),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endif
endfunction
function V3R takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function V4R takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function V5R takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(11),Condition(function V4R)))>=180)
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function V6R takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function V7R takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func001Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function V8R takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function V9R takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[1])
endfunction
function EVR takes nothing returns boolean
return(V5R())
endfunction
function EER takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function EXR takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function EOR takes nothing returns boolean
return(CountUnitsInGroup(CUE(Player(10),Condition(function EXR)))>=180)
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func003001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func003001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func003001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func003001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function ERR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function EIR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func004001002002001001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func004001002002001002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func004001002002001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)))!=null
endfunction
function Trig_Spawn_Units_Func031Func003Func002Func004001002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)!=null
endfunction
function EAR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)))!=null
endfunction
function ENR takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(),PD[2])
endfunction
function EBR takes nothing returns boolean
return(EOR())
endfunction
function Trig_Spawn_Units_Func031Func003Func003001 takes nothing returns boolean
return(HD)
endfunction
function ECR takes nothing returns boolean
return(QD[1])
endfunction
function EDR takes nothing returns boolean
return(QD[2])
endfunction
function Trig_Spawn_Units_Func031Func003Func007001 takes nothing returns boolean
return(HD)
endfunction
function EFR takes nothing returns boolean
return(QD[1])
endfunction
function EGR takes nothing returns boolean
return(QD[2])
endfunction
function Trig_Spawn_Units_Func031Func007001 takes nothing returns boolean
return(HD)
endfunction
function EHR takes nothing returns nothing
local integer count = 0
local integer starting
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc0020 seconds till game starts.|r")
call TriggerSleepAction(20.)
//call SetPlayerHandicapBJ(Player(8),ED)
//call SetPlayerHandicapBJ(Player(9),ED)
call SetPlayerHandicapBJ(Player(10),ED)
call SetPlayerHandicapBJ(Player(11),ED)
if(Y1O())then
call ForForce(C_E(MAP_CONTROL_COMPUTER),function Y0O)
endif
if(Y3O())then
call ForForce(C_E(MAP_CONTROL_COMPUTER),function Y2O)
endif
if(Y5O())then
call ForForce(C_E(MAP_CONTROL_COMPUTER),function Y4O)
endif
if(Y7O())then
call ForForce(C_E(MAP_CONTROL_COMPUTER),function Y6O)
endif
set PC=1
loop
exitwhen PC>19
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Round "+(I2S(PC)+" is now starting.")))
loop
exitwhen count == 12
if TIPST[count] then
call DisplayTimedTextToPlayer(Player(count),0,0,20.,DT[PC])
call DisplayTimedTextToPlayer(Player(count),0,0,20.,NT[PC])
endif
set count = count + 1
endloop
set count = 0
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Income: "+(I2S((PC*600))+".")))
if(Y8O())then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.," ")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Players can no longer repick.|r")
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set JT[bj_forLoopAIndex]=true
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
call ForForce(bj_FORCE_ALL_PLAYERS,function Y9O)
set BD[1]=1
loop
exitwhen BD[1]>QC
if(ZIO()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function ZEO))),function ZXO)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function ZOO))),function ZRO)
endif
if(ZFO()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function ZNO))),function ZBO)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function ZCO))),function ZDO)
endif
if(ZIO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function BRTELE))),function ZXO)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function BRTELE))),function ZRO)
endif
if(ZFO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function BRTELE))),function ZBO)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function BRTELE))),function ZDO)
endif
if((HD))then
return
endif
if(ZHO())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
if(ZGO())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
else
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(1.67)
if((HD))then
return
endif
endif
if(ZKO())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
if(ZJO())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(1.67)
if((HD))then
return
endif
endif
if(ZMO())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
if(ZLO())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(1.67)
if((HD))then
return
endif
endif
set BD[1]=BD[1]+1
endloop
set OT=0
call TriggerSleepAction(13.)
if((HD))then
return
endif
set PC=PC+1
endloop
call TriggerSleepAction(15.)
if((HD))then
return
endif
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Bonus Round has started! Bosses will not cause you to lose lives if they reach the goal, but careful, they can be quite dangerous!")
if(ZPO())then
call CreateNUnitsAtLoc(1,'h00B',Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851983,PD[1])
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,60.)
endif
if(ZQO())then
call CreateNUnitsAtLoc(1,'h00B',Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851983,PD[2])
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,60.)
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
set PC=20
loop
exitwhen PC>34
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Round "+(I2S(PC)+" is now starting.")))
loop
exitwhen count == 12
if TIPST[count] then
call DisplayTimedTextToPlayer(Player(count),0,0,20.,DT[PC])
call DisplayTimedTextToPlayer(Player(count),0,0,20.,NT[PC])
endif
set count = count + 1
endloop
set count = 0
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.," ")
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Income: "+(I2S((PC*600))+".")))
if(ZTO())then
call ForForce(bj_FORCE_ALL_PLAYERS,function ZSO)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Kalestraum's Darkrift has been disabled for all players.|r")
endif
call ForForce(bj_FORCE_ALL_PLAYERS,function ZUO)
set BD[1]=1
loop
exitwhen BD[1]>QC
if(Z3O()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(11),Condition(function Z_O))),function Z0O)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function Z1O))),function Z2O)
endif
if(VER()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function Z7O))),function Z8O)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function Z9O))),function VVR)
endif
if(ZIO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function BRTELE))),function ZXO)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function BRTELE))),function ZRO)
endif
if(ZFO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function BRTELE))),function ZBO)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function BRTELE))),function ZDO)
endif
if((HD))then
return
endif
if(VOR())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
if(VXR())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(1.67)
if((HD))then
return
endif
endif
if(VIR())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
if(VRR())then
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(1.67)
if((HD))then
return
endif
endif
if(VNR())then
set OT=(OT+1)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(1.67)
if((HD))then
return
endif
if(VAR())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
call TriggerSleepAction(.01)
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
endif
set BD[1]=BD[1]+1
endloop
set OT=0
call TriggerSleepAction(10.)
if((HD))then
return
endif
set PC=PC+1
endloop
set PC=35
loop
exitwhen PC>40
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Round "+(I2S(PC)+" is now starting.")))
loop
exitwhen count == 12
if TIPST[count] then
call DisplayTimedTextToPlayer(Player(count),0,0,20.,DT[PC])
call DisplayTimedTextToPlayer(Player(count),0,0,20.,NT[PC])
endif
set count = count + 1
endloop
set count = 0
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.," ")
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Income: "+(I2S((PC*600))+".")))
call ForForce(bj_FORCE_ALL_PLAYERS,function VBR)
set BD[1]=1
loop
exitwhen BD[1]>QC
if(VLR()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function VGR))),function VHR)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function VJR))),function VKR)
endif
if(VYR()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function VSR))),function VTR)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function VUR))),function VWR)
endif
if(ZIO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function BRTELE))),function ZXO)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function BRTELE))),function ZRO)
endif
if(ZFO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function BRTELE))),function ZBO)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function BRTELE))),function ZDO)
endif
if((HD))then
return
endif
if(VZR())then
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[3],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(11),CNE(MD[4],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
if(V_R())then
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,135.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[1],200.,315.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,45.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[PC],Player(10),CNE(MD[2],200.,225.),bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(5.)
if((HD))then
return
endif
set BD[1]=BD[1]+1
endloop
if(V0R())then
call CreateNUnitsAtLoc(1,PK[PC],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(.01)
if(V1R())then
call CreateNUnitsAtLoc(1,PK[PC],Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
set PC=PC+1
endloop
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("You have reached the final wave....But only one team may emerge victorious. Who will survive the endless onslaught?"))
set starting = 1
loop
exitwhen starting == 1000
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Round 40 is now starting.")
if GetRandomInt(1,100) <= 50 then
set DT[40]="|cff00baffMolten Terror|r"
set MC[40]='n045'
set PK[40]='n046'
set NT[40]="Molten Terrors are your end. They deal |cffee0000massive spell damage|r with their |cffee0000area of effect spells|r. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
else
set DT[40]="|cff00baffS'lai Screamer|r"
set MC[40]='n016'
set PK[40]='n03K'
set NT[40]="S'lai Screamers are your end. They are all protected by |cffee0000Evil Angels|r. Their Commander has |cffee0000Lay Waste|r, a devastating area attack. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
endif
loop
exitwhen count == 12
if TIPST[count] then
call DisplayTimedTextToPlayer(Player(count),0,0,20.,DT[40])
call DisplayTimedTextToPlayer(Player(count),0,0,20.,NT[40])
endif
set count = count + 1
endloop
set count = 0
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.," ")
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Income: "+(I2S((40*600))+".")))
//call ForForce(bj_FORCE_ALL_PLAYERS,function V2R)
set BD[1]=1
loop
exitwhen BD[1]>QC
if(EVR()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(11),Condition(function V6R))),function V7R)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function V8R))),function V9R)
endif
if(EBR()) and not BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function ERR))),function EIR)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function EAR))),function ENR)
endif
if(ZIO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The West Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(10),Condition(function BRTELE))),function ZXO)
call ForGroupBJ(C5E(8,CUE(Player(11),Condition(function BRTELE))),function ZRO)
endif
if(ZFO()) and BRTON then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"The East Side team has had eight units teleported to the goal!")
//call ForGroupBJ(C5E(4,CUE(Player(8),Condition(function BRTELE))),function ZBO)
call ForGroupBJ(C5E(8,CUE(Player(10),Condition(function BRTELE))),function ZDO)
endif
if((HD))then
return
endif
if(ECR())then
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[40],Player(11),MD[3],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[40],Player(11),MD[3],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[40],Player(11),MD[4],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[40],Player(11),MD[4],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
if(EDR())then
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[40],Player(10),MD[1],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[40],Player(10),MD[1],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
if BRTON == false then
call CreateNUnitsAtLoc(1,MC[40],Player(10),MD[2],bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(1,PK[40],Player(10),MD[2],bj_UNIT_FACING)
endif
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(5.)
if((HD))then
return
endif
set BD[1]=BD[1]+1
endloop
if(EFR())then
call CreateNUnitsAtLoc(1,PK[40],Player(11),MD[GetRandomInt(3,4)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
if(EGR())then
call CreateNUnitsAtLoc(1,PK[40],Player(10),MD[GetRandomInt(1,2)],bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call TriggerRegisterUnitEvent(SetPathing_AggroTrigger,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(PATHING_GROUP,bj_lastCreatedUnit)
call SetUnitAcquireRange(bj_lastCreatedUnit,900.)
endif
call TriggerSleepAction(10.)
if((HD))then
return
endif
set starting = starting + 1
endloop
endfunction
function ETR takes nothing returns boolean
return(GetSpellAbilityId()=='A079')
endfunction
function EUR takes nothing returns nothing
call SetUnitVertexColorBJ(GetTriggerUnit(),20.,20.,20.,0)
call AddSpecialEffectTargetUnitBJ("overhead",GetTriggerUnit(),"war3mapImported\\Sin.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\NewDarkPillar.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function EYR takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H005')
endfunction
function EZR takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ("hand,right",GetTriggerUnit(),"war3mapImported\\ThePowerOfLight.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function E0R takes nothing returns boolean
return((UnitHasBuffBJ(GetTriggerUnit(),'B00V'))and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null
endfunction
function E1R takes nothing returns boolean
return((GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())+(GetEventDamage()*2.))>=GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit()))
endfunction
function E2R takes nothing returns nothing
if(E1R())then
call SetWidgetLife(GetTriggerUnit(),GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetTriggerUnit()))
else
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())+(GetEventDamage()*2.)))
endif
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function E4R takes nothing returns boolean
return((UnitHasBuffBJ(GetTriggerUnit(),'B00W'))and(GetUnitAbilityLevelSwapped('Avul',GetEventDamageSource())==0)and(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)!=true))!=null
endfunction
function E5R takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ("origin",GetEventDamageSource(),"war3mapImported\\ChaosExplosion.mdx")
call DestroyEffect(bj_lastCreatedEffect)
call UnitDamageTargetBJ(GetTriggerUnit(),GetEventDamageSource(),(GetEventDamage()*2.),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endfunction
function E7R takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B00X'))
endfunction
function E8R takes nothing returns nothing
call SetWidgetLife(GetEventDamageSource(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetEventDamageSource())+GetEventDamage()))
call AddSpecialEffectTargetUnitBJ("origin",GetEventDamageSource(),"Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function XVR takes nothing returns boolean
return(UnitHasBuffBJ(GetAttacker(),'B015'))
endfunction
function XER takes nothing returns nothing
set NF=GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetAttacker()),NF,bj_UNIT_FACING)
call RemoveLocation(NF)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A07O')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetTriggerUnit())
endfunction
function XOR takes nothing returns boolean
return(UnitHasBuffBJ(GetEventDamageSource(),'B01A'))and(GetRandomInt(1,100)<=15)and(GetEventDamage()>.0)and(not((BI[NI])!=(LN)))
endfunction
function XRR takes nothing returns nothing
call UnitDamageTargetEx(GetEventDamageSource(),GetTriggerUnit(),(GetEventDamage()*4.),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set OK=GetUnitLoc(GetTriggerUnit())
call CreateTextTagLocBJ((R2S((GetEventDamage()*5.))+"!"),OK,0,16.,100.,.0,.0,0)
call RemoveLocation(OK)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,5.)
call SetTextTagFadepointBJ(bj_lastCreatedTextTag,4)
endfunction
function XAR takes nothing returns boolean
return(GetSpellAbilityId()=='A07N')
endfunction
function XNR takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\Firaga.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function XCR takes nothing returns boolean
return(UnitHasBuffBJ(GetAttacker(),'B018'))
endfunction
function XDR takes nothing returns nothing
set BF=GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetAttacker()),BF,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A07M')
call IssueTargetOrderById(bj_lastCreatedUnit,852119,GetTriggerUnit())
call RemoveLocation(BF)
endfunction
function XGR takes nothing returns boolean
return(GetSpellAbilityId()=='A07L')
endfunction
function XHR takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A07K')
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"war3mapImported\\Nebula.mdx")
call DestroyEffect(bj_lastCreatedEffect)
endfunction
function XKR takes nothing returns boolean
return(UnitHasBuffBJ(GetAttacker(),'B01B'))
endfunction
function XLR takes nothing returns nothing
set CF=GetUnitLoc(GetAttacker())
set DF=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetAttacker()),CF,bj_UNIT_FACING)
call RemoveLocation(CF)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A07H')
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852218,DF)
call RemoveLocation(DF)
endfunction
function XPR takes nothing returns boolean
return(GetSpellAbilityId()=='A07E')
endfunction
function XQR takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A07F')
call UnitAddAbility(GetTriggerUnit(),'A07I')
endfunction
function XTR takes nothing returns boolean
local unit g=GetFilterUnit()
local boolean b=IsUnitType(g,UNIT_TYPE_STRUCTURE)==false and IsUnitType(g,UNIT_TYPE_FLYING)==false and IsUnitType(g,UNIT_TYPE_MAGIC_IMMUNE)==false and(GetUnitAbilityLevel((g),'Avul')>0)==false and(GetUnitAbilityLevel((g),'A0ET')>0)==false
set g=null
return b
endfunction
function XUR takes unit XWR,real CHE returns group
local real x=GetUnitX(XWR)
local real y=GetUnitY(XWR)
local real xx
local real yy
local real CDE
local real XYR=GetUnitFacing(XWR)
local real XZR
local group g=CreateGroup()
local group gg=CreateGroup()
local unit u
call GroupEnumUnitsInRange(g,x,y,CHE,Condition(function XTR))
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
set xx=GetUnitX(u)
set yy=GetUnitY(u)
set CDE=Atan2(y-yy,x-xx)*bj_RADTODEG
set XZR=ModuloReal(RAbsBJ(CDE-XYR),360)
if XZR>90 and XZR<270 then
call GroupAddUnit(gg,u)
endif
endloop
call DestroyGroup(g)
set g=null
return gg
endfunction
function X_R takes group g,real X0R,real X1R returns nothing
local unit u
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
call SetUnitX(u,GetUnitX(u)+X0R)
call SetUnitY(u,GetUnitY(u)+X1R)
endloop
endfunction
function X2R takes nothing returns nothing
local integer i=RDV
local integer sw
local group g
local unit O3X
loop
exitwhen i<=0
set sw=RFV[i]
if ModuloInteger(AGE[sw],3)==0 then
call SAE('H00A',AKE[sw],ALE[sw],AME[sw],.8,"attack two",.6)
call SetUnitAnimation(AFE[sw],"attack two")
endif
set AKE[sw]=AKE[sw]+AHE[sw]
set ALE[sw]=ALE[sw]+AJE[sw]
call SetUnitX(AFE[sw],AKE[sw])
call SetUnitY(AFE[sw],ALE[sw])
set g=XUR(AFE[sw],150.)
call GroupRemoveUnit(g,AFE[sw])
call LPE(1,g,AHE[sw],AJE[sw])
call DestroyGroup(g)
set g=null
set AGE[sw]=AGE[sw]-1
if AGE[sw]==0 then
call DestroyEffect(AddSpecialEffect("none.mdl",AKE[sw],ALE[sw]))
set O3X=CreateUnit(GetOwningPlayer(AFE[sw]),'h007',AKE[sw],ALE[sw],0)
call UnitAddAbility(O3X,'A07Y')
call SetUnitAbilityLevel(O3X,'A07Y',GetUnitAbilityLevel(O3X,'A07X'))
call IssueImmediateOrder(O3X,"battleroar")
call UnitApplyTimedLife(O3X,0,1.5)
set O3X=null
set RFV[i]=RFV[RDV]
set RFV[RDV]=sw
set RDV=RDV-1
if RDV==0 then
call PauseTimer(RHV)
endif
call SetUnitInvulnerable(AFE[sw],false)
call SetUnitTimeScale(AFE[sw],1)
call DestroyEffect(APE[sw])
endif
set i=i-1
endloop
endfunction
function X3R takes unit U0E,location X4R returns nothing
local real xx=GetLocationX(X4R)
local real yy=GetLocationY(X4R)
local real x=GetUnitX(U0E)
local real y=GetUnitY(U0E)
local real X5R=xx-x
local real X6R=yy-y
local real CCE=SquareRoot(X5R*X5R+X6R*X6R)
local integer X7R=R2I(CCE/1000./.03125)
local real X8R=X5R/I2R(X7R)
local real X9R=X6R/I2R(X7R)
local real K0E=Atan2(X9R,X8R)*bj_RADTODEG
call SetUnitAnimation(U0E,"Attack")
call SetUnitFacing(U0E,K0E)
call SetUnitInvulnerable(U0E,true)
call SetUnitTimeScale(U0E,.6)
set RDV=RDV+1
if RDV>RGV then
set RGV=RGV+1
set RFV[RDV]=D_E()
endif
set AFE[RFV[RDV]]=U0E
set AKE[RFV[RDV]]=x
set ALE[RFV[RDV]]=y
set AHE[RFV[RDV]]=X8R
set AJE[RFV[RDV]]=X9R
set AGE[RFV[RDV]]=X7R
set AME[RFV[RDV]]=K0E
set APE[RFV[RDV]]=AddSpecialEffectTarget("war3mapImported\\ShadowWave.mdx",U0E,"origin")
call RemoveLocation(X4R)
set X4R=null
if RDV==1 then
call TimerStart(RHV,.03125,true,function X2R)
endif
endfunction
function OVR takes nothing returns boolean
if 'A07X'==GetSpellAbilityId()then
call X3R(GetTriggerUnit(),GetSpellTargetLoc())
endif
return false
endfunction
function OER takes nothing returns boolean
return(GetSpellAbilityId()=='A07Y')
endfunction
function OXR takes nothing returns nothing
set JF=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h007',GetOwningPlayer(GetTriggerUnit()),JF,bj_UNIT_FACING)
call RemoveLocation(JF)
call UnitApplyTimedLifeBJ(21.01,'BTLF',bj_lastCreatedUnit)
set KF=bj_lastCreatedUnit
set LF=(LF+1)
set MF[LF]=KF
set PF[LF]=GetUnitLoc(KF)
set QF[LF]=840
set SF[LF]=840
set TF[LF]=500.
set TF[LF]=(TF[LF]/40.)
set WF[LF]=CreateGroup()
set OL=1
loop
exitwhen OL>GF
call CreateNUnitsAtLoc(1,'n01R',GetOwningPlayer(KF),PF[LF],(I2R(OL)*(360./I2R(GF))))
set UF=bj_lastCreatedUnit
call GroupAddUnit(WF[LF],UF)
call UnitAddAbility(UF,'Amrf')
call UnitRemoveAbility(UF,'Amrf')
call SetUnitFlyHeight(UF,65.,.0)
call SetUnitAnimation(UF,"Birth")
call QueueUnitAnimation(UF,"Stand")
call SetUnitTimeScalePercent(UF,180.)
set OL=OL+1
endloop
set YF[LF]=CreateSound("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFogLoop1.wav",true,true,false,100,100,"SpellsEAX")
call PlaySoundAtPointBJ(YF[LF],100,PF[LF],0)
endfunction
function ORR takes nothing returns nothing
set KF=GetEnumUnit()
call SetUnitTimeScalePercent(KF,100.)
call SetUnitAnimation(KF,"Stand")
endfunction
function OIR takes nothing returns boolean
return(GetDestructableMaxLife(GetEnumDestructable())==50.)
endfunction
function OAR takes nothing returns nothing
if(OIR())then
call KillDestructable(GetEnumDestructable())
endif
endfunction
function ONR takes nothing returns boolean
return(QF[ZF]==(SF[ZF]-20))
endfunction
function OBR takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function OCR takes nothing returns nothing
set KF=GetEnumUnit()
call SetUnitTimeScalePercent(KF,350.)
call SetUnitAnimation(KF,"Death")
endfunction
function ODR takes nothing returns boolean
return(QF[ZF]==20)
endfunction
function OFR takes nothing returns nothing
set KF=GetEnumUnit()
call SetUnitVertexColorBJ(KF,100,100,100,(5.*I2R((20-(SF[ZF]-QF[ZF])))))
endfunction
function OGR takes nothing returns boolean
return(QF[ZF]>=(SF[ZF]-20))
endfunction
function Trig_WarpField_Act_Func001Func001Func008Func001002003001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)!=null
endfunction
function Trig_WarpField_Act_Func001Func001Func008Func001002003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_WarpField_Act_Func001Func001Func008Func001002003002002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(MF[ZF])))
endfunction
function Trig_WarpField_Act_Func001Func001Func008Func001002003002 takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(MF[ZF]))))
endfunction
function OHR takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(MF[ZF])))))))!=null
endfunction
function OJR takes nothing returns boolean
return(IsTerrainPathableBJ(XG,PATHING_TYPE_WALKABILITY))
endfunction
function OKR takes nothing returns boolean
return(TF[ZF]>.0)
endfunction
function OLR takes nothing returns nothing
set KF=GetEnumUnit()
set EG=GetUnitLoc(KF)
set XG=CNE(EG,HF,AngleBetweenPoints(PF[ZF],EG))
if(OJR())then
call SetUnitPositionLoc(KF,XG)
else
call SetUnitX(KF,GetLocationX(XG))
call SetUnitY(KF,GetLocationY(XG))
endif
call AddSpecialEffectLocBJ(XG,"Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(EG)
call RemoveLocation(XG)
if(OKR())then
call UnitDamageTargetBJ(MF[ZF],KF,TF[ZF],ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endif
endfunction
function OMR takes nothing returns boolean
return(QF[ZF]<(SF[ZF]-20))and(QF[ZF]>20)
endfunction
function OPR takes nothing returns nothing
set KF=GetEnumUnit()
call SetUnitVertexColorBJ(KF,100,100,100,(5.*I2R(QF[ZF])))
endfunction
function OQR takes nothing returns boolean
return(QF[ZF]<=20)
endfunction
function OSR takes nothing returns boolean
return(QF[ZF]>0)
endfunction
function OTR takes nothing returns nothing
set ZF=1
loop
exitwhen ZF>LF
if(OSR())then
if(ONR())then
call ForGroupBJ(WF[ZF],function ORR)
call CGE(500.,PF[ZF],function OAR)
endif
if(ODR())then
call ForGroupBJ(WF[ZF],function OCR)
endif
if(OGR())then
call ForGroupBJ(WF[ZF],function OFR)
endif
if(OMR())then
set VG=CQE(435.,PF[ZF],Condition(function OHR))
call ForGroupBJ(VG,function OLR)
call DestroyGroup(VG)
endif
if(OQR())then
call ForGroupBJ(WF[ZF],function OPR)
endif
set QF[ZF]=(QF[ZF]-1)
else
call ForGroupBJ(WF[ZF],function OBR)
call RemoveLocation(PF[ZF])
call DestroyGroup(WF[ZF])
call StopSoundBJ(YF[ZF],true)
call KillSoundWhenDone(YF[ZF])
set MF[ZF]=MF[LF]
set WF[ZF]=WF[LF]
set YF[ZF]=YF[LF]
set PF[ZF]=PF[LF]
set QF[ZF]=QF[LF]
set SF[ZF]=SF[LF]
set LF=(LF-1)
set ZF=(ZF-1)
endif
set ZF=ZF+1
endloop
endfunction
function OWR takes nothing returns boolean
return(GetSpellAbilityId()=='A082')
endfunction
function Trig_Terra_Crush_Init_Func005002003001001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)!=null
endfunction
function Trig_Terra_Crush_Init_Func005002003001002 takes nothing returns boolean
return(GetOwningPlayer(GetFilterUnit())!=Player(PLAYER_NEUTRAL_PASSIVE))
endfunction
function Trig_Terra_Crush_Init_Func005002003001 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetOwningPlayer(GetFilterUnit())!=Player(PLAYER_NEUTRAL_PASSIVE))))!=null
endfunction
function Trig_Terra_Crush_Init_Func005002003002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Terra_Crush_Init_Func005002003002002001001 takes nothing returns boolean
return(IsUnitDeadBJ(GetFilterUnit())==false)
endfunction
function Trig_Terra_Crush_Init_Func005002003002002001002 takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('Avul',GetFilterUnit())!=1)
endfunction
function Trig_Terra_Crush_Init_Func005002003002002001 takes nothing returns boolean
return GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetUnitAbilityLevelSwapped('Avul',GetFilterUnit())!=1))
endfunction
function Trig_Terra_Crush_Init_Func005002003002002002 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(OG)))
endfunction
function Trig_Terra_Crush_Init_Func005002003002002 takes nothing returns boolean
return GetBooleanAnd((GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetUnitAbilityLevelSwapped('Avul',GetFilterUnit())!=1))),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(OG))))
endfunction
function Trig_Terra_Crush_Init_Func005002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(GetBooleanAnd((GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetUnitAbilityLevelSwapped('Avul',GetFilterUnit())!=1))),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(OG)))))))!=null
endfunction
function OYR takes nothing returns boolean
return(GetBooleanAnd((GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(GetOwningPlayer(GetFilterUnit())!=Player(PLAYER_NEUTRAL_PASSIVE)))),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false),(GetBooleanAnd((GetBooleanAnd((IsUnitDeadBJ(GetFilterUnit())==false),(GetUnitAbilityLevelSwapped('Avul',GetFilterUnit())!=1))),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(OG)))))))))!=null
endfunction
function OZR takes nothing returns nothing
set VQ=GetEnumUnit()
set EQ=GetUnitLoc(VQ)
set NG=AngleBetweenPoints(RG,EQ)
set VK=GetRandomReal(1000.,5000.)
call M6E((VQ),((500.)*1.),((1.)*1.),((NG)*1.),null,150.,false,false)
call UnitDamageTargetBJ(OG,VQ,VK,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call CreateTextTagLocBJ((I2S(R2I(VK))+"!"),EQ,0,12.,.0,.0,.0,0)
call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,5.)
call SetTextTagFadepointBJ(bj_lastCreatedTextTag,4)
call GroupRemoveUnit(IG,VQ)
endfunction
function O_R takes nothing returns nothing
set OG=GetSpellAbilityUnit()
set RG=GetUnitLoc(OG)
call AddSpecialEffectLocBJ(RG,"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set IG=CQE(400.,RG,Condition(function OYR))
set AG=CountUnitsInGroup(IG)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=AG
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call ForGroupBJ(C5E(1,IG),function OZR)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call DestroyGroup(IG)
call RemoveLocation(RG)
call RemoveLocation(EQ)
endfunction
function O1R takes nothing returns boolean
return(BG[1]==0)
endfunction
function O2R takes nothing returns nothing
if(O1R())then
call EnableTrigger(EHV)
endif
set BG[1]=(BG[1]+1)
set BG[2]=(BG[2]+1)
set CG[1]=GetUnitLoc(DG)
set FG[BG[2]]=DistanceBetweenPoints(CG[1],GG)
set HG[BG[2]]=.0
set JG[BG[2]]=KG
set LG[BG[2]]=DG
set MG[BG[2]]=AngleBetweenPoints(CG[1],GG)
set PG[BG[2]]=QG
set SG[BG[2]]=TG
set UG[BG[2]]=WG
set YG[BG[2]]=(ZG*FG[BG[2]])
call SetUnitPathing(DG,false)
call SetUnitTimeScalePercent(DG,(VH*100.))
call SetUnitAnimation(DG,TG)
call GroupAddUnit(EH,DG)
call UnitAddAbility(DG,'Arav')
call UnitRemoveAbility(DG,'Arav')
call RemoveLocation(CG[1])
endfunction
function O4R takes nothing returns boolean
return(BG[1]==0)
endfunction
function O5R takes nothing returns boolean
return(GetRandomInt(1,5)==1)
endfunction
function O6R takes nothing returns boolean
return(HG[BG[3]]<FG[BG[3]])
endfunction
function O7R takes nothing returns boolean
return(IsUnitInGroup(LG[BG[3]],EH))
endfunction
function O8R takes nothing returns nothing
set BG[3]=1
loop
exitwhen BG[3]>BG[2]
if(O7R())then
if(O6R())then
call QueueUnitAnimation(LG[BG[3]],SG[BG[3]])
set CG[1]=GetUnitLoc(LG[BG[3]])
set CG[2]=CNE(CG[1],JG[BG[3]],MG[BG[3]])
call SetUnitPositionLoc(LG[BG[3]],CG[2])
set HG[BG[3]]=(HG[BG[3]]+JG[BG[3]])
if(O5R())then
call AddSpecialEffectTargetUnitBJ("origin",LG[BG[3]],PG[BG[3]])
call DestroyEffect(bj_lastCreatedEffect)
endif
set XH[BG[3]]=(XH[BG[3]]+(180./(FG[BG[3]]/JG[BG[3]])))
set OH[BG[3]]=(SinBJ(XH[BG[3]])*YG[BG[3]])
call SetUnitFlyHeight(LG[BG[3]],OH[BG[3]],1000000000.)
call RemoveLocation(CG[1])
call RemoveLocation(CG[2])
else
call SetUnitPathing(LG[BG[3]],true)
call GroupRemoveUnit(EH,LG[BG[3]])
call SetUnitTimeScalePercent(LG[BG[3]],100.)
call ResetUnitAnimation(LG[BG[3]])
set XH[BG[3]]=.0
set BG[1]=(BG[1]-1)
if(O4R())then
set BG[2]=0
call CreateNUnitsAtLoc(1,'h00D',GetOwningPlayer(DG),GG,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A082')
call IssueImmediateOrderById(bj_lastCreatedUnit,852600)
call RemoveLocation(GG)
call DisableTrigger(GetTriggeringTrigger())
endif
endif
endif
set BG[3]=BG[3]+1
endloop
endfunction
function RVR takes nothing returns boolean
return(GetSpellAbilityId()=='A081')
endfunction
function RER takes nothing returns nothing
set ZG=.5
set WG=false
set RH=false
set GG=GetSpellTargetLoc()
set DG=GetTriggerUnit()
set KG=18.
set QG="war3mapImported\\NewAirEX.mdx"
set TG="attack"
set VH=.6
set IH=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'h00D',GetOwningPlayer(GetTriggerUnit()),IH,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(.01,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(IH)
call ConditionalTriggerExecute(EGV)
endfunction
function ROR takes nothing returns boolean
return((GetUnitAbilityLevelSwapped('A083',GetAttacker())==1)and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false))!=null and GetUnitTypeId(GetTriggerUnit()) != 'E00E'
endfunction
function RRR takes nothing returns boolean
return(ROR())
endfunction
function RIR takes nothing returns boolean
return(CountUnitsInGroup(AH)==0)
endfunction
function RAR takes nothing returns boolean
return(JH[NH]==3)
endfunction
function RNR takes nothing returns boolean
return(JH[NH]==2)
endfunction
function RBR takes nothing returns boolean
return(JH[NH]==1)
endfunction
function RCR takes nothing returns nothing
if(RIR())then
call EnableTrigger(ELV)
endif
call AddSpecialEffectTargetUnitBJ("weapon",GetAttacker(),"Abilities\\Weapons\\Rifle\\RifleImpact.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set NH=(NH+1)
set BH[NH]=GetAttacker()
set CH[NH]=GetTriggerUnit()
call GroupAddUnit(AH,CH[NH])
set DH[NH]=GetUnitLoc(BH[NH])
set FH[1]=GetUnitLoc(CH[NH])
set GH[NH]=AngleBetweenPoints(DH[NH],FH[1])
set HH[NH]=12.
set JH[NH]=3
if(RBR())then
set KH[NH]=150.
set LH[NH]=(KH[NH]/HH[NH])
else
if(RNR())then
set KH[NH]=250.
set LH[NH]=(KH[NH]/HH[NH])
else
if(RAR())then
set KH[NH]=350.
set LH[NH]=(KH[NH]/HH[NH])
endif
endif
endif
set BH[NH]=null
call RemoveLocation(DH[1])
endfunction
function RFR takes nothing returns boolean
return(GetRandomInt(1,6)==1)
endfunction
function RGR takes nothing returns boolean
return(CountUnitsInGroup(AH)==0)
endfunction
function RHR takes nothing returns boolean
return(KH[MH]<=3.)
endfunction
function Trig_Siphone_Blade_Loop_Func001Func001Func012001 takes nothing returns boolean
return(IsUnitType(CH[MH],UNIT_TYPE_STRUCTURE)!=true)!=null
endfunction
function Trig_Siphone_Blade_Loop_Func001Func001Func012002 takes nothing returns boolean
return(IsUnitType(CH[MH],UNIT_TYPE_FLYING)!=true)!=null
endfunction
function RJR takes nothing returns boolean
return((IsUnitInGroup(CH[MH],AH))and(GetBooleanAnd((IsUnitType(CH[MH],UNIT_TYPE_STRUCTURE)!=true),(IsUnitType(CH[MH],UNIT_TYPE_FLYING)!=true))))!=null
endfunction
function RKR takes nothing returns nothing
set MH=1
loop
exitwhen MH>NH
if(RJR())then
set FH[1]=GetUnitLoc(CH[MH])
set HH[MH]=(KH[MH]/LH[MH])
set HH[MH]=(HH[MH]+1)
set FH[2]=CNE(FH[1],HH[MH],GH[MH])
call SetUnitPositionLoc(CH[MH],FH[2])
if(RFR())then
call AddSpecialEffectLocBJ(FH[1],"Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endif
call RemoveLocation(DH[1])
call RemoveLocation(DH[2])
set KH[MH]=(KH[MH]-HH[MH])
if(RHR())then
call GroupRemoveUnit(AH,CH[MH])
set HH[MH]=.0
set JH[MH]=0
set KH[MH]=.0
set LH[MH]=.0
set GH[MH]=.0
call RemoveLocation(DH[MH])
set CH[MH]=null
if(RGR())then
set NH=0
call DisableTrigger(ELV)
endif
endif
endif
set MH=MH+1
endloop
endfunction
function RMR takes nothing returns boolean
return(GetSpellAbilityId()=='A087')
endfunction
function RPR takes nothing returns boolean
return(CountUnitsInGroup(PH)==0)
endfunction
function RQR takes nothing returns boolean
return(UH[QH]==3)
endfunction
function RSR takes nothing returns boolean
return(UH[QH]==2)
endfunction
function RTR takes nothing returns boolean
return(UH[QH]==1)
endfunction
function RUR takes nothing returns nothing
if(RPR())then
call EnableTrigger(EPV)
endif
set QH=(QH+1)
set SH[QH]=GetSpellAbilityUnit()
call SetUnitPathing(SH[QH],false)
set TH[1]=GetUnitLoc(SH[QH])
set UH[QH]=GetUnitAbilityLevelSwapped('A087',SH[QH])
set WH[QH]=22.
set YH[QH]=GetSpellTargetLoc()
set ZH[QH]=DistanceBetweenPoints(TH[1],YH[QH])
if(RTR())then
set VJ[QH]=1500.
else
if(RSR())then
set VJ[QH]=1500.
else
if(RQR())then
set VJ[QH]=1500.
endif
endif
endif
call GroupAddUnit(PH,SH[QH])
call RemoveLocation(TH[1])
endfunction
function RYR takes nothing returns boolean
return(GetRandomInt(0,101)<=5)
endfunction
function RZR takes nothing returns boolean
return(GetRandomInt(1,18)<=3)
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003001 takes nothing returns boolean
return(GetOwningPlayer(GetFilterUnit())!=GetOwningPlayer(SH[EJ]))
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003002002001 takes nothing returns boolean
return(IsUnitInGroup(GetFilterUnit(),OJ)==false)
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003002002002 takes nothing returns boolean
return(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(SH[EJ]))==false)
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003002002 takes nothing returns boolean
return GetBooleanAnd((IsUnitInGroup(GetFilterUnit(),OJ)==false),(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(SH[EJ]))==false))
endfunction
function Trig_Time_Travel_Loop_MUI_Func001Func001Func007002003002 takes nothing returns boolean
return GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitInGroup(GetFilterUnit(),OJ)==false),(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(SH[EJ]))==false))))
endfunction
function R_R takes nothing returns boolean
return GetBooleanAnd((GetOwningPlayer(GetFilterUnit())!=GetOwningPlayer(SH[EJ])),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitInGroup(GetFilterUnit(),OJ)==false),(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(SH[EJ]))==false))))))
endfunction
function R0R takes nothing returns nothing
call GroupAddUnit(OJ,GetEnumUnit())
call UnitDamageTargetBJ(SH[EJ],GetEnumUnit(),VJ[EJ],ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endfunction
function R1R takes nothing returns boolean
return(CountUnitsInGroup(PH)==0)
endfunction
function R2R takes nothing returns boolean
return(ZH[EJ]<=5.)
endfunction
function R3R takes nothing returns boolean
return(IsUnitInGroup(SH[EJ],PH))
endfunction
function R4R takes nothing returns nothing
set EJ=1
loop
exitwhen EJ>QH
if(R3R())then
set TH[1]=GetUnitLoc(SH[EJ])
set TH[2]=CNE(TH[1],WH[EJ],AngleBetweenPoints(TH[1],YH[EJ]))
call SetUnitPositionLoc(SH[EJ],TH[2])
if(RYR())then
call CreateNUnitsAtLoc(1,'h00C',GetOwningPlayer(SH[EJ]),TH[1],bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A04M')
call IssueImmediateOrderById(bj_lastCreatedUnit,852127)
endif
if(RZR())then
call CreateNUnitsAtLoc(1,'h00C',GetOwningPlayer(SH[EJ]),TH[1],bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(.01,'BTLF',bj_lastCreatedUnit)
endif
set XJ[EJ]=CQE(400.,TH[1],Condition(function R_R))
call ForGroupBJ(XJ[EJ],function R0R)
call DestroyGroup(XJ[EJ])
call RemoveLocation(TH[1])
call RemoveLocation(TH[2])
set ZH[EJ]=(ZH[EJ]-WH[EJ])
if(R2R())then
call GroupRemoveUnit(PH,SH[EJ])
set UH[EJ]=0
set ZH[EJ]=.0
call SetUnitPathing(SH[EJ],true)
set SH[EJ]=null
set WH[EJ]=.0
call RemoveLocation(YH[EJ])
if(R1R())then
set QH=0
call GroupClear(OJ)
call DisableTrigger(EPV)
endif
endif
endif
set EJ=EJ+1
endloop
endfunction
function R6R takes nothing returns boolean
return(GetSpellAbilityId()=='A04M')
endfunction
function R7R takes nothing returns boolean
return(RJ==0)
endfunction
function Trig_Split_Knock_On_Func018002003001 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(AJ[IJ]))) and GetUnitTypeId(GetFilterUnit()) != 'E00E'
endfunction
function Trig_Split_Knock_On_Func018002003002001 takes nothing returns boolean
return(IsUnitAliveBJ(GetFilterUnit()))
endfunction
function Trig_Split_Knock_On_Func018002003002002001 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false)!=null
endfunction
function Trig_Split_Knock_On_Func018002003002002002001 takes nothing returns boolean
return(GetPlayerController(GetOwningPlayer(GetFilterUnit()))!=GetPlayerController(Player(PLAYER_NEUTRAL_PASSIVE)))
endfunction
function Trig_Split_Knock_On_Func018002003002002002002 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)!=null
endfunction
function Trig_Split_Knock_On_Func018002003002002002 takes nothing returns boolean
return(GetBooleanAnd((GetPlayerController(GetOwningPlayer(GetFilterUnit()))!=GetPlayerController(Player(PLAYER_NEUTRAL_PASSIVE))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)))!=null
endfunction
function Trig_Split_Knock_On_Func018002003002002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false),(GetBooleanAnd((GetPlayerController(GetOwningPlayer(GetFilterUnit()))!=GetPlayerController(Player(PLAYER_NEUTRAL_PASSIVE))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)))))!=null
endfunction
function Trig_Split_Knock_On_Func018002003002 takes nothing returns boolean
return(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false),(GetBooleanAnd((GetPlayerController(GetOwningPlayer(GetFilterUnit()))!=GetPlayerController(Player(PLAYER_NEUTRAL_PASSIVE))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)))))))!=null
endfunction
function R8R takes nothing returns boolean
return(GetBooleanAnd((IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(AJ[IJ]))),(GetBooleanAnd((IsUnitAliveBJ(GetFilterUnit())),(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false),(GetBooleanAnd((GetPlayerController(GetOwningPlayer(GetFilterUnit()))!=GetPlayerController(Player(PLAYER_NEUTRAL_PASSIVE))),(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)))))))))!=null
endfunction
function R9R takes nothing returns nothing
if(R7R())then
call EnableTrigger(ESV)
endif
set IJ=(IJ+1)
set RJ=(RJ+1)
set AJ[IJ]=GetSpellAbilityUnit()
set NJ[IJ]=GetUnitLoc(AJ[IJ])
set BJ[IJ]=200.
set CJ[IJ]=9.
set DJ[IJ]=(BJ[IJ]/CJ[IJ])
set FJ[IJ]=CQE(275.,NJ[IJ],Condition(function R8R))
endfunction
function IER takes nothing returns boolean
return(GetRandomInt(1,6)==3)
endfunction
function IXR takes nothing returns nothing
set HJ[1]=GetUnitLoc(GetEnumUnit())
set CJ[GJ]=(BJ[GJ]/DJ[GJ])
set CJ[GJ]=(CJ[GJ]+.5)
set HJ[2]=CNE(HJ[1],CJ[GJ],AngleBetweenPoints(NJ[GJ],HJ[1]))
call SetUnitPositionLoc(GetEnumUnit(),HJ[2])
if(IER())then
call AddSpecialEffectTargetUnitBJ("origin",GetEnumUnit(),"Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
endif
call RemoveLocation(HJ[1])
call RemoveLocation(HJ[2])
endfunction
function IOR takes nothing returns boolean
return(RJ==0)
endfunction
function IRR takes nothing returns boolean
return(BJ[GJ]<=.0)
endfunction
function IIR takes nothing returns nothing
set GJ=1
loop
exitwhen GJ>IJ
if(IRR())then
call DestroyGroup(FJ[GJ])
set AJ[GJ]=null
set BJ[GJ]=.0
set DJ[GJ]=.0
set CJ[GJ]=.0
call RemoveLocation(NJ[GJ])
set RJ=(RJ-1)
if(IOR())then
set IJ=0
call DisableTrigger(ESV)
endif
else
call ForGroupBJ(FJ[GJ],function IXR)
endif
set BJ[GJ]=(BJ[GJ]-CJ[GJ])
set GJ=GJ+1
endloop
endfunction
function INR takes nothing returns boolean
return(QT[bj_forLoopAIndex]>0)
endfunction
function IBR takes nothing returns boolean
return(QT[bj_forLoopAIndex]>1)
endfunction
function ICR takes nothing returns boolean
return(QT[bj_forLoopAIndex]>2)
endfunction
function IDR takes nothing returns boolean
return(QT[bj_forLoopAIndex]>3)
endfunction
function IFR takes nothing returns boolean
return(QT[bj_forLoopAIndex]>4)
endfunction
function IGR takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=40
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set QT[bj_forLoopAIndex]=GetRandomInt(0,XT)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=40
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(INR())then
set PT[bj_forLoopAIndex]=LT[GetRandomInt(1,28)]
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=41
set bj_forLoopAIndexEnd=80
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(IBR())then
set PT[bj_forLoopAIndex]=LT[GetRandomInt(1,28)]
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=81
set bj_forLoopAIndexEnd=120
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(ICR())then
set PT[bj_forLoopAIndex]=LT[GetRandomInt(1,28)]
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=121
set bj_forLoopAIndexEnd=160
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(IDR())then
set PT[bj_forLoopAIndex]=LT[GetRandomInt(1,28)]
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=161
set bj_forLoopAIndexEnd=200
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(IFR())then
set PT[bj_forLoopAIndex]=LT[GetRandomInt(1,28)]
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function IJR takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,30,s)
endfunction
function IJR2 takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,75,s)
endfunction
function IJR3 takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,150,s)
endfunction
function IKR takes nothing returns nothing
call IJR("Error: |cff00baffEasy|r difficulty can only be voted upon.")
endfunction
function ILR takes nothing returns nothing
if XT==0 then
call IJR("Red has chosen |cff1ab700Normal|r.")
set XT=2
endif
endfunction
function IMR takes nothing returns nothing
if XT==0 then
call IJR("Red has chosen |cfff6ff00Hard|r difficulty, Commanders are Hard difficulty and all offensive spells are enabled.")
set XT=3
endif
endfunction
function IPR takes nothing returns nothing
if XT==0 then
if not BRTON then
set XT=4
call IJR("Red has chosen |cFFFE8A0ENightmare|r difficulty, Commanders are Nightmarish...")
else
call IJR("Error: |cFFFE8A0ENightmare|r difficulty can only be set in non-Boss Rush games; otherwise it must be voted upon.")
endif
endif
endfunction
function IQR takes nothing returns nothing
call IJR("Error: |cffaa0000Hell|r difficulty can only be voted upon.")
endfunction
function IQRQQ takes nothing returns nothing
if GAMEM then
if not BRTON then
if not LWMON then
call IJR("Red has chosen |cffaa0000Boss Rush|r, prepare to die, fail, and die again...")
set BRTON=true
else
call IJR("Error: |cffaa0000Boss Rush|r is incompatible with Line Wars mode. Please turn off Line Wars if you wish to enable Boss Rush.")
endif
else
call IJR("Red has disabled |cffaa0000Boss Rush|r, only one Commander will spawn per round.")
set BRTON=false
endif
endif
endfunction
function IQRQ1 takes nothing returns nothing
if GAMEM then
if not NOOBM then
call IJR("Red has chosen |cff00baffCommander Promotions|r, normal creeps will be promoted to Commanders when they kill a hero.")
set NOOBM=true
else
call IJR("Red has disabled |cff00baffCommander Promotions|r, normal creeps will not be promoted to Commanders when they kill a hero.")
set NOOBM=false
endif
endif
endfunction
function IQRQ11 takes nothing returns nothing
if GAMEM then
if not TRUEENFOS then
call IJR("Red has chosen |c00000000T|r|c00001A1Ar|r|c00003333u|r|c00004D4De|r|c00006666 |r|c00008080E|r|c00208080n|r|c00408080f|r|c00608080o|r|c00808080s|r, welcome to the definitive Enfos FFB experience! |cff00baffCommander Promotions|r are enabled, and certain enemy mechanics have been upgraded to actually be a challenge. You can type -cp to turn off |cff00baffCommander Promotions|r if it's too much for you.")
set TRUEENFOS=true
set NOOBM=true
else
call IJR("Red has disabled |c00000000T|r|c00001A1Ar|r|c00003333u|r|c00004D4De|r|c00006666 |r|c00008080E|r|c00208080n|r|c00408080f|r|c00608080o|r|c00808080s|r. :( |cff00baffCommander Promotions|r has been disabled. Creeps are easiser. GLFH.")
set TRUEENFOS=false
set NOOBM=false
endif
endif
endfunction
function IQRQ2 takes nothing returns nothing
//if FLAGREMATCH then
//call IJR("Error: Stats are already being recorded for this match.")
//else
//call IJR("Stats will now be recorded for this match.")
//set FLAGREMATCH=true
//endif
endfunction
function IQRQ3 takes nothing returns nothing
local unit u
local integer i =0
if GAMEM then
if not LWMON then
call IJR("Red has chosen |cff00baffLine Wars|r, unit spawning buildings have been created for all players.")
call IJR("You must use these buildings to send units to the other side for income.")
call IJR("In this mode, death will not patrol the no man's land between the two sides.")
call IJR("Red can now choose a starting income between 5 and 200 by typing -StartingIncome XXX (Default 30)")
set LWMON=true
call ForForce(bj_FORCE_ALL_PLAYERS,function ZSO)
//call MultiboardSetItemWidthBJ( AS[1], 2, 1, 12.00 )
//call MultiboardSetItemWidthBJ( AS[2], 2, 1, 12.00 )
call MultiboardSetItemValueBJ(AS[1],2,1,(BS[9]+"$$$|r"))
call MultiboardSetItemValueBJ(AS[2],2,1,(BS[9]+"$$$|r"))
if BRTON then
call IJR("|cffaa0000Boss Rush|r has been disabled.")
set BRTON=false
endif
loop
exitwhen i==12
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i)) != MAP_CONTROL_COMPUTER then
set u = CreateUnit(Player(i),'H014',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(i),'H015',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(i),'H016',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
set u = CreateUnit(Player(i),'H013',0.,-5000.,0.)
call SetHeroLevel(u,300,false)
set u = null
endif
set i = i +1
endloop
else
call IJR("Red has disabled |cff00baffLine Wars|r, a normal Enfo's round will commence.")
call GroupEnumUnitsInRange(UNIT_SPAWNERS_GROUP,0.,0.,99999.,function RemoveUnitSpawners)
set LWMON=false
call ForForce(bj_FORCE_ALL_PLAYERS,function MQO)
call MultiboardSetItemValueBJ(AS[1],2,1,(BS[9]+"L|r"))
call MultiboardSetItemValueBJ(AS[2],2,1,(BS[9]+"L|r"))
endif
endif
set u = null
endfunction
function IQRQ4 takes nothing returns nothing
if GAMEM then
call IJR("Red has reset modes; Boss Rush, True Enfos Line Wars, Speedy Creeps, and Commander Promotions modes have been turned off.")
set NOOBM=true
set BRTON=false
set TRUEENFOS = false
if SpeedyGonzalez!=null then
call RemoveUnit(SpeedyGonzalez)
set SpeedyGonzalez=null
endif
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
if LWMON then
call MultiboardSetItemValueBJ(AS[1],2,1,(BS[9]+"L|r"))
call MultiboardSetItemValueBJ(AS[2],2,1,(BS[9]+"L|r"))
call GroupEnumUnitsInRange(UNIT_SPAWNERS_GROUP,0.,0.,99999.,function RemoveUnitSpawners)
call ForForce(bj_FORCE_ALL_PLAYERS,function MQO)
set LWMON=false
endif
endif
endfunction
function IQRQ5 takes nothing returns nothing
if GAMEM then
if SpeedyGonzalez==null then
set SpeedyGonzalez=CreateUnit(Player(0),'o006',0.,0.,0.)
call IJR("Red has enabled Speedy Creeps, creeps will move incredibly fast.")
else
call IJR("Red has disabled Speedy Creeps, creeps will move at normal speed.")
call RemoveUnit(SpeedyGonzalez)
set SpeedyGonzalez=null
endif
endif
endfunction
function RANDOMOVEFUNCTION takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit()) == 'ushd' and (GetIssuedOrderId()==851971 or GetIssuedOrderId()==851986 or GetIssuedOrderId()==851990) then
call SetUnitX(GetTriggerUnit(),1280.)
call SetUnitY(GetTriggerUnit(),-3840.)
endif
return false
endfunction
function RANDOMFILTER takes nothing returns boolean
if GetUnitTypeId(GetFilterUnit()) == 'ushd' then
call SetUnitX(GetFilterUnit(),1280.)
call SetUnitY(GetFilterUnit(),-3840.)
endif
return false
endfunction
function LETSGOALLRANDOM takes nothing returns nothing
call GroupEnumUnitsInRect(RANDOMGROUP,GetPlayableMapRect(),Filter(function RANDOMFILTER))
endfunction
function IQRQ6 takes nothing returns nothing
if GAMEM then
if ALLRANDOM == false then
set ALLRANDOM = true
call IJR("Red has chosen |c00FF0101A|r|c00FF900Fl|r|c00FEC808l|r|c00FEFF01 |r|c008FDF00R|r|c0021C000a|r|c0001BBFFn|r|c00025EFFd|r|c000201FFo|r|c007F0080m|r. Enjoy the 30 potions and have fun! If you would like to random an advanced hero promote yourself.")
call LETSGOALLRANDOM()
set RANDOMOVE=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(RANDOMOVE,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterAnyUnitEventBJ(RANDOMOVE,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition(RANDOMOVE,Condition(function RANDOMOVEFUNCTION))
endif
endif
endfunction
function IQRQ7 takes nothing returns nothing
if GAMEM then
if SOCIALWELFARE==false then
set SOCIALWELFARE=true
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has enabled |cffffd700Social Welfare|r, 50% of kill bounty is shared with the rest of the team.")
else
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has disabled |cffffd700Social Welfare|r, kill bounty is restored to default.")
endif
endif
endfunction
function IQRQ8 takes nothing returns nothing
if GAMEM then
if TRUECOMMUNISM==false then
set SOCIALWELFARE=false
set TRUECOMMUNISM=true
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has enabled |cffffd700True Communism|r, 100% of kill bounty is shared with the rest of the team. Hail, Comrade!")
else
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has disabled |cffffd700True Communism|r, kill bounty is restored to default.")
endif
endif
endfunction
function IQRQ9 takes nothing returns nothing
if GAMEM then
if PRODICT==false then
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=true
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has enabled |cffffd700Proletarian Dictatorship|r, 10% of kill bounty is shared with the rest of the team.")
else
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has disabled |cffffd700Proletarian Dictatorship|r, kill bounty is restored to default.")
endif
endif
endfunction
function IQRQ99 takes nothing returns nothing
if GAMEM then
if NOBOUNTY==false then
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=true
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has enabled |cffffd700No Bountyr, enemies will not give any gold bounty.")
else
set SOCIALWELFARE=false
set TRUECOMMUNISM=false
set PRODICT=false
set NOBOUNTY=false
call ForForce(C_E(MAP_CONTROL_COMPUTER),function MAO)
call IJR("Red has disabled |cffffd700No Bounty|r, kill bounty is restored to default.")
endif
endif
endfunction
function IQRQ999 takes nothing returns nothing
if GAMEM then
if REDUCEDBOUNTY==false then
set REDUCEDBOUNTY=true
call IJR("Red has enabled |cffffd700Reduced Bounty|r, enemies will now give 75% the gold bounty.")
else
set REDUCEDBOUNTY=false
call IJR("Red has disabled |cffffd700Reduced Bounty|r, kill bounty is restored to 100%.")
endif
endif
endfunction
function WarmUpRandom takes nothing returns nothing
local integer i = 0
local integer warmCount = 50 + R2I(GetRandomReal(1.,100.) * 100)
loop
exitwhen i >= warmCount
call GetRandomInt(1, 100) // dummy call; we ignore the result.
set i = i + 1
endloop
endfunction
function IQRQ99991234 takes nothing returns nothing
// Arrays holding rawcodes (integers). Single quotes produce rawcodes.
local integer array randomwaveson
local integer array randomwavesoncommander
local integer array numberused
// Arrays holding text (names and descriptions)
//local string array DT
//local string array NT
// Loop counters
local integer r = 0
local integer i = 1
if GAMEM then
if RANDOMWAVEON == false then
set RANDOMWAVEON = true
call IJR("Red has enabled |cFFFF0303R|r|cFF1EE231a|r|cFF46B783n|r|cFFF7073Ad|r|cFFDAB425o|r|cFF0042FFm|r|cFF0A77BA |r|cFF8000FFW|r|cFF90EE11a|r|cFFE2FF00v|r|cFFFF009De|r|cFFDAB425s|r, waves will now be randomized!")
call WarmUpRandom()
// --------------------------------------------------------------------
// 1) Define your basic creep rawcodes
// --------------------------------------------------------------------
set randomwaveson[1] = 'n020'
set randomwaveson[2] = 'n02G'
set randomwaveson[3] = 'n01Y'
set randomwaveson[4] = 'n02W'
set randomwaveson[5] = 'n024'
set randomwaveson[6] = 'n022'
set randomwaveson[7] = 'n03F'
set randomwaveson[8] = 'n02E'
set randomwaveson[9] = 'e00Z'
set randomwaveson[10] = 'n03O'
set randomwaveson[11] = 'n028'
set randomwaveson[12] = 'n02U'
set randomwaveson[13] = 'n039'
set randomwaveson[14] = 'n02A'
set randomwaveson[15] = 'n030'
set randomwaveson[16] = 'n02S'
set randomwaveson[17] = 'n02Q'
set randomwaveson[18] = 'n01W'
set randomwaveson[19] = 'n03L'
set randomwaveson[20] = 'n03Q'
set randomwaveson[21] = 'n02M'
set randomwaveson[22] = 'n03G'
set randomwaveson[23] = 'n02K'
set randomwaveson[24] = 'n03D'
set randomwaveson[25] = 'n02I'
set randomwaveson[26] = 'n02C'
set randomwaveson[27] = 'n02Y'
set randomwaveson[28] = 'n037'
set randomwaveson[29] = 'n026'
set randomwaveson[30] = 'n01U'
set randomwaveson[31] = 'n03B'
set randomwaveson[32] = 'e00G'
set randomwaveson[33] = 'n03R'
set randomwaveson[34] = 'n02O'
set randomwaveson[35] = 'u00R'
set randomwaveson[36] = 'u00V'
set randomwaveson[37] = 'u00W'
set randomwaveson[38] = 'u00P'
set randomwaveson[39] = 'u00U'
set randomwaveson[40] = 'n042'
// --------------------------------------------------------------------
// 2) Define your commander rawcodes
// --------------------------------------------------------------------
set randomwavesoncommander[1] = 'n021'
set randomwavesoncommander[2] = 'n02H'
set randomwavesoncommander[3] = 'n01Z'
set randomwavesoncommander[4] = 'n02X'
set randomwavesoncommander[5] = 'n025'
set randomwavesoncommander[6] = 'n023'
set randomwavesoncommander[7] = 'n03H'
set randomwavesoncommander[8] = 'n02F'
set randomwavesoncommander[9] = 'e01S'
set randomwavesoncommander[10] = 'n03P'
set randomwavesoncommander[11] = 'n029'
set randomwavesoncommander[12] = 'n02V'
set randomwavesoncommander[13] = 'n03A'
set randomwavesoncommander[14] = 'n02B'
set randomwavesoncommander[15] = 'n031'
set randomwavesoncommander[16] = 'n02T'
set randomwavesoncommander[17] = 'n02R'
set randomwavesoncommander[18] = 'n01X'
set randomwavesoncommander[19] = 'n03N'
set randomwavesoncommander[20] = 'n03S'
set randomwavesoncommander[21] = 'n02N'
set randomwavesoncommander[22] = 'n03J'
set randomwavesoncommander[23] = 'n02L'
set randomwavesoncommander[24] = 'n03E'
set randomwavesoncommander[25] = 'n02J'
set randomwavesoncommander[26] = 'n02D'
set randomwavesoncommander[27] = 'n02Z'
set randomwavesoncommander[28] = 'n038'
set randomwavesoncommander[29] = 'n027'
set randomwavesoncommander[30] = 'n01V'
set randomwavesoncommander[31] = 'n03C'
set randomwavesoncommander[32] = 'e00X'
set randomwavesoncommander[33] = 'n03T'
set randomwavesoncommander[34] = 'n02P'
set randomwavesoncommander[35] = 'u00S'
set randomwavesoncommander[36] = 'u00X'
set randomwavesoncommander[37] = 'u00Y'
set randomwavesoncommander[38] = 'u00Q'
set randomwavesoncommander[39] = 'u00T'
set randomwavesoncommander[40] = 'n043'
set NT[1]="Crabs are peaceful creatures that generally don't do a lot, although they are capable of |cffee0000leaping|r towards you at high speeds, which grants them a temporary attack and movement speed boost. Their commander passively |cffee0000drains|r the mana of nearby heroes."
set NT[2]="Gnolls are small melee warriors, wearing heavy armor. They are capable of |cffee0000leaping|r towards you at high speeds, which grants them a temporary attack and movement speed boost. Their commander has a medium-range armor reducing attack, and is capable of |cffee0000Berserk|r; gaining a massive attack and movespeed burst, as well as the ability to scale walls. His |cffee0000Backstab|r ability allows him to deal double damage if he hits you from behind, so running away from him is not advised."
set NT[3]="Crazed Madmen are axe wielding melee units. Their commander uses a spear to attack |cffee0000Multiple Enemies|r from a very long range. His |cffee0000Trueshot Aura|r provides him with a massive damage boost, beware!"
set NT[4]="Wild Boars are feral beasts, able to increase their attack speed at will. Their commander is able to |cffee0000Revive|r himself if not killed fast enough. He is also able to heal his allies, has massive damage and spell reduction, as well as |cffee0000Berserk|r, |cffee0000Lesser Fury Swipes|r, and |cffee0000Deals damage to melee attackers|r."
set NT[5]="Wood Trolls have a stackable slow poison attack. Their leader is able cast |cffee0000Wrath of the Ancients,|r a powerful summoning spell. It is recommended that he is dealt with as soon as possible, of you will quickly find yourself overwhelmed.. If the commander is slain, the trees will lose the source of their power, and thusly lose their poisonous attacks."
set NT[6]="Faenrae Reaver are |cffee0000permanently invisible|r while their commander is alive, so some means of seeing invisible is advised. Faenrae Reavers are extremely gifted assassins, having mastered the art of backstabbing. Their commander has an armor-reducing attack, Vampiric Aura, and |cffee0000Berserk|r."
set NT[7]="Blood Wolves are cute, fluffy creatures capable of feasting on your insides to regain their health. Their commander has |cffee0000Feedback, Vampiric Aura, Berserk, Blood Scent|r, which grants a massive attack speed boost to nearby units, and |cffee0000Critical Wound|r, allowing him to score heavy critical hits."
set NT[8]="Engorged Blood Spiders Spiders are easily capable of swarming you if not careful, with their deadly |cffee0000Leaping Strikes|r, which temporarily increaes their attack and movement speed. They are also capable of laying eggs with which to |cffee0000toss|r at you. Their commander attacks by shooting sticky strands of |cffee0000Web|r at you. If they connect, they will stick to you and throw you haphazardly around, dealing 20% of your current health as damage and slowing for 3 seconds. Be sure to avoid being trapped, or it will hit you very easily! The commander can also spawn eggsacks, which will spawn more spiders when killed."
set NT[9]="The Rock Trolls are heavy trolls, made of rock.They possess |cffee0000Leaping Strikes|r, and their massive bulk allows them to |cffee0000possess 80% Magic and Spell Reduction|r. Their commander grants all units in range a |cffee0000major|r armor and |cffee0000regeneration|r bonus, while he himself has additional damage reduction against attacks, |cffee0000spell and magic resistance|r, and |cffee00005% Maximum Health Regeneration|r. His hits are also capable of |cffee0000knocking you back|r, and he is protected by an |cffee0000Evil Angel|r, which gives him a chance to avoid taking fatal damage, instead converting the damage into a heal."
set NT[10]="Diseased Bears are cute, furry animals; able to knock you back if they hit you. They have evasion, and gain increased speed from their commander, who has |cffee000080% Evasion|r and |cffee000020% Max Health Regeneration|r."
set NT[11]="Dark Fiends have a cleaving attack. Their commander is graced by many auras, including |cffee0000Blood Scent|r and Vampiric Aura, which enhance the fiends' capabilities greatly. In addition, he has a devastating |cffee0000Mind Rip|r that will decimate your mana, can |cffee0000Reincarnate|r, and is protected by an |cffee0000Evil Angel|r."
set NT[12]="Snowbeasts are fluffy beasts that are just...freaking adorable! Due to their overwhelming cuteness, they are all protected by |cffee0000Guardian Angels|r. Their ultra-cute Commander also has a |cffee0000Healing Aura|r."
set NT[13]="Lesser Sluaghs are not to be underestimated because of their low damage. They will score a critical strike on almost every attack. Their commander has |cffee0000Multishot|r and is able to |cffee0000slow|r you a lot, so don't get caught in the middle!"
set NT[14]="Arbelogs can bash your head in, stunning you for a short duration. Their commander is extremely fast and deadly, able to decimate you in mere seconds, with his arsenal of |cffee0000Overpower|r,Vampiric Aura, Bash, and |cffee0000Fury Swipes|r, which amplifies the damage he deals with each strike. However, this commander is easily tired, and its movement speed slows down considerably the lower its health is."
set NT[15]="Moss Meys are the worst nightmare for mages. They have a slowing attack, as well as |cffee0000Backstab|r, which is absolutely deadly combined with their |cffee0000Leaping Strikes|r. Their commander drains mana from a wide range. Their commander also has high evasion, making it hard for melee heroes to take her down."
set NT[16]="Swamp Trolls has high magic resistance while their commander is alive. They are also able to dispel positive and negative buffs. In addition to a |cffee0000healing|r and armor aura, their Commander has |cffee000090% Ranged and Spell Reduction|r, and the sheer force of his blows can |cffee0000knock you back|r."
set NT[17]="Young Ogres have big clubs, and are able to ignore your armor with their |cffee0000Pulverize|r ability. Their Commander is able to enhance his fellow Ogres with his Command and Endurance Auras, is protected by a |cffee0000Guardian Angel|r, and never misses with his |cffee0000Spirit Strike|r, whhich also grants him 1.4x damage on his attacks."
set NT[18]="Trolls are able to run through walls, and bash your head in. They are very fast and deadly, be careful! Their commander is also able to |cffee0000critically wound|r his enemies."
set NT[19]="Small Peccaries have Evasion and |cffee0000Spirit Strike|r, which lets them deal 140% normal damage on every attack, that will never miss. Their leader has the deadly |cffee0000Armor Crush|r and |cffee0000Berserk|r, as well as |cffee0000Vampiric Aura|r and |cffee000090% Ranged and Spell Reduction|r."
set NT[20]="Giant Thicket Vipers possess a short ranged poison attack and evasion. Their commander has High Evasion and |cffee0000Corruption Aura|r, which decreases the armor of nearby enemy units."
set NT[21]="Yvhh la'tamis are known for their |cffee0000stuns|r. Their commander has a healing aura and a mana regeneration aura, increasing the rate his allies can stun at. In addition, he has a devastating |cffee0000Glacial Aura|r, that severely slows nearby enemies."
set NT[22]="Giant Leucros are yet another wolf race. They have Critical Strike and |cffee0000Berserk|r, and their commander has the deadly |cffee0000Armor Crush|r, |cffee0000Berserk|r, and |cffee0000Feedback|r combo, as well as |cffee0000Blood Scent|r and Vampiric Aura."
set NT[23]="Frost Wyrms have a medium ranged attack, as well as |cffee0000Curse|r. Their leader has a devastating |cffee0000Mind Rip|r and high Evasion."
set NT[24]="Death Spirits can slow you with cold arrows and heal their allies with Healing Wave, while |cffee0000Purging|r you and burning your mana. Their leader has |cffee0000Berserk|r and Frost Shield, as well as |cffee0000Corruption Aura|r."
set NT[25]="Rock Guardians can knock you back and |cffee0000possess 80% Magic and Spell Reduction|r. Their commander has |cffee0000Spell and Ranged Attack Immunity|r, is protected by a |cffee0000Guardian Angel|r, and his blows can |cffee0000knock you back|r."
set NT[26]="Pirates are invisible, and have an armor ignoring Pulverize, in addition to |cffee0000Fury Swipes|r. Their leader has spell damage reduction."
set NT[27]="Skeletal Sailors are strong warriors with |cffee0000Feedback|r and Evasion. Their commander has |cffee0000Curse|r, as well as the feared |cffee0000Armor Crush|r."
set NT[28]="Marbled Angiswaerds have thorns granted by their commander, as well as |cffee0000possessing 80% Magic and Spell Reduction|r. However, if their commander is slain, they will lose their thorns. Their commander can |cffee0000can Deflect Projectiles|r."
set NT[29]="Adan'f Blood Warriors possess a lethal Poison Sting, which deals stackable damage per second. Their Commander has |cffee0000Armor Crush|r, |cffee0000Berserk, |cffee0000Evil Angel|r, and a devastating |cffee0000Mind Rip|r."
set NT[30]="Zombie Nomads are the precursors to your demise, with a |cffee0000Vile Poison attack|r and |cffee0000Leaping Strikes|r. Their commander is protected by an |cffee0000Evil Angel|r."
set NT[31]="Adan'f Shadow Mages can |cffee0000Cripple|r you severely. Their Commander has |cffee0000Curse|r, a devastating |cffee0000Mind Rip|r, can cast |cffee0000Unholy Frenzy|r on his minions, granting them a major attack speed boost. He also wields deadly death magic in the form of |cffee0000Death Bolt|r."
set NT[32]="Lun'Shele Hunters possess a stackable poison attack, and their commander has various attack speed buffs and auras, in addition to |cffee0000Berserk|r and |cffee0000Shattering Arrows|r, which pernamently reduces the armor of units struck by her. When slain, you will recover your lost armor points."
set NT[33]="Kra'hei have very high |cffee0000Spell Reduction|r and |cffee0000Spirit Strike|r. Their leader also has the Endurance and Command Auras, as well as the feared |cffee0000Armor Crush|r. In addition, he is protected by a |cffee0000Guardian angel|r."
set NT[34]="Poloh'izh are permanently invisible, possess Evasion, and are capable of |cffee0000Backstab|rbing you in addition to their |cffee0000Leaping Strikes|r. Their Commander can |cffee0000Mind Rip|r and |cffee0000Curse|r you."
set NT[35]="Misshapen Germish'din have nothing special. Their leader possesses |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r."
set NT[36]="Armored Warklins have Spell Damage Reduction and |cffee0000Thorns|r. Their commander has an armor-reducing attack."
set NT[37]="Warklin Maulers have high Spell and Damage Reduction."
set NT[38]="S'sugi Malchata have a |cffee0000stackable poison|r attack, |cffee0000Leaping Strikes|r, and |cffee0000Lifesteal|r."
set NT[39]="What? Still not dead yet? Here, have an |cffee0000Armor Crushing|r Snaer Hafwa commander! Her minions possess a slowing attack and |cffee0000Mind Rip|r."
set NT[40]="Penguin Cutpurses possess |cffee0000Pilfering Paws|r, allowing them to steal gold on hit. After stealing enough gold, they will attempt to escape into the goal. Kill them to reclaim your gold! Their commander possess |cffee000080% Evasion|r, |cffee0000Unholy Aura|r, |cffee0000Endurance Aura|r, and |cffee0000throws very tasty fish|r at you, how kind of them! Unfortunately, this fish tends to |cffee0000attract sharks|r..."
set DT[1]="|cff00baffCrabs|r"
set DT[2]="|cff00baffGnolls|r"
set DT[3]="|cff00baffCrazed Madman|r"
set DT[4]="|cff00baffBoar Enforcer|r"
set DT[5]="|cff00baffWood Troll|r"
set DT[6]="|cff00baffSatyr Reaver|r"
set DT[7]="|cff00baffBlood Wolf|r"
set DT[8]="|cff00baffEngorged Blood Spider|r"
set DT[9]="|cff00baffFlesh Giant|r"
set DT[10]="|cff00baffDiseased Bear|r"
set DT[11]="|cff00baffFrenetic Demon|r"
set DT[12]="|cff00baffBaby Cubble Bear|r"
set DT[13]="|cff00baffTainted Sluagh|r"
set DT[14]="|cff00baffVampire|r"
set DT[15]="|cff00baffMoss Mey|r"
set DT[16]="|cff00baffRisen Stone|r"
set DT[17]="|cff00baffOgre Gladiator|r"
set DT[18]="|cff00baffBlood Troll Amazoness|r"
set DT[19]="|cff00baffSavage Peccary|r"
set DT[20]="|cff00baffLesser Crystal Dragon|r"
set DT[21]="|cff00baffYvhh la'tami|r"
set DT[22]="|cff00baffBlood Leucro|r"
set DT[23]="|cff00baffFrostwyrm|r"
set DT[24]="|cff00baffDeath Spirit|r"
set DT[25]="|cff00baffDivine Rock|r"
set DT[26]="|cff00baffSea King|r"
set DT[27]="|cff00baffSkeletal Royal|r"
set DT[28]="|cff00baffBlood Marbled Angiswaerd|r"
set DT[29]="|cff00baffAdan'f Blood Warrior|r"
set DT[30]="|cff00baffZombie Necros|r"
set DT[31]="|cff00baffAdan'f War Mage|r"
set DT[32]="|cff00baffLun'Shele Deceiver|r"
set DT[33]="|cff00baffDoom Kra'hei|r"
set DT[34]="|cff00baffPoloh'izh Assassin|r"
set DT[35]="|cff00baffMisshapen Gremish'din|r"
set DT[36]="|cff00baffFanciful Aberration|r"
set DT[37]="|cff00baffForsaken Ouroboros|r"
set DT[38]="|cff00baffS'sugi Malchata|r"
set DT[39]="|cff00baffSnaer Hafwa|r"
set DT[40]="|cff00baffPenguin Cutpurse|r"
// --------------------------------------------------------------------
// 4) Initialize the numberused array to 0 (unused) for indices 1 to 40.
// --------------------------------------------------------------------
set i = 1
loop
exitwhen i > 40
set numberused[i] = 0
set i = i + 1
endloop
// --------------------------------------------------------------------
// 5) Randomly assign each final wave slot a matching set of data.
// --------------------------------------------------------------------
set i = 1
loop
exitwhen i > 40
loop
set r = GetRandomInt(1, 40)
exitwhen numberused[r] == 0
endloop
set MC[i] = randomwaveson[r]
set PK[i] = randomwavesoncommander[r]
set DT[i] = DT[r]
set NT[i] = NT[r]
set numberused[r] = 1
set i = i + 1
endloop
else
set RANDOMWAVEON = false
call IJR("Red has disabled |cFFFF0303R|r|cFF1EE231a|r|cFF46B783n|r|cFFF7073Ad|r|cFFDAB425o|r|cFF0042FFm|r|cFF0A77BA |r|cFF8000FFW|r|cFF90EE11a|r|cFFE2FF00v|r|cFFFF009De|r|cFFDAB425s|r, waves will now no longer be randomized!")
set DT[1]="|cff00baffCrabs|r"
set DT[2]="|cff00baffGnolls|r"
set DT[3]="|cff00baffCrazed Madman|r"
set DT[4]="|cff00baffBoar Enforcer|r"
set DT[5]="|cff00baffWood Troll|r"
set DT[6]="|cff00baffSatyr Reaver|r"
set DT[7]="|cff00baffBlood Wolf|r"
set DT[8]="|cff00baffEngorged Blood Spider|r"
set DT[9]="|cff00baffFlesh Giant|r"
if GetRandomInt(1,100) <= 50 then
set DT[10]="|cff00baffDiseased Bear|r"
set MC[10]='n03O'
set PK[10]='n03P'
set NT[10]="Diseased Bears have a tendency to |cffee0000Maul|r enemies in a line. They also have |cffee0000Evasion|r and |cffee0000Disease Cloud|r, and their Commander has |cffee000080% Evasion|r and |cffee000020% Max Health Regeneration|r. It also has |cffee0000Endurance Aura|r and |cffee0000Flat Thorns|r."
else
set DT[10]="|cff00baffPenguin Cutpurse|r"
set MC[10]='n042'
set PK[10]='n043'
set NT[10]="Penguin Cutpurses possess |cffee0000Pilfering Paws|r, allowing them to steal gold on hit. After stealing enough gold, they will attempt to escape into the goal. Kill them to reclaim your gold! Their commander possess |cffee000080% Evasion|r, |cffee0000Unholy Aura|r, |cffee0000Endurance Aura|r, and |cffee0000throws very tasty fish|r at you, how kind of them! Unfortunately, this fish tends to |cffee0000attract sharks|r..."
endif
set DT[11]="|cff00baffFrenetic Demon|r"
set DT[12]="|cff00baffBaby Cubble Bear|r"
set DT[13]="|cff00baffTainted Sluagh|r"
set DT[14]="|cff00baffVampire|r"
set DT[15]="|cff00baffMoss Mey|r"
set DT[16]="|cff00baffRisen Stone|r"
set DT[17]="|cff00baffOgre Gladiator|r"
set DT[18]="|cff00baffBlood Troll Amazoness|r"
set DT[19]="|cff00baffSavage Peccary|r"
set DT[20]="|cff00baffLesser Crystal Dragon|r"
set DT[21]="|cff00baffYvhh la'tami|r"
set DT[22]="|cff00baffBlood Leucro|r"
set DT[23]="|cff00baffFrostwyrm|r"
set DT[24]="|cff00baffDeath Spirit|r"
set DT[25]="|cff00baffDivine Rock|r"
set DT[26]="|cff00baffSea King|r"
set DT[27]="|cff00baffSkeletal Royal|r"
set DT[28]="|cff00baffBlood Marbled Angiswaerd|r"
set DT[29]="|cff00baffAdan'f Blood Warrior|r"
set DT[30]="|cff00baffZombie Necros|r"
set DT[31]="|cff00baffAdan'f War Mage|r"
set DT[32]="|cff00baffLun'Shele Deceiver|r"
set DT[33]="|cff00baffDoom Kra'hei|r"
set DT[34]="|cff00baffPoloh'izh Assassin|r"
set DT[35]="|cff00baffMisshapen Gremish'din|r"
set DT[36]="|cff00baffFanciful Aberration|r"
set DT[37]="|cff00baffForsaken Ouroboros|r"
set DT[38]="|cff00baffS'sugi Malchata|r"
set DT[39]="|cff00baffSnaer Hafwa|r"
if GetRandomInt(1,100) <= 50 then
set DT[40]="|cff00baffMolten Terror|r"
set MC[40]='n045'
set PK[40]='n046'
set NT[40]="Molten Terrors are your end. They deal |cffee0000massive spell damage|r with their |cffee0000area of effect spells|r. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
else
set DT[40]="|cff00baffS'lai Screamer|r"
set MC[40]='n016'
set PK[40]='n03K'
set NT[40]="S'lai Screamers are your end. They are all protected by |cffee0000Evil Angels|r. Their Commander has |cffee0000Lay Waste|r, a devastating area attack. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
endif
set NT[1]="Crabs are peaceful creatures, that generally don't do much. Their commander passively |cffee0000drains|r the mana of nearby heroes."
set NT[2]="Gnolls |cffee0000Leap|r, same deal. Their |cffee0000ranged|r commander can |cffee0000BERSERK|r; gaining maximum attack and movement speed, as well as the ability to |cffee0000climb walls|r. His |cffee0000Backstab|r ability lets him deal |cffee0000double damage|r from behind."
set NT[3]="Crazed Madmen have |cffee0000Ensnare|r and |cffee0000Bash|r. Their |cffee0000EXTREMELY LONG RANGED commander can attack |cffee0000Multiple Enemies|r. His |cffee0000Trueshot Aura|r passively gives him a |cffee0000MASSIVE DAMAGE BOOST|r."
set NT[4]="Boar Enforcers can |cffee0000Frenzy|r to increase their attack speed. Their commander has a |cffee0000SHORT COOLDOWN REINCARNATION|r, |cffee0000HEALING WAVE|r, |cffee0000spell and damage reduction|r, and |cffee0000BERSERK|r. |cffee0000Lesser Grevious Wounds|r cause his attacks to |cffee0000stack bonus damage on subsequent hits|r, and he has |cffee0000Flat Thorns|r."
set NT[5]="Wood Trolls have a |cffee0000 STRONG STACKABLE SLOW POISON|r. Their leader is able cast |cffee0000Wrath of the Ancients,|r a |cffee0000POWERFUL SUMMONING SPELL|r. |cffee0000KILL SUMMONER FIRST|r. Once the commander is dead, the Wood Trolls lose their Slow Poison."
set NT[6]="Satyr Reavers are |cffee0000permanently invisible|r while their commander is alive, so |cffee0000GET WARDS|r. They also all posses |cffee0000BACKSTAB|r. Their commander has an |cffee0000armor-reducing attack, Vampiric Aura|r, and |cffee0000BERSERK|r."
set NT[7]="Blood Wolves have |cffee0000Bloodlust|r. Their commander has |cffee0000Feedback, Vampiric Aura, BERSERK|r,and |cffee0000BLOOD SCENT|r, which is a |cffee0000MASSIVE ATTACK SPEED AURA|r. He also has |cffee0000Critical Wound|r, for deadly crits and |cffee0000Feedback|r to combust your mana."
set NT[8]="Engorged Blood Spiders can |cffee0000LEAP|r and |cffee0000TOSS EGGS AT YOU|r. Eggs will |cffee0000HATCH INTO ADDITIONAL SPIDERS|R. Their commander shoots sticky strands of |cffee0000Web|r at you, that |cffee0000GRAB, TOSS, DAMAGE, and SLOW|r you if you get hit, as well as possessing |cffee0000Mirror Image|r."
set NT[9]="Flesh Giants have |cffee0000Leap|r. Their commander also has |cffee0000METEOR IMPACT|r, which deals |cffee0000physical area damage|r and |cffee0000knockback|r upon landing on an enemy. He also |cffee0000KNOCKS YOU BACK|r with every attack. He also has a |cffee0000MASSIVE ARMOR AURA|r and |cffee0000HEALING AURA|r,plus |cffee0000damage reduction against attacks|r, |cffee000090% Magic and Ranged attack resistance|r, and |cffee00005% Maximum Health Regeneration|r. He is protected by an |cffee0000Evil Angel|r, which gives a chance to survive lethal damage."
set NT[11]="Frenetic Demons |cffee0000cleave|r. Their commander has |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r. It also has |cffee0000MINDRIP|r, which is a |cffee000099999 Mana Burn|r. It also has |cffee0000REINCARNATION|r, and has an |cffee0000EVIL ANGEL|r."
set NT[12]="Baby Cubble Bears are all protected by |cffee0000Guardian Angels|r, which are exactly like Evil Angels. In addition, they all possess |cffee0000Cuddly Sacrifice|r, which causes them to explode on death, dealing damage in an area after 1 second and permanently increasing the maximum health of friendly units in the area. The Commander also has a |cffee0000Healing Aura|r and |cffee0000Grevious Wounds|r."
set NT[13]="Tainted Sluaghs are ranged units with a |cffee0000MASSIVE CRIT|r. Their commander has |cffee0000Multishot|r."
set NT[14]="Vampires have natural |cffee0000Lifesteal|r and |cffee0000Bash|r. Their commander |cffee0000ATTACKS SUPER FAST|r due to his |cffee0000Overpower|r. He also has |cffee0000Vampiric Aura, Bash, and |cffee0000Grevious Wounds|r."
set NT[15]="Moss Meys have |cffee0000Leap|r, |cffee0000Backstab|r, and |cffee0000Slow Poison|r.. Their commander |cffee0000drains mana from a CRAZY LONG DISTANCE|r. It also has |cffee000080% Evasion|r, |cffee0000Multishot|r, and |cffee0000Backstab|r."
set NT[16]="Risen Stones have |cffee0000high magic resistance|r while their commander is alive. They also have |cffee0000ABOLISH MAGIC|r. In addition to a |cffee0000HEALING AND ARMOR AURA|r, their Commander has |cffee000090% Ranged and Spell Reduction|r, and |cffee0000knocks back on attack|r."
set NT[17]="Ogre Gladiators have |cffee0000Pulverize|r, letting them deal |cffee0000bonus damage that ignores armor|r, as well as |cffee0000Gluttonous Feast|r, which increases their maximum health, damage, and attack speed on hit. Their Commander has |cffee0000Command and Endurance Auras|r, has a |cffee0000Guardian Angel|r, |cffee0000Armor Aura|r, and never misses with his |cffee0000SPIRIT STRIKE|r, which also grants him a 1.4x crit on his attacks."
set NT[18]="Blood Troll Amazonesses have |cffee0000 BERSERK|r and |cffee0000BASH|r. In addtion, they |cffee0000SUMMON BLOOD TOTEMS|r that need to be killed IMMEDIATELY or BAD THINGS WILL HAPPEN. Their commander also has |cffee0000Critical Wound|r and |cffee0000Gluttonous Feast|r."
set NT[19]="Savage Peccaries have |cffee0000Evasion|r, |cffee0000Spirit Strike|r, and |cffee0000Charge|r. Their leader has |cffee0000ARMOR CRUSH|r which temporarily nullifies your armor, and |cffee0000Berserk|r, as well as |cffee0000Vampiric Aura|r and |cffee000090% Ranged and Spell Reduction|r."
set NT[20]="Lesser Crystal Dragons have a short ranged |cffee0000TRIPLE STRIKE|r attack that can encase you in Crystal, and |cffee0000Evasion|r. Their commander has |cffee0000High Evasion|r and |cffee0000Corruption Aura|r, which decreases the armor of nearby enemy units. Also they all |cffee0000LEAP|r."
set NT[21]="Yvhh la'tamis can |cffee0000stun with their Chaos Bolt|r and cast |cffee0000Rain of Fire|r. Their commander has a |cffee0000healing aura and a mana regeneration aura|r, as well as a devastating |cffee0000Glacial Aura|r, that severely slows nearby enemies. They also all have |cffee0000Cleave|r."
set NT[22]="Blood Leucros have |cffee0000Critical Strike|r and |cffee0000Lesser Berserk|r, and their commander has |cffee0000ARMOR CRUSH|r, |cffee0000BERSERK|r, and |cffee0000Feedback|r. It also has |cffee0000Blood Scent|r and Vampiric Aura."
set NT[23]="Frost Wyrms have |cffee0000Curse, making your attacks miss a lot|r. Their leader |cffee0000Mind Rip|r, |cffee0000high Evasion|r |cffee0000Glacial Aura|r and |cffee0000Frostburn|r, which deals damage over time to nearby enemies."
set NT[24]="Death Spirits have |cffee0000Frost Attack|r, |cffee0000Purge|r, |cffee0000Mana Burn|r, and |cffee0000Deathly Dance|r, allowing them to charge forward, dealing area physical damage around them. Their leader has |cffee0000Berserk|r and |cffee0000Corruption Aura|r. They also all have |cffee00005% Max Health Regeneration|r and |cffee0000Phase Shift|r, causing them to become briefly invulnerable while quickly dashing backwards."
set NT[25]="Divine Rocks have |cffee0000MAJESTIC IMPACT|r and |cffee0000possess 80% Ranged and Spell Reduction|r. Their commander has |cffee0000Spell and Ranged Attack Immunity|r, |cffee0000Guardian Angel|r, and his blows can |cffee0000knock you back|r."
set NT[26]="Sea Kings are |cffee0000PERMANENTLY INVISIBLE|r, have |cffee0000Pulverize|r, |cffee0000Bloodlust|r,|cffee0000Ensnare|r, and |cffee0000Grevious Wounds|r. Their leader has spell damage reduction."
set NT[27]="Skeletal Royals have |cffee0000Feedback|r and Evasion. Their ranged commander has |cffee0000Curse|r, |cffee0000ARMOR CRUSH|r, |cffee0000Backstab|r, and |cffee0000Leap|r."
set NT[28]="Blood Marbled Angiswaerds have |cffee0000NASTY THORNS|r, as well as |cffee0000possessing 80% Ranged and Spell Reduction|r. However, if their commander is slain, they will lose their thorns. Their commander can |cffee0000can Deflect Projectiles|r."
set NT[29]="Adan'f Blood Warriors have a |cffee0000HIGHLY DAMAGING STACKABLE POISON STING|r. Their Commander has |cffee0000Armor Crush|r, |cffee0000Berserk, |cffee0000Evil Angel|r, and |cffee0000Mind Rip|r."
set NT[30]="Zombie Nomads are the precursors to your demise, with |cffee0000Vile Poison |r and |cffee0000Leap|r. Their commander has an |cffee0000Evil Angel|r."
set NT[31]="Adan'f War Mages can |cffee0000Cripple|r you severely, and cast |cffee0000Death Bolt|r, dealing |cffee0000MASSIVE DEATH DAMAGE|r and |cffee0000summoning an Adan'f Greedling with Pilfering Paws|r. Their Commander has |cffee0000Curse|r, |cffee0000Mind Rip|r, can cast |cffee0000Unholy Frenzy|r, and will nuke you down with his |cffee0000Fel Bolt|r, which additionally |cffee0000summons multiple Greedlings|r."
set NT[32]="Lun'Shele Deceivers have a ranged |cffee0000Slow Poison. Their their commander has various attack speed buffs and auras, in addition to |cffee0000Berserk|r and |cffee0000Shattering Arrows|r, which pernamently reduces the armor of units struck by her. When slain, you will recover your lost armor points."
set NT[33]="Doom Kra'hei have very high |cffee0000Spell Reduction|r and |cffee0000Spirit Strike|r. Their leader also has the Endurance and Command Auras, as well as the feared |cffee0000Armor Crush|r. In addition, he is protected by a |cffee0000Guardian angel|r."
set NT[34]="Poloh'izh are |cffee0000permanently invisible|r, possess |cffee0000Evasion|r, have |cffee0000Backstab|r, |cffee0000Ensnare|r, and |cffee0000Leap|r. Their Commander can |cffee0000Mind Rip|r and |cffee0000Curse|r you."
set NT[35]="Misshapen Germish'din have |cffee0000Lifesteal|r and |cffee0000Gluttonous Feast|R, which increases their maximum health, damage, and attack speed on hit. Their leader possesses |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r."
set NT[36]="Fanciful Aberrations have |cffee0000Spell Damage Reduction|r and |cffee0000Thorns|r, as well as |cffee000080% Evasion|r. Their commander has an armor-reducing attack and |cffee00005% Max Health Regeneration|r."
set NT[37]="Forsaken Ouroboros have high natural regeneration, as well as |cffee0000Spell Damage Reduction|r, |cffee0000Life Steal,|r |cffee0000Spirit Strike, and |cffee0000Infinite Cycle|r, which resurrects all allied commanders on the map and doubling their maximum health. Their commander has |cffee0000Armor Crush, Blood Scent, Critical Wound, and an area of effect lightning attack|r."
set NT[38]="S'sugi Malchata have a |cffee0000stackable poison|r attack, |cffee0000Lifesteal|r, |cffee0000Gluttonous Feast|r, and |cffee0000Leap|r."
set NT[39]="What? Still not dead yet? Here, have an |cffee0000Armor Crushing|r Snaer Hafwa commander! Her minions possess a slowing attack and |cffee0000Mind Rip|r."
endif
endif
endfunction
function IQRQ9999 takes nothing returns nothing
if GAMEM then
if DOUBLEHEALTH==false then
set DOUBLEHEALTH=true
call IJR("Red has enabled |cffffd700Double Health|r, enemies will now have twice the amount of health.")
else
set DOUBLEHEALTH=false
call IJR("Red has disabled |cffffd700Double Health|r, enemy health is restored to 100%.")
endif
endif
endfunction
function s__Modes_reset takes nothing returns boolean
set XT=0
set ST=false
return false
endfunction
function ISR takes nothing returns nothing
local trigger t=CreateTrigger()
call BlzChangeMinimapTerrainTex("war3mapImported\\custom_minimap.tga")
set AQE=VJX("D1",true,function IKR)
set GIV[(AQE)*12+(0)]=true
set ASE=VJX("D2",true,function ILR)
set GIV[(ASE)*12+(0)]=true
set ATE=VJX("D3",true,function IMR)
set GIV[(ATE)*12+(0)]=true
set AUE=VJX("D4",true,function IPR)
set GIV[(AUE)*12+(0)]=true
set AWE=VJX("D5",true,function IQR)
set GIV[(AWE)*12+(0)]=true
set AWEQQ=VJX("br",true,function IQRQQ)
set GIV[(AWEQQ)*12+(0)]=true
set AWEQ1=VJX("cp",true,function IQRQ1)
set GIV[(AWEQ1)*12+(0)]=true
set AWEQ11=VJX("te",true,function IQRQ11)
set GIV[(AWEQ11)*12+(0)]=true
set AWEQ2=VJX("sr",true,function IQRQ2)
set GIV[(AWEQ2)*12+(0)]=true
set AWEQ3=VJX("lw",true,function IQRQ3)
set GIV[(AWEQ3)*12+(0)]=true
set AWEQ4=VJX("rm",true,function IQRQ4)
set GIV[(AWEQ4)*12+(0)]=true
set AWEQ5=VJX("sc",true,function IQRQ5)
set GIV[(AWEQ5)*12+(0)]=true
set AWEQ6=VJX("ar",true,function IQRQ6)
set GIV[(AWEQ6)*12+(0)]=true
set AWEQ7=VJX("sw",true,function IQRQ7)
set GIV[(AWEQ7)*12+(0)]=true
set AWEQ8=VJX("tc",true,function IQRQ8)
set GIV[(AWEQ8)*12+(0)]=true
set AWEQ9=VJX("pd",true,function IQRQ9)
set GIV[(AWEQ9)*12+(0)]=true
set AWEQ99=VJX("nb",true,function IQRQ99)
set GIV[(AWEQ99)*12+(0)]=true
set AWEQ999=VJX("rb",true,function IQRQ999)
set GIV[(AWEQ999)*12+(0)]=true
set AWEQ9999=VJX("dh",true,function IQRQ9999)
set GIV[(AWEQ9999)*12+(0)]=true
set AWEQ99991234=VJX("rw",true,function IQRQ99991234)
set GIV[(AWEQ99991234)*12+(0)]=true
//call IJR2("|cffff0000Please wait while the map is loading. There will be heavy lag for around 60 seconds while resources are being preloaded.|r")
//call IJR2("|cffff0000Please do not drop laggers during this time.|r")
call IJR2("|cffffcc00Available Mode strings:|r -d2 (Normal), -d3 (Hard), -d4 (Nightmare),-d5 (Hell), -te(|c00000000T|r|c00001A1Ar|r|c00003333u|r|c00004D4De|r|c00006666 |r|c00008080E|r|c00208080n|r|c00408080f|r|c00608080o|r|c00808080s|r.), -ar(|c00FF0101A|r|c00FF900Fl|r|c00FEC808l|r|c00FEFF01 |r|c008FDF00R|r|c0021C000a|r|c0001BBFFn|r|c00025EFFd|r|c000201FFo|r|c007F0080m|r, cannot be turned off), -br(Boss Rush), -cp(|c00800000C|r|c00790000o|r|c00730000m|r|c006C0000m|r|c00650000a|r|c005E0000n|r|c00580000d|r|c00510000e|r|c004A0000r|r|c00430000 |r|c003D0000P|r|c00360000r|r|c002F0000o|r|c00280000m|r|c00220000o|r|c001B0000t|r|c00140000i|r|c000D0000o|r|c00070000n|r|c00000000s|r, Recommended for experienced players),")
call IJR2("-lw(Line Wars mode), -sc(Speedy Creeps, Recommended for Line Wars), -sw(Social Welfare), -tc(True Communism), -pd(Proletarian Dictatorship),")
call IJR2(" -rb (Reduced Bounty), -dh(Double Health) -nb(No Bounty), -rw (|cFFFF0303R|r|cFF1EE231a|r|cFF46B783n|r|cFFF7073Ad|r|cFFDAB425o|r|cFF0042FFm|r|cFF0A77BA |r|cFF8000FFW|r|cFF90EE11a|r|cFFE2FF00v|r|cFFFF009De|r|cFFDAB425s|r),-rm (Resets all modes to default)")
call IJR(" ")
call IJR2("Red can also type -lives ### to change the amount of starting lives.")
call IJR2("Players will be able to vote on a difficulty setting if Red does not set a difficulty.")
call IJR(" ")
call IJR("|c00630064Youtube Guides: StrikestTV, Kindness")
//call IJR(" ")
//call IJR3("The |cFF09F3F7Recipe Shop, |r|cFFFFCC00Venus|r, allows you to view and buy all recipe items in the game from anywhere on the map. Items bought this way will cost 10% more than if you had made the item yourself from its components. However, it is a good way for new players to get acquainted with all the items in the game.")
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,60.,"|cff00ffffAnnouncing the first ever Enfo's TS FFB Edition tournament; with a cash prize of 250+ usd, and taking place in August.Please out our discord for more info: https://discord.gg/PGub8vzzf4. Also thank you to the patrons at https://www.patreon.com/EnfosFFB for contrubiting to the prize money so I don't have to pay too much out of pocket. GLHF!|r")
set TIPST[0]=true
set TIPST[1]=true
set TIPST[2]=true
set TIPST[3]=true
set TIPST[4]=true
set TIPST[5]=true
set TIPST[6]=true
set TIPST[7]=true
set TIPST[8]=true
set TIPST[9]=true
set TIPST[10]=true
set TIPST[11]=true
set VoracityInt[0]=0
set VoracityInt[1]=0
set VoracityInt[2]=0
set VoracityInt[3]=0
set VoracityInt[4]=0
set VoracityInt[5]=0
set VoracityInt[6]=0
set VoracityInt[7]=0
set VoracityInt[8]=0
set VoracityInt[9]=0
set VoracityInt[10]=0
set VoracityInt[11]=0
set t=null
endfunction
function IUR takes nothing returns boolean
return(GetEnumUnit()==PL[bj_forLoopAIndex])and(TT[bj_forLoopAIndex])
endfunction
function IWR takes nothing returns boolean
return(IUR())
endfunction
function IYR takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(IWR())then
call UnitDamageTargetEx(OG,GetEnumUnit(),60000.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
set TT[bj_forLoopAIndex]=false
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function IZR takes nothing returns nothing
set UT=GetSpellTargetLoc()
set OG=GetTriggerUnit()
set bj_wantDestroyGroup=true
call ForGroupBJ(CTE(240.,UT),function IYR)
call RemoveLocation(UT)
endfunction
//function I0R takes nothing returns boolean
//return((GetSpellAbilityId()=='A02J')or(GetSpellAbilityId()=='A0BG')or(GetSpellAbilityId()=='A0GX')or(GetSpellAbilityId()=='A08X')or(GetSpellAbilityId()=='A08V')or(GetSpellAbilityId()=='A08H')or(GetSpellAbilityId()=='A03F')and not JT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
//endfunction
//function I1R takes nothing returns boolean
//return(I0R())
//endfunction
function I3R takes nothing returns nothing
if not JT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
set JT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
endif
endfunction
function TipsToggleFunc takes nothing returns boolean
if TIPST[GetPlayerId(GetTriggerPlayer())] then
set TIPST[GetPlayerId(GetTriggerPlayer())] = false
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"Wave information has been turned off.")
else
set TIPST[GetPlayerId(GetTriggerPlayer())] = true
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"Wave information has been turned on.")
endif
return false
endfunction
function LichToggleFunc takes nothing returns boolean
if LICHS[GetPlayerId(GetTriggerPlayer())] then
set LICHS[GetPlayerId(GetTriggerPlayer())] = false
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"Minion auto-selection has been turned off.")
else
set LICHS[GetPlayerId(GetTriggerPlayer())] = true
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"Minion auto-selection has been turned on.")
endif
return false
endfunction
function s__ReviveSafe___revivec__allocate takes nothing returns integer
local integer this=si__ReviveSafe___revivec_F
if (this!=0) then
set si__ReviveSafe___revivec_F=si__ReviveSafe___revivec_V[this]
else
set si__ReviveSafe___revivec_I=si__ReviveSafe___revivec_I+1
set this=si__ReviveSafe___revivec_I
endif
if (this>8190) then
return 0
endif
set si__ReviveSafe___revivec_V[this]=-1
return this
endfunction
//Generated destructor of ReviveSafe___revivec
function s__ReviveSafe___revivec_deallocate takes integer this returns nothing
if this==null then
return
elseif (si__ReviveSafe___revivec_V[this]!=-1) then
return
endif
set si__ReviveSafe___revivec_V[this]=si__ReviveSafe___revivec_F
set si__ReviveSafe___revivec_F=this
endfunction
function ReviveSafe___Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local integer data= GetTimerData(t) // INLINED!!
local real x= GetRectCenterX(GD[s__ReviveSafe___revivec_i[data]])
local real y= GetRectCenterY(GD[s__ReviveSafe___revivec_i[data]])
call ReviveHero(LC[s__ReviveSafe___revivec_i[data]],x,y,true)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"Revival time is over, hero will hopefully have been revived. Please report the revive bug by sending me the replay. Contact me at [email protected] or my e-mail, [email protected].")
call s__ReviveSafe___revivec_deallocate(data)
call ReleaseTimer(t)
set t=null
endfunction
function ReviveSafe___OnSpell takes nothing returns boolean
local timer t
local integer data
local integer i= GetPlayerId(GetTriggerPlayer()) + 1
if not UnitAlive(LC[i]) then
set data=s__ReviveSafe___revivec__allocate()
set s__ReviveSafe___revivec_i[data]=i
set t= NewTimer()
call SetTimerData(t,data) // INLINED!!
call TimerStart(t,10. + GetHeroLevel(LC[i]), false, function ReviveSafe___Handler)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"Attempting to fix revive bug. Hero will hopefully revive after the revival time.")
endif
set t=null
return false
endfunction
function DtaHoliday___OnSpell takes nothing returns nothing
local real x= GetUnitX(GetTriggerUnit())
local real y= GetUnitY(GetTriggerUnit())
//if GetSpellAbilityId() == 'A0AG' then
call DestroyEffect(AddSpecialEffect("war3mapImported\\BonediggerHaloTC.mdl",x,y))
//endif
//return false
endfunction
globals
constant group DandDecay__GROUP = CreateGroup( )
integer DandDecay__Level
endglobals
function DandDecay__FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if UnitAlive(u) and GetUnitTypeId(u) == 'uskm' then
if GetUnitAbilityLevel(u,'A0AD') == 0 then
call UnitAddAbility(u,'A0AD')
endif
call SetUnitAbilityLevel(u, 'A0AD',DandDecay__Level)
call UnitMakeAbilityPermanent(u,true,'A0AD')
call BlzSetUnitAbilityManaCost(u,'A0AD',DandDecay__Level-1,0)
endif
set u = null
return false
endfunction
function DandDecay___OnSpell takes nothing returns nothing
local real x= GetSpellTargetX()
local real y= GetSpellTargetY()
local unit u
//if GetSpellAbilityId() == 'A0AD' then
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'h007', x, y, 0.)
call UnitAddAbility(u, 'A0AF')
call SetUnitAbilityLevel(u, 'A0AF', GetUnitAbilityLevel(GetTriggerUnit(), 'A0AD'))
call IssuePointOrder(u, "deathanddecay", x, y)
call UnitApplyTimedLife(u, 'BTLF', 25.)
//endif
if GetUnitAbilityLevel(GetTriggerUnit(),'A0MD') == 1 then
set DandDecay__Level = GetUnitAbilityLevel(GetTriggerUnit(), 'A0AD')
call GroupEnumUnitsOfPlayer(DandDecay__GROUP,GetOwningPlayer(GetTriggerUnit()),Filter(function DandDecay__FilterActions))
endif
set u=null
//return false
endfunction
function s__DeathCall___DCall__allocate takes nothing returns integer
local integer this=si__DeathCall___DCall_F
if (this!=0) then
set si__DeathCall___DCall_F=si__DeathCall___DCall_V[this]
else
set si__DeathCall___DCall_I=si__DeathCall___DCall_I+1
set this=si__DeathCall___DCall_I
endif
if (this>8190) then
return 0
endif
set si__DeathCall___DCall_V[this]=-1
return this
endfunction
//Generated destructor of DeathCall___DCall
function s__DeathCall___DCall_deallocate takes integer this returns nothing
if this==null then
return
elseif (si__DeathCall___DCall_V[this]!=-1) then
return
endif
set si__DeathCall___DCall_V[this]=si__DeathCall___DCall_F
set si__DeathCall___DCall_F=this
endfunction
function s__DeathCall___DCall_destroy takes integer this returns nothing
set s__DeathCall___DCall_cast[this]=null
set s__DeathCall___DCall_t[this]=null
set s__DeathCall___DCall_attach[this]=null
call s__DeathCall___DCall_deallocate(this)
endfunction
function DeathCall___Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local integer data= GetTimerData(t) // INLINED!!
local unit u
local texttag tt
local integer i
if UnitAlive(s__DeathCall___DCall_t[data]) then
set u = CreateUnit(GetOwningPlayer(s__DeathCall___DCall_cast[data]), 'h007', GetUnitX(s__DeathCall___DCall_t[data]), GetUnitY(s__DeathCall___DCall_t[data]), .0)
call UnitAddAbility(u, 'A0AN')
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkForce.mdx", GetUnitX(s__DeathCall___DCall_t[data]),GetUnitY(s__DeathCall___DCall_t[data])))
if IsUnitType(s__DeathCall___DCall_t[data],UNIT_TYPE_ANCIENT) or GetUnitTypeId(s__DeathCall___DCall_t[data]) == 'n045' or GetUnitTypeId(s__DeathCall___DCall_t[data]) == 'n016' then
call SetWidgetLife(s__DeathCall___DCall_t[data],GetUnitState(s__DeathCall___DCall_t[data],UNIT_STATE_LIFE)*.66)
else
call UnitDamageTarget(u, s__DeathCall___DCall_t[data], 999999999., false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
endif
call UnitApplyTimedLife(u, 'BTLF', 1.)
call IssueImmediateOrder(u, "roar")
if DeathStacks[GetUnitUserData(s__DeathCall___DCall_cast[data])]<2444 then
set DeathStacks[GetUnitUserData(s__DeathCall___DCall_cast[data])]=DeathStacks[GetUnitUserData(s__DeathCall___DCall_cast[data])] + 24
if DeathStacks[GetUnitUserData(s__DeathCall___DCall_cast[data])] >= 2444 then
call UnitAddAbility(s__DeathCall___DCall_cast[data],'A0MD')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Ghost Strike.mdx",s__DeathCall___DCall_cast[data],"origin"))
endif
else
set i = GetRandomInt(0,2)
if i == 0 then
call SetHeroInt(s__DeathCall___DCall_cast[data],GetHeroInt(s__DeathCall___DCall_cast[data],false)+10,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl",s__DeathCall___DCall_cast[data],"origin"))
endif
if i == 1 then
call SetHeroStr(s__DeathCall___DCall_cast[data],GetHeroStr(s__DeathCall___DCall_cast[data],false)+10,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",s__DeathCall___DCall_cast[data],"origin"))
endif
if i == 2 then
call SetHeroAgi(s__DeathCall___DCall_cast[data],GetHeroAgi(s__DeathCall___DCall_cast[data],false)+10,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",s__DeathCall___DCall_cast[data],"origin"))
endif
endif
else
call DisplayTextToPlayer(GetOwningPlayer(s__DeathCall___DCall_cast[data]),0.,0.,"|c00000000D|r|c00050005e|r|c00090009a|r|c000E000Et|r|c00130013h|r|c00180018 |r|c001C001Ci|r|c00210021s|r|c00260026 |r|c002B002BD|r|c002F002Fi|r|c00340034s|r|c002F002Fp|r|c002A002Al|r|c00240024e|r|c001F001Fa|r|c001A001As|r|c00150015e|r|c00100010d|r|c000A000A.|r|c00050005.|r|c00000000.|r")
set tt=CreateTextTag()
call SetTextTagText(tt,"|c00000000f|r|c001A001Aa|r|c00340034i|r|c00000000l|r",.024)
call SetTextTagPos(tt,GetUnitX(s__DeathCall___DCall_t[data]),GetUnitY(s__DeathCall___DCall_t[data]),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
set u = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h007', GetUnitX(s__DeathCall___DCall_t[data]), GetUnitY(s__DeathCall___DCall_t[data]), .0)
call UnitAddAbility(u, 'ACcb')
call SetUnitAbilityLevel(u, 'ACcb',6)
call UnitApplyTimedLife(u, 'BTLF', 1.)
call IssueTargetOrderById(u, 852095, s__DeathCall___DCall_cast[data])
endif
call DestroyEffect(s__DeathCall___DCall_attach[data])
call ReleaseTimer(t)
call s__DeathCall___DCall_destroy(data)
set tt= null
set t=null
set u=null
endfunction
function DeathCall___OnSpell takes nothing returns nothing
local timer t
local integer data
//if GetSpellAbilityId() == 'A0AM' then
set data=s__DeathCall___DCall__allocate()
set s__DeathCall___DCall_cast[data]=GetTriggerUnit()
set s__DeathCall___DCall_t[data]=GetSpellTargetUnit()
set s__DeathCall___DCall_attach[data]=AddSpecialEffectTarget("war3mapImported\\Death Spell.mdx", s__DeathCall___DCall_t[data], "origin")
set t=NewTimer() // INLINED!!
call SetTimerData(t,data) // INLINED!!
if GetUnitAbilityLevel(s__DeathCall___DCall_cast[data],'A0MD') == 1 then
call TimerStart(t, .5, false, function DeathCall___Handler)
else
call TimerStart(t, 5., false, function DeathCall___Handler)
endif
//endif
set t=null
//return false
endfunction
function s__CalloftheHaunted___CotH__allocate takes nothing returns integer
local integer this=si__CalloftheHaunted___CotH_F
if (this!=0) then
set si__CalloftheHaunted___CotH_F=si__CalloftheHaunted___CotH_V[this]
else
set si__CalloftheHaunted___CotH_I=si__CalloftheHaunted___CotH_I+1
set this=si__CalloftheHaunted___CotH_I
endif
if (this>8190) then
return 0
endif
set si__CalloftheHaunted___CotH_V[this]=-1
return this
endfunction
//Generated destructor of CalloftheHaunted___CotH
function s__CalloftheHaunted___CotH_deallocate takes integer this returns nothing
if this==null then
return
elseif (si__CalloftheHaunted___CotH_V[this]!=-1) then
return
endif
set si__CalloftheHaunted___CotH_V[this]=si__CalloftheHaunted___CotH_F
set si__CalloftheHaunted___CotH_F=this
endfunction
function CalloftheHaunted___GetPeriod takes unit a,integer level,integer level2 returns real
local real cooldown
local integer i = 0
local item it
local integer i2 = 0
local integer i3 = 0
local integer i4 = 0
if GetUnitAbilityLevel(a,'A0QP') != 0 or GetUnitAbilityLevel(a,'A0QQ') != 0 or GetUnitAbilityLevel(a,'B03V') != 0 or GetUnitAbilityLevel(a,'A0RU') != 0 then
loop
exitwhen i > 5
set it = UnitItemInSlot(a,i)
if GetItemTypeId(it) == 'I01R' then
set i2 = i2 + 35
endif
if GetItemTypeId(it) == 'I03E' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04A' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I05A' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I02Z' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I02V' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I053' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03F' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I037' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I05E' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I05C' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I04Y' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03D' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I049' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04P' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I03V' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I036' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I048' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I05J' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I05M' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I05I' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I02K' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I02Y' then
set i2 = i2 + 20
endif
set i = i + 1
if GetItemTypeId(it) == 'I05V' then
set i2 = i2 + 20
endif
endloop
if GetUnitAbilityLevel(a,'A0QQ') != 0 then
set i2 = i2 + 90
endif
if GetUnitAbilityLevel(a,'A0RU') != 0 then
set i2 = i2 + 20
endif
if GetUnitAbilityLevel(a,'B03V') != 0 then
if AETHER_BUFF_LVL[GetUnitUserData(a)] >= 40 then
set i2 = i2 + 80
else
set i2 = i2 + (AETHER_BUFF_LVL[GetUnitUserData(a)]*2)
endif
endif
//call BJDebugMsg(I2S(data.level))
//call BJDebugMsg(R2S(data.reduction))
endif
set cooldown = 10. - ( .5 * level )
if i2 > 0 then
set cooldown =( cooldown-(cooldown*(i2/(i2+100.))) )
endif
if cooldown <= .01 then
set cooldown = .01
endif
set it = null
return cooldown
endfunction
constant function CalloftheHaunted___GetDuration takes unit u,integer level,integer level2 returns real
return (15. + 1. * level) + (level2*.5)
endfunction
constant function CalloftheHaunted___GetDurationSuper takes unit u,integer level,integer level2 returns real
return (15. + 1. * level) + (level2*.5)
endfunction
constant function CalloftheHaunted___AoE takes unit u,integer level,integer level2 returns real
return 350.
endfunction
constant function CalloftheHaunted___SuperUnitChance takes unit u,integer level,integer level2 returns real
return 5. + 2. * level
endfunction
constant function CalloftheHaunted___SummonTypeAmount takes unit u,integer level,integer level2 returns integer
return 4
endfunction
constant function CalloftheHaunted___GetHealth takes unit u,integer level,integer level2,integer i,integer str,integer agi,integer int,integer herolvl returns integer
if i == 1 then
if not LWMON and not GAMEM then
return ( ((PC * PC * level*2) +(level*str*2)*(1+herolvl/100)) + 240 )
else
return ( (((herolvl*3/2) * (herolvl*3/2) * level*2) +(level*str*2)*(1+herolvl/100))+ 240 )
endif
endif
if i == 2 then
if not LWMON and not GAMEM then
return ((PC * PC * level)*(1+herolvl/100)+40)+((level*int)*(1+herolvl/100))+200
else
return (((herolvl*3/2) * (herolvl*3/2) * level)*(1+herolvl/100)+40)+((level*int)*(1+herolvl/100))+200
endif
endif
if i == 3 then
if not LWMON and not GAMEM then
return ((PC * PC * level)*(1+herolvl/100)+40)+((level*agi)*(1+herolvl/100)) + 200
else
return (((herolvl*3/2) * (herolvl*3/2) * level)*(1+herolvl/100)+40)+((level*agi)*(1+herolvl/100)) +200
endif
endif
if i == 4 then
if not LWMON and not GAMEM then
return ((PC * PC * level*(1+herolvl/100))+40)+((level*agi/2)*(1+herolvl/100))+((level*int/2)*(1+herolvl/100))+200
else
return ((herolvl*3/2) * (herolvl*3/2) * level * (1+herolvl/100)+40)+((level*agi/2)*(1+herolvl/100))+((level*int/2)*(1+herolvl/100)) +200
endif
endif
return 0
endfunction
constant function CalloftheHaunted___GetDamage takes unit u,integer level,integer level2,integer i,integer str,integer agi,integer int,integer herolvl,integer dmg returns integer
if i == 1 then
if not LWMON and not GAMEM then
return ( (PC*level) + (level*str/3*2)+16 ) + (dmg)
else
return ( ((herolvl*3/2)*level) + (level*str/3*2)+16 ) + (dmg)
endif
endif
if i == 2 then
if not LWMON and not GAMEM then
return ((PC*level)+ (level*int/3*2)+16 ) + (dmg)
else
return (((herolvl*3/2)*level)+ (level*int/3*2)+16 ) + (dmg)
endif
endif
if i == 3 then
if not LWMON and not GAMEM then
return ( (PC*level) + (level*agi/4*3)+16 ) + (dmg)
else
return ( ((herolvl*3/2)*level) + (level*agi/4*3)+16 ) + (dmg)
endif
endif
if i == 4 then
if not LWMON and not GAMEM then
return (( (PC*level)+ (level*agi/6) + (level*int/6) +16)*3/4) + (dmg)
else
return (( ((herolvl*3/2)*level)+ (level*agi/6) + (level*int/6) +16)*3/4) + (dmg)
endif
endif
return 0
endfunction
constant function CalloftheHaunted___GetDamageSuper takes unit u,integer level,integer level2,integer int,integer herolvl,integer dmg returns integer
if not LWMON and not GAMEM then
return ( (2 *PC * level) + (level*int/2)+16 ) + (dmg)
else
return ( (2 *(herolvl*3/2) * level) + (level*int/2)+16 ) + (dmg)
endif
endfunction
constant function CalloftheHaunted___GetHealthSuper takes unit u,integer level,integer level2,integer str,integer herolvl returns integer
if not LWMON and not GAMEM then
return (((PC*3*PC*level) + (level*str*3)*(1+herolvl/100)) +240)
else
return ((((herolvl*3/2)*3*(herolvl*3/2)*level) + (level*str*3)*(1+herolvl/100)) +240)
endif
endfunction
constant function CalloftheHaunted___GetSummonType takes integer i returns integer
if i == 1 then
return CalloftheHaunted___UNIT1
endif
if i == 2 then
return CalloftheHaunted___UNIT2
endif
if i == 3 then
return CalloftheHaunted___UNIT3
endif
if i == 4 then
return CalloftheHaunted___UNIT4
endif
return 0
endfunction
constant function CalloftheHaunted___GetDamageTomeType takes integer i returns integer
if i == 1 then
return CalloftheHaunted___DAMAGE_TOME_1
endif
if i == 2 then
return CalloftheHaunted___DAMAGE_TOME_2
endif
if i == 3 then
return CalloftheHaunted___DAMAGE_TOME_3
endif
if i == 4 then
return CalloftheHaunted___DAMAGE_TOME_4
endif
return 0
endfunction
constant function CalloftheHaunted___GetHealthTomeType takes integer i returns integer
if i == 1 then
return CalloftheHaunted___HEALTH_TOME_1
endif
if i == 2 then
return CalloftheHaunted___HEALTH_TOME_2
endif
if i == 3 then
return CalloftheHaunted___HEALTH_TOME_3
endif
if i == 4 then
return CalloftheHaunted___HEALTH_TOME_4
endif
return 0
endfunction
constant function CalloftheHaunted___GetBirthIndex takes integer i returns integer
if i == 1 then
return CalloftheHaunted___UNIT1_INDEX
endif
if i == 2 then
return CalloftheHaunted___UNIT2_INDEX
endif
if i == 3 then
return CalloftheHaunted___UNIT3_INDEX
endif
if i == 4 then
return CalloftheHaunted___UNIT4_INDEX
endif
return 0
endfunction
constant function CalloftheHaunted___GetAbility1 takes integer i returns integer
if i == 1 then
return CalloftheHaunted___UNIT1_ABILITY1
endif
if i == 2 then
return CalloftheHaunted___UNIT2_ABILITY1
endif
if i == 3 then
return CalloftheHaunted___UNIT3_ABILITY1
endif
if i == 4 then
return CalloftheHaunted___UNIT4_ABILITY1
endif
return 0
endfunction
constant function CalloftheHaunted___GetAbility2 takes integer i returns integer
if i == 1 then
return CalloftheHaunted___UNIT1_ABILITY2
endif
if i == 2 then
return CalloftheHaunted___UNIT2_ABILITY2
endif
if i == 3 then
return CalloftheHaunted___UNIT3_ABILITY2
endif
if i == 4 then
return CalloftheHaunted___UNIT4_ABILITY2
endif
return 0
endfunction
//////////////////////////////////////////////////////NO TOUCHY PAST THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING/////////////////////////////////////////////////////////////////////////////
function s__CalloftheHaunted___CotH_destroy takes integer this returns nothing
set s__CalloftheHaunted___CotH_cast[this]=null
set s__CalloftheHaunted___CotH_attach[this]=null
call s__CalloftheHaunted___CotH_deallocate(this)
endfunction
function CalloftheHaunted___Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local integer data= GetTimerData(t) // INLINED!!
local real x
local real y
local real d
local real r= GetRandomReal(0., 360.)
local real f= GetUnitFacing(s__CalloftheHaunted___CotH_cast[data])
local integer i
local integer hp
local integer dmg
local unit u
local integer cost
if GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data],'A0MD') == 1 then
set cost = 50
else
set cost = 20
endif
set s__CalloftheHaunted___CotH_lvl[data]=GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID)
set s__CalloftheHaunted___CotH_lvl2[data]=GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2)
set d=GetRandomReal(0., CalloftheHaunted___AoE(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]))
set i=GetRandomInt(1, CalloftheHaunted___SummonTypeAmount(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]))
if GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data])))], CalloftheHaunted___ABIL_ID) != 0 then
set s__CalloftheHaunted___CotH_x[data]=GetUnitX(s__CalloftheHaunted___CotH_cast[data])
set s__CalloftheHaunted___CotH_y[data]=GetUnitY(s__CalloftheHaunted___CotH_cast[data])
set x=s__CalloftheHaunted___CotH_x[data] + d * Cos(r * bj_DEGTORAD)
set y=s__CalloftheHaunted___CotH_y[data] + d * Sin(r * bj_DEGTORAD)
if UnitAlive(s__CalloftheHaunted___CotH_cast[data]) then
if GetUnitState(s__CalloftheHaunted___CotH_cast[data],UNIT_STATE_MANA) >= (GetUnitState(s__CalloftheHaunted___CotH_cast[data],UNIT_STATE_MAX_MANA)/cost) then
call SetUnitState(s__CalloftheHaunted___CotH_cast[data],UNIT_STATE_MANA,(GetUnitState(s__CalloftheHaunted___CotH_cast[data],UNIT_STATE_MANA)-GetUnitState(s__CalloftheHaunted___CotH_cast[data],UNIT_STATE_MAX_MANA)/cost))
if GetRandomReal(0., 100.) <= CalloftheHaunted___SuperUnitChance(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]) then
call DestroyEffect(AddSpecialEffect(CalloftheHaunted___SUPER_EFFECT, x, y))
set u=CreateUnit(GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data]), CalloftheHaunted___SUPER_UNIT, x, y, f)
call UnitApplyTimedLife(u, CalloftheHaunted___TIMED_LIFE_ID, CalloftheHaunted___GetDurationSuper(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]))
call SetUnitAnimationByIndex(u, CalloftheHaunted___SUPER_BIRTH_INDEX)
call QueueUnitAnimation(u, "stand")
if GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2) != 0 then
call UnitAddAbility(u, CalloftheHaunted___SUPER_UNIT_ABILITY1)
call UnitAddAbility(u, CalloftheHaunted___SUPER_UNIT_ABILITY2)
call UnitAddAbility(u, CalloftheHaunted___SUPER_UNIT_ABILITY3)
call SetUnitAbilityLevel(u, CalloftheHaunted___SUPER_UNIT_ABILITY1, GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2))
call SetUnitAbilityLevel(u, CalloftheHaunted___SUPER_UNIT_ABILITY2, GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2))
call SetUnitAbilityLevel(u, CalloftheHaunted___SUPER_UNIT_ABILITY3, GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2))
endif
set hp=CalloftheHaunted___GetHealthSuper(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data],GetHeroStr(s__CalloftheHaunted___CotH_cast[data],true),GetHeroLevel(s__CalloftheHaunted___CotH_cast[data]))
set dmg=CalloftheHaunted___GetDamageSuper(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data],GetHeroInt(s__CalloftheHaunted___CotH_cast[data],true),GetHeroLevel(s__CalloftheHaunted___CotH_cast[data]),BlzGetUnitBaseDamage(s__CalloftheHaunted___CotH_cast[data],0))
call BlzSetUnitBaseDamage(u,R2I(dmg),0)
call BlzSetUnitMaxHP(u,R2I(hp))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)+(BlzGetUnitArmor(s__CalloftheHaunted___CotH_cast[data])*.5))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call DestroyEffect(AddSpecialEffect(CalloftheHaunted___EFFECT, x, y))
set u=CreateUnit(GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data]), CalloftheHaunted___GetSummonType(i), x, y, f)
call UnitApplyTimedLife(u, CalloftheHaunted___TIMED_LIFE_ID, CalloftheHaunted___GetDuration(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]))
call SetUnitAnimationByIndex(u, CalloftheHaunted___GetBirthIndex(i))
call QueueUnitAnimation(u, "stand")
if GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2) != 0 then
call UnitAddAbility(u, CalloftheHaunted___GetAbility1(i))
call UnitAddAbility(u, CalloftheHaunted___GetAbility2(i))
call SetUnitAbilityLevel(u, CalloftheHaunted___GetAbility1(i), GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2))
call SetUnitAbilityLevel(u, CalloftheHaunted___GetAbility2(i), GetUnitAbilityLevel(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ABIL_ID2))
endif
set hp=CalloftheHaunted___GetHealth(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data] , i,GetHeroStr(s__CalloftheHaunted___CotH_cast[data],true),GetHeroAgi(s__CalloftheHaunted___CotH_cast[data],true),GetHeroInt(s__CalloftheHaunted___CotH_cast[data],true),GetHeroLevel(s__CalloftheHaunted___CotH_cast[data]))
set dmg=CalloftheHaunted___GetDamage(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data] , i,GetHeroStr(s__CalloftheHaunted___CotH_cast[data],true),GetHeroAgi(s__CalloftheHaunted___CotH_cast[data],true),GetHeroInt(s__CalloftheHaunted___CotH_cast[data],true),GetHeroLevel(s__CalloftheHaunted___CotH_cast[data]),BlzGetUnitBaseDamage(s__CalloftheHaunted___CotH_cast[data],0))
call BlzSetUnitBaseDamage(u,R2I(dmg),0)
call BlzSetUnitMaxHP(u,R2I(hp))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)+(BlzGetUnitArmor(s__CalloftheHaunted___CotH_cast[data])*.5))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
if i != 1 and IsUnitSelected(s__CalloftheHaunted___CotH_cast[data],GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data])) and LICHS[GetPlayerId(GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data]))] then
call SelectUnitAddForPlayer(u,GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data]))
endif
endif
else
call Q_E(GetOwningPlayer(s__CalloftheHaunted___CotH_cast[data]),"Not enough mana for summon.")
endif
endif
call SetTimerData(t,data) // INLINED!!
call TimerStart(t, CalloftheHaunted___GetPeriod(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]), false, function CalloftheHaunted___Handler)
else
call ReleaseTimer(t)
call DestroyEffect(s__CalloftheHaunted___CotH_attach[data])
call UnitRemoveAbility(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___NOSTACK_ID)
call s__CalloftheHaunted___CotH_destroy(data)
endif
set u=null
set t=null
endfunction
function CalloftheHaunted___OnSpell takes nothing returns boolean
local integer data
local timer t
if GetLearnedSkill() == CalloftheHaunted___ABIL_ID and GetUnitAbilityLevel(GetTriggerUnit(), CalloftheHaunted___NOSTACK_ID) != 1 then
set data=s__CalloftheHaunted___CotH__allocate()
set s__CalloftheHaunted___CotH_cast[data]=GetTriggerUnit()
set s__CalloftheHaunted___CotH_attach[data]=AddSpecialEffectTarget(CalloftheHaunted___ATTACH, s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___ATTACH_POINT)
call UnitAddAbility(s__CalloftheHaunted___CotH_cast[data], CalloftheHaunted___NOSTACK_ID)
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t, CalloftheHaunted___GetPeriod(s__CalloftheHaunted___CotH_cast[data] , s__CalloftheHaunted___CotH_lvl[data] , s__CalloftheHaunted___CotH_lvl2[data]), false, function CalloftheHaunted___Handler)
endif
set t = null
return false
endfunction
function s__Chernobyliss__Cbliss__allocate takes nothing returns integer
local integer this=si__Chernobyliss__Cbliss_F
if (this!=0) then
set si__Chernobyliss__Cbliss_F=si__Chernobyliss__Cbliss_V[this]
else
set si__Chernobyliss__Cbliss_I=si__Chernobyliss__Cbliss_I+1
set this=si__Chernobyliss__Cbliss_I
endif
if (this>8190) then
return 0
endif
set si__Chernobyliss__Cbliss_V[this]=-1
return this
endfunction
function s__Chernobyliss__Cbliss_deallocate takes integer this returns nothing
if this==null then
return
elseif (si__Chernobyliss__Cbliss_V[this]!=-1) then
return
endif
set si__Chernobyliss__Cbliss_V[this]=si__Chernobyliss__Cbliss_F
set si__Chernobyliss__Cbliss_F=this
endfunction
constant function Chernobyliss__DAMAGE_PER_SECOND takes integer level,integer herostr,integer heroagi,integer heroint returns real
return ( 50. + ( level * 40. * level ) + heroagi*2. ) / Chernobyliss__TIMER_INTERVAL
endfunction
constant function Chernobyliss__DURATION takes integer level returns real
return 20. + level * 2.
endfunction
constant function Chernobyliss__AOE takes integer level returns real
return 195. + ( 5. * level )
endfunction
constant function Chernobyliss__SPREAD_AOE takes integer level returns real
return 200.
endfunction
constant function Chernobyliss__KB_DISTANCE takes integer level returns real
return 190. + level * 10.
endfunction
constant function Chernobyliss__CHANCE_TO_SPREAD takes integer level returns real
return 150. / Chernobyliss__TIMER_INTERVAL
endfunction
constant function Chernobyliss__FILTER_UNITS takes unit u returns boolean
return IsUnitEnemy(u, GetOwningPlayer(Chernobyliss__CASTER))
endfunction
function Chernobyliss__Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local integer data= GetTimerData(t) // INLINED!!
local unit u
local unit ug= null
local integer lvl= s__Chernobyliss__Cbliss_lvl[data]
local real dur= s__Chernobyliss__Cbliss_dur[data] - 1. / Chernobyliss__TIMER_INTERVAL
local real life
local real mlife
if s__Chernobyliss__Cbliss_dur[data] <= 0 or not UnitAlive(s__Chernobyliss__Cbliss_t[data]) then
call DestroyEffect(s__Chernobyliss__Cbliss_attach[data])
call UnitRemoveAbility(s__Chernobyliss__Cbliss_t[data], Chernobyliss__SLOW_ID)
call SetUnitVertexColor(s__Chernobyliss__Cbliss_t[data], 255, 255, 255, 255)
call s__Chernobyliss__Cbliss_deallocate(data)
call ReleaseTimer(t)
else
call UnitDamageTargetEx(s__Chernobyliss__Cbliss_cast[data], s__Chernobyliss__Cbliss_t[data], Chernobyliss__DAMAGE_PER_SECOND(s__Chernobyliss__Cbliss_lvl[data] , GetHeroStr(s__Chernobyliss__Cbliss_cast[data], true) , GetHeroAgi(s__Chernobyliss__Cbliss_cast[data], true) , GetHeroInt(s__Chernobyliss__Cbliss_cast[data], true)), false, false, Chernobyliss__ATTACK_TYPE, Chernobyliss__DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
set life=GetUnitState(s__Chernobyliss__Cbliss_t[data], UNIT_STATE_LIFE)
set mlife=GetUnitState(s__Chernobyliss__Cbliss_t[data], UNIT_STATE_MAX_LIFE)
if life / mlife >= .3 then
call SetUnitVertexColor(s__Chernobyliss__Cbliss_t[data], R2I(( life / mlife ) * 255.), 255, R2I(( life / mlife ) * 255.), 255)
else
call SetUnitVertexColor(s__Chernobyliss__Cbliss_t[data], R2I(( life / mlife ) * 255.), 130, R2I(( life / mlife ) * 255.), 255)
endif
set s__Chernobyliss__Cbliss_dur[data]=s__Chernobyliss__Cbliss_dur[data] - 1. / Chernobyliss__TIMER_INTERVAL
call SetTimerData(t,data) // INLINED!!
call TimerStart(t, 1. / Chernobyliss__TIMER_INTERVAL, false, function Chernobyliss__Handler)
set Chernobyliss__CASTER=s__Chernobyliss__Cbliss_cast[data]
set s__Chernobyliss__Cbliss_x[data]=GetUnitX(s__Chernobyliss__Cbliss_t[data])
set s__Chernobyliss__Cbliss_y[data]=GetUnitY(s__Chernobyliss__Cbliss_t[data])
call GroupEnumUnitsInRange(Chernobyliss__GROUP, s__Chernobyliss__Cbliss_x[data], s__Chernobyliss__Cbliss_y[data], Chernobyliss__SPREAD_AOE(lvl), null)
loop
set ug=FirstOfGroup(Chernobyliss__GROUP)
exitwhen ug == null
if UnitAlive(ug) and GetUnitAbilityLevel(ug, Chernobyliss__SLOW_ID) == 0 and s__Chernobyliss__Cbliss_dur[data] > 1. / Chernobyliss__TIMER_INTERVAL and GetRandomInt(0, 100) <= R2I(Chernobyliss__CHANCE_TO_SPREAD(lvl)) then
if (IsUnitEnemy((ug), GetOwningPlayer(Chernobyliss__CASTER))) then // INLINED!!
set data=s__Chernobyliss__Cbliss__allocate()
set s__Chernobyliss__Cbliss_cast[data]=Chernobyliss__CASTER
set s__Chernobyliss__Cbliss_t[data]=ug
set s__Chernobyliss__Cbliss_x[data]=GetUnitX(ug)
set s__Chernobyliss__Cbliss_y[data]=GetUnitY(ug)
set s__Chernobyliss__Cbliss_lvl[data]=lvl
set s__Chernobyliss__Cbliss_dur[data]=dur
set s__Chernobyliss__Cbliss_attach[data]=AddSpecialEffectTarget(Chernobyliss__EFFECT2, ug, Chernobyliss__ATTACH)
call DestroyEffect(AddSpecialEffectTarget(Chernobyliss__EFFECT3, ug, Chernobyliss__ATTACH2))
call UnitAddAbility(ug, Chernobyliss__SLOW_ID)
call SetUnitAbilityLevel(ug, Chernobyliss__SLOW_ID, lvl)
set t=NewTimer() // INLINED!!
call SetTimerData(t,data) // INLINED!!
call TimerStart(t, 1. / Chernobyliss__TIMER_INTERVAL, false, function Chernobyliss__Handler)
endif
endif
call GroupRemoveUnit(Chernobyliss__GROUP, ug)
endloop
endif
set t=null
set u=null
set ug=null
endfunction
function Chernobyliss__FilterActions takes nothing returns boolean
local integer data
local timer t
local unit u= GetFilterUnit()
local real x1= Chernobyliss__SPELL_X
local real y1= Chernobyliss__SPELL_Y
local real x2= GetUnitX(u)
local real y2= GetUnitY(u)
local real a= bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
local integer lvl= GetUnitAbilityLevel(Chernobyliss__CASTER, Chernobyliss__ABIL_ID)
if UnitAlive(u) then
if (IsUnitEnemy((u), GetOwningPlayer(Chernobyliss__CASTER))) then // INLINED!!
call M6E(u , (190. + (lvl) * 10.) , Chernobyliss__KB_DURATION , a , Chernobyliss__KB_SFX , Chernobyliss__TREE_AOE , Chernobyliss__ALLOW_MOVE , Chernobyliss__CHECK_PATHING) // INLINED!!
set data=s__Chernobyliss__Cbliss__allocate()
set s__Chernobyliss__Cbliss_cast[data]=Chernobyliss__CASTER
set s__Chernobyliss__Cbliss_t[data]=u
set s__Chernobyliss__Cbliss_x[data]=x2
set s__Chernobyliss__Cbliss_y[data]=y2
set s__Chernobyliss__Cbliss_attach[data]=AddSpecialEffectTarget(Chernobyliss__EFFECT2, u, Chernobyliss__ATTACH)
set s__Chernobyliss__Cbliss_lvl[data]=lvl
set s__Chernobyliss__Cbliss_dur[data]=(20. + (lvl) * 2.)*1.5 // INLINED!!
call DestroyEffect(AddSpecialEffectTarget(Chernobyliss__EFFECT3, u, Chernobyliss__ATTACH2))
call UnitAddAbility(u, Chernobyliss__SLOW_ID)
call SetUnitAbilityLevel(u, Chernobyliss__SLOW_ID, lvl)
set t=NewTimer() // INLINED!!
call SetTimerData(t,data) // INLINED!!
call TimerStart(t, 1. / Chernobyliss__TIMER_INTERVAL, false, function Chernobyliss__Handler)
endif
endif
set u=null
set t=null
return false
endfunction
function Chernobyliss__Actions takes nothing returns nothing
local real x= GetSpellTargetX()
local real y= GetSpellTargetY()
call DestroyEffect(AddSpecialEffect(Chernobyliss__EFFECT1, x, y))
set Chernobyliss__CASTER=GetTriggerUnit()
set Chernobyliss__SPELL_X=x
set Chernobyliss__SPELL_Y=y
call GroupEnumUnitsInRange(Chernobyliss__GROUP, x, y, (195. + ( 5. * (GetUnitAbilityLevel(Chernobyliss__CASTER, Chernobyliss__ABIL_ID)) )), Filter(function Chernobyliss__FilterActions)) // INLINED!!
endfunction
/*function Chernobyliss__OnSpell takes nothing returns boolean
if GetSpellAbilityId() == Chernobyliss__ABIL_ID then
call Chernobyliss__Actions()
endif
return false
endfunction*/
function I5R takes nothing returns nothing
call SetPlayerAllianceStateBJ( Player(10), Player(12), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(13), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(12), Player(10), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(13), Player(11), bj_ALLIANCE_ALLIED_VISION )
set DT[1]="|cff00baffCrabs|r"
set DT[2]="|cff00baffGnolls|r"
set DT[3]="|cff00baffCrazed Madman|r"
set DT[4]="|cff00baffBoar Enforcer|r"
set DT[5]="|cff00baffWood Troll|r"
set DT[6]="|cff00baffSatyr Reaver|r"
set DT[7]="|cff00baffBlood Wolf|r"
set DT[8]="|cff00baffEngorged Blood Spider|r"
set DT[9]="|cff00baffFlesh Giant|r"
if GetRandomInt(1,100) <= 50 then
set DT[10]="|cff00baffDiseased Bear|r"
set MC[10]='n03O'
set PK[10]='n03P'
set NT[10]="Diseased Bears have a tendency to |cffee0000Maul|r enemies in a line. They also have |cffee0000Evasion|r and |cffee0000Disease Cloud|r, and their Commander has |cffee000080% Evasion|r and |cffee000020% Max Health Regeneration|r. It also has |cffee0000Endurance Aura|r and |cffee0000Flat Thorns|r."
else
set DT[10]="|cff00baffPenguin Cutpurse|r"
set MC[10]='n042'
set PK[10]='n043'
set NT[10]="Penguin Cutpurses possess |cffee0000Pilfering Paws|r, allowing them to steal gold on hit. After stealing enough gold, they will attempt to escape into the goal. Kill them to reclaim your gold! Their commander possess |cffee000080% Evasion|r, |cffee0000Unholy Aura|r, |cffee0000Endurance Aura|r, and |cffee0000throws very tasty fish|r at you, how kind of them! Unfortunately, this fish tends to |cffee0000attract sharks|r..."
endif
set DT[11]="|cff00baffFrenetic Demon|r"
set DT[12]="|cff00baffBaby Cubble Bear|r"
set DT[13]="|cff00baffTainted Sluagh|r"
set DT[14]="|cff00baffVampire|r"
set DT[15]="|cff00baffMoss Mey|r"
set DT[16]="|cff00baffRisen Stone|r"
set DT[17]="|cff00baffOgre Gladiator|r"
set DT[18]="|cff00baffBlood Troll Amazoness|r"
set DT[19]="|cff00baffSavage Peccary|r"
set DT[20]="|cff00baffLesser Crystal Dragon|r"
set DT[21]="|cff00baffYvhh la'tami|r"
set DT[22]="|cff00baffBlood Leucro|r"
set DT[23]="|cff00baffFrostwyrm|r"
set DT[24]="|cff00baffDeath Spirit|r"
set DT[25]="|cff00baffDivine Rock|r"
set DT[26]="|cff00baffSea King|r"
set DT[27]="|cff00baffSkeletal Royal|r"
set DT[28]="|cff00baffBlood Marbled Angiswaerd|r"
set DT[29]="|cff00baffAdan'f Blood Warrior|r"
set DT[30]="|cff00baffZombie Necros|r"
set DT[31]="|cff00baffAdan'f War Mage|r"
set DT[32]="|cff00baffLun'Shele Deceiver|r"
set DT[33]="|cff00baffDoom Kra'hei|r"
set DT[34]="|cff00baffPoloh'izh Assassin|r"
set DT[35]="|cff00baffMisshapen Gremish'din|r"
set DT[36]="|cff00baffFanciful Aberration|r"
set DT[37]="|cff00baffForsaken Ouroboros|r"
set DT[38]="|cff00baffS'sugi Malchata|r"
set DT[39]="|cff00baffSnaer Hafwa|r"
if GetRandomInt(1,100) <= 50 then
set DT[40]="|cff00baffMolten Terror|r"
set MC[40]='n045'
set PK[40]='n046'
set NT[40]="Molten Terrors are your end. They deal |cffee0000massive spell damage|r with their |cffee0000area of effect spells|r. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
else
set DT[40]="|cff00baffS'lai Screamer|r"
set MC[40]='n016'
set PK[40]='n03K'
set NT[40]="S'lai Screamers are your end. They are all protected by |cffee0000Evil Angels|r. Their Commander has |cffee0000Lay Waste|r, a devastating area attack. Their Damage, Health and Armor |cffee0000scale endlessly|r based on how many the enemy team kills."
endif
set NT[1]="Crabs are peaceful creatures, that generally don't do much. Their commander passively |cffee0000drains|r the mana of nearby heroes."
set NT[2]="Gnolls |cffee0000Leap|r, same deal. Their |cffee0000ranged|r commander can |cffee0000BERSERK|r; gaining maximum attack and movement speed, as well as the ability to |cffee0000climb walls|r. His |cffee0000Backstab|r ability lets him deal |cffee0000double damage|r from behind."
set NT[3]="Crazed Madmen have |cffee0000Ensnare|r and |cffee0000Bash|r. Their |cffee0000EXTREMELY LONG RANGED commander can attack |cffee0000Multiple Enemies|r. His |cffee0000Trueshot Aura|r passively gives him a |cffee0000MASSIVE DAMAGE BOOST|r."
set NT[4]="Boar Enforcers can |cffee0000Frenzy|r to increase their attack speed. Their commander has a |cffee0000SHORT COOLDOWN REINCARNATION|r, |cffee0000HEALING WAVE|r, |cffee0000spell and damage reduction|r, and |cffee0000BERSERK|r. |cffee0000Lesser Grevious Wounds|r cause his attacks to |cffee0000stack bonus damage on subsequent hits|r, and he has |cffee0000Flat Thorns|r."
set NT[5]="Wood Trolls have a |cffee0000 STRONG STACKABLE SLOW POISON|r. Their leader is able cast |cffee0000Wrath of the Ancients,|r a |cffee0000POWERFUL SUMMONING SPELL|r. |cffee0000KILL SUMMONER FIRST|r. Once the commander is dead, the Wood Trolls lose their Slow Poison."
set NT[6]="Satyr Reavers are |cffee0000permanently invisible|r while their commander is alive, so |cffee0000GET WARDS|r. They also all posses |cffee0000BACKSTAB|r. Their commander has an |cffee0000armor-reducing attack, Vampiric Aura|r, and |cffee0000BERSERK|r."
set NT[7]="Blood Wolves have |cffee0000Bloodlust|r. Their commander has |cffee0000Feedback, Vampiric Aura, BERSERK|r,and |cffee0000BLOOD SCENT|r, which is a |cffee0000MASSIVE ATTACK SPEED AURA|r. He also has |cffee0000Critical Wound|r, for deadly crits and |cffee0000Feedback|r to combust your mana."
set NT[8]="Engorged Blood Spiders can |cffee0000LEAP|r and |cffee0000TOSS EGGS AT YOU|r. Eggs will |cffee0000HATCH INTO ADDITIONAL SPIDERS|R. Their commander shoots sticky strands of |cffee0000Web|r at you, that |cffee0000GRAB, TOSS, DAMAGE, and SLOW|r you if you get hit, as well as possessing |cffee0000Mirror Image|r."
set NT[9]="Flesh Giants have |cffee0000Leap|r. Their commander also has |cffee0000METEOR IMPACT|r, which deals |cffee0000physical area damage|r and |cffee0000knockback|r upon landing on an enemy. He also |cffee0000KNOCKS YOU BACK|r with every attack. He also has a |cffee0000MASSIVE ARMOR AURA|r and |cffee0000HEALING AURA|r,plus |cffee0000damage reduction against attacks|r, |cffee000090% Magic and Ranged attack resistance|r, and |cffee00005% Maximum Health Regeneration|r. He is protected by an |cffee0000Evil Angel|r, which gives a chance to survive lethal damage."
set NT[11]="Frenetic Demons |cffee0000cleave|r. Their commander has |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r. It also has |cffee0000MINDRIP|r, which is a |cffee000099999 Mana Burn|r. It also has |cffee0000REINCARNATION|r, and has an |cffee0000EVIL ANGEL|r."
set NT[12]="Baby Cubble Bears are all protected by |cffee0000Guardian Angels|r, which are exactly like Evil Angels. In addition, they all possess |cffee0000Cuddly Sacrifice|r, which causes them to explode on death, dealing damage in an area after 1 second and permanently increasing the maximum health of friendly units in the area. The Commander also has a |cffee0000Healing Aura|r and |cffee0000Grevious Wounds|r."
set NT[13]="Tainted Sluaghs are ranged units with a |cffee0000MASSIVE CRIT|r. Their commander has |cffee0000Multishot|r."
set NT[14]="Vampires have natural |cffee0000Lifesteal|r and |cffee0000Bash|r. Their commander |cffee0000ATTACKS SUPER FAST|r due to his |cffee0000Overpower|r. He also has |cffee0000Vampiric Aura, Bash, and |cffee0000Grevious Wounds|r."
set NT[15]="Moss Meys have |cffee0000Leap|r, |cffee0000Backstab|r, and |cffee0000Slow Poison|r.. Their commander |cffee0000drains mana from a CRAZY LONG DISTANCE|r. It also has |cffee000080% Evasion|r, |cffee0000Multishot|r, and |cffee0000Backstab|r."
set NT[16]="Risen Stones have |cffee0000high magic resistance|r while their commander is alive. They also have |cffee0000ABOLISH MAGIC|r. In addition to a |cffee0000HEALING AND ARMOR AURA|r, their Commander has |cffee000090% Ranged and Spell Reduction|r, and |cffee0000knocks back on attack|r."
set NT[17]="Ogre Gladiators have |cffee0000Pulverize|r, letting them deal |cffee0000bonus damage that ignores armor|r, as well as |cffee0000Gluttonous Feast|r, which increases their maximum health, damage, and attack speed on hit. Their Commander has |cffee0000Command and Endurance Auras|r, has a |cffee0000Guardian Angel|r, |cffee0000Armor Aura|r, and never misses with his |cffee0000SPIRIT STRIKE|r, which also grants him a 1.4x crit on his attacks."
set NT[18]="Blood Troll Amazonesses have |cffee0000 BERSERK|r and |cffee0000BASH|r. In addtion, they |cffee0000SUMMON BLOOD TOTEMS|r that need to be killed IMMEDIATELY or BAD THINGS WILL HAPPEN. Their commander also has |cffee0000Critical Wound|r and |cffee0000Gluttonous Feast|r."
set NT[19]="Savage Peccaries have |cffee0000Evasion|r, |cffee0000Spirit Strike|r, and |cffee0000Charge|r. Their leader has |cffee0000ARMOR CRUSH|r which temporarily nullifies your armor, and |cffee0000Berserk|r, as well as |cffee0000Vampiric Aura|r and |cffee000090% Ranged and Spell Reduction|r."
set NT[20]="Lesser Crystal Dragons have a short ranged |cffee0000TRIPLE STRIKE|r attack that can encase you in Crystal, and |cffee0000Evasion|r. Their commander has |cffee0000High Evasion|r and |cffee0000Corruption Aura|r, which decreases the armor of nearby enemy units. Also they all |cffee0000LEAP|r."
set NT[21]="Yvhh la'tamis can |cffee0000stun with their Chaos Bolt|r and cast |cffee0000Rain of Fire|r. Their commander has a |cffee0000healing aura and a mana regeneration aura|r, as well as a devastating |cffee0000Glacial Aura|r, that severely slows nearby enemies. They also all have |cffee0000Cleave|r."
set NT[22]="Blood Leucros have |cffee0000Critical Strike|r and |cffee0000Lesser Berserk|r, and their commander has |cffee0000ARMOR CRUSH|r, |cffee0000BERSERK|r, and |cffee0000Feedback|r. It also has |cffee0000Blood Scent|r and Vampiric Aura."
set NT[23]="Frost Wyrms have |cffee0000Curse, making your attacks miss a lot|r. Their leader |cffee0000Mind Rip|r, |cffee0000high Evasion|r |cffee0000Glacial Aura|r and |cffee0000Frostburn|r, which deals damage over time to nearby enemies."
set NT[24]="Death Spirits have |cffee0000Frost Attack|r, |cffee0000Purge|r, |cffee0000Mana Burn|r, and |cffee0000Deathly Dance|r, allowing them to charge forward, dealing area physical damage around them. Their leader has |cffee0000Berserk|r and |cffee0000Corruption Aura|r. They also all have |cffee00005% Max Health Regeneration|r and |cffee0000Phase Shift|r, causing them to become briefly invulnerable while quickly dashing backwards."
set NT[25]="Divine Rocks have |cffee0000MAJESTIC IMPACT|r and |cffee0000possess 80% Ranged and Spell Reduction|r. Their commander has |cffee0000Spell and Ranged Attack Immunity|r, |cffee0000Guardian Angel|r, and his blows can |cffee0000knock you back|r."
set NT[26]="Sea Kings are |cffee0000PERMANENTLY INVISIBLE|r, have |cffee0000Pulverize|r, |cffee0000Bloodlust|r,|cffee0000Ensnare|r, and |cffee0000Grevious Wounds|r. Their leader has spell damage reduction."
set NT[27]="Skeletal Royals have |cffee0000Feedback|r and Evasion. Their ranged commander has |cffee0000Curse|r, |cffee0000ARMOR CRUSH|r, |cffee0000Backstab|r, and |cffee0000Leap|r."
set NT[28]="Blood Marbled Angiswaerds have |cffee0000NASTY THORNS|r, as well as |cffee0000possessing 80% Ranged and Spell Reduction|r. However, if their commander is slain, they will lose their thorns. Their commander can |cffee0000can Deflect Projectiles|r."
set NT[29]="Adan'f Blood Warriors have a |cffee0000HIGHLY DAMAGING STACKABLE POISON STING|r. Their Commander has |cffee0000Armor Crush|r, |cffee0000Berserk, |cffee0000Evil Angel|r, and |cffee0000Mind Rip|r."
set NT[30]="Zombie Nomads are the precursors to your demise, with |cffee0000Vile Poison |r and |cffee0000Leap|r. Their commander has an |cffee0000Evil Angel|r."
set NT[31]="Adan'f War Mages can |cffee0000Cripple|r you severely, and cast |cffee0000Death Bolt|r, dealing |cffee0000MASSIVE DEATH DAMAGE|r and |cffee0000summoning an Adan'f Greedling with Pilfering Paws|r. Their Commander has |cffee0000Curse|r, |cffee0000Mind Rip|r, can cast |cffee0000Unholy Frenzy|r, and will nuke you down with his |cffee0000Fel Bolt|r, which additionally |cffee0000summons multiple Greedlings|r."
set NT[32]="Lun'Shele Deceivers have a ranged |cffee0000Slow Poison. Their their commander has various attack speed buffs and auras, in addition to |cffee0000Berserk|r and |cffee0000Shattering Arrows|r, which pernamently reduces the armor of units struck by her. When slain, you will recover your lost armor points."
set NT[33]="Doom Kra'hei have very high |cffee0000Spell Reduction|r and |cffee0000Spirit Strike|r. Their leader also has the Endurance and Command Auras, as well as the feared |cffee0000Armor Crush|r. In addition, he is protected by a |cffee0000Guardian angel|r."
set NT[34]="Poloh'izh are |cffee0000permanently invisible|r, possess |cffee0000Evasion|r, have |cffee0000Backstab|r, |cffee0000Ensnare|r, and |cffee0000Leap|r. Their Commander can |cffee0000Mind Rip|r and |cffee0000Curse|r you."
set NT[35]="Misshapen Germish'din have |cffee0000Lifesteal|r and |cffee0000Gluttonous Feast|R, which increases their maximum health, damage, and attack speed on hit. Their leader possesses |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r."
set NT[36]="Fanciful Aberrations have |cffee0000Spell Damage Reduction|r and |cffee0000Thorns|r, as well as |cffee000080% Evasion|r. Their commander has an armor-reducing attack and |cffee00005% Max Health Regeneration|r."
set NT[37]="Forsaken Ouroboros have high natural regeneration, as well as |cffee0000Spell Damage Reduction|r, |cffee0000Life Steal,|r |cffee0000Spirit Strike, and |cffee0000Infinite Cycle|r, which resurrects all allied commanders on the map and doubling their maximum health. Their commander has |cffee0000Armor Crush, Blood Scent, Critical Wound, and an area of effect lightning attack|r."
set NT[38]="S'sugi Malchata have a |cffee0000stackable poison|r attack, |cffee0000Lifesteal|r, |cffee0000Gluttonous Feast|r, and |cffee0000Leap|r."
set NT[39]="What? Still not dead yet? Here, have an |cffee0000Armor Crushing|r Snaer Hafwa commander! Her minions possess a slowing attack and |cffee0000Mind Rip|r."
/*
set NT[1]="Crabs are peaceful creatures that generally don't do a lot, although they are capable of |cffee0000leaping|r towards you at high speeds, which grants them a temporary attack and movement speed boost. Their commander passively |cffee0000drains|r the mana of nearby heroes."
set NT[2]="Gnolls are small melee warriors, wearing heavy armor. They are capable of |cffee0000leaping|r towards you at high speeds, which grants them a temporary attack and movement speed boost. Their commander has a medium-range armor reducing attack, and is capable of |cffee0000Berserk|r; gaining a massive attack and movespeed burst, as well as the ability to scale walls. His |cffee0000Backstab|r ability allows him to deal double damage if he hits you from behind, so running away from him is not advised."
set NT[3]="Crazed Madmen are axe wielding melee units. Their commander uses a spear to attack |cffee0000Multiple Enemies|r from a very long range. His |cffee0000Trueshot Aura|r provides him with a massive damage boost, beware!"
set NT[4]="Wild Boars are feral beasts, able to increase their attack speed at will. Their commander is able to |cffee0000Revive|r himself if not killed fast enough. He is also able to heal his allies, has massive damage and spell reduction, as well as |cffee0000Berserk|r, |cffee0000Lesser Fury Swipes|r, and |cffee0000Deals damage to melee attackers|r."
set NT[5]="Wood Trolls have a stackable slow poison attack. Their leader is able cast |cffee0000Wrath of the Ancients,|r a powerful summoning spell. It is recommended that he is dealt with as soon as possible, of you will quickly find yourself overwhelmed.. If the commander is slain, the trees will lose the source of their power, and thusly lose their poisonous attacks."
set NT[6]="Faenrae Reaver are |cffee0000permanently invisible|r while their commander is alive, so some means of seeing invisible is advised. Faenrae Reavers are extremely gifted assassins, having mastered the art of backstabbing. Their commander has an armor-reducing attack, Vampiric Aura, and |cffee0000Berserk|r."
set NT[7]="Blood Wolves are cute, fluffy creatures capable of feasting on your insides to regain their health. Their commander has |cffee0000Feedback, Vampiric Aura, Berserk, Blood Scent|r, which grants a massive attack speed boost to nearby units, and |cffee0000Critical Wound|r, allowing him to score heavy critical hits."
set NT[8]="Engorged Blood Spiders Spiders are easily capable of swarming you if not careful, with their deadly |cffee0000Leaping Strikes|r, which temporarily increaes their attack and movement speed. They are also capable of laying eggs with which to |cffee0000toss|r at you. Their commander attacks by shooting sticky strands of |cffee0000Web|r at you. If they connect, they will stick to you and throw you haphazardly around, dealing 20% of your current health as damage and slowing for 3 seconds. Be sure to avoid being trapped, or it will hit you very easily! The commander can also spawn eggsacks, which will spawn more spiders when killed."
set NT[9]="The Rock Trolls are heavy trolls, made of rock.They possess |cffee0000Leaping Strikes|r, and their massive bulk allows them to |cffee0000possess 80% Magic and Spell Reduction|r. Their commander grants all units in range a |cffee0000major|r armor and |cffee0000regeneration|r bonus, while he himself has additional damage reduction against attacks, |cffee0000spell and magic resistance|r, and |cffee00005% Maximum Health Regeneration|r. His hits are also capable of |cffee0000knocking you back|r, and he is protected by an |cffee0000Evil Angel|r, which gives him a chance to avoid taking fatal damage, instead converting the damage into a heal."
set NT[10]="Diseased Bears are cute, furry animals; able to knock you back if they hit you. They have evasion, and gain increased speed from their commander, who has |cffee000080% Evasion|r and |cffee000020% Max Health Regeneration|r."
set NT[11]="Dark Fiends have a cleaving attack. Their commander is graced by many auras, including |cffee0000Blood Scent|r and Vampiric Aura, which enhance the fiends' capabilities greatly. In addition, he has a devastating |cffee0000Mind Rip|r that will decimate your mana, can |cffee0000Reincarnate|r, and is protected by an |cffee0000Evil Angel|r."
set NT[12]="Snowbeasts are fluffy beasts that are just...freaking adorable! Due to their overwhelming cuteness, they are all protected by |cffee0000Guardian Angels|r. Their ultra-cute Commander also has a |cffee0000Healing Aura|r."
set NT[13]="Lesser Sluaghs are not to be underestimated because of their low damage. They will score a critical strike on almost every attack. Their commander has |cffee0000Multishot|r and is able to |cffee0000slow|r you a lot, so don't get caught in the middle!"
set NT[14]="Arbelogs can bash your head in, stunning you for a short duration. Their commander is extremely fast and deadly, able to decimate you in mere seconds, with his arsenal of |cffee0000Overpower|r,Vampiric Aura, Bash, and |cffee0000Fury Swipes|r, which amplifies the damage he deals with each strike. However, this commander is easily tired, and its movement speed slows down considerably the lower its health is."
set NT[15]="Moss Meys are the worst nightmare for mages. They have a slowing attack, as well as |cffee0000Backstab|r, which is absolutely deadly combined with their |cffee0000Leaping Strikes|r. Their commander drains mana from a wide range. Their commander also has high evasion, making it hard for melee heroes to take her down."
set NT[16]="Swamp Trolls has high magic resistance while their commander is alive. They are also able to dispel positive and negative buffs. In addition to a |cffee0000healing|r and armor aura, their Commander has |cffee000090% Ranged and Spell Reduction|r, and the sheer force of his blows can |cffee0000knock you back|r."
set NT[17]="Young Ogres have big clubs, and are able to ignore your armor with their |cffee0000Pulverize|r ability. Their Commander is able to enhance his fellow Ogres with his Command and Endurance Auras, is protected by a |cffee0000Guardian Angel|r, and never misses with his |cffee0000Spirit Strike|r, whhich also grants him 1.4x damage on his attacks."
set NT[18]="Trolls are able to run through walls, and bash your head in. They are very fast and deadly, be careful! Their commander is also able to |cffee0000critically wound|r his enemies."
set NT[19]="Small Peccaries have Evasion and |cffee0000Spirit Strike|r, which lets them deal 140% normal damage on every attack, that will never miss. Their leader has the deadly |cffee0000Armor Crush|r and |cffee0000Berserk|r, as well as |cffee0000Vampiric Aura|r and |cffee000090% Ranged and Spell Reduction|r."
set NT[20]="Giant Thicket Vipers possess a short ranged poison attack and evasion. Their commander has High Evasion and |cffee0000Corruption Aura|r, which decreases the armor of nearby enemy units."
set NT[21]="Yvhh la'tamis are known for their |cffee0000stuns|r. Their commander has a healing aura and a mana regeneration aura, increasing the rate his allies can stun at. In addition, he has a devastating |cffee0000Glacial Aura|r, that severely slows nearby enemies."
set NT[22]="Giant Leucros are yet another wolf race. They have Critical Strike and |cffee0000Berserk|r, and their commander has the deadly |cffee0000Armor Crush|r, |cffee0000Berserk|r, and |cffee0000Feedback|r combo, as well as |cffee0000Blood Scent|r and Vampiric Aura."
set NT[23]="Frost Wyrms have a medium ranged attack, as well as |cffee0000Curse|r. Their leader has a devastating |cffee0000Mind Rip|r and high Evasion."
set NT[24]="Death Spirits can slow you with cold arrows and heal their allies with Healing Wave, while |cffee0000Purging|r you and burning your mana. Their leader has |cffee0000Berserk|r and Frost Shield, as well as |cffee0000Corruption Aura|r."
set NT[25]="Rock Guardians can knock you back and |cffee0000possess 80% Magic and Spell Reduction|r. Their commander has |cffee0000Spell and Ranged Attack Immunity|r, is protected by a |cffee0000Guardian Angel|r, and his blows can |cffee0000knock you back|r."
set NT[26]="Pirates are invisible, and have an armor ignoring Pulverize, in addition to |cffee0000Fury Swipes|r. Their leader has spell damage reduction."
set NT[27]="Skeletal Sailors are strong warriors with |cffee0000Feedback|r and Evasion. Their commander has |cffee0000Curse|r, as well as the feared |cffee0000Armor Crush|r."
set NT[28]="Marbled Angiswaerds have thorns granted by their commander, as well as |cffee0000possessing 80% Magic and Spell Reduction|r. However, if their commander is slain, they will lose their thorns. Their commander can |cffee0000can Deflect Projectiles|r."
set NT[29]="Adan'f Blood Warriors possess a lethal Poison Sting, which deals stackable damage per second. Their Commander has |cffee0000Armor Crush|r, |cffee0000Berserk, |cffee0000Evil Angel|r, and a devastating |cffee0000Mind Rip|r."
set NT[30]="Zombie Nomads are the precursors to your demise, with a |cffee0000Vile Poison attack|r and |cffee0000Leaping Strikes|r. Their commander is protected by an |cffee0000Evil Angel|r."
set NT[31]="Adan'f Shadow Mages can |cffee0000Cripple|r you severely. Their Commander has |cffee0000Curse|r, a devastating |cffee0000Mind Rip|r, can cast |cffee0000Unholy Frenzy|r on his minions, granting them a major attack speed boost. He also wields deadly death magic in the form of |cffee0000Death Bolt|r."
set NT[32]="Lun'Shele Hunters possess a stackable poison attack, and their commander has various attack speed buffs and auras, in addition to |cffee0000Berserk|r and |cffee0000Shattering Arrows|r, which pernamently reduces the armor of units struck by her. When slain, you will recover your lost armor points."
set NT[33]="Kra'hei have very high |cffee0000Spell Reduction|r and |cffee0000Spirit Strike|r. Their leader also has the Endurance and Command Auras, as well as the feared |cffee0000Armor Crush|r. In addition, he is protected by a |cffee0000Guardian angel|r."
set NT[34]="Poloh'izh are permanently invisible, possess Evasion, and are capable of |cffee0000Backstab|rbing you in addition to their |cffee0000Leaping Strikes|r. Their Commander can |cffee0000Mind Rip|r and |cffee0000Curse|r you."
set NT[35]="Misshapen Germish'din have nothing special. Their leader possesses |cffee0000Blood Scent|r and |cffee0000Vampiric Aura|r."
set NT[36]="Armored Warklins have Spell Damage Reduction and |cffee0000Thorns|r. Their commander has an armor-reducing attack."
set NT[37]="Warklin Maulers have high Spell and Damage Reduction."
set NT[38]="S'sugi Malchata have a |cffee0000stackable poison|r attack, |cffee0000Leaping Strikes|r, and |cffee0000Lifesteal|r."
set NT[39]="What? Still not dead yet? Here, have an |cffee0000Armor Crushing|r Snaer Hafwa commander! Her minions possess a slowing attack and |cffee0000Mind Rip|r."
set NT[40]="S'lai Screamers are your end. They are all protected by |cffee0000Evil Angels|r, and possess |cffee0000Bash|r, |cffee0000Dispel Magic|r, |cffee0000Cripple|r, |cffee0000Animate Dead|r, and |cffee0000Screams of the Fallen, which grants them bonus damage, health, and spells the more of their brethren on both sides that are slain.|r."
*/
endfunction
function I7R takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(false,'A05G',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A05Y',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A096',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A0GA',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A0H8',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A0HW',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A0NT',GetEnumPlayer())
call SetPlayerAbilityAvailableBJ(false,'A0RT',GetEnumPlayer())
endfunction
function I8R takes nothing returns nothing
call ForForce(bj_FORCE_ALL_PLAYERS,function I7R)
call SetPlayerAbilityAvailableBJ(false,'A0H8',Player(PLAYER_NEUTRAL_PASSIVE))
/*call UnitAddAbility(X6V,'A09C')
call UnitRemoveAbility(X6V,'A09C')
call UnitAddAbility(X6V,'A03P')
call UnitAddAbility(X6V,'A03N')
call UnitAddAbility(X6V,'A03O')
call UnitRemoveAbility(X6V,'A03O')
call UnitRemoveAbility(X6V,'A03N')
call UnitRemoveAbility(X6V,'A03P')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0F6')
call UnitRemoveAbility(X6V,'A0F6')
call UnitAddAbility(X6V,'A099')
call UnitRemoveAbility(X6V,'A099')
call UnitAddAbility(X6V,'A04V')
call UnitRemoveAbility(X6V,'A04V')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A05B')
call UnitAddAbility(X6V,'A04Y')
call UnitAddAbility(X6V,'A054')
call UnitRemoveAbility(X6V,'A05B')
call UnitRemoveAbility(X6V,'A04Y')
call UnitRemoveAbility(X6V,'A054')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A052')
call UnitRemoveAbility(X6V,'A052')
call UnitAddAbility(X6V,'A053')
call UnitRemoveAbility(X6V,'A053')
call UnitAddAbility(X6V,'A055')
call UnitRemoveAbility(X6V,'A055')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A058')
call UnitRemoveAbility(X6V,'A058')
call UnitAddAbility(X6V,'A059')
call UnitRemoveAbility(X6V,'A059')
call UnitAddAbility(X6V,'A04W')
call UnitAddAbility(X6V,'A04X')
call UnitAddAbility(X6V,'A056')
call UnitRemoveAbility(X6V,'A056')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A057')
call UnitRemoveAbility(X6V,'A057')
call UnitAddAbility(X6V,'A04Z')
call UnitRemoveAbility(X6V,'A04Z')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A050')
call UnitRemoveAbility(X6V,'A050')
call UnitRemoveAbility(X6V,'A04W')
call UnitRemoveAbility(X6V,'A04X')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A017')
call UnitRemoveAbility(X6V,'A017')
call UnitAddAbility(X6V,'A006')
call UnitRemoveAbility(X6V,'A006')
call UnitAddAbility(X6V,'A030')
call UnitRemoveAbility(X6V,'A030')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A01I')
call UnitRemoveAbility(X6V,'A01I')
call UnitAddAbility(X6V,'A031')
call UnitRemoveAbility(X6V,'A031')
call UnitAddAbility(X6V,'A03L')
call UnitRemoveAbility(X6V,'A03L')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A035')
call UnitRemoveAbility(X6V,'A035')
call UnitAddAbility(X6V,'A03B')
call UnitRemoveAbility(X6V,'A03B')
call UnitAddAbility(X6V,'A06P')
call UnitRemoveAbility(X6V,'A06P')
call UnitAddAbility(X6V,'A05H')
call UnitRemoveAbility(X6V,'A05H')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A09E')
call UnitRemoveAbility(X6V,'A09E')
call UnitAddAbility(X6V,'A0AH')
call UnitRemoveAbility(X6V,'A0AH')
call UnitAddAbility(X6V,'A03M')
call UnitRemoveAbility(X6V,'A03M')
call UnitAddAbility(X6V,'A00S')
call UnitRemoveAbility(X6V,'A00S')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A03I')
call UnitRemoveAbility(X6V,'A03I')
call UnitAddAbility(X6V,'A028')
call UnitRemoveAbility(X6V,'A028')
call UnitAddAbility(X6V,'A0FT')
call UnitRemoveAbility(X6V,'A0FT')
call UnitAddAbility(X6V,'A09U')
call UnitRemoveAbility(X6V,'A09U')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0A5')
call UnitRemoveAbility(X6V,'A0A5')
call UnitAddAbility(X6V,'A0AF')
call UnitRemoveAbility(X6V,'A0AF')
call UnitAddAbility(X6V,'A0A0')
call UnitRemoveAbility(X6V,'A0A0')
call UnitAddAbility(X6V,'A0AK')
call UnitRemoveAbility(X6V,'A0AK')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0AN')
call UnitRemoveAbility(X6V,'A0AN')
call UnitAddAbility(X6V,'A0A6')
call UnitRemoveAbility(X6V,'A0A6')
call UnitAddAbility(X6V,'A0A1')
call UnitRemoveAbility(X6V,'A0A1')
call UnitAddAbility(X6V,'A09W')
call UnitRemoveAbility(X6V,'A09W')
call UnitAddAbility(X6V,'A09Z')
call UnitRemoveAbility(X6V,'A09Z')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0A4')
call UnitRemoveAbility(X6V,'A0A4')
call UnitAddAbility(X6V,'A09U')
call UnitRemoveAbility(X6V,'A09U')
call UnitAddAbility(X6V,'A0A2')
call UnitRemoveAbility(X6V,'A0A2')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A05W')
call UnitRemoveAbility(X6V,'A05W')
call UnitAddAbility(X6V,'A033')
call UnitRemoveAbility(X6V,'A033')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A05O')
call UnitRemoveAbility(X6V,'A05O')
call UnitAddAbility(X6V,'A05M')
call UnitRemoveAbility(X6V,'A05M')
call UnitAddAbility(X6V,'A0FF')
call UnitRemoveAbility(X6V,'A0FF')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0GA')
call UnitRemoveAbility(X6V,'A0GA')
call UnitAddAbility(X6V,'A0G6')
call UnitRemoveAbility(X6V,'A0G6')
call UnitAddAbility(X6V,'A0G8')
call UnitRemoveAbility(X6V,'A0G8')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0G7')
call UnitRemoveAbility(X6V,'A0G7')
call UnitAddAbility(X6V,'A0G9')
call UnitRemoveAbility(X6V,'A0G9')
call UnitAddAbility(X6V,'A0G3')
call UnitRemoveAbility(X6V,'A0G3')
call TriggerSleepAction(.01)
call UnitAddAbility(X6V,'A0G4')
call UnitRemoveAbility(X6V,'A0G4')
call UnitAddAbility(X6V,'A0G5')
call UnitRemoveAbility(X6V,'A0G5')*/
call RemoveUnit(X6V)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function AVR takes nothing returns nothing
//call SetUnitVertexColorBJ(XVV,10.,10.,10.,0)
call SetUnitVertexColorBJ(OXV,10.,10.,10.,0)
endfunction
//! inject main
local weathereffect we
local trigger X_X
local trigger t
local integer i
local unit AXR
local trigger AOR
//local trigger ARR
local integer DGE
local integer DHE
local version v
local integer DOE
local integer Z7X
local region r
call SetCameraBounds(-10240.+GetCameraMargin(CAMERA_MARGIN_LEFT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM),10240.-GetCameraMargin(CAMERA_MARGIN_RIGHT),8192.-GetCameraMargin(CAMERA_MARGIN_TOP),-10240.+GetCameraMargin(CAMERA_MARGIN_LEFT),8192.-GetCameraMargin(CAMERA_MARGIN_TOP),10240.-GetCameraMargin(CAMERA_MARGIN_RIGHT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCDalaran\\DNCDalaranTerrain\\DNCDalaranTerrain.mdl","Environment\\DNC\\DNCDalaran\\DNCDalaranUnit\\DNCDalaranUnit.mdl")
set we=AddWeatherEffect(Rect(-10240.,-8192.,10240.,8192.),'LRma')
call EnableWeatherEffect(we,true)
call NewSoundEnvironment("Default")
call SetAmbientDaySound("IceCrownDay")
call SetAmbientNightSound("IceCrownNight")
call SetMapMusic("Music",true,0)
set GY=CreateSound("Sound\\Interface\\Hint.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(GY,"Hint")
call SetSoundDuration(GY,2006)
set HY=CreateSound("Sound\\Interface\\GoodJob.wav",false,false,false,10,10,"")
call SetSoundParamsFromLabel(HY,"GoodJob")
call SetSoundDuration(HY,2548)
set JY=CreateSound("Sound\\Interface\\Warning.wav",false,false,false,10,10,"")
call SetSoundParamsFromLabel(JY,"Warning")
call SetSoundDuration(JY,1904)
set KY=CreateSound("Abilities\\Spells\\Other\\ANsa\\SacrificeUnit.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(KY,"SacrificeUnit")
call SetSoundDuration(KY,2693)
set LY=CreateSound("Units\\Orc\\HeroBladeMaster\\CriticalStrike.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(LY,"CriticalStrike")
call SetSoundDuration(LY,1962)
set MY=CreateSound("Abilities\\Spells\\Other\\StormEarthFire\\PandarenUltimate.wav",false,true,true,25,10,"SpellsEAX")
call SetSoundParamsFromLabel(MY,"StormEarthFireSound")
call SetSoundDuration(MY,3251)
call SetSoundPitch(MY,1.4)
set PY=CreateSound("Abilities\\Spells\\Undead\\ReviveUndead\\ReviveUndead.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(PY,"ReviveUndead")
call SetSoundDuration(PY,3623)
set QY=CreateSound("Abilities\\Spells\\NightElf\\FaerieFire\\FaerieFireLaunch1.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(QY,"FaerieFire")
call SetSoundDuration(QY,2067)
set SY=CreateSound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(SY,"LightningBolt")
call SetSoundDuration(SY,2136)
set TY=CreateSound("Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(TY,"Tranquility")
call SetSoundDuration(TY,3572)
call FRX()
set DY=CreateCameraSetup()
call CameraSetupSetField(DY,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_ROTATION,90.3,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_ANGLE_OF_ATTACK,327.,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_TARGET_DISTANCE,910.6,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_FIELD_OF_VIEW,90.,.0)
call CameraSetupSetField(DY,CAMERA_FIELD_FARZ,10000.,.0)
call CameraSetupSetDestPosition(DY,3.9,5842.8,.0)
set FY=CreateCameraSetup()
call CameraSetupSetField(FY,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_ROTATION,90.,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_ANGLE_OF_ATTACK,308.4,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_TARGET_DISTANCE,2500.,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_FIELD_OF_VIEW,90.,.0)
call CameraSetupSetField(FY,CAMERA_FIELD_FARZ,10000.,.0)
call CameraSetupSetDestPosition(FY,-5.1,7808.7,.0)
call FEX()
call FXX()
call FVX()
call ConfigureNeutralVictim()
set CXE=Filter(function DDE)
set filterIssueHauntOrderAtLocBJ=Filter(function IssueHauntOrderAtLocBJFilter)
set filterEnumDestructablesInCircleBJ=Filter(function CFE)
set filterGetUnitsInRectOfPlayer=Filter(function GetUnitsInRectOfPlayerFilter)
set filterGetUnitsOfTypeIdAll=Filter(function GetUnitsOfTypeIdAllFilter)
set filterGetUnitsOfPlayerAndTypeId=Filter(function GetUnitsOfPlayerAndTypeIdFilter)
set filterMeleeTrainedUnitIsHeroBJ=Filter(function MeleeTrainedUnitIsHeroBJFilter)
set filterLivingPlayerUnitsOfTypeId=Filter(function LivingPlayerUnitsOfTypeIdFilter)
set DGE=0
loop
exitwhen DGE==16
set bj_FORCE_PLAYER[DGE]=CreateForce()
call ForceAddPlayer(bj_FORCE_PLAYER[DGE],Player(DGE))
set DGE=DGE+1
endloop
set bj_FORCE_ALL_PLAYERS=CreateForce()
call ForceEnumPlayers(bj_FORCE_ALL_PLAYERS,null)
set bj_cineModePriorSpeed=GetGameSpeed()
set bj_cineModePriorFogSetting=IsFogEnabled()
set bj_cineModePriorMaskSetting=IsFogMaskEnabled()
set DGE=0
loop
exitwhen DGE>=bj_MAX_QUEUED_TRIGGERS
set bj_queuedExecTriggers[DGE]=null
set bj_queuedExecUseConds[DGE]=false
set DGE=DGE+1
endloop
set bj_isSinglePlayer=false
set DHE=0
set DGE=0
loop
exitwhen DGE>=12
if(GetPlayerController(Player(DGE))==MAP_CONTROL_USER and GetPlayerSlotState(Player(DGE))==PLAYER_SLOT_STATE_PLAYING)then
set DHE=DHE+1
endif
set DGE=DGE+1
endloop
set bj_isSinglePlayer=(DHE==1)
set bj_rescueSound=CreateSoundFromLabel("Rescue",false,false,false,10000,10000)
set bj_questDiscoveredSound=CreateSoundFromLabel("QuestNew",false,false,false,10000,10000)
set bj_questUpdatedSound=CreateSoundFromLabel("QuestUpdate",false,false,false,10000,10000)
set bj_questCompletedSound=CreateSoundFromLabel("QuestCompleted",false,false,false,10000,10000)
set bj_questFailedSound=CreateSoundFromLabel("QuestFailed",false,false,false,10000,10000)
set bj_questHintSound=CreateSoundFromLabel("Hint",false,false,false,10000,10000)
set bj_questSecretSound=CreateSoundFromLabel("SecretFound",false,false,false,10000,10000)
set bj_questItemAcquiredSound=CreateSoundFromLabel("ItemReward",false,false,false,10000,10000)
set bj_questWarningSound=CreateSoundFromLabel("Warning",false,false,false,10000,10000)
set bj_victoryDialogSound=CreateSoundFromLabel("QuestCompleted",false,false,false,10000,10000)
set bj_defeatDialogSound=CreateSoundFromLabel("QuestFailed",false,false,false,10000,10000)
call DelayedSuspendDecayCreate()
set v=VersionGet()
if(v==VERSION_REIGN_OF_CHAOS)then
set bj_MELEE_MAX_TWINKED_HEROES=bj_MELEE_MAX_TWINKED_HEROES_V0
else
set bj_MELEE_MAX_TWINKED_HEROES=bj_MELEE_MAX_TWINKED_HEROES_V1
endif
call InitQueuedTriggers()
call InitRescuableBehaviorBJ()
call InitDNCSounds()
call InitMapRects()
call InitSummonableCaps()
set DOE=0
loop
set bj_stockAllowedPermanent[DOE]=false
set bj_stockAllowedCharged[DOE]=false
set bj_stockAllowedArtifact[DOE]=false
set DOE=DOE+1
exitwhen DOE>10
endloop
call SetAllItemTypeSlots(11)
call SetAllUnitTypeSlots(11)
set bj_stockUpdateTimer=CreateTimer()
call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INITIAL_DELAY,false,function DBE)
set bj_stockItemPurchased=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(bj_stockItemPurchased,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_SELL_ITEM,null)
call TriggerAddAction(bj_stockItemPurchased,function RemovePurchasedItem)
call DetectGameStarted()
call ExecuteFunc("AIR")
call ExecuteFunc("L5E")
call ExecuteFunc("M7E")
call ExecuteFunc("PGE")
call ExecuteFunc("P_E")
call ExecuteFunc("QQE")
call ExecuteFunc("QSE")
call ExecuteFunc("Q2E")
call ExecuteFunc("Q4E")
call ExecuteFunc("SRE")
call ExecuteFunc("S8E")
call ExecuteFunc("T9E")
call ExecuteFunc("UJE")
call ExecuteFunc("W8E")
call ExecuteFunc("YNE")
call ExecuteFunc("ZVE")
call ExecuteFunc("XZX")
call ExecuteFunc("OXX")
call ExecuteFunc("OQX")
call ExecuteFunc("RJX")
call ExecuteFunc("RLX")
call ExecuteFunc("RWX")
call ExecuteFunc("R0X")
call ExecuteFunc("INX")
call ExecuteFunc("IFX")
call ExecuteFunc("ILX")
call ExecuteFunc("IUX")
call ExecuteFunc("I_X")
call ExecuteFunc("I3X")
call ExecuteFunc("AVX")
call ExecuteFunc("AIX")
call ExecuteFunc("AFX")
call ExecuteFunc("ALX")
call ExecuteFunc("ATX")
call ExecuteFunc("A1X")
call ExecuteFunc("A5X")
call ExecuteFunc("A9X")
call ExecuteFunc("NRX")
call ExecuteFunc("NKX")
call ExecuteFunc("N2X")
call ExecuteFunc("N5X")
call ExecuteFunc("N9X")
call ExecuteFunc("BNX")
call ExecuteFunc("BYX")
call ExecuteFunc("B_X")
call ExecuteFunc("COX")
call ExecuteFunc("CMX")
call ExecuteFunc("C4X")
call ExecuteFunc("DIX")
//call ExecuteFunc("DNX")
call ExecuteFunc("DBX")
call ExecuteFunc("DFX")
call ExecuteFunc("DQX")
call ExecuteFunc("DTX")
call ExecuteFunc("DWX")
//! dovjassinit
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function SOX))
set X_X=null*/
call RegisterSpellEffectEvent('A0PA', function SXX)
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function SAX))
set X_X=null*/
call RegisterSpellEffectEvent('A09K', function SAX)
//set t=CreateTrigger()
//call TriggerAddCondition(t,Condition(function SCX))
//call MOE(II,(t))
//set t=null
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function S2X))*/
set t=null
call RegisterSpellEffectEvent('A062', function S1X)
set FLESHLESSARMOR=CreateTrigger()
call TriggerAddCondition(FLESHLESSARMOR,Condition(function S5X))
call MOE(II,(FLESHLESSARMOR))
call DisableTrigger(FLESHLESSARMOR)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function TEX))
set t=null*/
call RegisterSpellEffectEvent('A060', function TVX)
set i=0
/*set Z_Y= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Z_Y, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Z_Y, Condition(function Chernobyliss__OnSpell))
set Z_Y = null*/
call RegisterSpellEffectEvent(Chernobyliss__ABIL_ID, function Chernobyliss__Actions)
set P_9= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(P_9, EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(P_9, Condition(function CalloftheHaunted___OnSpell))
set P_9 = null
/*set Q_8= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Q_8, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Q_8, Condition(function DeathCall___OnSpell))*/
call RegisterSpellEffectEvent('A0AM', function DeathCall___OnSpell)
/*set Q_7= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Q_7, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Q_7, Condition(function DandDecay___OnSpell))*/
call RegisterSpellEffectEvent('A0AD', function DandDecay___OnSpell)
//set Q_7 = null
/*set Q_6= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Q_6, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Q_6, Condition(function DtaHoliday___OnSpell))
set Q_6 = null*/
call RegisterSpellEffectEvent('A0AG', function DtaHoliday___OnSpell)
set Q_5= CreateTrigger()
call TriggerRegisterPlayerChatEvent(Q_5,Player(0),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(1),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(2),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(3),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(4),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(5),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(6),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(7),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(8),"-revivefix",true)
call TriggerRegisterPlayerChatEvent(Q_5,Player(9),"-revivefix",true)
call TriggerAddCondition(Q_5, Condition(function ReviveSafe___OnSpell))
set Q_5 = null
set Q_4= CreateTrigger()
call TriggerRegisterPlayerChatEvent(Q_4,Player(0),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(1),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(2),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(3),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(4),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(5),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(6),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(7),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(8),"-toggleautoselect",true)
call TriggerRegisterPlayerChatEvent(Q_4,Player(9),"-toggleautoselect",true)
call TriggerAddCondition(Q_4, Condition(function LichToggleFunc))
set Q_4 = null
set Q_3= CreateTrigger()
call TriggerRegisterPlayerChatEvent(Q_3,Player(0),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(1),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(2),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(3),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(4),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(5),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(6),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(7),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(8),"-tips",true)
call TriggerRegisterPlayerChatEvent(Q_3,Player(9),"-tips",true)
call TriggerAddCondition(Q_3, Condition(function TipsToggleFunc))
set Q_3 = null
set X2=CreateTrigger()
set OGV=bj_mapInitialPlayableArea
loop
call TriggerRegisterPlayerUnitEvent(X2,Player(i),EVENT_PLAYER_UNIT_ATTACKED,WE)
set i=i+1
exitwhen i==16
endloop
call TriggerAddCondition(X2,Condition(function TMX))
call TriggerAddAction(X2,function T9X)
set AXR=CreateUnit(Player(14),'h007',700.,700.,0)
call UnitAddAbility(AXR,'A068')
call RemoveUnit(AXR)
set AXR=null
call Preload("Abilities\\Spells\\Undead\\Web\\Webmissile.mdl")
call Preload("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
call Preload("Abilities\\Spells\\Undead\\Web\\Web_AirTarget.mdl")
call Preload("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
call Preload("Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
call Preload("Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
call Preload("war3mapImported\\Winter Blast HD.mdx")
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function UIX))
set t=null
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function UNX))
call MOE(II,(t))
set t=null
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function UCX))
call MOE(II,(t))
set t=null
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function UFX))
call MOE(II,(t))
set t=null
//set t=CreateTrigger()
set A5E[0]=90000
set A5E[1]=125
set A5E[2]=175
set A5E[3]=225
/*call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function YTX)
set t=null*/
call RegisterSpellEffectEvent('A00J', function YTX)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function YWX)*/
call RegisterSpellEffectEvent('A014', function YWX)
//set t=null
//set t=CreateTrigger()
set A6E[0]=10.
set A6E[1]=25.
set A6E[2]=40.
set A6E[3]=60.
set A6E[4]=120.
set A6E[5]=156.
set A6E[6]=210.
set A6E[7]=260.
set A6E[8]=315.
set A6E[9]=400.
/*call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function YZX)
set t=null*/
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function ZEX))
call TriggerAddAction(X_X,function ZXX)
set X_X=null*/
call RegisterSpellEffectEvent('A07U', function ZXX)
set AOR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(AOR,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(AOR,Condition(function ZCX))
call TriggerAddAction(AOR,function ZDX)
set AOR=null
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function VFO))
call TriggerAddAction(t,function VGO)
set t=null*/
call RegisterSpellEffectEvent('A004', function VGO)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function VMO))
call TriggerAddAction(t,function VPO)
set t=null*/
call RegisterSpellEffectEvent('A09F', function VPO)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function VUO))
call TriggerAddAction(t,function VWO)
set t=null*/
call RegisterSpellEffectEvent('A00F', function VWO)
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function V2O))
set X_X=null*/
call RegisterSpellEffectEvent('A06S', function V1O)
call RegisterSpellEffectEvent('A07V', function V1O)
call RegisterSpellEffectEvent('A0J3', function V1O)
call RegisterSpellEffectEvent('A08L', function V1O)
/*set ARR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ARR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ARR,Condition(function ESO))*/
call RegisterSpellEffectEvent('A06T', function ESO)
set OZV=CreateSound("Abilities\\Spells\\Other\\Submerge\\Submerge1.wav",false,true,true,10,10,"")
call SetSoundParamsFromLabel(OZV,"SubmergeSound")
set OYV=InitHashtable()
set O_V[1]=.04*50
set O0V[1]=3
set O1V[1]=.25
set O2V[1]=460
set O_V[2]=.04*75
set O0V[2]=3
set O1V[2]=.25
set O2V[2]=460
set O_V[3]=.04*100
set O0V[3]=3
set O1V[3]=.25
set O2V[3]=460
set O_V[4]=.04*150
set O0V[4]=3
set O1V[4]=.25
set O2V[4]=460
set O_V[5]=.04*200
set O0V[5]=3
set O1V[5]=.25
set O2V[5]=460
set O_V[6]=.04*275
set O0V[6]=3
set O1V[6]=.25
set O2V[6]=460
set O_V[7]=.04*350
set O0V[7]=3
set O1V[7]=.25
set O2V[7]=460
set O_V[8]=.04*800
set O0V[8]=3
set O1V[8]=.25
set O2V[8]=460
set O_V[9]=.04*1800
set O0V[9]=3
set O1V[9]=.25
set O2V[9]=460
set O_V[10]=.04*2700
set O0V[10]=3
set O1V[10]=.25
set O2V[10]=460
//set ARR=null
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function EYO))
set X_X=null*/
call RegisterSpellEffectEvent('A07V', function EWO)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function XTO))*/
call RegisterSpellEffectEvent('A042', function XSO)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function X3O))
set t=CreateTrigger()*/
call RegisterSpellEffectEvent('A04W', function XYO)
/*call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function X5O))*/
call RegisterSpellEffectEvent('A04X', function X4O)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function OBO))*/
call RegisterSpellEffectEvent('A0FD', function ONO)
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function OFO))
set X_X=null*/
call RegisterSpellEffectEvent('A0DF', function ODO)
/*set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function OHO))*/
call RegisterSpellEffectEvent('A0HK', function OGO)
/*set X_X=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function OLO))*/
//call RegisterSpellEffectEvent('A0BX', function OKO)
set X_X=CreateTrigger()
/*call TriggerRegisterAnyUnitEventBJ(X_X,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X_X,Condition(function O5O))*/
call RegisterSpellEffectEvent('A03B', function O3O)
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function CZO))
call MOE(II,(t))
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function D7O))
call MOE(II,(t))
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function FVO))
call MOE(II,(t))
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function J8O))
call MOE(II,(t))
set t=CreateTrigger()
call TriggerAddCondition(t,Condition(function K3O))
call MOE(II,(t))
set VRV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VRV,80.,XPV)
call TriggerAddCondition(VRV,Condition(function TDO))
call TriggerAddAction(VRV,function TGO)
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function W8O))
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(t,Condition(function OVR))
set i=0
set SC=StartingLives
set TC=StartingLives
set YC=DialogCreate()
set i=0
loop
exitwhen(i>5)
set VD[i]=0
set i=i+1
endloop
set ED=100.
set i=0
loop
exitwhen(i>12)
set XD[i]=CreateTimer()
set OD[i]=false
set VL[i]=null
set PL[i]=null
set CQ[i]=600.
set i=i+1
endloop
set RD=DialogCreate()
set i=0
loop
exitwhen(i>3)
set AD[i]=0
set BD[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>2)
set KD[i]=false
set QD[i]=false
set GT[i]=0
set HT[i]=0
set i=i+1
endloop
set SD=CreateGroup()
set i=0
loop
exitwhen(i>1)
set TD[i]=0
set QF[i]=0
set SF[i]=0
set TF[i]=0
set WF[i]=CreateGroup()
set BG[i]=0
set FG[i]=0
set HG[i]=0
set JG[i]=0
set MG[i]=0
set PG[i]=""
set SG[i]=""
set UG[i]=false
set YG[i]=0
set XH[i]=0
set OH[i]=0
set GH[i]=0
set HH[i]=0
set JH[i]=0
set KH[i]=0
set LH[i]=0
set UH[i]=0
set WH[i]=0
set ZH[i]=0
set VJ[i]=0
set XJ[i]=CreateGroup()
set BJ[i]=0
set CJ[i]=0
set DJ[i]=0
set FJ[i]=CreateGroup()
set LJ[i]=0
set MJ[i]=0
set YJ[i]=CreateGroup()
set EM[i]=false
set IM[i]=0
set AM[i]=0
set JM[i]=0
set KM[i]=false
set LM[i]=0
set MM[i]=0
set PM[i]=0
set XP[i]=0
set OP[i]=0
set RP[i]=0
set IP[i]=0
set KP[i]=0
set LP[i]=0
set MP[i]=0
set PP[i]=0
set QP[i]=0
set SQ[i]=""
set UQ[i]=0
set VS[i]=CreateForce()
set XS[i]=""
set IS[i]=0
set AS[i]=CreateMultiboard()
set BS[i]=""
set GS[i]=0
set HS[i]=0
set JS[i]=0
set KS[i]=0
set EU[i]=false
set OU[i]=0
set RU[i]=0
set CU[i]=CreateTimer()
set i=i+1
endloop
set i=0
loop
exitwhen(i>8)
set UD[i]=""
set SS[i]=""
set TS[i]=0
set US[i]=0
set WS[i]=0
set BT[i]=0
set CT[i]=0
set FT[i]=0
set JT[i]=false
set MT[i]=0
set TT[i]=false
set WT[i]=false
set i=i+1
endloop
set VG=CreateGroup()
set IG=CreateGroup()
set EH=CreateGroup()
set AH=CreateGroup()
set PH=CreateGroup()
set OJ=CreateGroup()
set ZJ=CreateGroup()
set AK=CreateGroup()
set NK=CreateGroup()
set BK=CreateGroup()
set CK=CreateGroup()
set GK=CreateGroup()
set QK=CreateGroup()
set SK=CreateGroup()
set TK=CreateGroup()
set UK=CreateGroup()
set WK=CreateGroup()
set XL=CreateGroup()
set GL=CreateGroup()
set KL=CreateGroup()
set NM=CreateGroup()
set CM=CreateGroup()
set TM=CreateGroup()
set XQ=CreateForce()
set BQ=CreateForce()
set ES=CreateForce()
set LS=3
set MS=CreateForce()
set PS=2
set i=0
loop
exitwhen(i>99)
set QS[i]=0
set i=i+1
endloop
set YS=1
set i=0
loop
exitwhen(i>10)
set ZS[i]=0
set IT[i]=0
set AT[i]=0
set KT[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>15)
set VT[i]=0
set ET[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>41)
set NT[i]=""
set i=i+1
endloop
set i=0
loop
exitwhen(i>40)
set DT[i]=""
set QT[i]=0
set i=i+1
endloop
set DU=CreateTrigger()
set UY=CreateTrigger()
set r = CreateRegion()
call RegionAddRect(r,GetWorldBounds())
call TriggerRegisterEnterRegion(UY,r,null)
call TriggerAddCondition(UY,Condition(function FIX))
call TriggerAddAction(UY,function FCX)
set WY=CreateTrigger()
call TriggerRegisterEnterRegion(WY,r,null)
call TriggerAddCondition(WY,Condition(function FFX))
call TriggerAddAction(WY,function FKX)
set YY=CreateTrigger()
call TriggerRegisterEnterRegion(YY,r,null)
call TriggerAddCondition(YY,Condition(function FMX))
call TriggerAddAction(YY,function FTX)
set ZY=CreateTrigger()
call TriggerRegisterEnterRegion(ZY,r,null)
call TriggerAddCondition(ZY,Condition(function FWX))
call TriggerAddAction(ZY,function F0X)
set VZ=CreateTrigger()
call TriggerRegisterEnterRegion(VZ,r,null)
call TriggerAddCondition(VZ,Condition(function F2X))
call TriggerAddAction(VZ,function F6X)
set EZ=CreateTrigger()
call TriggerRegisterEnterRegion(EZ,r,null)
call TriggerAddCondition(EZ,Condition(function F8X))
call TriggerAddAction(EZ,function GXX)
set XZ=CreateTrigger()
call TriggerRegisterEnterRegion(XZ,r,null)
call TriggerAddCondition(XZ,Condition(function GRX))
call TriggerAddAction(XZ,function GBX)
set OZ=CreateTrigger()
call TriggerRegisterEnterRegion(OZ,r,null)
call TriggerAddCondition(OZ,Condition(function GDX))
call TriggerAddAction(OZ,function GJX)
set RZ=CreateTrigger()
call TriggerRegisterEnterRegion(RZ,r,null)
call TriggerAddCondition(RZ,Condition(function GLX))
call TriggerAddAction(RZ,function GSX)
set IZ=CreateTrigger()
call TriggerRegisterEnterRegion(IZ,r,null)
call TriggerAddCondition(IZ,Condition(function GUX))
call TriggerAddAction(IZ,function G_X)
set AZ=CreateTrigger()
call TriggerRegisterEnterRegion(AZ,r,null)
call TriggerAddCondition(AZ,Condition(function G1X))
call TriggerAddAction(AZ,function G2X)
set NZ=CreateTrigger()
call TriggerRegisterEnterRegion(NZ,r,null)
call TriggerAddCondition(NZ,Condition(function G4X))
call TriggerAddAction(NZ,function G5X)
set BZ=CreateTrigger()
call TriggerRegisterEnterRegion(BZ,r,null)
call TriggerAddCondition(BZ,Condition(function G7X))
call TriggerAddAction(BZ,function G8X)
set CZ=CreateTrigger()
call TriggerRegisterEnterRegion(CZ,r,null)
call TriggerAddCondition(CZ,Condition(function HVX))
call TriggerAddAction(CZ,function HEX)
set DZ=CreateTrigger()
call TriggerRegisterEnterRegion(DZ,r,null)
call TriggerAddCondition(DZ,Condition(function HOX))
call TriggerAddAction(DZ,function HRX)
set FZ=CreateTrigger()
call TriggerRegisterEnterRegion(FZ,r,null)
call TriggerAddCondition(FZ,Condition(function HAX))
call TriggerAddAction(FZ,function HNX)
set GZ=CreateTrigger()
call TriggerRegisterEnterRegion(GZ,r,null)
call TriggerAddCondition(GZ,Condition(function HCX))
call TriggerAddAction(GZ,function HDX)
set HZ=CreateTrigger()
call TriggerRegisterEnterRegion(HZ,r,null)
call TriggerAddCondition(HZ,Condition(function HGX))
call TriggerAddAction(HZ,function HJX)
set JZ=CreateTrigger()
call TriggerRegisterEnterRegion(JZ,r,null)
call TriggerAddCondition(JZ,Condition(function HLX))
call TriggerAddAction(JZ,function HQX)
set KZ=CreateTrigger()
call TriggerRegisterEnterRegion(KZ,r,null)
call TriggerAddCondition(KZ,Condition(function HTX))
call TriggerAddAction(KZ,function HUX)
set LZ=CreateTrigger()
call TriggerRegisterEnterRegion(LZ,r,null)
call TriggerAddCondition(LZ,Condition(function HYX))
call TriggerAddAction(LZ,function HZX)
set MZ=CreateTrigger()
call TriggerRegisterEnterRegion(MZ,r,null)
call TriggerAddCondition(MZ,Condition(function H0X))
call TriggerAddAction(MZ,function H1X)
set PZ=CreateTrigger()
call TriggerRegisterEnterRegion(PZ,r,null)
call TriggerAddCondition(PZ,Condition(function H3X))
call TriggerAddAction(PZ,function H4X)
set QZ=CreateTrigger()
call TriggerRegisterEnterRegion(QZ,r,null)
call TriggerAddCondition(QZ,Condition(function H6X))
call TriggerAddAction(QZ,function H7X)
set SZ=CreateTrigger()
call TriggerRegisterEnterRegion(SZ,r,null)
call TriggerAddCondition(SZ,Condition(function H9X))
call TriggerAddAction(SZ,function JVX)
set TZ=CreateTrigger()
call TriggerRegisterEnterRegion(TZ,r,null)
call TriggerAddCondition(TZ,Condition(function JXX))
call TriggerAddAction(TZ,function JOX)
set UZ=CreateTrigger()
call TriggerRegisterEnterRegion(UZ,r,null)
call TriggerAddCondition(UZ,Condition(function JIX))
call TriggerAddAction(UZ,function JAX)
set WZ=CreateTrigger()
call TriggerRegisterEnterRegion(WZ,r,null)
call TriggerAddCondition(WZ,Condition(function JBX))
call TriggerAddAction(WZ,function JDX)
set YZ=CreateTrigger()
call TriggerRegisterEnterRegion(YZ,r,null)
call TriggerAddCondition(YZ,Condition(function JGX))
call TriggerAddAction(YZ,function JHX)
set ZZ=CreateTrigger()
call TriggerRegisterEnterRegion(ZZ,r,null)
call TriggerAddCondition(ZZ,Condition(function JKX))
call TriggerAddAction(ZZ,function JLX)
set V0=CreateTrigger()
call TriggerRegisterEnterRegion(V0,r,null)
call TriggerAddCondition(V0,Condition(function JPX))
call TriggerAddAction(V0,function JQX)
set E0=CreateTrigger()
call TriggerRegisterEnterRegion(E0,r,null)
call TriggerAddCondition(E0,Condition(function JTX))
call TriggerAddAction(E0,function JUX)
set X0=CreateTrigger()
call TriggerRegisterEnterRegion(X0,r,null)
call TriggerAddCondition(X0,Condition(function JYX))
call TriggerAddAction(X0,function JZX)
set O0=CreateTrigger()
call TriggerRegisterEnterRegion(O0,r,null)
call TriggerAddCondition(O0,Condition(function J0X))
call TriggerAddAction(O0,function J1X)
set R0=CreateTrigger()
call TriggerRegisterEnterRegion(R0,r,null)
call TriggerAddCondition(R0,Condition(function J3X))
call TriggerAddAction(R0,function J4X)
set I0=CreateTrigger()
call TriggerRegisterEnterRegion(I0,r,null)
call TriggerAddCondition(I0,Condition(function J6X))
call TriggerAddAction(I0,function J7X)
set A0=CreateTrigger()
call TriggerRegisterEnterRegion(A0,r,null)
call TriggerAddCondition(A0,Condition(function J9X))
call TriggerAddAction(A0,function KEX)
set N0=CreateTrigger()
call TriggerRegisterEnterRegion(N0,r,null)
call TriggerAddCondition(N0,Condition(function KOX))
call TriggerAddAction(N0,function KRX)
set B0=CreateTrigger()
call TriggerRegisterEnterRegion(B0,r,null)
call TriggerAddCondition(B0,Condition(function KAX))
call TriggerAddAction(B0,function KNX)
set C0=CreateTrigger()
call TriggerRegisterEnterRegion(C0,r,null)
call TriggerAddCondition(C0,Condition(function KCX))
call TriggerAddAction(C0,function KDX)
set D0=CreateTrigger()
call TriggerRegisterEnterRegion(D0,r,null)
call TriggerAddCondition(D0,Condition(function KGX))
call TriggerAddAction(D0,function KHX)
set F0=CreateTrigger()
call TriggerRegisterEnterRegion(F0,r,null)
call TriggerAddCondition(F0,Condition(function KKX))
call TriggerAddAction(F0,function KLX)
set G0=CreateTrigger()
call TriggerRegisterEnterRegion(G0,r,null)
call TriggerAddCondition(G0,Condition(function KPX))
call TriggerAddAction(G0,function KQX)
set H0=CreateTrigger()
call TriggerRegisterEnterRegion(H0,r,null)
call TriggerAddCondition(H0,Condition(function KTX))
call TriggerAddAction(H0,function KUX)
set J0=CreateTrigger()
call TriggerRegisterEnterRegion(J0,r,null)
call TriggerAddCondition(J0,Condition(function KYX))
call TriggerAddAction(J0,function KZX)
set J00=CreateTrigger()
call TriggerRegisterEnterRegion(J00,r,null)
call TriggerAddCondition(J00,Condition(function KYYX))
call TriggerAddAction(J00,function KZZX)
set K0=CreateTrigger()
call TriggerRegisterEnterRegion(K0,r,null)
call TriggerAddCondition(K0,Condition(function K0X))
call TriggerAddAction(K0,function K2X)
set K00=CreateTrigger()
call TriggerRegisterEnterRegion(K00,r,null)
call TriggerAddCondition(K00,Condition(function K0XX))
call TriggerAddAction(K00,function K2XX)
set K000=CreateTrigger()
call TriggerRegisterEnterRegion(K00,r,null)
call TriggerAddCondition(K000,Condition(function K0XXX))
call TriggerAddAction(K000,function K2XXX)
set L0=CreateTrigger()
call TriggerRegisterEnterRegion(L0,r,null)
call TriggerAddCondition(L0,Condition(function K4X))
call TriggerAddAction(L0,function K5X)
set M0=CreateTrigger()
call TriggerRegisterEnterRegion(M0,r,null)
call TriggerAddCondition(M0,Condition(function K7X))
call TriggerAddAction(M0,function K8X)
set P0=CreateTrigger()
call TriggerRegisterEnterRegion(P0,r,null)
call TriggerAddCondition(P0,Condition(function LVX))
call TriggerAddAction(P0,function LEX)
set Q0=CreateTrigger()
call TriggerRegisterEnterRegion(Q0,r,null)
call TriggerAddCondition(Q0,Condition(function LOX))
call TriggerAddAction(Q0,function LRX)
set S0=CreateTrigger()
call TriggerRegisterEnterRegion(S0,r,null)
call TriggerAddCondition(S0,Condition(function LAX))
call TriggerAddAction(S0,function LNX)
set T0=CreateTrigger()
call TriggerRegisterEnterRegion(T0,r,null)
call TriggerAddCondition(T0,Condition(function LCX))
call TriggerAddAction(T0,function LDX)
set U0=CreateTrigger()
call TriggerRegisterEnterRegion(U0,r,null)
call TriggerAddCondition(U0,Condition(function LGX))
call TriggerAddAction(U0,function LHX)
set W0=CreateTrigger()
call TriggerRegisterEnterRegion(W0,r,null)
call TriggerAddCondition(W0,Condition(function LKX))
call TriggerAddAction(W0,function LLX)
set Y0=CreateTrigger()
call TriggerRegisterEnterRegion(Y0,r,null)
call TriggerAddCondition(Y0,Condition(function LPX))
call TriggerAddAction(Y0,function LQX)
set Z0=CreateTrigger()
call TriggerRegisterEnterRegion(Z0,r,null)
call TriggerAddCondition(Z0,Condition(function LTX))
call TriggerAddAction(Z0,function LUX)
set V1=CreateTrigger()
call TriggerRegisterEnterRegion(V1,r,null)
call TriggerAddCondition(V1,Condition(function LYX))
call TriggerAddAction(V1,function LZX)
set E1=CreateTrigger()
call TriggerRegisterEnterRegion(E1,r,null)
call TriggerAddCondition(E1,Condition(function L0X))
call TriggerAddAction(E1,function L1X)
set X1=CreateTrigger()
call TriggerRegisterEnterRegion(X1,r,null)
call TriggerAddCondition(X1,Condition(function L3X))
call TriggerAddAction(X1,function L4X)
set O1=CreateTrigger()
call TriggerRegisterEnterRegion(O1,r,null)
call TriggerAddCondition(O1,Condition(function L6X))
call TriggerAddAction(O1,function L7X)
set BS[1]="|cffff0303"
set BS[2]="|cff0042ff"
set BS[3]="|cff1ce6b9"
set BS[4]="|cff540081"
set BS[5]="|cfffffc01"
set BS[6]="|cfffeba0e"
set BS[7]="|cff20c000"
set BS[8]="|cffe55bb0"
set BS[9]="|cff959697"
set BS[10]="|cff7ebff1"
set BS[11]="|cff106246"
set BS[12]="|cff4e2a04"
set BS[13]="|cff000000"
set BS[14]="|cffffffff"
set BS[15]="|cffffcc00"
set BS[16]="|cff006666"
set R1=CreateTrigger()
call TriggerRegisterTimerEventSingle(R1,.0)
call TriggerAddAction(R1,function MIX)
set I1=CreateTrigger()
call DisableTrigger(I1)
call TriggerAddAction(I1,function MDX)
set A1=CreateTrigger()
call DisableTrigger(A1)
call TriggerRegisterTimerEventPeriodic(A1,1.)
call TriggerAddAction(A1,function MMX)
set N1=CreateTrigger()
call TriggerRegisterPlayerEventLeave(N1,Player(0))
call TriggerRegisterPlayerEventLeave(N1,Player(1))
call TriggerRegisterPlayerEventLeave(N1,Player(2))
call TriggerRegisterPlayerEventLeave(N1,Player(3))
call TriggerRegisterPlayerEventLeave(N1,Player(4))
call TriggerRegisterPlayerEventLeave(N1,Player(5))
call TriggerRegisterPlayerEventLeave(N1,Player(6))
call TriggerRegisterPlayerEventLeave(N1,Player(7))
call TriggerRegisterPlayerEventLeave(N1,Player(8))
call TriggerRegisterPlayerEventLeave(N1,Player(9))
call TriggerAddAction(N1,function MQX)
set B1=CreateTrigger()
call DisableTrigger(B1)
call TriggerRegisterAnyUnitEventBJ(B1,EVENT_PLAYER_HERO_LEVEL)
call TriggerAddCondition(B1,Condition(function MTX))
call TriggerAddAction(B1,function MWX)
set C1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C1,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(C1,Condition(function M_X))
call TriggerAddAction(C1,function M1X)
set D1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(D1,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(D1,Condition(function M4X))
call TriggerAddAction(D1,function M7X)
set F1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(F1,Player(0),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(1),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(2),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(3),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(4),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(5),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(6),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(7),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(8),"-promote",false)
call TriggerRegisterPlayerChatEvent(F1,Player(9),"-promote",false)
call TriggerAddCondition(F1,Condition(function M9X))
call TriggerAddAction(F1,function POX)
set G1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(G1,Player(0),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(1),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(2),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(3),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(4),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(5),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(6),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(7),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(8),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(9),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(10),"-monsters",true)
call TriggerRegisterPlayerChatEvent(G1,Player(11),"-monsters",true)
call TriggerAddAction(G1,function PCX)
set H1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(H1,Player(0),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(1),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(2),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(3),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(4),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(5),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(6),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(7),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(8),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(9),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(10),"-repick",true)
call TriggerRegisterPlayerChatEvent(H1,Player(11),"-repick",true)
call TriggerAddCondition(H1,Condition(function PFX))
call TriggerAddAction(H1,function PJX)
set J1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(J1,Player(0),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(1),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(2),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(3),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(4),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(5),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(6),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(7),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(8),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(9),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(10),"-zoom",false)
call TriggerRegisterPlayerChatEvent(J1,Player(11),"-zoom",false)
call TriggerAddCondition(J1,Condition(function PLX))
call TriggerAddAction(J1,function PSX)
set K1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(K1,Player(0),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(1),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(2),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(3),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(4),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(5),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(6),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(7),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(8),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(9),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(10),"-tm",false)
call TriggerRegisterPlayerChatEvent(K1,Player(11),"-tm",false)
call TriggerAddAction(K1,function PWX)
call TriggerAddCondition(K1,Condition(function PUX))
set L1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(L1,Player(0),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(1),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(2),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(3),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(4),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(5),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(6),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(7),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(8),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(9),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(10),"-range",false)
call TriggerRegisterPlayerChatEvent(L1,Player(11),"-range",false)
call TriggerAddAction(L1,function P4X)
set M1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(M1,Player(0),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(1),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(2),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(3),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(4),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(5),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(6),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(7),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(8),"-suicide",true)
call TriggerRegisterPlayerChatEvent(M1,Player(9),"-suicide",true)
call TriggerAddAction(M1,function P7X)
set P1=CreateTrigger()
call TriggerRegisterPlayerChatEvent(P1,Player(0),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(1),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(2),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(3),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(4),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(5),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(6),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(7),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(8),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(9),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(10),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(11),"-clear",false)
call TriggerRegisterPlayerChatEvent(P1,Player(0),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(1),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(2),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(3),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(4),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(5),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(6),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(7),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(8),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(9),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(10),"-c",true)
call TriggerRegisterPlayerChatEvent(P1,Player(11),"-c",true)
call TriggerAddAction(P1,function QWX)
set Q1=CreateTrigger()
call TriggerAddAction(Q1,function QZX)
/*set U1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(U1,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(U1,Condition(function SDX))
call TriggerAddAction(U1,function SHX)*/
call RegisterSpellEffectEvent('A06I', function SHX)
set W1=CreateTrigger()
call DisableTrigger(W1)
call TriggerRegisterTimerEventPeriodic(W1,.01)
call TriggerAddAction(W1,function SQX)
set Y1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Y1,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Y1,Condition(function STX))
call TriggerAddAction(Y1,function SUX)
/*set Z1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Z1,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Z1,Condition(function TAX))
call TriggerAddAction(Z1,function TNX)*/
call RegisterSpellEffectEvent('A05I', function TNX)
set V2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(V2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(V2,Condition(function TCX))
call TriggerAddAction(V2,function TDX)
/*set E2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(E2,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(E2,Condition(function TGX))
call TriggerAddAction(E2,function THX)*/
call RegisterSpellEffectEvent('A06A', function THX)
set O2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(O2,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(O2,Condition(function UVX))
call TriggerAddAction(O2,function UXX)
set R2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(R2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(R2,Condition(function UJX))
call TriggerAddAction(R2,function UMX)
set I2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(I2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(I2,Condition(function UQX))
call TriggerAddAction(I2,function UUX)
set A2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(A2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(A2,Condition(function UYX))
call TriggerAddAction(A2,function U0X)
set N2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(N2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(N2,Condition(function U2X))
call TriggerAddAction(N2,function U5X)
set B2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(B2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(B2,Condition(function U7X))
call TriggerAddAction(B2,function WVX)
set C2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(C2,Condition(function WXX))
call TriggerAddAction(C2,function WIX)
set D2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(D2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(D2,Condition(function WNX))
call TriggerAddAction(D2,function WDX)
set F2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(F2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(F2,Condition(function WGX))
call TriggerAddAction(F2,function WKX)
/*set G2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(G2,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(G2,Condition(function WMX))
call TriggerAddAction(G2,function WPX)*/
call RegisterSpellEffectEvent('Absk', function WPX)
call RegisterSpellEffectEvent('A0KQ', function WPX)
/*set H2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(H2,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(H2,Condition(function WSX))
call TriggerAddAction(H2,function WTX)*/
call RegisterSpellEffectEvent('A06O', function WTX)
set J2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(J2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(J2,Condition(function WWX))
call TriggerAddAction(J2,function W_X)
set K2=CreateTrigger()
call MOE(II,(K2))
call TriggerAddCondition(K2,Condition(function W1X))
call TriggerAddAction(K2,function W2X)
set L2=CreateTrigger()
call MOE(II,(L2))
call TriggerAddCondition(L2,Condition(function W4X))
call TriggerAddAction(L2,function W5X)
set M2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(M2,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(M2,Condition(function W7X))
call TriggerAddAction(M2,function YVX)
set P2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(P2,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(P2,Condition(function YXX))
call TriggerAddAction(P2,function YIX)
set Q2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Q2,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Q2,Condition(function YNX))
call TriggerAddAction(Q2,function YBX)
set S2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(S2,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(S2,Condition(function YDX))
call TriggerAddAction(S2,function YFX)
set T2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T2,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T2,Condition(function YHX))
call TriggerAddAction(T2,function YJX)
set U2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(U2,EVENT_PLAYER_UNIT_DROP_ITEM)
call TriggerAddCondition(U2,Condition(function YLX))
call TriggerAddAction(U2,function YPX)
set W2=CreateTrigger()
call TriggerAddAction(W2,function Y_X)
set Y2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Y2,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(Y2,Condition(function Y2X))
call TriggerAddAction(Y2,function Y3X)
set Z7X=0
set E3=CreateTrigger()
loop
exitwhen Z7X==16
call TriggerRegisterPlayerUnitEvent(E3,Player(Z7X),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set Z7X=Z7X+1
endloop
call TriggerAddCondition(E3,Condition(function ZTX))
call TriggerAddAction(E3,function VOO)
set Z7X=0
loop
exitwhen Z7X>ZKX(4)
call Preload(ZMX(Z7X))
call DestroyEffect(AddSpecialEffect(ZMX(Z7X),9000,9000))
set Z7X=Z7X+1
endloop
set Z7X=0
set X3=CreateTrigger()
call DisableTrigger(X3)
call TriggerRegisterAnyUnitEventBJ(X3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X3,Condition(function E8O))
call TriggerAddAction(X3,function E9O)
//set O3=CreateTrigger()
//call DisableTrigger(O3)
//call TriggerRegisterAnyUnitEventBJ(O3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
//call TriggerAddCondition(O3,Condition(function XRO))
//call TriggerAddAction(O3,function XIO)
set R3=CreateTrigger()
call DisableTrigger(R3)
call TriggerRegisterAnyUnitEventBJ(R3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(R3,Condition(function XNO))
call TriggerAddAction(R3,function XBO)
set I3=CreateTrigger()
call DisableTrigger(I3)
call TriggerRegisterAnyUnitEventBJ(I3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(I3,Condition(function XDO))
call TriggerAddAction(I3,function XFO)
set A3=CreateTrigger()
call DisableTrigger(A3)
call TriggerRegisterAnyUnitEventBJ(A3,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(A3,Condition(function XHO))
call TriggerAddAction(A3,function XKO)
set N3=CreateTrigger()
call TriggerRegisterTimerEventSingle(N3,.0)
call TriggerAddAction(N3,function XUO)
//set B3=CreateTrigger()
//call TriggerRegisterAnyUnitEventBJ(B3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
//call TriggerAddCondition(B3,Condition(function X6O))
//call TriggerAddAction(B3,function X7O)
set C3=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(C3,Condition(function X9O))
call TriggerAddAction(C3,function OVO)
set D3=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(D3,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(D3,Condition(function OXO))
call TriggerAddAction(D3,function ORO)
set H3=CreateTrigger()
call DisableTrigger(H3)
call TriggerRegisterAnyUnitEventBJ(H3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(H3,Condition(function OZO))
call TriggerAddAction(H3,function O_O)
set K3=CreateTrigger()
call DisableTrigger(K3)
call TriggerRegisterAnyUnitEventBJ(K3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(K3,Condition(function O6O))
call TriggerAddAction(K3,function O8O)
/*set L3=CreateTrigger()
call DisableTrigger(L3)
call TriggerRegisterAnyUnitEventBJ(L3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(L3,Condition(function RVO))
call TriggerAddAction(L3,function RXO)*/
set M3=CreateTrigger()
call DisableTrigger(M3)
call TriggerRegisterAnyUnitEventBJ(M3,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(M3,Condition(function RRO))
call TriggerAddAction(M3,function RIO)
set P3=CreateTrigger()
call DisableTrigger(P3)
call TriggerRegisterAnyUnitEventBJ(P3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(P3,Condition(function RNO))
call TriggerAddAction(P3,function RCO)
set Q3=CreateTrigger()
call DisableTrigger(Q3)
call TriggerRegisterAnyUnitEventBJ(Q3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Q3,Condition(function RFO))
call TriggerAddAction(Q3,function RJO)
set S3=CreateTrigger()
call DisableTrigger(S3)
call TriggerRegisterTimerEventPeriodic(S3,.03)
call TriggerAddAction(S3,function RZO)
set T3=CreateTrigger()
call DisableTrigger(T3)
call TriggerRegisterAnyUnitEventBJ(T3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T3,Condition(function R0O))
call TriggerAddAction(T3,function R2O)
set U3=CreateTrigger()
call DisableTrigger(U3)
call TriggerRegisterAnyUnitEventBJ(U3,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(U3,Condition(function R4O))
call TriggerAddAction(U3,function R5O)
set W3=CreateTrigger()
call DisableTrigger(W3)
call TriggerRegisterAnyUnitEventBJ(W3,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(W3,Condition(function R7O))
call TriggerAddAction(W3,function R9O)
set Y3=CreateTrigger()
call DisableTrigger(Y3)
call TriggerRegisterAnyUnitEventBJ(Y3,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Y3,Condition(function IEO))
call TriggerAddAction(Y3,function IOO)
set Z3=CreateTrigger()
call DisableTrigger(Z3)
call TriggerRegisterAnyUnitEventBJ(Z3,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Z3,Condition(function IIO))
call TriggerAddAction(Z3,function IAO)
set V4=CreateTrigger()
call DisableTrigger(V4)
call TriggerRegisterAnyUnitEventBJ(V4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(V4,Condition(function IBO))
call TriggerAddAction(V4,function ITO)
set E4=CreateTrigger()
call DisableTrigger(E4)
call TriggerRegisterAnyUnitEventBJ(E4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(E4,Condition(function IWO))
call TriggerAddAction(E4,function IZO)
set X4=CreateTrigger()
call DisableTrigger(X4)
call TriggerRegisterTimerEventPeriodic(X4,.03)
call TriggerAddAction(X4,function I7O)
set O4=CreateTrigger()
call DisableTrigger(O4)
call TriggerRegisterAnyUnitEventBJ(O4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(O4,Condition(function I9O))
call TriggerAddAction(O4,function AVO)
set R4=CreateTrigger()
call DisableTrigger(R4)
call TriggerRegisterAnyUnitEventBJ(R4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(R4,Condition(function AXO))
call TriggerAddAction(R4,function AIO)
set I4=CreateTrigger()
call DisableTrigger(I4)
call MOE(II,(I4))
call TriggerAddCondition(I4,Condition(function ANO))
call TriggerAddAction(I4,function ACO)
set A4=CreateTrigger()
call DisableTrigger(A4)
call TriggerRegisterAnyUnitEventBJ(A4,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(A4,Condition(function AFO))
call TriggerAddAction(A4,function AGO)
set N4=CreateTrigger()
call DisableTrigger(N4)
call TriggerRegisterAnyUnitEventBJ(N4,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(N4,Condition(function AJO))
call TriggerAddAction(N4,function AKO)
set B4=CreateTrigger()
call DisableTrigger(B4)
call TriggerRegisterAnyUnitEventBJ(B4,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(B4,Condition(function AMO))
call TriggerAddAction(B4,function AQO)
set D4=CreateTrigger()
call DisableTrigger(D4)
call MOE(II,(D4))
call TriggerAddCondition(D4,Condition(function AZO))
call TriggerAddAction(D4,function A_O)
set F4=CreateTrigger()
call DisableTrigger(F4)
call MOE(II,(F4))
call TriggerAddCondition(F4,Condition(function A1O))
call TriggerAddAction(F4,function A2O)
set G4=CreateTrigger()
call MOE(II,(G4))
call TriggerAddCondition(G4,Condition(function A4O))
call TriggerAddAction(G4,function A5O)
set H4=CreateTrigger()
call DisableTrigger(H4)
call TriggerAddCondition(H4,Condition(function A7O))
call TriggerAddAction(H4,function A9O)
call MOE(II,(H4))
set J4=CreateTrigger()
call DisableTrigger(J4)
call MOE(II,(J4))
call TriggerAddCondition(J4,Condition(function NEO))
call TriggerAddAction(J4,function NRO)
set K4=CreateTrigger()
call DisableTrigger(K4)
call TriggerRegisterAnyUnitEventBJ(K4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(K4,Condition(function NAO))
call TriggerAddAction(K4,function NHO)
set L4=CreateTrigger()
call DisableTrigger(L4)
call TriggerRegisterAnyUnitEventBJ(L4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(L4,Condition(function NKO))
call TriggerAddAction(L4,function NLO)
set M4=CreateTrigger()
call DisableTrigger(M4)
call TriggerRegisterAnyUnitEventBJ(M4,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(M4,Condition(function NPO))
call TriggerAddAction(M4,function NTO)
set P4=CreateTrigger()
call DisableTrigger(P4)
call MOE(II,(P4))
call TriggerAddCondition(P4,Condition(function NWO))
call TriggerAddAction(P4,function NYO)
set Q4=CreateTrigger()
call DisableTrigger(Q4)
call MOE(II,(Q4))
call TriggerAddCondition(Q4,Condition(function N_O))
call TriggerAddAction(Q4,function N2O)
set S4=CreateTrigger()
call DisableTrigger(S4)
call TriggerRegisterAnyUnitEventBJ(S4,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(S4,Condition(function N4O))
call TriggerAddAction(S4,function N6O)
set T4=CreateTrigger()
call DisableTrigger(T4)
call TriggerRegisterAnyUnitEventBJ(T4,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(T4,Condition(function N8O))
call TriggerAddAction(T4,function N9O)
set U4=CreateTrigger()
call DisableTrigger(U4)
call TriggerRegisterAnyUnitEventBJ(U4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(U4,Condition(function BEO))
call TriggerAddAction(U4,function BOO)
set W4=CreateTrigger()
call DisableTrigger(W4)
call TriggerRegisterAnyUnitEventBJ(W4,EVENT_PLAYER_UNIT_SPELL_ENDCAST)
call TriggerAddCondition(W4,Condition(function BIO))
call TriggerAddAction(W4,function BNO)
set Y4=CreateTrigger()
call DisableTrigger(Y4)
call TriggerRegisterAnyUnitEventBJ(Y4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Y4,Condition(function BCO))
call TriggerAddAction(Y4,function BFO)
set Z4=CreateTrigger()
call DisableTrigger(Z4)
call TriggerRegisterAnyUnitEventBJ(Z4,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(Z4,Condition(function BHO))
call TriggerAddAction(Z4,function BKO)
set V5=CreateTrigger()
call DisableTrigger(V5)
call TriggerRegisterAnyUnitEventBJ(V5,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(V5,Condition(function BMO))
call TriggerAddAction(V5,function BQO)
set E5=CreateTrigger()
call DisableTrigger(E5)
call TriggerRegisterAnyUnitEventBJ(E5,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(E5,Condition(function BTO))
call TriggerAddAction(E5,function BWO)
set X5=CreateTrigger()
call DisableTrigger(X5)
call MOE(II,(X5))
call TriggerAddCondition(X5,Condition(function BZO))
call TriggerAddAction(X5,function B0O)
set O5=CreateTrigger()
call DisableTrigger(O5)
call MOE(II,(O5))
call TriggerAddCondition(O5,Condition(function B2O))
call TriggerAddAction(O5,function B4O)
set R5=CreateTrigger()
call DisableTrigger(R5)
call TriggerRegisterAnyUnitEventBJ(R5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(R5,Condition(function B6O))
call TriggerAddAction(R5,function B9O)
set I5=CreateTrigger()
call DisableTrigger(I5)
call TriggerRegisterAnyUnitEventBJ(I5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(I5,Condition(function CEO))
call TriggerAddAction(I5,function CRO)
set A5=CreateTrigger()
call DisableTrigger(A5)
call TriggerRegisterAnyUnitEventBJ(A5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(A5,Condition(function CAO))
call TriggerAddAction(A5,function CCO)
set N5=CreateTrigger()
call DisableTrigger(N5)
call TriggerRegisterAnyUnitEventBJ(N5,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(N5,Condition(function CFO))
call TriggerAddAction(N5,function CLO)
set B5=CreateTrigger()
call DisableTrigger(B5)
call TriggerRegisterAnyUnitEventBJ(B5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(B5,Condition(function CPO))
call TriggerAddAction(B5,function CQO)
set C5=CreateTrigger()
call DisableTrigger(C5)
call MOE(II,(C5))
call TriggerAddCondition(C5,Condition(function CTO))
call TriggerAddAction(C5,function CUO)
set F5=CreateTrigger()
call DisableTrigger(F5)
call MOE(II,(F5))
call TriggerAddCondition(F5,Condition(function C_O))
call TriggerAddAction(F5,function C1O)
set G5=CreateTrigger()
call DisableTrigger(G5)
call MOE(II,(G5))
call TriggerAddCondition(G5,Condition(function C3O))
call TriggerAddAction(G5,function C4O)
set H5=CreateTrigger()
call DisableTrigger(H5)
call MOE(II,(H5))
call TriggerAddCondition(H5,Condition(function C6O))
call TriggerAddAction(H5,function C7O)
set J5=CreateTrigger()
call DisableTrigger(J5)
call TriggerRegisterAnyUnitEventBJ(J5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(J5,Condition(function C9O))
call TriggerAddAction(J5,function DEO)
set K5=CreateTrigger()
call DisableTrigger(K5)
call TriggerRegisterAnyUnitEventBJ(K5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(K5,Condition(function DOO))
call TriggerAddAction(K5,function DIO)
set L5=CreateTrigger()
call DisableTrigger(L5)
call TriggerRegisterAnyUnitEventBJ(L5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(L5,Condition(function DNO))
call TriggerAddAction(L5,function DDO)
set M5=CreateTrigger()
call DisableTrigger(M5)
call TriggerRegisterAnyUnitEventBJ(M5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(M5,Condition(function DGO))
call TriggerAddAction(M5,function DJO)
set P5=CreateTrigger()
call DisableTrigger(P5)
call TriggerRegisterAnyUnitEventBJ(P5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(P5,Condition(function DLO))
call TriggerAddAction(P5,function DPO)
set Q5=CreateTrigger()
call DisableTrigger(Q5)
call MOE(II,(Q5))
call TriggerAddCondition(Q5,Condition(function DSO))
call TriggerAddAction(Q5,function DTO)
set S5=CreateTrigger()
call DisableTrigger(S5)
call TriggerRegisterAnyUnitEventBJ(S5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(S5,Condition(function DWO))
call TriggerAddAction(S5,function DYO)
set T5=CreateTrigger()
call DisableTrigger(T5)
call TriggerRegisterAnyUnitEventBJ(T5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T5,Condition(function D_O))
call TriggerAddAction(T5,function D0O)
set U5=CreateTrigger()
call DisableTrigger(U5)
call TriggerRegisterAnyUnitEventBJ(U5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(U5,Condition(function D2O))
call TriggerAddAction(U5,function D4O)
set Z5=CreateTrigger()
call DisableTrigger(Z5)
call TriggerRegisterAnyUnitEventBJ(Z5,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Z5,Condition(function FEO))
call TriggerAddAction(Z5,function FRO)
set V6=CreateTrigger()
call DisableTrigger(V6)
call TriggerRegisterAnyUnitEventBJ(V6,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(V6,Condition(function FAO))
call TriggerAddAction(V6,function FNO)
set E6=CreateTrigger()
call DisableTrigger(E6)
call TriggerRegisterAnyUnitEventBJ(E6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(E6,Condition(function FCO))
call TriggerAddAction(E6,function FDO)
set X6=CreateTrigger()
call DisableTrigger(X6)
call TriggerRegisterAnyUnitEventBJ(X6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(X6,Condition(function FGO))
call TriggerAddAction(X6,function FMO)
/*set O6=CreateTrigger()
call DisableTrigger(O6)
call TriggerRegisterAnyUnitEventBJ(O6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(O6,Condition(function FQO))
call TriggerAddAction(O6,function FYO)*/
set R6=CreateTrigger()
call DisableTrigger(R6)
call TriggerRegisterAnyUnitEventBJ(R6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(R6,Condition(function F_O))
call TriggerAddAction(R6,function F0O)
set I6=CreateTrigger()
call DisableTrigger(I6)
call TriggerRegisterAnyUnitEventBJ(I6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(I6,Condition(function F2O))
call TriggerAddAction(I6,function F3O)
set A6=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(A6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(A6,Condition(function F5O))
call TriggerAddAction(A6,function F6O)
set N6=CreateTrigger()
call DisableTrigger(N6)
call TriggerRegisterAnyUnitEventBJ(N6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(N6,Condition(function F8O))
call TriggerAddAction(N6,function F9O)
set B6=CreateTrigger()
call DisableTrigger(B6)
call TriggerRegisterAnyUnitEventBJ(B6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(B6,Condition(function GEO))
call TriggerAddAction(B6,function GXO)
set C6=CreateTrigger()
call DisableTrigger(C6)
call TriggerRegisterAnyUnitEventBJ(C6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(C6,Condition(function GRO))
call TriggerAddAction(C6,function GIO)
set D6=CreateTrigger()
call DisableTrigger(D6)
call TriggerRegisterAnyUnitEventBJ(D6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(D6,Condition(function GNO))
call TriggerAddAction(D6,function GBO)
set F6=CreateTrigger()
call DisableTrigger(F6)
call TriggerRegisterAnyUnitEventBJ(F6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(F6,Condition(function GDO))
call TriggerAddAction(F6,function GGO)
set G6=CreateTrigger()
call DisableTrigger(G6)
call TriggerRegisterAnyUnitEventBJ(G6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(G6,Condition(function GJO))
call TriggerAddAction(G6,function GKO)
set H6=CreateTrigger()
call DisableTrigger(H6)
call TriggerRegisterAnyUnitEventBJ(H6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(H6,Condition(function GMO))
call TriggerAddAction(H6,function GPO)
set J6=CreateTrigger()
call DisableTrigger(J6)
call TriggerRegisterAnyUnitEventBJ(J6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(J6,Condition(function GSO))
call TriggerAddAction(J6,function GUO)
set K6=CreateTrigger()
call DisableTrigger(K6)
call TriggerRegisterAnyUnitEventBJ(K6,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(K6,Condition(function GYO))
call TriggerAddAction(K6,function GZO)
set L6=CreateTrigger()
call DisableTrigger(L6)
call TriggerRegisterAnyUnitEventBJ(L6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(L6,Condition(function G0O))
call TriggerAddAction(L6,function G6O)
set M6=CreateTrigger()
call DisableTrigger(M6)
call TriggerRegisterAnyUnitEventBJ(M6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(M6,Condition(function G8O))
call TriggerAddAction(M6,function HVO)
set P6=CreateTrigger()
call DisableTrigger(P6)
call TriggerRegisterAnyUnitEventBJ(P6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(P6,Condition(function HXO))
call TriggerAddAction(P6,function HOO)
set Q6=CreateTrigger()
call DisableTrigger(Q6)
call TriggerRegisterAnyUnitEventBJ(Q6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Q6,Condition(function HIO))
call TriggerAddAction(Q6,function HBO)
set S6=CreateTrigger()
call DisableTrigger(S6)
call TriggerRegisterAnyUnitEventBJ(S6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(S6,Condition(function HDO))
call TriggerAddAction(S6,function HJO)
set T6=CreateTrigger()
call DisableTrigger(T6)
call TriggerRegisterAnyUnitEventBJ(T6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T6,Condition(function HLO))
call TriggerAddAction(T6,function HSO)
set U6=CreateTrigger()
call DisableTrigger(U6)
call MOE(II,(U6))
call TriggerAddCondition(U6,Condition(function HUO))
call TriggerAddAction(U6,function HWO)
//set W6=CreateTrigger()
//call DisableTrigger(W6)
//call MOE(II,(W6))
//call TriggerAddCondition(W6,Condition(function HZO))
//call TriggerAddAction(W6,function H_O)
set Y6=CreateTrigger()
call DisableTrigger(Y6)
call MOE(II,(Y6))
call TriggerAddCondition(Y6,Condition(function H1O))
call TriggerAddAction(Y6,function H2O)
set Z6=CreateTrigger()
call DisableTrigger(Z6)
call MOE(II,(Z6))
call TriggerAddCondition(Z6,Condition(function H5O))
call TriggerAddAction(Z6,function H6O)
set E7=CreateTrigger()
call DisableTrigger(E7)
call MOE(II,(E7))
call TriggerAddCondition(E7,Condition(function JAO))
call TriggerAddAction(E7,function JUO)
set X7=CreateTrigger()
call DisableTrigger(X7)
call MOE(II,(X7))
call TriggerAddCondition(X7,Condition(function JYO))
call TriggerAddAction(X7,function JZO)
set O7=CreateTrigger()
call DisableTrigger(O7)
call MOE(II,(O7))
call TriggerAddCondition(O7,Condition(function J0O))
call TriggerAddAction(O7,function J1O)
set R7=CreateTrigger()
call DisableTrigger(R7)
call MOE(II,(R7))
call TriggerAddCondition(R7,Condition(function J3O))
call TriggerAddAction(R7,function J4O)
set A7=CreateTrigger()
call DisableTrigger(A7)
call TriggerRegisterAnyUnitEventBJ(A7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(A7,Condition(function J9O))
call TriggerAddAction(A7,function KVO)
set N7=CreateTrigger()
call DisableTrigger(N7)
call TriggerRegisterTimerEventPeriodic(N7,.04)
call TriggerAddAction(N7,function KMO)
set B7=CreateTrigger()
call DisableTrigger(B7)
call TriggerRegisterAnyUnitEventBJ(B7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(B7,Condition(function KQO))
call TriggerAddAction(B7,function K0O)
set F7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(F7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(F7,Condition(function K8O))
call TriggerAddAction(F7,function K9O)
set G7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(G7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(G7,Condition(function LEO))
call TriggerAddAction(G7,function LXO)
set H7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(H7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(H7,Condition(function LRO))
call TriggerAddAction(H7,function LIO)
set J7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(J7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(J7,Condition(function LNO))
call TriggerAddAction(J7,function LBO)
set K7=CreateTrigger()
call TriggerAddAction(K7,function LDO)
set L7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(L7,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(L7,Condition(function LHO))
call TriggerAddAction(L7,function LJO)
set M7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(M7,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(M7,Condition(function LLO))
call TriggerAddAction(M7,function LMO)
set P7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(P7,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(P7,Condition(function LQO))
call TriggerAddAction(P7,function LSO)
set Q7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Q7,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Q7,Condition(function LUO))
call TriggerAddAction(Q7,function LWO)
set S7=CreateTrigger()
call TriggerAddAction(S7,function LZO)
set T7=CreateTrigger()
call TriggerRegisterTimerEventSingle(T7,.0)
call TriggerAddAction(T7,function MNO)
set U7=CreateTrigger()
call TriggerRegisterTimerEventSingle(U7,.0)
call TriggerAddAction(U7,function MCO)
set W7=CreateTrigger()
call DisableTrigger(W7)
call TriggerAddCondition(W7,Condition(function MFO))
call TriggerAddAction(W7,function MSO)
//set Y7=CreateTrigger()
//call TriggerRegisterTimerEventSingle(Y7,.01)
//call TriggerAddAction(Y7,function MWO)
set Z7=CreateTrigger()
call TriggerRegisterTimerEventSingle(Z7,.01)
call TriggerAddAction(Z7,function MZO)
set V8=CreateTrigger()
call TriggerRegisterDialogEvent(V8,YC)
call TriggerAddAction(V8,function M5O)
set E8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(E8,80.,XWV)
call TriggerAddCondition(E8,Condition(function M7O))
call TriggerAddAction(E8,function PVO)
set X8=CreateTrigger()
//call TriggerRegisterUnitInRangeSimple(X8,80.,XCV)
call TriggerRegisterUnitInRangeSimple(X8,80.,OVV)
//call TriggerRegisterUnitInRangeSimple(X8,80.,XQV)
call TriggerAddCondition(X8,Condition(function PXO))
call TriggerAddAction(X8,function PRO)
set O8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(O8,80.,XTV)
call TriggerAddCondition(O8,Condition(function PAO))
call TriggerAddAction(O8,function PBO)
set R8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(R8,80.,XHV)
call TriggerAddCondition(R8,Condition(function PDO))
call TriggerAddAction(R8,function PGO)
set I8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(I8,80.,XHV)
call TriggerAddCondition(I8,Condition(function PJO))
call TriggerAddAction(I8,function PMO)
set A8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(A8,80.,OEV)
call TriggerAddCondition(A8,Condition(function PQO))
call TriggerAddAction(A8,function PTO)
set N8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(N8,80.,XGV)
call TriggerAddCondition(N8,Condition(function PWO))
call TriggerAddAction(N8,function PZO)
set B8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(B8,80.,X9V)
call TriggerAddCondition(B8,Condition(function P0O))
call TriggerAddAction(B8,function P2O)
set C8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(C8,80.,X8V)
call TriggerAddCondition(C8,Condition(function P4O))
call TriggerAddAction(C8,function P6O)
set D8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(D8,80.,X7V)
call TriggerAddCondition(D8,Condition(function P8O))
call TriggerAddAction(D8,function QVO)
set F8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(F8,80.,X7V)
call TriggerAddCondition(F8,Condition(function QXO))
call TriggerAddAction(F8,function QIO)
set G8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(G8,80.,E6V)
call TriggerAddCondition(G8,Condition(function QNO))
call TriggerAddAction(G8,function QCO)
set H8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(H8,80.,XUV)
call TriggerAddCondition(H8,Condition(function QFO))
call TriggerAddAction(H8,function QHO)
set J8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(J8,80.,XEV)
call TriggerAddCondition(J8,Condition(function QKO))
call TriggerAddAction(J8,function QMO)
set K8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(K8,80.,XEV)
call TriggerAddCondition(K8,Condition(function QQO))
call TriggerAddAction(K8,function QUO)
set L8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(L8,80.,XKV)
call TriggerAddCondition(L8,Condition(function QYO))
call TriggerAddAction(L8,function Q_O)
set M8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(M8,80.,E5V)
call TriggerAddCondition(M8,Condition(function Q1O))
call TriggerAddAction(M8,function Q3O)
set P8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(P8,80.,E8V)
call TriggerAddCondition(P8,Condition(function Q5O))
call TriggerAddAction(P8,function Q7O)
set Q8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(Q8,80.,XJV)
call TriggerAddCondition(Q8,Condition(function Q9O))
call TriggerAddAction(Q8,function SEO)
set S8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(S8,80.,XBV)
call TriggerAddCondition(S8,Condition(function SOO))
call TriggerAddAction(S8,function SIO)
set T8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(T8,80.,XSV)
call TriggerAddCondition(T8,Condition(function SNO))
call TriggerAddAction(T8,function SCO)
set U8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(U8,80.,XLV)
call TriggerAddCondition(U8,Condition(function SFO))
call TriggerAddAction(U8,function SHO)
set W8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(W8,80.,XRV)
call TriggerAddCondition(W8,Condition(function SKO))
call TriggerAddAction(W8,function SMO)
set Y8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(Y8,80.,XXV)
call TriggerAddCondition(Y8,Condition(function SQO))
call TriggerAddAction(Y8,function STO)
set Z8=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(Z8,80.,XDV)
call TriggerAddCondition(Z8,Condition(function SWO))
call TriggerAddAction(Z8,function SZO)
set VVV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VVV,80.,XOV)
call TriggerAddCondition(VVV,Condition(function S0O))
call TriggerAddAction(VVV,function S2O)
set VEV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VEV,80.,XNV)
call TriggerAddCondition(VEV,Condition(function S4O))
call TriggerAddAction(VEV,function S6O)
set VXV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VXV,80.,E1V)
call TriggerAddCondition(VXV,Condition(function S8O))
call TriggerAddAction(VXV,function TVO)
set VOV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VOV,80.,OXV)
call TriggerAddCondition(VOV,Condition(function TXO))
call TriggerAddAction(VOV,function TIO)
set VIV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VIV,80.,E2V)
call TriggerAddCondition(VIV,Condition(function THO))
call TriggerAddAction(VIV,function TKO)
set VAV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VAV,80.,X5V)
call TriggerAddCondition(VAV,Condition(function TMO))
call TriggerAddAction(VAV,function TQO)
set VNV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VNV,80.,OOV)
call TriggerAddCondition(VNV,Condition(function TTO))
call TriggerAddAction(VNV,function TWO)
set VBV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VBV,80.,XIV)
call TriggerAddCondition(VBV,Condition(function TZO))
call TriggerAddAction(VBV,function T0O)
set VCV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VCV,80.,E3V)
call TriggerAddCondition(VCV,Condition(function T2O))
call TriggerAddAction(VCV,function T4O)
set VDV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VDV,80.,XAV)
call TriggerAddCondition(VDV,Condition(function T6O))
call TriggerAddAction(VDV,function T8O)
set QoBT=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(QoBT,80.,QoBC)
call TriggerAddCondition(QoBT,Condition(function T6O))
call TriggerAddAction(QoBT,function QoBPT)
set PeHT=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(PeHT,80.,PeHC)
call TriggerAddCondition(PeHT,Condition(function T6O))
call TriggerAddAction(PeHT,function PeHPT)
set VFV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VFV,80.,E9V)
call TriggerAddCondition(VFV,Condition(function UVO))
call TriggerAddAction(VFV,function UXO)
set VGV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VGV,80.,XVV)
call TriggerAddCondition(VGV,Condition(function URO))
call TriggerAddAction(VGV,function UNO)
set VHV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VHV,80.,XFV)
call TriggerAddCondition(VHV,Condition(function UCO))
call TriggerAddAction(VHV,function UFO)
set VJV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(VJV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(VJV,Condition(function UHO))
call TriggerAddAction(VJV,function UKO)
set VKV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(VKV,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(VKV,Condition(function UMO))
call TriggerAddAction(VKV,function UPO)
set VLV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VLV,75.,X1V)
call TriggerAddCondition(VLV,Condition(function USO))
call TriggerAddAction(VLV,function UTO)
set VMV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VMV,75.,X_V)
call TriggerAddCondition(VMV,Condition(function UWO))
call TriggerAddAction(VMV,function UYO)
set VPV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VPV,75.,X2V)
call TriggerAddCondition(VPV,Condition(function U_O))
call TriggerAddAction(VPV,function U0O)
set VQV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VQV,75.,X4V)
call TriggerAddCondition(VQV,Condition(function U2O))
call TriggerAddAction(VQV,function U3O)
set VSV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VSV,75.,X0V)
call TriggerAddCondition(VSV,Condition(function U5O))
call TriggerAddAction(VSV,function U6O)
set VTV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VTV,75.,XZV)
call TriggerAddCondition(VTV,Condition(function U8O))
call TriggerAddAction(VTV,function U9O)
set VUV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VUV,75.,X3V)
call TriggerAddCondition(VUV,Condition(function WEO))
call TriggerAddAction(VUV,function WXO)
set VWV=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(VWV,75.,XYV)
call TriggerAddCondition(VWV,Condition(function WRO))
call TriggerAddAction(VWV,function WIO)
set VYV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(VYV,30.)
call TriggerAddCondition(VYV,Condition(function WDO))
call TriggerAddAction(VYV,function WFO)
set VZV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(VZV,30.)
call TriggerAddCondition(VZV,Condition(function WLO))
call TriggerAddAction(VZV,function WMO)
set V_V=CreateTrigger()
call TriggerRegisterPlayerEventLeave(V_V,Player(0))
call TriggerRegisterPlayerEventLeave(V_V,Player(1))
call TriggerRegisterPlayerEventLeave(V_V,Player(2))
call TriggerRegisterPlayerEventLeave(V_V,Player(3))
call TriggerRegisterPlayerEventLeave(V_V,Player(4))
call TriggerRegisterPlayerEventLeave(V_V,Player(5))
call TriggerRegisterPlayerEventLeave(V_V,Player(6))
call TriggerRegisterPlayerEventLeave(V_V,Player(7))
call TriggerRegisterPlayerEventLeave(V_V,Player(8))
call TriggerRegisterPlayerEventLeave(V_V,Player(9))
call TriggerRegisterPlayerEventDefeat(V_V,Player(0))
call TriggerRegisterPlayerEventDefeat(V_V,Player(1))
call TriggerRegisterPlayerEventDefeat(V_V,Player(2))
call TriggerRegisterPlayerEventDefeat(V_V,Player(3))
call TriggerRegisterPlayerEventDefeat(V_V,Player(4))
call TriggerRegisterPlayerEventDefeat(V_V,Player(5))
call TriggerRegisterPlayerEventDefeat(V_V,Player(6))
call TriggerRegisterPlayerEventDefeat(V_V,Player(7))
call TriggerRegisterPlayerEventDefeat(V_V,Player(8))
call TriggerRegisterPlayerEventDefeat(V_V,Player(9))
call TriggerAddAction(V_V,function WZO)
set V0V=CreateTrigger()
//call TriggerRegisterPlayerUnitEventSimple(V0V,Player(8),EVENT_PLAYER_UNIT_DEATH)
//call TriggerRegisterPlayerUnitEventSimple(V0V,Player(9),EVENT_PLAYER_UNIT_DEATH)
call TriggerRegisterPlayerUnitEventSimple(V0V,Player(10),EVENT_PLAYER_UNIT_DEATH)
call TriggerRegisterPlayerUnitEventSimple(V0V,Player(11),EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(V0V,Condition(function W0O))
call TriggerAddAction(V0V,function W3O)
set V1V=CreateTrigger()
call TriggerRegisterEnterRectSimple(V1V,GU)
call TriggerAddCondition(V1V,Condition(function YVO))
call TriggerAddAction(V1V,function YAO)
set V2V=CreateTrigger()
call TriggerRegisterEnterRectSimple(V2V,HU)
call TriggerAddCondition(V2V,Condition(function YCO))
call TriggerAddAction(V2V,function YKO)
set V3V=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(V3V,1.)
call TriggerAddAction(V3V,function YZO)
set V4V=CreateTrigger()
call DisableTrigger(V4V)
call TriggerAddAction(V4V,function EHR)
set V7V=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(V7V,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(V7V,Condition(function ETR))
call TriggerAddAction(V7V,function EUR)
set V8V=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(V8V,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(V8V,Condition(function EYR))
call TriggerAddAction(V8V,function EZR)
set V9V=CreateTrigger()
call MOE(II,(V9V))
call TriggerAddCondition(V9V,Condition(function E0R))
call TriggerAddAction(V9V,function E2R)
set EVV=CreateTrigger()
call MOE(II,(EVV))
call TriggerAddCondition(EVV,Condition(function E4R))
call TriggerAddAction(EVV,function E5R)
set EEV=CreateTrigger()
call MOE(II,(EEV))
call TriggerAddCondition(EEV,Condition(function E7R))
call TriggerAddAction(EEV,function E8R)
set EXV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EXV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(EXV,Condition(function XVR))
call TriggerAddAction(EXV,function XER)
set EOV=CreateTrigger()
call TriggerAddCondition(EOV,Condition(function XOR))
call TriggerAddAction(EOV,function XRR)
call MOE(II,(EOV))
set ERV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ERV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ERV,Condition(function XAR))
call TriggerAddAction(ERV,function XNR)
set EIV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EIV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(EIV,Condition(function XCR))
call TriggerAddAction(EIV,function XDR)
set EAV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EAV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EAV,Condition(function XGR))
call TriggerAddAction(EAV,function XHR)
set ENV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ENV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(ENV,Condition(function XKR))
call TriggerAddAction(ENV,function XLR)
set EBV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EBV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EBV,Condition(function XPR))
call TriggerAddAction(EBV,function XQR)
set ECV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ECV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ECV,Condition(function OER))
call TriggerAddAction(ECV,function OXR)
set EDV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(EDV,(1/40.))
call TriggerAddAction(EDV,function OTR)
set EFV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EFV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EFV,Condition(function OWR))
call TriggerAddAction(EFV,function O_R)
set EGV=CreateTrigger()
call TriggerAddAction(EGV,function O2R)
set EHV=CreateTrigger()
call DisableTrigger(EHV)
call TriggerRegisterTimerEventPeriodic(EHV,.02)
call TriggerAddAction(EHV,function O8R)
set EJV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EJV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EJV,Condition(function RVR))
call TriggerAddAction(EJV,function RER)
set EKV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EKV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(EKV,Condition(function RRR))
call TriggerAddAction(EKV,function RCR)
set ELV=CreateTrigger()
call DisableTrigger(ELV)
call TriggerRegisterTimerEventPeriodic(ELV,.02)
call TriggerAddAction(ELV,function RKR)
set EMV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EMV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EMV,Condition(function RMR))
call TriggerAddAction(EMV,function RUR)
set EPV=CreateTrigger()
call DisableTrigger(EPV)
call TriggerRegisterTimerEventPeriodic(EPV,.02)
call TriggerAddAction(EPV,function R4R)
set EQV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EQV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EQV,Condition(function R6R))
call TriggerAddAction(EQV,function R9R)
set ESV=CreateTrigger()
call DisableTrigger(ESV)
call TriggerRegisterTimerEventPeriodic(ESV,.02)
call TriggerAddAction(ESV,function IIR)
set ETV=CreateTrigger()
call TriggerAddAction(ETV,function IGR)
//set EWV=CreateTrigger()
//call TriggerRegisterAnyUnitEventBJ(EWV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
//call TriggerAddCondition(EWV,Condition(function ITR))
//call TriggerAddAction(EWV,function IZR)
call RegisterSpellEffectEvent('A02D', function IZR)
//set EYV=CreateTrigger()
//call TriggerRegisterAnyUnitEventBJ(EYV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
//call TriggerAddCondition(EYV,Condition(function I1R))
//call TriggerAddAction(EYV,function I3R)
//return((GetSpellAbilityId()=='A02J')or(GetSpellAbilityId()=='A0BG')or(GetSpellAbilityId()=='A0GX')or(GetSpellAbilityId()=='A08X')or(GetSpellAbilityId()=='A08V')or(GetSpellAbilityId()=='A08H')or(GetSpellAbilityId()=='A03F')and not JT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call RegisterSpellEffectEvent('A02J', function I3R)
call RegisterSpellEffectEvent('A0BG', function I3R)
call RegisterSpellEffectEvent('A0GX', function I3R)
call RegisterSpellEffectEvent('A08X', function I3R)
call RegisterSpellEffectEvent('A08V', function I3R)
call RegisterSpellEffectEvent('A08H', function I3R)
call RegisterSpellEffectEvent('A03F', function I3R)
call RegisterSpellEffectEvent('A0NK', function I3R)
set EZV=CreateTrigger()
call TriggerAddAction(EZV,function I5R)
set E_V=CreateTrigger()
call TriggerRegisterTimerEventSingle(E_V,.01)
call TriggerAddAction(E_V,function I8R)
set E0V=CreateTrigger()
call TriggerAddAction(E0V,function AVR)
call ConditionalTriggerExecute(Q1)
call ConditionalTriggerExecute(T1)
call ConditionalTriggerExecute(S7)
call ConditionalTriggerExecute(EZV)
call ConditionalTriggerExecute(E_V)
call ConditionalTriggerExecute(E0V)
call CreateDeadDestructableZ('YTfb',-5536,-6624,192,270,1,0)
call CreateDeadDestructableZ('YTfb',-5536,-6624,192,270,1,0)
//! endinject
//! inject config
call SetMapName("|cffaa0000Enfo's FFB Edition v1.32|r")
call SetMapDescription("A more advanced and harder version of the classic Enfo maps. Created by clan FFB.\n\n|cffffcc00Released on 15th Feb, 2014.|r\nChange log and info at: |cffaa0000https://discord.gg/PGub8vzzf4|r")
call SetPlayers(12)
call SetTeams(12)
call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER)
call DefineStartLocation(0,.0,-5120.)
call DefineStartLocation(1,.0,-5120.)
call DefineStartLocation(2,.0,-5120.)
call DefineStartLocation(3,.0,-5120.)
call DefineStartLocation(4,.0,-5120.)
call DefineStartLocation(5,.0,-5120.)
call DefineStartLocation(6,.0,-5120.)
call DefineStartLocation(7,.0,-5120.)
call DefineStartLocation(8,.0,-5120.)
call DefineStartLocation(9,.0,-5120.)
call DefineStartLocation(10,.0,-5120.)
call DefineStartLocation(11,.0,-5120.)
call SetPlayerStartLocation(Player(0),0)
call ForcePlayerStartLocation(Player(0),0)
call SetPlayerColor(Player(0),ConvertPlayerColor(0))
call SetPlayerRacePreference(Player(0),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(0),false)
call SetPlayerController(Player(0),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(1),1)
call ForcePlayerStartLocation(Player(1),1)
call SetPlayerColor(Player(1),ConvertPlayerColor(1))
call SetPlayerRacePreference(Player(1),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(1),false)
call SetPlayerController(Player(1),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(2),2)
call ForcePlayerStartLocation(Player(2),2)
call SetPlayerColor(Player(2),ConvertPlayerColor(2))
call SetPlayerRacePreference(Player(2),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(2),false)
call SetPlayerController(Player(2),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(3),3)
call ForcePlayerStartLocation(Player(3),3)
call SetPlayerColor(Player(3),ConvertPlayerColor(3))
call SetPlayerRacePreference(Player(3),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(3),false)
call SetPlayerController(Player(3),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(4),4)
call ForcePlayerStartLocation(Player(4),4)
call SetPlayerColor(Player(4),ConvertPlayerColor(4))
call SetPlayerRacePreference(Player(4),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(4),false)
call SetPlayerController(Player(4),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(5),5)
call ForcePlayerStartLocation(Player(5),5)
call SetPlayerColor(Player(5),ConvertPlayerColor(5))
call SetPlayerRacePreference(Player(5),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(5),false)
call SetPlayerController(Player(5),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(6),6)
call ForcePlayerStartLocation(Player(6),6)
call SetPlayerColor(Player(6),ConvertPlayerColor(6))
call SetPlayerRacePreference(Player(6),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(6),false)
call SetPlayerController(Player(6),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(7),7)
call ForcePlayerStartLocation(Player(7),7)
call SetPlayerColor(Player(7),ConvertPlayerColor(7))
call SetPlayerRacePreference(Player(7),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(7),false)
call SetPlayerController(Player(7),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(8),8)
call ForcePlayerStartLocation(Player(8),8)
call SetPlayerColor(Player(8),ConvertPlayerColor(8))
call SetPlayerRacePreference(Player(8),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(8),false)
call SetPlayerController(Player(8),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(9),9)
call ForcePlayerStartLocation(Player(9),9)
call SetPlayerColor(Player(9),ConvertPlayerColor(9))
call SetPlayerRacePreference(Player(9),RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(9),false)
call SetPlayerController(Player(9),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(10),10)
call ForcePlayerStartLocation(Player(10),10)
call SetPlayerColor(Player(10),ConvertPlayerColor(10))
call SetPlayerRacePreference(Player(10),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(10),false)
call SetPlayerController(Player(10),MAP_CONTROL_COMPUTER)
call SetPlayerStartLocation(Player(11),11)
call ForcePlayerStartLocation(Player(11),11)
call SetPlayerColor(Player(11),ConvertPlayerColor(11))
call SetPlayerRacePreference(Player(11),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(11),false)
call SetPlayerController(Player(11),MAP_CONTROL_COMPUTER)
call InitCustomTeams()
call SetStartLocPrioCount(0,7)
call SetStartLocPrio(0,0,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,1,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,2,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,3,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,4,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(1,7)
call SetStartLocPrio(1,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,1,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,2,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,3,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,4,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(2,7)
call SetStartLocPrio(2,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,2,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,3,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,4,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(3,7)
call SetStartLocPrio(3,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,3,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,4,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(4,7)
call SetStartLocPrio(4,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,4,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(5,7)
call SetStartLocPrio(5,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,5,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(6,7)
call SetStartLocPrio(6,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,6,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(7,7)
call SetStartLocPrio(7,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,6,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(8,11)
call SetStartLocPrio(8,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,6,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,7,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,8,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,9,10,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,10,11,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(9,11)
call SetStartLocPrio(9,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,6,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,7,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,8,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,9,10,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,10,11,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(10,11)
call SetStartLocPrio(10,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,6,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,7,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,8,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,9,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10,10,11,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(11,11)
call SetStartLocPrio(11,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,1,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,2,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,3,3,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,4,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,5,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,6,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,7,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,8,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,9,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11,10,10,MAP_LOC_PRIO_HIGH)
//! endinject
function AAR takes nothing returns boolean
local integer D0E=B3E
call GroupClear(EYE[D0E])
return true
endfunction
function ANR takes nothing returns boolean
local integer D0E=B3E
set RTV[RUV[D0E]]=RTV[D0E]
set RUV[RTV[D0E]]=RUV[D0E]
call GCE(D0E)
return true
endfunction
function ABR takes nothing returns boolean
local integer D0E=B3E
local integer i=0
call ReleaseTimer(TOV[D0E])
call GroupRemoveUnit(KC,SQV[D0E])
loop
exitwhen i==TRV[D0E]
call YLE(SWV[SYV[D0E]+i])
set i=i+1
endloop
return true
endfunction
function ACR takes nothing returns boolean
local integer D0E=B3E
set SJV[SKV[D0E]]=SJV[D0E]
set SKV[SJV[D0E]]=SKV[D0E]
return true
endfunction
function ADR takes nothing returns boolean
local integer D0E=B3E
set SAV[SNV[D0E]]=SAV[D0E]
set SNV[SAV[D0E]]=SNV[D0E]
return true
endfunction
function AFR takes nothing returns boolean
local integer D0E=B3E
set Q6V[Q7V[D0E]]=Q6V[D0E]
set Q7V[Q6V[D0E]]=Q7V[D0E]
return true
endfunction
function AGR takes nothing returns boolean
local integer D0E=B3E
set QZV[Q_V[D0E]]=QZV[D0E]
set Q_V[QZV[D0E]]=Q_V[D0E]
return true
endfunction
function AHR takes nothing returns boolean
local integer D0E=B3E
set QMV[QPV[D0E]]=QMV[D0E]
set QPV[QMV[D0E]]=QPV[D0E]
return true
endfunction
function AJR takes nothing returns boolean
local integer D0E=B3E
set QCV[QDV[D0E]]=QCV[D0E]
set QDV[QCV[D0E]]=QDV[D0E]
return true
endfunction
function AKR takes nothing returns boolean
local integer D0E=B3E
set QEV[QXV[D0E]]=QEV[D0E]
set QXV[QEV[D0E]]=QXV[D0E]
return true
endfunction
function ALR takes nothing returns boolean
local integer D0E=B3E
set P3V[P4V[D0E]]=P3V[D0E]
set P4V[P3V[D0E]]=P4V[D0E]
return true
endfunction
function AMR takes nothing returns boolean
local integer D0E=B3E
set MBV[MCV[D0E]]=MBV[D0E]
set MCV[MBV[D0E]]=MCV[D0E]
return true
endfunction
function APR takes nothing returns boolean
local integer D0E=B3E
set L4V[L5V[D0E]]=L4V[D0E]
set L5V[L4V[D0E]]=L5V[D0E]
return true
endfunction
function AQR takes nothing returns boolean
local integer D0E=B3E
set R0V[D0E]=null
if R7V[D0E]!=null then
call DestroyEffect(R7V[D0E])
set R7V[D0E]=null
endif
set W[0]=false
set W[1]=false
return true
endfunction
function ASR takes nothing returns boolean
local integer D0E=B3E
local integer JFE=B_E
local integer i=0
local integer j=0
if JFE!=0 and IsUnitInGroup(HFV[JFE],JWV[D0E])then
call GroupRemoveUnit(JWV[D0E],HFV[JFE])
set JUV[D0E]=JUV[D0E]-1
set i=LoadInteger(ZA,(JFE),-1)-1
set j=LoadInteger(VN,(JFE),D0E)
call SaveInteger(ZA,(JFE),-1,i)
call SaveInteger(ZA,(JFE),j,LoadInteger(ZA,(JFE),i))
call SaveInteger(VN,(JFE),LoadInteger(ZA,(JFE),j),j)
if i<1 then
call FlushChildHashtable(ZA,(JFE))
call FlushChildHashtable(VN,(JFE))
endif
set B4E=true
return true
endif
set B4E=false
return true
endfunction
function ATR takes nothing returns boolean
local integer D0E=B3E
local unit u=null
loop
set u=FirstOfGroup(JWV[D0E])
exitwhen u==null
call XKX(D0E,GDV[(GetUnitUserData(((u))))])
endloop
call GroupClear(JWV[D0E])
set JUV[D0E]=0
set u=null
return true
endfunction
function AUR takes nothing returns boolean
local integer D0E=B3E
set B5E=(GWV[D0E])
return true
endfunction
function AWR takes nothing returns boolean
local integer D0E=B3E
if GTV[GWV[D0E]]==D0E then
call JPE(GWV[D0E])
elseif GUV[GWV[D0E]]==D0E then
call JME(GWV[D0E])
else
set GTV[GUV[D0E]]=GTV[D0E]
set GUV[GTV[D0E]]=GUV[D0E]
set GWV[GWV[D0E]]=(GWV[GWV[D0E]])-1
set GTV[D0E]=0
set GUV[D0E]=0
set GWV[D0E]=0
endif
set B5E=D0E
return true
endfunction
function AYR takes nothing returns boolean
local integer D0E=B3E
local integer AZR=GUV[D0E]
set GUV[D0E]=GUV[GUV[D0E]]
set GTV[GUV[D0E]]=0
set GWV[D0E]=(GWV[D0E])-1
set GTV[AZR]=0
set GUV[AZR]=0
set GWV[AZR]=0
if GTV[D0E]==AZR then
set GTV[D0E]=0
endif
set B5E=AZR
return true
endfunction
function A_R takes nothing returns boolean
local integer D0E=B3E
local integer A0R=GTV[D0E]
set GTV[D0E]=GTV[GTV[D0E]]
set GUV[GTV[D0E]]=0
set GWV[D0E]=(GWV[D0E])-1
set GTV[A0R]=0
set GUV[A0R]=0
set GWV[A0R]=0
if GUV[D0E]==A0R then
set GUV[D0E]=0
endif
set B5E=A0R
return true
endfunction
function A1R takes nothing returns boolean
local integer D0E=B3E
local integer i=0
call LHE(HAV[D0E],D0E)
if HaveSavedInteger(ZA,D0E,-1)then
set i=LoadInteger(ZA,D0E,-1)-1
loop
exitwhen i<0
call JDE((LoadInteger(ZA,D0E,i)),D0E)
set i=i-1
endloop
call FlushChildHashtable(ZA,D0E)
call FlushChildHashtable(VN,D0E)
endif
if HVV[D0E]then
call SetUnitAnimationByIndex(HFV[D0E],90)
endif
if H_V[D0E]!=null then
call DestroyEffect(H_V[D0E])
endif
if G8V[D0E]then
call V3X(HFV[D0E],G6V[D0E])
else
call RemoveUnit(HFV[D0E])
endif
if HaveSavedInteger(ZA,0,(D0E))then
call RemoveSavedInteger(ZA,0,(D0E))
endif
call TZE(JVV[D0E])
set JVV[D0E]=null
if(JBV[(D0E)])then
call ELX(D0E)
endif
set GDV[(GetUnitUserData(((HFV[D0E]))))]=0
set GZV[D0E]=null
set HFV[D0E]=null
set H_V[D0E]=null
set H0V[D0E]=""
call JUE(D0E)
return true
endfunction
function A2R takes nothing returns boolean
local integer D0E=B3E
set JHV[JJV[D0E]]=JHV[D0E]
set JJV[JHV[D0E]]=JJV[D0E]
return true
endfunction
function A3R takes nothing returns boolean
local integer D0E=B3E
set GLV[GMV[D0E]]=GLV[D0E]
set GMV[GLV[D0E]]=GMV[D0E]
return true
endfunction
function A4R takes nothing returns boolean
set B4E=(GetUnitTypeId((BYE))=='e001')
return true
endfunction
function A5R takes nothing returns boolean
local integer D0E=B3E
set GDV[D0E]=0
return true
endfunction
function A6R takes nothing returns boolean
local integer D0E=B3E
set GDV[D0E]=0
return true
endfunction
function A7R takes nothing returns boolean
local integer D0E=B3E
call DZE(D0E,false)
call DWE(D0E,.0)
call DTE(D0E,true)
return true
endfunction
function A8R takes nothing returns boolean
local integer D0E=B3E
if GetUnitAbilityLevel((YX[((D0E))]),'Aloc') != 1 and GetUnitTypeId((YX[((D0E))])) != 'e005' and GetOwningPlayer((YX[((D0E))])) != Player(PLAYER_NEUTRAL_PASSIVE) then
set D1V[D0E]=CreateTrigger()
call TriggerAddCondition(D1V[D0E],D0V)
call TriggerRegisterUnitEvent(D1V[D0E],(YX[((D0E))]),EVENT_UNIT_DAMAGED)
endif
return true
endfunction
function A9R takes nothing returns boolean
local integer D0E=B3E
if D1V[D0E] != null then
call DestroyTrigger(D1V[D0E])
endif
return true
endfunction
function NVR takes nothing returns boolean
set D0V=Condition(function YPE)
return true
endfunction
function NER takes nothing returns boolean
local integer D0E=B3E
if(DZV[D0E]!=0)then
call UnitRemoveAbility(DPV[D0E],DZV[D0E])
endif
if(DQV[D0E]!=null)then
call DestroyEffect(DQV[D0E])
set DQV[D0E]=null
endif
if(DGV==8190)then
call TimerStart(OI,0,false,function YAE)
call ExplodeUnitBJ(DPV[D0E])
else
set DDV[DGV]=DPV[D0E]
set DFV[DGV]=TimerGetElapsed(RI)+4.
set DGV=((DGV)+1)
if(DGV==1)then
call TimerStart(OI,4.,false,function YAE)
endif
call SetUnitOwner(DPV[D0E],Player(PLAYER_NEUTRAL_PASSIVE),false)
endif
set DPV[D0E]=null
return true
endfunction
function NXR takes nothing returns boolean
local integer D0E=B3E
local integer i=0
loop
call WGE(D0E,DEV[DXV[D0E]+i])
set i=i+1
exitwhen i==6
endloop
call WHE(D0E,DOV[D0E])
set DOV[D0E]=0
return true
endfunction
function NOR takes nothing returns boolean
local integer D0E=B3E
call FlushChildHashtable(CX,((D0E)))
return true
endfunction
function NRR takes nothing returns boolean
local integer D0E=B3E
local real x=BUE
set A6V[D0E]=x
call SetUnitX(A3V[D0E],x)
set A4V[(D0E)]=.0
return true
endfunction
function NIR takes nothing returns boolean
local integer D0E=B3E
local real y=BUE
set A7V[D0E]=y
call SetUnitY(A3V[D0E],y)
set A4V[(D0E)]=.0
return true
endfunction
function NAR takes nothing returns boolean
local integer D0E=B3E
local real K0E=BUE
local integer z=R2I(K0E*.7)
loop
exitwhen z>=0 and z<=252
if z>252 then
set z=z-252
else
set z=z+252
endif
endloop
call SetUnitAnimationByIndex(A3V[D0E],z)
set A4V[(D0E)]=.0
return true
endfunction
function NNR takes nothing returns boolean
local integer D0E=B3E
local real K2E=BUE
set NVV[D0E]=K2E
call SetUnitTurnSpeed(A3V[D0E],K2E)
set A4V[(D0E)]=.0
return true
endfunction
function NBR takes nothing returns boolean
local integer D0E=B3E
set ACV[D0E]=null
set AJV[D0E]=null
call RemoveLocation(AJV[D0E])
return true
endfunction
function NCR takes nothing returns boolean
local integer J7E=LRE()
set FKV[J7E]=P8E(.0,.0,.0)
set FLV[J7E]=P8E(.0,.0,.0)
set FMV[J7E]=P8E(.0,.0,.0)
set FPV[J7E]=P8E(.0,.0,.0)
call DTE((FKV[J7E]),false)
call DTE((FLV[J7E]),false)
call DTE((FPV[J7E]),false)
call DTE((FMV[J7E]),false)
set F4V[J7E]=true
call J9E(J7E)
if J7E==F7V then
set F7V=F7V+1
endif
set B5E=J7E
return true
endfunction
function NDR takes nothing returns boolean
set B4E=UKE(B3E,BYE)
return true
endfunction
function NFR takes nothing returns boolean
local integer D0E=B3E
set CWV[CYV[D0E]]=CWV[D0E]
set CYV[CWV[D0E]]=CYV[D0E]
return true
endfunction
function NGR takes nothing returns boolean
local integer D0E=B3E
set KQV[D0E]=false
set KPV[D0E]=false
set KMV[D0E]=false
set KJV[D0E]=""
set KKV[D0E]=""
set B3E=D0E
return true
endfunction
function NHR takes nothing returns boolean
local integer D0E=B3E
set B4E=true
return true
endfunction
function NJR takes nothing returns boolean
local integer D0E=B3E
return true
endfunction
function NKR takes nothing returns boolean
local integer D0E=B3E
set KTV=KDV[D0E]
set KUV=Z5E(D0E)
set KWV=KBV[D0E]-KCV[D0E]
set KZV=D0E
call LBE(D0E)
if KQV[D0E]then
call R2X(KSV[D0E],Z5E(D0E),KKV[D0E])
set KSV[D0E]=Z5E(D0E)
endif
if KDV[D0E]==Z5E(D0E)and KPV[D0E]then
call IVX(D0E)
return true
endif
if not KMV[D0E]then
call SaveInteger(CX,((KLV[D0E])),GetHandleId((Z5E(D0E))),(D0E))
endif
set KCV[D0E]=KCV[D0E]-1
if KCV[D0E]==0 then
if KPV[D0E]then
call Z8E(D0E,KTV)
return true
else
call IVX(D0E)
return true
endif
endif
call GroupEnumUnitsInRange(KYV,GetUnitX(Z5E(D0E)),GetUnitY(Z5E(D0E)),KFV[D0E],Condition(function IEX))
set KUV=GroupPickRandomUnit(KYV)
if KUV==null then
if KPV[D0E]then
set KUV=KTV
else
call IVX(D0E)
return true
endif
endif
call Z8E(D0E,KUV)
call GroupClear(KYV)
return true
endfunction
function NLR takes nothing returns boolean
local integer D0E=B3E
set B4E=IsUnitEnemy(KUV,GetOwningPlayer(KTV))and GetWidgetLife(KUV)>.405 and IsUnitAliveBJ(KUV)
return true
endfunction
function NMR takes nothing returns boolean
local integer D0E=B3E
if IsEyeRat[GetUnitUserData(LC[(1+GetPlayerId(GetOwningPlayer(KTV)))])] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Banana.mdx",KUV,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Void.mdx",KUV,"chest"))
endif
call UnitDamageTargetEx(KTV,KUV,A6E[YYV[D0E]]+(GetHeroAgi(LC[(1+GetPlayerId(GetOwningPlayer(KTV)))],true)*GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(KTV)))],'A00D')*.12*GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(KTV)))],'A00D'))*(1.+(.03 * GetHeroLevel(LC[(1+GetPlayerId(GetOwningPlayer(KTV)))]))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
return true
endfunction
function NPR takes nothing returns boolean
local integer D0E=B3E
set B4E=GetUnitState(KUV,UNIT_STATE_MANA)>.0 and GetWidgetLife(KUV)>.405 and IsUnitEnemy(KUV,GetOwningPlayer(KTV))and not IsUnitType(KUV,UNIT_TYPE_MAGIC_IMMUNE)and IsUnitType(KUV,UNIT_TYPE_HERO)and not(GetUnitAbilityLevel((KUV),'Avul')>0)
return true
endfunction
function NQR takes nothing returns boolean
local integer D0E=B3E
local real BFX=GetUnitState(KUV,UNIT_STATE_MANA)
local integer ELO=GetUnitAbilityLevel(KTV,'A00J')-1
local real NSR=A5E[ELO]-A5E[ELO]*(1-Pow(1-.0,KWV))
local unit u
if NSR>BFX then
set NSR=BFX
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Energy Release.mdx",KUV,"origin"))
set u = CreateUnit(GetOwningPlayer(KTV),'h007',0.,0.,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,'A01F')
call IssueTargetOrder(u,"manaburn",KUV)
//call Q9E(KUV,R2I(NSR))
//call UnitDamageTarget(KTV,KUV,NSR,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
//call SetUnitState(KUV,UNIT_STATE_MANA,BFX-NSR)
set u =null
return true
endfunction
function NTR takes nothing returns boolean
local integer D0E=B3E
set B4E=IsUnitEnemy(KUV,GetOwningPlayer(KTV))and GetWidgetLife(KUV)>.405 and IsUnitType(KUV,UNIT_TYPE_HERO)and not(GetUnitAbilityLevel((KUV),'Avul')>0)and not IsUnitType(KUV,UNIT_TYPE_MAGIC_IMMUNE)
return true
endfunction
function NUR takes nothing returns boolean
local integer D0E=B3E
local real BFX=GetUnitState(KUV,UNIT_STATE_MANA)
local real NSR=GetUnitState(KUV,UNIT_STATE_MANA)*.5
if NSR > 50000. then
set NSR = 50000.
endif
if KUV == KTV then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Energy Release.mdx",KUV,"origin"))
call SetUnitState(KUV,UNIT_STATE_MANA,BFX+YUV[D0E])
call AddUnitBonus(KUV,BONUS_MANA,YUV[D0E]*1.)
call Q9999E(KUV,R2I(YUV[D0E]))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Energy Release.mdx",KUV,"origin"))
call SetUnitState(KUV,UNIT_STATE_MANA,BFX-NSR)
call Q9E(KUV,R2I(NSR))
set YUV[D0E]=YUV[D0E]+NSR
endif
return true
endfunction
function NWR takes nothing returns boolean
call PCE(B0E,B_E)
return true
endfunction
function NYR takes nothing returns boolean
call T0E(B1E)
return true
endfunction
function NZR takes nothing returns boolean
call OOX(B_E,BYE)
return true
endfunction
function N_R takes nothing returns boolean
local integer E3X=MA
local integer TBE=(PA)
if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
set G5V[E3X]=.5
call SetUnitVertexColor(HFV[E3X],25,100,150,255)
endif
return true
endfunction
function N0R takes nothing returns boolean
local integer p=B_E
call XQX(KA,HHV[p],HJV[p],HKV[p],125.,p,(1))
return true
endfunction
globals
constant group DEMONIC_SINGULARITY_GROUP = CreateGroup()
unit DEMONIC_SINGULARITY_CASTER
real DEMONIC_SINGULARITY_DAMAGE
endglobals
function N0R3 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit d
if IsUnitEnemy(u,GetOwningPlayer(DEMONIC_SINGULARITY_CASTER)) and UnitAlive(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\DarknessBomb.mdx",u,"chest"))
call UnitDamageTargetEx(DEMONIC_SINGULARITY_CASTER,(u),DEMONIC_SINGULARITY_DAMAGE,false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set d = CreateUnit(GetOwningPlayer(DEMONIC_SINGULARITY_CASTER),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A0NB')
call IssueTargetOrderById(d,852095,u)
call UnitApplyTimedLife(d,'BTLF',1.)
endif
set d = null
set u = null
return false
endfunction
function N0R2 takes nothing returns boolean
local integer p=B_E
local effect fx = AddSpecialEffect("war3mapImported\\Nether Blast IV.mdx",HHV[p],HJV[p])
call BlzSetSpecialEffectScale(fx,2.)
call BlzSetSpecialEffectZ(fx,300.)
call DestroyEffect(fx)
//call BJDebugMsg(GetUnitName(GZV[p]))
//call BJDebugMsg(R2S(((G3V[p])*64.)))
set DEMONIC_SINGULARITY_CASTER = GZV[p]
set DEMONIC_SINGULARITY_DAMAGE = ((G3V[p])*256.)
call GroupEnumUnitsInRange(DEMONIC_SINGULARITY_GROUP,HHV[p],HJV[p],325.,Filter(function N0R3))
call EHX(p)
set fx = null
return true
endfunction
function N1R takes nothing returns boolean
call REX(B_E,BYE)
return true
endfunction
function N2R takes nothing returns boolean
call RXX(B_E,BYE)
return true
endfunction
function N3R takes nothing returns boolean
local integer p=B_E
call EHX(p)
return true
endfunction
function N4R takes nothing returns boolean
local integer p=B_E
return true
endfunction
function N5R takes nothing returns boolean
local integer p=B_E
return true
endfunction
function N6R takes nothing returns boolean
local integer p=(MA)
if HEV[p]then
call EDX(p)
endif
return true
endfunction
function N7R takes nothing returns boolean
call RMX(B_E,BYE)
return true
endfunction
function N8R takes nothing returns boolean
call RYX(B_E,BYE)
return true
endfunction
function N9R takes nothing returns boolean
call IRX(B_E,BYE)
return true
endfunction
function BVR takes nothing returns boolean
local integer RPX=B_E
call EHX(RPX)
return true
endfunction
function BER takes nothing returns boolean
local integer RPX=B_E
local integer XSX=((LoadInteger(ZA,0,((RPX)))))
local integer p=0
local integer i=0
local integer ri
local real ps=1000.
local real ss=1.
local real x=0
local real y=0
local real a=0
loop
exitwhen i==ZN
set x=K2V[XSX]+GetRandomReal(.0,200.)*Cos(GetRandomReal(.0,bj_PI*2.))
set y=K3V[XSX]+GetRandomReal(.0,200.)*Sin(GetRandomReal(.0,bj_PI*2.))
set a=Atan2(y-HJV[RPX],x-HHV[RPX])
set p=XAX(HHV[RPX],HJV[RPX],HKV[RPX],a)
set GZV[p]=GZV[RPX]
set G_V[p]=G_V[RPX]
set ri = GetRandomInt(0,100)
if ri <= 20 then//lightning
call V9X(p,"war3mapImported\\LightningArrow1.mdx")
set ps = 1250.
set ss = 2.25
elseif ri >20 and ri <= 40 then
call V9X(p,"Abilities\\Weapons\\FlamingArrow\\FlamingArrowMissile.mdl")
set ss = 1.75
elseif ri > 40 and ri <= 60 then
call V9X(p,"Abilities\\Weapons\\ColdArrow\\ColdArrowMissile.mdl")
set ps = 850.
set ss = 1.75
elseif ri>60 and ri<=80 then
call V9X(p,"war3mapImported\\CentaurArcherMissile.mdx")
set ss = 1.75
elseif ri>80 and ri<=100 then
call V9X(p,"war3mapImported\\s_Enchanted Arrow.mdx")
set ss = 1.5
endif
set G3V[p]=50.
call V8X(p,ss)
set G6V[p]=5.
set G1V[p]=80.
set G8V[p]=true
set HVV[p]=true
set HOV[p]=true
set HCV[p]=(5)
set HBV[p]=(5)
call XIX(p,x,y,.0,ps*.75,.1)
set i=i+1
endloop
call JAE(XSX)
call EHX(RPX)
return true
endfunction
function BXR takes nothing returns boolean
call IBX(B_E,BYE)
return true
endfunction
function BOR takes nothing returns boolean
local integer RPX=B_E
call EHX(RPX)
return true
endfunction
function BRR takes nothing returns boolean
local integer RPX=B_E
local unit u
local integer lvl = GetUnitAbilityLevel(GZV[RPX],'A0CM')
set u=CreateUnit(GetOwningPlayer(GZV[RPX]),'h007',HHV[RPX],HJV[RPX],.0)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,'A03I')
call SetUnitAbilityLevel(u,'A03I',lvl)
call IssueTargetOrderById(u,852095,(HZV[(RPX)]))
if not IsUnitType(HZV[(RPX)],UNIT_TYPE_HERO) then
call UnitDamageTargetEx(GZV[RPX],HZV[(RPX)],((GetHeroStr(GZV[RPX],true)*.5*lvl*(1.+(.05*GetHeroLevel(GZV[RPX]))))),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
call EHX(RPX)
set u=null
return true
endfunction
function BIR takes nothing returns boolean
call IQX(B_E,BYE)
return true
endfunction
function BAR takes nothing returns boolean
local integer RPX=B_E
local unit u2=GZV[RPX]
local real x=HHV[RPX]
local real y=HJV[RPX]
call EHX(RPX)
set NB=u2
call GroupEnumUnitsInRange(AB,x,y,250.+(10.*I2R(GetUnitAbilityLevel(u2,'A017'))),Filter(function IWX))
call DestroyEffect(AddSpecialEffect("war3mapImported\\FireNova.mdx",x,y))
set u2=null
return true
endfunction
function BNR takes nothing returns boolean
call I0X(B_E,BYE)
return true
endfunction
function BBR takes nothing returns boolean
call I4X(B_E,BYE)
return true
endfunction
function BCR takes nothing returns boolean
local integer RPX=B_E
call EHX(RPX)
return true
endfunction
function BDR takes nothing returns boolean
call AEX(B_E,BYE)
return true
endfunction
function BFR takes nothing returns boolean
local integer p=B_E
//call EHX(p)
return true
endfunction
function BGR takes nothing returns boolean
call AXX(B_E,BZE)
return true
endfunction
function BHR takes nothing returns boolean
local integer E3X=MA
local integer TBE=(PA)
if GZV[E3X]!=GZV[TBE]then
call ECX(E3X,HHV[E3X]+((600.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((600.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
endif
return true
endfunction
function BJR takes nothing returns boolean
local integer p=B_E
call XQX(KA,HHV[p],HJV[p],HKV[p],150.,p,(3))
return true
endfunction
function BKR takes nothing returns boolean
local integer RPX=B_E
local location BLR=Location(HHV[RPX],HJV[RPX])
if JFV[RPX]then
call DestroyEffect(L8E("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",HHV[RPX],HJV[RPX],HKV[RPX]))
call OTX(GZV[RPX],BLR,G3V[RPX],180.,DAMAGE_TYPE_NORMAL,ATTACK_TYPE_NORMAL,false)
else
call EHX(RPX)
endif
call RemoveLocation(BLR)
set BLR=null
return true
endfunction
function BMR takes nothing returns boolean
call AGX(B_E,BYE)
return true
endfunction
function BPR takes nothing returns boolean
local integer RPX=B_E
call EHX(RPX)
return true
endfunction
function BQR takes nothing returns boolean
local integer RPX=B_E
return true
endfunction
function BSR takes nothing returns boolean
call APX(B_E,BYE)
return true
endfunction
function BTR takes nothing returns boolean
call AZX(B_E,BYE)
return true
endfunction
function BUR takes nothing returns boolean
call A2X(B_E,BYE)
return true
endfunction
function BWR takes nothing returns boolean
call A6X(B_E,BYE)
return true
endfunction
function BYR takes nothing returns boolean
call NVX(B_E,BYE)
return true
endfunction
function BZR takes nothing returns boolean
local integer RPX=B_E
call EHX(RPX)
return true
endfunction
function B_R takes nothing returns boolean
call NEX(B_E,BZE)
return true
endfunction
function B0R takes nothing returns boolean
local integer RPX=B_E
if not EJX(RPX,(HZV[(RPX)]))and IsUnitInRangeXY((HZV[(RPX)]),HHV[RPX],HJV[RPX],G1V[RPX])then
call NVX(RPX,(HZV[(RPX)]))
endif
return true
endfunction
function B1R takes nothing returns boolean
call NIX(B_E,BYE)
return true
endfunction
function B2R takes nothing returns boolean
call NBX(B_E,BZE)
return true
endfunction
function B3R takes nothing returns boolean
local integer E3X=MA
local integer TBE=(PA)
if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
call ECX(E3X,HHV[E3X]+((700.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((700.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
endif
return true
endfunction
function B4R takes nothing returns boolean
local integer p=B_E
call XQX(KA,HHV[p],HJV[p],HKV[p],172.,p,(4))
return true
endfunction
function B5R takes nothing returns boolean
local integer p=MA
set G5V[p]=1.
return true
endfunction
function B6R takes nothing returns boolean
local integer p=MA
set HEV[p]=false
set G5V[p]=.1
return true
endfunction
function B7R takes nothing returns boolean
local integer RPX=B_E
local unit u
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",HHV[RPX],HJV[RPX]))
set u=CreateUnit(GetOwningPlayer(GZV[RPX]),'n00L',HHV[RPX],HJV[RPX],270.)
if XT==1 then
call UnitRemoveAbility(u,'A018')
endif
call UnitApplyTimedLife(u,'BTLF',45.)
call EHX(RPX)
set u=null
return true
endfunction
function B8R takes nothing returns boolean
call N6X(B_E,BYE)
return true
endfunction
function B9R takes nothing returns boolean
call BVX(B_E,BYE)
return true
endfunction
function CVR takes nothing returns boolean
local integer p=B_E
return true
endfunction
function CER takes nothing returns boolean
local integer E3X=MA
local integer TBE=(PA)
if IsUnitEnemy(GZV[E3X],GetOwningPlayer(GZV[TBE]))then
call ECX(E3X,HHV[E3X]+((700.*2.75)*.03125)*Cos(EOX(TBE)),HJV[E3X]+((700.*2.75)*.03125)*Sin(EOX(TBE)),HKV[E3X],true)
endif
return true
endfunction
function CXR takes nothing returns boolean
local integer p=B_E
call XQX(KA,HHV[p],HJV[p],HKV[p],125.,p,(7))
return true
endfunction
function COR takes nothing returns boolean
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(P8V[d])
local real y=GetUnitY(P8V[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((P8V[d])))
if GetRandomReal(.0,1.)<=.5 and not IsUnitAlly(GZV[p],GetOwningPlayer(P8V[d]))and UnitAlive(P8V[d])then
if not XMX(AC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",P8V[d],"origin"))
call B5X(P8V[d],a*bj_RADTODEG)
endif
endif
call XLX(AC[j],p)
return true
endfunction
function CRR takes nothing returns boolean
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(QJV[d])
local real y=GetUnitY(QJV[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((QJV[d])))
if GetRandomReal(.0,1.)<=.5 and not IsUnitAlly(GZV[p],GetOwningPlayer(QJV[d]))and UnitAlive(QJV[d])then
if not XMX(CC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",QJV[d],"origin"))
call CCX(QJV[d],a*bj_RADTODEG)
endif
endif
call XLX(CC[j],p)
return true
endfunction
function CIR takes nothing returns boolean
local integer p=MA
local integer d=(PA)
local real x=GetUnitX(Q3V[d])
local real y=GetUnitY(Q3V[d])
local real a=Atan2((HJV[p]-y),(HHV[p]-x))
local integer j=(GetUnitUserData((Q3V[d])))
if GetRandomReal(.0,1.)<=.25+(I2R(XT)/10.)and not IsUnitAlly(GZV[p],GetOwningPlayer(Q3V[d]))and UnitAlive(Q3V[d])then
if not XMX(GC[j],p)then
set HEV[p]=false
set JGV[p]=0
call ERX(p,x+500.*Cos(a),y+500.*Sin(a),.0,true)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",Q3V[d],"origin"))
call CWX(Q3V[d],a*bj_RADTODEG)
endif
endif
call XLX(GC[j],p)
return true
endfunction
function CAR takes nothing returns boolean
local integer p=(MA)
local real x=.0
local real y=.0
set HEV[p]=true
call DestroyEffect(L8E("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",HHV[p],HJV[p],HKV[p]-30.))
set x=HHV[p]+500.*Cos(EOX(p))
set y=HJV[p]+500.*Sin(EOX(p))
call ECX(p,x,y,HKV[p],false)
set x=HQV[p]+500.*Cos(EOX(p))
set y=HSV[p]+500.*Sin(EOX(p))
call ERX(p,x,y,HTV[p],false)
call DestroyEffect(L8E("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",HHV[p],HJV[p],HKV[p]-30.))
return true
endfunction
function CNR takes nothing returns boolean
local integer VRO=B_E
set BSE=(VRO*1.5)+10.
return true
endfunction
function CBR takes nothing returns boolean
local integer VRO=B_E
set BSE=15.+(2.*VRO)
return true
endfunction
function CCR takes nothing returns boolean
call TNO(B_E,BYE)
return true
endfunction
function CDR takes nothing returns boolean
local integer p=B_E
call EHX(p)
return true
endfunction
function CFR takes nothing returns boolean
call X_R(B2E,BUE,BWE)
return true
endfunction
function AIR takes nothing returns nothing
set BGE=CreateTrigger()
call TriggerAddCondition(BGE,Condition(function AAR))
set NDE=CreateTrigger()
call TriggerAddCondition(NDE,Condition(function ANR))
set BFE=CreateTrigger()
call TriggerAddCondition(BFE,Condition(function ABR))
set BDE=CreateTrigger()
call TriggerAddCondition(BDE,Condition(function ACR))
set BCE=CreateTrigger()
call TriggerAddCondition(BCE,Condition(function ADR))
set BBE=CreateTrigger()
call TriggerAddCondition(BBE,Condition(function AFR))
set BNE=CreateTrigger()
call TriggerAddCondition(BNE,Condition(function AGR))
set BAE=CreateTrigger()
call TriggerAddCondition(BAE,Condition(function AHR))
set BIE=CreateTrigger()
call TriggerAddCondition(BIE,Condition(function AJR))
set BRE=CreateTrigger()
call TriggerAddCondition(BRE,Condition(function AKR))
set BOE=CreateTrigger()
call TriggerAddCondition(BOE,Condition(function ALR))
set BXE=CreateTrigger()
call TriggerAddCondition(BXE,Condition(function AMR))
set BEE=CreateTrigger()
call TriggerAddCondition(BEE,Condition(function APR))
set NFE=CreateTrigger()
call TriggerAddCondition(NFE,Condition(function AQR))
set N9E=CreateTrigger()
call TriggerAddCondition(N9E,Condition(function ASR))
set BVE=CreateTrigger()
call TriggerAddCondition(BVE,Condition(function ATR))
set N3E=CreateTrigger()
call TriggerAddCondition(N3E,Condition(function AUR))
set N4E=CreateTrigger()
call TriggerAddCondition(N4E,Condition(function AWR))
set N5E=CreateTrigger()
call TriggerAddCondition(N5E,Condition(function AYR))
set N6E=CreateTrigger()
call TriggerAddCondition(N6E,Condition(function A_R))
set N7E=CreateTrigger()
call TriggerAddCondition(N7E,Condition(function A1R))
set N8E=CreateTrigger()
call TriggerAddCondition(N8E,Condition(function A2R))
set N2E=CreateTrigger()
call TriggerAddCondition(N2E,Condition(function A3R))
set N_E=CreateTrigger()
call TriggerAddCondition(N_E,Condition(function A4R))
set N0E=CreateTrigger()
call TriggerAddCondition(N0E,Condition(function A5R))
set N1E=CreateTrigger()
call TriggerAddCondition(N1E,Condition(function A6R))
set NGE=CreateTrigger()
call TriggerAddCondition(NGE,Condition(function A7R))
set FRV[34]=null
set FIV[34]=null
set FIV[43]=null
set FIV[89]=null
set FIV[90]=null
set FIV[91]=null
set FAV[34]=null
set FAV[43]=null
set FAV[89]=null
set FAV[90]=null
set FAV[91]=null
set FNV[34]=null
set FNV[43]=null
set FNV[89]=null
set FNV[90]=null
set FNV[91]=null
set FBV[34]=null
set FBV[43]=null
set FBV[89]=null
set FBV[90]=null
set FBV[91]=null
set FCV[34]=null
set FCV[43]=null
set FCV[89]=null
set FCV[90]=null
set FCV[91]=null
set FDV[34]=null
set FDV[43]=null
set FDV[89]=null
set FDV[90]=null
set FDV[91]=null
set FFV[34]=null
set FFV[43]=null
set FFV[89]=null
set FFV[90]=null
set FFV[91]=null
set FGV[34]=null
set FGV[43]=null
set FGV[89]=null
set FGV[90]=null
set FGV[91]=null
set NUE=CreateTrigger()
call TriggerAddCondition(NUE,Condition(function A8R))
set NWE=CreateTrigger()
call TriggerAddCondition(NWE,Condition(function A9R))
set NYE=CreateTrigger()
call TriggerAddCondition(NYE,Condition(function NVR))
set NTE=CreateTrigger()
call TriggerAddCondition(NTE,Condition(function NER))
set NSE=CreateTrigger()
call TriggerAddCondition(NSE,Condition(function NXR))
set NCE[7]=CreateTrigger()
set NCE[8]=NCE[7]
set NCE[9]=NCE[7]
set NCE[10]=NCE[7]
call TriggerAddCondition(NCE[7],Condition(function NOR))
set B3V[22]=null
set B4V[22]=null
set B5V[22]=null
set B6V[22]=null
set NJE=CreateTrigger()
call TriggerAddCondition(NJE,Condition(function NRR))
set NKE=CreateTrigger()
call TriggerAddCondition(NKE,Condition(function NIR))
set NLE=CreateTrigger()
call TriggerAddCondition(NLE,Condition(function NAR))
set NME=CreateTrigger()
call TriggerAddCondition(NME,Condition(function NNR))
set NHE=CreateTrigger()
call TriggerAddCondition(NHE,Condition(function NBR))
set NZE=CreateTrigger()
call TriggerAddCondition(NZE,Condition(function NCR))
set FOV[34]=null
set NPE=CreateTrigger()
call TriggerAddCondition(NPE,Condition(function NDR))
set NQE=CreateTrigger()
call TriggerAddCondition(NQE,Condition(function NFR))
set B2V[22]=null
set NAE[43]=CreateTrigger()
call TriggerAddCondition(NAE[43],Condition(function NHR))
call TriggerAddAction(NAE[43],function NHR)
set NNE[43]=CreateTrigger()
call TriggerAddCondition(NNE[43],Condition(function NJR))
call TriggerAddAction(NNE[43],function NJR)
set FRV[43]=CreateTrigger()
set FRV[89]=FRV[43]
set FRV[90]=FRV[43]
set FRV[91]=FRV[43]
call TriggerAddCondition(FRV[43],Condition(function NKR))
call TriggerAddAction(FRV[43],function NKR)
set FOV[43]=CreateTrigger()
set FOV[89]=FOV[43]
set FOV[90]=FOV[43]
set FOV[91]=FOV[43]
call TriggerAddCondition(FOV[43],Condition(function NGR))
set NAE[91]=CreateTrigger()
call TriggerAddCondition(NAE[91],Condition(function NLR))
call TriggerAddAction(NAE[91],function NLR)
set NNE[91]=CreateTrigger()
call TriggerAddCondition(NNE[91],Condition(function NMR))
call TriggerAddAction(NNE[91],function NMR)
set NAE[89]=CreateTrigger()
call TriggerAddCondition(NAE[89],Condition(function NPR))
call TriggerAddAction(NAE[89],function NPR)
set NNE[89]=CreateTrigger()
call TriggerAddCondition(NNE[89],Condition(function NQR))
call TriggerAddAction(NNE[89],function NQR)
set NAE[90]=CreateTrigger()
call TriggerAddCondition(NAE[90],Condition(function NTR))
call TriggerAddAction(NAE[90],function NTR)
set NNE[90]=CreateTrigger()
call TriggerAddCondition(NNE[90],Condition(function NUR))
call TriggerAddAction(NNE[90],function NUR)
set BKE[1]=CreateTrigger()
call TriggerAddAction(BKE[1],function NWR)
call TriggerAddCondition(BKE[1],Condition(function NWR))
set BLE[1]=CreateTrigger()
call TriggerAddAction(BLE[1],function NYR)
call TriggerAddCondition(BLE[1],Condition(function NYR))
set BME[1]=CreateTrigger()
call TriggerAddAction(BME[1],function NZR)
call TriggerAddCondition(BME[1],Condition(function NZR))
set BJE[1]=CreateTrigger()
call TriggerAddAction(BJE[1],function N_R)
call TriggerAddCondition(BJE[1],Condition(function N_R))
set BHE[1]=CreateTrigger()
call TriggerAddAction(BHE[1],function N0R)
call TriggerAddCondition(BHE[1],Condition(function N0R))
set BHE[666]=CreateTrigger()
call TriggerAddAction(BHE[666],function N0R2)
call TriggerAddCondition(BHE[666],Condition(function N0R2))
set BME[2]=CreateTrigger()
call TriggerAddAction(BME[2],function N1R)
call TriggerAddCondition(BME[2],Condition(function N1R))
set BME[20]=CreateTrigger()
call TriggerAddAction(BME[20],function N2R)
call TriggerAddCondition(BME[20],Condition(function N2R))
set BHE[2]=CreateTrigger()
call TriggerAddAction(BHE[2],function N3R)
call TriggerAddCondition(BHE[2],Condition(function N3R))
set BHE[3]=CreateTrigger()
call TriggerAddAction(BHE[3],function N4R)
call TriggerAddCondition(BHE[3],Condition(function N4R))
set BHE[4]=CreateTrigger()
call TriggerAddAction(BHE[4],function N5R)
call TriggerAddCondition(BHE[4],Condition(function N5R))
set BJE[2]=CreateTrigger()
call TriggerAddAction(BJE[2],function N6R)
call TriggerAddCondition(BJE[2],Condition(function N6R))
set BME[3]=CreateTrigger()
call TriggerAddAction(BME[3],function N7R)
call TriggerAddCondition(BME[3],Condition(function N7R))
set BME[4]=CreateTrigger()
call TriggerAddAction(BME[4],function N8R)
call TriggerAddCondition(BME[4],Condition(function N8R))
set BME[5]=CreateTrigger()
call TriggerAddAction(BME[5],function N9R)
call TriggerAddCondition(BME[5],Condition(function N9R))
set BHE[5]=CreateTrigger()
call TriggerAddAction(BHE[5],function BVR)
call TriggerAddCondition(BHE[5],Condition(function BVR))
set BHE[6]=CreateTrigger()
call TriggerAddAction(BHE[6],function BER)
call TriggerAddCondition(BHE[6],Condition(function BER))
set BME[6]=CreateTrigger()
call TriggerAddAction(BME[6],function BXR)
call TriggerAddCondition(BME[6],Condition(function BXR))
set BHE[8]=CreateTrigger()
call TriggerAddAction(BHE[8],function BOR)
call TriggerAddCondition(BHE[8],Condition(function BOR))
set BHE[7]=CreateTrigger()
call TriggerAddAction(BHE[7],function BRR)
call TriggerAddCondition(BHE[7],Condition(function BRR))
set BME[7]=CreateTrigger()
call TriggerAddAction(BME[7],function BIR)
call TriggerAddCondition(BME[7],Condition(function BIR))
set BHE[9]=CreateTrigger()
call TriggerAddAction(BHE[9],function BAR)
call TriggerAddCondition(BHE[9],Condition(function BAR))
set BME[8]=CreateTrigger()
call TriggerAddAction(BME[8],function BNR)
call TriggerAddCondition(BME[8],Condition(function BNR))
set BME[9]=CreateTrigger()
call TriggerAddAction(BME[9],function BBR)
call TriggerAddCondition(BME[9],Condition(function BBR))
set BHE[10]=CreateTrigger()
call TriggerAddAction(BHE[10],function BCR)
call TriggerAddCondition(BHE[10],Condition(function BCR))
set BME[10]=CreateTrigger()
call TriggerAddAction(BME[10],function BDR)
call TriggerAddCondition(BME[10],Condition(function BDR))
set BHE[12]=CreateTrigger()
call TriggerAddAction(BHE[12],function BFR)
call TriggerAddCondition(BHE[12],Condition(function BFR))
set BPE[1]=CreateTrigger()
call TriggerAddAction(BPE[1],function BGR)
call TriggerAddCondition(BPE[1],Condition(function BGR))
set BJE[3]=CreateTrigger()
call TriggerAddAction(BJE[3],function BHR)
call TriggerAddCondition(BJE[3],Condition(function BHR))
set BHE[11]=CreateTrigger()
call TriggerAddAction(BHE[11],function BJR)
call TriggerAddCondition(BHE[11],Condition(function BJR))
set BHE[13]=CreateTrigger()
call TriggerAddAction(BHE[13],function BKR)
call TriggerAddCondition(BHE[13],Condition(function BKR))
set BME[11]=CreateTrigger()
call TriggerAddAction(BME[11],function BMR)
call TriggerAddCondition(BME[11],Condition(function BMR))
set BHE[15]=CreateTrigger()
call TriggerAddAction(BHE[15],function BPR)
call TriggerAddCondition(BHE[15],Condition(function BPR))
set BHE[14]=CreateTrigger()
call TriggerAddAction(BHE[14],function BQR)
call TriggerAddCondition(BHE[14],Condition(function BQR))
set BME[12]=CreateTrigger()
call TriggerAddAction(BME[12],function BSR)
call TriggerAddCondition(BME[12],Condition(function BSR))
set BME[13]=CreateTrigger()
call TriggerAddAction(BME[13],function BTR)
call TriggerAddCondition(BME[13],Condition(function BTR))
set BME[14]=CreateTrigger()
call TriggerAddAction(BME[14],function BUR)
call TriggerAddCondition(BME[14],Condition(function BUR))
set BME[15]=CreateTrigger()
call TriggerAddAction(BME[15],function BWR)
call TriggerAddCondition(BME[15],Condition(function BWR))
set BME[16]=CreateTrigger()
call TriggerAddAction(BME[16],function BYR)
call TriggerAddCondition(BME[16],Condition(function BYR))
set BHE[16]=CreateTrigger()
call TriggerAddAction(BHE[16],function BZR)
call TriggerAddCondition(BHE[16],Condition(function BZR))
set BPE[2]=CreateTrigger()
call TriggerAddAction(BPE[2],function B_R)
call TriggerAddCondition(BPE[2],Condition(function B_R))
set BHE[17]=CreateTrigger()
call TriggerAddAction(BHE[17],function B0R)
call TriggerAddCondition(BHE[17],Condition(function B0R))
set BME[17]=CreateTrigger()
call TriggerAddAction(BME[17],function B1R)
call TriggerAddCondition(BME[17],Condition(function B1R))
set BPE[3]=CreateTrigger()
call TriggerAddAction(BPE[3],function B2R)
call TriggerAddCondition(BPE[3],Condition(function B2R))
set BJE[4]=CreateTrigger()
call TriggerAddAction(BJE[4],function B3R)
call TriggerAddCondition(BJE[4],Condition(function B3R))
set BHE[18]=CreateTrigger()
call TriggerAddAction(BHE[18],function B4R)
call TriggerAddCondition(BHE[18],Condition(function B4R))
set BJE[5]=CreateTrigger()
call TriggerAddAction(BJE[5],function B5R)
call TriggerAddCondition(BJE[5],Condition(function B5R))
set BJE[6]=CreateTrigger()
call TriggerAddAction(BJE[6],function B6R)
call TriggerAddCondition(BJE[6],Condition(function B6R))
set BHE[19]=CreateTrigger()
call TriggerAddAction(BHE[19],function B7R)
call TriggerAddCondition(BHE[19],Condition(function B7R))
set BME[18]=CreateTrigger()
call TriggerAddAction(BME[18],function B8R)
call TriggerAddCondition(BME[18],Condition(function B8R))
set BME[19]=CreateTrigger()
call TriggerAddAction(BME[19],function B9R)
call TriggerAddCondition(BME[19],Condition(function B9R))
set BHE[21]=CreateTrigger()
call TriggerAddAction(BHE[21],function CVR)
call TriggerAddCondition(BHE[21],Condition(function CVR))
set BJE[7]=CreateTrigger()
call TriggerAddAction(BJE[7],function CER)
call TriggerAddCondition(BJE[7],Condition(function CER))
set BHE[20]=CreateTrigger()
call TriggerAddAction(BHE[20],function CXR)
call TriggerAddCondition(BHE[20],Condition(function CXR))
set BJE[8]=CreateTrigger()
call TriggerAddAction(BJE[8],function COR)
call TriggerAddCondition(BJE[8],Condition(function COR))
set BJE[9]=CreateTrigger()
call TriggerAddAction(BJE[9],function CRR)
call TriggerAddCondition(BJE[9],Condition(function CRR))
set BJE[10]=CreateTrigger()
call TriggerAddAction(BJE[10],function CIR)
call TriggerAddCondition(BJE[10],Condition(function CIR))
set BJE[11]=CreateTrigger()
call TriggerAddAction(BJE[11],function CAR)
call TriggerAddCondition(BJE[11],Condition(function CAR))
set BQE[1]=CreateTrigger()
call TriggerAddAction(BQE[1],function CNR)
call TriggerAddCondition(BQE[1],Condition(function CNR))
set BQE[2]=CreateTrigger()
call TriggerAddAction(BQE[2],function CBR)
call TriggerAddCondition(BQE[2],Condition(function CBR))
set BME[21]=CreateTrigger()
call TriggerAddAction(BME[21],function CCR)
call TriggerAddCondition(BME[21],Condition(function CCR))
set BHE[22]=CreateTrigger()
call TriggerAddAction(BHE[22],function CDR)
call TriggerAddCondition(BHE[22],Condition(function CDR))
set BTE[1]=CreateTrigger()
call TriggerAddAction(BTE[1],function CFR)
call TriggerAddCondition(BTE[1],Condition(function CFR))
call ExecuteFunc("UZE")
call ExecuteFunc("W9E")
call ExecuteFunc("Y6E")
call ExecuteFunc("V2X")
call ExecuteFunc("E7X")
call ExecuteFunc("NSX")
call ExecuteFunc("N_X")
call ExecuteFunc("B4X")
call ExecuteFunc("CVX")
call ExecuteFunc("CBX")
call ExecuteFunc("CJX")
call ExecuteFunc("CUX")
call ExecuteFunc("C1X")
call ExecuteFunc("C9X")
call ExecuteFunc("DLX")
//call ExecuteFunc("LSE")
call ExecuteFunc("QLE")
call ExecuteFunc("Q5E")
call ExecuteFunc("TCE")
call ExecuteFunc("WXE")
call ExecuteFunc("Y5E")
call ExecuteFunc("ZQE")
call ExecuteFunc("VHX")
call ExecuteFunc("VSX")
call ExecuteFunc("VYX")
call ExecuteFunc("XNX")
call ExecuteFunc("R6X")
call ExecuteFunc("D9X")
call ExecuteFunc("E7O")
call ExecuteFunc("ISR")
endfunction
//TESH.scrollpos=41
//TESH.alwaysfold=0
library TimerUtils initializer init
//*********************************************************************
//* TimerUtils (red+blue+orange flavors for 1.24b+) 2.0
//* ----------
//*
//* To implement it , create a custom text trigger called TimerUtils
//* and paste the contents of this script there.
//*
//* To copy from a map to another, copy the trigger holding this
//* library to your map.
//*
//* (requires vJass) More scripts: htt://www.wc3c.net
//*
//* For your timer needs:
//* * Attaching
//* * Recycling (with double-free protection)
//*
//* set t=NewTimer() : Get a timer (alternative to CreateTimer)
//* set t=NewTimerEx(x) : Get a timer (alternative to CreateTimer), call
//* Initialize timer data as x, instead of 0.
//*
//* ReleaseTimer(t) : Relese a timer (alt to DestroyTimer)
//* SetTimerData(t,2) : Attach value 2 to timer
//* GetTimerData(t) : Get the timer's value.
//* You can assume a timer's value is 0
//* after NewTimer.
//*
//* Multi-flavor:
//* Set USE_HASH_TABLE to true if you don't want to complicate your life.
//*
//* If you like speed and giberish try learning about the other flavors.
//*
//********************************************************************
//================================================================
globals
//How to tweak timer utils:
// USE_HASH_TABLE = true (new blue)
// * SAFEST
// * SLOWEST (though hash tables are kind of fast)
//
// USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = true (orange)
// * kinda safe (except there is a limit in the number of timers)
// * ALMOST FAST
//
// USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = false (red)
// * THE FASTEST (though is only faster than the previous method
// after using the optimizer on the map)
// * THE LEAST SAFE ( you may have to tweak OFSSET manually for it to
// work)
//
private constant boolean USE_HASH_TABLE = true
private constant boolean USE_FLEXIBLE_OFFSET = false
private constant integer OFFSET = 0x100000
private integer VOFFSET = OFFSET
//Timers to preload at map init:
private constant integer QUANTITY = 2048
//Changing this to something big will allow you to keep recycling
// timers even when there are already AN INCREDIBLE AMOUNT of timers in
// the stack. But it will make things far slower so that's probably a bad idea...
private constant integer ARRAY_SIZE = 8190
endglobals
//==================================================================================================
globals
private integer array data[ARRAY_SIZE]
private hashtable ht
endglobals
//It is dependent on jasshelper's recent inlining optimization in order to perform correctly.
function SetTimerData takes timer t, integer value returns nothing
static if(USE_HASH_TABLE) then
// new blue
call SaveInteger(ht,0,GetHandleId(t), value)
elseif (USE_FLEXIBLE_OFFSET) then
// orange
static if (DEBUG_MODE) then
if(GetHandleId(t)-VOFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
set data[GetHandleId(t)-VOFFSET]=value
else
// new red
static if (DEBUG_MODE) then
if(GetHandleId(t)-OFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
set data[GetHandleId(t)-OFFSET]=value
endif
endfunction
function GetTimerData takes timer t returns integer
static if(USE_HASH_TABLE) then
// new blue
return LoadInteger(ht,0,GetHandleId(t) )
elseif (USE_FLEXIBLE_OFFSET) then
// orange
static if (DEBUG_MODE) then
if(GetHandleId(t)-VOFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
return data[GetHandleId(t)-VOFFSET]
else
// new red
static if (DEBUG_MODE) then
if(GetHandleId(t)-OFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
return data[GetHandleId(t)-OFFSET]
endif
endfunction
//==========================================================================================
globals
private timer array tT[ARRAY_SIZE]
private integer tN = 0
private constant integer HELD=0x28829022
//use a totally random number here, the more improbable someone uses it, the better.
private boolean didinit = false
endglobals
private keyword init
//==========================================================================================
// I needed to decide between duplicating code ignoring the "Once and only once" rule
// and using the ugly textmacros. I guess textmacros won.
//
//! textmacro TIMERUTIS_PRIVATE_NewTimerCommon takes VALUE
// On second thought, no.
//! endtextmacro
function NewTimerEx takes integer value returns timer
if (tN==0) then
if (not didinit) then
//This extra if shouldn't represent a major performance drawback
//because QUANTITY rule is not supposed to be broken every day.
call init.evaluate()
set tN = tN - 1
else
//If this happens then the QUANTITY rule has already been broken, try to fix the
// issue, else fail.
debug call BJDebugMsg("NewTimer: Warning, Exceeding TimerUtils_QUANTITY, make sure all timers are getting recycled correctly")
set tT[0]=CreateTimer()
static if( not USE_HASH_TABLE) then
debug call BJDebugMsg("In case of errors, please increase it accordingly, or set TimerUtils_USE_HASH_TABLE to true")
static if( USE_FLEXIBLE_OFFSET) then
if (GetHandleId(tT[0])-VOFFSET<0) or (GetHandleId(tT[0])-VOFFSET>=ARRAY_SIZE) then
//all right, couldn't fix it
call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
return null
endif
else
if (GetHandleId(tT[0])-OFFSET<0) or (GetHandleId(tT[0])-OFFSET>=ARRAY_SIZE) then
//all right, couldn't fix it
call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
return null
endif
endif
endif
endif
else
set tN=tN-1
endif
//debug call BJDebugMsg(I2S(tN))
call SetTimerData(tT[tN],value)
return tT[tN]
endfunction
function NewTimer takes nothing returns timer
return NewTimerEx(0)
endfunction
//==========================================================================================
function ReleaseTimer takes timer t returns nothing
if(t==null) then
debug call BJDebugMsg("Warning: attempt to release a null timer")
return
endif
if (tN==ARRAY_SIZE) then
debug call BJDebugMsg("Warning: Timer stack is full, destroying timer!!")
//stack is full, the map already has much more troubles than the chance of bug
call DestroyTimer(t)
else
call PauseTimer(t)
if(GetTimerData(t)==HELD) then
debug call BJDebugMsg("Warning: ReleaseTimer: Double free!")
return
endif
call SetTimerData(t,HELD)
set tT[tN]=t
set tN=tN+1
endif
endfunction
private function init takes nothing returns nothing
local integer i=0
local integer o=-1
local boolean oops = false
if ( didinit ) then
return
else
set didinit = true
endif
static if( USE_HASH_TABLE ) then
set ht = InitHashtable()
loop
exitwhen(i==QUANTITY)
set tT[i]=CreateTimer()
call SetTimerData(tT[i], HELD)
set i=i+1
endloop
set tN = QUANTITY
else
loop
set i=0
loop
exitwhen (i==QUANTITY)
set tT[i] = CreateTimer()
if(i==0) then
set VOFFSET = GetHandleId(tT[i])
static if(USE_FLEXIBLE_OFFSET) then
set o=VOFFSET
else
set o=OFFSET
endif
endif
if (GetHandleId(tT[i])-o>=ARRAY_SIZE) then
exitwhen true
endif
if (GetHandleId(tT[i])-o>=0) then
set i=i+1
endif
endloop
set tN = i
exitwhen(tN == QUANTITY)
set oops = true
exitwhen not USE_FLEXIBLE_OFFSET
debug call BJDebugMsg("TimerUtils_init: Failed a initialization attempt, will try again")
endloop
if(oops) then
static if ( USE_FLEXIBLE_OFFSET) then
debug call BJDebugMsg("The problem has been fixed.")
//If this message doesn't appear then there is so much
//handle id fragmentation that it was impossible to preload
//so many timers and the thread crashed! Therefore this
//debug message is useful.
elseif(DEBUG_MODE) then
call BJDebugMsg("There were problems and the new timer limit is "+I2S(i))
call BJDebugMsg("This is a rare ocurrence, if the timer limit is too low:")
call BJDebugMsg("a) Change USE_FLEXIBLE_OFFSET to true (reduces performance a little)")
call BJDebugMsg("b) or try changing OFFSET to "+I2S(VOFFSET) )
endif
endif
endif
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TestingIsFun initializer OnInit
globals
private constant group GROUP = CreateGroup()
endglobals
private function FilterActions takes nothing returns boolean
if IsHeroUnitId(GetUnitTypeId(GetFilterUnit())) then
call SetHeroLevel(GetFilterUnit(),50,true)
call UnitResetCooldown(GetFilterUnit())
call SetWidgetLife(GetFilterUnit(),GetUnitState(GetFilterUnit(),UNIT_STATE_MAX_LIFE)*.75)
//call UnitAddItemById(GetFilterUnit(),'I04D')
endif
return false
endfunction
private function Actions takes nothing returns nothing
//local unit u = CreateUnit(Player(0),'ushd',-20.,-5000.,0.)
call SetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD,10000000)
call SetPlayerState(Player(0),PLAYER_STATE_RESOURCE_LUMBER,10000000)
call GroupEnumUnitsInRange(GROUP,0.,0.,99999.,function FilterActions)
// call CreateUnit(Player(0),'n02M',-6000.,0.,0.)
call CreateUnit(Player(0),'ushd',-200.,-5000.,0.)
//call CreateUnit(Player(0),'n02K',-7000.,-800.,0.)
call CreateUnit(Player(8),'n016',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n01Z',-7000.,-800.,0.)
//call CreateUnit(Player(0),'u00Y',-7000.,-800.,0.)
//call CreateUnit(Player(0),'u00W',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n01X',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n01W',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n03O',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n03P',-7000.,-800.,0.)
//call CreateUnit(Player(8),'n025',-7000.,-800.,0.)
//call CreateUnit(Player(8),'E020',7000.,-800.,0.)
//call CreateUnit(Player(0),'h00B',-7000.,-800.,0.)
//call CreateItem('I05A',-7000.,-800.)
//call BJDebugMsg(I2S(GetUnitCurrentOrder(LC[0])))
//call CreateUnit(Player(0),'u006',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n043',-7000.,-2800.,0.)
//call CreateUnit(Player(0),'n046',-7000.,-2800.,0.)
//call CreateUnit(Player(8),'n02U',-7000.,-800.,0.)
//call CreateUnit(Player(8),'n02Z',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n03K',-7000.,-800.,0.)
//call CreateUnit(Player(8),'u00Y',-7000.,-800.,0.)
//call CreateUnit(Player(0),'e00X',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n03J',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n027',-7000.,-800.,0.)
//call CreateUnit(Player(0),'n03T',-7000.,-800.,0.)
//call BJDebugMsg(I2S(GetPlayerTeam(Player(0))))
//call BJDebugMsg(I2S(GetPlayerTeam(Player(11))))
//call BJDebugMsg(R2S(MouseX[0]))
//call BJDebugMsg(R2S(MouseY[0]))
//set TC = 1
set PC = 10
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerEvent(trig,Player(0),EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction(trig,function Actions)
endfunction
endscope
call UnitAddAbility(GetTriggerUnit(),'A055')
call UnitRemoveAbility(GetTriggerUnit(),'A055')
call UnitAddAbility(GetTriggerUnit(),'A052')
call UnitRemoveAbility(GetTriggerUnit(),'A052')
call UnitAddAbility(GetTriggerUnit(),'A058')
call UnitRemoveAbility(GetTriggerUnit(),'A058')
call UnitAddAbility(GetTriggerUnit(),'A053')
call UnitRemoveAbility(GetTriggerUnit(),'A053')
call UnitAddAbility(GetTriggerUnit(),'A059')
call UnitRemoveAbility(GetTriggerUnit(),'A059')
call UnitAddAbility(GetTriggerUnit(),'A056')
call UnitRemoveAbility(GetTriggerUnit(),'A056')
call UnitAddAbility(GetTriggerUnit(),'A057')
call UnitRemoveAbility(GetTriggerUnit(),'A057')
call UnitAddAbility(GetTriggerUnit(),'A04Z')
call UnitRemoveAbility(GetTriggerUnit(),'A04Z')
call UnitAddAbility(GetTriggerUnit(),'A050')
call UnitRemoveAbility(GetTriggerUnit(),'A050')
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AutopoolOff initializer OnInit
private function Conditions takes nothing returns boolean
if AutopoolOn[GetPlayerId(GetTriggerPlayer())] then
set AutopoolOn[GetPlayerId(GetTriggerPlayer())] = false
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Turning off autopool...")
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-autopool off", true )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-autopool off", true )
call TriggerAddCondition(trig,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
globals
boolean array AutopoolOn
boolean array AutopoolOn2
endglobals
scope Autopool initializer OnInit
private struct AP
player pooler
player poolee
method destroy takes nothing returns nothing
set this.pooler = null
set this.poolee = null
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AP data = GetTimerData(t)
local integer gold
local integer wood
local integer gold2
local integer wood2
if GetPlayerSlotState(data.poolee) != PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(data.pooler) != PLAYER_SLOT_STATE_PLAYING or not AutopoolOn[GetPlayerId(data.pooler)] then
set AutopoolOn2[GetPlayerId(data.pooler)] = false
call DisplayTextToPlayer(data.pooler,0.,0.,"Autosend disabled.")
call data.destroy()
call ReleaseTimer(t)
else
set gold = GetPlayerState(data.pooler, PLAYER_STATE_RESOURCE_GOLD)
set wood = GetPlayerState(data.pooler, PLAYER_STATE_RESOURCE_LUMBER)
call SetPlayerState(data.pooler,PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(data.pooler,PLAYER_STATE_RESOURCE_LUMBER,0)
set gold2 = GetPlayerState(data.poolee, PLAYER_STATE_RESOURCE_GOLD)
set wood2 = GetPlayerState(data.poolee, PLAYER_STATE_RESOURCE_LUMBER)
if gold + gold2 >= 1000000 then
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_GOLD,1000000)
call DisplayTextToPlayer(data.pooler,0.,0.,"Warning: Autopool player has maximum gold. Stop pooling to prevent loss of resources. To turn off autosend, type -autopool off.")
call DisplayTextToPlayer(data.poolee,0.,0.,"Warning: You have maximum gold. Either spend it or convert it to prevent loss of resources.")
else
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_GOLD,gold + gold2)
endif
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_LUMBER,wood + wood2)
call SetTimerData(t,data)
call TimerStart(t,10.,false,function Handler)
endif
set t = null
endfunction
private function Conditions takes nothing returns boolean
local integer PlayerString = S2I(SubString(GetEventPlayerChatString(),10,StringLength(GetEventPlayerChatString()))) - 1
local timer t
local AP data
if PlayerString < 12 and PlayerString >= 0 then
if not AutopoolOn[GetPlayerId(GetTriggerPlayer())] and GetPlayerSlotState(Player(PlayerString)) == PLAYER_SLOT_STATE_PLAYING and IsPlayerAlly(GetTriggerPlayer(),Player(PlayerString)) and not AutopoolOn2[GetPlayerId(GetTriggerPlayer())] and GetTriggerPlayer() != Player(PlayerString) and PlayerString != GetPlayerId(GetTriggerPlayer()) and GetPlayerController(Player(PlayerString)) != MAP_CONTROL_COMPUTER then
set t = NewTimer()
set data = AP.create()
set data.pooler = GetTriggerPlayer()
set data.poolee = Player(PlayerString)
set AutopoolOn[GetPlayerId(data.pooler)] = true
set AutopoolOn2[GetPlayerId(data.pooler)] = true
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Autosending to " + GetPlayerName(Player(PlayerString)) + ".")
call DisplayTextToPlayer(Player(PlayerString),0.,0.,"Automatically receiving gold from " + GetPlayerName(GetTriggerPlayer())+".")
call SetTimerData(t,data)
call TimerStart(t,10.,false, function Handler)
else
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Error: Invalid input or you are already autosending someone. To turn off autosend, type -autopool off.")
endif
else
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Error: Invalid input.")
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-autosend", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
set AutopoolOn[0] = false
set AutopoolOn[1] = false
set AutopoolOn[2] = false
set AutopoolOn[3] = false
set AutopoolOn[4] = false
set AutopoolOn[5] = false
set AutopoolOn[6] = false
set AutopoolOn[7] = false
set AutopoolOn[8] = false
set AutopoolOn[9] = false
set AutopoolOn[10] = false
set AutopoolOn[11] = false
set AutopoolOn2[0] = false
set AutopoolOn2[1] = false
set AutopoolOn2[2] = false
set AutopoolOn2[3] = false
set AutopoolOn2[4] = false
set AutopoolOn2[5] = false
set AutopoolOn2[6] = false
set AutopoolOn2[7] = false
set AutopoolOn2[8] = false
set AutopoolOn2[9] = false
set AutopoolOn2[10] = false
set AutopoolOn2[11] = false
endfunction
endscope
//TESH.scrollpos=33
//TESH.alwaysfold=0
library TerrainPathability initializer Init
//******************************************************************************
//* BY: Rising_Dusk
//*
//* This script can be used to detect the type of pathing at a specific point.
//* It is valuable to do it this way because the IsTerrainPathable is very
//* counterintuitive and returns in odd ways and aren't always as you would
//* expect. This library, however, facilitates detecting those things reliably
//* and easily.
//*
//******************************************************************************
//*
//* > function IsTerrainDeepWater takes real x, real y returns boolean
//* > function IsTerrainShallowWater takes real x, real y returns boolean
//* > function IsTerrainLand takes real x, real y returns boolean
//* > function IsTerrainPlatform takes real x, real y returns boolean
//* > function IsTerrainWalkable takes real x, real y returns boolean
//*
//* These functions return true if the given point is of the type specified
//* in the function's name and false if it is not. For the IsTerrainWalkable
//* function, the MAX_RANGE constant below is the maximum deviation range from
//* the supplied coordinates that will still return true.
//*
//* The IsTerrainPlatform works for any preplaced walkable destructable. It will
//* return true over bridges, destructable ramps, elevators, and invisible
//* platforms. Walkable destructables created at runtime do not create the same
//* pathing hole as preplaced ones do, so this will return false for them. All
//* other functions except IsTerrainWalkable return false for platforms, because
//* the platform itself erases their pathing when the map is saved.
//*
//* After calling IsTerrainWalkable(x, y), the following two global variables
//* gain meaning. They return the X and Y coordinates of the nearest walkable
//* point to the specified coordinates. These will only deviate from the
//* IsTerrainWalkable function arguments if the function returned false.
//*
//* Variables that can be used from the library:
//* [real] TerrainPathability_X
//* [real] TerrainPathability_Y
//*
globals
private constant real MAX_RANGE = 10.
private constant integer DUMMY_ITEM_ID = 'wolg'
endglobals
globals
private item Item = null
private rect Find = null
private item array Hid
private integer HidMax = 0
public real X = 0.
public real Y = 0.
endglobals
function IsTerrainDeepWater takes real x, real y returns boolean
return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
endfunction
function IsTerrainShallowWater takes real x, real y returns boolean
return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY)
endfunction
function IsTerrainLand takes real x, real y returns boolean
return IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY)
endfunction
function IsTerrainPlatform takes real x, real y returns boolean
return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY)
endfunction
private function HideItem takes nothing returns nothing
if IsItemVisible(GetEnumItem()) then
set Hid[HidMax] = GetEnumItem()
call SetItemVisible(Hid[HidMax], false)
set HidMax = HidMax + 1
endif
endfunction
function IsTerrainWalkable takes real x, real y returns boolean
//Hide any items in the area to avoid conflicts with our item
call MoveRectTo(Find, x, y)
call EnumItemsInRect(Find ,null, function HideItem)
//Try to move the test item and get its coords
call SetItemPosition(Item, x, y) //Unhides the item
set X = GetItemX(Item)
set Y = GetItemY(Item)
static if LIBRARY_IsTerrainWalkable then
//This is for compatibility with the IsTerrainWalkable library
set IsTerrainWalkable_X = X
set IsTerrainWalkable_Y = Y
endif
call SetItemVisible(Item, false)//Hide it again
//Unhide any items hidden at the start
loop
exitwhen HidMax <= 0
set HidMax = HidMax - 1
call SetItemVisible(Hid[HidMax], true)
set Hid[HidMax] = null
endloop
//Return walkability
return (X-x)*(X-x)+(Y-y)*(Y-y) <= MAX_RANGE*MAX_RANGE and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
endfunction
private function Init takes nothing returns nothing
set Find = Rect(0., 0., 128., 128.)
set Item = CreateItem(DUMMY_ITEM_ID, 0, 0)
call SetItemVisible(Item, false)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope WellOfSorrow initializer OnInit
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
private function Conditions takes nothing returns boolean
if GetSpellAbilityId()=='A0B8' then
call PridesDownfallFunc()
endif
return false
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
library HurlBoulder initializer OnInit requires Projectile, Damage, UnitHeights
globals
private constant integer ABIL_ID = 'A000'
private constant real DAMAGE = 50.00
private constant string EFFECT = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
private location loc = Location(0.00,0.00)
endglobals
native UnitAlive takes unit id returns boolean
private function OnUnitImpact takes projectile inst, unit whichUnit returns nothing
if UnitAlive(whichUnit) and whichUnit != inst.sourceUnit then
if IsInHeightRange(inst.posZ,whichUnit) then
if whichUnit == inst.targetUnit then
call Damage_Pure(inst.sourceUnit,whichUnit,inst.damageDealt)
else
call Damage_Pure(inst.sourceUnit,whichUnit,inst.damageDealt / 2.00)
endif
call inst.terminate()
endif
endif
endfunction
private function OnProjImpact takes projectile inst, projectile whichProj returns nothing
if inst.sourceUnit != whichProj.sourceUnit then
call inst.terminate()
endif
endfunction
private function OnLandImpact takes projectile inst returns nothing
static if LIBRARY_ProjBounces then
if inst.allowBouncing then
call DestroyEffect(AddSpecialEffectZ(EFFECT,inst.posX,inst.posY,inst.posZ))
else
call inst.terminate()
endif
else
call inst.terminate()
endif
endfunction
private function OnDestImpact takes projectile inst, destructable dest returns nothing
call KillDestructable(dest)
call inst.terminate()
endfunction
private function ProjectileCollisions takes nothing returns nothing
if EnumProjectile.sourceUnit != projectile(ForProjGroupData).sourceUnit and EnumProjectile.effectPath != "Abilities\\Spells\\Undead\\DarkSummoning\\DarkSummonMissile.mdl" then
call EnumProjectile.terminate()
call projectile(ForProjGroupData).terminate()
endif
endfunction
private function OnLoopFunc takes projectile inst returns nothing
call GlobalProjGroup.forNearby(inst.posX,inst.posY,inst.posZ,64.00,inst,ProjectileCollisions)
endfunction
private function Actions takes nothing returns nothing
local unit cast = GetTriggerUnit()
local unit targ = GetSpellTargetUnit()
local real casx = GetUnitX(cast)
local real casy = GetUnitY(cast)
local real tarx = 0.00
local real tary = 0.00
local real ang = 0.00
local projectile proj = 0
if targ == null then
set tarx = GetSpellTargetX()
set tary = GetSpellTargetY()
else
set tarx = GetUnitX(targ)
set tary = GetUnitY(targ)
endif
set ang = Atan2((tary - casy),(tarx - casx))
call MoveLocation(loc,casx,casy)
//---------------------------------------------------------
set proj = projectile.create(casx,casy,GetUnitFlyHeight(cast) + 50.00 + GetLocationZ(loc),ang)
set proj.sourceUnit = cast
set proj.owningPlayer = GetOwningPlayer(cast)
set proj.effectPath = EFFECT
set proj.damageDealt = DAMAGE
set proj.scaleSize = 0.75
set proj.zOffset = 50.00
set proj.allowDeathSfx = true
set proj.allowArcAnimReset = true
set proj.allowUnitCollisions = true
set proj.allowDestCollisions = true
set proj.unitHitRadius = 64.00
set proj.destHitRadius = 64.00
set proj.onLoop = OnLoopFunc
set proj.onUnit = OnUnitImpact
set proj.onLand = OnLandImpact
set proj.onDest = OnDestImpact
static if LIBRARY_ProjShadows then
call proj.attachShadow(proj.unitHitRadius)
endif
call MoveLocation(loc,tarx,tary)
if targ != null then
set proj.targetUnit = targ
set proj.allowTargetHoming = true
call proj.projectNormal(tarx,tary,GetUnitFlyHeight(targ) + 50.00 + GetLocationZ(loc),1000.00)
else
static if LIBRARY_ProjBounces then
set proj.allowBouncing = true
set proj.bounceAmount = 2
set proj.friction = 0.25
set proj.restitution = 0.75
endif
call proj.projectArcing(tarx,tary,GetLocationZ(loc),1000.00,0.35)
endif
//---------------------------------------------------------
set cast = null
set targ = null
endfunction
private function OnSpell takes nothing returns boolean
if GetSpellAbilityId() == ABIL_ID then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig,Condition(function OnSpell))
endfunction
endlibrary
//TESH.scrollpos=10
//TESH.alwaysfold=0
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I042',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I043',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I044',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I042',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I043',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I044',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I042',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I043',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I044',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I042',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I043',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I044',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I042',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I043',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I044',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I02A' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I042',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I02W' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I043',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I038' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I044',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02A',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I02W',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,0)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,0))
call UnitAddItemToSlotById(ZSX,'I038',0)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02A',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I02W',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,1)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,1))
call UnitAddItemToSlotById(ZSX,'I038',1)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02A',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I02W',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,2)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,2))
call UnitAddItemToSlotById(ZSX,'I038',2)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02A',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I02W',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,3)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,3))
call UnitAddItemToSlotById(ZSX,'I038',3)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02A',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I02W',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,4)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,4))
call UnitAddItemToSlotById(ZSX,'I038',4)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I042' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02A',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I043' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I02W',5)
endif
if GetItemTypeId(UnitItemInSlot(ZSX,5)) == 'I044' then
call UnitRemoveItem(ZSX,UnitItemInSlot(ZSX,5))
call UnitAddItemToSlotById(ZSX,'I038',5)
endif
//TESH.scrollpos=0
//TESH.alwaysfold=0
function TXX takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer PXE=GetTimerData(t)
local real SVE=GetUnitState(U5V[PXE],UNIT_STATE_MAX_LIFE)*.07
if not UnitAlive(U5V[PXE])or U7V[PXE]==0 then
call UnitRemoveAbility(U5V[PXE],'A05W')
call DestroyEffect(U6V[PXE])
call GQE(PXE)
call ReleaseTimer(GetExpiredTimer())
else
call UnitDamageTargetEx((U4V[PXE]),(U5V[PXE]),((SVE)*1.),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
set U7V[PXE]=U7V[PXE]-1
call SetTimerData(t,PXE)
call TimerStart(t,1.,false,function TXX)
endif
set t=null
endfunction
function TOX takes nothing returns boolean
local timer t
local integer PXE
local unit S8X=GetFilterUnit()
if IsUnitEnemy(S8X,GetOwningPlayer(ODV))and UnitAlive(S8X)then
set t=NewTimer()
set PXE=GPE()
set U4V[PXE]=ODV
set U5V[PXE]=S8X
set U6V[PXE]=AddSpecialEffectTarget("war3mapImported\\NetherInferno.mdx",S8X,"chest")
set U7V[PXE]=(5+(GetUnitAbilityLevel(ODV,'A061')))
call UnitAddAbility(S8X,'A05W')
call SetUnitAbilityLevel(S8X,'A05W',GetUnitAbilityLevel(ODV,'A061'))
call SetTimerData(t,PXE)
call TimerStart(t,.01,false,function TXX)
endif
set t=null
set S8X=null
return false
endfunction
function TRX takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local unit s=CreateUnit(Player(14),'h00Q',x,y,.0)
call KillUnit(s)
call DestroyEffect(AddSpecialEffect("war3mapImported\\DecayGreen_Groundonly_1.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Acid Ex.mdx",x,y))
set ODV=u
call GroupEnumUnitsInRange(OCV,x,y,249.,Filter(function TOX))
set s=null
set u=null
endfunction
function TIX takes nothing returns boolean
if GetSpellAbilityId()=='A061' then
call TRX()
endif
return false
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope IsUnitInPathingGroup initializer OnInit
private function IsUnitAdded takes nothing returns boolean
if IsUnitInGroup(GetTriggerUnit(),PATHING_GROUP) then
call BJDebugMsg("In pathing group")
else
call BJDebugMsg("Not in pathing group")
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerAddCondition(t,function IsUnitAdded)
endfunction
endscope
//TESH.scrollpos=35
//TESH.alwaysfold=0
globals
boolean array RainsOn
endglobals
scope Rains initializer OnInit
private struct AP
player playa
method destroy takes nothing returns nothing
set this.playa = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AP data = GetTimerData(t)
local integer i = 15
local real a
local real d
if RainsOn[GetPlayerId(data.playa)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\CorpseRain.mdx",GetUnitX(LC[1+GetPlayerId(data.playa)]),GetUnitY(LC[1+GetPlayerId(data.playa)])))
loop
exitwhen i == 0
set a = GetRandomReal(0.,360.)
set d = GetRandomReal(0.,225.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\CorpseRain.mdx",GetUnitX(LC[1+GetPlayerId(data.playa)])+d*Cos(a*bj_DEGTORAD),GetUnitY(LC[1+GetPlayerId(data.playa)])+d*Sin(a*bj_DEGTORAD)))
set i = i - 1
endloop
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
else
call data.destroy()
call ReleaseTimer(t)
endif
set t = null
endfunction
private function Conditions takes nothing returns boolean
local string payload = (SubString(GetEventPlayerChatString(),18,StringLength(GetEventPlayerChatString())))
local timer t
local AP data
if payload == "off" then
if RainsOn[GetPlayerId(GetTriggerPlayer())] then
set RainsOn[GetPlayerId(GetTriggerPlayer())] = false
endif
set t = null
set payload = null
return false
else
if not RainsOn[GetPlayerId(GetTriggerPlayer())] then
set RainsOn[GetPlayerId(GetTriggerPlayer())] = true
set t = NewTimer()
set data = AP.create()
set data.playa = GetTriggerPlayer()
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
endif
set payload = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-It's Raining Men", false )
set RainsOn[pid] = false
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=35
//TESH.alwaysfold=0
globals
boolean array RainbowOn
endglobals
scope Rainbow initializer OnInit
// private struct RB
// effect r1
//effect r2
//effect r3
//effect r4
// method destroy takes nothing returns nothing
// call DestroyEffect(this.r1)
// call DestroyEffect(this.r2)
//call DestroyEffect(this.r3)
//call DestroyEffect(this.r4)
//set this.r1 = null
//set this.r2 = null
//set this.r3 = null
//set this.r4 = null
// call this.deallocate()
// endmethod
// endstruct
private function Conditions takes nothing returns boolean
if LC[(1+GetPlayerId(GetTriggerPlayer()))] != null and not RainbowOn[GetUnitUserData(LC[(1+GetPlayerId(GetTriggerPlayer()))])] then
set RainbowOn[GetUnitUserData(LC[(1+GetPlayerId(GetTriggerPlayer()))])] = true
call UnitAddAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0IY')
call UnitAddAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0J1')
call UnitAddAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0IZ')
call UnitAddAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0J0')
call UnitMakeAbilityPermanent(LC[(1+GetPlayerId(GetTriggerPlayer()))],true,'A0IY')
call UnitMakeAbilityPermanent(LC[(1+GetPlayerId(GetTriggerPlayer()))],true,'A0J1')
call UnitMakeAbilityPermanent(LC[(1+GetPlayerId(GetTriggerPlayer()))],true,'A0IZ')
call UnitMakeAbilityPermanent(LC[(1+GetPlayerId(GetTriggerPlayer()))],true,'A0J0')
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-rainbow", true)
set RainbowOn[pid] = false
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
scope SecretCodeRevealLadyVashj initializer OnInit
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == 'I04E' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"-Lady Vashj the Unwavering")
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
globals
boolean array IsRangerRat
endglobals
scope RatRanger initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Rat#21173" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'N01S' then
call BlzSetUnitSkin( LC[1+id], 'N01Q' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[47])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[47])
call BlzSetHeroProperName(LC[1+id],"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
call BlzSetUnitName(LC[1+id],"|c000100DAR|r|c000B00D3a|r|c001500CCt|r|c001F00C6l|r|c002800BFi|r|c003200B8n|r|c003C00B1g|r|c004600AB |r|c005000A4G|r|c005A009Du|r|c00630096n|r|c006D0090n|r|c00770089e|r|c00810082r|r")
set IsRangerRat[GetUnitUserData(LC[1+id])] = true
endif
endif
/*
set lvl = GetUnitAbilityLevel(LC[1+id],'A0DX')
if lvl > 0 then
call UnitRemoveAbility(LC[1+id],'A0DX')
call UnitAddAbility(LC[1+id],'A0J6')
call UnitMakeAbilityPermanent(LC[1+id],true,'A0J6')
call SetUnitAbilityLevel(LC[1+id],'A0J6',lvl)
endif
if lvl == 0 then
call SelectHeroSkill( GetTriggerUnit(), 'A0DX' )
call UnitRemoveAbility(LC[1+id],'A0DX')
call UnitAddAbility(LC[1+id],'A0J6')
call UnitMakeAbilityPermanent(LC[1+id],true,'A0J6')
call SetUnitAbilityLevel(LC[1+id],'A0J6',0)
endif
*/
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Ratty Ranger", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsRangerGreen
endglobals
scope GreenRanger initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "DrunkCat#1765" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'N01S' then
call BlzSetUnitSkin( LC[1+id], 'N03U' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[53])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[53])
call BlzSetHeroProperName(LC[1+id],"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call BlzSetUnitName(LC[1+id],"|cff008044Green Infantry Sniper|r")
set IsRangerGreen[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Army Sniper", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsTinker
endglobals
scope CustomTinker initializer OnInit
private function Conditions takes nothing returns boolean
//local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
//if GetPlayerName(GetTriggerPlayer()) == "useless#1203" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if IsTinker[GetUnitUserData(LC[1+id])] == false then
call BlzSetUnitSkin( LC[1+id], 'E01Q' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[28])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[28])
call BlzSetUnitName(LC[1+id],"Tinker")
call BlzSetHeroProperName(LC[1+id],"Coming Soon")
set IsTinker[GetUnitUserData(LC[1+id])] = true
endif
//endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-coming soon tm", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsRangerUseless
endglobals
scope UselessRanger initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "useless#1203" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'N01S' then
call BlzSetUnitSkin( LC[1+id], 'N01M' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[42])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[42])
call BlzSetUnitName(LC[1+id],"Useless Ranger")
set IsRangerUseless[GetUnitUserData(LC[1+id])] = true
endif
endif
/*
set lvl = GetUnitAbilityLevel(LC[1+id],'A0DX')
if lvl > 0 then
call UnitRemoveAbility(LC[1+id],'A0DX')
call UnitAddAbility(LC[1+id],'A0J6')
call UnitMakeAbilityPermanent(LC[1+id],true,'A0J6')
call SetUnitAbilityLevel(LC[1+id],'A0J6',lvl)
endif
if lvl == 0 then
call SelectHeroSkill( GetTriggerUnit(), 'A0DX' )
call UnitRemoveAbility(LC[1+id],'A0DX')
call UnitAddAbility(LC[1+id],'A0J6')
call UnitMakeAbilityPermanent(LC[1+id],true,'A0J6')
call SetUnitAbilityLevel(LC[1+id],'A0J6',0)
endif
*/
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Useless Ranger", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsThiefRat
endglobals
scope RatThief initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Rat#21173" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E01L' then
call BlzSetUnitSkin( LC[1+id], 'E01M' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[49])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[49])
call BlzSetHeroProperName(LC[1+id],"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
call BlzSetUnitName(LC[1+id],"|c02F101FFR|r|c02D901F6a|r|c02C101EDt|r|c01A901E4t|r|c019101DBy|r|c017900D2 |r|c016100CAT|r|c014900C1h|r|c003100B8i|r|c001900AFe|r|c000100A6f|r")
set IsThiefRat[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Ratty Thief", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsCitGod
endglobals
scope NzothCit initializer OnInit
private function Conditions takes nothing returns boolean
local real x1
local real x2
local real y1
local real y2
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Rat#21173" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E00E' then
call BlzSetUnitSkin( LC[1+id], 'E01I' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[50])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[50])
call BlzSetHeroProperName(LC[1+id],"|c02F101FFN|r|c02C101ED'|r|c019101DBz|r|c016100CAo|r|c003100B8t|r|c000100A6h|r")
call BlzSetUnitName(LC[1+id],"|c02F101FFT|r|c02DB01F7h|r|c02C501EFe|r|c01B001E7 |r|c019A01DFO|r|c018401D7l|r|c016E00CEd|r|c015800C6e|r|c014200BEr|r|c002D00B6g|r|c001700AEo|r|c000100A6d|r")
set IsCitGod[GetUnitUserData(LC[1+id])] = true
set x1 = GetUnitX(LC[1+id])
set y1 = GetUnitY(LC[1+id])
set x2 = x1 + 300. * Cos(225. * bj_DEGTORAD)
set y2 = y1 + 300. * Sin(225. * bj_DEGTORAD)
call CreateUnit(GetTriggerPlayer(),'h01W',x2,y2,225.)
set x2 = x1 + 300. * Cos(135. * bj_DEGTORAD)
set y2 = y1 + 300. * Sin(135. * bj_DEGTORAD)
call CreateUnit(GetTriggerPlayer(),'h01V',x2,y2,135.)
set x2 = x1 + 300. * Cos(315. * bj_DEGTORAD)
set y2 = y1 + 300. * Sin(315. * bj_DEGTORAD)
call CreateUnit(GetTriggerPlayer(),'h01V',x2,y2,315.)
set x2 = x1 + 300. * Cos(45. * bj_DEGTORAD)
set y2 = y1 + 300. * Sin(45. * bj_DEGTORAD)
call CreateUnit(GetTriggerPlayer(),'h01V',x2,y2,45.)
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Oldergod", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsAMChonk
endglobals
scope ChonkAM initializer OnInit
private function Conditions takes nothing returns boolean
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Fumandra#2247" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E011' then
call BlzSetUnitSkin( LC[1+id], 'O00E' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[52])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[52])
call BlzSetHeroProperName(LC[1+id],"|c007F1080C|r|c00970B55h|r|c00B0052Bo|r|c00C80000m|r|c00BA0000o|r|c00AB0000s|r|c009D0000u|r|c008E0000k|r|c00800000e|r")
call BlzSetUnitName(LC[1+id],"|c007F1080A|r|c00910C60r|r|c00A40840c|r|c00B60420a|r|c00C80000n|r|c00BC0000e|r|c00B00000 |r|c00A40000C|r|c00980000a|r|c008C0000t|r|c00800000?|r")
set IsAMChonk[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-ChonkAM", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsQoBTyrael
endglobals
scope QobTyrael initializer OnInit
private function Conditions takes nothing returns boolean
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Rat#21173" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" or GetPlayerName(GetTriggerPlayer()) == "tyreal#11180" then
if GetUnitTypeId(LC[1+id]) == 'E006' then
call BlzSetUnitSkin( LC[1+id], 'E01X' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[54])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[54])
call BlzSetHeroProperName(LC[1+id],"Tyrael")
call BlzSetUnitName(LC[1+id],"Archangel of Heaven")
set IsQoBTyrael[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Tyrael", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
scope StrikeBetaTestt initializer OnInit
private function Conditions takes nothing returns boolean
if GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
set StrikeBetaTest= true
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-beta", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsGrakeTank
endglobals
scope GrakeTank initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Fumandra#2247" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E01C' then
call BlzSetUnitSkin( LC[1+id], 'E01R' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[51])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[51])
call BlzSetHeroProperName(LC[1+id],"T-90S")
call BlzSetUnitName(LC[1+id],"Modernized Tank")
set IsGrakeTank[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Tanky Grake", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
scope CustomSkinIllusions initializer OnInit
private function Actions takes nothing returns boolean
local unit u = GetSummonedUnit()
local unit c = GetSummoningUnit()
if (IsRangerRat[GetUnitUserData(c)] or IsThiefRat[GetUnitUserData(c)] or IsRangerGreen[GetUnitUserData(c)]) and IsUnitIllusion(u) and GetUnitAbilityLevel(u,'BIil') != 1 then
if IsRangerRat[GetUnitUserData(c)] then
set IsRangerRat[GetUnitUserData(u)] = true
endif
if IsThiefRat[GetUnitUserData(c)] then
set IsThiefRat[GetUnitUserData(u)] = true
endif
if IsRangerGreen[GetUnitUserData(c)] then
set IsRangerGreen[GetUnitUserData(u)] = true
endif
if IsRangerRat[GetUnitUserData(c)] then
if GetUnitTypeId(c) == 'N01S' or GetUnitTypeId(c) == 'N01Q' then
call BlzSetUnitSkin( u, 'N01Q' )
call BlzSetHeroProperName(u,"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
if GetUnitTypeId(c) == 'N01T' or GetUnitTypeId(c) == 'N032' then
call BlzSetUnitSkin( u, 'N032' )
call BlzSetHeroProperName(u,"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
endif
if IsRangerGreen[GetUnitUserData(c)] then
if GetUnitTypeId(c) == 'N01S' or GetUnitTypeId(c) == 'N01Q' then
call BlzSetUnitSkin( u, 'N03U' )
call BlzSetHeroProperName(u,"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call SetUnitVertexColor(u,10,35,10,255)
endif
if GetUnitTypeId(c) == 'N01T' or GetUnitTypeId(c) == 'N032' then
call BlzSetUnitSkin( u, 'N03V' )
call BlzSetHeroProperName(u,"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call SetUnitVertexColor(u,10,35,10,255)
endif
//call SetUnitVertexColor(c,10,35,10,255)
endif
if GetUnitTypeId(c) == 'E01L' then
call BlzSetUnitSkin( u, 'E01M' )
call BlzSetHeroProperName(u,"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
endif
set c = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( t, Condition( function Actions ) )
endfunction
endscope
scope SecretCodeFallenOneDrop initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
if IsUnitType(u,UNIT_TYPE_ANCIENT) and GetPlayerController( GetOwningPlayer(u)) == MAP_CONTROL_COMPUTER and GetRandomInt(0,1777) == 777 then
call CreateItem('I04D',GetUnitX(u),GetUnitY(u))
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
scope SecretCodeRevealFallenOne initializer OnInit
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == 'I04D' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"-Dullahan The Fallen One :)")
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
scope SecretCodeLadyVashjDrop initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
if IsUnitType(u,UNIT_TYPE_ANCIENT) and GetPlayerController( GetOwningPlayer(u)) == MAP_CONTROL_COMPUTER and GetRandomInt(0,3666) == 666 then
call CreateItem('I04E',GetUnitX(u),GetUnitY(u))
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
scope RattyRage initializer OnInit
globals
private constant integer SPELL_ID = 'A0DX'
endglobals
native UnitAlive takes unit id returns boolean
private struct RatR
integer i
unit u
boolean b = false
method destroy takes nothing returns nothing
set this.u= null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RatR data = GetTimerData(t)
if not UnitAlive(data.u) or GetHeroProperName(data.u) == "Mira Shadewither" or data.u == null then
if IsRangerRat[GetUnitUserData(data.u)] then
call BlzSetUnitSkin( data.u, 'N032' )
call BlzSetHeroProperName(data.u,"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
endif
if IsRangerGreen[GetUnitUserData(data.u)] then
call BlzSetUnitSkin( data.u, 'N03V' )
//call BlzSetHeroProperName(data.u,"|c00000000D|r|c00404040r|r|c00808080u|r|c00BFBFBFn|r|c00FFFFFFk|r|c00E4AAAAC|r|c00C95555a|r|c00AE0000t|r")
call SetUnitVertexColor(data.u,10,35,10,255)
endif
//call BlzSetUnitName(data.u,"|c000100DAR|r|c000B00D3a|r|c001500CCt|r|c001F00C6l|r|c002800BFi|r|c003200B8n|r|c003C00B1g|r|c004600AB |r|c005000A4G|r|c005A009Du|r|c00630096n|r|c006D0090n|r|c00770089e|r|c00810082r|r")
call ReleaseTimer(t)
call data.destroy()
else
//if not data.b then
if IsRangerRat[GetUnitUserData(data.u)] then
call BlzSetUnitSkin( data.u, 'N032' )
endif
if IsRangerGreen[GetUnitUserData(data.u)] then
call BlzSetUnitSkin( data.u, 'N03V' )
//call SetUnitVertexColor(data.u,10,35,10,255)
endif
//set data.b = true
//endif
call SetTimerData(t,data)
call TimerStart(t,.03,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local timer t
local RatR data
if GetSpellAbilityId() == SPELL_ID and (IsRangerRat[GetUnitUserData(u)] or IsRangerGreen[GetUnitUserData(u)] ) then
if GetUnitTypeId(u) == 'N01S' or GetUnitTypeId(u) == 'N01T' then
set t = NewTimer()
set data = RatR.create()
if IsRangerRat[GetUnitUserData(u)] then
call BlzSetUnitSkin( u, 'N032' )
endif
if IsRangerGreen[GetUnitUserData(u)] then
call BlzSetUnitSkin( u, 'N03V' )
//call SetUnitVertexColor(u,10,35,10,255)
endif
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,.1,false,function Handler)
endif
endif
set t = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
globals
boolean array IsFallenOne
endglobals
scope CustomFallenOne initializer OnInit
private function Conditions takes nothing returns boolean
//local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
//if GetPlayerName(GetTriggerPlayer()) == "useless#1203" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E01C' and not IsUnitType(LC[1+id],UNIT_TYPE_MAGIC_IMMUNE) then
call BlzSetUnitSkin( LC[1+id], 'E00U' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[45])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[45])
call BlzSetUnitName(LC[1+id],"Fallen One")
call BlzSetHeroProperName(LC[1+id],"Dullahan")
set IsFallenOne[GetUnitUserData(LC[1+id])] = true
endif
//endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Dullahan The Fallen One :)", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsBardCustom
endglobals
scope CustomBard initializer OnInit
private function Conditions takes nothing returns boolean
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" or GetEventPlayerChatString() == "-Lady Vashj the Unwavering"then
if GetUnitTypeId(LC[1+id]) == 'E013' then
call BlzSetUnitSkin( LC[1+id], 'E00R' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[44])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[44])
call BlzSetUnitName(LC[1+id],"Handmaiden of Azshara")
call BlzSetHeroProperName(LC[1+id],"Lady Vashj")
//call UnitAddAbility(LC[1+id],'A0JJ')
set IsBardCustom[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Lady Vashj", false )
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Lady Vashj the Unwavering", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsMechaSkaar
endglobals
scope MechaSkaar initializer OnInit
private function Conditions takes nothing returns boolean
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" or GetEventPlayerChatString() == "-Thanks for being a subscriber :)"then
if GetUnitTypeId(LC[1+id]) == 'E004' then
call BlzSetUnitSkin( LC[1+id], 'E01Y' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[55])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[55])
call BlzSetUnitName(LC[1+id],"Mechanical Horror")
call BlzSetHeroProperName(LC[1+id],"Mecha Sk'aar")
//call UnitAddAbility(LC[1+id],'A0JJ')
set IsMechaSkaar[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Mecha Skaar", false )
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Thanks for being a subscriber :)", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=35
//TESH.alwaysfold=0
scope SpikeDMech initializer OnInit
// private struct RB
// effect r1
//effect r2
//effect r3
//effect r4
// method destroy takes nothing returns nothing
// call DestroyEffect(this.r1)
// call DestroyEffect(this.r2)
//call DestroyEffect(this.r3)
//call DestroyEffect(this.r4)
//set this.r1 = null
//set this.r2 = null
//set this.r3 = null
//set this.r4 = null
// call this.deallocate()
// endmethod
// endstruct
private function Conditions takes nothing returns boolean
if IsMechaSkaar[GetUnitUserData(LC[(1+GetPlayerId(GetTriggerPlayer()))])] then
if GetUnitAbilityLevel(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0M9') == 1 then
call UnitRemoveAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0M9')
else
call UnitAddAbility(LC[(1+GetPlayerId(GetTriggerPlayer()))],'A0M9')
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-spiked mech", true)
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsSkaarUseless
endglobals
scope UselessSkaar initializer OnInit
private function Conditions takes nothing returns boolean
//local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "useless#1203" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" or GetPlayerName(GetTriggerPlayer()) == "Rat#21173" then
if GetUnitTypeId(LC[1+id]) == 'E004' then
call BlzSetUnitSkin( LC[1+id], 'E00Q' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[43])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[43])
call BlzSetUnitName(LC[1+id],"Useless Horror")
set IsSkaarUseless[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Useless Horror", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
boolean array IsEyeRat
endglobals
scope EyeoftheRat initializer OnInit
private function Conditions takes nothing returns boolean
local integer lvl
local integer id = GetPlayerId(GetTriggerPlayer())
if GetPlayerName(GetTriggerPlayer()) == "Rat#21173" or GetPlayerName(GetTriggerPlayer()) == "Strikest#1504" then
if GetUnitTypeId(LC[1+id]) == 'E000' then
call BlzSetUnitSkin( LC[1+id], 'O00B' )
call MultiboardSetItemIconBJ(AS[1],1,(WS[1+id]+2),SQ[48])
call MultiboardSetItemIconBJ(AS[2],1,(WS[1+id]+2),SQ[48])
call BlzSetHeroProperName(LC[1+id],"|c000100CAR|r|c006407FFA|r|c00DC01FFT|r")
call BlzSetUnitName(LC[1+id],"|c000100E2E|r|c000F00DFy|r|c001D00DBe|r|c002B00D8 |r|c003800D4o|r|c004600D1f|r|c005400CE |r|c006200CAt|r|c007000C7h|r|c007E00C4e|r|c008B00C0 |r|c009900BDR|r|c00A700B9a|r|c00B500B6t|r")
set IsEyeRat[GetUnitUserData(LC[1+id])] = true
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-Eye of the Rat", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
scope TankGrakeLearn initializer OnInit
globals
private constant integer SPELL_ID = 'A0BS'
private constant integer SPELL_ID2 = 'A0K7'
endglobals
private function Conditions takes nothing returns boolean
if GetLearnedSkill()==SPELL_ID and IsGrakeTank[GetUnitUserData(GetTriggerUnit())] then
if GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID2) != 1 then
call UnitAddAbility(GetTriggerUnit(),SPELL_ID2)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=4
//TESH.alwaysfold=0
scope UnitCleanup initializer OnInit
private struct UC
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local UC data= GetTimerData(t)
call RemoveUnit(data.u)
call ReleaseTimer(t)
call data.destroy()
set t=null
endfunction
private function OnSpell takes nothing returns boolean
local UC data
local timer t
local player p
set p = GetOwningPlayer(GetTriggerUnit())
if (p == Player(10) or p == Player(11)) then
set data= UC.create()
set data.u=GetTriggerUnit()
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,10.,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=4
//TESH.alwaysfold=0
globals
boolean array HasPlayerLeft
endglobals
scope FlagLeavers initializer OnInit
private struct LeaverFlag
integer i
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local LeaverFlag data = GetTimerData(t)
set HasPlayerLeft[data.i] = true
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function OnLeave takes nothing returns boolean
local timer t
local LeaverFlag data = LeaverFlag.create()
set data.i = GetPlayerId(GetTriggerPlayer())
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,300.,false,function Handler)
set t = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterPlayerEventLeave( trig, Player(0) )
call TriggerRegisterPlayerEventLeave( trig, Player(1) )
call TriggerRegisterPlayerEventLeave( trig, Player(2) )
call TriggerRegisterPlayerEventLeave( trig, Player(3) )
call TriggerRegisterPlayerEventLeave( trig, Player(4) )
call TriggerRegisterPlayerEventLeave( trig, Player(5) )
call TriggerRegisterPlayerEventLeave( trig, Player(6) )
call TriggerRegisterPlayerEventLeave( trig, Player(7) )
call TriggerRegisterPlayerEventLeave( trig, Player(8) )
call TriggerRegisterPlayerEventLeave( trig, Player(9) )
call TriggerRegisterPlayerEventLeave( trig, Player(10) )
call TriggerRegisterPlayerEventLeave( trig, Player(11) )
call TriggerAddCondition( trig, function OnLeave )
set trig = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
integer StartingIncomeVar=30
integer array Income
endglobals
scope StartingIncome initializer OnInit
private function Conditions takes nothing returns boolean
local integer i = S2I(SubString(GetEventPlayerChatString(),16,StringLength(GetEventPlayerChatString())))
local integer i2 = 0
if GAMEM and LWMON then
if i >=200 then
set i = 200
endif
if i <=5 then
set i = 5
endif
set StartingIncomeVar=i
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Starting income set to " + I2S(i) + ".")
loop
exitwhen i2 == 12
set Income[i2] = i
set i2 = i2 + 1
endloop
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-StartingIncome ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-StartingIncome ", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Lives initializer OnInit
private function Conditions takes nothing returns boolean
local integer i = S2I(SubString(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString())))
if GAMEM then
if i >=999 then
set i = 999
endif
if i <=1 then
set i = 1
endif
set StartingLives=i
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Starting lives set to " + I2S(i) + ".")
set SC=StartingLives
set TC=StartingLives
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-lives ", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DisplayWins initializer OnInit
private function Conditions takes nothing returns boolean
local integer i = S2I(SubString(GetEventPlayerChatString(),6,StringLength(GetEventPlayerChatString())))
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0.,0.,10.,GetPlayerName(Player(i-1))+" Wins: " + I2S(W_I_N_S[i-1]) + ".")
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-wins ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-wins ", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DisplayFrags initializer OnInit
private function Conditions takes nothing returns boolean
local integer i = S2I(SubString(GetEventPlayerChatString(),11,StringLength(GetEventPlayerChatString())))
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0.,0.,10.,GetPlayerName(Player(i-1))+" Corrupted Fragments: " + I2S(C_F_R_A_G_S[i-1]) + ".")
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-Fragments ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-Fragments ", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Displaylooses initializer OnInit
private function Conditions takes nothing returns boolean
local integer i = S2I(SubString(GetEventPlayerChatString(),8,StringLength(GetEventPlayerChatString())))
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0.,0.,10.,GetPlayerName(Player(i-1))+" Losses: " + I2S(LOOOSES[i-1]) + ".")
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(1), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(2), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(3), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(4), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(5), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(6), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(7), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(8), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(9), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(10), "-losses ", false )
call TriggerRegisterPlayerChatEvent( trig, Player(11), "-losses ", false )
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ProtectItems initializer OnInit
struct Prot
unit p
method destroy takes nothing returns nothing
set this.p = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Prot data = GetTimerData(t)
call IssueImmediateOrderById(data.p,851972)
call Q_E(GetOwningPlayer(data.p),"Unable to attack items.")
call ReleaseTimer(t)
call data.destroy()
set t= null
endfunction
private function Actions takes nothing returns nothing
local Prot data = Prot.create()
local timer t = NewTimer()
set data.p = GetTriggerUnit()
call SetTimerData(t,data)
call TimerStart(t,0.0,false,function Handler)
set t = null
endfunction
private function Conditions takes nothing returns boolean
if GetIssuedOrderId() == String2OrderIdBJ("attack") and GetOrderTargetItem() != null then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DisplayIndex initializer OnInit
private function Conditions takes nothing returns boolean
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,I2S(XO))
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-indexes", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
globals
unit FountainGuardWest
unit FountainGuardEast
endglobals
scope SpawnTheseFountains initializer OnInit
private function OnInit takes nothing returns nothing
set FountainGuardWest = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h01I',-6404.5,1178.7,0.)
set FountainGuardEast = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h01I',6393.0,1184.9,0.)
endfunction
endscope
scope FragDrops initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
//if StrikeBetaTest then
//call CreateItem('I04Z',GetUnitX(u),GetUnitY(u))
//else
if GetUnitTypeId(u)=='u002' and GetRandomInt(0,99) <= 19 and GetOwningPlayer(u) != Player(PLAYER_NEUTRAL_PASSIVE) then
call CreateItem('I04Z',GetUnitX(u),GetUnitY(u))
endif
//endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=100
//TESH.alwaysfold=0
scope HeroDummyInit initializer OnInit
private function OnInit takes nothing returns nothing
local unit u
local location center
//local effect fx
set FU=GetRectCenter(NW)
call CreateNUnitsAtLoc(1,'Nplh',Player(PLAYER_NEUTRAL_PASSIVE),FU,214.)
call RemoveLocation(FU)
//set FU=GetRectCenter(LW)
//call CreateNUnitsAtLoc(1,'Nplh',Player(PLAYER_NEUTRAL_PASSIVE),FU,214.)
//call RemoveLocation(FU)
//call CreateNUnitsAtLoc(1,'Nplh',Player(PLAYER_NEUTRAL_PASSIVE),FU,214.)
set center = GetRectCenter(ZW)
set FU=PolarProjectionBJ(center,250.,180.)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("war3mapImported\\Dathylos.mdx",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call UnitAddAbility(bj_lastCreatedUnit,'Amrf')
call UnitRemoveAbility(bj_lastCreatedUnit,'Amrf')
call SetUnitFlyHeight(bj_lastCreatedUnit,120.,0.)
call RemoveLocation(FU)
call RemoveLocation(center)
set FU=GetRectCenter(YU)
call CreateNUnitsAtLoc(1,'U00Z',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(FU)
set FU=GetRectCenter(ZU)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("units\\creeps\\SylvanusWindrunner\\SylvanusWindrunner.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.2,1.2,1.2)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(VW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("units\\nightelf\\HeroDemonHunter\\HeroDemonHunter.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(EW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("units\\nightelf\\Huntress\\Huntress.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.2,1.2,1.2)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(XW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("Units\\Creeps\\FirePandarenBrewmaster\\FirePandarenBrewmaster.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.1,1.1,1.1)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(OW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("Units\\Creeps\\EarthPandarenBrewmaster\\EarthPandarenBrewmaster.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.1,1.1,1.1)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(RW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("Units\\Creeps\\BansheeRanger\\BansheeRanger.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.4,1.4,1.4)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_AGGRESSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(IW)
call CreateNUnitsAtLoc(1,'U00N',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(FU)
set FU=GetRectCenter(AW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,270.)
call AddSpecialEffectTarget("war3mapImported\\Cosmos Eye.mdl",bj_lastCreatedUnit,"origin")
call SetUnitVertexColorBJ(bj_lastCreatedUnit, 100, 0.00, 100, 0 )
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(BW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("Units\\Naga\\NagaSiren\\NagaSiren.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.1,1.1,1.1)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(CW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("war3mapImported\\WitchDoctor.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.1,1.1,1.1)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(DW)
call CreateNUnitsAtLoc(1,'E019',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(FU)
set FU=GetRectCenter(FW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("units\\creeps\\LordGarithos\\LordGarithos.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.3,1.3,1.3)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(GW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("units\\naga\\HeroNagaSeawitch\\HeroNagaSeawitch.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,.9,.9,.9)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(HW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("war3mapImported\\Pilgrim.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.6,1.6,1.6)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(JW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("war3mapImported\\Retributer.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.05,1.05,1.05)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(KW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,180.)
call AddSpecialEffectTarget("Units\\Creeps\\HeroTinker\\HeroTinker.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(MW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("war3mapImported\\HeroSealedPython.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(PW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("units\\human\\BloodElfSpellThief\\BloodElfSpellThief.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,.9,.9,.9)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(QW)
call CreateNUnitsAtLoc(1,'E011',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(FU)
set FU=GetRectCenter(SW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("war3mapImported\\DruidoftheTalonV2.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.3,1.3,1.3)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(TW)
call CreateNUnitsAtLoc(1,'h01C',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
/*set fx = AddSpecialEffectTarget("war3mapImported\\Demon_BulwarkBastionCitadeledited.mdl",bj_lastCreatedUnit,"origin")
call BlzSetSpecialEffectScale( fx, .50 )
call BlzPlaySpecialEffect( fx, ANIM_TYPE_STAND )
call BlzSpecialEffectAddSubAnimation (fx,SUBANIM_TYPE_WORK)
call BlzSpecialEffectAddSubAnimation (fx,SUBANIM_TYPE_UPGRADE)
call BlzSpecialEffectAddSubAnimation (fx,SUBANIM_TYPE_SECOND)
call SetUnitScale(bj_lastCreatedUnit,1.2,1.2,1.2)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))*/
call RemoveLocation(FU)
set FU=GetRectCenter(UW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("units\\demon\\ChaosWarlock\\ChaosWarlock.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.2,1.2,1.2)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(WW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("units\\creeps\\assassin\\assassin.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.1,1.1,1.1)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(YW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("Units\\Creeps\\StormPandarenBrewmaster\\StormPandarenBrewmaster.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,.9,.9,.9)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(ZW)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("units\\undead\\HeroLich\\HeroLich.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(EY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\demon\\HeroChaosBladeMaster\\HeroChaosBladeMaster.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(XY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\creeps\\Owlbear\\Owlbear.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.05,1.05,1.05)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(OY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\human\\HeroPaladin\\HeroPaladin.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.3,1.3,1.3)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(RY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\orc\\Tauren\\Tauren.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(IY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\other\\Proudmoore\\Proudmoore.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.05,1.05,1.05)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(AY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\human\\HeroMountainKing\\HeroMountainKing.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.21,1.21,1.21)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(NY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("Units\\Creeps\\Beastmaster\\Beastmaster.mdl",bj_lastCreatedUnit,"origin")
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(BY)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call AddSpecialEffectTarget("units\\human\\TheCaptain\\TheCaptain.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.5,1.5,1.5)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
set FU=GetRectCenter(CY)
call CreateNUnitsAtLoc(1,'E01H',Player(PLAYER_NEUTRAL_PASSIVE),FU,.0)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(FU)
set center = GetRectCenter(MW)
set FU=PolarProjectionBJ(center,250.,0.)
call CreateNUnitsAtLoc(1,'h010',Player(PLAYER_NEUTRAL_PASSIVE),FU,90.)
call AddSpecialEffectTarget("war3mapImported\\RazorArm-Automaton.mdl",bj_lastCreatedUnit,"origin")
call SetUnitScale(bj_lastCreatedUnit,1.8,1.8,1.8)
call SetUnitVertexColor(bj_lastCreatedUnit,190,190,190,255)
call SetUnitColor(bj_lastCreatedUnit,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
call RemoveLocation(FU)
call RemoveLocation(center)
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',-1396.,-3900.,0.)
call AddSpecialEffectTarget("war3mapImported\\IronQueen81x.mdl",u,"origin")
call SetUnitScale(u,1.3,1.3,1.3)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',3.8,-6200.3,90.)
call AddSpecialEffectTarget("war3mapImported\\HeroFlameLord.mdx",u,"origin")
call SetUnitScale(u,1.3,1.3,1.3)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',-1150.,-5125.,0.)
call AddSpecialEffectTarget("war3mapImported\\Mars.mdx",u,"origin")
call SetUnitScale(u,1.15,1.15,1.15)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',3.8,-3960.,270.)
call AddSpecialEffectTarget("war3mapImported\\LordofDarkness.MDX",u,"origin")
call SetUnitScale(u,1.2,1.2,1.2)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',660.4,-3960.,270.)
call AddSpecialEffectTarget("war3mapImported\\heraldofnzoth.mdl",u,"origin")
call SetUnitScale(u,1.,1.,1.)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h010',1406.854,-6153.044,180.)
call AddSpecialEffectTarget("war3mapImported\\Maxira.mdl",u,"origin")
call SetUnitScale(u,1.2,1.2,1.3)
call SetUnitColor(u,GetPlayerColor(Player(PLAYER_NEUTRAL_PASSIVE)))
set bj_wantDestroyGroup=true
call ForGroupBJ(CPE(PU),function MUO)
set u = null
set center = null
//set fx = null
endfunction
endscope
//TESH.scrollpos=3
//TESH.alwaysfold=0
scope NoMansLand initializer OnInit
globals
rect NO_MANS_LAND
rect NO_MANS_LAND2
rect NO_MANS_LAND3
rect NO_MANS_LAND4
rect NO_MANS_LAND5
endglobals
private struct Noman
unit u
effect e
method destroy takes nothing returns nothing
set this.u = null
set this.e = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local Noman data = GetTimerData(t)
local texttag tt
local location loc
if Rects_IsUnitInRect(data.u,NO_MANS_LAND) or Rects_IsUnitInRect(data.u,NO_MANS_LAND2) or Rects_IsUnitInRect(data.u,NO_MANS_LAND3) or Rects_IsUnitInRect(data.u,NO_MANS_LAND4) or Rects_IsUnitInRect(data.u,NO_MANS_LAND5) then
call DestroyEffect(data.e)
set loc = GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(data.u)))])
call SetUnitPositionLoc(data.u,loc)
call RemoveLocation(loc)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ChaosExplosion.mdx",data.u,"chest"))
call KillUnit(data.u)
call DisplayTextToPlayer(GetOwningPlayer(data.u),0.,0.,"|cFF8A0209Y U NO LISTEN???|r")
else
call DisplayTextToPlayer(GetOwningPlayer(data.u),0.,0.,"|cFFC00141Y|r|cFFB80A48o|r|cFFB0134Eu|r|cFFA81C54 |r|cFFA0245Bh|r|cFF982D62a|r|cFF903668v|r|cFF883F6Ee|r|cFF804875 |r|cFF78507Ce|r|cFF705982s|r|cFF686288c|r|cFF606B8Fa|r|cFF587496p|r|cFF507D9Ce|r|cFF4886A2d|r|cFF408EA9 |r|cFF3897B0d|r|cFF30A0B6e|r|cFF28A9BCa|r|cFF20B2C3t|r|cFF18BACAh|r|cFF10C3D0.|r|cFF08CCD6.|r|cFF00D5DD.|r")
call DestroyEffect(data.e)
set tt=CreateTextTag()
call SetTextTagText(tt,"fail",.024)
call SetTextTagPos(tt,GetUnitX(data.u),GetUnitY(data.u),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
call ReleaseTimer(t)
call data.destroy()
set loc = null
set t = null
set tt = null
endfunction
private function Conditions takes nothing returns boolean
local Noman data
local timer t
if GetOwningPlayer(GetEnteringUnit()) != Player(15) and not LWMON and GetUnitAbilityLevel(GetEnteringUnit(),'Aloc') != 1 and GetUnitAbilityLevel(GetEnteringUnit(),'A07S') != 1 and GetUnitTypeId(GetEnteringUnit()) != 'H013' and GetUnitTypeId(GetEnteringUnit()) != 'H014' and GetUnitTypeId(GetEnteringUnit()) != 'H015' and GetUnitTypeId(GetEnteringUnit()) != 'H016' and GetUnitTypeId(GetEnteringUnit()) != 'n00E' and GetUnitTypeId(GetEnteringUnit()) != 'h000' and GetUnitTypeId(GetEnteringUnit()) != 'ushd' and GetUnitTypeId(GetEnteringUnit()) != 'h007' and BlzIsUnitInvulnerable(GetEnteringUnit()) == false and not M5E(GetEnteringUnit()) and (GetPlayerController(GetOwningPlayer(GetEnteringUnit())) == MAP_CONTROL_USER) then
set t = NewTimer()
set data = Noman.create()
set data.u = GetEnteringUnit()
set data.e = AddSpecialEffectTarget("war3mapImported\\Death Spell.mdx",data.u,"origin")
call DisplayTextToPlayer(GetOwningPlayer(data.u),0.,0.,"|cFF8A0209D|r|cFF8C020Be|r|cFF8E020Da|r|cFF90020Ft|r|cFF910211h|r|cFF930213 |r|cFF950215h|r|cFF970217a|r|cFF990218s|r|cFF9B021A |r|cFF9D021Cm|r|cFF9E021Ea|r|cFFA00220r|r|cFFA20222k|r|cFFA40224e|r|cFFA60126d|r|cFFA80128 |r|cFFAA012Ay|r|cFFAC012Co|r|cFFAD012Eu|r|cFFAF0130.|r|cFFB10132.|r|cFFB30133.|r|cFFB50135 |r|cFFB70137y|r|cFFB90139o|r|cFFBA013Bu|r|cFFBC013D |r|cFFBE013Fh|r|cFFC00141a|r|cFFBE013Fv|r|cFFBC013De|r|cFFBA013B |r|cFFB90139f|r|cFFB70137i|r|cFFB50135v|r|cFFB30133e|r|cFFB10132 |r|cFFAF0130s|r|cFFAD012Ee|r|cFFAC012Cc|r|cFFAA012Ao|r|cFFA80128n|r|cFFA60126d|r|cFFA40224s|r|cFFA20222 |r|cFFA00220t|r|cFF9E021Eo|r|cFF9D021C |r|cFF9B021At|r|cFF990218u|r|cFF970217r|r|cFF950215n|r|cFF930213 |r|cFF910211b|r|cFF90020Fa|r|cFF8E020Dc|r|cFF8C020Bk|r|cFF8A0209.|r")
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
set NO_MANS_LAND = Rect(-3330.,-8192.,3200.,8192.)
set NO_MANS_LAND2 = Rect(-7601.2,2134.2,-5334.9,8062.3)
set NO_MANS_LAND3 = Rect(5187.3,2134.5,7430.6,8062.5)
set NO_MANS_LAND4 = Rect(-6560.,1015.,-6225.,1300.)
set NO_MANS_LAND5 = Rect(6222.,1015.,6575.,1300.)
call TriggerRegisterEnterRectSimple( trig, NO_MANS_LAND )
call TriggerRegisterEnterRectSimple( trig, NO_MANS_LAND2 )
call TriggerRegisterEnterRectSimple( trig, NO_MANS_LAND3 )
call TriggerRegisterEnterRectSimple( trig, NO_MANS_LAND4 )
call TriggerRegisterEnterRectSimple( trig, NO_MANS_LAND5 )
call TriggerAddCondition(trig, Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Income requires TimerUtils
globals
timerdialog IncomeDialog
endglobals
function IncomeHandler takes nothing returns nothing
local timer IncomeHandler_t = GetExpiredTimer()
local integer i = 0
call DestroyTimerDialog(IncomeDialog)
if HD then
call ReleaseTimer(IncomeHandler_t)
else
set IncomeDialog = CreateTimerDialog(IncomeHandler_t)
loop
exitwhen i == 12
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i)) != MAP_CONTROL_COMPUTER then
if GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD) + Income[i] >= 1000000 then
call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,1000000)
call DisplayTextToPlayer(Player(i),0.,0.,"Warning: You have maximal gold. Spend it or convert it to lumber to prevent loss of resources.")
else
call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD) + Income[i]))
endif
if TIPST[i] then
call DisplayTextToPlayer(Player(i),0.,0.,"Income: "+I2S(Income[i]))
endif
endif
set i = i + 1
endloop
call TimerDialogSetTitle(IncomeDialog, "Income:")
call TimerDialogDisplay(IncomeDialog, true)
call TimerStart(IncomeHandler_t,10.,false,function IncomeHandler)
endif
endfunction
function IncomeTrigger takes nothing returns nothing
local timer IncomeHandler_t = NewTimer()
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc0020 seconds till game starts.|r")
call TriggerSleepAction(20.)
set IncomeDialog = CreateTimerDialog(IncomeHandler_t)
call TimerDialogSetTitle(IncomeDialog, "Income:")
call TimerDialogDisplay(IncomeDialog, true)
call TimerStart(IncomeHandler_t,10.,false,function IncomeHandler)
set IncomeHandler_t = null
endfunction
endlibrary
scope CFragmentss initializer OnInit
private function Conditions takes nothing returns boolean
local integer i
local player p
local string s = null
local Savecode savecode
if GetItemTypeId(GetManipulatedItem()) == 'I04Z' then
set p = GetOwningPlayer(GetTriggerUnit())
if GetPlayerId(p) <=4 then
set i = 0
loop
exitwhen i >4
set p = Player(i)
set C_F_R_A_G_S[i] = C_F_R_A_G_S[i] + 1
call DisplayTimedTextToPlayer(p,0.,0.,10.,"You have gained a Corrupted Fragment. Corrupted Fragments are account-bound and persist between multiple games.")
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[i] ,1000000 )
call savecode.Encode(W_I_N_S[i],1000000)
call savecode.Encode(LOOOSES[i],1000000)
set s = savecode.Save(p,1)
call savecode.destroy()
if (GetLocalPlayer() == p) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(p)+".pld",GetPlayerName(p)+": "+s)
endif
set i = i + 1
endloop
else
set i = 5
loop
exitwhen i >9
set p = Player(i)
set C_F_R_A_G_S[i] = C_F_R_A_G_S[i] + 1
call DisplayTimedTextToPlayer(p,0.,0.,10.,"You have gained a Corrupted Fragment. Corrupted Fragments are account-bound and persist between multiple games.")
set savecode = Savecode.create()
call savecode.Encode(C_F_R_A_G_S[i] ,1000000 )
call savecode.Encode(W_I_N_S[i],1000000)
call savecode.Encode(LOOOSES[i],1000000)
set s = savecode.Save(p,1)
call savecode.destroy()
if (GetLocalPlayer() == p) then
call FileIO_Write("Enfos FFB\\"+GetPlayerName(p)+".pld",GetPlayerName(p)+": "+s)
endif
set i = i + 1
endloop
endif
endif
set p =null
set s = null
return false
endfunction
function Trig_Fragars_Actions takes nothing returns nothing
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
scope CrystalFragmentss initializer OnInit
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == 'I05H' then
call UnitAddItemById(GetTriggerUnit(),'I046')
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=84
//TESH.alwaysfold=0
globals
boolean array AutopoolOn
boolean array AutopoolOn2
endglobals
scope Autopool initializer OnInit
private struct AP
player pooler
player poolee
method destroy takes nothing returns nothing
set this.pooler = null
set this.poolee = null
call this.deallocate()
endmethod
endstruct
private function disableAutopool takes nothing returns nothing
if AutopoolOn[GetPlayerId(GetTriggerPlayer())] then
set AutopoolOn[GetPlayerId(GetTriggerPlayer())] = false
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Turning off autopool...")
endif
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AP data = GetTimerData(t)
local integer gold
local integer wood
local integer gold2
local integer wood2
if GetPlayerSlotState(data.poolee) != PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(data.pooler) != PLAYER_SLOT_STATE_PLAYING or not AutopoolOn[GetPlayerId(data.pooler)] then
set AutopoolOn2[GetPlayerId(data.pooler)] = false
call DisplayTextToPlayer(data.pooler,0.,0.,"Autosend disabled.")
call data.destroy()
call ReleaseTimer(t)
else
set gold = GetPlayerState(data.pooler, PLAYER_STATE_RESOURCE_GOLD)
set wood = GetPlayerState(data.pooler, PLAYER_STATE_RESOURCE_LUMBER)
call SetPlayerState(data.pooler,PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(data.pooler,PLAYER_STATE_RESOURCE_LUMBER,0)
set gold2 = GetPlayerState(data.poolee, PLAYER_STATE_RESOURCE_GOLD)
set wood2 = GetPlayerState(data.poolee, PLAYER_STATE_RESOURCE_LUMBER)
if gold + gold2 >= 10000000 then
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_GOLD,10000000)
call DisplayTextToPlayer(data.pooler,0.,0.,"Warning: Autopool player has maximum gold. Stop pooling to prevent loss of resources. To turn off autosend, type -autopool/autosend off.")
call DisplayTextToPlayer(data.poolee,0.,0.,"Warning: You have maximum gold. Either spend it or convert it to prevent loss of resources.")
else
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_GOLD,gold + gold2)
endif
call SetPlayerState(data.poolee,PLAYER_STATE_RESOURCE_LUMBER,wood + wood2)
call SetTimerData(t,data)
call TimerStart(t,10.,false,function Handler)
endif
set t = null
endfunction
private function setAutopool takes player pooler, player poolee returns nothing
local timer t
local AP data
set t = NewTimer()
set data = AP.create()
set data.pooler = pooler
set data.poolee = poolee
set AutopoolOn[GetPlayerId(data.pooler)] = true
set AutopoolOn2[GetPlayerId(data.pooler)] = true
call DisplayTextToPlayer(pooler,0.,0.,"Autosending to " + GetPlayerName(poolee) + ".")
call DisplayTextToPlayer(poolee,0.,0.,"Automatically receiving gold from " + GetPlayerName(pooler)+".")
call SetTimerData(t,data)
call TimerStart(t,10.,false, function Handler)
set t = null
endfunction
private function Conditions takes nothing returns boolean
local string payload = (SubString(GetEventPlayerChatString(),10,StringLength(GetEventPlayerChatString())))
local integer PlayerString
local timer t
local AP data
if payload == "off" then
call disableAutopool()
set t = null
set payload = null
return false
endif
set PlayerString = S2I(payload) - 1
if PlayerString < 12 and PlayerString >= 0 then
if not AutopoolOn[GetPlayerId(GetTriggerPlayer())] and GetPlayerSlotState(Player(PlayerString)) == PLAYER_SLOT_STATE_PLAYING and IsPlayerAlly(GetTriggerPlayer(),Player(PlayerString)) and not AutopoolOn2[GetPlayerId(GetTriggerPlayer())] and GetTriggerPlayer() != Player(PlayerString) and PlayerString != GetPlayerId(GetTriggerPlayer()) and GetPlayerController(Player(PlayerString)) != MAP_CONTROL_COMPUTER then
call setAutopool(GetTriggerPlayer(), Player(PlayerString))
else
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Error: Invalid input or you are already autosending someone. To turn off autosend, type -autopool/-autosend off.")
endif
else
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Error: Invalid input.")
endif
set payload = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer pid = 0
loop
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-autosend", false )
call TriggerRegisterPlayerChatEvent( trig, Player(pid), "-autopool", false )
set AutopoolOn[pid] = false
set AutopoolOn2[pid] = false
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( trig, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AetherConstructSelect initializer OnInit
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(AETHERONHIT)
call EnableTrigger(AETHERSTACKS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U000',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
call UnitAddAbility(GetTriggerUnit(),'A0ER')
call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[40])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[40])
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,XQV)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FirelordSelect initializer OnInit
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if WT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(FIRELORDBURN)
call EnableTrigger(PUDDLEBURNING)
call EnableTrigger(LEARNBMARK)
call EnableTrigger(FLAMELASER)
call EnableTrigger(FERVORSTACKS)
call EnableTrigger(MOLTENWAVE)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'N01O',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
//call UnitAddAbility(GetTriggerUnit(),'A0ER')
//call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[46])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[46])
endif
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick an |cFFFF0000Advanced|r difficulty hero. If you still wish to pick this hero, enable promote mode by typing: -promote, followed by your player number.")
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,FIRELORDCIRCLE)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TritusSelect initializer OnInit
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(DOUBLESTRIKE)
call EnableTrigger(WARGODBLEED)
call EnableTrigger(SEARINGSHIELD)
call EnableTrigger(MREVEL)
call EnableTrigger(BARBSTACKS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E01Z',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
//call UnitAddAbility(GetTriggerUnit(),'A0ER')
//call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[56])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[56])
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,TRITUSCIRCLE)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope MolochSelect initializer OnInit
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(ELDRITCHT)
call EnableTrigger(DEMONLIGHTNING)
call EnableTrigger(CHAOSBOUNTY)
call EnableTrigger(DIABLERIESTACKS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E020',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
//call UnitAddAbility(GetTriggerUnit(),'A0ER')
//call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[57])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[57])
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,MOLOCHCIRCLE)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope VeraSelect initializer OnInit
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(NFEROCITY)
call EnableTrigger(NREDRESS)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'U007',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
//call UnitAddAbility(GetTriggerUnit(),'A0ER')
//call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[58])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[58])
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,VERACIRCLE)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope NyxvirSelect initializer OnInit
globals
boolean StrikeBetaTest = false
endglobals
private function Conditions takes nothing returns boolean
local location HeroCreateLocation
if C_F_R_A_G_S[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] >= 20 or bj_isSinglePlayer or StrikeBetaTest then
if (GetUnitTypeId(GetTriggerUnit())=='ushd') then
call EnableTrigger(CCDMG)
call EnableTrigger(CSDMG)
call EnableTrigger(CCEXPLOSION)
set HeroCreateLocation=GetRectCenter(GD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
call CreateNUnitsAtLoc(1,'E024',GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,270.)
if OD[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))] then
call UnitAddItemByIdSwapped('I01I',bj_lastCreatedUnit)
endif
set LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedUnit
set MQ[(1+GetPlayerId(GetTriggerPlayer()))]=bj_lastCreatedUnit
//call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,UD[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))])
call AddSpecialEffectLocBJ(HeroCreateLocation,"Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl")
call DestroyEffect(bj_lastCreatedEffect)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),HeroCreateLocation,.3)
//call AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()),"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
//call DestroyEffect(bj_lastCreatedEffect)
//call UnitAddAbility(GetTriggerUnit(),'A0ER')
//call UnitRemoveAbility(GetTriggerUnit(),'A0ER')
call RemoveUnit(GetTriggerUnit())
call MultiboardSetItemStyleBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),true,true)
call MultiboardSetItemIconBJ(AS[1],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[59])
call MultiboardSetItemStyleBJ(AS[2],1,(YS+(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+3)),true,true)
call MultiboardSetItemIconBJ(AS[2],1,(WS[(1+GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit)))]+2),SQ[59])
endif
else
call DisplayTextToForce(CZE(GetOwningPlayer(GetTriggerUnit())),"You are trying to pick a |cFFFF0000Super Advanced|r difficulty hero. This hero requires 20 Corrupted Fragments to be played in multiplayer. You have "+I2S(C_F_R_A_G_S[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])+" Corrupted Fragments. To view your Corrupted Fragments, type -Fragments # where # is your Player Number.")
endif
set HeroCreateLocation = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,80.,NYXVIRCIRCLE)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SummonCourier initializer OnInit
globals
unit array Courier
endglobals
private function OnSpell takes nothing returns boolean
local unit u
local integer i
local real a
local real x
local real y
if GetSpellAbilityId() == 'A0FZ' then
set u = GetTriggerUnit()
set i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
set a = GetUnitFacing(u)
set x = GetUnitX(u) + 200. *Cos(a*bj_DEGTORAD)
set y = GetUnitY(u) + 200. *Sin(a*bj_DEGTORAD)
if Courier[i] != null or UnitAlive(Courier[i]) then
call UnitRemoveItemFromSlot(Courier[i],0)
call UnitRemoveItemFromSlot(Courier[i],1)
call KillUnit(Courier[i])
endif
set Courier[i] = null
if GetPlayerName(Player(i)) == "Strikest#1504" or GetPlayerName(Player(i)) == "KindInMind#2657" or GetPlayerName(Player(i)) == "Mike#22559" or GetPlayerName(Player(i)) == "MokT#1639" or GetPlayerName(Player(i)) == "Fabs#1762" or GetPlayerName(Player(i)) == "dkang#1347" or GetPlayerName(Player(i)) == "Vision#2578" or GetPlayerName(Player(i)) == "SpeedMachine#11873" or GetPlayerName(Player(i)) == "Fun#11323" or GetPlayerName(Player(i)) == "useless#1203" or GetPlayerName(Player(i)) == "Quan#12708" or GetPlayerName(Player(i)) == "vicemob#1569" or GetPlayerName(Player(i)) == "DrunkPenguin#21498" or GetPlayerName(Player(i)) == "Rat#21173" or GetPlayerName(Player(i)) == "Fumandra#2247" or GetPlayerName(Player(i)) == "Loona#1398" or GetPlayerName(Player(i)) == "DrunkCat#1765" or GetPlayerName(Player(i)) == "Issei#2618" then
if GetPlayerName(Player(i)) == "Strikest#1504" then
if GetUnitTypeId(LC[1+GetPlayerId(Player(i))]) == 'E020' then
set Courier[i] = CreateUnit(Player(i),'e021',x,y,GetUnitFacing(u))
else
if GetRandomInt(0,100) >= 50 then
set Courier[i] = CreateUnit(Player(i),'e01W',x,y,GetUnitFacing(u))
else
set Courier[i] = CreateUnit(Player(i),'e00M',x,y,GetUnitFacing(u))
endif
endif
endif
if GetPlayerName(Player(i)) == "Fabs#1762" then
set Courier[i] = CreateUnit(Player(i),'e00H',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "DrunkCat#1765" then
set Courier[i] = CreateUnit(Player(i),'e01V',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "Fumandra#2247" then
set Courier[i] = CreateUnit(Player(i),'e01N',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "DrunkPenguin#21498" then
set Courier[i] = CreateUnit(Player(i),'e00W',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "Loona#1398" then
set Courier[i] = CreateUnit(Player(i),'e01T',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "KindInMind#2657" then
set Courier[i] = CreateUnit(Player(i),'e00S',x,y,GetUnitFacing(u))
call SetUnitVertexColor(Courier[i],100,150,255,128)
endif
if GetPlayerName(Player(i)) == "Rat#21173" then
set Courier[i] = CreateUnit(Player(i),'e010',x,y,GetUnitFacing(u))
call SetUnitVertexColor(Courier[i],100,150,255,128)
endif
if GetPlayerName(Player(i)) == "Mike#22559" then
set Courier[i] = CreateUnit(Player(i),'e00I',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "Quan#12708" then
set Courier[i] = CreateUnit(Player(i),'e00V',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "vicemob#1569" then
set Courier[i] = CreateUnit(Player(i),'e00T',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "MokT#1639" then
set Courier[i] = CreateUnit(Player(i),'e00F',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "dkang#1347" then
set Courier[i] = CreateUnit(Player(i),'e00J',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "Fun#11323" then
set Courier[i] = CreateUnit(Player(i),'e00N',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "Issei#2618" then
set Courier[i] = CreateUnit(Player(i),'e025',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "SpeedMachine#11873" then
if GetRandomInt(0,100) >= 50 then
set Courier[i] = CreateUnit(Player(i),'e00L',x,y,GetUnitFacing(u))
else
set Courier[i] = CreateUnit(Player(i),'e00O',x,y,GetUnitFacing(u))
endif
endif
if GetPlayerName(Player(i)) == "Vision#2578" then
set Courier[i] = CreateUnit(Player(i),'e00K',x,y,GetUnitFacing(u))
endif
if GetPlayerName(Player(i)) == "useless#1203" then
set Courier[i] = CreateUnit(Player(i),'e00P',x,y,GetUnitFacing(u))
endif
else
set Courier[i] = CreateUnit(Player(i),'e00A',x,y,GetUnitFacing(u))
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earthshock.mdl",Courier[i],"chest"))
endif
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope VK initializer OnInit
globals
constant integer VOTES_NEEDED_TO_KICK=3
dialog array votekick_dialog
button array votekick_buttons
integer array votekick_votes
trigger votekick_buttonclick=null
trigger votekick_votekick=null
endglobals
function init_votekick takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
set votekick_dialog[i]=DialogCreate()
call TriggerRegisterPlayerChatEvent(votekick_votekick,Player(i),"-votekick",true)
call TriggerRegisterDialogEvent(votekick_buttonclick,votekick_dialog[i])
set i=i+1
endloop
endfunction
function VotekickClick takes nothing returns nothing
local player p=GetTriggerPlayer()
local integer id=GetPlayerId(p)
local integer istart=id*12+100
local button b=GetClickedButton()
local integer j=0
local player q
loop
exitwhen j>11
if votekick_buttons[istart+j]==b then
set q=Player(j)
if votekick_votes[istart+j]==1 then
set votekick_votes[istart+j]=0
set votekick_votes[j]=votekick_votes[j]-1
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,8.,"A kick vote has been withdrawn for "+GetPlayerName(q))
else
set votekick_votes[j]=votekick_votes[j]+1
set votekick_votes[istart+j]=1
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,8.,"Type -votekick to open vote menu, A kick vote has been issued for "+GetPlayerName(q))
if votekick_votes[j] >= VOTES_NEEDED_TO_KICK then
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,8.,GetPlayerName(q)+" has been kicked by vote")
call RemovePlayer(q,PLAYER_GAME_RESULT_DEFEAT)
set ND=0
call ForForce(C3E(q),function WSO)
call ForForce(C3E(q),function WUO)
set QD[1]=false
set QD[2]=false
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[1]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if((GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING))then
set QD[2]=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call PlaySoundBJ(JY)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,(GetPlayerName(q)+" has been kicked!"))
call DisplayTimedTextToForce(C3E(q),30,("Your share of gold: "+I2S((GetPlayerState(q,PLAYER_STATE_RESOURCE_GOLD)/ND))))
call DisplayTimedTextToForce(C3E(q),30,("Your share of lumber: "+I2S((GetPlayerState(q,PLAYER_STATE_RESOURCE_LUMBER)/ND))))
call DisplayTimedTextToForce(C3E(q),30,("Your share of experience: "+I2S((GetHeroXP(LC[(1+GetPlayerId(q))])/ND))))
call MultiboardSetItemColorBJ(bj_lastCreatedMultiboard,0,QS[(1+GetPlayerId(q))],20.,20.,20,0)
call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,1,QS[(1+GetPlayerId(q))],true,false)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call UnitRemoveItemFromSlotSwapped(bj_forLoopAIndex,LC[(1+GetPlayerId(q))])
call UnitRemoveItemFromSlotSwapped(bj_forLoopAIndex,Courier[(GetPlayerId(q))])
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveUnit(LC[(1+GetPlayerId(q))])
call ForGroupBJ(CUE(q,Condition(function WWO)),function WYO)
if q==GetLocalPlayer()then
call EndGame(false)
endif
endif
endif
endif
set j=j+1
endloop
set q=null
set b=null
set p=null
endfunction
function VotekickShow takes nothing returns nothing
local player p=GetTriggerPlayer()
local integer id=GetPlayerId(p)
local integer istart=id*12+100
local integer j=0
local player q
call DialogClear(votekick_dialog[id])
call DialogSetMessage(votekick_dialog[id],"|cffffcc00Votekick who?")
loop
exitwhen j>11
set votekick_buttons[istart+j]=null
set q=Player(j)
if GetPlayerSlotState(q)==PLAYER_SLOT_STATE_PLAYING and GetPlayerController(q)==MAP_CONTROL_USER and q!=p then
if votekick_votes[istart+j]!=1then
set votekick_buttons[istart+j]=DialogAddButton(votekick_dialog[id],GetPlayerName(q)+" |r[|cffffcc00Vote|r]",0)
else
set votekick_buttons[istart+j]=DialogAddButton(votekick_dialog[id],GetPlayerName(q)+" |r[|cffffcc00Cancel Vote|r]",0)
endif
endif
set j=j+1
endloop
set votekick_buttons[id]=DialogAddButton(votekick_dialog[id],"Cancel |r[|cffff0000ESC|r]",512)
call DialogDisplay(p,votekick_dialog[id],true)
set p=null
set q=null
endfunction
private function OnInit takes nothing returns nothing
set votekick_votekick=CreateTrigger()
set votekick_buttonclick=CreateTrigger()
call TriggerAddAction(votekick_votekick,function VotekickShow)
call TriggerAddAction(votekick_buttonclick,function VotekickClick)
call ExecuteFunc("init_votekick")
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope UnitCleanup initializer OnInit
private function Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
if IsUnitInGroup(u,PATHING_GROUP) then
call GroupRemoveUnit(PATHING_GROUP,u)
endif
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition(t, function Actions )
set t = null
endfunction
endscope
globals
integer array CorruptAmount
//integer array CorruptionRaised
endglobals
scope Corruption initializer OnInit
globals
private constant integer SPELL_ID = 'A0PY'
private timer TIME
endglobals
private function Actions takes nothing returns nothing
local player p
local integer id=0
local integer o
local real ar
local real x
local real y
local real a
local unit u
local integer i = 0
local item it
loop
exitwhen id>9
set p = Player(id)
if UnitAlive(LC[id+1])then
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id+1],i)
if GetItemType(it) == ITEM_TYPE_ARTIFACT then
set CorruptAmount[id]=CorruptAmount[id]+GetItemLevel(it)
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
endif
set i = i + 1
endloop
if GetUnitAbilityLevel(LC[id+1],'B05P') == 1 then
set CorruptAmount[id]=CorruptAmount[id]+10
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
endif
if CorruptAmount[id] >=100 and not BlzIsUnitInvulnerable(LC[id+1]) and GetUnitAbilityLevel(LC[id+1],'A0N9') != 1 and GetUnitAbilityLevel(LC[id+1],SPELL_ID) != 1 then
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
set x = GetUnitX(LC[id+1])
set y = GetUnitY(LC[id+1])
set a = GetUnitFacing(LC[id+1])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special-2.mdx",LC[id+1],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CorpseExplodeFire.mdx",LC[id+1],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CorpseExplodeFire.mdx",LC[id+1],"head"))
set ar = BlzGetUnitArmor(LC[id+1])
call KillUnit(LC[id+1])
call DestroyEffect(AddSpecialEffect("BigBloodEX-NoSplat-NoGutz.mdx",x,y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Explosion.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Requiem.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Blast.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\OrbofCorruption.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Discharge Purple.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Call of Dread Purple.mdx",x,y))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[1+id]+(GetPlayerName(p)+"|r"))+(" |c00BD00EEh|r|c00B800D6a|r|c00B400BEs|r|c00AF01A7 |r|c00AB018Fl|r|c00A60177e|r|c00A2015Ft|r|c009D0147 |r|c00990230T|r|c00940218h|r|c00900200e|r|c0093021B |r|c00960137C|r|c009A0152o|r|c009D016Dr|r|c00A00089r|r|c00A300A4u|r|c00A100A3p|r|c009E00A2t|r|c009C00A2o|r|c009A00A1r|r|c009700A0 |r|c0095009Fo|r|c0093009Ev|r|c0091009Ee|r|c008E009Dr|r|c008C009Ct|r|c008A009Ba|r|c0087009Ak|r|c0085009Ae|r|c00830099 |r|c00800098h|r|c007E0097i|r|c007C0096m|r|c007A0096.|r|c00770095.|r|c00750094.|r")))
set u = CreateUnit(Player(o),'u002',x,y,a)
call BlzSetUnitMaxHP(u,(BlzGetUnitMaxHP(LC[id+1])*5)+(BlzGetUnitMaxMana(LC[id+1])*5))
call SetWidgetLife(u,(BlzGetUnitMaxHP(LC[id+1])*5)+(BlzGetUnitMaxMana(LC[id+1])*5))
call BlzSetUnitArmor(u,ar)
call BlzSetUnitBaseDamage(u,(BlzGetUnitMaxHP(LC[id+1])/5)+(BlzGetUnitMaxMana(LC[id+1])/5),0)
set CorruptAmount[id] = 0
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,0)
endif
endif
set i = 0
set id = id +1
endloop
set it = null
set u = null
set p = null
endfunction
private function OnInit takes nothing returns nothing
set TIME= NewTimer()
call TimerStart(TIME,5.,true,function Actions)
endfunction
endscope
scope GlobalGoldBuff initializer OnInit
globals
integer array ScreamStacks
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEnteringUnit()
local integer i
local integer id = GetUnitUserData(u)
local integer pid
if RANDOMWAVEON then
if GetPlayerController(GetOwningPlayer(u)) != MAP_CONTROL_USER and GetUnitTypeId(u) != 'h00B' and GetUnitAbilityLevel(u,'A0S9') == 0 and GetUnitTypeId(u) != 'n013' and GetUnitTypeId(u) != 'u006' and GetUnitTypeId(u) != 'u002' then
if PC>=39 then
set RANDOMDAMAGE[40] = 24998
set RANDOMHEALTH[40] = 700000
set RANDOMARMOR[40] = 150.
set RANDOMMOVESPEED[40] = 270.
set RANDOMATTACKINTERVAL[40] = 1.00
set RANDOMLEVEL[40] = 20
set RANDOMBOUNTY[40] = 19998
set COMMANDERRANDOMDAMAGE[40] = 34999
set COMMANDERRANDOMHEALTH[40] = 1350000
set COMMANDERRANDOMARMOR[40] = 200.
set COMMANDERRANDOMMOVESPEED[40] = 270.
set COMMANDERRANDOMATTACKINTERVAL[40] = .700
set COMMANDERRANDOMLEVEL[40] = 80
set COMMANDERRANDOMBOUNTY[40] = 39999
endif
if GetUnitAbilityLevel(u,'A0S8') == 1 then
//COMMANDERS
call BlzSetUnitBaseDamage(u,COMMANDERRANDOMDAMAGE[PC],0)
call BlzSetUnitAttackCooldown(u,COMMANDERRANDOMATTACKINTERVAL[PC],0)
call BlzSetUnitBaseDamage(u,COMMANDERRANDOMDAMAGE[PC],1)
call BlzSetUnitAttackCooldown(u,COMMANDERRANDOMATTACKINTERVAL[PC],1)
call BlzSetUnitMaxHP(u,COMMANDERRANDOMHEALTH[PC])
call BlzSetUnitArmor(u,COMMANDERRANDOMARMOR[PC])
call SetUnitMoveSpeed(u,COMMANDERRANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,COMMANDERRANDOMLEVEL[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,COMMANDERRANDOMBOUNTY[PC])
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitRealField( GetTriggerUnit(), UNIT_RF_HIT_POINTS_REGENERATION_RATE, PC *10)
if GetUnitTypeId(u) =='n01V' then
call SetUnitAbilityLevel(u,'A01T',XT)
endif
if GetUnitTypeId(u) =='u00Q' then
call SetUnitAbilityLevel(u,'Aspo',XT)
endif
if GetUnitTypeId(u) =='u00S' then
call SetUnitAbilityLevel(u,'ACvp',XT)
endif
if GetUnitTypeId(u) =='e00X' then
call SetUnitAbilityLevel(u,'ACat',XT)
call SetUnitAbilityLevel(u,'SCae',XT)
endif
if GetUnitTypeId(u) =='n03T' then
call SetUnitAbilityLevel(u,'AIsr',XT)
call SetUnitAbilityLevel(u,'SCae',XT)
call SetUnitAbilityLevel(u,'ACac',XT)
endif
if GetUnitTypeId(u) =='u00X' then
call SetUnitAbilityLevel(u,'A037',XT)
call SetUnitAbilityLevel(u,'AIsr',XT)
endif
if GetUnitTypeId(u) =='n038' then
call SetUnitAbilityLevel(u,'Ansk',XT)
call SetUnitAbilityLevel(u,'A037',XT)
endif
if GetUnitTypeId(u) =='n031' then
call SetUnitAbilityLevel(u,'A01W',XT)
endif
if GetUnitTypeId(u) =='n01Z' then
call SetUnitAbilityLevel(u,'AEar',XT)
endif
if GetUnitTypeId(u) =='n02V' then
call SetUnitAbilityLevel(u,'Ansk',XT)
endif
if GetUnitTypeId(u) =='e01S' then
call SetUnitAbilityLevel(u,'A04P',XT)
call SetUnitAbilityLevel(u,'Ansk',XT)
call SetUnitAbilityLevel(u,'ACav',XT)
endif
if GetUnitTypeId(u) =='n02T' then
call SetUnitAbilityLevel(u,'ACav',XT)
call SetUnitAbilityLevel(u,'Ansk',XT)
endif
if GetUnitTypeId(u) =='n03A' then
call SetUnitAbilityLevel(u,'SCae',XT)
endif
if GetUnitTypeId(u) =='n02X' then
call SetUnitAbilityLevel(u,'A04P',XT)
endif
if GetUnitTypeId(u) =='n029' then
call SetUnitAbilityLevel(u,'ACvp',XT)
call SetUnitAbilityLevel(u,'A04P',XT)
call SetUnitAbilityLevel(u,'ACua',XT)
call SetUnitAbilityLevel(u,'ACac',XT)
endif
if GetUnitTypeId(u) =='n02R' then
call SetUnitAbilityLevel(u,'ACac',XT)
call SetUnitAbilityLevel(u,'SCae',XT)
call SetUnitAbilityLevel(u,'ACav',XT)
endif
if GetUnitTypeId(u) =='n02B' then
call SetUnitAbilityLevel(u,'ANbh',XT)
call SetUnitAbilityLevel(u,'ACvp',XT)
endif
if GetUnitTypeId(u) =='n03P' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,0,BlzGetUnitBaseDamage(u,0)*.001)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,1,BlzGetUnitBaseDamage(u,0)*.002)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,2,BlzGetUnitBaseDamage(u,0)*.05)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,3,BlzGetUnitBaseDamage(u,0)*.75)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,4,BlzGetUnitBaseDamage(u,0)*1.)
call SetUnitAbilityLevel(u,'A0L0',XT)
call SetUnitAbilityLevel(u,'SCae',XT)
endif
if GetUnitTypeId(u) =='n043' then
call SetUnitAbilityLevel(u,'ACua',XT)
call SetUnitAbilityLevel(u,'SCae',XT)
endif
if GetUnitTypeId(u) =='n025' then
call BlzSetUnitBaseDamage(u,0,0)
call BlzSetUnitAttackCooldown(u,4.65,0)
call BlzSetUnitBaseDamage(u,0,1)
call BlzSetUnitAttackCooldown(u,4.65,1)
endif
if GetUnitTypeId(u) =='n043' then
call BlzSetUnitBaseDamage(u,0,0)
call BlzSetUnitAttackCooldown(u,1.7,0)
call BlzSetUnitBaseDamage(u,0,1)
call BlzSetUnitAttackCooldown(u,1.7,1)
endif
if GetUnitTypeId(u) =='n02F' then
call BlzSetUnitBaseDamage(u,0,0)
call BlzSetUnitAttackCooldown(u,4.,0)
call BlzSetUnitBaseDamage(u,0,1)
call BlzSetUnitAttackCooldown(u,4.,1)
endif
if GetUnitTypeId(u) =='n02N' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_HBZ2,0,BlzGetUnitBaseDamage(u,0)*.2)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_HBZ2,0,BlzGetUnitBaseDamage(u,1)*.2)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_PER_SECOND_HBZ5,0,BlzGetUnitBaseDamage(u,0)*.05)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_PER_SECOND_HBZ5,0,BlzGetUnitBaseDamage(u,1)*.05)
endif
if GetUnitTypeId(u) =='n02D' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,0,BlzGetUnitBaseDamage(u,0)*.1)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,0,BlzGetUnitBaseDamage(u,1)*.1)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,1,BlzGetUnitBaseDamage(u,0)*.15)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,1,BlzGetUnitBaseDamage(u,1)*.15)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,2,BlzGetUnitBaseDamage(u,0)*.3)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,2,BlzGetUnitBaseDamage(u,1)*.3)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,3,BlzGetUnitBaseDamage(u,0)*.45)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,3,BlzGetUnitBaseDamage(u,1)*.45)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,4,BlzGetUnitBaseDamage(u,0)*1.2)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,4,BlzGetUnitBaseDamage(u,1)*1.2)
call SetUnitAbilityLevel(u,'ACpv',XT)
endif
if GetUnitTypeId(u) =='n027' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,0,BlzGetUnitBaseDamage(u,0)*.003)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,1,BlzGetUnitBaseDamage(u,0)*.006)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,2,BlzGetUnitBaseDamage(u,0)*.1)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,3,BlzGetUnitBaseDamage(u,0)*1.)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,4,BlzGetUnitBaseDamage(u,0)*1.25)
call SetUnitAbilityLevel(u,'Apoi',XT)
endif
if GetUnitTypeId(u) =='n02B' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ANbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,0,BlzGetUnitBaseDamage(u,0)*.01)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ANbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,1,BlzGetUnitBaseDamage(u,0)*.015)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ANbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,2,BlzGetUnitBaseDamage(u,0)*.25)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ANbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,3,BlzGetUnitBaseDamage(u,0)*1.)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ANbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,4,BlzGetUnitBaseDamage(u,0)*3.)
call SetUnitAbilityLevel(u,'ANbh',XT)
endif
if GetUnitTypeId(u) =='n02L' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0PU'),ABILITY_RLF_DAMAGE_PER_INTERVAL,0,BlzGetUnitBaseDamage(u,0)*.05)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0PU'),ABILITY_RLF_DAMAGE_PER_INTERVAL,0,BlzGetUnitBaseDamage(u,1)*.05)
endif
else
//CREEPS
call BlzSetUnitBaseDamage(u,RANDOMDAMAGE[PC],0)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],0)
call BlzSetUnitBaseDamage(u,RANDOMDAMAGE[PC],1)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],1)
call BlzSetUnitMaxHP(u,RANDOMHEALTH[PC])
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,RANDOMLEVEL[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,RANDOMBOUNTY[PC])
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitRealField( GetTriggerUnit(), UNIT_RF_HIT_POINTS_REGENERATION_RATE, PC *2)
if GetUnitTypeId(u) =='n039' then
call UnitRemoveAbility(u, 'A0EG')
endif
if GetUnitTypeId(u) =='n03M' then
call BlzSetUnitBaseDamage(u,RANDOMDAMAGE[PC],0)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],0)
call BlzSetUnitBaseDamage(u,RANDOMDAMAGE[PC],1)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*.3))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='n00S' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.05),0)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],0)
call BlzSetUnitBaseDamage(u,RANDOMDAMAGE[PC],1)
call BlzSetUnitAttackCooldown(u,RANDOMATTACKINTERVAL[PC],1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*.05))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='n03I' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.5),0)
call BlzSetUnitAttackCooldown(u,2.3,0)
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.5),1)
call BlzSetUnitAttackCooldown(u,2.3,1)
call BlzSetUnitMaxHP(u,RANDOMHEALTH[PC])
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='e007' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),0)
call BlzSetUnitAttackCooldown(u,2.5,0)
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),1)
call BlzSetUnitAttackCooldown(u,2.5,1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*1.25))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='e008' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),0)
call BlzSetUnitAttackCooldown(u,2.5,0)
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),1)
call BlzSetUnitAttackCooldown(u,2.5,1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*1.25))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='e009' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),0)
call BlzSetUnitAttackCooldown(u,2.5,0)
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.75),1)
call BlzSetUnitAttackCooldown(u,2.5,1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*1.25))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='n044' then
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.4),0)
call BlzSetUnitAttackCooldown(u,.75,0)
call BlzSetUnitBaseDamage(u,R2I(RANDOMDAMAGE[PC]*.4),1)
call BlzSetUnitAttackCooldown(u,.75,1)
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*.4))
call BlzSetUnitArmor(u,RANDOMARMOR[PC])
call SetUnitMoveSpeed(u,RANDOMMOVESPEED[PC])
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='h00S' then
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*.05))
call SetUnitMoveSpeed(u,0.)
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,R2I(RANDOMBOUNTY[PC]*.001))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='h020' then
call BlzSetUnitMaxHP(u,R2I(RANDOMHEALTH[PC]*.5))
call SetUnitMoveSpeed(u,0.)
call BlzSetUnitIntegerField(u,UNIT_IF_LEVEL,1)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,5)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
if GetUnitTypeId(u) =='n02A' then
call SetUnitAbilityLevel(u,'ACbh',XT)
endif
if GetUnitTypeId(u) =='n02M' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_HBZ2,0,BlzGetUnitBaseDamage(u,0)*.025)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_HBZ2,0,BlzGetUnitBaseDamage(u,1)*.025)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_PER_SECOND_HBZ5,0,BlzGetUnitBaseDamage(u,0)*.01)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A01N'),ABILITY_RLF_DAMAGE_PER_SECOND_HBZ5,0,BlzGetUnitBaseDamage(u,1)*.01)
endif
if GetUnitTypeId(u) =='n02C' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,0,BlzGetUnitBaseDamage(u,0)*.1)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,0,BlzGetUnitBaseDamage(u,1)*.1)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,1,BlzGetUnitBaseDamage(u,0)*.15)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,1,BlzGetUnitBaseDamage(u,1)*.15)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,2,BlzGetUnitBaseDamage(u,0)*.3)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,2,BlzGetUnitBaseDamage(u,1)*.3)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,3,BlzGetUnitBaseDamage(u,0)*.45)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,3,BlzGetUnitBaseDamage(u,1)*.45)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,4,BlzGetUnitBaseDamage(u,0)*1.2)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACpv'),ABILITY_RLF_DAMAGE_DEALT_WAR2,4,BlzGetUnitBaseDamage(u,1)*1.2)
call SetUnitAbilityLevel(u,'ACpv',XT)
endif
if GetUnitTypeId(u) =='n03O' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,0,BlzGetUnitBaseDamage(u,0)*.001)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,1,BlzGetUnitBaseDamage(u,0)*.002)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,2,BlzGetUnitBaseDamage(u,0)*.05)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,3,BlzGetUnitBaseDamage(u,0)*.75)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'A0L0'),ABILITY_RLF_DAMAGE_PER_SECOND_APL2,4,BlzGetUnitBaseDamage(u,0)*1.)
call SetUnitAbilityLevel(u,'A0L0',XT)
endif
if GetUnitTypeId(u) =='n026' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,0,BlzGetUnitBaseDamage(u,0)*.002)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,1,BlzGetUnitBaseDamage(u,0)*.004)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,2,BlzGetUnitBaseDamage(u,0)*.075)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,3,BlzGetUnitBaseDamage(u,0)*.75)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'Apoi'),ABILITY_RLF_DAMAGE_PER_SECOND_POI1,4,BlzGetUnitBaseDamage(u,0)*1.)
call SetUnitAbilityLevel(u,'Apoi',XT)
endif
if GetUnitTypeId(u) =='n02A' then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,0,BlzGetUnitBaseDamage(u,0)*.0075)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,1,BlzGetUnitBaseDamage(u,0)*.01)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,2,BlzGetUnitBaseDamage(u,0)*.15)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,3,BlzGetUnitBaseDamage(u,0)*.75)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(u,'ACbh'),ABILITY_RLF_DAMAGE_BONUS_HBH3,4,BlzGetUnitBaseDamage(u,0)*2.)
call SetUnitAbilityLevel(u,'ACbh',XT)
endif
if GetUnitTypeId(u) =='n028' then
call SetUnitAbilityLevel(u,'ACce',XT)
endif
if GetUnitTypeId(u) =='n024' then
call SetUnitAbilityLevel(u,'Aspo',XT)
endif
if GetUnitTypeId(u) =='n02W' then
call SetUnitAbilityLevel(u,'ANak',XT)
endif
if GetUnitTypeId(u) =='n02Y' then
call SetUnitAbilityLevel(u,'Afbt',XT)
endif
if GetUnitTypeId(u) =='n02S' then
call SetUnitAbilityLevel(u,'AIsr',XT)
endif
if GetUnitTypeId(u) =='n03R' then
call SetUnitAbilityLevel(u,'AIsr',XT)
endif
if GetUnitTypeId(u) =='u00P' then
call SetUnitAbilityLevel(u,'AIsr',XT)
endif
if GetUnitTypeId(u) =='n01U' then
call SetUnitAbilityLevel(u,'A01T',XT)
endif
if GetUnitTypeId(u) =='u00Q' then
call SetUnitAbilityLevel(u,'Aspo',XT)
endif
if GetUnitTypeId(u) =='n037' then
call SetUnitAbilityLevel(u,'Ansk',XT)
call SetUnitAbilityLevel(u,'A037',XT)
endif
if GetUnitTypeId(u) =='u00V' then
call SetUnitAbilityLevel(u,'A037',XT)
call SetUnitAbilityLevel(u,'AIsr',XT)
endif
endif
endif
else
endif
if GetUnitName(u) == "Naga Siren" then
set pid = 1 + GetPlayerId(GetOwningPlayer(u))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)+( (GetHeroInt(LC[pid],true)+GetHeroAgi(LC[pid],true)) * 2. * GetUnitAbilityLevel(LC[pid],'A0A7') * (1.+(GetHeroLevel(LC[pid])*.075)) )),0)
endif
if not TRUEENFOS and GetUnitAbilityLevel(u,'Aloc')==0 then
set i = BlzGetUnitIntegerField(u, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,i+(i/5))
//call BJDebugMsg("I2S(i)")
endif
if GetUnitAbilityLevel(u,'Aloc')==0 then
set i = BlzGetUnitIntegerField(u, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)
if REDUCEDBOUNTY then
call BlzSetUnitIntegerField(u,UNIT_IF_GOLD_BOUNTY_AWARDED_BASE,i*3/4)
endif
endif
if DOUBLEHEALTH then
if GetOwningPlayer(u) == Player(11) or GetOwningPlayer(u) == Player(13) or GetOwningPlayer(u) == Player(10) or GetOwningPlayer(u) == Player(12) then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*2))
call SetWidgetLife(u,R2I(BlzGetUnitMaxHP(u)*2))
endif
endif
if TRUEENFOS then
if GetOwningPlayer(u) == Player(11) or GetOwningPlayer(u) == Player(13) or GetOwningPlayer(u) == Player(10) or GetOwningPlayer(u) == Player(12) then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*1.2))
call SetWidgetLife(u,R2I(BlzGetUnitMaxHP(u)*1.2))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*1.2),0)
endif
endif
if GetUnitAbilityLevel(u,'A01X') != 0 then
call UnitRemoveAbility(u,'A01X')
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.9)
endif
if GetUnitAbilityLevel(u,'A0DW') != 0 then
call UnitRemoveAbility(u,'A0DW')
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.99)
endif
if GetUnitAbilityLevel(u,'A0HS') != 0 then
call UnitRemoveAbility(u,'A0HS')
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.8)
endif
if GetUnitAbilityLevel(u,'A0HP') != 0 then
call UnitRemoveAbility(u,'A0HP')
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.9)
endif
if GetUnitAbilityLevel(u,'AIsr') != 0 then
call UnitRemoveAbility(u,'AIsr')
if XT==1 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.4)
endif
if XT==2 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.7)
endif
if XT==3 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.8)
endif
if XT==4 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.9)
endif
if XT==5 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.99)
endif
endif
if TRUEENFOS and GetUnitTypeId(u) == 'n020' then
call UnitAddAbility(u,'A0K9')
//call BJDebugMsg("Added")
endif
if NaturesAbundanceS[id]>= 1 and GetUnitAbilityLevel(u,'Aloc')==0 and GetUnitAbilityLevel(u,'A0OT') != 1 then
set NaturesAbundanceS[id] = 0
endif
if StealStacks[id]>= 1 and GetUnitAbilityLevel(u,'Aloc')==0 and GetUnitAbilityLevel(u,'A0RK') != 1 then
set StealStacks[id] = 0
endif
if GetUnitTypeId(u) == 'n01Y' then
call SetUnitAbilityLevel(u,'ACbh',XT)
if not TRUEENFOS then
call UnitRemoveAbility(u,'A0PG')
endif
endif
if GetUnitTypeId(u) == 'n02L' then
call SetUnitAbilityLevel(u,'A0PU',XT)
endif
if GetUnitAbilityLevel(u,'A0S9') != 0 then
if GetOwningPlayer(u) == Player(10) or GetOwningPlayer(u) == Player(12) then
if ScreamStacks[0] > 400 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(100.+((ScreamStacks[0]-400)*.06))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(15.+((ScreamStacks[0]-400)*.0225))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[0]-400)*.01)))
else
if ScreamStacks[0] > 275 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(36.+((ScreamStacks[0]-400)*.06))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(5.+((ScreamStacks[0]-275)*.0225))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[0]-275)*.01)))
else
if ScreamStacks[0] > 150 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(10.+((ScreamStacks[0]-200)*.04))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(3.+((ScreamStacks[0]-150)*.015))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[0]-150)*.01)))
else
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(3.+(ScreamStacks[0]*.01))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(2.+(ScreamStacks[0]*.01))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
endif
endif
if ScreamStacks[0] >= 150 then
call UnitAddAbility(u,'SCva')
call UnitAddAbility(u,'A0P2')
endif
if ScreamStacks[0] >= 275 then
call UnitAddAbility(u,'A0QT')
endif
if ScreamStacks[0] >= 400 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.5)
endif
else
if GetOwningPlayer(u) == Player(11) or GetOwningPlayer(u) == Player(13) then
if ScreamStacks[0] > 400 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(100.+((ScreamStacks[0]-600)*.06))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(15.+((ScreamStacks[0]-400)*.0225))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[0]-400)*.01)))
else
if ScreamStacks[1] > 275 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(36.+((ScreamStacks[1]-400)*.06))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(5.+((ScreamStacks[1]-275)*.0225))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[1]-275)*.01)))
else
if ScreamStacks[1] > 150 then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(10.+((ScreamStacks[1]-200)*.04))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(3.+((ScreamStacks[1]-150)*.015))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*(1.+((ScreamStacks[1]-150)*.01)))
else
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*(3.+(ScreamStacks[1]*.01))))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*(2.+(ScreamStacks[1]*.01))),0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endif
endif
endif
if ScreamStacks[1] >= 150 then
call UnitAddAbility(u,'SCva')
call UnitAddAbility(u,'A0P2')
endif
if ScreamStacks[1] >= 275 then
call UnitAddAbility(u,'A0QT')
endif
if ScreamStacks[0] >= 400 then
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,.5)
endif
endif
endif
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterEnterRectSimple( t,GetPlayableMapRect() )
call TriggerAddCondition(t, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Socialism initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u
local integer i = 0
local integer players = 0
local integer loop1 = 0
local integer loop2 = 5
local integer i2 = 0
local real x
local real y
local integer i3
local unit k
local player p
local string s = null
local texttag tt = null
if TRUECOMMUNISM==true or SOCIALWELFARE==true or PRODICT == true then
set u = GetTriggerUnit()
set i = BlzGetUnitIntegerField(u, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)
if GetPlayerController(GetOwningPlayer(u))== MAP_CONTROL_COMPUTER and i > 0 then
set k = GetKillingUnit()
set p = GetOwningPlayer(k)
if IsUnitAlly(k,Player(10)) then
loop
exitwhen loop1 == 5
if GetPlayerSlotState(Player(loop1)) == PLAYER_SLOT_STATE_PLAYING then
set i2 = i2 + 1
endif
set loop1 = loop1 + 1
endloop
set loop1 = 0
set x = GetUnitX(u)
set y = GetUnitY(u)
if i2 > 1 then
if TRUECOMMUNISM then
set i = i/i2
endif
if SOCIALWELFARE then
set i = i/2
set i3 = i/(i2-1)
endif
if PRODICT then
set i3 = (R2I(i*.1))/(i2-1)
set i = R2I(i*.9)
endif
endif
loop
exitwhen loop1 == 5
if GetPlayerSlotState(Player(loop1)) == PLAYER_SLOT_STATE_PLAYING then
if SOCIALWELFARE or PRODICT then
if p == Player(loop1) then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD))+i)
if GetLocalPlayer() == Player(loop1) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
else
call SetPlayerState(Player(loop1),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(loop1),PLAYER_STATE_RESOURCE_GOLD))+i3)
if GetLocalPlayer() == Player(loop1) then
set s = "|cffffcc00 +"+I2S(i3)+"|r"
endif
endif
else
call SetPlayerState(Player(loop1),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(loop1),PLAYER_STATE_RESOURCE_GOLD))+i)
if GetLocalPlayer() == Player(loop1) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
endif
set tt = CreateTextTag()
call SetTextTagText(tt,s,0.023)
call SetTextTagPos(tt,x,y,10.)
call SetTextTagColor(tt,255,255,255,255)
call SetTextTagVelocity(tt,0.0355*Cos(90. * bj_DEGTORAD),0.0355*Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,1.5)
call SetTextTagLifespan(tt,2.)
call SetTextTagPermanent(tt,false)
endif
set loop1 = loop1 + 1
endloop
else
if IsUnitAlly(GetKillingUnit(),Player(11)) then
loop
exitwhen loop2 == 10
if GetPlayerSlotState(Player(loop2)) == PLAYER_SLOT_STATE_PLAYING then
set i2 = i2 + 1
endif
set loop2 = loop2 + 1
endloop
set loop2 = 5
set x = GetUnitX(u)
set y = GetUnitY(u)
if i2 > 1 then
if TRUECOMMUNISM then
set i = i/i2
endif
if SOCIALWELFARE then
set i = i/2
set i3 = i/(i2-1)
endif
if PRODICT then
set i3 = i/10/(i2-1)
set i = i/10 * 9
endif
endif
loop
exitwhen loop2 == 10
if GetPlayerSlotState(Player(loop2)) == PLAYER_SLOT_STATE_PLAYING then
if SOCIALWELFARE or PRODICT then
if p == Player(loop2) then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD))+i)
if GetLocalPlayer() == Player(loop2) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
else
call SetPlayerState(Player(loop2),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(loop2),PLAYER_STATE_RESOURCE_GOLD))+i3)
if GetLocalPlayer() == Player(loop2) then
set s = "|cffffcc00 +"+I2S(i3)+"|r"
endif
endif
else
call SetPlayerState(Player(loop2),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(loop2),PLAYER_STATE_RESOURCE_GOLD))+i)
if GetLocalPlayer() == Player(loop2) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
endif
set tt = CreateTextTag()
call SetTextTagText(tt,s,0.023)
call SetTextTagPos(tt,x,y,10.)
call SetTextTagColor(tt,255,255,255,255)
call SetTextTagVelocity(tt,0.0355*Cos(90. * bj_DEGTORAD),0.0355*Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,1.5)
call SetTextTagLifespan(tt,2.)
call SetTextTagPermanent(tt,false)
endif
set loop2 = loop2 + 1
endloop
endif
endif
endif
endif
set p = null
set s = null
set tt = null
set k = null
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CrushingBlows initializer OnInit
globals
private constant integer SPELL_ID = 'A0QX'
private constant integer SPELL_ID2 = 'A0EQ'
trigger CRUSHINGBLOWS
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real i
if GetUnitAbilityLevel(a,SPELL_ID) == 1 and a != u and GetEventDamage()>= 1. and not IsUnitType(u,UNIT_TYPE_HERO) and BlzGetEventIsAttack() and GetEventDamage() > 0 then
if GetUnitAbilityLevel(u,SPELL_ID2) != 1 then
call UnitAddAbility(u,SPELL_ID2)
endif
set i = -1.*(1+(BlzGetUnitArmor(LC[1+GetPlayerId(GetOwningPlayer(a))])*.00666666))
call AddUnitBonus(u,BONUS_ARMOR,i)
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CRUSHINGBLOWS = CreateTrigger()
call MOE(II, (CRUSHINGBLOWS))
call TriggerAddCondition(CRUSHINGBLOWS, Condition(function Actions))
call DisableTrigger(CRUSHINGBLOWS)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EvasionMastery initializer OnInit
globals
private integer array values
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
local integer i = 0
if GetUnitAbilityLevel(u,'A0AP')>=1 then
set i = values[GetUnitAbilityLevel(u,'A0AP')]
else
if GetUnitAbilityLevel(u,'A0RA')>=1 then
set i = values[GetUnitAbilityLevel(u,'A0RA')]
else
if GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A0RA')>=1 and IsUnitIllusion(u) and GetUnitAbilityLevel(u,'B06Y') != 0 then
set i = values[GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A0RA')]
endif
endif
endif
if GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= i and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A026') == 0 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
set values[1] = 15
set values[2] = 20
set values[3] = 25
set values[4] = 30
set values[5] = 45
set values[6] = 50
set values[7] = 55
set values[8] = 60
set values[9] = 65
set values[10] = 70
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CombatMasteryEvasion initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0AC')>=1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= GetUnitAbilityLevel(u,'A0AC') * 5 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A026') == 0 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
// set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=5
//TESH.alwaysfold=0
scope GlythidesGift initializer OnInit
private struct Glyth
unit u
player p
integer i
method destroy takes nothing returns nothing
set this.p = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local Glyth data = GetTimerData(t)
if GetUnitAbilityLevel(data.u,'BNdh') != 1 or data.i == 13 then
call CameraClearNoiseForPlayer(data.p)
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
endfunction
private function Conditions takes nothing returns nothing
local Glyth data
local timer t
if GetSpellTargetUnit() == LC[(1+GetPlayerId(GetOwningPlayer(GetSpellTargetUnit())))] then
set t = NewTimer()
set data = Glyth.create()
set data.u = GetSpellTargetUnit()
set data.i = 0
set data.p = GetOwningPlayer(data.u)
call SetTimerData(t,data)
call CameraSetTargetNoiseForPlayer(data.p,1600.,600.)
call TimerStart(t,.01,false,function Handler)
endif
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A03X', function Conditions)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope Charge initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private integer DATA
private unit CASTER
private real DAMAGE
private real ANGLE
private constant integer SPELL_ID = 'A0O1'
private constant string EFFECT = "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl"
private constant string ATTACH_POINT = "chest"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
group g
effect fx1
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.c = null
set this.fx1 = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
local unit d
local player p
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
set p = GetOwningPlayer(CASTER)
if p == Player(10) then
set p = Player(12)
else
if p==Player(11) then
set p = Player(13)
endif
endif
set d = CreateUnit(p,'h007',GetUnitX(u),GetUnitY(u),0.)
if TRUEENFOS then
call UnitAddAbility(d,'A0OC')
else
call UnitAddAbility(d,'A0O2')
endif
call IssueTargetOrderById(d,852095,u)
call UnitApplyTimedLife(d,'BTLF',1.)
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set p = null
set d = null
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 32 or not UnitAlive(data.c) then
call DestroyEffect(data.fx1)
call ReleaseTimer(t)
call data.destroy()
else
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 200., Filter( function FilterActions ) )
set data.g = GROUP2
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",data.x,data.y))
if TRUEENFOS then
set data.x = GetUnitX(data.c) + 45 * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 45 * Sin(data.a * bj_DEGTORAD)
else
set data.x = GetUnitX(data.c) + 18 * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 18 * Sin(data.a * bj_DEGTORAD)
endif
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
else
call DestroyEffect(data.fx1)
call ReleaseTimer(t)
call data.destroy()
set t = null
return
endif
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.a = GetUnitFacing(data.c)
set data.current = 0
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Valiant Charge.mdx",data.c,"origin")
call BlzSetSpecialEffectScale(data.fx1,.65)
if TRUEENFOS then
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*3.
else
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*2.
endif
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
integer array FeastStacks
endglobals
scope GluttonousFeast initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real hp
if GetUnitAbilityLevel(a,'A0QJ')==1 and GetEventDamage() > 0 and a != u and not IsUnitIllusion(a) then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if FeastStacks[GetUnitUserData(a)] <= 100 then
set FeastStacks[GetUnitUserData(a)] = FeastStacks[GetUnitUserData(a)] + 1
call SetUnitScale(a,BlzGetUnitRealField(a, UNIT_RF_SCALING_VALUE)+(FeastStacks[GetUnitUserData(a)]*.02),BlzGetUnitRealField(a, UNIT_RF_SCALING_VALUE)+(FeastStacks[GetUnitUserData(a)]*.02),BlzGetUnitRealField(a, UNIT_RF_SCALING_VALUE)+(FeastStacks[GetUnitUserData(a)]*.02))
set hp = BlzGetUnitMaxHP(a) * .03
call BlzSetUnitMaxHP(a,R2I((hp*100)+hp))
call SetWidgetLife(a,GetWidgetLife(a)+hp)
call BlzSetUnitBaseDamage(a,R2I(BlzGetUnitBaseDamage(a,0)*1.03),0)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\VampiricAuraTarget.mdx",a,"origin"))
call AddUnitBonus(a,BONUS_ATTACK_SPEED,.03)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
if FeastStacks[GetUnitUserData(a)] <= 100 then
set FeastStacks[GetUnitUserData(a)] = FeastStacks[GetUnitUserData(a)] + 1
call SetUnitScale(a,1.+(FeastStacks[GetUnitUserData(a)]*.02),1.+(FeastStacks[GetUnitUserData(a)]*.02),1.+(FeastStacks[GetUnitUserData(a)]*.02))
set hp = BlzGetUnitMaxHP(a) * .01
call BlzSetUnitMaxHP(a,R2I((hp*100)+hp))
call SetWidgetLife(a,GetWidgetLife(a)+hp)
call BlzSetUnitBaseDamage(a,R2I(BlzGetUnitBaseDamage(a,0)*1.02),0)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\VampiricAuraTarget.mdx",a,"origin"))
call AddUnitBonus(a,BONUS_ATTACK_SPEED,.03)
endif
endif
endif
endif
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
integer array StealStacks
endglobals
scope Pilfer initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer gold
local player p
if GetUnitAbilityLevel(a,'A0RE')==1 and GetEventDamage() > 0 and a != u and not IsUnitIllusion(a) and GetPlayerController(GetOwningPlayer(a))==MAP_CONTROL_COMPUTER then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if StealStacks[GetUnitUserData(a)] == 0 then
call AddUnitAnimationProperties(a,"gold",true)
call UnitAddAbility(a,'A0RK')
endif
set p = GetOwningPlayer(u)
set gold = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
if gold > 1000 then
set gold = 1000
endif
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)-gold)
set StealStacks[GetUnitUserData(a)] = StealStacks[GetUnitUserData(a)] + gold
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl",u,"origin"))
if StealStacks[GetUnitUserData(a)] >= 5000 then
call UnitAddAbility(a,'A0CF')
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
if StealStacks[GetUnitUserData(a)] == 0 then
call AddUnitAnimationProperties(a,"gold",true)
call UnitAddAbility(a,'A0RK')
endif
set p = GetOwningPlayer(u)
set gold = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
if gold > 1000 then
set gold = 1000
endif
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)-gold)
set StealStacks[GetUnitUserData(a)] = StealStacks[GetUnitUserData(a)] + gold
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl",u,"origin"))
if StealStacks[GetUnitUserData(a)] >= 5000 then
call UnitAddAbility(a,'A0CF')
endif
endif
endif
endif
set p = null
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope PilferDrop initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local item it
if StealStacks[GetUnitUserData(u)]> 0 and GetOwningPlayer(u) != Player(PLAYER_NEUTRAL_PASSIVE) then
set it = CreateItem('I05N',GetUnitX(u),GetUnitY(u))
call BlzSetItemIntegerField(it, ITEM_IF_LEVEL,StealStacks[GetUnitUserData(u)])
set StealStacks[GetUnitUserData(u)] = 0
endif
set it = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
scope PickupStolenGold initializer OnInit
private function Conditions takes nothing returns boolean
local item it = GetManipulatedItem()
local unit u
local player p
if GetItemTypeId(it) == 'I05N' then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+GetItemLevel(it))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\ResourceItems\\ResourceEffectTarget.mdl",u,"origin"))
//call BJDebugMsg(I2S(GetItemLevel(it)))
endif
set u = null
set p = null
set it = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
scope InfiniteCycle initializer OnInit
globals
trigger INFINITYCYCLE
private constant integer ABIL_ID = 'B06P'
endglobals
private struct Data
unit c
effect fx
real x
real y
real hp
real heal
real timescale
integer i
method destroy takes nothing returns nothing
call BlzSetSpecialEffectScale(this.fx,1.)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", this.c, "chest"))
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetTimerData(t)
if data.i >= 23. or not UnitAlive(data.c) then
call BlzPauseUnitEx(data.c, false)
call SetUnitTimeScale(data.c,1.)
call SetUnitInvulnerable(data.c, false)
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i + 1
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", data.c, "chest"))
set data.timescale = data.timescale + .1
call BlzSetSpecialEffectTimeScale(data.fx, data.timescale)
set data.hp = data.hp + data.heal
call SetWidgetLife(data.c, data.hp)
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
call BlzSetSpecialEffectX(data.fx,data.x)
call BlzSetSpecialEffectY(data.fx,data.y)
call SetTimerData(t, data)
call TimerStart(t, 1.0, false, function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit p = GetTriggerUnit()
local real r
local real d
local timer t
local Data data
if GetUnitAbilityLevel(p, ABIL_ID) != 0 and p != u then
set r = GetWidgetLife(p)
if (J5V[(ROX((GetUnitTypeId(u))))]) then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
set d = GetEventDamage()
if d >= r or r <=(GetUnitState(p,UNIT_STATE_MAX_LIFE)*.4) then
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set t = NewTimer()
set data = Data.create()
set data.c = p
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.i = 0
call BlzSetUnitMaxHP(data.c,BlzGetUnitMaxHP(data.c)*2)
call BlzSetUnitMaxHP(data.c,BlzGetUnitMaxHP(data.c)*2)
call BlzSetUnitBaseDamage(data.c,R2I(BlzGetUnitBaseDamage(data.c,0)*1.3),0)
call BlzSetUnitBaseDamage(data.c,R2I(BlzGetUnitBaseDamage(data.c,1)*1.3),1)
set data.timescale = 1.
set data.hp = r
set data.heal = GetUnitState(data.c, UNIT_STATE_MAX_LIFE) * .05
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", data.c, "chest"))
//set data.fx = AddSpecialEffect("war3mapImported\\timeFalo.mdx", data.x, data.y)
set data.fx = AddSpecialEffectTarget("war3mapImported\\timeFalo.mdx", data.c, "chest")
call BlzSetSpecialEffectScale(data.fx,2.5)
//call BlzSetSpecialEffectHeight(data.fx,300.)
//call BlzSetSpecialEffectColor(data.fx,255,10,10)
//call BlzSetSpecialEffectYaw(data.fx,45.* bj_RADTODEG)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", data.c, "chest"))
call BlzPauseUnitEx(data.c, true)
call SetUnitTimeScale(data.c,0.)
call SetUnitInvulnerable(data.c, true)
call SetWidgetLife(data.c,1.)
call SetTimerData(t, data)
call TimerStart(t, 1.0, false, function Handler)
endif
endif
else
set d = GetEventDamage()
if d >= r or r <=(GetUnitState(p,UNIT_STATE_MAX_LIFE)*.4) then
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set t = NewTimer()
set data = Data.create()
set data.c = p
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.i = 0
call BlzSetUnitMaxHP(data.c,BlzGetUnitMaxHP(data.c)*2)
set data.timescale = 1.
set data.hp = r
set data.heal = GetUnitState(data.c, UNIT_STATE_MAX_LIFE) * .05
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", data.c, "chest"))
//set data.fx = AddSpecialEffect("war3mapImported\\timeFalo.mdx", data.x, data.y)
set data.fx = AddSpecialEffectTarget("war3mapImported\\timeFalo.mdx", data.c, "chest")
call BlzSetSpecialEffectScale(data.fx,1.5)
//call BlzSetSpecialEffectHeight(data.fx,300.)
//call BlzSetSpecialEffectYaw(data.fx,45.* bj_RADTODEG)
//call BlzSetSpecialEffectColor(data.fx,255,10,10)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Black Fragon Effect.mdx", data.c, "chest"))
call BlzPauseUnitEx(data.c, true)
call SetUnitTimeScale(data.c,0.)
call SetUnitInvulnerable(data.c, true)
call SetWidgetLife(data.c,1.)
call SetTimerData(t, data)
call TimerStart(t, 1.0, false, function Handler)
endif
endif
endif
set t = null
set p = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set INFINITYCYCLE = CreateTrigger()
call MOE(II, (INFINITYCYCLE))
call TriggerAddCondition(INFINITYCYCLE, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope DeathlyDance initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private integer DATA
private unit CASTER
private real DAMAGE
private real ANGLE
private constant integer SPELL_ID = 'A0PH'
private constant string EFFECT = "war3mapImported\\TwilightImmolationDamage.mdx"
private constant string ATTACH_POINT = "head"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
effect fx1
effect fx2
effect fx3
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
return data
endmethod
method destroy takes nothing returns nothing
set this.c = null
set this.fx1 = null
set this.fx2 = null
set this.fx3 = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
//call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 64 or not UnitAlive(data.c) then
call DestroyEffect(data.fx1)
call DestroyEffect(data.fx2)
call DestroyEffect(data.fx3)
call ReleaseTimer(t)
call data.destroy()
else
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 200., Filter( function FilterActions ) )
//call DestroyEffect(AddSpecialEffect("war3mapImported\\SpiritWalkerChange3.mdx",data.x,data.y))
if TRUEENFOS then
set data.x = GetUnitX(data.c) + 12 * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 12 * Sin(data.a * bj_DEGTORAD)
else
set data.x = GetUnitX(data.c) + 9 * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 9 * Sin(data.a * bj_DEGTORAD)
endif
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
endif
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.a = GetUnitFacing(data.c)
set data.current = 0
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\PurpleManaBurst.mdx",data.c,"hand,left")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\PurpleManaBurst.mdx",data.c,"hand,right")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\SpiritWalkerChange3.mdx",data.c,"origin")
//call BlzSetSpecialEffectScale(data.fx1,.65)
if TRUEENFOS then
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*5.*.03125
else
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*2.5*.03125
endif
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope Rampage initializer OnInit
globals
private unit CASTER
private real DAMAGE
private constant integer SPELL_ID = 'A0RO'
private constant string EFFECT = "war3mapImported\\Firebrand Shot Green.mdx"
private constant string ATTACH_POINT = "chest"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
effect fx1
//effect fx2
//effect fx3
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
return data
endmethod
method destroy takes nothing returns nothing
set this.c = null
set this.fx1 = null
//set this.fx2 = null
//set this.fx3 = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
//call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
local effect fx
if data.current == 64 or not UnitAlive(data.c) then
call DestroyEffect(data.fx1)
call SetUnitTimeScale(data.c,1.)
//call DestroyEffect(data.fx2)
//call DestroyEffect(data.fx3)
call ReleaseTimer(t)
call data.destroy()
else
set data.x = GetUnitX(data.c) + 13 * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 13 * Sin(data.a * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
endif
if data.current == 16 or data.current == 32 or data.current == 48 or data.current == 0 then
call SetUnitTimeScale(data.c,3.)
call SetUnitAnimation(data.c,"attack slam")
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GLOBALGROUP, data.x + 124. * Cos(data.a * bj_DEGTORAD), data.y + 124. * Sin(data.a * bj_DEGTORAD), 249., Filter( function FilterActions ) )
call MoveLocation(GLOBALLOCATION,data.x,data.y)
set fx = AddSpecialEffect("war3mapImported\\Reaper's Claws Green.mdx", data.x + 199. * Cos(data.a * bj_DEGTORAD), data.y + 199. * Sin(data.a * bj_DEGTORAD))
call BlzSetSpecialEffectOrientation( fx, Deg2Rad(data.a), 0, Deg2Rad(-45))
call BlzSetSpecialEffectHeight(fx, GetLocationZ(GLOBALLOCATION) + 20. )
call BlzSetSpecialEffectTimeScale(fx, 0.8)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Reaper's Claws Green.mdx", data.x+ 199. * Cos(data.a * bj_DEGTORAD), data.y + 199. * Sin(data.a * bj_DEGTORAD))
call BlzSetSpecialEffectOrientation( fx, Deg2Rad(data.a), 0, Deg2Rad(-135))
call BlzSetSpecialEffectHeight(fx,GetLocationZ(GLOBALLOCATION)+ 20.)
call BlzSetSpecialEffectTimeScale(fx, 0.7)
call DestroyEffect(fx)
endif
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.a = GetUnitFacing(data.c)
set data.current = 0
set data.fx1 = AddSpecialEffect("war3mapImported\\BossArrow.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(data.fx1,.95)
call BlzSetSpecialEffectYaw(data.fx1,data.a * bj_DEGTORAD)
//set data.fx2 = AddSpecialEffectTarget("war3mapImported\\PurpleManaBurst.mdx",data.c,"hand,right")
//set data.fx3 = AddSpecialEffectTarget("war3mapImported\\SpiritWalkerChange3.mdx",data.c,"origin")
//call BlzSetSpecialEffectScale(data.fx1,.65)
if TRUEENFOS then
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*4.
else
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*2.
endif
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.9,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope FieryLasers initializer OnInit
globals
private constant integer SPELL_ID = 'A0RR'
//boolean array IsChannelingFireLaser
endglobals
private struct FT2
effect fx
method destroy takes nothing returns nothing
call BlzSetSpecialEffectAlpha(this.fx,0)
call DestroyEffect(this.fx)
call this.deallocate()
endmethod
endstruct
private struct FT
unit c
lightning l
integer i
real x1
real x2
real y1
real y2
real z1
real z2
real a
real dmg
player p
effect fx
integer id
method destroy takes nothing returns nothing
//call BJDebugMsg("End")
//set IsChannelingFireLaser[GetUnitUserData(this.c)] = false
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call DestroyLightning(this.l)
set this.l = null
set this.p = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t= GetExpiredTimer()
local FT2 data = GetTimerData(t)
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local unit FoG
local group g
//local real z
local integer i
if data.i <= 0 or not UnitAlive(data.c) or data.c == null then //or IsChannelingFireLaser[GetUnitUserData(data.c)] == false
call data.destroy()
call ReleaseTimer(t)
else
if data.i == 80 then
call DestroyLightning(data.l)
set data.l = AddLightningEx("FIBM",true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
set data.fx = AddSpecialEffect("war3mapImported\\Ember.mdx",data.x2,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z1+20.)
call BlzSetSpecialEffectZ(data.fx,data.z1+20.)
call BlzSetSpecialEffectScale(data.fx,3.25)
endif
set data.x1 = GetUnitX(data.c)
set data.y1 = GetUnitY(data.c)
if data.i <= 80 then
set g = CreateGroup()
call LineSegment.EnumUnits(g,data.x1,data.y1,data.x2,data.y2,90.) //takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
//call MoveLocation(LOC,GetUnitX(FoG),GetUnitY(FoG))
//set z = GetLocationZ(LOC)+BlzGetUnitZ(FoG)
if IsUnitEnemy(FoG,data.p) and UnitAlive(FoG) then //and ((z<= data.z1+95. and z>=data.z1-95.)or(z<= data.z2+65. and z>=data.z2-65.)) then
//if IsUnitType(FoG,UNIT_TYPE_HERO) then
call UnitDamageTargetEx(data.c,FoG,BlzGetUnitMaxHP(FoG)*.0625*.4 ,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
//endif
call UnitDamageTargetEx(data.c,FoG,data.dmg ,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Orange.mdx",FoG,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"head"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
endif
set data.a = data.a - 2.25
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
call MoveLocation(GLOBALLOCATION,data.x2,data.y2)
set data.z2 = GetLocationZ(GLOBALLOCATION) + 35.
call MoveLightningEx(data.l,true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
if data.i <=80 then
call BlzSetSpecialEffectX(data.fx,data.x2)
call BlzSetSpecialEffectY(data.fx,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z2+10.)
call BlzSetSpecialEffectZ(data.fx,data.z2+10.)
endif
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function Handler)
endif
set g = null
set FoG = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local FT data
local real a2 = GetRandomReal(0.,360.)
local real aa = a2
local FT2 data2 = FT2.create()
local unit u = GetTriggerUnit()
local real x= GetUnitX(u)
local real y = GetUnitY(u)
set data2.fx = AddSpecialEffect("war3mapImported\\D00729.mdx",x,y)
call MoveLocation(GLOBALLOCATION,x,y)
call BlzSetSpecialEffectZ(data2.fx,GetLocationZ(GLOBALLOCATION) + 5.)
call BlzSetSpecialEffectScale(data2.fx,3.25)
set t = NewTimer()
call SetTimerData(t,data2)
call TimerStart(t,6., false, function Handler2)
call AddUnitBonusTimed(u,BONUS_MAGIC_RESISTANCE,.5,6.)
call AddUnitBonusTimed(u,BONUS_ARMOR,500,6.)
loop
exitwhen aa >= a2 + 360.
set data = FT.create()
set t = NewTimer()
set data.c = u
set data.i = 96
set data.x1 = x
set data.y1 = y
call MoveLocation(GLOBALLOCATION,data.x1,data.y1)
set data.z1 = GetLocationZ(GLOBALLOCATION) + 35.
set data.a = aa
// local real x = GetLocationX(source) + dist * Cos(angle * bj_DEGTORAD)
//local real y = GetLocationY(source) + dist * Sin(angle * bj_DEGTORAD)
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
call MoveLocation(GLOBALLOCATION,data.x2,data.y2)
set data.z2 = GetLocationZ(GLOBALLOCATION) + 35.
set data.p = GetOwningPlayer(data.c)
set data.l = AddLightningEx("FISB",true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
set data.id = GetPlayerId(data.p)
set data.dmg = BlzGetUnitBaseDamage(data.c,0)*0.0625* .3
//set IsChannelingRedLaser[GetUnitUserData(data.c)] = true
call SetTimerData(t,data)
call TimerStart(t,0.0625 ,false, function Handler)
set aa = aa + 45.
endloop
set u = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
scope CuddlySacrifice initializer OnInit
private struct NBind
unit u
real x
real y
effect fx
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if UnitAlive(u) and not BlzIsUnitInvulnerable(u) then
if IsUnitEnemy(u,GetOwningPlayer(GLOBAL_CASTER)) then
call UnitDamageTargetEx(GLOBAL_CASTER, u, BlzGetUnitMaxHP(u)*.2, false, false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
else
if not IsUnitType(u,UNIT_TYPE_HERO) then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(u)*1.25))
call BlzSetUnitBaseDamage(u,R2I(BlzGetUnitBaseDamage(u,0)*1.15),0)
call SetWidgetLife(u,GetWidgetLife(u)+ (BlzGetUnitMaxHP(u)/5) )
endif
endif
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", u, "origin") )
endif
return false
endfunction
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local NBind data = GetTimerData(t)
local effect fx
// call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.2))
set fx = AddSpecialEffect("war3mapImported\\Empyrean Nova Classic.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx, .8)
call DestroyEffect(fx)
set GLOBAL_CASTER = data.u
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,288.288,Filter(function FilterActions))
call data.destroy()
call ReleaseTimer(t)
set fx = null
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
local timer t
local NBind data
if GetUnitTypeId(u) == 'n02U' or GetUnitTypeId(u) == 'n02V' and GetOwningPlayer(u) != Player(PLAYER_NEUTRAL_PASSIVE) then
set t = NewTimer()
set data = NBind.create()
set data.u = u
set data.x = GetUnitX(u)
set data.y = GetUnitY(u)
set data.fx = AddSpecialEffect("war3mapImported\\Spell Marker TC.mdx",data.x,data.y)
call BlzSetSpecialEffectColorByPlayer(data.fx, Player(4))
call BlzSetSpecialEffectScale(data.fx, 2.)
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set u = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope FireWave initializer OnInit
globals
private constant integer SPELL_ID = 'A0RP'
private constant string EFFECT = "war3mapImported\\Airstrike Rocket.mdx"
private constant string ATTACH_POINT = "chest"
endglobals
private struct Temp2
unit c
real dmg
real x
real y
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct TempA
unit c
real dmg
real x
real y
real a
integer current
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( GLOBAL_CASTER ) ) and IsUnitType(u,UNIT_TYPE_HERO) then
call UnitDamageTargetEx(GLOBAL_CASTER ,u,BlzGetUnitMaxHP(u)*.0625*.1 ,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamageTargetEx(GLOBAL_CASTER, u, GLOBALDAMAGE, false, true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Temp2 data = GetTimerData(t)
set GLOBAL_CASTER = data.c
set GLOBALDAMAGE = data.dmg
call GroupEnumUnitsInRange( GLOBALGROUP, data.x, data.y, 125., Filter( function FilterActions ) )
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
local effect fx
local timer t2
local Temp2 data2
if data.current == 42 then
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 35. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 35. * Sin(data.a * bj_DEGTORAD)
set fx = AddSpecialEffect("war3mapImported\\Rain of Fire Vol. II.mdx",data.x,data.y)
//call MoveLocation(GLOBALLOCATION,data.x,data.y)
//call BlzSetSpecialEffectPitch(fx,180.*bj_DEGTORAD)
//call BlzSetSpecialEffectHeight(fx,GetLocationZ(GLOBALLOCATION)-2000.)
call DestroyEffect(fx)
set data2 = Temp2.create()
set data2.c = data.c
set data2.dmg = data.dmg
set data2.x = data.x
set data2.y = data.y
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2, 1., false, function Handler2)
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function Handler)
endif
set t2 =null
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local TempA data2 = TempA.create()
local timer t2
local real face
local real dx
local real dy
set dx = GetUnitX(GetSpellTargetUnit())
set dy = GetUnitY(GetSpellTargetUnit())
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set face = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
set data.x = data.x + 325. * Cos((face+90.) * bj_DEGTORAD)
set data.y = data.y + 325. * Sin((face+90.) * bj_DEGTORAD)
set data.x = data.x + 325. * Cos((face+180.) * bj_DEGTORAD)
set data.y = data.y + 325. * Sin((face+180.) * bj_DEGTORAD)
set data.a = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
set data.current = 0
set data.dmg = BlzGetUnitBaseDamage(data.c,0) * 0.0625 * .75
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.03125,false,function Handler)
set data2.c = GetTriggerUnit()
set face = GetUnitFacing(data2.c)
set data2.x = GetUnitX(data2.c) + 325. * Cos((face-90.) * bj_DEGTORAD)
set data2.y = GetUnitY(data2.c) + 325. * Sin((face-90.) * bj_DEGTORAD)
set data2.x = data2.x + 325. * Cos((face+180.) * bj_DEGTORAD)
set data2.y = data2.y + 325. * Sin((face+180.) * bj_DEGTORAD)
set dx = GetUnitX(GetSpellTargetUnit())
set dy = GetUnitY(GetSpellTargetUnit())
set data2.a = bj_RADTODEG * Atan2(dy - data2.y, dx - data2.x)
set data2.current = 0
set data2.dmg = BlzGetUnitBaseDamage(data2.c,0) * 0.0625
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,0.0625,false,function Handler)
set t2 = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope FlameDisc initializer OnInit
globals
private constant integer SPELL_ID = 'A0RQ'
unit FLAMEDISCCASTER = null
endglobals
private struct TM
real dur
unit u
unit t
real damage
real x
real y
//real yaw
effect fx1
//effect fx2
effect fx3
//effect fx4
method destroy takes nothing returns nothing
call DestroyEffect(this.fx1)
//call DestroyEffect(this.fx2)
call DestroyEffect(this.fx3)
//call DestroyEffect(this.fx4)
set this.fx1 = null
//set this.fx2 = null
set this.fx3 = null
//set this.fx4 = null
set this.u = null
set this.t = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(FLAMEDISCCASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not BlzIsUnitInvulnerable(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Airstrike Rocket.mdx",u,"chest"))
call UnitDamageTargetEx(FLAMEDISCCASTER,u,GLOBALDAMAGE,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
if IsUnitType(u,UNIT_TYPE_HERO) then
call UnitDamageTargetEx(FLAMEDISCCASTER,u,BlzGetUnitMaxHP(u)*.08*.0625,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
endif
set u = null
return false
endfunction
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and not BlzIsUnitInvulnerable(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)))
endfunction
private function HandlerA takes nothing returns nothing
local timer t = GetExpiredTimer()
local TM data = GetTimerData(t)
local real angle
local effect fx
if data.dur <= 0 or not UnitAlive(data.u) or data.u == null then
call ReleaseTimer(t)
call data.destroy()
else
set data.dur = data.dur - 0.0625
if UnitAlive(data.t) then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 15 * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 15 * Sin(angle * bj_DEGTORAD)
else
set GLOBAL_CASTER = data.u
set data.t = ZEE(null,data.x,data.y,3000.,(Condition(function FilterUnits2)))
if data.t != null then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 15 * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 15 * Sin(angle * bj_DEGTORAD)
endif
endif
//set data.yaw = data.yaw + 90.
set FLAMEDISCCASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,245.,Filter(function FilterActions))
set FLAMEDISCCASTER = null
call MoveLocation(GLOBALLOCATION,data.x,data.y)
call BlzSetSpecialEffectX(data.fx1,data.x)
call BlzSetSpecialEffectY(data.fx1,data.y)
call BlzSetSpecialEffectZ(data.fx1,GetLocationZ(GLOBALLOCATION) + 90.)
//call BlzSetSpecialEffectX(data.fx2,data.x)
//call BlzSetSpecialEffectY(data.fx2,data.y)
call BlzSetSpecialEffectX(data.fx3,data.x)
call BlzSetSpecialEffectY(data.fx3,data.y)
//call BlzSetSpecialEffectX(data.fx4,data.x)
//call BlzSetSpecialEffectY(data.fx4,data.y)
call BlzSetSpecialEffectZ(data.fx3,GetLocationZ(GLOBALLOCATION) + 90.)
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function HandlerA)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TM data
set data = TM.create()
set t = NewTimer()
set data.u = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
set data.damage = BlzGetUnitBaseDamage(data.u,0) * 0.0625 *.25
set data.dur = 10.
set data.x = GetUnitX(data.u)
set data.y = GetUnitY(data.u)
set GLOBAL_CASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,245.,Filter(function FilterActions))
call MoveLocation(GLOBALLOCATION,data.x,data.y)
set data.fx1 = AddSpecialEffect("war3mapImported\\Blood Lust Target.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(data.fx1,1.75)
//call BlzSetSpecialEffectYaw(data.fx1,data.yaw*bj_DEGTORAD)
call BlzSetSpecialEffectScale(data.fx1,2.25)
call BlzSetSpecialEffectZ(data.fx1,GetLocationZ(GLOBALLOCATION) + 90.)
//set data.fx2 = AddSpecialEffect("war3mapImported\\Blood Lust Target.mdx",data.x,data.y)
//call BlzSetSpecialEffectTimeScale(data.fx2,1.25)
//call BlzSetSpecialEffectYaw(data.fx2,data.yaw*bj_DEGTORAD)
//call BlzSetSpecialEffectScale(data.fx2,2.5)
set data.fx3 = AddSpecialEffect("war3mapImported\\Blood Lust Target.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(data.fx1,3.75)
//call BlzSetSpecialEffectYaw(data.fx3,data.yaw*bj_DEGTORAD)
call BlzSetSpecialEffectScale(data.fx3,2.25)
call BlzSetSpecialEffectZ(data.fx3,GetLocationZ(GLOBALLOCATION) + 90.)
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function HandlerA)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope NightmareWeb initializer OnInit
globals
private constant integer SPELL_ID = 'A0S2'
unit NIGHTMAREWEBCASTER= null
endglobals
private struct TM
real dur
unit u
unit t
real damage
real x
real y
//real yaw
effect fx1
//effect fx2
effect fx3
//effect fx4
method destroy takes nothing returns nothing
call DestroyEffect(this.fx1)
//call DestroyEffect(this.fx2)
call DestroyEffect(this.fx3)
//call DestroyEffect(this.fx4)
set this.fx1 = null
//set this.fx2 = null
set this.fx3 = null
//set this.fx4 = null
set this.u = null
set this.t = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(NIGHTMAREWEBCASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not BlzIsUnitInvulnerable(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Airstrike Rocket.mdx",u,"chest"))
call UnitDamageTargetEx(NIGHTMAREWEBCASTER,u,GLOBALDAMAGE,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
if IsUnitType(u,UNIT_TYPE_HERO) then
call UnitDamageTargetEx(NIGHTMAREWEBCASTER,u,BlzGetUnitMaxHP(u)*.08*.0625,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
endif
set u = null
return false
endfunction
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and not BlzIsUnitInvulnerable(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)))
endfunction
private function HandlerA takes nothing returns nothing
local timer t = GetExpiredTimer()
local TM data = GetTimerData(t)
local real angle
local effect fx
if data.dur <= 0 or not UnitAlive(data.u) or data.u == null then
call ReleaseTimer(t)
call data.destroy()
else
set data.dur = data.dur - 0.0625
if UnitAlive(data.t) then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 15 * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 15 * Sin(angle * bj_DEGTORAD)
else
set GLOBAL_CASTER = data.u
set data.t = ZEE(null,data.x,data.y,3000.,(Condition(function FilterUnits2)))
if data.t != null then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 15 * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 15 * Sin(angle * bj_DEGTORAD)
endif
endif
//set data.yaw = data.yaw + 90.
set NIGHTMAREWEBCASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,275.,Filter(function FilterActions))
set NIGHTMAREWEBCASTER = null
call MoveLocation(GLOBALLOCATION,data.x,data.y)
call BlzSetSpecialEffectX(data.fx1,data.x)
call BlzSetSpecialEffectY(data.fx1,data.y)
call BlzSetSpecialEffectZ(data.fx1,GetLocationZ(GLOBALLOCATION) + 90.)
//call BlzSetSpecialEffectX(data.fx2,data.x)
//call BlzSetSpecialEffectY(data.fx2,data.y)
call BlzSetSpecialEffectX(data.fx3,data.x)
call BlzSetSpecialEffectY(data.fx3,data.y)
//call BlzSetSpecialEffectX(data.fx4,data.x)
//call BlzSetSpecialEffectY(data.fx4,data.y)
call BlzSetSpecialEffectZ(data.fx3,GetLocationZ(GLOBALLOCATION) + 90.)
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function HandlerA)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TM data
set data = TM.create()
set t = NewTimer()
set data.u = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
set data.damage = BlzGetUnitBaseDamage(data.u,0) * 0.0625 *.25
set data.dur = 10.
set data.x = GetUnitX(data.u)
set data.y = GetUnitY(data.u)
set GLOBAL_CASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,275.,Filter(function FilterActions))
call MoveLocation(GLOBALLOCATION,data.x,data.y)
set data.fx1 = AddSpecialEffect("war3mapImported\\Void Rift Purple.mdl",data.x,data.y)
call BlzSetSpecialEffectTimeScale(data.fx1,1.75)
//call BlzSetSpecialEffectYaw(data.fx1,data.yaw*bj_DEGTORAD)
call BlzSetSpecialEffectScale(data.fx1,2.25)
call BlzSetSpecialEffectZ(data.fx1,GetLocationZ(GLOBALLOCATION) + 90.)
//set data.fx2 = AddSpecialEffect("war3mapImported\\Blood Lust Target.mdx",data.x,data.y)
//call BlzSetSpecialEffectTimeScale(data.fx2,1.25)
//call BlzSetSpecialEffectYaw(data.fx2,data.yaw*bj_DEGTORAD)
//call BlzSetSpecialEffectScale(data.fx2,2.5)
//set data.fx3 = AddSpecialEffect("war3mapImported\\Blood Lust Target.mdx",data.x,data.y)
//call BlzSetSpecialEffectTimeScale(data.fx1,3.75)
//call BlzSetSpecialEffectYaw(data.fx3,data.yaw*bj_DEGTORAD)
//call BlzSetSpecialEffectScale(data.fx3,2.25)
//call BlzSetSpecialEffectZ(data.fx3,GetLocationZ(GLOBALLOCATION) + 90.)
call SetTimerData(t,data)
call TimerStart(t,0.0625,false,function HandlerA)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope PhaseShift initializer OnInit
globals
private constant integer SPELL_ID = 'Apsh'
endglobals
private struct TempA
unit c
//real dmg
//real x
//real y
//real a
//effect fx1
//effect fx2
//effect fx3
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
return data
endmethod
method destroy takes nothing returns nothing
set this.c = null
// set this.fx1 = null
// set this.fx2 = null
//set this.fx3 = null
call this.deallocate()
endmethod
endstruct
/*
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
//call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
*/
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 5 then
call ReleaseTimer(t)
call data.destroy()
else
if M5E(data.c) then
if GetUnitTypeId(data.c) == 'n03D' then
call SGE('h026',GetUnitX(data.c),GetUnitY(data.c),GetUnitFacing(data.c),.75,"spell",1.0)
else
call SGE('h027',GetUnitX(data.c),GetUnitY(data.c),GetUnitFacing(data.c),.75,"spell",1.0)
endif
endif
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.15,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
set data.c = GetTriggerUnit()
set data.current = 0
call M6E(data.c,450.,.75,GetUnitFacing(data.c)-180.,"war3mapImported\\SpiritWalkerChange3.mdx",.0,true,true)
if GetUnitTypeId(data.c) == 'n03D' then
call SGE('h026',GetUnitX(data.c),GetUnitY(data.c),GetUnitFacing(data.c),.75,"spell",1.0)
else
call SGE('h027',GetUnitX(data.c),GetUnitY(data.c),GetUnitFacing(data.c),.75,"spell",1.0)
endif
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope LayWaste initializer OnInit
globals
private constant integer SPELL_ID = 'A0RG'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
endglobals
native UnitAlive takes unit id returns boolean
private struct RoD
unit c
real x
real y
integer dur
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct RoD2
real x
real y
effect fx
unit c
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local integer id
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not BlzIsUnitInvulnerable(u) then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",GetUnitX(u),GetUnitY(u)))
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamageTargetEx(CASTER,u,BlzGetUnitMaxHP(u)*.2,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD2 data2 = GetTimerData(t)
set CASTER = data2.c
set DAMAGE = BlzGetUnitBaseDamage(CASTER,0)*.5
call GroupEnumUnitsInRange(GROUP,data2.x,data2.y,190.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",data2.x,data2.y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Singularity I Purple.mdx",data2.x,data2.y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Discharge Purple.mdx",data2.x,data2.y))
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD data = GetTimerData(t)
local timer t2
local RoD2 data2
local effect fx
if data.dur <=0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - 1
set data2=RoD2.create()
set data2.c = data.c
set data2.x = data.x+GetRandomReal(-800.,800.)
set data2.y = data.y+GetRandomReal(-800.,800.)
set data2.fx = AddSpecialEffect("war3mapImported\\Spell Marker Red.mdx",data2.x,data2.y)
call BlzSetSpecialEffectScale(data2.fx,1.25)
set t2= NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,1.,false,function Handler2)
//set fx = AddSpecialEffect("war3mapImported\\Rain of Fire.mdx",data2.x,data2.y)
set fx = AddSpecialEffect("war3mapImported\\RocketRain.mdx",data2.x,data2.y)
call BlzSetSpecialEffectScale(fx,2.5)
call DestroyEffect(fx)
call TimerStart(t,.3,false,function Handler)
endif
set fx = null
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local RoD data = RoD.create()
set data.c = GetTriggerUnit()
set data.x = GetUnitX(GetSpellTargetUnit())
set data.y = GetUnitY(GetSpellTargetUnit())
if GetOwningPlayer(data.c) == Player(10) or GetOwningPlayer(data.c) == Player(12) then
if ScreamStacks[0] > 200 then
set data.dur = 30 + ((ScreamStacks[0]-200)/20)
else
set data.dur = 30
endif
else
if GetOwningPlayer(data.c) == Player(11) or GetOwningPlayer(data.c) == Player(13) then
if ScreamStacks[1] > 200 then
set data.dur = 30 + ((ScreamStacks[1]-200)/20)
else
set data.dur = 30
endif
endif
endif
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TripleStrike initializer OnInit
globals
private constant integer SPELL_ID = 'A0O4'
private constant integer SPELL_ID2 = 'A0MI'
integer array TripleStrike
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit d
local player p
if GetUnitAbilityLevel(u,SPELL_ID)==1 and u != GetTriggerUnit() and Damage_IsAttack() and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) then
if TripleStrike[GetUnitUserData(u)] > 0 then
set TripleStrike[GetUnitUserData(u)] = TripleStrike[GetUnitUserData(u)] - 1
if TripleStrike[GetUnitUserData(u)] == 0 then
call UnitRemoveAbility(u,SPELL_ID2)
call BlzSetUnitAttackCooldown(u,6.25,0)
call BlzSetUnitAttackCooldown(u,6.25,1)
endif
else
set TripleStrike[GetUnitUserData(u)] = 2
call UnitAddAbility(u,SPELL_ID2)
call UnitMakeAbilityPermanent(u,true,SPELL_ID2)
call BlzSetUnitAttackCooldown(u,.35,0)
call BlzSetUnitAttackCooldown(u,.35,1)
endif
if (GetRandomInt(0,99) <= 14) then
set p = GetOwningPlayer(u)
if p == Player(10) then
set p = Player(12)
else
if p==Player(11) then
set p = Player(13)
endif
endif
set d = CreateUnit(p,'h007',GetUnitX(u),GetUnitY(u),0.)
if TRUEENFOS then
call UnitAddAbility(d,'A0O3')
else
call UnitAddAbility(d,'A0OD')
endif
call IssueTargetOrderById(d,852095,GetTriggerUnit())
call UnitApplyTimedLife(d,'BTLF',1.)
endif
endif
set p = null
set d = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope NuclearOption initializer OnInit
globals
private constant integer SPELL_ID = 'A0KR'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit c
local player p
set p = GetOwningPlayer(u)
if p == Player(10) then
set p = Player(12)
else
if p==Player(11) then
set p = Player(13)
endif
endif
set c = CreateUnit(p,'h007',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitAddAbility(c,'A084')
call IssuePointOrderById(c,852652,GetSpellTargetX(),GetSpellTargetY())
call UnitApplyTimedLife(c,'BTLF',4.)
set p = null
set c = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
library SpiderPoison requires TimerUtils
private struct SP
unit c
unit t
integer i
effect fx
method destroy takes nothing returns nothing
set this.c = null
set this.t = null
call DestroyEffect(this.fx)
set this.fx = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local SP data = GetTimerData(t)
if data.i <= 0 then
call ReleaseTimer(t)
call data.destroy()
else
if TRUEENFOS then
if RANDOMWAVEON then
call UnitDamageTarget(data.c,data.t,COMMANDERRANDOMDAMAGE[PC]*.075,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTarget(data.c,data.t,125.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
else
if RANDOMWAVEON then
call UnitDamageTarget(data.c,data.t,COMMANDERRANDOMDAMAGE[PC]*.02,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTarget(data.c,data.t,50.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
endfunction
public function PoisonUnit takes unit c, unit tar returns nothing
local SP data = SP.create()
local timer t = NewTimer()
set data.c = c
set data.t = tar
set data.fx = AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\CorrosiveBreath\\ChimaeraAcidTargetArt.mdl",data.t,"chest")
set data.i = 5
call SetTimerData(t,data)
call TimerStart(t,01,false,function Handler)
set t = null
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CreepEvasion80 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A04H')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 80 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitTypeId(a) != 'h00L' and GetUnitTypeId(a) != 'h01Q' and GetUnitTypeId(a) != 'h01T' and GetUnitAbilityLevel(a,'A026') == 0 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=50 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=50 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CreepEvasion15 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'ACev')==1 and GetUnitAbilityLevel(a,'A026') == 0 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 15 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitTypeId(a) != 'h01Q' and GetUnitTypeId(a) != 'h01T' then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=50 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=50 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CurseMiss initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(a,'Bcrs')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 66 and GetUnitAbilityLevel(a,'A026') == 0 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
// set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
// set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope AlwaysBerserk initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetAttacker()
if GetUnitAbilityLevel(u,'Absk') == 1 and GetUnitAbilityLevel(u,'Bbsk') != 1 then
call IssueImmediateOrderById(u,852100)
endif
if GetUnitAbilityLevel(u,'A0KQ') == 1 and GetUnitAbilityLevel(u,'Bbsk') != 1 then
call IssueImmediateOrderById(u,852561)
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
library SetPathing initializer OnInit
globals
public trigger AggroTrigger
group PATHING_GROUP = CreateGroup()
//private triggercondition AggroTriggerCondition
private group swap=CreateGroup()
private group temp
endglobals
function SetPathing takes nothing returns boolean
local unit u = GetTriggerUnit()
local unit FoG
if GetUnitAbilityLevel(u,'Bbsk') != 1 and GetUnitAbilityLevel(u,'B02M') != 1 then
call SetUnitPathing(u,true)
endif
if GetUnitAbilityLevel(u,'A023') == 1 then
call IssuePointOrderById(u,852555,GetUnitX(GetEventTargetUnit()),GetUnitY(GetEventTargetUnit()))
endif
// if GetUnitAbilityLevel(u,'A0K9') == 1 then
// call IssueTargetOrderById(u,852601,GetEventTargetUnit())
//endif
// if GetUnitAbilityLevel(u,'A0O1') == 1 then
// call IssueImmediateOrderById(u,852520)
//endif
//call BJDebugMsg("Pathing set to true")
//call TriggerRemoveCondition(AggroTrigger, AggroTriggerCondition)
//set AggroTriggerCondition = null
call DestroyTrigger(AggroTrigger)
call GroupRemoveUnit(PATHING_GROUP,u)
set AggroTrigger = CreateTrigger()
//set AggroTriggerCondition =
call TriggerAddCondition(AggroTrigger,function SetPathing)
loop
set FoG=FirstOfGroup(PATHING_GROUP)
exitwhen FoG==null
call TriggerRegisterUnitEvent(AggroTrigger,FoG,EVENT_UNIT_ACQUIRED_TARGET)
call TriggerRegisterUnitEvent(AggroTrigger,FoG,EVENT_UNIT_TARGET_IN_RANGE )
call GroupAddUnit(swap,FoG)
call GroupRemoveUnit(PATHING_GROUP,FoG)
endloop
set temp=PATHING_GROUP
set PATHING_GROUP=swap
set swap=temp
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set AggroTrigger=CreateTrigger()
//set AggroTriggerCondition =
call TriggerAddCondition(AggroTrigger,function SetPathing)
endfunction
endlibrary
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope Leapy initializer OnInit
globals
private unit CASTER
private real DAMAGE
private real XX
private real YY
private constant group GROUP = CreateGroup()
endglobals
private struct Leapy
unit c
unit t
real d
real h
effect fx
effect fx2
method destroy takes nothing returns nothing
set this.c = null
set this.t = null
call DestroyEffect(this.fx)
call DestroyEffect(this.fx2)
//call BJDebugMsg("destroyed")
set this.fx = null
set this.fx2 = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real d = 100.
if TRUEENFOS then
set d = 300.
endif
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetUnitTypeId(u) != 'H00B' then
call UnitDamageTargetEx(CASTER,u,DAMAGE + BlzGetUnitMaxHP(u)*.15,false,true,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",u,"chest"))
if not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and GetUnitTypeId(u) != 'E00E' and not BlzIsUnitInvulnerable(u) then
call M6E(u,d,.75,bj_RADTODEG * Atan2(GetUnitY(u) - YY, GetUnitX(u) - XX),"war3mapImported\\Dust.mdx",.0,true,true)
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Leapy data = GetTimerData(t)
//call BJDebugMsg(R2S(data.h))
if data.d >= .6 then
call SetUnitFlyHeight(data.c,0.,0.0)
if GetUnitTypeId(data.c)=='h00S'then
//call BJDebugMsg("happened")
call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Massacre.mdx",GetUnitX(data.c),GetUnitY(data.c)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX-Special.mdx",GetUnitX(data.c),GetUnitY(data.c)))
endif
call IssueTargetOrder(data.c,"attack",data.t)
if TRUEENFOS then
call AddUnitBonusTimed(data.c,BONUS_ATTACK_SPEED,(1.2*(XT-2)),2.)
call AddUnitBonusTimed(data.c,BONUS_MOVEMENT_SPEED,(120.+((XT-3)*30.)),3.)
else
call AddUnitBonusTimed(data.c,BONUS_ATTACK_SPEED,(.75*(XT-2)),2.)
call AddUnitBonusTimed(data.c,BONUS_MOVEMENT_SPEED,(60.*(XT-2)),3.)
endif
if (TRUEENFOS and GetUnitTypeId(data.c)=='e00Z') or GetUnitTypeId(data.c)=='e01S' or GetUnitTypeId(data.c)=='n02I' or GetUnitTypeId(data.c)=='n02J' then
set CASTER = data.c
if TRUEENFOS then
set DAMAGE = BlzGetUnitBaseDamage(data.c,0)*1.5
else
set DAMAGE = BlzGetUnitBaseDamage(data.c,0)*.75
endif
set XX = GetUnitX(data.c)
set YY = GetUnitY(data.c)
call GroupEnumUnitsInRange(GROUP,XX,YY,256.,Filter(function FilterActions))
if GetUnitTypeId(data.c)=='n02I' or GetUnitTypeId(data.c)=='n02J' then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Empyrean Nova Classic.mdx",XX,YY))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewDirtEXNofire.mdx",XX,YY))
endif
endif
call data.destroy()
call ReleaseTimer(t)
else
if data.d < .48 then
set data.h = data.h + 6
call SetUnitFlyHeight(data.c,data.h,0.0)
else
set data.h = data.h - 24
call SetUnitFlyHeight(data.c,data.h,0.0)
endif
set data.d = data.d + .01
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Leapy data
local real d = 0
local real a = 0
local real cx = 0
local real cy = 0
local real tx =0
local real ty =0
local real dx =0
local real dy = 0
local real x = 0
local real y = 0
local real a2 = 0
local player p
if (((not TRUEENFOS and GetRandomInt(0,100) >= 65)or (TRUEENFOS and GetRandomInt(0,100) >= 33)) and (GetUnitTypeId(GetTriggerUnit())=='n02E')) or (((not TRUEENFOS and GetRandomInt(0,100) >= 90)or (TRUEENFOS and GetRandomInt(0,100) >= 33)) and (GetUnitTypeId(GetTriggerUnit())=='n03M')) and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER then
set t = NewTimer()
set data = Leapy.create()
set data.c = GetTriggerUnit()
set a2 = GetUnitFacing(data.c)
set p = GetOwningPlayer(data.c)
set x = GetUnitX(data.c) + 45. * Cos(a2 * bj_DEGTORAD)
set y = GetUnitY(data.c) + 45. * Sin(a2 * bj_DEGTORAD)
set data.c = null
set data.c = CreateUnit(p,'h00S',x,y,a2)
call SetUnitPropWindow(data.c,0.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX-Special.mdx",x,y))
set data.t = GetSpellTargetUnit()
set cx = GetUnitX(data.c)
set cy = GetUnitY(data.c)
set tx = GetUnitX(data.t)
set ty = GetUnitY(data.t)
set a = bj_RADTODEG * Atan2(ty - cy, tx - cx)
set dx = tx - cx
set dy = ty - cy
if GetUnitTypeId(data.c)=='n03Q'or GetUnitTypeId(data.c)=='n03S'then
set d =(SquareRoot(dx * dx + dy * dy)) + 180.
else
set d =(SquareRoot(dx * dx + dy * dy)) + 80.
endif
call UnitAddAbility(data.c,'Amrf')
call UnitRemoveAbility(data.c,'Amrf')
set data.fx = AddSpecialEffectTarget("war3mapImported\\Carrion Bat Blood HD.mdx",data.c,"chest")
call M6E(data.c,d,.6,a,"none.mdl",.0,true,false)
set data.d =.01
set data.h = 6
call SetUnitFlyHeight(data.c,data.h,0.0)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
else
set t = NewTimer()
set data = Leapy.create()
set data.c = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
set cx = GetUnitX(data.c)
set cy = GetUnitY(data.c)
set tx = GetUnitX(data.t)
set ty = GetUnitY(data.t)
call UnitAddAbility(data.c,'Amrf')
call UnitRemoveAbility(data.c,'Amrf')
set a = bj_RADTODEG * Atan2(ty - cy, tx - cx)
set dx = tx - cx
set dy = ty - cy
set d =(SquareRoot(dx * dx + dy * dy)) + 80.
call M6E(data.c,d,.6,a,"none.mdl",.0,true,false)
if GetUnitTypeId(data.c)=='n02E' or GetUnitTypeId(data.c)=='n00S' or GetUnitTypeId(data.c)=='n030' or GetUnitTypeId(data.c)=='n01U' or GetUnitTypeId(data.c)=='u00Q' or GetUnitTypeId(data.c)=='u00P' or GetUnitTypeId(data.c)=='n02G' or GetUnitTypeId(data.c)=='n02O' or GetUnitTypeId(data.c)=='n02P' or GetUnitTypeId(data.c)=='e00Z' or GetUnitTypeId(data.c)=='e01S' or GetUnitTypeId(data.c)=='n03Q' or GetUnitTypeId(data.c)=='n03S' or GetUnitTypeId(data.c)=='n02Z' or GetUnitTypeId(data.c)=='n03M' or GetUnitTypeId(data.c)=='n02I' or GetUnitTypeId(data.c)=='n02J' then
if GetUnitTypeId(data.c)=='n02E' or GetUnitTypeId(data.c)=='n030' or GetUnitTypeId(data.c)=='u00Q'or GetUnitTypeId(data.c)=='n02G' or GetUnitTypeId(data.c)=='n02O' or GetUnitTypeId(data.c)=='n02P' or GetUnitTypeId(data.c)=='n03Q' or GetUnitTypeId(data.c)=='n02Z' or GetUnitTypeId(data.c)=='n03M' then
set data.fx = AddSpecialEffectTarget("war3mapImported\\Carrion Bat Blood HD.mdx",data.c,"chest")
endif
if GetUnitTypeId(data.c)=='e00Z' or GetUnitTypeId(data.c)=='e01S' then
set data.fx = AddSpecialEffectTarget("war3mapImported\\Valiant Charge.mdx",data.c,"chest")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Fire.mdx",data.c,"chest")
endif
if GetUnitTypeId(data.c)=='n02I' or GetUnitTypeId(data.c)=='n02J' then
set data.fx = AddSpecialEffectTarget("war3mapImported\\Sacred Exile.mdx",data.c,"chest")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\HolySpiral.MDX",data.c,"chest")
endif
if GetUnitTypeId(data.c)=='n00S' or GetUnitTypeId(data.c)=='n01U' or GetUnitTypeId(data.c)=='u00P' or GetUnitTypeId(data.c)=='n03S' then
if GetRandomInt(0,100) >= 50 then
set data.fx = AddSpecialEffectTarget("war3mapImported\\Carrion Bat Avocado HD.mdx",data.c,"chest")
else
set data.fx = AddSpecialEffectTarget("war3mapImported\\Carrion Bat Jade HD.mdx",data.c,"chest")
endif
endif
else
set data.fx = AddSpecialEffectTarget("Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl",data.c,"chest")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\SlideWater.mdx",data.c,"chest")
endif
set data.d =.01
set data.h = 6
call SetUnitFlyHeight(data.c,data.h,0.0)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set p = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0K9', function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AlwaysLeap2 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetAttacker()
local unit t = GetTriggerUnit()
if GetUnitAbilityLevel(a,'A0K9') == 1 then
call IssueTargetOrderById(a,852601,t)
endif
if GetUnitAbilityLevel(a,'A023') == 1 then
call IssuePointOrderById(a,852555,GetUnitX(t),GetUnitY(t))
endif
if GetUnitAbilityLevel(a,'A0O1') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(a,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(a,852520)
endif
endif
endif
if GetUnitAbilityLevel(a,'A0PH') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(a,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(a,852520)
endif
endif
endif
if GetUnitAbilityLevel(a,'A0RO') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(a,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(a,852520)
endif
endif
endif
if GetUnitAbilityLevel(t,'A0K9') == 1 then
call IssueTargetOrderById(t,852601,a)
endif
if GetUnitAbilityLevel(t,'A023') == 1 then
call IssuePointOrderById(t,852555,GetUnitX(a),GetUnitY(a))
endif
if GetUnitAbilityLevel(t,'A0O1') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(t,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(t,852520)
endif
endif
endif
if GetUnitAbilityLevel(a,'A0RP') == 1 then//and GetUnitCurrentOrder(a) != 852074 and GetUnitCurrentOrder(a) != 852601 then
call IssueTargetOrderById(a,852601,t)
endif
set t = null
set a = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition(t, function Actions )
set t = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AlwaysLeapTwice initializer OnInit
private function Actions takes nothing returns boolean
local unit t = GetTriggerUnit()
local real dx
local real dy
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(t,'A0K9') == 1 then
call IssueTargetOrderById(t,852601,u)
endif
if GetUnitAbilityLevel(t,'A023') == 1 then
call IssuePointOrderById(t,852555,GetUnitX(u),GetUnitY(u))
endif
if GetUnitAbilityLevel(t,'A0O1') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(t,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(t,852520)
endif
endif
endif
if GetUnitAbilityLevel(t,'A0PH') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(t,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(t,852520)
endif
endif
endif
if GetUnitAbilityLevel(t,'A0RO') == 1 then
if TRUEENFOS then
call IssueImmediateOrderById(t,852520)
else
if GetRandomInt(0,99) <= 30 then
call IssueImmediateOrderById(t,852520)
endif
endif
endif
if GetUnitAbilityLevel(t,'A0RR') == 1 then
call IssueImmediateOrderById(t,852520)
endif
if GetUnitAbilityLevel(t,'A0RQ') == 1 then//and GetUnitCurrentOrder(t) != 852074 and GetUnitCurrentOrder(t) != 852601 then
set dx = GetUnitX(u) - GetUnitX(t)
set dy = GetUnitY(u) - GetUnitY(t)
if SquareRoot(dx * dx + dy * dy) >600. then
call IssueTargetOrderById(t,852074,u)
else
call IssueTargetOrderById(t,852601,u)
endif
endif
set u = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=99
//TESH.alwaysfold=0
scope RainOfFireWave21 initializer OnInit
globals
private constant integer SPELL_ID = 'A023'
endglobals
private function Actions takes nothing returns nothing
local unit u
local unit t = GetTriggerUnit()
local player p = GetOwningPlayer(t)
if p == Player(10) then
set p = Player(12)
else
if p==Player(11) then
set p = Player(13)
endif
endif
set u = CreateUnit(p,'h007',GetUnitX(t),GetUnitY(t),0.)
call UnitAddAbility(u,'A01N')
call IssuePointOrderById(u,852238,GetSpellTargetX(),GetSpellTargetY())
call UnitApplyTimedLife(u,'BTLF',6.1)
set u = null
set p = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TankAntistuck initializer OnInit
private function Actions takes nothing returns boolean
local unit t = GetTriggerUnit()
if GetUnitTypeId(t)=='h00B' and (GetUnitCurrentOrder(t) == 852580 or GetUnitCurrentOrder(t) == 852592 or GetUnitCurrentOrder(t) == 852232) then
call IssueImmediateOrderById(t,851972)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AlwaysDeathBolt initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetAttacker()
if (GetUnitTypeId(a) == 'n03C' or (GetUnitTypeId(a) == 'n03B' and GetRandomInt(0,100) >= 50 and not TRUEENFOS)or(GetUnitTypeId(a) == 'n03B' and TRUEENFOS))then
if GetUnitCurrentOrder(a) != 852230 then
call IssueTargetOrderById(a,852230,GetTriggerUnit())
endif
endif
set a = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition(t, function Actions )
set t = null
endfunction
endscope
//TESH.scrollpos=406
//TESH.alwaysfold=0
//===========================================================================
//A spell that creates a Green Paradise. This paradise spawns friendly trees
//and ancients to aid you. While inside the paradise, friendly units also get
//extra abilities. The weaker the tree, the more chances it has to be spawned.
//
//Requires TimerUtils and Table
//
//@author Flame_Phoenix
//
//@credits
//- the-thingy, Kyrbi0, Pyrogasm, Anitarf
//- My first teacher of vJASS: Blue_Jeans
//- All other people I forgot or ignored
//
//@version 1.6
//===========================================================================
scope ForestCall initializer Init
//This will be needed for spell's core, don't change
private keyword treeChances
private keyword treeType
private keyword TREE_POOLS
//===========================================================================
//=============================SETUP START===================================
//===========================================================================
globals
private constant integer AID = 'A034' //the rawcode of the ability
private constant string ANIMATION = "attack" //the animation that will be played when the unit is created
private constant integer MAX_TYPES = 3 //The maximum number of unit types of the spell
private constant integer MAX_LEVELS = 3 //the maximum number of levels of the spell
private constant integer ARRAY_SIZE = 4 //MAX_TYPES + 1. This will be needed for the spell's core, and is important that is correct.
// private constant integer FOREST_AURA = 'A004'
endglobals
//===========================================================================
//============================TREE SETUP=====================================
//===========================================================================
private function TreeCalibration takes nothing returns nothing
//here we type all types of units this spell can have
//in this case I use 6 types of units
set treeType[1] = 'e008' //Treant
set treeType[2] = 'e007' //Ancient Protector
set treeType[3] = 'e009' //Tree of Life
//Here we type the chances that each unit has to be spawned
//Note that the chances start in 0 and go to 1.0
//All chances together must be equal to 1.0, for the spell to work
//properly.
//level 1 chances
set treeChances[1][1] = 0.5
set treeChances[1][2] = 0.3
set treeChances[1][3] = 0.2
//level 2 chances
set treeChances[2][1] = 0.4
set treeChances[2][2] = 0.3
set treeChances[2][3] = 0.3
//level 3 chances
set treeChances[3][1] = 0.3
set treeChances[3][2] = 0.3
set treeChances[3][3] = 0.4
//PS: note that in all levels, if we sum the chances, we ALWAYS get 1
endfunction
private constant function TreeLife takes integer level returns real
//the amount of time each tree will have, if ChannelTrees() is false
return 60.
endfunction
private constant function ChannelTrees takes integer level returns boolean
//if true it will make all spawned trees die when the caster stops the channel
//if false, it allows the trees to have TreeLife() seconds of life and they
//will not die when the caster stops the channel
//in this case my trees have die when the channel stops in levels 1 and 2, but
//in level 3 they get 30 seconds of life.
return false
endfunction
private constant function TreesPerCycle takes integer level returns integer
//the number of trees that will be created each cycle
return 1 + (level * 0)
endfunction
private constant function Cycle takes integer level returns real
//the cycle which will determine when we create trees
//this means, TreesPerCycle() trees are created every cycle
//in this case, we create 1 tree per second (in this case a second
//is a cycle)
return .25
endfunction
//===========================================================================
//============================EFFECT SETUP===================================
//===========================================================================
private constant function DummyEffectId takes integer level returns integer
//the rawcode of the dummy unit that will be effect
//this is in a function so you can have different effects in different
//levels
return 'h017'
endfunction
private constant function MinRange takes integer level returns real
//in this case we don't have a minimum range, which means we can
//create trees at the center of the circle
//the minimum range is smaller circle, inside the area of the spell
//in which trees will not be created
return 0.
endfunction
private constant function MaxRange takes integer level returns real
//this ensures trees are not created outside the AOE of the spell
//this gives the AOE of the spell. This is the max AOE of the spell.
return 300. + (level * 0)
endfunction
private constant function CircleCount takes integer level returns integer
//the number of circles that will be created to give the illusion of the effect
//effect. The more circles the more realistic, but more CPU will be needed.
return 3 + level
endfunction
private constant function InnerCyrcleUnits takes integer level returns integer
//the number of units that the most inner circle will have
return level + 5
endfunction
private constant function InnerCyrcleUnitsIncrease takes integer level returns integer
//the increment of units per circle
return 0
endfunction
//===========================================================================
//=============================SETUP END=====================================
//===========================================================================
type chancesPerTreeType extends real array[ARRAY_SIZE]
globals
private group TreeInvocationCasters
private hashtable activeTable
private chancesPerTreeType array treeChances
private integer array treeType
private unitpool array TREE_POOLS
endglobals
private struct MyStruct
unit caster
integer level
timer cycleTimer
real spellLocX
real spellLocY
group dummyEffects
group trees
static method create takes unit caster, real locX, real locY returns MyStruct
local MyStruct data = MyStruct.allocate()
//set variables about the caster
set data.caster = caster
set data.level = GetUnitAbilityLevel(data.caster, AID)
//variables about the location
set data.spellLocX = locX
set data.spellLocY = locY
//the timer which will determine when we create trees
//creates a treeeverytime it expires
set data.cycleTimer = NewTimer()
//This groups will save the dumy effect effects, so we can kill them
//when the caster stops the channeling
set data.dummyEffects = CreateGroup()
//if we want the trees to die when the caster stops channel
//then we create this group so we can add all trees to it
//then we kill the trees when the caster stops the channel
if (ChannelTrees(data.level)) then
set data.trees = CreateGroup()
endif
return data
endmethod
method onDestroy takes nothing returns nothing
//here we select all units from the effect group and we kill them all ! =P
//thus meaning that the effect effects will disappear !
local unit f
loop
set f = FirstOfGroup(.dummyEffects)
exitwhen(f == null)
call GroupRemoveUnit(.dummyEffects, f)
call KillUnit(f)
endloop
//if the variable is true, then trees group was created and it has
//units, and so now we kill them all.
if (ChannelTrees(.level)) then
loop
set f = FirstOfGroup(.trees)
exitwhen(f == null)
call GroupRemoveUnit(.trees, f)
call KillUnit(f)
endloop
call DestroyGroup(.trees)
endif
//since the spell is not active anymore, we clean the Table
call FlushChildHashtable(activeTable,GetHandleId(.caster))
//the units are not anymore in the active units group.
call GroupRemoveUnit(TreeInvocationCasters, .caster)
//releasing the timer for TimerUitls to use one day later =D
call ReleaseTimer(.cycleTimer)
call DestroyGroup(.dummyEffects)
endmethod
endstruct
//===========================================================================
private function onStop takes nothing returns boolean
local MyStruct data
local unit u = GetTriggerUnit()
//when a unit stops the channel, we verify if that unit is inside the
//catsers group. If so, than it is because it is our caster casting this spell
//and so we recover information about him and we make the spell end
if(IsUnitInGroup(u, TreeInvocationCasters)) then
//recover the data from the caster
set data = LoadInteger(activeTable,GetHandleId(u),0)
//now, time to clean the mess once again
call data.destroy()
endif
set u = null
return false
endfunction
//===========================================================================
//Function made by Themerion and adapted by Flame_Phoenix
//Creates circles of dummy units to give the illusion of the effect effect
private function createGreenEffect takes integer aStruct returns nothing
local MyStruct data = aStruct
// forPlayer -> Create the units for which player?
local player forPlayer = GetOwningPlayer(data.caster)
// innerRadius -> The radius of the innermost circle
// outerRadius -> The radius of the outmost circle
local real innerRadius = MinRange(data.level)
local real outerRadius = MaxRange(data.level)
// x and y -> Center of circles
local real x = data.spellLocX
local real y = data.spellLocY
local real radiusInc = (outerRadius - innerRadius) / I2R(CircleCount(data.level)-1)
//see functions they call
local integer fxcount = InnerCyrcleUnits(data.level)
local integer fxcountinc = InnerCyrcleUnitsIncrease(data.level)
local unit greenEffect
local real phi = 0
local real phiInc
loop
exitwhen (innerRadius + 0.001 >= outerRadius)
set phi = 0
set phiInc = 2*bj_PI/I2R(fxcount)
loop
exitwhen (phi + 0.001 >= 2 * bj_PI)
//we add the units to a group, so we can kill them when we want ! =P
set greenEffect = CreateUnit(Player(15), DummyEffectId(data.level), x + innerRadius * Cos(phi), y + innerRadius * Sin(phi), 180 + Rad2Deg(phi))
call GroupAddUnit(data.dummyEffects, greenEffect)
if (data.level == 1) then
// call SetUnitAbilityLevel(greenEffect, FOREST_AURA, 1)
elseif (data.level == 2) then
// call SetUnitAbilityLevel(greenEffect, FOREST_AURA, 2)
elseif (data.level == 3) then
// call SetUnitAbilityLevel(greenEffect, FOREST_AURA, 3)
endif
set phi = phi + phiInc
endloop
set innerRadius = innerRadius + radiusInc
set fxcount = fxcount + fxcountinc
endloop
set forPlayer = null
set greenEffect = null
endfunction
//===========================================================================
//Function made by Vexorian, it selects a random region in a disk.
//All regions have the same chance of beeing choosen
private function GetRandomPointInDisk takes real centerx, real centery, real minradius, real maxradius returns location
local real d = SquareRoot(GetRandomReal(minradius * minradius, maxradius * maxradius))
local real a = GetRandomReal(0, 2 * bj_PI)
return Location(centerx + d * Cos(a), centery + d * Sin(a))
endfunction
//===========================================================================
private function createTrees takes nothing returns nothing
//we get the structure from the timer
local MyStruct data = MyStruct(GetTimerData(GetExpiredTimer()))
//variables for us to know where the trees will born
local location point
local real randomX
local real randomY
//just to keep count about how many trees we created
local integer loopCounter = 0
//variables about the trees
local unit tree
local real treeFacing = GetUnitFacing(data.caster)
//Here we spawn the trees
loop
exitwhen(loopCounter >= TreesPerCycle(data.level))
set point = GetRandomPointInDisk(data.spellLocX, data.spellLocY, MinRange(data.level), MaxRange(data.level))
set randomX = GetLocationX(point)
set randomY = GetLocationY(point)
set tree = PlaceRandomUnit(TREE_POOLS[data.level], GetOwningPlayer(data.caster), randomX, randomY, treeFacing)
call SetUnitAnimation( tree, ANIMATION )
//if ChannelTrees(data.level) is true we add the treeto it
//so we can keep track of it and kill it later in the "onDestroy"
//method
//else if the variable is false, it means that the group was not
//created, and we ant the units to have a LifeTime
if (ChannelTrees(data.level)) then
call GroupAddUnit(data.trees, tree)
else
call UnitApplyTimedLife(tree, 'BTLF', TreeLife(data.level))
endif
call RemoveLocation(point)
set point = null
set loopCounter = loopCounter + 1
endloop
set tree= null
endfunction
//===========================================================================
private function Conditions takes nothing returns boolean
local MyStruct data
local location spellLoc //the location of the spell
if (GetSpellAbilityId() == AID) then
//setting variables for the struct
set spellLoc = GetSpellTargetLoc()
set data = MyStruct.create(GetTriggerUnit(), GetLocationX(spellLoc), GetLocationY(spellLoc))
//put the struct in the Table, we just use the caster's handle adress as
//the key which tells us where in the Table the struct is stored
call SaveInteger(activeTable,GetHandleId(data.caster),0,data)
// we add the casting unit to some sort of "pool"
call GroupAddUnit(TreeInvocationCasters, data.caster)
//now we create the green effects
call createGreenEffect(data)
//we attach the struct to the timer
call SetTimerData(data.cycleTimer, integer(data))
call TimerStart(data.cycleTimer, Cycle(data.level), true, function createTrees)
//cleaning up the mess
call RemoveLocation(spellLoc)
endif
set spellLoc = null
return false
endfunction
//==========================================================================
private function Init takes nothing returns nothing
//these integers are counters for a loop and will be used later
local integer i
local integer j
//here we set up the triggers we will need
//Creates the trigger for when the unit start the effect of the spell
local trigger ForestCallTrigger = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(ForestCallTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(ForestCallTrigger, Condition( function Conditions ) )
//Creates the trigger for when the unit ceases the channel
set ForestCallTrigger = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ForestCallTrigger, EVENT_PLAYER_UNIT_SPELL_ENDCAST)
call TriggerAddCondition(ForestCallTrigger, Condition(function onStop))
set ForestCallTrigger = null
//set our globals
set activeTable = InitHashtable()
set TreeInvocationCasters = CreateGroup()
//now we will Create UnitPools using loops and the
//counters
//in this loop we create the 2D dynamic arrays, and create an UnitPool
//for each level
set i = 1
loop
exitwhen(i > MAX_LEVELS)
set treeChances[i] = chancesPerTreeType.create()
set TREE_POOLS[i] = CreateUnitPool()
set i = i + 1
endloop
//here we fill all our arrays
call TreeCalibration()
//here we add the units to the UnitPools with a respective weight per level
//PS: "weitgh" is the chances a unit has of being spawned.
set i = 1
set j = 1
loop
exitwhen( i > MAX_LEVELS)
loop
exitwhen(j > MAX_TYPES)
call UnitPoolAddUnitType(TREE_POOLS[i], treeType[j], treeChances[i][j])
set j = j + 1
endloop
set j = 1
set i = i + 1
endloop
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RangedDamageReduction initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
//local real d = GetEventDamage() * 25.
//local texttag tt
//local string Q7E
if GetUnitAbilityLevel(u,'A0HP')==1 and GetEventDamage() > 0 and a != u then
if (J5V[(ROX((GetUnitTypeId(a))))]) or GetUnitTypeId(a) == 'N00D' then
if (BI[NI]) == (LN) or GetUnitTypeId(a) == 'N00D' then
//set DI[NI] = DI[NI] + (GetEventDamage()*.9)
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*.9))
endif
endif
endif
set u = null
set a = null
//set Q7E=null
//set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RangedDamageReduction80 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
//local real d = GetEventDamage() * 25.
//local texttag tt
//local string Q7E
if GetUnitAbilityLevel(u,'A0HS')==1 and GetEventDamage() > 0 and a != u then
if (J5V[(ROX((GetUnitTypeId(a))))]) or GetUnitTypeId(a) == 'N00D' then
if (BI[NI]) == (LN) or GetUnitTypeId(a) == 'N00D' then
// set DI[NI] = DI[NI] + (GetEventDamage()*.8)
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*.8))
endif
endif
endif
set u = null
set a = null
//set Q7E=null
//set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope FelBolt initializer OnInit
globals
private constant integer ABIL_ID = 'A0KK'
endglobals
private struct LB
ProgressBar cast
effect hl
effect hr
unit u
unit t
real dmg
real time
boolean mob
method destroy takes nothing returns nothing
set this.u = null
call DestroyEffect(this.hl)
call DestroyEffect(this.hr)
set this.hl = null
set this.hr = null
set this.t = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local LB data = GetTimerData(t)
local real dmg
local integer lvl
local real dx = GetUnitX(data.t) - GetUnitX(data.u)
local real dy = GetUnitY(data.t) - GetUnitY(data.u)
//call BJDebugMsg("Hander begins handling")
//if GetUnitCurrentOrder(data.u) != 852600 then
if GetUnitCurrentOrder(data.u) != 852230 or SquareRoot(dx * dx + dy * dy) >= 700. then
//call BJDebugMsg("Is order Id correct?")
if data.time >= 2.42 then
//Actions
//static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
call TimedL.U2U(AddLightningEx("GRNL",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
set lvl = GetUnitAbilityLevel(data.u,ABIL_ID)
set dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*7.5*lvl)+(BlzGetUnitBaseDamage(data.u,0)*.5*lvl)
if data.mob then
if RANDOMWAVEON then
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*2.5)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
if TRUEENFOS then
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*2.)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*1.75)+(BlzGetUnitMaxHP(data.t)*.075),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
else
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Massacre Blight.mdx",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
endif
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
set data.time = data.time + .02
call data.cast.setPercentage(R2I(data.time*40.), 1)
if data.time == 1.06 then
call SetUnitAnimation(data.u,"attack")
endif
if data.time == 2.06 then
call SetUnitAnimation(data.u,"attack")
endif
if data.time >= 2.5 then
//Actions
set lvl = GetUnitAbilityLevel(data.u,ABIL_ID)
set dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*7.5*lvl)+(BlzGetUnitBaseDamage(data.u,0)*.5*lvl)
call TimedL.U2U(AddLightningEx("GRNL",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
if data.mob then
if TRUEENFOS then
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*2.)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*1.75)+(BlzGetUnitMaxHP(data.t)*.075),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
else
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Massacre Blight.mdx",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
endif
set t = null
endfunction
private function OnSpell takes nothing returns boolean
local timer t
local LB data
local real x
local real y
local real a = 0
//call BJDebugMsg("Is event firing?")
if GetSpellAbilityId() == ABIL_ID then
//call BJDebugMsg("Spell begins casting")
set t = NewTimer()
set data = LB.create()
set data.u = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
if GetUnitTypeId(data.u) == 'n03C' then
set data.mob = true
loop
exitwhen a >= 360.
set x= GetUnitX(data.t) + 225. * Cos(a * bj_DEGTORAD)
set y = GetUnitY(data.t) + 225. * Sin(a* bj_DEGTORAD)
call CreateUnit(GetOwningPlayer(data.u),'n044',x,y,GetUnitFacing(data.u)-180.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Doomsday.mdx",x,y))
set a = a + 60.
endloop
else
set data.mob = false
endif
set data.hl = AddSpecialEffectTarget("war3mapImported\\Ember Green.mdx",data.u,"hand, left")
set data.hr = AddSpecialEffectTarget("war3mapImported\\Ember Green.mdx",data.u,"hand, right")
set data.time = 0
set data.cast = ProgressBar.create()
set data.cast.xOffset = -15
if data.mob then
set data.cast.zOffset = 400
else
set data.cast.zOffset = 175
endif
if data.mob then
set data.cast.size = 1.75
else
set data.cast.size = .8
endif
set data.cast.color = GetPlayerColor(GetOwningPlayer(data.u))
set data.cast.targetUnit = data.u
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( trig, Condition( function OnSpell ) )
set trig = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TreeAI initializer OnInit
private function Actions takes nothing returns nothing
if GetUnitTypeId(GetAttacker()) == 'n025' then
call IssuePointOrder(GetAttacker(),"deathanddecay",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
endif
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(trig, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope SummonBloodPriestess initializer OnInit
globals
private constant integer SPELL_ID = 'A0KW'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real a = GetRandomReal(0.,360.)
local real d = GetRandomReal(60.,575.)
local real x
local real y
local effect fx
set x = GetUnitX(u) + d * Cos(a * bj_DEGTORAD)
set y = GetUnitY(u) + d * Sin(a * bj_DEGTORAD)
call CreateUnit(GetOwningPlayer(u),'n03I',x,y,a+180.)
set fx = AddSpecialEffect("war3mapImported\\Soul Beam Red.mdx",x,y)
call BlzSetSpecialEffectScale(fx,.7)
call DestroyEffect(fx)
set u = null
set fx = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope DetectRessedTroll initializer OnInit
globals
private constant integer SPELL_ID = 'A0KY'
boolean array RESSEDTROLL
endglobals
private function Actions takes nothing returns nothing
set RESSEDTROLL[GetUnitUserData(GetSpellTargetUnit())] = true
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope SummonBloodTotem initializer OnInit
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local real a = GetUnitFacing(c)
local real x = GetUnitX(c) + 70. * Cos(a * bj_DEGTORAD)
local real y = GetUnitY(c) + 70. * Sin(a * bj_DEGTORAD)
if ((TRUEENFOS== false and GetRandomInt(0,100) >=50 )or(TRUEENFOS))then
call IssuePointOrderById(c,852619,x,y)
endif
if not TRUEENFOS then
call UnitRemoveAbility(c,'ACbh')
endif
set c = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0KQ', function Actions)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope CorruptorFear initializer OnInit
globals
private constant string PATH = "war3mapImported\\Poltergeist.mdx"
private constant string ATTACH = "head"
private integer array fearstacks
endglobals
private struct FearIS
unit u
unit c
integer i
integer p
method destroy takes nothing returns nothing
set .c = null
set .u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FearIS data = GetTimerData(t)
local Fear F
local real r
if fearstacks[GetUnitUserData(data.u)]>0 and data.i <160 and UnitAlive(data.u) and LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] == data.u then
if data.i == 0then
if GetLocalPlayer() == Player(data.p) then
call EnableUserControl(false)
endif
if Fear.isFeared(data.u) then
set F = Fear.get(data.u)
set F.time = F.time + 5.
else
set F = Fear.create()
set F.targ = data.u
set F.path = PATH
set F.attach = ATTACH
set F.time = 5.
call F.start()
call F.destroy()
endif
endif
call PanCameraToForPlayer(Player(data.p),GetUnitX(data.u),GetUnitY(data.u))
set data.i = data.i + 1
if data.i == 33 or data.i == 65 or data.i == 97 or data.i ==129 or data.i == 1 then
set CorruptAmount[data.p]=CorruptAmount[data.p]+1
endif
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
else
set fearstacks[GetUnitUserData(data.u)] = fearstacks[GetUnitUserData(data.u)] - 1
if GetLocalPlayer() == Player(data.p) and fearstacks[GetUnitUserData(data.u)] == 0 then
call EnableUserControl(true)
endif
if fearstacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A0LK')
call UnitRemoveAbility(data.u,'B05Q')
endif
call data.destroy()
call ReleaseTimer(t)
endif
set t = null
endfunction
private function Actions takes nothing returns boolean
local timer t //= NewTimer()
local FearIS data// = FearIS.create()
if GetUnitTypeId(GetEventDamageSource()) == 'u002' and GetRandomInt(0,100) <= 20 and not IsUnitType(GetTriggerUnit(),UNIT_TYPE_MAGIC_IMMUNE) and GetUnitAbilityLevel(GetTriggerUnit(),'A0QC') != 1 then
set t = NewTimer()
set data = FearIS.create()
set data.c = GetEventDamageSource()
set data.u = GetTriggerUnit()
set data.i = 0
if fearstacks[GetUnitUserData(data.u)] == 0 then
call UnitAddAbility(data.u,'A0LK')
endif
set fearstacks[GetUnitUserData(data.u)] = fearstacks[GetUnitUserData(data.u)] + 1
set data.p = GetPlayerId(GetOwningPlayer(data.u))
call SetTimerData(t,data)
if IsUnitIllusion(data.u) then
call UnitDamageTarget(data.c,data.u,GetUnitState(data.u,UNIT_STATE_MAX_LIFE)*3.,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope ThrowFish initializer OnInit
globals
location GLOBALLOCATION = Location(0,0)
real GLOBALX
real GLOBALY
endglobals
private struct Dt2
effect fx
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
call this.deallocate()
endmethod
endstruct
private struct Dt
unit c
real x
real y
effect fx
boolean b = false
real interval
real scale
integer i
player p
method destroy takes nothing returns nothing
call BlzSetSpecialEffectAlpha(this.fx,0)
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
set this.p = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u= GetFilterUnit()
//call BJDebugMsg("is this filter working?")
if IsUnitEnemy(u,GLOBALPLAYER) and UnitAlive(u) then
call M6E(u,150.,.5,bj_RADTODEG * Atan2(GetUnitY(u) - GLOBALY, GetUnitX(u) - GLOBALX),"war3mapImported\\SlideWater.mdx",.0,true,true)
call UnitDamageTargetEx(GLOBAL_CASTER,u,1000. + (BlzGetUnitMaxHP(u)*.25),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl",u,"chest"))
endif
set u= null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Dt2 data = GetTimerData(t)
call BlzPlaySpecialEffect(data.fx,ANIM_TYPE_DECAY)
call BlzSetSpecialEffectAlpha(data.fx,0)
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Dt data = GetTimerData(t)
local effect fx2
local timer t2
local Dt2 data2
local effect fx3
local unit u
if data.interval <= .01 then
set GLOBALPLAYER = data.p
set GLOBAL_CASTER = data.c
set GLOBALX = data.x
set GLOBALY = data.y
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,349.,Filter(function FilterActions))
set u = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,'A0RN')
call IssueImmediateOrderById(u,852285)
call data.destroy()
call ReleaseTimer(t)
else
if data.interval >= .3 then
set data.interval = data.interval - .1
else
set data.interval = data.interval - .01
endif
set data.scale = data.scale + .1
call BlzSetSpecialEffectScale(data.fx,data.scale)
if data.i == 0 then
set data.i = 1
call BlzSetSpecialEffectColor(data.fx,255,0,0)
else
set data.i = 0
call BlzSetSpecialEffectColor(data.fx,255,255,255)
endif
if data.interval <= .05 and data.b == false then
set data.b = true
set fx2 = AddSpecialEffect("war3mapImported\\Shark.mdx",data.x-50.,data.y+95.)
call BlzPlaySpecialEffect(fx2,ANIM_TYPE_ATTACK)
call BlzSetSpecialEffectScale(fx2,5.5)
call MoveLocation(GLOBALLOCATION,data.x,data.y)
call BlzSetSpecialEffectZ(fx2,GetLocationZ(GLOBALLOCATION)-705.)
call BlzSetSpecialEffectPitch(fx2,-65.*bj_DEGTORAD)
//call DestroyEffect(fx2)
set data2 = Dt2.create()
set t2 = NewTimer()
set data2.fx = fx2
call SetTimerData(t2,data2)
call TimerStart(t2,1.,false,function Handler2)
set fx3 = AddSpecialEffect("war3mapImported\\Tidal Burst - Classic.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx3,1.5)
call BlzSetSpecialEffectAlpha(fx3,125)
call DestroyEffect(fx3)
endif
call SetTimerData(t,data)
call TimerStart(t,data.interval,false,function Handler)
endif
set u = null
set fx3 = null
set t2 = null
set fx2 = null
set t = null
endfunction
private struct ThrowOrb extends array
private static method onRemove takes Misssile missile returns boolean
local timer t = NewTimer()
local Dt data = Dt.create()
call missile.effect.clearModels()
set data.c = missile.source
if missile.model == "war3mapImported\\cutefish tropical.mdx" then
set data.fx = AddSpecialEffect("war3mapImported\\cutefish tropical.mdx",missile.x,missile.y)
else
set data.fx = AddSpecialEffect("war3mapImported\\cutefish.mdx",missile.x,missile.y)
endif
set data.interval = .7
set data.scale = 2.5
set data.i = 0
set data.x = missile.x
set data.y = missile.y
set data.p = missile.owner
call BlzSetSpecialEffectYaw(data.fx,missile.angle)
call BlzSetSpecialEffectScale(data.fx,data.scale)
call MoveLocation(GLOBALLOCATION,data.x,data.y)
call BlzSetSpecialEffectZ(data.fx,GetLocationZ(GLOBALLOCATION)+175.)
call BlzPlaySpecialEffect(data.fx,ANIM_TYPE_WALK)
call SetTimerData(t,data)
call TimerStart(t,data.interval,false,function Handler)
set t = null
return true
endmethod
// Runs when a missile collides with a unit.
implement MisssileStruct
endstruct
private function Actions takes nothing returns boolean
local Misssile m
local unit u = GetAttacker()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real a = GetUnitFacing(u)
local unit t = GetTriggerUnit()
if GetUnitTypeId(u) == 'n043' then
set m = Misssile.createXYZ(x, y, GetUnitFlyHeight(t), GetUnitX(t)+GetRandomReal(0.,125.), GetUnitY(t)+GetRandomReal(0.,125.), 0.)
set m.source = u
set m.speed = 42.
//set m.acceleration = 7.03125
set m.scale = 1.5
//if GetRandomInt(1,100) <= 50 then
// set m.model = "war3mapImported\\cutefish tropical.mdx"
//else
set m.model = "war3mapImported\\cutefish.mdx"
//endif
set m.arc = 65.*bj_DEGTORAD
set m.collision = 16.
//set m.spin = 270.*bj_DEGTORAD
//set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
call ThrowOrb.launch(m)// Launch is implemented via module MissileStruct
endif
set u = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( t, Condition( function Actions ) )
//call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ScreamoftheFallen initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = GetTriggerUnit()
local integer ii
local player pp
local integer i3
if GetUnitTypeId(u) == 'n016' or GetUnitTypeId(u) == 'n03K' or GetUnitTypeId(u) == 'n045' or GetUnitTypeId(u) == 'n046' then
if GetOwningPlayer(u) == Player(10) or GetOwningPlayer(u) == Player(12) then
set ii = 0
set i3 = 0
loop
exitwhen ii >4
set pp = Player(ii)
if GetPlayerSlotState(pp) == PLAYER_SLOT_STATE_PLAYING then
set i3 = i3 + 1
endif
set ii = ii + 1
endloop
if i3 == 0 then
set ScreamStacks[0] = ScreamStacks[0] + 4
endif
if ScreamStacks[0]-100 >= ScreamStacks[1] then
set ScreamStacks[1] = ScreamStacks[1] + 16
endif
if ScreamStacks[1]-250 >= ScreamStacks[0] then
set ScreamStacks[0] = ScreamStacks[0] + 20
endif
//set ScreamStacks[0] = ScreamStacks[0] + 1
set ScreamStacks[1] = ScreamStacks[1] + 4
else
if GetOwningPlayer(u) == Player(11) or GetOwningPlayer(u) == Player(13) then
set ii = 5
set i3 = 0
loop
exitwhen ii >9
set pp = Player(ii)
if GetPlayerSlotState(pp) == PLAYER_SLOT_STATE_PLAYING then
set i3 = i3 + 1
endif
set ii = ii + 1
endloop
if i3 == 0 then
set ScreamStacks[1] = ScreamStacks[1] + 4
endif
if ScreamStacks[1]-100 >= ScreamStacks[0] then
set ScreamStacks[0] = ScreamStacks[0] + 16
endif
if ScreamStacks[0]-250 >= ScreamStacks[1] then
set ScreamStacks[1] = ScreamStacks[1] + 20
endif
//set ScreamStacks[1] = ScreamStacks[1] + 1
set ScreamStacks[0] = ScreamStacks[0] + 4
endif
endif
endif
set pp = null
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FlyingEvasion initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0DO')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,99) <= 80 and GetUnitAbilityLevel(a,'A026') == 0 and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' then
if (J5V[(ROX((GetUnitTypeId(a))))]) then
if (BI[NI]) == (LN) then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real r = 1.
local texttag tt
local string Q7E
local integer i = 0
local item it
if (GetUnitAbilityLevel(u,'A0QM') != 0 or GetUnitAbilityLevel(u,'A0QN') != 0) and GetEventDamage() > 0 and a != u and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A026') == 0 then
if GetUnitAbilityLevel(u,'A0QN') != 0 then
loop
exitwhen i > 5
set it = UnitItemInSlot(u,i)
if (GetItemType(it) == ITEM_TYPE_UNKNOWN or GetItemTypeId(it) == 'I04U') and it !=null then
if GetItemTypeId(it) == 'I04U' then
set r=(1-(.6))*r
//call BJDebugMsg("r: "+R2S(r))
else
set r=(1-(GetItemLevel(it)*.01))*r
//call BJDebugMsg("r: "+R2S(r))
endif
endif
set i = i + 1
endloop
else
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[1+GetPlayerId(GetOwningPlayer(u))],i)
if (GetItemType(it) == ITEM_TYPE_UNKNOWN or GetItemTypeId(it) == 'I04U') and it !=null then
if GetItemTypeId(it) == 'I04U' then
set r=(1-(.6*.5))*r
//call BJDebugMsg("r: "+R2S(r))
else
set r=(1-(GetItemLevel(it)*.5*.01))*r
//call BJDebugMsg("r: "+R2S(r))
endif
endif
set i = i + 1
endloop
endif
if GetUnitAbilityLevel(a,'A0QT') != 0 then
set r = r*.85
endif
//call BJDebugMsg("Evasion: "+R2S((1-r)*100))
if GetRandomReal(1.,100.) <= (1-r)*100 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
set it = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion35 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A08P')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,99) <= 35 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion40 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A08R')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 40 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion50 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0IP')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 50 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion60 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0OG')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,99) <= 60 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion65 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0OH')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,99) <= 65 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemEvasion75 initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0JH')==1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= 75 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() then
set DI[NI] = DI[NI] + GetEventDamage()
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonSeedCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04F'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 1
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonHeartCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04H'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 1
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonHandCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04Q'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 1
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonCarapaceCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04O'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 4
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonMutilatorCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04R'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 4
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonVessselCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04P'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 6
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonEyeCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04N'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 2
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope DemonEyeStickCorr initializer OnInit
globals
private constant integer ITEM_ID = 'I04T'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 3
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope Indulgencecorrp initializer OnInit
globals
private constant integer ITEM_ID = 'I03F'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 6
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonHear initializer OnInit
globals
private constant integer ITEM_ID = 'I04H'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 2
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonHand initializer OnInit
globals
private constant integer ITEM_ID = 'I04Q'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 2
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonMutilator initializer OnInit
globals
private constant integer ITEM_ID = 'I04R'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 4
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonSeed initializer OnInit
globals
private constant integer ITEM_ID = 'I04F'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 1
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrIndulg initializer OnInit
globals
private constant integer ITEM_ID = 'I03F'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 6
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonEye initializer OnInit
globals
private constant integer ITEM_ID = 'I04N'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 2
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonEyestick initializer OnInit
globals
private constant integer ITEM_ID = 'I04T'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 3
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonCarapace initializer OnInit
globals
private constant integer ITEM_ID = 'I04O'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 4
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseCorrDemonVessel initializer OnInit
globals
private constant integer ITEM_ID = 'I04P'
endglobals
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID then
set CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CorruptionRaised[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] - 6
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
scope ExcessLoseCorr initializer OnInit
private function OnSpell takes nothing returns boolean
if CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]>0 and GetUnitTypeId(GetTriggerUnit())=='n013' and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 2
if CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]<0 then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = 0
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope FaustianHeal initializer OnInit
private function OnSpell takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit())=='u006' and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) then
call SetWidgetLife(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],GetWidgetLife(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))])+(BlzGetUnitMaxHP(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))])-GetWidgetLife(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))*.25)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Orange.mdx",LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],"origin"))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicHandEyeLoseCorr initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = GetKillingUnit()
local integer id = GetPlayerId(GetOwningPlayer(u))+1
local integer i = 0
local item it
local integer c = 0
if (UnitHasItemOfTypeBJ(LC[id],'I04Q')or UnitHasItemOfTypeBJ(LC[id],'I04N')) and GetRandomInt(0,99) <= 54 and CorruptAmount[id-1]>0 and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[id]) and u != null then
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I04Q' or GetItemTypeId(it) == 'I04N' then
set c = c + 1
endif
set i = i + 1
endloop
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set c = c * 3
endif
set CorruptAmount[id-1] = CorruptAmount[id-1] - c
if CorruptAmount[id-1] < 0 then
set CorruptAmount[id-1] = 0
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id-1])
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
set u = null
set it = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicHandLoseCorr2 initializer OnInit
private function OnSpell takes nothing returns boolean
if (UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04R') or UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04S')) and GetRandomInt(0,99) <= 43 and CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]>0 and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 6
else
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 2
endif
if CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] <0 then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = 0
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(GetTriggerUnit(),GetKillingUnit(),BlzGetUnitMaxHP(GetKillingUnit())*.04 ,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAuraDamage.mdl",GetKillingUnit(),"head"))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicHandLoseCorr3 initializer OnInit
private function OnSpell takes nothing returns boolean
if (UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04W') or UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04X')) and GetRandomInt(0,99) <= 65 and CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]>0 and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 6
else
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 2
endif
if CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] <0 then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = 0
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetEx(GetTriggerUnit(),GetKillingUnit(),BlzGetUnitMaxHP(GetKillingUnit())*.04 ,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(GetTriggeringTrigger())
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAuraDamage.mdl",GetKillingUnit(),"head"))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicMutilatorsLoseCorr initializer OnInit
private function OnSpell takes nothing returns boolean
if (UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04R')or UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04W')) and CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]>0 and IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and GetKillingUnit() != null then
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) and not IsUnitIllusion(GetTriggerUnit()) then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = 0
else
if CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] >= 20 then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 20
else
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = 0
endif
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicEyeStickLoseCorr initializer OnInit
private function OnSpell takes nothing returns boolean
if UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I04T') and GetRandomInt(0,100) <= 66 and CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]>0 and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
set CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] = CorruptAmount[(GetPlayerId(GetOwningPlayer(GetKillingUnit())))] - 1
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope DemonicEyeStickSwordbowLoseCorr initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = GetKillingUnit()
local integer id = GetPlayerId(GetOwningPlayer(u))+1
local integer i = 0
local item it
local integer c = 0
if (UnitHasItemOfTypeBJ(LC[id],'I04T')or UnitHasItemOfTypeBJ(LC[id],'I04U')) and GetRandomInt(0,99) <= 47 and CorruptAmount[id-1]>0 and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[id]) and u != null then
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I04T' or GetItemTypeId(it) == 'I04U' then
set c = c + 2
endif
set i = i + 1
endloop
if GetUnitTypeId(GetTriggerUnit()) == 'n016' or GetUnitTypeId(GetTriggerUnit()) == 'n03K' or GetUnitTypeId(GetTriggerUnit()) == 'n045' or GetUnitTypeId(GetTriggerUnit()) == 'n046' then
set c = c * 3
endif
set CorruptAmount[id-1] = CorruptAmount[id-1] - c
if CorruptAmount[id-1] < 0 then
set CorruptAmount[id-1] = 0
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id-1])
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
set u = null
set it = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope DemonicOffering initializer OnInit
globals
private constant integer SPELL_ID = 'A0LT'
endglobals
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer o
local player p = GetOwningPlayer(c)
local integer id = GetPlayerId(p)
local unit u
local real x
local real a
local real y
local real d
local real ar
if IsUnitType(c,UNIT_TYPE_HERO) then
if GetRandomInt(1,100) <= 33 then
if GetRandomInt(1,100) <= 32 then
set o = id
else
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
endif
set d = GetRandomReal(50.,300.)
set a = GetRandomReal(0.,360.)
set x = GetUnitX(LC[id+1]) + d * Cos(a * bj_DEGTORAD)
set y = GetUnitY(LC[id+1]) + d * Sin(a * bj_DEGTORAD)
set ar = BlzGetUnitArmor(LC[id+1])
if ar >= 1000 then
set ar = 666
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\ChaosExplosion.mdx",x,y))
set u = CreateUnit(Player(o),'u006',x,y,a-180.)
call BlzSetUnitMaxHP(u,R2I(GetWidgetLife(LC[id+1])*.33*5.))
call SetWidgetLife(u,GetWidgetLife(LC[id+1])*.33*5.)
call BlzSetUnitArmor(u,ar/2)
call BlzSetUnitBaseDamage(u,R2I(GetWidgetLife(LC[id+1])*.33*.5),0)
if GetUnitBonus(c,BONUS_HEALTH) >= 100000 then
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
call SetUnitOwner(u,Player(o),true)
call BlzSetUnitMaxHP(u,BlzGetUnitMaxHP(u)*10)
call SetWidgetLife(u,BlzGetUnitMaxHP(u)*1.)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)*10,0)
call SetUnitScale(u,6.,6.,6.)
call ZWE(u,500.)
call IssueTargetOrderById(u,851983,c)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(p))]+(GetPlayerName(p)+"|r"))+(" |c00800000has reached the pinnacle of Demon diplomacy...Now to reap the fruits of his labours.|r")))
endif
endif
call SetWidgetLife(LC[id+1],GetWidgetLife(LC[id+1])*.67)
if CorruptAmount[id] > 0 then
set CorruptAmount[id] = CorruptAmount[id] - 14
if CorruptAmount[id] < 0 then
set CorruptAmount[id] = 0
endif
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
endif
endif
set c = null
set p = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope DemonicOfferingVessel initializer OnInit
globals
private constant integer SPELL_ID = 'A0M3'
endglobals
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer o
local player p = GetOwningPlayer(c)
local integer id = GetPlayerId(p)
local unit u
local real x
local real a
local real y
local real d
local real ar
if IsUnitType(c,UNIT_TYPE_HERO) then
if GetRandomInt(1,100) <= 32 then
if GetRandomInt(1,100) <= 32 then
set o = id
else
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
endif
set d = GetRandomReal(50.,300.)
set a = GetRandomReal(0.,360.)
set x = GetUnitX(LC[id+1]) + d * Cos(a * bj_DEGTORAD)
set y = GetUnitY(LC[id+1]) + d * Sin(a * bj_DEGTORAD)
set ar = BlzGetUnitArmor(LC[id+1])
call DestroyEffect(AddSpecialEffect("war3mapImported\\ChaosExplosion.mdx",x,y))
set u = CreateUnit(Player(o),'u006',x,y,a-180.)
call BlzSetUnitMaxHP(u,R2I(GetWidgetLife(LC[id+1])*.36*5.))
call SetWidgetLife(u,GetWidgetLife(LC[id+1])*.36*5.)
if ar >= 1000 then
set ar = 666
endif
call BlzSetUnitArmor(u,ar/2)
call BlzSetUnitBaseDamage(u,R2I(GetWidgetLife(LC[id+1])*.36*.5),0)
if GetUnitBonus(c,BONUS_HEALTH) >= 100000 then
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
call SetUnitOwner(u,Player(o),true)
call BlzSetUnitMaxHP(u,BlzGetUnitMaxHP(u)*10)
call SetWidgetLife(u,BlzGetUnitMaxHP(u)*1.)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)*10,0)
call SetUnitScale(u,6.,6.,6.)
call ZWE(u,500.)
call IssueTargetOrderById(u,851983,c)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(p))]+(GetPlayerName(p)+"|r"))+(" |c00800000has reached the pinnacle of Demon diplomacy...Now to reap the fruits of his labours.|r")))
endif
endif
call SetWidgetLife(LC[id+1],GetWidgetLife(LC[id+1])*.64)
if CorruptAmount[id] > 0 then
set CorruptAmount[id] = CorruptAmount[id] - 21
if CorruptAmount[id] < 0 then
set CorruptAmount[id] = 0
endif
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
endif
endif
set c = null
set p = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=16
//TESH.alwaysfold=0
// ItemSet demo
// Description: Learn how to easy setup item sets.
// Scroll down to function Init to see how to use ItemSet API
scope ItemSetDemo initializer Init
// Runs when a set is completed. Check function Init how to register functions.
//private function OnComplete takes nothing returns boolean
// local string setName = GetTriggerItemSet().name
//local string unitName = GetUnitName(GetTriggerItemSetUnit())
//call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 1, unitName + " completed " + setName + "!")
//return false
//endfunction
// runs when a set was prev complete.
//private function OnInComplete takes nothing returns boolean
// call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 1, "incomplete")
//return false
//endfunction
private function d takes nothing returns boolean
call ItemSet.onItemUnequip(GetTriggerUnit(), GetItemTypeId(GetManipulatedItem()))
return false
endfunction
private function p takes nothing returns boolean
call ItemSet.onItemEquip(GetTriggerUnit(), GetItemTypeId(GetManipulatedItem()))
return false
endfunction
private function Init takes nothing returns nothing
local trigger onPick = CreateTrigger()
local trigger onDrop = CreateTrigger()
/**
* Setup an item set.
*/
local ItemSet new = ItemSet.create("Tranquil Warfare", "war3mapImported\\DalaranAura.mdx", "origin")
local ItemSet new2 = ItemSet.create("The Witch's Tithe", "war3mapImported\\Bondage Red HD2.mdx", "chest")
call new.addItem('I045')
call new.addItem('I032')
call new.addItem('I040')
call new.addAbility(2, 'A0G6')
call new.addAbility(2, 'A0RU')
call new.addAbility(3, 'A0G7')
call new.addAbility(3, 'A0G8')
call new.addAbility(3, 'A0GA')
call new.addAbility(3, 'A0QQ')
call new2.addItem('I03V')
call new2.addItem('I036')
call new2.addItem('I048')
call new2.addAbility(2, 'A0L4')
call new2.addAbility(2, 'A0L3')
call new2.addAbility(2, 'A0L7')
call new2.addAbility(3, 'A0LA')
call new2.addAbility(3, 'A0L5')
call new2.addAbility(3, 'A0OJ')
call new2.addBuffIndicator(1, 'A0LB', 'B05L')
call new2.addBuffIndicator(2, 'A0LC', 'B05M')
call new2.addBuffIndicator(3, 'A0LD', 'B05N')
/**
* Add a buff indicator ( optional ). Those are just visuals based on the slow tornado buff.
*/
call new.addBuffIndicator(1, 'A0G4', 'B04C')
call new.addBuffIndicator(2, 'A0G5', 'B04B')
call new.addBuffIndicator(3, 'A0G3', 'B041')
/**
* Register functions which should be evaluated each time an
* item set event fires.( Optional )
*/
//call RegisterItemSetEvent(ItemSet.COMPLETE, function OnComplete)
//call RegisterItemSetEvent(ItemSet.INCOMPLETE, function OnInComplete)
/**
* Which inventory system? Wc3 default or custom is up to you.
*/
call TriggerAddCondition(onPick, Condition(function p))
call TriggerAddCondition(onDrop, Condition(function d))
call TriggerRegisterAnyUnitEventBJ(onPick, EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(onDrop, EVENT_PLAYER_UNIT_DROP_ITEM)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EVERLASTINGFLAME initializer OnInit
globals
trigger EVERLASTINGFLAMEBURN
integer array EverlastingBurnStacks
private timer globalTimer
private unit array burningUnits
private unit array burnCasters
private integer array burnDurations
private integer numBurningUnits = 0
private constant integer SPELL_ID2 = 'A0EQ'
real GLOBALDAMAGE
integer array MultiRifts
integer array MultiRains
integer array MultiSwords
endglobals
native UnitAlive takes unit id returns boolean
private struct TM
real dur
unit u
unit t
real damage
real x
real y
integer id
real yaw
method destroy takes nothing returns nothing
set this.u = null
set this.t = null
call this.deallocate()
endmethod
endstruct
private struct PS
real dur
unit u
real damage
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(GLOBAL_CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",u,"chest"))
call DisableTrigger(EVERLASTINGFLAMEBURN)
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(GLOBAL_CASTER,u,GLOBALDAMAGE,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(EVERLASTINGFLAMEBURN)
call EnableTrigger(TOXIAPOISON)
endif
set u = null
return false
endfunction
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and not BlzIsUnitInvulnerable(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)))
endfunction
private function HandlerA takes nothing returns nothing
local timer t = GetExpiredTimer()
local TM data = GetTimerData(t)
local real angle
local effect fx
if data.dur <= 0 then
set MultiRifts[GetUnitUserData(LC[data.id])] = MultiRifts[GetUnitUserData(LC[data.id])] - 1
call ReleaseTimer(t)
call data.destroy()
else
set data.dur = data.dur -.25
if UnitAlive(data.t) then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 45. * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 45. * Sin(angle * bj_DEGTORAD)
else
set GLOBAL_CASTER = data.u
set data.t = ZEE(null,data.x,data.y,3000.,(Condition(function FilterUnits2)))
if data.t != null then
set angle = bj_RADTODEG * Atan2(GetUnitY(data.t) - data.y, GetUnitX(data.t) - data.x)
set data.x = data.x + 45. * Cos(angle * bj_DEGTORAD)
set data.y = data.y + 45. * Sin(angle * bj_DEGTORAD)
endif
endif
set data.yaw = data.yaw + 90.
set GLOBAL_CASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,275.,Filter(function FilterActions))
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(fx,1.75)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(fx,1.25)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
call SetTimerData(t,data)
call TimerStart(t,.25,false,function HandlerA)
endif
set fx = null
set t = null
endfunction
globals
private constant integer ARMAGEDDON_ABILITY = 'A001'
// Damage options.
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
// Missile constants.
private constant real METEOR_START_HEIGHT = 2500.
// Effect options.
// EVENT_PLAYER_UNIT_SPELL_EFFECT.
// private constant string ON_EFFECT_EVENT_FX = ".mdl"
// private constant string ON_CASTER_FX = ".mdl"
// private constant string CASTER_FX_ATTACH_POINT = "origin"
private constant string ON_DAMAGE_UNIT_FX = "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl"
private constant string DAMAGE_FX_ATTACH_POINT = "chest"
// Spell concept.
// EVENT_PLAYER_UNIT_ISSUED_ORDER or EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER.
// private constant boolean IS_IMMEDIATE_ORDER = true
private constant boolean IMPACT_DAMAGES_TREES = false//Requires library IsDestructableTree.
// private constant boolean DAMAGE_FLYING_UNITS = true// Requires USE_COLLISION_Z_FILTER = true in library Missile.
endglobals
// Set if the spell moves along with the caster.
private function IsSpellMovingWithCaster takes unit caster, integer level returns boolean
return true
endfunction
// Set if the caster has to channel the spell.
// In case the spell is channeling, make sure the "follow through time" field of the ability fits the spell duration.
private function IsSpellChanneling takes unit caster, integer level returns boolean
return false
endfunction
// Set how many meteor should be created per second.
// This function is re-evaluated each second, therefore a GetRandomInt() also makes sense here.
private function GetMeteorsPerSecond takes integer level returns integer
return GetRandomInt(21,25)
endfunction
// Set the total spell duration.
// Set the maximum field size in which effects take place.
private constant function GetSpellFieldSize takes integer level returns real
return 500.
endfunction
// Set the expected fly time per meteor.
private function GetMeteorFlyTime takes integer level returns real
return GetRandomReal(.75, 1.)
endfunction
// Filter valid target units. Runs on unit collision.
// Do NOT filter for flying units. This is done internally inside the spell script.
private function FilterUnits takes unit target, player p returns boolean
return UnitAlive(target) and IsUnitEnemy(target, p)
endfunction
// Runs each time before a new meteor is created.
private function GlobalCasterCondition takes unit caster returns boolean
return UnitAlive(caster)
endfunction
// Customize all missile members to your needs. "speed", "source", "owner" and "acceleration" are reserved and will be overriden.
private function CustomizeMeteor takes Misssile missile, unit caster, integer level returns nothing
local real scale = 1.15//GetRandomReal(.8, 1.3)
set missile.scale = scale
set missile.damage =level * 4. *(GetHeroAgi(caster,true)*(1.+(.1*GetHeroLevel(caster))))
set missile.data = level
set missile.collision = 80.*scale
// set missile.collisionZ = 96.*scale// Only required for if you want to damage flying units in mid air.
set missile.model = "war3mapImported\\Bloodstone Arrow.mdx"
endfunction
private struct PhantomShredder extends array
private static method onPeriod takes Misssile missile returns boolean
if missile.data == 256 then
set missile.model = "war3mapImported\\Jaithys, the Prison Blade.mdx"
endif
set missile.data = missile.data -5
loop
exitwhen missile.effect.moveIterator()
call BlzSetSpecialEffectAlpha(missile.effect.currentHandle(), missile.data)
endloop
return false
endmethod
private static method onFinish takes Misssile missile returns boolean
call missile.effect.clearModels()
return true
endmethod
// Runs when a missile collides with a unit.
static method onCollide takes Misssile missile , unit hit returns boolean
if FilterUnits(hit, missile.owner) then
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(missile.source, hit, missile.damage, false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
call EnableTrigger(TOXIAPOISON)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",hit,"chest"))
//return true
endif
return false
endmethod
implement MisssileStruct
endstruct
// Uses Missile's API.
private struct Meteor extends array
// Runs on any destructable collision. You'll need IsDestructableTree.
// static if LIBRARY_IsDestructableTree and IMPACT_DAMAGES_TREES then
// static method onDestructable takes Misssile missile, destructable hit returns boolean
// if IsTreeAlive(hit) then
// if (missile.damage > (GetWidgetLife(hit) + .405)) then
// call KillDestructable(hit)
// else
// call SetWidgetLife(hit, GetWidgetLife(hit) - missile.damage)
// call SetDestructableAnimation(hit, "stand hit")
// endif
// endif
// return false
// endmethod
//endif
// Runs on any unit collision. Written to hit flying units in mid air.
// Requires Missile_USE_COLLISION_Z_FILTER = true.
// static if Missile_USE_COLLISION_Z_FILTER and DAMAGE_FLYING_UNITS then
// static method onCollide takes Misssile missile, unit hit returns boolean
// if IsUnitType(hit, UNIT_TYPE_FLYING) and FilterUnits(hit, missile.owner) then
// if UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.005), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
// call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
// endif
// endif
// return false
// endmethod
// endif
// Runs when a missile launched from the Armageddon struct is deallocated.
// Written to hit non flying units in collision range.
/* static method onRemove takes Misssile missile returns boolean
local unit u
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
if UnitDamageTargetEx(missile.source, u, missile.damage+(GetWidgetLife(u)*.02*missile.data), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
call DisableTrigger(TOXIAPOISON)
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, u, DAMAGE_FX_ATTACH_POINT))
call EnableTrigger(TOXIAPOISON)
endif
endif
endloop
return true
endmethod*/
static method onCollide takes Misssile missile , unit hit returns boolean
if FilterUnits(hit, missile.owner) then
call UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.025*missile.data), false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
if GetRandomInt(1,100) <= 4 and not IsUnitType(hit,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(hit,SPELL_ID2) != 1 then
call UnitAddAbility(hit,SPELL_ID2)
endif
call AddUnitBonus(hit,BONUS_ARMOR,-13.*missile.data)
endif
return true
endif
return false
endmethod
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Enables the Missile interface for this struct.
implement MisssileStruct
endstruct
private function Random takes nothing returns real
return GetRandomReal(0., 1.)
endfunction
private function GetRandomRange takes real radius returns real
local real r = Random() + Random()
if r > 1. then
return (2 - r)*radius
endif
return r*radius
endfunction
private function CreateMeteor takes unit source, player owner, real centerX, real centerY, real maxRange, integer level , real offsetangle returns nothing
// Get point of creation.
local real theta = 2*bj_PI*Random()
local real radius = GetRandomRange(maxRange)
local real posX = centerX + radius*Cos(theta)
local real posY = centerY + radius*Sin(theta)
local real posX2 = posX + 1400. * Cos(offsetangle * bj_DEGTORAD)
local real posY2 = posY + 1400. * Sin(offsetangle * bj_DEGTORAD)
// Get the fly angle and maximum distance towards it.
local real angle = 2*bj_PI*Random()
local real maxX = centerX + maxRange*Cos(angle)
local real maxY = centerY + maxRange*Sin(angle)
// Get the maximum distance without leaving the field.
//local real dX = posX - maxX
//local real dY = posY - maxY
//local real dX2 = posX2 - maxX
//local real dY2 = posY - maxY
// Between 0 and max distance.
//local Misssile missile = Misssile.create(posX2, posY2, METEOR_START_HEIGHT, angle, SquareRoot(dX*dX + dY*dY)*Random(), 0.)
//local Misssile missile = Misssile.create(posX2, posY2, METEOR_START_HEIGHT, (offsetangle+180.)*bj_DEGTORAD, SquareRoot(dX2*dX2 + dY2*dY2)*Random(), 0.)
local Misssile missile = Misssile.createXYZ(posX2,posY2,METEOR_START_HEIGHT,posX,posY,0.)
//local Misssile missile = Misssile.create(posX, posY, METEOR_START_HEIGHT, 180.*bj_DEGTORAD, 0., 0.)
// Allow user customization.
call CustomizeMeteor(missile, source, level)
// Set or override important missile fields.
set missile.source = source
set missile.owner = owner
set missile.acceleration = 0.
call missile.flightTime2Speed(GetMeteorFlyTime(level))
call Meteor.launch(missile)
endfunction
private struct Armageddon// extends array
// implement Alloc
//
// Members.
unit source
unit target
player user
timer clock
effect fx
// sound snd
//
real centerX
real centerY
real size
real time
real interval
real offsetangle
integer count
// integer order
integer level
// Spell concept members.
//boolean move
// boolean channel
method clear takes nothing returns nothing
// if snd != null then
// call StopSound(snd, true, true)
// set snd = null
//endif
call DestroyEffect(fx)
call ReleaseTimer(clock)
call deallocate()
call BlzEndUnitAbilityCooldown( source, 'A0R8' )
set MultiRains[GetUnitUserData(source)] = MultiRains[GetUnitUserData(source)] - 1
//call BJDebugMsg("Ended:"+I2S(MultiRains[GetUnitUserData(source)]))
set source = null
set clock = null
set target = null
set user = null
set fx = null
endmethod
static method onPeriodic takes nothing returns nothing
local real angle
local thistype this = GetTimerData(GetExpiredTimer())
local boolean fire = (count > 0)
// Evaluate global conditions.
if time <= 0. then
call clear()
else
// Update time members.
set time = time - interval
set count = count - 1
if count <= 0 then
set count = GetMeteorsPerSecond(level)
set interval = 1./IMaxBJ(1, count)
call TimerStart(clock, interval, true, function thistype.onPeriodic)
endif
// Update the center position.
if UnitAlive(target) then
set angle = bj_RADTODEG * Atan2(GetUnitY(target) - centerY, GetUnitX(target) - centerX)
set centerX = centerX + 45. * Cos(angle * bj_DEGTORAD)
set centerY = centerY + 45. * Sin(angle * bj_DEGTORAD)
else
set GLOBAL_CASTER = source
set target = ZEE(null,centerX,centerY,3000.,(Condition(function FilterUnits2)))
if target != null then
set angle = bj_RADTODEG * Atan2(GetUnitY(target) - centerY, GetUnitX(target) - centerX)
set centerX = centerX + 45. * Cos(angle * bj_DEGTORAD)
set centerY = centerY + 45. * Sin(angle * bj_DEGTORAD)
endif
endif
//if (snd != null) then
// call SetSoundPosition(snd, centerX, centerY, 0.)
// endif
if fire then
// Create a new meteor.
call CreateMeteor(source, user, centerX, centerY, size, level,offsetangle )
endif
endif
endmethod
endstruct
private function Handler takes nothing returns nothing
local integer i = 0
local integer j = 0
local unit u
local integer uIndex
local unit caster
local integer array unitsToRemove
local integer numUnitsToRemove = 0
loop
exitwhen i >= numBurningUnits
set u = burningUnits[i]
if u != null then // Check if unit is removed
set uIndex = GetUnitUserData(u)
set caster = burnCasters[uIndex]
if UnitAlive(u) then
// Apply burn damage based on stacks...
call DisableTrigger(EVERLASTINGFLAMEBURN)
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(caster,u,((BlzGetUnitMaxHP(caster)*.02)*EverlastingBurnStacks[uIndex])+(EverlastingBurnStacks[uIndex]*GetWidgetLife(u)*.0002),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call EnableTrigger(TOXIAPOISON)
call EnableTrigger(EVERLASTINGFLAMEBURN)
set burnDurations[uIndex] = burnDurations[uIndex] - 1
if burnDurations[uIndex] <= 0 then
set EverlastingBurnStacks[uIndex] = EverlastingBurnStacks[uIndex] - 1
if EverlastingBurnStacks[uIndex] > 0 then
else
// End burn effect...
call UnitRemoveAbility(u,'A0C2')
call UnitRemoveAbility(u,'A0EH')
call UnitRemoveAbility(u,'A0EJ')
set EverlastingBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
endif
else
// Unit is dead, remove from burningUnits list...
call UnitRemoveAbility(u,'A0C2')
call UnitRemoveAbility(u,'A0EH')
call UnitRemoveAbility(u,'A0EJ')
set EverlastingBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
else
// Unit is removed, mark it for removal from burningUnits list...
set unitsToRemove[numUnitsToRemove] = i
set numUnitsToRemove = numUnitsToRemove + 1
endif
set i = i + 1
endloop
// Remove marked units from burningUnits list...
set i = numUnitsToRemove - 1
loop
exitwhen i < 0
set j = unitsToRemove[i]
set burningUnits[j] = burningUnits[numBurningUnits - 1]
set numBurningUnits = numBurningUnits - 1
if numBurningUnits <= 0 then
// Pause the timer if there are no burning units
call PauseTimer(globalTimer)
endif
set i = i - 1
endloop
set caster = null
set u = null
endfunction
private function PSHandler takes nothing returns nothing
local timer t = GetExpiredTimer()
local PS data = GetTimerData(t)
local Misssile m
local real x
local real y
local real a
local real d
if data.dur <= 0 or not UnitAlive(data.u) then
set MultiSwords[GetUnitUserData(data.u)] = MultiSwords[GetUnitUserData(data.u)] - 1
call ReleaseTimer(t)
call data.destroy()
else
set a = GetUnitFacing(data.u)
set x = GetUnitX(data.u) + 400. * Cos((a-180.) * bj_DEGTORAD)
set y= GetUnitY(data.u) + 400. * Sin((a-180.) * bj_DEGTORAD)
if GetRandomInt(0,1) == 1 then
//set d = GetRandomReal(0.,162.5)
set d = GetRandomReal(0.,147.5)
set x = x + d * Cos((a-90.) * bj_DEGTORAD)
set y= y + d * Sin((a-90.) * bj_DEGTORAD)
else
//set d = GetRandomReal(0.,162.5)
set d = GetRandomReal(0.,147.5)
set x = x + d * Cos((a+90.) * bj_DEGTORAD)
set y= y + d * Sin((a+90.) * bj_DEGTORAD)
endif
//set m = Misssile.create(x, y, 65., (a+GetRandomReal(-5.5,5.5))*bj_DEGTORAD, 1000., 65.)
set m = Misssile.create(x, y, 65., (a+GetRandomReal(-.05,.05))*bj_DEGTORAD, 1000., 65.)
set m.source = data.u
set m.speed = 57.5
//set m.acceleration = 7.03125
//set m.scale = 1.4
set m.scale = 1.3
//set m.spin = 90.*bj_DEGTORAD
// set m.model = "war3mapImported\\Jaithys, the Prison Blade.mdx"
set m.data = 256
//set m.arc = 15.*bj_DEGTORAD
set m.collision = 16.
//set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
set m.damage=data.damage
call PhantomShredder.launch(m)
set data.dur = data.dur - .05
call SetTimerData(t,data)
call TimerStart(t,.05,false,function PSHandler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = 0
local integer i2 = 0
local integer i3 = 0
local integer i4 = 0
local integer i5 = 0
local integer i6 = 0
local integer i7 = 0
local integer i8 = 0
local integer i9 = 0
local integer i10 = 0
local item it
local unit a = GetEventDamageSource()
local timer t
local TM data
local integer str
local real d = GetEventDamage()
local integer id = GetPlayerId(GetOwningPlayer(a))+1
local effect fx
local real d2 = 0
local Armageddon dex
local PS data2
local integer i11 = 0
local boolean array bi
loop
exitwhen i2 > 5
set it = UnitItemInSlot(a,i2)
if GetItemTypeId(it) == 'I049'then
set i3 = i3 + 1
endif
if GetItemTypeId(it) == 'I030'then
set i7 = i7 + 6
endif
if GetItemTypeId(it) == 'I00I'then
set i7 = i7 + 4
endif
if GetItemTypeId(it) == 'I01N'then
set i7 = i7 + 4
endif
if GetItemTypeId(it) == 'I02W'then
set i7 = i7 + 6
endif
if GetItemTypeId(it) == 'I05R' then
set i4 = i4 + 75
set i7 = i6 + 6
set i10 = i10 + 1
endif
if GetItemTypeId(it) == 'I00F'then
set i4 = i4 + 10
endif
if GetItemTypeId(it) == 'I00W'then
set i4 = i4 + 25
set i7 = i7 + 6
endif
if GetItemTypeId(it) == 'I036' then
set i4 = i4 + 45
endif
if GetItemTypeId(it) == 'I048' then
set i4 = i4 + 65
endif
if GetItemTypeId(it) == 'I02U'then
set i4 = i4 + 75
set i7 = i7 + 6
set i8 = i8 + 1
endif
if GetItemTypeId(it) == 'I02V'then
set i4 = i4 + 35
set i7 = i7 + 6
endif
if GetItemTypeId(it) == 'I04H'then
set i4 = i4 + 15
endif
if GetItemTypeId(it) == 'I04O'then
set i4 = i4 + 25
endif
if GetItemTypeId(it) == 'I04P'then
set i4 = i4 + 50
endif
if GetItemTypeId(it) == 'I02G'then
set i4 = i4 + 50
set i10 = i10 + 1
endif
if GetItemTypeId(it) == 'I02O'then
set i4 = i4 + 100
set i9 = i9 + 1
endif
if GetItemTypeId(it) == 'I02N'then
set i4 = i4 + 50
endif
if GetItemTypeId(it) == 'I02M'then
set i4 = i4 + 35
endif
if GetItemTypeId(it) == 'I05J'then
set i4 = i4 + 35
endif
if GetItemTypeId(it) == 'I05M'then
set i4 = i4 + 75
endif
if GetItemTypeId(it) == 'I04W' or GetItemTypeId(it) == 'I04X' then
set i4 = i4 + 36
set i5 = i5 + 8
endif
if GetItemTypeId(it) == 'I04R' or GetItemTypeId(it) == 'I04S' then
set i6 = i6 + 8
endif
set i2 = i2 + 1
endloop
set i2 = 0
loop
exitwhen i2 > 5
set it = UnitItemInSlot(u,i2)
if GetItemTypeId(it) == 'I049'then
set i11 = i11 + 1
endif
set i2 = i2 + 1
endloop
call BlzSetEventDamage(d*(1.+(i4*.01)))
if GetRandomInt(1,100) <= i10*20 and MultiSwords[GetUnitUserData(LC[id])] < 1 and UnitAlive(LC[id]) then
set MultiSwords[GetUnitUserData(LC[id])] = MultiSwords[GetUnitUserData(LC[id])] + 1
set data2 = PS.create()
set t = NewTimer()
set data2.u = LC[id]
set data2.damage = (((d*(1.+(i4*.01)))*.075)+(GetHeroAgi(data2.u,true)*5.*(1.+(.1*GetHeroLevel(data2.u)))))*i10
set data2.dur = 5. + (GetHeroAgi(data2.u,true)*.005)
call SetTimerData(t,data2)
call TimerStart(t,.01,false,function PSHandler)
endif
if GetRandomInt(1,100) <= i9*20 and MultiRains[GetUnitUserData(LC[id])] < 1 then
set MultiRains[GetUnitUserData(LC[id])] = MultiRains[GetUnitUserData(LC[id])] + 1
//call BJDebugMsg("Started: "+I2S(MultiRains[GetUnitUserData(LC[id])]))
set dex = Armageddon.create()
set dex.source = LC[id]
set dex.target = u
set dex.level = i9
set dex.offsetangle = GetRandomReal(0.,360.)
set dex.clock = NewTimerEx(dex)
set dex.user = Player(id-1)
// set dex.order = GetUnitCurrentOrder(a)
set dex.time = (10. + (GetHeroAgi(LC[id],true)*.005))
if dex.time > 30. then
set dex.time = 30.
endif
set dex.count = GetMeteorsPerSecond(i9)
//set dex.move = IsSpellMovingWithCaster(a, i9)
set dex.size = GetSpellFieldSize(i9)*.5
//set dex.channel = IsSpellChanneling(a, i9)
if UnitAlive(LC[id]) and not IsUnitHidden(LC[id]) and not IsUnitPaused(LC[id]) and not UnitIsCasting[GetUnitUserData(LC[id])] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I02O' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
//call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
call UnitAddItemToSlotById(LC[id],'I02O',i)
call BlzStartUnitAbilityCooldown( LC[id], 'A0R8', dex.time )
endif
set i = i + 1
endloop
else
call BlzStartUnitAbilityCooldown( LC[id], 'A0R8', dex.time )
endif
set dex.centerX = GetUnitX(u)
set dex.centerY = GetUnitY(u)
// Run effects.
//set dex.snd = GetSoundHandle()
// if dex.snd != null then
// call SetSoundPosition(dex.snd, dex.centerX, dex.centerY, 0.)
// endif
//call DestroyEffect(AddSpecialEffect(ON_EFFECT_EVENT_FX, dex.centerX, dex.centerY))
//set dex.fx = AddSpecialEffectTarget(ON_CASTER_FX, source, CASTER_FX_ATTACH_POINT)
// Start the spell.
set dex.interval = 1./IMaxBJ(1, dex.count)
call TimerStart(dex.clock, dex.interval, true, function Armageddon.onPeriodic)
endif
if i7 >0 or i8 >0 then
if i8 > 0 then
set d2 = ((GetHeroStr(LC[id],true)*2.)*(1.+(.05*GetHeroLevel(LC[id]))))*i8
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx( a, u, d2, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call EnableTrigger(TOXIAPOISON)
endif
call SetWidgetLife(a,GetWidgetLife(a)+((d2*.15)+((d*(1.+(i4*.01)))*(i7*.01))))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",a,"origin"))
endif
if GetRandomInt(1,100) <= i5+i6 and MultiRifts[GetUnitUserData(LC[id])] < 5 then
set MultiRifts[GetUnitUserData(LC[id])] = MultiRifts[GetUnitUserData(LC[id])] + 1
set data = TM.create()
set t = NewTimer()
set data.u = a
set data.t = u
set data.id = id
set str = GetHeroStr(data.u,true)
set data.damage = .25*((((d*(1.+(i4*.01))) * .15 )+(str*2.)+((str*2.)*GetHeroLevel(a)*.05))*i5)+((((d*(1.+(i4*.01))) * .05 )+(str*.5)+((str*.5)*GetHeroLevel(a)*.05))*i6)
set data.dur = 8. + (str/300)
set data.x = GetUnitX(data.u)
set data.y = GetUnitY(data.u)
set GLOBAL_CASTER = data.u
set GLOBALDAMAGE = data.damage
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,275.,Filter(function FilterActions))
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(fx,1.75)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectTimeScale(fx,1.25)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Cleaver.mdx",data.x,data.y)
call BlzSetSpecialEffectYaw(fx,data.yaw*bj_DEGTORAD)
call DestroyEffect(fx)
call SetTimerData(t,data)
call TimerStart(t,.25,false,function HandlerA)
endif
if i3 > 0 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Orange.mdx",u,"chest"))
if EverlastingBurnStacks[GetUnitUserData(u)] == 0 then
call UnitAddAbility(u,'A0C2')
call UnitAddAbility(u,'A0EH')
call UnitAddAbility(u,'A0EJ')
set burningUnits[numBurningUnits] = u
if numBurningUnits == 0 then
call TimerStart(globalTimer, 1.0, true, function Handler)
endif
set numBurningUnits = numBurningUnits + 1
endif
set EverlastingBurnStacks[GetUnitUserData(u)] = EverlastingBurnStacks[GetUnitUserData(u)] + i3
set burnCasters[GetUnitUserData(u)] = a
set burnDurations[GetUnitUserData(u)] = 10
endif
if i11 > 0 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Orange.mdx",a,"chest"))
if EverlastingBurnStacks[GetUnitUserData(a)] == 0 then
call UnitAddAbility(a,'A0C2')
call UnitAddAbility(a,'A0EH')
call UnitAddAbility(a,'A0EJ')
set burningUnits[numBurningUnits] = a
if numBurningUnits == 0 then
call TimerStart(globalTimer, 1.0, true, function Handler)
endif
set numBurningUnits = numBurningUnits + 1
endif
set EverlastingBurnStacks[GetUnitUserData(a)] = EverlastingBurnStacks[GetUnitUserData(a)] + i11
set burnCasters[GetUnitUserData(a)] = u
set burnDurations[GetUnitUserData(a)] = 10
endif
set fx = null
set t = null
set a= null
set it= null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local unit a = GetEventDamageSource()
if (GetUnitAbilityLevel(a,'A0IM')==1 or GetUnitAbilityLevel(u,'A0IJ')==1) and IsUnitEnemy(a,GetOwningPlayer(u)) and GetEventDamage() >0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if(BI[NI])==(LN)then
call Actions()
endif
else
if(CI[NI]) and BlzGetEventIsAttack() then
call Actions()
endif
endif
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set globalTimer = NewTimer()
set EVERLASTINGFLAMEBURN=CreateTrigger()
call TriggerAddCondition(EVERLASTINGFLAMEBURN,Condition(function Conditions))
call MOE(II,(EVERLASTINGFLAMEBURN))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SpellAmp initializer OnInit
globals
trigger SPELLDAMAGETRIG
private constant integer SPELL_ID = 'A0NE'
private unit CASTER
private group GROUP2
boolean array SpellsparkCooldown
endglobals
private struct SP
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct FCL
unit u
unit d
integer i
group g
real dmg
integer i2
static method create takes nothing returns FCL
local FCL data = FCL.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local boolean b
local unit f = GetFilterUnit()
if UnitAlive(f) and IsUnitEnemy(CASTER,GetOwningPlayer(f)) and not IsUnitType(f,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(f,UNIT_TYPE_STRUCTURE) and not IsUnitInGroup(f,GROUP2) and GetUnitAbilityLevel(f,'Aloc') != 1 then
set b = true
else
set b = false
endif
set f = null
return b
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local SP data = GetTimerData(t)
call BlzEndUnitAbilityCooldown( data.u, 'A0R7' )
set SpellsparkCooldown[GetUnitUserData(data.u)]=false
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FCL data = GetTimerData(t)
local effect fx
local unit u = null
//local real z1
//local real z2
//local real x1
//local real x2
//local real y1
//local real y2
//local real z1
//local real z2
if UnitAlive(data.d) then
call DisableTrigger(SPELLDAMAGETRIG)
if not IsUnitType(data.d, UNIT_TYPE_HERO) then
call UnitDamageTargetEx( data.u, data.d, data.dmg, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
if GetUnitAbilityLevel(data.d,'A0O5') != 1 then
call UnitAddAbility(data.d,'A0O5')
endif
call AddUnitBonus(data.d,BONUS_MAGIC_RESISTANCE,-.04*data.i2)
else
call UnitDamageTargetEx( data.u, data.d, data.dmg*.005, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
endif
call EnableTrigger(SPELLDAMAGETRIG)
endif
set fx = AddSpecialEffectTarget("war3mapImported\\Psionic Shot Purple.mdx",data.d,"chest")
//set fx = AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",data.d,"chest")
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect(fx)
call GroupAddUnit(data.g,data.d)
set CASTER = data.u
set GROUP2 = data.g
set u = ZEE(null,GetUnitX(data.d),GetUnitY(data.d),600.,Condition(function FilterActions))
if data.i == 0 or u == null then
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i - 1
//call MoveLocation(LOC,GetUnitX(data.d),GetUnitY(data.d))
//set z1 = GetLocationZ(LOC) + 40.
//call MoveLocation(LOC,GetUnitX(u),GetUnitY(u))
//set z2 = GetLocationZ(LOC) + 30.
//set x1 = GetUnitX(data.d)
//set x2 = GetUnitX(u)
//set y1 = GetUnitY(data.d)
//set y2 = GetUnitY(u)
//set z1 = GetUnitZ(data.d)
//set z2 = GetUnitZ(u)
call TimedL.P2P(AddLightningEx("MYNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+65.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+60.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+60.),data.d,u,.4,GetUnitZ(data.d)+60.,GetUnitZ(u)+60.,1.,.4)
set data.d = u
call SetTimerData(t,data)
call TimerStart(t,.075,false,function Handler2)
endif
set u = null
set fx = null
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer i = 0
local item it
local integer i2 = 0
local real d = GetEventDamage()
local integer id = 1+GetPlayerId(GetOwningPlayer(a))
local timer t
local FCL data2
local integer i3 = 0
local integer i4 = 0
local timer t2
local SP data
local integer int
local boolean array bi
if GetUnitAbilityLevel(LC[id],SPELL_ID) != 0 and GetEventDamage() >0 and BI[NI] != DAMAGE_TYPE_DISEASE then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])!=(LN) then
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I051' or GetItemTypeId(it) == 'I053' or GetItemTypeId(it) == 'I037' or GetItemTypeId(it)== 'I02Y' or GetItemTypeId(it)== 'I05I' then
set i2=i2+GetItemLevel(it)
endif
if GetItemTypeId(it) == 'I04T' then
set i2=i2+35
endif
if GetItemTypeId(it) == 'I05P' then
set i2=i2+40
endif
if GetItemTypeId(it) == 'I05O' then
set i2=i2+25
endif
if GetItemTypeId(it) == 'I053'then
set i3 = i3 + 1
set i4 = i4 + 15
endif
set i = i + 1
endloop
//call BJDebugMsg("Spell Damage Amplified to"+R2S(d*(1.+(i2*.01))))
if not IsUnitType(u,UNIT_TYPE_HERO) then
call BlzSetEventDamage(d*(1.+(i2*.01)))
endif
if i3 > 0 and GetRandomInt(1,100) <= i4 and not SpellsparkCooldown[GetUnitUserData(LC[id])] then
set t = NewTimer()
set data2 = FCL.create()
set data2.u = LC[id]
set data2.d = u
set int = GetHeroInt(LC[id],true)
set data2.i2 = i3
set data2.i = 12 + (int/100)
set data2.dmg = ((d*.2)+(int*9)+((int*9)*GetHeroLevel(data2.u)*.075))*i3*(1.+(i2*.01))
call TimedL.P2P(AddLightningEx("MYNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+65.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+60.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+60.),data2.u,data2.d,.4,GetUnitZ(data2.u)+60.,GetUnitZ(data2.d)+60.,1.,.4)
set t = NewTimer()
call SetTimerData(t,data2)
set t2 = NewTimer()
set data = SP.create()
set data.u = LC[id]
set SpellsparkCooldown[GetUnitUserData(LC[id])]=true
if UnitAlive(LC[id]) and not IsUnitHidden(LC[id]) and not IsUnitPaused(LC[id]) and not UnitIsCasting[GetUnitUserData(LC[id])] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I053' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
//call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
call UnitAddItemToSlotById(LC[id],'I053',i)
call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
endif
set i = i + 1
endloop
else
call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
endif
call SetTimerData(t2,data)
call TimerStart(t2,1.,false,function Handler)
call TimerStart(t,.075,false,function Handler2)
endif
endif
else
if not BlzGetEventIsAttack() then
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I051' or GetItemTypeId(it) == 'I053' or GetItemTypeId(it) == 'I037' or GetItemTypeId(it)== 'I02Y' or GetItemTypeId(it)== 'I05I' then
set i2=i2+GetItemLevel(it)
endif
if GetItemTypeId(it) == 'I04T' then
set i2=i2+35
endif
if GetItemTypeId(it) == 'I05P' then
set i2=i2+40
endif
if GetItemTypeId(it) == 'I05O' then
set i2=i2+40
endif
if GetItemTypeId(it) == 'I053'then
set i3 = i3 + 1
set i4 = i4 + 25
endif
set i = i + 1
endloop
//call BJDebugMsg("Spell Damage Amplified to"+R2S(d*(1.+(i2*.01))))
if not IsUnitType(u,UNIT_TYPE_HERO) then
call BlzSetEventDamage(d*(1.+(i2*.01)))
endif
if i3 > 0 and GetRandomInt(1,100) <= i4 and not SpellsparkCooldown[GetUnitUserData(LC[id])] then
set t = NewTimer()
set data2 = FCL.create()
set data2.u = LC[id]
set data2.d = u
set int = GetHeroInt(LC[id],true)
set data2.i2 = i3
set data2.i = 12 + (int/100)
set data2.dmg = ((d*.2)+(int*9)+((int*9)*GetHeroLevel(data2.u)*.075))*i3*(1.+(i2*.01))
call TimedL.P2P(AddLightningEx("MYNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+65.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+65.),.4,1.,.4)
set t = NewTimer()
call SetTimerData(t,data2)
set t2 = NewTimer()
set data = SP.create()
set data.u = LC[id]
set SpellsparkCooldown[GetUnitUserData(LC[id])]=true
if UnitAlive(LC[id]) and not IsUnitHidden(LC[id]) and not IsUnitPaused(LC[id]) and not UnitIsCasting[GetUnitUserData(LC[id])] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I053' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
//call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
call UnitAddItemToSlotById(LC[id],'I053',i)
call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
endif
set i = i + 1
endloop
else
call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
endif
call SetTimerData(t2,data)
call TimerStart(t2,1.,false,function Handler)
call TimerStart(t,.075,false,function Handler2)
endif
endif
endif
endif
set t2 = null
set t = null
set it = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set SPELLDAMAGETRIG = CreateTrigger()
call MOE(II, (SPELLDAMAGETRIG ))
call TriggerAddCondition(SPELLDAMAGETRIG , Condition(function Actions))
endfunction
endscope
scope ArcaneBarrage initializer OnInit
globals
private constant integer SPELL_ID = 'A0RY'
endglobals
private struct ArcaneBarrage extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
if hit == missile.target then
call UnitDamageTargetEx(missile.source, hit,missile.damage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private function Actions takes nothing returns nothing
local Misssile m
local real x
local real y
local real a
local unit c = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local integer i = 0
local real curve = 0.
local real dmg
//local integer number = 1
set x = GetUnitX(c)
set y = GetUnitY(c)
set i = GetRandomInt(8,12)
//set i = 8
set curve = 180./(i+1)
set dmg = (GetHeroInt(c,true)*3.)*(1.+(GetHeroLevel(c)*.075))
loop
exitwhen i == 0
set a = Atan2(y - GetUnitY(u), x - GetUnitX(u))
set m = Misssile.create(x, y, 65., a, 1000., 65.)
set m.source = c
set m.target = GetSpellTargetUnit()
set m.speed = GetRandomReal(24.,28.)
//set m.acceleration = 7.03125
set m.scale = 1.
set m.model = "war3mapImported\\Firebrand Shot Blue.mdx"
set m.arc = 10.*bj_DEGTORAD
set m.collision = 16.
//set m.spin = 270.*bj_DEGTORAD
set m.curve = curve* i * bj_DEGTORAD
set m.owner = GetOwningPlayer(c)
set m.damage = dmg
//call BJDebugMsg(I2S(number))
//set number = number + 1
call ArcaneBarrage.launch(m)// Launch is implemented via module MissileStruct
set i = i - 1
endloop
set u = null
set c = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope Overload initializer OnInit
globals
private timer TIME
real array HeroX
real array HeroY
integer array OverloadCharges
endglobals
private function Actions takes nothing returns nothing
local integer i = 0
local integer i2 = 0
local item it
local real d
local real dx
local real dy
local real x
local real y
loop
exitwhen i > 9
if UnitAlive(LC[1+i]) and GetUnitAbilityLevel(LC[1+i],'A0Q7')==1 and OverloadCharges[i]< 100 then
set x = GetUnitX(LC[1+i])
set y = GetUnitY(LC[1+i])
set dx = x - HeroX[i]
set dy = y - HeroY[i]
set d = SquareRoot(dx * dx + dy * dy)
set HeroX[i] = x
set HeroY[i]= y
if d < 1000. then
set d = d*.04
if d > 10. then
set d = 10.
endif
set OverloadCharges[i] = OverloadCharges[i] + R2I(d)
if OverloadCharges[i] >= 100 then
set OverloadCharges[i] = 100
call UnitAddAbility(LC[1+i],'A0Q9')
endif
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[1+i],i2)
if GetItemTypeId(it) == 'I04I' or GetItemTypeId(it) == 'I054' or GetItemTypeId(it) == 'I04V' or GetItemTypeId(it) == 'I05U' then
call SetItemCharges(it,OverloadCharges[i])
endif
set i2 = i2 + 1
endloop
endif
endif
set i2 = 0
set i = i + 1
endloop
set it = null
endfunction
private function OnInit takes nothing returns nothing
set TIME= NewTimer()
call TimerStart(TIME,.1,true,function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope OverloadOnHit initializer OnInit
globals
private constant integer SPELL_ID = 'A0Q7'
private unit CASTER
private real DAMAGE
private group GROUP2
private location LOC = Location(0,0)
group GLOBALGROUP = CreateGroup()
integer GLOBALINTEGER
//* Damage options.
private constant integer CHAOTIC_BOULDER_ABILITY = 'A0Q7'
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
//* Effect options.
private constant string ON_EFFECT_FX = "war3mapImported\\OrbOfLightning.mdx"
private constant string ON_DAMAGE_BIG_FX = "war3mapImported\\Electric Spark - Classic.mdx"
endglobals
private function FilterUnits takes unit target, player owner returns boolean
return UnitAlive(target) and IsUnitEnemy(target, owner) and not IsUnitType(target, UNIT_TYPE_FLYING)
endfunction
//* Set the travel distance.
private function GetSmallBoulderFlyDistance takes integer level returns real
return GetRandomReal(50., 400.)
endfunction
//* Set the explosion radius on impact.
private constant function GetExplosionRadius takes integer level returns real
return 224. + (0.*level)
endfunction
//* Set the amount of fragments.
private function GetSmallBoulderCount takes integer level returns integer
return GetRandomInt(12, 16)
endfunction
//* Customize all missile members to your needs.
private function CustomizeSmallMissile takes Misssile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 1.5)*distance/200.)
//set missile.damage = 10. + 10.*level
set missile.collision = 116.
set missile.arc = GetRandomReal(80., 85.)*bj_DEGTORAD
set missile.model = "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
set missile.scale = 0.7
endfunction
//* Customize all missile members to your needs.
private function CustomizeBigMissile takes Misssile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/1800.)
//set missile.damage = 200. + 70.*level
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 200.
set missile.model = "war3mapImported\\GreatElderHydraLightningOrbV.107.mdx"
set missile.scale = 1.8
endfunction
//* Uses Missile's API. Add or remove whatever you need.
private struct ChaoticBoulder extends array
//* Only living trees are valid targets.
private static method createSmallBoulders takes Misssile big returns nothing
local integer level = GetUnitAbilityLevel(big.source, CHAOTIC_BOULDER_ABILITY)
local integer dex = 0
local integer max = 10 + (GetHeroAgi(big.source,true)/200)
local Misssile small
loop
exitwhen (dex >= max)
set small = Misssile.create(big.x, big.y, 0., GetRandomReal(-bj_PI, bj_PI), GetSmallBoulderFlyDistance(level), 0.)
call CustomizeSmallMissile(small, small.origin.distance, level)
set small.source = big.source
set small.owner = big.owner
set small.damage = big.damage*.2
set small.data = 0
call thistype.launch(small)
set dex = dex + 1
endloop
endmethod
//* Damages close unit on missile removal.
private static method onRemove takes Misssile missile returns boolean
local unit u
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
call UnitDamageTargetEx(missile.source, u, missile.damage, false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
endif
endloop
//* Detect big boulder.
if (missile.data == -1) then
//* Runs effects.
call DestroyEffect(AddSpecialEffect(ON_DAMAGE_BIG_FX, missile.x, missile.y))
call createSmallBoulders(missile)
endif
return true
endmethod
implement MisssileStruct
endstruct
private struct FCL
unit u
unit d
integer i
group g
real dmg
static method create takes nothing returns FCL
local FCL data = FCL.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct LS
unit c
real dmg
real x
real y
integer i
method destroy takes nothing returns nothing
set this. c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local boolean b
local unit f = GetFilterUnit()
if UnitAlive(f) and IsUnitEnemy(CASTER,GetOwningPlayer(f)) and not IsUnitType(f,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(f,UNIT_TYPE_STRUCTURE) and not IsUnitInGroup(f,GROUP2) and GetUnitAbilityLevel(f,'Aloc') != 1 then
set b = true
else
set b = false
endif
set f = null
return b
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FCL data = GetTimerData(t)
local effect fx
local unit u = null
//local real z1
//local real z2
//local real x1
//local real x2
//local real y1
//local real y2
//local real z1
//local real z2
if UnitAlive(data.d) then
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx( data.u, data.d, data.dmg, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
call EnableTrigger(TOXIAPOISON)
endif
set fx = AddSpecialEffectTarget("war3mapImported\\Psionic Shot Blue.mdx",data.d,"chest")
//set fx = AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",data.d,"chest")
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect(fx)
call GroupAddUnit(data.g,data.d)
set CASTER = data.u
set GROUP2 = data.g
set u = ZEE(null,GetUnitX(data.d),GetUnitY(data.d),600.,Condition(function FilterActions))
if data.i == 0 or u == null then
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i - 1
//call MoveLocation(LOC,GetUnitX(data.d),GetUnitY(data.d))
//set z1 = GetLocationZ(LOC) + 40.
//call MoveLocation(LOC,GetUnitX(u),GetUnitY(u))
//set z2 = GetLocationZ(LOC) + 30.
//set x1 = GetUnitX(data.d)
//set x2 = GetUnitX(u)
//set y1 = GetUnitY(data.d)
//set y2 = GetUnitY(u)
//set z1 = GetUnitZ(data.d)
//set z2 = GetUnitZ(u)
call TimedL.P2P(AddLightningEx("BLNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+65.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+60.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+60.),data.d,u,.4,GetUnitZ(data.d)+60.,GetUnitZ(u)+60.,1.,.4)
set data.d = u
call SetTimerData(t,data)
call TimerStart(t,.075,false,function Handler2)
endif
set u = null
set fx = null
set t = null
endfunction
private function FilterActions2 takes nothing returns boolean
local unit f = GetFilterUnit()
local effect fx
if UnitAlive(f) and IsUnitEnemy(CASTER,GetOwningPlayer(f)) then
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(CASTER, f, DAMAGE, false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
call EnableTrigger(TOXIAPOISON)
set fx = AddSpecialEffectTarget("war3mapImported\\Psionic Shot Blue.mdx",f,"chest")
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect(fx)
endif
set fx = null
set f = null
return false
endfunction
private function Handler3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local LS data = GetTimerData(t)
local effect fx
set fx = AddSpecialEffect("war3mapImported\\Electric Spark - Classic.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx,.5)
call DestroyEffect(fx)
call MoveLocation(LOC,data.x,data.y)
call TimedL.P2P(AddLightningEx("BLNL",true,data.x,data.y,4000.,data.x,data.y,GetLocationZ(LOC)),.4,1.,.4)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\LaserStrikeSingle.mdx",data.x,data.y))
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange(GLOBALGROUP,data.x,data.y,185.,Filter(function FilterActions2))
set data.x = data.x + GetRandomReal(-200.,200.)
set data.y = data.y + GetRandomReal(-200.,200.)
set data.i = data.i - 1
if data.i == 0 then
call data.destroy()
call ReleaseTimer(t)
else
call TimerStart(t,GetRandomReal(.1,.3),false, function Handler3)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local integer i = GetPlayerId(GetOwningPlayer(a)) + 1
local unit u = GetTriggerUnit()
local timer t
local FCL data2
local item it
local integer i2 = 0
local integer i3 = 0
local integer i4 = 0
local integer str
local integer agi
local integer int
local real x
local real y
local Misssile missile
local timer timer2
local LS data3
local integer c1 = 0
local integer l1 = 0
if (GetUnitAbilityLevel(a,SPELL_ID) != 0 or GetUnitAbilityLevel(a,'A0Q9') != 0) and GetEventDamage() >0 and IsUnitEnemy(u,GetOwningPlayer(a)) and a == LC[i] then
if(J5V[(ROX((GetUnitTypeId(a))))]) then
if (BI[NI])==(LN) then
if OverloadCharges[i-1] == 100 then
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[i],i2)
if GetItemTypeId(it) == 'I04I' then
set i3 = i3 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I054' then
set c1 = c1 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I04V' then
set i4 = i4 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I05U' then
set l1 = l1 + 1
call SetItemCharges(it,0)
endif
set i2 = i2 + 1
endloop
if i3 > 0 or c1 > 0 then
set t = NewTimer()
set data2 = FCL.create()
set data2.u = a
set data2.d = u
set str = GetHeroStr(data2.u,true)
set agi = GetHeroAgi(data2.u,true)
set int = GetHeroInt(data2.u,true)
if str >= agi and str >= int then
set data2.i = 12 + (str/200)
set data2.dmg = (((str*12.)+((str*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((str*10.)+((str*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
if agi >= str and agi >= int then
set data2.i = 12 + (agi/200)
set data2.dmg = (((agi*12.)+((agi*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((agi*10.)+((agi*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
if int >= agi and int >= str then
set data2.i = 12 + (int/200)
set data2.dmg = (((int*12.)+((int*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((int*10.)+((int*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
call TimedL.P2P(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+65.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+60.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+60.),data2.u,data2.d,.4,GetUnitZ(data2.u)+60.,GetUnitZ(data2.d)+60.,1.,.4)
set t = NewTimer()
call SetTimerData(t,data2)
call TimerStart(t,.075,false,function Handler2)
endif
if i4 > 0 then
/*
set x = GetUnitX(a)
set y = GetUnitY(a)
set str = GetHeroStr(a,true)
set agi = GetHeroAgi(a,true)
set int = GetHeroInt(a,true)
set missile = Misssile.createXYZ(x, y, GetUnitFlyHeight(a), GetUnitX(u), GetUnitY(u), 0.)
call CustomizeBigMissile(missile, missile.origin.distance, i4)
if str >= agi and str >= int then
set missile.damage = ((GetEventDamage()*3.)+(str*20.)+((str*20.)*GetHeroLevel(a)*.05))*i4
endif
if agi >= str and agi >= int then
set missile.damage = ((GetEventDamage()*3.)+(agi*20.)+((agi*20.)*GetHeroLevel(a)*.05))*i4
endif
if int >= agi and int >= str then
set missile.damage = ((GetEventDamage()*3.)+(int*20.)+((int*20.)*GetHeroLevel(a)*.05))*i4
endif
set missile.source = a
set missile.data = -1
set missile.owner = GetOwningPlayer(a)
call ChaoticBoulder.launch(missile)
*/
set data3 = LS.create()
set timer2 = NewTimer()
set data3.c = a
set data3.x = GetUnitX(u)
set data3.y = GetUnitY(u)
set str = GetHeroStr(a,true)
set agi = GetHeroAgi(a,true)
set int = GetHeroInt(a,true)
if str >= agi and str >= int then
set data3.dmg = ((GetEventDamage()*.5)+(str*6.)+((str*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroStr(data3.c,true)/150)
endif
if agi >= str and agi >= int then
set data3.dmg = ((GetEventDamage()*.5)+(agi*6.)+((agi*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroAgi(data3.c,true)/150)
endif
if int >= agi and int >= str then
set data3.dmg = ((GetEventDamage()*.5)+(int*6.)+((int*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroInt(data3.c,true)/150)
endif
if data3.i > 50 then
set data3.i = 50
endif
call SetTimerData(timer2,data3)
call TimerStart(timer2,GetRandomReal(.1,.3),false, function Handler3)
endif
call UnitRemoveAbility(LC[i],'A0Q9')
set OverloadCharges[i-1] = 0
else
set OverloadCharges[i-1] = OverloadCharges[i-1] + 4
if OverloadCharges[i-1] >= 100 then
set OverloadCharges[i-1] = 100
call UnitAddAbility(LC[i],'A0Q9')
endif
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[i],i2)
if GetItemTypeId(it) == 'I04I' or GetItemTypeId(it) == 'I054' then
if OverloadCharges[i-1] == 100 then
call SetItemCharges(it,100)
endif
//call SetItemCharges(it,OverloadCharges[i-1])
endif
if GetItemTypeId(it) == 'I04V' then
//call SetItemCharges(it,OverloadCharges[i-1])
endif
set i2 = i2 + 1
endloop
endif
endif
else
if((CI[NI]) and BlzGetEventIsAttack()) or GetUnitTypeId(a)=='N00D' then
if OverloadCharges[i-1] == 100 then
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[i],i2)
if GetItemTypeId(it) == 'I04I' then
set i3 = i3 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I054' then
set c1 = c1 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I04V' then
set i4 = i4 + 1
call SetItemCharges(it,0)
endif
if GetItemTypeId(it) == 'I05U' then
set l1 = l1 + 1
call SetItemCharges(it,0)
endif
set i2 = i2 + 1
endloop
if i3 > 0 or c1 > 0 then
set t = NewTimer()
set data2 = FCL.create()
set data2.u = a
set data2.d = u
set str = GetHeroStr(data2.u,true)
set agi = GetHeroAgi(data2.u,true)
set int = GetHeroInt(data2.u,true)
if str >= agi and str >= int then
set data2.i = 12 + (str/200)
set data2.dmg = (((str*12.)+((str*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((str*7.5)+((str*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
if agi >= str and agi >= int then
set data2.i = 12 + (agi/200)
set data2.dmg = (((agi*12.)+((agi*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((agi*7.5)+((agi*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
if int >= agi and int >= str then
set data2.i = 12 + (int/200)
set data2.dmg = (((int*12.)+((int*12.)*GetHeroLevel(data2.u)*.05))*i3)+(((int*7.5)+((int*7.5)*GetHeroLevel(data2.u)*.05))*c1)
endif
if GetUnitTypeId(a) == 'N00D' then
set data2.dmg = data2.dmg * .1
endif
call TimedL.P2P(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+65.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+60.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+60.),data2.u,data2.d,.4,GetUnitZ(data2.u)+60.,GetUnitZ(data2.d)+60.,1.,.4)
set t = NewTimer()
call SetTimerData(t,data2)
call TimerStart(t,.075,false,function Handler2)
endif
if i4 > 0 then
/*
set x = GetUnitX(a)
set y = GetUnitY(a)
set str = GetHeroStr(a,true)
set agi = GetHeroAgi(a,true)
set int = GetHeroInt(a,true)
set missile = Misssile.createXYZ(x, y, GetUnitFlyHeight(a), GetUnitX(u), GetUnitY(u), 0.)
call CustomizeBigMissile(missile, missile.origin.distance, i4)
if str >= agi and str >= int then
set missile.damage = ((GetEventDamage()*3.)+(str*20.)+((str*20.)*GetHeroLevel(a)*.05))*i4
endif
if agi >= str and agi >= int then
set missile.damage = ((GetEventDamage()*3.)+(agi*20.)+((agi*20.)*GetHeroLevel(a)*.05))*i4
endif
if int >= agi and int >= str then
set missile.damage = ((GetEventDamage()*3.)+(int*20.)+((int*20.)*GetHeroLevel(a)*.05))*i4
endif
set missile.source = a
set missile.data = -1
set missile.owner = GetOwningPlayer(a)
call ChaoticBoulder.launch(missile)
*/
set data3 = LS.create()
set timer2 = NewTimer()
set data3.c = a
set data3.x = GetUnitX(u)
set data3.y = GetUnitY(u)
set str = GetHeroStr(a,true)
set agi = GetHeroAgi(a,true)
set int = GetHeroInt(a,true)
if str >= agi and str >= int then
set data3.dmg = ((GetEventDamage()*.5)+(str*6.)+((str*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroStr(data3.c,true)/150)
endif
if agi >= str and agi >= int then
set data3.dmg = ((GetEventDamage()*.5)+(agi*6.)+((agi*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroAgi(data3.c,true)/150)
endif
if int >= agi and int >= str then
set data3.dmg = ((GetEventDamage()*.5)+(int*6.)+((int*6.)*GetHeroLevel(a)*.125))*i4
set data3.i = 10 + (GetHeroInt(data3.c,true)/150)
endif
if GetUnitTypeId(a) == 'N00D' then
set data3.dmg = data3.dmg * .1
endif
if data3.i > 50 then
set data3.i = 50
endif
call SetTimerData(timer2,data3)
call TimerStart(timer2,GetRandomReal(.1,.3),false, function Handler3)
endif
call UnitRemoveAbility(LC[i],'A0Q9')
set OverloadCharges[i-1] = 0
else
if GetUnitTypeId(a) != 'N00D' then
set OverloadCharges[i-1] = OverloadCharges[i-1] + 4
if OverloadCharges[i-1] >= 100 then
set OverloadCharges[i-1] = 100
call UnitAddAbility(LC[i],'A0Q9')
endif
endif
loop
exitwhen i2 > 5
set it = UnitItemInSlot(LC[i],i2)
if GetItemTypeId(it) == 'I04I' or GetItemTypeId(it) == 'I054' then
if OverloadCharges[i-1] == 100 then
call SetItemCharges(it,100)
endif
//call SetItemCharges(it,OverloadCharges[i-1])
endif
if GetItemTypeId(it) == 'I04V' then
//set i4 = i4 + 1
//call SetItemCharges(it,0)
endif
set i2 = i2 + 1
endloop
endif
endif
endif
endif
set timer2 = null
set t = null
set a = null
set u = null
set it = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope HermesCharges initializer OnInit
private function Conditions takes nothing returns boolean
local item i = GetManipulatedItem()
if GetItemTypeId(i) == 'I04I' or GetItemTypeId(i) == 'I04V' or GetItemTypeId(i) == 'I05U' then
call SetItemCharges(i,GetItemCharges(i)+1)
endif
set i = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CritItems initializer OnInit
globals
private constant integer SPELL_ID = 'A00K'
private constant integer SPELL_ID2 = 'B048'
private constant integer SPELL_ID3 = 'A0BT'
unit GLOBAL_CASTER
integer array CritChance
boolean array FiringCooldown
boolean array ConvergenceCooldown
trigger CRITICALITEMS
//* Damage options.
private constant integer CHAOTIC_BOULDER_ABILITY = 'A00K'
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_CHAOS
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_UNIVERSAL
//* Effect options.
private constant string ON_DAMAGE_BIG_FX = "war3mapImported\\Electric Spark - Classic.mdx"
endglobals
private function FilterUnits takes unit target, player owner returns boolean
return UnitAlive(target) and IsUnitEnemy(target, owner)
endfunction
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and not BlzIsUnitInvulnerable(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)))
endfunction
private struct SP
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct DS
integer i
unit u
unit t
real damage
integer i2
real x
real y
method destroy takes nothing returns nothing
set this.u = null
set this.t = null
call this.deallocate()
endmethod
endstruct
//* Set the travel distance.
private function GetSmallBoulderFlyDistance takes integer level returns real
return GetRandomReal(50., 400.)
endfunction
//* Set the explosion radius on impact.
private constant function GetExplosionRadius takes integer level returns real
return 224. + (0.*level)
endfunction
//* Set the amount of fragments.
private function GetSmallBoulderCount takes integer level returns integer
return GetRandomInt(12, 16)
endfunction
//* Customize all missile members to your needs.
private function CustomizeSmallMissileLightning takes Misssile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 1.5)*distance/200.)
set missile.collision = 116.
set missile.arc = GetRandomReal(80., 85.)*bj_DEGTORAD
set missile.model = "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
set missile.scale = 0.7
endfunction
private function CustomizeSmallMissileFire takes Misssile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 1.5)*distance/200.)
set missile.collision = 116.
set missile.arc = GetRandomReal(80., 85.)*bj_DEGTORAD
set missile.model = "war3mapImported\\Fireball Minor.mdx"
//set missile.model = "war3mapImported\\Firebolt Classic.mdx"
set missile.scale = 0.5
//set missile.scale = 0.25
endfunction
private function CustomizeSmallMissileIce takes Misssile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 1.5)*distance/200.)
set missile.collision = 116.
set missile.arc = GetRandomReal(80., 85.)*bj_DEGTORAD
set missile.model = "war3mapImported\\Orb of Frost.mdx"
set missile.scale = 0.5
endfunction
//* Customize all missile members to your needs.
private function CustomizeBigMissile takes Misssile missile, real distance, integer level returns nothing
local integer i = GetRandomInt(0,2)
if i == 0 then
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/1800.)
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 200.
set missile.model = "war3mapImported\\GreatElderHydraLightningOrbV.107.mdx"
set missile.scale = 1.6
endif
if i == 3 then
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/1800.)
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 200.
set missile.model = "war3mapImported\\LivingMeteor.mdx"
set missile.scale = 1.5
endif
if i == 1 then
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/1800.)
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 200.
//set missile.model = "war3mapImported\\Fireball Medium.mdx"
set missile.model = "war3mapImported\\Firebolt Classic.mdx"
//set missile.scale = 1.4
set missile.scale = 2.4
endif
if i == 2 then
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/1800.)
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 200.
set missile.model = "war3mapImported\\FrozenOrb.mdx"
set missile.scale = 2.1
endif
endfunction
//* Uses Missile's API. Add or remove whatever you need.
private struct ChaoticBoulder extends array
//* Only living trees are valid targets.
private static method createSmallBoulders takes Misssile big returns nothing
local integer level = GetUnitAbilityLevel(big.source, CHAOTIC_BOULDER_ABILITY)
local integer dex = 0
local integer max = 10 + (CritChance[GetUnitUserData(big.source)]/10)
local Misssile small
if max > 20 then
set max = 20
endif
loop
exitwhen (dex >= max)
if big.model == "war3mapImported\\GreatElderHydraLightningOrbV.107.mdx" then
set small = Misssile.create(big.x, big.y, 0., GetRandomReal(-bj_PI, bj_PI), GetSmallBoulderFlyDistance(level), 0.)
call CustomizeSmallMissileLightning(small, small.origin.distance, level)
set small.source = big.source
set small.owner = big.owner
set small.damage = big.damage*.2
set small.data = 0
call thistype.launch(small)
endif
//if big.model == "war3mapImported\\Fireball Medium.mdx" then
if big.model == "war3mapImported\\Firebolt Classic.mdx" then
set small = Misssile.create(big.x, big.y, 0., GetRandomReal(-bj_PI, bj_PI), GetSmallBoulderFlyDistance(level), 0.)
call CustomizeSmallMissileFire(small, small.origin.distance, level)
set small.source = big.source
set small.owner = big.owner
set small.damage = big.damage*.2
set small.data = 0
call thistype.launch(small)
endif
if big.model == "war3mapImported\\FrozenOrb.mdx" then
set small = Misssile.create(big.x, big.y, 0., GetRandomReal(-bj_PI, bj_PI), GetSmallBoulderFlyDistance(level), 0.)
call CustomizeSmallMissileIce(small, small.origin.distance, level)
set small.source = big.source
set small.owner = big.owner
set small.damage = big.damage*.2
set small.data = 0
call thistype.launch(small)
endif
set dex = dex + 1
endloop
endmethod
/*private static method onPeriod takes Misssile missile returns boolean
local unit u
if missile.data == 5 then
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
call DisableTrigger(CRITICALITEMS)
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(missile.source, u, missile.damage, false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call EnableTrigger(CRITICALITEMS)
call EnableTrigger(TOXIAPOISON)
endif
endloop
endif
set u = null
return false
endmethod*/
//* Damages close unit on missile removal.
private static method onRemove takes Misssile missile returns boolean
local unit u
local effect fx
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
call DisableTrigger(TOXIAPOISON)
call DisableTrigger(CRITICALITEMS)
if missile.model == "war3mapImported\\Bloodstone Arrow.mdx" then
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl",u,"chest"))
call UnitDamageTargetEx(missile.source, u, missile.damage+(GetWidgetLife(u)*missile.data*.0275), false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
else
call UnitDamageTargetEx(missile.source, u, missile.damage, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
endif
call EnableTrigger(TOXIAPOISON)
call EnableTrigger(CRITICALITEMS)
endif
endloop
if missile.model == "war3mapImported\\Orb of Frost.mdx" then
set fx = AddSpecialEffect("Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl", missile.x, missile.y)
call BlzSetSpecialEffectScale(fx,.8)
call DestroyEffect(fx)
endif
//* Detect big boulder.
if (missile.data == -1) then
//* Runs effects.
if missile.model == "war3mapImported\\GreatElderHydraLightningOrbV.107.mdx" then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Electric Spark - Classic.mdx", missile.x, missile.y))
call createSmallBoulders(missile)
endif
//if missile.model == "war3mapImported\\Fireball Medium.mdx" then
if missile.model == "war3mapImported\\Firebolt Classic.mdx" then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Xin Crack.mdx", missile.x, missile.y))
call createSmallBoulders(missile)
endif
if missile.model == "war3mapImported\\FrozenOrb.mdx" then
set fx = AddSpecialEffect("war3mapImported\\Winter Blast HD.mdx", missile.x, missile.y)
call BlzSetSpecialEffectScale(fx,1.4)
call DestroyEffect(fx)
call createSmallBoulders(missile)
endif
endif
set fx = null
set u = null
return true
endmethod
implement MisssileStruct
endstruct
private function HandlerA takes nothing returns nothing
local timer t2 = GetExpiredTimer()
local DS data2 = GetTimerData(t2)
local Misssile missile
if data2.i == 0 or data2.t == null or not UnitAlive(data2.u) or data2.u == null then
set FiringCooldown[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data2.u))])] = false
call ReleaseTimer(t2)
call data2.destroy()
else
set data2.i = data2.i -1
if UnitAlive(data2.t) then
set data2.x = GetUnitX(data2.t)
set data2.y = GetUnitY(data2.t)
else
set GLOBAL_CASTER = data2.u
set data2.t = ZEE(null,data2.x,data2.y,3000.,(Condition(function FilterUnits2)))
if data2.t != null then
set data2.x = GetUnitX(data2.t)
set data2.y = GetUnitY(data2.t)
endif
endif
set missile = Misssile.createXYZ(GetUnitX(data2.u), GetUnitY(data2.u), GetUnitFlyHeight(data2.u), data2.x+GetRandomReal(-175.,175.),data2.y+GetRandomReal(-175.,175.), 0.)
call missile.flightTime2Speed(GetRandomReal(1., 2.)*missile.origin.distance/1800.)
set missile.arc = 35.*bj_DEGTORAD + RMinBJ(20., missile.origin.distance*.1)*bj_DEGTORAD
set missile.collision = 96.
set missile.model = "war3mapImported\\Bloodstone Arrow.mdx"
set missile.scale = 1.0
set missile.damage = data2.damage
set missile.source = data2.u
set missile.data = data2.i2
set missile.owner = GetOwningPlayer(data2.u)
call ChaoticBoulder.launch(missile)
call SetTimerData(t2,data2)
call TimerStart(t2,GetRandomReal(.0625,.12),false,function HandlerA)
endif
set t2 = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local SP data = GetTimerData(t)
call BlzEndUnitAbilityCooldown( data.u, 'A0R9' )
set ConvergenceCooldown[GetUnitUserData(data.u)]=false
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer id = GetPlayerId(GetOwningPlayer(a)) + 1
local integer i = 0
local item it
local integer i2 = 0
local integer i3 = 0
local integer i4 = 0
local real d = GetEventDamage()
local texttag tt
local string Q7E
local integer i5 = 0
local integer i6 = 0
local real x
local real y
local Misssile missile
local real angle
local timer t
local SP data
local integer i7 = 0
local real life
local real mlife
local timer t2
local DS data2
local integer i8 = 0
local integer i9 = 0
local integer lvl = 0
local real life2
local real mlife2
local boolean array bi
if (GetUnitAbilityLevel(LC[id],SPELL_ID)==1 or GetUnitAbilityLevel(a,SPELL_ID)==1 or GetUnitAbilityLevel(LC[id],SPELL_ID2)==1 or GetUnitAbilityLevel(a,SPELL_ID2)==1 or GetUnitAbilityLevel(LC[id],SPELL_ID3)!=0 or GetUnitAbilityLevel(a,SPELL_ID3)!=0) and d>1.0 and IsUnitEnemy(u,Player(id-1)) then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if BI[NI]==LN or BI[NI]==DAMAGE_TYPE_LIGHTNING or BI[NI]==DAMAGE_TYPE_COLD or BI[NI]==DAMAGE_TYPE_MAGIC or BI[NI]==DAMAGE_TYPE_PLANT or BI[NI]==DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL) then
if GetUnitAbilityLevel(LC[id],SPELL_ID2)==1 or GetUnitAbilityLevel(a,SPELL_ID2)==1 then
set i2 = 25
endif
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemType(it) == ITEM_TYPE_CAMPAIGN and (GetItemTypeId(it)== 'I05A' or GetItemTypeId(it)== 'I01X' or GetItemTypeId(it)== 'I01L' or GetItemTypeId(it)== 'I00Y' or GetItemTypeId(it)== 'I052') then
if GetItemTypeId(it)== 'I01X' or GetItemTypeId(it)== 'I01L' or GetItemTypeId(it)== 'I00Y' then
set i7 = i7 + 1
set i2 = 40
if GetItemTypeId(it)== 'I01X' then
set i9 = i9 + 1
endif
else
set i3 = i3 + GetItemLevel(it)
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I05A' then
set i5 = i5 + 20
set i6 = i6 + 1
endif
endif
if GetItemTypeId(it) == 'I03F' then
set i3 = i3 + 18
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I04U' then
set i3 = i3 + 25
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
set i8 = i8 + 1
endif
if GetItemTypeId(it) == 'I04W' or GetItemTypeId(it) == 'I04X' then
set i3 = i3 + 18
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I05U' then
set i3 = i3 + 20
set i4 = i4 + 80
endif
if GetItemTypeId(it) == 'I03C' then
set i3 = i3 + 10
endif
if GetItemTypeId(it) == 'I02W' then
set i3 = i3 + 10
set i4 = i4 + 75
endif
if GetItemTypeId(it) == 'I05O' then
set i3 = i3 + 20
set i4 = i4 + 100
endif
set i = i + 1
endloop
if GetUnitAbilityLevel(LC[id],SPELL_ID3)!=0 or GetUnitAbilityLevel(a,SPELL_ID3)!=0 then
set i3 = i3 + 15
set lvl = GetUnitAbilityLevel(LC[id],SPELL_ID3)
if GetUnitAbilityLevel(a,SPELL_ID3) > lvl then
set lvl = GetUnitAbilityLevel(a,SPELL_ID3)
endif
set i4 = i4 + (lvl*35)
endif
if i3 >100 then
set i4 = i4 + (3*(i3-100))
endif
set life = GetWidgetLife(u)
set mlife = BlzGetUnitMaxHP(u)
if GetRandomInt(1,100) <= i3+i2 or (i7 > 0 and life==mlife) or (i9 > 0 and life <= mlife * .2) then
if i7 > 0 and mlife == life then
call SetWidgetLife(u,mlife-(mlife*.12*i7))
endif
set d = d*(2.+(i4*.01))
if lvl > 0 then
set life2 = GetWidgetLife(LC[id])
set mlife2 = BlzGetUnitMaxHP(LC[id])
call DisableTrigger(CRITICALITEMS)
call UnitDamageTargetEx(a, u, ((mlife-life)*.15*lvl), false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
call EnableTrigger(CRITICALITEMS)
// set d = d + ((mlife-life)*.1*lvl)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Lascerate.mdx",u,"chest"))
endif
if i9 > 0 and life <= mlife * .2 then
set d = d * (2. * i9)
endif
call BlzSetEventDamage(d)
//call BJDebugMsg("Crit Damage Amplified to"+R2S(d))
set tt = CreateTextTag()
set Q7E = I2S(R2I(d))+"!"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
if GetRandomInt(1,100) <= (i8*15) and not FiringCooldown[GetUnitUserData(LC[id])] and UnitAlive(LC[id]) then
set FiringCooldown[GetUnitUserData(LC[id])] = true
set data2 = DS.create()
set t2 = NewTimer()
set data2.u = LC[id]
set data2.t = u
set data2.i = 50 + ((i3 + i2)/2) + (GetHeroAgi(LC[id],true)/100)
if data2.i > 300 then
set data2.i = 300
endif
set data2.x = GetUnitX(u)
set data2.y = GetUnitY(u)
set missile = Misssile.createXYZ(GetUnitX(data2.u), GetUnitY(data2.u), GetUnitFlyHeight(LC[id]), data2.x,data2.y, 0.)
call missile.flightTime2Speed(GetRandomReal(1., 2.)*missile.origin.distance/1800.)
set missile.arc = 35.*bj_DEGTORAD + RMinBJ(20., missile.origin.distance*.1)*bj_DEGTORAD
set missile.collision = 96.
set missile.model = "war3mapImported\\Bloodstone Arrow.mdx"
set missile.scale = 1.0
set data2.damage = (.05*d)*i8
set missile.damage =data2.damage
set missile.source = data2.u
set missile.data = i8
set missile.owner = GetOwningPlayer(data2.u)
call ChaoticBoulder.launch(missile)
set data2.i2 = i8
call SetTimerData(t2,data2)
call TimerStart(t2,GetRandomReal(.0625,.12),false,function HandlerA)
endif
if i6 > 0 and GetRandomInt(1,100) <= i5 and not ConvergenceCooldown[GetUnitUserData(LC[id])] then
if UnitAlive(LC[id]) and not IsUnitHidden(LC[id]) and not IsUnitPaused(LC[id]) and not UnitIsCasting[GetUnitUserData(LC[id])] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I05A' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
//call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
call UnitAddItemToSlotById(LC[id],'I05A',i)
call BlzStartUnitAbilityCooldown( LC[id], 'A0R9', 1.00 )
endif
set i = i + 1
endloop
else
call BlzStartUnitAbilityCooldown( LC[id], 'A0R9', 1.00 )
endif
set ConvergenceCooldown[GetUnitUserData(LC[id])] = true
set CritChance[GetUnitUserData(LC[id])] = i3 + i2
set x = GetUnitX(LC[id])
set y = GetUnitY(LC[id])
set missile = Misssile.createXYZ(x, y, GetUnitFlyHeight(LC[id]), GetUnitX(u), GetUnitY(u), 0.)
call CustomizeBigMissile(missile, missile.origin.distance, i6)
set missile.damage = (2.*d)*i6
set missile.source = LC[id]
set missile.data = -1
set missile.owner = GetOwningPlayer(a)
call ChaoticBoulder.launch(missile)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Magic Missile.mdx",a,"chest"))
set t = NewTimer()
set data = SP.create()
set data.u = LC[id]
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
endif
endif
else
if GetUnitAbilityLevel(LC[id],SPELL_ID2)==1 or GetUnitAbilityLevel(a,SPELL_ID2)==1 then
set i2 = 25
endif
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemType(it) == ITEM_TYPE_CAMPAIGN and (GetItemTypeId(it)== 'I05A' or GetItemTypeId(it)== 'I01X' or GetItemTypeId(it)== 'I01L' or GetItemTypeId(it)== 'I00Y' or GetItemTypeId(it)== 'I052') then
if GetItemTypeId(it)== 'I01X' or GetItemTypeId(it)== 'I01L' or GetItemTypeId(it)== 'I00Y' then
set i7 = i7 + 1
set i2 = 40
if GetItemTypeId(it)== 'I01X' then
set i9 = i9 + 1
endif
else
set i3 = i3 + GetItemLevel(it)
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I05A' then
set i5 = i5 + 20
set i6 = i6 + 1
endif
endif
if GetItemTypeId(it) == 'I03F' then
set i3 = i3 + 18
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I04U' then
set i3 = i3 + 25
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
set i8 = i8 + 1
endif
if GetItemTypeId(it) == 'I04W' or GetItemTypeId(it) == 'I04X' then
set i3 = i3 + 18
set i4 = i4 + BlzGetItemIntegerField(it, ITEM_IF_PRIORITY)
endif
if GetItemTypeId(it) == 'I05U' then
set i3 = i3 + 20
set i4 = i4 + 80
endif
if GetItemTypeId(it) == 'I03C' then
set i3 = i3 + 10
endif
if GetItemTypeId(it) == 'I02W' then
set i3 = i3 + 10
set i4 = i4 + 75
endif
if GetItemTypeId(it) == 'I05O' then
set i3 = i3 + 20
set i4 = i4 + 100
endif
set i = i + 1
endloop
if GetUnitAbilityLevel(LC[id],SPELL_ID3)!=0 or GetUnitAbilityLevel(a,SPELL_ID3)!=0 then
set i3 = i3 + 15
set lvl = GetUnitAbilityLevel(LC[id],SPELL_ID3)
if GetUnitAbilityLevel(a,SPELL_ID3) > lvl then
set lvl = GetUnitAbilityLevel(a,SPELL_ID3)
endif
set i4 = i4 + (lvl*35)
endif
if i3 >100 then
set i4 = i4 + (3*(i3-100))
endif
set life = GetWidgetLife(u)
set mlife = BlzGetUnitMaxHP(u)
if GetRandomInt(1,100) <= i3+i2 or (i7 > 0 and life==mlife) or (i9 > 0 and life <= mlife * .2) then
if i7 > 0 and mlife == life then
call SetWidgetLife(u,mlife-(mlife*.12*i7))
endif
set d = d*(2.+(i4*.01))
if lvl > 0 then
set life2 = GetWidgetLife(LC[id])
set mlife2 = BlzGetUnitMaxHP(LC[id])
call DisableTrigger(CRITICALITEMS)
call UnitDamageTargetEx(a, u, ((mlife-life)*.15*lvl), false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
call EnableTrigger(CRITICALITEMS)
//set d = d + ((mlife-life)*.1*lvl)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Lascerate.mdx",u,"chest"))
endif
if i9 > 0 and life <= mlife * .2 then
set d = d * (2. * i9)
endif
//call BJDebugMsg("Crit Damage Amplified to"+R2S(d))
call BlzSetEventDamage(d)
set tt = CreateTextTag()
set Q7E = I2S(R2I(d))+"!"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
if GetRandomInt(1,100) <= (i8*15) and not FiringCooldown[GetUnitUserData(LC[id])] and UnitAlive(LC[id]) then
set FiringCooldown[GetUnitUserData(LC[id])] = true
set data2 = DS.create()
set t2 = NewTimer()
set data2.u = LC[id]
set data2.t = u
set data2.i = 50 + ((i3 + i2)/2) + (GetHeroAgi(LC[id],true)/100)
if data2.i > 300 then
set data2.i = 300
endif
set data2.x = GetUnitX(u)
set data2.y = GetUnitY(u)
set missile = Misssile.createXYZ(GetUnitX(data2.u), GetUnitY(data2.u), GetUnitFlyHeight(LC[id]), data2.x,data2.y, 0.)
call missile.flightTime2Speed(GetRandomReal(1., 2.)*missile.origin.distance/1800.)
set missile.arc = 35.*bj_DEGTORAD + RMinBJ(20., missile.origin.distance*.1)*bj_DEGTORAD
set missile.collision = 96.
set missile.model = "war3mapImported\\Bloodstone Arrow.mdx"
set missile.scale = 1.0
set data2.damage = (.05*d)*i8
set missile.damage =data2.damage
set missile.source = data2.u
set missile.data = i8
set missile.owner = GetOwningPlayer(data2.u)
call ChaoticBoulder.launch(missile)
set data2.i2 = i8
call SetTimerData(t2,data2)
call TimerStart(t2,GetRandomReal(.0625,.12),false,function HandlerA)
endif
if i6 > 0 and GetRandomInt(1,100) <= i5 and not ConvergenceCooldown[GetUnitUserData(LC[id])] then
set ConvergenceCooldown[GetUnitUserData(LC[id])] = true
if UnitAlive(LC[id]) and not IsUnitHidden(LC[id]) and not IsUnitPaused(LC[id]) and not UnitIsCasting[GetUnitUserData(LC[id])] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(LC[id],i)
if GetItemTypeId(it) == 'I05A' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
//call BlzStartUnitAbilityCooldown( LC[id], 'A0R7', 1.00 )
call UnitAddItemToSlotById(LC[id],'I05A',i)
call BlzStartUnitAbilityCooldown( LC[id], 'A0R9', 1.00 )
endif
set i = i + 1
endloop
else
call BlzStartUnitAbilityCooldown( LC[id], 'A0R9', 1.00 )
endif
set CritChance[GetUnitUserData(LC[id])] = i3 + i2
set x = GetUnitX(LC[id])
set y = GetUnitY(LC[id])
set missile = Misssile.createXYZ(x, y, GetUnitFlyHeight(LC[id]), GetUnitX(u), GetUnitY(u), 0.)
call CustomizeBigMissile(missile, missile.origin.distance, i6)
set missile.damage = (2.*d)*i6
set missile.source = LC[id]
set missile.data = -1
set missile.owner = GetOwningPlayer(a)
call ChaoticBoulder.launch(missile)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Magic Missile.mdx",a,"chest"))
set t = NewTimer()
set data = SP.create()
set data.u = LC[id]
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
endif
endif
endif
set t2 = null
set t= null
set tt = null
set Q7E = null
set it = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CRITICALITEMS = CreateTrigger()
call MOE(II, (CRITICALITEMS))
call TriggerAddCondition(CRITICALITEMS, Condition(function Actions))
endfunction
endscope
scope CooldownReduction initializer OnInit
globals
player GLOBALPLAYER
endglobals
private struct PD
unit c
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct CD
unit u
integer id
integer level
real reduction
boolean b
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local CD data = GetTimerData(t)
local real cooldown
local item it
local integer i = 0
local integer i2 = 0
local boolean array bi
//call BJDebugMsg(I2S(GetUnitAbilityLevel(data.u,data.id)))
if GetUnitAbilityLevel(data.u,data.id)!= 0 and data.id != 'A0L9' then
set cooldown = BlzGetUnitAbilityCooldownRemaining(data.u,data.id)
//call BJDebugMsg(R2S(cooldown))
//call BJDebugMsg(R2S(data.reduction))
if cooldown > 0 then
if cooldown - data.reduction <= 0 or (data.b and cooldown-data.reduction <= 15. )then
call BlzEndUnitAbilityCooldown(data.u,data.id)
else
call BlzStartUnitAbilityCooldown(data.u,data.id, cooldown - data.reduction)
if UnitAlive(data.u) and not IsUnitHidden(data.u) and data.id == 'A0RX' and not IsUnitPaused(data.u) and not UnitIsCasting[GetUnitUserData(data.u)] then
set i = 0
loop
exitwhen i > 5
set it = UnitItemInSlot(data.u,i)
if GetItemTypeId(it) == 'I05O' then
set bi[i] = true
call RemoveItem(it)
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
if bi[i] then
call UnitAddItemToSlotById(data.u,'I05O',i)
call BlzStartUnitAbilityCooldown( data.u, 'A0RZ',cooldown - data.reduction )
set it = UnitItemInSlot(data.u,i)
call SetItemCharges(it,RimefrostStacks[GetUnitUserData(data.u)])
endif
set i = i + 1
endloop
call BlzStartUnitAbilityCooldown(data.u,data.id, cooldown - data.reduction)
else
if data.id == 'A0RX' then
call BlzStartUnitAbilityCooldown( data.u, 'A0RZ',cooldown - data.reduction )
endif
endif
endif
endif
endif
call ReleaseTimer(t)
call data.destroy()
set it = null
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local PD data = GetTimerData(t)
call UnitRemoveAbility(data.c,'A0S6')
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if UnitAlive(u) and IsUnitEnemy(u,GLOBALPLAYER) and not BlzIsUnitInvulnerable(u) then
//call BJDebugMsg(R2S(GLOBALDAMAGE)+"+"+I2S(GLOBALINTEGER))
if not IsUnitType(u,UNIT_TYPE_HERO) then
if GetUnitAbilityLevel(u,'A0O5') != 1 then
call UnitAddAbility(u,'A0O5')
endif
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,-.1*GLOBALINTEGER)
endif
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_LIFE)*(1-(.03*GLOBALINTEGER)))
call UnitDamageTargetEx(GLOBAL_CASTER, u,GLOBALDAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareBoltImpact.mdl",u,"chest"))
endif
set u = null
return false
endfunction
private function OnSpell takes nothing returns boolean
local unit a = GetTriggerUnit()
local real cooldown
local integer i = 0
local item it
local integer i2 = 0
local timer t
local CD data
local integer i3 = 0
local integer i4 = 0
local real r = 1.
local boolean isitem
local boolean array bi
local timer t2
local PD data2
if GetUnitAbilityLevel(a,'A0QP') != 0 or GetUnitAbilityLevel(a,'A0QQ') != 0 or GetUnitAbilityLevel(a,'B03V') != 0 or GetUnitAbilityLevel(a,'A0RU') != 0 then
loop
exitwhen i > 5
set it = UnitItemInSlot(a,i)
if GetItemTypeId(it) == 'I01R' then
set i2 = i2 + 35
set r=(1-(.35))*r
endif
if GetItemTypeId(it) == 'I03E' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04A' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I05A' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I02Z' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I02V' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I053' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03F' then
set i2 = i2 + 10
endif
if GetItemTypeId(it) == 'I037' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I05E' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I05C' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I04Y' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I03D' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I049' then
set i2 = i2 + 15
endif
if GetItemTypeId(it) == 'I04P' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I03V' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I036' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I048' then
set i2 = i2 + 40
endif
if GetItemTypeId(it) == 'I05I' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I05J' then
set i2 = i2 + 20
endif
if GetItemTypeId(it) == 'I05M' then
set i2 = i2 + 25
endif
if GetItemTypeId(it) == 'I02K' then
set i2 = i2 + 30
endif
if GetItemTypeId(it) == 'I02Y' then
set i2 = i2 + 20
set i3 = i3 + 1
endif
set i = i + 1
endloop
if GetUnitAbilityLevel(a,'A0QQ') != 0 then
set i2 = i2 + 90
endif
if GetUnitAbilityLevel(a,'A0RU') != 0 then
set i2 = i2 + 20
endif
if GetUnitAbilityLevel(a,'B03V') != 0 then
if AETHER_BUFF_LVL[GetUnitUserData(a)] >= 40 then
set i2 = i2 + 80
else
set i2 = i2 + (AETHER_BUFF_LVL[GetUnitUserData(a)]*2)
endif
endif
set data = CD.create()
set data.u = a
set data.id = GetSpellAbilityId()
set isitem = BlzGetAbilityBooleanField(BlzGetUnitAbility(a, data.id), ABILITY_BF_ITEM_ABILITY)
if not isitem and GetRandomReal(1.,100.) <= (1-r)*100 and data.id != 'A0L9' then
set data.b = true
else
set data.b = false
endif
set data.level = GetUnitAbilityLevel(a,data.id)
set cooldown = BlzGetUnitAbilityCooldown(a,data.id,data.level-1)
set data.reduction = cooldown*(i2/(i2+100.))
//call BJDebugMsg(I2S(data.level))
//call BJDebugMsg(R2S(data.reduction))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
if i3 > 0 and not isitem and data.id != 'A0L9' and GetUnitAbilityLevel(data.u,'A0S6') !=1 then
set GLOBAL_CASTER = data.u
set GLOBALPLAYER = GetOwningPlayer(data.u)
set GLOBALDAMAGE = i3 *((GetHeroInt(LC[1+GetPlayerId(GLOBALPLAYER)],true)*2.)*(1.+(.075 * GetHeroLevel(LC[1+GetPlayerId(GLOBALPLAYER)]))))
set GLOBALINTEGER = i3
call UnitAddAbility(data.u,'A0S6')
set data2 = PD.create()
set data2.c = data.u
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,.5,false,function Handler2)
if UnitAlive(data.u) and not IsUnitHidden(data.u) and not IsUnitPaused(data.u) and not UnitIsCasting[GetUnitUserData(data.u)] then
set i4 = 0
loop
exitwhen i4 > 5
set it = UnitItemInSlot(data.u,i4)
if GetItemTypeId(it) == 'I02Y' then
set bi[i4] = true
call RemoveItem(it)
endif
set i4 = i4 + 1
endloop
set i4 = 0
loop
exitwhen i4 > 5
if bi[i4] then
//call BlzStartUnitAbilityCooldown( data.u, 'A0S7', .5 )
call UnitAddItemToSlotById(data.u,'I02Y',i4)
call BlzStartUnitAbilityCooldown( data.u, 'A0S7', .5 )
endif
set i4 = i4 + 1
endloop
else
call BlzStartUnitAbilityCooldown( data.u, 'A0S7', .5 )
endif
call GroupEnumUnitsInRange( GLOBALGROUP, GetUnitX(data.u), GetUnitY(data.u), 1250., Filter( function FilterActions ) )
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Discharge.mdx",GetUnitX(data.u),GetUnitY(data.u)))
endif
endif
set t2 = null
set t= null
set it = null
set a = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope MeatyMeat initializer OnInit
globals
integer array MeatHealth
integer array MeatCollected
integer array PremiumMeatCollected
endglobals
private function Conditions takes nothing returns boolean
local unit u
local integer maxhp
local integer id
local unit u2 = null
if GetItemTypeId(GetManipulatedItem()) == 'I05K' then
set u = GetTriggerUnit()
set id = GetPlayerId(GetOwningPlayer(u))
if u == PL[1+id] then
set u2 = LC[1+id]
endif
if u == LC[1+id] then
set MeatHealth[GetUnitUserData(u)] = MeatHealth[GetUnitUserData(u)] + 75+(GetHeroLevel(u)*10)
set MeatCollected[GetUnitUserData(u)] = MeatCollected[GetUnitUserData(u)] + 1
endif
set maxhp = BlzGetUnitMaxHP(u)
call BlzSetUnitMaxHP(u,maxhp+75+(GetHeroLevel(LC[1+id])*10))
call SetWidgetLife(u,(GetHeroLevel(LC[1+id])*10)+75.+GetWidgetLife(u)+(maxhp*.1))
set CorruptAmount[id] = CorruptAmount[id]+3
call SetPlayerState(Player(id),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",u,"origin"))
if u2 != null then
set maxhp = BlzGetUnitMaxHP(u2)
call BlzSetUnitMaxHP(u2,maxhp+75+(GetHeroLevel(u2)*10))
call SetWidgetLife(u2,(GetHeroLevel(u2)*10)+75.+GetWidgetLife(u2)+(maxhp*.1))
set CorruptAmount[id] = CorruptAmount[id]+3
call SetPlayerState(Player(id),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",u2,"origin"))
set MeatHealth[GetUnitUserData(u2)] = MeatHealth[GetUnitUserData(u2)] + 75+(GetHeroLevel(u2)*10)
set MeatCollected[GetUnitUserData(u2)] = MeatCollected[GetUnitUserData(u2)] + 1
endif
endif
set u2 = null
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
scope MeatyPremiumMeat initializer OnInit
private function Conditions takes nothing returns boolean
local unit u
local integer maxhp
local integer id
local unit u2 = null
if GetItemTypeId(GetManipulatedItem()) == 'I05L' then
set u = GetTriggerUnit()
set id = GetPlayerId(GetOwningPlayer(u))
if u == PL[1+id] then
set u2 = LC[1+id]
endif
if u == LC[1+id] then
set MeatHealth[GetUnitUserData(u)] = MeatHealth[GetUnitUserData(u)] + 250+(GetHeroLevel(u)*18)
set PremiumMeatCollected[GetUnitUserData(u)] = PremiumMeatCollected[GetUnitUserData(u)] + 1
endif
set maxhp = BlzGetUnitMaxHP(u)
call BlzSetUnitMaxHP(u,maxhp+250+(GetHeroLevel(LC[1+id])*18))
call SetWidgetLife(u,(GetHeroLevel(LC[1+id])*18)+250.+GetWidgetLife(u)+(maxhp*.1))
if IsUnitType(u,UNIT_TYPE_HERO) then
call ModifyHeroStat(0,u,0,3)
call ModifyHeroStat(1,u,0,3)
call ModifyHeroStat(2,u,0,3)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",u,"origin"))
if u2 !=null then
set maxhp = BlzGetUnitMaxHP(u2)
call BlzSetUnitMaxHP(u2,maxhp+250+(GetHeroLevel(u2)*18))
call SetWidgetLife(u2,(GetHeroLevel(u2)*18)+250.+GetWidgetLife(u2)+(maxhp*.1))
if IsUnitType(u2,UNIT_TYPE_HERO) then
call ModifyHeroStat(0,u2,0,3)
call ModifyHeroStat(1,u2,0,3)
call ModifyHeroStat(2,u2,0,3)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",u2,"origin"))
set MeatHealth[GetUnitUserData(u2)] = MeatHealth[GetUnitUserData(u2)] + 250+(GetHeroLevel(u2)*18)
set PremiumMeatCollected[GetUnitUserData(u2)] = PremiumMeatCollected[GetUnitUserData(u2)] + 1
endif
endif
set u2= null
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t,EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DamageBlock initializer OnInit
globals
private constant integer SPELL_ID = 'A0QB'
boolean array CVCooldown
endglobals
private struct SP
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct SP2
item i
method destroy takes nothing returns nothing
set this.i = null
call this.deallocate()
endmethod
endstruct
private function Handler3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local SP2 data = GetTimerData(t)
call RemoveItem(data.i)
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private struct FreshMeat extends array
private static method onRemove takes Misssile missile returns boolean
local timer t = NewTimer()
local SP2 data = SP2.create()
if missile.scale == 1.2 then
set data.i = CreateItem('I05L',missile.x,missile.y)
else
set data.i = CreateItem('I05K',missile.x,missile.y)
endif
call SetTimerData(t,data)
call TimerStart(t,60., false, function Handler3)
set t = null
return true
endmethod
implement MisssileStruct
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local SP data = GetTimerData(t)
set CVCooldown[GetUnitUserData(data.u)]=false
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer i = 0
local item it
local real i2 = 0.
local integer i3 = 0
local unit s
local real x
local real y
local real d = GetEventDamage()
local real hp
local real angle
local real dist
local real armor
local timer t
local SP data
local integer i4 = 0
local integer i5 = 0
local integer corruption
local real i6 = 0.
local integer p
local Misssile missile
local real x2
local real y2
local integer i7 = 0
local integer i8 = 0
// local texttag tt
// local string Q7E
if GetUnitAbilityLevel(u,SPELL_ID) != 0 and GetEventDamage() >0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) then
loop
exitwhen i > 5
set it = UnitItemInSlot(u,i)
if GetItemType(it) == ITEM_TYPE_CAMPAIGN and GetItemTypeId(it)!= 'I01X' and GetItemTypeId(it)!= 'I01L' and GetItemTypeId(it)!= 'I00Y' and GetItemTypeId(it)!='I052' and GetItemTypeId(it)!='I05A' then
set i2=i2+GetItemLevel(it)
endif
if GetItemTypeId(it) == 'I05E' then
set i3 = i3 + 1
endif
if GetItemTypeId(it) == 'I02V' then
set i4 = i4 + 1
endif
if GetItemTypeId(it) == 'I02Z' then
set i5 = i5 + 1
endif
if GetItemTypeId(it) == 'I05J' then
set i2 = i2 + 444
set i7 = i7 + 1
set p = GetPlayerId(GetOwningPlayer(u))
set corruption = CorruptAmount[p]
if corruption > 100 then
set corruption = 100
endif
set i6 = i6 + ((75.+ (BlzGetUnitMaxHP(u)*.04))*(1.+(.01*corruption)))
endif
if GetItemTypeId(it) == 'I05M' then
set i2 = i2 + 1666
set i8 = i8 + 1
set p = GetPlayerId(GetOwningPlayer(u))
set corruption = CorruptAmount[p]
if corruption > 100 then
set corruption = 100
endif
set i6 = i6 + ((666.+ (BlzGetUnitMaxHP(u)*.2))*(1.+(.01*corruption)))
endif
set i = i + 1
endloop
if i6 > 0. then
call UnitDamageTargetEx(u, a, i6, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAuraDamage.mdl",a,"head"))
if GetWidgetLife(u) <= BlzGetUnitMaxHP(u)*1 and GetRandomInt(1,100) <= (10*(i8+i7)) then
set CorruptAmount[p] = CorruptAmount[p] - (i7*8) - (i8*11)
if CorruptAmount[p] < 0 then
set CorruptAmount[p] = 0
endif
call SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[p])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",u,"chest"))
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set missile = Misssile.createXYZ(x2, y2, GetUnitFlyHeight(u), x2+GetRandomReal(-500.,500.),y2+GetRandomReal(-500.,500.), 0.)
call missile.flightTime2Speed(GetRandomReal(1., 2.)*missile.origin.distance/600.)
set missile.arc = 60.*bj_DEGTORAD + RMinBJ(20., missile.origin.distance*.1)*bj_DEGTORAD
set missile.collision = 96.
set missile.model = "war3mapImported\\Meat.mdx"
if i8 > 0 then
if GetRandomInt(1,100) <= 15 then
set missile.scale = 1.2
else
set missile.scale = 1.
endif
else
if GetRandomInt(1,100) <= 5 then
set missile.scale = 1.2
else
set missile.scale = 1.
endif
endif
set missile.source = u
set missile.owner = Player(p)
call FreshMeat.launch(missile)
endif
endif
if i3 > 0 then
set i2 = i2+ (.0375*i3*BlzGetUnitMaxHP(u))
if GetRandomInt(1,100) <= (i3*5) and not CVCooldown[GetUnitUserData(u)] then
set CVCooldown[GetUnitUserData(u)] = true
set t = NewTimer()
set data = SP.create()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,5.,false,function Handler)
set angle = GetRandomReal(0.,360.)
set dist = GetRandomReal(200.,300.)
set x = GetUnitX(u) + dist * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(u) + dist * Sin(angle * bj_DEGTORAD)
set s = CreateUnit(GetOwningPlayer(u),'n041',x,y,GetUnitFacing(u))
set hp = BlzGetUnitMaxHP(u)
if hp > 3000000. then
set hp = 3000000.
endif
set armor = BlzGetUnitArmor(u)
if armor > 7777. then
set armor = 7777.
endif
call BlzSetUnitBaseDamage(s,R2I((armor*100.)+(hp*.1)+(GetHeroStr(u,true)*10.*(1.+(.125*GetHeroLevel(u))))),0)
call BlzSetUnitMaxHP(s,R2I(hp))
call BlzSetUnitArmor(s,armor)
call SetWidgetLife(s,GetUnitState(s,UNIT_STATE_MAX_LIFE))
call UnitApplyTimedLife(s,'BTLF',10.+(GetHeroLevel(u)*.5)+(BlzGetUnitArmor(u)*.075))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl",x,y))
endif
endif
if i4 > 0 then
set i2 = i2+ (.35*i4*GetHeroStr(u,true))
endif
if i5 > 0 then
set i2 = i2+ (2.*i5*BlzGetUnitArmor(u))
endif
if i3 > 0 or i4 > 0 or i5 > 0 then
set i2 = i2* (1.+(i3*.1) + (i4*.06) + (i5 * .06)+(i8*.005*corruption))
endif
if d-(i2*1.) <= 0. then
call BlzSetEventDamage(0.)
// set tt = CreateTextTag()
// set Q7E = "Blocked!"
// call SetTextTagText(tt,Q7E,.012)
// call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
// call SetTextTagColor(tt,105,105,105,255)
// call SetTextTagVelocity(tt,.0,.04)
// call SetTextTagVisibility(tt,true)
// call SetTextTagFadepoint(tt,2.)
// call SetTextTagLifespan(tt,5.)
// call SetTextTagPermanent(tt,false)
else
call BlzSetEventDamage(d-(i2*1.))
endif
endif
else
if(CI[NI]) and BlzGetEventIsAttack() then
loop
exitwhen i > 5
set it = UnitItemInSlot(u,i)
if GetItemType(it) == ITEM_TYPE_CAMPAIGN and GetItemTypeId(it)!= 'I01X' and GetItemTypeId(it)!= 'I01L' and GetItemTypeId(it)!= 'I00Y' and GetItemTypeId(it)!='I052' and GetItemTypeId(it)!='I05A' then
set i2=i2+GetItemLevel(it)
endif
if GetItemTypeId(it) == 'I05E' then
set i3 = i3 + 1
endif
if GetItemTypeId(it) == 'I02V' then
set i4 = i4 + 1
endif
if GetItemTypeId(it) == 'I02Z' then
set i5 = i5 + 1
endif
if GetItemTypeId(it) == 'I05J' then
set i2 = i2 + 444
set i7 = i7 + 1
set p = GetPlayerId(GetOwningPlayer(u))
set corruption = CorruptAmount[p]
if corruption > 100 then
set corruption = 100
endif
set i6 = i6 + ((75.+ (BlzGetUnitMaxHP(u)*.04))*(1.+(.01*corruption)))
endif
if GetItemTypeId(it) == 'I05M' then
set i2 = i2 + 1666
set i8 = i8 + 1
set p = GetPlayerId(GetOwningPlayer(u))
set corruption = CorruptAmount[p]
if corruption > 100 then
set corruption = 100
endif
set i6 = i6 + ((666.+ (BlzGetUnitMaxHP(u)*.2))*(1.+(.01*corruption)))
endif
set i = i + 1
endloop
if i6 > 0. then
call UnitDamageTargetEx(u, a, i6, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAuraDamage.mdl",a,"head"))
if GetWidgetLife(u) <= BlzGetUnitMaxHP(u)*1 and GetRandomInt(1,100) <= (9*(i8+i7)) then
set CorruptAmount[p] = CorruptAmount[p] - (i7*8) - (i8*11)
if CorruptAmount[p] < 0 then
set CorruptAmount[p] = 0
endif
call SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[p])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",u,"chest"))
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set missile = Misssile.createXYZ(x2, y2, GetUnitFlyHeight(u), x2+GetRandomReal(-500.,500.),y2+GetRandomReal(-500.,500.), 0.)
call missile.flightTime2Speed(GetRandomReal(1., 2.)*missile.origin.distance/600.)
set missile.arc = 60.*bj_DEGTORAD + RMinBJ(20., missile.origin.distance*.1)*bj_DEGTORAD
set missile.collision = 96.
set missile.model = "war3mapImported\\Meat.mdx"
if i8 > 0 then
if GetRandomInt(1,100) <= 15 then
set missile.scale = 1.2
else
set missile.scale = 1.
endif
else
if GetRandomInt(1,100) <= 5 then
set missile.scale = 1.2
else
set missile.scale = 1.
endif
endif
set missile.source = u
set missile.owner = Player(p)
call FreshMeat.launch(missile)
endif
endif
if i3 > 0 then
set i2 = i2+ (.0375*i3*BlzGetUnitMaxHP(u))
if GetRandomInt(1,100) <= (i3*5) and not CVCooldown[GetUnitUserData(u)] then
set CVCooldown[GetUnitUserData(u)] = true
set t = NewTimer()
set data = SP.create()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,5.,false,function Handler)
set angle = GetRandomReal(0.,360.)
set dist = GetRandomReal(200.,300.)
set x = GetUnitX(u) + dist * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(u) + dist * Sin(angle * bj_DEGTORAD)
set s = CreateUnit(GetOwningPlayer(u),'n041',x,y,GetUnitFacing(u))
set hp = BlzGetUnitMaxHP(u)
if hp > 3000000. then
set hp = 3000000.
endif
set armor = BlzGetUnitArmor(u)
if armor > 7777. then
set armor = 7777.
endif
call BlzSetUnitBaseDamage(s,R2I((armor*100.)+(hp*.1)+(GetHeroStr(u,true)*10.*(1.+(.125*GetHeroLevel(u))))),0)
call BlzSetUnitMaxHP(s,R2I(hp))
call BlzSetUnitArmor(s,armor)
call SetWidgetLife(s,GetUnitState(s,UNIT_STATE_MAX_LIFE))
call UnitApplyTimedLife(s,'BTLF',10.+(GetHeroLevel(u)*.5)+(BlzGetUnitArmor(u)*.075))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl",x,y))
endif
endif
if i4 > 0 then
set i2 = i2+ (.35*i4*GetHeroStr(u,true))
endif
if i5 > 0 then
set i2 = i2+ (2.*i5*BlzGetUnitArmor(u))
endif
if i3 > 0 or i4 > 0 or i5 > 0 then
set i2 = i2* (1.+(i3*.1) + (i4*.06) + (i5 * .06)+(i8*.005*corruption))
endif
if d-(i2*1.) <= 0. then
call BlzSetEventDamage(0.)
// set tt = CreateTextTag()
// set Q7E = "Blocked!"
// call SetTextTagText(tt,Q7E,.012)
// call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
// call SetTextTagColor(tt,105,105,105,255)
// call SetTextTagVelocity(tt,.0,.04)
// call SetTextTagVisibility(tt,true)
// call SetTextTagFadepoint(tt,2.)
// call SetTextTagLifespan(tt,5.)
// call SetTextTagPermanent(tt,false)
else
call BlzSetEventDamage(d-(i2*1.))
endif
endif
endif
endif
//set tt = null
//set Q7E = null
set it = null
set a = null
set u = null
set s = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope LightningRain initializer OnInit
globals
private constant integer ARMAGEDDON_ABILITY = 'A0QR'
// Damage options.
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
// Missile constants.
private constant real METEOR_START_HEIGHT = 2500.
// Effect options.
// EVENT_PLAYER_UNIT_SPELL_EFFECT.
// private constant string ON_EFFECT_EVENT_FX = ".mdl"
// private constant string ON_CASTER_FX = ".mdl"
// private constant string CASTER_FX_ATTACH_POINT = "origin"
private constant string ON_DAMAGE_UNIT_FX = "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldBuff.mdl"
private constant string DAMAGE_FX_ATTACH_POINT = "chest"
// Spell concept.
// EVENT_PLAYER_UNIT_ISSUED_ORDER or EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER.
// private constant boolean IS_IMMEDIATE_ORDER = true
private constant boolean IMPACT_DAMAGES_TREES = false//Requires library IsDestructableTree.
// private constant boolean DAMAGE_FLYING_UNITS = true// Requires USE_COLLISION_Z_FILTER = true in library Missile.
endglobals
// Set if the spell moves along with the caster.
private function IsSpellMovingWithCaster takes unit caster, integer level returns boolean
return true
endfunction
// Set if the caster has to channel the spell.
// In case the spell is channeling, make sure the "follow through time" field of the ability fits the spell duration.
private function IsSpellChanneling takes unit caster, integer level returns boolean
return false
endfunction
// Set how many meteor should be created per second.
// This function is re-evaluated each second, therefore a GetRandomInt() also makes sense here.
private function GetMeteorsPerSecond takes integer level returns integer
return GetRandomInt(35,45)
endfunction
// Set the total spell duration.
private constant function GetSpellDuration takes integer level, unit caster returns real
return 10.
endfunction
// Set the maximum field size in which effects take place.
private constant function GetSpellFieldSize takes integer level returns real
return 475.
endfunction
// Set the expected fly time per meteor.
private function GetMeteorFlyTime takes integer level returns real
return GetRandomReal(.4, .65)
endfunction
// Filter valid target units. Runs on unit collision.
// Do NOT filter for flying units. This is done internally inside the spell script.
private function FilterUnits takes unit target, player p returns boolean
return UnitAlive(target) and IsUnitEnemy(target, p)
endfunction
// Runs each time before a new meteor is created.
private function GlobalCasterCondition takes unit caster returns boolean
return UnitAlive(caster)
endfunction
// Customize all missile members to your needs. "speed", "source", "owner" and "acceleration" are reserved and will be overriden.
private function CustomizeMeteor takes Misssile missile, unit caster, integer level returns nothing
local real scale = GetRandomReal(.8, 1.1)
set missile.scale = scale
set missile.damage =level * 1.0 *(GetHeroAgi(caster,true)*(1.+(.05*GetHeroLevel(caster))))
set missile.collision = 96.
// set missile.collisionZ = 96.*scale// Only required for if you want to damage flying units in mid air.
set missile.model = "war3mapImported\\ZeusMissile.mdx"
endfunction
//========================================================================
// Armageddon code. Make changes carefully.
//========================================================================
// Uses Missile's API.
private struct Meteor extends array
// Runs on any destructable collision. You'll need IsDestructableTree.
// static if LIBRARY_IsDestructableTree and IMPACT_DAMAGES_TREES then
// static method onDestructable takes Misssile missile, destructable hit returns boolean
// if IsTreeAlive(hit) then
// if (missile.damage > (GetWidgetLife(hit) + .405)) then
// call KillDestructable(hit)
// else
// call SetWidgetLife(hit, GetWidgetLife(hit) - missile.damage)
// call SetDestructableAnimation(hit, "stand hit")
// endif
// endif
// return false
// endmethod
//endif
// Runs on any unit collision. Written to hit flying units in mid air.
// Requires Missile_USE_COLLISION_Z_FILTER = true.
// static if Missile_USE_COLLISION_Z_FILTER and DAMAGE_FLYING_UNITS then
// static method onCollide takes Misssile missile, unit hit returns boolean
// if IsUnitType(hit, UNIT_TYPE_FLYING) and FilterUnits(hit, missile.owner) then
// if UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.005), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
// call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
// endif
// endif
// return false
// endmethod
// endif
// Runs when a missile launched from the Armageddon struct is deallocated.
// Written to hit non flying units in collision range.
/* static method onRemove takes Misssile missile returns boolean
local unit u
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
if UnitDamageTargetEx(missile.source, u, missile.damage+(GetWidgetLife(u)*.01), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, u, DAMAGE_FX_ATTACH_POINT))
endif
endif
endloop
return true
endmethod*/
static method onCollide takes Misssile missile , unit hit returns boolean
if FilterUnits(hit, missile.owner) then
if GetUnitAbilityLevel(missile.source,'A0G0') != 1 then
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.01), false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
call EnableTrigger(TOXIAPOISON)
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
endif
return true
endif
return false
endmethod
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Enables the Missile interface for this struct.
implement MisssileStruct
endstruct
private function Random takes nothing returns real
return GetRandomReal(0., 1.)
endfunction
private function GetRandomRange takes real radius returns real
local real r = Random() + Random()
if r > 1. then
return (2 - r)*radius
endif
return r*radius
endfunction
private function CreateMeteor takes unit source, player owner, real centerX, real centerY, real maxRange, integer level returns nothing
// Get point of creation.
local real theta = 2*bj_PI*Random()
local real radius = GetRandomRange(maxRange)
local real posX = centerX + radius*Cos(theta)
local real posY = centerY + radius*Sin(theta)
// Get the fly angle and maximum distance towards it.
local real angle = 2*bj_PI*Random()
local real maxX = centerX + maxRange*Cos(angle)
local real maxY = centerY + maxRange*Sin(angle)
// Get the maximum distance without leaving the field.
local real dX = posX - maxX
local real dY = posY - maxY // Between 0 and max distance.
//local Misssile missile = Misssile.create(posX, posY, METEOR_START_HEIGHT, angle, SquareRoot(dX*dX + dY*dY)*Random(), 0.)
local Misssile missile = Misssile.create(posX, posY, METEOR_START_HEIGHT, 180.*bj_DEGTORAD, 0., 0.)
// Allow user customization.
call CustomizeMeteor(missile, source, level)
// Set or override important missile fields.
set missile.source = source
set missile.owner = owner
set missile.acceleration = 0.
call missile.flightTime2Speed(GetMeteorFlyTime(level))
call Meteor.launch(missile)
endfunction
private struct Armageddon// extends array
// implement Alloc
//
// Members.
unit source
unit target
player user
timer clock
effect fx
// sound snd
//
real centerX
real centerY
real size
real time
real interval
integer count
// integer order
integer level
// Spell concept members.
//boolean move
// boolean channel
method clear takes nothing returns nothing
// if snd != null then
// call StopSound(snd, true, true)
// set snd = null
//endif
call DestroyEffect(fx)
call ReleaseTimer(clock)
call deallocate()
//set MultiRains[GetUnitUserData(source)] = MultiRains[GetUnitUserData(source)] - 1
set source = null
set clock = null
set target = null
set user = null
set fx = null
endmethod
static method onPeriodic takes nothing returns nothing
local real angle
local thistype this = GetTimerData(GetExpiredTimer())
local boolean fire = (count > 0)
// Evaluate global conditions.
if time <= 0. then
call clear()
else
// Update time members.
set time = time - interval
set count = count - 1
if count <= 0 then
set count = GetMeteorsPerSecond(level)
set interval = 1./IMaxBJ(1, count)
call TimerStart(clock, interval, true, function thistype.onPeriodic)
endif
// Update the center position.
//if (snd != null) then
// call SetSoundPosition(snd, centerX, centerY, 0.)
// endif
if fire then
// Create a new meteor.
call CreateMeteor(source, user, centerX, centerY, size, level)
endif
endif
endmethod
endstruct
private function Actions takes nothing returns nothing
local Armageddon dex = Armageddon.create()
set dex.source = GetTriggerUnit()
set dex.level = 1
set dex.clock = NewTimerEx(dex)
set dex.user = GetOwningPlayer(dex.source)
set dex.time = GetSpellDuration(dex.level,dex.source)
set dex.count = GetMeteorsPerSecond(dex.level)
set dex.size = GetSpellFieldSize(dex.level)*.5
set dex.centerX = GetSpellTargetX()
set dex.centerY = GetSpellTargetY()
// Run effects.
//set dex.snd = GetSoundHandle()
// if dex.snd != null then
// call SetSoundPosition(dex.snd, dex.centerX, dex.centerY, 0.)
// endif
//call DestroyEffect(AddSpecialEffect(ON_EFFECT_EVENT_FX, dex.centerX, dex.centerY))
//set dex.fx = AddSpecialEffectTarget(ON_CASTER_FX, source, CASTER_FX_ATTACH_POINT)
// Start the spell.
set dex.interval = 1./IMaxBJ(1, dex.count)
call TimerStart(dex.clock, dex.interval, true, function Armageddon.onPeriodic)
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ARMAGEDDON_ABILITY , function Actions)
endfunction
endscope
scope TearRain initializer OnInit
globals
private constant integer ARMAGEDDON_ABILITY = 'A0QS'
// Damage options.
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
// Missile constants.
private constant real METEOR_START_HEIGHT = 3000.
// Effect options.
// EVENT_PLAYER_UNIT_SPELL_EFFECT.
// private constant string ON_EFFECT_EVENT_FX = ".mdl"
// private constant string ON_CASTER_FX = ".mdl"
// private constant string CASTER_FX_ATTACH_POINT = "origin"
private constant string ON_DAMAGE_UNIT_FX = "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl"
private constant string DAMAGE_FX_ATTACH_POINT = "chest"
// Spell concept.
// EVENT_PLAYER_UNIT_ISSUED_ORDER or EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER.
// private constant boolean IS_IMMEDIATE_ORDER = true
private constant boolean IMPACT_DAMAGES_TREES = false//Requires library IsDestructableTree.
// private constant boolean DAMAGE_FLYING_UNITS = true// Requires USE_COLLISION_Z_FILTER = true in library Missile.
endglobals
// Set if the spell moves along with the caster.
private function IsSpellMovingWithCaster takes unit caster, integer level returns boolean
return true
endfunction
// Set if the caster has to channel the spell.
// In case the spell is channeling, make sure the "follow through time" field of the ability fits the spell duration.
private function IsSpellChanneling takes unit caster, integer level returns boolean
return false
endfunction
// Set how many meteor should be created per second.
// This function is re-evaluated each second, therefore a GetRandomInt() also makes sense here.
private function GetMeteorsPerSecond takes integer level returns integer
return GetRandomInt(35,45)
endfunction
// Set the total spell duration.
private constant function GetSpellDuration takes integer level, unit caster returns real
return 15.
endfunction
// Set the maximum field size in which effects take place.
private constant function GetSpellFieldSize takes integer level returns real
return 600.
endfunction
// Set the expected fly time per meteor.
private function GetMeteorFlyTime takes integer level returns real
return GetRandomReal(1.1, 1.35)
endfunction
// Filter valid target units. Runs on unit collision.
// Do NOT filter for flying units. This is done internally inside the spell script.
private function FilterUnits takes unit target, player p returns boolean
return UnitAlive(target) and IsUnitEnemy(target, p)
endfunction
// Runs each time before a new meteor is created.
private function GlobalCasterCondition takes unit caster returns boolean
return UnitAlive(caster)
endfunction
// Customize all missile members to your needs. "speed", "source", "owner" and "acceleration" are reserved and will be overriden.
private function CustomizeMeteor takes Misssile missile, unit caster, integer level returns nothing
local real scale = GetRandomReal(1.25, 1.75)
set missile.scale = scale
set missile.damage =level * 2. *(GetHeroAgi(caster,true)*(1.+(.05*GetHeroLevel(caster))))
set missile.collision = 96.
// set missile.collisionZ = 96.*scale// Only required for if you want to damage flying units in mid air.
set missile.model = "war3mapImported\\BonefireArrowFireless.mdx"
endfunction
//========================================================================
// Armageddon code. Make changes carefully.
//========================================================================
// Uses Missile's API.
private struct Meteor extends array
// Runs on any destructable collision. You'll need IsDestructableTree.
// static if LIBRARY_IsDestructableTree and IMPACT_DAMAGES_TREES then
// static method onDestructable takes Misssile missile, destructable hit returns boolean
// if IsTreeAlive(hit) then
// if (missile.damage > (GetWidgetLife(hit) + .405)) then
// call KillDestructable(hit)
// else
// call SetWidgetLife(hit, GetWidgetLife(hit) - missile.damage)
// call SetDestructableAnimation(hit, "stand hit")
// endif
// endif
// return false
// endmethod
//endif
// Runs on any unit collision. Written to hit flying units in mid air.
// Requires Missile_USE_COLLISION_Z_FILTER = true.
// static if Missile_USE_COLLISION_Z_FILTER and DAMAGE_FLYING_UNITS then
// static method onCollide takes Misssile missile, unit hit returns boolean
// if IsUnitType(hit, UNIT_TYPE_FLYING) and FilterUnits(hit, missile.owner) then
// if UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.005), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
// call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
// endif
// endif
// return false
// endmethod
// endif
// Runs when a missile launched from the Armageddon struct is deallocated.
// Written to hit non flying units in collision range.
/* static method onRemove takes Misssile missile returns boolean
local unit u
call GroupEnumUnitsInRange(GLOBALGROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if FilterUnits(u, missile.owner) then
if UnitDamageTargetEx(missile.source, u, missile.damage+(GetWidgetLife(u)*.0275), false, true, ATTACK_TYPE, DAMAGE_TYPE, null) then
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, u, DAMAGE_FX_ATTACH_POINT))
endif
endif
endloop
return true
endmethod*/
static method onCollide takes Misssile missile , unit hit returns boolean
if FilterUnits(hit, missile.owner) then
if GetUnitAbilityLevel(missile.source,'A0G0') != 1 then
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(missile.source, hit, missile.damage+(GetWidgetLife(hit)*.0175*missile.data), false, true, ATTACK_TYPE, DAMAGE_TYPE, null)
call EnableTrigger(TOXIAPOISON)
call DestroyEffect(AddSpecialEffectTarget(ON_DAMAGE_UNIT_FX, hit, DAMAGE_FX_ATTACH_POINT))
endif
return true
endif
return false
endmethod
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Enables the Missile interface for this struct.
implement MisssileStruct
endstruct
private function Random takes nothing returns real
return GetRandomReal(0., 1.)
endfunction
private function GetRandomRange takes real radius returns real
local real r = Random() + Random()
if r > 1. then
return (2 - r)*radius
endif
return r*radius
endfunction
private function CreateMeteor takes unit source, player owner, real centerX, real centerY, real maxRange, integer level returns nothing
// Get point of creation.
local real theta = 2*bj_PI*Random()
local real radius = GetRandomRange(maxRange)
local real posX = centerX + radius*Cos(theta)
local real posY = centerY + radius*Sin(theta)
// Get the fly angle and maximum distance towards it.
local real angle = 2*bj_PI*Random()
local real maxX = centerX + maxRange*Cos(angle)
local real maxY = centerY + maxRange*Sin(angle)
// Get the maximum distance without leaving the field.
local real dX = posX - maxX
local real dY = posY - maxY // Between 0 and max distance.
local Misssile missile = Misssile.create(posX, posY, METEOR_START_HEIGHT, angle, SquareRoot(dX*dX + dY*dY)*Random(), 0.)
//local Misssile missile = Misssile.create(posX, posY, METEOR_START_HEIGHT, 180.*bj_DEGTORAD, 0., 0.)
// Allow user customization.
call CustomizeMeteor(missile, source, level)
// Set or override important missile fields.
set missile.source = source
set missile.owner = owner
set missile.acceleration = 0.
call missile.flightTime2Speed(GetMeteorFlyTime(level))
call Meteor.launch(missile)
endfunction
private struct Armageddon// extends array
// implement Alloc
//
// Members.
unit source
unit target
player user
timer clock
effect fx
// sound snd
//
real centerX
real centerY
real size
real time
real interval
integer count
// integer order
integer level
// Spell concept members.
//boolean move
// boolean channel
method clear takes nothing returns nothing
// if snd != null then
// call StopSound(snd, true, true)
// set snd = null
//endif
call DestroyEffect(fx)
call ReleaseTimer(clock)
call deallocate()
//set MultiRains[GetUnitUserData(source)] = MultiRains[GetUnitUserData(source)] - 1
set source = null
set clock = null
set target = null
set user = null
set fx = null
endmethod
static method onPeriodic takes nothing returns nothing
local real angle
local thistype this = GetTimerData(GetExpiredTimer())
local boolean fire = (count > 0)
// Evaluate global conditions.
if time <= 0. then
call clear()
else
// Update time members.
set time = time - interval
set count = count - 1
if count <= 0 then
set count = GetMeteorsPerSecond(level)
set interval = 1./IMaxBJ(1, count)
call TimerStart(clock, interval, true, function thistype.onPeriodic)
endif
// Update the center position.
//if (snd != null) then
// call SetSoundPosition(snd, centerX, centerY, 0.)
// endif
if fire then
// Create a new meteor.
call CreateMeteor(source, user, centerX, centerY, size, level)
endif
endif
endmethod
endstruct
private function Actions takes nothing returns nothing
local Armageddon dex = Armageddon.create()
set dex.source = GetTriggerUnit()
set dex.level = 1
set dex.clock = NewTimerEx(dex)
set dex.user = GetOwningPlayer(dex.source)
set dex.time = GetSpellDuration(dex.level,dex.source)
set dex.count = GetMeteorsPerSecond(dex.level)
set dex.size = GetSpellFieldSize(dex.level)*0.5
set dex.centerX = GetSpellTargetX()
set dex.centerY = GetSpellTargetY()
// Run effects.
//set dex.snd = GetSoundHandle()
// if dex.snd != null then
// call SetSoundPosition(dex.snd, dex.centerX, dex.centerY, 0.)
// endif
//call DestroyEffect(AddSpecialEffect(ON_EFFECT_EVENT_FX, dex.centerX, dex.centerY))
//set dex.fx = AddSpecialEffectTarget(ON_CASTER_FX, source, CASTER_FX_ATTACH_POINT)
// Start the spell.
set dex.interval = 1./IMaxBJ(1, dex.count)
call TimerStart(dex.clock, dex.interval, true, function Armageddon.onPeriodic)
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ARMAGEDDON_ABILITY , function Actions)
endfunction
endscope
//TESH.scrollpos=12
//TESH.alwaysfold=0
scope ChaoticBoulder initializer Init /*v1.0
*************************************************************************************
*
* Hurls a boulder of magma towards the targeted point,
* splitting on impact into tiny fragments that launch into the sky.
*
*************************************************************************************/
//**
//* User settings:
//* ==============
globals
private constant integer CHAOTIC_BOULDER_ABILITY = 'A00D'
//* Damage options.
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
//* Effect options.
private constant string ON_EFFECT_FX = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
private constant string ON_DAMAGE_BIG_FX = "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"
endglobals
//* Filter valid target units.
private function FilterUnits takes unit target, player owner returns boolean
return UnitAlive(target) and IsUnitEnemy(target, owner) and not IsUnitType(target, UNIT_TYPE_FLYING)
endfunction
//* Set the travel distance.
private function GetSmallBoulderFlyDistance takes integer level returns real
return GetRandomReal(50., 200.)
endfunction
//* Set the explosion radius on impact.
private constant function GetExplosionRadius takes integer level returns real
return 200. + (0.*level)
endfunction
//* Set the amount of fragments.
private function GetSmallBoulderCount takes integer level returns integer
return GetRandomInt(4, 6) + 2*level
endfunction
//* Customize all missile members to your needs.
private function CustomizeSmallMissile takes Missile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 1.5)*distance/200.)
set missile.damage = 10. + 10.*level
set missile.collision = 96.
set missile.arc = GetRandomReal(80., 85.)*bj_DEGTORAD
set missile.model = "Abilities\\Spells\\Other\\Volcano\\VolcanoMissile.mdl"
set missile.scale = 0.8
endfunction
//* Customize all missile members to your needs.
private function CustomizeBigMissile takes Missile missile, real distance, integer level returns nothing
call missile.flightTime2Speed(GetRandomReal(1., 2.)*distance/800.)
set missile.damage = 200. + 70.*level
set missile.arc = 45.*bj_DEGTORAD + RMinBJ(20., distance*.1)*bj_DEGTORAD
set missile.collision = 128.
set missile.model = "Abilities\\Spells\\Other\\Volcano\\VolcanoMissile.mdl"
set missile.scale = 1.2
endfunction
//========================================================================
//* Chaotic boulder code. Make changes carefully.
//========================================================================
//* Uses Missile's API. Add or remove whatever you need.
private struct ChaoticBoulder extends array
//* Only living trees are valid targets.
private static method createSmallBoulders takes Missile big returns nothing
local integer level = GetUnitAbilityLevel(big.source, CHAOTIC_BOULDER_ABILITY)
local integer dex = 0
local integer max = GetSmallBoulderCount(level)
local Missile small
loop
exitwhen (dex >= max)
set small = Missile.create(big.x, big.y, 0., GetRandomReal(-bj_PI, bj_PI), GetSmallBoulderFlyDistance(level), 0.)
call CustomizeSmallMissile(small, small.origin.distance, level)
set small.source = big.source
set small.owner = big.owner
set small.data = 0
call thistype.launch(small)
set dex = dex + 1
endloop
endmethod
//* Damages close unit on missile removal.
private static method onRemove takes Missile missile returns boolean
local unit u
call GroupEnumUnitsInRange(SpellIndex.GLOBAL_GROUP, missile.x, missile.y, missile.collision, null)
loop
set u = FirstOfGroup(SpellIndex.GLOBAL_GROUP)
exitwhen u == null
call GroupRemoveUnit(SpellIndex.GLOBAL_GROUP, u)
if FilterUnits(u, missile.owner) then
call UnitDamageTarget(missile.source, u, missile.damage, false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
endif
endloop
//* Detect big boulder.
if (missile.data == -1) then
//* Runs effects.
call DestroyEffect(AddSpecialEffect(ON_DAMAGE_BIG_FX, missile.x, missile.y))
call createSmallBoulders(missile)
endif
return true
endmethod
implement MissileStruct
endstruct
private function OnEffect takes nothing returns nothing
local unit source = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(source, CHAOTIC_BOULDER_ABILITY)
local real x = GetUnitX(source)
local real y = GetUnitY(source)
//* Create the main missile.
local Missile missile = Missile.createXYZ(x, y, GetUnitFlyHeight(source), GetSpellTargetX(), GetSpellTargetY(), 0.)
call CustomizeBigMissile(missile, missile.origin.distance, level)
set missile.source = source
set missile.data = -1
set missile.owner = GetTriggerPlayer()
set missile.target = GetSpellTargetUnit()
call ChaoticBoulder.launch(missile)
//* Runs Effects.
call DestroyEffect(AddSpecialEffect(ON_EFFECT_FX, x, y))
set source = null
endfunction
private function Init takes nothing returns nothing
call RegisterSpellEffectEvent(CHAOTIC_BOULDER_ABILITY, function OnEffect)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope TheWitchsTithe initializer OnInit
globals
private constant integer SPELL_ID = 'A0L9'
endglobals
private function Actions takes nothing returns nothing
local unit u = LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
if GetUnitAbilityLevel(u,'A0LE') != 1 then
call UnitAddAbility(u,'A0LE')
call UnitAddAbility(u,'A0LF')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Mana Burn Red.mdx",u,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Evisceration.mdx",u,"chest"))
call TimedL.P2U(AddLightningEx("RENL",true,GetUnitX(u),GetUnitY(u),1500.,GetUnitX(u),GetUnitY(u),GetUnitFlyHeight(u)),u,1.0,GetUnitX(u),GetUnitY(u),1500.,GetUnitFlyHeight(u),1.,1.)
else
if not BlzIsUnitInvulnerable(u) and GetUnitAbilityLevel(u,'A0N9') != 1 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Mana Burn Red.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Chain Impale.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Desecrate.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special-2.mdx",u,"chest"))
call KillUnit(u)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(GetOwningPlayer(u)))]+(GetPlayerName(GetOwningPlayer(u))+"|r"))+(" |c007F1080h|r|c00840F77a|r|c00890E6Es|r|c008F0D65 |r|c00940B5Bp|r|c00990A52a|r|c009E0949i|r|c00A40840d|r|c00A90737 |r|c00AE062ET|r|c00B30525h|r|c00B8031Be|r|c00BE0212 |r|c00C30109W|r|c00C80000i|r|c00C40000t|r|c00C10000c|r|c00BD0000h|r|c00BA0000 |r|c00B60000Q|r|c00B20000u|r|c00AF0000e|r|c00AB0000e|r|c00A80000n|r|c00A40000'|r|c00A00000s|r|c009D0000 |r|c00990000T|r|c00960000i|r|c00920000t|r|c008E0000h|r|c008B0000e|r|c00870000.|r|c00840000.|r|c00800000.|r")))
endif
endif
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope WitchsTithePaid initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))]
if GetUnitAbilityLevel(u,'A0LE') == 1 then
call UnitRemoveAbility(u,'A0LE')
call UnitRemoveAbility(u,'B05O')
call UnitRemoveAbility(u,'A0LF')
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX-Special.mdx",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit())))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Bondage Red HD2.mdx",u,"chest"))
endif
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope Rimefrost initializer OnInit
globals
private constant integer SPELL_ID = 'A0RX'
private constant string EFFECT = "war3mapImported\\FrozenOrb.mdx"
private constant string ATTACH_POINT = "chest"
integer array RimefrostStacks
endglobals
private struct Temp2
unit c
real dmg
real x
real y
real scale
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct TempA
unit c
real dmg
real x
real y
real a
real scale
real scale2
boolean b = false
integer current
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit())and not BlzIsUnitInvulnerable(GetFilterUnit()) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)))
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
local unit u2
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( GLOBAL_CASTER ) ) then
//call UnitDamageTargetEx(GLOBAL_CASTER ,u,BlzGetUnitMaxHP(u)*.0625*.1 ,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamageTargetEx(GLOBAL_CASTER, u, GLOBALDAMAGE, false, false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
set u2 = CreateUnit(GetOwningPlayer( GLOBAL_CASTER ),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(u2,'A0RW')
call IssueTargetOrderById(u2,852095,u)
call UnitApplyTimedLife(u2,'BTLF',.5)
endif
endif
set u2 = null
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Temp2 data = GetTimerData(t)
set GLOBAL_CASTER = data.c
set GLOBALDAMAGE = data.dmg
call GroupEnumUnitsInRange( GLOBALGROUP, data.x, data.y, 120.*data.scale, Filter( function FilterActions ) )
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
local effect fx
local timer t2
local Temp2 data2
if data.current == 5 and not data.b then
call ReleaseTimer(t)
call data.destroy()
elseif data.current == 6 and data.b then
call ReleaseTimer(t)
call data.destroy()
else
if data.current == 0 then
set data.x = data.x + 50. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 50. * Sin(data.a * bj_DEGTORAD)
else
set data.x = data.x + 150. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 150. * Sin(data.a * bj_DEGTORAD)
endif
set fx = AddSpecialEffect("war3mapImported\\NNmodel (59).mdl",data.x,data.y)
call MoveLocation(GLOBALLOCATION,data.x,data.y)
call BlzSetSpecialEffectYaw(fx,data.a*bj_DEGTORAD)
call BlzSetSpecialEffectHeight(fx,GetLocationZ(GLOBALLOCATION))
call BlzSetSpecialEffectScale(fx,data.scale)
call DestroyEffect(fx)
set data2 = Temp2.create()
set data2.dmg = data.dmg * data.scale2
set data.scale = data.scale + .75
set data.scale2 = data.scale2 + .35
set data2.c = data.c
set data2.x = data.x
set data2.y = data.y
set data2.scale = data.scale2
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2, .05, false, function Handler2)
set data.current = data.current + 1
call SetTimerData(t,data)
if data.current == 1 then
call TimerStart(t,0.2,false,function Handler)
else
call TimerStart(t,0.4,false,function Handler)
endif
endif
set t2 =null
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data
local real face
local unit u
local real dx
local real dy
local real a2 = GetRandomReal(0.,360.)
local real a = a2
local unit c = GetTriggerUnit()
local real dmg
local integer id = GetPlayerId(GetOwningPlayer(c))
local real dmg2
local item it
local integer i = 0
local integer i2 = 0
if GetUnitAbilityLevel(c,'A0G0') == 0 then
set dmg = (GetHeroStr(LC[1+id],true) * 4.)*(1.+(GetHeroLevel(LC[1+id])*.05))
set dmg2 = (GetHeroAgi(LC[1+id],true) * 4.)*(1.+(GetHeroLevel(LC[1+id])*.05))
if dmg2 > dmg then
set dmg = dmg2
endif
set dmg2 = (GetHeroInt(LC[1+id],true) * 8.)*(1.+(GetHeroLevel(LC[1+id])*.075))
if dmg2 > dmg then
set dmg = dmg2
endif
loop
exitwhen i > 5
set it = UnitItemInSlot(c,i)
if GetItemTypeId(it) == 'I05O' then
set i2 = i2 + 1
endif
set i = i + 1
endloop
set dmg = dmg *i2
if RimefrostStacks[GetUnitUserData(c)] == 9 then
loop
exitwhen a >= a2 + 360.
set data = TempA.create()
set data.c = c
set GLOBAL_CASTER = data.c
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set face = a
//set data.x = data.x + 10. * Cos((face) * bj_DEGTORAD)
//set data.y = data.y + 10. * Sin((face) * bj_DEGTORAD)
set data.a = face
set data.current = 0
set data.scale = 1.
set data.scale2 = 1.
set data.b = true
set data.dmg = dmg
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.01,false,function Handler)
set a = a + 40.
endloop
set RimefrostStacks[GetUnitUserData(c)] = 0
else
set data = TempA.create()
set data.c = c
set GLOBAL_CASTER = data.c
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set u = ZEE(null,data.x,data.y,3000.,(Condition(function FilterUnits2)))
if u != null then
set dx = GetUnitX(u)
set dy = GetUnitY(u)
set face = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
else
set face = GetRandomReal(0.,360.)
endif
//set data.x = data.x + 10. * Cos((face) * bj_DEGTORAD)
//set data.y = data.y + 10. * Sin((face) * bj_DEGTORAD)
set data.a = face
set data.current = 0
set data.scale = 1.
set data.scale2 = 1.
set data.dmg = dmg
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.01,false,function Handler)
set data = TempA.create()
set data.c = c
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set face = face -25.
//set data.x = data.x + 225. * Cos((face) * bj_DEGTORAD)
//set data.y = data.y + 225. * Sin((face) * bj_DEGTORAD)
set data.a = face
set data.current = 0
set data.scale = 1.
set data.scale2 = 1.
set data.dmg = dmg
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.01,false,function Handler)
set data = TempA.create()
set data.c = c
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set face = face + 50.
//set data.x = data.x + 225. * Cos((face) * bj_DEGTORAD)
//set data.y = data.y + 225. * Sin((face) * bj_DEGTORAD)
set data.a = face
set data.current = 0
set data.scale = 1.
set data.scale2 = 1.
set data.dmg = dmg
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.01,false,function Handler)
set RimefrostStacks[GetUnitUserData(data.c)] = RimefrostStacks[GetUnitUserData(data.c)] + 1
endif
endif
set it = null
set c = null
set u = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope LightningBlade initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private unit CASTER
private real DAMAGE
private real XX
private real YY
private player PLAYA
private constant integer SPELL_ID = 'A0PE'
private constant string EFFECT = "war3mapImported\\Electric Spark - Classic.mdx"
private constant string EFFECT2 = "war3mapImported\\OrbOfLightning.mdl"
private constant string ATTACH_POINT = "chest"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
real tx
real ty
real current
group g
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
local unit d
if UnitAlive(u) then
if IsUnitEnemy( u, PLAYA ) and not IsUnitInGroup( u, GROUP2 ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
call DestroyEffect( AddSpecialEffectTarget( EFFECT2, u, ATTACH_POINT ) )
if not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and GetUnitTypeId(u) != 'E00E' and not BlzIsUnitInvulnerable(u) then
call M6E(u,200.,.75,bj_RADTODEG * Atan2(GetUnitY(u) - YY, GetUnitX(u) - XX),"war3mapImported\\OrbOfLightning.mdx",.0,true,true)
endif
set d = CreateUnit(PLAYA,'h007',XX,YY,0.)
call UnitAddAbility(d,'A0PV')
call IssueTargetOrderById(d,852111,u)
call UnitApplyTimedLife(d,'BTLF',1.)
endif
endif
set d = null
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current <= 0 then
call ShowUnit(data.c,true)
if (GetLocalPlayer() == GetOwningPlayer(data.c))then
call SelectUnit(data.c, true)
endif
call ReleaseTimer(t)
call data.destroy()
call SetUnitX(data.c,data.tx)
call SetUnitY(data.c,data.ty)
else
set data.x = data.x + 90. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 90. * Sin(data.a * bj_DEGTORAD)
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
set PLAYA = GetOwningPlayer(CASTER)
set XX = data.x
set YY = data.y
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 150., Filter( function FilterActions ) )
call DestroyEffect( AddSpecialEffect( EFFECT, data.x, data.y ) )
set data.g = GROUP2
set data.current = data.current -90.
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data
local integer lvl
local real dx
local real dy
if GetUnitTypeId(GetTriggerUnit()) != 'E00E' then
set data = TempA.create()
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.tx = GetSpellTargetX()
set data.ty = GetSpellTargetY()
set data.a = bj_RADTODEG * Atan2(data.ty - data.y, data.tx - data.x)
set dx = data.tx-data.x
set dy = data.ty-data.y
set data.current = SquareRoot(dx * dx + dy * dy)
call ShowUnit(data.c,false)
set lvl = GetUnitAbilityLevel(data.c,SPELL_ID)
set data.dmg = (GetHeroAgi(data.c,true)*75.)*(1.+((GetHeroLevel(data.c))*.02))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope EternitysEnd initializer OnInit
globals
private constant integer SPELL_ID = 'A0DI'
private constant group GROUP = CreateGroup()
private unit CASTER
private real AMOUNT
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call UnitDamageTargetEx(CASTER,u,AMOUNT,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadowCannon.mdx",u,"chest"))
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
set AMOUNT = GetWidgetLife(u)*3.
call SetWidgetLife(u,GetWidgetLife(u)*.5)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PeterifyVer.2.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(0. * bj_DEGTORAD),y+ 300. * Sin(0. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(45. * bj_DEGTORAD),y+ 300. * Sin(45. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(90. * bj_DEGTORAD),y+ 300. * Sin(90. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(135. * bj_DEGTORAD),y+ 300. * Sin(135. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(180. * bj_DEGTORAD),y+ 300. * Sin(180. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(225. * bj_DEGTORAD),y+ 300. * Sin(225. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(270. * bj_DEGTORAD),y+ 300. * Sin(270. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\s_ShadowEruption_Rain.mdx",x+ 300. * Cos(315. * bj_DEGTORAD),y+ 300. * Sin(315. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(0. * bj_DEGTORAD),y+ 300. * Sin(0. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(45. * bj_DEGTORAD),y+ 300. * Sin(45. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(90. * bj_DEGTORAD),y+ 300. * Sin(90. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(135. * bj_DEGTORAD),y+ 300. * Sin(135. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(180. * bj_DEGTORAD),y+ 300. * Sin(180. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(225. * bj_DEGTORAD),y+ 300. * Sin(225. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(270. * bj_DEGTORAD),y+ 300. * Sin(270. * bj_DEGTORAD)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightningNova.mdx",x+ 300. * Cos(315. * bj_DEGTORAD),y+ 300. * Sin(315. * bj_DEGTORAD)))
set CASTER = u
call GroupEnumUnitsInRange(GROUP,x,y,500.,Filter(function FilterActions))
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope HermesLightning initializer OnInit
globals
private constant integer SPELL_ID = 'A0Q6'
private constant group GROUP = CreateGroup()
private unit CASTER
private real XX
private real YY
endglobals
private struct THUNDAANDDALIGHTNING extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
local integer id
if hit == missile.target then
call UnitDamageTargetEx(missile.source, hit, missile.damage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",hit,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Psionic Shot Blue.mdx",hit,"chest"))
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private struct Bls
unit c
real x
real y
real a
real dur
real damage
integer id
integer i
integer i2
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and not BlzIsUnitInvulnerable(u) then
call M6E(u,200.,.75,bj_RADTODEG * Atan2(GetUnitY(u) - YY, GetUnitX(u) - XX),"Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",.0,true,true)
endif
set u = null
return false
endfunction
private function FilterGroup takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit())
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Bls data = GetTimerData(t)
local real x
local real y
local real x2
local real y2
local unit u
local Misssile m
local real a
local effect fx
if data.dur <=0 or not UnitAlive(data.c) then
//call SetUnitPropWindow(data.c, GetUnitDefaultPropWindow(data.c))
//call SetUnitPropWindow(data.c, 60.)
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - .03125
//if GetUnitCurrentOrder(data.c) == 851986 then
//call IssueImmediateOrderById(data.c,851993)
//endif
set x = GetUnitX(data.c)
set y = GetUnitY(data.c)
set data.a = bj_RADTODEG * Atan2(MouseY[data.id] - y, MouseX[data.id] - x)
call SetUnitFacing(data.c,data.a)
set data.x = x + 55.* Cos(GetUnitFacing(data.c) * bj_DEGTORAD)
set data.y = y + 55. * Sin(GetUnitFacing(data.c) * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
else
call SetUnitPosition(data.c,data.x,data.y)
endif
set data.i = data.i+1
set data.i2 = data.i2 + 1
set CASTER = data.c
if data.i == 4 then
set data.i = 0
call GroupEnumUnitsInRange(GROUP,data.x,data.y,648.,Filter(function FilterGroup))
set u = GroupPickRandomUnit(GROUP)
call GroupClear(GROUP)
if u != null then
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set a = Atan2(data.y - y2, data.x - x2)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\JudgementTarget.mdx",u,"origin"))
set m = Misssile.create(data.x, data.y, 65., a, 800., 65.)
set m.source = CASTER
set m.target = u
set m.speed = 56.09375
//set m.acceleration = 7.03125
set m.scale = 2.2
set m.model = "war3mapImported\\Psionic Shot Blue.mdx"
// set m.arc = .15*bj_DEGTORAD
set m.collision = 12.
//set m.spin = 720.*bj_DEGTORAD
// set m.curve = GetRandomReal(-bj_PI/4, bj_PI/4)
set m.owner = GetOwningPlayer(m.source)
set m.damage = data.damage
call THUNDAANDDALIGHTNING.launch(m)// Launch is implemented via module MissileStruct
//call UnitDamageTargetEx(m.target, m.source, m.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Electric Spark - Classic.mdx",m.source,"chest"))
endif
endif
set XX = data.x
set YY = data.y
call GroupEnumUnitsInRange(GROUP,data.x,data.y,148.,Filter(function FilterActions))
if data.i2 == 2 then
set data.i2 = 0
set fx = AddSpecialEffect("war3mapImported\\Electric Spark - Classic.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx,.7)
call DestroyEffect(fx)
endif
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set fx = null
set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Bls data
if GetUnitTypeId(GetTriggerUnit()) != 'E00E' then
set data = Bls.create()
set data.c = GetTriggerUnit()
set data.damage = (1.+((GetHeroLevel(data.c))*.05)) * (GetHeroAgi(data.c,true)) * 5.
//call SetUnitPropWindow(data.c,0.)
set data.id = GetPlayerId(GetOwningPlayer(data.c))
set data.a = GetUnitFacing(data.c)
set data.x = GetUnitX(data.c) + 55.* Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + 55. * Sin(data.a * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
else
call SetUnitPosition(data.c,data.x,data.y)
endif
call IssueImmediateOrderById(data.c,851993)
set data.dur = 10.
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
endif
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope FearItem initializer OnInit
globals
private constant string PATH = "war3mapImported\\Poltergeist.mdx"
private constant string ATTACH = "head"
endglobals
private struct FearIS
unit u
unit c
integer i
integer p
boolean revenge
method destroy takes nothing returns nothing
set .c = null
set .u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FearIS data = GetTimerData(t)
local Fear F
local real r
if GetUnitAbilityLevel(data.u,'B03K') > 0 and data.i <160 and UnitAlive(data.u) and LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] == data.u then
if data.i == 0 or data.i == -1440 then
if GetLocalPlayer() == Player(data.p) then
call EnableUserControl(false)
endif
if Fear.isFeared(data.u) then
set F = Fear.get(data.u)
if data.revenge then
set F.time = F.time + 50.
else
set F.time = F.time + 5.
endif
else
set F = Fear.create()
set F.targ = data.u
set F.path = PATH
set F.attach = ATTACH
if data.revenge then
set F.time = 50.
else
set F.time = 5.
endif
call F.start()
call F.destroy()
endif
endif
call PanCameraToForPlayer(Player(data.p),GetUnitX(data.u),GetUnitY(data.u))
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
else
if GetLocalPlayer() == Player(data.p) then
call EnableUserControl(true)
endif
call data.destroy()
call ReleaseTimer(t)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local FearIS data = FearIS.create()
set data.c = GetTriggerUnit()
if GetUnitAbilityLevel(data.c,'A0G0') == 1 then
set data.u = LC[(1+GetPlayerId(GetOwningPlayer(data.c)))]
set data.i = -1440
set data.revenge = true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(GetOwningPlayer(data.c)))]+(GetPlayerName(GetOwningPlayer(data.c))+"|r"))+(" has succumbed to Dementia.")))
else
set data.u = GetSpellTargetUnit()
set data.i = 0
set data.revenge = false
endif
set data.p = GetPlayerId(GetOwningPlayer(data.u))
call SetTimerData(t,data)
if IsUnitIllusion(data.u) then
call UnitDamageTarget(data.c,data.u,GetUnitState(data.u,UNIT_STATE_MAX_LIFE)*3.,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0CX', function Actions)
endfunction
endscope
scope AntiMagicCharges initializer OnInit
private function Conditions takes nothing returns boolean
local item i = GetManipulatedItem()
if GetItemTypeId(i) == 'I01K' then
if GetItemCharges(i) ==0 then
call RemoveItem( i )
endif
endif
set i = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=16
//TESH.alwaysfold=0
scope PDownfall initializer OnInit
struct PDown
unit u
unit c
method destroy takes nothing returns nothing
set this.c = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local PDown data = GetTimerData(t)
local unit u
local real r
local unit revenge
if GetUnitAbilityLevel(data.c,'A0G0') == 1 then
set revenge = data.u
set data.u = LC[(1+GetPlayerId(GetOwningPlayer(data.c)))]
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[(1+GetPlayerId(GetOwningPlayer(data.c)))]+(GetPlayerName(GetOwningPlayer(data.c))+"|r"))+(" has let Pride become his downfall.")))
endif
if GetUnitAbilityLevel(data.u,'BHbn') > 0 or GetUnitAbilityLevel(data.c,'A0G0') == 1 then
if GetUnitAbilityLevel(data.c,'A0G0') == 1 then
set u = CreateUnit(GetOwningPlayer(revenge),'h00W',GetUnitX(data.u),GetUnitY(data.u),0.0)
else
set u = CreateUnit(GetOwningPlayer(data.c),'h00W',GetUnitX(data.u),GetUnitY(data.u),0.0)
endif
call UnitApplyTimedLife(u,'BTLF',1.)
if IsUnitEnemy(data.u,GetOwningPlayer(data.c)) or GetUnitAbilityLevel(data.c,'A0G0') == 1 then
if IsUnitType(data.u,UNIT_TYPE_HERO) and GetUnitAbilityLevel(data.c,'A0G0') != 1 then
set r = ((5.*GetHeroInt(data.u,true)*GetUnitAbilityLevel(data.u,'A038'))+(5.*GetHeroStr(data.u,true)*GetUnitAbilityLevel(data.u,'A039'))+(5.*GetHeroAgi(data.u,true)*GetUnitAbilityLevel(data.u,'A01J')))
call UnitDamageTargetEx(u,data.u,r,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call Q9E(data.u,R2I(r))
else
if GetUnitAbilityLevel(data.c,'A0G0') == 1 then
set r = 666666.
else
set r = ((25.*GetHeroInt(data.c,true)*GetUnitAbilityLevel(data.c,'A038'))+(25.*GetHeroStr(data.c,true)*GetUnitAbilityLevel(data.c,'A039'))+(25.*GetHeroAgi(data.c,true)*GetUnitAbilityLevel(data.c,'A01J')))
endif
call UnitDamageTargetEx(u,data.u,r,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call Q9E(data.u,R2I(r))
endif
endif
endif
call data.destroy()
call ReleaseTimer(t)
set revenge = null
set u = null
set t = null
endfunction
private function PridesDownfallFunc takes nothing returns nothing
local timer t = NewTimer()
local PDown data = PDown.create()
set data.c = GetTriggerUnit()
set data.u = GetSpellTargetUnit()
call SetUnitState(data.c,UNIT_STATE_MANA,GetUnitState(data.c,UNIT_STATE_MANA)/2.)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0B8', function PridesDownfallFunc)
endfunction
endscope
//TESH.scrollpos=5
//TESH.alwaysfold=0
scope WandCourierPunishment initializer OnInit
private struct WandP
unit u
effect fx
integer i
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local WandP data = GetTimerData(t)
if data.u == null or not UnitAlive(data.u) or data.i == 60 then
call ReleaseTimer(t)
call data.destroy()
else
call SetWidgetLife(data.u,GetWidgetLife(data.u)-(GetWidgetLife(data.u)*.3))
call SetUnitState(data.u,UNIT_STATE_MANA,0.)
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
endfunction
private function Conditions takes nothing returns nothing
local WandP data
local timer t
if GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') == 1 then
set t = NewTimer()
set data = WandP.create()
set data.u = LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
set data.i = 0
set data.fx = AddSpecialEffectTarget("Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl",data.u,"origin")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,"An ominous wind from the East blows for " + ((BS[(1+GetPlayerId(GetOwningPlayer(data.u)))]+(GetPlayerName(GetOwningPlayer(data.u))+"|r"))+("...")))
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A04G', function Conditions)
endfunction
endscope
//TESH.scrollpos=5
//TESH.alwaysfold=0
scope SmokeBombEyegasm initializer OnInit
private function Conditions takes nothing returns nothing
local unit u = GetTriggerUnit()
local effect fx = AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx= AddSpecialEffect("war3mapImported\\Swashbuckler_Turmoil_Effect.MDX",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0KL', function Conditions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseRagnas initializer OnInit
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == 'I030' then
call UnitRemoveAbility(GetTriggerUnit(),'A0C9')
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LoseRagnok initializer OnInit
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == 'I02V' then
call UnitRemoveAbility(GetTriggerUnit(),'A0C8')
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
scope Ragnaros initializer OnInit
globals
private constant integer ABIL_ID = 'A0C9'
private constant integer ITEM_ID = 'I030'
private constant integer DUMMY_ID = 'h00Z'
private constant integer DBUFF_ID = 'A0EQ'
private constant group GROUP = CreateGroup()
private unit CASTER
boolean array RagnarosChecker
endglobals
private struct Ragnas2
unit u
integer i
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct Ragnas
unit u
unit u1
unit u2
unit u3
real a1
real a2
real a3
method destroy takes nothing returns nothing
set this.u = null
set this.u1 = null
set this.u2 = null
set this.u3 = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Ragnas2 data = GetTimerData(t)
set RagnarosChecker[data.i] = false
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local timer t
local Ragnas2 data
local real i
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and RagnarosChecker[GetUnitUserData(u)] == false and GetUnitAbilityLevel(CASTER,'A07S') == 0 then
set t = NewTimer()
set data = Ragnas2.create()
if GetUnitAbilityLevel(u,DBUFF_ID) == 0 then
call UnitAddAbility(u,DBUFF_ID)
endif
set i = -1.*(1.*(1.+(.01*GetHeroLevel(CASTER))))
call AddUnitBonus(u,BONUS_ARMOR,i*GLOBALINTEGER)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Flameshock.mdx",u,"chest"))
call UnitDamageTarget(CASTER,u,GLOBALDAMAGE,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set data.i = GetUnitUserData(u)
set RagnarosChecker[data.i] = true
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler2)
endif
set u = null
set t = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Ragnas data = GetTimerData(t)
local real x
local real y
local integer i = 0
local item it
local integer i2 = 0
local integer id = GetPlayerId(GetOwningPlayer(data.u))
if GetUnitAbilityLevel(data.u,ABIL_ID) != 0 and data.u != null then
set CASTER = data.u
loop
exitwhen i > 5
set it = UnitItemInSlot(data.u,i)
if GetItemTypeId(it) == 'I030' then
set i2 = i2 + 1
endif
set i = i + 1
endloop
set GLOBALINTEGER = i2
set GLOBALDAMAGE = (GetHeroStr(LC[1+id],true)*6.*(1.+((GetHeroLevel(LC[1+id]))*.005))) * i2
set data.a1 = data.a1 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a1 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a1 * bj_DEGTORAD )
call SetUnitX(data.u1,x)
call SetUnitY(data.u1,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
set data.a2 = data.a2 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a2 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a2 * bj_DEGTORAD )
call SetUnitX(data.u2,x)
call SetUnitY(data.u2,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
set data.a3 = data.a3 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a3 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a3 * bj_DEGTORAD )
call SetUnitX(data.u3,x)
call SetUnitY(data.u3,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
else
call RemoveUnit( data.u1 )
call RemoveUnit( data.u2 )
call RemoveUnit( data.u3 )
call data.destroy( )
call ReleaseTimer( t )
endif
set it = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local Ragnas data = Ragnas.create()
local real x
local real y
set data.u = GetTriggerUnit()
set data.a1 = 0.
set x = GetUnitX( data.u ) + 128. * Cos( data.a1 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a1 * bj_DEGTORAD )
set data.u1 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
set data.a2 = 120.
set x = GetUnitX( data.u ) + 128. * Cos( data.a2 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a2 * bj_DEGTORAD )
set data.u2 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
set data.a3 = 240.
set x = GetUnitX( data.u ) + 128. * Cos( data.a3 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a3 * bj_DEGTORAD )
set data.u3 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
set t = null
endfunction
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') == 0 then
if GetUnitAbilityLevel(GetTriggerUnit(),ABIL_ID) == 0 then
call Actions()
call UnitAddAbility(GetTriggerUnit(),ABIL_ID)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope Ragnarok initializer OnInit
globals
private constant integer ABIL_ID = 'A0C8'
private constant integer ITEM_ID = 'I02V'
private constant integer DUMMY_ID = 'h00Z'
private constant integer DBUFF_ID = 'A0EQ'
private constant group GROUP = CreateGroup()
private unit CASTER
boolean array RagnarokChecker
endglobals
private struct Ragnak2
unit u
integer i
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct Ragnak
unit u
unit u1
unit u2
unit u3
unit u4
real a1
real a2
real a3
real a4
method destroy takes nothing returns nothing
set this.u = null
set this.u1 = null
set this.u2 = null
set this.u3 = null
set this.u4 = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Ragnak2 data = GetTimerData(t)
set RagnarokChecker[data.i] = false
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local timer t
local Ragnak2 data
local real i
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and RagnarokChecker[GetUnitUserData(u)] == false and GetUnitAbilityLevel(CASTER,'A07S') == 0 then
set t = NewTimer()
set data = Ragnak2.create()
set data.i = GetUnitUserData(u)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Flameshock.mdx",u,"chest"))
if GetUnitAbilityLevel(u,DBUFF_ID) == 0 then
call UnitAddAbility(u,DBUFF_ID)
endif
set i = -1.*(5.*(1.+(.01*GetHeroLevel(CASTER))))
call AddUnitBonus(u,BONUS_ARMOR,i*GLOBALINTEGER)
set RagnarokChecker[data.i] = true
call UnitDamageTarget(CASTER,u,GLOBALDAMAGE,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler2)
endif
set u = null
set t = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Ragnak data = GetTimerData(t)
local real x
local real y
local integer i = 0
local item it
local integer i2 = 0
local integer id = GetPlayerId(GetOwningPlayer(data.u))
if GetUnitAbilityLevel(data.u,ABIL_ID) != 0 and data.u != null then
set CASTER = data.u
loop
exitwhen i > 5
set it = UnitItemInSlot(data.u,i)
if GetItemTypeId(it) == 'I02V' then
set i2 = i2 + 1
endif
set i = i + 1
endloop
set GLOBALINTEGER = i2
set GLOBALDAMAGE = (GetHeroStr(LC[1+id],true)*40.*(1.+((GetHeroLevel(LC[1+id]))*.02))) * i2
set data.a1 = data.a1 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a1 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a1 * bj_DEGTORAD )
call SetUnitX(data.u1,x)
call SetUnitY(data.u1,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
set data.a2 = data.a2 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a2 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a2 * bj_DEGTORAD )
call SetUnitX(data.u2,x)
call SetUnitY(data.u2,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
set data.a3 = data.a3 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a3 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a3 * bj_DEGTORAD )
call SetUnitX(data.u3,x)
call SetUnitY(data.u3,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
set data.a4 = data.a4 + 2.
set x = GetUnitX( data.u ) + 128. * Cos( data.a4 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a4 * bj_DEGTORAD )
call SetUnitX(data.u4,x)
call SetUnitY(data.u4,y)
call GroupEnumUnitsInRange( GROUP, x, y, 116., Filter( function FilterActions ) )
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
else
call RemoveUnit( data.u1 )
call RemoveUnit( data.u2 )
call RemoveUnit( data.u3 )
call RemoveUnit( data.u4 )
call data.destroy( )
call ReleaseTimer( t )
endif
set it = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local Ragnak data = Ragnak.create()
local real x
local real y
set data.u = GetTriggerUnit()
set data.a1 = 0.
set x = GetUnitX( data.u ) + 128. * Cos( data.a1 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a1 * bj_DEGTORAD )
set data.u1 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
set data.a2 = 90.
set x = GetUnitX( data.u ) + 128. * Cos( data.a2 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a2 * bj_DEGTORAD )
set data.u2 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
set data.a3 = 180.
set x = GetUnitX( data.u ) + 128. * Cos( data.a3 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a3 * bj_DEGTORAD )
set data.u3 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
set data.a4 = 270.
set x = GetUnitX( data.u ) + 128. * Cos( data.a4 * bj_DEGTORAD )
set y = GetUnitY( data.u ) + 128. * Sin( data.a4 * bj_DEGTORAD )
set data.u4 = CreateUnit(GetOwningPlayer(data.u),DUMMY_ID,x,y,0.)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
set t = null
endfunction
private function Conditions takes nothing returns boolean
if GetItemTypeId(GetManipulatedItem()) == ITEM_ID and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') == 0 then
if GetUnitAbilityLevel(GetTriggerUnit(),ABIL_ID) == 0 then
call Actions()
call UnitAddAbility(GetTriggerUnit(),ABIL_ID)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trig, Condition( function Conditions ) )
endfunction
endscope
scope CrucibleHeal initializer OnInit
private function OnSpell takes nothing returns boolean
if UnitHasItemOfTypeBJ(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],'I03C') and GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
call SetWidgetLife(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],GetWidgetLife(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))])+(GetUnitState(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],UNIT_STATE_MAX_LIFE)*.05))
call SetUnitState(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],UNIT_STATE_MANA,GetUnitState(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],UNIT_STATE_MANA)+(GetUnitState(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],UNIT_STATE_MAX_MANA)*.0088))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
scope ShatteringStrike initializer OnInit
globals
private constant integer SPELL_ID = 'A0R4'
private constant integer SPELL_ID2 = 'A0R3'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call BlzSetUnitAttackCooldown(u,.2,0)
call UnitAddAbility(u,SPELL_ID2)
call UnitMakeAbilityPermanent(u,true,SPELL_ID2)
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ShatteringStrikeOnHit initializer OnInit
globals
private constant integer SPELL_ID = 'A0R3'
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit d = GetTriggerUnit()
if GetUnitAbilityLevel(u,SPELL_ID)==1 and u != d and BlzGetEventIsAttack() and IsUnitEnemy(u,GetOwningPlayer(d)) and GetEventDamage() > 1 then
call UnitRemoveAbility(u,SPELL_ID)
call UnitRemoveAbility(u,'B06W')
call BlzSetUnitAttackCooldown(u,1.55,0)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Shield Breaker1.mdx",d,"chest"))
call BlzSetEventDamage((GetEventDamage()*3.)+(BlzGetUnitMaxHP(d)*.8))
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)/4,0)
endif
set d = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=9
//TESH.alwaysfold=0
scope SinisterJar initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real d = GetEventDamage() * 25.
if (UnitHasItemOfTypeBJ(u, 'I034') or UnitHasItemOfTypeBJ(u, 'I035')) and GetEventDamage() >= GetWidgetLife(u) and GetEventDamage() > 0 and a != u then
if (J5V[(ROX((GetUnitTypeId(a))))]) then
if (BI[NI]) == (LN) then
set DI[NI] = DI[NI] + GetEventDamage()
if GetUnitState(u, UNIT_STATE_LIFE) >= GetUnitState(u, UNIT_STATE_MAX_LIFE) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + d)
endif
if (UnitHasItemOfTypeBJ(u, 'I035')) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx", u, "chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx", u, "origin"))
call RemoveItem( GetItemOfTypeFromUnitBJ(u, 'I035') )
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", u, "origin"))
call RemoveItem( GetItemOfTypeFromUnitBJ(u, 'I034') )
endif
endif
else
set DI[NI] = DI[NI] + GetEventDamage()
if GetUnitState(u, UNIT_STATE_LIFE) >= GetUnitState(u, UNIT_STATE_MAX_LIFE) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
else
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + d)
endif
if (UnitHasItemOfTypeBJ(u, 'I035')) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx", u, "chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbOfCorruption.mdx", u, "origin"))
call RemoveItem( GetItemOfTypeFromUnitBJ(u, 'I035') )
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", u, "origin"))
call RemoveItem( GetItemOfTypeFromUnitBJ(u, 'I034') )
endif
endif
endif
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=585
//TESH.alwaysfold=0
//==============================================================================
// Ninja Rope 1.01 -- Spell Making Session #10 -- by masda70
//==============================================================================
// Ninja Rope by masda70,
// - specifically made for wc3c's Spell Making Session #10
// - inspired from Team17's Worms game
// - adjusted to fit wc3's RTS combat, so as to have particular uses in different mainstream map types.
//
// Requirements:
// - vJASS
// - Timer Ticket library made by cohadar
// - Perfect Unit Indexing library made by cohadar
// - Two abilities, the main one to cast the spell and the other to stop swinging
// - The attach point unit, which is a rope in this demo
// Credits to:
// * Cohadar for his TT and PUI libraries
// * Vexorian for vJass
// * PipeDream and all of the other grimoire contributors
// * Rei, for his feedback
// * Wc3campaigns for hosting this spell making contest
//
// Setup:
// - Look below for CUSTOMIZABLE VALUES, and change as you wish both balance, skill progression, SFX and object data
// - Look further below for the DIFFERENTIAL EQUATION, if you wish to play with it
// - Look for SPELL_CONFLICT variables to configure conflicting spells, such as entangling roots and ensnare, which are supposed to prevent moevment
// configuring this is done by setting up the exact buffs, that when removed will trigger the desired effect.
//
// Public functions:
// - NinjaRope_UnitStopSpell takes unit caster : provides a way to stop the unit from swinging, possibly used in conjunction with other spells
// requiring total control of hero's movement, or perhaps to prevent abuse of a certain spell or item with this ability.
//==============================================================================
scope NinjaRope initializer InitTrig
//==============================================================================
// -- CUSTOMIZABLE VALUES --
//==============================================================================
globals //levelable values having an effect on gameplay, all adjusted below in the InitVars function
private real array ROPE_STABLELENGTH //Rope length, kept constant during flight
private real array ROPE_ATTACHHEIGHT //altitude at which the owl flies
private real array ANGLE_INITIALVELOCITY //Given angle initial velocity, keep in mind that it's a constant
//so the caster will have greater Energy the further the spell
//target location is from the caster
private constant boolean SPELL_CONFLICT_ON=true //decide whether buff conflict check is on or not
private integer array SPELL_CONFLICT_IDS //Used to store single target spell buffs that should stop Ninja Rope.
private constant integer SPELL_CONFLICT_NUMBER=3 // Entangle, cyclone and ensnare are setup in this demo, the setup is done in InitVars
endglobals
globals //values having a real effect on gameplay
private constant real GRAVITY_ACCELERATION=-981. //Magnitude of acceleration, a negative value sets the standard direction
private constant real ANGLE_VELOCITYFRICTION=0.10 // Take into account friction, small changes in this value are noticeable in the game
private constant real OWL_STABILISATIONTIME=1. //time in seconds it takes the owl to reach 'cruise height'
private constant real UNIT_COLLISIONRADIUS=10. //radius at which the caster's surrounding elevations are checked
private constant real BOUNCE_ANGLEVELOCITYGAIN=0.1 //Velocity gain upon collision, positive in this example
//since our caster likes to bounce
endglobals
globals //Misc SFX values
private constant real UNIT_ATTACHHEIGHT=70. //height at which the rope appears attached to the caster's body
private constant real BOUNCE_SAMPLERADIUS=4. //is used to find terrain normal vector, not very useful
private constant real FALLINGBOLT_STEP=960.*.03125 //its the step per frame actually the length of the rope does
//when it disappears
endglobals
globals // Object data values
private constant string LIGHTNING_TYPE="ROPE" //Lightning type id
private constant integer ABILITY_ID='A0DL' //Ability id of the main spell
private constant integer ABILITY_STOPID='A0DO' //Ability id of the stop swinging spell
private constant integer UNIT_ID='n00E' //Unit id of the owl, AKA the dummy to which the rope is attached
endglobals
private function InitVars takes nothing returns nothing //The spell has three levels in this demo, adjustable here
set ROPE_STABLELENGTH[1]=700.
set ROPE_STABLELENGTH[2]=700.
set ROPE_STABLELENGTH[3]=700.
set ROPE_ATTACHHEIGHT[1]=800.
set ROPE_ATTACHHEIGHT[2]=800.
set ROPE_ATTACHHEIGHT[3]=800.
set ANGLE_INITIALVELOCITY[1]=-0.5
set ANGLE_INITIALVELOCITY[2]=-0.5
set ANGLE_INITIALVELOCITY[3]=-0.5
//Ladder conflicting BUFFS are setup here for the demo
set SPELL_CONFLICT_IDS[1]='BEer' //Entaling roots
set SPELL_CONFLICT_IDS[2]='Beng' //Raider's Ensnare
set SPELL_CONFLICT_IDS[3]='Bcy2' //DoTT's Cyclone
endfunction
//==============================================================================
// -- END OF CUSTOMIZABLE VALUES --
//==============================================================================
//==============================================================================
//UnitXYZ and Z handling
globals
private location LocationZ=Location(0.,0.)
endglobals
private function UnitAddZ takes unit u returns nothing
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u,'Amrf')
endfunction
private function GetUnitZ takes unit u returns real
call MoveLocation( LocationZ ,GetUnitX(u),GetUnitY(u) )
return GetLocationZ(LocationZ) + GetUnitFlyHeight(u)
endfunction
private function SetUnitXYZ takes unit u, real x, real y,real z returns nothing
call SetUnitX(u,x)
call SetUnitY(u,y)
call MoveLocation( LocationZ , x, y )
call SetUnitFlyHeight(u,z-GetLocationZ(LocationZ),0.)
endfunction
//==============================================================================
globals
private real z1
private real z2
private real z3
private real z4
endglobals
private struct SpellData
public static SpellData array CasterData
unit Caster
unit AttachPoint
lightning bolt
real tetaP //angle
real tetaV //angular momentum
real tetaA //angular acceleration
real utetax //the coordinates of the vector determinating the teta angle along with the (0,0,-1) vector
real utetay
real vtetaz
real aposx
real aposy
real aposz
real cvelx
real cvely
real cvelz
real cposx
real cposy
real cposz
integer ticks
real owlspeed
real owlteta
real owld
real owlx
real owly
real owlz
boolean initfall=false
trigger onDeath
triggercondition onDeathCond
real ropelength
method CalcVelocity takes nothing returns nothing
set .cvelx=Cos(.tetaP)*.utetax*.tetaV*.ropelength
set .cvely=Cos(.tetaP)*.utetay*.tetaV*.ropelength
set .cvelz=-Sin(.tetaP)*.vtetaz*.tetaV*.ropelength
endmethod
method CheckCollision takes nothing returns boolean
call MoveLocation(LocationZ, .cposx-UNIT_COLLISIONRADIUS, .cposy)
set z1=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx+UNIT_COLLISIONRADIUS, .cposy)
set z2=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx, .cposy-UNIT_COLLISIONRADIUS)
set z3=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx, .cposy+UNIT_COLLISIONRADIUS)
set z4=GetLocationZ(LocationZ)
if z1>.cposz or z2>.cposz or z3>.cposz or z4>.cposz then
return true
else
return false
endif
endmethod
method Bounce takes nothing returns nothing
call MoveLocation(LocationZ, .cposx-BOUNCE_SAMPLERADIUS, .cposy)
set z1=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx+BOUNCE_SAMPLERADIUS, .cposy)
set z2=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx, .cposy-BOUNCE_SAMPLERADIUS)
set z3=GetLocationZ(LocationZ)
call MoveLocation(LocationZ, .cposx, .cposy+BOUNCE_SAMPLERADIUS)
set z4=GetLocationZ(LocationZ)
set z1 = (z1-z2)*2.*BOUNCE_SAMPLERADIUS
set z2= (z3-z4)*2.*BOUNCE_SAMPLERADIUS
set z3 = BOUNCE_SAMPLERADIUS
call .CalcVelocity()
if z1*.cvelx+z2*.cvely+z3*.cvelz<=0. then
if .tetaV<0. then
set .tetaV=-.tetaV+BOUNCE_ANGLEVELOCITYGAIN
else
set .tetaV=-.tetaV-BOUNCE_ANGLEVELOCITYGAIN
endif
endif
endmethod
method BoundBounce takes real x, real y returns nothing
call .CalcVelocity()
if x*.cvelx+y*.cvely<=0. then
if .tetaV<0. then
set .tetaV=-.tetaV+BOUNCE_ANGLEVELOCITYGAIN
else
set .tetaV=-.tetaV-BOUNCE_ANGLEVELOCITYGAIN
endif
endif
endmethod
method onDestroy takes nothing returns nothing
local real height = 0.
if GetUnitTypeId(.Caster) == 'U00O' or GetUnitTypeId(.Caster) == 'U003' then
set height = 30.
endif
if GetUnitTypeId(.Caster) == 'U000' then
set height = 120.
endif
call SetUnitFlyHeight(.Caster,height,0.)
call SetUnitPathing(.Caster,true)
set SpellData.CasterData[GetUnitUserData(.Caster)]=0
if .Caster!=null then
call UnitRemoveAbility(.Caster,ABILITY_STOPID)
endif
set .Caster=null
if .AttachPoint!=null then
call KillUnit(.AttachPoint)
endif
set .AttachPoint=null
if .bolt!=null then
call DestroyLightning(.bolt)
endif
set .bolt=null
call TriggerRemoveCondition(.onDeath,.onDeathCond)
call DestroyTrigger(.onDeath)
set .onDeathCond=null
set .onDeath=null
endmethod
static method onDeathCondition takes nothing returns boolean
call SpellData.CasterData[GetUnitUserData(GetTriggerUnit())].Stop()
return false
endmethod
static method create takes unit u returns SpellData
local SpellData this=SpellData.allocate()
set .Caster=u
call UnitAddZ(u)
call SetUnitPathing(u,false)
if GetUnitAbilityLevel(.Caster,ABILITY_STOPID) == 0 then
call UnitAddAbility(.Caster,ABILITY_STOPID)
call UnitMakeAbilityPermanent(.Caster, true, ABILITY_STOPID)
endif
if UnitHasItemOfTypeBJ(.Caster,'I04Y') then
call BlzSetAbilityIntegerLevelField( BlzGetUnitAbility(.Caster, ABILITY_STOPID), ABILITY_ILF_AGILITY_BONUS, 0, 120 + (GetHeroLevel(.Caster)*3) )
call BlzSetAbilityIntegerLevelField( BlzGetUnitAbility(.Caster, ABILITY_STOPID), ABILITY_ILF_INTELLIGENCE_BONUS, 0, R2I( ( GetHeroInt(.Caster,true) + 150 + (GetHeroLevel(.Caster)*8) ) *.1) + 150 + (GetHeroLevel(.Caster)*8) )
else
call BlzSetAbilityIntegerLevelField( BlzGetUnitAbility(.Caster, ABILITY_STOPID), ABILITY_ILF_AGILITY_BONUS, 0, 60+ (GetHeroLevel(.Caster)*1) )
call BlzSetAbilityIntegerLevelField( BlzGetUnitAbility(.Caster, ABILITY_STOPID), ABILITY_ILF_INTELLIGENCE_BONUS, 0, 75 + (GetHeroLevel(.Caster)*2) )
endif
call IncUnitAbilityLevel(.Caster,ABILITY_STOPID)
call DecUnitAbilityLevel(.Caster,ABILITY_STOPID)
set SpellData.CasterData[GetUnitUserData(u)]=this
set .onDeath=CreateTrigger()
call TriggerRegisterUnitEvent( .onDeath, .Caster, EVENT_UNIT_DEATH )
set .onDeathCond=TriggerAddCondition( .onDeath, Condition(function SpellData.onDeathCondition ))
set .cposx=GetUnitX(u)
set .cposy=GetUnitY(u)
set .cposz=GetUnitZ(u)
return this
endmethod
method recreate takes nothing returns nothing //Used between two continious rope casts
if .AttachPoint!=null then
call KillUnit(.AttachPoint)
endif
set .AttachPoint=null
if .bolt!=null then
call DestroyLightning(.bolt)
endif
set .bolt=null
call KillUnit(.AttachPoint)
set .initfall=false
endmethod
public method Stop takes nothing returns nothing
set .ticks=0
endmethod
endstruct
//==============================================================================
// -- DIFFERENTIAL EQUATION --
//
// d^2(Teta)/dt^2=-g/L*Sin(Teta)-F*d(Teta)/dt
//
// where g is the acceleration due to standard gravity, the minus sign is included in the constant value for this demo
// L is the length of the rope
// F is the velocity friction's coef
// Teta is the algebraic angle between the rope and the Z-Axis in the plane in which the movement occurs.
//
// located here due to the problem of availability of private structs
//==============================================================================
private function AngularAcceleration takes SpellData data returns real
return (GRAVITY_ACCELERATION/data.ropelength)*Sin(data.tetaP)-ANGLE_VELOCITYFRICTION*data.tetaV
endfunction
//==============================================================================
// -- END OF DIFFERENTIAL EQUATION --
//==============================================================================
private struct FallingBolt
lightning bolt
real x
real y
real z
real utx
real uty
real vtz
real tP
real l
method onDestroy takes nothing returns nothing
call DestroyLightning(.bolt)
set .bolt=null
endmethod
static method Vanish takes nothing returns boolean
local timer t = GetExpiredTimer()
local FallingBolt this = GetTimerData(t)
set .l=.l-FALLINGBOLT_STEP
if .l<=0. then
call .destroy()
call ReleaseTimer(t)
return true
endif
call MoveLightningEx(.bolt,true,.x,.y,.z,.x+.utx*Sin(.tP)*.l,.y+.uty*Sin(.tP)*.l,.z-70.+.vtz*Cos(.tP)*.l)
call SetTimerData(t,this)
call TimerStart(t,.03125,false,function FallingBolt.Vanish)
set t =null
return false
endmethod
static method create takes SpellData data returns FallingBolt
local timer t = NewTimer()
local FallingBolt this=FallingBolt.allocate()
set .bolt=data.bolt
set .x=data.aposx+data.utetax*Sin(data.owlteta)*(data.owld)
set .y=data.aposy+data.utetay*Sin(data.owlteta)*(data.owld)
set .z=data.aposz-Cos(data.owlteta)*(data.owld)
set .utx=data.utetax
set .uty=data.utetay
set .vtz=data.vtetaz
set .tP=data.tetaP
set .l=data.ropelength
set data.bolt=null
call SetTimerData(t,this)
call TimerStart(t,.03125,false,function FallingBolt.Vanish)
set t=null
return this
endmethod
endstruct
//==============================================================================
globals
//static data
private trigger trg
private real bound_L
private real bound_R
private real bound_U
private real bound_B
private real temp
endglobals
private function PeriodicIntegration takes nothing returns boolean
local timer t = GetExpiredTimer()
local SpellData data = GetTimerData(t)
local boolean b=false
local unit u=data.Caster
local integer i
local real height = 1.
if GetUnitTypeId(u) == 'U00O' or GetUnitTypeId(u) == 'U003' then
set height = 30.
endif
if GetUnitTypeId(u) == 'U000' then
set height = 120.
endif
if data.ticks==0 then //let gravity pull the unit back to a normal position
if not data.initfall then
call FallingBolt.create(data)
call data.CalcVelocity()
set data.initfall=true
endif
set data.cposx=data.cposx+.03125*data.cvelx
set data.cposy=data.cposy+.03125*data.cvely
set data.cposz=data.cposz+.03125*data.cvelz
set data.cvelz=data.cvelz+.03125*GRAVITY_ACCELERATION
call SetUnitXYZ(u,data.cposx,data.cposy,data.cposz)
if data.cposx< bound_L then
set data.cvelx=0
elseif data.cposx>bound_R then
set data.cvelx=0
endif
if data.cposy<bound_B then
set data.cvely=0
elseif data.cposy>bound_U then
set data.cvely=0
endif
if GetUnitFlyHeight(u)<=height then
debug call BJDebugMsg("gravitystop")
//call SetTimerData(t,data)
//call TimerStart(t,.03125,false,function PeriodicIntegration)
call ReleaseTimer(t)
call data.destroy()
set u=null
set t =null
return true
endif
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function PeriodicIntegration)
//call ReleaseTimer(t)
set t = null
set u=null
return false
else
set i=1
if SPELL_CONFLICT_ON then // check conflicts
loop
exitwhen i>SPELL_CONFLICT_NUMBER
if GetUnitAbilityLevel(u,SPELL_CONFLICT_IDS[i])>0 then
set data.ticks=0
set data.tetaV=0
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function PeriodicIntegration)
set t = null
set u = null
return false
endif
set i=i+1
endloop
endif
set data.ticks=data.ticks-1
//Applying LeapFrog
set data.tetaP=data.tetaP+data.tetaV*.03125+data.tetaA*.03125*.03125*0.5
set temp=data.tetaA
set data.tetaA=AngularAcceleration(data)
set data.tetaV=data.tetaV+(data.tetaA+temp)*.03125*0.5
//End of integration
//Reduce owl distance
if data.owld!=0. then
set b=true
if data.owld>data.owlspeed then
set data.owld=data.owld-data.owlspeed
set data.owlx=data.aposx+data.utetax*Sin(data.owlteta)*(data.owld)
set data.owly=data.aposy+data.utetay*Sin(data.owlteta)*(data.owld)
set data.owlz=data.aposz+data.vtetaz*Cos(data.owlteta)*(data.owld)
else
set data.owld=0.
set data.owlx=data.aposx
set data.owly=data.aposy
set data.owlz=data.aposz
endif
endif
//Apply changes to position
set data.cposx=data.owlx+data.utetax*Sin(data.tetaP)*data.ropelength
set data.cposy=data.owly+data.utetay*Sin(data.tetaP)*data.ropelength
set data.cposz=data.owlz+data.vtetaz*Cos(data.tetaP)*data.ropelength
call MoveLightningEx(data.bolt,true,data.cposx,data.cposy,data.cposz+UNIT_ATTACHHEIGHT,data.owlx,data.owly,data.owlz-70.)
call SetUnitXYZ(data.AttachPoint,data.owlx,data.owly,data.owlz)
if data.CheckCollision() then
call data.Bounce()
debug call BJDebugMsg("hitting ground, bounc")
endif
if data.cposx< bound_L then
call data.BoundBounce(1.,0.)
elseif data.cposx>bound_R then
call data.BoundBounce(-1.,0)
endif
if data.cposy<bound_B then
call data.BoundBounce(0.,1.)
elseif data.cposy>bound_U then
call data.BoundBounce(0.,-1.)
endif
call SetUnitXYZ(u,data.cposx,data.cposy,data.cposz) //Is he going to be at some nice position??
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function PeriodicIntegration)
set u=null
set t =null
return false
endif
endfunction
//==============================================================================
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == ABILITY_ID and GetUnitTypeId(GetTriggerUnit()) != 'E00E'
endfunction
private function Actions takes nothing returns nothing
local timer t
local SpellData data
local real duration=15.
local location target=GetSpellTargetLoc()
local real length
local unit u=GetTriggerUnit()
local location casterloc=GetUnitLoc(u)
local integer level =GetUnitAbilityLevel(u,ABILITY_ID)
local integer i=1
if SPELL_CONFLICT_ON then // check conflicts
loop
exitwhen i>SPELL_CONFLICT_NUMBER
if GetUnitAbilityLevel(u,SPELL_CONFLICT_IDS[i])>0 then
call UnitRemoveAbility(u,SPELL_CONFLICT_IDS[i])
endif
set i=i+1
endloop
endif
if SpellData.CasterData[GetUnitUserData(u)]!=0 then
set data=SpellData.CasterData[GetUnitUserData(u)]
call FallingBolt.create(data)
call data.recreate()
set data.tetaV=-RAbsBJ(data.tetaV)
else
set data=SpellData.create(u)
set data.tetaV=ANGLE_INITIALVELOCITY[level]
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function PeriodicIntegration)
endif
set data.ticks=R2I(duration/.03125)
set data.ropelength=ROPE_STABLELENGTH[level]
set data.aposx=GetLocationX(target)
set data.aposy=GetLocationY(target)
set data.aposz=ROPE_ATTACHHEIGHT[level]+RMaxBJ(GetLocationZ(casterloc),GetLocationZ(target))
set length=SquareRoot((data.aposx-data.cposx)*(data.aposx-data.cposx)+(data.aposy-data.cposy)*(data.aposy-data.cposy))
set data.utetax=(data.cposx-data.aposx)/length
set data.utetay=(data.cposy-data.aposy)/length
set data.vtetaz=-1.
set length=SquareRoot((data.aposx-data.cposx)*(data.aposx-data.cposx)+(data.aposy-data.cposy)*(data.aposy-data.cposy)+(data.aposz-data.cposz)*(data.aposz-data.cposz))
set data.tetaP=Acos((data.aposz-data.cposz)/length)
set data.tetaA=AngularAcceleration(data)
set data.owld=length-data.ropelength
set data.owlx=data.aposx+data.utetax*Sin(data.tetaP)*data.owld
set data.owly=data.aposy+data.utetay*Sin(data.tetaP)*data.owld
set data.owlz=data.aposz+data.vtetaz*Cos(data.tetaP)*data.owld
set data.owlteta=data.tetaP
set data.owlspeed=RAbsBJ((data.owld)*.03125/OWL_STABILISATIONTIME)
set data.AttachPoint=CreateUnit(GetOwningPlayer(data.Caster),UNIT_ID,0.,0.,bj_RADTODEG *Atan2(data.aposy-data.cposy,data.aposx-data.cposx))
set data.bolt=AddLightningEx(LIGHTNING_TYPE,true,data.cposx,data.cposy,data.cposz+UNIT_ATTACHHEIGHT,data.owlx,data.owly,data.owlz)
call SetUnitXYZ(data.AttachPoint,data.owlx,data.owly,data.owlz)
call UnitAddZ(data.AttachPoint)
call RemoveLocation(target)
call RemoveLocation(casterloc)
set casterloc=null
set target=null
set u=null
set t = null
endfunction
private function ConditionsStop takes nothing returns boolean
// return GetSpellAbilityId() == ABILITY_STOPID
return SpellData.CasterData[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])] != 0
endfunction
private function ActionsStop takes nothing returns nothing
if SpellData.CasterData[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]!=0 then
call SpellData.CasterData[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])].Stop()
endif
endfunction
//===========================================================================
// Public functions
//===========================================================================
public function UnitStopSpell takes unit u returns nothing
if SpellData.CasterData[GetUnitUserData(u)]!=0 then
call SpellData.CasterData[GetUnitUserData(u)].Stop()
endif
endfunction
private function InitTrig takes nothing returns nothing
call InitVars.execute()
set bound_L=GetRectMinX(bj_mapInitialPlayableArea)
set bound_R=GetRectMaxX(bj_mapInitialPlayableArea)
set bound_B=GetRectMinY(bj_mapInitialPlayableArea)
set bound_U=GetRectMaxY(bj_mapInitialPlayableArea)
set trg = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( trg, Condition( function Conditions ))
call TriggerAddAction( trg, function Actions )
set trg = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(0) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(1) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(2) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(3) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(4) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(5) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(6) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(7) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(8) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(9) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(10) )
call TriggerRegisterPlayerEventEndCinematic( trg, Player(11) )
call TriggerAddCondition( trg, Condition( function ConditionsStop ))
call TriggerAddAction( trg, function ActionsStop )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Pacify initializer OnInit
native UnitAlive takes unit id returns boolean
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetAttacker(),'B03B') ==1 or GetUnitAbilityLevel(GetTriggerUnit(),'B03B') ==1 then
if GetUnitTypeId(GetTriggerUnit()) != 'E00E' then
call IssueImmediateOrder(GetAttacker(),"stop")
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdl",GetAttacker(),"chest"))
call M6E(GetAttacker(),300.,.3,GetUnitFacing(GetAttacker())-180.,".mdl",.0,false,false)
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope WrathActive initializer OnInit
globals
private real DAMAGE
private unit CASTER
private group GROUP = CreateGroup()
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FORCE,WEAPON_TYPE_WHOKNOWS)
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
call DestroyEffect(AddSpecialEffect("war3mapImported\\CorpseExplodeFire.mdx",GetUnitX(u),GetUnitY(u)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\CorspeBomb.mdx",GetUnitX(u),GetUnitY(u)))
call DestroyEffect(AddSpecialEffect("BigBloodEX-NoSplat-NoGutz.mdx",GetUnitX(u),GetUnitY(u)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX-Special.mdx",GetUnitX(u),GetUnitY(u)))
set DAMAGE = GetWidgetLife(u)*3.
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP,GetUnitX(u),GetUnitY(u),375.,Filter(function FilterActions))
call ExplodeUnitBJ(u)
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0FN', function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Defend initializer OnInit
private struct Dstruct
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Dstruct data = GetTimerData(t)
call ShowUnit(data.u,false)
call KillUnit(data.u)
call RemoveUnit(data.u)
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local unit d
local timer t
local Dstruct data
if GetUnitAbilityLevel(u,'B05B')==1 and GetEventDamage() > 1. and a != u and GetRandomInt(0,100) <= 50 then
if (J5V[(ROX((GetUnitTypeId(a))))]) then
if (BI[NI]) == (LN) then
//set DI[NI] = DI[NI] + (GetEventDamage())
call BlzSetEventDamage(0.)
call DestroyEffect(AddSpecialEffectTarget("RandomSlash.mdl",u,"origin"))
set d = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),GetUnitTypeId(u),GetUnitX(u),GetUnitY(u),bj_RADTODEG * Atan2(GetUnitY(a) - GetUnitY(u), GetUnitX(a) - GetUnitX(u)))
call UnitAddAbility(d,'Aloc')
call SetUnitPathing(d,false)
call SetUnitTimeScale(d,3.)
call SetUnitVertexColor(d,255,255,255,80)
call SetUnitScale(d,1.5,.0,.0)
call SetUnitX(d,GetUnitX(u))
call SetUnitY(d,GetUnitY(u))
call SetUnitAnimation(d,"attack")
call SetUnitOwner(d,GetOwningPlayer(u),true)
call SetUnitOwner(d,Player(PLAYER_NEUTRAL_PASSIVE),false)
call UnitDamageTargetEx(d,d,.0,false,false,null,null,WEAPON_TYPE_METAL_LIGHT_SLICE)
//call UnitApplyTimedLife(d,'BTLF',.03)
set data= Dstruct.create()
set data.u=d
set t= NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.4,false,function Handler)
endif
endif
endif
set t = null
set d = null
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope IndulgenceActive initializer OnInit
private function Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
if GetUnitAbilityLevel(u,'A0E0') != 1 and GetUnitAbilityLevel(GetTriggerUnit(),'A0G0') != 1 then
call UnitAddAbility(u,'A0E0')
call UnitAddAbility(u,'A0E4')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special.mdx",u,"origin"))
call SetUnitPathing(u,false)
call ZWE(u,500.)
call IssueTargetOrder(u,"attack",GetTriggerUnit())
endif
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0DR', function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope IndulgenceOnSumm initializer OnInit
private function Conditions takes nothing returns boolean
local unit u = GetSummonedUnit()
if GetUnitTypeId(u)=='n013' and GetRandomInt(0,99)>=49 then
call BlzSetUnitSkin(u,'n03Z')
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ItemOnKillEffects initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = GetKillingUnit()
local unit d = GetDyingUnit()
local integer id2 = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
local integer id = GetPlayerId(GetOwningPlayer(u))
if UnitHasItemOfTypeBJ(LC[1+id],'I036') and Player(id2) != Player(PLAYER_NEUTRAL_PASSIVE) and id != id2 and u != null and GetUnitTypeId(d) != 'n013' and GetUnitTypeId(d) != 'n03I' and GetUnitTypeId(d) != 'n03M' and GetUnitTypeId(d) !='e007' and GetUnitTypeId(d) !='e008' and GetUnitTypeId(d) !='e009' then
if GetUnitAbilityLevel(LC[1+id],'A0LA') != 0 then
call BlzSetUnitBaseDamage(LC[1+id],BlzGetUnitBaseDamage(LC[1+id],0)+100,0)
else
call BlzSetUnitBaseDamage(LC[1+id],BlzGetUnitBaseDamage(LC[1+id],0)+25,0)
endif
endif
if UnitHasItemOfTypeBJ(LC[1+id],'I048') and Player(id2) != Player(PLAYER_NEUTRAL_PASSIVE) and id != id2 and u != null and GetUnitTypeId(d) != 'n013' and GetUnitTypeId(d) != 'n03I' and GetUnitTypeId(d) != 'n03M' and GetUnitTypeId(d) !='e007' and GetUnitTypeId(d) !='e008' and GetUnitTypeId(d) !='e009' then
if GetUnitAbilityLevel(LC[1+id],'A0LA') != 0 then
if GetRandomInt(1,100) <= 100 then
call AddUnitBonus(LC[1+id],BONUS_STRENGTH,3)
call AddUnitBonus(LC[1+id],BONUS_AGILITY,3)
call AddUnitBonus(LC[1+id],BONUS_INTELLIGENCE,3)
endif
else
if GetRandomInt(1,100) <= 10 then
call AddUnitBonus(LC[1+id],BONUS_STRENGTH,1)
call AddUnitBonus(LC[1+id],BONUS_AGILITY,1)
call AddUnitBonus(LC[1+id],BONUS_INTELLIGENCE,1)
endif
endif
endif
if UnitHasItemOfTypeBJ(LC[1+id],'I03F') and GetRandomInt(1,100) <= 44 and Player(id2) != Player(PLAYER_NEUTRAL_PASSIVE) and id != id2 and u != null and GetUnitTypeId(d) != 'n03I' and GetUnitTypeId(d) != 'n03M' and GetUnitTypeId(d) !='e007' and GetUnitTypeId(d) !='e008' and GetUnitTypeId(d) !='e009' then
if CorruptAmount[id] >= 88 then
call SetHeroInt(LC[1+id],GetHeroInt(LC[1+id],false)+4,true)
else
call SetHeroInt(LC[1+id],GetHeroInt(LC[1+id],false)+1,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl",LC[1+id],"origin"))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ForTheCause initializer OnInit
globals
private unit CASTER
private group GROUP = CreateGroup()
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(u,UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(CASTER,u,200.,false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FORCE,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",GetUnitX(u),GetUnitY(u)))
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
set CASTER = GetTriggerUnit()
call DestroyEffect(AddSpecialEffect("war3mapImported\\NuclearExplosion5.mdx",GetUnitX(CASTER),GetUnitY(CASTER)))
call KillUnit(CreateUnit(GetOwningPlayer(CASTER),'h019',GetUnitX(CASTER),GetUnitY(CASTER),0.))
call GroupEnumUnitsInRange(GROUP,GetUnitX(CASTER),GetUnitY(CASTER),924.,Filter(function FilterActions))
call KillUnit(CASTER)
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0FQ', function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope LAsers initializer OnInit
globals
private constant integer SPELL_ID = 'A0M4'
boolean array IsChannelingRedLaser
//private location LOC = Location(0,0)
endglobals
private struct FT
unit c
lightning l
integer i
real x1
real x2
real y1
real y2
real z1
real z2
real a
player p
integer m
effect fx
integer id
boolean anim
method destroy takes nothing returns nothing
set IsChannelingRedLaser[GetUnitUserData(this.c)] = false
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call DestroyLightning(this.l)
set this.l = null
set this.p = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local unit FoG
local group g
//local real z
local real cm = GetUnitState(data.c,UNIT_STATE_MANA)
local integer i
if data.i <= 0 or cm <= data.m*.04 or IsChannelingRedLaser[GetUnitUserData(data.c)] == false or not UnitAlive(data.c) or data.c == null then
call data.destroy()
call ReleaseTimer(t)
else
if data.anim then
call QueueUnitAnimation(data.c,"spell")
endif
set g = CreateGroup()
call LineSegment.EnumUnits(g,data.x1,data.y1,data.x2,data.y2,70.) //takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
//call MoveLocation(LOC,GetUnitX(FoG),GetUnitY(FoG))
//set z = GetLocationZ(LOC)+BlzGetUnitZ(FoG)
if IsUnitEnemy(FoG,data.p) and UnitAlive(FoG) then //and ((z<= data.z1+95. and z>=data.z1-95.)or(z<= data.z2+65. and z>=data.z2-65.)) then
call UnitDamageTargetEx(data.c,FoG,(GetHeroInt(data.c,true)*16.66+(GetHeroInt(data.c,true)*.666*GetHeroLevel(data.c)))*.03125 ,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_PLANT,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"head"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
call SetUnitState(data.c,UNIT_STATE_MANA,cm-(data.m*.04*.03125 ))
set data.a = bj_RADTODEG * Atan2(MouseY[data.id] - data.y1, MouseX[data.id] - data.x1)
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
//call MoveLocation(LOC,data.x2,data.y2)
set data.z2 = GetTerrainZ(data.x2,data.y2) + 45.
call SetUnitFacing(data.c,data.a)
call MoveLightningEx(data.l,true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
call BlzSetSpecialEffectX(data.fx,data.x2)
call BlzSetSpecialEffectY(data.fx,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z2+30.)
call BlzSetSpecialEffectZ(data.fx,data.z2+30.)
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set g = null
set FoG = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local FT data
if IsChannelingRedLaser[GetUnitUserData(GetTriggerUnit())] == false then
set data = FT.create()
set t = NewTimer()
set data.c = GetTriggerUnit()
set data.i = 1280
set data.x1 = GetUnitX(data.c)
set data.y1 = GetUnitY(data.c)
//call MoveLocation(LOC,data.x1,data.y1)
set data.z1 = GetTerrainZ(data.x1,data.y1) + 45.
set data.a = bj_RADTODEG * Atan2(GetSpellTargetY() - data.y1, GetSpellTargetX() - data.x1)
call SetUnitFacing(data.c,data.a)
// local real x = GetLocationX(source) + dist * Cos(angle * bj_DEGTORAD)
//local real y = GetLocationY(source) + dist * Sin(angle * bj_DEGTORAD)
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
//call MoveLocation(LOC,data.x2,data.y2)
set data.z2 = GetTerrainZ(data.x2,data.y2) + 45.
set data.p = GetOwningPlayer(data.c)
set data.m = BlzGetUnitMaxMana(data.c)
set data.l = AddLightningEx("REFB",true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
set data.id = GetPlayerId(data.p)
set data.fx = AddSpecialEffect("war3mapImported\\Ember Red.mdx",data.x2,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z1+30.)
call BlzSetSpecialEffectZ(data.fx,data.z1+30.)
call BlzSetSpecialEffectScale(data.fx,1.75)
set data.anim = false
if GetUnitTypeId(data.c) == 'N01O' or GetUnitTypeId(data.c) == 'U00O' then
call SetUnitAnimation(data.c,"stand channel")
else
if GetUnitTypeId(data.c) == 'E019' or GetUnitTypeId(data.c) == 'N01S' or GetUnitTypeId(data.c) == 'N01T' or GetUnitTypeId(data.c) == 'E01C' then
call SetUnitAnimation(data.c,"stand victory")
else
call SetUnitAnimation(data.c,"spell")
set data.anim = true
endif
endif
set IsChannelingRedLaser[GetUnitUserData(data.c)] = true
call SetTimerData(t,data)
call TimerStart(t,.03125 ,false, function Handler)
endif
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope LAsers initializer OnInit
globals
private constant integer SPELL_ID = 'A0M4'
boolean array IsChannelingRedLaser
private location LOC = Location(0,0)
endglobals
private struct FT
unit c
lightning l
integer i
real x1
real x2
real y1
real y2
real z1
real z2
real a
player p
integer m
effect fx
integer id
boolean anim
method destroy takes nothing returns nothing
set IsChannelingRedLaser[GetUnitUserData(this.c)] = false
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call DestroyLightning(this.l)
set this.l = null
set this.p = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local unit FoG
local group g
//local real z
local real cm = GetUnitState(data.c,UNIT_STATE_MANA)
local integer i
if data.i <= 0 or cm <= data.m*.04 or IsChannelingRedLaser[GetUnitUserData(data.c)] == false or not UnitAlive(data.c) or data.c == null then
call data.destroy()
call ReleaseTimer(t)
else
if data.anim then
call QueueUnitAnimation(data.c,"spell")
endif
set g = CreateGroup()
set data.x1 = GetUnitX(data.c)
set data.y1 = GetUnitY(data.c)
call LineSegment.EnumUnits(g,data.x1,data.y1,data.x2,data.y2,70.) //takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
//call MoveLocation(LOC,GetUnitX(FoG),GetUnitY(FoG))
//set z = GetLocationZ(LOC)+BlzGetUnitZ(FoG)
if IsUnitEnemy(FoG,data.p) and UnitAlive(FoG) then //and ((z<= data.z1+95. and z>=data.z1-95.)or(z<= data.z2+65. and z>=data.z2-65.)) then
call UnitDamageTargetEx(data.c,FoG,(GetHeroInt(data.c,true)*.8888+(GetHeroInt(data.c,true)*.666*GetHeroLevel(data.c)))*.03125*(1.+(GetHeroLevel(data.c)*.04)) ,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_PLANT,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"head"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
call SetUnitState(data.c,UNIT_STATE_MANA,cm-(data.m*.04*.03125 ))
set data.a = bj_RADTODEG * Atan2(MouseY[data.id] - data.y1, MouseX[data.id] - data.x1)
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
call MoveLocation(LOC,data.x2,data.y2)
set data.z2 = GetLocationZ(LOC) + 45.
call SetUnitFacing(data.c,data.a)
call MoveLightningEx(data.l,true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
call BlzSetSpecialEffectX(data.fx,data.x2)
call BlzSetSpecialEffectY(data.fx,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z2+30.)
call BlzSetSpecialEffectZ(data.fx,data.z2+30.)
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set g = null
set FoG = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local FT data
if IsChannelingRedLaser[GetUnitUserData(GetTriggerUnit())] == false then
set data = FT.create()
set t = NewTimer()
set data.c = GetTriggerUnit()
set data.i = 1280
set data.x1 = GetUnitX(data.c)
set data.y1 = GetUnitY(data.c)
call MoveLocation(LOC,data.x1,data.y1)
set data.z1 = GetLocationZ(LOC) + 45.
set data.a = bj_RADTODEG * Atan2(GetSpellTargetY() - data.y1, GetSpellTargetX() - data.x1)
call SetUnitFacing(data.c,data.a)
// local real x = GetLocationX(source) + dist * Cos(angle * bj_DEGTORAD)
//local real y = GetLocationY(source) + dist * Sin(angle * bj_DEGTORAD)
set data.x2 = data.x1 + 1200. * Cos(data.a * bj_DEGTORAD)
set data.y2 = data.y1 + 1200. * Sin(data.a * bj_DEGTORAD)
call MoveLocation(LOC,data.x2,data.y2)
set data.z2 = GetLocationZ(LOC) + 45.
set data.p = GetOwningPlayer(data.c)
set data.m = BlzGetUnitMaxMana(data.c)
set data.l = AddLightningEx("REFB",true,data.x1,data.y1,data.z1,data.x2,data.y2,data.z2)
set data.id = GetPlayerId(data.p)
set data.fx = AddSpecialEffect("war3mapImported\\Ember Red.mdx",data.x2,data.y2)
call BlzSetSpecialEffectHeight(data.fx,data.z1+30.)
call BlzSetSpecialEffectZ(data.fx,data.z1+30.)
call BlzSetSpecialEffectScale(data.fx,1.75)
set data.anim = false
if GetUnitTypeId(data.c) == 'N01O' or GetUnitTypeId(data.c) == 'U00O' then
call SetUnitAnimation(data.c,"stand channel")
else
if GetUnitTypeId(data.c) == 'E019' or GetUnitTypeId(data.c) == 'N01S' or GetUnitTypeId(data.c) == 'N01T' or GetUnitTypeId(data.c) == 'E01C' then
call SetUnitAnimation(data.c,"stand victory")
else
call SetUnitAnimation(data.c,"spell")
set data.anim = true
endif
endif
set IsChannelingRedLaser[GetUnitUserData(data.c)] = true
call SetTimerData(t,data)
call TimerStart(t,.03125 ,false, function Handler)
endif
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope EndLaserCast initializer OnInit
private function Actions takes nothing returns boolean
if GetSpellAbilityId() == 'A0M4' then
set IsChannelingRedLaser[GetUnitUserData(GetTriggerUnit())] = false
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( t, Condition( function Actions) )
endfunction
endscope
scope EternalThirst initializer OnInit
globals
private constant integer SPELL_ID = 'A0QO'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct AblatedCorruption extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
if hit == missile.target then
call SetWidgetLife(missile.target,(GetWidgetLife(missile.target))+(missile.damage*.2 ))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",hit,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidball Minor.mdx",hit,"chest"))
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private struct Bls
unit c
effect fx
//effect fx2
effect fx3
//effect fx4
effect fx5
real dur
real damage
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
//call DestroyEffect(this.fx2)
//set this.fx2 = null
call DestroyEffect(this.fx3)
set this.fx3 = null
//call DestroyEffect(this.fx4)
//set this.fx4 = null
call DestroyEffect(this.fx5)
set this.fx5 = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterGroup takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit())
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Bls data = GetTimerData(t)
local real x
local real y
local real x2
local real y2
local unit u
local Misssile m
local real a
local real c
if data.dur <=0 or not UnitAlive(data.c) then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - .1
set x = GetUnitX(data.c)
set y = GetUnitY(data.c)
set CASTER = data.c
call GroupEnumUnitsInRange(GROUP,x,y,674.,Filter(function FilterGroup))
set u = GroupPickRandomUnit(GROUP)
call GroupClear(GROUP)
if u != null then
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set a = Atan2(GetUnitY(CASTER) - y2, GetUnitX(CASTER) - x2)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Massacre.mdx",u,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\JudgementTarget.mdx",u,"origin"))
set m = Misssile.create(x2, y2, 65., a, 800., 65.)
set m.source = u
set m.target = CASTER
set m.speed = 21.09375
//set m.acceleration = 7.03125
set m.spin = 180.*bj_DEGTORAD
set m.scale = 1.0
set m.model = "war3mapImported\\BloodElementalMisile.mdx"
set m.arc = GetRandomReal(0.,60.)*bj_DEGTORAD
set m.collision = 12.
// set m.curve = GetRandomReal(-bj_PI/4, bj_PI/4)
set m.owner = GetOwningPlayer(m.source)
set m.damage = data.damage
if m.damage > GetWidgetLife(u) then
set m.damage = GetWidgetLife(u)
endif
call AblatedCorruption.launch(m)// Launch is implemented via module MissileStruct
call UnitDamageTargetEx(m.target, m.source, data.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidball Minor.mdx",m.source,"chest"))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodExplosion.mdx",x+(GetRandomReal(-337.,337.)),y+(GetRandomReal(-337.,337.))))
endif
//call DestroyEffect(AddSpecialEffect("war3mapImported\\JudgementTarget.mdx",GetUnitX(data.c),GetUnitY(data.c)))
call SetTimerData(t,data)
call TimerStart(t,.1,false,function Handler)
endif
set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Bls data = Bls.create()
local integer i = 12
local real x
local real y
set data.c = GetTriggerUnit()
set data.fx = AddSpecialEffectTarget("war3mapImported\\BlackFrost Glacial Storm Red.mdx",data.c,"origin")
//set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Blood Aura 2.mdx",data.c,"origin")
//set data.fx4 = AddSpecialEffectTarget("war3mapImported\\BlackFrost Glacial Storm Astral.mdx",data.c,"chest")
//set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Soul Armor Void_opt35.mdx",data.c,"chest")
//set data.fx5 = AddSpecialEffectTarget("war3mapImported\\Soul Armor Void_opt2x.mdx",data.c,"chest")
set data.damage = (7.5*(GetHeroStr(data.c,true)))*(1.+(GetHeroLevel(data.c)*.05))
set x = GetUnitX(data.c)
set y= GetUnitY(data.c)
set data.dur = 10.
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.1,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Soulrend initializer OnInit
globals
private constant integer SPELL_ID = 'S00C'
private constant integer SPELL_ID2 = 'A00I'
boolean array ApplyingNimsha
boolean array ApplyingSoulreave
endglobals
private struct FB2
unit u
unit c
integer i
method destroy takes nothing returns nothing
set this.c = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data = GetTimerData(t)
local integer stat
set stat = GetHeroStr(data.c,true)
if GetHeroAgi(data.c,true) > stat then
set stat = GetHeroAgi(data.c,true)
endif
if GetHeroInt(data.c,true) > stat then
set stat = GetHeroInt(data.c,true)
endif
if stat > 4000 then
set stat = 4000
endif
set ApplyingSoulreave[data.i] = false
call LinkBonusToBuff(data.u, BONUS_MAGIC_RESISTANCE,-.35-(stat*.01*.01*(1.+(.08*GetHeroLevel(data.c)))), 'B063')
call LinkBonusToBuff(data.u, BONUS_ARMOR,-20-(BlzGetUnitArmor(data.u)*2/5), 'B063')
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data = GetTimerData(t)
local integer stat
set stat = GetHeroStr(data.c,true)
if GetHeroAgi(data.c,true) > stat then
set stat = GetHeroAgi(data.c,true)
endif
if GetHeroInt(data.c,true) > stat then
set stat = GetHeroInt(data.c,true)
endif
if stat > 4000 then
set stat = 4000
endif
//call BJDebugMsg(R2S(-1.*(stat*.01*(1.+(.03*GetHeroLevel(data.c))))))
set ApplyingNimsha[data.i] = false
call LinkBonusToBuff(data.u, BONUS_ARMOR,-20-(BlzGetUnitArmor(data.u)*2/5), 'B00H')
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local integer i = GetPlayerId(GetOwningPlayer(a)) + 1
local unit u = GetTriggerUnit()
local unit d
local timer t
local FB2 data
local FB2 data2
if (GetUnitAbilityLevel(LC[i],SPELL_ID) != 0 or GetUnitAbilityLevel(a,SPELL_ID) != 0) and GetUnitAbilityLevel(u,'B063') == 0 and GetEventDamage() >0 and ApplyingSoulreave[GetUnitUserData(u)] == false and not IsUnitType(u,UNIT_TYPE_HERO) then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL) then
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A0MZ')
call IssueTargetOrderById(d,852149,u)
call UnitApplyTimedLife(d,'BTLF',1)
set t = NewTimer()
set data = FB2.create()
set data.u = u
set data.c = LC[i]
set data.i = GetUnitUserData(u)
set ApplyingSoulreave[data.i] = true
call SetTimerData(t,data)
call TimerStart(t,.175,false, function Handler)
endif
else
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A0MZ')
call IssueTargetOrderById(d,852149,u)
call UnitApplyTimedLife(d,'BTLF',1)
set t = NewTimer()
set data = FB2.create()
set data.u = u
set data.c = LC[i]
set data.i = GetUnitUserData(u)
set ApplyingSoulreave[data.i] = true
call SetTimerData(t,data)
call TimerStart(t,.175,false, function Handler)
endif
endif
if (GetUnitAbilityLevel(LC[i],'A00I') != 0 or GetUnitAbilityLevel(a,'A00I') != 0) and GetUnitAbilityLevel(u,'B00H') == 0 and GetEventDamage() >0 and ApplyingNimsha[GetUnitUserData(u)] == false and not IsUnitType(u,UNIT_TYPE_HERO) then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL) then
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A029')
call IssueTargetOrderById(d,852149,u)
call UnitApplyTimedLife(d,'BTLF',1)
set t = NewTimer()
set data2 = FB2.create()
set data2.u = u
set data2.c = LC[i]
set data2.i = GetUnitUserData(u)
set ApplyingNimsha[data2.i] = true
call SetTimerData(t,data2)
call TimerStart(t,.175,false, function Handler2)
endif
else
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A029')
call IssueTargetOrderById(d,852149,u)
call UnitApplyTimedLife(d,'BTLF',1)
set t = NewTimer()
set data2 = FB2.create()
set data2.u = u
set data2.c = LC[i]
set data2.i = GetUnitUserData(u)
set ApplyingNimsha[data2.i] = true
call SetTimerData(t,data2)
call TimerStart(t,.175,false, function Handler2)
endif
endif
if GetUnitAbilityLevel(a,'B049')==1 and IsUnitEnemy(a,GetOwningPlayer(u)) and GetEventDamage() >0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if(BI[NI])==(LN)then
call SetUnitState(a,UNIT_STATE_MANA,GetUnitState(a,UNIT_STATE_MANA)+(GetUnitState(a,UNIT_STATE_MAX_MANA)*.0075))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",a,"origin"))
//call BJDebugMsg("Damage:" + R2S(GetEventDamage()))
endif
else
if(CI[NI]) and BlzGetEventIsAttack() then
call SetUnitState(a,UNIT_STATE_MANA,GetUnitState(a,UNIT_STATE_MANA)+(GetUnitState(a,UNIT_STATE_MAX_MANA)*.0075))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",a,"origin"))
//call BJDebugMsg("Damage:" + R2S(GetEventDamage()))
endif
endif
endif
set t = null
set d = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope MeatStacks initializer OnInit
private function Conditions takes nothing returns boolean
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Meat Collected: " +I2S(MeatCollected[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Premium Meat Collected: " +I2S(PremiumMeatCollected[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Health Gained: " +I2S(MeatHealth[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
local trigger t= CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent(t, Player(pid), "-meat", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition(t, Condition(function Conditions) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SavageStrikes initializer OnInit
globals
trigger SAVAGESTRIKE
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real d = GetEventDamage()
local texttag tt
local string Q7E
local real life = GetWidgetLife(a)
local integer maxhp = BlzGetUnitMaxHP(a)
local integer lvl = GetUnitAbilityLevel(a,'A0NJ')
local effect fx
local real mishp
if lvl!=0 and d > 0 and a != u and ((life<(maxhp*.5) and GetRandomInt(0,100) <= (50+(lvl*5)))or (life>=(maxhp*.5) and GetRandomInt(0,100) <= (25+(lvl*2.5)))) and Damage_IsAttack() and IsUnitEnemy(u,GetOwningPlayer(a)) then
if GetUnitAbilityLevel(a,'B01P') != 0 then
set mishp= (BlzGetUnitMaxHP(u)-GetWidgetLife(u))*.005*GetUnitAbilityLevel(a,'A01H')
call BlzSetEventDamage((GetEventDamage()*2.)+mishp)
//call UnitDamageTargetEx(a,u,d+mishp,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set Q7E = I2S(R2I((d*2.)+mishp)) + "!"
else
call BlzSetEventDamage(GetEventDamage()*2.)
// call UnitDamageTargetEx(a,u,d,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set Q7E = I2S(R2I(d*2.)) + "!"
endif
set tt = CreateTextTag()
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
set fx = AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",a,"origin")
call DestroyEffect(fx)
call SetWidgetLife(a,life+(maxhp-life)*(.01+.004*lvl))
endif
set fx = null
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
set SAVAGESTRIKE = CreateTrigger()
call MOE(II, (SAVAGESTRIKE))
call TriggerAddCondition(SAVAGESTRIKE, Condition(function Actions))
call DisableTrigger(SAVAGESTRIKE)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope StarlightInt initializer OnInit
globals
trigger STARLIGHTINTGAIN
endglobals
private function OnSpell takes nothing returns boolean
if GetUnitTypeId(GetKillingUnit()) == 'e023' and GetRandomInt(0,100) <= 80 and GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
call SetHeroInt(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],GetHeroInt(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl",LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],"origin"))
//call DisplayTextToPlayer(Player(0),0.,0.,GetUnitName(GetKillingUnit())+" killed "+GetUnitName(GetTriggerUnit()))
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set STARLIGHTINTGAIN = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(STARLIGHTINTGAIN, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(STARLIGHTINTGAIN, Condition(function OnSpell))
call DisableTrigger(STARLIGHTINTGAIN)
endfunction
endscope
scope StarlightSphereLearn initializer OnInit
globals
private constant integer SPELL_ID = 'A0PI'
private constant integer SPELL_ID2 = 'A0PK'
trigger STARLIGHTLEARN
endglobals
private function Conditions takes nothing returns boolean
if GetLearnedSkill()==SPELL_ID then
if GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID2) != 1 then
call UnitAddAbility(GetTriggerUnit(),SPELL_ID2)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set STARLIGHTLEARN = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(STARLIGHTLEARN,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(STARLIGHTLEARN,Condition(function Conditions))
call DisableTrigger(STARLIGHTLEARN)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope StarlightSphere initializer OnInit
globals
private constant integer SPELL_ID = 'A0PI'
unit array starsphere
private location LOC = Location(0.,0.)
integer array spherecount
integer array StarlightCharge
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitUserData(u)
local player p = GetOwningPlayer(u)
local effect fx
//call BJDebugMsg("Start:" + I2S(spherecount[i]))
if spherecount[i] <= 0 then
set starsphere[i+spherecount[i]] = CreateUnit(p,'e023',GetSpellTargetX(),GetSpellTargetY(),0.)
call MoveLocation(LOC,GetSpellTargetX(),GetSpellTargetY())
set fx = AddSpecialEffect("war3mapImported\\void.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectHeight(fx,GetLocationZ(LOC)+130.)
call BlzSetSpecialEffectScale(fx,2.4)
call DestroyEffect(fx)
set spherecount[i] = spherecount[i] + 1
else
if spherecount[i] >8 then
call IssueImmediateOrderById(u,851972)
call Q_E(p,"Maximum spheres reached!.")
else
set starsphere[i+spherecount[i]] = CreateUnit(p,'e023',GetSpellTargetX(),GetSpellTargetY(),0.)
call MoveLocation(LOC,GetSpellTargetX(),GetSpellTargetY())
set fx = AddSpecialEffect("war3mapImported\\void.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectHeight(fx,GetLocationZ(LOC)+130.)
call BlzSetSpecialEffectScale(fx,2.4)
call DestroyEffect(fx)
set spherecount[i] = spherecount[i] + 1
endif
endif
//call BJDebugMsg("End:" +I2S(spherecount[i]))
set fx = null
set p = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope DetonateSphereManual initializer OnInit
globals
private constant integer SPELL_ID = 'A0PJ'
private constant integer SPELL_ID2 = 'A0PI'
private group GROUP = CreateGroup()
private unit CASTER
private unit CASTER2
endglobals
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
if IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(CASTER2,GetFilterUnit(),GetUnitAbilityLevel(CASTER,SPELL_ID2)*GetHeroInt(CASTER,true)*5.*(1.0+(StarlightCharge[GetUnitUserData(CASTER2)]*.01)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(CASTER2,GetFilterUnit(),999999.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl",GetFilterUnit(),"chest"))
endif
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit c = LC[1+GetPlayerId(GetOwningPlayer(u))]
local effect fx
//local effect fx2
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firaga.mdx",c,"origin"))
set fx = AddSpecialEffect("war3mapImported\\Arcane Explosion.mdx",x,y)
//set fx2 = AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.0+(StarlightCharge[GetUnitUserData(u)]*.01))
//call BlzSetSpecialEffectScale(fx2,2.3)
call DestroyEffect(fx)
//call DestroyEffect(fx2)
set CASTER= c
set CASTER2 = u
call GroupEnumUnitsInRange(GROUP,x,y,324.*(1.0+(StarlightCharge[GetUnitUserData(u)]*.01)),Filter(function FilterActions))
set spherecount[GetUnitUserData(c)] = spherecount[GetUnitUserData(c)] - 1
call KillUnit(u)
set starsphere[GetUnitUserData(u)] = null
//set fx2 = null
set fx = null
set c = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope StarlightSphereAuto initializer OnInit
globals
private constant integer SPELL_ID = 'A0PK'
private constant integer SPELL_ID2 = 'A0PI'
private group GROUP = CreateGroup()
private unit CASTER
private unit CASTER2
endglobals
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
if IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(CASTER2,GetFilterUnit(),GetUnitAbilityLevel(CASTER,SPELL_ID2)*GetHeroInt(CASTER,true)*5.*(1.0+(StarlightCharge[GetUnitUserData(CASTER2)]*.01)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(CASTER2,GetFilterUnit(),999999.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl",GetFilterUnit(),"chest"))
endif
return false
endfunction
private function Conditions takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit()) == 'e023' and GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit())
endfunction
private function Actions takes nothing returns nothing
local unit c = LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
local real x
local real y
local unit u
local effect fx
//local effect fx2
set CASTER= c
set u = (ZEE(null,(GetUnitX(c)),(GetUnitY(c)),((7000.)*1.),(Condition(function Conditions))))
if u == null then
call Q_E(GetOwningPlayer(c),"No spheres found.")
else
set CASTER2 = u
set x = GetUnitX(u)
set y = GetUnitY(u)
set fx = AddSpecialEffect("war3mapImported\\Arcane Explosion.mdx",x,y)
//set fx2 = AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.0+(StarlightCharge[GetUnitUserData(u)]*.01))
//call BlzSetSpecialEffectScale(fx2,2.3)
call DestroyEffect(fx)
//call DestroyEffect(fx2)
call GroupEnumUnitsInRange(GROUP,x,y,324.*(1.0+(StarlightCharge[GetUnitUserData(u)]*.01)),Filter(function FilterActions))
set spherecount[GetUnitUserData(c)] = spherecount[GetUnitUserData(c)] - 1
call KillUnit(u)
set starsphere[GetUnitUserData(u)] = null
endif
set fx = null
//set fx2= null
set c = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FrostShardOnAttack initializer OnInit
globals
private constant integer SPELL_ID = 'A04O'
trigger FROSTSHARDHIT
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local unit c = CreateUnit(GetOwningPlayer(u),'h007',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitRemoveAbility(t,'B06H')
call UnitAddAbility(c,'A04O')
call SetUnitAbilityLevel(c,'A04O',GetUnitAbilityLevel(u,'A04O'))
call IssuePointOrderById(c,852060,GetUnitX(t),GetUnitY(t))
call UnitApplyTimedLife(c,'BTLF',1.)
set c = null
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and GetUnitAbilityLevel(GetTriggerUnit(),'B06H') ==1 then
call UnitRemoveAbility(GetTriggerUnit(),'B06H')
if GetRandomInt(0,99) <=14 and GetEventDamage() > 0 then
call Actions()
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set FROSTSHARDHIT=CreateTrigger()
call TriggerAddCondition(FROSTSHARDHIT,Condition(function Conditions))
call MOE(II,(FROSTSHARDHIT))
call DisableTrigger(FROSTSHARDHIT)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FireawallnAttack initializer OnInit
globals
private constant integer SPELL_ID = 'A042'
private constant string SFX_AOE = "war3mapImported\\EyeOfChaos.mdx"
private constant string SFX_LASER = "war3mapImported\\DarknessBomb.mdx"
private group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0
endglobals
native UnitAlive takes unit id returns boolean
private struct AF
unit u
real x
real y
real time
real dmg
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
if GetRandomInt(1,15) == 1 then
call DestroyEffect(AddSpecialEffect(SFX_LASER,GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit())))
endif
if GetFilterUnit() == CASTER then
if GetRandomInt(0,99) <= 19. then
call SetWidgetLife(CASTER,1)
else
call SetWidgetLife(CASTER,GetWidgetLife(CASTER)+DAMAGE)
endif
else
call UnitDamageTargetEx(CASTER,GetFilterUnit(),DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
endif
return false
endfunction
private function FilterGroup takes nothing returns boolean
return (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE))
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AF data = GetTimerData(t)
local integer count
// call BJDebugMsg("Time: " +R2S(data.time))
if data.time == 0. then
call data.destroy()
call ReleaseTimer(t)
// call BJDebugMsg("Destroyed")
else
set CASTER = data.u
call GroupEnumUnitsInRange(GROUP,data.x,data.y,275.,Filter(function FilterGroup))
set count = CountUnitsInGroup(GROUP)
//call BJDebugMsg(I2S(count))
if count != 0 then
set DAMAGE = data.dmg/count
else
set DAMAGE = data.dmg
endif
//call BJDebugMsg(R2S(DAMAGE))
call GroupEnumUnitsInRange(GROUP,data.x,data.y,275.,Filter(function FilterActions))
set data.time = data.time - .2
call SetTimerData(t,data)
call TimerStart(t,.2,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit d = GetTriggerUnit()
local AF data = AF.create()
local timer t = NewTimer()
set data.u = u
set data.x = GetUnitX(d) + GetRandomReal(-1000.,1000.) * (Cos(GetRandomReal(0.,360.)) * bj_DEGTORAD)
set data.y = GetUnitY(d) + GetRandomReal(-1000.,1000.) * (Sin(GetRandomReal(0.,360.)) * bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(SFX_AOE,data.x,data.y))
set data.time = 5.
set data.dmg = ((GetUnitAbilityLevel(data.u,SPELL_ID)*2.*GetHeroStr(data.u,true)))
call SetTimerData(t,data)
call TimerStart(t,.1,false,function Handler)
set t = null
set d = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and GetUnitAbilityLevel(GetTriggerUnit(),'B06H') ==1 then
if GetRandomInt(0,99) <=14 then
call Actions()
else
call UnitRemoveAbility(GetTriggerUnit(),'B06H')
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerAddCondition(t,Condition(function Conditions))
call MOE(II,(t))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DoubleStrike initializer OnInit
globals
trigger DOUBLESTRIKE
private constant integer SPELL_ID = 'A0MJ'
private constant integer SPELL_ID2 = 'A0MI'
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(u,SPELL_ID)==1 and u != GetTriggerUnit() and Damage_IsAttack() and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) then
if GetUnitAbilityLevel(u,SPELL_ID2)==1 then
call UnitRemoveAbility(u,SPELL_ID2)
if GetUnitAbilityLevel(u,'A0MH') == 1 then
call BlzSetUnitAttackCooldown(u,1.8,0)
else
call BlzSetUnitAttackCooldown(u,3.6,0)
endif
else
call UnitAddAbility(u,SPELL_ID2)
call UnitMakeAbilityPermanent(u,true,SPELL_ID2)
call BlzSetUnitAttackCooldown(u,.5,0)
endif
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set DOUBLESTRIKE = CreateTrigger()
call MOE(II, (DOUBLESTRIKE))
call TriggerAddCondition(DOUBLESTRIKE, Condition(function Actions))
call DisableTrigger(DOUBLESTRIKE)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope BleedingSpears initializer OnInit
globals
trigger WARGODBLEED
integer array BleedStacks
private constant integer SPELL_ID = 'A0MJ'
private constant integer SPELL_ID2 = 'A0MK'
endglobals
native UnitAlive takes unit id returns boolean
private struct FB
unit caster
unit u
effect fx
integer i
real dmg
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call DestroyEffect(this.fx)
set this.fx = null
call this.deallocate()
endmethod
endstruct
private struct FB2
unit caster
unit u
integer i
real a
real x
real y
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data = GetTimerData(t)
local unit u = null
local effect fx
if data.i == 16 then
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 11.71875 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 11.71875 * Sin(data.a * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.u,data.x)
call SetUnitY(data.u,data.y)
set fx = AddSpecialEffect("war3mapImported\\Cannonball.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect( fx )
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t, .03125, false, function Handler2)
else
set u = CreateUnit(GetOwningPlayer(data.caster),'h007',GetUnitX(u),GetUnitY(u),0.)
if IsUnitType(data.u,UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx( data.caster, data.u,.25* (GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*2.5)+(GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*.1*GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])), false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
else
call UnitDamageTargetEx( data.caster, data.u, (GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*2.5)+(GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*.1*GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])), false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
endif
set fx = AddSpecialEffectTarget( "war3mapImported\\BloodEX-Special-2.mdx", data.u, "chest" )
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect( fx )
call UnitAddAbility(u,'A0MF')
call IssueTargetOrderById(u,852095,data.u)
call UnitApplyTimedLife(u,'BTLF',1.)
if GetUnitAbilityLevel(data.u,'B05V') != 1 then
set Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] = Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] + 1
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] == 250 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Gatekeepers_Pact.mdx",LC[1+GetPlayerId(GetOwningPlayer(data.caster))],"origin"))
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],'A0MH')
call BlzSetUnitAttackCooldown(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],1.8,0)
endif
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] > 250 then
call SetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",LC[1+GetPlayerId(GetOwningPlayer(data.caster))],"origin"))
endif
endif
call ReleaseTimer(t)
call data.destroy()
endif
endif
set fx = null
set u = null
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB data = GetTimerData(t)
if BleedStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,SPELL_ID2)
call UnitRemoveAbility(data.u,'A0MQ')
call ReleaseTimer(t)
call data.destroy()
else
if data.i == 0 or not UnitAlive(data.u) or data.u == null then
set BleedStacks[GetUnitUserData(data.u)] = BleedStacks[GetUnitUserData(data.u)] -1
if BleedStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,SPELL_ID2)
call UnitRemoveAbility(data.u,'A0MQ')
endif
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
set data.i = data.i - 1
call DisableTrigger(WARGODBLEED)
call UnitDamageTargetEx(data.caster,data.u,data.dmg,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
call EnableTrigger(WARGODBLEED)
call SetTimerData(t,data)
call TimerStart(t, 1.0, false, function Handler)
endif
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local FB data = 0
local timer t
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local timer t2 = NewTimer()
local FB2 data2 = FB2.create()
if BleedStacks[GetUnitUserData(u)] == 10 then
call DisableTrigger(WARGODBLEED)
call UnitDamageTargetEx(GetEventDamageSource(),u,(BlzGetUnitMaxHP(u)-GetWidgetLife(u))*.1,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
call EnableTrigger(WARGODBLEED)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodySplat Missile.mdx",data.u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",data.u,"chest"))
else
set t = NewTimer()
set data = FB.create()
set data.u = GetTriggerUnit()
set data.fx = AddSpecialEffectTarget("war3mapImported\\Lascerate.mdx",data.u,"chest")
if BleedStacks[GetUnitUserData(data.u)] == 0 then
call UnitAddAbility(data.u,SPELL_ID2)
call UnitAddAbility(data.u,'A0MQ')
endif
set BleedStacks[GetUnitUserData(data.u)] = BleedStacks[GetUnitUserData(data.u)] + 1
set data.caster = GetEventDamageSource()
set data.dmg = (GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*2.5)+(GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],true)*.25*GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(data.caster))]))
set data.i = 10
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
endif
set data2.caster = GetEventDamageSource()
set data2.u = u
set data2.i = 0
set data2.x = GetUnitX(data2.u)
set data2.y = GetUnitY(data2.u)
set data2.a = bj_RADTODEG * Atan2(data2.y - GetUnitY(data2.caster), data2.x - GetUnitX(data2.caster))
call SetTimerData(t2,data2)
call TimerStart(t2,.03125,false,function Handler2)
set t2 = null
set t= null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(u,SPELL_ID) != 0 and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u,'BIil') != 1 and (BI[NI])==(LN) then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set WARGODBLEED=CreateTrigger()
call TriggerAddCondition(WARGODBLEED,Condition(function Conditions))
call MOE(II,(WARGODBLEED))
call DisableTrigger(WARGODBLEED)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope SkewerA initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
boolean array skewered
boolean array isimpaled
private unit CASTER
private real DAMAGE
private real DAMAGE2
private real ANGLE
private constant integer SPELL_ID = 'A0MG'
private constant integer SPELL_ID2 = 'A0MP'
private constant string EFFECT = "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl"
private constant string ATTACH_POINT = "chest"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
group g
effect fx1
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.c = null
set this.fx1 = null
call this.deallocate()
endmethod
endstruct
private function GroupActions3 takes nothing returns nothing
set skewered[GetUnitUserData(GetEnumUnit())]= false
set isimpaled[GetUnitUserData(GetEnumUnit())] = false
endfunction
private function GroupActions2 takes nothing returns nothing
local unit u = GetEnumUnit()
local unit d
if isimpaled[GetUnitUserData(u)] then
else
set d = CreateUnit(GetOwningPlayer(CASTER),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitDamageTargetEx( CASTER, u, DAMAGE2, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\BloodEX-Special-2.mdx", u, "chest" ) )
call UnitAddAbility(d,'A0MF')
call IssueTargetOrderById(d,852095,u)
call UnitApplyTimedLife(d,'BTLF',1.)
set skewered[GetUnitUserData(u)]= false
set Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] = Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] + 1
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] == 250 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Gatekeepers_Pact.mdx",LC[1+GetPlayerId(GetOwningPlayer(CASTER))],"origin"))
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],'A0MH')
call BlzSetUnitAttackCooldown(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],1.8,0)
endif
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] > 250 then
call SetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",LC[1+GetPlayerId(GetOwningPlayer(CASTER))],"origin"))
endif
endif
set d = null
set u = null
endfunction
private function GroupActions takes nothing returns nothing
local unit u = GetEnumUnit()
local real x
local real y
local unit d
if not isimpaled[GetUnitUserData(u)] then
set x = GetUnitX(u) + 31.25 * Cos(ANGLE * bj_DEGTORAD)
set y = GetUnitY(u) + 31.25 * Sin(ANGLE * bj_DEGTORAD)
if IsTerrainWalkable(x,y) then
call SetUnitX(u,x)
call SetUnitY(u,y)
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
else
set isimpaled[GetUnitUserData(u)] = true
set d = CreateUnit(GetOwningPlayer(CASTER),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitDamageTargetEx( CASTER, u, DAMAGE2, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\BloodEX-Special-2.mdx", u, "chest" ) )
call UnitAddAbility(d,'A0MF')
call IssueTargetOrderById(d,852095,u)
call UnitApplyTimedLife(d,'BTLF',1.)
set skewered[GetUnitUserData(u)] = false
set Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] = Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] + 1
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] == 250 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Gatekeepers_Pact.mdx",LC[1+GetPlayerId(GetOwningPlayer(CASTER))],"origin"))
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],'A0MH')
call BlzSetUnitAttackCooldown(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],1.8,0)
endif
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(CASTER))])] > 250 then
call SetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",LC[1+GetPlayerId(GetOwningPlayer(CASTER))],"origin"))
endif
endif
endif
set d = null
set u = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) and not skewered[GetUnitUserData(u)] then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
set skewered[GetUnitUserData(u)]= true
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 32 then
call DestroyEffect(data.fx1)
call ForGroup(data.g,function GroupActions3)
call ReleaseTimer(t)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call data.destroy()
else
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 180., Filter( function FilterActions ) )
set data.g = GROUP2
set data.x = data.x + 35.9375 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 35.9375 * Sin(data.a * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then // or GetUnitTypeId(data.c) == 'n03Y' then
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
set ANGLE = data.a
set CASTER = data.c
set DAMAGE2 = data.dmg
call ForGroup(data.g,function GroupActions)
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewDirtEXNofire.mdx",GetUnitX(data.c),GetUnitY(data.c)))
set DAMAGE2 = data.dmg
call ForGroup(data.g,function GroupActions2)
call ForGroup(data.g,function GroupActions3)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call DestroyEffect(data.fx1)
call ReleaseTimer(t)
call data.destroy()
endif
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
local real dx
local real dy
local integer id
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
call BlzPauseUnitEx(data.c,true)
set UnitIsCasting[GetUnitUserData(data.c)] = true
set id = GetPlayerId(GetOwningPlayer(data.c))
if data.c == LC[id+1] then
set dx = MouseX[id]
set dy = MouseY[id]
set data.a = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
call BlzSetUnitFacingEx(data.c,data.a)
else
set data.a= GetUnitFacing(data.c)
endif
set data.current = 0
set lvl = GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(data.c))],SPELL_ID)
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Valiant Charge.mdx",data.c,"origin")
call BlzSetSpecialEffectScale(data.fx1,1.3)
set data.dmg = (GetHeroAgi(LC[1+GetPlayerId(GetOwningPlayer(data.c))],true)*5.*lvl)+(GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(data.c))],true)*4.*lvl)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
call RegisterSpellEffectEvent(SPELL_ID2, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SearingAegis initializer OnInit
globals
trigger SEARINGSHIELD
private constant integer SPELL_ID = 'A0ML'
private constant integer SPELL_ID2 = 'A0MM'
private constant group GROUP = CreateGroup( )
private unit CASTER
private real DAMAGE
private real CASTX
private real CASTY
private real ANGLE
endglobals
private struct FB2
unit caster
unit u
integer i
real a
real x
real y
real dmg
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data = GetTimerData(t)
local unit u = null
local effect fx
if data.i == 24 then
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 15.625 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 15.625 * Sin(data.a * bj_DEGTORAD)
if IsTerrainWalkable(data.x,data.y) then
call SetUnitX(data.u,data.x)
call SetUnitY(data.u,data.y)
set fx = AddSpecialEffect("war3mapImported\\Cannonball.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect( fx )
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t,.03125, false, function Handler)
else
set u = CreateUnit(GetOwningPlayer(data.caster),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitDamageTargetEx( data.caster, data.u, data.dmg, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
set fx = AddSpecialEffectTarget( "war3mapImported\\BloodEX-Special-2.mdx", data.u, "chest" )
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect( fx )
call UnitAddAbility(u,'A0MF')
call IssueTargetOrderById(u,852095,data.u)
call UnitApplyTimedLife(u,'BTLF',1.)
set Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] = Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] + 1
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] == 250 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Gatekeepers_Pact.mdx",LC[1+GetPlayerId(GetOwningPlayer(data.caster))],"origin"))
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],'A0MH')
call BlzSetUnitAttackCooldown(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],1.8,0)
endif
if Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] > 250 then
call SetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(data.caster))],false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",LC[1+GetPlayerId(GetOwningPlayer(data.caster))],"origin"))
endif
call ReleaseTimer(t)
call data.destroy()
endif
endif
set fx = null
set u = null
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real a = bj_RADTODEG * Atan2(GetUnitY(u) - CASTY, GetUnitX(u) - CASTX)
local FB2 data
local timer t
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and UnitAlive(u) and a >=ANGLE-75 and a <= ANGLE+75 then
set data = FB2.create()
set t= NewTimer()
set data.caster = CASTER
set data.u = u
set data.i = 0
set data.x = GetUnitX(data.u)
set data.y = GetUnitY(data.u)
set data.a = a
set data.dmg = DAMAGE
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
call UnitDamageTargetEx( data.caster, data.u, data.dmg, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
endif
set t = null
set u = null
return false
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],SPELL_ID)
local real angle = bj_RADTODEG * Atan2(GetUnitY(a) - GetUnitY(u), GetUnitX(a) - GetUnitX(u))
local effect fx
local real x
local real y
local real face = GetUnitFacing(u)
if GetUnitAbilityLevel(u,SPELL_ID2) == 1 and angle >= face-75 and angle <= face+75 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if(BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
//set DI[NI]=DI[NI]+(GetEventDamage()*(1.-.25-(lvl*.05)))
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*(1.-.25-(lvl*.05))))
endif
else
//set DI[NI]=DI[NI]+(GetEventDamage()*(1.-.25-(lvl*.05)))
call BlzSetEventDamage(GetEventDamage()-(GetEventDamage()*(1.-.25-(lvl*.05))))
endif
if GetRandomInt(1,100) <= 15 + (5 * lvl) then
set CASTX = GetUnitX(u)
set CASTY = GetUnitY(u)
set x = CASTX + 100. * Cos(face * bj_DEGTORAD)
set y = CASTY + 100. * Sin(face * bj_DEGTORAD)
set fx = AddSpecialEffect("war3mapImported\\GodsRebuke.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.1)
call BlzSetSpecialEffectYaw(fx,face*(bj_PI/180.00))
call DestroyEffect(fx)
set CASTER = u
set DAMAGE = GetHeroStr(LC[1+GetPlayerId(GetOwningPlayer(u))],true) * lvl * 3.
set ANGLE = face
call GroupEnumUnitsInRange( GROUP, CASTX, CASTY, 300., Filter( function FilterActions ) )
endif
endif
set fx = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set SEARINGSHIELD= CreateTrigger()
call MOE(II, (SEARINGSHIELD))
call TriggerAddCondition(SEARINGSHIELD, Condition(function Actions))
call DisableTrigger(SEARINGSHIELD)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope MalVladisPantheon initializer OnInit
globals
private constant integer SPELL_ID = 'A0MO'
private constant integer UNIT_ID = 'n03Y'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real face = GetUnitFacing(u)
local real x = GetUnitX(u) + 300. * Cos((face-180) * bj_DEGTORAD)
local real y = GetUnitY(u) + 300. * Sin((face-180) * bj_DEGTORAD)
local integer i = 0
local real x2 = x + 600. * Cos((face-90) * bj_DEGTORAD)
local real y2 = y + 600. * Sin((face-90) * bj_DEGTORAD)
local unit s
local player p = GetOwningPlayer(u)
local integer hp = BlzGetUnitMaxHP(u)
local real armor = BlzGetUnitArmor(u)
local integer damage = (GetUnitAbilityLevel(u,SPELL_ID) * 2 * GetHeroAgi(u,true)) + (GetUnitAbilityLevel(u,SPELL_ID) * 2 * GetHeroStr(u,true))
loop
exitwhen i == 9
set s= CreateUnit(p,UNIT_ID,x2,y2,face)
call BlzSetUnitMaxHP(s,hp)
call SetWidgetLife(s,hp*1.)
call BlzSetUnitArmor(s,armor)
call BlzSetUnitBaseDamage(s,damage,0)
call UnitApplyTimedLife(s,'BTLF',15.)
call SetUnitPropWindow(s,0.)
call IssueImmediateOrderById(s,852520)
set x2 = x2 + 150. * Cos((face+90) * bj_DEGTORAD)
set y2 = y2 + 150. * Sin((face+90) * bj_DEGTORAD)
set i = i + 1
endloop
set p = null
set u = null
set s = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope MalVladisRevelry initializer OnInit
globals
private constant integer SPELL_ID = 'A0MN'
private constant integer SPELL_ID2 = 'A0MG'
private constant integer SPELL_ID3 = 'A0ML'
private constant integer SPELL_ID4 = 'A0MO'
integer array Revelry
trigger MREVEL
endglobals
private struct FB
unit caster
integer i
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB data = GetTimerData(t)
local effect fx
local real life
local real maxhp
local integer lvl
local real cooldown
local real armor
if data.i >= 5 then
set Revelry[GetUnitUserData(data.caster)] = Revelry[GetUnitUserData(data.caster)] -1
call ReleaseTimer(t)
call data.destroy()
else
set life = GetWidgetLife(data.caster)
set maxhp = BlzGetUnitMaxHP(data.caster)*1.
if life <= maxhp/2. then
if GetUnitAbilityLevel(data.caster, SPELL_ID2 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(data.caster, SPELL_ID2 )
if cooldown > 0 then
if cooldown - .75 <= 0 then
call BlzEndUnitAbilityCooldown(data.caster, SPELL_ID2 )
else
call BlzStartUnitAbilityCooldown(data.caster, SPELL_ID2 , cooldown - .75)
endif
endif
endif
if GetUnitAbilityLevel(data.caster, SPELL_ID3 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(data.caster, SPELL_ID3 )
if cooldown > 0 then
if cooldown - .75 <= 0 then
call BlzEndUnitAbilityCooldown(data.caster, SPELL_ID3 )
else
call BlzStartUnitAbilityCooldown(data.caster, SPELL_ID3 , cooldown - .75)
endif
endif
endif
if GetUnitAbilityLevel(data.caster, SPELL_ID4 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(data.caster, SPELL_ID4 )
if cooldown > 0 then
if cooldown - .75 <= 0 then
call BlzEndUnitAbilityCooldown(data.caster, SPELL_ID4 )
else
call BlzStartUnitAbilityCooldown(data.caster, SPELL_ID4 , cooldown - .75)
endif
endif
endif
endif
if life < maxhp and UnitAlive(data.caster) then
set lvl = GetUnitAbilityLevel(data.caster,SPELL_ID)
set armor = lvl*7.5*((maxhp-life)/maxhp)
call AddUnitBonusTimed(data.caster, BONUS_ARMOR, armor,1.)
set fx = AddSpecialEffectTarget("war3mapImported\\Heal Orange2.mdx",data.caster,"origin")
//call BlzSetSpecialEffectScale(fx,.9)
call DestroyEffect(fx)
call SetWidgetLife(data.caster,life+(maxhp-life)*(.05+.01*lvl))
endif
set data.i = data.i + 1
call SetTimerData(t,data)
call TimerStart(t,1.,false, function Handler)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local timer t
local FB data
if GetUnitAbilityLevel(u,SPELL_ID)>=1 and GetEventDamage() > 0 and a != u then
if J5V[(ROX((GetUnitTypeId(a))))] then
if ((BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL) then
if Revelry[GetUnitUserData(u)]<1 then
set t= NewTimer()
set data = FB.create()
set data.caster = u
set data.i = 0
set Revelry[GetUnitUserData(data.caster)] = Revelry[GetUnitUserData(data.caster)] +1
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
endif
endif
else
if Revelry[GetUnitUserData(u)]<1 then
set t= NewTimer()
set data = FB.create()
set data.caster = u
set data.i = 0
set Revelry[GetUnitUserData(data.caster)] = Revelry[GetUnitUserData(data.caster)] +1
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
endif
endif
endif
set t= null
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
set MREVEL = CreateTrigger()
call MOE(II, (MREVEL))
call TriggerAddCondition(MREVEL, Condition(function Actions))
call DisableTrigger(MREVEL)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Barbarism initializer OnInit
globals
integer array Barbarism
trigger BARBSTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01Z' or GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|c00DE0000M|r|c00D70000a|r|c00D10000l|r|c00CA0000'|r|c00C40000V|r|c00BD0000l|r|c00B70000a|r|c00B00000d|r|c00AA0000i|r|c00A30000s|r|c009D0000'|r|c00960000 |r|c00A00000B|r|c00AA0000a|r|c00B40000r|r|c00BE0000b|r|c00C80000a|r|c00BD0000r|r|c00B20000i|r|c00950000s|r|c00770000m|r|c005A0000:|r "+ I2S(Barbarism[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set BARBSTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( BARBSTACKS, Player(pid), "-Barbarism", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition(BARBSTACKS, Condition(function Conditions) )
call DisableTrigger(BARBSTACKS)
endfunction
endscope
//TESH.scrollpos=6
//TESH.alwaysfold=0
scope SearingAegisActive initializer OnInit
globals
private constant integer ABIL_ID = 'A0ML'
integer array SearingAegisStacks
endglobals
private struct EB
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local EB data= GetTimerData(t)
set SearingAegisStacks[GetUnitUserData(data.u)] = SearingAegisStacks[GetUnitUserData(data.u)] -1
if SearingAegisStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A0MM')
call AddUnitAnimationProperties(data.u,"defend",false)
endif
call ReleaseTimer(t)
call data.destroy()
set t=null
endfunction
private function OnSpell takes nothing returns nothing
local EB data
local timer t
local effect fx
set data=EB.create()
set data.u=GetTriggerUnit()
if SearingAegisStacks[GetUnitUserData(data.u)] == 0 then
call UnitAddAbility(data.u,'A0MM')
call AddUnitAnimationProperties(data.u,"defend",true)
endif
set SearingAegisStacks[GetUnitUserData(data.u)] = SearingAegisStacks[GetUnitUserData(data.u)] + 1
set fx = AddSpecialEffect("war3mapImported\\GodsRebuke.mdx",GetUnitX(data.u),GetUnitY(data.u))
//call BlzSetSpecialEffectScale(fx,1.1)
call BlzSetSpecialEffectYaw(fx,GetUnitFacing(data.u)*(bj_PI/180.00))
call DestroyEffect(fx)
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,15.,false,function Handler)
set fx = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope WSLeapy initializer OnInit
globals
private unit CASTER
private real DAMAGE
private real XX
private real YY
private constant group GROUP = CreateGroup()
endglobals
private struct Leapy
unit c
real d
real h
effect fx
effect fx2
method destroy takes nothing returns nothing
set this.c = null
call DestroyEffect(this.fx)
call DestroyEffect(this.fx2)
//call BJDebugMsg("destroyed")
set this.fx = null
set this.fx2 = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Leapy data = GetTimerData(t)
local unit u
if data.d >= .6 then
call SetUnitFlyHeight(data.c,0.,0.0)
set u = CreateUnit(GetOwningPlayer(data.c),'h007',GetUnitX(data.c),GetUnitY(data.c),0.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",GetUnitX(data.c),GetUnitY(data.c)))
call UnitAddAbility(u,'A03Y')
call SetUnitAbilityLevel(u,'A03Y',GetUnitAbilityLevel(data.c,'A0NH'))
call IssueImmediateOrderById(u,852164)
call UnitApplyTimedLife(u,'BTLF',1.)
//call BlzPauseUnitEx(data.c,false)
//set UnitIsCasting[GetUnitUserData(data.c)] = false
call data.destroy()
call ReleaseTimer(t)
else
if data.d < .48 then
set data.h = data.h + 12
call SetUnitFlyHeight(data.c,data.h,0.0)
else
set data.h = data.h - 48
call SetUnitFlyHeight(data.c,data.h,0.0)
endif
set data.d = data.d + .01
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Leapy data
local real d = 0
local real a = 0
local real cx = 0
local real cy = 0
local real tx =0
local real ty =0
local real dx =0
local real dy = 0
local real x = 0
local real y = 0
local real a2 = 0
//local player p
set t = NewTimer()
set data = Leapy.create()
set data.c = GetTriggerUnit()
call SetUnitAnimation(data.c,"attack two")
//call BlzPauseUnitEx(data.c,true)
//set UnitIsCasting[GetUnitUserData(data.c)] = true
set cx = GetUnitX(data.c)
set cy = GetUnitY(data.c)
set tx = GetSpellTargetX()
set ty = GetSpellTargetY()
call UnitAddAbility(data.c,'Amrf')
call UnitRemoveAbility(data.c,'Amrf')
set a = bj_RADTODEG * Atan2(ty - cy, tx - cx)
set dx = tx - cx
set dy = ty - cy
set d =(SquareRoot(dx * dx + dy * dy)) + 80.
call M6E(data.c,d,.6,a,"none.mdl",.0,true,false)
set data.fx = AddSpecialEffectTarget("war3mapImported\\LightningArrow1.mdx",data.c,"weapon")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\OrbOfLightning.mdx",data.c,"chest")
set data.d =.01
set data.h = 6
call SetUnitFlyHeight(data.c,data.h,0.0)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
//set p = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent('A0NH', function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EldritchCurse initializer OnInit
globals
private constant integer SPELL_ID = 'A0N4'
private constant integer SPELL_ID2 = 'A0N3'
trigger ELDRITCHT
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
if GetUnitAbilityLevel(a,SPELL_ID) == 1 and a != u and GetEventDamage()>= 1. and not IsUnitType(u,UNIT_TYPE_HERO) and ((BI[NI]==DAMAGE_TYPE_MAGIC) or(BI[NI]==DAMAGE_TYPE_LIGHTNING)) and GetEventDamage() > 0 then
if GetUnitAbilityLevel(u,SPELL_ID2) != 1 then
call UnitAddAbility(u,SPELL_ID2)
endif
call AddUnitBonus(u,BONUS_ARMOR,-1.*(1.+(GetHeroAgi(a,true)*.002)))
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,-1.*(.01+(GetHeroInt(a,true)*.00002)))
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set ELDRITCHT = CreateTrigger()
call MOE(II, (ELDRITCHT))
call TriggerAddCondition(ELDRITCHT, Condition(function Actions))
call DisableTrigger(ELDRITCHT)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DemonicLightning initializer OnInit
globals
private constant integer UNIT_ID = 'E020'
//private location LOC = Location(0,0)
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real angle
local group g
local unit FoG
local real x1
local real y1
local real x2
local real y2
local integer i= 0
local player p = GetOwningPlayer(a)
local real dmg
local effect fx
local real x3
local real y3
local real dist
local group g2
//local real z
if GetUnitTypeId(a) == UNIT_ID and Damage_IsAttack() and a != u and IsUnitEnemy(u,p) and GetEventDamage()>= 1. and (BI[NI]!=DAMAGE_TYPE_UNIVERSAL) then
set dmg = GetEventDamage()
set DI[NI]=DI[NI]+dmg
set x1 = GetUnitX(a)
set y1 = GetUnitY(a)
set angle = bj_RADTODEG * Atan2(GetUnitY(u) - y1, GetUnitX(u) - x1)-16.
if GetUnitAbilityLevel(a,'A0N9')==1 then
set dist = 1200.
else
set dist = 675.
endif
if GetUnitAbilityLevel(a,'A0N8')==1 then
set dist = dist + 150.
endif
set g2 = CreateGroup()
loop
exitwhen i > 4
set x3 = x1 + 40. * Cos(angle * bj_DEGTORAD)
set y3 = y1 + 40. * Sin(angle * bj_DEGTORAD)
set x2 = x1 + dist * Cos(angle * bj_DEGTORAD)
set y2 = y1 + dist * Sin(angle * bj_DEGTORAD)
//call MoveLocation(LOC,x1,y1)
//set z = GetLocationZ(LOC)
call TimedL.P2P(AddLightningEx("RENL",true,x3,y3,GetTerrainZ(x1,y1)+40.,x2,y2,GetTerrainZ(x2,y2)+30.),.75,1.,1.)
set fx = AddSpecialEffect("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",x2,y2)
call BlzSetSpecialEffectScale(fx,.65)
call BlzSetSpecialEffectZ(fx,GetTerrainZ(x2,y2)+30.)
call DestroyEffect(fx)
set g = CreateGroup()
call LineSegment.EnumUnits(g,x1,y1,x2,y2,45.)
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if IsUnitEnemy(FoG,p) and UnitAlive(FoG) then
if not IsUnitInGroup(FoG,g2) then
call UnitDamageTargetEx(a,FoG, dmg+(GetHeroAgi(a,true)*1.8)+(GetHeroInt(a,true)*0.8),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(a,FoG, (dmg+(GetHeroAgi(a,true)*1.8)+(GetHeroInt(a,true)*0.8))*.45,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
if not IsUnitInGroup(FoG,g2) then
call GroupAddUnit(g2,FoG)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"head"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
set FoG = null
set angle = angle + 8.
set i = i + 1
endloop
call GroupClear(g2)
call DestroyGroup(g2)
endif
set g2 = null
set FoG = null
set g = null
set p = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DemonicLightning initializer OnInit
globals
private constant integer UNIT_ID = 'E020'
private location LOC = Location(0,0)
trigger DEMONLIGHTNING
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real angle
local group g
local unit FoG
local real x1
local real y1
local real x2
local real y2
local integer i= 0
local player p = GetOwningPlayer(a)
local real dmg
local effect fx
local real x3
local real y3
local real dist
local group g2
if GetUnitTypeId(a) == UNIT_ID and Damage_IsAttack() and a != u and IsUnitEnemy(u,p) and (BI[NI]!=DAMAGE_TYPE_LIGHTNING) then
set dmg = GetEventDamage()
set DI[NI]=DI[NI]+dmg
set x1 = GetUnitX(a)
set y1 = GetUnitY(a)
set angle = bj_RADTODEG * Atan2(GetUnitY(u) - y1, GetUnitX(u) - x1)-16.
if GetUnitAbilityLevel(a,'A0N9')==1 then
set dist = 1200.
else
set dist = 675.
endif
if GetUnitAbilityLevel(a,'A0N8')==1 then
set dist = dist + 150.
endif
set g2 = CreateGroup()
loop
exitwhen i > 4
set x3 = x1 + 40. * Cos(angle * bj_DEGTORAD)
set y3 = y1 + 40. * Sin(angle * bj_DEGTORAD)
set x2 = x1 + dist * Cos(angle * bj_DEGTORAD)
set y2 = y1 + dist * Sin(angle * bj_DEGTORAD)
call MoveLocation(LOC,x1,y1)
call TimedL.P2P(AddLightningEx("RENL",true,x3,y3,GetLocationZ(LOC)+40.,x2,y2,30.),.75,1.,1.)
set fx = AddSpecialEffect("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",x2,y2)
call BlzSetSpecialEffectScale(fx,.65)
call BlzSetSpecialEffectZ(fx,30.)
call DestroyEffect(fx)
set g = CreateGroup()
call LineSegment.EnumUnits(g,x1,y1,x2,y2,45.)
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if IsUnitEnemy(FoG,p) and UnitAlive(FoG) then
if not IsUnitInGroup(FoG,g2) then
call UnitDamageTargetEx(a,FoG, dmg+(GetHeroAgi(a,true)*1.8)+(GetHeroInt(a,true)*1.0),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(a,FoG, (dmg+(GetHeroAgi(a,true)*1.8)+(GetHeroInt(a,true)*1.0))*.45,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
if not IsUnitInGroup(FoG,g2) then
call GroupAddUnit(g2,FoG)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Blood Leak.mdx",FoG,"head"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
set FoG = null
set angle = angle + 8.
set i = i + 1
endloop
call GroupClear(g2)
call DestroyGroup(g2)
endif
set g2 = null
set FoG = null
set g = null
set p = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set DEMONLIGHTNING = CreateTrigger()
call MOE(II, (DEMONLIGHTNING))
call TriggerAddCondition(DEMONLIGHTNING, Condition(function Actions))
call DisableTrigger(DEMONLIGHTNING)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope Felreaving initializer OnInit
globals
private constant integer SPELL_ID = 'A0N5'
private constant group GROUP = CreateGroup()
private unit CASTER
private real ANGLE
private integer LEVEL
private real CASTX
private real CASTY
private constant integer SPELL_ID2 = 'A0N3'
endglobals
private struct FT
unit c
integer i
boolean swing
effect fx
real a
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct FT2
unit c
real x
real y
real a
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct FT3
unit c
real d
integer id
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real a = bj_RADTODEG * Atan2(GetUnitY(u) - CASTY, GetUnitX(u) - CASTX)
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and UnitAlive(u) and a >=ANGLE-95 and a <= ANGLE+95 then
if GetUnitAbilityLevel(u,SPELL_ID2) != 1 then
call UnitAddAbility(u,SPELL_ID2)
endif
call AddUnitBonus(u,BONUS_ARMOR,-6.*(1.+(GetHeroAgi(CASTER,true)*.002)))
call AddUnitBonus(u,BONUS_MAGIC_RESISTANCE,-6.*(.01+(GetHeroInt(CASTER,true)*.00002)))
if IsUnitType(u,UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx( CASTER, u, (LEVEL*GetHeroInt(CASTER,true)*2.5)+(LEVEL*GetHeroAgi(CASTER,true)*.5)*.5, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_LIGHTNING, WEAPON_TYPE_WHOKNOWS )
else
call UnitDamageTargetEx( CASTER, u, (LEVEL*GetHeroInt(CASTER,true)*2.5)+(LEVEL*GetHeroAgi(CASTER,true)*.5), false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_LIGHTNING, WEAPON_TYPE_WHOKNOWS )
endif
call IssueTargetOrder(u,"attack",CASTER)
if GetRandomInt(0,2)==1 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Orange.mdx",u,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Green.mdx",u,"chest"))
endif
endif
set u = null
return false
endfunction
private function Handler3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT3 data = GetTimerData(t)
if data.d >=4.9584 or not UnitAlive(data.c) then
call ReleaseTimer(t)
call data.destroy()
else
set data.d = data.d + .03125
call BlzSetUnitFacingEx(data.c,bj_RADTODEG * Atan2(MouseY[data.id] - GetUnitY(data.c), MouseX[data.id] - GetUnitX(data.c)))
call SetTimerData(t,data)
call TimerStart(t,.03125,false, function Handler3)
endif
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT2 data = GetTimerData(t)
set CASTER = data.c
set ANGLE = data.a
//set ANGLE = GetUnitFacing(data.c)
set LEVEL = GetUnitAbilityLevel(data.c,SPELL_ID)
set CASTX = data.x
set CASTY = data.y
call GroupEnumUnitsInRange(GROUP,data.x,data.y,325.,Filter( function FilterActions ) )
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local timer t2
local FT2 data2
if data.i <= 0 or not UnitAlive(data.c) or data.c == null then
call SetUnitTimeScale(data.c,1.)
call data.destroy()
call ReleaseTimer(t)
else
if data.swing then
set data.swing = false
else
set data.swing = true
endif
if data.swing then
call SetUnitAnimation(data.c,"spell")
else
call SetUnitAnimation(data.c,"spell throw")
endif
set t2 = NewTimer()
set data2 = FT2.create()
set data2.c = data.c
set data2.x = GetUnitX(data.c)
set data2.y = GetUnitY(data.c)
//set data2.a = GetUnitFacing(data.c)
set data2.a = bj_RADTODEG * Atan2(MouseY[GetPlayerId(GetOwningPlayer(data.c))] - GetUnitY(data.c), MouseX[GetPlayerId(GetOwningPlayer(data.c))] - GetUnitX(data.c))
set data.i = data.i - 1
call SetTimerData(t,data)
if data.swing then
call TimerStart(t,0.3864,false, function Handler)
else
call TimerStart(t,.44,false, function Handler)
endif
call SetTimerData(t2,data2)
call TimerStart(t2,.2,false, function Handler2)
endif
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local FT data = FT.create()
local timer t2 = NewTimer()
local FT2 data2 = FT2.create()
local integer i = GetRandomInt(0,1)
local FT3 data3 = FT3.create()
local timer t3 = NewTimer()
set data.c = GetTriggerUnit()
set data.i = 11
//set data.a = bj_RADTODEG * Atan2(GetSpellTargetY() - GetUnitY(data.c), GetSpellTargetX() - GetUnitX(data.c))
set data.a = GetUnitFacing(data.c)
//call SetUnitFacing(data.c,data.a)
set data.fx = AddSpecialEffectTarget("war3mapImported\\Ember Sword FX 55.mdx",data.c,"weapon")
call BlzSetSpecialEffectScale(data.fx,1.25)
if i == 1 then
set data.swing = true
else
set data.swing = false
endif
set data2.c = data.c
set data2.x = GetUnitX(data.c)
set data2.y = GetUnitY(data.c)
set data2.a = data.a
call AddUnitBonusTimed(data.c, BONUS_ARMOR, 6666, 6.6)
call SetUnitTimeScale(data.c,2.5)
if data.swing then
call SetUnitAnimation(data.c,"spell")
else
call SetUnitAnimation(data.c,"spell throw")
endif
call SetTimerData(t,data)
if data.swing then
call TimerStart(t,0.3864,false, function Handler)
else
call TimerStart(t,0.44,false, function Handler)
endif
call SetTimerData(t2,data2)
call TimerStart(t2,.2,false, function Handler2)
set data3.c = data.c
set data3.d = 0.
set data3.id = GetPlayerId(GetOwningPlayer(data.c))
call SetTimerData(t3,data3)
call TimerStart(t3,.03125,false, function Handler3)
set t3=null
set t2 = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=99
//TESH.alwaysfold=0
scope EldCurse initializer OnInit
globals
private constant integer SPELL_ID = 'A0N1'
private constant integer BUFF_ID = 'B064'
integer array Diablerie
endglobals
private struct BB
unit caster
unit t
real x
real y
integer i
method destroy takes nothing returns nothing
set this.caster = null
set this.t = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local BB data = GetTimerData(t)
local real x = GetUnitX(data.t)
local real y = GetUnitY(data.t)
local real m = GetUnitState(data.t,UNIT_STATE_MANA)
local unit d
local integer i = 0
local real x2
local real y2
local real x3
local real y3
if data. i == 0 or not UnitAlive(data.t) or data.t == null or GetUnitAbilityLevel(data.t,BUFF_ID) != 1 then
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
if SquareRoot((x-data.x) * (x-data.x) + (y-data.y) * (y-data.y)) > 0. then
call SetUnitState(data.t,UNIT_STATE_MANA,m-(BlzGetUnitMaxMana(data.t)*.01))
call SetUnitState(data.caster,UNIT_STATE_MANA,GetUnitState(data.caster,UNIT_STATE_MANA)+(BlzGetUnitMaxMana(data.t)*.01))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Red.mdx",data.t,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Orange.mdx",data.caster,"chest"))
set m = GetUnitState(data.t,UNIT_STATE_MANA)
if m <= 0 then
set d = CreateUnit(GetOwningPlayer(data.caster),'h007',x,y,0.)
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosDone.mdl", data.t, "chest" ) )
call UnitAddAbility(d,'A0N7')
call IssueTargetOrderById(d,852095,data.t)
call UnitApplyTimedLife(d,'BTLF',1.)
if GetUnitAbilityLevel(data.caster,'A0N8') != 1 then
if GetHeroStr(data.caster,false) <= 20 then
call SetHeroStr(data.caster,1,true)
else
call SetHeroStr(data.caster,GetHeroStr(data.caster,false)-20,true)
endif
call SetHeroAgi(data.caster,GetHeroAgi(data.caster,false)+20,true)
call SetHeroInt(data.caster,GetHeroInt(data.caster,false)+20,true)
else
call SetHeroAgi(data.caster,GetHeroAgi(data.caster,false)+40,true)
call SetHeroInt(data.caster,GetHeroInt(data.caster,false)+40,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",data.caster,"origin"))
set Diablerie[GetUnitUserData(data.caster)] = Diablerie[GetUnitUserData(data.caster)] + 20
if Diablerie[GetUnitUserData(data.caster)] >= 222 and GetUnitAbilityLevel(data.caster,'A0N8') != 1 then
call UnitAddAbility(data.caster,'A0N8')
call BlzSetUnitAttackCooldown(data.caster,1.8,0)
set x2 = GetUnitX(data.caster)
set y2 = GetUnitY(data.caster)
loop
exitwhen i >=18
set x3 = x2 + GetRandomReal(-350.,350.)
set y3 = y2 + GetRandomReal(-350.,350.)
if GetRandomInt(0,1)==1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire.mdx",x3,y3))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Fel.mdx",x3,y3))
endif
set i = i + 1
endloop
endif
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
set data.x = x
set data.y = y
set data.i = data.i -1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
else
set data.x = x
set data.y = y
set data.i = data.i -1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
endif
set d = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local BB data = BB.create()
set data.caster = GetTriggerUnit()
set data.i = 160+(GetUnitAbilityLevel(data.caster,SPELL_ID)*16)
set data.t = GetSpellTargetUnit()
set data.x = GetUnitX(data.t)
set data.y = GetUnitY(data.t)
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=99
//TESH.alwaysfold=0
scope ChaosOverwhelming initializer OnInit
globals
private constant integer SPELL_ID = 'A0ND'
private constant integer BUFF_ID = 'A0N9'
integer array OriginalPlayerOwner
endglobals
private struct BB
unit caster
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local BB data = GetTimerData(t)
call UnitRemoveAbility(data.caster,BUFF_ID)
call SelectUnitAddForPlayer(data.caster,Player(OriginalPlayerOwner[GetUnitUserData(data.caster)]))
if GetUnitAbilityLevel(data.caster,'A0N8') == 1 then
call BlzSetUnitAttackCooldown(data.caster,1.8,0)
else
call BlzSetUnitAttackCooldown(data.caster,2.7,0)
endif
call SetUnitOwner(data.caster,Player(OriginalPlayerOwner[GetUnitUserData(data.caster)]),false)
call SetUnitAcquireRange(data.caster,800.)
if not UnitAlive(data.caster) then
call ReviveHero(data.caster,GetUnitX(data.caster),GetUnitY(data.caster),true)
endif
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = NewTimer()
local timer t2 = GetExpiredTimer()
local BB data = GetTimerData(t2)
local integer i = 0
local real x2
local real y2
local real x3
local real y3
call ReleaseTimer(t2)
call BlzSetUnitAttackCooldown(data.caster,.1,0)
call DestroyEffect(AddSpecialEffect("",GetUnitX(data.caster),GetUnitY(data.caster)))
call SetUnitAcquireRange(data.caster,2000.)
set OriginalPlayerOwner[GetUnitUserData(data.caster)] = GetPlayerId(GetOwningPlayer(data.caster))
call SetUnitOwner(data.caster,Player(PLAYER_NEUTRAL_AGGRESSIVE),false)
set x2 = GetUnitX(data.caster)
set y2 = GetUnitY(data.caster)
loop
exitwhen i >=18
set x3 = x2 + GetRandomReal(-350.,350.)
set y3 = y2 + GetRandomReal(-350.,350.)
if GetRandomInt(0,1)==1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire.mdx",x3,y3))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Fel.mdx",x3,y3))
endif
set i = i + 1
endloop
//call AddUnitBonusTimed(data.caster, BONUS_ARMOR, 666666, 16.)
call SetTimerData(t,data)
call TimerStart(t,10.,false,function Handler2)
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local BB data = BB.create()
set data.caster = GetTriggerUnit()
call UnitAddAbility(data.caster,BUFF_ID)
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
call SetPlayerAbilityAvailable(Player(PLAYER_NEUTRAL_AGGRESSIVE),'A0N1',false)
endfunction
endscope
scope ChaosBounty initializer OnInit
globals
trigger CHAOSBOUNTY
endglobals
private function OnSpell takes nothing returns boolean
local unit u = GetKillingUnit()
local unit t = GetTriggerUnit()
local integer i
local texttag tt
local string s = null
local integer i2 = 0
local real x2
local real y2
local real x3
local real y3
if GetUnitAbilityLevel(u,'A0N9') == 1 then
if GetOwningPlayer(t)==Player(10) or GetOwningPlayer(t)==Player(11) then
set i = BlzGetUnitIntegerField(t, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)
set tt = CreateTextTag()
if GetLocalPlayer()==Player(OriginalPlayerOwner[GetUnitUserData(u)]) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
call SetTextTagText(tt,s,0.023)
call SetTextTagPos(tt,GetUnitX(t),GetUnitY(t),10.)
call SetTextTagColor(tt,255,255,255,255)
call SetTextTagVelocity(tt,0.0355*Cos(90. * bj_DEGTORAD),0.0355*Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,1.5)
call SetTextTagLifespan(tt,2.)
call SetTextTagPermanent(tt,false)
call SetPlayerState(Player(OriginalPlayerOwner[GetUnitUserData(u)]),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(OriginalPlayerOwner[GetUnitUserData(u)]),PLAYER_STATE_RESOURCE_GOLD))+i)
call SetPlayerState(Player(PLAYER_NEUTRAL_AGGRESSIVE),PLAYER_STATE_RESOURCE_GOLD,0)
endif
if 1+OriginalPlayerOwner[GetUnitUserData(u)]<=10 then
if 1+OriginalPlayerOwner[GetUnitUserData(u)]<=5 then
set GT[1]=(GT[1]+1)
else
set GT[2]=(GT[2]+1)
endif
set FT[1+OriginalPlayerOwner[GetUnitUserData(u)]]=(FT[1+OriginalPlayerOwner[GetUnitUserData(u)]]+1)
call MultiboardSetItemValueBJ(AS[1],3,CT[1+OriginalPlayerOwner[GetUnitUserData(u)]],I2S(FT[1+OriginalPlayerOwner[GetUnitUserData(u)]]))
call MultiboardSetItemValueBJ(AS[2],3,CT[1+OriginalPlayerOwner[GetUnitUserData(u)]],I2S(FT[1+OriginalPlayerOwner[GetUnitUserData(u)]]))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=2
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],3,2,I2S(GT[1]))
call MultiboardSetItemValueBJ(AS[bj_forLoopAIndex],3,(CountPlayersInForceBJ(VS[1])+4),I2S(GT[2]))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
if GetUnitAbilityLevel(u,'A0N8') != 1 then
if GetHeroStr(u,false) <= 1 then
call SetHeroStr(u,1,true)
else
call SetHeroStr(u,GetHeroStr(u,false)-1,true)
endif
call SetHeroAgi(u,GetHeroAgi(u,false)+1,true)
call SetHeroInt(u,GetHeroInt(u,false)+1,true)
else
call SetHeroAgi(u,GetHeroAgi(u,false)+2,true)
call SetHeroInt(u,GetHeroInt(u,false)+2,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",u,"origin"))
set Diablerie[GetUnitUserData(u)] = Diablerie[GetUnitUserData(u)] + 1
if Diablerie[GetUnitUserData(u)] >= 222 and GetUnitAbilityLevel(u,'A0N8') != 1 then
call UnitAddAbility(u,'A0N8')
call BlzSetUnitAttackCooldown(u,1.8,0)
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
loop
exitwhen i2 >=18
set x3 = x2 + GetRandomReal(-350.,350.)
set y3 = y2 + GetRandomReal(-350.,350.)
if GetRandomInt(0,1)==1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire.mdx",x3,y3))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Fel.mdx",x3,y3))
endif
set i2 = i2 + 1
endloop
endif
if IsUnitType(t,UNIT_TYPE_HERO) and not IsUnitIllusion(t) then
if GetUnitAbilityLevel(u,'A0N8') != 1 then
if GetHeroStr(u,false) <= 9 then
call SetHeroStr(u,1,true)
else
call SetHeroStr(u,GetHeroStr(u,false)-9,true)
endif
call SetHeroAgi(u,GetHeroAgi(u,false)+9,true)
call SetHeroInt(u,GetHeroInt(u,false)+9,true)
else
call SetHeroAgi(u,GetHeroAgi(u,false)+18,true)
call SetHeroInt(u,GetHeroInt(u,false)+18,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",u,"origin"))
set Diablerie[GetUnitUserData(u)] = Diablerie[GetUnitUserData(u)] + 10
if Diablerie[GetUnitUserData(u)] >= 222 and GetUnitAbilityLevel(u,'A0N8') != 1 then
call UnitAddAbility(u,'A0N8')
call BlzSetUnitAttackCooldown(u,1.8,0)
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
loop
exitwhen i2 >=18
set x3 = x2 + GetRandomReal(-350.,350.)
set y3 = y2 + GetRandomReal(-350.,350.)
if GetRandomInt(0,1)==1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire.mdx",x3,y3))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Fel.mdx",x3,y3))
endif
set i2 = i2 + 1
endloop
endif
endif
endif
set tt = null
set s = null
set u = null
set t = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set CHAOSBOUNTY = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CHAOSBOUNTY, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(CHAOSBOUNTY, Condition(function OnSpell))
call DisableTrigger(CHAOSBOUNTY)
endfunction
endscope
scope MolochAI initializer OnInit
private function Conditions takes nothing returns boolean
local unit a = GetAttacker()
if GetUnitTypeId(a) == 'E020' and GetUnitAbilityLevel(a,'A0N9') == 1 then
call IssuePointOrderById(a,852218,GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
endif
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t, function Conditions)
set t = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Diablerie initializer OnInit
globals
trigger DIABLERIESTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E020' or GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|c0021C000M|r|c0032AB00o|r|c00439500l|r|c00548000o|r|c00656B00c|r|c00765500h|r|c00874000'|r|c00982B00s|r|c00A91500 |r|c00BA0000D|r|c00B40000i|r|c00AE0000a|r|c00A90000b|r|c00A30000l|r|c009D0000e|r|c00970000r|r|c00910000i|r|c008C0000e|r|c00860000:|r|c00800000 |r "+ I2S(Diablerie[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set DIABLERIESTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( DIABLERIESTACKS, Player(pid), "-Diablerie", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition(DIABLERIESTACKS, Condition(function Conditions) )
call DisableTrigger(DIABLERIESTACKS)
endfunction
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
scope InnerFocus initializer OnInit
globals
private constant integer SPELL_ID = 'A0PB'
private integer array StackCount
endglobals
private struct NBind
unit u
integer i
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local NBind data = GetTimerData(t)
set StackCount[GetUnitUserData(data.u)] = StackCount[GetUnitUserData(data.u)] - 1
call SetHeroAgi(data.u,GetHeroAgi(data.u,false)-data.i,true)
if StackCount[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A0PD')
call UnitRemoveAbility(data.u,'A0PC')
call UnitRemoveAbility(data.u,'B06L')
if GetUnitTypeId(data.u) == 'E01L' then
call BlzSetUnitAttackCooldown(data.u,1.9,0)
else
call BlzSetUnitAttackCooldown(data.u,2.8,0)
endif
endif
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u
local timer t = NewTimer()
local NBind data = NBind.create()
set data.u = GetTriggerUnit()
set data.i = R2I(.1 * GetHeroAgi(data.u,true))+ (10* GetUnitAbilityLevel(data.u,SPELL_ID))
call SetHeroAgi(data.u,GetHeroAgi(data.u,false)+data.i,true)
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",data.u,"origin"))
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",data.u,"origin"))
set StackCount[GetUnitUserData(data.u)] = StackCount[GetUnitUserData(data.u)] + 1
if StackCount[GetUnitUserData(data.u)] == 1 then
call UnitAddAbility(data.u,'A0PC')
call UnitAddAbility(data.u,'A0PD')
if GetUnitTypeId(data.u) == 'E01L' then
call BlzSetUnitAttackCooldown(data.u,.475,0)
else
call BlzSetUnitAttackCooldown(data.u,1.4,0)
endif
endif
call SetTimerData(t,data)
call TimerStart(t,10.+GetUnitAbilityLevel(data.u,SPELL_ID),false,function Handler)
set u = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope VacuumBurst initializer OnInit
/*-----------------------------------------------------------------------------------/
/- v1.0.2
/- JC Helas
/-----------------------------------------------------------------------------------*/
globals
/*- Determine the ability ID of Frost Bite -*/
private constant integer SPELL_ID = 'A0L2'
/*- Determine the dummy id of that stands as frost trap -*/
private constant integer DUM_ID = 'e001'
/*- Determine the base amount of frost trap -*/
private constant integer LINES = 9
/*- Determine the additional line per level -*/
private constant integer LINES_LVL= 0
/*- Determine the damage amount of back and forth -*/
private constant real DAMAGE = 50.0
/*- Determine the additional amount of damage -*/
private constant real DAMAGE_LVL = 5.0
/*- Determine the affect of area per line -*/
private constant real DAMAGE_AOE = 100.0
/*- Determine the distance travel of each line -*/
private constant real DISTANCE = 850.0
/*- Determine the speed of forth -*/
private constant real SPEED_FORTH = 20.0
/*- Determine the speed of back -*/
private constant real SPEED_BACK = 35.0
/*- Determine the summoning distance to target caster position -*/
private constant real SUMMON_DIST = 50.0
/*- Determine the speed of vacuum -*/
private constant real VACUUM_SPEED= 40.0
/*- Determine the flying height of vacuumed unit -*/
private constant real VACUUM_Z = 350.0
/*- Determine the attack type of Frost Bite -*/
private constant attacktype A_TYPE= ATTACK_TYPE_NORMAL
/*- Determine the damage type of Frost Bite -*/
private constant damagetype D_TYPE= DAMAGE_TYPE_MAGIC
/*- Determine the owner of dummies -*/
private constant player DUM_OWNER = Player(PLAYER_NEUTRAL_PASSIVE)
/*- Determine the model attachment to dummy -*/
private constant string ATTACH = "origin"
/*- Determine the model of dummy -*/
private constant string MODEL = "Abilities\\Spells\\Other\\Tornado\\TornadoElemental"
/*- Determine the nova fx -*/
private constant string TARGETFX = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
endglobals
private struct data
player owner
unit caster
unit dummy
real angle
real rate
real speed
real dmg
real dx
real dy
effect fx
boolean b
group g
method destroy takes nothing returns nothing
set this.caster = null
set this.dummy = null
set this.owner = null
call GroupClear(this.g)
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private struct vacuumdata
unit u
real d
real r
real z
real bz
real a
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
globals
private constant real periodic=0.031250
private constant group grp=CreateGroup()
private constant timer tmr=CreateTimer()
private integer ix=0
private integer array ic
private data link=0
private constant timer vtmr=CreateTimer()
private integer vix=0
private integer array vic
endglobals
private function onVacuumLoop takes nothing returns nothing
local integer i=1
local real x
local real y
local vacuumdata this
loop
exitwhen(i>vix)
set this=vic[i]
set this.r=this.r+VACUUM_SPEED
set x=GetUnitX(this.u)+VACUUM_SPEED*Cos(this.a*bj_DEGTORAD)
set y=GetUnitY(this.u)+VACUUM_SPEED*Sin(this.a*bj_DEGTORAD)
call SetUnitX(this.u,x)
call SetUnitY(this.u,y)
call SetUnitFlyHeight(this.u,this.bz+(Sin(((180.0/this.d)*this.r)*bj_DEGTORAD)*this.z),0.0)
if(this.r>=this.d) then
call SetUnitPathing(this.u,true)
call SetUnitFlyHeight(this.u,GetUnitDefaultFlyHeight(this.u),0)
set this.u=null
call this.destroy()
set vic[i]=vic[vix]
set vix= vix -1
set i=i -1
if(vix==0) then
call PauseTimer(vtmr)
endif
endif
set i =i+1
endloop
endfunction
private function onVacuum takes unit t,real x,real y returns nothing
local real dx
local real dy
local real xt=GetUnitX(t)
local real yt=GetUnitY(t)
local vacuumdata this=vacuumdata.create()
set vix= vix+1
set vic[vix]=this
set dx=x-xt
set dy=y-yt
set this.u=t
set this.r=0.0
set this.bz=GetUnitFlyHeight(t)
set this.d=SquareRoot(dx*dx+dy*dy)*0.75
set this.z=(VACUUM_Z/(DISTANCE*0.75))*this.d
set this.a=bj_RADTODEG*Atan2(y-yt,x-xt)
call UnitAddAbility(t,'Amrf')
call UnitRemoveAbility(t,'Amrf')
call SetUnitPathing(t,false)
call DestroyEffect(AddSpecialEffect(TARGETFX,xt,yt))
if(vix==1) then
call TimerStart(vtmr,periodic,true,function onVacuumLoop)
endif
endfunction
private function FilterActions takes nothing returns boolean
local real x
local real y
local unit t =GetFilterUnit()
if UnitAlive(t) and not IsUnitType(t,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(t,UNIT_TYPE_STRUCTURE) and not IsUnitAlly(t,link.owner) then
set x = GetUnitX(link.dummy)
set y = GetUnitY(link.dummy)
if not IsUnitInGroup(t,link.g) then
call UnitDamageTargetEx(link.caster,t,link.dmg,false,false,A_TYPE,D_TYPE,null)
call GroupAddUnit(link.g,t)
if not link.b then
call onVacuum(t,link.dx,link.dy)
else
call SetUnitX(t,x)
call SetUnitY(t,y)
if GetRandomInt(0,100)<=25 then
call DestroyEffect(AddSpecialEffect(TARGETFX,x,y))
endif
endif
endif
if IsUnitInGroup(t,link.g) and link.b then
call SetUnitX(t,x)
call SetUnitY(t, y)
if GetRandomInt(0,100)<=25 then
call DestroyEffect(AddSpecialEffect(TARGETFX,x,y))
endif
endif
endif
set t = null
return false
endfunction
function onLoop takes nothing returns nothing
local data this
local integer i=1
local real x
local real y
local unit t
loop
exitwhen i>ix
set this=ic[i]
set x=this.dx
set y=this.dy
if(this.rate<100.0) then
set this.rate=this.rate+this.speed
set x=x+(Sin(((180.0/100)*this.rate)*bj_DEGTORAD)*DISTANCE)*Cos(this.angle*bj_DEGTORAD)
set y=y+(Sin(((180.0/100)*this.rate)*bj_DEGTORAD)*DISTANCE)*Sin(this.angle*bj_DEGTORAD)
call SetUnitX(this.dummy,x)
call SetUnitY(this.dummy,y)
set link=this
call GroupEnumUnitsInRange(grp,x,y,DAMAGE_AOE,Filter(function FilterActions))
call GroupClear(grp)
if(this.rate>=50.0 and this.b) then
set this.b=false
set this.speed=(100.0/DISTANCE)*SPEED_BACK
call GroupClear(this.g)
endif
else
call GroupClear(this.g)
call DestroyEffect(this.fx)
call KillUnit(this.dummy)
set this.caster=null
set this.dummy=null
set this.owner=null
call this.destroy()
set ic[i]=ic[ix]
set ix= ix-1
set i= i -1
if(ix==0) then
call PauseTimer(tmr)
endif
endif
set i = i+1
endloop
endfunction
private function onCast takes nothing returns boolean
local unit u
local player p
local real x1
local real y1
local real x2
local real y2
local real a
local real d
local integer i
local integer lvl
local data this
set u=GetTriggerUnit()
set p=GetOwningPlayer(u)
set lvl=GetUnitAbilityLevel(u,SPELL_ID)
set i=LINES+(LINES_LVL*lvl)
set d=(60.*lvl*lvl)+(GetHeroInt(u,true)*lvl*3.*(1.+(.7*GetHeroLevel(u))))
set x1=GetUnitX(u)
set y1=GetUnitY(u)
set a=360.0/i
loop
exitwhen i <= 0
set x2=x1+SUMMON_DIST*Cos((a*i)*bj_DEGTORAD)
set y2=y1+SUMMON_DIST*Sin((a*i)*bj_DEGTORAD)
set this=data.create()
set ix = ix + 1
set ic[ix]=this
set this.b=true
set this.dx=x2
set this.dy=y2
set this.dmg=d
set this.rate=0.0
set this.speed=(100.0/DISTANCE)*SPEED_FORTH
set this.angle=a*i
set this.caster=u
set this.owner=p
set this.dummy=CreateUnit(DUM_OWNER,DUM_ID,x2,y2,a*i)
set this.fx=AddSpecialEffectTarget(MODEL,this.dummy,ATTACH)
if(this.g==null) then
set this.g=CreateGroup()
endif
if(ix==1) then
call TimerStart(tmr,periodic,true,function onLoop)
endif
set i = i-1
endloop
set u=null
set p = null
return false
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function onCast)
endfunction
endscope
scope WindShield initializer OnInit
globals
private constant integer SPELL_ID = 'A0DJ'
private real array WindDamage
endglobals
private struct EB
unit u
unit c
integer level
integer int
boolean b
method destroy takes nothing returns nothing
set this.u = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local EB data = GetTimerData(t)
if data.b then
call LinkBonusToBuff(data.c, BONUS_DAMAGE, WindDamage[GetUnitUserData(data.c)]*-1., 'B01Z')
//if IsUnitType(data.c,UNIT_TYPE_HERO) then
//call LinkBonusToBuff(data.c, BONUS_MOVEMENT_SPEED, -300., 'B01Z')
//endif
endif
if IsUnitType(data.c,UNIT_TYPE_HERO) then
set WindDamage[GetUnitUserData(data.c)] = (data.level*10.) + (data.level*data.int)
call LinkBonusToBuff(data.c, BONUS_DAMAGE, WindDamage[GetUnitUserData(data.c)], 'B01Z')
call LinkBonusToBuff(data.c, BONUS_MOVEMENT_SPEED, 300., 'B01Z')
else
if GetUnitAbilityLevel(data.c,'A0EG') != 0 then
set WindDamage[GetUnitUserData(data.c)] = (data.level*1.)
else
set WindDamage[GetUnitUserData(data.c)] = (data.level*10.)
endif
call LinkBonusToBuff(data.c, BONUS_DAMAGE,WindDamage[GetUnitUserData(data.c)] , 'B01Z')
endif
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function DP1 takes nothing returns nothing
local timer t = NewTimer()
local EB data = EB.create()
set data.u = GetTriggerUnit()
set data.c = GetSpellTargetUnit()
set data.level = GetUnitAbilityLevel(data.u,SPELL_ID)
set data.int = GetHeroInt(data.u,true)
if GetUnitAbilityLevel(data.c,'B01Z') != 0 then
set data.b = true
endif
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function DP1)
endfunction
endscope
scope Galeforce initializer OnInit
globals
private constant integer SPELL_ID = 'A0PQ'
private constant integer SLOW_AURA_ID = 'A0PT'
private constant integer BUFF_ID = 'B06M'
private constant real TICK_INTERVAL = 0.03125
private constant real RADIUS = 575.
private group DEFILE_GROUP
private integer DEFILE_DATA
integer array GaleStacks
endglobals
private struct Data
unit caster
player p
real x
real y
real level
real duration
real TimeElapsed = 0.
real lastReductionApplied = 0.
boolean damageReduced = false
group units
method destroy takes nothing returns nothing
set p = null
set this.caster = null
call GroupClear(this.units)
call DestroyGroup(this.units)
set this.units = null
call this.deallocate()
endmethod
endstruct
private struct Data2
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data2 data = GetTimerData(t)
set GaleStacks[GetUnitUserData(data.u)] = GaleStacks[GetUnitUserData(data.u)] - 1
if GaleStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,SLOW_AURA_ID)
call UnitRemoveAbility(data.u,BUFF_ID)
endif
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetEnumUnit()
local Data d = DEFILE_DATA
local real reduction
local real dx = GetUnitX(u) - d.x
local real dy = GetUnitY(u) - d.y
local real dist = SquareRoot(dx * dx + dy * dy)
local real x1
local real x2
local real y1
local real y2
local real a
local real nx
local real ny
local real damage
local timer t
local Data2 d2
if dist > RADIUS or not UnitAlive(u) then
set u = null
set t = null
return
else
if IsUnitEnemy(u,d.p) then
// Your force calculation code here...
set x1=d.x
set y1=d.y
set x2=GetUnitX(u)
set y2=GetUnitY(u)
set dx=x2-x1
set dy=y2-y1
set dist=SquareRoot(dx*dx+dy*dy)
set a=Atan2(y2-y1,x2-x1)*bj_RADTODEG
if dist <= 225. then
if dist<=15. then
set nx=x1+dist*Cos((a)*bj_DEGTORAD)
set ny=y1+dist*Sin((a)*bj_DEGTORAD)
else
if IsUnitType(u,UNIT_TYPE_HERO) then
set nx=x1+(dist-(6.))*Cos((a)*bj_DEGTORAD)
set ny=y1+(dist-(6.))*Sin((a)*bj_DEGTORAD)
else
set nx=x1+(dist-(10.))*Cos((a)*bj_DEGTORAD)
set ny=y1+(dist-(10.))*Sin((a)*bj_DEGTORAD)
endif
endif
else
if IsUnitType(u,UNIT_TYPE_HERO) then
set nx=x1+(dist-(3.))*Cos((a)*bj_DEGTORAD)
set ny=y1+(dist-(3.))*Sin((a)*bj_DEGTORAD)
else
set nx=x1+(dist-(5.))*Cos((a)*bj_DEGTORAD)
set ny=y1+(dist-(5.))*Sin((a)*bj_DEGTORAD)
endif
endif
//call SetUnitPathing(u,false)
call SetUnitX(u,nx)
call SetUnitY(u,ny)
//call SetUnitPathing(u,true)
endif
if not d.damageReduced then // check if a full second has passed
if IsUnitEnemy(u,d.p) then
if not IsUnitType(u,UNIT_TYPE_HERO) then
if dist <= 225. then
set damage = ((GetHeroInt(d.caster, true) *.45* d.level* (1. + (.7 * GetHeroLevel(d.caster)))) + (5.*d.level))*2.
else
set damage = (GetHeroInt(d.caster, true) *.45* d.level * (1. + (.7 * GetHeroLevel(d.caster)))) + (5.*d.level)
endif
//Damage
call UnitDamageTargetEx(d.caster,u,damage,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
else
if IsUnitAlly(u,d.p) and GetUnitTypeId(u) != 'oeye' then
if dist <= 225. then
if IsUnitType(u,UNIT_TYPE_HERO) then
set reduction = (GetHeroInt(d.caster, true) * d.level*.15) + (5.*d.level) + (BlzGetUnitBaseDamage(u,0)*.025*d.level)
call AddUnitBonusTimed(u,BONUS_ATTACK_SPEED,(.1+(d.level*.05))*2.,5.+d.level)
call AddUnitBonusTimed(u,BONUS_DAMAGE,reduction*2.,5.+d.level)
call AddUnitBonusTimed(u, BONUS_MOVEMENT_SPEED, 200., 5.+d.level)
else
if GetUnitAbilityLevel(u,'A0EG') ==0 then
set reduction = (2.5*d.level*.5) + (BlzGetUnitBaseDamage(u,0)*.025*d.level*.5)
else
set reduction = (BlzGetUnitBaseDamage(u,0)*.005*d.level)
endif
call AddUnitBonusTimed(u,BONUS_ATTACK_SPEED,(.05+(d.level*.025)),5.+d.level)
call AddUnitBonusTimed(u,BONUS_DAMAGE,reduction*2.,5.+d.level)
endif
else
if IsUnitType(u,UNIT_TYPE_HERO) then
set reduction = (GetHeroInt(d.caster, true) * d.level*.15) + (5.*d.level) + (BlzGetUnitBaseDamage(u,0)*.025*d.level)
call AddUnitBonusTimed(u,BONUS_ATTACK_SPEED,.1+(d.level*.05),5.+d.level)
call AddUnitBonusTimed(u,BONUS_DAMAGE,reduction,5.+d.level)
call AddUnitBonusTimed(u, BONUS_MOVEMENT_SPEED, 100., 5.+d.level)
else
if GetUnitAbilityLevel(u,'A0EG') ==0 then
set reduction = (1.25*d.level*.5) + (BlzGetUnitBaseDamage(u,0)*.0125*d.level*.5)
else
set reduction = (BlzGetUnitBaseDamage(u,0)*.005*d.level)*.5
endif
call AddUnitBonusTimed(u,BONUS_ATTACK_SPEED,(.05+(d.level*.025))*.5,5.+d.level)
call AddUnitBonusTimed(u,BONUS_DAMAGE,reduction,5.+d.level)
endif
endif
//buff placing
if GetUnitAbilityLevel(u,SLOW_AURA_ID) == 0 then
call UnitAddAbility(u,SLOW_AURA_ID)
endif
set GaleStacks[GetUnitUserData(u)] = GaleStacks[GetUnitUserData(u)] + 1
set t = NewTimer()
set d2 = Data2.create()
set d2.u = u
call SetTimerData(t,d2)
call TimerStart(t,5.+d.level,false,function Handler)
endif
endif
endif
endif
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetFilterUnit()
if UnitAlive(u) and u !=null and not BlzIsUnitInvulnerable(u) and GetUnitTypeId(u) != 'E00E' then
set u = null
return true
else
set u = null
return false
endif
endfunction
private function OnTick takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data d = GetTimerData(t)
local effect fx
//local unit u
set d.TimeElapsed = d.TimeElapsed + TICK_INTERVAL
if d.TimeElapsed > d.duration then
//loop
// set u = FirstOfGroup(d.units)
// exitwhen (u == null)
// call GroupRemoveUnit(d.units, u)
//actions
// endloop
call ReleaseTimer(t)
call d.destroy()
else
set DEFILE_GROUP= d.units
if R2I(d.TimeElapsed) != R2I(d.lastReductionApplied) then // check if a full second has passed
set d.lastReductionApplied = R2I(d.TimeElapsed)
set d.damageReduced = false
set fx = AddSpecialEffect("war3mapImported\\Wind Blast - Classic.mdx",d.x,d.y)
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
endif
if GetRandomInt(0,99) <= 20 then
set fx = AddSpecialEffect("war3mapImported\\WindCirclefaster.mdx",d.x,d.y)
call BlzSetSpecialEffectScale(fx,1.25)
call DestroyEffect(fx)
endif
call GroupEnumUnitsInRange(d.units, d.x, d.y, 825., Condition(function Conditions))
set DEFILE_DATA = d
call ForGroup(d.units, function Actions)
set d.damageReduced = true
call TimerStart(t, TICK_INTERVAL, true, function OnTick)
endif
set fx = null
//set u = null
set t = null
endfunction
private function OnCast takes nothing returns nothing
local unit s
local timer t = NewTimer()
local Data d = Data.create()
local effect fx
set d.caster = GetTriggerUnit()
set d.p = GetOwningPlayer(d.caster)
set d.x = GetSpellTargetX()
set d.y = GetSpellTargetY()
set d.level = GetUnitAbilityLevel(d.caster, SPELL_ID)
set d.duration = 5.
set d.units = CreateGroup()
set fx = AddSpecialEffect("war3mapImported\\Wind Blast - Classic.mdx",d.x,d.y)
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\WindCirclefaster.mdx",d.x,d.y)
call BlzSetSpecialEffectScale(fx,1.25)
call DestroyEffect(fx)
call SetTimerData(t, d)
call TimerStart(t, TICK_INTERVAL, true, function OnTick)
set fx = null
set s = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function OnCast)
endfunction
endscope
scope DeathsFavor initializer OnInit
globals
integer array DeathStacks
trigger DEATHSFAVOR
endglobals
private function OnSpell takes nothing returns boolean
local unit k = GetKillingUnit()
local unit h = LC[1+(GetPlayerId(GetOwningPlayer(k)))]
local unit d = GetDyingUnit()
local integer i
if GetUnitAbilityLevel(h,'A0AM') != 0 and GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(h) and k != null and GetUnitTypeId(GetTriggerUnit()) != 'n013' then
if DeathStacks[GetUnitUserData(h)]<2444 then
if GetUnitTypeId(d) != 'n03I' and GetUnitTypeId(d) != 'n03M' and GetUnitTypeId(d) !='e007' and GetUnitTypeId(d) !='e008' and GetUnitTypeId(d) !='e009' then
set DeathStacks[GetUnitUserData(h)]=DeathStacks[GetUnitUserData(h)] + 4
if DeathStacks[GetUnitUserData(h)] >= 2444 then
call UnitAddAbility(h,'A0MD')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Ghost Strike.mdx",h,"origin"))
endif
endif
else
set i = GetRandomInt(0,2)
if i == 0 then
call SetHeroInt(h,GetHeroInt(h,false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl",h,"origin"))
endif
if i == 1 then
call SetHeroStr(h,GetHeroStr(h,false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",h,"origin"))
endif
if i == 2 then
call SetHeroAgi(h,GetHeroAgi(h,false)+1,true)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",h,"origin"))
endif
endif
endif
set k = null
set h = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set DEATHSFAVOR = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DEATHSFAVOR, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(DEATHSFAVOR, Condition(function OnSpell))
call DisableTrigger(DEATHSFAVOR)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope DeathBolt initializer OnInit
globals
private constant integer ABIL_ID = 'A0K5'
endglobals
private struct LB
ProgressBar cast
effect hl
effect hr
unit u
unit t
real dmg
real time
boolean mob
method destroy takes nothing returns nothing
set this.u = null
call DestroyEffect(this.hl)
call DestroyEffect(this.hr)
set this.hl = null
set this.hr = null
set this.t = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local LB data = GetTimerData(t)
local real dmg
local integer lvl
local real dx = GetUnitX(data.t) - GetUnitX(data.u)
local real dy = GetUnitY(data.t) - GetUnitY(data.u)
//call BJDebugMsg("Hander begins handling")
//if GetUnitCurrentOrder(data.u) != 852600 then
if GetUnitCurrentOrder(data.u) != 852230 or SquareRoot(dx * dx + dy * dy) >= 700. then
//call BJDebugMsg("Is order Id correct?")
if data.time >= 1.92 then
//Actions
//static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
call TimedL.U2U(AddLightningEx("RENL",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
set lvl = GetUnitAbilityLevel(data.u,ABIL_ID)
set dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(GetHeroAgi(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(GetHeroStr(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(BlzGetUnitBaseDamage(data.u,0)*.2*lvl)
if data.mob then
if RANDOMWAVEON then
call UnitDamageTargetEx(data.u,data.t,(BlzGetUnitBaseDamage(data.u,0)*1.15)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
if TRUEENFOS then
call UnitDamageTargetEx(data.u,data.t,(500.)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(data.u,data.t,(500.)+(BlzGetUnitMaxHP(data.t)*.075),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
else
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
endif
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
set data.time = data.time + .02
call data.cast.setPercentage(R2I(data.time*50.), 1)
if data.time == 1.06 then
call SetUnitAnimation(data.u,"attack")
endif
if data.time >= 2. then
//Actions
set lvl = GetUnitAbilityLevel(data.u,ABIL_ID)
set dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(GetHeroAgi(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(GetHeroStr(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*2.*lvl)+(BlzGetUnitBaseDamage(data.u,0)*.2*lvl)
call TimedL.U2U(AddLightningEx("RENL",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
if data.mob then
if TRUEENFOS then
call UnitDamageTargetEx(data.u,data.t,(500.)+(BlzGetUnitMaxHP(data.t)*.15),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(data.u,data.t,(500.)+(BlzGetUnitMaxHP(data.t)*.075),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
else
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
endif
set t = null
endfunction
private function OnSpell takes nothing returns boolean
local timer t
local LB data
local real x
local real y
//call BJDebugMsg("Is event firing?")
if GetSpellAbilityId() == ABIL_ID then
//call BJDebugMsg("Spell begins casting")
set t = NewTimer()
set data = LB.create()
set data.u = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
if GetUnitTypeId(data.u) == 'n03B' then
set data.mob = true
set x= GetUnitX(data.t) + 225. * Cos(GetUnitFacing(data.u) * bj_DEGTORAD)
set y = GetUnitY(data.t) + 225. * Sin(GetUnitFacing(data.u)* bj_DEGTORAD)
call CreateUnit(GetOwningPlayer(data.u),'n044',x,y,GetUnitFacing(data.u)-180.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Doomsday.mdx",x,y))
else
set data.mob = false
endif
set data.hl = AddSpecialEffectTarget("war3mapImported\\ChaosHands.mdx",data.u,"hand, left")
set data.hr = AddSpecialEffectTarget("war3mapImported\\ChaosHands.mdx",data.u,"hand, right")
set data.time = 0
set data.cast = ProgressBar.create()
set data.cast.xOffset = -15
if data.mob then
set data.cast.zOffset = 400
else
set data.cast.zOffset = 175
endif
if data.mob then
set data.cast.size = 1.75
else
set data.cast.size = .8
endif
set data.cast.color = GetPlayerColor(GetOwningPlayer(data.u))
set data.cast.targetUnit = data.u
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( trig, Condition( function OnSpell ) )
set trig = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CombatMasteryEvasionSkeles initializer OnInit
globals
trigger SKELECM
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0A5')>=1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= GetUnitAbilityLevel(u,'A0A5') * 5 and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A026') == 0 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
//set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
set SKELECM = CreateTrigger()
call MOE(II, (SKELECM))
call TriggerAddCondition(SKELECM, Condition(function Actions))
call DisableTrigger(SKELECM)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EvasionMasterySkeleton initializer OnInit
globals
trigger SKELEEVASION
private integer array values
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local texttag tt
local string Q7E
if GetUnitAbilityLevel(u,'A0A1')>=1 and GetEventDamage() > 0 and a != u and GetRandomInt(0,100) <= values[GetUnitAbilityLevel(u,'A0A1')] and GetUnitTypeId(a) != 'h007' and GetUnitTypeId(a) != 'h00L' and GetUnitAbilityLevel(a,'A04K') != 1 and GetUnitAbilityLevel(a,'A0L1') != 1 and GetUnitAbilityLevel(a,'BEar') != 1 and GetUnitAbilityLevel(a,'A026') == 0 then
if (BI[NI]==LN) and J5V[(ROX((GetUnitTypeId(a))))] then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
// set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
else
if not J5V[(ROX((GetUnitTypeId(a))))] and Damage_IsAttack() and BlzGetEventIsAttack() then
if GetUnitAbilityLevel(a,'A0QT') != 0 and GetRandomInt(1,100)<=15 then
else
// set DI[NI] = DI[NI] + GetEventDamage()
call BlzSetEventDamage(0.)
set tt = CreateTextTag()
set Q7E = "miss"
call SetTextTagText(tt,Q7E,.024)
call SetTextTagPos(tt,GetUnitX(a),GetUnitY(a),.0)
call SetTextTagColor(tt,255,0,0,255)
call SetTextTagVelocity(tt,.0,.04)
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,2.)
call SetTextTagLifespan(tt,5.)
call SetTextTagPermanent(tt,false)
endif
endif
endif
endif
set u = null
set a = null
set Q7E=null
set tt=null
return false
endfunction
private function OnInit takes nothing returns nothing
set SKELEEVASION = CreateTrigger()
call MOE(II, (SKELEEVASION))
call TriggerAddCondition(SKELEEVASION, Condition(function Actions))
call DisableTrigger(SKELEEVASION)
set values[1] = 13
set values[2] = 16
set values[3] = 19
set values[4] = 22
set values[5] = 25
set values[6] = 28
set values[7] = 31
set values[8] = 34
set values[9] = 37
set values[10] = 40
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DeathStacks initializer OnInit
globals
trigger DEATHSTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'U00O' or GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|c00000000D|r|c00070007e|r|c000F000Fa|r|c00160016t|r|c001E001Eh|r|c00250025'|r|c002D002Ds|r|c00340034 |r|c002B002BF|r|c00230023a|r|c001A001Av|r|c00110011o|r|c00090009r|r|c00000000:|r "+"|c00730074" +I2S(DeathStacks[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set DEATHSTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( DEATHSTACKS, Player(pid), "-favour", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( DEATHSTACKS, Condition(function Conditions) )
call DisableTrigger(DEATHSTACKS)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope UnlivingAiToggle initializer OnInit
globals
boolean array UnlivingAI
trigger SKELETONAI
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'U00O' or GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
if UnlivingAI[GetPlayerId(GetTriggerPlayer())] == false then
set UnlivingAI[GetPlayerId(GetTriggerPlayer())] = true
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Skeleton AI enabled.")
else
set UnlivingAI[GetPlayerId(GetTriggerPlayer())] = false
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"Skeleton AI disabled.")
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set SKELETONAI = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( SKELETONAI, Player(pid), "-skeletonai", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( SKELETONAI, Condition(function Conditions) )
call DisableTrigger(SKELETONAI)
endfunction
endscope
scope UnlvingAI initializer OnInit
globals
trigger SKELETONAI2
endglobals
private function OnSpell takes nothing returns boolean
local unit u = GetAttacker()
if (GetUnitTypeId(u) == 'nskf' or GetUnitTypeId(u) == 'nskm' or GetUnitTypeId(u) == 'uskm' ) and UnlivingAI[GetPlayerId(GetOwningPlayer(u))] == true then
if not IsUnitSelected(u,GetOwningPlayer(u)) then
if GetUnitAbilityLevel(u,'A0AD') != 0 then
call IssuePointOrderById(u,852652,GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
endif
if GetUnitAbilityLevel(u,'A09Z') != 0 then
call IssueImmediateOrderById(u,852100)
endif
endif
endif
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set SKELETONAI2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(SKELETONAI2, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(SKELETONAI2, Condition(function OnSpell))
call DisableTrigger(SKELETONAI2)
endfunction
endscope
scope NexusDamageBonus initializer OnInit
globals
private constant integer SPELL_ID = 'A02J'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+(10+(GetHeroLevel(u)*(5/2))+(GetHeroInt(u,true)*(7/2))),0)
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope BardSelfGrace initializer OnInit
globals
private constant integer SPELL_ID = 'A03F'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit d = CreateUnit(GetOwningPlayer(u),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A03F')
call SetUnitAbilityLevel(d,'A03F',GetUnitAbilityLevel(u,'A03F'))
call IssueTargetOrderById(d,852149,u)
call UnitApplyTimedLife(d,'BTLF',1.)
set d = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope UnnervingSymphony initializer OnInit
globals
private constant integer SPELL_ID = 'A0BX'
private constant group GROUP = CreateGroup()
private integer array EffectCount
private unit CASTER
private real DURATION
endglobals
private struct US
unit c
integer r
integer g
integer b
integer a
method destroy takes nothing returns nothing
set EffectCount[GetUnitUserData(this.c)] = EffectCount[GetUnitUserData(this.c)] - 1
if EffectCount[GetUnitUserData(this.c)] == 0 then
call SetUnitVertexColor(this.c,this.r,this.g,this.b,this.a)
call UnitRemoveAbility(this.c,'A0GG')
endif
set this.c = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local US data = GetTimerData(t)
call ReleaseTimer(t)
call data.destroy()
set t= null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local US data
local timer t
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and UnitAlive(u) then
set data = US.create()
set data.c = u
set data.r = BlzGetUnitIntegerField(data.c, UNIT_IF_TINTING_COLOR_RED)
set data.g = BlzGetUnitIntegerField(data.c, UNIT_IF_TINTING_COLOR_GREEN)
set data.b = BlzGetUnitIntegerField(data.c, UNIT_IF_TINTING_COLOR_BLUE)
set data.a = BlzGetUnitIntegerField(data.c, UNIT_IF_TINTING_COLOR_ALPHA)
set EffectCount[GetUnitUserData(data.c)] = EffectCount[GetUnitUserData(data.c)] + 1
if EffectCount[GetUnitUserData(data.c)] == 1 then
call SetUnitVertexColor(data.c,65,130,65,160)
call UnitAddAbility(data.c,'A0GG')
endif
call AddUnitBonusTimed(data.c,BONUS_MAGIC_RESISTANCE,-.66,DURATION)
call AddUnitBonusTimed(data.c,BONUS_ATTACK_SPEED,-100.,DURATION)
call AddUnitBonusTimed(data.c,BONUS_DAMAGE,-999999999.,DURATION)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",data.c,"origin"))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,DURATION,false, function Handler)
endif
set t = null
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(u,SPELL_ID)
set CASTER = u
set DURATION = lvl + 20.
call GroupEnumUnitsInRange(GROUP,GetSpellTargetX(),GetSpellTargetY(), 145.+(55.*lvl) ,Filter( function FilterActions ) )
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope ManaTide initializer OnInit
globals
private constant integer SPELL_ID = 'A0QA'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0.
private real MANAGAIN
endglobals
native UnitAlive takes unit id returns boolean
private struct RoD
unit c
real x
real y
integer dur
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct RoD2
real x
real y
effect fx
unit c
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local integer id
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\RefreshingSurge.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Blue.mdx",u,"chest"))
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and IsUnitType(u,UNIT_TYPE_HERO) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\RefreshingSurge.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Blue.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",u,"origin"))
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+MANAGAIN)
call SetHeroInt(u,GetHeroInt(u,false)+1,true)
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD2 data2 = GetTimerData(t)
set CASTER = data2.c
set DAMAGE = GetUnitAbilityLevel(data2.c,SPELL_ID)*(GetHeroAgi(data2.c,true))*2.5
set MANAGAIN = GetHeroAgi(data2.c,true) + 15.
call GroupEnumUnitsInRange(GROUP,data2.x,data2.y,250.,Filter(function FilterActions))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Smash.mdx",data2.x,data2.y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Tidal Burst - Classic.mdx",data2.x,data2.y))
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD data = GetTimerData(t)
local timer t2
local RoD2 data2
local effect fx
if data.dur <=0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - 1
set data2=RoD2.create()
set data2.c = data.c
set data2.x = data.x+GetRandomReal(-400.,400.)
set data2.y = data.y+GetRandomReal(-400.,400.)
set data2.fx = AddSpecialEffect("war3mapImported\\Spell Marker TC.mdx",data2.x,data2.y)
call BlzSetSpecialEffectColorByPlayer(data2.fx, Player(2))
call BlzSetSpecialEffectScale(data2.fx, 1.5)
set t2= NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,1.,false,function Handler2)
//set fx = AddSpecialEffect("war3mapImported\\Kingdom Come.mdx",data2.x,data2.y)
//call BlzSetSpecialEffectScale(fx,1.5)
//call DestroyEffect(fx)
call TimerStart(t,.5,false,function Handler)
endif
set fx = null
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local RoD data = RoD.create()
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.dur = 5 + GetUnitAbilityLevel(data.c,SPELL_ID)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope FlameTurbine initializer OnInit
globals
private constant integer SPELL_ID = 'A0JU'
private group GROUP = CreateGroup()
private unit CASTER
private location LOC = Location(0.,0.)
boolean array HasRecentlyBeenHit
endglobals
private struct FT
integer i
real a
real x
real y
real d
unit c
method destroy takes nothing returns nothing
set this.c= null
call this.deallocate()
endmethod
endstruct
private struct FT2
effect fx
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
call this.deallocate()
endmethod
endstruct
private struct FT3
unit u
method destroy takes nothing returns nothing
set this.u= null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT2 data = GetTimerData(t)
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Handler3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT3 data = GetTimerData(t)
set HasRecentlyBeenHit[GetUnitUserData(data.u)] =false
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit t = GetFilterUnit()
local real d = GetUnitAbilityLevel(CASTER,SPELL_ID) * GetHeroInt(CASTER,true)*2*(1.+(.05*GetHeroLevel(CASTER)))
local timer t2
local FT3 data
if (UnitAlive(t) and IsUnitEnemy(t,GetOwningPlayer(CASTER)) and t != CASTER) and not IsUnitType(t,UNIT_TYPE_MAGIC_IMMUNE) and HasRecentlyBeenHit[GetUnitUserData(t)]==false then
call UnitDamageTargetEx(CASTER,t,d,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Airstrike Rocket.mdx",t,"chest"))
set HasRecentlyBeenHit[GetUnitUserData(t)] = true
set t2 = NewTimer()
set data = FT3.create()
set data.u = t
call SetTimerData(t2,data)
call TimerStart(t2,.021,false,function Handler3)
endif
set t2 = null
set t = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local timer t2
local FT2 data2
if data.i == 0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.i = data.i - 1
set data2 = FT2.create()
set data.x = GetUnitX(data.c) + data.d * Cos(data.a * bj_DEGTORAD)
set data.y = GetUnitY(data.c) + data.d * Sin(data.a * bj_DEGTORAD)
set data2.fx = AddSpecialEffect("war3mapImported\\Fireball Medium.mdx",data.x,data.y)
call MoveLocation(LOC,GetUnitX(data.c),GetUnitY(data.c))
call BlzSetSpecialEffectHeight(data2.fx,GetLocationZ(LOC)+90.)
set CASTER = data.c
call GroupEnumUnitsInRange(GROUP,data.x,data.y,120.,Filter(function FilterActions))
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,.3,false,function Handler2)
set data.a = data.a + 24.
set data.d = data.d + 12.
call SetTimerData(t,data)
call TimerStart(t,.015,false,function Handler)
endif
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local FT data = FT.create()
set data.c = GetTriggerUnit()
set data.i = 60
set data.a = 270.
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.d = 60.
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope EverlastingFlame initializer OnInit
globals
private constant integer SPELL_ID = 'A0K3'
private constant integer UNIT_ID = 'h01T'
private group GROUP = CreateGroup()
private unit CASTER
boolean array IsChannelingEverlasting
endglobals
private struct FT
effect fx1
effect fx2
effect fx3
effect fx4
effect fx5
effect fx6
real x1
real x2
real x3
real x4
real x5
real x6
real y1
real y2
real y3
real y4
real y5
real y6
real tx
real ty
boolean b
effect attach
effect attach2
unit u
unit u2
integer i
integer i2
method destroy takes nothing returns nothing
call DestroyEffect(this.fx1)
set this.fx1 = null
call DestroyEffect(this.fx2)
set this.fx2 = null
call DestroyEffect(this.fx3)
set this.fx3 = null
call DestroyEffect(this.fx4)
set this.fx4 = null
call DestroyEffect(this.fx5)
set this.fx5 = null
call DestroyEffect(this.fx6)
set this.fx6 = null
set IsChannelingEverlasting[GetUnitUserData(this.u)] = false
set this.u = null
if this.u2 != null then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",GetUnitX(this.u2),GetUnitY(this.u2)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike I.mdx",GetUnitX(this.u2),GetUnitY(this.u2)))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",GetUnitX(this.u2),GetUnitY(this.u2)))
call ShowUnit(this.u2, false)
call PauseUnit(this.u2,true)
call UnitApplyTimedLife(this.u2,'BTLF',2.)
endif
set this.attach2 = null
set this.u2 = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if (UnitAlive(u) and IsUnitEnemy(u,GetOwningPlayer(CASTER)) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE)) then
call UnitDamageTargetEx(CASTER,u,GetUnitAbilityLevel(CASTER,SPELL_ID)*GetHeroInt(CASTER,true)*44.44,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FORCE,WEAPON_TYPE_WHOKNOWS)
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local real rand
local real sx
local real sy
local real ax
local real ay
local real cx
local real cy
local real a
local boolean new = false
if data.i2 <= 0 then
call SetUnitX(data.u,data.tx)
call SetUnitY(data.u,data.ty)
call ShowUnit(data.u, true)
call SetUnitAnimationByIndex(data.u,6)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",data.tx,data.ty))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike I.mdx",data.tx,data.ty))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",data.tx,data.ty))
call AddUnitBonusTimed(data.u,BONUS_HEALTH,1000000.+(GetUnitAbilityLevel(data.u,SPELL_ID)*1000.*GetHeroInt(data.u,true)),2.5)
call SelectUnitAddForPlayer(data.u,GetOwningPlayer(data.u))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x1,data.y1))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x2,data.y2))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x3,data.y3))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x4,data.y4))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x5,data.y5))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x6,data.y6))
set CASTER = data.u
call GroupEnumUnitsInRange(GROUP,data.x1,data.y1,270.,Filter(function FilterActions))
call GroupEnumUnitsInRange(GROUP,data.x2,data.y2,270.,Filter(function FilterActions))
call GroupEnumUnitsInRange(GROUP,data.x3,data.y3,270.,Filter(function FilterActions))
call GroupEnumUnitsInRange(GROUP,data.x4,data.y4,270.,Filter(function FilterActions))
call GroupEnumUnitsInRange(GROUP,data.x5,data.y5,270.,Filter(function FilterActions))
call GroupEnumUnitsInRange(GROUP,data.x6,data.y6,270.,Filter(function FilterActions))
call DestroyEffect(data.attach2)
call data.destroy()
call ReleaseTimer(t)
else
set data.i2 = data.i2 -1
set cx = GetUnitX(data.u2)
set cy = GetUnitY(data.u2)
loop
exitwhen new == true
set rand = GetRandomInt(1,6)
if rand == 1 then
set sx = data.x1
set sy = data.y1
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
if rand == 2 then
set sx = data.x2
set sy = data.y2
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
if rand == 3 then
set sx = data.x3
set sy = data.y3
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
if rand == 4 then
set sx = data.x4
set sy = data.y4
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
if rand == 5 then
set sx = data.x5
set sy = data.y5
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
if rand == 6 then
set sx = data.x6
set sy = data.y6
if cx == sx and cy == sy then
set new = false
else
set new = true
endif
endif
endloop
call IssueImmediateOrderById(data.u2,851972)
call SetUnitAnimationByIndex(data.u2,6)
call SetUnitX(data.u2,sx)
call SetUnitY(data.u2,sy)
call SetUnitX(data.u,sx)
call SetUnitY(data.u,sy)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",sx,sy))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike I.mdx",sx,sy))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",sx,sy))
set a = GetRandomReal(0.,360.)
set ax = data.tx + (GetRandomReal(-380.,380.) * Cos(a * bj_DEGTORAD))
set ay = data.ty + (GetRandomReal(-380.,380.) * Sin(a * bj_DEGTORAD))
call IssuePointOrderById(data.u2,851984,ax,ay)
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler2)
endif
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local integer rand
local real x
local real y
local real sx
local real sy
local real ax
local real ay
local real a
if data.i <= 0 or (GetUnitCurrentOrder(data.u) != 852591 and not data.b) or not UnitAlive(data.u) then
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x1,data.y1))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x2,data.y2))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x3,data.y3))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x4,data.y4))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x5,data.y5))
call DestroyEffect(AddSpecialEffect("war3mapImported\\ExplosionBIG.mdx",data.x6,data.y6))
call DestroyEffect(data.attach)
set data.attach = null
call data.destroy()
call ReleaseTimer(t)
else
if data.i == 1 then
set x = GetUnitX(data.u)
set y = GetUnitY(data.u)
call ShowUnit(data.u, false)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike I.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",x,y))
set rand = GetRandomInt(1,6)
call DestroyEffect(data.attach)
set data.attach = null
if rand == 1 then
set sx = data.x1
set sy = data.y1
endif
if rand == 2 then
set sx = data.x2
set sy = data.y2
endif
if rand == 3 then
set sx = data.x3
set sy = data.y3
endif
if rand == 4 then
set sx = data.x4
set sy = data.y4
endif
if rand == 5 then
set sx = data.x5
set sy = data.y5
endif
if rand == 6 then
set sx = data.x6
set sy = data.y6
endif
set data.i2 = 19
call BlzPlaySpecialEffect(data.fx1,ANIM_TYPE_SPELL)
call BlzPlaySpecialEffect(data.fx2,ANIM_TYPE_SPELL)
call BlzPlaySpecialEffect(data.fx3,ANIM_TYPE_SPELL)
call BlzPlaySpecialEffect(data.fx4,ANIM_TYPE_SPELL)
call BlzPlaySpecialEffect(data.fx5,ANIM_TYPE_SPELL)
call BlzPlaySpecialEffect(data.fx6,ANIM_TYPE_SPELL)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x1,data.y1))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x2,data.y2))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x3,data.y3))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x4,data.y4))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x5,data.y5))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",data.x6,data.y6))
set data.u2 = CreateUnit(GetOwningPlayer(data.u),UNIT_ID,sx,sy,bj_RADTODEG * Atan2(data.ty - sy, data.tx - sx))
call SetUnitX(data.u,sx)
call SetUnitY(data.u,sy)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",sx,sy))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike I.mdx",sx,sy))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",sx,sy))
set data.attach2 = AddSpecialEffectTarget("war3mapImported\\Custom SFX3.mdx",data.u2,"origin")
call AddUnitBonusTimed(data.u2,BONUS_ATTACK_SPEED,400.,11.)
set a = GetRandomReal(0.,360.)
set ax = data.tx + (GetRandomReal(-380.,380.) * Cos(a) * bj_DEGTORAD)
set ay = data.ty + (GetRandomReal(-380.,380.) * Sin(a) * bj_DEGTORAD)
call IssuePointOrderById(data.u2,851984,ax,ay)
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler2)
else
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local FT data
local real a = 0.
if IsChannelingEverlasting[GetUnitUserData(GetTriggerUnit())] == false then
set data = FT.create()
set t = NewTimer()
set data.u = GetTriggerUnit()
set data.attach = AddSpecialEffectTarget("war3mapImported\\Custom SFX3.mdx",data.u,"origin")
set data.i = 250
if GetUnitAbilityLevel(data.u,'A0ME') != 0 then
set data.b = true
endif
set data.tx = GetSpellTargetX()
set data.ty = GetSpellTargetY()
set data.x1 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y1 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set a = a + 60.
set data.x2 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y2 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set a = a + 60.
set data.x3 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y3 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set a = a + 60.
set data.x4 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y4 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set a = a + 60.
set data.x5 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y5 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set a = a + 60.
set data.x6 = data.tx + 400. * Cos(a * bj_DEGTORAD)
set data.y6 = data.ty + 400. * Sin(a * bj_DEGTORAD)
set data.fx1 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x1,data.y1)
set data.fx2 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x2,data.y2)
set data.fx3 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x3,data.y3)
set data.fx4 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x4,data.y4)
set data.fx5 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x5,data.y5)
set data.fx6 = AddSpecialEffect("war3mapImported\\Ember Forge_opt2edit.mdx",data.x6,data.y6)
call BlzPlaySpecialEffectWithTimeScale(data.fx1,ANIM_TYPE_BIRTH,4.)
call BlzPlaySpecialEffectWithTimeScale(data.fx2,ANIM_TYPE_BIRTH,4.)
call BlzPlaySpecialEffectWithTimeScale(data.fx3,ANIM_TYPE_BIRTH,4.)
call BlzPlaySpecialEffectWithTimeScale(data.fx4,ANIM_TYPE_BIRTH,4.)
call BlzPlaySpecialEffectWithTimeScale(data.fx5,ANIM_TYPE_BIRTH,4.)
call BlzPlaySpecialEffectWithTimeScale(data.fx6,ANIM_TYPE_BIRTH,4.)
set IsChannelingEverlasting[GetUnitUserData(data.u)] = true
call SetTimerData(t,data)
call TimerStart(t,.02,false, function Handler)
endif
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope MarkofBaal initializer OnInit
globals
private constant integer SPELL_ID = 'A0JX'
unit array firerune
private location LOC = Location(0.,0.)
integer array runecount
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitUserData(u)
local player p = GetOwningPlayer(u)
local effect fx
if runecount[i] <= 0 then
set firerune[i+runecount[i]] = CreateUnit(p,'n01P',GetSpellTargetX(),GetSpellTargetY(),0.)
call MoveLocation(LOC,GetSpellTargetX(),GetSpellTargetY())
set fx = AddSpecialEffect("war3mapImported\\Firaga.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectHeight(fx,GetLocationZ(LOC)+80.)
call BlzSetSpecialEffectScale(fx,2.8)
call DestroyEffect(fx)
set runecount[i] = runecount[i] + 1
else
if runecount[i] >9 then
//call IssueImmediateOrderById(u,851972)
call Q_E(p,"Maximum runes spawned.")
set fx = null
set p = null
set u = null
return
endif
set firerune[i+runecount[i]] = CreateUnit(p,'n01P',GetSpellTargetX(),GetSpellTargetY(),0.)
call MoveLocation(LOC,GetSpellTargetX(),GetSpellTargetY())
set fx = AddSpecialEffect("war3mapImported\\Firaga.mdx",GetSpellTargetX(),GetSpellTargetY())
call BlzSetSpecialEffectHeight(fx,GetLocationZ(LOC)+80.)
call BlzSetSpecialEffectScale(fx,2.8)
call DestroyEffect(fx)
set runecount[i] = runecount[i] + 1
endif
set fx = null
set p = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope FlameRuneManual initializer OnInit
globals
private constant integer SPELL_ID = 'A0K0'
private constant integer SPELL_ID2 = 'A0JX'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
call UnitDamageTargetEx(CASTER,GetFilterUnit(),GetUnitAbilityLevel(CASTER,SPELL_ID2)*GetHeroInt(CASTER,true)*5.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebolt Minor.mdx",GetFilterUnit(),"chest"))
endif
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit c = LC[1+GetPlayerId(GetOwningPlayer(u))]
local effect fx
local effect fx2
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firaga.mdx",c,"origin"))
call SetUnitX(c,x)
call SetUnitY(c,y)
call SetUnitAnimationByIndex(c,6)
call SelectUnitAddForPlayer(c,GetOwningPlayer(c))
set fx = AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",x,y)
set fx2 = AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.4)
call BlzSetSpecialEffectScale(fx2,2.3)
call DestroyEffect(fx)
call DestroyEffect(fx2)
set CASTER= c
call GroupEnumUnitsInRange(GROUP,x,y,375.,Filter(function FilterActions))
call AddUnitBonusTimed(c,BONUS_ATTACK_SPEED,.4 +(GetUnitAbilityLevel(c,SPELL_ID2)*.1),10.)
call AddUnitBonusTimed(c,BONUS_HEALTH,10000.+(GetUnitAbilityLevel(c,SPELL_ID2)*5.*GetHeroInt(c,true)),3.5)
set runecount[GetUnitUserData(c)] = runecount[GetUnitUserData(c)] - 1
call KillUnit(u)
set firerune[GetUnitUserData(u)] = null
set fx2 = null
set fx = null
set c = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope FlameRuneAuto initializer OnInit
globals
private constant integer SPELL_ID = 'A0K1'
private constant integer SPELL_ID2 = 'A0JX'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
call UnitDamageTargetEx(CASTER,GetFilterUnit(),GetUnitAbilityLevel(CASTER,SPELL_ID2)*GetHeroInt(CASTER,true)*5.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebolt Minor.mdx",GetFilterUnit(),"chest"))
endif
return false
endfunction
private function Conditions takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit()) == 'n01P' and GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit())
endfunction
private function Actions takes nothing returns nothing
local unit c = LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
local real x
local real y
local unit u
local effect fx
local effect fx2
set CASTER= c
set u = (ZEE(null,(GetUnitX(c)),(GetUnitY(c)),((7000.)*1.),(Condition(function Conditions))))
if u == null then
call Q_E(GetOwningPlayer(c),"No runes found.")
else
set x = GetUnitX(u)
set y = GetUnitY(u)
set fx = AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",x,y)
set fx2 = AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.4)
call BlzSetSpecialEffectScale(fx2,2.3)
call DestroyEffect(fx)
call DestroyEffect(fx2)
call SetUnitX(c,x)
call SetUnitY(c,y)
call SetUnitAnimation(c,"spell")
call GroupEnumUnitsInRange(GROUP,x,y,375.,Filter(function FilterActions))
call AddUnitBonusTimed(c,BONUS_ATTACK_SPEED,.4 + (GetUnitAbilityLevel(c,SPELL_ID2)*.1),10.)
call AddUnitBonusTimed(c,BONUS_HEALTH,10000.+(GetUnitAbilityLevel(c,SPELL_ID2)*5.*GetHeroInt(c,true)),3.5)
set runecount[GetUnitUserData(c)] = runecount[GetUnitUserData(c)] - 1
call KillUnit(u)
set firerune[GetUnitUserData(u)] = null
endif
set fx = null
set fx2= null
set c = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope MarkofBaalLearn initializer OnInit
globals
private constant integer SPELL_ID = 'A0JX'
private constant integer SPELL_ID2 = 'A0K1'
trigger LEARNBMARK
endglobals
private function Conditions takes nothing returns boolean
if GetLearnedSkill()==SPELL_ID then
if GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID2) != 1 then
call UnitAddAbility(GetTriggerUnit(),SPELL_ID2)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set LEARNBMARK = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(LEARNBMARK,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(LEARNBMARK,Condition(function Conditions))
call DisableTrigger(LEARNBMARK)
endfunction
endscope
//TESH.scrollpos=14
//TESH.alwaysfold=0
scope MoltenWaveCast initializer OnInit
globals
private constant integer SPELL_ID = 'A0JV'
private constant integer SPELL_ID2 = 'A0JW'
endglobals
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit u = CreateUnit(GetOwningPlayer(c),'h01S',GetUnitX(c),GetUnitY(c),GetUnitFacing(c))
call UnitAddAbility(u,SPELL_ID2)
call SetUnitAbilityLevel(u,SPELL_ID2,GetUnitAbilityLevel(c,SPELL_ID))
call IssuePointOrderById(u,852580,GetSpellTargetX(),GetSpellTargetY())
set c = null
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope MoltenWaveActions initializer OnInit
globals
trigger MOLTENWAVE
private constant integer SPELL_ID = 'A0JV'
endglobals
native UnitAlive takes unit id returns boolean
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit c
local unit t = GetTriggerUnit()
local integer lvl
if IsUnitEnemy(u,GetOwningPlayer(t)) and (GetUnitTypeId(u)) == 'h01S' then
set c = LC[1+GetPlayerId(GetOwningPlayer(u))]
set lvl = GetUnitAbilityLevel(c,SPELL_ID)
call DisableTrigger(MOLTENWAVE)
call UnitDamageTargetEx(c,t,lvl*GetHeroInt(c,true)*3.75,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(MOLTENWAVE)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Lava_Burn.mdl",t,"chest"))
call SetWidgetLife(c,GetWidgetLife(c)+(BlzGetUnitMaxHP(c)*.0888))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firaga.mdx",c,"origin"))
call AddUnitBonusTimed(c,BONUS_ATTACK_SPEED,.15+(lvl*.02),5.)
endif
set t= null
set c = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set MOLTENWAVE=CreateTrigger()
call TriggerAddCondition(MOLTENWAVE,Condition(function Conditions))
call MOE(II,(MOLTENWAVE))
call DisableTrigger(MOLTENWAVE)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ALLSHALLBURN initializer OnInit
globals
trigger FIRELORDBURN
integer array FirelordBurnStacks
private timer globalTimer
private unit array burningUnits
private unit array burnCasters
private integer array burnDurations
private integer numBurningUnits = 0
integer array Fervor
boolean array HasExploded
private group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
endglobals
native UnitAlive takes unit id returns boolean
private struct FB
unit caster
unit u
integer i
real dmg
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct FB2
unit u
effect fx
effect fx2
effect fx3
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
call DestroyEffect(this.fx2)
set this.fx2 = null
call DestroyEffect(this.fx3)
set this.fx3 = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data2 = GetTimerData(t)
set HasExploded[GetUnitUserData(data2.u)] = false
call ReleaseTimer(GetExpiredTimer())
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local integer i = 0
local integer j = 0
local unit u
local integer uIndex
local unit caster
local integer array unitsToRemove
local integer numUnitsToRemove = 0
loop
exitwhen i >= numBurningUnits
set u = burningUnits[i]
if u != null then // Check if unit is removed
set uIndex = GetUnitUserData(u)
set caster = burnCasters[uIndex]
if UnitAlive(u) then
// Apply burn damage based on stacks...
call DisableTrigger(FIRELORDBURN)
call UnitDamageTargetEx(caster,u,(GetHeroInt(caster,true)*.2*(1.+(.05*GetHeroLevel(caster))))*FirelordBurnStacks[uIndex],false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call EnableTrigger(FIRELORDBURN)
set burnDurations[uIndex] = burnDurations[uIndex] - 1
if burnDurations[uIndex] <= 0 then
set FirelordBurnStacks[uIndex] = FirelordBurnStacks[uIndex] - 1
if FirelordBurnStacks[uIndex] > 0 then
else
// End burn effect...
call UnitRemoveAbility(u,'A0JP')
call UnitRemoveAbility(u,'A0JO')
call UnitRemoveAbility(u,'A0JT')
set FirelordBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
endif
else
// Unit is dead, remove from burningUnits list...
call UnitRemoveAbility(u,'A0JP')
call UnitRemoveAbility(u,'A0JO')
call UnitRemoveAbility(u,'A0JT')
set FirelordBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
else
// Unit is removed, mark it for removal from burningUnits list...
set unitsToRemove[numUnitsToRemove] = i
set numUnitsToRemove = numUnitsToRemove + 1
endif
set i = i + 1
endloop
// Remove marked units from burningUnits list...
set i = numUnitsToRemove - 1
loop
exitwhen i < 0
set j = unitsToRemove[i]
set burningUnits[j] = burningUnits[numBurningUnits - 1]
set numBurningUnits = numBurningUnits - 1
if numBurningUnits <= 0 then
// Pause the timer if there are no burning units
call PauseTimer(globalTimer)
endif
set i = i - 1
endloop
set caster = null
set u = null
endfunction
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
call UnitDamageTargetEx(CASTER,GetFilterUnit(),DAMAGE,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
return false
endfunction
private function Actions takes nothing returns nothing
local timer t
local FB data
local FB2 data2
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real x2
local real y2
local real x3
local real y3
local integer i = 0
local integer explodingUnitIndex = -1
if FirelordBurnStacks[GetUnitUserData(u)] == 5 then
set t= NewTimer()
set data2 = FB2.create()
set data2.u=GetTriggerUnit()
set data2.fx = AddSpecialEffectTarget("war3mapImported\\Burning Rage Orange.mdx",data2.u,"overhead")
set data2.fx2 = AddSpecialEffectTarget("war3mapImported\\fireball.mdx",data2.u,"overhead")
set data2.fx3 = AddSpecialEffectTarget("war3mapImported\\fireball.mdx",data2.u,"chest")
set HasExploded[GetUnitUserData(data2.u)] = true
set FirelordBurnStacks[GetUnitUserData(data2.u)] = 0
call UnitRemoveAbility(data2.u,'A0JP')
call UnitRemoveAbility(data2.u,'A0JO')
call UnitRemoveAbility(data2.u,'A0JT')
set burnDurations[GetUnitUserData(data2.u)] = 0
loop
exitwhen i >= numBurningUnits
if burningUnits[i] == data2.u then
set explodingUnitIndex = i
exitwhen true
endif
set i = i + 1
endloop
// If the exploding unit was found in the array, replace it with the last unit in the list
if explodingUnitIndex != -1 then
set burningUnits[explodingUnitIndex] = burningUnits[numBurningUnits - 1]
set burningUnits[numBurningUnits - 1] = null
set numBurningUnits = numBurningUnits - 1
endif
if numBurningUnits == 0 then
call PauseTimer(globalTimer)
endif
set CASTER = LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))]
set Fervor[GetUnitUserData(CASTER)] = Fervor[GetUnitUserData(CASTER)] + 1
if Fervor[GetUnitUserData(CASTER)] == 355 then
call BlzSetUnitAttackCooldown(CASTER,.9,0)
call UnitAddAbility(CASTER,'A0ME')
set x2 = GetUnitX(CASTER)
set y2 = GetUnitY(CASTER)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",x2,y2))
loop
exitwhen i >=12
set x3 = x2 + GetRandomReal(-250.,250.)
set y3 = y2 + GetRandomReal(-250.,250.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Vol. II.mdx",x3,y3))
set i = i + 1
endloop
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\OrbOfFire.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Fireball Major.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firebolt Medium.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewAirEX.mdx",x,y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\CorpseExplodeFire.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",x,y))
if GetUnitAbilityLevel(CASTER,'A0ME') == 1 then
call SetHeroInt(CASTER,GetHeroInt(CASTER,false)+2,true)
else
call SetHeroInt(CASTER,GetHeroInt(CASTER,false)+1,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",CASTER,"origin"))
set DAMAGE = BlzGetUnitMaxHP(data2.u)*.05+((3*GetHeroInt(CASTER,true)*(1.+(.05*GetHeroLevel(CASTER)))))
call GroupEnumUnitsInRange(GROUP,x,y,300.,Filter(function FilterActions))
call SetTimerData(t,data2)
if GetUnitAbilityLevel(CASTER,'A0ME') == 1 then
call TimerStart(t,2.,false, function Handler2)
else
call TimerStart(t,3.,false, function Handler2)
endif
else
if FirelordBurnStacks[GetUnitUserData(u)] == 0 then
call UnitAddAbility(u,'A0JP')
call UnitAddAbility(u,'A0JO')
call UnitAddAbility(u,'A0JT')
set burningUnits[numBurningUnits] = u
if numBurningUnits == 0 then
call TimerStart(globalTimer, 1.0, true, function Handler)
endif
set numBurningUnits = numBurningUnits + 1
endif
set FirelordBurnStacks[GetUnitUserData(u)] = FirelordBurnStacks[GetUnitUserData(u)] + 1
set burnCasters[GetUnitUserData(u)] = LC[1+GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
set burnDurations[GetUnitUserData(u)] = 10
endif
set t= null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if (GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A0JL') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u,'BIil') != 1 and HasExploded[GetUnitUserData(GetTriggerUnit())] == false and ((BI[NI])==(LN) or (BI[NI])==(DAMAGE_TYPE_UNIVERSAL) or (BI[NI])==(DAMAGE_TYPE_LIGHTNING) or (GetUnitTypeId(u) == 'h01Q' and BI[NI] == DAMAGE_TYPE_COLD and GetEventDamage() > 0 ) or (GetUnitTypeId(u) == 'h01T' and BI[NI] == DAMAGE_TYPE_COLD and GetEventDamage() > 0 and GetRandomInt(0,100) <= 20))) then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set globalTimer = NewTimer()
set FIRELORDBURN=CreateTrigger()
call TriggerAddCondition(FIRELORDBURN,Condition(function Conditions))
call MOE(II,(FIRELORDBURN))
call DisableTrigger(FIRELORDBURN)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ALLSHALLBURN initializer OnInit
globals
trigger FIRELORDBURN
integer array FirelordBurnStacks
private timer globalTimer
private unit array burningUnits
private unit array burnCasters
private integer array burnDurations
private integer numBurningUnits = 0
integer array Fervor
boolean array HasExploded
private group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
endglobals
native UnitAlive takes unit id returns boolean
private struct FB
unit caster
unit u
integer i
real dmg
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct FB2
unit u
effect fx
effect fx2
effect fx3
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
call DestroyEffect(this.fx2)
set this.fx2 = null
call DestroyEffect(this.fx3)
set this.fx3 = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FB2 data2 = GetTimerData(t)
set HasExploded[GetUnitUserData(data2.u)] = false
call ReleaseTimer(GetExpiredTimer())
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local integer i = 0
local integer j = 0
local unit u
local integer uIndex
local unit caster
local integer array unitsToRemove
local integer numUnitsToRemove = 0
loop
exitwhen i >= numBurningUnits
set u = burningUnits[i]
if u != null then // Check if unit is removed
set uIndex = GetUnitUserData(u)
set caster = burnCasters[uIndex]
if UnitAlive(u) then
// Apply burn damage based on stacks...
call DisableTrigger(FIRELORDBURN)
call UnitDamageTargetEx(caster,u,(GetHeroInt(caster,true)*.2*(1.+(.05*GetHeroLevel(caster))))*FirelordBurnStacks[uIndex],false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call EnableTrigger(FIRELORDBURN)
set burnDurations[uIndex] = burnDurations[uIndex] - 1
if burnDurations[uIndex] <= 0 then
set FirelordBurnStacks[uIndex] = FirelordBurnStacks[uIndex] - 1
if FirelordBurnStacks[uIndex] > 0 then
else
// End burn effect...
call UnitRemoveAbility(u,'A0JP')
call UnitRemoveAbility(u,'A0JO')
call UnitRemoveAbility(u,'A0JT')
set FirelordBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
endif
else
// Unit is dead, remove from burningUnits list...
call UnitRemoveAbility(u,'A0JP')
call UnitRemoveAbility(u,'A0JO')
call UnitRemoveAbility(u,'A0JT')
set FirelordBurnStacks[uIndex] = 0 // Reset burn stacks
set burnDurations[uIndex] = 0 // Reset burn duration
set unitsToRemove[numUnitsToRemove] = i // Mark unit for removal
set numUnitsToRemove = numUnitsToRemove + 1
endif
else
// Unit is removed, mark it for removal from burningUnits list...
set unitsToRemove[numUnitsToRemove] = i
set numUnitsToRemove = numUnitsToRemove + 1
endif
set i = i + 1
endloop
// Remove marked units from burningUnits list...
set i = numUnitsToRemove - 1
loop
exitwhen i < 0
set j = unitsToRemove[i]
set burningUnits[j] = burningUnits[numBurningUnits - 1]
set numBurningUnits = numBurningUnits - 1
if numBurningUnits <= 0 then
// Pause the timer if there are no burning units
call PauseTimer(globalTimer)
endif
set i = i - 1
endloop
set caster = null
set u = null
endfunction
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) then
call DisableTrigger(FIRELORDBURN)
call UnitDamageTargetEx(CASTER,GetFilterUnit(),DAMAGE,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(FIRELORDBURN)
endif
return false
endfunction
private function Actions takes nothing returns nothing
local timer t
local FB data
local FB2 data2
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real x2
local real y2
local real x3
local real y3
local integer i = 0
local integer explodingUnitIndex = -1
if FirelordBurnStacks[GetUnitUserData(u)] == 5 then
set t= NewTimer()
set data2 = FB2.create()
set data2.u=GetTriggerUnit()
set data2.fx = AddSpecialEffectTarget("war3mapImported\\Burning Rage Orange.mdx",data2.u,"overhead")
set data2.fx2 = AddSpecialEffectTarget("war3mapImported\\fireball.mdx",data2.u,"overhead")
set data2.fx3 = AddSpecialEffectTarget("war3mapImported\\fireball.mdx",data2.u,"chest")
set HasExploded[GetUnitUserData(data2.u)] = true
set FirelordBurnStacks[GetUnitUserData(data2.u)] = 0
call UnitRemoveAbility(data2.u,'A0JP')
call UnitRemoveAbility(data2.u,'A0JO')
call UnitRemoveAbility(data2.u,'A0JT')
set burnDurations[GetUnitUserData(data2.u)] = 0
loop
exitwhen i >= numBurningUnits
if burningUnits[i] == data2.u then
set explodingUnitIndex = i
exitwhen true
endif
set i = i + 1
endloop
// If the exploding unit was found in the array, replace it with the last unit in the list
if explodingUnitIndex != -1 then
set burningUnits[explodingUnitIndex] = burningUnits[numBurningUnits - 1]
set burningUnits[numBurningUnits - 1] = null
set numBurningUnits = numBurningUnits - 1
endif
if numBurningUnits == 0 then
call PauseTimer(globalTimer)
endif
set CASTER = LC[(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))]
set Fervor[GetUnitUserData(CASTER)] = Fervor[GetUnitUserData(CASTER)] + 1
if Fervor[GetUnitUserData(CASTER)] == 355 then
call BlzSetUnitAttackCooldown(CASTER,.9,0)
call UnitAddAbility(CASTER,'A0ME')
set x2 = GetUnitX(CASTER)
set y2 = GetUnitY(CASTER)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Flamestrike II.mdx",x2,y2))
loop
exitwhen i >=12
set x3 = x2 + GetRandomReal(-250.,250.)
set y3 = y2 + GetRandomReal(-250.,250.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Rain of Fire Vol. II.mdx",x3,y3))
set i = i + 1
endloop
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\OrbOfFire.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Fireball Major.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firebolt Medium.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewAirEX.mdx",x,y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\CorpseExplodeFire.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Firaga.mdx",x,y))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",x,y))
if GetUnitAbilityLevel(CASTER,'A0ME') == 1 then
call SetHeroInt(CASTER,GetHeroInt(CASTER,false)+2,true)
else
call SetHeroInt(CASTER,GetHeroInt(CASTER,false)+1,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",CASTER,"origin"))
set DAMAGE = (BlzGetUnitMaxHP(data2.u)*.05+((2*GetHeroInt(CASTER,true)*(1.+(.1*GetHeroLevel(CASTER))))))
call GroupEnumUnitsInRange(GROUP,x,y,300.,Filter(function FilterActions))
call SetTimerData(t,data2)
if GetUnitAbilityLevel(CASTER,'A0ME') == 1 then
call TimerStart(t,1.,false, function Handler2)
else
call TimerStart(t,2.,false, function Handler2)
endif
else
if FirelordBurnStacks[GetUnitUserData(u)] == 0 then
call UnitAddAbility(u,'A0JP')
call UnitAddAbility(u,'A0JO')
call UnitAddAbility(u,'A0JT')
set burningUnits[numBurningUnits] = u
if numBurningUnits == 0 then
call TimerStart(globalTimer, 1.0, true, function Handler)
endif
set numBurningUnits = numBurningUnits + 1
endif
set FirelordBurnStacks[GetUnitUserData(u)] = FirelordBurnStacks[GetUnitUserData(u)] + 1
set burnCasters[GetUnitUserData(u)] = LC[1+GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
set burnDurations[GetUnitUserData(u)] = 10
endif
set t= null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if (GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A0JL') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u,'BIil') != 1 and HasExploded[GetUnitUserData(GetTriggerUnit())] == false and ((BI[NI])==(LN) or (BI[NI])==(DAMAGE_TYPE_UNIVERSAL) or (BI[NI])==(DAMAGE_TYPE_LIGHTNING) or (GetUnitTypeId(u) == 'h01Q' and BI[NI] == DAMAGE_TYPE_COLD and GetEventDamage() > 0 ) or (GetUnitTypeId(u) == 'h01T' and BI[NI] == DAMAGE_TYPE_COLD and GetEventDamage() > 0 and GetRandomInt(0,100) <= 20))) then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set globalTimer = NewTimer()
set FIRELORDBURN=CreateTrigger()
call TriggerAddCondition(FIRELORDBURN,Condition(function Conditions))
call MOE(II,(FIRELORDBURN))
call DisableTrigger(FIRELORDBURN)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope PuddleBurn initializer OnInit
globals
trigger PUDDLEBURNING
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit c = LC[1+GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
call DisableTrigger(PUDDLEBURNING)
if GetUnitAbilityLevel(c,'A0ME') != 1 then
call UnitDamageTargetEx(GetEventDamageSource(),u,GetWidgetLife(u)*.03,false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_COLD,null)
else
call UnitDamageTargetEx(GetEventDamageSource(),u,GetWidgetLife(u)*.03+(5*GetHeroInt(c,true)*.05*GetHeroLevel(c)),false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_COLD,null)
endif
call EnableTrigger(PUDDLEBURNING)
set u = null
set c = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitTypeId(u) == 'h01Q' and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > .01 then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set PUDDLEBURNING =CreateTrigger()
call TriggerAddCondition(PUDDLEBURNING,Condition(function Conditions))
call MOE(II,(PUDDLEBURNING))
call DisableTrigger(PUDDLEBURNING)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FlamingLaser initializer OnInit
globals
trigger FLAMELASER
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit c = GetEventDamageSource()
call DisableTrigger(FLAMELASER)
call UnitDamageTargetEx(c,u,GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(c)))],'A0K3')*GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(c)))],true)*.1,false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_COLD,null)
call EnableTrigger(FLAMELASER)
set u = null
set c = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitTypeId(u) == 'h01T' and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > .01 then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set FLAMELASER=CreateTrigger()
call TriggerAddCondition(FLAMELASER,Condition(function Conditions))
call MOE(II,(FLAMELASER))
call DisableTrigger(FLAMELASER)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FervorStacks initializer OnInit
globals
trigger FERVORSTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'N01O' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|c00E25300F|r|c00DC4D00e|r|c00D64700r|r|c00D04100v|r|c00C93B00e|r|c00C33500n|r|c00BD2F00t|r|c00B72900 |r|c00B12400F|r|c00AB1E00l|r|c00A51800a|r|c009E1200m|r|c00980C00e|r|c00920600s|r|c008C0000:|r " +I2S(Fervor[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set FERVORSTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( FERVORSTACKS, Player(pid), "-fervor", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( FERVORSTACKS, Condition(function Conditions) )
call DisableTrigger(FERVORSTACKS)
endfunction
endscope
scope ToxiaPoison initializer OnInit
globals
trigger TOXIAPOISON
integer array ToxiaPoisonStacks
real array ToxiaPoisonDamage
integer array ArmorReduced
private timer globalTimer
private boolean globalTimerActive = false
private integer array poisonedUnitData
private integer poisonedUnitCount = 0
endglobals
private struct PoisonedUnit
integer index
unit u
real dmg
unit caster
integer i
method destroy takes nothing returns nothing
set this.u = null
set this.dmg = 0.
set this.caster = null
set this.i = 0
call this.deallocate()
endmethod
endstruct
private function RemovePoisonedUnit takes PoisonedUnit pu returns nothing
call pu.destroy()
endfunction
private function DestroyUnit takes integer puIndex returns nothing
local integer i = puIndex
local PoisonedUnit pu = PoisonedUnit(poisonedUnitData[puIndex])
call RemovePoisonedUnit(pu)
loop
exitwhen i >= poisonedUnitCount
set poisonedUnitData[i] = poisonedUnitData[i + 1]
set i = i + 1
endloop
set poisonedUnitCount = poisonedUnitCount - 1
set poisonedUnitData[poisonedUnitCount] = 0
endfunction
private function Handler takes nothing returns nothing
local PoisonedUnit pu
local integer currentIndex = 0
local real dmgPerSecond
local boolean unitsRemaining = false
loop
exitwhen currentIndex >= poisonedUnitCount
set pu = PoisonedUnit(poisonedUnitData[currentIndex])
set pu.i = pu.i - 1
if pu.i < 0 or not UnitAlive(pu.u) then
if pu.u != null then
set ToxiaPoisonStacks[GetUnitUserData(pu.u)] = ToxiaPoisonStacks[GetUnitUserData(pu.u)] - 1
if ToxiaPoisonStacks[GetUnitUserData(pu.u)] == 0 then
// call UnitRemoveAbility(pu.u, 'A0J5')
call UnitRemoveAbility(pu.u, 'A0J4')
call UnitRemoveAbility(pu.u, 'B058')
endif
if ToxiaPoisonStacks[GetUnitUserData(pu.u)] == 5 then
call UnitRemoveAbility(pu.u,'A0R6')
call UnitRemoveAbility(pu.u,'B06X')
endif
endif
call DestroyUnit(currentIndex)
else
set dmgPerSecond = pu.dmg / (pu.i + 1)
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(pu.caster, pu.u, dmgPerSecond, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\GreatElderHydraLightningOrbV.107.mdx",pu.u,"chest"))
call EnableTrigger(TOXIAPOISON)
set pu.dmg = pu.dmg - dmgPerSecond
set ToxiaPoisonDamage[GetUnitUserData(pu.u)] = pu.dmg
set unitsRemaining = true
set currentIndex = currentIndex + 1
endif
endloop
if not unitsRemaining then
call PauseTimer(globalTimer)
set globalTimerActive = false
endif
endfunction
private function Actions takes nothing returns nothing
local unit target = GetTriggerUnit()
local integer puIndex = poisonedUnitCount
local PoisonedUnit pu
local integer currentStacks
if ToxiaPoisonStacks[GetUnitUserData(target)] > 100 then
set target = null
return
endif
set pu = PoisonedUnit.create()
set pu.u = target
set pu.index = puIndex
set pu.caster = LC[1 + GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
set currentStacks = ToxiaPoisonStacks[GetUnitUserData(target)]
set pu.i = 15
if ToxiaPoisonStacks[GetUnitUserData(pu.u)] == 0 then
//call UnitAddAbility(pu.u,'A0J5')
call UnitAddAbility(pu.u,'A0J4')
endif
if currentStacks == 5 then
call UnitAddAbility(pu.u,'A0R6')
endif
if currentStacks >= 5 then
set pu.dmg = pu.dmg + (((GetHeroLevel(pu.caster) * 1.) + (GetHeroAgi(pu.caster, true) * .35)*(1.+(.075*GetHeroLevel(pu.caster)))) * pu.i)
set ToxiaPoisonDamage[GetUnitUserData(pu.u)] = pu.dmg
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl",pu.u,"chest"))
if ArmorReduced[GetUnitUserData(pu.u)] < GetHeroLevel(pu.caster) + 10 then
if GetUnitAbilityLevel(pu.u,'A0QY') != 1 then
call UnitAddAbility(pu.u,'A0QY')
endif
call AddUnitBonus(pu.u, BONUS_ARMOR, -1)
set ArmorReduced[GetUnitUserData(pu.u)] = ArmorReduced[GetUnitUserData(pu.u)] + 1
endif
else
set pu.dmg = pu.dmg + (((GetHeroLevel(pu.caster)*.2) + (GetHeroAgi(pu.caster, true) * .3)) * pu.i)
set ToxiaPoisonDamage[GetUnitUserData(pu.u)] = pu.dmg
endif
set ToxiaPoisonStacks[GetUnitUserData(target)] = currentStacks + 1
set poisonedUnitData[puIndex] = pu
set poisonedUnitCount = poisonedUnitCount + 1
set ToxiaPoisonStacks[GetUnitUserData(target)] = currentStacks + 1
//call BJDebugMsg("Poison count for unit " + I2S(GetUnitUserData(target)) + " incremented to " + I2S(ToxiaPoisonStacks[GetUnitUserData(target)]))
if not globalTimerActive then
//set globalTimer = NewTimer()
call TimerStart(globalTimer, 1.0, true, function Handler)
set globalTimerActive = true
endif
set target = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(LC[1 + GetPlayerId(GetOwningPlayer(u))], 'A0FB') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u, GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u, 'BIil') != 1 and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER and BI[NI] != DAMAGE_TYPE_PLANT then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set TOXIAPOISON = CreateTrigger()
set globalTimer = NewTimer()
call TriggerAddCondition(TOXIAPOISON, Condition(function Conditions))
call MOE(II, (TOXIAPOISON))
call DisableTrigger(TOXIAPOISON)
endfunction
endscope
scope ToxiaPoison initializer OnInit
globals
trigger TOXIAPOISON
integer array ToxiaPoisonStacks
integer array ArmorReduced
private timer globalTimer
private boolean globalTimerActive = false
private integer array poisonedUnitData
private integer poisonedUnitCount = 0
endglobals
private struct PoisonedUnit
integer index
unit u
real dmg
unit caster
integer i
method destroy takes nothing returns nothing
set this.u = null
set this.dmg = 0.
set this.caster = null
set this.i = 0
call this.deallocate()
endmethod
endstruct
private function RemovePoisonedUnit takes PoisonedUnit pu returns nothing
set ToxiaPoisonStacks[GetUnitUserData(pu.u)] = ToxiaPoisonStacks[GetUnitUserData(pu.u)] - 1
if ToxiaPoisonStacks[GetUnitUserData(pu.u)] == 0 then
call UnitRemoveAbility(pu.u, 'A0J5')
call UnitRemoveAbility(pu.u, 'A0J4')
endif
call pu.destroy()
endfunction
private function DestroyUnit takes integer puIndex returns nothing
local integer i = puIndex
local PoisonedUnit pu = PoisonedUnit(poisonedUnitData[puIndex])
call RemovePoisonedUnit(pu)
loop
exitwhen i >= poisonedUnitCount
set poisonedUnitData[i] = poisonedUnitData[i + 1]
set i = i + 1
endloop
set poisonedUnitData[poisonedUnitCount] = 0
set poisonedUnitCount = poisonedUnitCount - 1
endfunction
private function Handler takes nothing returns nothing
local PoisonedUnit pu
local integer currentIndex = 1
local real dmgPerSecond
local boolean unitsRemaining = false
loop
exitwhen currentIndex > poisonedUnitCount
set pu = PoisonedUnit(poisonedUnitData[currentIndex])
if pu.i <= 0 or not UnitAlive(pu.u) or pu.u == null then
call DestroyUnit(currentIndex)
else
set pu.i = pu.i - 1
set dmgPerSecond = pu.dmg / (pu.i + 1)
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(pu.caster, pu.u, dmgPerSecond, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
call EnableTrigger(TOXIAPOISON)
set pu.dmg = pu.dmg - dmgPerSecond
set unitsRemaining = true
set currentIndex = currentIndex + 1
endif
endloop
if not unitsRemaining then
call PauseTimer(globalTimer)
set globalTimerActive = false
endif
endfunction
private function Actions takes nothing returns nothing
local unit target = GetTriggerUnit()
local integer puIndex = poisonedUnitCount
local PoisonedUnit pu
local integer currentStacks
if ToxiaPoisonStacks[GetUnitUserData(target)] > 40 then
return
endif
set pu = PoisonedUnit.create()
set pu.u = target
set pu.index = puIndex
set pu.caster = GetEventDamageSource()
set currentStacks = ToxiaPoisonStacks[GetUnitUserData(target)]
set pu.i = 3
if ToxiaPoisonStacks[GetUnitUserData(pu.u)] == 0 then
call UnitAddAbility(pu.u,'A0J5')
call UnitAddAbility(pu.u,'A0J4')
endif
if currentStacks >= 4 then
set pu.dmg = pu.dmg + (GetHeroLevel(pu.caster) * 5. + GetHeroAgi(pu.caster, true) * 2.) * pu.i
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl",pu.u,"chest"))
if ArmorReduced[GetUnitUserData(pu.u)] < GetHeroLevel(pu.caster)*2 then
call AddUnitBonus(pu.u, BONUS_ARMOR, -1)
set ArmorReduced[GetUnitUserData(pu.u)] = ArmorReduced[GetUnitUserData(pu.u)] + 1
endif
else
set pu.dmg = pu.dmg + (GetHeroLevel(pu.caster) + GetHeroAgi(pu.caster, true) * 1.75) * pu.i
endif
set ToxiaPoisonStacks[GetUnitUserData(target)] = currentStacks + 1
set poisonedUnitData[puIndex] = pu
set poisonedUnitCount = poisonedUnitCount + 1
if not globalTimerActive then
set globalTimer = NewTimer()
call TimerStart(globalTimer, 1.0, true, function Handler)
set globalTimerActive = true
endif
set target = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(LC[1 + GetPlayerId(GetOwningPlayer(u))], 'A0FB') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u, GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u, 'BIil') != 1 and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set TOXIAPOISON = CreateTrigger()
set globalTimer = NewTimer()
call TriggerAddCondition(TOXIAPOISON, Condition(function Conditions))
call MOE(II, (TOXIAPOISON))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
trigger TOXIAPOISON
integer array ToxiaPoisonStacks
integer array ArmorReduced
endglobals
scope ToxiaPoison initializer OnInit
native UnitAlive takes unit id returns boolean
private struct TP
unit caster
unit u
integer i
real dmg
//integer i
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TP data = GetTimerData(t)
if data.i == 0 or not UnitAlive(data.u) or data.u == null then
set ToxiaPoisonStacks[GetUnitUserData(data.u)] = ToxiaPoisonStacks[GetUnitUserData(data.u)] -1
//if ToxiaPoisonStacks[GetUnitUserData(data.u)] <10 then
//call UnitRemoveAbility(data.u,'A0P3')
//endif
if ToxiaPoisonStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A0J5')
call UnitRemoveAbility(data.u,'A0J4')
endif
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
set data.i = data.i - 1
call DisableTrigger(TOXIAPOISON)
call UnitDamageTargetEx(data.caster,data.u,data.dmg,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
call EnableTrigger(TOXIAPOISON)
call SetTimerData(t,data)
call TimerStart(t, 1.0, false, function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TP data
if ToxiaPoisonStacks[GetUnitUserData(GetTriggerUnit())] > 40 then
else
set t = NewTimer()
set data = TP.create()
set data.u = GetTriggerUnit()
if ToxiaPoisonStacks[GetUnitUserData(data.u)] == 0 then
call UnitAddAbility(data.u,'A0J5')
call UnitAddAbility(data.u,'A0J4')
endif
set data.caster = LC[1+GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
if ToxiaPoisonStacks[GetUnitUserData(data.u)] == 4 then
call UnitAddAbility(data.u,'A0P3')
endif
if ToxiaPoisonStacks[GetUnitUserData(data.u)] >= 4 then
set data.dmg = (GetHeroLevel(data.caster)*5.)+GetHeroAgi(data.caster,true)*2.
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl",data.u,"chest"))
if ArmorReduced[GetUnitUserData(data.u)] < GetHeroLevel(data.caster)*2 then
call AddUnitBonus(data.u, BONUS_ARMOR, -1)
set ArmorReduced[GetUnitUserData(data.u)] = ArmorReduced[GetUnitUserData(data.u)] + 1
endif
else
set data.dmg = GetHeroLevel(data.caster)+GetHeroAgi(data.caster,true)*1.75
endif
set ToxiaPoisonStacks[GetUnitUserData(data.u)] = ToxiaPoisonStacks[GetUnitUserData(data.u)] + 1
set data.i = 3
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
endif
set t= null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A0FB') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetUnitAbilityLevel(u,'BIil') != 1 and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set TOXIAPOISON=CreateTrigger()
call TriggerAddCondition(TOXIAPOISON,Condition(function Conditions))
call MOE(II,(TOXIAPOISON))
endfunction
endscope
globals
integer array Corrosion
trigger CORROSIONKILL
endglobals
scope Corrosion initializer OnInit
private function OnSpell takes nothing returns boolean
local unit u = LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]
if ToxiaPoisonStacks[GetUnitUserData(GetTriggerUnit())] >= 6 and GetUnitAbilityLevel(u,'A0FB') != 0 then
set Corrosion[GetUnitUserData(u)] = Corrosion[GetUnitUserData(u)] + 1
if Corrosion[GetUnitUserData(u)] > 699 and GetUnitAbilityLevel(u,'A0P4') == 0 then
call SetUnitVertexColor(u, 90, 160, 90, 190)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Acid Ex.mdx",u,"origin"))
call UnitAddAbility(u,'A0P4')
call BlzSetUnitWeaponIntegerFieldBJ( u, UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS, 0, 6 )
call BlzSetUnitWeaponStringFieldBJ( u, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, 0, "war3mapImported\\NaishaGlaiveMissileV2.mdx" )
call BlzSetUnitWeaponIntegerFieldBJ( u, UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS, 1, 6 )
call BlzSetUnitWeaponRealField(u, UNIT_WEAPON_RF_ATTACK_RANGE, 1, BlzGetUnitWeaponRealField(u, UNIT_WEAPON_RF_ATTACK_RANGE, 1) + 325.)
endif
if GetRandomInt(0,99) <= 39 then
if Corrosion[GetUnitUserData(u)] > 700 then
call SetHeroAgi(u,GetHeroAgi(u,false)+3,true)
else
call SetHeroAgi(u,GetHeroAgi(u,false)+1,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",u,"origin"))
endif
endif
set u =null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set CORROSIONKILL = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CORROSIONKILL, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(CORROSIONKILL, Condition(function OnSpell))
call DisableTrigger(CORROSIONKILL)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CorrosionStacks initializer OnInit
globals
trigger CORROSIONSTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01G' or GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|c020A3800C|r|c020D4A00o|r|c02105C00r|r|c02136E00r|r|c02178000o|r|c021A9200s|r|c021DA400i|r|c0220B600v|r|c021EA900e|r|c021B9D00 |r|c02199000K|r|c02178400i|r|c02157700s|r|c02126B00s|r|c02105E00:|r"+"|c021EA900" +I2S(Corrosion[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set CORROSIONSTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent(CORROSIONSTACKS, Player(pid), "-corrosion", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition(CORROSIONSTACKS, Condition(function Conditions) )
call DisableTrigger(CORROSIONSTACKS)
endfunction
endscope
scope Expunge initializer OnInit
globals
private constant integer SPELL_ID = 'A0FB'
endglobals
private struct ReffineCorruption extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
if hit == missile.target then
set Corrosion[GetUnitUserData(hit)] = Corrosion[GetUnitUserData(hit)] + 1
if Corrosion[GetUnitUserData(hit)] > 699 and GetUnitAbilityLevel(hit,'A0P4') == 0 then
call SetUnitVertexColor(hit, 90, 160, 90, 190)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Acid Ex.mdx",hit,"origin"))
call UnitAddAbility(hit,'A0P4')
call BlzSetUnitWeaponIntegerFieldBJ( hit, UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS, 0, 6 )
call BlzSetUnitWeaponStringFieldBJ( hit, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, 0, "war3mapImported\\NaishaGlaiveMissileV2.mdx" )
call BlzSetUnitWeaponIntegerFieldBJ( hit, UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS, 1, 6 )
call BlzSetUnitWeaponRealField(hit, UNIT_WEAPON_RF_ATTACK_RANGE, 1, BlzGetUnitWeaponRealField(hit, UNIT_WEAPON_RF_ATTACK_RANGE, 1) + 325.)
endif
if Corrosion[GetUnitUserData(hit)] > 699 then
call SetHeroAgi(hit,GetHeroAgi(hit,false)+3,true)
else
call SetHeroAgi(hit,GetHeroAgi(hit,false)+1,true)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",hit,"origin"))
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private function Actions takes nothing returns nothing
local unit u = null
local Misssile m
local real x
local real y
local real a
local unit c = GetTriggerUnit()
local player p = GetOwningPlayer(c)
set x = GetUnitX(c)
set y = GetUnitY(c)
call GroupEnumUnitsInRange(GLOBALGROUP,x,y,1200.,null)
loop
set u = FirstOfGroup(GLOBALGROUP)
exitwhen u == null
call GroupRemoveUnit(GLOBALGROUP, u)
if IsUnitEnemy(u,p) and UnitAlive(u) and GetUnitAbilityLevel(u,'A0J4') != 0 then
if GetUnitAbilityLevel(u,'A0R6') !=0 then
set x = GetUnitX(u)
set y = GetUnitY(u)
set a = Atan2(GetUnitY(c) - y, GetUnitX(c) - x)
set m = Misssile.create(x, y, 65., a, 1000., 65.)
set m.source = u
set m.target = c
set m.speed = 36
//set m.acceleration = 7.03125
set m.scale = .45
set m.model = "war3mapImported\\Orb of Poison.mdx"
set m.arc = 15.*bj_DEGTORAD
set m.collision = 16.
set m.spin = 270.*bj_DEGTORAD
//set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(c)
call ReffineCorruption.launch(m)// Launch is implemented via module MissileStruct
call UnitDamageTargetEx(c, u, ToxiaPoisonDamage[GetUnitUserData(u)]*1., false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\NetherInferno.mdx",u,"chest"))
else
call UnitDamageTargetEx(c, u, ToxiaPoisonDamage[GetUnitUserData(u)]*1., false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\NetherInferno.mdx",u,"chest"))
endif
endif
endloop
set p = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope Chernobyliss2 initializer OnInit
globals
private constant integer SPELL_ID = 'A0PL'
private constant real DAMAGE_BASE = 15.0
private constant real DAMAGE_MULT = 1.0
private constant real RADIUS = 200.
private constant integer MAX_TICKS = 50
private hashtable ht = InitHashtable()
endglobals
struct data
unit caster
player casterOwner
unit target
real x
real y
integer ticks
integer originalRed
integer originalGreen
integer originalBlue
static method create takes unit caster, real x, real y returns data
local data this = data.allocate()
set .caster = caster
set .casterOwner = GetOwningPlayer(caster)
set .x = x
set .y = y
set .ticks = 0
return this
endmethod
method applyAura takes nothing returns nothing
call UnitAddAbility(.target, 'A09U') // Replace 'Axxx' with the slow aura ability rawcode
endmethod
method removeAura takes nothing returns nothing
call UnitRemoveAbility(.target, 'A09U') // Replace 'Axxx' with the slow aura ability rawcode
endmethod
method saveOriginalColors takes unit u returns nothing
set .originalRed = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_RED)
set .originalGreen = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_GREEN)
set .originalBlue = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_BLUE)
endmethod
method restoreOriginalColors takes unit u returns nothing
call SetUnitVertexColor(u, .originalRed, .originalGreen, .originalBlue, 255)
endmethod
method destroy takes nothing returns nothing
call .removeAura()
call .restoreOriginalColors(.target)
set .caster = null
set .casterOwner = null
set .target = null
endmethod
endstruct
private function DoEffect takes unit target, unit caster returns nothing
local real damage = GetHeroAgi(caster, true) * DAMAGE_MULTIPLIER
call UnitDamageTargetEx(caster, target, damage, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
set target = null
set caster = null
endfunction
private function Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer tid = GetHandleId(t)
local data d = LoadData(ht, tid, 0)
local group g = CreateGroup()
local unit u
local integer uid
set d.ticks = d.ticks + 1
if d.ticks > MAX_TICKS then
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if LoadInteger(ht, uid, 0) == 1 then
call d.removeAura()
call d.restoreOriginalColors(u)
call RemoveSavedInteger(ht, uid, 0)
endif
endloop
call DestroyGroup(g)
call d.destroy()
call ReleaseTimer(t)
else
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if LoadInteger(ht, uid, 0) == 1 then
call DoEffect(u, d.caster)
else if IsUnitEnemy(u, d.casterOwner) then
call d.applyAura()
call d.saveOriginalColors(u)
call SaveInteger(ht, uid, 0, 1)
call DoEffect(u, d.caster)
endif
endloop
call DestroyGroup(g)
endif
set t = null
set u = null
set g = null
endfunction
private function ApplySpell takes unit caster, real x, real y returns nothing
local timer t = NewTimer()
local integer tid = GetHandleId(t)
local data d = data.create(caster, x, y)
local group g = CreateGroup()
local unit u
local integer uid
local real angle
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if IsUnitEnemy(u, d.casterOwner) and LoadInteger(ht, uid, 0) == 0 then
set angle = Atan2(GetUnitY(u) - d.y, GetUnitX(u) - d.x)
call KnockBack(u, angle, 500.0, 15.0) // knockback function
call d.saveOriginalColors(u)
call d.applyAura()
call DoEffect(u, d.caster)
call SaveInteger(ht, uid, 0, 1)
endif
endloop
call DestroyGroup(g)
call SaveData(ht, tid, 0, d)
call TimerStart(t, TIMER_PERIOD, true, function Actions)
set t = null
set u = null
set g = null
endfunction
private function Actions_Start takes nothing returns nothing
call ApplySpell(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY())
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions_Start)
endfunction
endscope
scope Chernobyliss2 initializer OnInit
globals
private constant integer SPELL_ID = 'A0PL'
private constant real DAMAGE_MULTIPLIER = 1.0
private constant real RADIUS = 200.0
private constant integer MAX_TICKS = 50
private hashtable ht = InitHashtable()
private real array affectedUnitX
private real array affectedUnitY
private constant real TIMER_PERIOD = 0.5
endglobals
private struct data
unit caster
player casterOwner
unit target
real x
real y
integer ticks
integer originalRed
integer originalGreen
integer originalBlue
integer level
static method create takes unit caster, real x, real y, integer level returns data
local data this = data.allocate()
set .caster = caster
set .casterOwner = GetOwningPlayer(caster)
set .x = x
set .y = y
set .ticks = 0
set .level = level
return this
endmethod
method applyAura takes nothing returns nothing
call UnitAddAbility(.target, 'A09U')
call SetUnitAbilityLevel(.target, 'A09U', .level)
endmethod
method removeAura takes nothing returns nothing
call UnitRemoveAbility(.target, 'A09U')
endmethod
method saveOriginalColors takes unit u returns nothing
set .originalRed = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_RED)
set .originalGreen = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_GREEN)
set .originalBlue = BlzGetUnitIntegerField(u, UNIT_IF_TINTING_COLOR_BLUE)
endmethod
method restoreOriginalColors takes unit u returns nothing
call SetUnitVertexColor(u, .originalRed, .originalGreen, .originalBlue, 255)
endmethod
method destroy takes nothing returns nothing
call .removeAura()
call .restoreOriginalColors(.target)
set .caster = null
set .casterOwner = null
set .target = null
endmethod
endstruct
private function DoEffect takes unit target, unit caster, integer level, real x, real y returns nothing
local real damage = GetHeroAgi(caster, true) * DAMAGE_MULTIPLIER * level
local real healthPercent = GetUnitLifePercent(target)
local integer greenColor = R2I(255 - (255 * healthPercent))
if UnitAlive(target) then
call UnitDamageTargetEx(caster, target, damage, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_LIGHTNING, null)
set affectedUnitX[GetUnitUserData(target)] = x
set affectedUnitY[GetUnitUserData(target)] = y
call SetUnitVertexColor(target, 255, greenColor, 255, 255)
endif
endfunction
private function SpreadPoison takes real x, real y, integer level returns nothing
local group g = CreateGroup()
local unit u
local integer uid
local real newX
local real newY
local data d
set g = CreateGroup()
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if not IsUnitEnemy(u, GetOwningPlayer(GetTriggerUnit())) or LoadInteger(ht, uid, 0) == 1 or GetUnitAbilityLevel(u, 'A09U') >= level or not UnitAlive(u) then
// Skip the unit if it's not an enemy, already affected, has a higher or equal level of the slow aura ability, or is dead
set newX = GetUnitX(u)
set newY = GetUnitY(u)
set d = LoadInteger(ht, uid, 0)
if d != null then
// Spread the poison to the nearby unaffected unit
call d.applyAura()
call DoEffect(u, d.caster, d.level, newX, newY)
call SaveInteger(ht, uid, 0, 1)
endif
endif
endloop
call DestroyGroup(g)
call FlushChildHashtable(ht, 0)
endfunction
private function Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local data d = GetTimerData(t) // Retrieve the data from the timer
set d.ticks = d.ticks + 1
if d.ticks > MAX_TICKS then
call d.removeAura()
call d.restoreOriginalColors(d.target)
call RemoveSavedInteger(ht, GetHandleId(d.target), 0)
call d.destroy() // Call destroy method to clean up the struct instance
call ReleaseTimer(t)
else
call DoEffect(d.target, d.caster, d.level, d.x, d.y)
call SpreadPoison(d.x, d.y, d.level)
endif
set t = null
endfunction
private function ApplySpell takes unit caster, real x, real y, integer level returns nothing
local timer t = NewTimer()
local data d = data.create(caster, x, y, level)
call d.applyAura()
call d.saveOriginalColors(caster)
call DoEffect(caster, caster, level, x, y)
call SpreadPoison(x, y, level)
call TimerStart(t, TIMER_PERIOD, true, function Actions)
call SetTimerData(t, d) // Attach the data to the timer
endfunction
private function Actions_Start takes nothing returns nothing
call ApplySpell(GetTriggerUnit(), GetSpellTargetX(), GetSpellTargetY(), GetUnitAbilityLevel(GetTriggerUnit(), SPELL_ID))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions_Start)
endfunction
endscope
scope Chernobyliss2 initializer OnInit
globals
private constant integer SPELL_ID = 'A0PL'
private constant real DAMAGE_BASE = 15.0
private constant real DAMAGE_MULT = 1.0
private constant real RADIUS = 200.
private constant integer MAX_TICKS = 50
private hashtable ht = InitHashtable()
endglobals
struct data
unit caster
player casterOwner
unit target
real x
real y
integer ticks
integer originalRed
integer originalGreen
integer originalBlue
endstruct
private function DoEffect takes unit target, unit caster returns nothing
local real damage = GetHeroAgi(caster, true) * DAMAGE_MULT
call UnitDamageTargetEx(caster, target, damage, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
set target = null
set caster = null
endfunction
private function Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer tid = GetHandleId(t)
local data d = LoadData(ht, tid, 0)
local group g = CreateGroup()
local unit u
local integer uid
set d.ticks = d.ticks + 1
if d.ticks > MAX_TICKS then
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if LoadInteger(ht, uid, 0) == 1 then
call d.removeAura()
call d.restoreOriginalColors(u)
call RemoveSavedInteger(ht, uid, 0)
endif
set u = null
endloop
call DestroyGroup(g)
call FlushChildHashtable(ht, tid)
call d.destroy()
call ReleaseTimer(t)
else
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if LoadInteger(ht, uid, 0) == 1 then
call DoEffect(u, d.caster)
else if IsUnitEnemy(u, d.casterOwner) then
call d.applyAura()
call d.saveOriginalColors(u)
call SaveInteger(ht, uid, 0, 1)
call DoEffect(u, d.caster)
endif
set u = null
endloop
call DestroyGroup(g)
endif
set t = null
set g = null
endfunction
private function ApplySpell takes unit caster, real x, real y returns nothing
local timer t = NewTimer()
local integer tid = GetHandleId(t)
local data d = data.create(caster, x, y)
local group g = CreateGroup()
local unit u
local integer uid
local real angle
call GroupEnumUnitsInRange(g, d.x, d.y, RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set uid = GetHandleId(u)
call GroupRemoveUnit(g, u)
if IsUnitEnemy(u, d.casterOwner) and LoadInteger(ht, uid, 0) == 0 then
set angle = Atan2(GetUnitY(u) - d.y, GetUnitX(u) - d.x)
call KnockBack(u, angle, 500.0, 15.0) // Replace with your knockback function
call d.saveOriginalColors(u)
call d.applyAura()
call DoEffect(u, d.caster)
call SaveInteger(ht, uid, 0, 1)
endif
set u = null
endloop
call DestroyGroup(g)
call SaveData(ht, tid, 0, d)
call TimerStart(t, TIMER_PERIOD, true, function Actions)
set t = null
set g = null
endfunction
private function Actions_Start takes nothing returns nothing
call ApplySpell(GetTriggerUnit(), GetSpellTargetX(), GetSpellTargetY())
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions_Start)
endfunction
endscope
scope Chernobyliss2 initializer OnInit
globals
private constant integer SPELL_ID = 'A0PL'
private constant real DAMAGE_MULTIPLIER = 2.0
private constant real RADIUS = 200.0
private hashtable ht = InitHashtable()
private constant real TIMER_PERIOD = 1
private constant string EFFECT1 = "war3mapImported\\Acid Ex.mdx"
private constant string EFFECT2 = "war3mapImported\\VenomousGaleV2_Portrait.mdx"
private constant string EFFECT3 = "Abilities\\Spells\\Other\\AcidBomb\\BottleMissile.mdl"
private constant string ATTACH = "chest"
private constant string ATTACH2 = "chest"
private integer firstDataInstance = 0
private timer globalTimer = null
//private integer spellCastCounter = 0
endglobals
private struct data
unit caster
player casterOwner
unit target
real x
real y
real damage
integer maxTicks
integer remainingTicks
integer originalRed
integer originalGreen
integer originalBlue
integer level
//integer castId
effect attach
data next
static method create takes unit caster, unit target, real x, real y, integer level returns data
local data this = data.allocate()
set .caster = caster
set .casterOwner = GetOwningPlayer(caster)
set .target = target
set .x = x
set .y = y
set .level = level
set .damage = GetHeroAgi(caster, true) * DAMAGE_MULTIPLIER *level *.1 * level * (1.+(.1 * GetHeroLevel(caster)))
set .maxTicks = (30 + 3 * level)
set .remainingTicks = .maxTicks
// set .castId = spellCastCounter
set .attach = AddSpecialEffectTarget(EFFECT2, target, ATTACH)
// Saving original colors of the target
set .originalRed = BlzGetUnitIntegerField(target, UNIT_IF_TINTING_COLOR_RED)
set .originalGreen = BlzGetUnitIntegerField(target, UNIT_IF_TINTING_COLOR_GREEN)
set .originalBlue = BlzGetUnitIntegerField(target, UNIT_IF_TINTING_COLOR_BLUE)
return this
endmethod
method applyAura takes nothing returns nothing
call UnitAddAbility(.target, 'A09U')
call SetUnitAbilityLevel(.target, 'A09U', .level)
endmethod
method removeAura takes nothing returns nothing
call UnitRemoveAbility(.target, 'A09U')
endmethod
method changeVertexColor takes nothing returns nothing
local real life = GetWidgetLife(.target)
local real mlife = GetUnitState(.target, UNIT_STATE_MAX_LIFE)
local real plife = life / mlife
local integer greenColor
if plife >= .3 then
set greenColor = R2I(plife * 255)
call SetUnitVertexColor(.target, greenColor, 255, greenColor, 255)
else
call SetUnitVertexColor(.target, 60, 130, 60, 255)
endif
endmethod
method restoreOriginalColors takes nothing returns nothing
call SetUnitVertexColor(.target, .originalRed, .originalGreen, .originalBlue, 255)
endmethod
method destroy takes nothing returns nothing
call RemoveSavedInteger(ht, GetUnitUserData(.target), 0)
call SaveInteger(ht, GetUnitUserData(.target), 0, 0) // Added this line
call DestroyEffect(.attach)
call .removeAura()
call .restoreOriginalColors()
set .caster = null
set .casterOwner = null
set .target = null
set .attach = null
endmethod
endstruct
private function DoEffect takes data d returns nothing
if UnitAlive(d.target) then
call UnitDamageTargetEx(d.caster, d.target, d.damage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING, null)
call d.changeVertexColor()
call DestroyEffect(AddSpecialEffectTarget(EFFECT3, d.target, ATTACH2))
endif
endfunction
private function SpreadPoison takes data d returns nothing
local group g = CreateGroup()
local unit u
local integer uid
local data d2
// Enumerate units in range of the affected unit, rather than the original cast location.
call GroupEnumUnitsInRange(g, GetUnitX(d.target), GetUnitY(d.target), RADIUS, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
set uid = GetUnitUserData(u)
if IsUnitEnemy(u, d.casterOwner) and LoadInteger(ht, uid, 0) == 0 and GetUnitAbilityLevel(u, 'A09U') < d.level and UnitAlive(u) then
// Create a new data object for this unit, using its current location.
set d2 = data.create(d.caster, u, GetUnitX(u), GetUnitY(u), d.level)
set d2.remainingTicks = d.remainingTicks
call d2.applyAura()
call DoEffect(d2)
call SaveInteger(ht, uid, 0, 1) // Ensure that the hashtable is updated for this unit.
set d2.next = d.next
set d.next = d2
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
set d2 = 0
endfunction
private function Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local data d = firstDataInstance
local data next
local boolean hasActiveData = false
loop
exitwhen d == 0
set next = d.next
if UnitAlive(d.target) then
set d.remainingTicks = d.remainingTicks - 1 // Decrement remainingTicks only if unit is alive.
if d.remainingTicks <= 0 then
if d == firstDataInstance then
set firstDataInstance = next
endif
call d.removeAura()
call d.destroy()
else
set hasActiveData = true
call DoEffect(d)
if GetRandomInt(0,99) <= 49 then
call SpreadPoison(d)
endif
endif
else
if d == firstDataInstance then
set firstDataInstance = next
endif
call d.destroy()
endif
set d = next
endloop
if hasActiveData == false then
call PauseTimer(globalTimer)
set globalTimer = null
endif
set t = null
set d = 0
endfunction
private function ApplySpell takes unit caster, real x, real y, integer level returns nothing
local timer t
local unit target
local group g = CreateGroup()
local data d
local data first = 0
local real dx
local real dy
local real angle
if globalTimer == null then
set globalTimer = NewTimer()
call TimerStart(globalTimer, TIMER_PERIOD, true, function Actions)
endif
set t = globalTimer
call DestroyEffect(AddSpecialEffect(EFFECT1, x, y))
call GroupEnumUnitsInRange(g, x, y, RADIUS, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
// Apply spell only to enemy units and only if they are alive
if IsUnitEnemy(target, GetOwningPlayer(caster)) and UnitAlive(target) then
set d = data.create(caster, target, x, y, level)
set d.next = firstDataInstance
set firstDataInstance = d
set first = d
set dx = GetUnitX(target) - x
set dy = GetUnitY(target) - y
set angle = Atan2(dy, dx) * 180. / bj_PI
call d.applyAura()
call DoEffect(d)
call SpreadPoison(d)
call M6E(target, 190. + level * 10., .6, angle, "", 0.0, false, false)
endif
endloop
call DestroyGroup(g)
set t = null
set g = null
set target = null
endfunction
private function Actions_Start takes nothing returns nothing
call ApplySpell(GetTriggerUnit(), GetSpellTargetX(), GetSpellTargetY(), GetUnitAbilityLevel(GetTriggerUnit(), SPELL_ID))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions_Start)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope PProseltyization initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private boolean array skewered
private unit CASTER
private real DAMAGE
private real DAMAGE2
private real ANGLE
private real BIGX
private real BIGY
private integer CURRENT
private constant integer SPELL_ID = 'A0Q0'
private constant string EFFECT = "war3mapImported\\Void Spear.mdx"
private constant string ATTACH_POINT = "chest"
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
group g
effect fx1
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.c = null
set this.fx1 = null
call this.deallocate()
endmethod
endstruct
private function GroupActions3 takes nothing returns nothing
set skewered[GetUnitUserData(GetEnumUnit())]= false
endfunction
private function GroupActions2 takes nothing returns nothing
local unit u = GetEnumUnit()
local unit d
set skewered[GetUnitUserData(u)]= false
set d = null
set u = null
endfunction
private function GroupActions takes nothing returns nothing
local unit u = GetEnumUnit()
local real x
local real y
//local unit d
call SetUnitX(u,BIGX)
call SetUnitY(u,BIGY)
//call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\Firebrand Shot Purple.mdx", u, "chest") )
if CURRENT >= 16 then
call UnitDamageTargetEx( CASTER, u, DAMAGE2, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
endif
//set d = null
set u = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) and not skewered[GetUnitUserData(u)] then
if CURRENT < 16 then
call UnitDamageTargetEx( CASTER, u, DAMAGE*.5, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
endif
call GroupAddUnit( GROUP2, u )
set skewered[GetUnitUserData(u)]= true
// call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
//call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\Firebrand Shot Purple.mdx", u, "chest") )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
local effect fx
if data.current == 32 then
//call SetUnitTimeScale(data.c,1.)
call DestroyEffect(data.fx1)
call ForGroup(data.g,function GroupActions3)
call ReleaseTimer(t)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call data.destroy()
else
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
set CURRENT = data.current
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 180., Filter( function FilterActions ) )
set data.g = GROUP2
if data.current >= 16 then
set data.x = data.x - 56.25 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y - 56.25 * Sin(data.a * bj_DEGTORAD)
set fx = AddSpecialEffect("war3mapImported\\OrbofCorruption.mdx",data.x,data.y)
call BlzSetSpecialEffectScale(fx,.8)
call DestroyEffect(fx)
else
set data.x = data.x + 56.25 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 56.25 * Sin(data.a * bj_DEGTORAD)
endif
set ANGLE = data.a
set CASTER = data.c
set DAMAGE2 = data.dmg*.03125
set CURRENT = data.current
set BIGX = data.x
set BIGY = data.y
call ForGroup(data.g,function GroupActions)
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set fx = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
local effect fx
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.a = bj_RADTODEG * Atan2(GetSpellTargetY() - data.y, GetSpellTargetX() - data.x)
set data.current = 0
call BlzPauseUnitEx(data.c,true)
set UnitIsCasting[GetUnitUserData(data.c)] = true
set lvl = GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(data.c))],SPELL_ID)
//set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Valiant Charge.mdx",data.c,"chest")
//call BlzSetSpecialEffectScale(data.fx1,1.3)
set data.dmg = 3.*(GetHeroAgi(data.c,true)+ GetHeroStr(data.c,true)+GetHeroInt(data.c,true))*GetUnitAbilityLevel(data.c,SPELL_ID)
set fx = AddSpecialEffect("war3mapImported\\Piercing Thrust Purple.mdx",data.x,data.y)
call BlzSetSpecialEffectYaw(fx,Deg2Rad(data.a))
call BlzSetSpecialEffectScale(fx,2.75)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Piercing Thrust Purple.mdx",data.x,data.y)
call BlzSetSpecialEffectYaw(fx,Deg2Rad(data.a))
call BlzSetSpecialEffectScale(fx,2.75)
call DestroyEffect(fx)
//call SetUnitTimeScale(data.c,2.)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set fx = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CSExplosion initializer OnInit
globals
trigger CSDMG
private constant integer SPELL_ID3 = 'A0Q3'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
endglobals
private struct CSeeds
unit u
unit c
method destroy takes nothing returns nothing
set this.c = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions2 takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
//call DisableTrigger(CSDMG)
call UnitDamageTargetEx(CASTER, u,DAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
//call EnableTrigger(CSDMG)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Void Crescent Tailed.mdx",u,"chest"))
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local CSeeds data = GetTimerData(t)
local effect fx
local real x
local real y
set CASTER = data.c
set DAMAGE =(GetHeroAgi(CASTER,true)+ GetHeroStr(CASTER,true)+GetHeroInt(CASTER,true))
set x = GetUnitX(data.u)
set y = GetUnitY(data.u)
call GroupEnumUnitsInRange(GROUP,x,y,225.,Filter(function FilterActions2))
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",x,y)
call BlzSetSpecialEffectScale(fx,1.5)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",x,y)
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
call data.destroy()
call ReleaseTimer(t)
set t = null
set fx = null
endfunction
private function Actions takes nothing returns boolean
local effect fx
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local timer t
local CSeeds data
if GetUnitAbilityLevel(u,SPELL_ID3) == 1 and IsUnitEnemy(a,GetOwningPlayer(u)) and GetEventDamage() >.5 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
call UnitRemoveAbility(u,SPELL_ID3)
call UnitRemoveAbility(u,'B06S')
set t = NewTimer()
set data = CSeeds.create()
set data.u = u
set data.c = CSCASTER[GetUnitUserData(u)]
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
endif
else
call UnitRemoveAbility(u,SPELL_ID3)
call UnitRemoveAbility(u,'B06S')
set t = NewTimer()
set data = CSeeds.create()
set data.u = u
set data.c = CSCASTER[GetUnitUserData(u)]
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
endif
endif
set t= null
set fx = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CSDMG= CreateTrigger()
call MOE(II, (CSDMG))
call TriggerAddCondition(CSDMG, Condition(function Actions))
call DisableTrigger(CSDMG)
endfunction
endscope
scope AblateCorruption initializer OnInit
globals
private constant integer SPELL_ID = 'A0Q1'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct AblatedCorruption extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
local integer id
//local real c = 0.
if hit == missile.target then
//call BJDebugMsg("Hit")
if missile.scale == 1.4 then
//call BJDebugMsg("1.4")
set id = GetPlayerId(GetOwningPlayer(missile.target))
set CorruptAmount[id] = CorruptAmount[id] + 1
call SetPlayerState(Player(id),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
else
//call BJDebugMsg("Not 1.4")
//if CorruptAmount[id] > 0 then
//set c = .0025*CorruptAmount[id]
//if c >= 3. then
//set c = 3.
//endif
//endif
//call BJDebugMsg("missile damage:"+R2S(missile.damage))
//call BJDebugMsg("HUH")
call SetWidgetLife(missile.target,(GetWidgetLife(missile.target))+(missile.damage*.15 ))
endif
// call UnitDamageTargetEx(missile.source, hit, missile.damage, true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",hit,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidball Minor.mdx",hit,"chest"))
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private struct Bls
unit c
effect fx
//effect fx2
effect fx3
//effect fx4
effect fx5
real dur
real damage
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
//call DestroyEffect(this.fx2)
//set this.fx2 = null
call DestroyEffect(this.fx3)
set this.fx3 = null
//call DestroyEffect(this.fx4)
//set this.fx4 = null
call DestroyEffect(this.fx5)
set this.fx5 = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local Misssile m
local real a
local real x
local real y
local player p = GetOwningPlayer(u)
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and p != Player(15) and IsUnitType(u,UNIT_TYPE_HERO) and not IsUnitIllusion(u) and CorruptAmount[GetPlayerId(p)] >0 and u != CASTER then
set x = GetUnitX(u)
set y = GetUnitY(u)
set a = Atan2(GetUnitY(CASTER) - y, GetUnitX(CASTER) - x)
set CorruptAmount[GetPlayerId(p)] = CorruptAmount[GetPlayerId(p)] - 1
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[GetPlayerId(p)])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
set m = Misssile.create(x, y, 65., a, 800., 65.)
set m.source = u
set m.target = CASTER
set m.speed = 21.09375
//set m.acceleration = 7.03125
set m.scale = 1.4
set m.spin = 90.*bj_DEGTORAD
set m.model = "war3mapImported\\Void Spear.mdx"
set m.arc = 15.*bj_DEGTORAD
set m.collision = 16.
set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
//set m.damage=1
call AblatedCorruption.launch(m)// Launch is implemented via module MissileStruct
endif
set p = null
set u = null
return false
endfunction
private function FilterGroup takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit())
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Bls data = GetTimerData(t)
local real x
local real y
local real x2
local real y2
local unit u
local Misssile m
local real a
local real c
local integer id
if data.dur <=0 or not UnitAlive(data.c) then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - .2
set x = GetUnitX(data.c)
set y = GetUnitY(data.c)
set CASTER = data.c
call GroupEnumUnitsInRange(GROUP,x,y,448.,Filter(function FilterGroup))
set u = GroupPickRandomUnit(GROUP)
call GroupClear(GROUP)
if u != null then
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set a = Atan2(GetUnitY(CASTER) - y2, GetUnitX(CASTER) - x2)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\JudgementTarget.mdx",u,"origin"))
set m = Misssile.create(x2, y2, 65., a, 800., 65.)
set m.source = u
set m.target = CASTER
set m.speed = 21.09375
//set m.acceleration = 7.03125
set m.scale = 1.0
set m.spin = 90.*bj_DEGTORAD
set m.model = "war3mapImported\\Void Spear.mdx"
set m.arc = 15.*bj_DEGTORAD
set m.collision = 12.
set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
set m.damage = data.damage
set id = GetPlayerId(GetOwningPlayer(CASTER))
if CorruptAmount[id] >0 then
set c = .0025*CorruptAmount[id]
if c >= 3. then
set c = 3.
endif
set m.damage = m.damage * (1.+c)
endif
if m.damage > GetWidgetLife(u) then
set m.damage = GetWidgetLife(u)
endif
call AblatedCorruption.launch(m)// Launch is implemented via module MissileStruct
call UnitDamageTargetEx(m.target, m.source, data.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidball Minor.mdx",m.source,"chest"))
endif
call GroupEnumUnitsInRange(GROUP,x,y,448.,Filter(function FilterActions))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\JudgementTarget.mdx",GetUnitX(data.c),GetUnitY(data.c)))
call SetTimerData(t,data)
call TimerStart(t,.2,false,function Handler)
endif
set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Bls data = Bls.create()
local integer i = 12
local real x
local real y
set data.c = GetTriggerUnit()
set data.fx = AddSpecialEffectTarget("war3mapImported\\Void Disc2x.mdx",data.c,"origin")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\BlackFrost Glacial Storm Astral.mdx",data.c,"origin")
//set data.fx4 = AddSpecialEffectTarget("war3mapImported\\BlackFrost Glacial Storm Astral.mdx",data.c,"chest")
//set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Soul Armor Void_opt35.mdx",data.c,"chest")
set data.fx5 = AddSpecialEffectTarget("war3mapImported\\Soul Armor Void_opt2x.mdx",data.c,"chest")
set data.damage = .2*(GetHeroAgi(data.c,true)+ GetHeroStr(data.c,true)+GetHeroInt(data.c,true))*GetUnitAbilityLevel(data.c,SPELL_ID)
set x = GetUnitX(data.c)
set y= GetUnitY(data.c)
set data.dur = 10.+(CorruptAmount[GetPlayerId(GetOwningPlayer(data.c))]*0.001)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.2,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CSExplosion initializer OnInit
globals
trigger CSDMG
private constant integer SPELL_ID3 = 'A0Q3'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
endglobals
private function FilterActions2 takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call DisableTrigger(CSDMG)
call UnitDamageTargetEx(CASTER, u,DAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call EnableTrigger(CSDMG)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Void Crescent Tailed.mdx",u,"chest"))
endif
set u = null
return false
endfunction
private function Actions takes nothing returns boolean
local effect fx
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
if GetUnitAbilityLevel(u,SPELL_ID3) == 1 and IsUnitEnemy(a,GetOwningPlayer(u)) and GetEventDamage() >.5 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
call UnitRemoveAbility(u,SPELL_ID3)
call UnitRemoveAbility(u,'B06S')
set CASTER = CSCASTER[GetUnitUserData(u)]
set DAMAGE =(GetHeroAgi(CASTER,true)+ GetHeroStr(CASTER,true)+GetHeroInt(CASTER,true))*(1.+(.075*GetHeroLevel(CASTER)))
call GroupEnumUnitsInRange(GROUP,GetUnitX(u),GetUnitY(u),225.,Filter(function FilterActions2))
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,1.5)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
endif
else
call UnitRemoveAbility(u,SPELL_ID3)
call UnitRemoveAbility(u,'B06S')
set CASTER = a
set DAMAGE =(GetHeroAgi(CASTER,true)+ GetHeroStr(CASTER,true)+GetHeroInt(CASTER,true))*(1.+(.075*GetHeroLevel(CASTER)))
call GroupEnumUnitsInRange(GROUP,GetUnitX(u),GetUnitY(u),225.,Filter(function FilterActions2))
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,1.5)
call DestroyEffect(fx)
set fx = AddSpecialEffect("war3mapImported\\Void Rain Missile.mdx",GetUnitX(u),GetUnitY(u))
call BlzSetSpecialEffectScale(fx,2.)
call DestroyEffect(fx)
endif
endif
set fx = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CSDMG= CreateTrigger()
call MOE(II, (CSDMG))
call TriggerAddCondition(CSDMG, Condition(function Actions))
call DisableTrigger(CSDMG)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CorruptedCommunion initializer OnInit
globals
private constant integer SPELL_ID = 'A0PY'
private constant integer SPELL_ID2 = 'B06R'
private constant integer SPELL_ID3 = 'A0Q3'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE
trigger CCDMG
unit array CSCASTER
endglobals
private struct Leapy
unit c
unit t
real d
real h
effect fx
//effect fx2
method destroy takes nothing returns nothing
set this.c = null
set this.t =null
call DestroyEffect(this.fx)
//call DestroyEffect(this.fx2)
//call BJDebugMsg("destroyed")
set this.fx = null
//set this.fx2 = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Leapy data = GetTimerData(t)
local unit u
if data.d >= .6 then
call SetUnitFlyHeight(data.c,0.,0.0)
if GetUnitAbilityLevel(data.c, SPELL_ID3) != 1 and not IsUnitType(data.c,UNIT_TYPE_HERO) then
set CSCASTER[GetUnitUserData(data.c)]=data.t
call UnitAddAbility(data.c, SPELL_ID3)
endif
call data.destroy()
call ReleaseTimer(t)
else
if data.d < .3 then
set data.h = data.h + 12
call SetUnitFlyHeight(data.c,data.h,0.0)
else
set data.h = data.h - 12
call SetUnitFlyHeight(data.c,data.h,0.0)
endif
set data.d = data.d + .01
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set u = null
set t = null
endfunction
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
local timer t
local Leapy data
local real d = 0
local real a = 0
local real cx = 0
local real cy = 0
local real tx =0
local real ty =0
local real dx =0
local real dy = 0
local real x = 0
local real y = 0
local real a2 = 0
//local player p
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
set t = NewTimer()
set data = Leapy.create()
set data.c = u
set data.t = CASTER
//call SetUnitAnimation(data.c,"attack two")
set cx = GetUnitX(CASTER)
set cy = GetUnitY(CASTER)
set tx = GetUnitX(data.c)
set ty = GetUnitY(data.c)
call UnitAddAbility(data.c,'Amrf')
call UnitRemoveAbility(data.c,'Amrf')
set a = bj_RADTODEG * Atan2(ty - cy, tx - cx)
// set dx = tx - cx
// set dy = ty - cy
// set d =(SquareRoot(dx * dx + dy * dy)) + 80.
set d = 450.
call M6E(data.c,d,.6,a,"none.mdl",.0,true,false)
//set data.fx = AddSpecialEffectTarget("war3mapImported\\PrismBeam_Master.mdx",data.c,"chest")
set data.fx = AddSpecialEffectTarget("war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",data.c,"chest")
call UnitDamageTargetEx(CASTER, data.c,DAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
set data.d =.01
set data.h = 6
call SetUnitFlyHeight(data.c,data.h,0.0)
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set u = null
set t = null
return false
endfunction
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer id = GetPlayerId(GetOwningPlayer(a))
local real c
local real d
if GetUnitAbilityLevel(a,SPELL_ID) == 1 and a != u then
if CorruptAmount[id] >0 then
set c = .0025*CorruptAmount[id]
if c >= 3. then
set c = 3.
endif
set d = GetEventDamage() * (1.+(c))
call BlzSetEventDamage(d)
//call BJDebugMsg("Damage:"+R2S(d))
endif
//call DisableTrigger(CCDMG)
//call UnitDamageTargetEx(a,u,d,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
//call EnableTrigger(CCDMG)
if Damage_IsAttack() and GetUnitAbilityLevel(u,SPELL_ID2) ==1 and GetUnitAbilityLevel(a,SPELL_ID) == 1 then
call UnitRemoveAbility(u,SPELL_ID2)
set CASTER = a
set DAMAGE = 2.*(GetHeroAgi(CASTER,true)+ GetHeroStr(CASTER,true)+GetHeroInt(CASTER,true))*(1.+(.025*GetHeroLevel(CASTER)))
call GroupEnumUnitsInRange(GROUP,GetUnitX(a),GetUnitY(a),300.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Call of Dread Purple.mdx",GetUnitX(a),GetUnitY(a)))
endif
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CCDMG= CreateTrigger()
call MOE(II, (CCDMG))
call TriggerAddCondition(CCDMG, Condition(function Actions))
call DisableTrigger(CCDMG)
endfunction
endscope
scope RefineCorruption initializer OnInit
globals
private constant integer SPELL_ID = 'A0Q4'
private unit CASTER
private real DAMAGE
endglobals
private struct Ref
group g
unit c
integer current
real damage
static method create takes nothing returns Ref
local Ref data = Ref.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.c = null
//set this.fx1 = null
call this.deallocate()
endmethod
endstruct
private struct ReffineCorruption extends array
private static method onRemove takes Misssile missile returns boolean
return true
endmethod
// Runs when a missile collides with a unit.
private static method onCollide takes Misssile missile, unit hit returns boolean
local thistype this = thistype(missile)
if hit == missile.target then
if missile.scale == 1.0 then
if UnitAlive(hit) then
call CreateItem('I04F',GetUnitX(missile.target),GetUnitY(missile.target))
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",hit,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",hit,"chest"))
if GetUnitAbilityLevel(hit,'A0Q3') == 0 then
set CSCASTER[GetUnitUserData(hit)]=missile.source
call UnitAddAbility(hit,'A0Q3')
endif
endif
return true// returning true will destroy the missile instance.
endif
return false// returning false will keep the missile flying.
endmethod
implement MisssileStruct
endstruct
private function FilterGroup takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and UnitAlive(GetFilterUnit()) and not BlzIsUnitInvulnerable(GetFilterUnit())
endfunction
private function Handler takes nothing returns nothing
local unit u
local Misssile m
local real a
local real x
local real y
//local player p = GetOwningPlayer(u)
local timer t = GetExpiredTimer()
local Ref data = GetTimerData(t)
set u = FirstOfGroup(data.g)
if u!= null then
if UnitAlive(u) then
if GetUnitAbilityLevel(u,'A0Q3') == 1 then
set x = GetUnitX(u)
set y = GetUnitY(u)
set a = Atan2(GetUnitY(data.c) - y, GetUnitX(data.c) - x)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
set m = Misssile.create(x, y, 65., a, 1000., 65.)
set m.source = u
set m.target = data.c
set m.speed = 28.125
//set m.acceleration = 7.03125
set m.scale = 1.0
set m.model = "war3mapImported\\ShadowOrbMissile v1.2.mdl"
set m.arc = 45.*bj_DEGTORAD
set m.collision = 16.
set m.spin = 270.*bj_DEGTORAD
set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
call ReffineCorruption.launch(m)// Launch is implemented via module MissileStruct
call UnitDamageTargetEx(m.target, m.source, data.damage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidball Medium.mdx",m.source,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\OrbofCorruption.mdx",m.source,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Voidbolt Major.mdx",m.source,"chest"))
else
if not IsUnitType(u,UNIT_TYPE_HERO) then
set x = GetUnitX(data.c)
set y = GetUnitY(data.c)
set a = Atan2(GetUnitY(u) - y, GetUnitX(u) - x)
//set m = Misssile.create(x, y, 65., a, 1000., 65.)
set m = Misssile.createXYZ(x, y, GetUnitFlyHeight(data.c), GetUnitX(u), GetUnitY(u), GetUnitFlyHeight(u)+66.)
set m.source = data.c
set m.speed = 42.1875
//set m.acceleration = 7.03125
set m.scale = .95
set m.model = "war3mapImported\\OrbofCorruption.mdx"
set m.arc = GetRandomReal(40.,70.)*bj_DEGTORAD
set m.spin = 90.*bj_DEGTORAD
set m.collision = 16.
//set m.collisionZ = 15.
// set m.curve = GetRandomReal(-bj_PI/4, bj_PI/4)
//set m.arc = bj_PI/3
set m.curve = GetRandomReal(-bj_PI/3, bj_PI/3)
set m.owner = GetOwningPlayer(m.source)
set m.target = u
call ReffineCorruption.launch(m)// Launch is implemented via module MissileStruct
endif
endif
endif
call GroupRemoveUnit(data.g,u)
call SetTimerData(t,data)
call TimerStart(t,.075,false,function Handler)
else
call data.destroy()
call ReleaseTimer(t)
endif
set t = null
//set p = null
set u = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local Ref data = Ref.create()
local real x
local real y
set data.c = GetTriggerUnit()
set CASTER = data.c
set x = GetUnitX(CASTER)
set y = GetUnitY(CASTER)
set data.damage= GetUnitAbilityLevel(CASTER,SPELL_ID)*4.*(GetHeroAgi(CASTER,true)+ GetHeroStr(CASTER,true)+GetHeroInt(CASTER,true))
call GroupEnumUnitsInRange(data.g,x,y,1800.,Filter(function FilterGroup))
call SetTimerData(t,data)
call TimerStart(t,.01,false, function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope CCExplo initializer OnInit
globals
trigger CCEXPLOSION
private constant integer SPELL_ID = 'A0PY'
endglobals
private function OnSpell takes nothing returns boolean
local integer o
local unit u = GetTriggerUnit()
local real ar
local real x
local real y
local real a
local integer id = GetPlayerId(GetOwningPlayer(u))
local player p
local unit c
if GetUnitAbilityLevel(u,SPELL_ID) == 1 and CorruptAmount[id] >= 100 then
set x = GetUnitX(LC[id+1])
set y = GetUnitY(LC[id+1])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special-2.mdx",LC[id+1],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CorpseExplodeFire.mdx",LC[id+1],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CorpseExplodeFire.mdx",LC[id+1],"head"))
call DestroyEffect(AddSpecialEffect("BigBloodEX-NoSplat-NoGutz.mdx",x,y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Explosion.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Requiem.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Blast.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\OrbofCorruption.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Discharge Purple.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Call of Dread Purple.mdx",x,y))
//call SetHeroInt(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],GetHeroInt(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],false)+1,true)
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl",LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))],"origin"))
set p = Player(id)
if IsPlayerAlly(p,Player(10)) then
set o = 11
else
set o = 10
endif
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,((BS[1+id]+(GetPlayerName(p)+"|r"))+("|c02800000 |r|c02800005h|r|c02800009a|r|c0280000Es|r|c02800013 |r|c02800018s|r|c0280001Cu|r|c02800021c|r|c02800026c|r|c0280002Bu|r|c0280002Fm|r|c02800034b|r|c02800039e|r|c0280003Ed|r|c027F0042 |r|c027F0047t|r|c027F004Co|r|c027F0051 |r|c027F0055t|r|c027F005Ah|r|c027F005Fe|r|c027F0064 |r|c027F0068i|r|c027F006Dn|r|c027F0072e|r|c027F0077f|r|c027F007Bf|r|c027F0080a|r|c027F0077b|r|c027F006El|r|c027F0065e|r|c027F005B |r|c027F0052f|r|c027F0049o|r|c02800040r|r|c02800037c|r|c0280002Ee|r|c02800025s|r|c0280001B |r|c02800012o|r|c02800009f|r|c02800000 |r|c027F0009C|r|c027E0012o|r|c027D001Ar|r|c027B0023r|r|c027A002Cu|r|c02790035p|r|c0278003Dt|r|c02770046i|r|c0276004Fo|r|c02740058n|r|c02730060.|r|c02720069.|r|c02710072.|r")))
loop
exitwhen CorruptAmount[id] < 100
set CorruptAmount[id]= CorruptAmount[id] - 100
call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
set a = GetUnitFacing(LC[id+1])
set ar = BlzGetUnitArmor(LC[id+1])
//call KillUnit(LC[id+1])
set c = CreateUnit(Player(o),'u002',x,y,a)
call BlzSetUnitMaxHP(c,(BlzGetUnitMaxHP(LC[id+1])*5)+(BlzGetUnitMaxMana(LC[id+1])*5))
call SetWidgetLife(c,(BlzGetUnitMaxHP(LC[id+1])*5)+(BlzGetUnitMaxMana(LC[id+1])*5))
call BlzSetUnitArmor(c,ar)
call BlzSetUnitBaseDamage(c,(BlzGetUnitMaxHP(LC[id+1])/5)+(BlzGetUnitMaxMana(LC[id+1])/5),0)
endloop
endif
set c= null
set p = null
set u = null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set CCEXPLOSION = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CCEXPLOSION, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(CCEXPLOSION, Condition(function OnSpell))
call DisableTrigger(CCEXPLOSION)
endfunction
endscope
scope ExpurgationofPurity initializer OnInit
globals
private constant integer SPELL_ID = 'A0Q2'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0.
endglobals
native UnitAlive takes unit id returns boolean
private struct RoD
unit c
real x
real y
integer dur
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct RoD2
real x
real y
effect fx
unit c
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local integer id
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and not BlzIsUnitInvulnerable(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Void Arrow.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
if IsUnitType(u,UNIT_TYPE_HERO) then
if not IsUnitIllusion(u) then
set id = GetPlayerId(GetOwningPlayer(u))
set CorruptAmount[id]= CorruptAmount[id] + 1
call SetPlayerState(Player(id),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
endif
else
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
endif
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and IsUnitType(u,UNIT_TYPE_HERO) and not IsUnitIllusion(u) then
set id = GetPlayerId(GetOwningPlayer(u))
set CorruptAmount[id]= CorruptAmount[id] + 1
call SetPlayerState(Player(id),PLAYER_STATE_RESOURCE_FOOD_USED,CorruptAmount[id])
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Void Arrow.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebrand Shot Purple.mdx",u,"chest"))
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD2 data2 = GetTimerData(t)
set CASTER = data2.c
set DAMAGE = GetUnitAbilityLevel(data2.c,SPELL_ID)*(GetHeroStr(data2.c,true)+GetHeroAgi(data2.c,true)+GetHeroInt(data2.c,true))*2.
call GroupEnumUnitsInRange(GROUP,data2.x,data2.y,180.,Filter(function FilterActions))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Smash.mdx",data2.x,data2.y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Singularity I Purple.mdx",data2.x,data2.y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Soul Discharge Purple.mdx",data2.x,data2.y))
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD data = GetTimerData(t)
local timer t2
local RoD2 data2
local effect fx
if data.dur <=0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - 1
set data2=RoD2.create()
set data2.c = data.c
set data2.x = data.x+GetRandomReal(-300.,300.)
set data2.y = data.y+GetRandomReal(-300.,300.)
set data2.fx = AddSpecialEffect("war3mapImported\\Spell Marker TC.mdx",data2.x,data2.y)
call BlzSetSpecialEffectColorByPlayer(data2.fx, Player(3))
set t2= NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,1.,false,function Handler2)
//set fx = AddSpecialEffect("war3mapImported\\Kingdom Come.mdx",data2.x,data2.y)
//call BlzSetSpecialEffectScale(fx,1.5)
//call DestroyEffect(fx)
call TimerStart(t,.3,false,function Handler)
endif
set fx = null
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local RoD data = RoD.create()
local integer b = 0
local integer c
set data.c = GetTriggerUnit()
set c = CorruptAmount[GetPlayerId(GetOwningPlayer(data.c))]
if c >= 200 then
loop
exitwhen c < 200
set b = b + 1
set c = c-200
endloop
endif
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
set data.dur = 10 + GetUnitAbilityLevel(data.c,SPELL_ID) + b
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope Hailstorm initializer OnInit
globals
private constant integer SPELL_ID = 'A0S0'
integer array HailstormStacks
endglobals
native UnitAlive takes unit id returns boolean
private struct RoD
unit t
unit c
real x
real y
effect fx
effect fx2
integer dur
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
call DestroyEffect(this.fx2)
set this.fx2 = null
set this.fx = null
set this.t = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct RoD2
real x
real y
effect fx
unit c
method destroy takes nothing returns nothing
call DestroyEffect(this.fx)
set this.fx = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local integer id
if IsUnitEnemy(u,GetOwningPlayer(GLOBAL_CASTER)) and UnitAlive(u) and not IsUnitType(u,UNIT_TYPE_HERO) then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ZigguratFrostMissile\\ZigguratFrostMissile.mdl",u,"chest"))
call UnitDamageTargetEx(GLOBAL_CASTER,u,GLOBALDAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
set u = null
return false
endfunction
private function FilterUnits2 takes nothing returns boolean
return(UnitAlive(GetFilterUnit()) and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GLOBAL_CASTER)) and GetOwningPlayer(GetFilterUnit()) != Player(PLAYER_NEUTRAL_PASSIVE))
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD2 data2 = GetTimerData(t)
set GLOBAL_CASTER = data2.c
set GLOBALDAMAGE = (GetUnitAbilityLevel(data2.c,SPELL_ID)*(GetHeroInt(data2.c,true))*1.)*(1.+(.01*GetHeroLevel(data2.c)))
call GroupEnumUnitsInRange(GLOBALGROUP,data2.x,data2.y,150.,Filter(function FilterActions))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Smash.mdx",data2.x,data2.y))
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD data = GetTimerData(t)
local timer t2
local RoD2 data2
local effect fx
local integer i = 0
if data.dur <=0 then
set HailstormStacks[GetUnitUserData(data.t)] = HailstormStacks[GetUnitUserData(data.t)] - 1
if HailstormStacks[GetUnitUserData(data.t)] == 0 then
call UnitRemoveAbility(data.t,'A0S3')
endif
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - 1
set data.x = GetUnitX(data.t)
set data.y = GetUnitY(data.t)
loop
exitwhen i == 15
set data2=RoD2.create()
set data2.c = data.c
set data2.x = data.x+GetRandomReal(-550.,550.)
set data2.y = data.y+GetRandomReal(-550.,550.)
set data2.fx = AddSpecialEffect("war3mapImported\\Blizzard II.mdx",data2.x,data2.y)
//set data2.fx = AddSpecialEffect("war3mapImported\\FrostBoltRainV.mdx",data2.x,data2.y)
//call BlzSetSpecialEffectScale(data2.fx, 1.5)
set t2= NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,.8,false,function Handler2)
set i = i + 1
endloop
call TimerStart(t,.5,false,function Handler)
endif
set fx = null
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local RoD data = RoD.create()
set data.c = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
if data.t == null then
set GLOBAL_CASTER = data.c
set data.t = ZEE(null,GetSpellTargetX(),GetSpellTargetY(),3000.,(Condition(function FilterUnits2)))
endif
if data.t == null then
set data.t = data.c
endif
set HailstormStacks[GetUnitUserData(data.t)] = HailstormStacks[GetUnitUserData(data.t)] + 1
if HailstormStacks[GetUnitUserData(data.t)] == 1 then
call UnitAddAbility(data.t,'A0S3')
endif
set data.fx = AddSpecialEffectTarget("war3mapImported\\FrozenShell.MDX",data.t,"chest")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Emi-3.mdx",data.t,"chest")
set data.x = GetUnitX(data.t)
set data.y = GetUnitY(data.t)
set data.dur = 3 + GetUnitAbilityLevel(data.c,SPELL_ID)
call AddUnitBonusTimed(data.t,BONUS_ARMOR,10*GetUnitAbilityLevel(data.c,SPELL_ID),data.dur*.5)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope EnchantWeapons initializer OnInit
globals
private constant integer SPELL_ID = 'A0NL'
private location LOC = Location(0,0)
endglobals
private struct EW
unit caster
unit target
integer level
integer damageincrease
real casterx
real castery
real targetx
real targety
real casterz
real targetz
real lightningx1
real lightningy1
real lightningx2
real lightningy2
real lightningz1
real lightningz2
real a
lightning ll
method destroy takes nothing returns nothing
call DestroyLightning(this.ll)
set this.ll = null
set this.caster = null
set this.target = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local EW data = GetTimerData(t)
local effect fx
if data.caster == null or data.target == null or IsUnitHidden(data.target) or IsUnitHidden(data.caster) then
call ReleaseTimer(t)
call data.destroy()
else
if (data.lightningx2<= data.targetx +25 and data.lightningx2>= data.targetx-25) and (data.lightningy2<= data.targety +25 and data.lightningy2>= data.targety-25) then
call BlzSetUnitBaseDamage(data.target,BlzGetUnitBaseDamage(data.target,0)+data.damageincrease,0)
call BlzSetUnitBaseDamage(data.caster,BlzGetUnitBaseDamage(data.caster,0)+data.damageincrease,0)
set fx = AddSpecialEffectTarget("war3mapImported\\Culling Slash II Silver.mdx",data.caster,"chest")
call BlzSetSpecialEffectScale(fx,.8)
call DestroyEffect(fx)
set fx = AddSpecialEffectTarget("war3mapImported\\Culling Slash II Silver.mdx",data.target,"chest")
call BlzSetSpecialEffectScale(fx,.8)
call DestroyEffect(fx)
call ReleaseTimer(t)
call data.destroy()
else
set data.casterx = GetUnitX(data.caster)
set data.castery = GetUnitY(data.caster)
set data.targetx = GetUnitX(data.target)
set data.targety = GetUnitY(data.target)
set data.lightningx1 = data.casterx
set data.lightningy1 = data.castery
call MoveLocation(LOC,data.casterx,data.castery)
set data.casterz = GetLocationZ(LOC) + GetUnitFlyHeight(data.caster) + 25.
call MoveLocation(LOC,data.targetx,data.targety)
set data.targetz = GetLocationZ(LOC) + GetUnitFlyHeight(data.target) + 25.
set data.lightningz1=data.casterz
set data.lightningz2=data.targetz
set data.a = bj_RADTODEG * Atan2(data.targety - data.lightningy2, data.targetx - data.lightningx2)
set data.lightningx2 = data.lightningx2 + 48. * Cos(data.a * bj_DEGTORAD)
set data.lightningy2 = data.lightningy2 + 48. * Sin(data.a * bj_DEGTORAD)
call MoveLightningEx(data.ll,true,data.lightningx1,data.lightningy1,data.lightningz1,data.lightningx2,data.lightningy2,data.lightningz2)
call SetTimerData(t,data)
call TimerStart(t,.03125,false, function Handler)
endif
endif
set t = null
set fx = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local EW data = EW.create()
set data.caster = GetTriggerUnit()
set data.target = GetSpellTargetUnit()
set data.level = GetUnitAbilityLevel(data.caster,SPELL_ID)
set data.damageincrease = (20 * data.level) + (BlzGetUnitBaseDamage(data.target,0)/20)
if data.damageincrease < (20 * data.level) + (BlzGetUnitBaseDamage(data.caster,0)/20) then
set data.damageincrease = (20 * data.level) + (BlzGetUnitBaseDamage(data.caster,0)/20)
endif
if GetUnitAbilityLevel(data.target,'A0CJ') != 0 then
set data.damageincrease = (20 * data.level) + (BlzGetUnitBaseDamage(data.caster,0)/20)
endif
set data.casterx = GetUnitX(data.caster)
set data.castery = GetUnitY(data.caster)
set data.targetx = GetUnitX(data.target)
set data.targety = GetUnitY(data.target)
set data.lightningx1 = data.casterx
set data.lightningy1 = data.castery
set data.lightningx2 = data.lightningx1
set data.lightningy2 = data.lightningy1
call MoveLocation(LOC,data.casterx,data.castery)
set data.casterz = GetLocationZ(LOC) + GetUnitFlyHeight(data.caster) + 25.
call MoveLocation(LOC,data.targetx,data.targety)
set data.targetz = GetLocationZ(LOC) + GetUnitFlyHeight(data.target) + 25.
set data.lightningz1=data.casterz
set data.lightningz2=data.targetz
set data.ll = AddLightningEx("WHCH",true,data.lightningx1,data.lightningy1,data.lightningz1,data.lightningx2,data.lightningy2,data.lightningz2)
set data.a = bj_RADTODEG * Atan2(data.targety - data.castery, data.targetx - data.casterx)
set data.lightningx2 = data.lightningx2 + 8. * Cos(data.a * bj_DEGTORAD)
set data.lightningy2 = data.lightningy2 + 8. * Sin(data.a * bj_DEGTORAD)
call MoveLightningEx(data.ll,true,data.lightningx1,data.lightningy1,data.lightningz1,data.lightningx2,data.lightningy2,data.lightningz2)
call SetTimerData(t,data)
call TimerStart(t,.03125,false, function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope MuseCDR initializer OnInit
globals
trigger MUSEONHIT
private constant integer SPELL_ID = 'A0BE'
private constant integer SPELL_ID2 = 'A0C3'
private constant integer SPELL_ID3 = 'A0NL'
private constant integer SPELL_ID4 = 'A089'
private constant integer SPELL_ID5 = 'A0AR'
endglobals
native UnitAlive takes unit id returns boolean
private function Conditions takes nothing returns boolean
local unit c = GetEventDamageSource()
local unit t = GetTriggerUnit()
local real cooldown
if (GetUnitAbilityLevel(c,SPELL_ID) != 0 or GetUnitAbilityLevel(c,SPELL_ID5) != 0) and t != c and IsUnitEnemy(c,GetOwningPlayer(t)) and Damage_IsAttack() and UnitAlive(c) and GetUnitAbilityLevel(t,'B06O') ==1 then
call UnitRemoveAbility(t,'B06O')
if GetEventDamage() > 0 then
if GetUnitAbilityLevel(c,SPELL_ID) != 0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID )
if cooldown > 0 then
if cooldown - .25 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID , cooldown - .2)
endif
endif
if GetUnitAbilityLevel(c, SPELL_ID2 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID2 )
if cooldown > 0 then
if cooldown - .25 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID2 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID2 , cooldown - .2)
endif
endif
endif
if GetUnitAbilityLevel(c, SPELL_ID3 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID3 )
if cooldown > 0 then
if cooldown - .25 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID3 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID3 , cooldown - .2)
endif
endif
endif
if GetUnitAbilityLevel(c, SPELL_ID4 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID4 )
if cooldown > 0 then
if cooldown - .25 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID4 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID4 , cooldown - .2)
endif
endif
endif
endif
if GetUnitAbilityLevel(c,SPELL_ID5) != 0 and GetRandomInt(1,100) <= 10 then
if GetUnitAbilityLevel(t,'A0EQ') != 1 then
call UnitAddAbility(t,'A0EQ')
endif
call AddUnitBonus(t,BONUS_ARMOR,-1.*GetUnitAbilityLevel(c,SPELL_ID5) )
endif
endif
endif
set c = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
set MUSEONHIT=CreateTrigger()
call TriggerAddCondition(MUSEONHIT,Condition(function Conditions))
call MOE(II,(MUSEONHIT))
call DisableTrigger(MUSEONHIT)
endfunction
endscope
scope CalltoArmsTaunt initializer OnInit
globals
trigger CTATAUNT
endglobals
private function Conditions takes nothing returns boolean
local unit u = GetAttacker()
local unit a = GetTriggerUnit()
if GetUnitTypeId(u) == 'h01J' or GetUnitTypeId(u) == 'h01K' or GetUnitTypeId(u) == 'h01L' or GetUnitTypeId(u) == 'h01M' or GetUnitTypeId(u) == 'h01N' or GetUnitTypeId(u) == 'h01O'or GetUnitTypeId(u) == 'h01X' or GetUnitTypeId(u) == 'h01Z' or GetUnitTypeId(u) == 'h01Y' then
if UnitAlive(LC[(1+GetPlayerId(GetOwningPlayer(u)))]) then
call IssueTargetOrder(a,"attack",LC[(1+GetPlayerId(GetOwningPlayer(u)))])
if GetUnitAbilityLevel(a,'Bbsk') != 1 and GetUnitAbilityLevel(a,'B02M') != 1 then
call SetUnitPathing(a,true)
endif
endif
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set CTATAUNT= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CTATAUNT,EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition(CTATAUNT,Condition(function Conditions))
call DisableTrigger(CTATAUNT)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope CalltoArms initializer OnInit
globals
private constant integer SPELL_ID = 'A0JI'
endglobals
private function Actions takes nothing returns nothing
local integer unitid
local integer i
local unit c = GetTriggerUnit()
local unit u
local real x
local real y
local real a = GetRandomReal(0.,360.)
local real d = GetRandomReal(200.,300.)
local integer id = GetPlayerId(GetOwningPlayer(c))
set x = GetUnitX(c) + d * Cos(a * bj_DEGTORAD)
set y = GetUnitY(c) + d * Sin(a * bj_DEGTORAD)
set i = GetRandomInt(0,2)
if i == 0 then
if IsFallenOne[GetUnitUserData(LC[1+id])] or IsGrakeTank[GetUnitUserData(LC[1+id])] then
if IsFallenOne[GetUnitUserData(LC[1+id])] then
set unitid = 'h01M'
endif
if IsGrakeTank[GetUnitUserData(LC[1+id])] then
set unitid = 'h01X'
endif
else
set unitid = 'h01K'
endif
endif
if i == 1 then
if IsFallenOne[GetUnitUserData(LC[1+id])] or IsGrakeTank[GetUnitUserData(LC[1+id])] then
if IsFallenOne[GetUnitUserData(LC[1+id])] then
set unitid = 'h01O'
endif
if IsGrakeTank[GetUnitUserData(LC[1+id])] then
set unitid = 'h01Z'
endif
else
set unitid = 'h01J'
endif
endif
if i == 2 then
if IsFallenOne[GetUnitUserData(LC[1+id])] or IsGrakeTank[GetUnitUserData(LC[1+id])] then
if IsFallenOne[GetUnitUserData(LC[1+id])] then
set unitid = 'h01N'
endif
if IsGrakeTank[GetUnitUserData(LC[1+id])] then
set unitid = 'h01Y'
endif
else
set unitid = 'h01L'
endif
endif
set u = CreateUnit(Player(id),unitid,x,y,GetUnitFacing(c))
call BlzSetUnitBaseDamage(u,R2I((BlzGetUnitMaxHP(c)*.04))+R2I((BlzGetUnitMaxHP(c)*.0008*GetHeroLevel(c)))+(GetHeroStr(c,true))*2+R2I(BlzGetUnitArmor(c)*.75*GetHeroLevel(c))-30,0)
call UnitApplyTimedLife(u,'BTLF',20.+(GetHeroLevel(c)*.6)+(BlzGetUnitArmor(c)*.15))
if IsFallenOne[GetUnitUserData(LC[1+id])] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Doomsday.mdx",x,y))
else
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl",x,y))
endif
//call IssueTargetOrderById(u,851971,c)
call SetUnitVertexColor(u,255,255,255,130)
call SetUnitPathing(u,true)
set c = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EnforceTaxes initializer OnInit
globals
private constant integer SPELL_ID = 'A0JB'
trigger ENFORCETAXES
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local player p = GetOwningPlayer(u)
call UnitRemoveAbility(t,'B05A')
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+(GetHeroLevel(u)*7))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl",t,"origin"))
set p = null
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and GetUnitAbilityLevel(GetTriggerUnit(),'B05A') ==1 and GetEventDamage() > 0 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set ENFORCETAXES=CreateTrigger()
call TriggerAddCondition(ENFORCETAXES,Condition(function Conditions))
call MOE(II,(ENFORCETAXES))
call DisableTrigger(ENFORCETAXES)
endfunction
endscope
scope EnforcerStrengthBuff initializer OnInit
globals
private constant integer SPELL_ID = 'A0C5'
endglobals
private function DP1 takes nothing returns nothing
local unit u = GetTriggerUnit()
call AddUnitBonusTimed(u,BONUS_STRENGTH, (GetUnitAbilityLevel(u,'A0C5')*20)+R2I(GetHeroStr(u,true)*.25),35.)
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function DP1)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
unit array ShatteredVeil
endglobals
scope PiercetheVeil initializer OnInit
globals
private constant integer SPELL_ID = 'A0FI'
private constant integer DEBUFF_ID = 'A0FP'
private constant string SFX_AOE = "war3mapImported\\DarkChakraExplosion.mdx"
private group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0
endglobals
private struct PV
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local PV data = GetTimerData(t)
call UnitRemoveAbility(data.u,DEBUFF_ID)
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local timer t
local PV data
local unit u
if UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitVisible(GetFilterUnit(),GetOwningPlayer(CASTER)) and GetUnitTypeId(GetFilterUnit()) != 'h00S' then
set data = PV.create()
set data.u = GetFilterUnit()
set u = CreateUnit(GetOwningPlayer(CASTER),'h018',0.,0.,0.)
call SetUnitAbilityLevel(u,'A0FF',GetUnitAbilityLevel(CASTER,SPELL_ID))
call UnitApplyTimedLife(u,'BTLF',1.)
call IssueTargetOrderById(u,852274,data.u)
set ShatteredVeil[GetUnitUserData(u)] = data.u
call UnitAddAbility(data.u,DEBUFF_ID)
call SetUnitAbilityLevel(data.u,DEBUFF_ID,GetUnitAbilityLevel(CASTER,SPELL_ID))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\WarpDarkTargetPurple.mdx",data.u,"origin"))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,10.,false,function Handler)
endif
set u = null
set t = null
return false
endfunction
private function Actions takes nothing returns nothing
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP,GetSpellTargetX(),GetSpellTargetY(),400.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect(SFX_AOE,GetSpellTargetX(),GetSpellTargetY()))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkForce.mdx",GetSpellTargetX(),GetSpellTargetY()))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ShatteredVeil2 initializer OnInit
globals
trigger SHATTEREDKILL
endglobals
private function Actions takes nothing returns nothing
call ModifyHeroStat(1,LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],0,2)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PeterifyVer.2.mdx",LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PeterifyVer.2.mdx",GetTriggerUnit(),"chest"))
call UnitRemoveAbility(GetTriggerUnit(),'A0FP')
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A0FP') != 0 and GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],'A0FI') != 0 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set SHATTEREDKILL=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(SHATTEREDKILL, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(SHATTEREDKILL,Condition(function Conditions))
call DisableTrigger(SHATTEREDKILL)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ShatteredVeil3 initializer OnInit
globals
trigger SHATTEREDSUMMON
endglobals
private function Actions takes nothing returns nothing
local unit u = GetSummonedUnit()
call UnitAddAbility(u,'Aloc')
call UnitAddAbility(u,'A05X')
call SetUnitAcquireRange(u,3000.)
//call IssueTargetOrder(u,"attack",ShatteredVeil[GetUnitUserData(GetSummoningUnit())])
call IssueTargetOrderById(u,851983,ShatteredVeil[GetUnitUserData(GetSummoningUnit())])
if RANDOMWAVEON then
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(ShatteredVeil[GetUnitUserData(GetSummoningUnit())],0),0)
call BlzSetUnitAttackCooldown(u,BlzGetUnitAttackCooldown(ShatteredVeil[GetUnitUserData(GetSummoningUnit())],0),0)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(ShatteredVeil[GetUnitUserData(GetSummoningUnit())],1),1)
call BlzSetUnitAttackCooldown(u,BlzGetUnitAttackCooldown(ShatteredVeil[GetUnitUserData(GetSummoningUnit())],1),1)
call SetUnitMoveSpeed(u,GetUnitMoveSpeed(ShatteredVeil[GetUnitUserData(GetSummoningUnit())]))
call UnitRemoveAbility(u,'A0EG')
endif
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitTypeId(GetSummoningUnit())=='h018' then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set SHATTEREDSUMMON=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(SHATTEREDSUMMON, EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(SHATTEREDSUMMON,Condition(function Conditions))
call DisableTrigger(SHATTEREDSUMMON)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AetherStacks initializer OnInit
globals
trigger AETHERSTACKS
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'U000' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|cFF09F3F7A|r|cFF0AEBF5e|r|cFF0CE3F4t|r|cFF0DDAF2h|r|cFF0FD2F1e|r|cFF10CAEFr|r|cFF12C2ED |r|cFF13B9ECS|r|cFF15B1EAt|r|cFF16A9E8a|r|cFF18A1E7c|r|cFF1998E5k|r|cFF1B90E4s|r|cFF1C88E2:|r "+ I2S(CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set AETHERSTACKS = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( AETHERSTACKS, Player(pid), "-as", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition(AETHERSTACKS, Condition(function Conditions) )
call DisableTrigger(AETHERSTACKS)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AetherShot initializer OnInit
globals
trigger AETHERONHIT
private constant integer ABIL_ID = 'A0EN'
private constant integer ABIL_ID2 = 'A0EO'
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit d = GetTriggerUnit()
local effect fx
local real m
local real hp
local real mhp
local real cm
if (GetUnitAbilityLevel(u,ABIL_ID)>0 or GetUnitAbilityLevel(u,ABIL_ID2)>0) and d != u and BI[NI] != DAMAGE_TYPE_LIGHTNING and GetEventDamage() > 0 then
set u = GetEventDamageSource()
if(BI[NI])==(LN)then
set hp = GetWidgetLife(u)
set mhp = GetUnitState(u,UNIT_STATE_MAX_LIFE)*1.
set m = GetUnitState(u,UNIT_STATE_MAX_MANA)
set cm = GetUnitState(u,UNIT_STATE_MANA)
//if cm <= (m*.5) then
//set m = m *.02
//else
//set m = m *.01
//endif
set m = ((m-cm)*.035)
set fx =AddSpecialEffectTarget("war3mapImported\\Heal Blue.mdx",u,"origin")
call BlzSetSpecialEffectScale(fx,.9)
call DestroyEffect(fx)
call SetUnitState(u,UNIT_STATE_MANA,cm-(cm*.03))
set cm = GetUnitState(u,UNIT_STATE_MANA)
call SetUnitState(u,UNIT_STATE_MANA,cm+m)
set m = cm*.05
//set m = ((1.+(.5*GetHeroLevel(u)))*m*(1.-(hp/mhp)))+((1.+(.5*GetHeroLevel(u)))*m)
set m = ((m)+((1.-hp/mhp)*m))*(1.+(.25*GetHeroLevel(u)))
call UnitDamageTargetEx(u,d,m,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"chest"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"head"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"hand,left"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"hand,right"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"foot,light"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl",d,"foot,right"))
endif
endif
set fx = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set AETHERONHIT = CreateTrigger()
call MOE(II, (AETHERONHIT))
call TriggerAddCondition(AETHERONHIT, Condition(function Actions))
call DisableTrigger(AETHERONHIT)
endfunction
endscope
//TESH.scrollpos=8
//TESH.alwaysfold=0
scope ManaBolt initializer OnInit
globals
private constant integer SPELL_ID = 'A0EW'
endglobals
private function Actions takes nothing returns nothing
local unit OIX=LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
local unit EXX
local real OAX=GetUnitX(OIX)
local real ONX=GetUnitY(OIX)
local real OJX=.0
local real OKX=.0
local real OLX=.0
local real lvl = GetUnitAbilityLevel(OIX,SPELL_ID) * 1.
local real mana = GetUnitState(OIX,UNIT_STATE_MANA)
local real life = GetWidgetLife(OIX)
local real maxhp = GetUnitState(OIX,UNIT_STATE_MAX_LIFE)
local integer OMX=0
set EXX=GetSpellTargetUnit()
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(GetUnitFacing(OIX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(OIX)
call V9X(OMX,"war3mapImported\\BluefireBolt.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
//set G3V[OMX]=((GetUnitAbilityLevel(OIX,SPELL_ID)*GetUnitState(OIX,UNIT_STATE_MANA)*.25)+((1.-(GetWidgetLife(OIX)/GetUnitState(OIX,UNIT_STATE_MAX_LIFE)))*(GetUnitAbilityLevel(OIX,SPELL_ID)*GetUnitState(OIX,UNIT_STATE_MANA)*.25)))+((1.+(.04*GetHeroLevel(OIX)))*GetUnitAbilityLevel(OIX,SPELL_ID)*GetUnitState(OIX,UNIT_STATE_MANA)*.25)
//set G3V[OMX]=((lvl * mana * .25)+((1.-life/maxhp)*(lvl * mana * .25))))+(((lvl * mana * .25)+((1.-life/maxhp)*(lvl * mana * .25))))*(1.+(.04*GetHeroLevel(OIX))))
//set G3V[OMX]=((lvl*mana*.25)+((1.-life/maxhp)*lvl*mana*.25))+(((lvl*mana*.25)+((1.-life/maxhp)*lvl*mana*.25))*.04*GetHeroLevel(OIX))
set G3V[OMX]=((lvl*mana*.25)+((1.-life/maxhp)*lvl*mana*.25))*(1.+(.075*GetHeroLevel(OIX)))
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,1000.)
set OIX=null
set EXX=null
endfunction
private function OnSpell takes nothing returns boolean
if GetSpellAbilityId() == SPELL_ID or GetSpellAbilityId() == 'A0F9' then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=32
//TESH.alwaysfold=0
globals
integer array AETHER_BUFF_LVL
endglobals
scope AetherInfusion initializer OnInit
globals
private constant integer SPELL_ID = 'A0ES'
private constant integer SPELL_ID2 = 'A0ER'
endglobals
private struct AT
unit u
integer lvl
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AT data = GetTimerData(t)
set AETHER_BUFF_LVL[GetUnitUserData(data.u)] = AETHER_BUFF_LVL[GetUnitUserData(data.u)] - data.lvl
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local AT data = AT.create()
local unit cast = LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
local integer i
local unit d = CreateUnit(GetOwningPlayer(cast),'h007',GetUnitX(cast),GetUnitY(cast),0.)
local real life
local real maxhp
set data.u = GetSpellTargetUnit()
set data.lvl = GetUnitAbilityLevel(cast,SPELL_ID)
set life = GetUnitState(data.u,UNIT_STATE_MANA)
set maxhp = GetUnitState(data.u,UNIT_STATE_MAX_MANA)
call SetUnitState(data.u,UNIT_STATE_MANA,life+((maxhp-life)*(.1+.025*data.lvl)))
if AETHER_BUFF_LVL[GetUnitUserData(data.u)] == null then
set AETHER_BUFF_LVL[GetUnitUserData(data.u)] = 0
endif
set i = AETHER_BUFF_LVL[GetUnitUserData(data.u)]
call UnitAddAbility(d,SPELL_ID2)
call UnitApplyTimedLife(d,'BTLF',1.)
if i + data.lvl >= 40 then
call SetUnitAbilityLevel(d,SPELL_ID2,i+data.lvl)
else
call SetUnitAbilityLevel(d,SPELL_ID2,i+data.lvl)
endif
call IssueTargetOrder(d,"bloodlust",data.u)
set AETHER_BUFF_LVL[GetUnitUserData(data.u)] = AETHER_BUFF_LVL[GetUnitUserData(data.u)] + data.lvl
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CharmTarget1.mdx",data.u,"overhead"))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,60.,false,function Handler)
set cast = null
set d = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=12
//TESH.alwaysfold=0
scope AetherFlare initializer OnInit
globals
private constant integer SPELL_ID = 'A0EX'
private constant string SFX_AOE = "war3mapImported\\LightningNova.mdx"
private constant string SFX_LASER = "war3mapImported\\LaserStrikeSingle.mdx"
private group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0
endglobals
private struct AF
unit u
real x
real y
real time
real dmg
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
if (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) or GetFilterUnit()==CASTER then
if GetRandomInt(1,5) == 1 then
call DestroyEffect(AddSpecialEffect(SFX_LASER,GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit())))
endif
if GetFilterUnit() == CASTER then
if GetWidgetLife(CASTER)-DAMAGE <= 1 then
call SetWidgetLife(CASTER,1)
else
call SetWidgetLife(CASTER,GetWidgetLife(CASTER)-DAMAGE)
endif
else
call UnitDamageTargetEx(CASTER,GetFilterUnit(),DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
endif
return false
endfunction
private function FilterGroup takes nothing returns boolean
return (UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)) or GetFilterUnit()==CASTER
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local AF data = GetTimerData(t)
local real distance = GetRandomReal(0.,260.)
local real angle = GetRandomReal(0.,360.)
local integer count
// call BJDebugMsg("Time: " +R2S(data.time))
if data.time == 0. then
call data.destroy()
call ReleaseTimer(t)
// call BJDebugMsg("Destroyed")
else
//if GetRandomReal(0.,1.) <= .7 then
call DestroyEffect(AddSpecialEffect(SFX_AOE,data.x,data.y))
//endif
if GetRandomReal(0.,1.) <= .7 then
call DestroyEffect(AddSpecialEffect(SFX_LASER,data.x + distance * Cos(angle * bj_DEGTORAD),data.y + distance * Sin(angle * bj_DEGTORAD)))
endif
set CASTER = data.u
call GroupEnumUnitsInRange(GROUP,data.x,data.y,275.,Filter(function FilterGroup))
set count = CountUnitsInGroup(GROUP)
call GroupClear(GROUP)
//call BJDebugMsg(I2S(count))
if count != 0 then
set DAMAGE = data.dmg/count
else
set DAMAGE = data.dmg
endif
//call BJDebugMsg(R2S(DAMAGE))
call GroupEnumUnitsInRange(GROUP,data.x,data.y,275.,Filter(function FilterActions))
set data.time = data.time - .2
call SetTimerData(t,data)
call TimerStart(t,.2,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local AF data = AF.create()
local timer t = NewTimer()
set data.u = LC[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
call DestroyEffect(AddSpecialEffect(SFX_AOE,data.x,data.y))
set data.time = 5.
set data.dmg = ((1.+(.075 * GetHeroLevel(data.u)))*(GetUnitAbilityLevel(data.u,SPELL_ID)*GetUnitState(data.u,UNIT_STATE_MANA)*1.5) + ((GetUnitAbilityLevel(data.u,SPELL_ID)*GetUnitState(data.u,UNIT_STATE_MANA)*1.5)*(1.-(GetWidgetLife(data.u)/GetUnitState(data.u,UNIT_STATE_MAX_LIFE)))))/25.
call SetTimerData(t,data)
call TimerStart(t,.1,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=9
//TESH.alwaysfold=0
scope AetherealActive initializer OnInit
globals
private constant integer CAST_ID = 'A0EY'
private constant integer SPELL_ID = 'A0EK'
private constant integer SPELL_ID2 = 'A0EN'
private constant integer SPELL_ID3 = 'A0EO'
private constant integer SPELL_ID4 = 'A0EP'
private constant string SFX_PATH = "war3mapImported\\AncientExplodeBlue.mdx"
endglobals
private function OnSpell takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = 0
call DestroyEffect(AddSpecialEffect(SFX_PATH,GetUnitX(u),GetUnitY(u)))
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MAX_MANA))
if CORE_LVL[GetUnitUserData(u)] == null then
set CORE_LVL[GetUnitUserData(u)] = 0
endif
if CORE_LVL[GetUnitUserData(u)] < 100 and GetWidgetLife(u) <= (GetUnitState(u,UNIT_STATE_MAX_LIFE)*.3) then
if CORE_LVL[GetUnitUserData(u)] + ((GetUnitAbilityLevel(u,CAST_ID)*9)+9) >= 100 then
set i = 100 - CORE_LVL[GetUnitUserData(u)]
loop
exitwhen i == 0
call AddUnitBonus(u, BONUS_MANA,20*(1+.02*GetHeroLevel(u)))
set i = i - 1
endloop
set CORE_LVL[GetUnitUserData(u)] = 100
call UnitRemoveAbility(u,SPELL_ID2)
call UnitAddAbility(u,SPELL_ID3)
call UnitAddAbility(u,SPELL_ID4)
else
set i = ((GetUnitAbilityLevel(u,CAST_ID)*9)+9)
loop
exitwhen i == 0
call AddUnitBonus(u, BONUS_MANA,25*(1+.04*GetHeroLevel(u)))
set i = i - 1
endloop
set CORE_LVL[GetUnitUserData(u)] = CORE_LVL[GetUnitUserData(u)] + ((GetUnitAbilityLevel(u,CAST_ID)*9)+9)
endif
endif
set u = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(CAST_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=842
//TESH.alwaysfold=0
scope DischargeAether initializer InitTrig_Discharge_Aether
globals
real array DE_AOE
real array DE_BaseVelocity
real array DE_CurrentDeathTimer
real array DE_CurrentDuration
effect array DE_CurrentEffect
real array DE_CurrentShardDelay
real array DE_CurrentZ
real array DE_Duration
group DE_GravitatedShard = CreateGroup()
real array DE_HealthDamage
integer DE_LastNode
real array DE_ManaDamage
real DE_MapMaxX
real DE_MapMaxY
real DE_MapMinX
real DE_MapMinY
real array DE_Mass
integer array DE_NextNode
integer DE_NodeNumber
unit array DE_OriginalCaster
unit array DE_Portal
real array DE_PortalHeight
real array DE_PortalX
real array DE_PortalY
real array DE_PortalZ
integer array DE_PrevNode
real array DE_Radius
integer array DE_RecycleNodes
integer DE_RecycleableNodes
real array DE_ShardAOE
real array DE_ShardScale
real array DE_SpawnRate
integer DE_SpellCounter
integer array DE_StageID
group DE_TempGroup = CreateGroup()
unit array DE_Unit
real array DE_XVelocity
real array DE_YVelocity
location DE_ZLoc
real array DE_ZVelocity
endglobals
////////////////////////////////////////////////////////////////////
// DEVASTATION ENVOY V1.00 //
// //
// Author: Tank-Commander //
// Requires: Dummy.mdl //
// Purpose: Spam-cast spell //
// //
// Notes: //
// - Read the readme before you try modifying the config //
// - Use the "Helpful files" to help you import the spell //
// //
// Credits: //
// - (Dummy.mdl) Vexorian //
// //
// //
// If you have used this spell in your map, you are required //
// to give credits to Tank-Commander for the creation of it //
// If you take a snippet from this code for physics reasons //
// or whatever else, if possible, also give credit for its //
// source origin //
// //
// Importing: Remember to import Dummy.mdl and possibly the //
// object data when importing this spell (just the ability and //
// dummy unit) note that importing the dummy unit object should //
// be done AFTER importing Dummy.mdl, if not, then you will //
// need to set the model of the dummy to Dummy.mdl yourself, if //
// you would like to change what your dummy unit is you can, //
// but it will still need Dummy.mdl for this spell to work //
// If you have problems, make sure you read the readme first //
// and follow it to the best of your abilities before posting //
// comments //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// README: //
// Before modifying this spell a few things need to be //
// understood and read, this is one of those things, while //
// most modification can be considered intuitive, it still //
// helps to read through these intstructions, as they will //
// inform you about how to configure this spell to your //
// desire. //
//----------------------------------------------------------------//
// Initial importing: The variable creator trigger can be //
// imported first and if you have the correct settings (file, //
// preferences, General, automatically create unknown variables //
// checked, then when you pasta in the variable creator it //
// will automatically give you all the variables you need for //
// this spell //
//----------------------------------------------------------------//
// This configuration is ordered by category of use, and not //
// alphabetically, the ones you're most likely to want to //
// change, are earlier in the readme, the most essential being //
// first. These categories are: //
// //
// - Data Values: The most essential to change, otherwise the //
// spell will simply not function //
// //
// - ChronoKinetic: Fancy word for affecting the flow of time //
// Contains things like the duration of the //
// spell, the Timer speed and Shard Spawn rate //
// //
// - Power: Controls the aspects of the speed of the shards //
// based on the Mass, and Radius of the Portal //
// //
// - Damage: Controls the AOE and damage (health and mana) //
// values each individual Shard has //
// //
// - Aesthetics: Controls the Appearences of the ability - the //
// models used, the scales of those models and //
// so on //
// //
// - Damage Information: Contains things like weapontypes and //
// damage types, etc. //
// //
// - Other Attributes: Contains the world gravity, death timer //
// Height let and the celestial Gravitational //
// constant. //
//----------------------------------------------------------------//
// DATA VALUES //
//----------------------------------------------------------------//
// Dummy ID: This is the raw data of the dummy unit, to see //
// raw data in the object editor, press Ctrl + D, doing this //
// again will switch it back, if you want to change this dummy //
// unit, follow as displayed (use the first 4 characters in //
// the raw data and put them in ' markers) //
constant function DE_DummyID takes nothing returns integer
return 'u005'
endfunction
//----------------------------------------------------------------//
// Spell ID: This is done in the same manner as the Dummy ID //
// except that this time, you're doing it with ability raw //
// data, see the dummy unit if you do not know already how to //
// view raw data //
constant function DE_SpellID takes nothing returns integer
return 'A0EO'
endfunction
//----------------------------------------------------------------//
// CHRONOKINETIC //
//----------------------------------------------------------------//
// Timer Speed: The default for this is 0.03, it determines how //
// many times per second these triggers are ran, normally you //
// want to leave this at 0.03, but 0.04 and prehaps 0.05 //
// would be good options if you computer lags a bit. //
constant function DE_TimerSpeed takes nothing returns real
return 0.03
endfunction
//----------------------------------------------------------------//
// Duration Base: Determines how long each cast will last as a //
// base value - this is to help give better control when //
// scaling abilities while not having to change values for each //
// level, cutting out a lot of configuration time, the value is //
// in seconds (1.00 = 1second) //
constant function DE_DurationBase takes nothing returns real
return 3.
endfunction
//----------------------------------------------------------------//
// Duration Per Level: Deter,omes jpw ;pmg eacj casy wo;; as a //
// per level value - at level one this will be applied once, //
// twice at level two and so forth, it is added on to the base //
// value to come to the actual duration of the spell instance //
constant function DE_DurationPerLevel takes nothing returns real
return 0.0
endfunction
//----------------------------------------------------------------//
// Spawn Rate Base: A base value, this controls how many //
// seconds there are between each Shard being created, if this //
// is the same or lower (the sum total of the Base and Per //
// Level) is lower or equal to the timer speed, then one Shard //
// will be made every Timer Speed seconds (Time is a decimal //
// value, 0.5 is half a second) //
constant function DE_SpawnRateBase takes nothing returns real
return 0.03
endfunction
//----------------------------------------------------------------//
// Spawn Rate Per Level: The other part to the spawn rate //
// remember that it's a decimal value and the lower it is, the //
// faster Shards are created, so for this per level you'll //
// normally either want a negative value, or 0.00, though you //
// are not limited to such values //
constant function DE_SpawnRatePerLevel takes nothing returns real
return 0.0
endfunction
//----------------------------------------------------------------//
// POWER //
//----------------------------------------------------------------//
// Radius Base: This Base value determines how far out from the //
// center the shards are created, it also affects the gravity //
// strength of the Portal - the smaller the radius in relation //
// to it's Mass, the higher the gravitational effect and the //
// more volatile the Shards will be //
constant function DE_RadiusBase takes nothing returns real
return 100.00
endfunction
//----------------------------------------------------------------//
// Radius Per Level: The per level component to the Radius, //
// works the same all the other per level factors, giving this //
// a negative value will make your Portal smaller but more //
// volatile each level, and a positive value will make it large //
// and more stable //
constant function DE_RadiusPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mass Base: the Mass within the Portal, the main strength of //
// the gravitational pull, larger numbers will decrease //
// stability and increase the speed the Shards move, lowering //
// it makes it more stable, but unlike the Radius, it does not //
// affect the size of your Portal, works well for a baseline //
// when testing different levels of instability or stability //
// when getting your preferences for the spell //
constant function DE_MassBase takes nothing returns real
return 2000.00
endfunction
//----------------------------------------------------------------//
// Mass Per Level: the Per level component of the Mass can make //
// the spell more stable or volatile as it levels up without //
// changing it's size, remember that it is applied once at level //
// one, so the values 800 and 400 (the defaults) yeild 1200 //
// Mass at level one //
constant function DE_MassPerLevel takes nothing returns real
return 800.00
endfunction
//----------------------------------------------------------------//
// DAMAGE //
//----------------------------------------------------------------//
// Shard AOE Base: Determines the area of effect of the shards //
// 90 is melee range, 40 is directly on top, 20 is probably too //
// small an area to work and 400 to large, try different values //
// and see what you like //
constant function DE_ShardAOEBase takes nothing returns real
return 110.00
endfunction
//----------------------------------------------------------------//
// Shard AEO Per Level: Normally not used, but here for your //
// preferences, allows you to adjust the area of effect of your //
// shards as they level up, normally only making the area larger //
// makes logical sense, or not changing it at all //
constant function DE_ShardAOEPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Health Damage Base: This is the damage the spell deals to //
// all the units within the AOE on impact with a shard, you'll //
// want to make this fairly relative to the number of shards //
// you have, 75 shards with 100 damage each is 7500 damage in //
// one cast of the spell - that's a lot of potential damage in //
// a spell which has no cooldown by default, note that this //
// damage is not true damage - enemies will have their armour //
// applied and reduce this damage based on their armour type //
// vs your damage type //
function DE_HealthDamageBase takes unit u returns real
return ((GetUnitState(u,UNIT_STATE_MAX_MANA)+1500.)*10.) + (((GetUnitState(u,UNIT_STATE_MAX_MANA)+1500.)*10.)*(1.-(GetWidgetLife(u)/GetUnitState(u,UNIT_STATE_MAX_LIFE))))
endfunction
//----------------------------------------------------------------//
// Health Damage Per Level: For changing the amount of damage //
// you want to deal with each shard as you level up, normally //
// this is your main source of increased damage as the spell //
// levels up rather than the other factors, it makes little //
// sense to not have this as a positive value of some number //
// (25% of your total level 1 damage seems like a good number, //
// i.e. if your combined level one damage is 100, roughly 25 of //
// that damage should probably be coming from this per level //
// value //
constant function DE_HealthDamagePerLevel takes nothing returns real
return 0.
endfunction
//----------------------------------------------------------------//
// Mana Damage Base: Unlike Health damage the mana damage is //
// true damage - no matter how much armour they have, exactly //
// these values will be subtracted from their mana, normally //
// this is 0 as mana damage is mostly useless except vs certain //
// enemies, but it's still good to have the option to be able //
// to have it if you want //
constant function DE_ManaDamageBase takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mana Damage Per Level: Per level component of the normally //
// disused mana damage, not any real sense in having a below 0 //
// amount here, since it'll only make it weaker, like the //
// health damage I suggest this to be 25% of your total mana //
// damage of your level 1 version //
constant function DE_ManaDamagePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// AESTHETICS //
//----------------------------------------------------------------//
// Portal Model: This determines the model used for your //
// main portal, you want to use the model path and paste it //
// into the double quotes or " markers, if the path has only //
// single slashes (\) you'll need to changeb it to double slash //
// (\\) before you save, the spell will not work if you do not //
// do this (if you acidentally save with the single slash (\) //
// it will still save but you may find yourself having a //
// lingering Progress bar at full percentage, you can ignore it //
// for the most part, but if you have it, you probably haven't //
// entered this field correctly. Get the model paths from the //
// Object editor - find the model you want (the model, not the //
// unit, in the models list, select it and hit enter twice, //
// then select the path (will look similar to this default //
// value, and paste in it here) I suggest doing this with a //
// unit of no value (changing the model to get the model path) //
// and then reset the field afterwards to get the unit back to //
// normal //
constant function DE_PortalModel takes nothing returns string
return "war3mapImported\\EMPBomb.mdx"
endfunction
//----------------------------------------------------------------//
// Shard Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
constant function DE_ShardModel takes nothing returns string
return "war3mapImported\\Soulfire Missile Blue.mdx"
endfunction
//----------------------------------------------------------------//
// Impact Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
constant function DE_ImpactModel takes nothing returns string
return "war3mapImported\\PlasmaGrenade.mdx"
endfunction
//----------------------------------------------------------------//
// Attachment Point: This determines where on the unit the //
// model is placed, "origin", "chest", "head", "overhead" are //
// all good places to put the model, switch them around to see //
// which you prefer the most, "foot" and "hand" are less so as //
// they're offsetted from the center //
constant function DE_AttachmentPoint takes nothing returns string
return "origin"
endfunction
//----------------------------------------------------------------//
// Portal Height Base: This is how height the portal is off the //
// floor (it is added onto the terrain Z) you'll want it a good //
// distance off the ground (unles you want Shards to smack into //
// the ground while the spell is still going off, which is a //
// viable thing to do for this spell) but not so high as to //
// send the Shards halfway across the map, 400 is default //
constant function DE_PortalHeightBase takes nothing returns real
return 200.00
endfunction
//----------------------------------------------------------------//
// Portal Height Per Level: The per level for the height of the //
// portal, generally this'll be set at 0 as the spell changes //
// more on functionality, than on effectiveness depending on //
// height - so changing this value as it levels up will not //
// necessarily make it any stronger or weaker //
constant function DE_PortalHeightPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Portal Scale Base: this is the scale of the portal model //
// it's a decimal percentage (1.00 = 100%) as the largest part //
// of the spell you'll normally want this at, at least 100% //
// depending on the model, generally a good idea to try to line //
// it up with your portal radius as to get the best effect out //
// of it //
constant function DE_PortalScaleBase takes nothing returns real
return 5.00
endfunction
//----------------------------------------------------------------//
// Portal Scale Per Level: Used for changing the portal scale //
// as it levels up - good in combination with radius change per //
// level as to stay correct relatively //
constant function DE_PortalScalePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Shard Scale Base: Scales the Shards that are created by the //
// portal, normally you'll want them significantly smaller that //
// the portal 10% (0.10) is a good size, but for some models a //
// bit bigger might be good, be sure to play around with this //
// to get the size you want and looks best in your opinion //
constant function DE_ShardScaleBase takes nothing returns real
return .01
endfunction
//----------------------------------------------------------------//
// Shard Scale Per Level: Also for use with making the portal //
// seem relatively the same size as it levels up - or simply //
// to make them bigger to show increased AOE, Damage, more or //
// less to show anything about the spell being stronger as it //
// levels up and becomes more powerful //
constant function DE_ShardScalePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// DAMAGE INFORMATION //
//----------------------------------------------------------------//
// Damage Type: These determine the damagetypes, changing this //
// will modify the damage multiplyers vs certain enemies //
// the standard is DAMAGE_TYPE_MAGIC, note that this spell //
// automatically discludes magic immunes, so changing this //
// damage type will not make them start taking damage //
constant function DE_AttackType takes nothing returns attacktype
return ATTACK_TYPE_NORMAL
endfunction
//----------------------------------------------------------------//
// Attack Type: This is very much so basically the same as //
// Damage Type, generally you'll want this to match with it //
// as such the default is ATTACK_TYPE_MAGIC, though Damagetype //
// is a key factor for determining bonuses rather than this //
// but unlike weapontype, you cannot have null as a setting //
constant function DE_DamageType takes nothing returns damagetype
return DAMAGE_TYPE_FORCE
endfunction
//----------------------------------------------------------------//
// Weapon Type: This alters what kind of weapon type is used by //
// the spell, those without knowledge of weapontypes don't //
// worry, you're not missing much, this spell doesn't really //
// use it, hence the default of null, but if you want to use //
// them, no reason to not. //
constant function DE_WeaponType takes nothing returns weapontype
return null
endfunction
//----------------------------------------------------------------//
// OTHER ATTRIBUTES //
//----------------------------------------------------------------//
// Gravity: Determines the worldly gravity strength used to //
// pull the shards back to the ground after they have been //
// freed from the portal, having a lower gravity increases the //
// spread range, higher lowers it, the default is 1/8 of the //
// earthly gravity of 9.81, beng 1.22625 //
constant function DE_Gravity takes nothing returns real
return 1.22625
endfunction
//----------------------------------------------------------------//
// Gravitational Constant: This is the constant reprisented by //
// G in Celestial Physics and Mechanics. Normally it's //
// 6.67384 x 10^-11 N (m/kg)^2 but for Warcraft purposes I //
// cranked it up a bit, (x 10^11 to be exact) changing it may //
// yeild interesting results, but I take no responcibility if //
// you do something silly and crash the game by making it //
// really high //
constant function DE_GravitationalConstant takes nothing returns real
return 6.67384
endfunction
//----------------------------------------------------------------//
// Height Let: This is a small let so that projectiles nearly //
// touching the floor, will be treated as actually touching it //
// This is to prevent graphical errors because models cannot //
// sink into the floor by reducing their fly height //
// 5 is default 10 is probably the max you can reasonably give //
// this //
constant function DE_HeightLet takes nothing returns real
return 5.00
endfunction
//----------------------------------------------------------------//
// Death Timer: Determines how long after the death of a dummy //
// will it be removed from the game completely, this is so //
// death effects, if any can finish playing before the unit is //
// removed, 1.8 is default, 2 is probably excessive and in some //
// cases it's possible that 1 could be too little //
constant function DE_DeathTimer takes nothing returns real
return 1.80
endfunction
//----------------------------------------------------------------//
// You have now reached the end of the configuration, below are //
// the functions used to run the spell, beyond this point if //
// you find any constant values (indicated in Blue like the //
// other constants here if you have standard syntax highlighting //
// they're there for a reason and don't fiddle with them, to //
// actually make any modifications I hope you're an experienced //
// programmer, though do not hassle for help because I don't //
// take responcibility for other people's programming skills //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function used for finding the Z height of a location, since //
// it cannot be done with co-ordinates, a recycled location is //
// used constantly. //
////////////////////////////////////////////////////////////////////
function DE_GetZ takes real x, real y returns real
//Gets the location Z of the selected location
call MoveLocation(DE_ZLoc, x, y)
return GetLocationZ(DE_ZLoc)
endfunction
////////////////////////////////////////////////////////////////////
// Target filter function - passed units and players and checks //
// if the unit is allowed to be targetted by this spell //
////////////////////////////////////////////////////////////////////
function DE_TargetFilter takes unit u, player pl returns boolean
//Checks if the unit can be used as a target
if (IsUnitType(u, UNIT_TYPE_GROUND)) and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) and (not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)) and (IsUnitEnemy(u, pl)) and (GetUnitTypeId(u) != DE_DummyID()) and (not IsUnitType(u, UNIT_TYPE_DEAD)) then
return true
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for running the main parts of the spell, creates //
// new shards and destroys old portals, and does all the //
// recycling and damaging of targets, as well as shard movement //
////////////////////////////////////////////////////////////////////
function DE_Loop takes nothing returns nothing
//Sets up all the locals needed for this section
local integer TempInt = 0
local integer TempInt2 = 0
local integer TempNode = 0
local integer Node = 0
local real Angle
local real Angle2
local real Distance
local real x
local real x2
local real dx
local real y
local real y2
local real dy
local real z
local unit u
local player pl
loop
//Moves to the next node
set TempInt = TempInt + 1
exitwhen TempInt > DE_SpellCounter
set Node = DE_NextNode[Node]
if (DE_StageID[Node] == 2) then
//Initialises data required for movement
set x = GetUnitX(DE_Unit[Node])
set y = GetUnitY(DE_Unit[Node])
set DE_CurrentZ[Node] = DE_CurrentZ[Node] + DE_ZVelocity[Node]
set z = DE_GetZ(x, y)
set dy = DE_PortalY[Node] - y
set dx = DE_PortalX[Node] - x
set Angle = Atan2(dy, dx)
set Angle2 = Atan2(DE_PortalZ[Node] - DE_CurrentZ[Node], SquareRoot(dx * dx + dy * dy))
//Checks if the projectile has crashed
if (DE_CurrentZ[Node] - z < DE_HeightLet()) then
//Yes it crashed, deassociating the unit
set DE_StageID[Node] = 3
set pl = GetOwningPlayer(DE_OriginalCaster[Node])
call DestroyEffect(DE_CurrentEffect[Node])
call DestroyEffect(AddSpecialEffect(DE_ImpactModel(), x, y))
//Select Units to damage
call GroupEnumUnitsInRange(DE_TempGroup, x, y, DE_ShardAOE[Node], null)
loop
//Scanning through
set u = FirstOfGroup(DE_TempGroup)
exitwhen u == null
//Select all the units which are to be damaged
if DE_TargetFilter(u, pl) then
//Dealing health and mana damage
call UnitDamageTargetEx(DE_OriginalCaster[Node], u, DE_HealthDamage[Node], false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, DE_WeaponType())
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u,UNIT_STATE_MANA) - DE_ManaDamage[Node]))
endif
//Remove the unit from the unit group
call GroupRemoveUnit(DE_TempGroup, u)
endloop
//Removes the projectile
call KillUnit(DE_Unit[Node])
//Nulls variables
set u = null
set pl = null
else
//Setting the new locations X and Y for this instance
set x2 = x + DE_XVelocity[Node]
set y2 = y + DE_YVelocity[Node]
if (IsUnitInGroup(DE_Unit[Node], DE_GravitatedShard)) then
//Calculating the new velocities (will be used next time this runs)
set DE_ZVelocity[Node] = DE_ZVelocity[Node] + DE_BaseVelocity[Node] * Sin(Angle2)
set DE_XVelocity[Node] = DE_XVelocity[Node] + DE_BaseVelocity[Node] * Cos(Angle) * Cos(Angle2)
set DE_YVelocity[Node] = DE_YVelocity[Node] + DE_BaseVelocity[Node] * Sin(Angle) * Cos(Angle2)
else
set DE_ZVelocity[Node] = DE_ZVelocity[Node] - DE_Gravity()
endif
//Makes sure the new location is within the map bounds
if ((DE_MapMinX <= x2) and (x2 <= DE_MapMaxX) and (DE_MapMinY <= y2)and (y2 <= DE_MapMaxY)) then
call SetUnitX(DE_Unit[Node], x2)
call SetUnitY(DE_Unit[Node], y2)
endif
//Sets the correct fly height
call SetUnitFlyHeight(DE_Unit[Node], DE_CurrentZ[Node] - z, 0.00)
endif
elseif (DE_StageID[Node] == 1) then
//Increases the duration of both artificial wait timers
set DE_CurrentShardDelay[Node] = DE_CurrentShardDelay[Node] + DE_TimerSpeed()
set DE_CurrentDuration[Node] = DE_CurrentDuration[Node] + DE_TimerSpeed()
//Checks if the spell has ran out of duration
if(DE_CurrentDuration[Node] >= DE_Duration[Node]) then
set DE_StageID[Node] = 3
call DestroyEffect(DE_CurrentEffect[Node])
//Finds all the affected Shards and releases them
loop
set TempInt2 = TempInt2 + 1
exitwhen TempInt2 > DE_SpellCounter
set TempNode = DE_NextNode[TempNode]
if (DE_Portal[TempNode] == DE_Unit[Node]) then
call GroupRemoveUnit (DE_GravitatedShard, DE_Unit[TempNode])
endif
endloop
//Checks if it's time to make a new shard
elseif (DE_CurrentShardDelay[Node] >= DE_SpawnRate[Node]) then
//Resets the timer
set DE_CurrentShardDelay[Node] = 0.00
//Sets up a random place to put the new Shard
set Angle = GetRandomReal(0, 360)
set Angle2 = GetRandomReal(0, 180)
set Distance = Cos(Angle2) * DE_Radius[Node]
if (Distance < 0) then
set Distance = Distance * -1
endif
set DE_SpellCounter = DE_SpellCounter + 1
set x = DE_PortalX[Node] + Distance * Cos(Angle * bj_DEGTORAD)
set y = DE_PortalY[Node] + Distance * Sin(Angle * bj_DEGTORAD)
set z = Sin(Angle2) * DE_Radius[Node] + DE_PortalZ[Node]
//Checking for recycleable Nodes
if (DE_RecycleableNodes == 0) then
set DE_NodeNumber = DE_NodeNumber + 1
set TempNode = DE_NodeNumber
else
set DE_RecycleableNodes = DE_RecycleableNodes - 1
set TempNode = DE_RecycleNodes[DE_RecycleableNodes]
endif
//Sets up this Node
set DE_NextNode[TempNode] = 0
set DE_NextNode[DE_LastNode] = TempNode
set DE_PrevNode[TempNode] = DE_LastNode
set DE_LastNode = TempNode
//Sets up the data for the Shard
set DE_HealthDamage[TempNode] = DE_HealthDamage[Node]
set DE_ManaDamage[TempNode] = DE_ManaDamage[Node]
set DE_Portal[TempNode] = DE_Unit[Node]
set DE_PortalX[TempNode] = DE_PortalX[Node]
set DE_PortalY[TempNode] = DE_PortalY[Node]
set DE_PortalZ[TempNode] = DE_PortalZ[Node]
set DE_ShardAOE[TempNode] = DE_ShardAOE[Node]
set DE_OriginalCaster[TempNode] = DE_OriginalCaster[Node]
set DE_BaseVelocity[TempNode] = DE_BaseVelocity[Node]
set DE_CurrentZ[TempNode] = z
set DE_StageID[TempNode] = 2
//Sets up initialisation Velocities (this is to give the shards a bit of a kick of instability in their orbit)
set DE_ZVelocity[TempNode] = DE_BaseVelocity[TempNode] * Sin(Angle2)
set DE_XVelocity[TempNode] = DE_BaseVelocity[TempNode] * Cos(Angle) * Cos(Angle2)
set DE_YVelocity[TempNode] = DE_BaseVelocity[TempNode] * Sin(Angle) * Cos(Angle2)
//Creates the unit and applies Aesthetics
set DE_Unit[TempNode] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(DE_Unit[TempNode], 'Amrf') and UnitRemoveAbility(DE_Unit[TempNode], 'Amrf') then
endif
set DE_CurrentEffect[TempNode] = AddSpecialEffectTarget(DE_ShardModel(), DE_Unit[TempNode], DE_AttachmentPoint())
call SetUnitScale(DE_Unit[TempNode], DE_ShardScale[Node], 0.00, 0.00)
call SetUnitFlyHeight(DE_Unit[TempNode], z, 0.00)
//Adds them to the group of Gravitated Shards
call GroupAddUnit(DE_GravitatedShard, DE_Unit[TempNode])
endif
elseif (DE_CurrentDeathTimer[Node] < DE_DeathTimer()) then
set DE_CurrentDeathTimer[Node] = 0.00
//Removes the projectile
call RemoveUnit(DE_Unit[Node])
if (DE_LastNode == Node) then
set DE_LastNode = DE_PrevNode[Node]
endif
//Recycles the node
set DE_RecycleNodes[DE_RecycleableNodes] = Node
set DE_RecycleableNodes = DE_RecycleableNodes + 1
set DE_NextNode[DE_PrevNode[Node]] = DE_NextNode[Node]
set DE_PrevNode[DE_NextNode[Node]] = DE_PrevNode[Node]
set DE_SpellCounter = DE_SpellCounter - 1
set TempInt = TempInt - 1
//Destroys the timer when not in use
if (DE_SpellCounter == 0) then
call DestroyTimer(GetExpiredTimer())
endif
else
set DE_CurrentDeathTimer[Node] = DE_CurrentDeathTimer[Node] + DE_TimerSpeed()
endif
endloop
endfunction
////////////////////////////////////////////////////////////////////
// Function runs when a new instance is to be created - runs //
// as a condition but always returns false, creates a new //
// portal if the correct spell was cast //
////////////////////////////////////////////////////////////////////
function DE_NewInstance takes nothing returns boolean
//Sets up locals
local integer i = 0
local real fxa
local real fxd
local unit u
local integer Node
local real rLevel
local real x
local real y
//Checks if the spell cast is the correct spell
if (GetSpellAbilityId() == DE_SpellID()) then
set u = GetTriggerUnit()
set x = GetUnitX(u)
set y = GetUnitY(u)
call DestroyEffect(AddSpecialEffect("war3mapImported\\AncientExplodeBlue.mdx",x,y))
set i = 10
loop
exitwhen i == 0
set fxd = GetRandomReal(20.,350.)
set fxa = GetRandomReal(0.,360.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\AncientExplodeBlue.mdx",x+fxd*Cos(fxa*bj_DEGTORAD),y+fxd*Sin(fxa*bj_DEGTORAD)))
set i = i -1
endloop
call UnitRemoveAbility(u,'A0EP')
call UnitRemoveAbility(u,'A0EO')
call UnitAddAbility(u,'A0EN')
set CORE_LVL[GetUnitUserData(u)] = 0
//call UnitAddAbility(u,'A0EZ')
//call SetUnitAbilityLevel(u,'A0EZ',2)
//call UnitRemoveAbility(u,'A0EZ')
call BlzSetUnitMaxMana(u,R2I(BlzGetUnitMaxMana(u)+((GetUnitBonus(u,BONUS_MANA))*.1)))
call RemoveUnitBonus(u,BONUS_MANA)
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MAX_MANA))
set rLevel = I2R(GetUnitAbilityLevel(u, DE_SpellID()))
//Checking for recycleable Nodes
if (DE_RecycleableNodes == 0) then
set DE_NodeNumber = DE_NodeNumber + 1
set Node = DE_NodeNumber
else
set DE_RecycleableNodes = DE_RecycleableNodes - 1
set Node = DE_RecycleNodes[DE_RecycleableNodes]
endif
//Sets up this Node
set DE_NextNode[Node] = 0
set DE_NextNode[DE_LastNode] = Node
set DE_PrevNode[Node] = DE_LastNode
set DE_LastNode = Node
//Sets up the portal data
set DE_PortalHeight[Node] = DE_PortalHeightBase() + (DE_PortalHeightPerLevel() * rLevel)
set DE_Mass[Node] = DE_MassBase() + (DE_MassPerLevel() * rLevel)
set DE_Radius[Node] = DE_RadiusBase() + (DE_RadiusPerLevel() * rLevel)
set DE_BaseVelocity[Node] = ((DE_GravitationalConstant() * DE_Mass[Node]) / DE_Radius[Node]) * DE_TimerSpeed()
set DE_HealthDamage[Node] = DE_HealthDamageBase(u) + (DE_HealthDamagePerLevel() * rLevel)
set DE_ManaDamage[Node] = DE_ManaDamageBase() + (DE_ManaDamagePerLevel() * rLevel)
set DE_SpawnRate[Node] = DE_SpawnRateBase() + (DE_SpawnRatePerLevel() * rLevel)
set DE_Duration[Node] = DE_DurationBase() + (DE_DurationPerLevel() * rLevel)
set DE_ShardScale[Node] = DE_ShardScaleBase() + (DE_ShardScalePerLevel() * rLevel)
set DE_ShardAOE[Node] = DE_ShardAOEBase() + (DE_ShardAOEPerLevel() * rLevel)
set DE_PortalX[Node] = x
set DE_PortalY[Node] = y
set DE_PortalZ[Node] = DE_PortalHeight[Node] + DE_GetZ(x, y)
set DE_CurrentShardDelay[Node] = 0.00
set DE_CurrentDuration[Node] = 0.00
set DE_OriginalCaster[Node] = u
set DE_StageID[Node] = 1
set DE_SpellCounter = DE_SpellCounter + 1
//Creates the unit and applies Aesthetics
set DE_Unit[Node] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(DE_Unit[Node], 'Amrf') and UnitRemoveAbility(DE_Unit[Node], 'Amrf') then
endif
set DE_CurrentEffect[Node] = AddSpecialEffectTarget(DE_PortalModel(), DE_Unit[Node], DE_AttachmentPoint())
call SetUnitScale(DE_Unit[Node], DE_PortalScaleBase() + (DE_PortalScalePerLevel() * rLevel), 0.00, 0.00)
call SetUnitFlyHeight(DE_Unit[Node], DE_PortalHeight[Node], 0.00)
//Checks if it's the only portal on the map
if (DE_SpellCounter == 1) then
call TimerStart(CreateTimer(), DE_TimerSpeed(), true, function DE_Loop)
endif
//Nulls variables
set u = null
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for setting up the other functions and initialising //
// the map bounds variables and Z finder for locations //
////////////////////////////////////////////////////////////////////
function InitTrig_Discharge_Aether takes nothing returns nothing
//Sets up locals
local trigger DE = CreateTrigger()
local integer index = 0
set DE_AOE[0] = 0.00
set DE_BaseVelocity[0] = 0.00
set DE_CurrentDeathTimer[0] = 0.00
set DE_CurrentDuration[0] = 0.00
set DE_CurrentEffect[0] = DE_CurrentEffect[0]
set DE_CurrentShardDelay[0] = 0.00
set DE_CurrentZ[0] = 0.00
set DE_Duration[0] = 0.00
//set DE_GravitatedShard = null
set DE_HealthDamage[0] = 0.00
set DE_LastNode = 0
set DE_ManaDamage[0] = 0.00
set DE_MapMaxX = 0.00
set DE_MapMaxY = 0.00
set DE_MapMinX = 0.00
set DE_MapMinY = 0.00
set DE_Mass[0] = 0.00
set DE_NextNode[0] = 0
set DE_NodeNumber = 0
//set DE_OriginalCaster[0] = DE_OriginalCaster[0]
set DE_Portal[0] = DE_Portal[0]
set DE_PortalHeight[0] = 0.00
set DE_PortalX[0] = 0.00
set DE_PortalY[0] = 0.00
set DE_PortalZ[0] = 0.00
set DE_PrevNode[0] = 0
set DE_Radius[0] = 0.00
set DE_RecycleNodes[0] = 0
set DE_RecycleableNodes = 0
set DE_ShardAOE[0] = 0.00
set DE_ShardScale[0] = 0.00
set DE_SpawnRate[0] = 0.00
set DE_SpellCounter = 0
set DE_StageID[0] = 0
//set DE_TempGroup = null
set DE_Unit[0] = null
set DE_XVelocity[0] = 0.00
set DE_YVelocity[0] = 0.00
//set DE_ZLoc = DE_ZLoc
set DE_ZVelocity[0] = 0.00
//Initialise the event for every player
loop
call TriggerRegisterPlayerUnitEvent(DE, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(DE, Condition(function DE_NewInstance))
//Sets up the map bounds the spell with use
set DE_MapMaxX = GetRectMaxX(bj_mapInitialPlayableArea)
set DE_MapMinX = GetRectMinX(bj_mapInitialPlayableArea)
set DE_MapMaxY = GetRectMaxY(bj_mapInitialPlayableArea)
set DE_MapMinY = GetRectMinY(bj_mapInitialPlayableArea)
//Sets up the Z location finder
set DE_ZLoc = Location(0,0)
//Nulls variables
set DE = null
endfunction
endscope
////////////////////////////////////////////////////////////////////
// End of the spell //
////////////////////////////////////////////////////////////////////
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
integer array CORE_LVL
endglobals
scope Ascension initializer OnInit
globals
private constant integer SPELL_ID = 'A0EK'
private constant integer SPELL_ID2 = 'A0EN'
private constant integer SPELL_ID3 = 'A0EO'
private constant integer SPELL_ID4 = 'A0EP'
endglobals
private function OnSpell takes nothing returns boolean
local unit c = GetKillingUnit()
local integer lvl = GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID2)
if CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] < 100 and lvl >0 and GetOwningPlayer(GetTriggerUnit()) != Player(15) and GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(LC[1+(GetPlayerId(GetOwningPlayer(GetKillingUnit())))]) and GetKillingUnit() != null then
if CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] == null then
set CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] = 0
endif
//call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID)
//call SetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID,2)
//call UnitRemoveAbility(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID)
call AddUnitBonus(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))], BONUS_MANA,25*(1+.04*GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])))
set CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] = CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] + 1
// call BJDebugMsg("Aether Core Level: " +I2S(GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID)))
if CORE_LVL[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))])] == 100 then
call UnitRemoveAbility(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID2)
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID3)
call UnitAddAbility(LC[1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))],SPELL_ID4)
endif
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=140
//TESH.alwaysfold=0
scope AetherealMastery initializer OnInit
globals
private constant integer SPELL_ID = 'A0EY'
private constant integer SPELL_ID1 = 'A0EW'
private constant integer SPELL_ID2 = 'A0ES'
private constant integer SPELL_ID3 = 'A0EX'
private constant integer SPELL_ID4 = 'A08V'
private constant integer SPELL_ID5 = 'A0BO'
private integer CASTS
private group GROUP = CreateGroup()
private unit CASTER
private unit array RANDOMU
private integer RANDOMI = 0
endglobals
private struct MC
unit u
integer cast
integer spell_id
integer lvl
real x
real y
unit target
method destroy takes nothing returns nothing
set this.u = null
set this.target = null
call this.deallocate()
endmethod
endstruct
private function FilterGroup takes nothing returns boolean
if UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) and IsUnitVisible(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) then
set RANDOMI = RANDOMI + 1
set RANDOMU[RANDOMI] = GetFilterUnit()
endif
return false
endfunction
private function FilterGroup2 takes nothing returns boolean
if UnitAlive(GetFilterUnit()) and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) then
set RANDOMI = RANDOMI + 1
set RANDOMU[RANDOMI] = GetFilterUnit()
endif
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local MC data = GetTimerData(t)
local unit d
local unit targ
if data.cast <= 0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.cast = data.cast - 1
if data.spell_id != SPELL_ID3 then
set d = CreateUnit(GetOwningPlayer(data.u),'h007',GetUnitX(data.u),GetUnitY(data.u),0.)
else
set d = CreateUnit(GetOwningPlayer(data.u),'h007',data.x,data.y,0.)
endif
call UnitApplyTimedLife(d,'BTLF',1.)
if data.spell_id != SPELL_ID1 then
call UnitAddAbility(d,data.spell_id)
call SetUnitAbilityLevel(d,data.spell_id,data.lvl)
else
call UnitAddAbility(d,'A0F9')
call SetUnitAbilityLevel(d,'A0F9',data.lvl)
endif
if data.spell_id == SPELL_ID5 then
call UnitAddAbility(d,'A0RJ')
call SetUnitAbilityLevel(d,'A0RJ',data.lvl)
endif
call SetUnitState(data.u,UNIT_STATE_MANA,GetUnitState(data.u,UNIT_STATE_MANA)-(GetUnitState(data.u,UNIT_STATE_MANA)*.1))
if data.spell_id == SPELL_ID1 then
if not UnitAlive(data.target) or data.target == null then
set CASTER = data.u
set RANDOMI = 0
call GroupEnumUnitsInRange(GROUP,GetUnitX(data.u),GetUnitY(data.u),1400.,Filter(function FilterGroup))
if RANDOMI > 0 then
set targ = RANDOMU[GetRandomInt(1, RANDOMI)]
call IssueTargetOrder(d,"thunderbolt",targ)
set RANDOMI = 0
endif
else
call IssueTargetOrder(d,"thunderbolt",data.target)
endif
elseif data.spell_id == SPELL_ID2 then
if AETHER_BUFF_LVL[GetUnitUserData(data.target)] >= 20 or not UnitAlive(data.target) or data.target == null then
set CASTER = data.u
set RANDOMI = 0
call GroupEnumUnitsInRange(GROUP,GetUnitX(data.u),GetUnitY(data.u),1200.,Filter(function FilterGroup2))
if RANDOMI > 0 then
set targ = RANDOMU[GetRandomInt(1, RANDOMI)]
call IssueTargetOrder(d,"cripple",targ)
set RANDOMI = 0
endif
else
call IssueTargetOrder(d,"cripple",data.target)
endif
elseif data.spell_id == SPELL_ID3 then
call IssuePointOrder(d,"impale",data.x,data.y)
elseif data.spell_id == SPELL_ID4 then
call IssueTargetOrder(d,"fingerofdeath",data.target)
elseif data.spell_id == SPELL_ID5 then
call IssueTargetOrderById(d,852274,data.target)
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\Stomp.mdx",GetUnitX(data.u),GetUnitY(data.u)))
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
endif
set targ = null
set d = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local MC data = MC.create()
local texttag tt = CreateTextTag()
local string text = "|cFF1C88E2M|r|cFF1A91E4u|r|cFF199AE6l|r|cFF17A3E7t|r|cFF16ACE9i|r|cFF14B5EBc|r|cFF12BEECa|r|cFF11C6EEs|r|cFF0FCFF0t|r|cFF0ED8F2 |r|cFF0CE1F4x|r" + "|cFF0BEAF5" + I2S(CASTS+1)+ "|r" + "|cFF09F3F7!|r"
//call BJDebugMsg("Start Actions")
set data.u = GetTriggerUnit()
set data.cast = CASTS
set data.spell_id = GetSpellAbilityId()
set data.lvl = GetUnitAbilityLevel(data.u,data.spell_id)
call SetTextTagText(tt, text, .024)
call SetTextTagPos(tt, GetUnitX(data.u), GetUnitY(data.u), 0.0)
call SetTextTagVelocity(tt, 0.0, 0.04)
call SetTextTagPermanent(tt, false)
call SetTextTagFadepoint(tt, 2.0)
call SetTextTagLifespan(tt, 2.0)
call SetTextTagVisibility(tt, true)
//call BJDebugMsg("Handle ID: "+I2S(GetHandleId(tt)))
if data.spell_id == SPELL_ID1 or data.spell_id == SPELL_ID2 or data.spell_id == SPELL_ID4 or data.spell_id == SPELL_ID5 then
if data.spell_id == SPELL_ID5 then
set data.target = data.u
else
set data.target = GetSpellTargetUnit()
endif
else
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
endif
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Stomp.mdx",GetUnitX(data.u),GetUnitY(data.u)))
call SetTimerData(t,data)
call TimerStart(t,.3,false,function Handler)
//call BJDebugMsg("End Actions")
set tt = null
set t = null
set text = null
endfunction
private function Conditions takes nothing returns boolean
local integer chance
local integer lvl = GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID)
if (GetSpellAbilityId()==SPELL_ID1 or GetSpellAbilityId()==SPELL_ID2 or GetSpellAbilityId()==SPELL_ID3 or GetSpellAbilityId()==SPELL_ID4 or GetSpellAbilityId()=='A0BO') and lvl >= 1 then
set chance = GetRandomInt(1,100)
if chance <= lvl*2 then
set CASTS = 4
call Actions()
return false
elseif chance <= lvl*3 then
set CASTS = 3
call Actions()
return false
elseif chance <= lvl*4 then
set CASTS = 2
call Actions()
return false
elseif chance <= lvl*5 then
set CASTS = 1
call Actions()
return false
endif
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope PuddleSplash initializer OnInit
globals
trigger PUDDLESPLASHING
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit d = GetEventDamageSource()
call DisableTrigger(PUDDLESPLASHING)
call UnitDamageTargetEx(GetEventDamageSource(),u,GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(d))],'A07V')*1.75*GetHeroInt(LC[1+GetPlayerId(GetOwningPlayer(d))],true) * (1. + (.05 * GetHeroLevel(LC[1+GetPlayerId(GetOwningPlayer(d))]))),false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC,null)
call EnableTrigger(PUDDLESPLASHING)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlueBasiliskMissile.mdx",u,"chest"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BlueBasiliskMissile.mdx",u,"head"))
set d = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitTypeId(u) == 'n01A' and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > .01 then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set PUDDLESPLASHING=CreateTrigger()
call TriggerAddCondition(PUDDLESPLASHING,Condition(function Conditions))
call MOE(II,(PUDDLESPLASHING))
call DisableTrigger(PUDDLESPLASHING)
endfunction
endscope
//TESH.scrollpos=842
//TESH.alwaysfold=0
scope Drown initializer OnInit
globals
private real array DE_AOE
private real array DE_BaseVelocity
private real array DE_CurrentDeathTimer
private real array DE_CurrentDuration
private effect array DE_CurrentEffect
private real array DE_CurrentShardDelay
private real array DE_CurrentZ
private real array DE_Duration
private group DE_GravitatedShard = CreateGroup()
private real array DE_HealthDamage
private integer DE_LastNode
private real array DE_ManaDamage
private real DE_MapMaxX
private real DE_MapMaxY
private real DE_MapMinX
private real DE_MapMinY
private real array DE_Mass
private integer array DE_NextNode
private integer DE_NodeNumber
private unit array DE_OriginalCaster
private unit array DE_Portal
private real array DE_PortalHeight
private real array DE_PortalX
private real array DE_PortalY
private real array DE_PortalZ
private integer array DE_PrevNode
private real array DE_Radius
private integer array DE_RecycleNodes
private integer DE_RecycleableNodes
private real array DE_ShardAOE
private real array DE_ShardScale
private real array DE_SpawnRate
private integer DE_SpellCounter
private integer array DE_StageID
private group DE_TempGroup = CreateGroup()
private unit array DE_Unit
private real array DE_XVelocity
private real array DE_YVelocity
private location DE_ZLoc
private real array DE_ZVelocity
endglobals
////////////////////////////////////////////////////////////////////
// DEVASTATION ENVOY V1.00 //
// //
// Author: Tank-Commander //
// Requires: Dummy.mdl //
// Purpose: Spam-cast spell //
// //
// Notes: //
// - Read the readme before you try modifying the config //
// - Use the "Helpful files" to help you import the spell //
// //
// Credits: //
// - (Dummy.mdl) Vexorian //
// //
// //
// If you have used this spell in your map, you are required //
// to give credits to Tank-Commander for the creation of it //
// If you take a snippet from this code for physics reasons //
// or whatever else, if possible, also give credit for its //
// source origin //
// //
// Importing: Remember to import Dummy.mdl and possibly the //
// object data when importing this spell (just the ability and //
// dummy unit) note that importing the dummy unit object should //
// be done AFTER importing Dummy.mdl, if not, then you will //
// need to set the model of the dummy to Dummy.mdl yourself, if //
// you would like to change what your dummy unit is you can, //
// but it will still need Dummy.mdl for this spell to work //
// If you have problems, make sure you read the readme first //
// and follow it to the best of your abilities before posting //
// comments //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// README: //
// Before modifying this spell a few things need to be //
// understood and read, this is one of those things, while //
// most modification can be considered intuitive, it still //
// helps to read through these intstructions, as they will //
// inform you about how to configure this spell to your //
// desire. //
//----------------------------------------------------------------//
// Initial importing: The variable creator trigger can be //
// imported first and if you have the correct settings (file, //
// preferences, General, automatically create unknown variables //
// checked, then when you pasta in the variable creator it //
// will automatically give you all the variables you need for //
// this spell //
//----------------------------------------------------------------//
// This configuration is ordered by category of use, and not //
// alphabetically, the ones you're most likely to want to //
// change, are earlier in the readme, the most essential being //
// first. These categories are: //
// //
// - Data Values: The most essential to change, otherwise the //
// spell will simply not function //
// //
// - ChronoKinetic: Fancy word for affecting the flow of time //
// Contains things like the duration of the //
// spell, the Timer speed and Shard Spawn rate //
// //
// - Power: Controls the aspects of the speed of the shards //
// based on the Mass, and Radius of the Portal //
// //
// - Damage: Controls the AOE and damage (health and mana) //
// values each individual Shard has //
// //
// - Aesthetics: Controls the Appearences of the ability - the //
// models used, the scales of those models and //
// so on //
// //
// - Damage Information: Contains things like weapontypes and //
// damage types, etc. //
// //
// - Other Attributes: Contains the world gravity, death timer //
// Height let and the celestial Gravitational //
// constant. //
//----------------------------------------------------------------//
// DATA VALUES //
//----------------------------------------------------------------//
// Dummy ID: This is the raw data of the dummy unit, to see //
// raw data in the object editor, press Ctrl + D, doing this //
// again will switch it back, if you want to change this dummy //
// unit, follow as displayed (use the first 4 characters in //
// the raw data and put them in ' markers) //
private constant function DE_DummyID takes nothing returns integer
return 'u005'
endfunction
//----------------------------------------------------------------//
// Spell ID: This is done in the same manner as the Dummy ID //
// except that this time, you're doing it with ability raw //
// data, see the dummy unit if you do not know already how to //
// view raw data //
private constant function DE_SpellID takes nothing returns integer
return 'A0J3'
endfunction
//----------------------------------------------------------------//
// CHRONOKINETIC //
//----------------------------------------------------------------//
// Timer Speed: The default for this is 0.03, it determines how //
// many times per second these triggers are ran, normally you //
// want to leave this at 0.03, but 0.04 and prehaps 0.05 //
// would be good options if you computer lags a bit. //
private constant function DE_TimerSpeed takes nothing returns real
return 0.03
endfunction
//----------------------------------------------------------------//
// Duration Base: Determines how long each cast will last as a //
// base value - this is to help give better control when //
// scaling abilities while not having to change values for each //
// level, cutting out a lot of configuration time, the value is //
// in seconds (1.00 = 1second) //
private constant function DE_DurationBase takes nothing returns real
return .75
endfunction
//----------------------------------------------------------------//
// Duration Per Level: Deter,omes jpw ;pmg eacj casy wo;; as a //
// per level value - at level one this will be applied once, //
// twice at level two and so forth, it is added on to the base //
// value to come to the actual duration of the spell instance //
private constant function DE_DurationPerLevel takes nothing returns real
return .25
endfunction
//----------------------------------------------------------------//
// Spawn Rate Base: A base value, this controls how many //
// seconds there are between each Shard being created, if this //
// is the same or lower (the sum total of the Base and Per //
// Level) is lower or equal to the timer speed, then one Shard //
// will be made every Timer Speed seconds (Time is a decimal //
// value, 0.5 is half a second) //
private constant function DE_SpawnRateBase takes nothing returns real
return 0.03
endfunction
//----------------------------------------------------------------//
// Spawn Rate Per Level: The other part to the spawn rate //
// remember that it's a decimal value and the lower it is, the //
// faster Shards are created, so for this per level you'll //
// normally either want a negative value, or 0.00, though you //
// are not limited to such values //
private constant function DE_SpawnRatePerLevel takes nothing returns real
return 0.0
endfunction
//----------------------------------------------------------------//
// POWER //
//----------------------------------------------------------------//
// Radius Base: This Base value determines how far out from the //
// center the shards are created, it also affects the gravity //
// strength of the Portal - the smaller the radius in relation //
// to it's Mass, the higher the gravitational effect and the //
// more volatile the Shards will be //
private constant function DE_RadiusBase takes nothing returns real
return 200.
endfunction
//----------------------------------------------------------------//
// Radius Per Level: The per level component to the Radius, //
// works the same all the other per level factors, giving this //
// a negative value will make your Portal smaller but more //
// volatile each level, and a positive value will make it large //
// and more stable //
private constant function DE_RadiusPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mass Base: the Mass within the Portal, the main strength of //
// the gravitational pull, larger numbers will decrease //
// stability and increase the speed the Shards move, lowering //
// it makes it more stable, but unlike the Radius, it does not //
// affect the size of your Portal, works well for a baseline //
// when testing different levels of instability or stability //
// when getting your preferences for the spell //
private constant function DE_MassBase takes nothing returns real
return 800.
endfunction
//----------------------------------------------------------------//
// Mass Per Level: the Per level component of the Mass can make //
// the spell more stable or volatile as it levels up without //
// changing it's size, remember that it is applied once at level //
// one, so the values 800 and 400 (the defaults) yeild 1200 //
// Mass at level one //
private constant function DE_MassPerLevel takes nothing returns real
return 100.
endfunction
//----------------------------------------------------------------//
// DAMAGE //
//----------------------------------------------------------------//
// Shard AOE Base: Determines the area of effect of the shards //
// 90 is melee range, 40 is directly on top, 20 is probably too //
// small an area to work and 400 to large, try different values //
// and see what you like //
private constant function DE_ShardAOEBase takes nothing returns real
return 120.
endfunction
//----------------------------------------------------------------//
// Shard AEO Per Level: Normally not used, but here for your //
// preferences, allows you to adjust the area of effect of your //
// shards as they level up, normally only making the area larger //
// makes logical sense, or not changing it at all //
private constant function DE_ShardAOEPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Health Damage Base: This is the damage the spell deals to //
// all the units within the AOE on impact with a shard, you'll //
// want to make this fairly relative to the number of shards //
// you have, 75 shards with 100 damage each is 7500 damage in //
// one cast of the spell - that's a lot of potential damage in //
// a spell which has no cooldown by default, note that this //
// damage is not true damage - enemies will have their armour //
// applied and reduce this damage based on their armour type //
// vs your damage type //
private function DE_HealthDamageBase takes unit u returns real
return GetHeroInt(u,true)*4. * (1. + (.05 * GetHeroLevel(u)))
endfunction
//----------------------------------------------------------------//
// Health Damage Per Level: For changing the amount of damage //
// you want to deal with each shard as you level up, normally //
// this is your main source of increased damage as the spell //
// levels up rather than the other factors, it makes little //
// sense to not have this as a positive value of some number //
// (25% of your total level 1 damage seems like a good number, //
// i.e. if your combined level one damage is 100, roughly 25 of //
// that damage should probably be coming from this per level //
// value //
private function DE_HealthDamagePerLevel takes unit u returns real
return GetHeroInt(u,true)*2. * (1. + (.05 * GetHeroLevel(u)))
endfunction
//----------------------------------------------------------------//
// Mana Damage Base: Unlike Health damage the mana damage is //
// true damage - no matter how much armour they have, exactly //
// these values will be subtracted from their mana, normally //
// this is 0 as mana damage is mostly useless except vs certain //
// enemies, but it's still good to have the option to be able //
// to have it if you want //
private constant function DE_ManaDamageBase takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mana Damage Per Level: Per level component of the normally //
// disused mana damage, not any real sense in having a below 0 //
// amount here, since it'll only make it weaker, like the //
// health damage I suggest this to be 25% of your total mana //
// damage of your level 1 version //
private constant function DE_ManaDamagePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// AESTHETICS //
//----------------------------------------------------------------//
// Portal Model: This determines the model used for your //
// main portal, you want to use the model path and paste it //
// into the double quotes or " markers, if the path has only //
// single slashes (\) you'll need to changeb it to double slash //
// (\\) before you save, the spell will not work if you do not //
// do this (if you acidentally save with the single slash (\) //
// it will still save but you may find yourself having a //
// lingering Progress bar at full percentage, you can ignore it //
// for the most part, but if you have it, you probably haven't //
// entered this field correctly. Get the model paths from the //
// Object editor - find the model you want (the model, not the //
// unit, in the models list, select it and hit enter twice, //
// then select the path (will look similar to this default //
// value, and paste in it here) I suggest doing this with a //
// unit of no value (changing the model to get the model path) //
// and then reset the field afterwards to get the unit back to //
// normal //
private constant function DE_PortalModel takes nothing returns string
return "war3mapImported\\ForceField.mdx"
endfunction
//----------------------------------------------------------------//
// Shard Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
private constant function DE_ShardModel takes nothing returns string
return "war3mapImported\\BlueBasiliskMissile.mdx"
endfunction
//----------------------------------------------------------------//
// Impact Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
private constant function DE_ImpactModel takes nothing returns string
return "war3mapImported\\WaterBlast.mdx"
endfunction
//----------------------------------------------------------------//
// Attachment Point: This determines where on the unit the //
// model is placed, "origin", "chest", "head", "overhead" are //
// all good places to put the model, switch them around to see //
// which you prefer the most, "foot" and "hand" are less so as //
// they're offsetted from the center //
private constant function DE_AttachmentPoint takes nothing returns string
return "origin"
endfunction
//----------------------------------------------------------------//
// Portal Height Base: This is how height the portal is off the //
// floor (it is added onto the terrain Z) you'll want it a good //
// distance off the ground (unles you want Shards to smack into //
// the ground while the spell is still going off, which is a //
// viable thing to do for this spell) but not so high as to //
// send the Shards halfway across the map, 400 is default //
private constant function DE_PortalHeightBase takes nothing returns real
return 400.00
endfunction
//----------------------------------------------------------------//
// Portal Height Per Level: The per level for the height of the //
// portal, generally this'll be set at 0 as the spell changes //
// more on functionality, than on effectiveness depending on //
// height - so changing this value as it levels up will not //
// necessarily make it any stronger or weaker //
private constant function DE_PortalHeightPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Portal Scale Base: this is the scale of the portal model //
// it's a decimal percentage (1.00 = 100%) as the largest part //
// of the spell you'll normally want this at, at least 100% //
// depending on the model, generally a good idea to try to line //
// it up with your portal radius as to get the best effect out //
// of it //
private constant function DE_PortalScaleBase takes nothing returns real
return .4
endfunction
//----------------------------------------------------------------//
// Portal Scale Per Level: Used for changing the portal scale //
// as it levels up - good in combination with radius change per //
// level as to stay correct relatively //
private constant function DE_PortalScalePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Shard Scale Base: Scales the Shards that are created by the //
// portal, normally you'll want them significantly smaller that //
// the portal 10% (0.10) is a good size, but for some models a //
// bit bigger might be good, be sure to play around with this //
// to get the size you want and looks best in your opinion //
private constant function DE_ShardScaleBase takes nothing returns real
return .01
endfunction
//----------------------------------------------------------------//
// Shard Scale Per Level: Also for use with making the portal //
// seem relatively the same size as it levels up - or simply //
// to make them bigger to show increased AOE, Damage, more or //
// less to show anything about the spell being stronger as it //
// levels up and becomes more powerful //
private constant function DE_ShardScalePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// DAMAGE INFORMATION //
//----------------------------------------------------------------//
// Damage Type: These determine the damagetypes, changing this //
// will modify the damage multiplyers vs certain enemies //
// the standard is DAMAGE_TYPE_MAGIC, note that this spell //
// automatically discludes magic immunes, so changing this //
// damage type will not make them start taking damage //
private constant function DE_AttackType takes nothing returns attacktype
return ATTACK_TYPE_NORMAL
endfunction
//----------------------------------------------------------------//
// Attack Type: This is very much so basically the same as //
// Damage Type, generally you'll want this to match with it //
// as such the default is ATTACK_TYPE_MAGIC, though Damagetype //
// is a key factor for determining bonuses rather than this //
// but unlike weapontype, you cannot have null as a setting //
private constant function DE_DamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
//----------------------------------------------------------------//
// Weapon Type: This alters what kind of weapon type is used by //
// the spell, those without knowledge of weapontypes don't //
// worry, you're not missing much, this spell doesn't really //
// use it, hence the default of null, but if you want to use //
// them, no reason to not. //
private constant function DE_WeaponType takes nothing returns weapontype
return null
endfunction
//----------------------------------------------------------------//
// OTHER ATTRIBUTES //
//----------------------------------------------------------------//
// Gravity: Determines the worldly gravity strength used to //
// pull the shards back to the ground after they have been //
// freed from the portal, having a lower gravity increases the //
// spread range, higher lowers it, the default is 1/8 of the //
// earthly gravity of 9.81, beng 1.22625 //
private constant function DE_Gravity takes nothing returns real
return 1.22625
endfunction
//----------------------------------------------------------------//
// Gravitational Constant: This is the constant reprisented by //
// G in Celestial Physics and Mechanics. Normally it's //
// 6.67384 x 10^-11 N (m/kg)^2 but for Warcraft purposes I //
// cranked it up a bit, (x 10^11 to be exact) changing it may //
// yeild interesting results, but I take no responcibility if //
// you do something silly and crash the game by making it //
// really high //
private constant function DE_GravitationalConstant takes nothing returns real
return 6.67384
endfunction
//----------------------------------------------------------------//
// Height Let: This is a small let so that projectiles nearly //
// touching the floor, will be treated as actually touching it //
// This is to prevent graphical errors because models cannot //
// sink into the floor by reducing their fly height //
// 5 is default 10 is probably the max you can reasonably give //
// this //
private constant function DE_HeightLet takes nothing returns real
return 5.00
endfunction
//----------------------------------------------------------------//
// Death Timer: Determines how long after the death of a dummy //
// will it be removed from the game completely, this is so //
// death effects, if any can finish playing before the unit is //
// removed, 1.8 is default, 2 is probably excessive and in some //
// cases it's possible that 1 could be too little //
private constant function DE_DeathTimer takes nothing returns real
return 1.80
endfunction
//----------------------------------------------------------------//
// You have now reached the end of the configuration, below are //
// the functions used to run the spell, beyond this point if //
// you find any constant values (indicated in Blue like the //
// other constants here if you have standard syntax highlighting //
// they're there for a reason and don't fiddle with them, to //
// actually make any modifications I hope you're an experienced //
// programmer, though do not hassle for help because I don't //
// take responcibility for other people's programming skills //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function used for finding the Z height of a location, since //
// it cannot be done with co-ordinates, a recycled location is //
// used constantly. //
////////////////////////////////////////////////////////////////////
private function DE_GetZ takes real x, real y returns real
//Gets the location Z of the selected location
call MoveLocation(DE_ZLoc, x, y)
return GetLocationZ(DE_ZLoc)
endfunction
////////////////////////////////////////////////////////////////////
// Target filter function - passed units and players and checks //
// if the unit is allowed to be targetted by this spell //
////////////////////////////////////////////////////////////////////
private function DE_TargetFilter takes unit u, player pl returns boolean
//Checks if the unit can be used as a target
if (IsUnitType(u, UNIT_TYPE_GROUND)) and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) and (not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)) and (IsUnitEnemy(u, pl)) and (GetUnitTypeId(u) != DE_DummyID()) and (not IsUnitType(u, UNIT_TYPE_DEAD)) then
return true
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for running the main parts of the spell, creates //
// new shards and destroys old portals, and does all the //
// recycling and damaging of targets, as well as shard movement //
////////////////////////////////////////////////////////////////////
private function DE_Loop takes nothing returns nothing
//Sets up all the locals needed for this section
local integer TempInt = 0
local integer TempInt2 = 0
local integer TempNode = 0
local integer Node = 0
local real Angle
local real Angle2
local real Distance
local real x
local real x2
local real dx
local real y
local real y2
local real dy
local real z
local unit u
local player pl
loop
//Moves to the next node
set TempInt = TempInt + 1
exitwhen TempInt > DE_SpellCounter
set Node = DE_NextNode[Node]
if (DE_StageID[Node] == 2) then
//Initialises data required for movement
set x = GetUnitX(DE_Unit[Node])
set y = GetUnitY(DE_Unit[Node])
set DE_CurrentZ[Node] = DE_CurrentZ[Node] + DE_ZVelocity[Node]
set z = DE_GetZ(x, y)
set dy = DE_PortalY[Node] - y
set dx = DE_PortalX[Node] - x
set Angle = Atan2(dy, dx)
set Angle2 = Atan2(DE_PortalZ[Node] - DE_CurrentZ[Node], SquareRoot(dx * dx + dy * dy))
//Checks if the projectile has crashed
if (DE_CurrentZ[Node] - z < DE_HeightLet()) then
//Yes it crashed, deassociating the unit
set DE_StageID[Node] = 3
set pl = GetOwningPlayer(DE_OriginalCaster[Node])
call DestroyEffect(DE_CurrentEffect[Node])
call DestroyEffect(AddSpecialEffect(DE_ImpactModel(), x, y))
//Select Units to damage
call GroupEnumUnitsInRange(DE_TempGroup, x, y, DE_ShardAOE[Node], null)
loop
//Scanning through
set u = FirstOfGroup(DE_TempGroup)
exitwhen u == null
//Select all the units which are to be damaged
if DE_TargetFilter(u, pl) then
//Dealing health and mana damage
call UnitDamageTargetEx(DE_OriginalCaster[Node], u, DE_HealthDamage[Node], false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE, DE_WeaponType())
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u,UNIT_STATE_MANA) - DE_ManaDamage[Node]))
endif
//Remove the unit from the unit group
call GroupRemoveUnit(DE_TempGroup, u)
endloop
//Removes the projectile
call KillUnit(DE_Unit[Node])
//Nulls variables
set u = null
set pl = null
else
//Setting the new locations X and Y for this instance
set x2 = x + DE_XVelocity[Node]
set y2 = y + DE_YVelocity[Node]
if (IsUnitInGroup(DE_Unit[Node], DE_GravitatedShard)) then
//Calculating the new velocities (will be used next time this runs)
set DE_ZVelocity[Node] = DE_ZVelocity[Node] + DE_BaseVelocity[Node] * Sin(Angle2)
set DE_XVelocity[Node] = DE_XVelocity[Node] + DE_BaseVelocity[Node] * Cos(Angle) * Cos(Angle2)
set DE_YVelocity[Node] = DE_YVelocity[Node] + DE_BaseVelocity[Node] * Sin(Angle) * Cos(Angle2)
else
set DE_ZVelocity[Node] = DE_ZVelocity[Node] - DE_Gravity()
endif
//Makes sure the new location is within the map bounds
if ((DE_MapMinX <= x2) and (x2 <= DE_MapMaxX) and (DE_MapMinY <= y2)and (y2 <= DE_MapMaxY)) then
call SetUnitX(DE_Unit[Node], x2)
call SetUnitY(DE_Unit[Node], y2)
endif
//Sets the correct fly height
call SetUnitFlyHeight(DE_Unit[Node], DE_CurrentZ[Node] - z, 0.00)
endif
elseif (DE_StageID[Node] == 1) then
//Increases the duration of both artificial wait timers
set DE_CurrentShardDelay[Node] = DE_CurrentShardDelay[Node] + DE_TimerSpeed()
set DE_CurrentDuration[Node] = DE_CurrentDuration[Node] + DE_TimerSpeed()
//Checks if the spell has ran out of duration
if(DE_CurrentDuration[Node] >= DE_Duration[Node]) then
set DE_StageID[Node] = 3
call DestroyEffect(DE_CurrentEffect[Node])
//Finds all the affected Shards and releases them
loop
set TempInt2 = TempInt2 + 1
exitwhen TempInt2 > DE_SpellCounter
set TempNode = DE_NextNode[TempNode]
if (DE_Portal[TempNode] == DE_Unit[Node]) then
call GroupRemoveUnit (DE_GravitatedShard, DE_Unit[TempNode])
endif
endloop
//Checks if it's time to make a new shard
elseif (DE_CurrentShardDelay[Node] >= DE_SpawnRate[Node]) then
//Resets the timer
set DE_CurrentShardDelay[Node] = 0.00
//Sets up a random place to put the new Shard
set Angle = GetRandomReal(0, 360)
set Angle2 = GetRandomReal(0, 180)
set Distance = Cos(Angle2) * DE_Radius[Node]
if (Distance < 0) then
set Distance = Distance * -1
endif
set DE_SpellCounter = DE_SpellCounter + 1
set x = DE_PortalX[Node] + Distance * Cos(Angle * bj_DEGTORAD)
set y = DE_PortalY[Node] + Distance * Sin(Angle * bj_DEGTORAD)
set z = Sin(Angle2) * DE_Radius[Node] + DE_PortalZ[Node]
//Checking for recycleable Nodes
if (DE_RecycleableNodes == 0) then
set DE_NodeNumber = DE_NodeNumber + 1
set TempNode = DE_NodeNumber
else
set DE_RecycleableNodes = DE_RecycleableNodes - 1
set TempNode = DE_RecycleNodes[DE_RecycleableNodes]
endif
//Sets up this Node
set DE_NextNode[TempNode] = 0
set DE_NextNode[DE_LastNode] = TempNode
set DE_PrevNode[TempNode] = DE_LastNode
set DE_LastNode = TempNode
//Sets up the data for the Shard
set DE_HealthDamage[TempNode] = DE_HealthDamage[Node]
set DE_ManaDamage[TempNode] = DE_ManaDamage[Node]
set DE_Portal[TempNode] = DE_Unit[Node]
set DE_PortalX[TempNode] = DE_PortalX[Node]
set DE_PortalY[TempNode] = DE_PortalY[Node]
set DE_PortalZ[TempNode] = DE_PortalZ[Node]
set DE_ShardAOE[TempNode] = DE_ShardAOE[Node]
set DE_OriginalCaster[TempNode] = DE_OriginalCaster[Node]
set DE_BaseVelocity[TempNode] = DE_BaseVelocity[Node]
set DE_CurrentZ[TempNode] = z
set DE_StageID[TempNode] = 2
//Sets up initialisation Velocities (this is to give the shards a bit of a kick of instability in their orbit)
set DE_ZVelocity[TempNode] = DE_BaseVelocity[TempNode] * Sin(Angle2)
set DE_XVelocity[TempNode] = DE_BaseVelocity[TempNode] * Cos(Angle) * Cos(Angle2)
set DE_YVelocity[TempNode] = DE_BaseVelocity[TempNode] * Sin(Angle) * Cos(Angle2)
//Creates the unit and applies Aesthetics
set DE_Unit[TempNode] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(DE_Unit[TempNode], 'Amrf') and UnitRemoveAbility(DE_Unit[TempNode], 'Amrf') then
endif
set DE_CurrentEffect[TempNode] = AddSpecialEffectTarget(DE_ShardModel(), DE_Unit[TempNode], DE_AttachmentPoint())
call SetUnitScale(DE_Unit[TempNode], DE_ShardScale[Node], 0.00, 0.00)
call SetUnitFlyHeight(DE_Unit[TempNode], z, 0.00)
//Adds them to the group of Gravitated Shards
call GroupAddUnit(DE_GravitatedShard, DE_Unit[TempNode])
endif
elseif (DE_CurrentDeathTimer[Node] < DE_DeathTimer()) then
set DE_CurrentDeathTimer[Node] = 0.00
//Removes the projectile
call RemoveUnit(DE_Unit[Node])
if (DE_LastNode == Node) then
set DE_LastNode = DE_PrevNode[Node]
endif
//Recycles the node
set DE_RecycleNodes[DE_RecycleableNodes] = Node
set DE_RecycleableNodes = DE_RecycleableNodes + 1
set DE_NextNode[DE_PrevNode[Node]] = DE_NextNode[Node]
set DE_PrevNode[DE_NextNode[Node]] = DE_PrevNode[Node]
set DE_SpellCounter = DE_SpellCounter - 1
set TempInt = TempInt - 1
//Destroys the timer when not in use
if (DE_SpellCounter == 0) then
call DestroyTimer(GetExpiredTimer())
endif
else
set DE_CurrentDeathTimer[Node] = DE_CurrentDeathTimer[Node] + DE_TimerSpeed()
endif
endloop
endfunction
////////////////////////////////////////////////////////////////////
// Function runs when a new instance is to be created - runs //
// as a condition but always returns false, creates a new //
// portal if the correct spell was cast //
////////////////////////////////////////////////////////////////////
private function DE_NewInstance takes nothing returns boolean
//Sets up locals
local integer i = 0
local real fxa
local real fxd
local unit u
local integer Node
local real rLevel
local real x
local real y
//Checks if the spell cast is the correct spell
if (GetSpellAbilityId() == DE_SpellID()) then
set u = GetTriggerUnit()
set x = GetUnitX(u)
set y = GetUnitY(u)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\WaterBlast.mdx",x,y))
//set i = 10
//loop
//exitwhen i == 0
//set fxd = GetRandomReal(20.,350.)
//set fxa = GetRandomReal(0.,360.)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\WaterBlast.mdx",x+fxd*Cos(fxa*bj_DEGTORAD),y+fxd*Sin(fxa*bj_DEGTORAD)))
//set i = i -1
//endloop
set rLevel = I2R(GetUnitAbilityLevel(u, DE_SpellID()))
//Checking for recycleable Nodes
if (DE_RecycleableNodes == 0) then
set DE_NodeNumber = DE_NodeNumber + 1
set Node = DE_NodeNumber
else
set DE_RecycleableNodes = DE_RecycleableNodes - 1
set Node = DE_RecycleNodes[DE_RecycleableNodes]
endif
//Sets up this Node
set DE_NextNode[Node] = 0
set DE_NextNode[DE_LastNode] = Node
set DE_PrevNode[Node] = DE_LastNode
set DE_LastNode = Node
//Sets up the portal data
set DE_PortalHeight[Node] = DE_PortalHeightBase() + (DE_PortalHeightPerLevel() * rLevel)
set DE_Mass[Node] = DE_MassBase() + (DE_MassPerLevel() * rLevel)
set DE_Radius[Node] = DE_RadiusBase() + (DE_RadiusPerLevel() * rLevel)
set DE_BaseVelocity[Node] = ((DE_GravitationalConstant() * DE_Mass[Node]) / DE_Radius[Node]) * DE_TimerSpeed()
set DE_HealthDamage[Node] = DE_HealthDamageBase(u) + (DE_HealthDamagePerLevel(u) * rLevel)
set DE_ManaDamage[Node] = DE_ManaDamageBase() + (DE_ManaDamagePerLevel() * rLevel)
set DE_SpawnRate[Node] = DE_SpawnRateBase() + (DE_SpawnRatePerLevel() * rLevel)
set DE_Duration[Node] = DE_DurationBase() + (DE_DurationPerLevel() * rLevel)
set DE_ShardScale[Node] = DE_ShardScaleBase() + (DE_ShardScalePerLevel() * rLevel)
set DE_ShardAOE[Node] = DE_ShardAOEBase() + (DE_ShardAOEPerLevel() * rLevel)
set DE_PortalX[Node] = x
set DE_PortalY[Node] = y
set DE_PortalZ[Node] = DE_PortalHeight[Node] + DE_GetZ(x, y)
set DE_CurrentShardDelay[Node] = 0.00
set DE_CurrentDuration[Node] = 0.00
set DE_OriginalCaster[Node] = u
set DE_StageID[Node] = 1
set DE_SpellCounter = DE_SpellCounter + 1
//Creates the unit and applies Aesthetics
set DE_Unit[Node] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(DE_Unit[Node], 'Amrf') and UnitRemoveAbility(DE_Unit[Node], 'Amrf') then
endif
set DE_CurrentEffect[Node] = AddSpecialEffectTarget(DE_PortalModel(), DE_Unit[Node], DE_AttachmentPoint())
call SetUnitScale(DE_Unit[Node], DE_PortalScaleBase() + (DE_PortalScalePerLevel() * rLevel), 0.00, 0.00)
call SetUnitFlyHeight(DE_Unit[Node], DE_PortalHeight[Node], 0.00)
//Checks if it's the only portal on the map
if (DE_SpellCounter == 1) then
call TimerStart(CreateTimer(), DE_TimerSpeed(), true, function DE_Loop)
endif
//Nulls variables
set u = null
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for setting up the other functions and initialising //
// the map bounds variables and Z finder for locations //
////////////////////////////////////////////////////////////////////
private function OnInit takes nothing returns nothing
//Sets up locals
local trigger DE = CreateTrigger()
local integer index = 0
set DE_AOE[0] = 0.00
set DE_BaseVelocity[0] = 0.00
set DE_CurrentDeathTimer[0] = 0.00
set DE_CurrentDuration[0] = 0.00
set DE_CurrentEffect[0] = DE_CurrentEffect[0]
set DE_CurrentShardDelay[0] = 0.00
set DE_CurrentZ[0] = 0.00
set DE_Duration[0] = 0.00
//set DE_GravitatedShard = null
set DE_HealthDamage[0] = 0.00
set DE_LastNode = 0
set DE_ManaDamage[0] = 0.00
set DE_MapMaxX = 0.00
set DE_MapMaxY = 0.00
set DE_MapMinX = 0.00
set DE_MapMinY = 0.00
set DE_Mass[0] = 0.00
set DE_NextNode[0] = 0
set DE_NodeNumber = 0
//set DE_OriginalCaster[0] = DE_OriginalCaster[0]
set DE_Portal[0] = DE_Portal[0]
set DE_PortalHeight[0] = 0.00
set DE_PortalX[0] = 0.00
set DE_PortalY[0] = 0.00
set DE_PortalZ[0] = 0.00
set DE_PrevNode[0] = 0
set DE_Radius[0] = 0.00
set DE_RecycleNodes[0] = 0
set DE_RecycleableNodes = 0
set DE_ShardAOE[0] = 0.00
set DE_ShardScale[0] = 0.00
set DE_SpawnRate[0] = 0.00
set DE_SpellCounter = 0
set DE_StageID[0] = 0
//set DE_TempGroup = null
set DE_Unit[0] = null
set DE_XVelocity[0] = 0.00
set DE_YVelocity[0] = 0.00
//set DE_ZLoc = DE_ZLoc
set DE_ZVelocity[0] = 0.00
//Initialise the event for every player
loop
call TriggerRegisterPlayerUnitEvent(DE, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(DE, Condition(function DE_NewInstance))
//Sets up the map bounds the spell with use
set DE_MapMaxX = GetRectMaxX(bj_mapInitialPlayableArea)
set DE_MapMinX = GetRectMinX(bj_mapInitialPlayableArea)
set DE_MapMaxY = GetRectMaxY(bj_mapInitialPlayableArea)
set DE_MapMinY = GetRectMinY(bj_mapInitialPlayableArea)
//Sets up the Z location finder
set DE_ZLoc = Location(0,0)
//Nulls variables
set DE = null
endfunction
endscope
////////////////////////////////////////////////////////////////////
// End of the spell //
////////////////////////////////////////////////////////////////////
//TESH.scrollpos=-1
//TESH.alwaysfold=0
scope GluttonyPas initializer OnInit
globals
private constant integer SPELL_ID = 'A0BQ'
trigger GLUTTONYP
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(u,SPELL_ID)
local real dmg = (lvl*GetHeroStr(u,true)*1) + ((GetUnitState(u,UNIT_STATE_MAX_LIFE)-GetWidgetLife(u))*.015)
local integer chance
if GetWidgetLife(u) <= GetUnitState(u,UNIT_STATE_MAX_LIFE)*.5 then
set chance = lvl * 4
else
set chance = lvl*2
endif
if GetRandomInt(0,100) <= chance then
if GetWidgetLife(u)+dmg >= GetUnitState(u,UNIT_STATE_MAX_LIFE) then
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(u,GetWidgetLife(u)+ dmg)
endif
call UnitDamageTargetEx(u,t,dmg,false,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"head"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"hand left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"hand right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"foot left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"foot right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SmallBloodEX-NoSplat.mdx",t,"foot right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\VampiricAuraTarget.mdx",u,"origin"))
endif
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and GetEventDamage() > 0 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set GLUTTONYP=CreateTrigger()
call TriggerAddCondition(GLUTTONYP,Condition(function Conditions))
call MOE(II,(GLUTTONYP))
call DisableTrigger(GLUTTONYP)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TemperancePas initializer OnInit
globals
private constant integer SPELL_ID = 'A0BP'
trigger TEMPERANCEP
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(u,SPELL_ID)
local real dmg = GetWidgetLife(u)*.07
local integer chance
call UnitRemoveAbility(t,'B03S')
if GetEventDamage() > 0 then
if GetWidgetLife(u) <= (GetUnitState(u,UNIT_STATE_MAX_LIFE)*.5) then
call SetWidgetLife(u,GetWidgetLife(u)-(dmg*.1))
call UnitDamageTargetEx(u,t,((dmg*.35*lvl)*(1.+(lvl*.1))+GetHeroAgi(u,true)*lvl*.2),false,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",t,"chest"))
else
call SetWidgetLife(u,GetWidgetLife(u)-dmg)
call UnitDamageTargetEx(u,t,((dmg*.35*lvl)*(1.+(lvl*.1))+GetHeroAgi(u,true)*lvl*.2),false,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",t,"chest"))
endif
if GetWidgetLife(u) <= GetUnitState(u,UNIT_STATE_MAX_LIFE)*.5 then
set chance = lvl * 2
else
set chance = lvl*2
endif
if GetRandomInt(0,100) <= chance then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"head"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"hand left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"hand right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"foot left"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\FatalWoundV2.mdx",t,"foot right"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SmallBloodEX-NoSplat.mdx",t,"foot right"))
call UnitDamageTargetEx(u,t,GetHeroAgi(u,true)*lvl*4,false,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
endif
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and GetUnitAbilityLevel(GetTriggerUnit(),'B03S') ==1 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set TEMPERANCEP=CreateTrigger()
call TriggerAddCondition(TEMPERANCEP,Condition(function Conditions))
call MOE(II,(TEMPERANCEP))
call DisableTrigger(TEMPERANCEP)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope TemperanceA initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private unit CASTER
private real DAMAGE
private constant integer SPELL_ID = 'A0BP'
private constant integer OTHER_ID = 'A0BQ'
private constant integer RESET_ID = 'A0B5'
private constant string EFFECT = "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
private constant string ATTACH_POINT = "chest"
endglobals
struct TempA
unit c
real dmg
real x
real y
real a
integer current
group g
effect fx1
effect fx2
effect fx3
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
set this.fx1 = null
set this.fx2 = null
set this.fx3 = null
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 32 then
call DestroyEffect(data.fx1)
call DestroyEffect(data.fx2)
call DestroyEffect(data.fx3)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call SetUnitTimeScale(data.c,1.)
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 15.625 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 15.625 * Sin(data.a * bj_DEGTORAD)
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 170., Filter( function FilterActions ) )
set data.g = GROUP2
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,0.015625,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
local integer lvlr
local integer lvlo
local real dx
local real dy
local integer id
set data.c = GetTriggerUnit()
set id = GetPlayerId(GetOwningPlayer(data.c))
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set dx = MouseX[id]
set dy = MouseY[id]
set data.a = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
call BlzPauseUnitEx(data.c,true)
set UnitIsCasting[GetUnitUserData(data.c)] = true
call SetUnitTimeScale(data.c,2.)
call BlzSetUnitFacingEx(data.c,data.a)
set data.current = 0
if IsQoBTyrael[GetUnitUserData(data.c)] then
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"hand left")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"weapon")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"chest")
else
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"weapon left")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"weapon right")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"chest")
endif
set lvl = GetUnitAbilityLevel(data.c,SPELL_ID)
set lvlr = GetUnitAbilityLevel(data.c,RESET_ID)
set VoracityInt[GetPlayerId(GetOwningPlayer(data.c))] = VoracityInt[GetPlayerId(GetOwningPlayer(data.c))] + (lvlr-1)
if lvlr >= 6 and GetUnitAbilityLevel(data.c,OTHER_ID) != 0 then
set lvlo = GetUnitAbilityLevel(data.c,OTHER_ID)
call UnitRemoveAbility(data.c,OTHER_ID)
call UnitAddAbility(data.c,OTHER_ID)
call SetUnitAbilityLevel(data.c,OTHER_ID,lvlo)
call UnitRemoveAbility(data.c,'A0BW')
endif
if lvlr > 1 then
set lvlr = lvlr - 1
endif
if lvlr > 10 then
set lvlr = 10
endif
set data.dmg = (GetHeroAgi(data.c,true)*5.*lvl)*(lvlr*.3)
call SetUnitAbilityLevel(data.c,RESET_ID,1)
call SetUnitAbilityLevel(data.c,'A0D4',1)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.015625,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope GluttonyA initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private unit CASTER
private real DAMAGE
private constant integer SPELL_ID = 'A0BQ'
private constant integer OTHER_ID = 'A0BP'
private constant integer RESET_ID = 'A0B5'
private constant string EFFECT = "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
private constant string ATTACH_POINT = "chest"
endglobals
struct GlutA
unit c
real dmg
real x
real y
real a
integer current
group g
effect fx1
effect fx2
effect fx3
static method create takes nothing returns GlutA
local GlutA data = GlutA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
set this.fx1 = null
set this.fx2 = null
set this.fx3 = null
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local GlutA data = GetTimerData(t)
if data.current == 32 then
call DestroyEffect(data.fx1)
call DestroyEffect(data.fx2)
call DestroyEffect(data.fx3)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call SetUnitTimeScale(data.c,1.)
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 15.625 * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 15.625 * Sin(data.a * bj_DEGTORAD)
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 170., Filter( function FilterActions ) )
set data.g = GROUP2
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,0.015625,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local GlutA data = GlutA.create()
local integer lvl
local integer lvlr
local integer lvlo
local real dx
local real dy
local integer id
set data.c = GetTriggerUnit()
set id = GetPlayerId(GetOwningPlayer(data.c))
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set dx = MouseX[id]
set dy = MouseY[id]
set data.a = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
call BlzPauseUnitEx(data.c,true)
set UnitIsCasting[GetUnitUserData(data.c)] = true
call SetUnitTimeScale(data.c,2.)
call BlzSetUnitFacingEx(data.c,data.a)
set data.current = 0
if IsQoBTyrael[GetUnitUserData(data.c)] then
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"hand left")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"weapon")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blue Soul.mdx",data.c,"chest")
else
set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"weapon left")
set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"weapon right")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Windwalk Blood.mdx",data.c,"chest")
endif
set lvl = GetUnitAbilityLevel(data.c,SPELL_ID)
set lvlr = GetUnitAbilityLevel(data.c,RESET_ID)
set VoracityInt[GetPlayerId(GetOwningPlayer(data.c))] = VoracityInt[GetPlayerId(GetOwningPlayer(data.c))] + (lvlr-1)
if lvlr >= 6 and GetUnitAbilityLevel(data.c,OTHER_ID) != 0 then
set lvlo = GetUnitAbilityLevel(data.c,OTHER_ID)
call UnitRemoveAbility(data.c,OTHER_ID)
call UnitAddAbility(data.c,OTHER_ID)
call SetUnitAbilityLevel(data.c,OTHER_ID,lvlo)
call UnitRemoveAbility(data.c,'A0BW')
endif
if lvlr > 1 then
set lvlr = lvlr - 1
endif
if lvlr > 10 then
set lvlr = 10
endif
set data.dmg = (GetHeroStr(data.c,true)*4.*lvl)*(lvlr*.3)
call SetUnitAbilityLevel(data.c,RESET_ID,1)
call SetUnitAbilityLevel(data.c,'A0D4',1)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,0.015625,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=128
//TESH.alwaysfold=0
scope Execute initializer OnInit
globals
private constant integer SPELL_ID = 'A0BV'
private constant integer STUN_ID = 'A06P'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private constant function Damage takes integer level, real mhp, integer str returns real
return (500. + (50 * level * level)) + (level * str * 5) + (mhp * .03 * level)
endfunction
private constant function AoE takes integer level returns real
return 900. + (30. * level)
endfunction
private struct Exec
unit cast
unit t
unit fx
real h
real dh
real hp
real tx
real ty
real sx
real sy
real oh
integer dur
real float
integer lvl
effect attach
boolean positive
method destroy takes nothing returns nothing
set this.cast = null
set this.t = null
set this.fx = null
set this.attach = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Exec data = GetTimerData(t)
if data.dur == 90 then
call DestroyEffect(data.attach)
call RemoveUnit(data.fx)
call UnitDamageTargetEx(data.cast, data.t, Damage(data.lvl, GetUnitState(data.t, UNIT_STATE_MAX_LIFE), GetHeroStr(data.cast, true)), false, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
if GetWidgetLife(data.t) <= (GetUnitState(data.t, UNIT_STATE_MAX_LIFE) * (.1 +(.02 * data.lvl))) then
call UnitRemoveAbility(data.t, 'A04P')
call UnitRemoveAbility(data.t, 'A08E')
call UnitRemoveAbility(data.t, 'A08B')
call UnitDamageTargetEx(data.cast, data.t, 66666666., false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special-2.mdx",data.t,"chest"))
call SetUnitPathing(data.t,true)
call SetUnitFlyHeight(data.t,data.oh,1.)
call ReleaseTimer(t)
call data.destroy()
else
if data.dur == 48 then
call SetUnitAnimation(data.cast,"stand victory")
endif
if data.dur >= 85 then
set data.h = data.h - data.hp
set data.dh = data.h + 350.
call SetUnitFlyHeight(data.t, data.h, 0.)
call SetUnitFlyHeight(data.fx, data.dh, 0.)
else
if data.dur >=65 then
if data.dh <= data.h + 350. then
set data.dh = data.h + 350.
else
set data.dh = data.dh - 60
endif
call SetUnitFlyHeight(data.fx, data.dh, 0.)
endif
if data.dur >= 20 then
set data.h = data.h + data.float
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
if data.positive then
set data.float = data.float + 1.
if data.float >= 12. then
set data.positive = false
endif
else
set data.float = data.float - 1.
if data.float <= -12. then
set data.positive = true
endif
endif
else
set data.h = data.h + 15.
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
endif
endif
set data.tx=GetUnitX(data.t)
set data.ty=GetUnitY(data.t)
set data.sx=GetUnitX(data.fx)
set data.sy=GetUnitY(data.fx)
if data.tx!=data.sx then
call SetUnitX(data.fx,data.tx)
endif
if data.ty!=data.sy then
call SetUnitY(data.fx,data.ty)
endif
call XQX(KA,GetUnitX(data.t),GetUnitY(data.t),.0,300.,0,(2))
set data.dur = data.dur + 1
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local Exec data
local timer t
local unit u = GetFilterUnit()
local unit u2
local integer lvl = GetUnitAbilityLevel(CASTER, SPELL_ID)
if UnitAlive(u) and IsUnitEnemy(u, GetOwningPlayer(CASTER)) then
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
set u2 = CreateUnit(GetOwningPlayer(CASTER), 'h007', 0., 0., 0.)
call UnitAddAbility(u2, STUN_ID)
call IssueTargetOrder(u2, "thunderbolt", u)
call UnitApplyTimedLife(u2, 'BTLF', 1.)
set data = Exec.create()
set data.cast = CASTER
set data.t = u
set data.attach = AddSpecialEffectTarget("war3mapImported\\AntiGravityTarget.mdx", u, "origin")
set data.lvl = lvl
set data.dur = 0
set data.float = 3.
set data.positive = true
set data.fx = CreateUnit(GetOwningPlayer(CASTER), 'h00X', GetUnitX(u), GetUnitY(u), 0.)
set data.oh = GetUnitDefaultFlyHeight(data.t)
call UnitAddAbility(data.fx, 'Amrf')
call UnitRemoveAbility(data.fx, 'Amrf')
call SetUnitPathing(data.t,false)
set data.dh = 2000.
set t = NewTimer()
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set u2 = null
set u = null
set t = null
return false
endfunction
private function OnSpell takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP, x, y, AoE(GetUnitAbilityLevel(CASTER, SPELL_ID)), Filter( function FilterActions ) )
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=128
//TESH.alwaysfold=0
scope Execute initializer OnInit
globals
private constant integer SPELL_ID = 'A0BV'
private constant integer STUN_ID = 'A06P'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private constant function Damage takes integer level, real mhp, integer str returns real
return (500. + (50 * level * level)) + (level * str * 5) + (mhp * .03 * level)
endfunction
private constant function AoE takes integer level returns real
return 900. + (30. * level)
endfunction
private struct Exec
unit cast
unit t
effect fx
effect fx2
real h
real dh
real hp
real tx
real ty
real sx
real sy
real oh
integer dur
real float
integer lvl
effect attach
boolean positive
method destroy takes nothing returns nothing
set this.cast = null
set this.t = null
set this.fx = null
set this.fx2 = null
set this.attach = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Exec data = GetTimerData(t)
if data.dur == 90 then
call DestroyEffect(data.attach)
call BlzSetSpecialEffectAlpha(data.fx,0)
call BlzSetSpecialEffectHeight(data.fx,-2000.)
call BlzSetSpecialEffectScale(data.fx,.000001)
call DestroyEffect(data.fx)
call DestroyEffect(data.fx2)
call UnitDamageTargetEx(data.cast, data.t, Damage(data.lvl, GetUnitState(data.t, UNIT_STATE_MAX_LIFE), GetHeroStr(data.cast, true)), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
if GetWidgetLife(data.t) <= (GetUnitState(data.t, UNIT_STATE_MAX_LIFE) * (.1 +(.02 * data.lvl))) then
call UnitRemoveAbility(data.t, 'A04P')
call UnitRemoveAbility(data.t, 'A08E')
call UnitRemoveAbility(data.t, 'A08B')
call UnitRemoveAbility(data.t, 'B06P')
call SetUnitInvulnerable(data.t, false)
call UnitDamageTargetEx(data.cast, data.t, 66666666., false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
endif
if IsQoBTyrael[GetUnitUserData(data.cast)] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Shining Flare.mdx",data.t,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heaven's Gate.mdx",data.t,"origin"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodEX-Special-2.mdx",data.t,"chest"))
endif
call SetUnitPathing(data.t,true)
call SetUnitFlyHeight(data.t,data.oh,1.)
call ReleaseTimer(t)
call data.destroy()
else
if data.dur == 48 then
call SetUnitAnimation(data.cast,"stand victory")
endif
if data.dur >= 85 then
set data.h = data.h - data.hp
set data.dh = data.h + 350.
call SetUnitFlyHeight(data.t, data.h, 0.)
call BlzSetSpecialEffectHeight(data.fx,data.dh)
else
if data.dur >=65 then
if data.dh <= data.h + 350. then
set data.dh = data.h + 350.
else
set data.dh = data.dh - 60
endif
call BlzSetSpecialEffectHeight(data.fx,data.dh)
endif
if data.dur >= 20 then
set data.h = data.h + data.float
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
if data.positive then
set data.float = data.float + 1.
if data.float >= 12. then
set data.positive = false
endif
else
set data.float = data.float - 1.
if data.float <= -12. then
set data.positive = true
endif
endif
else
set data.h = data.h + 15.
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
endif
endif
set data.tx=GetUnitX(data.t)
set data.ty=GetUnitY(data.t)
set data.sx=BlzGetLocalSpecialEffectX(data.fx)
set data.sy=BlzGetLocalSpecialEffectY(data.fx)
if data.tx!=data.sx then
call BlzSetSpecialEffectX(data.fx,data.tx)
endif
if data.ty!=data.sy then
call BlzSetSpecialEffectY(data.fx,data.ty)
endif
//if IsQoBTyrael[GetUnitUserData(data.cast)] and GetRandomInt(0,100)<=20 then
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Smite.mdx",data.tx,data.ty))
//endif
call XQX(KA,GetUnitX(data.t),GetUnitY(data.t),.0,300.,0,(2))
set data.dur = data.dur + 1
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local Exec data
local timer t
local unit u = GetFilterUnit()
local unit u2
local integer lvl = GetUnitAbilityLevel(CASTER, SPELL_ID)
if UnitAlive(u) and IsUnitEnemy(u, GetOwningPlayer(CASTER)) then
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
set u2 = CreateUnit(GetOwningPlayer(CASTER), 'h007', 0., 0., 0.)
call UnitAddAbility(u2, STUN_ID)
call IssueTargetOrder(u2, "thunderbolt", u)
call UnitApplyTimedLife(u2, 'BTLF', 1.)
set data = Exec.create()
set data.cast = CASTER
set data.t = u
//if IsQoBTyrael[GetUnitUserData(data.cast)] then
set data.attach = AddSpecialEffectTarget("war3mapImported\\Bondage Gold HD.mdx", u, "origin")
//else
// set data.attach = AddSpecialEffectTarget("war3mapImported\\Bondage Red HD.mdx", u, "origin")
//endif
set data.lvl = lvl
set data.dur = 0
set data.float = 3.
set data.positive = true
if IsQoBTyrael[GetUnitUserData(data.cast)] then
set data.fx2= AddSpecialEffect("war3mapImported\\Heaven's Gate Channel.mdx",GetUnitX(u), GetUnitY(u))
else
set data.fx2= AddSpecialEffect("war3mapImported\\Fountain of Souls_opt.mdx",GetUnitX(u), GetUnitY(u))
endif
call BlzSetSpecialEffectScale(data.fx2,.85)
set data.fx = AddSpecialEffect("war3mapImported\\ExtremeSword.mdl",GetUnitX(u), GetUnitY(u))
call BlzSetSpecialEffectZ(data.fx,-2000.)
call BlzSetSpecialEffectPitch(data.fx,90.*bj_DEGTORAD)
call BlzSetSpecialEffectHeight(data.fx,-2000.)
call BlzSetSpecialEffectScale(data.fx,.000001)
call BlzSetSpecialEffectAlpha(data.fx,0)
call BlzSetSpecialEffectHeight(data.fx,2000.)
call BlzSetSpecialEffectPitch(data.fx,-270.*bj_DEGTORAD)
call BlzSetSpecialEffectRoll( data.fx, 10.*bj_DEGTORAD)
call BlzSetSpecialEffectYaw( data.fx, 0.)
call BlzSetSpecialEffectScale(data.fx,3.)
call BlzSetSpecialEffectAlpha(data.fx,255)
set data.oh = GetUnitDefaultFlyHeight(data.t)
//call UnitAddAbility(data.fx, 'Amrf')
//call UnitRemoveAbility(data.fx, 'Amrf')
call SetUnitPathing(data.t,false)
set data.dh = 2000.
set t = NewTimer()
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set u2 = null
set u = null
set t = null
return false
endfunction
private function OnSpell takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP, x, y, AoE(GetUnitAbilityLevel(CASTER, SPELL_ID)), Filter( function FilterActions ) )
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=128
//TESH.alwaysfold=0
scope Execute initializer OnInit
globals
private constant integer SPELL_ID = 'A0BV'
private constant integer STUN_ID = 'A06P'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private constant function Damage takes integer level, real mhp, integer str returns real
return (500. + (50 * level * level)) + (level * str * 5) + (mhp * .03 * level)
endfunction
private constant function AoE takes integer level returns real
return 900. + (30. * level)
endfunction
private struct Exec
unit cast
unit t
effect fx
real h
real dh
real hp
real tx
real ty
real sx
real sy
real oh
integer dur
real float
integer lvl
effect attach
boolean positive
method destroy takes nothing returns nothing
set this.cast = null
set this.t = null
set this.fx = null
set this.attach = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Exec data = GetTimerData(t)
if data.dur == 90 then
call DestroyEffect(data.attach)
call BlzSetSpecialEffectTimeScale(data.fx,1000.)
call BlzSetSpecialEffectTime(data.fx,1000.)
call DestroyEffect(data.fx)
call UnitDamageTargetEx(data.cast, data.t, Damage(data.lvl, GetUnitState(data.t, UNIT_STATE_MAX_LIFE), GetHeroStr(data.cast, true)), false, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
if GetWidgetLife(data.t) <= (GetUnitState(data.t, UNIT_STATE_MAX_LIFE) * (.1 +(.02 * data.lvl))) then
call UnitRemoveAbility(data.t, 'A04P')
call UnitRemoveAbility(data.t, 'A08E')
call UnitRemoveAbility(data.t, 'A08B')
call UnitDamageTargetEx(data.cast, data.t, 66666666., false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("BigBloodEX-NoSplat-NoGutz.mdx",data.t,"chest"))
call SetUnitPathing(data.t,true)
call SetUnitFlyHeight(data.t,data.oh,1.)
call ReleaseTimer(t)
call data.destroy()
else
if data.dur == 48 then
call SetUnitAnimation(data.cast,"stand victory")
endif
if data.dur >= 85 then
set data.h = data.h - data.hp
set data.dh = data.h + 350.
call SetUnitFlyHeight(data.t, data.h, 0.)
call BlzSetSpecialEffectZ(data.fx, data.dh)
else
if data.dur >=65 then
if data.dh <= data.h + 350. then
set data.dh = data.h + 350.
else
set data.dh = data.dh - 60
endif
call BlzSetSpecialEffectZ(data.fx, data.dh)
endif
if data.dur >= 20 then
set data.h = data.h + data.float
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
if data.positive then
set data.float = data.float + 1.
if data.float >= 12. then
set data.positive = false
endif
else
set data.float = data.float - 1.
if data.float <= -12. then
set data.positive = true
endif
endif
else
set data.h = data.h + 15.
set data.hp = data.h / 5.
call SetUnitFlyHeight(data.t, data.h, .0)
endif
endif
set data.tx=GetUnitX(data.t)
set data.ty=GetUnitY(data.t)
set data.sx=BlzGetLocalSpecialEffectX(data.fx)
set data.sy=BlzGetLocalSpecialEffectY(data.fx)
if data.tx!=data.sx then
call BlzSetSpecialEffectX(data.fx,data.tx)
endif
if data.ty!=data.sy then
call BlzSetSpecialEffectY(data.fx,data.ty)
endif
call XQX(KA,GetUnitX(data.t),GetUnitY(data.t),.0,300.,0,(2))
set data.dur = data.dur + 1
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local Exec data
local timer t
local unit u = GetFilterUnit()
local unit u2
local integer lvl = GetUnitAbilityLevel(CASTER, SPELL_ID)
if UnitAlive(u) and IsUnitEnemy(u, GetOwningPlayer(CASTER)) then
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
set u2 = CreateUnit(GetOwningPlayer(CASTER), 'h007', 0., 0., 0.)
call UnitAddAbility(u2, STUN_ID)
call IssueTargetOrder(u2, "thunderbolt", u)
call UnitApplyTimedLife(u2, 'BTLF', 1.)
set data = Exec.create()
set data.cast = CASTER
set data.t = u
set data.attach = AddSpecialEffectTarget("war3mapImported\\AntiGravityTarget.mdx", u, "origin")
set data.lvl = lvl
set data.dur = 0
set data.float = 3.
set data.positive = true
set data.fx =AddSpecialEffect("war3mapImported\\ExtremeSword.mdx",GetUnitX(u), GetUnitY(u))
set data.oh = GetUnitDefaultFlyHeight(data.t)
call BlzSetSpecialEffectZ(data.fx,2000.)
call BlzSetSpecialEffectPitch(data.fx,90.*bj_DEGTORAD)
call BlzSetSpecialEffectScale(data.fx,2.5)
call SetUnitPathing(data.t,false)
set data.dh = 2000.
set t = NewTimer()
call SetTimerData(t, data)
call TimerStart(t, .03125, false, function Handler)
endif
set u2 = null
set u = null
set t = null
return false
endfunction
private function OnSpell takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP, x, y, AoE(GetUnitAbilityLevel(CASTER, SPELL_ID)), Filter( function FilterActions ) )
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope Voracity initializer OnInit
globals
trigger VORACITYP
integer array VoracityInt
private constant integer SPELL_ID = 'A0B5'
private constant integer SPELL_ID2 = 'A0D4'
private constant integer ARM_ID = 'A0B5'
endglobals
private struct VA
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local VA data = GetTimerData(t)
if GetUnitTypeId(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))]) != 'E006' or LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] != data.u then
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
if UnitAlive(data.u) then
if VoracityInt[GetPlayerId(GetOwningPlayer(data.u))] > 0 then
set VoracityInt[GetPlayerId(GetOwningPlayer(data.u))] = VoracityInt[GetPlayerId(GetOwningPlayer(data.u))] - 1
else
if GetUnitAbilityLevel(data.u,ARM_ID) == 6 then
call UnitRemoveAbility(data.u,'A0BW')
endif
call SetUnitAbilityLevel(data.u,ARM_ID,GetUnitAbilityLevel(data.u,ARM_ID) - 1)
call SetUnitAbilityLevel(data.u,SPELL_ID2,GetUnitAbilityLevel(data.u,SPELL_ID2) - 1)
endif
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
endif
endif
set t= null
endfunction
private function Actions takes nothing returns nothing
local timer t
local VA data
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(u,ARM_ID) < 21 then
if GetUnitAbilityLevel(u,ARM_ID) == 5 then
call UnitAddAbility(u,'A0BW')
endif
call SetUnitAbilityLevel(u,ARM_ID,GetUnitAbilityLevel(u,ARM_ID) + 1)
call SetUnitAbilityLevel(u,SPELL_ID2,GetUnitAbilityLevel(u,SPELL_ID2) + 1)
set t = NewTimer()
set data = VA.create()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,5.,false,function Handler)
endif
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and UnitAlive(GetEventDamageSource()) and GetUnitAbilityLevel(GetEventDamageSource(),'A0B5') < 21 and GetEventDamage() > 0 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set VORACITYP=CreateTrigger()
call TriggerAddCondition(VORACITYP,Condition(function Conditions))
call MOE(II,(VORACITYP))
call DisableTrigger(VORACITYP)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
// Instance Iterator by Garfield1337
// Iterates struct instances, for more info, check T32
// Usage:
// -Implement II module
// -Add a method named "execute" above the module implementation that doesn't
// take any arguments, this method will be called each iteration
// -call start() method to start iterating an instance
// -call end() method to stop
library II
globals
private trigger t = CreateTrigger()
private integer C = 0 //Global instance count
private timer l = CreateTimer()
endglobals
private function e takes nothing returns nothing
call TriggerEvaluate(t)
endfunction
module II
private static thistype array I
private static integer c = 0 //Struct type individual instance count
private integer i //Instance's index, position in array
private boolean b = false
method start takes nothing returns boolean
if not .b then
if C==0 then
call TimerStart(l,0.031250000,true,function e) //ResumeTimer() doesn't seem to work on a looping timer
endif
set C=C+1
set .c=.c+1
set .I[.c]=this
set .i=.c
set .b=true
return true
endif
return false
endmethod
method end takes nothing returns boolean
if .b then
set C=C-1
if C==0 then
call PauseTimer(l)
elseif .i!=.c then //If the instance is not last in the array, the last one is moved to it's position
set .I[.i] =.I[.c]
set .I[.i].i=.i
endif
set .c=.c-1
set .b=false
return true
endif
return false
endmethod
private static method p takes nothing returns boolean
local integer n=.c
loop
exitwhen n==0
call .I[n].execute()
set n=n-1
endloop
return false
endmethod
private static method onInit takes nothing returns nothing
call TriggerAddCondition(t,Condition(function thistype.p))
endmethod
endmodule
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Z
globals
private location l = Location(0.00,0.00)
endglobals
function GetUnitZ takes unit u returns real //If there's another GetUnitZ function in the map, you may delete this one
call MoveLocation(l,GetUnitX(u),GetUnitY(u))
return GetLocationZ(l) + GetUnitFlyHeight(u)
endfunction
function GetZ takes real x, real y returns real
call MoveLocation(l,x,y)
return GetLocationZ(l)
endfunction
endlibrary
//TESH.scrollpos=239
//TESH.alwaysfold=0
library Roflcopter requires TimerUtils, II, SpellEffectEvent, Z
//Configurables and whatnot
globals
private constant integer SPELL_RAW = 'A0OZ'
private constant string EXPLOSION_EFFECT = "war3mapImported\\Nature Blast - Classic.mdl"
private constant real HEIGHT = 350.0 //Roflcopter height
private constant real SPIN_PERIOD = 0.16 //Period between each propeller change
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_CHAOS
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_UNIVERSAL
private constant weapontype WEAPON_TYPE = WEAPON_TYPE_WHOKNOWS
endglobals
private constant function DAMAGE takes unit caster,integer lvl, integer agi, integer int returns real
return lvl * 1.25 *(agi+int) //Damage dependency of level.
//You can also make damage depend on caster's stats by refering to unit variable 'caster'
endfunction
private constant function TRAVEL_LENGTH takes integer lvl returns real
return 1400. //How long does roflcopter fly
endfunction
private constant function BOMB_PERIOD takes integer lvl returns real
return 0.25 //How often will roflcopter throw bombs
endfunction
private constant function BOMB_AOE takes integer lvl returns real
return 200. //Area of effect for bomb explosion
endfunction
private constant function ROFLCOPTER_SPEED takes integer lvl returns real
return 7. //Movement speed or roflcopter
endfunction
private constant function BOMB_SPEED takes integer lvl returns real
return 7. //Fall speed of bombs
endfunction
private function FILTER takes unit caster,unit target,integer lvl returns boolean
if UnitAlive(target) then
if IsUnitEnemy(target,GetOwningPlayer(caster)) then
return true
else
call SetWidgetLife(target,GetWidgetLife(target)+(lvl * 1.25 *(GetHeroAgi(caster,true)+GetHeroInt(caster,true))))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Green.mdx",target,"origin"))
return false
endif
endif
return false
//and IsUnitType(target,UNIT_TYPE_GROUND)
//and not IsUnitType(target,UNIT_TYPE_DEAD)
endfunction
private function EFFECTS takes unit caster,unit target,real x,real y,real z,integer lvl returns nothing
//You can add here anything you want to happen on explosion given the above arguments
//For example, you can set damaged targets on fire with a spell casted by dummy or something
endfunction
//Don't change stuff below
//===================================================================
globals
private constant string R1 = "|c0000ff00 ___\n / /`\n /\t/ . . -_\\\n ,( ( : ' /`\n \\\\' '. _\\ __\n __/\t/ \\\\ /` _____/ / --\n --o -----_^/\t/ \\^^ ---'\n`----^---- ' ( ._____( /--\n \\\\_,____\\ \\/__,\n \\^/ \\-^-/|r"
private constant string R2 = "|c0000ff00 __\n __/\t/ _____/ /--\n --o -----_^^^^^^^^^^ ---'\n`----^----' ( \\ \\ /( /--\n \\/\t/ _\\,_\\\\/__,\n /\t/,' / \\-^-/\n `(( : , _ \\,\n \\\\ ' ' /\n \\___\\\n|r"
private constant string R3 = "|c0000ff00 ___\n '\\ \\\n /_-. . \\\\\n '\\ ' : )).\n __ /_ .''/\t/\n \\ \\_____ '\\ /\t/ \\\\__\n `--- ^^/ \\\\^_----- o--\n --\\ )_____. )`----^----'\n ,__\\/\t/____,_/\t/\n \\-^-/ \\^/|r"
private constant string R4 = "|c0000ff00__\n --\\\\_____ \\\\__\n `--- ^^^^^^^^^^_----- o--\n --\\ )\\ /\t/ (`----^----'\n ,__\\/\t/_,_ \\\\/\n \\-^-/ \\ `,\\\\\n ,/_ , : ))'\n \\ ' ' /\t/\n /___/\n '|r"
private constant real DEVIATION = 100.0
endglobals
private keyword roflcopter
private struct instance
integer n
unit u
real bs
real rs
real d
real a
integer lv
method add takes nothing returns nothing
set .n = .n + 1
endmethod
method sub takes nothing returns nothing
set .n = .n - 1
if .n == 0 then
call .destroy()
endif
endmethod
static method create takes unit u,real x,real y returns thistype
local thistype this = thistype.allocate()
local integer l = GetUnitAbilityLevel(u,SPELL_RAW)
set .u = u
set .bs = BOMB_SPEED(l)
set .rs = ROFLCOPTER_SPEED(l)
set .d = DAMAGE(u,l,GetHeroAgi(u,true),GetHeroInt(u,true))
set .a = BOMB_AOE(l)
set .lv = l
call roflcopter.create(this,x,y,TRAVEL_LENGTH(l),BOMB_PERIOD(l))
return this
endmethod
endstruct
private keyword bomb
private struct roflcopter
texttag t = CreateTextTag()
instance i
real x
real y
real l
real a
timer bp
timer sp
integer p
method execute takes nothing returns nothing
set .x = .x + .i.rs * Cos(.a)
set .y = .y + .i.rs * Sin(.a)
call SetTextTagPos(.t,.x - DEVIATION,.y,HEIGHT)
set .l = .l - .i.rs
if .l <= 0 then
call .destroy()
endif
endmethod
implement II
static method bombdrop takes nothing returns nothing
local thistype this = thistype(GetTimerData(GetExpiredTimer()))
call bomb.create(.i,.x,.y,HEIGHT)
endmethod
static method spin takes nothing returns nothing
local thistype this = thistype(GetTimerData(GetExpiredTimer()))
if .p == 1 then
call SetTextTagText(.t,R2,0.0184)
set .p = 2
elseif .p == 2 then
call SetTextTagText(.t,R1,0.0184)
set .p = 1
elseif .p == 3 then
call SetTextTagText(.t,R4,0.0184)
set .p = 4
else
call SetTextTagText(.t,R3,0.0184)
set .p = 3
endif
endmethod
static method create takes instance i,real x,real y,real l,real p returns thistype
local thistype this = thistype.allocate()
local real a = Atan2(y - GetUnitY(i.u),x - GetUnitX(i.u))
if a < 0 then
set a = 2 * bj_PI + a
endif
set .i = i
set .l = l
set .a = a + bj_PI / 2
set .bp = NewTimer()
call TimerStart(.bp,p,true,function thistype.bombdrop)
call SetTimerData(.bp,this)
set .sp = NewTimer()
call TimerStart(.sp,SPIN_PERIOD,true,function thistype.spin)
call SetTimerData(.sp,this)
call SetTextTagPermanent(.t,false)
call SetTextTagVisibility(.t,true)
set .x = x + l / 2 * Cos(a - bj_PI / 2) - DEVIATION
set .y = y + TRAVEL_LENGTH(i) / 2 * Sin(a - bj_PI / 2)
call SetTextTagPos(.t,.x,.y,HEIGHT)
if a < bj_PI then
set .p = 1
call SetTextTagText(.t,R1,0.0184)
else
set .p = 3
call SetTextTagText(.t,R3,0.0184)
endif
call .start()
call .i.add()
return this
endmethod
method destroy takes nothing returns nothing
call DestroyTextTag(.t)
call ReleaseTimer(.bp)
call ReleaseTimer(.sp)
call .end()
call .i.sub()
call .deallocate()
endmethod
endstruct
private struct bomb
static thistype This
static group g = CreateGroup()
texttag t = CreateTextTag()
instance i
real x
real y
real h
method execute takes nothing returns nothing
set .h = .h - .i.bs
call SetTextTagPos(.t,.x,.y,.h)
if .h <= 3.00 then
call .destroy()
endif
endmethod
implement II
static method create takes instance i,real x,real y,real h returns thistype
local thistype this = thistype.allocate()
set .i = i
set .x = x
set .y = y
set .h = h
call SetTextTagPermanent(.t,false)
call SetTextTagVisibility(.t,true)
call SetTextTagPos(.t,x,y,h)
call SetTextTagText(.t,"|c00055f1a*|r",0.04)
call .start()
call .i.add()
return this
endmethod
static method explosion takes nothing returns boolean
local thistype this = .This
local unit u = GetFilterUnit()
local real x
local real y
local real z
local real z2
if FILTER(.i.u,u,.i.lv) then
set x = GetUnitX(u) - .x
set y = GetUnitY(u) - .y
set z2 = GetZ(.x,.y) + .h
set z = GetUnitZ(u) - z2
if x*x+y*y+z*z <= .i.a*.i.a then
//if IsUnitAlly(.u,GetOwningPlayer(u))then
//call SetWidgetLife(u,GetWidgetLife(u)+d)
//else
call UnitDamageTarget(.i.u,u,.i.d,false,false,ATTACK_TYPE,DAMAGE_TYPE,WEAPON_TYPE)
//endif
call EFFECTS(.i.u,u,.x,.y,z2,.i.lv)
endif
endif
set u = null
return false
endmethod
method destroy takes nothing returns nothing
call DestroyTextTag(.t)
call DestroyEffect(AddSpecialEffect(EXPLOSION_EFFECT,.x,.y))
set .This = this
call GroupEnumUnitsInRange(.g,.x,.y,.i.a,Filter(function thistype.explosion))
call .end()
call .i.sub()
call .deallocate()
endmethod
endstruct
public function ROFL_Cast takes unit u, real x, real y returns nothing
call instance.create(u,x,y)
endfunction
endlibrary
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope ChaosRIFT initializer OnInit
globals
private constant group TENTACLEGROUP = CreateGroup( )
private unit TENTACASTER
private constant integer SPELL_ID = 'A0MG'
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
group g
effect fx1
integer current
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
set this.fx1 = null
call this.deallocate()
endmethod
endstruct
private function TentacleActions0 takes nothing returns noting
local unit u = GetEnumUnit()
if UnitAlive(u) and I
set u = null
endfunction
private function Tentacles takes unit c, real x, real y,integer lvl returns nothing
local integer li = 0
local real x2
local real y2
local real x = GetUnitX(c)
local real y = GetUnitY(c)
local integer ri
loop
exitwhen li >20
set x2 = x + GetRandomReal(0.,800.) * Cos(GetRandomReal(0.,360.) * bj_DEGTORAD)
set y2 = y + GetRandomReal(0.,800.) * Sin(GetRandomReal(0.,360.)* bj_DEGTORAD)
set ri = GetRandomInt(0,2)
if ri == 0 then
set TENTACASTER=c
call GroupEnumUnitsInRange( TENTACLEGROUP , x2, y2, 400., Filter( function TentacleActions0 ) )
endif
if ri == 1 then
endif
if ri == 2 then
endif
set li = li + 1
endloop
endfunction
private function Actions takes nothing returns nothing
local integer i = GetRandomInt(0,99)
local unit c = GetTriggerUnit()
local integer li = 0
local integer lvl = GetUnitAbilityLevel(c,SPELL_ID)
local real x1 = GetUnitX(c)
local real y1 = GetUnitY(c)
local real x2
local real y2
if i <=4 then
loop
exitwhen li > 10 + lvl
set x2 = x1 + GetRandomReal(0.,800.) * Cos(GetRandomReal(0.,360.) * bj_DEGTORAD)
set y2 = y1 + GetRandomReal(0.,800.) * Sin(GetRandomReal(0.,360.)* bj_DEGTORAD)
call Roflcopter_ROFL_Cast(c,x2,y2)
set li = li + 1
endloop
endif
if i>4 and i <=9 then
call Tentacles(c,x1,y1,lvl)
endif
if i>9 and i <=14 then
endif
if i>14 and i <=19 then
endif
if i>19 and i <=24 then
endif
if i>24 and i <=29 then
endif
if i>29 and i <=34 then
endif
if i>34 and i <=39 then
endif
if i>39 and i <=44 then
endif
if i>44 and i <=49 then
endif
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope NaturesRedress initializer OnInit
globals
private constant integer SPELL_ID = 'B06K'
trigger NREDRESS
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local integer i = GetPlayerId(GetOwningPlayer(a)) + 1
local unit u = GetTriggerUnit()
if (GetUnitAbilityLevel(LC[i],SPELL_ID) != 0 or GetUnitAbilityLevel(a,SPELL_ID) != 0) and GetEventDamage() > 0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
if GetUnitAbilityLevel(a,'Aloc') == 1 then
set a = LC[i]
endif
call SetWidgetLife(a,GetWidgetLife(a)+(GetEventDamage()*.05))
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\VampiricAuraTargetGreen.mdx", a, "origin" ) )
endif
else
if GetUnitAbilityLevel(a,'Aloc') == 1 then
set a = LC[i]
endif
call SetWidgetLife(a,GetWidgetLife(a)+(GetEventDamage()*.05))
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\VampiricAuraTargetGreen.mdx", a, "origin" ) )
endif
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set NREDRESS= CreateTrigger()
call MOE(II, (NREDRESS))
call TriggerAddCondition(NREDRESS, Condition(function Actions))
call DisableTrigger(NREDRESS)
endfunction
endscope
//TESH.scrollpos=8
//TESH.alwaysfold=0
scope NaturesBounty initializer OnInit
globals
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit f = GetFilterUnit()
local boolean b
if UnitAlive(f) and IsUnitAlly(CASTER,GetOwningPlayer(f)) and not IsUnitInGroup(f,GROUP) and GetUnitAbilityLevel(f,'Aloc') != 1 and not BlzIsUnitInvulnerable(f) then
set b = true
else
set b = false
endif
set f = null
return b
endfunction
private function Actions takes nothing returns nothing
local unit OIX = GetTriggerUnit()
local unit EXX = GetEventDamageSource()
local real OAX
local real ONX
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
local integer i = 0
local real d
if GetEventDamage() >= 1 and OIX != EXX and NaturesAbundanceS[GetUnitUserData(OIX)]>=1 and GetUnitAbilityLevel(OIX,'A0OT') !=0 then
if(J5V[(ROX((GetUnitTypeId(EXX))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
set d = GetUnitAbilityLevel(NaturesAbundanceC[GetUnitUserData(OIX)],'A0OS') * (GetHeroAgi(NaturesAbundanceC[GetUnitUserData(OIX)],true)+GetHeroInt(NaturesAbundanceC[GetUnitUserData(OIX)],true))
if GetUnitAbilityLevel(EXX,'Aloc') == 1 then
set EXX = LC[1+GetPlayerId(GetOwningPlayer(EXX))]
endif
set NaturesAbundanceS[GetUnitUserData(OIX)] = NaturesAbundanceS[GetUnitUserData(OIX)] - 1
if NaturesAbundanceS[GetUnitUserData(OIX)] == 0 then
call UnitRemoveAbility(OIX,'A0OT')
call UnitRemoveAbility(OIX,'A0OU')
endif
call DestroyEffect( AddSpecialEffectTarget( "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl", OIX, "origin") )
set OAX=GetUnitX(OIX)
set ONX=GetUnitY(OIX)
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(Atan2(GetUnitY(EXX) - ONX, GetUnitX(EXX) - OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(EXX)
call V9X(OMX,"war3mapImported\\GaiaMissle.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G3V[OMX]=d
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,550.)
call GroupAddUnit(GROUP,EXX)
loop
exitwhen i == 3 or EXX == null
set CASTER = EXX
set EXX = ZEE(null,OAX,ONX,800.,Condition(function FilterActions))
if EXX != null then
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(Atan2(GetUnitY(EXX) - ONX, GetUnitX(EXX) - OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(EXX)
call V9X(OMX,"war3mapImported\\GaiaMissle.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G3V[OMX]=d
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,550.)
call GroupAddUnit(GROUP,EXX)
endif
set i = i + 1
endloop
call GroupClear(GROUP)
endif
else
set d = GetUnitAbilityLevel(NaturesAbundanceC[GetUnitUserData(OIX)],'A0OS') * (GetHeroAgi(NaturesAbundanceC[GetUnitUserData(OIX)],true)+GetHeroInt(NaturesAbundanceC[GetUnitUserData(OIX)],true))
if GetUnitAbilityLevel(EXX,'Aloc') == 1 then
set EXX = LC[1+GetPlayerId(GetOwningPlayer(EXX))]
endif
set NaturesAbundanceS[GetUnitUserData(OIX)] = NaturesAbundanceS[GetUnitUserData(OIX)] - 1
if NaturesAbundanceS[GetUnitUserData(OIX)] == 0 then
call UnitRemoveAbility(OIX,'A0OT')
call UnitRemoveAbility(OIX,'A0OU')
endif
call DestroyEffect( AddSpecialEffectTarget( "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl", OIX, "origin") )
set OAX=GetUnitX(OIX)
set ONX=GetUnitY(OIX)
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(Atan2(GetUnitY(EXX) - ONX, GetUnitX(EXX) - OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(EXX)
call V9X(OMX,"war3mapImported\\GaiaMissle.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G3V[OMX]=d
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,550.)
call GroupAddUnit(GROUP,EXX)
loop
exitwhen i == 3 or EXX == null
set CASTER = EXX
set EXX = ZEE(null,OAX,ONX,800.,Condition(function FilterActions))
if EXX != null then
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(Atan2(GetUnitY(EXX) - ONX, GetUnitX(EXX) - OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(EXX)
call V9X(OMX,"war3mapImported\\GaiaMissle.mdx")
call V8X(OMX,1.)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G3V[OMX]=d
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,550.)
call GroupAddUnit(GROUP,EXX)
endif
set i = i + 1
endloop
call GroupClear(GROUP)
endif
endif
set OIX=null
set EXX=null
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call MOE(II, (trig))
call TriggerAddCondition(trig, Condition(function Actions))
endfunction
endscope
scope NaturesShadow initializer OnInit
globals
private constant integer SPELL_ID = 'A0OY'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit s= CreateUnit(GetOwningPlayer(u),'n040',x,y,GetUnitFacing(u))
local integer hp = BlzGetUnitMaxHP(u)
local real armor = BlzGetUnitArmor(u)
local integer damage = GetUnitAbilityLevel(u,SPELL_ID) * (GetHeroAgi(u,true)+GetHeroInt(u,true))
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\Earthshock.mdx", s, "origin") )
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\Earthshock.mdx", u, "origin") )
call BlzSetUnitMaxHP(s,hp*R2I(1.+(.2*GetUnitAbilityLevel(u,SPELL_ID))))
call SetWidgetLife(s,hp*(1.+(.2*GetUnitAbilityLevel(u,SPELL_ID))))
call BlzSetUnitArmor(s,armor)
call BlzSetUnitBaseDamage(s,damage,0)
call UnitApplyTimedLife(s,'BTLF',10.)
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=8
//TESH.alwaysfold=0
scope NaturesViolation initializer OnInit
globals
private constant integer SPELL_ID = 'A0OX'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct NV
unit c
real dmg
integer i
group g
effect fx
static method create takes nothing returns NV
local NV data = NV.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
set this.fx = null
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit f = GetFilterUnit()
local boolean b
if UnitAlive(f) and IsUnitEnemy(CASTER,GetOwningPlayer(f)) and not IsUnitInGroup(f,GROUP) and GetUnitAbilityLevel(f,'Aloc') != 1 and not IsUnitType(f,UNIT_TYPE_MAGIC_IMMUNE) and not BlzIsUnitInvulnerable(f) then
set b = true
else
set b = false
endif
set f = null
return b
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local NV data = GetTimerData(t)
local unit OIX = data.c
local real OAX = GetUnitX(OIX)
local real ONX = GetUnitY(OIX)
local unit EXX = null
local real OJX=.0
local real OKX=.0
local real OLX=.0
local integer OMX=0
local integer i = 0
local real d
if data.i == 0 then
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i -1
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Seed Squirt Classic.mdx", OIX, "origin"))
loop
exitwhen i == 8
set GROUP = data.g
set CASTER = data.c
set EXX = ZEE(null,OAX,ONX,700.,Condition(function FilterActions))
if EXX != null then
call MoveLocation(EB,OAX,ONX)
set OMX=XAX(OAX,ONX,64.,Deg2Rad(Atan2(GetUnitY(EXX) - ONX, GetUnitX(EXX) - OAX)))
set GZV[OMX]=OIX
set G_V[OMX]=GetOwningPlayer(EXX)
call V9X(OMX,"war3mapImported\\Seed Shot.mdx")
call V8X(OMX,.6)
set G4V[OMX]=20.
set G9V[OMX]=true
set G2V[OMX]=60.
set G3V[OMX]=data.dmg
set G8V[OMX]=true
set HVV[OMX]=true
set HOV[OMX]=true
set HXV[OMX]=false
set G1V[OMX]=64.
set G0V[OMX]=64.
set HCV[OMX]=(6)
call EMX(OMX,G1V[OMX])
call MoveLocation(EB,OJX,OKX)
call EEX(OMX,EXX)
set HEV[OMX]=true
call XRX(OMX,OJX,OKX,GetUnitFlyHeight(EXX)+65.,750.)
call GroupAddUnit(data.g,EXX)
endif
set i = i + 1
endloop
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
set OIX=null
set EXX=null
endfunction
private function Actions takes nothing returns nothing
local NV data = NV.create()
local timer t = NewTimer()
set data.c = GetTriggerUnit()
set data.i = 5
set data.dmg = GetUnitAbilityLevel(data.c,SPELL_ID)*(GetHeroAgi(data.c,true)+GetHeroInt(data.c,true))*1.75
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=99
//TESH.alwaysfold=0
scope NaturesDragonflight initializer OnInit
globals
private constant integer SPELL_ID = 'A0OZ'
endglobals
private function Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer li = 0
local integer lvl = GetUnitAbilityLevel(c,SPELL_ID)
local real x1 = GetUnitX(c)
local real y1 = GetUnitY(c)
local real x2
local real y2
loop
exitwhen li > 3 + (lvl/2)
set x2 = x1 + GetRandomReal(0.,800.) * Cos(GetRandomReal(0.,360.) * bj_DEGTORAD)
set y2 = y1 + GetRandomReal(0.,800.) * Sin(GetRandomReal(0.,360.)* bj_DEGTORAD)
call Roflcopter_ROFL_Cast(c,x2,y2)
set li = li + 1
endloop
set c = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope NaturesBountyDeathRemoval initializer OnInit
private function OnSpell takes nothing returns boolean
local unit d = GetTriggerUnit()
if NaturesAbundanceS[GetUnitUserData(d)]>= 1 then
set NaturesAbundanceS[GetUnitUserData(d)] = 0
call UnitRemoveAbility(d,'A0OT')
endif
set d= null
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope ViridianStrike initializer OnInit
globals
private constant group GROUP = CreateGroup( )
private group GROUP2
private unit CASTER
private real DAMAGE
private constant integer SPELL_ID = 'A0OS'
unit array NaturesAbundanceC
integer array NaturesAbundanceS
private constant string EFFECT = "war3mapImported\\Firebrand Shot Green.mdx"
private constant string ATTACH_POINT = "chest"
boolean array UnitIsCasting
endglobals
private struct TempA
unit c
real dmg
real x
real y
real a
integer current
group g
//effect fx1
//effect fx2
effect fx3
static method create takes nothing returns TempA
local TempA data = TempA.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
set this.c = null
//set this.fx1 = null
//set this.fx2 = null
set this.fx3 = null
call DestroyGroup(this.g)
set this.g = null
call this.deallocate()
endmethod
endstruct
private function GroupActions takes nothing returns nothing
local unit u = GetEnumUnit()
set NaturesAbundanceC[GetUnitUserData(u)] = CASTER
if NaturesAbundanceS[GetUnitUserData(u)] == 0 then
call UnitAddAbility(u,'A0OT')
call UnitAddAbility(u,'A0OU')
endif
set NaturesAbundanceS[GetUnitUserData(u)] = NaturesAbundanceS[GetUnitUserData(u)] + 3
call DestroyEffect( AddSpecialEffectTarget( "war3mapImported\\Earthshock.mdx", u, "origin") )
set u = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit( )
if UnitAlive(u) then
if IsUnitEnemy( u, GetOwningPlayer( CASTER ) ) and not IsUnitInGroup( u, GROUP2 ) then
call UnitDamageTargetEx( CASTER, u, DAMAGE + (GetWidgetLife(u)*.1), false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
call GroupAddUnit( GROUP2, u )
call DestroyEffect( AddSpecialEffectTarget( EFFECT, u, ATTACH_POINT ) )
endif
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local TempA data = GetTimerData(t)
if data.current == 60 then
//call DestroyEffect(data.fx1)
//call DestroyEffect(data.fx2)
call DestroyEffect(data.fx3)
call BlzPauseUnitEx(data.c,false)
set UnitIsCasting[GetUnitUserData(data.c)] = false
call SetUnitTimeScale(data.c,1.)
set CASTER = data.c
call ForGroup(data.g,function GroupActions)
call ReleaseTimer(t)
call data.destroy()
else
set data.x = data.x + 10. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 10. * Sin(data.a * bj_DEGTORAD)
call SetUnitX(data.c,data.x)
call SetUnitY(data.c,data.y)
set GROUP2 = data.g
set CASTER = data.c
set DAMAGE = data.dmg
call GroupEnumUnitsInRange( GROUP, data.x, data.y, 190., Filter( function FilterActions ) )
set data.g = GROUP2
set data.current = data.current + 1
call SetTimerData(t,data)
call TimerStart(t,.01,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local TempA data = TempA.create()
local integer lvl
local real dx
local real dy
local integer id
set data.c = GetTriggerUnit()
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.current = 0
set id = GetPlayerId(GetOwningPlayer(data.c))
set dx = MouseX[id]
set dy = MouseY[id]
set data.a = bj_RADTODEG * Atan2(dy - data.y, dx - data.x)
call BlzSetUnitFacingEx(data.c,data.a)
call BlzPauseUnitEx(data.c,true)
set UnitIsCasting[GetUnitUserData(data.c)] = true
//set data.fx1 = AddSpecialEffectTarget("war3mapImported\\Windwalk Necro Soul.mdx",data.c,"weapon left")
//set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Windwalk Necro Soul.mdx",data.c,"weapon right")
set data.fx3 = AddSpecialEffectTarget("war3mapImported\\Windwalk Necro Soul.mdx",data.c,"chest")
set lvl = GetUnitAbilityLevel(data.c,SPELL_ID)
set data.dmg = ((GetHeroAgi(data.c,true)+GetHeroInt(data.c,true))*.2*lvl)
call SetUnitAnimation(data.c,"spell throw")
call SetUnitTimeScale(data.c,2.)
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope NaturesFerocity initializer OnInit
globals
private unit CASTER
private constant group GROUP = CreateGroup( )
private group GROUP2
trigger NFEROCITY
integer array FerocityInt
private constant integer SPELL_ID = 'A0ON'
private constant integer SPELL_ID2 = 'A0D4'
private constant integer HERO_ID = 'U007'
private constant integer ARM_ID = 'A0ON'
private constant integer CLEAVE_ID = 'A0OK'
private constant integer ORB_ID = 'A0OM'
private constant integer BUFF_ID = 'B06F'
endglobals
private struct FCL
unit u
unit d
integer i
group g
real dmg
static method create takes nothing returns FCL
local FCL data = FCL.allocate( )
if data.g == null then
set data.g = CreateGroup( )
endif
return data
endmethod
method destroy takes nothing returns nothing
call GroupClear( this.g )
call DestroyGroup(this.g)
set this.g = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct VA
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
local boolean b
local unit f = GetFilterUnit()
if UnitAlive(f) and IsUnitEnemy(CASTER,GetOwningPlayer(f)) and not IsUnitType(f,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(f,UNIT_TYPE_STRUCTURE) and not IsUnitInGroup(f,GROUP2) and GetUnitAbilityLevel(f,'Aloc') != 1 then
set b = true
else
set b = false
endif
set f = null
return b
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local FCL data = GetTimerData(t)
local effect fx
local unit u = null
//local real z1
//local real z2
//local real x1
//local real x2
//local real y1
//local real y2
//local real z1
//local real z2
if UnitAlive(data.d) then
call UnitDamageTargetEx( data.u, data.d, data.dmg, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
endif
set fx = AddSpecialEffectTarget("war3mapImported\\Psionic Shot Blue.mdx",data.d,"chest")
//set fx = AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",data.d,"chest")
call BlzSetSpecialEffectScale(fx,.75)
call DestroyEffect(fx)
call GroupAddUnit(data.g,data.d)
set CASTER = data.u
set GROUP2 = data.g
set u = ZEE(null,GetUnitX(data.d),GetUnitY(data.d),600.,Condition(function FilterActions))
if data.i == 0 or u == null then
call ReleaseTimer(t)
call data.destroy()
else
set data.i = data.i - 1
//call MoveLocation(LOC,GetUnitX(data.d),GetUnitY(data.d))
//set z1 = GetLocationZ(LOC) + 40.
//call MoveLocation(LOC,GetUnitX(u),GetUnitY(u))
//set z2 = GetLocationZ(LOC) + 30.
//set x1 = GetUnitX(data.d)
//set x2 = GetUnitX(u)
//set y1 = GetUnitY(data.d)
//set y2 = GetUnitY(u)
//set z1 = GetUnitZ(data.d)
//set z2 = GetUnitZ(u)
call TimedL.P2P(AddLightningEx("BLNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+65.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data.d),GetUnitY(data.d),GetUnitZ(data.d)+60.,GetUnitX(u),GetUnitY(u),GetUnitZ(u)+60.),data.d,u,.4,GetUnitZ(data.d)+60.,GetUnitZ(u)+60.,1.,.4)
set data.d = u
call SetTimerData(t,data)
call TimerStart(t,.15,false,function Handler2)
endif
set u = null
set fx = null
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local VA data = GetTimerData(t)
if GetUnitTypeId(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))]) != HERO_ID or LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] != data.u then
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
if UnitAlive(data.u) then
if FerocityInt[GetPlayerId(GetOwningPlayer(data.u))] > 0 then
set FerocityInt[GetPlayerId(GetOwningPlayer(data.u))] = FerocityInt[GetPlayerId(GetOwningPlayer(data.u))] - 1
else
if GetUnitAbilityLevel(data.u,ARM_ID) == 11 then
call UnitRemoveAbility(data.u,CLEAVE_ID)
call UnitAddAbility(data.u,'A0OR')
endif
call SetUnitAbilityLevel(data.u,ARM_ID,GetUnitAbilityLevel(data.u,ARM_ID) - 1)
call SetUnitAbilityLevel(data.u,SPELL_ID2,GetUnitAbilityLevel(data.u,SPELL_ID2) - 1)
endif
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
endif
endif
set t= null
endfunction
private function Actions takes nothing returns nothing
local timer t = null
local VA data = 0
local FCL data2 = 0
local unit u = GetEventDamageSource()
local unit d = GetTriggerUnit()
local timer t2 = null
//local real z1
//local real z2
call UnitRemoveAbility(d,BUFF_ID)
if GetEventDamage() > 0 then
if GetUnitAbilityLevel(u,CLEAVE_ID) == 1 and GetRandomInt(0,99) <= 19 then
set data2 = FCL.create()
set data2.u = u
set data2.d = d
set data2.i = 3 + ((GetHeroInt(data2.u,true)+GetHeroAgi(data2.u,true))/100)
set data2.dmg = (GetHeroAgi(data2.u,true)+GetHeroInt(data2.u,true))+((GetHeroAgi(data2.u,true)+GetHeroInt(data2.u,true))*GetHeroLevel(data2.u)*.1)
//call MoveLocation(LOC,GetUnitX(data2.u),GetUnitY(data2.u))
//set z1 = GetLocationZ(LOC) + 40.
//call MoveLocation(LOC,GetUnitX(data2.d),GetUnitY(data2.d))
//set z2 = GetLocationZ(LOC) + 30.
call TimedL.P2P(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+65.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+65.),.4,1.,.4)
//call TimedL.U2U(AddLightningEx("BLNL",true,GetUnitX(data2.u),GetUnitY(data2.u),GetUnitZ(data2.u)+60.,GetUnitX(data2.d),GetUnitY(data2.d),GetUnitZ(data2.d)+60.),data2.u,data2.d,.4,GetUnitZ(data2.u)+60.,GetUnitZ(data2.d)+60.,1.,.4)
set t2 = NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,.15,false,function Handler2)
endif
if GetUnitAbilityLevel(u,ARM_ID) < 21 then
if GetUnitAbilityLevel(u,ARM_ID) == 10 then
call UnitAddAbility(u,CLEAVE_ID)
call UnitAddAbility(u,'A0OR')
endif
call SetUnitAbilityLevel(u,ARM_ID,GetUnitAbilityLevel(u,ARM_ID) + 1)
call SetUnitAbilityLevel(u,SPELL_ID2,GetUnitAbilityLevel(u,SPELL_ID2) + 1)
set t = NewTimer()
set data = VA.create()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,8.,false,function Handler)
endif
endif
set t2 = null
set d = null
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and UnitAlive(GetEventDamageSource()) and GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) < 21 and GetUnitAbilityLevel(GetTriggerUnit(),BUFF_ID) == 1 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set NFEROCITY=CreateTrigger()
call TriggerAddCondition(NFEROCITY,Condition(function Conditions))
call MOE(II,(NFEROCITY))
call DisableTrigger(NFEROCITY)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope HappyHour initializer OnInit
globals
private constant integer SPELL_ID = 'A0GI'
private constant group GROUP = CreateGroup()
private unit CASTER
private real HEAL
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real r
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\StrongDrink\\BrewmasterMissile.mdl",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\RollingKegMissleNoSound.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",u,"origin"))
set r = GetWidgetLife(u)
if HEAL + r >= GetUnitState(u,UNIT_STATE_MAX_LIFE) then
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(u,r+HEAL)
endif
if u == CASTER then
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+(1),0)
else
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+(3),0)
endif
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
set CASTER = GetTriggerUnit()
set HEAL = (GetUnitState(CASTER,UNIT_STATE_MAX_LIFE)*.1)+(GetHeroStr(CASTER,TRUE)*2)
call GroupEnumUnitsInRange(GROUP,GetUnitX(CASTER),GetUnitY(CASTER),749.,Filter(function FilterActions))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Hallucinations initializer OnInit
globals
trigger HALLUCINATIONDAMAGE
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local real d = GetEventDamage()
local player p = GetOwningPlayer(a)
if (GetPlayerController(p) == MAP_CONTROL_USER) and IsUnitIllusion(u) and not IsUnitType(u,UNIT_TYPE_HERO) and d >=1. and GetUnitTypeId(LC[GetPlayerId(p)+1])=='E01D' and IsUnitEnemy(u,GetOwningPlayer(a)) and (GetEventDamage()>=1.)and ((BI[NI]==LN or BI[NI]==DAMAGE_TYPE_LIGHTNING or BI[NI]==DAMAGE_TYPE_COLD or BI[NI]==DAMAGE_TYPE_MAGIC or BI[NI]==DAMAGE_TYPE_PLANT or BI[NI]==DAMAGE_TYPE_UNIVERSAL or (CI[NI]==false and (BI[NI]) == DAMAGE_TYPE_NORMAL))and(J5V[(ROX((GetUnitTypeId(a))))])) then
call DisableTrigger(HALLUCINATIONDAMAGE)
call UnitDamageTargetEx(a,u,d*.5,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(HALLUCINATIONDAMAGE)
else
if (GetPlayerController(p) == MAP_CONTROL_USER) and IsUnitIllusion(u) and not IsUnitType(u,UNIT_TYPE_HERO) and d >= 1. and GetUnitTypeId(LC[GetPlayerId(p)+1])=='E01D' and(not(J5V[(ROX((GetUnitTypeId(a))))])) and IsUnitEnemy(u,GetOwningPlayer(a)) then
call DisableTrigger(HALLUCINATIONDAMAGE)
call UnitDamageTargetEx(a,u,d*.5,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(HALLUCINATIONDAMAGE)
endif
endif
set u = null
set a = null
set p = null
return false
endfunction
private function OnInit takes nothing returns nothing
set HALLUCINATIONDAMAGE = CreateTrigger()
call MOE(II, (HALLUCINATIONDAMAGE))
call TriggerAddCondition(HALLUCINATIONDAMAGE, Condition(function Actions))
call DisableTrigger(HALLUCINATIONDAMAGE)
endfunction
endscope
scope SilentScream initializer OnInit
globals
private constant integer SPELL_ID = 'A00Z'
private constant integer SPELL_ID2 = 'A08H'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct SScream
unit u
real x
real y
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local unit u2
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
set u2 = CreateUnit(GetOwningPlayer(CASTER),'h007',0.,0.,0.)
call UnitAddAbility(u2,SPELL_ID2)
call IssueTargetOrder(u2,"sleep",u)
call UnitApplyTimedLife(u2,'BTLF',1.)
endif
set u = null
set u2 = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local SScream data = GetTimerData(t)
set CASTER = data.u
call GroupEnumUnitsInRange(GROUP,data.x,data.y,210.,Filter(function FilterActions))
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u
local timer t = NewTimer()
local SScream data = SScream.create()
set data.u = GetTriggerUnit()
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
set u = CreateUnit(GetOwningPlayer(data.u),'h012',data.x,data.y,0.)
call UnitApplyTimedLife(u,'BTLF',2.0)
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
set u = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope SpellStealPrep initializer OnInit
globals
integer array SpellStealCounter
integer array SpellStealID
endglobals
private struct ss
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local ss data = GetTimerData(t)
set SpellStealCounter[GetUnitUserData(data.u)] = SpellStealCounter[GetUnitUserData(data.u)] - 1
if SpellStealCounter[GetUnitUserData(data.u)] == 0 then
set SpellStealID[GetUnitUserData(data.u)] = '4444'
endif
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local timer t
local ss data
if IsUnitType(u,UNIT_TYPE_HERO) and not BlzGetAbilityBooleanField(BlzGetUnitAbility(u, GetSpellAbilityId()),ABILITY_BF_ITEM_ABILITY) then
set SpellStealCounter[GetUnitUserData(u)] = SpellStealCounter[GetUnitUserData(u)] + 1
set SpellStealID[GetUnitUserData(u)] = GetSpellAbilityId()
set data = ss.create()
set t = NewTimer()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,3.,false,function Handler)
endif
set t = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Conditions ) )
endfunction
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
scope TricksoftheTrade initializer OnInit
globals
private constant integer SPELL_ID = 'A0RA'
endglobals
private struct NBind
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local NBind data = GetTimerData(t)
local integer id = SpellStealStolenID[GetUnitUserData(data.u)]
if id != 0 then
call UnitMakeAbilityPermanent(data.u,false,id)
call UnitRemoveAbility(data.u,id)
if SpellStealStolenID2[GetUnitUserData(data.u)] != 0 then
call UnitRemoveAbility(data.u,SpellStealStolenID2[GetUnitUserData(data.u)])
endif
if GetLocalPlayer() == GetOwningPlayer(data.u) then
call BlzSetAbilityPosX(id,SpellStealStolenX[GetUnitUserData(data.u)])
call BlzSetAbilityPosY(id,SpellStealStolenY[GetUnitUserData(data.u)])
endif
set SpellStealStolenID[GetUnitUserData(data.u)] = 0
set SpellStealStolenID2[GetUnitUserData(data.u)] = 0
set SpellStealStolenX[GetUnitUserData(data.u)] = 0
set SpellStealStolenY[GetUnitUserData(data.u)] = 0
call UnitAddAbility(data.u,'A0MV')
call UnitMakeAbilityPermanent(data.u,true,'A0MV')
endif
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local NBind data = NBind.create()
set data.u = GetTriggerUnit()
call UnitResetCooldown( data.u)
call SetTimerData(t,data)
call TimerStart(t,2.,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope SpellSteal initializer OnInit
globals
private constant integer SPELL_ID = 'A0MV'
integer array SpellStealStolenID
integer array SpellStealStolenID2
integer array SpellStealStolenX
integer array SpellStealStolenY
endglobals
private struct ss
unit u
integer x
integer y
integer id
integer id2
player p
method destroy takes nothing returns nothing
set this.u = null
set this.p = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local ss data = GetTimerData(t)
call UnitRemoveAbility(data.u,SPELL_ID)
call UnitAddAbility(data.u,SPELL_ID)
call UnitMakeAbilityPermanent(data.u,true,SPELL_ID)
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
/*private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local ss data = GetTimerData(t)
call UnitMakeAbilityPermanent(data.u,false,data.id)
call UnitRemoveAbility(data.u,data.id)
if data.id2 != 0 then
call UnitRemoveAbility(data.u,data.id2)
endif
if GetLocalPlayer() == data.p then
call BlzSetAbilityPosX(data.id,data.x)
call BlzSetAbilityPosY(data.id,data.y)
endif
call UnitAddAbility(data.u,SPELL_ID)
call UnitMakeAbilityPermanent(data.u,true,SPELL_ID)
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
*/
private function Actions takes nothing returns nothing
local unit t = GetSpellTargetUnit()
local unit u = GetTriggerUnit()
local timer tt
local ss data
local integer id = SpellStealID[GetUnitUserData(t)]
local unit d
local player p
if id == 'A00W' or id == 'A0K1' or id == 'A03K' or id == SPELL_ID or id == 'A0FB' or id == 'A098' or id == 'A08V' or id == 'A0BO' or id == 'A0IA' or id == 'A0DX' or id == 'A0PK' or id == 'A0L9' or id == 'A0RA' then
call Q_E(GetOwningPlayer(u),"Invalid target for Spell Steal: "+ GetObjectName(id))
set tt = NewTimer()
set data = ss.create()
set data.u = u
call SetTimerData(tt,data)
call TimerStart(tt,2.,false,function Handler2)
else
if id == 0 or id == '4444' then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,BS[(1+GetPlayerId(GetOwningPlayer(u)))]+(GetPlayerName(GetOwningPlayer(u))+"|r")+"|c00FF0101 has been caught stealing red handed! The no good dirty criminal has been detained!|r")
set d = CreateUnit(GetOwningPlayer(u),'h007',GetUnitX(u),GetUnitY(u),0.)
call UnitAddAbility(d,'A0MU')
call IssueTargetOrderById(d,852668,u)
call UnitApplyTimedLife(d,'BTLF',1)
else
/*set tt = NewTimer()
set data = ss.create()
set data.u = u
set data.id = id
set data.x = BlzGetAbilityPosX(data.id)
set data.y = BlzGetAbilityPosY(data.id)
set data.p = GetOwningPlayer(data.u)*/
call UnitRemoveAbility(u,SPELL_ID)
call UnitAddAbility(u,id)
call UnitMakeAbilityPermanent(u,true,id)
set SpellStealStolenID[GetUnitUserData(u)] = id
set SpellStealStolenX[GetUnitUserData(u)]= BlzGetAbilityPosX(id)
set SpellStealStolenY[GetUnitUserData(u)]= BlzGetAbilityPosY(id)
if id == 'A0JX' then
call UnitAddAbility(u,'A0K1')
call UnitMakeAbilityPermanent(u,true,'A0K1')
set SpellStealStolenID2[GetUnitUserData(u)] = 'A0K1'
//set data.id2 = 'A0K1'
endif
if id == 'A01G' then
call UnitAddAbility(u,'A00W')
call UnitMakeAbilityPermanent(u,true,'A00W')
set SpellStealStolenID2[GetUnitUserData(u)] = 'A00W'
//set data.id2 = 'A00W'
endif
if id == 'A04O' or id == 'A02E' or id == 'A035' then
call SetUnitAbilityLevel(u,id,GetUnitAbilityLevel(t,id))
call BlzSetUnitAbilityManaCost(u,id,GetUnitAbilityLevel(t,id)-1,25 + (GetUnitAbilityLevel(t,id)*5))
else
call SetUnitAbilityLevel(u,id,GetUnitAbilityLevel(t,id))
call BlzSetUnitAbilityManaCost(u,id,GetUnitAbilityLevel(t,id)-1,0)
endif
set p = GetOwningPlayer(u)
if GetLocalPlayer() == p then
call BlzSetAbilityPosX(id,1)
call BlzSetAbilityPosY(id,2)
endif
//call SetTimerData(tt,data)
//call TimerStart(tt,100.,false,function Handler)
if IsPlayerInForce(p,VS[1]) then
call DisplayTimedTextToForce(VS[1],4.,BS[(1+GetPlayerId(p))]+(GetPlayerName(p)+"|r")+" has stolen "+ BlzGetAbilityStringLevelField(BlzGetUnitAbility(u, id), ABILITY_SLF_TOOLTIP_NORMAL, GetUnitAbilityLevel(t,id)-1)+ " !")
else
call DisplayTimedTextToForce(VS[2],4.,BS[(1+GetPlayerId(p))]+(GetPlayerName(p)+"|r")+" has stolen "+ BlzGetAbilityStringLevelField(BlzGetUnitAbility(u, id), ABILITY_SLF_TOOLTIP_NORMAL, GetUnitAbilityLevel(t,id)-1)+ " !")
endif
call PlaySoundBJ(HY)
if IsThiefRat[GetUnitUserData(u)] then
call SGE('h01U',GetUnitX(t) - 100. * Cos(GetUnitFacing(t) * bj_DEGTORAD),GetUnitY(t) - 100. * Sin(GetUnitFacing(t) * bj_DEGTORAD),GetUnitFacing(t),.900,"attack two",1.0)
else
call SGE('h00Y',GetUnitX(t) - 100. * Cos(GetUnitFacing(t) * bj_DEGTORAD),GetUnitY(t) - 100. * Sin(GetUnitFacing(t) * bj_DEGTORAD),GetUnitFacing(t),.900,"attack one",1.0)
endif
endif
endif
set p = null
set d = null
set tt= null
set t = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ThiefCollision initializer OnInit
globals
trigger THIEFCOLL
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit()) == 'E01L' and IsUnitIllusion(GetTriggerUnit()) then
call SetUnitPathing(GetTriggerUnit(),true)
endif
return false
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
set THIEFCOLL = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(0), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(1), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(2), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(3), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(4), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(5), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(6), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(7), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(8), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(9), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(10), true )
call TriggerRegisterPlayerSelectionEventBJ( THIEFCOLL, Player(11), true )
call TriggerAddCondition( THIEFCOLL, Condition( function Conditions ) )
call DisableTrigger(THIEFCOLL)
endfunction
endscope
//TESH.scrollpos=1
//TESH.alwaysfold=0
scope ThiefIllusVenom initializer OnInit
globals
trigger VENOM
private constant integer SPELL_ID = 'A0DG'
private unit CASTER
private unit HIT
endglobals
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
return(UnitAlive(GetFilterUnit()) and IsUnitEnemy(CASTER,GetOwningPlayer(GetFilterUnit())) and GetUnitAbilityLevel(GetFilterUnit(),'B039') == 0 and GetFilterUnit() != HIT and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) )
endfunction
private function Actions takes nothing returns nothing
local unit u=CreateUnit(GetOwningPlayer(GetEventDamageSource()),'h007',0.,0.,0.)
call UnitAddAbility(u,'A0BR')
call SetUnitAbilityLevel(u,'A0BR',GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID))
call UnitApplyTimedLife(u,'BTLF',15.)
call IssueTargetOrder(u,"soulburn",GetTriggerUnit())
set CASTER = GetEventDamageSource()
set HIT = GetTriggerUnit()
if not IsUnitSelected(CASTER,GetOwningPlayer(CASTER)) then
if GetRandomInt(0,100) <= 75 then
call SetUnitPathing(CASTER,false)
call IssueTargetOrder(CASTER,"attack",ZEE(null,GetUnitX(CASTER),GetUnitY(CASTER),99999.,Condition(function FilterActions)))
endif
endif
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and IsUnitIllusion(GetEventDamageSource()) and GetUnitAbilityLevel(GetTriggerUnit(),'B039') == 0 and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER and GetEventDamage() > 0 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set VENOM=CreateTrigger()
call TriggerAddCondition(VENOM,Condition(function Conditions))
call MOE(II,(VENOM))
call DisableTrigger(VENOM)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SinfulPassive initializer OnInit
globals
trigger THIEFPOISON
real array THIEFSWAG
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u) - 100. * Cos(GetUnitFacing(u)) * bj_DEGTORAD
local real y = GetUnitY(u) - 100. * Sin(GetUnitFacing(u)) * bj_DEGTORAD
local unit c = LC[1+GetPlayerId(GetOwningPlayer(GetEventDamageSource()))]
call DisableTrigger(THIEFPOISON)
call UnitDamageTargetEx(c,u,THIEFSWAG[GetUnitUserData(c)]*.05*(1.+(.05*GetHeroLevel(c))),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
call EnableTrigger(THIEFPOISON)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",u,"chest"))
if IsThiefRat[GetUnitUserData(c)] then
call SGE('h01U',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack one",1.0)
else
call SGE('h00Y',x,y,GetUnitFacing(GetSpellTargetUnit()),.900,"attack one",1.0)
endif
set c = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetEventDamageSource()
if GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A08V') != 0 and GetTriggerUnit() != u and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit())) and GetEventDamage() > 1. and GetRandomInt(0,100) <= 15 + (3*GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(u))],'A08V')) and GetUnitAbilityLevel(u,'BIil') != 1 and GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_COMPUTER and BI[NI] != DAMAGE_TYPE_PLANT and GetEventDamage() > 0 then
call Actions()
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set THIEFPOISON =CreateTrigger()
call TriggerAddCondition(THIEFPOISON ,Condition(function Conditions))
call MOE(II,(THIEFPOISON ))
call DisableTrigger(THIEFPOISON)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ThiefStacks initializer OnInit
globals
trigger THIEFSWAG2
endglobals
private function Conditions takes nothing returns boolean
if GetUnitTypeId(LC[1+GetPlayerId(GetTriggerPlayer())]) == 'E01L' then
call DisplayTextToPlayer(GetTriggerPlayer(),0.,0.,"|cffffcc00Total Gold Stolen:|r "+ R2S(THIEFSWAG[GetUnitUserData(LC[1+GetPlayerId(GetTriggerPlayer())])]))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
local integer pid = 0
set THIEFSWAG2 = CreateTrigger()
loop
call TriggerRegisterPlayerChatEvent( THIEFSWAG2, Player(pid), "-swag", false )
exitwhen pid == 11
set pid = pid + 1
endloop
call TriggerAddCondition( THIEFSWAG2, Condition(function Conditions) )
call DisableTrigger(THIEFSWAG2)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope UndyingFlame initializer OnInit
globals
trigger UNDYINGFLAME
private constant integer SPELL_ID = 'A0IW'
endglobals
native UnitAlive takes unit id returns boolean
private function Actions takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local real dmg = ((GetUnitState(u,UNIT_STATE_MAX_MANA)-GetUnitState(u,UNIT_STATE_MANA))*.03)*(1.+(.35*GetHeroLevel(u)))
//call UnitRemoveAbility(t,'B057')
call DisableTrigger(UNDYINGFLAME)
call UnitDamageTargetEx(u,t,dmg,false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call EnableTrigger(UNDYINGFLAME)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Flameshock.mdx",t,"chest"))
call BlzSetUnitMaxMana(u,BlzGetUnitMaxMana(u)+5)
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and GetUnitState(GetEventDamageSource(),UNIT_STATE_MAX_MANA) != GetUnitState(GetEventDamageSource(),UNIT_STATE_MANA) and GetEventDamage() > 0 and BI[NI] != DAMAGE_TYPE_PLANT then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set UNDYINGFLAME=CreateTrigger()
call TriggerAddCondition(UNDYINGFLAME,Condition(function Conditions))
call MOE(II,(UNDYINGFLAME))
call DisableTrigger(UNDYINGFLAME)
endfunction
endscope
//TESH.scrollpos=99
//TESH.alwaysfold=0
scope Bloodbath initializer OnInit
globals
private constant integer SPELL_ID = 'A03H'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DMG
endglobals
private struct BB
unit caster
real x
real y
real c
//integer i
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private struct BBfx
unit caster
integer i
real c
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",u,"chest"))
call UnitDamageTargetEx(CASTER,u,DMG,false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
endif
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local BB data = GetTimerData(t)
set CASTER = data.caster
set DMG = data.c
set data.x = GetUnitX(data.caster)
set data.y = GetUnitY(data.caster)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Explosion.mdx",data.x,data.y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodSlam.mdx",data.x,data.y))
call GroupEnumUnitsInRange(GROUP,data.x,data.y,374.,Filter(function FilterActions))
//set data.i = data.i - 1
//if data. i == 0 then
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
//else
//call SetTimerData(t,data)
//call TimerStart(t,1.,false,function Handler)
//endif
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t2 = GetExpiredTimer()
local BBfx data2 = GetTimerData(t2)
local real x
local real y
local timer t = NewTimer()
local BB data = BB.create()
set x = GetUnitX(data2.caster)
set y = GetUnitY(data2.caster)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Blood Explosion.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodSlam.mdx",x,y))
set data.caster = data2.caster
set data.x = x
set data.y = y
set data.c = data2.c
call SetTimerData(t,data)
call TimerStart(t,.4,false,function Handler)
set data2.i = data2.i - 1
if data2. i == 0 then
call ReleaseTimer(GetExpiredTimer())
call data2.destroy()
else
call SetTimerData(t2,data2)
call TimerStart(t2,1.,false,function Handler2)
endif
set t= null
set t2 = null
endfunction
private function Actions takes nothing returns nothing
//local timer t = NewTimer()
local timer t2 = NewTimer()
//local BB data = BB.create()
local real hp
local BBfx data2 = BBfx.create()
//set data.i = 12
//set data.caster = GetTriggerUnit()
//set data.x = GetUnitX(data.caster)
//set data.y = GetUnitY(data.caster)
set data2.caster = GetTriggerUnit()
set hp = GetWidgetLife(data2.caster)
set data2.c = hp/2
call SetWidgetLife(data2.caster,hp-data2.c)
set data2.c = (data2.c*GetUnitAbilityLevel(data2.caster,SPELL_ID)*.2)+(GetUnitState(data2.caster,UNIT_STATE_MAX_LIFE)*GetUnitAbilityLevel(data2.caster,SPELL_ID)*.02)
//set CASTER = data.caster
//set DMG = data.c
call DestroyEffect(AddSpecialEffect("war3mapImported\\ChaosExplosion.mdx",GetUnitX(data2.caster),GetUnitY(data2.caster)))
//call GroupEnumUnitsInRange(GROUP,data.x,data.y,399.,Filter(function FilterActions))
//call SetTimerData(t,data)
//call TimerStart(t,1.,false,function Handler)
set data2.i = 12
call SetTimerData(t2,data2)
call TimerStart(t2,.6,false,function Handler2)
set t2 = null
//set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope BloodHydrant initializer OnInit
globals
private constant integer SPELL_ID = 'A0N2'
private boolean array NoStack
unit BLOODHYDRANTCASTER
unit BLOODHYDRANTTARGET
endglobals
private struct BH
unit c
method destroy takes nothing returns nothing
set NoStack[GetUnitUserData(this.c)] = false
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
return UnitAlive(GetFilterUnit()) and IsUnitEnemy(BLOODHYDRANTCASTER ,GetOwningPlayer(GetFilterUnit())) and IsUnitVisible(BLOODHYDRANTCASTER,GetOwningPlayer(GetFilterUnit()))
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local BH data = GetTimerData(t)
if data.c == null or UnitAlive(data.c) == false or GetUnitAbilityLevel(data.c,'B06C') != 1 then
call ReleaseTimer(t)
call data.destroy()
else
if GetWidgetLife(data.c) >= 1 then
set BLOODHYDRANTCASTER = data.c
set BLOODHYDRANTTARGET = ZEE(null,GetUnitX(BLOODHYDRANTCASTER),GetUnitY(BLOODHYDRANTCASTER),375.,Condition(function FilterActions))
if BLOODHYDRANTTARGET != null then
call SetWidgetLife(data.c,GetWidgetLife(data.c)*.75)
call RTX()
endif
endif
call SetTimerData(t,data)
call TimerStart(t,.5,false, function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local unit c = GetTriggerUnit()
local BH data
if NoStack[GetUnitUserData(c)] == false then
set NoStack[GetUnitUserData(c)] = true
set data = BH.create()
set data.c = c
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.5,false, function Handler)
endif
set c = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope BloodHydrantNew initializer OnInit
globals
private constant integer SPELL_ID = 'A0QU'
private boolean array NoStack
real array BloodHydrantCD
endglobals
private struct BH
unit c
method destroy takes nothing returns nothing
set NoStack[GetUnitUserData(this.c)] = false
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
return UnitAlive(GetFilterUnit()) and IsUnitEnemy(BLOODHYDRANTCASTER ,GetOwningPlayer(GetFilterUnit())) and IsUnitVisible(BLOODHYDRANTCASTER,GetOwningPlayer(GetFilterUnit()))
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local BH data = GetTimerData(t)
if data.c == null or UnitAlive(data.c) == false or GetUnitAbilityLevel(data.c,'B06C') != 1 then
call ReleaseTimer(t)
call data.destroy()
else
if GetWidgetLife(data.c) >= 1 then
set BLOODHYDRANTCASTER = data.c
set BLOODHYDRANTTARGET = ZEE(null,GetUnitX(BLOODHYDRANTCASTER),GetUnitY(BLOODHYDRANTCASTER),375.,Condition(function FilterActions))
if BLOODHYDRANTTARGET != null then
call SetWidgetLife(data.c,GetWidgetLife(data.c)*.75)
call RTX()
endif
endif
call SetTimerData(t,data)
call TimerStart(t,.5,false, function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local unit c = GetTriggerUnit()
local BH data
if NoStack[GetUnitUserData(c)] == false then
set NoStack[GetUnitUserData(c)] = true
set data = BH.create()
set data.c = c
set t = NewTimer()
if BloodHydrantCD[GetUnitUserData(c)] == 0 then
set BloodHydrantCD[GetUnitUserData(c)] = .5
endif
call SetTimerData(t,data)
call TimerStart(t,BloodHydrantCD[GetUnitUserData(c)],false, function Handler)
endif
set c = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
scope NissaBinding initializer OnInit
globals
private constant integer SPELL_ID = 'A0CY'
private constant integer SPELL_ID2 = 'A08H'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct NBind
unit u
real x
real y
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local unit u2
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
set u2 = CreateUnit(GetOwningPlayer(CASTER),'h007',0.,0.,0.)
call UnitAddAbility(u2,SPELL_ID2)
call IssueTargetOrder(u2,"sleep",u)
call UnitApplyTimedLife(u2,'BTLF',1.)
endif
set u = null
set u2 = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local NBind data = GetTimerData(t)
// call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.2))
//call DestroyEffect(AddSpecialEffect(SFX_PATH2,x,y))
set CASTER = data.u
call GroupEnumUnitsInRange(GROUP,data.x,data.y,210.,Filter(function FilterActions))
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit u
local timer t = NewTimer()
local NBind data = NBind.create()
set data.u = GetTriggerUnit()
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
set u = CreateUnit(GetOwningPlayer(data.u),'h012',data.x,data.y,0.)
call UnitApplyTimedLife(u,'BTLF',2.0)
call SetTimerData(t,data)
call TimerStart(t,2.,false,function Handler)
set u = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope MassCharm initializer OnInit
globals
private constant integer SPELL_ID = 'A0HC'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real r
local integer i
local texttag tt
local string s = null
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and GetUnitTypeId(u) != 'h000' and not IsUnitType(u,UNIT_TYPE_HERO) and GetPlayerId(GetOwningPlayer(u)) != PLAYER_NEUTRAL_PASSIVE and not IsUnitType(u,UNIT_TYPE_STRUCTURE) then
if GetUnitTypeId(u) == 'n016' or GetUnitTypeId(u) == 'n03K' or GetUnitTypeId(u) == 'n045' or GetUnitTypeId(u) == 'n048' or GetUnitTypeId(u) == 'n046' or GetUnitTypeId(u) == 'n049' then
call UnitRemoveAbility(u,'A0QJ')
call UnitRemoveAbility(u,'SCva')
if GetUnitAbilityLevel(u,'A0S9') == 1 then
call UnitApplyTimedLife(u,'BTLF',60.)
endif
endif
if GetUnitTypeId(u) == 'h00B' then
set i = BlzGetUnitIntegerField(u, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)
else
set i = BlzGetUnitIntegerField(u, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)*2
endif
set tt = CreateTextTag()
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Holy Light.mdx",u,"origin"))
if GetUnitTypeId(u) == 'u002' or GetUnitTypeId(u) == 'u006' then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,4.,"Despite " + ((BS[(1+GetPlayerId(GetOwningPlayer(CASTER)))]+(GetPlayerName(GetOwningPlayer(CASTER))+"|r"))+("'s earnest appeals to the heavens, the demon unfortunately could not be \"persuaded\". Negotiations have broken down, and unexpected results have occured from heaven's intervention.")))
call SetUnitScale(u,6.,6.,6.)
else
call SetUnitOwner(u,GetOwningPlayer(CASTER),true)
endif
if GetUnitAbilityLevel(u,'A04P') != 0 then
call UnitRemoveAbility(u,'A04P')
endif
if not IsUnitType(u,UNIT_TYPE_ANCIENT) then
call BlzSetUnitMaxHP(u,BlzGetUnitMaxHP(u)*2)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)*2,0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)*2.)
call AddUnitBonus(u, BONUS_ATTACK_SPEED, 1.)
call AddUnitBonus(u, BONUS_MOVEMENT_SPEED, 300)
call SetWidgetLife(u,BlzGetUnitMaxHP(u)*1.)
else
if GetUnitTypeId(u) == 'n025' then
set i =i/4
call UnitApplyTimedLife(u,'BTLF',90.)
else
call UnitApplyTimedLife(u,'BTLF',300.)
endif
call AddUnitBonus(u, BONUS_MOVEMENT_SPEED, 150)
call AddUnitBonus(u, BONUS_ATTACK_SPEED, 1.)
endif
if GetLocalPlayer()==GetOwningPlayer(CASTER) then
set s = "|cffffcc00 +"+I2S(i)+"|r"
endif
call SetTextTagText(tt,s,0.023)
call SetTextTagPos(tt,GetUnitX(u),GetUnitY(u),10.)
call SetTextTagColor(tt,255,255,255,255)
call SetTextTagVelocity(tt,0.0355*Cos(90. * bj_DEGTORAD),0.0355*Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility(tt,true)
call SetTextTagFadepoint(tt,1.5)
call SetTextTagLifespan(tt,2.)
call SetTextTagPermanent(tt,false)
call SetPlayerState(GetOwningPlayer(CASTER),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(CASTER),PLAYER_STATE_RESOURCE_GOLD))+i)
call UnitAddAbility(u,'A0NM')
if GetUnitAbilityLevel(u,'A0EV') != 0 or GetUnitAbilityLevel(u,'Apiv') != 0 then
call UnitRemoveAbility(u,'A0EV')
call UnitRemoveAbility(u,'Apiv')
endif
endif
set tt= null
set s = null
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
local effect fx = AddSpecialEffect("war3mapImported\\Divine Edict.mdx",GetSpellTargetX(),GetSpellTargetY())
set CASTER = GetTriggerUnit()
//call BlzSetSpecialEffectScale(fx,1.0)
call DestroyEffect(fx)
call GroupEnumUnitsInRange(GROUP,GetSpellTargetX(),GetSpellTargetY(),225.,Filter(function FilterActions))
set fx = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope VitalityHealing initializer OnInit
globals
private constant integer SPELL_ID = 'A0OV'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real r
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetPlayerId(GetOwningPlayer(u)) != PLAYER_NEUTRAL_PASSIVE then
call SetWidgetLife(u,GetWidgetLife(u)+(BlzGetUnitMaxHP(u)/2.))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Heal Green.mdx",u,"origin"))
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
//local effect fx = AddSpecialEffect("war3mapImported\\Divine Edict.mdx",GetSpellTargetX(),GetSpellTargetY())
set CASTER = GetTriggerUnit()
//call BlzSetSpecialEffectScale(fx,1.0)
//call DestroyEffect(fx)
call GroupEnumUnitsInRange(GROUP,GetUnitX(CASTER),GetUnitY(CASTER),336.,Filter(function FilterActions))
//set fx = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=49
//TESH.alwaysfold=0
//***************************************************************************
//***************************************************************************
//***************************************************************************
// S H A D O W I M A G E B L I N K
// By: Elphis (Nyuu)
// Version: 1.0
//
// Sepll Description:
// ` - Use dark power, creating an illusion and a energy
// ball shot to the selected point and after energy ball hit the target point,
// it will explodes and stuns enemies in 2/2.5/3/3.5 seconds and cause 50/100/150/200
// damage in 300 range.
// - Installation:
// - Import/copy Shadow Image Blink code to your map
// - Import/copy the custom ability and unit to your map and change the SPELL_ID, DSPELL_ID, DUMMY_BOLT and DUMMY_CASTER if needed
// - You may view the raw ID of the objects by pressing CTRL+D in the object editor
// - You may play with the configurables below
// - Credit:
// - Unleashthepower.mdx - http://www.hiveworkshop.com/forums/models-530/unleash-power-243024/?prev=search%3DPower%26d%3Dlist%26r%3D20
// - TerrainPathability - http://www.wc3c.net/showthread.php?t=103862
//
//
//***************************************************************************
//***************************************************************************
//***************************************************************************
scope ShadowImageBlink
globals
//Spell rawcode, change if needed
private constant integer SPELL_ID = 'A0CU'
//
private constant integer SPOOKED_ID = 'A0CI'
private constant integer DSPELL_ID = 'A001'
//Dummy unit rawcode (Bolt model) change if needed
private constant integer DUMMY_BOLT = 'e000'
//Dummy caster rawcode, change if needed
private constant integer CASTER_DUMMY = 'h007'
//Crow Form ability
private constant integer CROW_FORM = 'Amrf'
//Animation play when the caster casting this spell
private constant string ANIMATION = "spell"
//Effect of spell
private constant string BLINK_CAST = "war3mapImported\\WarpDarkTarget.mdx"
//Effect of spell when begin & end spell
private constant string BLINK_END = ".mdl"
//Attachment of the caster when spell end (Using BLINK_END effect)
private constant string ATTACHMENT = "chest"
//Order id of dummy caster casting the dummy ability
private constant string ORDER_ID = "thunderbolt"
//Dummy owner
private constant player DUMMY_OWNER = Player(15)
//******************************DAMAGE DATA SETTINGS******************************
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_DEATH
private constant weapontype WEAPON_TYPE = WEAPON_TYPE_CLAW_HEAVY_SLICE
//********************************************************************************
//Damage radius
private constant real DAMAGE_RADIUS = 300.
//Damage base of this spell
private constant real DAMAGE_BASE = 50.
//Animation speed of the caster unit when this spell is used
private constant real ANIMATION_SPEED = 0.43
//Spell period
private constant real PERIODIC = .031250000
//Virtual caster speed separator
private constant real SPERATION_SPEED = 20.
//Max height of the ball power
private constant real MAX_HEIGHT = 1000.
/*Fade settings*/
private constant integer FADE_COUNT = 10
private constant integer FADE_FLASH = 85
private constant integer FADE_SPEED = 10
//********************************************************
//***************************Non - Configurable*****************************
/* */
/**/private constant group G = CreateGroup()/**/
/* */
/**/private integer MUI = -1 /**/
/* */
/**/private integer array StructData /**/
/* */
/**/private constant timer TIMER = CreateTimer()/**/
//**************************************************************************
/**/private unit Dummy
//**************************************************************************
endglobals
//************************************DO NOT MODIFY ANYTHING BELOW************************************
//*******************Damage setting***********************************
/**/constant function getDamage takes integer lvl, integer Agi returns real /**/
/**/ return Agi* lvl * lvl*.5 /**/
/**/endfunction /**/
//********************************************************************
//*******************Filter Function***********************************
/**/function filterFunc takes player owner,unit filterUnit returns boolean
/**/ //Assure a better death check//
/**/return not IsUnitType(filterUnit,UNIT_TYPE_DEAD) and /**/GetUnitTypeId(filterUnit) != 0/**/ and IsUnitEnemy(filterUnit,owner)
/**/endfunction
//********************************************************************
//native UnitAlive takes unit u returns boolean
private struct ShadowImageBlink
unit caster
unit dummy_1
unit dummy_2
unit dummy_3
unit target
integer fade = 255
integer lvl
integer fade_count = FADE_COUNT
integer count
boolean fade_done = false
boolean subtract = true
player owner
real cos
real sin
real facing
real facing2
real total = -SPERATION_SPEED
real angle
real fade_seperation
real targetx
real targety
real speration_speed
real height
real dmg
static method onPeriodic takes nothing returns nothing
local integer i = 0
local thistype this
local real x
local real y
local real o
local real z
local unit f = null
local Fear F
local boolean b = false
local boolean b2 = false
loop
exitwhen i > MUI
set this = StructData[i]
if subtract then
set x = GetUnitX(dummy_1) + cos
set y = GetUnitY(dummy_1) + sin
set o = GetUnitX(dummy_2) - cos
set z = GetUnitY(dummy_2) - sin
if fade > fade_seperation then
if not fade_done then
set fade = fade - FADE_SPEED
else
set fade = 0
endif
elseif fade_done then
set fade = FADE_FLASH
if fade_count > 0 then
set fade_count = fade_count - 1
else
set subtract = false
set fade_done = false
set fade = 0
set cos = Cos(angle)
set sin = Sin(angle)
if UnitAlive(target) then
set targetx = GetUnitX(target) - 100. * Cos(GetUnitFacing(caster) * bj_DEGTORAD)
set targety = GetUnitY(target) - 100. * Sin(GetUnitFacing(caster) * bj_DEGTORAD)
endif
set x = targetx + total * cos
set y = targety + total * sin
//call SetUnitX(dummy_1,x)
//call SetUnitY(dummy_1,y)
call RemoveUnit(dummy_1)
set dummy_1 = CreateUnit(DUMMY_OWNER,GetUnitTypeId(caster),x,y,facing2)
if UnitAddAbility(dummy_1,'Aloc') then
call SetUnitPathing(dummy_1,false)
call SetUnitX(dummy_1,x)
call SetUnitY(dummy_1,y)
endif
call DestroyEffect(AddSpecialEffect(BLINK_CAST,x,y))
set x = targetx - total * cos
set y = targety - total * sin
call RemoveUnit(dummy_2)
set dummy_2 = CreateUnit(DUMMY_OWNER,GetUnitTypeId(caster),x,y,facing2)
if UnitAddAbility(dummy_2,'Aloc') then
call SetUnitPathing(dummy_2,false)
call SetUnitX(dummy_2,x)
call SetUnitY(dummy_2,y)
endif
call SetUnitColor(dummy_1,GetPlayerColor(owner))
call SetUnitColor(dummy_2,GetPlayerColor(owner))
//********************************************
call SetUnitTimeScale(dummy_1,ANIMATION_SPEED)
call SetUnitTimeScale(dummy_2,ANIMATION_SPEED)
//********************************************
call SetUnitAnimation(dummy_1,ANIMATION)
call SetUnitAnimation(dummy_2,ANIMATION)
//call SetUnitX(dummy_2,x)
//call SetUnitY(dummy_2,y)
call DestroyEffect(AddSpecialEffect(BLINK_CAST,x,y))
set cos = speration_speed*Cos(angle)
set sin = speration_speed*Sin(angle)
endif
else
set fade_done = true
endif
set total = total + speration_speed
endif
if not fade_done and not subtract then
set x = GetUnitX(dummy_1) - cos
set y = GetUnitY(dummy_1) - sin
set o = GetUnitX(dummy_2) + cos
set z = GetUnitY(dummy_2) + sin
if fade_count < FADE_COUNT then
set fade_count = fade_count + 1
if fade == 0 then
set fade = FADE_FLASH
else
set fade = 0
endif
if fade_count == FADE_COUNT then
set fade = 0
endif
elseif fade < 255 then
set fade = fade + FADE_SPEED
else
set StructData[i] = StructData[MUI]
set StructData[MUI] = -2
set MUI = MUI - 1
if MUI == -1 then
call PauseTimer(TIMER)
endif
call DestroyEffect(AddSpecialEffectTarget(BLINK_END,caster,ATTACHMENT))
call GroupEnumUnitsInRange(G,targetx,targety,DAMAGE_RADIUS,null)
call SetUnitAbilityLevel(Dummy,DSPELL_ID,lvl)
set count = 0
loop
set f = FirstOfGroup(G)
exitwhen f == null
if filterFunc(owner,f) and f != target then
set count = count +1
endif
call GroupRemoveUnit(G,f)
endloop
if UnitAlive(target) then
call SetUnitX(Dummy,GetUnitX(target))
call SetUnitY(Dummy,GetUnitY(f))
call UnitDamageTargetEx(caster,target,dmg,true,false,ATTACK_TYPE,DAMAGE_TYPE,WEAPON_TYPE)
if GetUnitAbilityLevel(target,SPOOKED_ID) == 1 then
set b = true
call UnitRemoveAbility(target,SPOOKED_ID)
call AddFreudeStack(SPELL_ID,caster)
else
set b2 = true
endif
if b or count == 0 then
if Fear.isFeared(target) then
set F = Fear.get(target)
set F.time = F.time + (5.+(lvl/2.))*2
call UnitDamageTargetEx(caster,target,lvl*.02*GetUnitState(target,UNIT_STATE_MAX_LIFE),false,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
if not IsUnitType(target,UNIT_TYPE_ANCIENT) and GetRandomInt(0,100) <= 2*lvl then
call UnitRemoveAbility(target, 'A04P')
call UnitRemoveAbility(target, 'A08E')
call UnitRemoveAbility(target, 'A08B')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Skull Missile.mdx",target,"chest"))
call UnitDamageTargetEx(caster,target,GetUnitState(target,UNIT_STATE_MAX_LIFE),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
else
set F = Fear.create()
set F.targ = target
set F.path = "war3mapImported\\Poltergeist.mdx"
set F.attach = "head"
if b and count == 0 then
set F.time = (5.+(lvl/2.))*2
else
set F.time = (5.+(lvl/2.))
endif
set b = false
call F.start()
call F.destroy()
endif
endif
if b2 then
if not IsUnitType(target,UNIT_TYPE_HERO) then
call UnitAddAbility(target,SPOOKED_ID)
endif
endif
endif
call SetUnitX(caster,targetx)
call SetUnitY(caster,targety)
call SetUnitFacing(caster,bj_RADTODEG * Atan2(GetUnitY(target) - (targety) , GetUnitX(target) - (targetx)))
call ShowUnit(caster,true)
if UnitAlive(target) then
call IssueTargetOrder(caster,"attack",target)
endif
call SetUnitTimeScale(caster,1.)
if GetLocalPlayer() == owner then
call ClearSelection()
call SelectUnit(caster,true)
endif
call RemoveUnit(dummy_1)
call RemoveUnit(dummy_2)
call RemoveUnit(dummy_3)
set owner = null
set dummy_1 = null
set dummy_2 = null
set dummy_3 = null
set caster = null
set target = null
call destroy()
endif
endif
call SetUnitX(dummy_1,x)
call SetUnitY(dummy_1,y)
call SetUnitX(dummy_2,o)
call SetUnitY(dummy_2,z)
call SetUnitFlyHeight(dummy_3,GetUnitFlyHeight(dummy_3)-height,0.)
call SetUnitVertexColor(dummy_1,255,255,255,fade)
call SetUnitVertexColor(dummy_2,255,255,255,fade)
set i = i + 1
endloop
endmethod
static method onCast takes nothing returns boolean
local thistype this
local real x
local real y
local real a
local playercolor owner_color
local integer i
if GetSpellAbilityId() == SPELL_ID then
set x = GetUnitX(GetSpellTargetUnit()) + 100. * Cos(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
set y = GetUnitY(GetSpellTargetUnit()) + 100. * Sin(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
// call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.1))
set this = allocate()
set MUI = MUI + 1
set StructData[MUI] = this
set caster = GetTriggerUnit()
set owner = GetTriggerPlayer()
set owner_color = GetPlayerColor(owner)
set lvl = GetUnitAbilityLevel(caster,SPELL_ID)
set dmg = getDamage(lvl,GetHeroAgi(caster,true))
call ShowUnit(caster,false)
set targetx = x
set targety = y
set target = GetSpellTargetUnit()
call SetUnitFacing(caster,bj_RADTODEG * Atan2(GetUnitY(target) - (targety) , GetUnitX(target) - (targetx)))
set fade_seperation = FADE_FLASH/3
set x = GetUnitX(caster)
set y = GetUnitY(caster)
set angle = 57.29583 * Atan2(targety - y, targetx - x) + 90.
set facing = angle - 90.
set facing2 = angle - 270.
set angle = angle *.0174533
set speration_speed = SPERATION_SPEED/FADE_SPEED
set height = MAX_HEIGHT/(SPERATION_SPEED*FADE_SPEED/speration_speed-10.)
set cos = speration_speed * Cos(angle)
set sin = speration_speed * Sin(angle)
set i = GetUnitTypeId(caster)
set dummy_1 = CreateUnit(DUMMY_OWNER,i,x,y,facing)
if UnitAddAbility(dummy_1,'Aloc') then
call SetUnitPathing(dummy_1,false)
call SetUnitX(dummy_1,x)
call SetUnitY(dummy_1,y)
endif
set dummy_2 = CreateUnit(DUMMY_OWNER,i,x,y,facing)
if UnitAddAbility(dummy_2,'Aloc') then
call SetUnitPathing(dummy_2,false)
call SetUnitX(dummy_2,x)
call SetUnitY(dummy_2,y)
endif
set dummy_3 = CreateUnit(DUMMY_OWNER,DUMMY_BOLT,targetx,targety,facing)
if UnitAddAbility(dummy_3,CROW_FORM) then
call UnitRemoveAbility(dummy_3,CROW_FORM)
call SetUnitFlyHeight(dummy_3,MAX_HEIGHT,0.)
endif
//********************************************
call SetUnitColor(dummy_1,owner_color)
call SetUnitColor(dummy_2,owner_color)
//********************************************
call SetUnitTimeScale(caster,ANIMATION_SPEED)
call SetUnitTimeScale(dummy_1,ANIMATION_SPEED)
call SetUnitTimeScale(dummy_2,ANIMATION_SPEED)
//********************************************
call SetUnitAnimation(caster,ANIMATION)
call SetUnitAnimation(dummy_1,ANIMATION)
call SetUnitAnimation(dummy_2,ANIMATION)
//********************************************
if MUI == 0 then
call TimerStart(TIMER,PERIODIC,true,function thistype.onPeriodic)
endif
endif
set owner_color = null
return false
endmethod
static method onInit takes nothing returns nothing
local integer i = 0
local trigger t = CreateTrigger()
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set i = i + 1
endloop
call TriggerAddCondition(t,function thistype.onCast)
set Dummy = CreateUnit(DUMMY_OWNER,CASTER_DUMMY,0.,0.,0.)
endmethod
endstruct
endscope
//TESH.scrollpos=87
//TESH.alwaysfold=0
scope AoEFearDoT initializer OnInit
globals
private constant integer SPELL_ID = 'A0CK'
private constant integer SPOOKED_ID = 'A0CI'
private constant integer SFX_ID = 'A0CG'
private constant string SFX = "war3mapImported\\MindRipper.mdx"
//private constant integer IAS_ID = 'A05W'
private constant string SFX_PATH = "war3mapImported\\Desecrate.mdx"
private constant string SFX_PATH2 = "war3mapImported\\Doomsday.mdx"
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct Dec
unit u
unit t
integer i
method destroy takes nothing returns nothing
set this.u = null
set this.t = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Dec data = GetTimerData(t)
local real dmg = GetHeroAgi(data.u,true)
local boolean b = false
local boolean b2 = false
local Fear F
if not UnitAlive(data.t) or data.i == 0 then
//call UnitRemoveAbility(data.t,IAS_ID)
call UnitRemoveAbility(data.t,SFX_ID)
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
if GetUnitAbilityLevel(data.t,SPOOKED_ID) == 1 then
set b = true
call UnitRemoveAbility(data.t,SPOOKED_ID)
call AddFreudeStack(SPELL_ID,data.u)
else
set b2 = true
endif
if b then
if Fear.isFeared(data.t) then
set F = Fear.get(data.t)
set F.time = F.time + 5.
else
set F = Fear.create()
set F.targ = data.t
set F.path = "war3mapImported\\Poltergeist.mdx"
set F.attach = "head"
set F.time = 5.
set b = false
call F.start()
call F.destroy()
endif
endif
if b2 then
if not IsUnitType(data.t,UNIT_TYPE_HERO) then
call UnitAddAbility(data.t,SPOOKED_ID)
endif
endif
//if (dmg/4.) + GetWidgetLife(data.u) >= GetUnitState(data.u,UNIT_STATE_MAX_LIFE) then
// call SetWidgetLife(data.u, GetUnitState(data.u,UNIT_STATE_MAX_LIFE))
// call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",data.u,"origin"))
//else
//call SetWidgetLife(data.u,GetWidgetLife(data.u) + (dmg/4.) )
// call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",data.u,"origin"))
//endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Doomsday.mdx",data.t,"origin"))
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,3.,false,function Handler)
endif
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local timer t
local Dec data
local unit tar = GetFilterUnit()
if IsUnitEnemy(tar,GetOwningPlayer(CASTER)) and UnitAlive(tar) then
set t = NewTimer()
set data = Dec.create()
set data.u = CASTER
set data.t = tar
call UnitAddAbility(data.t,SFX_ID)
set data.i = 4
//call UnitAddAbility(tar,IAS_ID)
//call SetUnitAbilityLevel(tar,IAS_ID,GetUnitAbilityLevel(CASTER,SPELL_ID))
call SetTimerData(t,data)
call TimerStart(t,1.27,false,function Handler)
endif
set t = null
set tar = null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
// call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.2))
call DestroyEffect(AddSpecialEffect(SFX_PATH,x,y))
//call DestroyEffect(AddSpecialEffect(SFX_PATH2,x,y))
set CASTER = u
call GroupEnumUnitsInRange(GROUP,x,y,249.,Filter(function FilterActions))
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=66
//TESH.alwaysfold=0
scope FearUltimate initializer OnInit
globals
private constant integer SPELL_ID = 'A0CQ'
private constant string PATHM = "war3mapImported\\GatherSouls.mdx"
private constant string PERIODIC_P = "war3mapImported\\Curse.mdx"
private constant string ATTACHM = "origin"
private constant string PATH = "war3mapImported\\Poltergeist.mdx"
private constant string ATTACH = "overhead"
private unit array RANDOMU
private integer RANDOMI = 0
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct DefStomp
unit DefU
unit DefT
integer DefI
effect DefE
method destroy takes nothing returns nothing
set this.DefU = null
set this.DefT = null
set this.DefE = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
if UnitAlive(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER)) == true and IsUnitVisible(GetFilterUnit(),GetOwningPlayer(CASTER)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) then
set RANDOMI = RANDOMI + 1
set RANDOMU[RANDOMI] = GetFilterUnit()
endif
return false
endfunction
private function DefStompH takes nothing returns nothing
local timer t = GetExpiredTimer()
local DefStomp data = GetTimerData(t)
local real ux = GetUnitX(data.DefT)
local real uy = GetUnitY(data.DefT)
local unit ru
local unit u
local real int = GetRandomReal(.5,1.75-(I2R(GetUnitAbilityLevel(data.DefU,SPELL_ID))*.1))
local Fear F
local boolean b = false
if data.DefI == 0 or UnitAlive(data.DefT) == false then
call DestroyEffect(data.DefE)
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
set CASTER = data.DefU
call GroupEnumUnitsInRange(GROUP,ux,uy,600.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect(PERIODIC_P,ux,uy))
if RANDOMI > 0 then
set ru = RANDOMU[GetRandomInt(1, RANDOMI)]
set u = CreateUnit(GetOwningPlayer(data.DefU),'h007',ux,uy,0.)
call UnitAddAbility(u,'A0AH')
call SetUnitAbilityLevel(u,'A0AH',GetUnitAbilityLevel(data.DefU,SPELL_ID))
call IssueTargetOrder(u,"deathcoil",ru)
call UnitApplyTimedLife(u,'BTLF',5.)
endif
set RANDOMI = 0
set data.DefI = data.DefI - 1
call SetTimerData(t,data)
call TimerStart(t,int,false,function DefStompH)
endif
set t = null
set ru = null
set u = null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit targ = GetSpellTargetUnit()
local integer level = GetUnitAbilityLevel(u,SPELL_ID)
local real interval = GetRandomReal(.5,1.75-(I2R(level)*.1))
local timer t
local DefStomp data = DefStomp.create()
set data.DefU = u
set data.DefT = u
set data.DefI = 15 + (level*3)
set data.DefE = AddSpecialEffectTarget(PATHM,u,ATTACHM)
//call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.25))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShadowAssault.mdx",data.DefU,"origin"))
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,interval,false,function DefStompH)
set u = null
set targ = null
set t = null
endfunction
//===========================================================================
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=101
//TESH.alwaysfold=0
//Remember that you must set the 3 integer arrays to 0 when units are created.
//scope ZFearStacks
library FearStacks requires TimerUtils
globals
integer array FearCounter
integer array FearCountExtra
integer array FearStacking
constant integer Schadenfreude_BUFF_ID = 'A0CJ'
constant integer Schadenfreude_UNIT_ID = 'U004'
constant string Schadenfreude_EFFECT = "war3mapImported\\Grin Curse.mdx"
constant string Schadenfreude_ATTACH = "chest"
endglobals
struct Schadenfreude
unit u
integer i
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
//native UnitAlive takes unit id returns boolean
function Schadenfreude_Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Schadenfreude data = GetTimerData(t)
local integer ud = GetUnitUserData(data.u)
if GetUnitTypeId(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))]) != Schadenfreude_UNIT_ID or LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] != data.u then
else
if FearCountExtra[ud] > 0 then
set FearCountExtra[ud] = FearCountExtra[ud] - 1
else
set FearCounter[ud] = FearCounter[ud] - 1
endif
endif
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
set t= null
endfunction
function Schadenfreude_Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Schadenfreude data = GetTimerData(t)
local integer ud = GetUnitUserData(data.u)
set FearStacking[ud] = FearStacking[ud] - 1
if FearStacking[ud] == 0 then
call SetUnitVertexColor(data.u,190,190,190,255)
call UnitRemoveAbility(data.u,Schadenfreude_BUFF_ID)
endif
call SetHeroAgi(data.u,GetHeroAgi(data.u,false)-data.i,true)
call data.destroy()
call ReleaseTimer(t)
set t= null
endfunction
function AddFreudeStack takes integer id, unit cast returns nothing
local timer t
local Schadenfreude data
local unit u = cast
local integer i
local integer ud = GetUnitUserData(u)
local texttag tt
local string text
if FearCounter[ud] == 9 then
set FearCountExtra[ud] = FearCountExtra[ud] + 9
set FearCounter[ud] = 0
set data = Schadenfreude.create()
set data.u = u
set data.i = GetHeroAgi(data.u,true)
set tt = CreateTextTag()
set text ="|cFF4A484AE|r|cFF4A454Cn|r|cFF4B414Fd|r|cFF4B3E52u|r|cFF4C3B54r|r|cFF4C3856i|r|cFF4D3459n|r|cFF4D315Cg|r|cFF4E2E5E |r|cFF4E2B60M|r|cFF4F2763a|r|cFF4F2466l|r|cFF4F2168i|r|cFF501D6Ac|r|cFF501A6De|r|cFF511770 |r|cFF511472L|r|cFF521074e|r|cFF520D77v|r|cFF530A7Ae|r|cFF53077Cl|r|cFF54037E |r|cFF54008110"
call SetTextTagText(tt, text, .024)
call SetTextTagPos(tt, GetUnitX(cast), GetUnitY(cast), 0.0)
call SetTextTagColor(tt, 255, 255, 255, 255)
call SetTextTagVelocity(tt, GetRandomReal(-.02,.02), GetRandomReal(-.02,.02))
call SetTextTagVisibility(tt, true)
call SetTextTagFadepoint(tt, 2.0)
call SetTextTagLifespan(tt, 5.0)
call SetTextTagPermanent(tt, false)
call SetHeroAgi(data.u,GetHeroAgi(data.u,false) + data.i,true)
call UnitAddAbility(data.u,Schadenfreude_BUFF_ID)
call SetUnitVertexColor(data.u,51,0,51,128)
call DestroyEffect(AddSpecialEffectTarget(Schadenfreude_EFFECT,data.u,Schadenfreude_ATTACH))
set FearStacking[ud] = FearStacking[ud] + 1
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,30.,false,function Schadenfreude_Handler2)
set i = GetUnitAbilityLevel(u,id)
call UnitRemoveAbility(u,id)
call UnitAddAbility(u,id)
call SetUnitAbilityLevel(u,id,i)
else
set FearCounter[ud] = FearCounter[ud] + 1
set tt = CreateTextTag()
set text ="|cFF4A484AE|r|cFF4A454Cn|r|cFF4B414Fd|r|cFF4B3E52u|r|cFF4C3B54r|r|cFF4C3856i|r|cFF4D3459n|r|cFF4D315Cg|r|cFF4E2E5E |r|cFF4E2B60M|r|cFF4F2763a|r|cFF4F2466l|r|cFF4F2168i|r|cFF501D6Ac|r|cFF501A6De|r|cFF511770 |r|cFF511472L|r|cFF521074e|r|cFF520D77v|r|cFF530A7Ae|r|cFF53077Cl|r|cFF54037E |r|cFF540081"+I2S(FearCounter[ud])
call SetTextTagText(tt, text, .024)
call SetTextTagPos(tt, GetUnitX(cast), GetUnitY(cast), 0.0)
call SetTextTagColor(tt, 255, 255, 255, 255)
call SetTextTagVelocity(tt, GetRandomReal(-.02,.02), GetRandomReal(-.02,.02))
call SetTextTagVisibility(tt, true)
call SetTextTagFadepoint(tt, 2.0)
call SetTextTagLifespan(tt, 5.0)
call SetTextTagPermanent(tt, false)
set t = NewTimer()
set data = Schadenfreude.create()
set data.u = u
call SetTimerData(t,data)
if id == 'A0CU' then
call TimerStart(t,90.,false,function Schadenfreude_Handler)
elseif id == 'A0CK' then
call TimerStart(t,5.,false,function Schadenfreude_Handler)
elseif id == 'A0CQ' then
call TimerStart(t,20.,false,function Schadenfreude_Handler)
else
call TimerStart(t,10.,false,function Schadenfreude_Handler)
endif
endif
set text = null
set tt = null
set t = null
set u = null
endfunction
endlibrary
//endscope
//TESH.scrollpos=455
//TESH.alwaysfold=0
//***************************************************************************
//***************************************************************************
//***************************************************************************
// S H A D O W I M A G E B L I N K
// By: Elphis (Nyuu)
// Version: 1.0
//
// Sepll Description:
// ` - Use dark power, creating an illusion and a energy
// ball shot to the selected point and after energy ball hit the target point,
// it will explodes and stuns enemies in 2/2.5/3/3.5 seconds and cause 50/100/150/200
// damage in 300 range.
// - Installation:
// - Import/copy Shadow Image Blink code to your map
// - Import/copy the custom ability and unit to your map and change the SPELL_ID, DSPELL_ID, DUMMY_BOLT and DUMMY_CASTER if needed
// - You may view the raw ID of the objects by pressing CTRL+D in the object editor
// - You may play with the configurables below
// - Credit:
// - Unleashthepower.mdx - http://www.hiveworkshop.com/forums/models-530/unleash-power-243024/?prev=search%3DPower%26d%3Dlist%26r%3D20
// - TerrainPathability - http://www.wc3c.net/showthread.php?t=103862
//
//
//***************************************************************************
//***************************************************************************
//***************************************************************************
scope FearUlti4Illusion
globals
//Spell rawcode, change if needed
private constant integer SPELL_ID = 'A0AH'
private constant integer SPELL_ID_ORIG = 'A0CQ'
private constant integer SPOOKED_ID = 'A0CI'
//
private constant integer UNIT_ID = 'h011'
private constant integer DSPELL_ID = 'A001'
//Dummy unit rawcode (Bolt model) change if needed
private constant integer DUMMY_BOLT = 'e000'
//Dummy caster rawcode, change if needed
private constant integer CASTER_DUMMY = 'e001'
//Crow Form ability
private constant integer CROW_FORM = 'Amrf'
//Animation play when the caster casting this spell
private constant string ANIMATION = "attack"
//Effect of spell
private constant string BLINK_CAST = "war3mapImported\\WarpDarkTarget.mdx"
//Effect of spell when begin & end spell
private constant string BLINK_END = ".mdl"
//Attachment of the caster when spell end (Using BLINK_END effect)
private constant string ATTACHMENT = "chest"
//Order id of dummy caster casting the dummy ability
private constant string ORDER_ID = "thunderbolt"
//Dummy owner
private constant player DUMMY_OWNER = Player(15)
//******************************DAMAGE DATA SETTINGS******************************
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_HERO
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_DEATH
private constant weapontype WEAPON_TYPE = WEAPON_TYPE_METAL_HEAVY_SLICE
//********************************************************************************
//Damage radius
private constant real DAMAGE_RADIUS = 300.
//Damage base of this spell
private constant real DAMAGE_BASE = 50.
//Animation speed of the caster unit when this spell is used
private constant real ANIMATION_SPEED = 0.43
//Spell period
private constant real PERIODIC = .031250000
//Virtual caster speed separator
private constant real SPERATION_SPEED = 20.
//Max height of the ball power
private constant real MAX_HEIGHT = 1000.
/*Fade settings*/
private constant integer FADE_COUNT = 10
private constant integer FADE_FLASH = 85
private constant integer FADE_SPEED = 20
//********************************************************
//***************************Non - Configurable*****************************
/* */
/**/private constant group G = CreateGroup()/**/
/* */
/**/private integer MUI = -1 /**/
/* */
/**/private integer array StructData /**/
/* */
/**/private constant timer TIMER = CreateTimer()/**/
//**************************************************************************
/**/private unit Dummy
//**************************************************************************
endglobals
//************************************DO NOT MODIFY ANYTHING BELOW************************************
//*******************Damage setting***********************************
//********************************************************************
//*******************Filter Function***********************************
//********************************************************************
//native UnitAlive takes unit u returns boolean
private struct ShadowImageBlink
unit caster
unit dummy_1
unit dummy_2
unit dummy_3
unit target
integer fade = 255
integer lvl
integer fade_count = FADE_COUNT
integer count
boolean fade_done = true
boolean subtract = true
player owner
real cos
real sin
real facing
real facing2
real total = -SPERATION_SPEED
real angle
real fade_seperation
real targetx
real targety
real speration_speed
real height
real dmg
static method onPeriodic takes nothing returns nothing
local integer i = 0
local thistype this
local real x
local real y
local real o
local real z
local unit f = null
local Fear F
local boolean b = false
local boolean b2 = false
loop
exitwhen i > MUI
set this = StructData[i]
if subtract then
set x = GetUnitX(dummy_1) + cos
set y = GetUnitY(dummy_1) + sin
set o = GetUnitX(dummy_2) - cos
set z = GetUnitY(dummy_2) - sin
if fade > fade_seperation then
if not fade_done then
set fade = fade - FADE_SPEED
else
set fade = 0
endif
elseif fade_done then
set fade = FADE_FLASH
if fade_count > 0 then
set fade_count = fade_count - 1
else
set subtract = false
set fade_done = false
set fade = 0
set cos = Cos(angle)
set sin = Sin(angle)
if UnitAlive(target) then
set targetx = GetUnitX(target) - 100. * Cos(GetUnitFacing(caster) * bj_DEGTORAD)
set targety = GetUnitY(target) - 100. * Sin(GetUnitFacing(caster) * bj_DEGTORAD)
set facing2 = bj_RADTODEG * Atan2((GetUnitY(target)) - (targety), (GetUnitX(target)) - (targetx))
endif
set x = targetx + total * cos
set y = targety + total * sin
//call SetUnitX(dummy_1,x)
//call SetUnitY(dummy_1,y)
call RemoveUnit(dummy_1)
set dummy_1 = CreateUnit(DUMMY_OWNER,UNIT_ID,x,y,facing2)
if UnitAddAbility(dummy_1,'Aloc') then
call SetUnitPathing(dummy_1,false)
call SetUnitX(dummy_1,x)
call SetUnitY(dummy_1,y)
endif
call DestroyEffect(AddSpecialEffect(BLINK_CAST,x,y))
set x = targetx - total * cos
set y = targety - total * sin
call RemoveUnit(dummy_2)
set dummy_2 = CreateUnit(DUMMY_OWNER,UNIT_ID,x,y,facing2)
if UnitAddAbility(dummy_2,'Aloc') then
call SetUnitPathing(dummy_2,false)
call SetUnitX(dummy_2,x)
call SetUnitY(dummy_2,y)
endif
call SetUnitColor(dummy_1,GetPlayerColor(owner))
call SetUnitColor(dummy_2,GetPlayerColor(owner))
//********************************************
call SetUnitTimeScale(dummy_1,ANIMATION_SPEED)
call SetUnitTimeScale(dummy_2,ANIMATION_SPEED)
//********************************************
call SetUnitAnimation(dummy_1,ANIMATION)
call SetUnitAnimation(dummy_2,ANIMATION)
//call SetUnitX(dummy_2,x)
//call SetUnitY(dummy_2,y)
call DestroyEffect(AddSpecialEffect(BLINK_CAST,x,y))
set cos = speration_speed*Cos(angle)
set sin = speration_speed*Sin(angle)
endif
else
set fade_done = true
endif
set total = total + speration_speed
endif
if not fade_done and not subtract then
set x = GetUnitX(dummy_1) - cos
set y = GetUnitY(dummy_1) - sin
set o = GetUnitX(dummy_2) + cos
set z = GetUnitY(dummy_2) + sin
if fade_count < FADE_COUNT then
set fade_count = fade_count + 1
if fade == 0 then
set fade = FADE_FLASH
else
set fade = 0
endif
if fade_count == FADE_COUNT then
set fade = 0
endif
elseif fade < 255 then
set fade = fade + FADE_SPEED
else
set StructData[i] = StructData[MUI]
set StructData[MUI] = -2
set MUI = MUI - 1
if MUI == -1 then
call PauseTimer(TIMER)
endif
call DestroyEffect(AddSpecialEffectTarget(BLINK_END,caster,ATTACHMENT))
if UnitAlive(target) then
set dmg = (GetHeroAgi(caster,true)*GetUnitAbilityLevel(caster,SPELL_ID_ORIG)) + (75.*GetUnitAbilityLevel(caster,SPELL_ID_ORIG))
call UnitDamageTargetEx(caster,target,dmg,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_METAL_HEAVY_SLICE)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\CurseBolt.mdx",target,"chest"))
if GetUnitAbilityLevel(target,SPOOKED_ID) == 1 then
set b = true
call UnitRemoveAbility(target,SPOOKED_ID)
call AddFreudeStack(SPELL_ID_ORIG,caster)
else
set b2 = true
endif
if b then
if Fear.isFeared(target) then
set F = Fear.get(target)
set F.time = F.time + 5.
else
set F = Fear.create()
set F.targ = target
set F.path = "war3mapImported\\Poltergeist.mdx"
set F.attach = "head"
set F.time = 5.
set b = false
call F.start()
call F.destroy()
endif
endif
if b2 then
if not IsUnitType(target,UNIT_TYPE_HERO) then
call UnitAddAbility(target,SPOOKED_ID)
endif
endif
endif
//call SetUnitX(caster,targetx)
//call SetUnitY(caster,targety)
//call SetUnitFacing(caster,bj_RADTODEG * Atan2(GetUnitY(target) - (targety) , GetUnitX(target) - (targetx)))
//call ShowUnit(caster,true)
//call SetUnitTimeScale(caster,1.)
// if GetLocalPlayer() == owner then
// call ClearSelection()
// call SelectUnit(caster,true)
//endif
call RemoveUnit(dummy_1)
call RemoveUnit(dummy_2)
call RemoveUnit(dummy_3)
set owner = null
set dummy_1 = null
set dummy_2 = null
set dummy_3 = null
set caster = null
set target = null
call destroy()
endif
endif
call SetUnitX(dummy_1,x)
call SetUnitY(dummy_1,y)
call SetUnitX(dummy_2,o)
call SetUnitY(dummy_2,z)
call SetUnitFlyHeight(dummy_3,GetUnitFlyHeight(dummy_3)-height,0.)
call SetUnitVertexColor(dummy_1,255,255,255,fade)
call SetUnitVertexColor(dummy_2,255,255,255,fade)
set i = i + 1
endloop
endmethod
static method onCast takes nothing returns boolean
local thistype this
local real x
local real y
local real a
local playercolor owner_color
local integer i
if GetSpellAbilityId() == SPELL_ID then
set x = GetUnitX(GetSpellTargetUnit()) + 100. * Cos(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
set y = GetUnitY(GetSpellTargetUnit()) + 100. * Sin(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
set this = allocate()
set MUI = MUI + 1
set StructData[MUI] = this
set caster = LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
set owner = GetTriggerPlayer()
set owner_color = GetPlayerColor(owner)
set lvl = GetUnitAbilityLevel(caster,SPELL_ID)
//call ShowUnit(caster,false)
set targetx = x
set targety = y
set target = GetSpellTargetUnit()
//call SetUnitFacing(GetTriggerUnit(),bj_RADTODEG * Atan2(GetUnitY(target) - (targety) , GetUnitX(target) - (targetx)))
set fade_seperation = FADE_FLASH/3
set x = GetUnitX(GetSpellTargetUnit()) - 100. * Cos(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
set y = GetUnitY(GetSpellTargetUnit()) - 100. * Sin(GetUnitFacing(GetTriggerUnit()) * bj_DEGTORAD)
set angle = 57.29583 * Atan2(targety - y, targetx - x) + 90.
set facing = angle - 90.
set facing2 = angle - 270.
set angle = angle *.0174533
set speration_speed = SPERATION_SPEED/FADE_SPEED
set height = MAX_HEIGHT/(SPERATION_SPEED*FADE_SPEED/speration_speed-10.)
set cos = speration_speed * Cos(angle)
set sin = speration_speed * Sin(angle)
set i = UNIT_ID
// set dummy_1 = CreateUnit(DUMMY_OWNER,UNIT_ID,x,y,facing)
//if UnitAddAbility(dummy_1,'Aloc') then
// call SetUnitPathing(dummy_1,false)
// call SetUnitX(dummy_1,x)
// call SetUnitY(dummy_1,y)
//endif
//set dummy_2 = CreateUnit(DUMMY_OWNER,UNIT_ID,x,y,facing)
//if UnitAddAbility(dummy_2,'Aloc') then
// call SetUnitPathing(dummy_2,false)
// call SetUnitX(dummy_2,x)
// call SetUnitY(dummy_2,y)
//endif
//set dummy_3 = CreateUnit(DUMMY_OWNER,DUMMY_BOLT,targetx,targety,facing)
//if UnitAddAbility(dummy_3,CROW_FORM) then
// call UnitRemoveAbility(dummy_3,CROW_FORM)
// call SetUnitFlyHeight(dummy_3,MAX_HEIGHT,0.)
//endif
//********************************************
//call SetUnitColor(dummy_1,owner_color)
//call SetUnitColor(dummy_2,owner_color)
//********************************************
//call SetUnitTimeScale(caster,ANIMATION_SPEED)
// call SetUnitTimeScale(dummy_1,ANIMATION_SPEED)
// call SetUnitTimeScale(dummy_2,ANIMATION_SPEED)
//********************************************
//call SetUnitAnimation(caster,ANIMATION)
// call SetUnitAnimation(dummy_1,ANIMATION)
// call SetUnitAnimation(dummy_2,ANIMATION)
//********************************************
if MUI == 0 then
call TimerStart(TIMER,PERIODIC,true,function thistype.onPeriodic)
endif
endif
set owner_color = null
return false
endmethod
static method onInit takes nothing returns nothing
local integer i = 0
local trigger t = CreateTrigger()
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set i = i + 1
endloop
call TriggerAddCondition(t,function thistype.onCast)
set Dummy = CreateUnit(DUMMY_OWNER,CASTER_DUMMY,0.,0.,0.)
endmethod
endstruct
endscope
//TESH.scrollpos=62
//TESH.alwaysfold=0
scope AoEFearSpell
//=============================================================
//=========================SETUP================================
//=============================================================
globals
private constant integer SPELL_ID = 'A0CL'
private constant integer SPOOKED_ID = 'A0CI'
private constant string PATH = "war3mapImported\\Poltergeist.mdx"
private constant string PATH_2 = "war3mapImported\\CallOfAggression.mdx"
private constant string ATTACH = "head"
endglobals
private function Duration takes integer level returns integer
return 5+level
endfunction
private function Aoe takes integer level returns integer
return 250 + 25*level
endfunction
private function Cond takes nothing returns boolean
local unit FoG
local player p
local real x
local real y
local group g
local integer lvl
local Fear F
local boolean b = false
local boolean b2 = false
if GetSpellAbilityId() == SPELL_ID then
// call SetUnitState(GetTriggerUnit(),UNIT_STATE_MANA,GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*.2))
set g = CreateGroup()
set p = GetOwningPlayer(GetTriggerUnit())
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
set lvl = GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
call DestroyEffect(AddSpecialEffect(PATH_2,x,y))
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if not IsUnitAlly(FoG,p) and UnitAlive(FoG) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\DarkLightning.mdx",FoG,"origin"))
if GetUnitAbilityLevel(FoG,SPOOKED_ID) == 1 then
call UnitRemoveAbility(FoG,SPOOKED_ID)
set b = true
call AddFreudeStack(SPELL_ID,GetTriggerUnit())
else
set b2 = true
endif
if Fear.isFeared(FoG) then
set F = Fear.get(FoG)
set F.time = F.time + (Duration(lvl)*2)
call UnitDamageTargetEx(GetTriggerUnit(),FoG,lvl*.03*GetUnitState(FoG,UNIT_STATE_MAX_LIFE),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
if not IsUnitType(FoG,UNIT_TYPE_ANCIENT) and GetRandomInt(0,100) <= 2*lvl then
call UnitRemoveAbility(FoG, 'A04P')
call UnitRemoveAbility(FoG, 'A08E')
call UnitRemoveAbility(FoG, 'A08B')
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Skull Missile.mdx",FoG,"chest"))
call UnitDamageTargetEx(GetTriggerUnit(),FoG,99999999.,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
else
set F = Fear.create()
set F.targ = FoG
set F.path = PATH
set F.attach = ATTACH
if b then
set F.time = Duration(lvl)*2
else
set F.time = Duration(lvl)
endif
set b = false
call F.start()
call F.destroy()
endif
if b2 then
if not IsUnitType(FoG,UNIT_TYPE_HERO) then
call UnitAddAbility(FoG,SPOOKED_ID)
endif
endif
endif
endloop
call DestroyGroup(g)
set g = null
set FoG = null
set p = null
endif
return false
endfunction
private module Module
private static method onInit takes nothing returns nothing
call init()
endmethod
endmodule
private struct A extends array
private static method init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Cond))
set t = null
endmethod
implement Module
endstruct
endscope
//TESH.scrollpos=10
//TESH.alwaysfold=0
scope ChatatadrusLight initializer OnInit
globals
private constant integer SPELL_ID = 'A0OA'
private integer array StackCount
endglobals
private struct NBind
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local NBind data = GetTimerData(t)
set StackCount[GetUnitUserData(data.u)] = StackCount[GetUnitUserData(data.u)] - 1
if StackCount[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A09D')
call UnitRemoveAbility(data.u,'A0OB')
call UnitRemoveAbility(data.u,'B06E')
if GetUnitTypeId(data.u) == 'E01L' then
call BlzSetUnitAttackCooldown(data.u,1.9,0)
else
call BlzSetUnitAttackCooldown(data.u,1.8,0)
endif
endif
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local NBind data = NBind.create()
set data.u = GetTriggerUnit()
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",data.u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",data.u,"origin"))
set StackCount[GetUnitUserData(data.u)] = StackCount[GetUnitUserData(data.u)] + 1
if StackCount[GetUnitUserData(data.u)] == 1 then
call UnitAddAbility(data.u,'A09D')
call UnitAddAbility(data.u,'A0OB')
if GetUnitTypeId(data.u) == 'E01L' then
call BlzSetUnitAttackCooldown(data.u,.6333,0)
else
call BlzSetUnitAttackCooldown(data.u,.6,0)
endif
endif
call SetTimerData(t,data)
call TimerStart(t,15.,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
globals
integer array IndomStacks
trigger INDOMMIGHT
endglobals
scope Indomitable initializer OnInit
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer mhp
local integer level = GetUnitAbilityLevel(a,'A01K')
local real cooldown
if (level != 0 or GetUnitAbilityLevel(a,'A05N')!= 0) and GetEventDamage() > 0 and a != u and IsUnitEnemy(u,GetOwningPlayer(a)) and (BI[NI]!=DAMAGE_TYPE_PLANT) then
if GetUnitAbilityLevel(a,'A01K')!= 0 then
set mhp = BlzGetUnitMaxHP(a)
if IndomStacks[GetUnitUserData(a)] <= 1000000 then
set IndomStacks[GetUnitUserData(a)] = IndomStacks[GetUnitUserData(a)] + 1
call BlzSetUnitMaxHP(a,mhp+5)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\HealingSpray\\HealBottleMissile.mdl",a,"hand,right"))
call DisableTrigger(INDOMMIGHT)
call UnitDamageTargetEx(a, u, ((mhp+4)*level*.05), false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
//call BlzSetEventDamage(GetEventDamage()+((mhp+5)*level*.06))
call EnableTrigger(INDOMMIGHT)
endif
if GetUnitAbilityLevel(a,'A05N')!= 0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(a, 'A05N')
if cooldown > 0 then
if cooldown - .03 <= 0 then
call BlzEndUnitAbilityCooldown(a, 'A05N')
else
call BlzStartUnitAbilityCooldown(a, 'A05N', cooldown - .03)
endif
endif
endif
endif
set u = null
set a = null
return false
endfunction
private function OnInit takes nothing returns nothing
set INDOMMIGHT= CreateTrigger()
call MOE(II, (INDOMMIGHT))
call TriggerAddCondition(INDOMMIGHT, Condition(function Actions))
call DisableTrigger(INDOMMIGHT)
endfunction
endscope
scope RighteousWrath initializer OnInit
globals
private constant integer SPELL_ID = 'A05N'
integer array RWStacks
endglobals
private struct EB
unit u
real d
real ls
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local EB data = GetTimerData(t)
set RWStacks[GetUnitUserData(data.u)]= RWStacks[GetUnitUserData(data.u)] - 1
if RWStacks[GetUnitUserData(data.u)] == 0 then
call UnitRemoveAbility(data.u,'A0NT')
call UnitRemoveAbility(data.u,'A0NV')
call data.destroy()
call ReleaseTimer(t)
else
call data.destroy()
call ReleaseTimer(t)
endif
set t = null
endfunction
private function DP1 takes nothing returns nothing
local timer t = NewTimer()
local EB data = EB.create()
set data.u = GetTriggerUnit()
set RWStacks[GetUnitUserData(data.u)]= RWStacks[GetUnitUserData(data.u)] + 1
if GetUnitAbilityLevel(data.u,SPELL_ID) == 1 then
set data.d = 100
set data.ls = .08
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 2 then
set data.d = 300
set data.ls = .1
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 3 then
set data.d = 600
set data.ls = .12
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 4 then
set data.d = 1000
set data.ls = .14
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 5 then
set data.d = 1500
set data.ls = .16
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 6 then
set data.d = 2000
set data.ls = .18
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 7 then
set data.d = 3000
set data.ls = .20
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 8 then
set data.d = 4000
set data.ls = .22
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 9 then
set data.d = 5000
set data.ls = .24
endif
if GetUnitAbilityLevel(data.u,SPELL_ID) == 10 then
set data.d = 7000
set data.ls = .26
endif
set data.d = data.d + (1.5 * GetHeroStr(data.u,true))+(.01*BlzGetUnitMaxHP(data.u))
call UnitAddAbility(data.u,'A0NT')
call UnitAddAbility(data.u,'A0NV')
call AddUnitBonusTimed(data.u, BONUS_DAMAGE, data.d, 30.)
call AddUnitBonusTimed(data.u, BONUS_LIFE_STEAL, data.ls, 30.)
call SetTimerData(t,data)
call TimerStart(t,30.,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function DP1)
endfunction
endscope
//TESH.scrollpos=200
//TESH.alwaysfold=0
scope Devastate initializer OnInit
globals
private constant integer SPELL_ID = 'A0FS'
private location loc = Location(0.,0.)
private constant group GROUP = CreateGroup()
private unit CASTER
private real X
private real Y
endglobals
private struct DV
unit caster
real x
real y
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private struct DVFly
unit caster
unit u
real h
real oh
integer i
method destroy takes nothing returns nothing
set this.caster = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private struct DVFX
unit caster
real x
real y
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private function Handler3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local DVFX data = GetTimerData(t)
local integer i = 0
local real a
local real x
local real y
local real d = 150.
if IsMechaSkaar[GetUnitUserData(data.caster)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdx",data.x,data.y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\MechaImpaleHitTarget2.mdx",data.x,data.y))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdx",data.x,data.y))
endif
loop
exitwhen i == 25
set a = GetRandomReal(0.,360.)
set x = data.x + GetRandomReal(50.,1200.) * Cos(a*bj_DEGTORAD)
set y = data.y + GetRandomReal(50.,1200.) * Sin(a*bj_DEGTORAD)
if not IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) then
if IsMechaSkaar[GetUnitUserData(data.caster)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\MechaImpaleHitTarget2.mdx",x,y))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdx",x,y))
endif
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen d >= 1200.
loop
exitwhen i == 16
set a = (360./16.)*I2R(i)
set x = data.x + d * Cos(a*bj_DEGTORAD)
set y = data.y + d * Sin(a*bj_DEGTORAD)
if IsMechaSkaar[GetUnitUserData(data.caster)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\MechaImpale.mdx",x,y))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget.mdx",x,y))
endif
set i = i +1
endloop
set i = 0
set d = d + 150.
endloop
call ReleaseTimer(t)
call data.destroy()
set t = null
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local DVFly data = GetTimerData(t)
if data.i == 0 then
call UnitDamageTargetEx(data.caster,data.u,(I2R(GetUnitAbilityLevel(data.caster,'A0FS'))*GetHeroStr(data.caster,true)*20.)+250.+(850.*I2R(GetUnitAbilityLevel(data.caster,'A0FS')))*(1.+(GetHeroLevel(data.caster)*.075)),false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,null)
call data.destroy()
call ReleaseTimer(t)
else
if data.i == 40 then
//call DestroyEffect(AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdx",GetUnitX(data.u),GetUnitY(data.u)))
call UnitAddAbility(data.u,'Amrf')
call UnitRemoveAbility(data.u,'Amrf')
if GetRandomInt(1,2) == 1 then
if IsMechaSkaar[GetUnitUserData(data.caster)] then
call M6E(data.u , GetRandomReal(300.,1200.) , 1.25, GetRandomReal(0.,360.) , "war3mapImported\\Big_ICM_Blue.mdx", 0.0, false, false)
else
call M6E(data.u , GetRandomReal(300.,1200.) , 1.25, GetRandomReal(0.,360.) , "", 0.0, false, false)
endif
endif
endif
if data.i <= 20 then
set data.h = data.h - 60
if data.h >= data.oh then
call SetUnitFlyHeight(data.u,data.h,0.0)
endif
else
set data.h = data.h + 60
call SetUnitFlyHeight(data.u,data.h,0.0)
endif
set data.i = data.i - 1
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler2)
endif
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local timer t
local DVFly data
local unit u = GetFilterUnit()
local real dx = GetUnitX(u) - X
local real dy = GetUnitY(u) - Y
local real d = SquareRoot(dx * dx + dy * dy)
local real a = bj_RADTODEG * Atan2(Y - GetUnitY(u), X - GetUnitX(u))
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call M6E(u , d , .6 , a , "war3mapImported\\Bleeding.mdx" , 0.0 , true , false)
//call M6E(u , d , .6 , a , "war3mapImported\\Big_ICM_Blue.mdx" , 0.0 , true , false)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SmallBloodEX-NoSplat.mdx",u,"chest"))
if GetRandomInt(0,100) >= 50 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\SmallBloodEX-NoSplat.mdx",GetUnitX(u),GetUnitY(u)))
endif
call UnitDamageTargetEx(CASTER,u,(I2R(GetUnitAbilityLevel(CASTER,'A0FS'))*GetHeroStr(CASTER,true)*4.)+200.+(450.*I2R(GetUnitAbilityLevel(CASTER,'A0FS')))*(1.+(GetHeroLevel(CASTER)*.075)),false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,null)
set data = DVFly.create()
set t = NewTimer()
set data.caster = CASTER
set data.u = u
set data.oh = GetUnitFlyHeight(u)
set data.h = data.oh
set data.i = 40
call SetTimerData(t,data)
call TimerStart(t,.63125,false,function Handler2)
endif
set t = null
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local DV data = GetTimerData(t)
local timer t2 = NewTimer()
local DVFX data2 = DVFX.create()
set data2.x = data.x
set data2.y = data.y
set data2.caster = data.caster
call SetTimerData(t2,data2)
call TimerStart(t2,.6,false,function Handler3)
set CASTER = data.caster
set X = data.x
set Y = data.y
call GroupEnumUnitsInRange(GROUP,data.x,data.y,1224.,Filter(function FilterActions))
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local DV data = DV.create()
local unit u
local real x
local real y
local real z
local real Degrees
local player owner
local integer i = 0
local effect fx
set data.caster = GetTriggerUnit()
set data.x = GetUnitX(data.caster)
set data.y = GetUnitY(data.caster)
set owner = GetOwningPlayer(data.caster)
set u = CreateUnit(owner,'h007',data.x,data.y,0.0)
//call BJDebugMsg("Creating Dummy Caster")
call UnitAddAbility(u,'A0FT')
call SetUnitAbilityLevel(u,'A0FT',GetUnitAbilityLevel(data.caster,'A0FS'))
//call BJDebugMsg("Setting Dummy Ability Level")
call IssuePointOrder(u,"dreadlordinferno",data.x,data.y)
//call BJDebugMsg("Issuing Point order")
call UnitApplyTimedLife(u,'BTLF',1.)
set u = null
loop
exitwhen (i == 8)
set Degrees = ((360./8) * I2R(i))
set x = data.x + 10.0 * Cos(Degrees * bj_DEGTORAD)
set y = data.y + 10.0 * Sin(Degrees * bj_DEGTORAD)
/*
set u = CreateUnit(owner, 'n01D', x, y, Degrees)
//call BJDebugMsg("Creating Unit 1")
call UnitApplyTimedLife(u,'BTLF',1.)
set u = null
set u = CreateUnit(owner, 'n01F', x, y, Degrees)
//call BJDebugMsg("Creating Unit 2")
call UnitApplyTimedLife(u,'BTLF',1.)
set u = null
set u = CreateUnit(owner, 'n01E', x, y, Degrees)
//call BJDebugMsg("Creating Unit 3")
call UnitApplyTimedLife(u,'BTLF',1.)
set u = null
set u = CreateUnit(owner, 'n01H', x, y, Degrees)
//call BJDebugMsg("Creating Unit 4")
call UnitApplyTimedLife(u,'BTLF',1.)
*/
call MoveLocation(loc,x,y)
set z = GetLocationZ(loc)
if IsMechaSkaar[GetUnitUserData(data.caster)] then
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdl",x,y)
else
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdl",x,y)
endif
call BlzSetSpecialEffectZ(fx,z)
call BlzSetSpecialEffectPitch(fx,60.*bj_DEGTORAD)
call BlzSetSpecialEffectRoll( fx, -85.*bj_DEGTORAD)
call BlzSetSpecialEffectYaw( fx, Degrees)
call DestroyEffect(fx)
if IsMechaSkaar[GetUnitUserData(data.caster)] then
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdl",x,y)
else
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdl",x,y)
endif
call BlzSetSpecialEffectZ(fx,z)
call BlzSetSpecialEffectPitch(fx,60.*bj_DEGTORAD)
call BlzSetSpecialEffectRoll( fx, -65.*bj_DEGTORAD)
call BlzSetSpecialEffectYaw( fx, Degrees)
call DestroyEffect(fx)
if IsMechaSkaar[GetUnitUserData(data.caster)] then
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdl",x,y)
else
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdl",x,y)
endif
call BlzSetSpecialEffectZ(fx,z)
call BlzSetSpecialEffectPitch(fx,60.*bj_DEGTORAD)
call BlzSetSpecialEffectRoll( fx, -45.*bj_DEGTORAD)
call BlzSetSpecialEffectYaw( fx, Degrees)
call DestroyEffect(fx)
if IsMechaSkaar[GetUnitUserData(data.caster)] then
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait22.mdl",x,y)
else
set fx = AddSpecialEffect("war3mapImported\\ImpaleMissTarget_Portrait.mdl",x,y)
endif
call BlzSetSpecialEffectZ(fx,z)
call BlzSetSpecialEffectPitch(fx,60.*bj_DEGTORAD)
call BlzSetSpecialEffectRoll( fx, -25.*bj_DEGTORAD)
call BlzSetSpecialEffectYaw( fx, Degrees)
call DestroyEffect(fx)
set fx = null
set u = null
set i = i + 1
endloop
call SetTimerData(t,data)
call TimerStart(t,.33,false,function Handler)
set owner = null
set u = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=85
//TESH.alwaysfold=0
/*scope Decay initializer OnInit
globals
private constant integer SPELL_ID = 'A061'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct DC
unit u
group g
method destroy takes nothing returns nothing
call DestroyGroup(g)
set this.g = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
endfunction
private function Actions takes nothing returns nothing
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local s
set CASTER = GetTriggerUnit()
if IsMechaSkaar[GetUnitUserData(CASTER)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Stormfall.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Acid Ex.mdx",x,y))
else
set s=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00Q',x,y,.0)
call DestroyEffect(AddSpecialEffect("war3mapImported\\DecayGreen_Groundonly_1.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Mana Storm.mdx",x,y))
call KillUnit(s)
endif
call GroupEnumUnitsInRange(GROUP,x,y,249.,Filter(function FilterActions))
set s = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope*/
scope Decay
globals
private constant real FPS = 0.0312500
private constant integer SPELL_ID = 'A061'
private group GROUP=CreateGroup()
private group SWAP=CreateGroup()
private group TEMP
private integer array STACKS
endglobals
private struct tempDat
unit caster
//unit target
group g
real temp
//real damage
integer steps
//Static members work like globals :)
static integer dindex
static timer period
static thistype array data
method destroy takes nothing returns nothing
local unit FoG=null
//Wash leaks
loop
set FoG=FirstOfGroup(this.g) //If you're new to this kind of loop, this part might look strange to you.
exitwhen FoG==null //combined with the above line, this is effectively checking if the group is empty
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] - 1
if STACKS[GetUnitUserData(FoG)] == 0 then
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call UnitRemoveAbility(FoG,'A0MA')
call UnitRemoveAbility(FoG,'A0MB')
else
call UnitRemoveAbility(FoG,'A05W')
endif
else
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PlasmaGrenade.mdx",FoG,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\NetherInferno.mdx",FoG,"chest"))
endif
endif
call GroupRemoveUnit(this.g,FoG) //here's how we make the loop eventually terminate. Remove first of group, and when the loop restarts we get the new "first of group".
endloop
call GroupClear(this.g)
call DestroyGroup(this.g)
set this.caster = null
set this.g = null
//this.target = null
if dindex == -1 then
call PauseTimer(period)
endif
call this.deallocate()
endmethod
static method periodic takes nothing returns nothing
local integer i = 0
local tempDat this
local unit FoG
loop
exitwhen i>dindex
set this = data[i]
set this.temp = this.temp-FPS
if this.temp <= .75 then
loop
set FoG=FirstOfGroup(this.g)
exitwhen FoG==null
if UnitAlive(FoG) then
call UnitDamageTargetEx(this.caster,FoG,GetUnitState(FoG,UNIT_STATE_MAX_LIFE)*.05*.25,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call GroupAddUnit(SWAP,FoG)
else
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] - 1
if STACKS[GetUnitUserData(FoG)] == 0 then
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call UnitRemoveAbility(FoG,'A0MA')
call UnitRemoveAbility(FoG,'A0MB')
else
call UnitRemoveAbility(FoG,'A05W')
endif
else
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\PlasmaGrenade.mdx",FoG,"chest"))
else
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\NetherInferno.mdx",FoG,"chest"))
endif
endif
endif
call GroupRemoveUnit(this.g,FoG)
endloop
set TEMP=this.g
set this.g=SWAP
set SWAP=TEMP
set this.steps = this.steps - 1
if this.steps == 0 then
set data[i] = data[dindex]
set i = i - 1
set dindex = dindex - 1
call this.destroy()
else
set this.temp = 1
endif
endif
set i = i + 1
endloop
endmethod
static method cond takes nothing returns nothing
local unit s
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local integer i
local unit FoG = null
//Thistype is replaced by the name of the struct :)
local thistype this
//if GetSpellAbilityId() == 'A000' then
set this = thistype.allocate() //Exactly the same as create
set this.caster = GetTriggerUnit()
set this.g = CreateGroup()
set i = GetUnitAbilityLevel(this.caster,SPELL_ID)
if IsMechaSkaar[GetUnitUserData(this.caster)] then
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Stormfall.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Mana Storm.mdx",x,y))
else
call DestroyEffect(AddSpecialEffect("war3mapImported\\DecayGreen_Groundonly_1.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Acid Ex.mdx",x,y))
set s=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00Q',x,y,.0)
call KillUnit(s)
endif
call GroupEnumUnitsInRange(GROUP,x,y,249.,null)
loop
set FoG=FirstOfGroup(GROUP) //If you're new to this kind of loop, this part might look strange to you.
exitwhen FoG==null //combined with the above line, this is effectively checking if the group is empty
if IsUnitEnemy(FoG,GetOwningPlayer(this.caster)) and UnitAlive(FoG) then //here we have a make-shift condition statement.. followed by an action below
call GroupAddUnit(this.g,FoG)
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call DestroyEffect(AddSpecialEffect("war3mapImported\\LaserStrikeSingle.mdx",GetUnitX(FoG),GetUnitY(FoG)))
endif
if STACKS[GetUnitUserData(FoG)] == 0 then
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call UnitAddAbility(FoG,'A0MA')
call UnitRemoveAbility(FoG,'A0MB')
else
call UnitAddAbility(FoG,'A05W')
endif
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] + 1
if IsMechaSkaar[GetUnitUserData(this.caster)] then
call SetUnitAbilityLevel(FoG,'A0MA',i)
else
call SetUnitAbilityLevel(FoG,'A05W',i)
endif
endif
endif
call GroupRemoveUnit(GROUP,FoG) //here's how we make the loop eventually terminate. Remove first of group, and when the loop restarts we get the new "first of group".
endloop
//set this.target = GetSpellTargetUnit()
set this.temp = 1
//set this.damage = 75*GetUnitAbilityLevel(this.caster, 'A000')
set this.steps = (5+i)*4
set dindex = dindex + 1
set data[dindex] = this
if dindex == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
endif
//endif
//return false
set s = null
endmethod
//This method is called at the begginning of the map.
//The keyword onInit does it.
static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function thistype.cond)
//call TriggerAddCondition(t, Condition(function thistype.cond))
//I personally prefer to instanciate static members there just a point of view
//You can do it in their declaration too it is the same.
set dindex = -1
set period = NewTimer()
endmethod
endstruct
endscope
scope DefileSpell initializer OnInit
globals
private constant integer SPELL_ID = 'A0PM'
private constant integer DAMAGE_ABILITY= 'A0PN'
private constant real TICK_INTERVAL = 0.03125
private constant real RADIUS = 449.
private group DEFILE_GROUP
private player DEFILE_PLAYER
private integer DEFILE_DATA
endglobals
private struct Data
unit caster
player p
real x
real y
real level
real duration
real TimeElapsed = 0.
real lastReductionApplied = 0.
boolean damageReduced = false
group units
method destroy takes nothing returns nothing
set p = null
set this.caster = null
call DestroyGroup(this.units)
set this.units = null
call this.deallocate()
endmethod
endstruct
private function Actions takes nothing returns nothing
local unit u = GetEnumUnit()
local Data d = DEFILE_DATA
local real reduction
local real dx = GetUnitX(u) - d.x
local real dy = GetUnitY(u) - d.y
local real dist = SquareRoot(dx * dx + dy * dy)
local real x1
local real x2
local real y1
local real y2
local real a
local real nx
local real ny
if dist > RADIUS or not UnitAlive(u) or not IsUnitEnemy(u,d.p) then
if GetUnitAbilityLevel(u,DAMAGE_ABILITY) !=0 then
call UnitRemoveAbility(u,DAMAGE_ABILITY)
call UnitRemoveAbility(u,'A0PZ')
call UnitRemoveAbility(u,'A0J5')
call UnitRemoveAbility(u,'B06Q')
endif
set u = null
return
else
// Your force calculation code here...
set x1=d.x
set y1=d.y
set x2=GetUnitX(u)
set y2=GetUnitY(u)
set dx=x2-x1
set dy=y2-y1
set dist=SquareRoot(dx*dx+dy*dy)
set a=Atan2(y2-y1,x2-x1)*bj_RADTODEG
if dist<=15. then
set nx=x1+dist*Cos((a+1.)*bj_DEGTORAD)
set ny=y1+dist*Sin((a+1.)*bj_DEGTORAD)
else
set nx=x1+(dist-(1.))*Cos((a+1.)*bj_DEGTORAD)
set ny=y1+(dist-(1.))*Sin((a+1.)*bj_DEGTORAD)
endif
call SetUnitPathing(u,false)
call SetUnitX(u,nx)
call SetUnitY(u,ny)
call SetUnitPathing(u,true)
if not d.damageReduced then // check if a full second has passed
if GetUnitAbilityLevel(u,DAMAGE_ABILITY) ==0 then
call UnitAddAbility(u,DAMAGE_ABILITY)
call UnitMakeAbilityPermanent(u, true, DAMAGE_ABILITY)
if IsMechaSkaar[GetUnitUserData(d.caster)]then
call UnitAddAbility(u,'A0PZ')
else
call UnitAddAbility(u,'A0J5')
endif
//call BJDebugMsg("Ability added")
endif
set reduction = (GetHeroStr(d.caster, true) * d.level *.075) + (2.*d.level) + (BlzGetUnitBaseDamage(u,0)*.002*d.level) + (BlzGetUnitArmor(d.caster) * d.level * 2.25)
call BlzSetAbilityIntegerLevelField( BlzGetUnitAbility(u, DAMAGE_ABILITY), ABILITY_ILF_ATTACK_BONUS, 0, ( BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, DAMAGE_ABILITY), ABILITY_ILF_ATTACK_BONUS, 0) - R2I(reduction) ) )
call IncUnitAbilityLevel(u, DAMAGE_ABILITY)
call DecUnitAbilityLevel(u, DAMAGE_ABILITY)
//call BJDebugMsg("Damage reduced by"+R2S(reduction))
//call BJDebugMsg("Current Damage Reduction:"+I2S(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(u, DAMAGE_ABILITY), ABILITY_ILF_ATTACK_BONUS, 0)))
endif
endif
set u = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u, DEFILE_PLAYER) and UnitAlive(u) and u !=null then
set u = null
return true
else
set u = null
return false
endif
endfunction
private function OnTick takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data d = GetTimerData(t)
local unit u
set d.TimeElapsed = d.TimeElapsed + TICK_INTERVAL
if d.TimeElapsed > d.duration then
loop
set u = FirstOfGroup(d.units)
exitwhen (u == null)
call GroupRemoveUnit(d.units, u)
if GetUnitAbilityLevel(u,DAMAGE_ABILITY) !=0 then
call UnitRemoveAbility(u,DAMAGE_ABILITY)
call UnitRemoveAbility(u,'A0PZ')
call UnitRemoveAbility(u,'A0J5')
call UnitRemoveAbility(u,'B06Q')
endif
//actions
endloop
call ReleaseTimer(t)
call d.destroy()
else
set DEFILE_GROUP= d.units
set DEFILE_PLAYER = d.p
if R2I(d.TimeElapsed) != R2I(d.lastReductionApplied) then // check if a full second has passed
set d.lastReductionApplied = R2I(d.TimeElapsed)
set d.damageReduced = false
endif
call GroupEnumUnitsInRange(d.units, d.x, d.y, 725., Condition(function Conditions))
set DEFILE_DATA = d
call ForGroup(d.units, function Actions)
set d.damageReduced = true
call TimerStart(t, TICK_INTERVAL, true, function OnTick)
endif
set u = null
set t = null
endfunction
private function OnCast takes nothing returns nothing
local unit s
local timer t = NewTimer()
local Data d = Data.create()
set d.caster = GetTriggerUnit()
set d.p = GetOwningPlayer(d.caster)
set d.x = GetUnitX(d.caster)
set d.y = GetUnitY(d.caster)
set d.level = GetUnitAbilityLevel(d.caster, SPELL_ID)
set d.duration = 5. + 2. * d.level
set d.units = CreateGroup()
if IsMechaSkaar[GetUnitUserData(d.caster)]then
set s=CreateUnit(GetOwningPlayer(d.caster),'h021',d.x,d.y,.0)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Stormfall.mdx",d.x,d.y))
else
set s=CreateUnit(GetOwningPlayer(d.caster),'h00R',d.x,d.y,.0)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Desecrate2.mdx",d.x,d.y))
endif
call UnitApplyTimedLife(s,'BTLF',(d.level*2)+5.)
call SetTimerData(t, d)
call TimerStart(t, TICK_INTERVAL, true, function OnTick)
set s = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function OnCast)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SoldiersofFortuneGoldCheck initializer OnInit
globals
private constant integer ABIL_ID = 'A0GX'
endglobals
private function OnSpell takes nothing returns boolean
local unit u
local player p
local integer i
if GetSpellAbilityId() == ABIL_ID then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set i = GetUnitAbilityLevel(u,ABIL_ID)
if GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD) <= i*300 then
call PauseUnit(u,true)
call IssueImmediateOrderById(u,851972)
call PauseUnit(u,false)
call Q_E(p,"Not enough gold to hire mercenary.")
endif
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=63
//TESH.alwaysfold=0
scope SoldiersofFortune initializer OnInit
globals
private constant integer ABIL_ID = 'A0GX'
private constant integer UNIT_1 = 'o007'
private constant integer UNIT_2 = 'h01E'
private constant integer UNIT_3 = 'h01B'
private constant integer UNIT_4 = 'h01D'
public real array ThunderboltDmg
endglobals
private function OnSpell takes nothing returns nothing
local unit u
local unit s
local integer i
local integer g
local player p
local integer c
local real x
local real y
local real a
local integer dmg
local integer hp
local integer dmgleft
local integer hpleft
local integer li = 0
local integer t
set u = GetTriggerUnit()
set i = GetUnitAbilityLevel(u,ABIL_ID)
set p = GetOwningPlayer(u)
//if GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD) >= i* 300 then
set g = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
set c = R2I((g-i*300)*.15)+(i*300)
//call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,g-c)
set a = GetUnitFacing(u)
set x = GetUnitX(u) + 200. * Cos(a * bj_DEGTORAD)
set y = GetUnitY(u) + 200. * Sin(a * bj_DEGTORAD)
set t = GetRandomInt(1,4)
if t == 1 then
set s = CreateUnit(p,UNIT_1,x,y,a)
elseif t == 2 then
set s = CreateUnit(p,UNIT_2,x,y,a)
elseif t == 3 then
set s = CreateUnit(p,UNIT_3,x,y,a)
elseif t == 4 then
set s = CreateUnit(p,UNIT_4,x,y,a)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl",s,"origin"))
if not GAMEM and not LWMON then
if PC > 30 then
set hp=((R2I(.2*GetUnitState(u,UNIT_STATE_MAX_LIFE))*i)+R2I(c*.45))
set dmg= ((30* i * i) + R2I(c*.15))
elseif PC > 20 then
set hp=((R2I(.2*GetUnitState(u,UNIT_STATE_MAX_LIFE))*i)+R2I(c*.3))
set dmg= ((10* i * i) + (c/10))
else
set hp=((R2I(.2*GetUnitState(u,UNIT_STATE_MAX_LIFE))*i)+R2I(c*.15))
set dmg= ((5* i * i) + (c/20))
endif
else
set hp=((R2I(.2*GetUnitState(u,UNIT_STATE_MAX_LIFE))*i)+R2I(c*.15))
set dmg= ((5* i * i) + (c/20))
endif
if t == 4 then
set ThunderboltDmg[GetUnitUserData(s)] = c*.25
endif
call BlzSetUnitBaseDamage(s,R2I(dmg),0)
call BlzSetUnitMaxHP(s,R2I(hp))
call SetWidgetLife(s,GetUnitState(s,UNIT_STATE_MAX_LIFE))
// endif
set u = null
set s = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ArcaneDrain initializer OnInit
globals
trigger ARCANEDRAIN
private constant integer ABIL_ID = 'A0GJ'
endglobals
private function Actions takes nothing returns boolean
local unit u
if GetUnitAbilityLevel(GetEventDamageSource(),ABIL_ID)>0 and GetTriggerUnit() != GetEventDamageSource() and GetEventDamage() > 0 then
set u = GetEventDamageSource()
if(BI[NI])==(LN)then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",u,"origin"))
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+(GetUnitState(u,UNIT_STATE_MAX_MANA)*.0175))
endif
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set ARCANEDRAIN= CreateTrigger()
call MOE(II, (ARCANEDRAIN))
call TriggerAddCondition(ARCANEDRAIN, Condition(function Actions))
call DisableTrigger(ARCANEDRAIN)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope LuckyShot initializer OnInit
globals
trigger LUCKYSHOT
private constant integer ABIL_ID = 'A0GN'
endglobals
private function Actions takes nothing returns boolean
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local texttag tt
if GetUnitAbilityLevel(u,ABIL_ID)>0 and t != u and GetRandomInt(0,100) <= 5 and not IsUnitType(t,UNIT_TYPE_ANCIENT) and not IsUnitType(t,UNIT_TYPE_HERO) then
call UnitDamageTargetEx(u,t,7777777.,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
set tt = CreateTextTag()
call SetTextTagText(tt, "|cFFCC0C06H|r|cFFB40D0Be|r|cFF9C0E10a|r|cFF840F15ds|r|cFF9C0E10h|r|cFFB40D0Bo|r|cFFCC0C06t|r", .02)
call SetTextTagPos(tt, GetUnitX(t), GetUnitY(t), 0.0)
call SetTextTagVelocity(tt, 0.0, 0.04)
call SetTextTagPermanent(tt, false)
call SetTextTagFadepoint(tt, 2.0)
call SetTextTagLifespan(tt, 2.0)
call SetTextTagVisibility(tt, true)
endif
set u = null
set t = null
set tt = null
return false
endfunction
private function OnInit takes nothing returns nothing
set LUCKYSHOT = CreateTrigger()
call MOE(II, (LUCKYSHOT))
call TriggerAddCondition(LUCKYSHOT, Condition(function Actions))
call DisableTrigger(LUCKYSHOT)
endfunction
endscope
//TESH.scrollpos=39
//TESH.alwaysfold=0
scope LightningBolt initializer OnInit
globals
private constant integer ABIL_ID = 'A0GO'
endglobals
private struct LB
ProgressBar cast
effect hl
effect hr
unit u
unit t
real dmg
real time
method destroy takes nothing returns nothing
set this.u = null
call DestroyEffect(this.hl)
call DestroyEffect(this.hr)
set this.hl = null
set this.hr = null
set this.t = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local LB data = GetTimerData(t)
local real dmg
//call BJDebugMsg("Hander begins handling")
if GetUnitCurrentOrder(data.u) != 852600 then
//call BJDebugMsg("Is order Id correct?")
if data.time >= 1.92 then
//Actions
//static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
call TimedL.U2U(AddLightningEx("FORK",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
if not GAMEM and not LWMON then
if PC > 25 then
set dmg = 1750.+(SoldiersofFortune_ThunderboltDmg[GetUnitUserData(data.u)]*2.)+(GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*17.5)
else
set dmg = 17.5+SoldiersofFortune_ThunderboltDmg[GetUnitUserData(data.u)]+(GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*17.5)
endif
else
set dmg = 17.5+SoldiersofFortune_ThunderboltDmg[GetUnitUserData(data.u)]+(GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*17.5)
endif
call UnitDamageTargetEx(data.u,data.t,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraLightningMissile\\ChimaeraLightningMissile.mdl",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
endif
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
set data.time = data.time + .02
call data.cast.setPercentage(R2I(data.time*50.), 1)
if data.time == 1.06 then
call SetUnitAnimationByIndex(data.u,6)
endif
if data.time >= 2. then
//Actions
call TimedL.U2U(AddLightningEx("FORK",true,GetUnitX(data.u),GetUnitY(data.u),40.,GetUnitX(data.t),GetUnitY(data.t),30.),data.u,data.t,.75,40.,30.,1.,1.)
call UnitDamageTargetEx(data.u,data.t,17.5+SoldiersofFortune_ThunderboltDmg[GetUnitUserData(data.u)]+(GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],true)*17.5),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraLightningMissile\\ChimaeraLightningMissile.mdl",data.t,"chest"))
call IssueImmediateOrder(data.u,"stop")
call ReleaseTimer(t)
call data.destroy()
call data.cast.destroy()
else
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
endif
set t = null
endfunction
private function OnSpell takes nothing returns boolean
local timer t
local LB data
//call BJDebugMsg("Is event firing?")
if GetSpellAbilityId() == ABIL_ID then
//call BJDebugMsg("Spell begins casting")
set t = NewTimer()
set data = LB.create()
set data.u = GetTriggerUnit()
set data.t = GetSpellTargetUnit()
set data.hl = AddSpecialEffectTarget("war3mapImported\\LightningSphere_FX.mdx",data.u,"hand, left")
set data.hr = AddSpecialEffectTarget("war3mapImported\\LightningSphere_FX.mdx",data.u,"hand, right")
set data.time = 0
set data.cast = ProgressBar.create()
set data.cast.xOffset = -15
set data.cast.zOffset = 175
set data.cast.size = .8
set data.cast.color = GetPlayerColor(GetOwningPlayer(data.u))
set data.cast.targetUnit = data.u
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( trig, Condition( function OnSpell ) )
set trig = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DrawABead initializer OnInit
globals
private constant integer SPELL_ID = 'A0H1'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if GetUnitAbilityLevel(u,'A0H0') == 1 then
call UnitRemoveAbility(u,'A0H0')
call UnitAddAbility(u,'A0GK')
call UnitAddAbility(u,'A0GL')
call SetUnitPropWindow(u,0.)
call IssueImmediateOrderById(u,851993)
else
call UnitAddAbility(u,'A0H0')
call UnitRemoveAbility(u,'A0GK')
call UnitRemoveAbility(u,'A0GL')
call SetUnitPropWindow(u, GetUnitDefaultPropWindow(u))
endif
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope PaladinTaunt initializer OnInit
globals
private constant integer SPELL_ID = 'A0GT'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call IssueTargetOrder(u,"attack",CASTER)
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
set CASTER = GetTriggerUnit()
//call SetUnitAnimationByIndex(CASTER,1)
call GroupEnumUnitsInRange(GROUP,GetUnitX(CASTER),GetUnitY(CASTER),724.,Filter(function FilterActions))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=6
//TESH.alwaysfold=0
scope EternalBattlethirstActive initializer OnInit
globals
private constant integer ABIL_ID = 'A0GW'
endglobals
private struct EB
unit u
effect fx
method destroy takes nothing returns nothing
set this.u = null
set this.fx = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local EB data= GetTimerData(t)
call DestroyEffect(data.fx)
call UnitDamageTarget(data.u,data.u,GetUnitState(data.u,UNIT_STATE_MAX_LIFE),false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call ReleaseTimer(t)
call data.destroy()
set t=null
endfunction
private function OnSpell takes nothing returns nothing
local EB data
local timer t
set data=EB.create()
set data.u=GetTriggerUnit()
set data.fx = AddSpecialEffectTarget("war3mapImported\\Death Spell.mdx", data.u, "origin")
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,21.,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope PaladinHeal initializer OnInit
globals
private constant integer ABIL_ID = 'A0GS'
endglobals
private function OnSpell takes nothing returns nothing
local unit u
local real r
local real h
set u = GetSpellTargetUnit()
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
set r = GetWidgetLife(u)
set h = GetUnitState(u,UNIT_STATE_MAX_LIFE)*.32
if h + r >= GetUnitState(u,UNIT_STATE_MAX_LIFE) then
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
else
call SetWidgetLife(u,r+h)
endif
//call SetUnitAnimationByIndex(GetTriggerUnit(),1)
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=50
//TESH.alwaysfold=0
scope AppleofEden initializer OnInit
globals
private constant integer ABIL_ID = 'A0GR'
integer array EffectCount
endglobals
private struct AE
unit u
integer i
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local AE data= GetTimerData(t)
if GetUnitAbilityLevel(data.u,'A039') == 1 then
call SetHeroStr(data.u,GetHeroStr(data.u,false)-data.i,true)
elseif GetUnitAbilityLevel(data.u,'A01J') == 1 then
call SetHeroAgi(data.u,GetHeroAgi(data.u,false)-data.i,true)
elseif GetUnitAbilityLevel(data.u,'A038') == 1 then
call SetHeroInt(data.u,GetHeroInt(data.u,false)-data.i,true)
endif
if EffectCount[GetUnitUserData(data.u)] == 1 then
call UnitRemoveAbility(data.u,'A0H5')
endif
set EffectCount[GetUnitUserData(data.u)] = EffectCount[GetUnitUserData(data.u)] - 1
call ReleaseTimer(t)
call data.destroy()
set t=null
endfunction
private function OnSpell takes nothing returns nothing
local AE data
local timer t
local player p
local unit u
local integer i
local real d
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set i = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
set d = i*.10
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,i-R2I(d))
set data= AE.create()
set data.u=GetSpellTargetUnit()
set data.i = R2I((40*GetUnitAbilityLevel(u,ABIL_ID))*(1.+(.02*GetHeroLevel(u))))
if GetUnitAbilityLevel(data.u,'A039') == 1 then
call SetHeroStr(data.u,GetHeroStr(data.u,false)+data.i,true)
elseif GetUnitAbilityLevel(data.u,'A01J') == 1 then
call SetHeroAgi(data.u,GetHeroAgi(data.u,false)+data.i,true)
elseif GetUnitAbilityLevel(data.u,'A038') == 1 then
call SetHeroInt(data.u,GetHeroInt(data.u,false)+data.i,true)
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl",GetUnitX(data.u),GetUnitY(data.u)))
if EffectCount[GetUnitUserData(data.u)] == 0 then
call UnitAddAbility(data.u,'A0H5')
endif
set EffectCount[GetUnitUserData(data.u)] = EffectCount[GetUnitUserData(data.u)] + 1
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,33.+(d*.006),false,function Handler)
set u = null
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=61
//TESH.alwaysfold=0
scope FaustianBargain initializer OnInit
globals
private constant integer ABIL_ID = 'A0GY'
private constant integer NOSTACK_ID = 'A0GF'
endglobals
private struct FB
unit u
//integer i
player p
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t= GetExpiredTimer()
local FB data= GetTimerData(t)
local integer i = GetUnitAbilityLevel(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))],ABIL_ID)
local boolean a = UnitAlive(data.u)
local texttag tt
local string text
local real d
local real hp
if i != 0 then
//set data.i = data.i + 1
//if data.i >= 3 then
if a then
call SetPlayerState(data.p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(data.p,PLAYER_STATE_RESOURCE_GOLD)+(16+(6*i*i)+(5*i)))
set tt = CreateTextTag()
set text = "|cFFFFCC00+" + I2S((16+(6*i*i)+(5*i))) + " Gold|r"
call SetTextTagText(tt, text, .02)
call SetTextTagPos(tt, GetUnitX(data.u), GetUnitY(data.u), 0.0)
call SetTextTagVelocity(tt, 0.0, 0.04)
call SetTextTagPermanent(tt, false)
call SetTextTagFadepoint(tt, 2.0)
call SetTextTagLifespan(tt, 2.0)
call SetTextTagVisibility(tt, true)
endif
//set data.i = 0
//endif
if a then
set d = (GetUnitState(data.u,UNIT_STATE_MAX_LIFE)*.003996*i)+(GetWidgetLife(data.u)*.005996*i)
set hp = GetWidgetLife(data.u)
if hp - d <= 0 then
call KillUnit(data.u)
else
call SetWidgetLife(data.u,hp-d)
endif
endif
call SetTimerData(t,data) // INLINED!!
call TimerStart(t, 1., false, function Handler)
else
call ReleaseTimer(t)
call UnitRemoveAbility(data.u, NOSTACK_ID)
call data.destroy()
endif
set t=null
set tt = null
set text = null
endfunction
private function OnSpell takes nothing returns boolean
local FB data
local timer t
if GetLearnedSkill() == ABIL_ID and GetUnitAbilityLevel(GetTriggerUnit(), NOSTACK_ID) != 1 then
set data= FB.create()
set data.u=GetTriggerUnit()
//set data.i = 0
set data.p = GetOwningPlayer(data.u)
set JT[(1+GetPlayerId(data.p))]=true
call UnitAddAbility(data.u, NOSTACK_ID)
set t=NewTimer()
call SetTimerData(t,data)
call TimerStart(t,1.,false,function Handler)
endif
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition(trig, Condition(function OnSpell))
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RecklessGreed initializer OnInit
globals
private constant integer ABIL_ID = 'A0GZ'
endglobals
private function OnSpell takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local integer i = GetUnitAbilityLevel(u,ABIL_ID)
local real r = (4.5*i*(GetHeroStr(u,true)+GetHeroAgi(u,true)+GetHeroInt(u,true)))+(GetUnitState(t,UNIT_STATE_MAX_LIFE)*.03*i)
local texttag tt
local player p
//call SetUnitAnimationByIndex(u,4)
if GetRandomInt(0,100) >= 80 then
set tt = CreateTextTag()
call SetTextTagText(tt, "Miss!", 0.024)
call SetTextTagPos(tt, GetUnitX(t), GetUnitY(t), 0.0)
call SetTextTagColor(tt, 255, 0, 0, 255)
call SetTextTagVelocity(tt, 0.0, 0.03)
call SetTextTagVisibility(tt, true)
call SetTextTagFadepoint(tt, 1.0)
call SetTextTagLifespan(tt, 3.0)
call SetTextTagPermanent(tt, false)
call UnitDamageTargetEx( t, u, r*.25, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetUnitX(t),GetUnitY(t)))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodySplat Missile.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Bleeding.mdx",u,"chest"))
else
set p = GetOwningPlayer(u)
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+R2I(r*(.2+(.03*i))))
call UnitDamageTargetEx( u, t, r, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call UnitDamageTargetEx( t, u, r*.125, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetUnitX(t),GetUnitY(t)))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodySplat Missile.mdx",u,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Bleeding.mdx",t,"chest"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BloodbathTarget.mdx",t,"chest"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl", t,"origin"))
endif
set u = null
set t = null
set tt = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_ID, function OnSpell)
endfunction
endscope
//TESH.scrollpos=62
//TESH.alwaysfold=0
scope SinisterCreed initializer OnInit
globals
trigger SINISTERC
integer array SinisterCInt
public boolean array TraderResBonus
private constant integer SPELL_ID = 'A0GD'
private constant integer SPELL_ID2 = 'A0GC'
endglobals
private struct SC
unit u
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local SC data = GetTimerData(t)
if GetUnitTypeId(LC[(1+GetPlayerId(GetOwningPlayer(data.u)))]) != 'H01F' or LC[(1+GetPlayerId(GetOwningPlayer(data.u)))] != data.u then
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
if UnitAlive(data.u) then
if SinisterCInt[GetPlayerId(GetOwningPlayer(data.u))] > 0 then
set SinisterCInt[GetPlayerId(GetOwningPlayer(data.u))] = SinisterCInt[GetPlayerId(GetOwningPlayer(data.u))] - 1
else
if GetUnitAbilityLevel(data.u,SPELL_ID) == 4 then
call UnitRemoveAbility(data.u,'A0GE')
set TraderResBonus[GetPlayerId(GetOwningPlayer(data.u))] = false
endif
call SetUnitAbilityLevel(data.u,SPELL_ID,GetUnitAbilityLevel(data.u,SPELL_ID) - 1)
call SetUnitAbilityLevel(data.u,SPELL_ID2,GetUnitAbilityLevel(data.u,SPELL_ID2) - 1)
endif
call data.destroy()
call ReleaseTimer(GetExpiredTimer())
else
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
endif
endif
set t= null
endfunction
private function Actions takes nothing returns nothing
local timer t
local SC data
local unit u = GetEventDamageSource()
local player p = GetOwningPlayer(u)
local integer i
local integer mis
call UnitRemoveAbility(GetTriggerUnit(),'B04P')
if GetEventDamage() > 0 then
if GetUnitAbilityLevel(u,'dprv')==1 then
set mis = R2I((BlzGetUnitMaxHP(u)-500000.-GetWidgetLife(u))*.0200*GetUnitAbilityLevel(u,'A0GY'))
else
set mis = R2I((BlzGetUnitMaxHP(u)-GetWidgetLife(u))*.0200*GetUnitAbilityLevel(u,'A0GY'))
endif
if GetUnitAbilityLevel(u,SPELL_ID) == 14 then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl", GetTriggerUnit(),"origin"))
if BRTON then
call UnitDamageTargetEx(u,GetTriggerUnit(),(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0015)+mis,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
else
if not IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(u,GetTriggerUnit(),((GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0015)+mis)*.75,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
endif
if GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD) < 2000000 then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+mis+R2I(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0015))
else
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+mis+R2I(2000000*.0015))
endif
endif
if GetUnitAbilityLevel(u,SPELL_ID) < 14 then
if GetUnitAbilityLevel(u,SPELL_ID) == 3 then
call UnitAddAbility(u,'A0GE')
set TraderResBonus[GetPlayerId(GetOwningPlayer(u))] = true
endif
call SetUnitAbilityLevel(u,SPELL_ID,GetUnitAbilityLevel(u,SPELL_ID) + 1)
call SetUnitAbilityLevel(u,SPELL_ID2,GetUnitAbilityLevel(u,SPELL_ID2) + 1)
set i = GetUnitAbilityLevel(u,SPELL_ID)
if i > 4 then
set i = 4
endif
set i = i - 1
if i != 0 then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl", GetTriggerUnit(),"origin"))
if BRTON then
call UnitDamageTargetEx(u,GetTriggerUnit(),(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0005*i)+mis,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
else
if not IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(u,GetTriggerUnit(),((GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0005*i)+mis)*.75,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
endif
if GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD) < 2000000 then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+mis+R2I(GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)*.0005*i))
else
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+mis+R2I(2000000*.0005*i))
endif
endif
set t = NewTimer()
set data = SC.create()
set data.u = u
call SetTimerData(t,data)
call TimerStart(t,3.,false,function Handler)
endif
endif
set t = null
set u = null
endfunction
private function Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SPELL_ID) != 0 and GetTriggerUnit() != GetEventDamageSource() and IsUnitEnemy(GetEventDamageSource(),GetOwningPlayer(GetTriggerUnit())) and Damage_IsAttack() and UnitAlive(GetEventDamageSource()) and GetUnitAbilityLevel(GetEventDamageSource(),'A0B5') < 14 and GetUnitAbilityLevel(GetTriggerUnit(),'B04P') ==1 then
call Actions()
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set SINISTERC=CreateTrigger()
call TriggerAddCondition(SINISTERC,Condition(function Conditions))
call MOE(II,(SINISTERC))
call DisableTrigger(SINISTERC)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SanctifiedArmor initializer OnInit
globals
trigger SANCTIFIEDARMOR
private constant integer ABIL_ID = 'A0GQ'
endglobals
private function Actions takes nothing returns boolean
local unit u
local unit p
local real r
if GetUnitAbilityLevel(GetTriggerUnit(),ABIL_ID)>0 and GetTriggerUnit() != GetEventDamageSource() and GetRandomInt(0,100) >= 93 then
set u = GetEventDamageSource()
set p = GetTriggerUnit()
set r = GetWidgetLife(p)
if(J5V[(ROX((GetUnitTypeId(u))))])then
if(BI[NI])==(LN)then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",p,"origin"))
call SetWidgetLife(p,r+(GetUnitState(p,UNIT_STATE_MAX_LIFE)*.16))
endif
else
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",p,"origin"))
call SetWidgetLife(p,r+(GetUnitState(p,UNIT_STATE_MAX_LIFE)*.16))
endif
endif
set p = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set SANCTIFIEDARMOR = CreateTrigger()
call MOE(II, (SANCTIFIEDARMOR))
call TriggerAddCondition(SANCTIFIEDARMOR, Condition(function Actions))
call DisableTrigger(SANCTIFIEDARMOR)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope EternalBattlethirstPas initializer OnInit
globals
private constant integer BUFF_ID = 'B04X'
trigger ETERNALBATTLE
endglobals
private function Actions takes nothing returns boolean
local unit u
if GetUnitAbilityLevel(GetTriggerUnit(),BUFF_ID)>0 and GetTriggerUnit() != GetEventDamageSource() and GetWidgetLife(GetTriggerUnit()) - GetEventDamage() <= 21 then
set u = GetEventDamageSource()
if(J5V[(ROX((GetUnitTypeId(u))))])then
if(BI[NI])==(LN)then
set DI[NI]=DI[NI]+GetEventDamage()
endif
else
set DI[NI]=DI[NI]+GetEventDamage()
endif
call SetWidgetLife(GetTriggerUnit(),21)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\VampiricAuraTarget.mdx",GetTriggerUnit(),"origin"))
endif
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set ETERNALBATTLE = CreateTrigger()
call MOE(II, (ETERNALBATTLE))
call TriggerAddCondition(ETERNALBATTLE, Condition(function Actions))
call DisableTrigger(ETERNALBATTLE)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RecklessnessTaunt initializer OnInit
globals
private constant integer SPELL_ID = 'A0GU'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call IssueTargetOrder(u,"attack",CASTER)
endif
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(GROUP,GetUnitX(CASTER),GetUnitY(CASTER),424.,Filter(function FilterActions))
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=8
//TESH.alwaysfold=0
scope TestFear
//=============================================================
//=========================SETUP================================
//=============================================================
globals
private constant integer SPELL_ID = 'A00M'
private constant string PATH = "war3mapImported\\ScaredSkullMissile.mdx"
private constant string PATH_2 = ".mdl"
private constant string ATTACH = "overhead"
endglobals
private function Duration takes integer level returns integer
return 3+level
endfunction
private function Aoe takes integer level returns integer
return 425 + 25*level
endfunction
private function Cond takes nothing returns boolean
local unit FoG
local player p
local real x
local real y
local group g
local integer lvl
local Fear F
if GetSpellAbilityId() == SPELL_ID or GetSpellAbilityId() == 'A00H' then
set g = CreateGroup()
set p = GetOwningPlayer(GetTriggerUnit())
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
if GetSpellAbilityId() == SPELL_ID then
set lvl = GetUnitAbilityLevel(GetTriggerUnit(),'A00H')
endif
if GetSpellAbilityId() == SPELL_ID then
set lvl = GetUnitAbilityLevel(GetTriggerUnit(),'A00H')
endif
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
call DestroyEffect(AddSpecialEffect(PATH_2,x,y))
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if not IsUnitAlly(FoG,p) and UnitAlive(FoG) then
if Fear.isFeared(FoG) then
set F = Fear.get(FoG)
set F.time = Duration(lvl)
else
set F = Fear.create()
set F.targ = FoG
set F.path = PATH
set F.attach = ATTACH
set F.time = Duration(lvl)
call F.start()
call F.destroy()
endif
endif
endloop
call DestroyGroup(g)
set g = null
set p = null
set FoG = null
endif
return false
endfunction
private module Module
private static method onInit takes nothing returns nothing
call init()
endmethod
endmodule
private struct A extends array
private static method init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Cond))
set t = null
endmethod
implement Module
endstruct
endscope
scope TerrorCrush initializer OnInit
globals
private constant integer SPELL_ID = 'A0NO'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local real x1=GetUnitX(CASTER)
local real y1=GetUnitY(CASTER)
local real x2=GetUnitX(GetFilterUnit())
local real y2=GetUnitY(GetFilterUnit())
local real SVE=I2R(BlzGetUnitBaseDamage(CASTER,0))*(1.+(I2R((GetUnitAbilityLevel(LC[1+GetPlayerId(GetOwningPlayer(CASTER))],'A01G')))*.1))
local unit s=CreateUnit(GetOwningPlayer(CASTER),'h007',x1,y1,.0)
local real a=bj_RADTODEG*(Atan2(y2-y1,x2-x1))
local real d=375.
//call BJDebugMsg("Filter")
if UnitAlive(GetFilterUnit())and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(CASTER))then
call M6E(GetFilterUnit(),d,.65,a,"war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",.0,true,false)
call Y0E(s,GetFilterUnit(),SVE,ATTACK_TYPE_CHAOS,false,false)
//call SEE(GetFilterUnit(),R2I(SVE))
call IssueTargetOrderById(GetFilterUnit(),851983,CASTER)
endif
call UnitApplyTimedLife(s,'BTLF',1.)
set s=null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
//call BJDebugMsg("Actions")
set CASTER=u
call GroupEnumUnitsInRange(GROUP,x,y,325.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Voidbolt Rough Major.mdx",x,y))
set u=null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope VoidShackles initializer OnInit
globals
private constant integer SPELL_ID = 'A0HR'
private constant integer SPELL_ID2 = 'A0HQ'
private constant group GROUP = CreateGroup()
private unit CASTER
private location loc = Location(0,0)
endglobals
private struct VShackle
unit u
unit u2
unit u3
real d
real lvl
real x
real y
lightning l
method destroy takes nothing returns nothing
set this.u = null
set this.u2 = null
set this.u3 = null
set this.l = null
call this.deallocate()
endmethod
endstruct
native UnitAlive takes unit id returns boolean
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local VShackle data = GetTimerData(t)
local real a
local real d
local real dx
local real dy
local real x = GetUnitX(data.u)
local real y = GetUnitY(data.u)
local unit u
local real z1
local real z2
if not UnitAlive(data.u) or data.d <= 0. or data.u2 == null or not UnitAlive(data.u2) then
call DestroyLightning(data.l)
call ReleaseTimer(t)
call data.destroy()
else
set dx = x-data.x
set dy = y-data.y
set d = SquareRoot(dx * dx + dy * dy)
if d >= 375. and not M5E(data.u) then
set a = bj_RADTODEG*Atan2(data.y-y,data.x-x)
call M6E(data.u,d,.3,a,"war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",0,true,false)
set u = CreateUnit(GetOwningPlayer(CASTER),'h007',x,y,0.)
call UnitApplyTimedLife(u,'BTLF',1.)
call UnitAddAbility(u,SPELL_ID2)
call IssueTargetOrder(u, "thunderbolt", data.u)
call UnitDamageTargetEx(data.u3,data.u,(GetHeroAgi(data.u3,true)*data.lvl*2.)+(GetHeroAgi(data.u3,true)*data.lvl*data.lvl*.5),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
call MoveLocation(loc,GetUnitX(data.u),GetUnitY(data.u))
set z1 = GetUnitFlyHeight(data.u)+40.+GetLocationZ(loc)
call MoveLocation(loc,data.x,data.y)
set z2 = GetLocationZ(loc) + 40.
call MoveLightningEx(data.l,true,GetUnitX(data.u),GetUnitY(data.u),z1,data.x,data.y,z2)
set data.d = data.d - .03125
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set u = null
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real x1 = GetUnitX(VL[(1+GetPlayerId(GetOwningPlayer(CASTER)))])
local real y1 = GetUnitY(VL[(1+GetPlayerId(GetOwningPlayer(CASTER)))])
local real x2 = GetUnitX(GetFilterUnit())
local real y2 = GetUnitY(GetFilterUnit())
local real z = GetUnitFlyHeight(u) + 40.
local real dx
local real dy
local real d
local real dx2
local real dy2
local real d2
local real d3
local real a
local real a2
local timer t
local VShackle data
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetUnitAbilityLevel(u,'Aloc') == 0 and not IsUnitType(u,UNIT_TYPE_STRUCTURE) then
set t = CreateTimer()
set data = VShackle.create()
set data.u = u
set data.u3 = CASTER
set data.u2 = VL[(1+GetPlayerId(GetOwningPlayer(CASTER)))]
set data.lvl = GetUnitAbilityLevel(CASTER,SPELL_ID)*1.
set data.d = 7.5 + (data.lvl*.75)
set data.x = x1
set data.y = y1
call MoveLocation(loc,x2,y2)
set z = z + GetLocationZ(loc)
call MoveLocation(loc,x1,y1)
set data.l = AddLightningEx("PONC",true,x2,y2,z,x1,y1,40.+GetLocationZ(loc))
call DestroyEffect(AddSpecialEffect("war3mapImported\\DarkLightning.mdx",x2,y2))
//set dx = x1 - x2
//set dy = y1 - y2
//set d = SquareRoot(dx * dx + dy * dy)
//if d >= 400. then
//set a = bj_RADTODEG*Atan2(y2-y1,x2-x1)
//set a2 = bj_RADTODEG*Atan2(y1-y2,x1-x2)
//set dx2 = x1 + 300. * Cos(a2 * bj_DEGTORAD)
//set dy2 = y1 + 300. * Sin(a2 * bj_DEGTORAD)
//set d2 = SquareRoot(dx2 * dx2 + dy2 * dy2)
//set d3 = d - d2
//call M6E(data.u,d3,.3,a,"war3mapImported\\ShadowyMissileofEvilDOOMV2.mdx",0,false,false)
//endif
call SetTimerData(t,data)
call TimerStart(t,.03125,false,function Handler)
endif
set t = null
set u = null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real r = GetUnitAbilityLevel(u,SPELL_ID)*1.
if VL[(1+GetPlayerId(GetOwningPlayer(u)))] != null then
set CASTER = u
call GroupEnumUnitsInRange(GROUP,GetUnitX(VL[(1+GetPlayerId(GetOwningPlayer(u)))]),GetUnitY(VL[(1+GetPlayerId(GetOwningPlayer(u)))]),424.+20.*r,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Call of Dread Purple.mdx",GetUnitX(VL[(1+GetPlayerId(GetOwningPlayer(u)))]),GetUnitY(VL[(1+GetPlayerId(GetOwningPlayer(u)))])))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Void Rift II Purple.mdx",GetUnitX(VL[(1+GetPlayerId(GetOwningPlayer(u)))]),GetUnitY(VL[(1+GetPlayerId(GetOwningPlayer(u)))])))
else
call Q_E(GetOwningPlayer(GetTriggerUnit()),"No Spatial Rend found")
endif
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope DesolationMove
globals
private constant real FPS = 0.0312500
private constant integer SPELL_ID = 'A00H'
private constant integer SPELL_ID2 = 'A0CF'
private group GROUP=CreateGroup()
private group SWAP=CreateGroup()
private group TEMP
private integer array STACKS
endglobals
private struct tempDat
unit caster
unit cast2
//unit target
group g
real temp
real x
real y
//real damage
integer steps
//Static members work like globals :)
static integer dindex
static timer period
static thistype array data
method destroy takes nothing returns nothing
local unit FoG=null
//Wash leaks
set this.caster = null
set this.cast2 = null
loop
set FoG=FirstOfGroup(this.g) //If you're new to this kind of loop, this part might look strange to you.
exitwhen FoG==null //combined with the above line, this is effectively checking if the group is empty
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] - 1
if STACKS[GetUnitUserData(FoG)] == 0 and not Fear.isFeared(FoG) then
call UnitRemoveAbility(FoG,SPELL_ID2)
endif
call GroupRemoveUnit(this.g,FoG) //here's how we make the loop eventually terminate. Remove first of group, and when the loop restarts we get the new "first of group".
endloop
call GroupClear(this.g)
call DestroyGroup(this.g)
set this.g = null
//this.target = null
if dindex == -1 then
call PauseTimer(period)
endif
call this.deallocate()
endmethod
static method periodic takes nothing returns nothing
local integer i = 0
local tempDat this
local unit FoG
loop
exitwhen i>dindex
set this = data[i]
set this.temp = this.temp-FPS
if this.temp <= .875 then
loop
set FoG=FirstOfGroup(this.g)
exitwhen FoG==null
if UnitAlive(FoG) and this.cast2 != null and UnitAlive(this.cast2) and not Fear.isFeared(FoG) then
call IssuePointOrderById(FoG,851986,data.x,data.y)
call GroupAddUnit(SWAP,FoG)
else
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] - 1
if STACKS[GetUnitUserData(FoG)] == 0 and not Fear.isFeared(FoG) then
call UnitRemoveAbility(FoG,SPELL_ID2)
endif
endif
call GroupRemoveUnit(this.g,FoG)
endloop
set TEMP=this.g
set this.g=SWAP
set SWAP=TEMP
set this.steps = this.steps - 1
if this.steps == 0 then
set data[i] = data[dindex]
set i = i - 1
set dindex = dindex - 1
call this.destroy()
else
set this.temp = 1
endif
endif
set i = i + 1
endloop
endmethod
static method cond takes nothing returns nothing
//local unit s
local real x
local real y
local integer i
local unit FoG = null
//Thistype is replaced by the name of the struct :)
local thistype this
if VL[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!= null then
set this = thistype.allocate() //Exactly the same as create
set this.caster = GetTriggerUnit()
set this.cast2 = VL[(1+GetPlayerId(GetOwningPlayer(this.caster)))]
set this.x = GetUnitX(this.cast2)
set this.y = GetUnitY(this.cast2)
set this.g = CreateGroup()
set x= GetUnitX(this.caster)
set y= GetUnitY(this.caster)
set i = GetUnitAbilityLevel(this.caster,SPELL_ID)
//set s=CreateUnit(Player(14),'h00Q',x,y,.0)
//call KillUnit(s)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\DecayGreen_Groundonly_1.mdx",x,y))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Acid Ex.mdx",x,y))
call GroupEnumUnitsInRange(GROUP,x,y,400.+(25.*i),null)
loop
set FoG=FirstOfGroup(GROUP) //If you're new to this kind of loop, this part might look strange to you.
exitwhen FoG==null //combined with the above line, this is effectively checking if the group is empty
if IsUnitEnemy(FoG,GetOwningPlayer(this.caster)) and UnitAlive(FoG) then //here we have a make-shift condition statement.. followed by an action below
call GroupAddUnit(this.g,FoG)
if STACKS[GetUnitUserData(FoG)] == 0 then
call UnitAddAbility(FoG,SPELL_ID2)
if not Fear.isFeared(FoG) then
call IssuePointOrderById(FoG,851986,data.x,data.y)
endif
endif
set STACKS[GetUnitUserData(FoG)] = STACKS[GetUnitUserData(FoG)] + 1
//call SetUnitAbilityLevel(FoG,'A05W',i)
endif
call GroupRemoveUnit(GROUP,FoG) //here's how we make the loop eventually terminate. Remove first of group, and when the loop restarts we get the new "first of group".
endloop
set this.temp = 1
set this.steps = (3+i)*8
set dindex = dindex + 1
set data[dindex] = this
if dindex == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
endif
endif
//return false
//set s = null
endmethod
//This method is called at the begginning of the map.
//The keyword onInit does it.
static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function thistype.cond)
//call TriggerAddCondition(t, Condition(function thistype.cond))
//I personally prefer to instanciate static members there just a point of view
//You can do it in their declaration too it is the same.
set dindex = -1
set period = NewTimer()
endmethod
endstruct
endscope
globals
rect TEMP_RECT = Rect(0,0,0,0)
endglobals
scope TerrorPickUpItems initializer OnInit
globals
private constant integer SPELL_ID = 'A0HD'
private unit CASTER
endglobals
private function EnumItem takes nothing returns boolean
//call IssueTargetItemOrder( CASTER, "smart", GetEnumItem() )
if GetItemTypeId(GetEnumItem()) != 'ciri' then
call UnitAddItem(CASTER,GetEnumItem())
endif
return false
endfunction
private function Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
set CASTER = GetTriggerUnit()
call SetRect(TEMP_RECT,x-500.,y-500.,x+500.,y+500.)
call EnumItemsInRect(TEMP_RECT,null,function EnumItem)
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope Bless initializer OnInit
globals
private constant integer SPELL_ID = 'A0IG'
integer array BlessEffectCount
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct Bls
unit c
//effect fx
//effect fx2
real dur
method destroy takes nothing returns nothing
//call DestroyEffect(this.fx)
//set this.fx = null
//call DestroyEffect(this.fx2)
//set this.fx2 = null
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct Bls2
unit u
integer int
integer agi
integer str
real arm
integer dmg
method destroy takes nothing returns nothing
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local Bls2 data2 = GetTimerData(t)
call SetHeroInt(data2.u,GetHeroInt(data2.u,false)-data2.int,true)
call SetHeroAgi(data2.u,GetHeroAgi(data2.u,false)-data2.agi,true)
if GetHeroStr(data2.u,false)-data2.str <=1 then
call SetHeroStr(data2.u,1,true)
else
call SetHeroStr(data2.u,GetHeroStr(data2.u,false)-data2.str,true)
endif
call BlzSetUnitArmor(data2.u,BlzGetUnitArmor(data2.u)-data2.arm)
call BlzSetUnitBaseDamage(data2.u,BlzGetUnitBaseDamage(data2.u,0)-data2.dmg,0)
if BlessEffectCount[GetUnitUserData(data2.u)] == 1 then
call UnitRemoveAbility(data2.u,'A0IE')
call UnitRemoveAbility(data2.u,'A0IF')
endif
set BlessEffectCount[GetUnitUserData(data2.u)] = BlessEffectCount[GetUnitUserData(data2.u)] - 1
call data2.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local timer t
local integer lvl
local Bls2 data2
if IsUnitAlly(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and IsUnitType(u,UNIT_TYPE_HERO) then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\JudgementTarget.mdx",u,"origin"))
set lvl = GetUnitAbilityLevel(CASTER,SPELL_ID)
call SetWidgetLife(u,GetWidgetLife(u)+(lvl*GetHeroStr(CASTER,true)*.25)+(GetUnitState(u,UNIT_STATE_MAX_LIFE)*lvl*.000125))
//if GetUnitTypeId(LC[1+GetPlayerId(GetOwningPlayer(u))]) == 'N01T' or GetUnitTypeId(LC[1+GetPlayerId(GetOwningPlayer(u))]) == 'N01S' or GetUnitTypeId(LC[1+GetPlayerId(GetOwningPlayer(u))]) == 'N01L' or GetUnitTypeId(LC[1+GetPlayerId(GetOwningPlayer(u))]) == 'N01M' then
//call AddUnitBonusTimed(u,BONUS_DAMAGE,lvl*10.,30.)
//call AddUnitBonusTimed(u,BONUS_ARMOR,lvl*1.5,30.)
//call AddUnitBonusTimed(u,BONUS_INTELLIGENCE,lvl*1.5,30.)
//call AddUnitBonusTimed(u,BONUS_AGILITY,lvl*1.5,30.)
//call AddUnitBonusTimed(u,BONUS_STRENGTH,lvl*1.5,30.)
//else
set data2 = Bls2.create()
set data2.int = lvl
set data2.agi = lvl
set data2.str = lvl
set data2.arm = lvl
set data2.dmg = lvl*10
call SetHeroInt(u,GetHeroInt(u,false)+data2.int,true)
call SetHeroAgi(u,GetHeroAgi(u,false)+data2.agi,true)
call SetHeroStr(u,GetHeroStr(u,false)+data2.str,true)
call BlzSetUnitArmor(u,BlzGetUnitArmor(u)+data2.arm)
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+data2.dmg,0)
set data2.u = u
if BlessEffectCount[GetUnitUserData(data2.u)] == 0 then
call UnitAddAbility(data2.u,'A0IE')
call UnitAddAbility(data2.u,'A0IF')
endif
set BlessEffectCount[GetUnitUserData(data2.u)] = BlessEffectCount[GetUnitUserData(data2.u)] + 1
set t = NewTimer()
call SetTimerData(t,data2)
call TimerStart(t,25.,false,function Handler2)
//endif
endif
set t = null
set u = null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local Bls data = GetTimerData(t)
local real x
local real y
//local real x2
//local real y2
//local unit u
local integer i = 12
if data.dur <=0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - .25
set x = GetUnitX(data.c)
set y = GetUnitY(data.c)
//call BlzSetSpecialEffectX(data.fx,x)
//call BlzSetSpecialEffectY(data.fx,y)
set CASTER = data.c
call GroupEnumUnitsInRange(GROUP,x,y,299.,Filter(function FilterActions))
//call DestroyEffect(AddSpecialEffect("war3mapImported\\JudgementTarget.mdx",GetUnitX(data.c),GetUnitY(data.c)))
set i = 12
loop
exitwhen i <= 0
//set x2 = x + GetRandomReal(1.,299.) * Cos(GetRandomReal(0.,360.)) * bj_DEGTORAD
//set y2 = y + GetRandomReal(1.,299.) * Sin(GetRandomReal(0.,360.)) * bj_DEGTORAD
//set u = CreateUnit(GetOwningPlayer(data.c),'h010',x2,y2,270.)
if GetRandomReal(0.,10.) <= 3.33 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\TheHolyBomb.mdx",x,y))
endif
//call UnitApplyTimedLife(u,'BTLF',2.)
//call BJDebugMsg(R2S(x2))
//call BJDebugMsg(R2S(y2))
set i = i - 1
endloop
call SetTimerData(t,data)
call TimerStart(t,.25,false,function Handler)
endif
//set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local Bls data = Bls.create()
local integer i = 12
local real x
local real y
//local real x2
//local real y2
set data.c = GetTriggerUnit()
//set data.fx = AddSpecialEffect("war3mapImported\\Judgement.mdx",x + GetRandomReal(50.,* Cos(angle * bj_DEGTORAD),y)
//set data.fx2 = AddSpecialEffectTarget("war3mapImported\\Judgement.mdx",data.c,"origin")call DestroyEffect(AddSpecialEffect("war3mapImported\\JudgementTarget.mdx",GetUnitX(data.c),GetUnitY(data.c)))
set i = 12
loop
exitwhen i <= 0
set x = GetUnitX(data.c)
set y= GetUnitY(data.c)
//set x2 = x + GetRandomReal(1.,299.) * Cos(GetRandomReal(0.,360.)) * bj_DEGTORAD
//set y2 = y + GetRandomReal(1.,299.) * Sin(GetRandomReal(0.,360.)) * bj_DEGTORAD
if GetRandomReal(0.,10.) <= 3.33 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\TheHolyBomb.mdx.mdx",x,y))
endif
set i = i -1
endloop
//call BlzSetSpecialEffectScale(data.fx,.75)
set data.dur = 15.
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.25,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope SancityAura initializer OnInit
globals
trigger SANCTITY
private constant integer SPELL_ID = 'B02P'
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local integer i = GetPlayerId(GetOwningPlayer(a)) + 1
local unit u = GetTriggerUnit()
if (GetUnitAbilityLevel(LC[i],SPELL_ID) != 0 or GetUnitAbilityLevel(a,SPELL_ID) != 0) and GetEventDamage() > 0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) or (BI[NI]) == DAMAGE_TYPE_COLD or (BI[NI]) == DAMAGE_TYPE_LIGHTNING or (BI[NI]) == DAMAGE_TYPE_MAGIC or (BI[NI]) == DAMAGE_TYPE_UNIVERSAL then
if GetUnitAbilityLevel(a,'Aloc') == 1 then
set a = LC[i]
endif
call SetWidgetLife(a,GetWidgetLife(a)+(GetEventDamage()*.05))
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl", a, "origin" ) )
endif
else
if GetUnitAbilityLevel(a,'Aloc') == 1 then
set a = LC[i]
endif
call SetWidgetLife(a,GetWidgetLife(a)+(GetEventDamage()*.07))
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl", a, "origin" ) )
endif
endif
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set SANCTITY = CreateTrigger()
call MOE(II, (SANCTITY))
call TriggerAddCondition(SANCTITY, Condition(function Actions))
call DisableTrigger(SANCTITY)
endfunction
endscope
scope REVENGEBLEEDSCOPE initializer OnInit
globals
trigger REVENGEBLEED
integer array RevengeBleedStacks
private timer globalTimer
private boolean globalTimerActive = false
private integer array poisonedUnitData
private integer poisonedUnitCount = 0
endglobals
private struct PoisonedUnit
integer index
unit u
real dmg
unit caster
integer i
method destroy takes nothing returns nothing
set this.u = null
set this.dmg = 0.
set this.caster = null
set this.i = 0
call this.deallocate()
endmethod
endstruct
private function RemovePoisonedUnit takes PoisonedUnit pu returns nothing
call pu.destroy()
endfunction
private function DestroyUnit takes integer puIndex returns nothing
local integer i = puIndex
local PoisonedUnit pu = PoisonedUnit(poisonedUnitData[puIndex])
call RemovePoisonedUnit(pu)
loop
exitwhen i >= poisonedUnitCount
set poisonedUnitData[i] = poisonedUnitData[i + 1]
set i = i + 1
endloop
set poisonedUnitCount = poisonedUnitCount - 1
set poisonedUnitData[poisonedUnitCount] = 0
endfunction
private function Handler takes nothing returns nothing
local PoisonedUnit pu
local integer currentIndex = 0
local real dmgPerSecond
local boolean unitsRemaining = false
local real dx
local real dy
loop
exitwhen currentIndex >= poisonedUnitCount
set pu = PoisonedUnit(poisonedUnitData[currentIndex])
set pu.i = pu.i - 1
if pu.i < 0 then
if pu.u != null then
set RevengeBleedStacks[GetUnitUserData(pu.u)] = RevengeBleedStacks[GetUnitUserData(pu.u)] - 1
//call BJDebugMsg("Poison count for unit " + I2S(GetUnitUserData(pu.u)) + " decremented to " + I2S(RevengeBleedStacks[GetUnitUserData(pu.u)]))
//if RevengeBleedStacks[GetUnitUserData(pu.u)] < 0 then
//call BJDebugMsg("Poison count for unit " + I2S(GetUnitUserData(pu.u)) + " is negative!")
//endif
if RevengeBleedStacks[GetUnitUserData(pu.u)] == 0 then
// call UnitRemoveAbility(pu.u, 'A0J5')
// call UnitRemoveAbility(pu.u, 'A0J4')
//call UnitRemoveAbility(pu.u, 'B058')
endif
endif
call DestroyUnit(currentIndex)
else
set dmgPerSecond = pu.dmg / (pu.i + 1)
call DisableTrigger(REVENGEBLEED)
call UnitDamageTargetEx(pu.caster, pu.u, dmgPerSecond, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
call EnableTrigger(REVENGEBLEED)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Bleeding.mdx",pu.u,"chest"))
set dx = GetUnitX(pu.caster)-GetUnitX(pu.u)
set dy = GetUnitY(pu.caster)-GetUnitY(pu.u)
if SquareRoot(dx * dx + dy * dy) <= 180. then
call SetWidgetLife(pu.caster,GetWidgetLife(pu.caster)+(dmgPerSecond))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\VampiricAuraTarget.mdx",pu.caster,"origin"))
endif
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\GreatElderHydraLightningOrbV.107.mdx",pu.u,"chest"))
set pu.dmg = pu.dmg - dmgPerSecond
set unitsRemaining = true
set currentIndex = currentIndex + 1
endif
endloop
if not unitsRemaining then
call PauseTimer(globalTimer)
set globalTimerActive = false
endif
endfunction
private function Actions takes nothing returns nothing
local unit target = GetEventDamageSource()
local integer puIndex = poisonedUnitCount
local PoisonedUnit pu
local integer currentStacks
local integer level
local real a
local real x
local real y
if RevengeBleedStacks[GetUnitUserData(target)] > 40 then
set target = null
return
endif
set pu = PoisonedUnit.create()
set pu.u = target
set pu.index = puIndex
set pu.caster = GetTriggerUnit()
set currentStacks = RevengeBleedStacks[GetUnitUserData(target)]
set pu.i = 5
set level = GetUnitAbilityLevel(pu.caster,'A00Y')
set a = GetUnitFacing(target)-180.
set x = GetUnitX(target) + 140. * Cos(a * bj_DEGTORAD)
set y = GetUnitY(target) + 140. * Sin(a * bj_DEGTORAD)
if RevengeBleedStacks[GetUnitUserData(pu.u)] == 0 then
//call UnitAddAbility(pu.u,'A0J5')
//call UnitAddAbility(pu.u,'A0J4')
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",pu.caster,"origin"))
call SAE('h00O',x,y,a+ 180.,1.134,"attack two",1.)
set pu.dmg = pu.dmg + ((level*.04) + (GetHeroAgi(pu.caster, true)*level*.5)) * pu.i
set RevengeBleedStacks[GetUnitUserData(target)] = currentStacks + 1
set poisonedUnitData[puIndex] = pu
set poisonedUnitCount = poisonedUnitCount + 1
set RevengeBleedStacks[GetUnitUserData(target)] = currentStacks + 1
//call BJDebugMsg("Poison count for unit " + I2S(GetUnitUserData(target)) + " incremented to " + I2S(RevengeBleedStacks[GetUnitUserData(target)]))
if not globalTimerActive then
set globalTimer = NewTimer()
call TimerStart(globalTimer, 1.0, true, function Handler)
set globalTimerActive = true
endif
set target = null
endfunction
private function Conditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local unit a = GetEventDamageSource()
local integer level = GetUnitAbilityLevel(u,'A00Y')
if level != 0 and a != u and IsUnitEnemy(u, GetOwningPlayer(a)) and GetEventDamage() > 0 and GetRandomInt(1,100) <= (5 + level) and a != FLAMEDISCCASTER and BI[NI] != DAMAGE_TYPE_PLANT and UnitAlive(a) then
call Actions()
endif
set u = null
set a =null
return false
endfunction
private function OnInit takes nothing returns nothing
set REVENGEBLEED = CreateTrigger()
set globalTimer = NewTimer()
call TriggerAddCondition(REVENGEBLEED, Condition(function Conditions))
call MOE(II, (REVENGEBLEED))
call DisableTrigger(REVENGEBLEED)
endfunction
endscope
scope BloodDanceDamageBonus initializer OnInit
globals
private constant integer SPELL_ID = 'A09A'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call BlzSetUnitBaseDamage(u,BlzGetUnitBaseDamage(u,0)+R2I((20+(GetHeroLevel(u)*4))*(1.+(.04 * GetHeroLevel(u)))),0)
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope Earthsplitter initializer OnInit
globals
private constant integer SPELL_ID = 'A0NZ'
private group GROUP = CreateGroup()
private unit CASTER
endglobals
private struct FT
integer i
player p
real a
real x
real y
real x1
real y1
real d
unit c
unit d1
unit d2
unit d3
unit d4
unit d5
unit d6
ubersplat u1
ubersplat u2
ubersplat u3
ubersplat u4
ubersplat u5
ubersplat u6
method destroy takes nothing returns nothing
call RemoveUnit(this.d1)
call RemoveUnit(this.d2)
call RemoveUnit(this.d3)
call RemoveUnit(this.d4)
call RemoveUnit(this.d5)
call RemoveUnit(this.d6)
call DestroyUbersplat(this.u1)
call DestroyUbersplat(this.u2)
call DestroyUbersplat(this.u3)
call DestroyUbersplat(this.u4)
call DestroyUbersplat(this.u5)
call DestroyUbersplat(this.u6)
set this.d1 = null
set this.d2 = null
set this.d3 = null
set this.d4 = null
set this.d5 = null
set this.d6 = null
set this.u1 = null
set this.u2 = null
set this.u3 = null
set this.u4 = null
set this.u5 = null
set this.u6 = null
set this.p = null
set this.c= null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FT data = GetTimerData(t)
local unit FoG
local group g
local real x
local real y
local integer i = 0
local real x2
local real y2
local unit d
set data.i = data.i + 1
if data.i == 8 then
call ReleaseTimer(t)
call data.destroy()
else
if data.i == 7 then
set data.x = data.x + 175. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 175. * Sin(data.a * bj_DEGTORAD)
set g = CreateGroup()
call LineSegment.EnumUnits(g,data.x1,data.y1,data.x,data.y,375.) //takes group whichgroup, real ax, real ay, real bx, real by, real offset returns nothing
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
if IsUnitEnemy(FoG,data.p) and UnitAlive(FoG) then //and ((z<= data.z1+95. and z>=data.z1-95.)or(z<= data.z2+65. and z>=data.z2-65.)) then
set d = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitApplyTimedLife(d,'BTLF',1.)
call UnitAddAbility(d,'A0PF')
call IssueTargetOrderById(d,852095,FoG)
if IsUnitType(data.c,UNIT_TYPE_ANCIENT) then
call UnitDamageTargetEx(data.c,FoG,data.d*.5/3.,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamageTargetEx(data.c,FoG,data.d*.5/3.,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTargetEx(data.c,FoG,data.d*.5,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamageTargetEx(data.c,FoG,data.d*.5,false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Earth NovaTarget.mdx",FoG,"origin"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\BarrensFissure0.mdx",FoG,"origin"))
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",FoG,"origin"))
//call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\EraserFire.mdl",FoG,"chest"))
endif
endloop
call DestroyGroup(g)
set x2 = GetUnitX(data.d1)
set y2 = GetUnitY(data.d1)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
set x2 = GetUnitX(data.d2)
set y2 = GetUnitY(data.d2)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
set x2 = GetUnitX(data.d3)
set y2 = GetUnitY(data.d3)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
set x2 = GetUnitX(data.d4)
set y2 = GetUnitY(data.d4)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
set x2 = GetUnitX(data.d5)
set y2 = GetUnitY(data.d5)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
set x2 = GetUnitX(data.d6)
set y2 = GetUnitY(data.d6)
loop
exitwhen i >=8
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=3
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=2
set x = x2 + GetRandomReal(-175.,175.)
set y = y2 + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl",x,y))
set i = i + 1
endloop
call SetTimerData(t,data)
call TimerStart(t,.4,false,function Handler)
set d = null
set FoG = null
set g = null
set t = null
return
endif
set data.x = data.x + 325. * Cos(data.a * bj_DEGTORAD)
set data.y = data.y + 325. * Sin(data.a * bj_DEGTORAD)
loop
exitwhen i >=8
set x = data.x + GetRandomReal(-175.,175.)
set y = data.y + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Dust.mdx",x,y))
set i = i + 1
endloop
set i = 0
loop
exitwhen i >=10
set x = data.x + GetRandomReal(-175.,175.)
set y = data.y + GetRandomReal(-175.,175.)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",x,y))
set i = i + 1
endloop
if data.i == 1 then
set data.d1 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d1,'A0NX')
set data.u1 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u1,true)
call SetUbersplatRenderAlways( data.u1, true )
endif
if data.i == 2 then
set data.d2 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d2,'A0NX')
set data.u2 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u2,true)
call SetUbersplatRenderAlways( data.u2, true )
endif
if data.i == 3 then
set data.d3 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d3,'A0NX')
set data.u3 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u3,true)
call SetUbersplatRenderAlways( data.u3, true )
endif
if data.i == 4 then
set data.d4 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d4,'A0NX')
set data.u4 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u4,true)
call SetUbersplatRenderAlways( data.u4, true )
endif
if data.i == 5 then
set data.d5 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d5,'A0NX')
set data.u5 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u5,true)
call SetUbersplatRenderAlways( data.u5, true )
endif
if data.i == 6 then
set data.d6 = CreateUnit(data.p,'h007',data.x,data.y,0.)
call UnitAddAbility(data.d6,'A0NX')
set data.u6 = CreateUbersplat(data.x,data.y,"THND",255,255,255,255,false,false)
call ShowUbersplat(data.u6,true)
call SetUbersplatRenderAlways( data.u6, true )
endif
call SetTimerData(t,data)
call TimerStart(t,.4,false,function Handler)
endif
set d = null
set FoG = null
set g = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer()
local FT data = FT.create()
set data.i = 0
set data.c = GetTriggerUnit()
set data.p = GetOwningPlayer(data.c)
set data.x = GetUnitX(data.c)
set data.y = GetUnitY(data.c)
set data.a = bj_RADTODEG * Atan2(GetSpellTargetY() - data.y, GetSpellTargetX() - data.x)
set data.x = data.x + 175. * Cos((data.a-180.) * bj_DEGTORAD)
set data.y = data.y + 175. * Sin((data.a-180.) * bj_DEGTORAD)
set data.x1 = data.x
set data.y1 = data.y
set data.d = (GetUnitAbilityLevel(data.c,SPELL_ID)*6*GetHeroStr(data.c,true))+(BlzGetUnitMaxHP(data.c)*.15)
call SetTimerData(t,data)
call TimerStart(t,.2,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope PulverizeCDR initializer OnInit
globals
trigger PULVERIZEONHIT
private constant integer SPELL_ID = 'A04C'
private constant integer SPELL_ID2 = 'A0DA'
private constant integer SPELL_ID3 = 'A0NZ'
private constant integer SPELL_ID4 = 'A027'
endglobals
native UnitAlive takes unit id returns boolean
private function Conditions takes nothing returns boolean
local unit c = GetEventDamageSource()
local unit t = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(c,SPELL_ID)
local real cooldown
if level != 0 and t != c and IsUnitEnemy(c,GetOwningPlayer(t)) and Damage_IsAttack() and UnitAlive(c) and GetUnitAbilityLevel(t,'B067') ==1 then
call UnitRemoveAbility(t,'B067')
if GetEventDamage() > 0 then
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(c,SPELL_ID),ABILITY_RLF_DAMAGE_DEALT_WAR2,level-1,400.+(GetHeroStr(c,true)*level*level*.25*(1.+(.035*GetHeroLevel(c)))))
if GetUnitAbilityLevel(c, SPELL_ID2 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID2 )
if cooldown > 0 then
if cooldown - .35 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID2 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID2 , cooldown - .35)
endif
endif
endif
if GetUnitAbilityLevel(c, SPELL_ID3 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID3 )
if cooldown > 0 then
if cooldown - .35 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID3 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID3 , cooldown - .35)
endif
endif
endif
if GetUnitAbilityLevel(c, SPELL_ID4 )>0 then
set cooldown = BlzGetUnitAbilityCooldownRemaining(c, SPELL_ID4 )
if cooldown > 0 then
if cooldown - .35 <= 0 then
call BlzEndUnitAbilityCooldown(c, SPELL_ID4 )
else
call BlzStartUnitAbilityCooldown(c, SPELL_ID4 , cooldown - .35)
endif
endif
endif
endif
endif
set c = null
set t = null
return false
endfunction
private function OnInit takes nothing returns nothing
set PULVERIZEONHIT=CreateTrigger()
call TriggerAddCondition(PULVERIZEONHIT,Condition(function Conditions))
call MOE(II,(PULVERIZEONHIT))
call DisableTrigger(PULVERIZEONHIT)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope GarZeng initializer OnInit
globals
trigger GARZENGONHIT
private constant integer SPELL_ID = 'A0AY'
private constant integer SPELL_ID2 = 'A030'
endglobals
private function Actions takes nothing returns boolean
local unit a = GetEventDamageSource()
local unit u = GetTriggerUnit()
local unit d
local real dmg = GetEventDamage()
local integer level = GetUnitAbilityLevel(a,SPELL_ID)
if GetUnitAbilityLevel(a,SPELL_ID) != 0 and GetRandomInt(0,99) <=3 and GetHeroInt(a,true) >= 350 and dmg > 0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) then
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(a),GetUnitY(a),GetUnitFacing(a))
call UnitAddAbility(d,SPELL_ID2)
call SetUnitAbilityLevel(d,SPELL_ID2,level)
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(d,SPELL_ID2),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(d,SPELL_ID2),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(a,true)*level*level*.05*(1.+(.04*GetHeroLevel(a)))))
call IssueTargetOrder(d,"forkedlightning",u)
call UnitApplyTimedLife(d,'BTLF',1)
endif
else
if(CI[NI])then
set d = CreateUnit(GetOwningPlayer(a),'h007',GetUnitX(a),GetUnitY(a),GetUnitFacing(a))
call UnitAddAbility(d,SPELL_ID2)
call SetUnitAbilityLevel(d,SPELL_ID2,GetUnitAbilityLevel(a,SPELL_ID))
call BlzSetAbilityRealLevelField(BlzGetUnitAbility(d,SPELL_ID2),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1,BlzGetAbilityRealLevelField(BlzGetUnitAbility(d,SPELL_ID2),ABILITY_RLF_DAMAGE_PER_TARGET_OCL1,level-1)+(GetHeroInt(a,true)*level*level*.05*(1.+(.04*GetHeroLevel(a)))))
call IssueTargetOrder(d,"forkedlightning",u)
call UnitApplyTimedLife(d,'BTLF',1)
endif
endif
endif
if GetUnitAbilityLevel(a,'A0NG') != 0 and dmg> 0 then
if(J5V[(ROX((GetUnitTypeId(a))))])then
if (BI[NI])==(LN) then
call DisableTrigger(GARZENGONHIT)
call UnitDamageTargetEx( a, u,(GetHeroInt(a,true)*.75*(1.+.125 * GetHeroLevel(a))), false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
call EnableTrigger(GARZENGONHIT)
endif
else
if(CI[NI])then
call DisableTrigger(GARZENGONHIT)
call UnitDamageTargetEx( a, u,(GetHeroInt(a,true)*.75*(1.+.125 * GetHeroLevel(a))), false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
call EnableTrigger(GARZENGONHIT)
endif
endif
endif
set d = null
set a = null
set u = null
return false
endfunction
private function OnInit takes nothing returns nothing
set GARZENGONHIT = CreateTrigger()
call MOE(II, (GARZENGONHIT))
call TriggerAddCondition(GARZENGONHIT, Condition(function Actions))
call DisableTrigger(GARZENGONHIT)
endfunction
endscope
scope HolyWaveHealing initializer OnInit
globals
private constant integer SPELL_ID = 'A092'
endglobals
private function Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local real life
local real maxhp
if IsUnitType(u,UNIT_TYPE_HERO) then
set life = GetWidgetLife(u)
set maxhp = BlzGetUnitMaxHP(u)*1.
call SetWidgetLife(u,life+((maxhp-life)*(.2+.025*GetUnitAbilityLevel(u,SPELL_ID))))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",u,"origin"))
endif
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=11
//TESH.alwaysfold=0
scope DemonSpawn initializer OnInit
globals
private constant integer SPELL_ID = 'A0HY'
endglobals
private function Actions takes nothing returns nothing
local integer unitid
local unit c = GetTriggerUnit()
local unit u
local real x
local real y
local real a = GetRandomReal(0.,360.)
local real d = GetRandomReal(300.,400.)
set x = GetUnitX(c) + d * Cos(a * bj_DEGTORAD)
set y = GetUnitY(c) + d * Sin(a * bj_DEGTORAD)
if GetUnitLevel(GetTriggerUnit()) < 25 then
set unitid = 'o008'
else
if GetRandomReal(0.,100.) >= 50. then
set unitid = 'n01J'
else
set unitid = 'o008'
endif
endif
if GetUnitLevel(GetTriggerUnit()) >= 50 and unitid == 'o008' then
set unitid = 'n01I'
endif
set u = CreateUnit((Player(GetPlayerId(GetOwningPlayer(c)))),unitid,x,y,a)
if unitid == 'o008' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(c)/3*(1. + (.025 * GetHeroLevel(c)))))
call BlzSetUnitBaseDamage(u,R2I(GetHeroStr(c,true)*(1. + (.05 * GetHeroLevel(c)))),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(c)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(u))])] then
call BlzSetUnitSkin( u, 'o00D' )
endif
endif
if unitid == 'n01J' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(c)/2*(1. + (.025 * GetHeroLevel(c)))))
call BlzSetUnitBaseDamage(u,R2I((1. + (.05 * GetHeroLevel(c)))*((GetHeroInt(c,true)*3)+GetHeroStr(c,true)+(GetHeroAgi(c,true)*2))),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(c)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(u))])] then
call BlzSetUnitSkin( u, 'n035' )
endif
endif
if unitid == 'n01I' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(c)*(1. + (.025 * GetHeroLevel(c)))))
call BlzSetUnitBaseDamage(u,R2I((1. + (.05 * GetHeroLevel(c)))*(GetHeroInt(c,true))+(GetHeroStr(c,true)*2)),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(c)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(u))])] then
call BlzSetUnitSkin( u, 'n036' )
endif
endif
call UnitApplyTimedLife(u,'BTLF',15.+(GetHeroLevel(c)*.075)+(GetHeroStr(c,true)*.01))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Doomsday.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Damnation Orange.mdx",x,y))
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
set c = null
set u = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope ReignofDeath initializer OnInit
globals
private constant integer SPELL_ID = 'A0IC'
private constant group GROUP = CreateGroup()
private unit CASTER
private real DAMAGE = 0.
endglobals
native UnitAlive takes unit id returns boolean
private struct RoD
unit c
integer dur
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private struct RoD2
real x
real y
unit c
method destroy takes nothing returns nothing
set this.c = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",GetUnitX(u),GetUnitY(u)))
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
endif
set u = null
return false
endfunction
private function Handler2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD2 data2 = GetTimerData(t)
local unit u = CreateUnit((Player(GetPlayerId(GetOwningPlayer(data2.c)))),'n01K',data2.x,data2.y,270.)
set CASTER = data2.c
set DAMAGE = GetUnitAbilityLevel(data2.c,SPELL_ID)*(GetHeroStr(data2.c,true)+GetHeroAgi(data2.c,true)+GetHeroInt(data2.c,true))*10.
call GroupEnumUnitsInRange(GROUP,data2.x,data2.y,399.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Smash.mdx",data2.x,data2.y))
call BlzSetUnitMaxHP(u,BlzGetUnitMaxHP(data2.c)*100)
call BlzSetUnitBaseDamage(u,GetHeroStr(data2.c,true)*75,0)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call UnitApplyTimedLife(u,'BTLF',15.)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data2.c))])] then
call BlzSetUnitSkin( u, 'n034' )
endif
call DestroyEffect(AddSpecialEffect("war3mapImported\\Damnation Orange.mdx",data2.x,data2.y))
set u = null
call data2.destroy()
set t = null
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local RoD data = GetTimerData(t)
local timer t2
local RoD2 data2
local effect fx
if data.dur <=0 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur - 1
set data2=RoD2.create()
set data2.c = data.c
set data2.x = GetUnitX(data.c)+GetRandomReal(-750.,750.)
set data2.y = GetUnitY(data.c)+GetRandomReal(-750.,750.)
set t2= NewTimer()
call SetTimerData(t2,data2)
call TimerStart(t2,.5,false,function Handler2)
set fx = AddSpecialEffect("war3mapImported\\Kingdom Come.mdx",data2.x,data2.y)
call BlzSetSpecialEffectScale(fx,1.5)
call DestroyEffect(fx)
call TimerStart(t,.5,false,function Handler)
endif
set fx = null
set t2 = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local RoD data = RoD.create()
set data.c = GetTriggerUnit()
set data.dur = 10
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=32
//TESH.alwaysfold=0
scope ViciousVice initializer OnInit
globals
private constant integer SPELL_ID = 'A0I8'
endglobals
private struct VV
unit c
unit u
real dmg
real dur
method destroy takes nothing returns nothing
set this.c = null
set this.u = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local VV data = GetTimerData(t)
if data.dur <=0. or GetUnitAbilityLevel(data.u,'B051')!= 1 then
call data.destroy()
call ReleaseTimer(t)
else
set data.dur = data.dur -.02
call UnitDamageTargetEx(data.c,data.u,data.dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call TimerStart(t,.02,false,function Handler)
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local VV data = VV.create()
set data.u = GetSpellTargetUnit()
set data.c = GetTriggerUnit()
if IsUnitType(data.u,UNIT_TYPE_ANCIENT) then
set data.dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.c)))],true)+(BlzGetUnitMaxHP(data.u)*.03))*.02
else
set data.dmg = (GetHeroInt(LC[(1+GetPlayerId(GetOwningPlayer(data.c)))],true)+(BlzGetUnitMaxHP(data.u)*.08))*.02
endif
call UnitDamageTargetEx(data.c,data.u,data.dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
set data.dur = 9.98
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,.02,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
scope InfernalMartyr initializer OnInit
globals
trigger INFERNALMARTYR
private constant integer SPELL_ID = 'A0I2'
private constant group GROUP = CreateGroup()
private unit CASTER
endglobals
private function FilterActions takes nothing returns boolean
local unit u = GetFilterUnit()
local real r
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) and GetOwningPlayer(u) != Player(15) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
call UnitDamageTargetEx(CASTER,u,GetHeroStr(LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)*2.*(1.+(.25*GetHeroLevel(LC[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))),false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,null)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Firebolt Minor.mdx",u,"chest"))
endif
set u = null
return false
endfunction
private function Conditions takes nothing returns boolean
local real x
local real y
set CASTER = GetTriggerUnit()
set x = GetUnitX(CASTER)
set y = GetUnitY(CASTER)
if GetUnitAbilityLevel(CASTER,SPELL_ID) == 1 then
call DestroyEffect(AddSpecialEffect("war3mapImported\\BloodEX-Special-2.mdx",x,y))
call GroupEnumUnitsInRange(GROUP,x,y,250.,Filter(function FilterActions))
endif
return false
endfunction
private function OnInit takes nothing returns nothing
set INFERNALMARTYR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(INFERNALMARTYR, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(INFERNALMARTYR,Condition(function Conditions))
call DisableTrigger(INFERNALMARTYR)
endfunction
endscope
scope FallingSword initializer OnInit
globals
private constant group GROUP = CreateGroup()
private unit CASTER
private constant integer SPELL_ID = 'A0HX'
private real DAMAGE = 0.
endglobals
native UnitAlive takes unit id returns boolean
private struct FelSword
unit caster
real x
real y
integer lvl
method destroy takes nothing returns nothing
set this.caster = null
call this.deallocate()
endmethod
endstruct
private function FilterActions takes nothing returns boolean
local unit u= GetFilterUnit()
//call BJDebugMsg("is this filter working?")
if IsUnitEnemy(u,GetOwningPlayer(CASTER)) and UnitAlive(u) then
call UnitDamageTargetEx(CASTER,u,DAMAGE,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Pillar of Flame Orange.mdx",GetUnitX(u),GetUnitY(u)))
//call BJDebugMsg("FIRE")
endif
set u= null
return false
endfunction
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local FelSword data = GetTimerData(t)
local integer i = 3 + data.lvl
local integer i2
local integer unitid
local unit u
local unit u2
set CASTER = data.caster
set DAMAGE = data.lvl*data.lvl*.1*(GetHeroStr(data.caster,true)+GetHeroAgi(data.caster,true)+GetHeroInt(data.caster,true))*2.
call GroupEnumUnitsInRange(GROUP,data.x,data.y,299.,Filter(function FilterActions))
call DestroyEffect(AddSpecialEffect("war3mapImported\\Smash.mdx",data.x,data.y))
set u2 = CreateUnit((Player(GetPlayerId(GetOwningPlayer(data.caster)))),'H01H',data.x,data.y,0.)
call UnitApplyTimedLife(u2,'BTLF',1.)
loop
exitwhen i <= 0
set i = i - 1
set i2 = GetRandomInt(0,2)
if i2 == 0 then
set unitid = 'o008'
endif
if i2 == 1 then
set unitid = 'n01J'
endif
if i2 == 2 then
set unitid = 'n01I'
endif
set u = CreateUnit((Player(GetPlayerId(GetOwningPlayer(data.caster)))),unitid,data.x,data.y,0.)
if unitid == 'o008' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(data.caster)/3*(1. + (.025 * GetHeroLevel(data.caster)))))
call BlzSetUnitBaseDamage(u,R2I(GetHeroStr(data.caster,true)*(1. + (.05 * GetHeroLevel(data.caster)))),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(data.caster)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] then
call BlzSetUnitSkin( u, 'o00D' )
endif
endif
if unitid == 'n01J' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(data.caster)/2*(1. + (.025 * GetHeroLevel(data.caster)))))
call BlzSetUnitBaseDamage(u,R2I((1. + (.05 * GetHeroLevel(data.caster)))*(GetHeroInt(data.caster,true)*3)+GetHeroStr(data.caster,true)+(GetHeroAgi(data.caster,true)*2)),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(data.caster)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] then
call BlzSetUnitSkin( u, 'n035' )
endif
endif
if unitid == 'n01I' then
call BlzSetUnitMaxHP(u,R2I(BlzGetUnitMaxHP(data.caster)*(1. + (.025 * GetHeroLevel(data.caster)))))
call BlzSetUnitBaseDamage(u,R2I((1. + (.05 * GetHeroLevel(data.caster)))*(GetHeroInt(data.caster,true))+(GetHeroStr(data.caster,true)*2)),0)
call BlzSetUnitArmor(u,BlzGetUnitArmor(data.caster)*.5)
if IsCitGod[GetUnitUserData(LC[1+GetPlayerId(GetOwningPlayer(data.caster))])] then
call BlzSetUnitSkin( u, 'n036' )
endif
endif
call UnitApplyTimedLife(u,'BTLF',(15.+(GetHeroLevel(data.caster)*.1)+(GetHeroStr(data.caster,true)*.1))*.5)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Doomsday.mdx",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Damnation Orange.mdx",u,"origin"))
set i = i - 1
endloop
set u2 = null
set u = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local FelSword data = FelSword.create()
local timer t=CreateTimer()
set data.caster= GetTriggerUnit()
set data.x = GetSpellTargetX()
set data.y = GetSpellTargetY()
set data.lvl = GetUnitAbilityLevel(data.caster,SPELL_ID)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Kingdom Come.mdx",data.x,data.y))
call SetTimerData(t,data)
call TimerStart(t,.5,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope
//TESH.scrollpos=32
//TESH.alwaysfold=0
scope ImpenetrableFortress initializer OnInit
globals
private constant integer SPELL_ID = 'A0IB'
integer array FortressStacks
endglobals
private struct IFFX
effect fx
unit u
method destroy takes nothing returns nothing
set this.u = null
call DestroyEffect(this.fx)
set this.fx = null
call this.deallocate()
endmethod
endstruct
private function Handler takes nothing returns nothing
local timer t = GetExpiredTimer()
local IFFX data = GetTimerData(t)
set FortressStacks[GetUnitUserData(data.u)] = FortressStacks[GetUnitUserData(data.u)] -1
if FortressStacks[GetUnitUserData(data.u)] == 0 then
call SetUnitInvulnerable(data.u,false)
endif
call data.destroy()
call ReleaseTimer(t)
set t = null
endfunction
private function Actions takes nothing returns nothing
local timer t
local IFFX data = IFFX.create()
set data.u = GetTriggerUnit()
set data.fx = AddSpecialEffect("war3mapImported\\Ubershield Autumn.mdx", GetUnitX(data.u),GetUnitY(data.u))
call BlzSetSpecialEffectZ(data.fx, 175.)
call BlzSetSpecialEffectScale(data.fx,3.5)
call SetUnitInvulnerable(data.u,true)
set FortressStacks[GetUnitUserData(data.u)] = FortressStacks[GetUnitUserData(data.u)] + 1
set t = NewTimer()
call SetTimerData(t,data)
call TimerStart(t,15.,false,function Handler)
set t = null
endfunction
private function OnInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function Actions)
endfunction
endscope