//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
//TESH.scrollpos=0
//TESH.alwaysfold=0
/*
LATEST PATCH INFORMATION:
fixed some memory leaks involving the pig farm triggers? and the new item stacking system.
disabled ability to 'rescue' demon players that weren't actually playing(critters now become
invulnerable so as to be invalid targets)
simplified some triggers a bit, using less variables
trees can't run 300 movespeed anymore, reduced to 260.
some minor terrain changes, a new item
fixed an overlooked bug with player red not receiving some of the trigger generated messages.
//forgive me, i'm newb to cjass
updating code to work with cjass, editing some runner unit costs and chaser item costs
balance changes here and there a few graphics additions with items
IF YOU FIND ANY BUGS PLEASE REPORT THEM TO [email protected] RIGHT AWAY
OR TO SANKAKU ON USWEST/EUROPE, OR MORGSHELLCREAM ON USEAST/ASIA
*/
//TESH.scrollpos=0
//TESH.alwaysfold=0
define creditsTDHT ={
*ARTISTS*
Afronight_76 made the Chaser A Skin.
antihero made the Chaser B Skin.
Egg made the Chaser C Skin.
Sellenisko made the Chaser D Model.
Darkholme/Sylrae/General Frank made the Chaser E Model.
chr2 made the Murloc Demon Hunter Skin.
Mr.Goblin made the Green Wolf Skin.
Mc ! made the Models of Runners M, Q, and S and Chaser F.
Black_Stan made the Chaser G Skin.
Callahan made the Models of Runners W and Z.
Dan van Ohllus made the Crow Scout Art.
Crazyrussian made the fire potion icon.
FrancK and AnimE made the item models.
unknown artists made item effects.
*skins*
Afronight_76
antihero
Egg
Black_Stan
Mr.Goblin
chr2
*models*
AnimE
Mc !
Callahan
Sellenisko
Darkholme
Sylrae
General Frank
Dan van Ohllus
*icons*
Dan van Ohllus
Crazyrussian
SanKakU
*documentors*
Cohadar
Vexorian
MindWorX
Adolf
SD_Ryoko
Elil
Archian
Rheian
*testers*
Eithyr
zog01
Palatine
LuckyXIII
Sankaku
*macintosh testers*
weep
Shade987
*scoreboard developers*
Magentix
Sankaku
*item system developers*
Jesus4Lyf
Vexorian
Sankaku
*Inspirational*
Rao Dao Zao
kingkingyyk3
JopeJope
Panik
Red_Baron
Icefrog
Darthfett
*trigger developers*
Rising_Dusk
Anitarf
Cohadar
Jesus4Lyf
Eithyr
sankaku
DotaMaster666
*project uploaders*
www.epicwar.com
hiveworkshop.com
xgm.ru}
//TESH.scrollpos=0
//TESH.alwaysfold=0
/*
FOR REFERENCE:
in an undisclosed version(0.96something), a secret unit was placed on the map!
see if you can find out what it is and what it does!
version 0.96u
fixed some items disappearing when try to pick them up.
version 0.96t
disabled ability to 'rescue' demon players that weren't actually playing(critters now become
invulnerable so as to be invalid targets)
simplified some triggers a bit, using less variables
trees can't run 300 movespeed anymore, reduced to 260.
some minor terrain changes, a new item
version 0.96s
fixed one important bug
version 0.96r
bear buff...hibernating is less sleeping and faster possible movement speed.
cleaned up trigger editor some and cleaned up the object editor a little bit.
minor item changes, items will combine somewhat differently from before.
major graphics changes and some balance changes.
chasers now have a starting gold fund, like runners have.
version 0.96q
additional bounties for runner buildings.
version 0.96p
added integer pool for random tips to make common and rare tips.
added support for macintosh computers to play the demon hunt tournament!
i don't have a mac so i can't explain it, i just followed the instructions
i was given and changed the mipmap in the icon making settings to 7
my guess however, is that icons that have too small of a filesize will crash macs.
i think a mipmap of 7 keeps the icons at 6kb or more so they are big enough.
version 0.96o
renamed runners and added chaser names. they are mostly tribute names.
redid the terrain again. loading screen and preview screen
are both changed due to the terrain change. rebalanced the hp
of the corrupted ancient of war. they should be easier to
kill now but still pack a wallop. new gold mine setups
which are randomly chosen. currently there are 4 choices.
version 0.96n
enhanced some coding...added a new spell and a new model. made the
camera system fully functional. changes to quests icons, and fixed credits errors
found in quests
version 0.96m
fixed the pig farm bugs and changed pig farm resources gain to include all
players' pig farms. this will add extra pressure to kill runners for the chasers.
worked on simplifying some of the code. added appropriate sounds to the end
game transmissions.
version 0.96l
fixed the slow spell icon on blood elf demon hunter. fixed the new loading screen.
version 0.96k
added 25% chance tree of life drops potion of volcano spell on death, new potion icon,
adjusted names in import manager, fixed more icons
made new loading screen(needed) and new preview screen
version 0.96j
enhanced icons, adding scorescreen icons and implemented standardized borders.
version 0.96i
added 2 new models, axed old skin & old model, and added some proper icons to replace the
filler icons (example: bloodmage icon replaced with bloodelf demon hunter icon)
version 0.95i
from 0.95h to 0.95i balance changes are as follows
changed changed duration for sniff the wind from 2.5/5/7.5/10(or something like that)
to 2/2/2/2. added a cooldown of 10.
changed mana cost for crow scout ability from 100 to 200.
crow scouts no longer reveal invisible units.
changed mana cost for spy posts from 125/100/75/50 to 125/125/125/125.
spy posts no longer reveal invisible units.
these changes were made in consideration of some problems with speedy runners* being
almost useless vs spy posts and crow scouts and even sniff the wind.
*idk why, but this said speedy chasers instead of speedy runners, lol.
version 0.95j
crash fixes.
version 0.95k
TDHT system is born. a system especially for this map.
trying to remove overlooked memory leaks and showing lumber/gold gain when the kills
are made for the hunters and for when the pig farms are built with the text tag system.
version 0.96
code improvement and fixing of tooltips...
changed the random tips colored text to bright green, it used to be purple.
new loading screen
fixed an exploit with mechanical critters.
item stacking system improved
edited watchtowers: they no longer target chasers (they never did dmg to them anyway)
version 0.96c
refined some coding...almost all the udg variables are gone, now.
added the MSGS library over from my TAF map.
VERSION 0.96F
NEW MULTIBOARD. added self-destruct for naga town hall.
version 0.96g
axed the custom demon gate model. fixed some bugs with random choice.
version 0.96h
modified the messages a little bit,FINISHED THE RUNNER Y FREAKOUT GAG, added 1 new random tip
*/
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_time_limit_Func007A takes nothing returns nothing
call CameraSetupApplyForPlayer(true, CAM[14], GetEnumPlayer(), 0)
endfunction
function Trig_time_limit_Func019A takes nothing returns nothing
call ResetToGameCameraForPlayer(GetEnumPlayer(), 0)
endfunction
function Trig_time_limit_Func020A takes nothing returns nothing
call CustomVictoryBJ(GetEnumPlayer(), true, true)
endfunction
function Trig_time_limit_Func021A takes nothing returns nothing
call CustomDefeatBJ(GetEnumPlayer(), "Defeat!")
endfunction
function Trig_time_limit_Actions takes nothing returns nothing
call DisableTrigger(gg_trg_Chasers_Win)
call DisableTrigger(gg_trg_Runners_win)
call TriggerSleepAction(5)
call msgall(60,gtc_red("Time is Up! Runners Win!"))
call TriggerSleepAction(5)
call msgall(15,gtc_gold("The Runners have survived the Demon Hunt Tournament!"))
call ForForce(GetPlayersAll(), function Trig_time_limit_Func007A)
call TriggerSleepAction(2)
call CinematicModeBJ(true, GetPlayersAll())
call ShowInterfaceForceOff(GetPlayersAll(), 2.00)
call SetUserControlForceOff(GetPlayersAll())
call ClearTextMessagesBJ(GetPlayersAll())
call ForceCinematicSubtitlesBJ(true)
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), nndk, gtc_redorange("The Burning Legion"), gg_snd_EvilLaugh, gtc_yellowgreen("Fear Our Evasiveness! We Will Never Go Down Without A Fight!"), bj_TIMETYPE_ADD, 10.00, true)
call PolledWait(2)
call ShowInterfaceForceOn(GetPlayersAll(), 2)
call SetUserControlForceOn(GetPlayersAll())
call CinematicModeBJ(false, GetPlayersAll())
call ForForce(GetPlayersAll(), function Trig_time_limit_Func019A)
call ForForce(GetPlayersAllies(Player(2)), function Trig_time_limit_Func020A)
call ForForce(GetPlayersAllies(Player(0)), function Trig_time_limit_Func021A)
call DisableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_time_limit takes nothing returns nothing
set gg_trg_time_limit = CreateTrigger()
call DisableTrigger(gg_trg_time_limit)
call TriggerRegisterTimerExpireEventBJ(gg_trg_time_limit, tmrTDHT)
call TriggerAddAction(gg_trg_time_limit, function Trig_time_limit_Actions)
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
function Trig_Chasers_Win_Func002002002 takes nothing returns boolean
return (IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true)
endfunction
function Trig_Chasers_Win_Func003A takes nothing returns nothing
call SetUnitPosition(GetEnumUnit(), (GetRandomReal(-480.00, 0.00)), (GetRandomReal(9191.00, 10101.00)))
endfunction
function Trig_Chasers_Win_Func005A takes nothing returns nothing
call CameraSetupApplyForPlayer(true, CAM[5], GetEnumPlayer(), 0)
endfunction
function Trig_Chasers_Win_Func018A takes nothing returns nothing
call ResetToGameCameraForPlayer(GetEnumPlayer(), 0)
endfunction
function Trig_Chasers_Win_Func019A takes nothing returns nothing
call CustomVictoryBJ(GetEnumPlayer(), true, true)
endfunction
function Trig_Chasers_Win_Func020A takes nothing returns nothing
call CustomDefeatBJ(GetEnumPlayer(), "TRIGSTR_3787")
endfunction
function Trig_Chasers_Win_Actions takes nothing returns nothing
local string transmission
local integer a=S2I(jBoard_TDHT.field(0,0).getValue())
local integer b=S2I(jBoard_TDHT.field(1,0).getValue())
local integer c=S2I(jBoard_TDHT.field(2,0).getValue())
call DisableTrigger(gg_trg_time_limit)
call DisableTrigger(gg_trg_Runners_win)
call TriggerSleepAction(5)
call msgall(60,gtc_gold("All the Runners have been captured! Chasers Win!"))
set TDHT_ug = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Chasers_Win_Func002002002))
call ForGroupBJ(TDHT_ug, function Trig_Chasers_Win_Func003A)
call GroupClear(TDHT_ug)
call ForForce(GetPlayersAll(), function Trig_Chasers_Win_Func005A)
call msgall(15,gtc_goldbrown("And the Champion of the Demon Hunt Tournament is............"))
call TriggerSleepAction(5)
call CinematicModeBJ(true, GetPlayersAll())
call ShowInterfaceForceOff(GetPlayersAll(), 2.00)
call SetUserControlForceOff(GetPlayersAll())
call ClearTextMessagesBJ(GetPlayersAll())
call ForceCinematicSubtitlesBJ(true)
if a>b and a>c then
set transmission =(gtc_gold(GetPlayerName(Player(0))+" is the Champion of the Demon Hunt Tournament!"))
elseif b>a and b>c then
set transmission = (gtc_gold(GetPlayerName(Player(1))+" is the Champion of the Demon Hunt Tournament!"))
elseif c>a and c>b then
set transmission = (gtc_gold(GetPlayerName(Player(10))+" is the Champion of the Demon Hunt Tournament!"))
elseif a==b and a==c then
set transmission=(gtc_gold("Full draw! No one is the champion of the Demon Hunt Tournament!"))
else
set transmission=(gtc_gold("Draw! No one is the champion of the Demon Hunt Tournament!"))
endif
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), efdr, gtc_palegreen("The Demon Hunt Tournament"), gg_snd_Vision, transmission, bj_TIMETYPE_ADD, 10.00, true)
call PolledWait(2)
call ShowInterfaceForceOn(GetPlayersAll(), 2)
call SetUserControlForceOn(GetPlayersAll())
call CinematicModeBJ(false, GetPlayersAll())
call ForForce(GetPlayersAll(), function Trig_Chasers_Win_Func018A)
call ForForce(GetPlayersAllies(Player(0)), function Trig_Chasers_Win_Func019A)
call ForForce(GetPlayersAllies(Player(2)), function Trig_Chasers_Win_Func020A)
call DisableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Chasers_Win takes nothing returns nothing
set gg_trg_Chasers_Win = CreateTrigger()
call TriggerRegisterPlayerStateEvent(gg_trg_Chasers_Win, Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_FOOD_USED, EQUAL, 9.00)
call TriggerAddAction(gg_trg_Chasers_Win, function Trig_Chasers_Win_Actions)
endfunction
//TESH.scrollpos=26
//TESH.alwaysfold=0
function Trig_Runners_win_Func005002002 takes nothing returns boolean
return (IsUnitType(GetFilterUnit(), UNIT_TYPE_SAPPER) == true)
endfunction
function Trig_Runners_win_Func006A takes nothing returns nothing
call SetUnitPosition(GetEnumUnit(), (GetRandomReal(-215.00, 50.00)), (GetRandomReal(-715.00, -420.00)))
endfunction
function Trig_Runners_win_Func009A takes nothing returns nothing
call CameraSetupApplyForPlayer(true, CAM[4], GetEnumPlayer(), 0)
endfunction
function Trig_Runners_win_Func022A takes nothing returns nothing
call ResetToGameCameraForPlayer(GetEnumPlayer(), 0)
endfunction
function Trig_Runners_win_Func023A takes nothing returns nothing
call CustomVictoryBJ(GetEnumPlayer(), true, true)
endfunction
function Trig_Runners_win_Func024A takes nothing returns nothing
call CustomDefeatBJ(GetEnumPlayer(), "Defeat!")
endfunction
function Trig_Runners_win_Actions takes nothing returns nothing
call DisableTrigger(gg_trg_time_limit)
call DisableTrigger(gg_trg_Chasers_Win)
call TriggerSleepAction(5)
call msgall(60,gtc_gold("Oh, Looks like all the Chasers are gone! Runners win!"))
call TriggerSleepAction(5)
set TDHT_ug = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Runners_win_Func005002002))
call ForGroupBJ(TDHT_ug, function Trig_Runners_win_Func006A)
call GroupClear(TDHT_ug)
call msgall(15,gtc_yellowgreen("The Demons have conquered the Tournament!"))
call ForForce(GetPlayersAll(), function Trig_Runners_win_Func009A)
call TriggerSleepAction(2)
call CinematicModeBJ(true, GetPlayersAll())
call ShowInterfaceForceOff(GetPlayersAll(), 2.00)
call SetUserControlForceOff(GetPlayersAll())
call ClearTextMessagesBJ(GetPlayersAll())
call ForceCinematicSubtitlesBJ(true)
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), nndk, gtc_redorange("The Burning Legion"), gg_snd_EvilLaugh, gtc_yellowgreen("Now That Our Powers Are Unveiled, The Reign Of Chaos Shall Begin Again."), bj_TIMETYPE_ADD, 10.00, true)
call PolledWait(2)
call ShowInterfaceForceOn(GetPlayersAll(), 2)
call SetUserControlForceOn(GetPlayersAll())
call CinematicModeBJ(false, GetPlayersAll())
call CustomDefeatBJ(GetEnumPlayer(), "Defeat!")
call ForForce(GetPlayersAll(), function Trig_Runners_win_Func022A)
call ForForce(GetPlayersAllies(Player(2)), function Trig_Runners_win_Func023A)
call ForForce(GetPlayersAllies(Player(0)), function Trig_Runners_win_Func024A)
call DisableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Runners_win takes nothing returns nothing
set gg_trg_Runners_win = CreateTrigger()
call TriggerRegisterPlayerStateEvent(gg_trg_Runners_win, Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_GOLD, EQUAL, 3.00)
call TriggerAddAction(gg_trg_Runners_win, function Trig_Runners_win_Actions)
endfunction
//TESH.scrollpos=292
//TESH.alwaysfold=0
////////////////////////////////////////
scope awaken initializer I
globals
private constant real PERIOD = 15.00
private constant integer awakenID='A00H'
endglobals
private struct Data
unit cast;real walk;real stop;timer tim
static method create takes unit cast returns Data
local Data d = Data.allocate()
set d.cast = cast
set d.walk = GetRandomReal(175.00, 450.00)
set d.stop = GetUnitDefaultMoveSpeed(d.cast)
call SetUnitMoveSpeed(d.cast,d.stop+d.walk)
set d.tim = NewTimer()
call SetTimerData(d.tim, d)
return d
endmethod
method onDestroy takes nothing returns nothing
call ReleaseTimer(.tim)
endmethod
endstruct
private function Callback takes nothing returns boolean
local timer tim = GetExpiredTimer()
local Data d = GetTimerData(tim)
call SetUnitMoveSpeed(d.cast,d.stop)
call d.destroy()
set tim = null
return false
endfunction
private function Actions takes nothing returns boolean
local Data d = Data.create(GetTriggerUnit())
call TimerStart(d.tim, PERIOD, true, function Callback)
return false
endfunction
public function I takes nothing returns nothing
call GT_AddStartsEffectAction(function Actions, awakenID)
endfunction
endscope
/////////////////////////////////////////////
scope starfall initializer I
globals
private constant integer starfallID='A00G'
endglobals
private function A takes nothing returns boolean
local integer index = 2
loop
if RUNNER[index] !=null then
call SetUnitMoveSpeed(RUNNER[index], GetUnitDefaultMoveSpeed(RUNNER[index])- GetRandomReal(50.00, 200.00))
endif
set index = index + 1
exitwhen index >11
endloop
return false
endfunction
private function B takes nothing returns boolean
local integer index = 2
loop
if RUNNER[index] !=null then
call SetUnitMoveSpeed(RUNNER[index], GetUnitDefaultMoveSpeed(RUNNER[index]))
endif
set index = index + 1
exitwhen index > 11
endloop
return false
endfunction
private function I takes nothing returns nothing
call GT_AddBeginsCastingAction(function A,starfallID)
call GT_AddStopsCastingAction(function B,starfallID)
endfunction
endscope
////////////////////////////////////////////////////
scope pandarenflames initializer I
globals
private constant integer flamesID='A00B'
private constant integer flames='AHfs'
endglobals
private function b takes nothing returns boolean
call msgally(5,GetOwningPlayer(GetTriggerUnit()),"Human in Halloween Costume: \"Be careful!\"",true)
return false
endfunction
private function A takes nothing returns boolean
local unit ut = GetTriggerUnit()
local real x = GetUnitX(ut)+ GetRandomReal(-800.00,800.00)
local real y = GetUnitY(ut)+GetRandomReal(-800.00,800.00)
local unit u = CreateUnit(GetOwningPlayer(ut), DUMMY, x, y, 270.00)
call UnitAddAbility(u, flames)
call IssuePointOrder(u, "flamestrike", x, y)
call UnitApplyTimedLife(u, 'BTLF', 2.00)
set u = null
set ut = null
return false
endfunction
private function I takes nothing returns nothing
call GT_AddStartsEffectAction(function b, 'A00S')
call GT_AddStartsEffectAction(function A, flamesID)
call XE_PreloadAbility(flames)
endfunction
endscope
///////////////////////////////////////////////
scope stuntraptrigger initializer I
globals
private constant integer trap='otot'
endglobals
private function A takes nothing returns boolean
local unit u= GetDyingUnit()
call PingMinimapEx(GetUnitX(u),GetUnitY(u),3,255,255,255,false)
set u = null
return false
endfunction
private function I takes nothing returns nothing
call GT_AddUnitDiesAction(function A, trap)
endfunction
endscope
//////////////////////////////////////////////////////
scope treedemonskills initializer I
private function h takes nothing returns boolean
local real ux = GetUnitX(GetTriggerUnit())
local real uy = GetUnitY(GetTriggerUnit())
call CreateDestructable('ITtw',ux,uy,GetRandomReal(0.00, 359.00),1,GetRandomInt(1, 10) )
call CreateDestructable('NTtw',ux + GetRandomReal(-200.00,200.00),uy + GetRandomReal(-200.00,200.00),GetRandomReal(0.00, 359.00),1,GetRandomInt(1, 10) )
call CreateDestructable('CTtr',ux + GetRandomReal(-200.00,200.00),uy + GetRandomReal(-200.00,200.00),GetRandomReal(0.00, 359.00),1,GetRandomInt(1, 5) )
return false
endfunction
private function g takes nothing returns boolean
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(16), GetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(16)) + 50)
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(2), GetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(2)) + 50)
return false
endfunction
private function f takes nothing returns boolean
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(16), GetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(16)) + 500)
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(2), GetPlayerState(GetOwningPlayer(GetTriggerUnit()), ConvertPlayerState(2)) + 500)
return false
endfunction
private function I takes nothing returns nothing
call GT_AddStartsEffectAction(function f, 'A00N')
call GT_AddStartsEffectAction(function g, 'A00J')
call GT_AddStartsEffectAction(function h, 'A00K')
endfunction
endscope
/////////////////////////////////////////////////////////
scope specialitem initializer I
private function f takes nothing returns boolean
call IssuePointOrder(GetSpellTargetUnit(),"move",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
return false
endfunction
private function I takes nothing returns nothing
call GT_AddStartsEffectAction(function f, 'A00Y')
endfunction
endscope
///////////////////////////////
scope DrillWalk initializer I
globals
private constant integer heroabi='A00Z'
private constant integer dumabi='A010'
private constant integer herabi='ACsh'
private constant real PERIOD = 0.20
private constant integer limit=11
endglobals
private struct Data
unit cast
unit dum
real x
real y
real f
integer w
timer tim
static method create takes unit cast, real tx, real ty returns Data
local Data d = Data.allocate()
set d.cast = cast
set d.f=Deg2Rad(GetUnitFacing(d.cast))
call UnitJump(d.cast,125.00,250.00,d.f,0.0)
call SetUnitAnimation(SpellEvent.CastingUnit,"Attack Slam - Whacky wheel")
set d.w=0
set d.x=tx
set d.y=ty
set d.tim = NewTimer()
call SetTimerData(d.tim, d)
return d
endmethod
method onDestroy takes nothing returns nothing
call ReleaseTimer(.tim)
endmethod
endstruct
private function Callback takes nothing returns boolean
local timer tim = GetExpiredTimer()
local Data d = GetTimerData(tim)
set d.x=GetUnitX(d.cast)
set d.y=GetUnitY(d.cast)
set d.dum = CreateUnit(GetOwningPlayer(d.cast), DUMMY,d.x,d.y , 270.0)
call UnitAddAbility(d.dum, dumabi)
call IssuePointOrder(d.dum,"selfdestruct",GetUnitX(d.dum),GetUnitY(d.dum))
set d.w=d.w+1
if d.w>=limit then
call d.destroy()
set tim = null
endif
return false
endfunction
private function Actions takes nothing returns nothing
local Data d = Data.create(GetTriggerUnit(),SpellEvent.TargetX,SpellEvent.TargetY)
call TimerStart(d.tim, PERIOD, true, function Callback)
endfunction
public function I takes nothing returns nothing
call RegisterSpellEffectResponse(heroabi,Actions)
call XE_PreloadAbility(dumabi)
endfunction
endscope
////////////////////////////////////
scope ChaosShockwave initializer I
globals
private constant integer heroabi='ACsh'
private constant real PERIOD = 1.0
private constant integer limit=17
endglobals
private struct Data
unit cast
integer w
timer tim
static method create takes unit cast returns Data
local Data d = Data.allocate()
set d.cast = cast
set d.w=0
set d.tim = NewTimer()
call SetTimerData(d.tim, d)
return d
endmethod
method onDestroy takes nothing returns nothing
call ReleaseTimer(.tim)
endmethod
endstruct
private function Callback takes nothing returns boolean
local timer tim = GetExpiredTimer()
local Data d = GetTimerData(tim)
call SetUnitAnimation(d.cast,"Spell")
set d.w=d.w+1
if d.w>=limit then
call d.destroy()
set tim = null
endif
return false
endfunction
private function Actions takes nothing returns nothing
local Data d = Data.create(GetTriggerUnit())
call TimerStart(d.tim, PERIOD, true, function Callback)
endfunction
public function I takes nothing returns nothing
call RegisterSpellChannelResponse(heroabi,Actions)
endfunction
endscope
/////////////////////////////////////////////
scope GhostWalk initializer I
globals
private constant integer HEROABI = 'A012'
private constant integer DUMMABI = 'AHbn'
endglobals
private function f takes nothing returns nothing
local unit ut = GetTriggerUnit()
local unit u = CreateUnit(GetOwningPlayer(ut), DUMMY, GetUnitX(ut), GetUnitY(ut), 270.00)
call UnitAddAbility(u, DUMMABI)
call IssueTargetOrder(u, "banish", ut)
call UnitApplyTimedLife(u, 'BTLF', 2.0)
set u = null
set ut = null
endfunction
public function I takes nothing returns nothing
call RegisterSpellEffectResponse(HEROABI,f)
call XE_PreloadAbility(DUMMABI)
endfunction
endscope
/////////////////////////////////////////////////////////////
scope WarningDeSp initializer I
globals
private constant integer HEROABI = 'A015'
endglobals
private function f takes nothing returns nothing
if CHASER[0] !=null then
call PingMinimapEx(GetUnitX(CHASER[0]),GetUnitY(CHASER[0]),3,255,0,0,false)
endif
if CHASER[1] !=null then
call PingMinimapEx(GetUnitX(CHASER[1]),GetUnitY(CHASER[1]),3,0,0,255,false)
endif
if CHASER[10] !=null then
call PingMinimapEx(GetUnitX(CHASER[10]),GetUnitY(CHASER[10]),3,0,175,75,false)
endif
endfunction
public function I takes nothing returns nothing
call RegisterSpellEffectResponse(HEROABI,f)
endfunction
endscope
/////////////////////////////////////////////////////////////
scope detectdemon initializer I
globals
private integer z=0
private constant integer HEROABI = 'A016'
endglobals
private function g takes nothing returns boolean
local player x=GetOwningPlayer(GetTriggerUnit())
if x==Player(bj_PLAYER_NEUTRAL_EXTRA) or x==Player(0) or x==Player(1) or x==Player(10) then
set x=null
return false
elseif IsUnitType(GetTriggerUnit(),UNIT_TYPE_SAPPER) then
call AddIndicator(GetTriggerUnit(),255,0,0,100)
set x=null
return false
elseif x==Player(PLAYER_NEUTRAL_PASSIVE) then
call AddIndicator(GetTriggerUnit(),0,255,255,100)
set x=null
return false
else
call AddIndicator(GetTriggerUnit(),255,255,0,100)
set x=null
return false
endif
set x=null
return false
endfunction
private function f takes nothing returns boolean
local trigger t = CreateTrigger()
set z=z+1
call TriggerRegisterUnitInRangeSimple( t, 1250.00*z,GetTriggerUnit())
call TriggerAddCondition( t, Condition(function g) )
return false
endfunction
public function I takes nothing returns nothing
call GT_AddLearnsAbilityAction(function f,HEROABI)
endfunction
endscope
////////////////////////////////////////////////////////
scope rageofmurloc initializer I
globals
private constant integer heroabi='A017'
private constant integer v=555
private integer z=0
endglobals
private struct Data
unit cast
unit dum
integer agi
integer x
timer tim
static method create takes unit cast, integer x returns Data
local Data d = Data.allocate()
set d.cast = cast
set d.x=x
set d.agi = GetHeroAgi(d.cast,true)
call SetHeroAgi(d.cast,GetHeroAgi(d.cast,true)+d.x*75,true)
call SetHeroInt(d.cast,GetHeroInt(d.cast,true)+v,true)
set d.tim = NewTimer()
call SetTimerData(d.tim, d)
return d
endmethod
method onDestroy takes nothing returns nothing
call ReleaseTimer(.tim)
endmethod
endstruct
private function Callback takes nothing returns boolean
local timer tim = GetExpiredTimer()
local Data d = GetTimerData(tim)
call SetHeroAgi(d.cast,GetHeroAgi(d.cast,true)-d.x*75,true)
call SetHeroInt(d.cast,GetHeroInt(d.cast,true)-v,true)
call d.destroy()
set tim = null
return false
endfunction
private function Actions takes nothing returns nothing
local Data d = Data.create(GetTriggerUnit(),GetUnitAbilityLevel(GetTriggerUnit(),heroabi))
call TimerStart(d.tim, 20.00, true, function Callback)
endfunction
public function I takes nothing returns nothing
call RegisterSpellEffectResponse(heroabi,Actions)
endfunction
endscope
/////////////////////////////////////////////
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_setvar_Actions takes nothing returns nothing
local integer index = 2
local player y=Player(PLAYER_NEUTRAL_PASSIVE)
local unit x=CreateUnit( y, 'nwgt', 4864.0, -5760.0, 270.000)
local quest q = CreateQuest()
local intpool ipgold = intpool.create()
set ip4rantip=intpool.create()
call WaygateSetDestination(x,-96.0,-544.0)
call WaygateActivate( x, true )
call QuestSetTitle(q, "Credits")
call QuestSetDescription(q, "There is simply not enough space in the quests for credits. Please refer to the trigger editor.")
call QuestSetIconPath(q, "ReplaceableTextures\\CommandButtons\\BTNSnazzyPotion.blp")
call QuestSetRequired(q, true)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
set q = CreateQuest()
call QuestSetTitle(q, "About Author")
call QuestSetDescription(q, "my bnet name is SanKakU or on USEAST/ASIA, MorgShellcream. i loved archon tag from starcraft and wanted to make the best war3 tag map. here it is.")
call QuestSetIconPath(q, "ReplaceableTextures\\CommandButtons\\BTNsankaku.blp")
call QuestSetRequired(q, true)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
set q = CreateQuest()
call QuestSetTitle(q, "What's New")
call QuestSetDescription(q, "orb of owls is now white instead of orange, variety of balance changes, some fixes to construction and item triggers, chasers now have a starting gold fund, like runners have.")
call QuestSetIconPath(q, "ReplaceableTextures\\CommandButtons\\BTNBloodElfDemonHunter.blp")
call QuestSetRequired(q, false)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
set q = CreateQuest()
call QuestSetTitle(q, "Commands")
call QuestSetDescription(q, "rcam (calls a random camera), cameras (lists all available cameras to call), -camxxx(x=numbers) calls a specific camera, camr returns the camera to where your chaser/runner is, to manipulate the camera by rotate, roll, angle, and distance: -rotxxx,-rolxxx,-angxxx,-disxxx(x=numbers) or unspecified: crot/crot-,crol/col-,cang/cang-,cdis/cdis- press esc for random tips on how to play.")
call QuestSetIconPath(q, "ReplaceableTextures\\CommandButtons\\BTNArchimonde.blp")
call QuestSetRequired(q, false)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
set q=null
call MeleeStartingVisibility( )
loop
call SetPlayerState(Player(index), PLAYER_STATE_RESOURCE_GOLD, 1000 )
call SetPlayerState(Player(index), PLAYER_STATE_RESOURCE_LUMBER, 1000 )
set index=index+1
exitwhen index==9
endloop
call SetPlayerState(Player(11), PLAYER_STATE_RESOURCE_GOLD, 1000 )
call SetPlayerState(Player(11), PLAYER_STATE_RESOURCE_LUMBER, 1000 )
call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, 3)
call SetPlayerState(Player(1), PLAYER_STATE_RESOURCE_GOLD, 3)
call SetPlayerState(Player(10), PLAYER_STATE_RESOURCE_GOLD, 3 )
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_FOOD_USED, 0)
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_GOLD, 0)
call SetPlayerState(Player(PLAYER_NEUTRAL_AGGRESSIVE), PLAYER_STATE_RESOURCE_FOOD_USED, 0)
set efdr = CreateUnit(Player(0), 'efdr', 4836.9, - 6058.9, 202.890)
set nndk = CreateUnit(Player(11), 'nndk', - 2742.7, - 8660.5, 254.840)
set index=1
loop
set CAM[index] = CreateCameraSetup()
set index=index+1
exitwhen index==15
endloop
call CameraSetupSetField(CAM[1], CAMERA_FIELD_ROTATION, 90.0, 0.0 )
call CameraSetupSetField(CAM[1], CAMERA_FIELD_ANGLE_OF_ATTACK, 304.0, 0.0 )
call CameraSetupSetField(CAM[1], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition(CAM[1], -89.0, -623.3, 0.0 )
call CameraSetupSetField(CAM[2], CAMERA_FIELD_ROTATION, 118.7, 0.0 )
call CameraSetupSetField(CAM[2], CAMERA_FIELD_ANGLE_OF_ATTACK, 346.8, 0.0 )
call CameraSetupSetField(CAM[2], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition(CAM[2], -206.6, -93.8, 0.0 )
call CameraSetupSetField(CAM[3], CAMERA_FIELD_ROTATION, 60.0, 0.0 )
call CameraSetupSetField(CAM[3], CAMERA_FIELD_ANGLE_OF_ATTACK, 323.5, 0.0 )
call CameraSetupSetField(CAM[3], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[3], 7471.8, 3532.3, 0.0 )
call CameraSetupSetField(CAM[4], CAMERA_FIELD_ROTATION, 344.4, 0.0 )
call CameraSetupSetField(CAM[4], CAMERA_FIELD_ANGLE_OF_ATTACK, 217.3, 0.0 )
call CameraSetupSetField(CAM[4], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[4], 79.5, -759.0, 0.0 )
call CameraSetupSetField(CAM[5], CAMERA_FIELD_ROTATION, 89.2, 0.0 )
call CameraSetupSetField(CAM[5], CAMERA_FIELD_ANGLE_OF_ATTACK, 325.8, 0.0 )
call CameraSetupSetField(CAM[5], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[5], -217.2, 9219.4, 0.0 )
call CameraSetupSetField(CAM[6], CAMERA_FIELD_ROTATION, 141.7, 0.0 )
call CameraSetupSetField(CAM[6], CAMERA_FIELD_ANGLE_OF_ATTACK, 325.5, 0.0 )
call CameraSetupSetField(CAM[6], CAMERA_FIELD_TARGET_DISTANCE, 1815.0, 0.0 )
call CameraSetupSetDestPosition( CAM[6], -7047.9, -3632.1, 0.0 )
call CameraSetupSetField(CAM[7], CAMERA_FIELD_ROTATION, 292.1, 0.0 )
call CameraSetupSetField(CAM[7], CAMERA_FIELD_ANGLE_OF_ATTACK, 332.7, 0.0 )
call CameraSetupSetField(CAM[7], CAMERA_FIELD_TARGET_DISTANCE, 1815.0, 0.0 )
call CameraSetupSetDestPosition( CAM[7], 8954.4, -6525.2, 0.0 )
call CameraSetupSetField(CAM[8], CAMERA_FIELD_ROTATION, 120.9, 0.0 )
call CameraSetupSetField(CAM[8], CAMERA_FIELD_ANGLE_OF_ATTACK, 328.8, 0.0 )
call CameraSetupSetField(CAM[8], CAMERA_FIELD_TARGET_DISTANCE, 2657.3, 0.0 )
call CameraSetupSetDestPosition( CAM[8], -8252.5, 7973.2, 0.0 )
call CameraSetupSetField(CAM[9], CAMERA_FIELD_ROTATION, 158.4, 0.0 )
call CameraSetupSetField(CAM[9], CAMERA_FIELD_ANGLE_OF_ATTACK, 321.5, 0.0 )
call CameraSetupSetField(CAM[9], CAMERA_FIELD_TARGET_DISTANCE, 3699.7, 0.0 )
call CameraSetupSetDestPosition( CAM[9], -2785.7, 5622.7, 0.0 )
call CameraSetupSetField(CAM[10], CAMERA_FIELD_ROTATION, 89.4, 0.0 )
call CameraSetupSetField(CAM[10], CAMERA_FIELD_ANGLE_OF_ATTACK, 269.0, 0.0 )
call CameraSetupSetField(CAM[10], CAMERA_FIELD_TARGET_DISTANCE, 4462.3, 0.0 )
call CameraSetupSetDestPosition( CAM[10], 317.6, -1537.8, 0.0 )
call CameraSetupSetField(CAM[11], CAMERA_FIELD_ROTATION, 65.5, 0.0 )
call CameraSetupSetField(CAM[11], CAMERA_FIELD_ANGLE_OF_ATTACK, 337.0, 0.0 )
call CameraSetupSetField(CAM[11], CAMERA_FIELD_TARGET_DISTANCE, 2319.1, 0.0 )
call CameraSetupSetDestPosition( CAM[11], 1430.4, 3938.4, 0.0 )
call CameraSetupSetField(CAM[12], CAMERA_FIELD_ROTATION, 18.2, 0.0 )
call CameraSetupSetField(CAM[12], CAMERA_FIELD_ANGLE_OF_ATTACK, 318.9, 0.0 )
call CameraSetupSetField(CAM[12], CAMERA_FIELD_TARGET_DISTANCE, 2008.5, 0.0 )
call CameraSetupSetDestPosition( CAM[12], 1353.9, 4010.9, 0.0 )
call CameraSetupSetField(CAM[13], CAMERA_FIELD_ROTATION, 331.0, 0.0 )
call CameraSetupSetField(CAM[13], CAMERA_FIELD_ANGLE_OF_ATTACK, 349.4, 0.0 )
call CameraSetupSetField(CAM[13], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[13], 5897.3, -7380.6, 0.0 )
call CameraSetupSetField(CAM[14], CAMERA_FIELD_ROTATION, 262.0, 0.0 )
call CameraSetupSetField(CAM[14], CAMERA_FIELD_ANGLE_OF_ATTACK, 347.8, 0.0 )
call CameraSetupSetField(CAM[14], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[14], -168.6, -1119.8, 0.0 )
call CameraSetupSetField(CAM[15], CAMERA_FIELD_ROTATION, 354.5, 0.0 )
call CameraSetupSetField(CAM[15], CAMERA_FIELD_ANGLE_OF_ATTACK, 348.5, 0.0 )
call CameraSetupSetField(CAM[15], CAMERA_FIELD_TARGET_DISTANCE, 1650.0, 0.0 )
call CameraSetupSetDestPosition( CAM[15], 182.1, -591.0, 0.0 )
set index=1
loop
set CAMX[index]=CameraSetupGetDestPositionX(CAM[index])
set CAMY[index]=CameraSetupGetDestPositionY(CAM[index])
set index=index+1
exitwhen index==15
endloop
set index=0
loop
set customCAM[index] = CreateCameraSetup( )
set customCAMrotatereal[index]=CameraSetupGetField(customCAM[index],CAMERA_FIELD_ROTATION)
set customCAManglereal[index]=CameraSetupGetField(customCAM[index],CAMERA_FIELD_ANGLE_OF_ATTACK)
set customCAMdistancereal[index]=CameraSetupGetField(customCAM[index],CAMERA_FIELD_TARGET_DISTANCE)
set index=index+1
exitwhen index==11
endloop
set ICON[0] = "ReplaceableTextures\\CommandButtons\\BTNHeroDemonHunter.blp"
set ICON[1] = "ReplaceableTextures\\CommandButtons\\BTNInfernal.blp"
set ICON[2] = "ReplaceableTextures\\CommandButtons\\BTNInfernalFlameCannon.blp"
set ICON[3] = "ReplaceableTextures\\CommandButtons\\BTNEredarWarlockPurple.blp"
set ICON[4] = "ReplaceableTextures\\CommandButtons\\BTNGrizzlyBear.blp"
set ICON[5] = "ReplaceableTextures\\CommandButtons\\BTNCritterChicken.blp"
set ICON[6] = "ReplaceableTextures\\CommandButtons\\BTNSpinyCrab.blp"
set ICON[7] = "ReplaceableTextures\\CommandButtons\\BTNWolf.blp"
set ICON[8] = "ReplaceableTextures\\CommandButtons\\BTNHex.blp"
set ICON[9] = "ReplaceableTextures\\CommandButtons\\BTNPenguin.blp"
set ICON[10] = "ReplaceableTextures\\CommandButtons\\BTNPig.blp"
set ICON[11] = "ReplaceableTextures\\CommandButtons\\BTNCritterRabbit.blp"
set ICON[12] = "ReplaceableTextures\\CommandButtons\\BTNRacoon.blp"
set ICON[13] = "ReplaceableTextures\\CommandButtons\\BTNx.blp"
set ICON[14] = "ReplaceableTextures\\CommandButtons\\BTNGreenHydra.blp"
set ICON[15] = "ReplaceableTextures\\CommandButtons\\BTNDoomGuard.blp"
set ICON[16] = "ReplaceableTextures\\CommandButtons\\BTNPurpleFelhound.blp"
set ICON[17] = "ReplaceableTextures\\CommandButtons\\BTNKeeperGhostBlue.blp"
set ICON[18] = "ReplaceableTextures\\CommandButtons\\BTNPitLord.blp"
set ICON[19] = "ReplaceableTextures\\CommandButtons\\BTNDemoness.blp"
set ICON[20] = "ReplaceableTextures\\CommandButtons\\BTNCorruptedEnt.blp"
set ICON[21] = "ReplaceableTextures\\CommandButtons\\BTNArchimonde.blp"
set ICON[22] = "ReplaceableTextures\\CommandButtons\\BTNHeroDreadLord.blp"
set ICON[23] = "ReplaceableTextures\\CommandButtons\\BTNChaosWarlock.blp"
set ICON[24] = "ReplaceableTextures\\CommandButtons\\BTNRunnerM.blp"
set ICON[25] = "ReplaceableTextures\\CommandButtons\\BTNShade.blp"
set ICON[26] = "ReplaceableTextures\\CommandButtons\\BTNFelBoar.blp"
set ICON[27] = "ReplaceableTextures\\CommandButtons\\BTNRunnerP.blp"
set ICON[28] = "ReplaceableTextures\\CommandButtons\\BTNRunnerQ.blp"
set ICON[29] = "ReplaceableTextures\\CommandButtons\\BTNRunnerR.blp"
set ICON[30] = "ReplaceableTextures\\CommandButtons\\BTNFelHound.blp"
set ICON[31] = "ReplaceableTextures\\CommandButtons\\BTNFelGuard.blp"
set ICON[32] = "ReplaceableTextures\\CommandButtons\\BTNChaosWolfRider.blp"
set ICON[33] = "ReplaceableTextures\\CommandButtons\\BTNGhostMage.blp"
set ICON[34] = "ReplaceableTextures\\CommandButtons\\BTNRunnerW.blp"
set ICON[35] = "ReplaceableTextures\\CommandButtons\\BTNVoidWalker.blp"
set ICON[36] = "ReplaceableTextures\\CommandButtons\\BTNUnbroken.blp"
set ICON[37] = "ReplaceableTextures\\CommandButtons\\BTNRunnerZ.blp"
set ICON[38] = "ReplaceableTextures\\CommandButtons\\BTNDemonHunterChampion.blp"
set ICON[39] = "ReplaceableTextures\\CommandButtons\\BTNDemonHunterMage.blp"
set ICON[40] = "ReplaceableTextures\\CommandButtons\\BTNDarkDemonHunter.blp"
set ICON[41] = "ReplaceableTextures\\CommandButtons\\BTNDemonHunterDruid.blp"
set ICON[42] = "ReplaceableTextures\\CommandButtons\\BTNAncientWarrior.blp"
set ICON[43] = "ReplaceableTextures\\CommandButtons\\BTNDemonSlayer.blp"
set ICON[44] = "ReplaceableTextures\\CommandButtons\\BTNBloodElfDemonHunter.blp"
set ICON[45] = "ReplaceableTextures\\CommandButtons\\BTNBeastMaster.blp"
set ICON[46] = "ReplaceableTextures\\CommandButtons\\BTNThrall.blp"
set ICON[47] = "ReplaceableTextures\\CommandButtons\\BTNFireBrewmaster.blp"
set ICON[48] = "ReplaceableTextures\\CommandButtons\\BTNMurlocNightCrawler.blp"
set SPECIALCRITTER[2]='nalb'
set SPECIALCRITTER[3]='nech'
set SPECIALCRITTER[4]='ncrb'
set SPECIALCRITTER[5]='ndog'
set SPECIALCRITTER[6]='ndwm'
set SPECIALCRITTER[7]='nfbr'
set SPECIALCRITTER[8]='nfro'
set SPECIALCRITTER[9]='necr'
set SPECIALCRITTER[11]='nrac'
set RANDOMTIP[0] = "|cff32cd32Random Tip #1: There is a lot more to this game than one might think at first. It is not your average Tag Map. It is the Best Tag Map!"
set RANDOMTIP[1] = "|cff32cd32Random Tip #2: The maker of this game is also developing now a more advanced game called The Ancient Frontier. Try to be one of the first to play it when it goes on battle.net!"
set RANDOMTIP[2] = "|cff32cd32Random Tip #3: Use your Runner Servant to keep an eye on the middle, or some other important area."
set RANDOMTIP[3] = "|cff32cd32Random Tip #4: Do not forget to build plenty of scout towers if the enemy has a Chaser A or a Chaser D! Those have invisibility skills."
set RANDOMTIP[4] = "|cff32cd32Random Tip #5: Remember to trade in lesser items at your wall shops in the middle of the map and to buy better items there."
set RANDOMTIP[5] = "|cff32cd32Random Tip #6: Remember to run away if a chaser is nearby, and use an escape ability."
set RANDOMTIP[6] = "|cff32cd32Random Tip #7: Try to pick a different runner every time, so you can find out which ones you like."
set RANDOMTIP[7] = "|cff32cd32Random Tip #8: Do not let all your wall shops be destroyed, or you will be unable to buy new items."
set RANDOMTIP[8] = "|cff32cd32Random Tip #9: If you can destroy enough wall shops, the runners can be rescued much easier."
set RANDOMTIP[9] = "|cff32cd32Random Tip #10: When the game is getting long, do not underestimate a runner that is hiding."
set RANDOMTIP[10] = "|cff32cd32Random Tip #11: Remember to get as many resources as possible so you can build a strong defensive outpost."
call ip4rantip.addInt(0, 0.15)
call ip4rantip.addInt(1, 0.1)
call ip4rantip.addInt(2, 0.3)
call ip4rantip.addInt(3, 0.23)
call ip4rantip.addInt(4, 0.2)
call ip4rantip.addInt(5, 0.2)
call ip4rantip.addInt(6, 0.5)
call ip4rantip.addInt(7, 0.3)
call ip4rantip.addInt(8, 0.18)
call ip4rantip.addInt(9, 0.16)
call ip4rantip.addInt(10, 0.4)
set RANDOMTIP[11] = "|cff32cd32Random Tip #12: Corrupted Trees of Life make very good resource centers, they can get gold and lumber, and they can run very fast! Just remember Demon Hunters earn extra bounty from killing them!"
set RANDOMTIP[12] = "|cff32cd32Random Tip #13: Runners A and X can both repick their runner."
set RANDOMTIP[13] = "|cff32cd32Random Tip #14: Try to not feed the chasers. They earn not only items but also gold and lumber from kills."
set RANDOMTIP[14] = "|cff32cd32Random Tip #15: Watch out for Runner V, he may not run as fast as the others, but he has alot of spells and can blow a chaser away with Kaboom!"
set RANDOMTIP[15] = "|cff32cd32Random Tip #16: Some of the Demons (and all of the runners) have the Wander Ability; they will randomly move like a critter if left unattended."
set RANDOMTIP[16] = "|cff32cd32Random Tip #17: Just Say 'No' To Formation Movement.|r"
set RANDOMTIP[17] = "|cff32cd32Random Tip #18: Some Hunters Have Invisibility Skills. Build Scout Towers To Detect Them!"
set RANDOMTIP[18] = "|cff32cd32Random Tip #19: Runner B is a good choice for new players. It has Magic Immunity."
set RANDOMTIP[19] = "|cff32cd32Random Tip #20: Every time you press 'Esc' you get another Random Tip."
set RANDOMTIP[20] = "|cff32cd32Random Tip #21: You can destroy the critters of the Hunters by using the same skill that you attack the critters in the middle with."
call ip4rantip.addInt(11, 0.5)
call ip4rantip.addInt(12, 0.35)
call ip4rantip.addInt(13, 0.2)
call ip4rantip.addInt(14, 0.18)
call ip4rantip.addInt(15, 0.3)
call ip4rantip.addInt(16, 0.4)
call ip4rantip.addInt(17, 0.35)
call ip4rantip.addInt(18, 0.3)
call ip4rantip.addInt(19, 0.3)
call ip4rantip.addInt(20, 0.3)
set RANDOMTIP[21] = "|cff32cd32Random Tip #22: Trees have 300 hp. Chasers can attack trees. Runners have different ways of harvesting lumber."
set RANDOMTIP[22] = "|cff32cd32Random Tip #23: Magic attacks hurt chasers more than Chaos attacks, but chasers can use Anti-Magic Potions to avoid damaage for a period of time."
set RANDOMTIP[23] = "|cff32cd32Random Tip #24: Massing a huge number of towers is always a good idea, but don't build them too close together! One Volcano Potion could destroy them all!"
set RANDOMTIP[24] = "|cff32cd32Random Tip #25: There is one chaser with shadow meld, another with permanent invisibility, and another with windwalk. Don't forget to Build Scout towers so that you can see them!!"
set RANDOMTIP[25] = "|cff32cd32Random Tip #26: If you're not sure if an invisible chaser is shopping at the middle, set up a scout tower or a chaos owl or a watchtower."
set RANDOMTIP[26] = "|cff32cd32Random Tip #27: There are only two ways to rescue runners; the rescue ally bolt that every runner has, or use a watchtower to attack the critter."
set RANDOMTIP[27] = "|cff32cd32Random Tip #28: Watchtowers can be used to destroy the flying critters of the chasers, and you can use your rescue ally bolt to do that also."
set RANDOMTIP[28] = "|cff32cd32Random Tip #29: Remember, runners, if you die, you can be revived by another runner if the critter with your name on it dies."
set RANDOMTIP[29] = "|cff32cd32Random Tip #30: Chasers will not revive if they die. Always look for another way if the outpost looks dangerous."
set RANDOMTIP[30] = "|cff32cd32Random Tip #31: If a runner outpost is giving you trouble, go find a weaker target to hit, and trade for some items to help you break the defenses."
set RANDOMTIP[31] = "|cff32cd32Random Tip #32: You can't really have enough pig farms, the more you get, the more cash you get."
call ip4rantip.addInt(21, 0.43)
call ip4rantip.addInt(22, 0.52)
call ip4rantip.addInt(23, 0.4)
call ip4rantip.addInt(24, 0.27)
call ip4rantip.addInt(25, 0.32)
call ip4rantip.addInt(26, 0.26)
call ip4rantip.addInt(27, 0.24)
call ip4rantip.addInt(28, 0.43)
call ip4rantip.addInt(29, 0.5)
call ip4rantip.addInt(30, 0.43)
call ip4rantip.addInt(31, 0.31)
set RANDOMTIP[32] = "|cff32cd32Random Tip #33: Runners, don't stay in one place for too long unless you need to make a stand. Early on in the game setup as many mining operations as possible."
set RANDOMTIP[33] = "|cff32cd32Random Tip #34: You may want to station a mechanical critter at your wall shops since the wall shops will not give you vision during the day time."
set RANDOMTIP[34] = "|cff32cd32Random Tip #35: Call your friends together for the next Demon Hunting Season."
set RANDOMTIP[35] = "|cff32cd32Random Tip #36: Press F8 to scroll through your idle workers. Your runner is also a worker."
set RANDOMTIP[36] = "|cff32cd32Random Tip #37: There is a Wild Runner Servant on the map giving vision to the runners. It cannot be killed, and provides truesight vision with a range of 1500 during the day, and 150 at night."
set RANDOMTIP[37] = "|cff32cd32Random Tip #38: There is a Wild Fairie Dragon on the map giving vision to the chasers. It cannot be killed, and provides vision with a range of 150 at night."
set RANDOMTIP[38] = "|cff32cd32Random Tip #39: When setting up a new outpost, decide whether you want to summon gathering centers and move on, or build a defensive position. Many new players stick around at their first outposts and get killed too early! Remember, that unit is called a 'Runner' for a reason!"
set RANDOMTIP[39] = "|cff32cd32Random Tip #40: At the middle of the map items might appear next to the shops. That means chasers are shopping there. Items do not appear in chaser inventories when purchased. This is a clue that a sneaky chaser is at the middle of the map if you do not see the chaser otherwise."
set RANDOMTIP[40] = "|cff32cd32Random Tip #41: It might be a lot quicker than you think for a Demon Hunter to bite the dust if he's not careful. Analyze the Runner defenses, if there are any. Remember Magic Damage deals twice the damage that Chaos Damage deals. Antimagic Potions are a must sometimes to siege some bases."
set RANDOMTIP[41] = "|cff32cd32Random Tip #42: Various Runner Buildings will disappear when the Runner building them has been destroyed. Remember sometimes it's better to ignore Runner Defenses and go straight for the Runner Kill."
set RANDOMTIP[42] = "|cff32cd32Random Tip #43: Check hiveworkshop.com and epicwar.com for the latest version of the map. Fun new changes are always coming, and feedback at hiveworkshop.com is also welcome."
call ip4rantip.addInt(32, 0.5)
call ip4rantip.addInt(33, 0.35)
call ip4rantip.addInt(34, 0.2)
call ip4rantip.addInt(35, 0.22)
call ip4rantip.addInt(36, 0.2)
call ip4rantip.addInt(37, 0.2)
call ip4rantip.addInt(38, 0.3)
call ip4rantip.addInt(39, 0.3)
call ip4rantip.addInt(40, 0.5)
call ip4rantip.addInt(41, 0.4)
call ip4rantip.addInt(42, 0.3)
set earngold5[0]=0
set earngold5[1]=0
set earngold5[10]=0
call ipgold.addInt(550000, 0.1)
call ipgold.addInt(250000, 0.6)
call ipgold.addInt(75000, 0.2)
call ipgold.addInt(50000, 2.0)
call ipgold.addInt(150000, 1.0)
call ipgold.addInt(500000000, 0.3)
set index=GetRandomInt(1,4)
if index ==1 then
placeGM(5568.0, -9472.0);placeGM(4544.0, -9856.0);placeGM(6528.0, -6784.0)
placeGM(9408.0, -7488.0);placeGM(9024.0, -9856.0);placeGM(9792.0, -3840.0)
placeGM(8000.0, -4736.0);placeGM(8704.0, -3072.0);placeGM(6080.0, -1856.0)
placeGM(7360.0, -192.0);placeGM(9088.0, 448.0);placeGM(8832.0, 1984.0)
placeGM(9280.0, 4224.0);placeGM(5952.0, 4032.0);placeGM(5824.0, 6592.0)
placeGM(8768.0, 6528.0);placeGM(8448.0, 8384.0);placeGM(2688.0, 5440.0)
placeGM(4544.0, 4032.0);placeGM(3904.0, 4608.0);placeGM(3264.0, 3776.0)
placeGM(-1152.0, 4608.0);placeGM(-3008.0, 2880.0);placeGM(-1472.0, 640.0)
placeGM(-3776.0, -2560.0);placeGM(-4160.0, -3904.0);placeGM(-8768.0, -3520.0)
placeGM(-6656.0, -64.0);placeGM(-8320.0, 1600.0);placeGM(-10048.0, 2944.0)
placeGM(-10048.0, 3584.0);placeGM(-8640.0, 4928.0);placeGM(-9536.0, 7616.0)
placeGM(-4544.0, 8896.0);placeGM(-3712.0, 7296.0);placeGM(-2944.0, 9152.0)
placeGM(1024.0, 9664.0);placeGM(-6976.0, -7168.0);placeGM(-4544.0, -7616.0)
placeGM(-5376.0, -9216.0);placeGM(-3648.0, -8768.0);placeGM(-640.0, -7040.0)
placeGM(-640.0, -8448.0);placeGM(1088.0, -7744.0);placeGM(2560.0, -7680.0)
placeGM(1792.0, -3904.0);placeGM(3840.0, -5760.0);placeGM(2944.0, -2816.0)
placeGM(3648.0, 2240.0);placeGM(-3200.0, 4800.0);placeGM(704.0, 4288.0)
placeGM(768.0, 6144.0);placeGM(-5312.0, -5568.0);placeGM(-3584.0, 704.0)
placeGM(-6080.0, 4224.0)
elseif index==2 then
placeGM(-2688.0, 9024.0);placeGM(768.0, -7360.0);placeGM(-5568.0, -9280.0)
placeGM(-9472.0, -9856.0);placeGM(-9856.0, 9856.0);placeGM(-7744.0, 1920.0)
placeGM(9728.0, -8192.0);placeGM(5760.0, -2816.0);placeGM(4096.0, 4608.0)
placeGM(4608.0, 4096.0);placeGM(3584.0, 4608.0);placeGM(4608.0, 3584.0)
placeGM(-512.0, 5376.0);placeGM(3584.0, -1920.0);placeGM(3072.0, -640.0)
placeGM(-1856.0, -3584.0);placeGM(-1024.0, -4096.0);placeGM(-5824.0, 3264.0)
placeGM(-3648.0, 3648.0);placeGM(-3200.0, 2816.0);placeGM(-4288.0, -2752.0)
placeGM(-3776.0, -3584.0);placeGM(9984.0, -9408.0);placeGM(512.0, 2304.0)
placeGM(2688.0, 2752.0);placeGM(1600.0, -3904.0);placeGM(2496.0, -4288.0)
placeGM(7744.0, -3136.0);placeGM(8000.0, -4672.0);placeGM(7744.0, 1600.0)
placeGM(8512.0, 5120.0);placeGM(10048.0, 9856.0);placeGM(-7104.0, -6912.0)
placeGM(3392.0, -8384.0);placeGM(-4608.0, -9472.0);placeGM(-8064.0, -2816.0)
placeGM(2240.0, 7360.0);placeGM(5440.0, 8000.0);placeGM(-1024.0, -6272.0)
placeGM(6528.0, -4864.0);placeGM(1664.0, 9984.0);placeGM(-9280.0, 3328.0)
placeGM(-9856.0, -640.0);placeGM(-4672.0, -7296.0);placeGM(-1280.0, 704.0)
placeGM(-1344.0, -2048.0);placeGM(1664.0, 576.0);placeGM(-192.0, -2240.0)
placeGM(-8960.0, 8256.0);placeGM(-9984.0, -2560.0);placeGM(4864.0, 1408.0)
placeGM(6208.0, -9984.0);placeGM(5824.0, -6976.0);placeGM(9344.0, 576.0)
placeGM(-6528.0, 5632.0)
elseif index==3 then
placeGM(-9920.0, 10112.0);placeGM(-8256.0, 10176.0);placeGM(-5888.0, 9984.0)
placeGM(-4160.0, 8960.0);placeGM(-7936.0, 2432.0);placeGM(-6400.0, -128.0)
placeGM(-3648.0, 3648.0);placeGM(-3200.0, 4800.0);placeGM(-1216.0, 5504.0)
placeGM(-384.0, 3712.0);placeGM(-1344.0, 7936.0);placeGM(-2944.0, 8832.0)
placeGM(1408.0, 9728.0);placeGM(2688.0, 9984.0);placeGM(3392.0, 5504.0)
placeGM(4032.0, 4608.0);placeGM(1920.0, 4864.0);placeGM(832.0, 4160.0)
placeGM(3456.0, 3328.0);placeGM(6144.0, 3648.0);placeGM(5376.0, 7424.0)
placeGM(7680.0, 7424.0);placeGM(9792.0, 8320.0);placeGM(7424.0, 10112.0)
placeGM(7168.0, 256.0);placeGM(8896.0, -128.0);placeGM(9408.0, 832.0)
placeGM(10176.0, 2688.0);placeGM(7680.0, 5504.0);placeGM(7808.0, -3136.0)
placeGM(8064.0, -4480.0);placeGM(10048.0, -9600.0);placeGM(7168.0, -8704.0)
placeGM(2496.0, -6848.0);placeGM(5376.0, -5312.0);placeGM(3264.0, -3968.0)
placeGM(384.0, -5184.0);placeGM(-320.0, -6464.0);placeGM(768.0, -7616.0)
placeGM(-640.0, -9088.0);placeGM(-2816.0, -9920.0);placeGM(-2432.0, -7872.0)
placeGM(-3776.0, -8832.0);placeGM(-6784.0, -9984.0);placeGM(-8640.0, -9792.0)
placeGM(-7232.0, -5760.0);placeGM(-5184.0, -6976.0);placeGM(-9216.0, -3456.0)
placeGM(-9664.0, -960.0);placeGM(-2688.0, -1408.0);placeGM(-768.0, -3712.0)
placeGM(3648.0, -1472.0);placeGM(-1216.0, 832.0);placeGM(5248.0, 1600.0)
placeGM(7232.0, 1920.0)
else
placeGM(128.0, 8064.0);placeGM(-5312.0, -5504.0);placeGM(-8704.0, -3584.0)
placeGM(-4928.0, -2688.0);placeGM(-7424.0, -7680.0);placeGM(-9536.0, -9728.0)
placeGM(-6336.0, -8704.0);placeGM(-3712.0, -8704.0);placeGM(-1792.0, -6464.0)
placeGM(-3776.0, -3648.0);placeGM(-128.0, -3648.0);placeGM(960.0, -2240.0)
placeGM(7168.0, 192.0);placeGM(5248.0, 1600.0);placeGM(2560.0, 4288.0)
placeGM(2688.0, 2752.0);placeGM(4032.0, 5824.0);placeGM(2240.0, 7296.0)
placeGM(7040.0, 9792.0);placeGM(5632.0, 8000.0);placeGM(10176.0, 6656.0)
placeGM(6528.0, 5248.0);placeGM(8576.0, 704.0);placeGM(704.0, -7296.0)
placeGM(1024.0, -7808.0);placeGM(3712.0, -5184.0);placeGM(2688.0, -4352.0)
placeGM(1664.0, -3904.0);placeGM(9664.0, -3712.0);placeGM(7872.0, -3008.0)
placeGM(8512.0, 5056.0);placeGM(9152.0, 4416.0);placeGM(7680.0, 5440.0)
placeGM(-3072.0, 9600.0);placeGM(-2880.0, 8960.0);placeGM(-10048.0, 7936.0)
placeGM(-9472.0, 7616.0);placeGM(-8960.0, 7552.0);placeGM(-8320.0, 896.0)
placeGM(-6848.0, 896.0);placeGM(-7808.0, 1792.0);placeGM(-768.0, -8576.0)
placeGM(-128.0, -9088.0);placeGM(-3008.0, 2880.0);placeGM(-3584.0, 4608.0)
placeGM(-3904.0, 7360.0);placeGM(-5760.0, 4352.0);placeGM(-5120.0, 1728.0)
placeGM(-1408.0, 704.0);placeGM(1216.0, 4672.0);placeGM(-1088.0, 5184.0)
placeGM(-1664.0, 7680.0);placeGM(6080.0, -3264.0);placeGM(6208.0, -6656.0)
placeGM(9664.0, -7936.0)
endif
set x=CreateUnit(y, 'nhmc', -1346.0, 6887.3, -80.413 )
set x=CreateUnit(y, 'nsc2', 3961.6, 8773.4, 244.156 )
set x=CreateUnit(y, 'nsc2', 4622.4, 8762.1, 240.671 )
set x=CreateUnit(y, 'nsc2', 5394.3, 8909.0, 237.355 )
set x=CreateUnit(y, 'ubdr', 10002.6, 4219.3, 201.671 )
set x=CreateUnit(y, 'etrs', 2760.6, 8512.9, 250.421 )
set x=CreateUnit(y, 'nsno', 8848.4, 4550.2, 205.852 )
set x=CreateUnit(y, 'nsno', 7952.0, 5067.2, 211.010 )
set x=CreateUnit(y, 'nsno', 7527.3, 4383.6, 208.623 )
set x=CreateUnit(y, 'nsno', 8180.1, 4483.2, 207.255 )
set x=CreateUnit(y, 'nsno', -10003.4, -8897.2, 42.767 )
set x=CreateUnit(y, 'nvul', -9914.8, -9204.3, 43.980 )
set x=CreateUnit(y, 'nvul', 3218.3, -1934.5, 148.564 )
set x=CreateUnit(y, 'nsno', 3747.8, -2327.7, 147.836 )
set x=CreateUnit(y, 'nsno', 8722.7, 3921.5, 202.830 )
set x=CreateUnit(y, 'nsno', 9067.0, 3580.1, 200.231 )
set x=CreateUnit(y, 'nsno', 9376.8, 3386.0, 198.593 )
set x=CreateUnit(y, 'nvul', 8393.3, 4139.1, 204.815 )
set x=CreateUnit(y, 'nvul', 8856.0, 3640.8, 200.998 )
set x=CreateUnit(y, 'nvul', 9146.6, 3337.0, 198.749 )
set x=CreateUnit(y, 'nvul', 5071.0, 9327.0, 240.051 )
set x=CreateUnit(y, 'nvul', 5003.2, 8811.4, 238.925 )
set x=CreateUnit(y, 'nvul', 5601.4, 9235.8, 237.365 )
set x=CreateUnit(y, 'nvul', 5561.0, 8525.8, 235.398 )
set x=CreateUnit(y, 'nsno', -9633.0, 9430.2, -44.528 )
set x=CreateUnit(y, 'nsno', -9899.8, 8722.8, -41.463 )
set x=CreateUnit(y, 'nsno', -9291.9, 8560.6, -42.764 )
set x=CreateUnit(y, 'nsno', -8348.0, 9319.3, -48.375 )
set x=CreateUnit(y, 'nsno', -7708.7, 8458.4, -47.893 )
set x=CreateUnit(y, 'nsno', 9914.6, -1293.9, 171.822 )
set x=CreateUnit(y, 'nsno', 10124.0, -1824.7, 169.122 )
set x=CreateUnit(y, 'nsno', 9643.4, -1518.6, 170.325 )
set x=CreateUnit(y, 'nsno', 10148.9, -2329.7, 166.480 )
set x=CreateUnit(y, 'nsno', 5600.7, -5374.3, 136.389 )
set x=CreateUnit(y, 'nsno', 5495.6, -4855.0, 138.679 )
set x=CreateUnit(y, 'nsno', 856.5, -8543.9, 96.984 )
set x=CreateUnit(y, 'nsno', 948.0, -8812.8, 97.352 )
set x=CreateUnit(y, 'nsno', 995.9, -9033.6, 97.471 )
set x=CreateUnit(y, 'nsno', 1152.5, -9195.1, 98.285 )
set x=CreateUnit(y, 'nsno', 1039.2, -8637.2, 98.080 )
set x=CreateUnit(y, 'nsno', 915.2, -8931.2, 97.054 )
set x=CreateUnit(y, 'nsno', 852.0, -8989.6, 96.619 )
set x=CreateUnit(y, 'nvul', 1259.9, -7019.2, 101.569 )
set x=CreateUnit(y, 'nvul', 1428.1, -7348.7, 102.304 )
set x=CreateUnit(y, 'nvul', 1543.2, -7526.7, 102.846 )
set x=CreateUnit(y, 'nvul', 1626.6, -7606.6, 103.302 )
set x=CreateUnit(y, 'nvul', 1596.8, -7268.8, 103.667 )
set x=CreateUnit(y, 'nvul', 1394.8, -6959.6, 102.700 )
set x=CreateUnit(y, 'nvul', 1206.6, -6784.0, 101.527 )
set x=CreateUnit(y, 'nvul', 1127.0, -7310.1, 100.145 )
set x=CreateUnit(y, 'nvul', 1265.7, -7522.2, 100.871 )
set x=CreateUnit(y, 'nvul', 1395.4, -7723.2, 101.508 )
set x=CreateUnit(y, 'nvul', -6090.9, -9173.0, 57.787 )
set x=CreateUnit(y, 'nvul', -4998.3, -3013.0, 33.539 )
set x=CreateUnit(y, 'nvul', -6238.7, -1350.6, 14.077 )
set x=CreateUnit(y, 'nvul', -3691.9, 4241.1, -49.521 )
set x=CreateUnit(y, 'nvul', -1839.5, 6835.7, -76.280 )
set x=CreateUnit(y, 'nvul', -1231.6, 7750.3, -82.332 )
set x=CreateUnit(y, 'nvul', -812.6, 7656.2, -85.402 )
set x=CreateUnit(y, 'nvul', -917.9, 6890.0, -83.994 )
set x=CreateUnit(y, 'nvul', -1159.0, 6957.7, -82.051 )
set x=CreateUnit(y, 'nvul', -1226.8, 6864.9, -81.374 )
set x=CreateUnit(y, 'nvul', -1187.4, 6711.5, -81.512 )
set x=CreateUnit(y, 'nvul', -1024.6, 6696.3, -82.894 )
set x=CreateUnit(y, 'nvul', -911.3, 6708.1, -83.885 )
set x=CreateUnit(y, 'nvul', -2207.3, 9372.6, -77.766 )
set x=CreateUnit(y, 'nvul', -2366.3, 9426.9, -76.899 )
set x=CreateUnit(y, 'nvul', -2253.7, 9177.1, -77.228 )
set x=CreateUnit(y, 'nvul', -2008.3, 9651.6, -79.270 )
set x=CreateUnit(y, 'nvul', -1894.7, 9172.7, -79.410 )
set x=CreateUnit(y, 'nvul', -2618.1, 8634.8, -74.135 )
set x=CreateUnit(y, 'nvul', -922.0, 9374.0, -85.580 )
set x=CreateUnit(y, 'nvul', -690.9, 8530.3, -86.711 )
set x=CreateUnit(y, 'nvul', -306.9, 8401.9, -89.326 )
set x=CreateUnit(y, 'nsno', 579.0, 9580.2, 265.213 )
set x=CreateUnit(y, 'nsno', 516.5, 8978.4, 265.290 )
set x=CreateUnit(y, 'nsno', 316.5, 8662.8, 266.457 )
set x=CreateUnit(y, 'nsno', 101.3, 4429.2, 265.829 )
set x=CreateUnit(y, 'nsno', 146.7, 3817.0, 264.428 )
set x=CreateUnit(y, 'nsno', 4512.8, 2554.3, 206.873 )
set x=CreateUnit(y, 'nsno', -7805.5, -4456.9, 31.299 )
set x=CreateUnit(y, 'nsno', -7730.9, -5323.3, 36.100 )
set x=CreateUnit(y, 'nsno', -9875.2, -148.8, 1.836 )
set x=CreateUnit(y, 'nsno', -9594.0, -2917.4, 18.162 )
set x=CreateUnit(y, 'nsno', -7665.0, -3207.3, 24.315 )
set x=CreateUnit(y, 'nsno', -6962.2, -3411.6, 27.884 )
set x=CreateUnit(y, 'nsno', 1134.5, -4270.6, 106.876 )
set x=CreateUnit(y, 'nsno', 438.8, -1774.5, 108.528 )
set x=CreateUnit(y, 'nsno', 827.9, -1520.5, 121.680 )
set x=CreateUnit(y, 'nhmc', -1129.2, 6954.2, -82.293 )
set x=CreateUnit(y, 'nskk', -746.2, 6746.4, -85.344 )
set x=CreateUnit(y, 'nskk', -3508.9, -1152.3, 21.710 )
set x=CreateUnit(y, 'nskk', -9888.7, -6625.0, 35.036 )
set x=CreateUnit(y, 'nder', 10028.2, -7593.5, 142.859 )
set x=CreateUnit(y, 'npig', -10226.8, -10231.8, 46.056 )
set x=CreateUnit(y, 'nder', -9468.3, -1282.4, 8.862 )
set x=CreateUnit(y, 'nder', -9354.5, -1169.8, 8.281 )
set x=CreateUnit(y, 'nder', -8401.9, 9146.2, -47.643 )
set x=CreateUnit(y, 'npig', -1195.8, 6861.9, -81.630 )
set x=CreateUnit(y, 'nsea', -3704.5, 6607.0, -61.536 )
set x=CreateUnit(y, 'nsea', -3629.9, 7247.2, -64.236 )
set x=CreateUnit(y, 'nsea', -6571.0, -3446.0, 29.556 )
set x=CreateUnit(y, 'nsea', 9605.2, -6310.3, 146.602 )
set x=CreateUnit(y, 'npng', -5294.6, 5928.1, -48.597 )
set x=CreateUnit(y, 'nsea', 3430.8, 1639.8, 202.105 )
set x=CreateUnit(y, 'nsea', 235.0, -5988.6, 94.138 )
set x=CreateUnit(y, 'nskk', -7178.4, -2961.4, 24.137 )
set x=CreateUnit(y, 'npig', -7246.3, -3346.8, 26.499 )
set x=CreateUnit(y, 'npig', -1775.6, -4998.0, 73.118 )
set x=CreateUnit(y, 'npig', -2127.6, -4643.6, 68.242 )
set x=CreateUnit(y, 'npig', -2751.0, -9698.2, 75.547 )
set x=CreateUnit(y, 'npig', -2504.0, -9461.5, 76.590 )
set x=CreateUnit(y, 'nhmc', 1080.2, 8515.1, 261.221 )
set x=CreateUnit(y, 'nskk', -9392.7, 5668.7, -30.954 )
set x=CreateUnit(y, 'nadk', -7118.4, 8400.1, -50.020 )
set x=CreateUnit(y, 'nsc2', 1990.2, 8818.8, 255.742 )
set x=CreateUnit(y, 'nsc2', 2682.9, 7949.3, 249.623 )
set x=CreateUnit(y, 'ngnw', -7804.3, -688.9, 6.386 )
set x=CreateUnit(y, 'npig', 466.9, -8173.2, 94.642 )
set x=CreateUnit(y, 'npig', 1063.1, -7029.7, 100.039 )
set x=CreateUnit(y, 'ngnw', -7805.7, -405.3, 4.265 )
set x=CreateUnit(y, 'ngnw', -7834.2, -1235.7, 10.382 )
set x=CreateUnit(y, 'ngnw', -7209.7, -719.0, 7.166 )
set x=CreateUnit(y, 'ngnw', -7126.1, 113.4, 0.395 )
set x=CreateUnit(y, 'ngnw', -7742.1, 495.5, -2.542 )
set x=CreateUnit(y, 'ngnw', -7546.3, 363.8, -1.582 )
set x=CreateUnit(y, 'npig', -4530.0, 6401.4, -55.306 )
set x=CreateUnit(y, 'ngnw', -8535.2, 599.9, -3.017 )
set x=CreateUnit(y, 'npig', -4306.6, 7197.3, -59.791 )
set x=CreateUnit(y, 'ngrk', -578.6, 7727.6, -87.210 )
set x=CreateUnit(y, 'ngst', -526.0, 7369.6, -87.489 )
set x=CreateUnit(y, 'ngrk', -393.1, 7543.9, -88.578 )
set x=CreateUnit(y, 'ngrk', -645.1, 7616.0, -86.659 )
set x=CreateUnit(y, 'nrat', 9561.3, 7251.2, 215.965 )
set x=CreateUnit(y, 'nrat', 9383.7, 7460.9, 217.268 )
set x=CreateUnit(y, 'nrat', 9831.4, 7503.2, 216.174 )
set x=CreateUnit(y, 'nrat', 9946.0, 7816.5, 217.009 )
set x=CreateUnit(y, 'nrat', 10012.7, 7578.9, 215.965 )
set x=CreateUnit(y, 'nrat', 10023.9, 7396.0, 215.259 )
set x=CreateUnit(y, 'nrat', 9353.8, 7584.0, 217.817 )
set x=CreateUnit(y, 'nrat', 9636.2, 8029.4, 218.629 )
set x=CreateUnit(y, 'nrat', 9785.5, 7953.8, 217.941 )
set x=CreateUnit(y, 'nrat', 9853.8, 7599.4, 216.469 )
set x=CreateUnit(y, 'nrat', 10014.9, 8247.1, 218.338 )
set x=CreateUnit(y, 'nrat', 9883.0, 7063.8, 214.369 )
set x=CreateUnit(y, 'nrat', 9947.2, 7144.9, 214.511 )
set x=CreateUnit(y, 'npig', 8353.9, -2270.4, 164.149 )
set x=CreateUnit(y, 'nspb', -5812.3, 2905.3, -26.097 )
set x=CreateUnit(y, 'nspb', -6111.1, 3532.0, -29.736 )
set x=CreateUnit(y, 'npng', 8144.1, -1516.6, 168.644 )
set x=CreateUnit(y, 'nspg', -5576.2, 3528.3, -32.107 )
set x=CreateUnit(y, 'n002', -10088.1, -3434.5, 20.001 )
set x=CreateUnit(y, 'npng', 9947.5, 2959.3, 195.402 )
set x=CreateUnit(y, 'n002', -10182.7, -3109.2, 18.156 )
set x=CreateUnit(y, 'n002', -9801.4, -3441.8, 20.588 )
set x=CreateUnit(y, 'n002', 964.4, 4741.5, 255.621 )
set x=CreateUnit(y, 'n002', 1687.3, 5240.2, 249.518 )
set x=CreateUnit(y, 'n002', 3528.5, 5399.8, 234.488 )
set x=CreateUnit(y, 'npng', -6534.8, -7196.9, 49.318 )
set x=CreateUnit(y, 'npng', -8512.8, -5959.7, 36.397 )
set x=CreateUnit(y, 'n002', 2324.6, 5585.4, 244.956 )
set x=CreateUnit(y, 'n002', 6302.4, 4842.9, 215.713 )
set x=CreateUnit(y, 'n002', 6316.3, 3534.0, 207.331 )
set x=CreateUnit(y, 'n002', 6490.9, 5677.1, 219.460 )
set x=CreateUnit(y, 'n002', 4445.4, -3029.8, 145.572 )
set x=CreateUnit(y, 'n002', 5751.8, -3222.4, 150.423 )
set x=CreateUnit(y, 'n002', 6553.5, -5477.9, 140.180 )
set x=CreateUnit(y, 'n002', -10194.0, 1262.2, -6.293 )
set x=CreateUnit(y, 'n002', -7273.3, 9902.9, -54.056 )
set x=CreateUnit(y, 'n003', 4290.9, -8689.9, 116.954 )
set x=CreateUnit(y, 'n003', -9463.6, -6929.6, 37.462 )
set x=CreateUnit(y, 'n003', -8390.1, -7159.5, 41.826 )
set x=CreateUnit(y, 'n003', -8209.3, -7058.3, 42.066 )
set x=CreateUnit(y, 'n003', -7660.7, -7642.3, 46.324 )
set x=CreateUnit(y, 'n003', -7479.2, -7530.1, 46.615 )
set x=CreateUnit(y, 'n003', -7921.9, -8417.7, 48.046 )
set x=CreateUnit(y, 'n003', -7288.6, -8647.2, 51.213 )
set x=CreateUnit(y, 'n003', -4429.8, -5267.8, 52.142 )
set x=CreateUnit(y, 'n003', -5037.4, -5153.5, 47.750 )
set x=CreateUnit(y, 'n003', -4614.2, -3793.6, 41.921 )
set x=CreateUnit(y, 'n004', 1381.2, 8257.2, 258.881 )
set x=CreateUnit(y, 'n004', 1536.3, 8180.9, 257.717 )
set x=CreateUnit(y, 'n004', 1756.2, 8744.9, 257.099 )
set x=CreateUnit(y, 'n004', 1418.4, 7913.7, 258.138 )
set x=CreateUnit(y, 'n004', 2256.1, 8934.2, 254.300 )
set x=CreateUnit(y, 'n004', 2237.9, 9166.3, 254.793 )
set x=CreateUnit(y, 'n004', 2543.7, 8971.4, 252.644 )
set x=CreateUnit(y, 'n004', 2984.3, 9291.5, 250.718 )
set x=CreateUnit(y, 'n004', 3110.6, 9192.0, 249.812 )
set x=CreateUnit(y, 'n004', 3157.2, 9340.6, 249.857 )
set x=CreateUnit(y, 'n004', 3606.2, 9272.9, 247.276 )
set x=CreateUnit(y, 'n004', 3788.5, 9142.6, 246.002 )
set x=CreateUnit(y, 'n004', 3906.5, 9025.0, 245.089 )
set x=CreateUnit(y, 'n004', 4069.1, 9326.2, 244.973 )
set x=CreateUnit(y, 'n004', 4403.9, 9440.4, 243.563 )
set x=CreateUnit(y, 'n004', 4683.9, 8901.2, 240.755 )
set x=CreateUnit(y, 'n004', 4545.0, 8546.3, 240.444 )
set x=CreateUnit(y, 'n004', 4243.9, 8473.6, 241.818 )
set x=CreateUnit(y, 'n004', 4111.6, 8511.6, 242.638 )
set x=CreateUnit(y, 'n004', 5801.7, 8636.5, 234.652 )
set x=CreateUnit(y, 'n004', 5901.9, 8672.3, 234.318 )
set x=CreateUnit(y, 'n004', 5983.0, 8609.0, 233.756 )
set x=CreateUnit(y, 'n004', 5831.9, 8481.0, 234.013 )
set x=CreateUnit(y, 'n004', 6069.9, 8733.1, 233.774 )
set x=CreateUnit(y, 'n004', 5938.5, 8404.7, 233.283 )
set x=CreateUnit(y, 'n004', 5992.3, 8503.9, 233.372 )
set x=CreateUnit(y, 'n004', 6063.1, 9308.9, 235.560 )
set x=CreateUnit(y, 'nske', 2932.0, 6181.0, 242.439 )
set x=CreateUnit(y, 'nske', 3585.5, 5822.4, 236.161 )
set x=CreateUnit(y, 'nske', 4707.5, 4931.6, 224.131 )
set x=CreateUnit(y, 'nske', -10021.5, -8764.5, 42.293 )
set x=CreateUnit(y, 'nske', -10009.2, -9893.3, 45.736 )
set x=CreateUnit(y, 'nske', -9949.6, -9757.7, 45.522 )
set x=CreateUnit(y, 'nske', -2002.5, 8802.5, -78.281 )
set x=CreateUnit(y, 'nske', -1789.1, 8785.9, -79.624 )
set x=CreateUnit(y, 'nske', -1889.6, 8603.0, -78.747 )
set x=CreateUnit(y, 'nske', -737.9, 9694.7, -86.830 )
set x=CreateUnit(y, 'nske', -223.3, 8603.6, -89.909 )
set x=CreateUnit(y, 'nske', 6.6, 8799.5, 268.565 )
set x=CreateUnit(y, 'nske', 352.8, 10061.6, 266.747 )
set x=CreateUnit(y, 'nske', 294.4, 9113.6, 266.776 )
set x=CreateUnit(y, 'nske', 2966.7, -1584.0, 151.217 )
set x=CreateUnit(y, 'nske', 3287.5, -2127.6, 146.799 )
set x=CreateUnit(y, 'nske', 6485.1, 825.9, 185.670 )
set x=CreateUnit(y, 'nske', 6643.3, 338.3, 181.481 )
set x=CreateUnit(y, 'nske', 6810.3, 247.5, 180.705 )
set x=CreateUnit(y, 'nske', 7036.7, 599.8, 183.464 )
set x=CreateUnit(y, 'nske', 6294.6, 292.2, 181.154 )
set x=CreateUnit(y, 'nske', 6435.9, 46.0, 179.008 )
set x=CreateUnit(y, 'nske', 6664.7, -104.2, 177.789 )
set x=CreateUnit(y, 'nske', 8575.5, 2508.0, 194.956 )
set x=CreateUnit(y, 'nske', 8633.7, 2450.6, 194.514 )
set x=CreateUnit(y, 'nske', 8669.5, 2407.7, 194.198 )
set x=CreateUnit(y, 'nske', 8739.1, 2358.8, 193.797 )
set x=CreateUnit(y, 'nske', 8842.7, 2302.3, 193.307 )
set x=CreateUnit(y, 'nske', 8943.0, 2236.9, 192.778 )
set x=CreateUnit(y, 'nske', 5690.1, 7050.4, 229.423 )
set x=CreateUnit(y, 'nske', 5836.3, 7035.9, 228.669 )
set x=CreateUnit(y, 'nske', 5237.7, 7280.5, 232.578 )
set x=CreateUnit(y, 'nske', 5180.2, 6888.3, 231.297 )
set x=CreateUnit(y, 'nske', 4828.3, 7210.1, 234.445 )
set x=CreateUnit(y, 'nske', 543.3, 7086.1, 263.793 )
set x=CreateUnit(y, 'nske', 643.0, 7465.5, 263.340 )
set x=CreateUnit(y, 'nske', -9899.8, 4102.5, -22.134 )
set x=CreateUnit(y, 'nske', -9503.7, 4793.6, -26.494 )
set x=CreateUnit(y, 'nske', 485.3, -5804.3, 96.647 )
set x=CreateUnit(y, 'nske', -202.1, -5229.7, 90.083 )
set x=CreateUnit(y, 'nske', 1483.6, -6123.8, 105.081 )
set x=CreateUnit(y, 'nshe', 3289.7, -7229.9, 115.337 )
set x=CreateUnit(y, 'nske', 2352.7, -4515.2, 118.722 )
set x=CreateUnit(y, 'nske', 3148.3, -5514.6, 120.612 )
set x=CreateUnit(y, 'nske', -7643.3, -9817.0, 53.315 )
set x=CreateUnit(y, 'narg', 8830.6, 8070.3, 221.181 )
set x=CreateUnit(y, 'narg', -588.3, -7064.9, 87.003 )
set x=CreateUnit(y, 'nske', -6475.0, 1488.9, -11.965 )
set x=CreateUnit(y, 'nske', -5698.1, 1177.9, -10.495 )
set x=CreateUnit(y, 'nske', -5652.5, 845.4, -7.166 )
set x=CreateUnit(y, 'nske', -5793.4, 319.1, -1.621 )
set x=CreateUnit(y, 'nske', -6191.4, -140.4, 2.886 )
set x=CreateUnit(y, 'nske', -6068.6, 82.4, 0.770 )
set x=CreateUnit(y, 'ngnw', -4510.7, 6210.1, -54.587 )
set x=CreateUnit(y, 'ngnw', -4284.0, 6137.1, -55.716 )
set x=CreateUnit(y, 'ngnw', -3922.8, 6574.4, -59.932 )
set x=CreateUnit(y, 'ngnw', -3908.2, 6846.3, -61.048 )
set x=CreateUnit(y, 'ngnw', -4098.1, 7089.3, -60.698 )
set x=CreateUnit(y, 'n005', -5594.3, -6438.4, 50.790 )
set x=CreateUnit(y, 'n005', -6384.4, -6254.1, 46.095 )
set x=CreateUnit(y, 'n005', -7370.3, -6399.2, 42.496 )
set x=CreateUnit(y, 'n005', -8039.3, -6564.7, 40.664 )
set x=CreateUnit(y, 'n005', -8521.6, -6024.3, 36.656 )
set x=CreateUnit(y, 'n005', 10046.4, -10145.6, 134.860 )
set x=CreateUnit(y, 'n005', 9707.2, 72.7, 179.489 )
set x=CreateUnit(y, 'n005', -2869.6, 5523.8, -63.621 )
set x=CreateUnit(y, 'n005', -2405.7, 5274.3, -66.759 )
set x=CreateUnit(y, 'n005', -2395.6, 4948.7, -65.462 )
set x=CreateUnit(y, 'n005', -3184.6, 4369.0, -54.742 )
set x=CreateUnit(y, 'n005', -3624.9, 4795.8, -53.616 )
set x=CreateUnit(y, 'n005', -4275.3, 5271.5, -51.497 )
set x=CreateUnit(y, 'n005', -3838.1, 5656.6, -56.567 )
set x=CreateUnit(y, 'n005', -3593.3, 6071.7, -60.212 )
set x=CreateUnit(y, 'n005', -3742.6, 6748.6, -61.796 )
set x=CreateUnit(y, 'n005', 8498.8, 7093.3, 218.520 )
set x=CreateUnit(y, 'n005', 9013.4, 7095.3, 216.936 )
set x=CreateUnit(y, 'n005', 9698.5, 4949.2, 205.791 )
set x=CreateUnit(y, 'n005', 10116.1, 4811.3, 204.244 )
set x=CreateUnit(y, 'n005', 9693.1, 4653.5, 204.401 )
set y=Player(0)
set x=CreateUnit(y, 'nfnp', 3200.0, -8000.0, 270.000 )
set x=CreateUnit(y, 'otrb', 288.0, -544.0, 270.000 )
set x=CreateUnit(y, 'otrb', -480.0, -928.0, 270.000 )
set x=CreateUnit(y, 'o000', -480.0, -352.0, 270.000 )
set x=CreateUnit(y, 'o000', 96.0, -928.0, 270.000 )
set x=CreateUnit(y, 'o000', 96.0, -160.0, 270.000 )
set y=Player(1)
set x=CreateUnit(y, 'zmar', -3140.9, 3540.5, 310.936 )
set x=CreateUnit(y, 'otrb', 288.0, -928.0, 270.000 )
set x=CreateUnit(y, 'otrb', -96.0, -928.0, 270.000 )
set x=CreateUnit(y, 'nfnp', 3456.0, -8000.0, 270.000 )
set x=CreateUnit(y, 'o000', -288.0, -160.0, 270.000 )
set x=CreateUnit(y, 'o000', 288.0, -352.0, 270.000 )
set x=CreateUnit(y, 'o000', -480.0, -736.0, 270.000 )
set y=Player(10)
set x=CreateUnit(y, 'otrb', 288.0, -160.0, 270.000 )
set x=CreateUnit(y, 'otrb', -96.0, -160.0, 270.000 )
set x=CreateUnit(y, 'otrb', -480.0, -544.0, 270.000 )
set x=CreateUnit(y, 'otrb', -480.0, -160.0, 270.000 )
set x=CreateUnit(y, 'nfnp', 3712.0, -8064.0, 270.000 )
set x=CreateUnit(y, 'o000', 288.0, -736.0, 270.000 )
set x=CreateUnit(y, 'o000', -288.0, -928.0, 270.000 )
set x=CreateUnit(Player(2), 'ndmg', -896.0, -1408.0, 270.000 )
set x=CreateUnit(Player(3), 'ndmg', -1024.0, -768.0, 270.000 )
set x=CreateUnit(Player(4), 'ndmg', -896.0, -256.0, 270.000 )
set x=CreateUnit(Player(5),'ndmg', -896.0, 256.0, 270.000 )
set x=CreateUnit(Player(6),'ndmg', -128.0, 256.0, 270.000 )
set x=CreateUnit(Player(7),'ndmg', 640.0, 256.0, 270.000 )
set x=CreateUnit(Player(8),'ndmg', 896.0, -128.0, 270.000 )
set x=CreateUnit(Player(9),'ndmg', 1024.0, -896.0, 270.000 )
set x=CreateUnit(Player(11),'ndmg', -256.0, -1664.0, 270.000 )
set x=null
set y=null
set gg_snd_demonstration = CreateSound( "Units\\Undead\\Varimathras\\VarimathrasPissed8.wav", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_demonstration, "VarimathrasPissed" )
call SetSoundDuration( gg_snd_demonstration, 8906 )
call SetSoundChannel( gg_snd_demonstration, 0 )
call SetSoundPitch( gg_snd_demonstration, 1.2 )
set gg_snd_Tension = CreateSound( "Sound\\Music\\mp3Music\\Tension.mp3", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundDuration( gg_snd_Tension, 19540 )
call SetSoundChannel( gg_snd_Tension, 7 )
call SetSoundVolume( gg_snd_Tension, 60 )
call SetSoundPitch( gg_snd_Tension, 1.0 )
set gg_snd_ilaughinthefaceofdanger = CreateSound( "Units\\Creeps\\GoblinZeppelin\\GoblinZeppelinReady1.wav", false, false, true, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_ilaughinthefaceofdanger, "GoblinZeppelinReady" )
call SetSoundDuration( gg_snd_ilaughinthefaceofdanger, 4044 )
call SetSoundPitch( gg_snd_ilaughinthefaceofdanger, 1.2 )
set gg_snd_ColdSounds = CreateSound( "Sound\\Ambient\\UndeadGlueScreenLoop1.wav", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_ColdSounds, "UndeadGlueScreenLoop" )
call SetSoundDuration( gg_snd_ColdSounds, 7291 )
set gg_snd_RainAmbience = CreateSound( "Sound\\Ambient\\RainAmbience.wav", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_RainAmbience, "AmbientSoundRain" )
call SetSoundDuration( gg_snd_RainAmbience, 4418 )
set gg_snd_Vision = CreateSound( "Sound\\Dialogue\\TutorialCampaign\\Tutorial01\\T01Medivh02.mp3", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_Vision, "T01Medivh02" )
call SetSoundDuration( gg_snd_Vision, 8098 )
set gg_snd_EvilLaugh = CreateSound( "Sound\\Dialogue\\NightElfCampaign\\NightElf01\\N01Archimonde30.mp3", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundParamsFromLabel( gg_snd_EvilLaugh, "N01Archimonde30" )
call SetSoundDuration( gg_snd_EvilLaugh, 3918 )
call EnableWeatherEffect( AddWeatherEffect( Rect( -288.0, -736.0, 96.0, -352.0 ), 'MEds' ), true )
call EnableWeatherEffect( AddWeatherEffect( Rect( 4448.0, -5280.0, 7424.0, -1184.0 ), 'SNls' ), true )
call SetSoundPosition( gg_snd_ColdSounds, 5936.0, -3232.0, 0.0 )
call RegisterStackedSound( gg_snd_ColdSounds, true, 2976.0, 4096.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( 5440.0, -6816.0, 6944.0, -5344.0 ), 'SNls' ), true )
call SetSoundPosition( gg_snd_ColdSounds, 6192.0, -6080.0, 0.0 )
call RegisterStackedSound( gg_snd_ColdSounds, true, 1504.0, 1472.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( 4192.0, 96.0, 6912.0, 6368.0 ), 'SNls' ), true )
call SetSoundPosition( gg_snd_ColdSounds, 5552.0, 3232.0, 0.0 )
call RegisterStackedSound( gg_snd_ColdSounds, true, 2720.0, 6272.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( 5856.0, -9664.0, 6496.0, -6848.0 ), 'SNls' ), true )
call SetSoundPosition( gg_snd_ColdSounds, 6176.0, -8256.0, 0.0 )
call RegisterStackedSound( gg_snd_ColdSounds, true, 640.0, 2816.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( -10240.0, -10208.0, -3168.0, -5856.0 ), 'RAlr' ), true )
call SetSoundPosition( gg_snd_RainAmbience, -6704.0, -8032.0, 0.0 )
call RegisterStackedSound( gg_snd_RainAmbience, true, 7072.0, 4352.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( -10240.0, 5920.0, -4032.0, 10240.0 ), 'RAlr' ), true )
call SetSoundPosition( gg_snd_RainAmbience, -7136.0, 8080.0, 390.0 )
call RegisterStackedSound( gg_snd_RainAmbience, true, 6208.0, 4320.0 )
call EnableWeatherEffect( AddWeatherEffect( Rect( -4800.0, 1312.0, -1312.0, 4480.0 ), 'FDwh' ), true )
endfunction
function InitTrig_setvar takes nothing returns nothing
set gg_trg_setvar = CreateTrigger( )
call TriggerAddAction( gg_trg_setvar, function Trig_setvar_Actions )
endfunction
//TESH.scrollpos=72
//TESH.alwaysfold=0
scope pickmain initializer I
globals
private unitpool chaserpool=CreateUnitPool()
private unitpool runnerpool=CreateUnitPool()
endglobals
private function selfdestruct takes unit sd returns boolean
call UnitAddAbility(sd, 'A00W')
call IssueTargetOrder(sd,"transmute",GetTriggerUnit())
call UnitApplyTimedLife(sd, 'BTLF', 2.0 )
return false
endfunction
private function killhuman takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit())=='otau' and IsUnitIllusion(GetTriggerUnit())==false then
call StartSound(gg_snd_demonstration)
call msgall(15,gtc_red("oh! Player "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" registered a human for the tournament! A vampire is eating his human runner!"))
elseif GetUnitTypeId(GetTriggerUnit())=='h00B' and IsUnitIllusion(GetTriggerUnit())==false then//peasant
elseif GetUnitTypeId(GetTriggerUnit())=='hdfR' and IsUnitIllusion(GetTriggerUnit())==false then
elseif GetUnitTypeId(GetTriggerUnit())=='nvlk' and IsUnitIllusion(GetTriggerUnit())==false then
elseif GetUnitTypeId(GetTriggerUnit())=='nvk2' and IsUnitIllusion(GetTriggerUnit())==false then
elseif GetUnitTypeId(GetTriggerUnit())=='nvlw' and IsUnitIllusion(GetTriggerUnit())==false then
elseif GetUnitTypeId(GetTriggerUnit())=='nvl2' and IsUnitIllusion(GetTriggerUnit())==false then
elseif GetUnitTypeId(GetTriggerUnit())=='hvil' and IsUnitIllusion(GetTriggerUnit())==false then
else
return false
endif
call USA('A00X',1,"rejuvination",GetTriggerUnit(),GetTriggerUnit())
return false
endfunction
private function fz takes nothing returns boolean
local trigger t =null
if GetUnitTypeId(GetTriggerUnit())=='uske' then
elseif GetUnitTypeId(GetTriggerUnit())=='ufro' then
set t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple( t, 350.00,GetTriggerUnit())
call TriggerAddCondition( t, Condition(function killhuman) )
endif
return false
endfunction
private function randomeddemonmageskills takes nothing returns nothing
local integer ip = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call UnitAddItemById(RUNNER[ip], 'I000')
call UnitAddItemById(RUNNER[ip], 'I001')
endfunction
private function demonmageskills takes nothing returns nothing
call UnitAddItemById(GetTrainedUnit(), 'I000')
call UnitAddItemById(GetTrainedUnit(), 'I001')
endfunction
private function chasertagfunction takes nothing returns nothing
set CHASER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetTrainedUnit()
endfunction
private function runnertagfunction takes nothing returns nothing
set RUNNER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetTrainedUnit()
endfunction
private function randomchaser takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer ip = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call RemoveUnit(GetTrainedUnit())
set CHASER[ip] = PlaceRandomUnit(chaserpool,Player(ip),x,y,80.00)
endfunction
private function randomrunner takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer ip = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call RemoveUnit(GetTrainedUnit())
set RUNNER[ip] = PlaceRandomUnit(runnerpool,Player(ip),x,y,GetRandomReal(0.01, 360.00))
if GetUnitTypeId(RUNNER[ip]) == 'hdhw' then
call randomeddemonmageskills()
endif
endfunction
private function seticonformbi takes unit x returns boolean
local integer ip = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
if GetUnitTypeId(x) =='edot' then
call jBoard_TDHT.field(ip,1).setIconPathR(ICON[GetUnitPointValue(RUNNER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])])
return false
elseif GetUnitTypeId(x) =='edry' then
call jBoard_TDHT.field(ip,1).setIconPathR(ICON[GetUnitPointValue(CHASER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])])
return false
else
call jBoard_TDHT.field(ip,1).setIconPathR(ICON[GetUnitPointValue(x)])
return false
endif
return false
endfunction
private function rru takes nothing returns nothing
local integer ip = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call UnitAddItemById(CHASER[ip],POINT)
call RemoveUnit(GetTriggerUnit())
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(CHASER[ip], true)
endif
endfunction
private function ru takes nothing returns nothing
call UnitAddItemById(GetTrainedUnit(),POINT)
call RemoveUnit(GetTriggerUnit())
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(GetTrainedUnit(), true)
endif
endfunction
private function spawnflyer takes nothing returns nothing
call RemoveUnit(GetTriggerUnit())
if runnerSERVANT[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] == null then
set runnerSERVANT[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'nnht', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetRandomReal(0.01, 360.00))
endif
endfunction
private function selectrunnernotflyer takes nothing returns nothing
local integer ip = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(RUNNER[ip], true)
endif
endfunction
private function f takes nothing returns boolean
local integer i = GetUnitTypeId(GetTrainedUnit())
local integer it = GetUnitTypeId(GetTriggerUnit())
if it == DEMONGATEA or it == DEMONGATEB or it == DEMONGATEC then
if i == 'edot' then
call randomrunner()
call seticonformbi(GetTrainedUnit())
call spawnflyer()
call selectrunnernotflyer()
return false
elseif i == 'hdhw' then
call runnertagfunction()
call demonmageskills()
call seticonformbi(GetTrainedUnit())
call spawnflyer()
call selectrunnernotflyer()
return false
elseif i == 'otau' then
call runnertagfunction()
call seticonformbi(GetTrainedUnit())
call spawnflyer()
call selectrunnernotflyer()
return false
else
call runnertagfunction()
call seticonformbi(GetTrainedUnit())
call spawnflyer()
call selectrunnernotflyer()
return false
endif
elseif it == 'nfnp' then
if i == 'edry' then
call randomchaser()
call seticonformbi(GetTrainedUnit())
call rru()
return false
else
call chasertagfunction()
call seticonformbi(GetTrainedUnit())
call ru()
return false
endif
elseif it == 'nntt' then
if i == 'ebal' then
call selfdestruct(GetTrainedUnit())
return false
endif
return false
endif
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer i = 0
//UPadd(chaserpool,'OMUR',80);
UPadd(chaserpool,'ECHA',1);UPadd(chaserpool,'EMAG',1);UPadd(chaserpool,'EDRU',1)
UPadd(chaserpool,'EDAR',1);UPadd(chaserpool,'HDES',1);UPadd(chaserpool,'HBLO',1);UPadd(chaserpool,'HSLA',1)
UPadd(chaserpool,'HTRA',1);UPadd(chaserpool,'OWAR',1);UPadd(chaserpool,'OPAN',1)
UPadd(runnerpool,'uaco',1);UPadd(runnerpool,'ushd',1);UPadd(runnerpool,'ugho',1);UPadd(runnerpool,'uabo',1)
UPadd(runnerpool,'umtw',1);UPadd(runnerpool,'ucry',1);UPadd(runnerpool,'ugar',1);UPadd(runnerpool,'uban',1)
UPadd(runnerpool,'unec',1);UPadd(runnerpool,'uobs',1);UPadd(runnerpool,'ufro',1);UPadd(runnerpool,'hfoo',1)
UPadd(runnerpool,'hkni',1);UPadd(runnerpool,'hrif',1);UPadd(runnerpool,'hmtm',1);UPadd(runnerpool,'hgyr',1)
UPadd(runnerpool,'hgry',1);UPadd(runnerpool,'hmpr',1);UPadd(runnerpool,'hsor',1);UPadd(runnerpool,'hmtt',1)
UPadd(runnerpool,'hspt',1);UPadd(runnerpool,'hdhw',1);UPadd(runnerpool,'ogru',1);UPadd(runnerpool,'orai',1)
UPadd(runnerpool,'otau',1);UPadd(runnerpool,'ohun',1)
loop
exitwhen i>11
call TriggerRegisterPlayerUnitEvent( t, Player(i),EVENT_PLAYER_UNIT_TRAIN_FINISH, Filter(function FilterDebug) )
set i=i+1
endloop
call TriggerAddCondition( t, Condition(function f) )
set t=CreateTrigger()
call TriggerRegisterEnterRectSimple( t, GetEntireMapRect() )
call TriggerAddCondition( t, Condition(function fz) )
call XE_PreloadAbility('A00W')
call XE_PreloadAbility('A00X')
endfunction
endscope
//TESH.scrollpos=243
//TESH.alwaysfold=0
scope DeadRunnerOrChaser initializer I
globals
private unit critter=null
private integer array earngold3[12]
private itempool array poolitems[7]
group DESTROYGROUP=CreateGroup()
endglobals
private function A takes nothing returns boolean
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[0],ux,uy)
call PlaceRandomItem(poolitems[1],ux,uy)
else
call PlaceRandomItem(poolitems[2],ux,uy)
call PlaceRandomItem(poolitems[1],ux,uy)
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
return false
endfunction
private function B takes nothing returns boolean
local integer x = GetRandomInt(1,4)
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) then
call PlaceRandomItem(poolitems[1],ux,uy)
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[1],ux,uy)
endif
call PlaceRandomItem(poolitems[3],ux,uy)
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
if x==1 then
call CreateItem('I00C',ux,uy)
endif
return false
endfunction
private function C takes nothing returns boolean
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) then
call PlaceRandomItem(poolitems[4],ux,uy)
endif
return false
endfunction
private function D takes nothing returns boolean
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) then
call PlaceRandomItem(poolitems[1],ux,uy)
if GetUnitTypeId(GetDyingUnit())=='e002' then
call CreateItem('I00C',ux,uy)
endif
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[1],ux,uy)
endif
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
return false
endfunction
private function ru takes nothing returns boolean
if GetUnitTypeId(GetFilterUnit()) == 'npgf' then
call KillUnit(GetFilterUnit())
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'uzg2' then
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'uzig' then
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'hatw' then
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'hwtw' then
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'eaom' then
call RemoveUnit(GetFilterUnit())
elseif GetUnitTypeId(GetFilterUnit()) == 'etrp' then
call RemoveUnit(GetFilterUnit())
endif
return false
endfunction
private function removeall takes nothing returns nothing
local integer ipid = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
call GroupEnumUnitsOfPlayer(DESTROYGROUP, Player(ipid), Filter(function ru))
if runnerSERVANT[ipid] != null then
call RemoveUnit(runnerSERVANT[ipid])
endif
endfunction
private function EcC takes nothing returns boolean
return IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) and IsUnitIllusion(GetTriggerUnit())==false
endfunction
private function Ec takes nothing returns nothing
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
local integer pik = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetKillingUnit())))
call jBoard_TDHT.field(pik,0).addR(3)
call jBoard_TDHT.field(pi,1).setIconPathR(iconX)
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_GOLD_GATHERED, GetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_GOLD_GATHERED) + 1)
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_STATE_RESOURCE_GOLD) + 1)
if GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) == PLAYER_SLOT_STATE_PLAYING then
call msgone(180,GetOwningPlayer(GetTriggerUnit()),gtc_coralblue("You have lost your Demon Hunter. You may continue to watch your fellow Demon Hunters hunt the remaining demons. You can also ask the better players in the game for advice to do better. Thanks for playing, wish you a better game next time!"),true)
call msgone(75,GetOwningPlayer(GetTriggerUnit()),gtc_coralpink("Oh, the Disgrace! A Chaser Has Been Eliminated From the Tournament!"),false)
endif
endfunction
private function EC takes nothing returns boolean
return IsUnitType(GetTriggerUnit(),UNIT_TYPE_SAPPER) and IsUnitIllusion(GetTriggerUnit()) == false
endfunction
private function E takes nothing returns nothing
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
local integer pik = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetKillingUnit())))
local real ux = GetUnitX(GetTriggerUnit())
local real uy = GetUnitY(GetTriggerUnit())
call PlaceRandomItem(poolitems[5],ux,uy)
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[6],ux,uy)
endif
call SetItemCharges( UnitItemInSlot(GetKillingUnit(), 0), ( GetItemCharges(UnitItemInSlot(GetKillingUnit(), 0)) + 1 ) )
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(16), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(16)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(2), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(2)) + 1)
if GetKillingUnit()==CHASER[pik] then
call jBoard_TDHT.field(pi,0).addR(-1)
call jBoard_TDHT.field(pik,0).addR(1)
endif
call jBoard_TDHT.field(pi,1).setIconPathR(ICON[pi+1])
set critter=CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), SPECIALCRITTER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))], (GetRandomReal(-215.00, 50.00)), (GetRandomReal(-715.00, -420.00)), GetRandomReal(0.00,359.99))
if GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) != PLAYER_SLOT_STATE_PLAYING then
call SetUnitInvulnerable(critter,true)
endif
call removeall()
if GetKillingUnit() != null then
if GetPlayerSlotState(Player(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))) == PLAYER_SLOT_STATE_PLAYING then
call msgone(20,GetOwningPlayer(GetTriggerUnit()),gtc_brightgreen("Your runner died to "+GetPlayerName(GetOwningPlayer(GetKillingUnit()))+"!"),true)
call msgone(15,GetOwningPlayer(GetKillingUnit()),gtc_coralblue("You killed the runner of "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!"),true)
call msgall(25,gtc_brightorange(GetPlayerName(GetOwningPlayer(GetKillingUnit()))+" has killed a runner! "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" must wait for a critter to die at the middle to get another chance to play!"))
endif
endif
endfunction
private function FC takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit())==DEMONGATEA or GetUnitTypeId(GetTriggerUnit())==DEMONGATEB or GetUnitTypeId(GetTriggerUnit())==DEMONGATEC
endfunction
private function F takes nothing returns nothing
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
call jBoard_TDHT.field(pi,1).setIconPathR(ICON[pi+1])
set critter=CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), SPECIALCRITTER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))], (GetRandomReal(-215.00, 50.00)), (GetRandomReal(-715.00, -420.00)), GetRandomReal(0.00,359.99))
if GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) != PLAYER_SLOT_STATE_PLAYING then
call SetUnitInvulnerable(critter,true)
endif
call removeall()
if GetPlayerSlotState(Player(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))) == PLAYER_SLOT_STATE_PLAYING then
if GetKillingUnit()==null then
call msgone(25,GetOwningPlayer(GetTriggerUnit()),gtc_sand("The host has destroyed a demon gate! "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" must wait for a critter to die at the middle to get another chance to play!"),false)
call msgone(75,GetOwningPlayer(GetTriggerUnit()),gtc_brightorange("The host has destroyed your demon gate! You must wait for a critter to die at the middle to get another chance to play!"),true)
return
endif
call msgone(15,GetOwningPlayer(GetKillingUnit()),gtc_coralblue("You destroyed the demon gate of "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!"),true)
call msgone(55,GetOwningPlayer(GetTriggerUnit()),gtc_brightorange("Your demon gate has been destroyed by "+GetPlayerName(GetOwningPlayer(GetKillingUnit()))+"!"),true)
call msgall(25,gtc_sand(GetPlayerName(GetOwningPlayer(GetKillingUnit()))+" has destroyed a demon gate! "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" must wait for a critter to die at the middle to get another chance to play!"))
endif
return
endfunction
private function Ef takes nothing returns boolean
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) then
call PlaceRandomItem(poolitems[1],ux,uy)
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[1],ux,uy)
endif
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 2)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 2)
return false
endfunction
private function Ee takes nothing returns boolean
local real ux = GetUnitX(GetDyingUnit())
local real uy = GetUnitY(GetDyingUnit())
if GetOwningPlayer(GetKillingUnit())==Player(0) or GetOwningPlayer(GetKillingUnit())==Player(1) or GetOwningPlayer(GetKillingUnit())==Player(10) then
else
return false
endif
if GetRandomInt(1,4)==4 then
if IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) then
call PlaceRandomItem(poolitems[1],ux,uy)
if GetUnitAbilityLevel(GetKillingUnit(),'BEah') > 0 then
call PlaceRandomItem(poolitems[1],ux,uy)
endif
endif
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
return false
endfunction
private function Ed takes nothing returns boolean
local integer ip = 0
if GetOwningPlayer(GetKillingUnit()) !=null then
set ip=GetPlayerId(GetOwningPlayer(GetKillingUnit()))
else
return false
endif
set earngold3[ip]=earngold3[ip]+1
if earngold3[ip]>2 then
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
set earngold3[ip]=0
endif
return false
endfunction
private function Fc takes nothing returns boolean
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), ConvertPlayerState(15), GetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), ConvertPlayerState(15)) + 1)
call SetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), ConvertPlayerState(1), GetPlayerState(Player(bj_PLAYER_NEUTRAL_EXTRA), ConvertPlayerState(1)) + 1)
call jBoard_TDHT.field(pi,1).setIconPathR(iconX)
return false
endfunction
private function G takes nothing returns boolean
if GetUnitTypeId(GetDyingUnit())=='e001' then
if GetRandomInt(1,4)==4 then
call PlaceRandomItem(poolitems[5],GetUnitX(GetDyingUnit()),GetUnitY(GetDyingUnit()))
endif
endif
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
return false
endfunction
private function H takes nothing returns boolean
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(16), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(16)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(2), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(2)) + 1)
return false
endfunction
private function I takes nothing returns nothing
local integer loopinteger=0
local trigger t = CreateTrigger( )
trigCAdeathC(t,EcC,Ec)
set t=CreateTrigger()
trigCAdeathR(t,EC,E)
set t=CreateTrigger()
trigCAdeathR(t,FC,F)
loop
set poolitems[loopinteger]=CreateItemPool()
set loopinteger=loopinteger+1
exitwhen loopinteger>6
endloop
/*
//! runtextmacro itemswitching("'mcri'","'I00B'","a")
//! runtextmacro ammostacking("'I00D'","'mcri'","3","b")
//! runtextmacro ammostacking("'rnec'","'I00E'","4","c")
//! runtextmacro ammostacking("'I00F'","'pgma'","2","d")
//! runtextmacro itemstacking("'desc'","'I007'","a")
//! runtextmacro itemstacking("'fgsk'","'I008'","b")
//! runtextmacro itemstacking("'fgfh'","'I009'","c")
//! runtextmacro itemstacking("'pclr'","'I005'","d")
//! runtextmacro itemstacking("'pman'","'I006'","e")
//! runtextmacro itemstacking("'tgxp'","'I002'","f")
//! runtextmacro itemstacking("'pams'","'I004'","g")
//! runtextmacro itemstacking("'moon'","'I003'","h")
//! runtextmacro itemstacking("'I00C'","'whwd'","i")
*/
call ItemPoolAddItemType(poolitems[0], 'I004', 40) // Chance: 4/43
call ItemPoolAddItemType(poolitems[0], 'I00E', 60) // Chance: 6/43
call ItemPoolAddItemType(poolitems[0], 'I007', 50) // Chance: 5/43
call ItemPoolAddItemType(poolitems[0], 'I008', 60) // Chance: 6/43
call ItemPoolAddItemType(poolitems[0], 'I009', 60) // Chance: 6/43
call ItemPoolAddItemType(poolitems[0], 'pgma', 50) // Chance: 5/43
call ItemPoolAddItemType(poolitems[0], 'I005', 30) // Chance: 3/43
call ItemPoolAddItemType(poolitems[0], 'mcri', 30) // Chance: 3/43
call ItemPoolAddItemType(poolitems[0], 'I003', 20) // Chance: 2/43
call ItemPoolAddItemType(poolitems[0], 'I006', 30) // Chance: 3/43
call ItemPoolAddItemType(poolitems[1], 'I004', 10) // Chance: 1/12 potion of antimagic
call ItemPoolAddItemType(poolitems[1], 'I005', 30) // Chance: 3/12 clarity potion
call ItemPoolAddItemType(poolitems[1], 'mcri', 30) // Chance: 3/12
call ItemPoolAddItemType(poolitems[1], 'I003', 20) // Chance: 2/12 moonstone
call ItemPoolAddItemType(poolitems[1], 'I006', 30)// Chance: 3/12 potion of mana
call ItemPoolAddItemType(poolitems[2], 'I004', 10) // Chance: 1/14
call ItemPoolAddItemType(poolitems[2], 'I00E', 30) // Chance: 3/14
call ItemPoolAddItemType(poolitems[2], 'I007', 20) // Chance: 2/14
call ItemPoolAddItemType(poolitems[2], 'I008', 30) // Chance: 3/14
call ItemPoolAddItemType(poolitems[2], 'I009', 30) // Chance: 3/14
call ItemPoolAddItemType(poolitems[2], 'pgma', 20) // Chance: 2/14
call ItemPoolAddItemType(poolitems[3], 'I004', 10) // Chance: 1/19
call ItemPoolAddItemType(poolitems[3], 'I005', 40) // Chance: 4/19
call ItemPoolAddItemType(poolitems[3], 'mcri', 40) // Chance: 4/19
call ItemPoolAddItemType(poolitems[3], 'I003', 40) // Chance: 4/19
call ItemPoolAddItemType(poolitems[3], 'I006', 40) // Chance: 4/19
call ItemPoolAddItemType(poolitems[3], 'whwd', 10) // Chance: 1/19
call ItemPoolAddItemType(poolitems[3], 'I002', 10) // Chance: 1/19
call ItemPoolAddItemType(poolitems[4], 'I005', 10) // Chance: 1/4
call ItemPoolAddItemType(poolitems[4], 'mcri', 10) // Chance: 1/4
call ItemPoolAddItemType(poolitems[4], 'I003', 10) // Chance: 1/4
call ItemPoolAddItemType(poolitems[4], 'I006', 10) // Chance: 1/4
call ItemPoolAddItemType(poolitems[5], 'I004', 30) //Chance: 3/33
call ItemPoolAddItemType(poolitems[5], 'I005', 40) //Chance: 4/33
call ItemPoolAddItemType(poolitems[5], 'mcri', 40) //Chance: 4/33
call ItemPoolAddItemType(poolitems[5], 'I003', 40) //Chance: 4/33
call ItemPoolAddItemType(poolitems[5], 'I006', 40) //Chance: 4/33
call ItemPoolAddItemType(poolitems[5], 'I00E', 20) //Chance: 2/33
call ItemPoolAddItemType(poolitems[5], 'I007', 10) //Chance: 1/33
call ItemPoolAddItemType(poolitems[5], 'whwd', 30) //Chance: 3/33
call ItemPoolAddItemType(poolitems[5], 'I008', 20) //Chance: 2/33
call ItemPoolAddItemType(poolitems[5], 'I009', 20) //Chance: 2/33
call ItemPoolAddItemType(poolitems[5], 'pgma', 10) //Chance: 1/33
call ItemPoolAddItemType(poolitems[5], 'I002', 30) //Chance: 3/33
call ItemPoolAddItemType(poolitems[5], 'penr', 5)//
call ItemPoolAddItemType(poolitems[5], 'oslo', 4)//
call ItemPoolAddItemType(poolitems[5], 'stre', 3)//
call ItemPoolAddItemType(poolitems[5], 'spsh', 2)//
call ItemPoolAddItemType(poolitems[5], 'azhr', 1)//
call ItemPoolAddItemType(poolitems[6], 'azhr', 1)//
call ItemPoolAddItemType(poolitems[6], 'spsh', 2)//
call ItemPoolAddItemType(poolitems[6], 'stre', 3)//
call ItemPoolAddItemType(poolitems[6], 'penr', 5)//
call ItemPoolAddItemType(poolitems[6], 'oslo', 4)//
call ItemPoolAddItemType(poolitems[6], 'I004', 40) //Chance: 4/34
call ItemPoolAddItemType(poolitems[6], 'I005', 60) //Chance: 6/34
call ItemPoolAddItemType(poolitems[6], 'mcri', 60) //Chance: 6/34
call ItemPoolAddItemType(poolitems[6], 'I003', 60) //Chance: 6/34
call ItemPoolAddItemType(poolitems[6], 'I006', 60) //Chance: 6/34
call ItemPoolAddItemType(poolitems[6], 'whwd', 30) //Chance: 3/34
call ItemPoolAddItemType(poolitems[6], 'I002', 30) //Chance: 3/34
call GT_AddUnitDiesAction(function A, 'eaom')//ancient of war
call GT_AddUnitDiesAction(function B, 'etol')//tree of life
call GT_AddUnitDiesAction(function C, 'ugol')//haunted gold mine
call GT_AddUnitDiesAction(function D, 'htow')//any other hall/
call GT_AddUnitDiesAction(function D, 'ofrt')//any other hall/
call GT_AddUnitDiesAction(function D, 'ogre')//any other hall/
call GT_AddUnitDiesAction(function D, 'nntt')//any other hall/
call GT_AddUnitDiesAction(function D, 'ndh2')//any other hall/
call GT_AddUnitDiesAction(function D, 'e002')//any other hall/
call GT_AddUnitDiesAction(function G, 'emow')//singlegoldpiecebounty/
call GT_AddUnitDiesAction(function G, 'e001')//singlegoldpiecebounty/
call GT_AddUnitDiesAction(function G, 'zcso')//singlegoldpiecebounty/
call GT_AddUnitDiesAction(function G, 'nnmg')//singlegoldpiecebounty/
call GT_AddUnitDiesAction(function H, 'hdfR')//singlewoodpiecebounty/
call GT_AddUnitDiesAction(function Fc, 'nfnp')//fountain
call GT_AddUnitDiesAction(function Ed, 'h000')//3buildings for 1 gold bounty
call GT_AddUnitDiesAction(function Ed, 'h001')//farms
call GT_AddUnitDiesAction(function Ed, 'h002')//
call GT_AddUnitDiesAction(function Ed, 'h003')//
call GT_AddUnitDiesAction(function Ed, 'h004')//
call GT_AddUnitDiesAction(function Ed, 'h005')//
call GT_AddUnitDiesAction(function Ed, 'h006')//
call GT_AddUnitDiesAction(function Ed, 'h007')//
call GT_AddUnitDiesAction(function Ed, 'h008')//
call GT_AddUnitDiesAction(function Ed, 'h009')//
call GT_AddUnitDiesAction(function Ee, 'hvlt')//vault//1gold//1/4chanceforitem
call GT_AddUnitDiesAction(function Ef, 'halt')//altar//2goldbounty//item
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RunnerRescueJass initializer I
private function f takes nothing returns boolean
local integer i4rr
local unit u = GetTriggerUnit()
local integer ui = GetUnitTypeId(u)
local player p=GetOwningPlayer(GetKillingUnit())
local integer pik = GetPlayerSlotMultiboard(GetPlayerId(GetOwningPlayer(GetKillingUnit())))
if ui == SPECIALCRITTER[2] then
call CreateUnit(Player(2), DEMONGATEA, -901.00, -1408.00, 270.00)
set i4rr = 2
elseif ui == SPECIALCRITTER[3] then
call CreateUnit(Player(3), DEMONGATEA, -1035.00, -769.00, 270.00)
set i4rr = 3
elseif ui == SPECIALCRITTER[4] then
call CreateUnit(Player(4), DEMONGATEA, -900.00, -260.00, 270.00)
set i4rr = 4
elseif ui == SPECIALCRITTER[5] then
call CreateUnit(Player(5), DEMONGATEA, -899.00, 260.00, 270.00)
set i4rr = 5
elseif ui == SPECIALCRITTER[6] then
call CreateUnit(Player(6), DEMONGATEA, -130.00, 260.00, 270.00)
set i4rr = 6
elseif ui == SPECIALCRITTER[7] then
call CreateUnit(Player(7), DEMONGATEA, 640.00, 260.00, 270.00)
set i4rr = 7
elseif ui == SPECIALCRITTER[8] then
call CreateUnit(Player(8), DEMONGATEA, 895.00, -130.00, 270.00)
set i4rr = 8
elseif ui == SPECIALCRITTER[9] then
call CreateUnit(Player(9), DEMONGATEA, 1019.00, -904.00, 270.00)
set i4rr = 9
elseif ui == SPECIALCRITTER[11] then
call CreateUnit(Player(11), DEMONGATEA, -258.00, -1666.00, 270.00)
set i4rr = 11
else
set p=null
set u = null
return false
endif
if GetPlayerSlotState(Player(i4rr)) == PLAYER_SLOT_STATE_PLAYING then
call msgall(45,"|cff80FF00"+GetPlayerName(p)+" has killed a special critter! "+GetPlayerName(Player(i4rr))+(" has another chance to play!|r"))
call msgone(90,Player(i4rr),"Your demon gate has been respawned! Summon a new runner, before the hunters get you!",true)
if GetKillingUnit()==RUNNER[GetPlayerId(p)] then
call jBoard_TDHT.field(pik,0).addR(1)
endif
else
set p=null
set u = null
return false
endif
set p=null
set u = null
call StartSound( gg_snd_ilaughinthefaceofdanger )
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( t, Player(bj_PLAYER_NEUTRAL_EXTRA), EVENT_PLAYER_UNIT_DEATH, null )
call TriggerAddCondition( t, Condition(function f) )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
////! runtextmacro itemswitching("'mcri'","'I00B'","a")
scope dialogbox initializer I
globals
trigger boxdisplay = CreateTrigger( )
trigger boxfinish= CreateTrigger( )
endglobals
private function C takes nothing returns boolean
call DialogSetMessageBJ( diadif, "Hunt Time Limit" )
set diadifbut[1] = DialogAddButtonBJ( diadif,"45 Minutes - Standard" )
set diadifbut[2] = DialogAddButtonBJ( diadif, "30-60 Minutes - Random" )
set diadifbut[3] = DialogAddButtonBJ( diadif, "No Limit - Experts" )
return false
endfunction
private function B takes nothing returns boolean
local integer a=diadifint[1]
local integer b=diadifint[2]
local integer c=diadifint[3]
if a>b and a>c then
call msgall(10,"Time Limit is Forty Five Minutes.")
call EnableTrigger(tmrTDHTa )
call EnableTrigger( gg_trg_time_limit )
elseif b>a and b>c then
call msgall(10,"Time Limit is Random.")
call EnableTrigger(tmrTDHTb )
call EnableTrigger( gg_trg_time_limit )
elseif c>a and c>b then
call msgall(10,"No Time Limit.")
else
call msgall(10,"Time Limit is Forty Five Minutes.")
call EnableTrigger(tmrTDHTa)
call EnableTrigger( gg_trg_time_limit )
endif
return false
endfunction
private function A takes nothing returns boolean
if GetClickedButtonBJ() == diadifbut[1] then
set diadifint[1] = ( diadifint[1] + 1 )
elseif GetClickedButtonBJ() == diadifbut[2] then
set diadifint[2] = ( diadifint[2] + 1 )
elseif GetClickedButtonBJ() == diadifbut[3] then
set diadifint[3] = ( diadifint[3] + 1 )
endif
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
set diadifint[1]=0
set diadifint[2]=0
set diadifint[3]=0
call TriggerRegisterDialogEventBJ( t, diadif )
call TriggerAddCondition( t, Condition( function A ) )
call DisableTrigger( boxfinish )
call TriggerAddCondition( boxfinish, Condition( function B ) )
call DisableTrigger( boxdisplay )
call TriggerAddCondition( boxdisplay, Condition( function C ) )
endfunction
endscope
scope triggerregistertimereventsingle initializer I
globals
trigger tmrTDHTa = CreateTrigger( )
trigger tmrTDHTb= CreateTrigger( )
endglobals
private function B takes nothing returns nothing
set tmrdiaTDHT = CreateTimerDialogBJ( tmrTDHT, "Hunting Timer" )
call TimerDialogSetTimeColorBJ( tmrdiaTDHT, 100, 25.00, 25.00, 0 )
call TimerDialogSetTitleColorBJ( tmrdiaTDHT, 50.00, 100.00, 50.00, 0 )
call TimerDialogDisplayBJ( true, tmrdiaTDHT )
call StartTimerBJ( tmrTDHT, false, I2R(GetRandomInt(30,60))*60.00+5.00)
endfunction
private function C takes nothing returns nothing
set tmrdiaTDHT = CreateTimerDialogBJ( tmrTDHT, "Hunting Timer" )
call TimerDialogSetTimeColorBJ( tmrdiaTDHT, 100, 25.00, 25.00, 0 )
call TimerDialogSetTitleColorBJ( tmrdiaTDHT, 50.00, 100.00, 50.00, 0 )
call TimerDialogDisplayBJ( true, tmrdiaTDHT )
call StartTimerBJ( tmrTDHT, false, 2705.00 )
endfunction
private function displaydiadif takes nothing returns nothing
call DialogDisplayBJ( true, diadif, GetEnumPlayer() )
endfunction
private function hidediadif takes nothing returns nothing
call DialogDisplayBJ( false, diadif, GetEnumPlayer() )
endfunction
private function dialoghidetime takes nothing returns boolean
call ForForce( GetPlayersAll(), function hidediadif )
call ConditionalTriggerExecute( boxfinish )
return false
endfunction
private function mbtime takes nothing returns boolean
call ConditionalTriggerExecute( gg_trg_mbTDHT )
call ConditionalTriggerExecute( boxdisplay )
call ForForce( GetPlayersAll(), function displaydiadif )
return false
endfunction
private function pickchasertime takes nothing returns boolean
call SetPlayerTechResearched(Player(0), CLOCK53, 1)
call SetPlayerTechResearched(Player(1), CLOCK53, 1)
call SetPlayerTechResearched(Player(10), CLOCK53, 1)
return false
endfunction
private function pickrunnertime takes nothing returns boolean
local integer index = 2
loop
call SetPlayerTechResearched(Player(index), CLOCK15, 1)
call SetPlayerTechResearched(Player(index), CLOCK15B, 1)
set index=index+1
exitwhen index>9
endloop
call SetPlayerTechResearched(Player(11), CLOCK15, 1)
call SetPlayerTechResearched(Player(11), CLOCK15B, 1)
return false
endfunction
private function m1 takes nothing returns boolean
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Welcome to "+gtc_palegreen("The Demon Hunt Tournament"))
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Remember to check online for the Newest Version.")
call StartSound( gg_snd_Tension )
return false
endfunction
private function m2 takes nothing returns boolean
call msgall(60,gtc_yellowgreen("Runners must either destroy the chasers or survive until the the hunting season is over.")+" Runners can be rescued by other runners with a rescue ally bolt."+gtc_gold(" Chasers, capture all Runners to win."))
return false
endfunction
private function m3 takes nothing returns boolean
call msgall(60,gtc_yellowgreen("Only Magic and Chaos Attacks can Damage the Chasers. ")+gtc_gold("Chasers, Don't make the wall entrance around the middle any bigger than it has to be!"))
return false
endfunction
private function m4 takes nothing returns boolean
call msgall(60,"|c00ffa50CIntead of |r|c007aff7Cannoying|r|c00ffa50C other people about how to play, |r|c007aff7Cplease|r|c00ffa50C check out your |r|c007aff7Cenhanced tooltips |r|c00ffa50Cand the |r|c007aff7Cquests section|r|c00ffa50C for more information.|r")
return false
endfunction
private function m6 takes nothing returns boolean
call msgall(25,"Hit Esc for a random tip!")
return false
endfunction
private function m7 takes nothing returns boolean
call msgally(15,Player(0),RANDOMTIP[38],false)
call msgally(15,Player(0),RANDOMTIP[29],true)
return false
endfunction
private function m8 takes nothing returns boolean
call msgall(15,RANDOMTIP[19])
return false
endfunction
private function m9 takes nothing returns boolean
call msgally(15,Player(0),RANDOMTIP[10],false)
call msgally(15,Player(0),RANDOMTIP[22],true)
return false
endfunction
private function I takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 150.00,false )
call TriggerAddCondition( t,Condition( function m6 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 120.00 ,false)
call TriggerAddCondition( t,Condition( function m4 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 25.00 ,false)
call TriggerAddCondition( t,Condition( function m3 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 10.00 ,false)
call TriggerAddCondition( t,Condition( function m2 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 3.00 ,false)
call TriggerAddCondition( t,Condition( function m1 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 180.00 ,false)
call TriggerAddCondition( t,Condition( function m7 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 240.00 ,false)
call TriggerAddCondition( t,Condition( function m8 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 540.00 ,false)
call TriggerAddCondition( t,Condition( function m9 ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 53.00 ,false)
call TriggerAddCondition( t,Condition( function pickchasertime ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 15.00 ,false)
call TriggerAddCondition( t,Condition( function pickrunnertime ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 1.0 ,false)
call TriggerAddCondition( t,Condition( function mbtime ))
set t= CreateTrigger()
call TriggerRegisterTimerEvent( t, 30.0 ,false)
call TriggerAddCondition( t,Condition( function dialoghidetime ))
call DisableTrigger( tmrTDHTa )
call TriggerRegisterTimerEvent( tmrTDHTa, 55.00,false )
call TriggerAddAction( tmrTDHTa, function C )
call DisableTrigger( tmrTDHTb )
call TriggerRegisterTimerEvent( tmrTDHTb, 55.00,false )
call TriggerAddAction( tmrTDHTb, function B )
endfunction
endscope
scope repickrunner initializer I
globals
private constant integer REPICKABILITY = 'AIv1'
endglobals
private function f takes nothing returns boolean
local unit ut = GetTriggerUnit()
local real x = GetUnitX(ut)
local real y = GetUnitY(ut)
local unit u = null
call RemoveUnit(runnerSERVANT[GetPlayerId(GetOwningPlayer(ut))])
call RemoveUnit( ut )
set u = CreateUnit(GetOwningPlayer(ut), DEMONGATEA, x, y, GetRandomReal(0.01, 360.00))
if GetLocalPlayer() == GetOwningPlayer(ut) then
call ClearSelection()
call SelectUnit(u, true)
endif
set u = null
set ut=null
return false
endfunction
private function I takes nothing returns nothing
call GT_AddBeginsCastingAction(function f, REPICKABILITY)
endfunction
endscope
scope randommessages initializer I
private function rantip takes nothing returns nothing
call msgone(15,GetTriggerPlayer(),RANDOMTIP[ip4rantip.getRInt()],true)
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
TriggerRegisterPlayerEventEndCinematic( t, Player(0) )
TriggerRegisterPlayerEventEndCinematic( t, Player(1) )
TriggerRegisterPlayerEventEndCinematic( t, Player(2) )
TriggerRegisterPlayerEventEndCinematic( t, Player(3) )
TriggerRegisterPlayerEventEndCinematic( t, Player(4) )
TriggerRegisterPlayerEventEndCinematic( t, Player(5) )
TriggerRegisterPlayerEventEndCinematic( t, Player(6) )
TriggerRegisterPlayerEventEndCinematic( t, Player(7) )
TriggerRegisterPlayerEventEndCinematic( t, Player(8) )
TriggerRegisterPlayerEventEndCinematic( t, Player(9) )
TriggerRegisterPlayerEventEndCinematic( t, Player(10) )
TriggerRegisterPlayerEventEndCinematic( t, Player(11) )
call TriggerAddAction( t, function rantip )
endfunction
endscope
scope playerL initializer I
private function A takes nothing returns boolean
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetTriggerPlayer()))
call TDHT_PLAYERLEAVING(RUNNER[GetPlayerId(GetTriggerPlayer())])
call jBoard_TDHT.field(pi,1).setIconPathR(iconX)
return false
endfunction
private function B takes nothing returns boolean
local integer pi = GetPlayerSlotMultiboard(GetPlayerId(GetTriggerPlayer()))
call TDHT_PLAYERLEAVING(CHASER[GetPlayerId(GetTriggerPlayer())])
call jBoard_TDHT.field(pi,1).setIconPathR(iconX)
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TDHT_RUNNERPEL(t)
call TriggerAddCondition( t, Condition(function A) )
set t = CreateTrigger( )
call TDHT_CHASERPEL(t)
call TriggerAddCondition( t, Condition(function B) )
endfunction
endscope
scope A2Zselection initializer I
private function C takes nothing returns boolean
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local unit u = null
if GetTrainedUnitType() == STOZ then
call RemoveUnit(GetTriggerUnit())
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DEMONGATEC, x, y, 270)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE))
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(u, true)
endif
endif
set u=null
return false
endfunction
private function B takes nothing returns boolean
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local unit u = null
if GetTrainedUnitType() == JTOR then
call RemoveUnit(GetTriggerUnit())
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DEMONGATEB, x, y, 270)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE))
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(u, true)
endif
endif
set u=null
return false
endfunction
private function A takes nothing returns boolean
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local unit u = null
if GetTrainedUnitType() == ATOI then
call RemoveUnit(GetTriggerUnit())
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DEMONGATEA, x, y, 270)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE))
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call ClearSelection()
call SelectUnit(u, true)
endif
endif
set u=null
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
//! runtextmacro RUNNER_PUE("t","EVENT_PLAYER_UNIT_TRAIN_START")
call TriggerAddCondition( t, Condition( function C ) )
set t = CreateTrigger( )
//! runtextmacro RUNNER_PUE("t","EVENT_PLAYER_UNIT_TRAIN_START")
call TriggerAddCondition( t, Condition( function B ) )
set t = CreateTrigger( )
//! runtextmacro RUNNER_PUE("t","EVENT_PLAYER_UNIT_TRAIN_START")
call TriggerAddCondition( t, Condition( function A ) )
endfunction
endscope
function CameraSetupForPlayer takes camerasetup x, integer y, player z returns nothing
if GetLocalPlayer()==z then
call CameraSetupSetDestPosition(x, CAMX[y], CAMY[y], 0.0 )
set customCAM[GetPlayerId(z)]=x
call CameraSetupApply(x,false,false)
endif
endfunction
function customCAMeraResetForPlayerId takes integer x returns nothing
if GetLocalPlayer()==Player(x) then
if GetPlayerSlotMultiboard(x)>2 then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROTATION,customCAMrotatereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK,customCAManglereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE,customCAMdistancereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROLL,customCAMrollreal[x],0.0)
call CameraSetupSetDestPosition(customCAM[x], GetUnitX(RUNNER[x]), GetUnitY(RUNNER[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
else
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROTATION,customCAMrotatereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK,customCAManglereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE,customCAMdistancereal[x],0.0)
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROLL,customCAMrollreal[x],0.0)
call CameraSetupSetDestPosition(customCAM[x], GetUnitX(CHASER[x]), GetUnitY(CHASER[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endif
endfunction
function customCAMeraRollForPlayerId takes integer x, real y returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROLL,y+15.00,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraRotateForPlayerId takes integer x, real y returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROTATION,y+15.00,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraAngleForPlayerId takes integer x, real y returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK,y+15.00,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraDistanceForPlayerId takes integer x, real y returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE,y+50.00,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraFixedRollForPlayerId takes integer x, real y, real z returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROLL,y+z,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraFixedRotateForPlayerId takes integer x, real y, real z returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ROTATION,y+z,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraFixedAngleForPlayerId takes integer x, real y, real z returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK,y+z,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraFixedDistanceForPlayerId takes integer x, real y, real z returns nothing
if GetLocalPlayer()==Player(x) then
call CameraSetupSetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE,y+z,0.0)
call CameraSetupSetDestPosition(customCAM[x], CameraSetupGetDestPositionX(customCAM[x]), CameraSetupGetDestPositionY(customCAM[x]), 0.0 )
call CameraSetupApply(customCAM[x],false,false)
endif
endfunction
function customCAMeraResetForPlayer takes player x returns nothing
local integer y=GetPlayerId(x)
if GetLocalPlayer()==x then
if GetPlayerSlotMultiboard(y)>2 then
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ROTATION,customCAMrotatereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ANGLE_OF_ATTACK,customCAManglereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_TARGET_DISTANCE,customCAMdistancereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ROLL,customCAMrollreal[y],0.0)
call CameraSetupSetDestPosition(customCAM[y], GetUnitX(RUNNER[y]), GetUnitY(RUNNER[y]), 0.0 )
call CameraSetupApply(customCAM[y],false,false)
else
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ROTATION,customCAMrotatereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ANGLE_OF_ATTACK,customCAManglereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_TARGET_DISTANCE,customCAMdistancereal[y],0.0)
call CameraSetupSetField(customCAM[y],CAMERA_FIELD_ROLL,customCAMrollreal[y],0.0)
call CameraSetupSetDestPosition(customCAM[y], GetUnitX(CHASER[y]), GetUnitY(CHASER[y]), 0.0 )
call CameraSetupApply(customCAM[y],false,false)
endif
endif
endfunction
scope chatcommands initializer I
//==//==//==//==
globals
private boolean tstrandom=true
endglobals
private function randomchaser takes nothing returns boolean
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "Oh, a DOTA command? Actually, random chaser is right there with your other chasers.")
return false
endfunction
private function randomrunner takes nothing returns boolean
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "Oh, a DOTA command? Actually, random runner is next to runner z in your demon gate.")
return false
endfunction
private function randomcameras takes nothing returns boolean
local integer x=GetRandomInt(1, 15)
call CameraSetupForPlayer(CAM[x],x, GetTriggerPlayer())
return false
endfunction
private function cameras takes nothing returns boolean
call DisplayTextToPlayer( GetTriggerPlayer(), 0, 0, "TRIGSTR_3637" )
return false
endfunction
private function rol takes nothing returns boolean
local real x=S2R(SubStringBJ(GetEventPlayerChatString(), 5, 7))
local integer y=GetPlayerId(GetTriggerPlayer())
call customCAMeraFixedRollForPlayerId(y,CameraSetupGetField(customCAM[y],CAMERA_FIELD_ROLL),x)
return false
endfunction
private function rot takes nothing returns boolean
local real x=S2R(SubStringBJ(GetEventPlayerChatString(), 5, 7))
local integer y=GetPlayerId(GetTriggerPlayer())
call customCAMeraFixedRotateForPlayerId(y,CameraSetupGetField(customCAM[y],CAMERA_FIELD_ROTATION),x)
return false
endfunction
private function ang takes nothing returns boolean
local real x=S2R(SubStringBJ(GetEventPlayerChatString(), 5, 7))
local integer y=GetPlayerId(GetTriggerPlayer())
call customCAMeraFixedAngleForPlayerId(y,CameraSetupGetField(customCAM[y],CAMERA_FIELD_ANGLE_OF_ATTACK),x)
return false
endfunction
private function dis takes nothing returns boolean
local real x=S2R(SubStringBJ(GetEventPlayerChatString(), 5, 7))
local integer y=GetPlayerId(GetTriggerPlayer())
call customCAMeraFixedDistanceForPlayerId(y,CameraSetupGetField(customCAM[y],CAMERA_FIELD_TARGET_DISTANCE),x)
return false
endfunction
private function cam takes nothing returns boolean
local integer x=S2I(SubStringBJ(GetEventPlayerChatString(), 5, 6))
call CameraSetupForPlayer(CAM[x],x, GetTriggerPlayer())
return false
endfunction
private function customCAMeras takes nothing returns boolean
call customCAMeraResetForPlayerId(GetPlayerId(GetTriggerPlayer()))
return false
endfunction
private function customCAMeraangle takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraAngleForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK))
return false
endfunction
private function customCAMeraroll takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraRollForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ROLL))
return false
endfunction
private function customCAMerarollminus takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraRollForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ROLL) - 30.00)
return false
endfunction
private function customCAMerarotate takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraRotateForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ROTATION))
return false
endfunction
private function customCAMeraangleminus takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraAngleForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ANGLE_OF_ATTACK) - 30.00)
return false
endfunction
private function customCAMerarotateminus takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraRotateForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_ROTATION) - 30.00)
return false
endfunction
private function customCAMeradistance takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraDistanceForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE))
return false
endfunction
private function customCAMeradistanceminus takes nothing returns boolean
local integer x=GetPlayerId(GetTriggerPlayer())
call customCAMeraDistanceForPlayerId(x,CameraSetupGetField(customCAM[x],CAMERA_FIELD_TARGET_DISTANCE) - 100.00)
return false
endfunction
private function I takes nothing returns nothing
local trigger t=CreateTrigger()
call TDHT_CHASERPCESS(t,"-cam")
call TDHT_RUNNERPCESS(t,"-cam")
call TriggerAddCondition(t,Condition(function cam))
set t=CreateTrigger()
call TDHT_CHASERPCESS(t,"-rot")
call TDHT_RUNNERPCESS(t,"-rot")
call TriggerAddCondition(t,Condition(function rot))
set t=CreateTrigger()
call TDHT_CHASERPCESS(t,"-rol")
call TDHT_RUNNERPCESS(t,"-rol")
call TriggerAddCondition(t,Condition(function rol))
set t=CreateTrigger()
call TDHT_CHASERPCESS(t,"-ang")
call TDHT_RUNNERPCESS(t,"-ang")
call TriggerAddCondition(t,Condition(function ang))
set t=CreateTrigger()
call TDHT_CHASERPCESS(t,"-dis")
call TDHT_RUNNERPCESS(t,"-dis")
call TriggerAddCondition(t,Condition(function dis))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"cameras")
call TDHT_RUNNERPCE(t,"cameras")
call TriggerAddCondition(t,Condition(function cameras))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"rcam")
call TDHT_RUNNERPCE(t,"rcam")
call TriggerAddCondition(t,Condition(function randomcameras))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"camr")
call TDHT_RUNNERPCE(t,"camr")
call TriggerAddCondition(t,Condition(function customCAMeras))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"crot")
call TDHT_RUNNERPCE(t,"crot")
call TriggerAddCondition(t,Condition(function customCAMerarotate))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"crol-")
call TDHT_RUNNERPCE(t,"crol-")
call TriggerAddCondition(t,Condition(function customCAMerarollminus))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"crol")
call TDHT_RUNNERPCE(t,"crol")
call TriggerAddCondition(t,Condition(function customCAMeraroll))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"crot-")
call TDHT_RUNNERPCE(t,"crot-")
call TriggerAddCondition(t,Condition(function customCAMerarotateminus))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"cang")
call TDHT_RUNNERPCE(t,"cang")
call TriggerAddCondition(t,Condition(function customCAMeraangle))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"cang-")
call TDHT_RUNNERPCE(t,"cang-")
call TriggerAddCondition(t,Condition(function customCAMeraangleminus))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"cdis")
call TDHT_RUNNERPCE(t,"cdis")
call TriggerAddCondition(t,Condition(function customCAMeradistance))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"cdis-")
call TDHT_RUNNERPCE(t,"cdis-")
call TriggerAddCondition(t,Condition(function customCAMeradistanceminus))
set t=CreateTrigger()
call TDHT_CHASERPCE(t,"-random")
call TriggerAddCondition(t,Condition(function randomchaser))
set t=CreateTrigger()
call TDHT_RUNNERPCE(t,"-random")
call TriggerAddCondition(t,Condition(function randomrunner))
endfunction
endscope
/*
remember to make a note of which runners summon pig farms.
*/
scope pgfrm initializer I
globals
integer piggy=0
endglobals
private function A takes nothing returns boolean
local integer ip = 0
if GetOwningPlayer(GetKillingUnit()) !=null then
set ip=GetPlayerId(GetOwningPlayer(GetKillingUnit()))
else
set piggy=piggy -1
return false
endif
set earngold5[ip]=earngold5[ip]+1
if earngold5[ip]==5 then
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(15)) + 1)
call SetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(GetKillingUnit()), ConvertPlayerState(1)) + 1)
set earngold5[ip]=0
endif
set piggy=piggy -1
return false
endfunction
private function f takes nothing returns boolean
local player x=GetOwningPlayer(GetTriggerUnit())
if GetUnitTypeId(GetTriggerUnit()) == 'npgf' then
call SetPlayerState(x, ConvertPlayerState(15), GetPlayerState(x, ConvertPlayerState(15)) + piggy)
call SetPlayerState(x, ConvertPlayerState(1), GetPlayerState(x, ConvertPlayerState(1)) + piggy)
call SetPlayerState(x, ConvertPlayerState(16), GetPlayerState(x, ConvertPlayerState(16)) + piggy)
call SetPlayerState(x, ConvertPlayerState(2), GetPlayerState(x, ConvertPlayerState(2)) + piggy)
endif
set x=null
return false
endfunction
private function g takes nothing returns boolean
if GetUnitTypeId(GetTriggerUnit()) == 'npgf' then
set piggy=piggy+1
endif
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
//! runtextmacro RUNNER_PUE("t","EVENT_PLAYER_UNIT_CONSTRUCT_FINISH")
call TriggerAddCondition( t, Condition( function f ) )
set t=CreateTrigger()
//! runtextmacro RUNNER_PUE("t","EVENT_PLAYER_UNIT_CONSTRUCT_START")
call TriggerAddCondition( t, Condition( function g ) )
call GT_AddUnitDiesAction(function A, 'npgf')
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
library mbTDHT initializer Init requires jBoardLib
globals
MyBoard jBoard_TDHT
jBoard jB
endglobals
//! runtextmacro jBoardCreate("MyBoard","12","2")
private function Actions takes nothing returns nothing
set jBoard_TDHT = MyBoard.create("TDHT 0.96u")
call jBoard_TDHT.field(0,0).setIconPath(iconP)
call jBoard_TDHT.field(1,0).setIconPath(iconP)
call jBoard_TDHT.field(2,0).setIconPath(iconP)
call jBoard_TDHT.field(3,0).setIconPath(iconR)
call jBoard_TDHT.field(4,0).setIconPath(iconR)
call jBoard_TDHT.field(5,0).setIconPath(iconR)
call jBoard_TDHT.field(6,0).setIconPath(iconR)
call jBoard_TDHT.field(7,0).setIconPath(iconR)
call jBoard_TDHT.field(8,0).setIconPath(iconR)
call jBoard_TDHT.field(9,0).setIconPath(iconR)
call jBoard_TDHT.field(10,0).setIconPath(iconR)
call jBoard_TDHT.field(11,0).setIconPath(iconR)
call jBoard_TDHT.field(0,1).setValue(GetPlayerName(Player(0))).setIconPath(iconF).setWidthR(0.10)
call jBoard_TDHT.field(1,1).setValue(GetPlayerName(Player(1))).setIconPath(iconF).setWidthR(0.10)
call jBoard_TDHT.field(2,1).setValue(GetPlayerName(Player(10))).setIconPath(iconF).setWidthR(0.10)
call jBoard_TDHT.field(3,1).setValue(GetPlayerName(Player(2))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(4,1).setValue(GetPlayerName(Player(3))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(5,1).setValue(GetPlayerName(Player(4))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(6,1).setValue(GetPlayerName(Player(5))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(7,1).setValue(GetPlayerName(Player(6))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(8,1).setValue(GetPlayerName(Player(7))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(9,1).setValue(GetPlayerName(Player(8))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(10,1).setValue(GetPlayerName(Player(9))).setIconPath(iconDG).setWidthR(0.10)
call jBoard_TDHT.field(11,1).setValue(GetPlayerName(Player(11))).setIconPath(iconDG).setWidthR(0.10)
endfunction
public function Init takes nothing returns nothing
set gg_trg_mbTDHT =CreateTrigger()
call TriggerAddAction(gg_trg_mbTDHT,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//==============================================================================
// TDHT - Library for The Demon Hunt Tournament by SanKakU -
//==============================================================================
// THANKS TO : TEXT TAG - Floating text system by Cohadar - v4.0
// I was able to learn how to make a library from examining that simple system
//==============================================================================
library TDHT
define {timedmsg=DisplayTimedTextToPlayer;void=nothing
iconX="ReplaceableTextures\\CommandButtons\\BTNx.blp"
iconP="ReplaceableTextures\\CommandButtons\\BTNGem.blp"
iconR="ReplaceableTextures\\CommandButtons\\BTNFireBolt.blp"
iconDG="ReplaceableTextures\\CommandButtons\\BTNDemonGate.blp"
iconF="ReplaceableTextures\\CommandButtons\\BTNFountainOfLife.blp"
CLOCK15='R000';CLOCK15B='Ropg';CLOCK53='R001';DUMMY='earc'
DEMONGATEA='ndmg';DEMONGATEB='ncbf';DEMONGATEC='ncbe'
ATOI='ehpr';JTOR='echm';STOZ='ehip'
placeGM(gx, gy) = {x = CreateUnit( y, 'ngol', gx, gy, 270.000 )
SetResourceAmount(x,ipgold.getRInt())}
trigCAdeathR(tri, con, act) = {TriggerRegisterPlayerUnitEvent( tri, Player(2), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(3), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(4), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(5), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(6), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(7), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(8), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(9), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(11), EVENT_PLAYER_UNIT_DEATH, null )
TriggerAddCondition( tri, Condition(function con) )
TriggerAddAction( tri, function act)}
trigCAdeathC(tri, con, act) = {TriggerRegisterPlayerUnitEvent( tri, Player(0), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(1), EVENT_PLAYER_UNIT_DEATH, null )
TriggerRegisterPlayerUnitEvent( tri, Player(10), EVENT_PLAYER_UNIT_DEATH, null )
TriggerAddCondition( tri, Condition(function con) )
TriggerAddAction( tri, function act)}
UPadd(upx, upy, upz)=UnitPoolAddUnitType(upx, upy, upz)
}
globals
intpool ip4rantip
camerasetup array customCAM[15]
real array customCAMrotatereal[15]
real array customCAMrollreal[15]
real array customCAManglereal[15]
real array customCAMdistancereal[15]
real array CAMX[15]
real array CAMY[15]
sound gg_snd_demonstration=null
sound gg_snd_Tension = null
sound gg_snd_ilaughinthefaceofdanger = null
sound gg_snd_ColdSounds= null
sound gg_snd_RainAmbience= null
sound gg_snd_Vision= null
sound gg_snd_EvilLaugh = null
public group ug
integer array earngold5[12]
unit efdr=null
unit nndk=null
camerasetup array CAM[15]
string array ICON[50]
string array RANDOMTIP[43]
integer array SPECIALCRITTER[12]
integer array diadifint[3]
constant integer POINT='phlt'
timer tmrTDHT=CreateTimer()
timerdialog tmrdiaTDHT=null
unit array runnerSERVANT[12]
unit array RUNNER[12]
unit array CHASER[12]
button array diadifbut[3]
dialog diadif=DialogCreate()
group GROUPRUNNERS
constant string C_goldbrown="|cffdaa520"
constant string C_gold="|cffffd700"
constant string C_palegreen="|cff7aff7c"
constant string C_pretty="|cffee82ee"
constant string C_grassgreen="|cff7fff00"
constant string C_brightgreen="|cff00ff00"
constant string C_brightblue="|cff0000ff"
constant string C_aqua="|cff00ffff"
constant string C_white="|cfff0ffff"
constant string C_seagreen="|cff7fffd4"
constant string C_twilightblur="|cff20b2aa"
constant string C_twilightgreen="|cff009966"
constant string C_coralgreen="|cff00fa9a"
constant string C_coralpink="|cfff08080"
constant string C_coralblue="|cff33aaff"
constant string C_plum="|cffba55d3"
constant string C_indigo="|cff4169e1"
constant string C_brightpurple="|cffff00ff"
constant string C_flowerred="|cffee2222"
constant string C_flowerpurple="|cffaaaaff"
constant string C_green="|cff32cd32"
constant string C_blue="|cff4169e1"
constant string C_yellowgreen="|cffadff2f"
constant string C_paledenim="|cffc3dbff"
constant string C_orange="|cffffa500"
constant string C_brightorange="|cffff8000"
constant string C_purple="|cffda70d6"
constant string C_royalpurple="|cffaa00ff"
constant string C_grey="|cffc0c0c0"
constant string C_gray="|cffc0c0c0"
constant string C_redorange="|cffff4500"
constant string C_red="|cffff0000"
constant string C_spanishgreen="|cff9acd32"
constant string C_darkspanishgreen="|cff6b8e23"
constant string C_brown ="|cff995500"
constant string C_yellow="|cffffff00"
constant string C_sand="|cffffffcc"
constant string C_CLOSE ="|r"
endglobals
//! textmacro givetextcolor takes TYPEWORD
function gtc_$TYPEWORD$ takes string s returns string
return C_$TYPEWORD$ + s + C_CLOSE
endfunction
//! endtextmacro
//! runtextmacro givetextcolor("goldbrown")
//! runtextmacro givetextcolor("gold")
//! runtextmacro givetextcolor("palegreen")
//! runtextmacro givetextcolor("pretty")
//! runtextmacro givetextcolor("grassgreen")
//! runtextmacro givetextcolor("brightgreen")
//! runtextmacro givetextcolor("aqua")
//! runtextmacro givetextcolor("brightblue")
//! runtextmacro givetextcolor("white")
//! runtextmacro givetextcolor("seagreen")
//! runtextmacro givetextcolor("twilightblur")
//! runtextmacro givetextcolor("twilightgreen")
//! runtextmacro givetextcolor("coralgreen")
//! runtextmacro givetextcolor("coralpink")
//! runtextmacro givetextcolor("coralblue")
//! runtextmacro givetextcolor("plum")
//! runtextmacro givetextcolor("indigo")
//! runtextmacro givetextcolor("brightpurple")
//! runtextmacro givetextcolor("flowerred")
//! runtextmacro givetextcolor("flowerpurple")
//! runtextmacro givetextcolor("green")
//! runtextmacro givetextcolor("blue")
//! runtextmacro givetextcolor("yellowgreen")
//! runtextmacro givetextcolor("paledenim")
//! runtextmacro givetextcolor("orange")
//! runtextmacro givetextcolor("brightorange")
//! runtextmacro givetextcolor("purple")
//! runtextmacro givetextcolor("royalpurple")
//! runtextmacro givetextcolor("grey")
//! runtextmacro givetextcolor("gray")
//! runtextmacro givetextcolor("redorange")
//! runtextmacro givetextcolor("red")
//! runtextmacro givetextcolor("spanishgreen")
//! runtextmacro givetextcolor("darkspanishgreen")
//! runtextmacro givetextcolor("brown")
//! runtextmacro givetextcolor("yellow")
//! runtextmacro givetextcolor("sand")
function CheckRunnerCount takes nothing returns integer
local integer index=0
local integer total=0
loop
exitwhen index >12
if RUNNER[index] != null then
set total=total+1
endif
set index=index+1
endloop
return total
endfunction
function CheckChaserCount takes nothing returns integer
local integer index=0
local integer total=0
loop
exitwhen index >12
if CHASER[index] != null then
set total=total+1
endif
set index=index+1
endloop
return total
endfunction
function FilterDebug takes nothing returns boolean
return true
endfunction
function GetPlayerSlotMultiboard takes integer playerid returns integer
if playerid==0 then
return 0
elseif playerid==1 then
return 1
elseif playerid==2 then
return 3
elseif playerid==3 then
return 4
elseif playerid==4 then
return 5
elseif playerid==5 then
return 6
elseif playerid==6 then
return 7
elseif playerid==7 then
return 8
elseif playerid==8 then
return 9
elseif playerid==9 then
return 10
elseif playerid==10 then
return 2
elseif playerid==11 then
return 11
endif
return 12
endfunction
public function RUNNERPCE takes trigger trig, string s returns nothing
call TriggerRegisterPlayerChatEvent(trig,Player(2),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(3),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(4),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(5),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(6),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(7),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(8),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(9),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(11),s,true)
endfunction
public function CHASERPCE takes trigger trig, string s returns nothing
call TriggerRegisterPlayerChatEvent(trig,Player(0),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(1),s,true)
call TriggerRegisterPlayerChatEvent(trig,Player(10),s,true)
endfunction
public function RUNNERPCESS takes trigger trig, string s returns nothing
call TriggerRegisterPlayerChatEvent(trig,Player(2),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(3),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(4),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(5),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(6),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(7),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(8),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(9),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(11),s,false)
endfunction
public function CHASERPCESS takes trigger trig, string s returns nothing
call TriggerRegisterPlayerChatEvent(trig,Player(0),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(1),s,false)
call TriggerRegisterPlayerChatEvent(trig,Player(10),s,false)
endfunction
public function PLAYERLEAVING takes unit whichUnit returns nothing
call KillUnit(whichUnit)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ( GetPlayerName(GetTriggerPlayer()) + gtc_yellow(" has fled the tournament in terror!") ) )
endfunction
public function RUNNERPEL takes trigger trig returns nothing
call TriggerRegisterPlayerEvent(trig, Player (2), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (3), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (4), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (5), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (6), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (7), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (8), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (9), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (11), EVENT_PLAYER_LEAVE)
endfunction
public function CHASERPEL takes trigger trig returns nothing
call TriggerRegisterPlayerEvent(trig, Player (0), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (1), EVENT_PLAYER_LEAVE)
call TriggerRegisterPlayerEvent(trig, Player (10), EVENT_PLAYER_LEAVE)
endfunction
//
function USA takes integer x, integer y, string b, unit damager, unit a returns unit
local unit z = CreateUnit(GetOwningPlayer(damager),DUMMY,GetUnitX(a),GetUnitY(a),0.00)
call UnitAddAbility(z,x)
call SetUnitAbilityLevel(z,x,y)
call IssueTargetOrder(z,b,a)
call UnitApplyTimedLife(z, 'BTLF', 3.0)
set z=null
return a
endfunction
//
//! textmacro RUNNER_PUE takes trig, whichPlayerUnitEvent
call TriggerRegisterPlayerUnitEvent( $trig$, Player(2),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(3),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(4),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(5),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(6),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(7),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(8),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(9),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(11),$whichPlayerUnitEvent$, null )
//! endtextmacro
//! textmacro CHASER_PUE takes trig, whichPlayerUnitEvent
call TriggerRegisterPlayerUnitEvent( $trig$, Player(0),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(1),$whichPlayerUnitEvent$, null )
call TriggerRegisterPlayerUnitEvent( $trig$, Player(10),$whichPlayerUnitEvent$, null )
//! endtextmacro
//== snippet by Jesus4Lyf
function SetDistanceToUnit takes unit y, unit x, real dist returns nothing
local real rx=GetUnitX(x)-GetUnitX(y)
local real ry=GetUnitY(x)-GetUnitY(y)
local real factor=dist/SquareRoot(rx*rx+ry*ry)
call SetUnitX(x,GetUnitX(y)+rx*factor)
call SetUnitY(x,GetUnitY(y)+ry*factor)
endfunction
function SetDistanceToXY takes real rx, real ry, unit x, real dist returns nothing
local real tx=GetUnitX(x)-rx
local real ty=GetUnitY(x)-ry
local real factor=dist/SquareRoot(tx*tx+ty*ty)
call SetUnitX(x,rx+tx*factor)
call SetUnitY(x,ry+ty*factor)
endfunction
//extension to snippet.
function getdis takes unit x, unit y returns real
local real dx = GetUnitX(x) - GetUnitX(y)
local real dy = GetUnitY(x) - GetUnitY(y)
return SquareRoot(dx * dx + dy * dy)
endfunction
function getdisr takes real x, real y, unit z returns real
local real dx = x - GetUnitX(z)
local real dy = y - GetUnitY(z)
return SquareRoot(dx * dx + dy * dy)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library MSGS{define{c_goldbrown="daa520";c_gold="ffd700";c_palegreen="7aff7c";c_pink="db7093";c_pretty="ee82ee"
c_grassgreen="7fff00";c_brightgreen="00ff00";c_brightblue="0000ff";c_aqua="00ffff";c_white="f0ffff"
c_black="000000";c_seagreen="7fffd4";c_twilightblur="20b2aa";c_twilightgreen="009966"
c_coralgreen="00fa9a";c_coralpink="f08080";c_coralblue="33aaff";c_plum="ba55d3";c_indigo="4169e1"
c_flowerpurple="aaaaff";c_green="32cd32";c_blue="4169e1";c_yellowgreen="adff2f";c_brightpurple="ff00ff"
c_paledenim="c3dbff";c_orange="ffa500";c_purple="da70d6";c_royalpurple="aa00ff";c_flowerred="ee2222"
c_grey="c0c0c0";c_gray="c0c0c0";c_redorange="ff4500";c_red="ff0000";c_spanishgreen="9acd32"
c_darkspanishgreen="6b8e23";c_brown ="995500";c_yellow="ffff00";c_sand="ffffcc"}//
string gtc(string x, string y){return "|cff"+x+y+"|r"}//colors text
string msggetcolor(integer x, string y){if x==0 then;return gtc(c_red,y);elseif x==1 then
return gtc(c_brightblue,y);elseif x==2 then;return gtc(c_aqua,y);elseif x==3 then
return gtc(c_purple,y);elseif x==4 then;return gtc(c_yellow,y);elseif x==5 then
return gtc(c_orange,y);else;return gtc(c_white,y);endif;return y}//colors text based on player color
integer GetPlayerTeamMSGS(integer playerid){if playerid==0 then;return 1;elseif playerid==1 then
return 1;elseif playerid==10 then;return 1;elseif playerid>11 then;return 3;endif;return 2}//player number for team number//customize as needed
nothing msgally(real x, player y, string z, boolean ally){integer a=GetPlayerId(y),b=GetPlayerTeamMSGS(a)
if ally then;a=-1;whilenot(a++>11){if GetPlayerTeamMSGS(a)==b then;timedmsg(Player(a),0,0,x,z);endif}
else;a=-1;whilenot(a++>11){if GetPlayerTeamMSGS(a)!=b then;timedmsg(Player(a),0,0,x,z);endif}endif}
nothing msgallyo(real x, player y, string z){integer a=GetPlayerId(y),b=GetPlayerTeamMSGS(a)
a=-1;whilenot(a++>11){if GetPlayerTeamMSGS(a)==b then;timedmsg(Player(a),0,0,x,z);endif}}
nothing msgenemyno(real x, player y, string z){integer a=GetPlayerId(y),b=GetPlayerTeamMSGS(a)
a=-1;whilenot(a++>11){if GetPlayerTeamMSGS(a)!=b then;timedmsg(Player(a),0,0,x,z);endif}}
nothing msgall(real dur, string s){integer i=-1;whilenot (i++>11){timedmsg(Player(i),0,0,dur,s)}}//standard text
nothing msgone(real dur, player p, string s, boolean one){integer i=-1,ip=GetPlayerId(p);if one then
timedmsg(p,0,0,dur,(s));else;whilenot(i++>11){if i!=ip then;timedmsg(p,0,0,dur,s);endif}endif}}
//TESH.scrollpos=0
//TESH.alwaysfold=0
//compilation of itemtriggers composed by sankaku
//dubbed item management
scope powerupSENTINEL initializer I
private function F takes nothing returns nothing
if GetWidgetLife(GetManipulatedItem()) == 0 then
call RemoveItem(GetManipulatedItem())
endif
endfunction
private function I takes nothing returns nothing
local trigger T = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( T, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( T, function F)
endfunction
endscope
scope mergeitems initializer I
private function f takes nothing returns boolean
call AddItemCharges(GetManipulatingUnit(),GetManipulatedItem())
return false
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
//! runtextmacro CHASER_PUE("t","EVENT_PLAYER_UNIT_PICKUP_ITEM")
call TriggerAddCondition( t, Condition(function f) )
endfunction
endscope
library StackItems
function GetInventoryOnce takes unit u, integer i returns integer
local integer index
local item indexItem=null
set index = 0
loop
set indexItem = UnitItemInSlot(u, index)
if (indexItem != null) and (GetItemTypeId(indexItem) == i) then
set indexItem=null
return index
else
set index=index+1
endif
exitwhen index>5
endloop
set indexItem=null
return 6
endfunction
function GetInventoryAgain takes unit u, integer i, integer in returns integer
local integer index
local item indexItem=null
set index = 0
loop
set indexItem = UnitItemInSlot(u, index)
if (indexItem != null) and (GetItemTypeId(indexItem) == i) and (indexItem != UnitItemInSlot(u,in)) then
set indexItem=null
return index
else
set index=index+1
endif
exitwhen index>5
endloop
set indexItem=null
return 6
endfunction
function AddItemCharges takes unit x, item y returns boolean
local integer z=0
local integer zx=0
if GetItemType(y) !=ConvertItemType(1) then
return false
endif
z=GetInventoryOnce(x,GetItemTypeId(y))
zx=GetInventoryAgain(x,GetItemTypeId(y),z)
if z!=6 and zx!=6 then
if z==zx then
return false
endif
call SetItemCharges(UnitItemInSlot(x,z),GetItemCharges(UnitItemInSlot(x,z))+GetItemCharges(UnitItemInSlot(x,zx)))
call RemoveItem(UnitItemInSlot(x,zx))
return false
endif
return false
endfunction
//! textmacro itemswitching takes itemA, itemB, type
scope switch$type$ initializer I
private function f takes nothing returns boolean
local unit mu = GetManipulatingUnit()
if IsUnitType(mu, UNIT_TYPE_HERO) then
set mu=null
return false
else
call UnitRemoveItem(mu,GetManipulatedItem())
call UnitAddItemById(mu,$itemB$)
set mu=null
return false
endif
endfunction
private function I takes nothing returns nothing
call GT_AddItemAcquiredAction(function f, $itemA$)
endfunction
endscope
//! endtextmacro
endlibrary
//TESH.scrollpos=192
//TESH.alwaysfold=0
//==============================================================================
// jBoard -- ADVANCED MULTIBOARD SYSTEM BY MAGENTIX -- v1.2
//==============================================================================
//==============================================================================
// Quick manual:
//==============================================================================
//
// Implement by adding "requires jBoardLib" behind your library/scope names
//
// ----------------------------------------------------------------------
// What is jBoard?
// ----------------------------------------------------------------------
//
// jBoard is an enhanced multiboard management system, inspired by the
// jQuery library that is available to webdesigners. That javascript library
// allows for a cool functionality called "chaining".
//
// Because WC3 multiboards often require a huge amount of function calls,
// I came up with jBoard to allow you to make your multiboard code shorter,
// smoother and overall more easy to use.
//
//
// ----------------------------------------------------------------------
// What is chaining and how to use it?
// ----------------------------------------------------------------------
//
// An example says a thousand words, assume this is your 10x5 multiboard setup
// and you want to set all fields to "0" and the first field to "1":
//
// - local multiboard MB = CreateMultiboard()
// local multiboarditem MBI
// call MultiboardSetTitleText(MB,"My Multiboard")
// call MultiboardDisplay(MB,true)
// call MultiboardSetRowCount(MB,10)
// call MultiboardSetColumnCount(MB,5)
// call MultiboardSetItemsValue(MB,"0")
// call MultiboardSetItemsStyle(MB,true,false)
// set MBI = MultiboardGetItem(MB,0,0)
// call MultiboardSetItemValue(MBI,"1")
//
// Now take a look at jBoard:
// - //! runtextmacro jBoardCreate("MyBoard","10","5")
// local MyBoard MB = MyBoard.create("My Multiboard").field(0,0).setValue("1")
// That's all you need to type!
//
// Remember: the textmacro also only has to be called ONCE to create a
// multiboard with the wanted dimensions. So actually that line wouldn't be
// there, but at the top of your script.
//
// Did you also notice how every method call returned an object that you
// could then call another method on? That is the beauty of chaining.
//
// !! EVERY FUNCTION CALL RETURNS A jBoard OBJECT UNLESS STATED OTHERWISE !!
//
//
// ----------------------------------------------------------------------
// I noticed a textmacro there, what gives?
// ----------------------------------------------------------------------
//
// Since you need to create structs that represent your multiboard, jBoard
// needs to know the dimensions of your multiboard to ensure the structs
// don't take up more space than they need to.
//
// For every multiboard variation you plan to use, simply call this once at
// the top of your script:
// //! runtextmacro jBoardCreate("StructName","RowAmount","ColAmount")
//
// Example for an 8 row, 4 col board:
// //! runtextmacro jBoardCreate("My8x4Board","8","4")
// Which you can then instanciate in your script as
// My8x4Board.create("BoardTitle")
//
//
// ----------------------------------------------------------------------
// Defaults
// ----------------------------------------------------------------------
//
// Somtimes we don't want our board cells to be empty by default, but show
// 0 for example. This is easy to achieve by setting a default. Take a look
// at the jBoard struct further down this info block and edit the defaults
// you like to see changed. Every jBoard that gets created after a change
// will take those defaults into account.
//
// Note that you can hardcode defaults below and still change them on the fly!
// set jBoard.defaultItemValue = "1" -- Valid syntax!
//
// Edit your defaults here:
//! textmacro jBoardDefaults
static string defaultItemValue = "0"
static string defaultIconPath = iconX
static boolean defaultShowValue = true
static boolean defaultShowIcon = true
static boolean defaultShowBoard = true
static real defaultItemWidth = 0.03
//! endtextmacro
//
//==============================================================================
//==============================================================================
// Tip: Commenting out newlines
//==============================================================================
//
// Sometimes when chaining methods, a command can get quite lengthy. jQuery
// doesn't suffer from this visually, because javascript allows people to write
// code over multiple lines until they end it with a semicolon (;)
//
// JASS, however, doesn't allow that directly. Fortunately you can call jBoard
// commands just as easily on multiple lines. Remember: Until you call .reset(),
// your selection will be saved to the next line!
//
// Example:
// local MyBoard MB = MyBoard.create("funkyboard").setplayerrow(0,2).setcolour("ff0000").reset().setplayerrow(1,3).setcolour("0000ff").reset().etc...
//
// Could become:
// local MyBoard MB = MyBoard.create("funkyboard")
// call MB.setplayerrow(0,2).setcolour("ff0000").reset()
// call MB.setplayerrow(1,3)
// call MB.setcolour("0000ff").reset() <-- Previous row selection was saved to this line
//
// In the end it all boils down to which type of coding you prefer, of course.
//
//==============================================================================
//==============================================================================
// Tip: -R Functions
//==============================================================================
//
// When chaining several commands onto a set of fields, one could easily say:
// "There, now let me reset my selection and continue chaining methods"
//
// However, when chaining that way, a string of jBoard commands could easily
// contain the call .reset() a dozen times.
//
// To save coding space and safeguard readability, I introduced the -R functions:
// Basically, any non-selector function that returns a jBoard object can be called
// with a capital "R" behind the name and the jBoard system will automatically
// call a .reset() for you.
//
// The above example of commenting out newlines would then become:
// local MyBoard MB = MyBoard.create("funkyboard").setPlayerRow(0,2).setColourR("ff0000").setPlayerRow(1,3).setColourR("0000ff").etc...
//
// As you can see, this makes the chaining process yet again a little smoother
// Once again: this functionality does not work on selectors/"getters"!
//
//==============================================================================
//==============================================================================
// Function index:
//==============================================================================
//
// ----------------------------------------------------------------------
// Standard Functions - Creating, showing, etc...
// ----------------------------------------------------------------------
//
// Main functionality you'd expect from any multiboard. May be used within
// a local player block. Can be used on any jBoard object (boad, row, col,
// field(s)) and returns the selection you called the function on.
//
// .create("MultiboardName")
// .show()
// .hide()
// .clear() -- SHOULD NEVER BE CALLED, just here for completion
// .fold()
// .unfold()
// .setName()
// .getName() -- Returns the multiboard name as a string, not a jBoard object
// .setNameColour("rgb value")
// Colour syntax: rrggbb (in hexadecimal)
// .getNameColour()
// .destroy()
//
//
// ----------------------------------------------------------------------
// Selection Functions - Adds rows, cols or fields to the selection
// ----------------------------------------------------------------------
//
// Selectors can be used on any jBoard object (boad, row, col, field(s))
// They always return the collection of all the objects you selected from
// the last .reset() up to that point.
//
// VERY IMPORTANT!
// .reset()
// Resets the current selection to the board
//
// MAIN SELECTORS
// .row(integer start, integer end)
// .col(integer start, integer end)
// Selects a row, a columns or multiple of any
// - .row(0,0) returns the row object of row 0
// - .row(0,1) returns the combined fields of row 0 and row 1
// - ONLY WHEN HAVING -ONE- ROW/COL SELECTED will you be able
// to use row/col only functionality
// (it won't give errors or bugs if you try, though)
//
// SINGLE SELECTOR
// .field(integer row, integer col)
// Adds one field to the selection or (if selection is empty)
// returns one field to use field-level manipulations on
// .getPlayerRowField(integer player, integer column)
// .getPlayerColField(integer player, integer row)
// The above two return just ONE field of a player's row.
// Since the player selectors return an entire row and a deep
// selector inside that row would clear the selection first,
// it would otherwise be impossible to select multiple fields
// from player rows or columns...
// You should use this over .getPlayerRow(0).getField(3) unless
// you want only that field of course.
//
// DEEP SELECTOR
// .getField(integer which)
// Returns just ONE field, selected from your previous selection
//
// Quick list of what it does when used on a:
// - Board: Returns the field in position X of the board,
// reading from top left to bottom right
// - Row: Returns the field in column X of that row
// - Column: Returns the field in row X of that column
// - Fields: Returns the field in position X of the selection,
// reading from top left to bottom right
// - Field: Does nothing (returns same field)
//
//
// ----------------------------------------------------------------------
// Player Selectors
// ----------------------------------------------------------------------
//
// Simple functions that allow you to save a row/col to a player.
//
// Both the setters and the getters add the row/col you just set
// to the current selection. Hence, this is both valid syntax:
// - MB.setPlayerRow(0,1).setcolour("ff0000")
// - MB.setPlayerRow(0,1)
// MB.getPlayerRow(0,1).setcolour("ff0000")
//
// The player "setters" have -R functionality, but the "getters" don't!
//
// .setPlayerRow(integer player, integer row)
// .setPlayerCol(integer player, integer col)
// .getPlayerRow(integer player)
// .getPlayerCol(integer player)
//
//
// ----------------------------------------------------------------------
// Manipulation Functions - Also referred to as "setters"
// ----------------------------------------------------------------------
//
// Setters can be used on any jBoard object (boad, row, col, field(s))
// They always return the object that was just manipulated
//
// ABOUT PREFIXES AND SUFFIXES:
// Imagine you want a row with user experience values, by setting a suffix
// "XP", you could still use .add(value) to a field, because the content
// can still be handled by S2I(). Example:
// - .field(1,2) has content "2" and suffix " xp", the field shows "2 xp"
// A user calls .field(1,2).add(4), the field now show "6 xp", without
// having to worry about the " xp" bit!
//
// VALUE SETTERS
// .setValue("value")
// .setColour("rgb value")
// Colour syntax: rrggbb (in hexadecimal)
// .setPrefix("value")
// .setSuffix("value")
// .setIconPath("path")
// .setWidth(real width)
//
// VALUE MANIPULATORS
// .add(integer value)
// Only works if field contents are numerical strings, value can be negative
//
//
// ----------------------------------------------------------------------
// Retrieval Functions - Also referred to as "getters"
// ----------------------------------------------------------------------
//
// Getters can be used on any jBoard object (boad, row, col, field(s))
// !! EVERY GETTER RETURNS A STRING !!
//
// HERE'S WHY:
// When using a getter on anything but a single field, a string is returned
// with all values in it, separated by a pipe (|).
// Future versions may support smart retrieval of a row's/col's properties
// should they all have the same colour for example...
//
// Naturally, the fact that these methods return a string instead of a
// jBoard object means that calling any of these methods is in fact
// "The end of the line" for that chaining process...
//
// .getValue()
// .getColour()
// .getPrefix()
// .getSuffix()
// .getIconPath() -- CAREFUL USE on many fields! (might blow up in your face)
// .getWidth()
//
//
// ----------------------------------------------------------------------
// Extra Functions - Various
// ----------------------------------------------------------------------
//
// .showIcon()
// .hideIcon()
// .showValue()
// .hideValue()
//
//==============================================================================
//==============================================================================
// Credits:
//==============================================================================
//
// John Resig for coming up with jQuery and its chaining
// Vexorian for vJass and JassHelper, making jBoard possible
//
//==============================================================================
//==============================================================================
// Open letter to Vexorian:
//==============================================================================
//
// Take a look at the setter/getter methods and the -R functions. If that isn't
// a reason why textmacroes should be allowed to be nested, I don't know what
// is :x (They're all the same bar the function name...)
//
// Protip: Yes, this is a request to you to get nested textmacroes working :)
//
//==============================================================================
//==============================================================================
// Macro function core -- No touchy from here on out!
//==============================================================================
//! textmacro jBoardCreate takes NAME, ROWS, COLS
globals
private constant integer $NAME$SIZE = $ROWS$*$COLS$
private constant integer $NAME$ROWS = $ROWS$
private constant integer $NAME$COLS = $COLS$
endglobals
private struct $NAME$FIELD
$NAME$ parent
integer realRow
integer realCol
multiboarditem mbi
real width= jBoard.defaultItemWidth
string iconpath = jBoard.defaultIconPath
string colour = "ffffff"
string prefix = ""
string content = jBoard.defaultItemValue
string suffix = ""
boolean showV = jBoard.defaultShowValue
boolean showI = jBoard.defaultShowIcon
static method create takes $NAME$ parent, integer row, integer col returns thistype
local thistype f = thistype.allocate()
set f.parent = parent
set f.realRow = row
set f.realCol = col
set f.mbi = MultiboardGetItem(f.parent.MB,f.realRow,f.realCol)
return f
endmethod
method onDestroy takes nothing returns nothing
call MultiboardReleaseItem(.mbi)
endmethod
private method updateField takes nothing returns nothing
call MultiboardSetItemValue(.mbi,"|cff"+.colour+.prefix+.content+.suffix+"|r")
endmethod
method add takes integer i returns nothing
set .content = I2S(S2I(.content) + i)
call .updateField()
endmethod
method setValue takes string s returns nothing
set .content = s
call .updateField()
endmethod
method setPrefix takes string s returns nothing
set .prefix = s
call .updateField()
endmethod
method setSuffix takes string s returns nothing
set .suffix = s
call .updateField()
endmethod
method setColour takes string rgb returns nothing
set .colour = rgb
call .updateField()
endmethod
method setWidth takes real w returns nothing
set .width = w
call MultiboardSetItemWidth(.mbi,w)
endmethod
method showIcon takes nothing returns nothing
set .showI = true
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod
method hideIcon takes nothing returns nothing
set .showI = false
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod
method showValue takes nothing returns nothing
set .showV = true
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod
method hideValue takes nothing returns nothing
set .showV = false
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod
method setIconPath takes string s returns nothing
set .iconpath = s
call MultiboardSetItemIcon(.mbi,.iconpath)
endmethod
method getValue takes nothing returns string
return .content
endmethod
method getPrefix takes nothing returns string
return .prefix
endmethod
method getSuffix takes nothing returns string
return .suffix
endmethod
method getColour takes nothing returns string
return .colour
endmethod
method getWidth takes nothing returns string
return R2S(.width)
endmethod
method getIconPath takes nothing returns string
return .iconpath
endmethod
endstruct
private interface $NAME$FIELDCOLLECTION
$NAME$ parent
method getField takes integer i returns $NAME$FIELD
endinterface
private struct $NAME$UTILITY extends $NAME$FIELDCOLLECTION
stub method getField takes integer i returns $NAME$FIELD
return 0
endmethod
endstruct
private struct $NAME$ROW extends $NAME$UTILITY
$NAME$FIELD array fields[$COLS$]
integer realPos
integer fromPlayer = -1
static method create takes $NAME$ parent, integer pos returns thistype
local thistype row = thistype.allocate()
local integer i = 0
set row.parent = parent
set row.realPos = pos
loop
exitwhen i == $NAME$COLS
set row.fields[i] = $NAME$FIELD.create(parent,pos,i)
set i = i + 1
endloop
return row
endmethod
method getField takes integer i returns $NAME$FIELD
return .fields[i]
endmethod
endstruct
private struct $NAME$COL extends $NAME$UTILITY
$NAME$FIELD array fields[$ROWS$]
integer realPos
integer fromPlayer = -1
static method create takes $NAME$ parent, integer pos returns thistype
local thistype col = thistype.allocate()
local integer i = 0
set col.parent = parent
set col.realPos = pos
loop
exitwhen i == $NAME$ROWS
set col.fields[i] = col.parent.rows[i].fields[pos]
set i = i + 1
endloop
return col
endmethod
method getField takes integer i returns $NAME$FIELD
return .fields[i]
endmethod
endstruct
private struct $NAME$FLD extends $NAME$UTILITY
$NAME$FIELD array fields[$NAME$SIZE]
static method create takes $NAME$ parent returns thistype
local thistype fld = thistype.allocate()
set fld.parent = parent
return fld
endmethod
private method hasField takes $NAME$FIELD f returns boolean
local integer i = 0
loop
exitwhen i == .parent.selectionAmount
if (.fields[i] == f) then
return true
endif
set i = i + 1
endloop
return false
endmethod
method addFields takes $NAME$FIELDCOLLECTION f, integer amount returns nothing
local integer i = 0
loop
exitwhen i == amount
if not(.hasField(f.getField(i))) then
set .fields[.parent.selectionAmount] = f.getField(i)
set .parent.selectionAmount = .parent.selectionAmount + 1
endif
set i = i + 1
endloop
endmethod
method getField takes integer i returns $NAME$FIELD
return .fields[i]
endmethod
endstruct
struct $NAME$ extends jBoard
$NAME$ROW array rows[$ROWS$]
$NAME$COL array cols[$COLS$]
$NAME$FLD selection
static method create takes string boardName returns thistype
local thistype board = thistype.allocate(boardName)
local integer i = 0
call MultiboardSetRowCount(board.MB,$NAME$ROWS)
call MultiboardSetColumnCount(board.MB,$NAME$COLS)
set board.selection = $NAME$FLD.create(board)
loop
exitwhen i == $NAME$ROWS
set board.rows[i] = $NAME$ROW.create(board,i)
set i = i + 1
endloop
set i = 0
loop
exitwhen i == $NAME$COLS
set board.cols[i] = $NAME$COL.create(board,i)
set i = i + 1
endloop
call board.initBoard()
return board
endmethod
private method transfer takes $NAME$FIELDCOLLECTION f, integer ftype, integer amount returns nothing
set .selectionLevel = IntegerTertiaryOp(.selectionLevel == jBoard_SELECTION_LVL_BOARD,ftype,jBoard_SELECTION_LVL_FIELDS)
call .selection.addFields(f,amount)
endmethod
method reset takes nothing returns thistype
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
set .selectionAmount = 0
return this
endmethod
method field takes integer row, integer col returns thistype
set .selection.fields[0] = .rows[row].fields[col]
set .selectionLevel = jBoard_SELECTION_LVL_FLD
return this
endmethod
method getField takes integer which returns thistype
if .selectionLevel == jBoard_SELECTION_LVL_ROW then
set .selection.fields[0] = .rows[.selectionSpecial].fields[which]
elseif .selectionLevel == jBoard_SELECTION_LVL_COL then
set .selection.fields[0] = .cols[.selectionSpecial].fields[which]
elseif .selectionLevel == jBoard_SELECTION_LVL_FIELDS then
set .selection.fields[0] = .selection.fields[which]
elseif .selectionLevel == jBoard_SELECTION_LVL_BOARD then
set .selection.fields[0] = .rows[which/$NAME$COLS].fields[ModuloInteger(which,$NAME$COLS)]
endif
set .selectionLevel = jBoard_SELECTION_LVL_FLD
return this
endmethod
method row takes integer start, integer end returns thistype
local integer i = IntegerTertiaryOp(start<end,start,end)
local integer j = IntegerTertiaryOp(start<end,end,start)
if start == end then
set .selectionSpecial = start
call .transfer(.rows[start],jBoard_SELECTION_LVL_ROW,$NAME$COLS)
else
loop
exitwhen i > j
call .transfer(.rows[i],jBoard_SELECTION_LVL_ROW,$NAME$COLS)
set i = i + 1
endloop
endif
return this
endmethod
method col takes integer start, integer end returns thistype
local integer i = IntegerTertiaryOp(start<end,start,end)
local integer j = IntegerTertiaryOp(start<end,end,start)
if start == end then
set .selectionSpecial = start
call .transfer(.cols[start],jBoard_SELECTION_LVL_COL,$NAME$ROWS)
else
loop
exitwhen i > j
call .transfer(.cols[i],jBoard_SELECTION_LVL_COL,$NAME$ROWS)
set i = i + 1
endloop
endif
return this
endmethod
method setPlayerRow takes integer p, integer row returns thistype
set .playerRow[p] = row
set .rows[row].fromPlayer = p
return .row(row,row)
endmethod
method getPlayerRow takes integer p returns thistype
return .row(.playerRow[p],.playerRow[p])
endmethod
method getPlayerRowField takes integer p, integer i returns thistype
return .field(.playerRow[p],i)
endmethod
method setPlayerCol takes integer p, integer col returns thistype
set .playerCol[p] = col
set .cols[col].fromPlayer = p
return .col(col,col)
endmethod
method getPlayerCol takes integer p returns thistype
return .col(.playerCol[p],.playerCol[p])
endmethod
method getPlayerColField takes integer p, integer i returns thistype
return .field(i,.playerCol[p])
endmethod
method setColour takes string rgb returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setColour(rgb)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setColour(rgb)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setColour(rgb)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setColour(rgb)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setColour(rgb)
endif
return this
endmethod
method setWidth takes real w returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setWidth(w)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setWidth(w)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setWidth(w)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setWidth(w)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setWidth(w)
endif
return this
endmethod
method setPrefix takes string val returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setPrefix(val)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setPrefix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setPrefix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setPrefix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setPrefix(val)
endif
return this
endmethod
method setSuffix takes string val returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setSuffix(val)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setSuffix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setSuffix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setSuffix(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setSuffix(val)
endif
return this
endmethod
method setIconPath takes string val returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setIconPath(val)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setIconPath(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setIconPath(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setIconPath(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setIconPath(val)
endif
return this
endmethod
method showIcon takes nothing returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).showIcon()
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].showIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].showIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].showIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].showIcon()
endif
return this
endmethod
method hideIcon takes nothing returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).hideIcon()
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].hideIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].hideIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].hideIcon()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].hideIcon()
endif
return this
endmethod
method showValue takes nothing returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).showValue()
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].showValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].showValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].showValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].showValue()
endif
return this
endmethod
method hideValue takes nothing returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).hideValue()
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].hideValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].hideValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].hideValue()
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].hideValue()
endif
return this
endmethod
method setValue takes string val returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).setValue(val)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].setValue(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].setValue(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].setValue(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].setValue(val)
endif
return this
endmethod
method add takes integer val returns thistype
local integer i = 0
if (.selectionLevel == jBoard_SELECTION_LVL_BOARD) then
loop
exitwhen i == $NAME$ROWS
call .reset().row(i,i).add(val)
set i = i + 1
endloop
set .selectionLevel = jBoard_SELECTION_LVL_BOARD
elseif (.selectionLevel == jBoard_SELECTION_LVL_FIELDS) then
loop
exitwhen i == .selectionAmount
call .selection.fields[i].add(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_ROW) then
loop
exitwhen i == $NAME$COLS
call .rows[.selectionSpecial].fields[i].add(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_COL) then
loop
exitwhen i == $NAME$ROWS
call .cols[.selectionSpecial].fields[i].add(val)
set i = i + 1
endloop
elseif (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
call .selection.fields[0].add(val)
endif
return this
endmethod
method getValue takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getValue()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getValue()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method getPrefix takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getPrefix()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getPrefix()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method getSuffix takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getSuffix()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getSuffix()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method getWidth takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getWidth()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getWidth()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method getColour takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getColour()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getColour()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method getIconPath takes nothing returns string
local integer i = 0
local string s = ""
if (.selectionLevel == jBoard_SELECTION_LVL_FLD) then
set s = .selection.fields[0].getIconPath()
else
loop
exitwhen i == .selectionAmount
set s = s + .selection.fields[i].getIconPath()
set i = i + 1
exitwhen i == .selectionAmount
set s = s + "|"
endloop
endif
call .reset()
return s
endmethod
method setName takes string s returns thistype
set .boardName = s
call MultiboardSetTitleText(.MB,"|cff"+.boardNameColour+.boardName+"|r")
return this
endmethod
method getName takes nothing returns string
call .reset()
return .boardName
endmethod
method setNameColour takes string s returns thistype
set .boardNameColour = s
call MultiboardSetTitleText(.MB,"|cff"+.boardNameColour+.boardName+"|r")
return this
endmethod
method getNameColour takes nothing returns string
call .reset()
return .boardNameColour
endmethod
method show takes nothing returns thistype
call MultiboardDisplay(.MB,true)
return this
endmethod
method hide takes nothing returns thistype
call MultiboardDisplay(.MB,false)
return this
endmethod
method clear takes nothing returns thistype
call MultiboardClear(.MB)
return this
endmethod
method fold takes nothing returns thistype
call MultiboardMinimize(.MB,true)
return this
endmethod
method unfold takes nothing returns thistype
call MultiboardMinimize(.MB,false)
return this
endmethod
method setValueR takes string val returns thistype
call .setValue(val)
call .reset()
return this
endmethod
method setColourR takes string rgb returns thistype
call .setColour(rgb)
call .reset()
return this
endmethod
method setPrefixR takes string val returns thistype
call .setPrefix(val)
call .reset()
return this
endmethod
method setSuffixR takes string val returns thistype
call .setSuffix(val)
call .reset()
return this
endmethod
method setIconPathR takes string val returns thistype
call .setIconPath(val)
call .reset()
return this
endmethod
method setWidthR takes real w returns thistype
call .setWidth(w)
call .reset()
return this
endmethod
method addR takes integer val returns thistype
call .add(val)
call .reset()
return this
endmethod
method setPlayerRowR takes integer p, integer col returns thistype
call .setPlayerRow(p,row)
call .reset()
return this
endmethod
method setPlayerColR takes integer p, integer col returns thistype
call .setPlayerCol(p,col)
call .reset()
return this
endmethod
method setNameR takes string s returns thistype
call .setName(s)
call .reset()
return this
endmethod
method setNameColourR takes string s returns thistype
call .setNameColour(s)
call .reset()
return this
endmethod
method showR takes nothing returns thistype
call .show()
call .reset()
return this
endmethod
method showIconR takes nothing returns thistype
call .showIcon()
call .reset()
return this
endmethod
method hideIconR takes nothing returns thistype
call .hideIcon()
call .reset()
return this
endmethod
method showValueR takes nothing returns thistype
call .showValue()
call .reset()
return this
endmethod
method hideValueR takes nothing returns thistype
call .hideValue()
call .reset()
return this
endmethod
method hideR takes nothing returns thistype
call .hide()
call .reset()
return this
endmethod
method clearR takes nothing returns thistype
call .clear()
call .reset()
return this
endmethod
method foldR takes nothing returns thistype
call .fold()
call .reset()
return this
endmethod
method unfoldR takes nothing returns thistype
call .unfold()
call .reset()
return this
endmethod
method destroy takes nothing returns nothing
local integer i = 0
local integer j = 0
loop
exitwhen i == $NAME$ROWS
loop
exitwhen j == $NAME$COLS
call rows[i].fields[j].destroy()
set j = j + 1
endloop
set i = i + 1
endloop
call DestroyMultiboard(.MB)
call .deallocate()
endmethod
endstruct
//! endtextmacro
/*method setItemIcon takes integer column, integer row, string iconFileName returns nothing
//Works similar to the MultiboardSetItem* functions.
//However, a value of 0 refers to the first column/row, -1 refers to all columns/rows
//Using a Column or Row higher than the current max will result in the function not doing anything.
local integer curCol = 0
local integer curRow = 0
if column > .columnCount or row > .rowCount then
return
endif
if column == -1 or row == -1 then
if column == -1 and row == -1 then
call MultiboardSetItemsIcon(.which,iconFileName)
return
elseif column == -1 then
loop
exitwhen curCol > .columnCount
call MultiboardSetItemIcon(.MBIZ[curCol * MAX_ROW_COUNT + row],iconFileName)
set curCol = curCol + 1
endloop
return
else
loop
exitwhen curRow > .rowCount
call MultiboardSetItemIcon(.MBIZ[column * MAX_ROW_COUNT + curRow],iconFileName)
set curRow = curRow + 1
endloop
return
endif
endif
call MultiboardSetItemIcon(.MBIZ[column * MAX_ROW_COUNT + row],iconFileName)
endmethod*/
//==============================================================================
// ACTUAL LIBRARY
//==============================================================================
library jBoardLib
globals
constant integer jBoard_SELECTION_LVL_BOARD = 0
constant integer jBoard_SELECTION_LVL_ROW = 1
constant integer jBoard_SELECTION_LVL_COL = 2
constant integer jBoard_SELECTION_LVL_FLD = 3
constant integer jBoard_SELECTION_LVL_FIELDS = 4
endglobals
struct jBoard
//! runtextmacro jBoardDefaults()
multiboard MB
string boardName
string boardNameColour = "ffffcc"
integer selectionLevel = 0
integer selectionSpecial = 0
integer selectionAmount = 0
integer array playerRow[12]
integer array playerCol[12]
static method create takes string boardName returns jBoard
local integer i = 0
set jB = thistype.allocate()
set jB.MB = CreateMultiboard()
set jB.boardName = boardName
call MultiboardSetTitleText(jB.MB,boardName)
call MultiboardDisplay(jB.MB,false)
return jB
endmethod
method initBoard takes nothing returns nothing
call MultiboardSetItemsValue(.MB,.defaultItemValue)
call MultiboardSetItemsStyle(.MB,.defaultShowValue,.defaultShowIcon)
call MultiboardSetItemsWidth(.MB,.defaultItemWidth)
call MultiboardDisplay(.MB,.defaultShowBoard)
endmethod
endstruct
endlibrary
//==============================================================================
// END OF jBoard ADVANCED MULTIBOARD SYSTEM
//==============================================================================
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library_once TimerUtils initializer init
//*********************************************************************
//* TimerUtils (Blue flavor for 1.23b or later)
//* ----------
//*
//* 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.wc3campaigns.net
//*
//* For your timer needs:
//* * Attaching
//* * Recycling (with double-free protection)
//*
//* set t=NewTimer() : Get a timer (alternative to CreateTimer)
//* 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.
//*
//* Blue Flavor: Slower than the red flavor, it got a 408000 handle id
//* limit, which means that if more than 408000 handle ids
//* are used in your map, TimerUtils might fail, this
//* value is quite big and it is much bigger than the
//* timer limit in Red flavor.
//*
//********************************************************************
//==================================================================================================
globals
private hashtable hasht //I <3 blizz
endglobals
//It is dependent on jasshelper's recent inlining optimization in order to perform correctly.
function SetTimerData takes timer t, integer value returns nothing
call SaveInteger(hasht,0, GetHandleId(t), value)
endfunction
function GetTimerData takes timer t returns integer
return LoadInteger(hasht, 0, GetHandleId(t))
endfunction
//==========================================================================================
globals
private timer array tT
private integer tN = 0
private constant integer HELD=0x28829022
//use a totally random number here, the more improbable someone uses it, the better.
endglobals
//==========================================================================================
function NewTimer takes nothing returns timer
if (tN==0) then
set tT[0]=CreateTimer()
else
set tN=tN-1
endif
call SetTimerData(tT[tN],0)
return tT[tN]
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==8191) 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
set hasht = InitHashtable()
endfunction
endlibrary
library xepreload initializer init requires xebasic, optional TimerUtils
//******************************************************************************
// xepreload 0.8
// ---------
// Ah, the joy of preloading abilities, it is such a necessary evil...
// Notice you are not supposed to use this system in places outside map init
//
// This one does the preloading and tries to minimize the hit on loading time
// for example, it only needs one single native call per ability preloaded.
//
//******************************************************************************
//==============================================================================
globals
private unit dum=null
endglobals
private keyword DebugIdInteger2IdString
//inline friendly (when debug mode is off..)
function XE_PreloadAbility takes integer abilid returns nothing
call UnitAddAbility(dum, abilid)
endfunction
// ................................................................................
//================================================================================
// Convert a integer id value into a 4-letter id code.
// * Taken from cheats.j so I don't have to code it again.
// * Used only on debug so making a whole library for it seemed silly
// * Private so people don't begin using xepreload just to call this function....
// * It will not work correctly if you paste this code in the custom script section
// due to the infamous % bug. Then again, if you do that then you probably
// deserve it....
//
private function DebugIdInteger2IdString takes integer value returns string
local string charMap = ".................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."
local string result = ""
local integer remainingValue = value
local integer charValue
local integer byteno
set byteno = 0
loop
set charValue = ModuloInteger(remainingValue, 256)
set remainingValue = remainingValue / 256
set result = SubString(charMap, charValue, charValue + 1) + result
set byteno = byteno + 1
exitwhen byteno == 4
endloop
return result
endfunction
//--------------------------------
private function kill takes nothing returns nothing
call RemoveUnit(dum)
set dum=null
//ifnottimerutils thencall DestroyTimer(GetExpiredTimer())
call ReleaseTimer( GetExpiredTimer() )
endfunction
private function init takes nothing returns nothing
local timer t
set dum = CreateUnit( Player(15), XE_DUMMY_UNITID, -60,-600,0)
if( dum == null) then
debug call BJDebugMsg("xePreload : XE_DUMMY_UNITID ("+DebugIdInteger2IdString.evaluate(XE_DUMMY_UNITID)+") not added correctly to the map.")
endif
//ifnotimterutilsthenset t=CreateTimer()
set t=NewTimer()
call TimerStart(t,0.0,false,function kill)
set t=null
endfunction
endlibrary
library xebasic
//**************************************************************************
//
// xebasic 0.4
// =======
// XE_DUMMY_UNITID : Rawcode of the dummy unit in your map. It should
// use the dummy.mdx model, so remember to import it as
// well, just use copy&paste to copy the dummy from the
// xe map to yours, then change the rawcode.
//
// XE_HEIGHT_ENABLER: Medivh's raven form ability, you may need to change
//this rawcode to another spell that morphs into a flier
//in case you modified medivh's spell in your map.
//
// XE_TREE_RECOGNITION: The ancients' Eat tree ability, same as with medivh
// raven form, you might have to change it.
//
// XE_ANIMATION_PERIOD: The global period of animation used by whatever
// timer that depends on it, if you put a low value
// the movement will look good but it may hurt your
// performance, if instead you use a high value it
// will not lag but will be fast.
//
// XE_MAX_COLLISION_SIZE: The maximum unit collision size in your map, if
//you got a unit bigger than 197.0 it would be
//a good idea to update this constant, since some
//enums will not find it. Likewise, if none of
//your units can go bellow X and X is much smaller
//than 197.0, it would be a good idea to update
//as well, since it will improve the performance
//those enums.
//
// Notice you probably don't have to update this library, unless I specify
// there are new constants which would be unlikely.
//
//**************************************************************************
//===========================================================================
globals
constant integer XE_DUMMY_UNITID = 'earc'
constant integer XE_HEIGHT_ENABLER = 'Amrf'
constant integer XE_TREE_RECOGNITION = 'Aeat'
constant real XE_ANIMATION_PERIOD = 0.025
constant real XE_MAX_COLLISION_SIZE = 197.0
endglobals
endlibrary
//==============================================================================
// TEXT TAG - Floating text system by Cohadar - v4.0
//==============================================================================
//
// PURPOUSE:
// * Displaying floating text - the easy way
// * Text is automatically centered depending on it's length
//
// FUNCTION LIST:
// * TextTag_XY(x, y, text, color)
// * TextTag_Unit(unit, text, color)
// * TextTag_GoldBounty(unit, text, killer)
// * TextTag_LumberBounty(unit, text, killer)
//
// color is a color string, example: "|c00FFCC00"
// killer is a killing player, usually: GetOwningPlayer(GetKillingUnit())
// (bounty text is visible only to killer)
//
// HOW TO IMPORT:
// * Just create a trigger named TextTag
// convert it to text and replace the whole trigger text with this one
//==============================================================================
library TextTag
globals
private constant integer MEAN_CHAR_WIDTH = 8
private constant integer MAX_TEXT_SHIFT = 32
private constant real FONT_SIZE = 0.025
private constant real VELOCITY_X = 0
private constant real VELOCITY_Y = .04
private constant real LIFESPAN = 4
private constant real HEIGHT = 16
private constant real FADE_POINT = 2.5
endglobals
//===========================================================================
public function XY takes real x, real y, string text, string color returns nothing
local texttag t = CreateTextTag()
local integer shift = IMinBJ(StringLength(text), MAX_TEXT_SHIFT) * MEAN_CHAR_WIDTH
call SetTextTagText(t, color+text, FONT_SIZE)
call SetTextTagPos(t, x-shift, y, HEIGHT)
call SetTextTagVelocity(t, VELOCITY_X, VELOCITY_Y)
call SetTextTagVisibility(t, true)
call SetTextTagFadepoint(t, FADE_POINT)
call SetTextTagLifespan(t, LIFESPAN)
call SetTextTagPermanent(t, false)
set t = null
endfunction
//===========================================================================
public function Unit takes unit whichUnit, string text, string color returns nothing
local texttag t = CreateTextTag()
local integer shift = IMinBJ(StringLength(text), MAX_TEXT_SHIFT) * MEAN_CHAR_WIDTH
call SetTextTagText(t, color+text, FONT_SIZE)
call SetTextTagPos(t, GetUnitX(whichUnit)-shift, GetUnitY(whichUnit), HEIGHT)
call SetTextTagVelocity(t, VELOCITY_X, VELOCITY_Y)
call SetTextTagVisibility(t, true)
call SetTextTagFadepoint(t, FADE_POINT)
call SetTextTagLifespan(t, LIFESPAN)
call SetTextTagPermanent(t, false)
set t = null
endfunction
//===========================================================================
public function GoldBounty takes unit whichUnit, string text, player killer returns nothing
local texttag t = CreateTextTag()
local integer shift = IMinBJ(StringLength(text), MAX_TEXT_SHIFT) * MEAN_CHAR_WIDTH
call SetTextTagText(t, text, FONT_SIZE)
call SetTextTagPos(t, GetUnitX(whichUnit)-shift, GetUnitY(whichUnit), HEIGHT)
call SetTextTagColor(t, 255, 220, 0, 255)
call SetTextTagVelocity(t, VELOCITY_X, VELOCITY_Y)
call SetTextTagVisibility(t, GetLocalPlayer()==killer)
call SetTextTagFadepoint(t, FADE_POINT)
call SetTextTagLifespan(t, LIFESPAN)
call SetTextTagPermanent(t, false)
set t = null
endfunction
//==============================================================================
public function LumberBounty takes unit whichUnit, string text, player killer returns nothing
local texttag t = CreateTextTag()
local integer shift = IMinBJ(StringLength(text), MAX_TEXT_SHIFT) * MEAN_CHAR_WIDTH
call SetTextTagText(t, text, FONT_SIZE)
call SetTextTagPos(t, GetUnitX(whichUnit)-shift, GetUnitY(whichUnit), HEIGHT)
call SetTextTagColor(t, 0, 196, 0, 255)
call SetTextTagVelocity(t, VELOCITY_X, VELOCITY_Y)
call SetTextTagVisibility(t, GetLocalPlayer()==killer)
call SetTextTagFadepoint(t, FADE_POINT)
call SetTextTagLifespan(t, LIFESPAN)
call SetTextTagPermanent(t, false)
set t = null
endfunction
endlibrary
library Pool
//******************************************************************************
//* BY: Rising_Dusk
//*
//* This script gives the user access to general integer pools. A pool is a data
//* structure that allows you to give entries to it a weight. This weight
//* essentially scales how likely certain random accesses to the pool will be
//* returned by the internal .getRandomInt method. Pools can be useful in any
//* number of ways, such as item drops, randomizing enemy encounters, randomly
//* selecting rects weighted by area, and so forth.
//*
//******************************************************************************
//*
//* Example usage:
//* local intpool ip = intpool.create()
//* call ip.addInt(1, 1.0)
//* call ip.addInt(2, 0.5)
//* call ip.getRInt()
//* call ip.getChance(2)
//* call ip.getWeight(2)
//* call ip.removeInt(1)
//* //or
//8 globals
/// intpool firstip
/// intpool secondip
/// endglobals
// //later on:
/// set firstip=intpool.create()
//* call firstip.addInt(1, 1.0)
//* call firstip.addInt(2, 0.5)
//* call firstip.getRInt()
//* call firstip.getChance(2)
//* call firstip.getWeight(2)
//* call firstip.removeInt(1)
//* //etc...
/// //global intpool are usually easier to use because you don't have to keep
/// //creating them over and over again and unless they need to change with
/// //events or time or whatever you only need 1 line to use them.
/// //that is, call nameofintpool.getRInt()
///
//* You will first need to create an intpool as shown above. Once you've done
//* that, you may use the .addInt method to add an entry to the pool with a
//* specific weight. The example above adds 2 integers, one twice as likely to
//* be randomly selected as the other. That means for the above example, the
//* .getRInt method will 66% of the time return 1 and 33% of the time
//* return 2. If you want to remove an entry from an intpool, the .removeInt
//* method is what you will want to use. If you would like to update an entry's
//* weight after already adding it, simply use .addInt again with the new
//* weight.
//*
//* The .getChance and .getWeight methods are there for convenience. If you are
//* interested in the exact chance of the intpool returning a specific entry,
//* then you should use .getChance to obtain the decimal chance out of 1. If you
//* want to know the weight input for a specific entry, .getWeight will return
//* that for you.
//*
//* When adding an entry to the intpool with .addInt, the actual magnitude of
//* the weight doesn't matter. What matters is its magnitude relative to the
//* magnitudes of all other entries in the intpool. This means that it is ok to
//* use very large or very small weights and is done at the user's discretion.
//*
//* It is worth noting that if you use .getRInt on an intpool with no
//* entries, the function will return INTPOOL_NO_ENTRIES, which is about as
//* random an integer as possible so as to avoid people accidentally using it.
//*
globals
//These constants can be changed//i think he meant to say can change the value
private constant integer MAX_INSTANCES = 2500//8191//current is about 2?
//i don't understand how the numbers work...
private constant integer MAX_ENTRIES = 150//256//current is around 43?
constant integer INTPOOL_NO_ENTRIES = 0x672819
//what is the point? why not return 0? what is that integer!?
//Don't change the following global declaration//i changed it lol(the name)
private hashtable poolht = InitHashtable()
endglobals
struct intpool[MAX_INSTANCES]
private integer Cnt = 0
private real WeightTotal = 0.
private integer array Entries[MAX_ENTRIES]
private real array Weights[MAX_ENTRIES]
method getWeight takes integer entry returns real
return Weights[LoadInteger(poolht, integer(this), entry)]
endmethod
method getChance takes integer entry returns real
if WeightTotal > 0. then
return Weights[LoadInteger(poolht, integer(this), entry)]/WeightTotal
endif
return 0.
endmethod
method addInt takes integer entry, real weight returns nothing
local integer in = 0
if .Cnt == MAX_ENTRIES then
//Can't hold any more entries
debug call BJDebugMsg(SCOPE_PREFIX+"Error: .addEntry has reached MAX_ENTRIES")
return
elseif weight <= 0. then
//Zero or negative weights make no sense
debug call BJDebugMsg(SCOPE_PREFIX+"Error: .addEntry can't take zero or negative weights")
return
endif
set in = LoadInteger(poolht, integer(this), entry)
if in > 0 then
//Update old entry
set .WeightTotal = .WeightTotal - .Weights[in] + weight
set .Weights[in] = weight
else
//Make a new entry
set .Cnt = .Cnt + 1
call SaveInteger(poolht, integer(this), entry, .Cnt)
set .Entries[.Cnt] = entry
set .Weights[.Cnt] = weight
set .WeightTotal = .WeightTotal + weight
endif
endmethod
method removeInt takes integer entry returns nothing
local integer in = LoadInteger(poolht, integer(this), entry)
if in > 0 then
call RemoveSavedInteger(poolht, integer(this), entry)
//Remove its entry in the arrays
set .WeightTotal = .WeightTotal - .Weights[in]
set .Entries[in] = .Entries[.Cnt]
set .Weights[in] = .Weights[.Cnt]
set .Cnt = .Cnt - 1
debug else
debug call BJDebugMsg(SCOPE_PREFIX+"Error: .removeEntry entry doesn't exist")
endif
endmethod
method getRInt takes nothing returns integer
local real r = GetRandomReal(0, .WeightTotal)
local integer c = 0
if .WeightTotal <= 0. then
debug call BJDebugMsg(SCOPE_PREFIX+"Error: intpool has no entries")
return INTPOOL_NO_ENTRIES
endif
loop
set r = r - .Weights[c]
exitwhen r <= 0
set c = c + 1
endloop
return .Entries[c]
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ParabolicMovement2
function ParabolaZ2 takes real y0, real y1, real h, real d, real x returns real
local real A = (2*(y0+y1)-4*h)/(d*d)
local real B = (y1-y0-A*d*d)/d
return A*x*x + B*x + y0
endfunction
endlibrary
library TimedLoop
//********************************************************
//* TimedLoop
//* ---------
//*
//* Requires jasshelper 0.9.G.1 or greater.
//*
//* A library + module that are meant to make those
//* array + timer loops easy, yet still faster than
//* other alternatives meant to be easy (In other words
//* no TriggerEvaluate is involved).
//*
//* The OOPness is interesting.
//*
//* Before implementing TimedLoop
//* your struct needs an onTimedLoop method that takes
//* nothing and returns boolean, if the method
//* returns false, the instance will get removed
//* from the loop and destroyed, else it will continue,
//* think of it as if the call asks the method a
//* question: "Should I continue the loop afterwards?"
//*
//* Alternatively, if you are not convinced, you may
//* use the TimedLoop_CONTINUE and TimedLoop_STOP
//* constants in the method's returns.
//*
//* After implementing TimedLoop, you can call
//* the startTimedLoop method to add the periodic event
//* to that instance, only call it once per instance.
//*
//* I recommend to call implement just bellow the
//* declaration of the onLoop method, else it will
//* actually use TriggerEvaluate, which is lame. Remind
//* me to implement a topsort in jasshelper.
//*
//* If you feel the need to destroy the struct outside
//* the loop, well, you'll have to add a flag to it so
//* you send a message to onLoop to make it return false.
//* A more complicated module to allow that easily would
//* come later.
//*
//********************************************************
//========================================================
// config:
globals
public constant real PERIOD = 0.025
// A lower value and everything using the module will
// look better, yet performance will drop.
endglobals
//========================================================
// implementation:
//
globals
public constant boolean STOP = false
public constant boolean CONTINUE = true
endglobals
//===========================
module TimedLoop
// god bless private module members.
//
private static thistype array V // The array
private static integer N = 0 // The count
private static timer T = null // the timer, one per
// struct that implements this
private static method onExpire takes nothing returns nothing
local integer n = 0
local thistype this // yay for odd-sounding syntax constructs
local integer i = 0
loop
exitwhen (i== thistype.N)
set this = .V[i]
if ( this.onTimedLoop() == CONTINUE ) then
set .V[n] = this
set n=n+1
else
call this.destroy()
endif
set i=i+1
endloop
set thistype.N = n
if (n== 0) then
call PauseTimer(.T)
endif
endmethod
public method startTimedLoop takes nothing returns nothing
set .V[.N] = this
set .N=.N + 1
if (.N == 1) then
if (.T == null) then
set .T = CreateTimer()
endif
call TimerStart(.T, PERIOD, true, function thistype.onExpire)
endif
endmethod
endmodule
endlibrary
//Requires:
//TimedLoop
//xebasic
//ParabolicMovement2.
//It is also recommended to use BoundSentinel in most cases, but this is not neccesary.
//function UnitJump takes unit whichunit, real speed, real distance, real direction, real height returns nothing
//whichunit is the unit that you want to move.
//speed is how fast the unit is moving.
//distance is how far the unit will be moved.
//height is the maximum height of the parabola.
library JumpSystem requires TimedLoop, xebasic, ParabolicMovement2
private struct Jump
static location Loc = Location(0, 0)
implement TimedLoop
unit target
real distance = 0
real increment
real max
real p
real x = 0
real y = 0
real cos
real sin
real height
real y0
real y1
method onTimedLoop takes nothing returns boolean
set this.x = this.x + this.cos
set this.y = this.y + this.sin
set this.distance = this.distance + this.increment
call MoveLocation(Loc, this.x, this.y)
call SetUnitFlyHeight(this.target, ParabolaZ2(this.y0, this.y1, this.height,this.max,this.distance) - GetLocationZ(Loc), 0)
call SetUnitX(this.target, this.x)
call SetUnitY(this.target, this.y)
if this.distance >= this.max then
return TimedLoop_STOP
endif
return TimedLoop_CONTINUE
endmethod
static method create takes unit whichunit, real speed, real distance, real direction, real height returns thistype
local thistype d = thistype.allocate()
local real r
set d.target = whichunit
set d.max = distance
set d.increment = speed * TimedLoop_PERIOD
set d.cos = d.increment * Cos(direction)
set d.sin = d.increment * Sin(direction)
set d.height = height
set d.x = GetUnitX(whichunit)
set d.y = GetUnitY(whichunit)
call MoveLocation(Loc, d.x, d.y)
set d.y0 = GetLocationZ(Loc)
call MoveLocation(Loc, d.x + distance * Cos(direction), d.y + distance * Sin(direction))
set d.y1 = GetLocationZ(Loc)
call UnitAddAbility(d.target, XE_HEIGHT_ENABLER)
call UnitRemoveAbility(d.target, XE_HEIGHT_ENABLER)
call d.startTimedLoop()
return d
endmethod
endstruct
function UnitJump takes unit whichunit, real speed, real distance, real direction, real height returns nothing
call Jump.create(whichunit, speed, distance, direction, height)
endfunction
endlibrary
//TESH.scrollpos=519
//TESH.alwaysfold=0
//table,advancedtable,spellevent,gt
////////////////////////////////////
library Table
//! textmacro Table__make takes name, type, key
struct $name$
private integer value
private thistype next
private thistype prev
private integer data
private boolean haveValue
static method create takes nothing returns thistype
local thistype this = .allocate()
set .next = this
set .prev = this
set .haveValue = false
return this
endmethod
method operator []= takes $type$ key, integer data returns nothing
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
if id == this then
set id = .allocate()
set .next.prev = id
set id.next = .next
set .next = id
set id.prev = this
set id.value = target
set id.haveValue = true
endif
set id.data = data
endmethod
method operator [] takes $type$ key returns integer
local thistype id = this.next
local integer target = $key$
loop
if id.value == target then
return id.data
endif
exitwhen id == this
set id = id.next
endloop
return 0
endmethod
method flush takes $type$ key returns nothing
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
if id.value == target then
set id.next.prev = id.prev
set id.prev.next = id.next
set id.next = 0
set id.prev = 0
set id.value = 0
set id.data = 0
set id.haveValue = false
call id.deallocate()
endif
endmethod
method exists takes $type$ key returns boolean
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
return id.haveValue
endmethod
method reset takes nothing returns nothing
local thistype id = this.next
local thistype temp
loop
exitwhen id == this
set id.next.prev = id.prev
set id.prev.next = id.next
set temp = id.next
set id.next = 0
set id.prev = 0
set id.value = 0
set id.data = 0
set id.haveValue = false
call id.deallocate()
set id = temp
endloop
endmethod
endstruct
//! endtextmacro
//! runtextmacro Table__make("Table","integer","key" )
//! runtextmacro Table__make("StringTable","string", "StringHash(key)" )
//! runtextmacro Table__make("HandleTable","handle","GetHandleId(key)" )
endlibrary
library AdvancedTable
//! textmacro TableEx__make takes name, varsType, varsNull, type, key
struct $name$Table
private integer value
private thistype next
private thistype prev
private $varsType$ data
private boolean haveValue
static method create takes nothing returns thistype
local thistype this = .allocate()
set .next = this
set .prev = this
set .haveValue = false
return this
endmethod
method operator []= takes $type$ key, $varsType$ data returns nothing
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
if id == this then
set id = .allocate()
set .next.prev = id
set id.next = .next
set .next = id
set id.prev = this
set id.value = target
set id.haveValue = true
endif
set id.data = data
endmethod
method operator [] takes $type$ key returns $varsType$
local thistype id = this.next
local integer target = $key$
loop
if id.value == target then
return id.data
endif
exitwhen id == this
set id = id.next
endloop
return $varsNull$
endmethod
method flush takes $type$ key returns nothing
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
if id.value == target then
set id.next.prev = id.prev
set id.prev.next = id.next
set id.next = 0
set id.prev = 0
set id.value = 0
set id.data = $varsNull$
set id.haveValue = false
call id.deallocate()
endif
endmethod
method exists takes $type$ key returns boolean
local thistype id = this.next
local integer target = $key$
loop
exitwhen id.value == target or id == this
set id = id.next
endloop
return id.haveValue
endmethod
method reset takes nothing returns nothing
local thistype id = this.next
local thistype temp
loop
exitwhen id == this
set id.next.prev = id.prev
set id.prev.next = id.next
set temp = id.next
set id.next = 0
set id.prev = 0
set id.value = 0
set id.data = $varsNull$
set id.haveValue = false
call id.deallocate()
set id = temp
endloop
endmethod
endstruct
//! endtextmacro
//! runtextmacro TableEx__make ("Integer","integer","0","integer","key")
//! runtextmacro TableEx__make ("Boolean","boolean","false","integer","key")
//! runtextmacro TableEx__make ("Unit","unit","null","integer","key")
//! runtextmacro TableEx__make ("Item","item","null","integer","key")
//! runtextmacro TableEx__make ("Destructable","destructable","null","destructable","GetHandleId(key)")
endlibrary
/////////////////////////////////////////////
library SpellEvent initializer Init requires Table
//*****************************************************************
//* SPELL EVENT LIBRARY 1.1
//*
//* written by: Anitarf
//* requires: -Table
//*
//* Maps with many triggered spells require many triggers that run
//* on spell events and whenever a spell is cast, all those
//* triggers need to be evaluated by the game even though only one
//* actually needs to run. This library has been written to reduce
//* the number of triggers in such maps; instead of having a
//* trigger per spell, you can use this library's single trigger
//* to only run the code associated with the spell that's actually
//* being cast.
//*
//* Perhaps more significant than the marginal speed gain is the
//* feature that allows you to access all the spell event
//* responses from all spell events, something that the native
//* functions senselessly do not support. With this system you can
//* for example easily get the target unit of the spell on the
//* casting finish event.
//*
//* All functions following the Response function interface that
//* is defined at the start of this library can be used to respond
//* to damage events. Simply put them on the call list for any of
//* the spell events using the appropriate function:
//*
//* function RegisterSpellChannelResponse takes integer spellId, Response r returns nothing
//* function RegisterSpellCastResponse takes integer spellId, Response r returns nothing
//* function RegisterSpellEffectResponse takes integer spellId, Response r returns nothing
//* function RegisterSpellFinishResponse takes integer spellId, Response r returns nothing
//* function RegisterSpellEndCastResponse takes integer spellId, Response r returns nothing
//*
//* The first event occurs at the very start of the spell, when
//* the spell's casting time begins; most spells have 0 casting
//* time, so in most cases this first event occurs at the same
//* time as the second one, which runs when the unit actually
//* begins casting a spell by starting it's spell animation. The
//* third event occurs when the spell effect actually takes place,
//* which happens sometime into the unit's spell animation
//* depending on the unit's Animation - Cast Point property.
//* The fourth event runs if the unit finishes casting the spell
//* uninterrupted, which might be important for channeling spells.
//* The last event runs when the unit stops casting the spell,
//* regardless of whether it finished casting or was interrupted.
//*
//* If you specify a spell id when registering a function then
//* that function will only run when that ability is cast; only
//* one function per ability per event is supported, if you
//* register more functions then only the last one registered will
//* be called. If, however, you pass 0 as the ability id parameter
//* then the registered function will run for all spells. Up to
//* 8190 functions can be registered this way for each event.
//* These functions will be called before the ability's specific
//* function in the order they were registered.
//*
//* This library provides it's own event responses that work
//* better than the Blizzard's bugged native cast event responses.
//* They still aren't guaranteed to work after a wait, but aside
//* from that they will work in response functions no matter what
//* event they are registered to.
//*
//* Here are usage examples for all event responses:
//*
//* local integer a = SpellEvent.AbilityId
//* local unit u = SpellEvent.CastingUnit
//* local unit t = SpellEvent.TargetUnit
//* local item i = SpellEvent.TargetItem
//* local destructable d = SpellEvent.TargetDestructable
//* local location l = SpellEvent.TargetLoc
//* local real x = SpellEvent.TargetX
//* local real y = SpellEvent.TargetY
//* local boolean b = SpellEvent.CastFinished
//*
//* SpellEvent.TargetLoc is provided for odd people who insist on
//* using locations, note that if you use it you have to cleanup
//* the returned location yourself.
//*
//* SpellEvent.CastFinished boolean is intended only for the
//* EndCast event as it tells you whether the spell finished or
//* was interrupted.
//*
//* Note that a few spells such as Berserk and Wind Walk behave
//* somewhat differently from regular spells: they are cast
//* instantly without regard for cast animation times, they do not
//* interrupt the unit's current order, as well as any spell it
//* may be casting. SpellEvent can now handle such spells without
//* errors provided they are truly instant (without casting time).
//*
//*****************************************************************
// use the RegisterSpell*Response functions to add spell event responses to the library
public function interface Response takes nothing returns nothing
// ================================================================
private keyword casterTable
private keyword effectDone
private keyword init
private keyword get
private struct spellEvent
static HandleTable casterTable
boolean effectDone=false
integer AbilityId
unit CastingUnit
unit TargetUnit
item TargetItem=null
destructable TargetDestructable=null
real TargetX=0.0
real TargetY=0.0
boolean CastFinished=false
private spellEvent interrupt
method operator TargetLoc takes nothing returns location
return Location(.TargetX, .TargetY)
endmethod
private static method create takes nothing returns spellEvent
return spellEvent.allocate()
endmethod
static method init takes nothing returns spellEvent
local spellEvent s=spellEvent.allocate()
set s.AbilityId = GetSpellAbilityId()
set s.CastingUnit = GetTriggerUnit()
set s.TargetUnit = GetSpellTargetUnit()
if s.TargetUnit != null then
set s.TargetX = GetUnitX(s.TargetUnit)
set s.TargetY = GetUnitY(s.TargetUnit)
else
set s.TargetDestructable = GetSpellTargetDestructable()
if s.TargetDestructable != null then
set s.TargetX = GetDestructableX(s.TargetDestructable)
set s.TargetY = GetDestructableY(s.TargetDestructable)
else
set s.TargetItem = GetSpellTargetItem()
if s.TargetItem != null then
set s.TargetX = GetItemX(s.TargetItem)
set s.TargetY = GetItemY(s.TargetItem)
else
set s.TargetX = GetSpellTargetX()
set s.TargetY = GetSpellTargetY()
endif
endif
endif
set s.interrupt=spellEvent.casterTable[s.CastingUnit]
set spellEvent.casterTable[s.CastingUnit]=integer(s)
return s
endmethod
static method get takes unit caster returns spellEvent
return spellEvent(spellEvent.casterTable[caster])
endmethod
method onDestroy takes nothing returns nothing
if .interrupt==0 then
call spellEvent.casterTable.flush(.CastingUnit)
else
set spellEvent.casterTable[.CastingUnit]=.interrupt
endif
set .CastingUnit=null
endmethod
endstruct
globals
spellEvent SpellEvent=0
endglobals
// ================================================================
//! textmacro spellEvent_make takes name
globals
private Response array $name$CallList
private integer $name$CallCount=0
private Table $name$Table
endglobals
private function $name$Calls takes nothing returns nothing
local integer i=0
local integer id=GetSpellAbilityId()
local spellEvent previous=SpellEvent
set SpellEvent=spellEvent.get(GetTriggerUnit())
loop
exitwhen i>=$name$CallCount
call $name$CallList[i].evaluate()
set i=i+1
endloop
if $name$Table.exists(id) then
call Response($name$Table[id]).evaluate()
endif
set SpellEvent=previous
endfunction
function RegisterSpell$name$Response takes integer spellId, Response r returns nothing
if spellId==0 then
set $name$CallList[$name$CallCount]=r
set $name$CallCount=$name$CallCount+1
else
set $name$Table[spellId]=integer(r)
endif
endfunction
//! endtextmacro
//! runtextmacro spellEvent_make("Channel")
//! runtextmacro spellEvent_make("Cast")
//! runtextmacro spellEvent_make("Effect")
//! runtextmacro spellEvent_make("Finish")
//! runtextmacro spellEvent_make("EndCast")
private function Channel takes nothing returns nothing
call spellEvent.init()
call ChannelCalls()
endfunction
private function Cast takes nothing returns nothing
call CastCalls()
endfunction
private function Effect takes nothing returns nothing
local spellEvent s=spellEvent.get(GetTriggerUnit())
if s!=0 and not s.effectDone then
set s.effectDone=true
call EffectCalls()
endif
endfunction
private function Finish takes nothing returns nothing
set spellEvent.get(GetTriggerUnit()).CastFinished=true
call FinishCalls()
endfunction
private function EndCast takes nothing returns nothing
call EndCastCalls()
call spellEvent.get(GetTriggerUnit()).destroy()
endfunction
// ================================================================
private function InitTrigger takes playerunitevent e, code c returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, e )
call TriggerAddAction(t, c)
set t=null
endfunction
private function Init takes nothing returns nothing
set spellEvent.casterTable=HandleTable.create()
set ChannelTable=Table.create()
set CastTable=Table.create()
set EffectTable=Table.create()
set FinishTable=Table.create()
set EndCastTable=Table.create()
call InitTrigger(EVENT_PLAYER_UNIT_SPELL_CHANNEL, function Channel)
call InitTrigger(EVENT_PLAYER_UNIT_SPELL_CAST, function Cast)
call InitTrigger(EVENT_PLAYER_UNIT_SPELL_EFFECT, function Effect)
call InitTrigger(EVENT_PLAYER_UNIT_SPELL_FINISH, function Finish)
call InitTrigger(EVENT_PLAYER_UNIT_SPELL_ENDCAST, function EndCast)
endfunction
endlibrary
/////////////////////////////////////////////
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~ GT ~~ GTrigger ~~ By Jesus4Lyf ~~ Version 1.05 ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// What is GTrigger?
// - GTrigger is an event system that replaces the cumbersome WC3
// event system.
// - GTrigger only launches the necessary threads instead of x threads,
// where x is the number of times the event type occurs in the map.
//
// =Pros=
// - Instead of having 16 events (for "16" players) per use of an,
// event type, you have 0 per use and 16 total for that event type.
// - If you have 100 events of one type in your map, instead of firing
// 100 triggers each time any spell is cast, you fire only what's needed.
// - GTrigger is faster to code with, more efficient to execute, and just
// better programming practises and nicer code all round.
//
// =Cons=
// - If a trigger with a GTrigger event is destroyed, it must have its
// event unregistered first or it will leak an event (slows firing down).
// - Shouldn't use "wait" actions anywhere in the triggers.
//
// Functions:
// // General
// - GT_UnregisterTriggeringEvent()
//
// // Ability events
// - GT_RegisterStartsEffectEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_RegisterBeginsChanellingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_RegisterBeginsCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_RegisterStopsCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_RegisterFinishesCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_RegisterLearnsAbilityEvent(trigger, abilityid) (returns the trigger passed in)
// // Order events // (can use String2OrderIdBJ("OrderString") for orderid
// - GT_RegisterTargetOrderEvent(trigger, orderid) (returns the trigger passed in)
// - GT_RegisterPointOrderEvent(trigger, orderid) (returns the trigger passed in)
// - GT_RegisterNoTargetOrderEvent(trigger, orderid) (returns the trigger passed in)
// // Item events
// - GT_RegisterItemUsedEvent(trigger, itemtypeid) (returns the trigger passed in)
// - GT_RegisterItemAcquiredEvent(trigger, itemtypeid) (returns the trigger passed in)
// - GT_RegisterItemDroppedEvent(trigger, itemtypeid) (returns the trigger passed in)
// // Unit events
// - GT_RegisterUnitDiesEvent(trigger, unittypeid) (returns the trigger passed in)
//
// // Ability Events
// - GT_UnregisterSpellEffectEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_UnregisterBeginsChanellingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_UnregisterBeginsCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_UnregisterStopsCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_UnregisterFinishesCastingEvent(trigger, abilityid) (returns the trigger passed in)
// - GT_UnregisterLearnsAbilityEvent(trigger, abilityid) (returns the trigger passed in)
// // Order events // (can use String2OrderIdBJ("OrderString") for orderid
// - GT_UnregisterTargetOrderEvent(trigger, orderid) (returns the trigger passed in)
// - GT_UnregisterPointOrderEvent(trigger, orderid) (returns the trigger passed in)
// - GT_UnregisterNoTargetOrderEvent(trigger, orderid) (returns the trigger passed in)
// // Item events
// - GT_UnregisterItemUsedEvent(trigger, itemtypeid) (returns the trigger passed in)
// - GT_UnregisterItemAcquiredEvent(trigger, itemtypeid) (returns the trigger passed in)
// - GT_UnregisterItemDroppedEvent(trigger, itemtypeid) (returns the trigger passed in)
// // Unit events
// - GT_UnregisterUnitDiesEvent(trigger, unittypeid) (returns the trigger passed in)
//
// Alternative interface (not recommended):
// If you aren't familiar with how this works, you shouldn't use it.
// All funcs must return false. (That is the only reason it isn't recommended.)
// // General
// - GT_RemoveTriggeringAction() // Use this to remove actions.
// // Ability Events
// - GT_AddStartsEffectAction(func, abilityid)
// - GT_AddBeginsChanellingActon(func, abilityid)
// - GT_AddBeginsCastingAction(func, abilityid)
// - GT_AddStopsCastingAction(func, abilityid)
// - GT_AddFinishesCastingAction(func, abilityid)
// - GT_AddLearnsAbilityAction(func, abilityid)
// // Order events // (can use String2OrderIdBJ("OrderString") for orderid
// - GT_AddTargetOrderAction(func, orderid)
// - GT_AddPointOrderAction(func, orderid)
// - GT_AddNoTargetOrderAction(func, orderid)
// // Item events
// - GT_AddItemUsedAction(func, itemtypeid)
// - GT_AddItemAcquiredAction(func, itemtypeid)
// - GT_AddItemDroppedAction(func, itemtypeid)
// // Unit events
// - GT_AddUnitDiesAction(func, unittypeid)
//
// Details:
// - Due to the storage method, only 8191 GTrigger events are possible at any one time.
//
// Thanks:
// - Daxtreme: For voluntarily testing this system and the UnitDies event idea.
// - kenny!: For the Order and Learns Ability event ideas.
//
// How to import:
// - Create a trigger named GT.
// - Convert it to custom text and replace the whole trigger text with this.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
library GT initializer Init
//////////////
// Pointers //
////////////////////////////////////////////////////////////////////////////
// Assigned to abilities, and point to trigger grouping linked lists.
//
// Use:
// GetPointer --> int (pointer)
// FreePointer(int (pointer))
// set PointerTarget[int (pointer)]=int (list link)
// PointerTarget[int (pointer)] --> int (list link)
globals
// Pointer
private integer array PointerTarget
private integer PointerMax=0
// Spare Pointer Stack
private integer array NextPointer
private integer NextPointerMaxPlusOne=1
endglobals
private function GetPointer takes nothing returns integer
if NextPointerMaxPlusOne==1 then
set PointerMax=PointerMax+1
return PointerMax
endif
set NextPointerMaxPlusOne=NextPointerMaxPlusOne-1
return NextPointer[NextPointerMaxPlusOne]
endfunction
private function FreePointer takes integer pointer returns nothing
set PointerTarget[pointer]=0
set NextPointer[NextPointerMaxPlusOne]=pointer
set NextPointerMaxPlusOne=NextPointerMaxPlusOne+1
endfunction
///////////////////////////////////
// Trigger Grouping Linked Lists //
////////////////////////////////////////////////////////////////////////////
// Contains a chain of triggers to be executed together.
//
// Use:
// GetMem() --> int (mem)
// FreeMem(int (mem))
// Link(int (pointer), int (mem))
// Unlink(int (pointer), int (mem))
globals
// Spare Link Stack
private integer array NextMem
private integer NextMemMaxPlusOne=1
// Linked list
private trigger array Trig
private integer array Next
private integer array Prev
private integer TrigMax=0
endglobals
private function GetMem takes nothing returns integer
if NextMemMaxPlusOne==1 then
set TrigMax=TrigMax+1
return TrigMax
endif
set NextMemMaxPlusOne=NextMemMaxPlusOne-1
return NextMem[NextMemMaxPlusOne]
endfunction
private function FreeMem takes integer i returns nothing
set Trig[i]=null
set NextMem[NextMemMaxPlusOne]=i
set NextMemMaxPlusOne=NextMemMaxPlusOne+1
endfunction
// Linked list functionality
// NOTE: This means "Next" must be loaded BEFORE executing the trigger, which could delete the current link.
private function Link takes integer pointer, integer new returns nothing
set Prev[new]=0
set Next[new]=PointerTarget[pointer]
set Prev[PointerTarget[pointer]]=new
set PointerTarget[pointer]=new
endfunction
private function Unlink takes integer pointer, integer rem returns nothing
if Prev[rem]==0 then
set PointerTarget[pointer]=Next[rem]
set Prev[Next[rem]]=0
endif
set Next[Prev[rem]]=Next[rem]
set Prev[Next[rem]]=Prev[rem]
endfunction
//////////////////////
// GTrigger General //
////////////////////////////////////////////////////////////////////////////
// Only contains the UnregisterTriggeringEvent action for public use.
globals
boolean UnregisterLastEvent=false
endglobals
public function UnregisterTriggeringEvent takes nothing returns nothing
set UnregisterLastEvent=true
endfunction
/////////////////////////////////////
// GTrigger Ability Implementation //
////////////////////////////////////////////////////////////////////////////
// The nasty textmacro implementation of special "All Players" events.
//! textmacro SetupSpecialAllPlayersEvent takes NAME, EVENT, GETSPECIAL
globals
private trigger $NAME$Trigger=CreateTrigger()
// Extendable arrays
private integer array $NAME$AbilityIdA
private integer array $NAME$ListPointerA
private integer array $NAME$AbilityIdB
private integer array $NAME$ListPointerB
private integer array $NAME$AbilityIdC
private integer array $NAME$ListPointerC
private integer array $NAME$AbilityIdD
private integer array $NAME$ListPointerD
private integer array $NAME$AbilityIdE
private integer array $NAME$ListPointerE
endglobals
globals//locals
private integer GetOrCreateListPointer$NAME$AbilHashed
endglobals
private function GetOrCreate$NAME$ListPointer takes integer abil returns integer
set GetOrCreateListPointer$NAME$AbilHashed=abil-(abil/8191)*8191
if $NAME$AbilityIdA[GetOrCreateListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerA[GetOrCreateListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdA[GetOrCreateListPointer$NAME$AbilHashed]<1 then // Empty
set $NAME$AbilityIdA[GetOrCreateListPointer$NAME$AbilHashed]=abil
set $NAME$ListPointerA[GetOrCreateListPointer$NAME$AbilHashed]=GetPointer()
return $NAME$ListPointerA[GetOrCreateListPointer$NAME$AbilHashed]
endif
if $NAME$AbilityIdB[GetOrCreateListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerB[GetOrCreateListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdB[GetOrCreateListPointer$NAME$AbilHashed]<1 then // Empty
set $NAME$AbilityIdB[GetOrCreateListPointer$NAME$AbilHashed]=abil
set $NAME$ListPointerB[GetOrCreateListPointer$NAME$AbilHashed]=GetPointer()
return $NAME$ListPointerB[GetOrCreateListPointer$NAME$AbilHashed]
endif
if $NAME$AbilityIdC[GetOrCreateListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerC[GetOrCreateListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdC[GetOrCreateListPointer$NAME$AbilHashed]<1 then // Empty
set $NAME$AbilityIdC[GetOrCreateListPointer$NAME$AbilHashed]=abil
set $NAME$ListPointerC[GetOrCreateListPointer$NAME$AbilHashed]=GetPointer()
return $NAME$ListPointerC[GetOrCreateListPointer$NAME$AbilHashed]
endif
if $NAME$AbilityIdD[GetOrCreateListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerD[GetOrCreateListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdD[GetOrCreateListPointer$NAME$AbilHashed]<1 then // Empty
set $NAME$AbilityIdD[GetOrCreateListPointer$NAME$AbilHashed]=abil
set $NAME$ListPointerD[GetOrCreateListPointer$NAME$AbilHashed]=GetPointer()
return $NAME$ListPointerD[GetOrCreateListPointer$NAME$AbilHashed]
endif
if $NAME$AbilityIdE[GetOrCreateListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerE[GetOrCreateListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdE[GetOrCreateListPointer$NAME$AbilHashed]<1 then // Empty
set $NAME$AbilityIdE[GetOrCreateListPointer$NAME$AbilHashed]=abil
set $NAME$ListPointerE[GetOrCreateListPointer$NAME$AbilHashed]=GetPointer()
return $NAME$ListPointerE[GetOrCreateListPointer$NAME$AbilHashed]
endif
call BJDebugMsg("GTrigger Error: Ran out of storage locations for pointers on object "+GetObjectName(abil)+"!")
set PointerTarget[0]=0
return 0
endfunction
globals//locals
private integer GetListPointer$NAME$AbilHashed
endglobals
private function Get$NAME$ListPointer takes integer abil returns integer
set GetListPointer$NAME$AbilHashed=abil-(abil/8191)*8191
if $NAME$AbilityIdA[GetListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerA[GetListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdA[GetListPointer$NAME$AbilHashed]<1 then // Empty
set PointerTarget[0]=0 // Make sure.
return 0
endif
if $NAME$AbilityIdB[GetListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerB[GetListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdB[GetListPointer$NAME$AbilHashed]<1 then // Empty
set PointerTarget[0]=0 // Make sure.
return 0
endif
if $NAME$AbilityIdC[GetListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerC[GetListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdC[GetListPointer$NAME$AbilHashed]<1 then // Empty
set PointerTarget[0]=0 // Make sure.
return 0
endif
if $NAME$AbilityIdD[GetListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerD[GetListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdD[GetListPointer$NAME$AbilHashed]<1 then // Empty
set PointerTarget[0]=0 // Make sure.
return 0
endif
if $NAME$AbilityIdE[GetListPointer$NAME$AbilHashed]==abil then // Correct
return $NAME$ListPointerE[GetListPointer$NAME$AbilHashed]
elseif $NAME$AbilityIdE[GetListPointer$NAME$AbilHashed]<1 then // Empty
set PointerTarget[0]=0 // Make sure.
return 0
endif
call BJDebugMsg("GTrigger Error: Ran out of storage locations for pointers at ability "+GetObjectName(abil)+"!")
set PointerTarget[0]=0
return 0
endfunction
globals//locals
private integer Register$NAME$Mem
endglobals
public function Register$NAME$Event takes trigger t, integer abil returns trigger
set Register$NAME$Mem=GetMem()
set Trig[Register$NAME$Mem]=t
call Link(GetOrCreate$NAME$ListPointer(abil),Register$NAME$Mem)
return t
endfunction
globals//locals
private integer Unregister$NAME$Pointer
private integer Unregister$NAME$Mem
endglobals
public function Unregister$NAME$Event takes trigger t, integer abil returns trigger
set Unregister$NAME$Pointer=Get$NAME$ListPointer(abil)
set Unregister$NAME$Mem=PointerTarget[Unregister$NAME$Pointer]
loop
exitwhen Trig[Unregister$NAME$Mem]==t
if Unregister$NAME$Mem==0 then
return t // Not found.
endif
set Unregister$NAME$Mem=Next[Unregister$NAME$Mem]
endloop
call Unlink(Unregister$NAME$Pointer,Unregister$NAME$Mem)
call FreeMem(Unregister$NAME$Mem)
return t
endfunction
private function Trigger$NAME$Event takes nothing returns boolean
local integer Trigger$NAME$Pointer=Get$NAME$ListPointer($GETSPECIAL$)
local integer Trigger$NAME$Mem=PointerTarget[Trigger$NAME$Pointer]
local integer Trigger$NAME$NextMem
set UnregisterLastEvent=false
loop
exitwhen Trigger$NAME$Mem<1
set Trigger$NAME$NextMem=Next[Trigger$NAME$Mem]
if TriggerEvaluate(Trig[Trigger$NAME$Mem]) then
call TriggerExecute(Trig[Trigger$NAME$Mem])
endif
if UnregisterLastEvent then
set UnregisterLastEvent=false
call Unlink(Trigger$NAME$Pointer,Trigger$NAME$Mem)
call FreeMem(Trigger$NAME$Mem)
endif
set Trigger$NAME$Mem=Trigger$NAME$NextMem
endloop
return false
endfunction
private function Init$NAME$ takes nothing returns nothing
local integer i=bj_MAX_PLAYER_SLOTS
call TriggerAddCondition($NAME$Trigger,Condition(function Trigger$NAME$Event))
loop
set i=i-1
call TriggerRegisterPlayerUnitEvent($NAME$Trigger,Player(i),EVENT_PLAYER_$EVENT$,null)
exitwhen i==0
endloop
endfunction
//! endtextmacro
//! runtextmacro SetupSpecialAllPlayersEvent("StartsEffect", "UNIT_SPELL_EFFECT", "GetSpellAbilityId()")
//! runtextmacro SetupSpecialAllPlayersEvent("BeginsChanelling", "UNIT_SPELL_CHANNEL", "GetSpellAbilityId()")
//! runtextmacro SetupSpecialAllPlayersEvent("BeginsCasting", "UNIT_SPELL_CAST", "GetSpellAbilityId()")
//! runtextmacro SetupSpecialAllPlayersEvent("StopsCasting", "UNIT_SPELL_ENDCAST", "GetSpellAbilityId()")
//! runtextmacro SetupSpecialAllPlayersEvent("FinishesCasting", "UNIT_SPELL_FINISH", "GetSpellAbilityId()")
//! runtextmacro SetupSpecialAllPlayersEvent("TargetOrder", "UNIT_ISSUED_TARGET_ORDER", "GetIssuedOrderId()")
//! runtextmacro SetupSpecialAllPlayersEvent("PointOrder", "UNIT_ISSUED_POINT_ORDER", "GetIssuedOrderId()")
//! runtextmacro SetupSpecialAllPlayersEvent("NoTargetOrder", "UNIT_ISSUED_ORDER", "GetIssuedOrderId()")
//! runtextmacro SetupSpecialAllPlayersEvent("ItemUsed", "UNIT_USE_ITEM", "GetItemTypeId(GetManipulatedItem())")
//! runtextmacro SetupSpecialAllPlayersEvent("ItemAcquired", "UNIT_PICKUP_ITEM", "GetItemTypeId(GetManipulatedItem())")
//! runtextmacro SetupSpecialAllPlayersEvent("ItemDropped", "UNIT_DROP_ITEM", "GetItemTypeId(GetManipulatedItem())")
//! runtextmacro SetupSpecialAllPlayersEvent("UnitDies", "UNIT_DEATH", "GetUnitTypeId(GetTriggerUnit())")
//! runtextmacro SetupSpecialAllPlayersEvent("LearnsAbility", "HERO_SKILL", "GetLearnedSkill()")
// Note to self: Remember to update the Init function.
/////////////////////////////////////////
// GTrigger All Players Implementation //
////////////////////////////////////////////////////////////////////////////
// The textmacro implementation of other "All Players" events.
//! textmacro SetupAllPlayersEvent takes NAME, EVENT
globals
private trigger $NAME$Trigger=CreateTrigger()
private integer $NAME$ListPointer=0
endglobals
globals//locals
private integer Register$NAME$Mem
endglobals
public function Register$NAME$Event takes trigger t returns trigger
set Register$NAME$Mem=GetMem()
set Trig[Register$NAME$Mem]=t
call Link($NAME$ListPointer,Register$NAME$Mem)
return t
endfunction
globals//locals
private integer Unregister$NAME$Pointer
private integer Unregister$NAME$Mem
endglobals
public function Unregister$NAME$Event takes trigger t returns trigger
set Unregister$NAME$Mem=PointerTarget[$NAME$ListPointer]
loop
exitwhen Trig[Unregister$NAME$Mem]==t
if Unregister$NAME$Mem==0 then
return t // Not found.
endif
set Unregister$NAME$Mem=Next[Unregister$NAME$Mem]
endloop
call Unlink($NAME$ListPointer,Unregister$NAME$Mem)
call FreeMem(Unregister$NAME$Mem)
return t
endfunction
private function Trigger$NAME$Event takes nothing returns boolean
local integer Trigger$NAME$Mem=PointerTarget[$NAME$ListPointer]
local integer Trigger$NAME$NextMem
set UnregisterLastEvent=false
loop
exitwhen Trigger$NAME$Mem<1
set Trigger$NAME$NextMem=Next[Trigger$NAME$Mem]
if TriggerEvaluate(Trig[Trigger$NAME$Mem]) then
call TriggerExecute(Trig[Trigger$NAME$Mem])
endif
if UnregisterLastEvent then
set UnregisterLastEvent=false
call Unlink($NAME$ListPointer,Trigger$NAME$Mem)
call FreeMem(Trigger$NAME$Mem)
endif
set Trigger$NAME$Mem=Trigger$NAME$NextMem
endloop
return false
endfunction
private function Init$NAME$ takes nothing returns nothing
local integer i=bj_MAX_PLAYER_SLOTS
call TriggerAddCondition($NAME$Trigger,Condition(function Trigger$NAME$Event))
loop
set i=i-1
call TriggerRegisterPlayerUnitEvent($NAME$Trigger,Player(i),EVENT_PLAYER_UNIT_$EVENT$,null)
exitwhen i==0
endloop
// Initialise the pointer.
set $NAME$ListPointer=GetPointer()
endfunction
//! endtextmacro
// Old: //! runtextmacro SetupAllPlayersEvent("AnyUnitDies", "DEATH")
private function Init takes nothing returns nothing
// Ability events
call InitStartsEffect()
call InitBeginsChanelling()
call InitBeginsCasting()
call InitStopsCasting()
call InitFinishesCasting()
call InitLearnsAbility()
// Order events
call InitTargetOrder()
call InitPointOrder()
call InitNoTargetOrder()
// Item events
call InitItemUsed()
call InitItemAcquired()
call InitItemDropped()
// Unit events
call InitUnitDies()
endfunction
//////////////
// Wrappers //
////////////////////////////////////////////////////////////////////////////
// Wraps it up, for those who really want this interface.
// General
public function RemoveTriggeringAction takes nothing returns nothing
call UnregisterTriggeringEvent()
call DestroyTrigger(GetTriggeringTrigger())
endfunction
// Special All Player Events
//! textmacro AddSpecialAllPlayersWrapper takes EVENT
public function Add$EVENT$Action takes code func, integer special returns nothing
call TriggerAddCondition(Register$EVENT$Event(CreateTrigger(),special),Condition(func))
endfunction
//! endtextmacro
//! runtextmacro AddSpecialAllPlayersWrapper("StartsEffect")
//! runtextmacro AddSpecialAllPlayersWrapper("BeginsChanelling")
//! runtextmacro AddSpecialAllPlayersWrapper("BeginsCasting")
//! runtextmacro AddSpecialAllPlayersWrapper("StopsCasting")
//! runtextmacro AddSpecialAllPlayersWrapper("FinishesCasting")
//! runtextmacro AddSpecialAllPlayersWrapper("TargetOrder")
//! runtextmacro AddSpecialAllPlayersWrapper("PointOrder")
//! runtextmacro AddSpecialAllPlayersWrapper("NoTargetOrder")
//! runtextmacro AddSpecialAllPlayersWrapper("ItemUsed")
//! runtextmacro AddSpecialAllPlayersWrapper("ItemAcquired")
//! runtextmacro AddSpecialAllPlayersWrapper("ItemDropped")
//! runtextmacro AddSpecialAllPlayersWrapper("UnitDies")
//! runtextmacro AddSpecialAllPlayersWrapper("LearnsAbility")
// Note to self: Remember to update the Init function.
// All Player Events
//! textmacro AddAllPlayersWrapper takes EVENT
public function Add$EVENT$Action takes code func returns nothing
call TriggerAddCondition(Register$EVENT$Event(CreateTrigger()),Condition(func))
endfunction
//! endtextmacro
//// runtextmacro AddAllPlayersWrapper("UnitSell")
// Old: //! runtextmacro AddAllPlayersWrapper("AnyUnitDies")
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//This trigger is all comments
/*
**plans for 0.97**
need to test make sure no item bugs with all
the new item changes just made.
need to modify attackpower of human and demon tree units
and test the changes
lots of graphics changes all around
plan to add on new custom spells for runners.
maybe chasers, too...we will see
made gold mine and camera upgrades
made mac compatible icons
after balance patches:
make new chasers:
first chaser uses regular demon hunter model
this will maybe have mana burn, evasion...
ultimate ability will be as immolation but...it does no area damage
immo is the dummy ability
the ability will run on a timer maybe using KT(we shall see)
and it will teleport him to a random point on the map every 15 seconds or so.
when the ability is disabled, the timer turns off.
second chaser will be based on taf skeleton lord
can cast smokescreen which will last a very long time. smokescreen will slow enemies ofc and make them not cast spells
short distance teleport that takes away a lot of hp
and ultimate will be healing himself over time.
*/