// Tutorial created by SeriousEnemy
// PM to me if you need any help
// Have fun while mapping! :)
// Greetings
Name | Type | is_array | initial_value |
ControlPanel | dialog | No | |
ControlPanelAnalysis | dialog | No | |
ControlPanelAnalysisDiag | button | Yes | |
ControlPanelDiag | button | Yes | |
Difficulty | dialog | No | |
DifficultyDiag | button | Yes | |
Endlevel | integer | No | |
GameStarted | boolean | No | |
i_GoldEarned | integer | Yes | |
i_HintsMax | integer | No | |
i_Kills | integer | Yes | |
i_Leaks | integer | Yes | |
i_UnitArmor | integer | Yes | |
i_UnitArmorSmall | integer | Yes | |
i_UnitLife | integer | Yes | |
i_UnitLifeSmall | integer | Yes | |
i_UnitSpeed | integer | Yes | |
i_UnitSpeedSmall | integer | Yes | |
Level | integer | No | |
Lifes | integer | Yes | |
Multiboard | multiboard | No | |
PlayerGroup | force | No | |
PlayerHintGroup | force | No | |
PlayerMusicGroup | force | No | |
PlayerName | string | Yes | |
r | real | No | |
r_Difficulty | real | No | |
RuneLureLoopAllow | boolean | No | false |
s_Difficulty | string | No | |
s_Dummy | string | No | |
s_GameMode | string | No | |
s_Hint | string | Yes | |
s_PlayerColor | string | Yes | |c00ff0303 |
s_UnitName | string | Yes | |
s_UnitNameSmall | string | Yes | |
Settings | dialog | No | |
SettingsDiag | button | Yes | |
ShowLifeLooseEffect | boolean | No | |
ShowSpawnEffect | boolean | No | |
SpawnCount | integer | Yes | |
SpawnCountSmall | integer | Yes | |
TA_PRock | boolean | Yes | false |
TeamLifes | boolean | No | |
TempGroup | group | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TimeBetweenRounds | real | No | |
TimeBetweenSpawns | real | No | |
Type | integer | No | |
Unit | unitcode | Yes | |
UnitSmall | unitcode | Yes |
You can download the latest version at http://www.hiveworkshop.com/forums/maps-564/how-create-tower-defense-v1-3-a-150232/
All credits go to SeriousEnemy [Northrend]!
Please give me credits if you use some stuff of this map (for example: tower spells)
Greetings
~Serious
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_PCom_Roll takes nothing returns nothing
local integer i = GetRandomInt(1, 100)
if ( GetTriggerPlayer() == Player(0) ) then
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, ( "|c00ff0303" + ( GetPlayerName(GetTriggerPlayer()) + ( "|r |c0020c000rolled:|r |c007ebff1" + ( I2S(i) + "|r" ) ) ) ) )
else
if ( GetTriggerPlayer() == Player(1) ) then
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, ( "|c000042ff" + ( GetPlayerName(GetTriggerPlayer()) + ( "|r |c0020c000rolled:|r |c007ebff1" + ( I2S(i) + "|r" ) ) ) ) )
else
if ( GetTriggerPlayer() == Player(2) ) then
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, ( "|c001ce6b9" + ( GetPlayerName(GetTriggerPlayer()) + ( "|r |c0020c000rolled:|r |c007ebff1" + ( I2S(i) + "|r" ) ) ) ) )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, ( "|c00540081" + ( GetPlayerName(GetTriggerPlayer()) + ( "|r |c0020c000rolled:|r |c007ebff1" + ( I2S(i) + "|r" ) ) ) ) )
endif
endif
endif
endfunction
function InitTrig_PCom_Roll takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent( t, Player(0), "-roll", true )
call TriggerRegisterPlayerChatEvent( t, Player(1), "-roll", true )
call TriggerRegisterPlayerChatEvent( t, Player(2), "-roll", true )
call TriggerRegisterPlayerChatEvent( t, Player(3), "-roll", true )
call TriggerAddAction( t, function Trig_PCom_Roll )
set t = null
endfunction
The Misc category doesn't belong to the tower defense stuff!
You just need to use the 'Initialization' 'Spawn, Lifes, Sell and Restart' and 'Move' category.
Most Misc stuff is written in JASS, if you want to use this in your map and it doesn't work ask
for help please! They don't work if you just copy this triggers without units and spells!
I don't even start explaining them, try to learn GUI first.
You will know if you are ready for this. ;)
==========================DO NOT CHANGE ANYTHING HERE IF YOU DON'T KNOW WHAT YOU ARE DOING!==========================
function Trig_Misc_Map_Initialization_Actions takes nothing returns nothing
set udg_ShowSpawnEffect = true
set udg_ShowLifeLooseEffect = true
set udg_TA_PRock[0] = true
set udg_TA_PRock[1] = true
set udg_TA_PRock[2] = true
set udg_TA_PRock[3] = true
set udg_RuneLureLoopAllow = true
endfunction
function InitTrig_Misc_Map_Initialization takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventSingle( t, 0.01 )
call TriggerAddAction( t, function Trig_Misc_Map_Initialization_Actions )
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Misc_Base_Stay takes nothing returns nothing
local unit u = GetEnteringUnit()
local location p1 = GetUnitLoc(u)
local location p2 = GetPlayerStartLocationLoc(GetOwningPlayer(u))
if ( GetOwningPlayer(u) == Player(4) ) then
call DoNothing()
else
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|Cffff0000You are not allowed to leave your location!|r" )
call SetUnitUserData( u, GetConvertedPlayerId(GetOwningPlayer(u)) )
call SetUnitOwner( u, Player(PLAYER_NEUTRAL_PASSIVE), false )
call IssuePointOrderLoc( u, "move", p2 )
call TriggerSleepAction( DistanceBetweenPoints(p1, p2) / 400 )
call SetUnitOwner( u, ConvertedPlayer(GetUnitUserData(u)), false )
call IssueImmediateOrder( u, "holdposition" )
endif
call RemoveLocation(p1)
call RemoveLocation(p2)
set p1 = null
set p2 = null
set u = null
endfunction
function InitTrig_Misc_Base_Stay takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterEnterRectSimple( t, gg_rct_MiscBaseStay1 )
call TriggerRegisterEnterRectSimple( t, gg_rct_MiscBaseStay2 )
call TriggerAddAction( t, function Trig_Misc_Base_Stay )
set t = null
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Spawn_Effects takes nothing returns nothing
local effect e
if ( GetOwningPlayer(GetEnteringUnit()) == Player(4) ) then
if ( udg_ShowSpawnEffect == true ) then
call AddSpecialEffectTargetUnitBJ( "origin", GetEnteringUnit(), "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
set e = bj_lastCreatedEffect
else
call DoNothing( )
endif
else
call DoNothing( )
endif
call TriggerSleepAction ( 2.00 )
call DestroyEffect(e)
set e = null
endfunction
function InitTrig_Spawn_Effects takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterEnterRectSimple( t, GetPlayableMapRect() )
call TriggerAddAction( t, function Trig_Spawn_Effects )
set t = null
endfunction
//TESH.scrollpos=16
//TESH.alwaysfold=0
function Trig_Life_Loose_Effects takes nothing returns nothing
local unit u = GetEnteringUnit()
local effect e
local effect ee
local location p1
if ( GetOwningPlayer(u) == Player(4) ) then
if ( udg_ShowLifeLooseEffect == true ) then
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl" )
set e = bj_lastCreatedEffect
call TriggerSleepAction ( 1.50 )
call DestroyEffect(e)
set p1 = GetUnitLoc(u)
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
set e = bj_lastCreatedEffect
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl" )
set ee = bj_lastCreatedEffect
call RemoveUnit( GetEnteringUnit() )
call TriggerSleepAction ( 1.00 )
else
call RemoveUnit( GetEnteringUnit() )
endif
else
endif
call DestroyEffect(e)
call DestroyEffect(ee)
call RemoveLocation(p1)
set e = null
set ee = null
set p1 = null
set u = null
endfunction
function InitTrig_Life_Loose_Effects takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterEnterRectSimple( t, gg_rct_Loose_Lifes )
call TriggerAddAction( t, function Trig_Life_Loose_Effects )
set t = null
endfunction
//TESH.scrollpos=71
//TESH.alwaysfold=0
function Trig_Misc_BoulderTowerAbility takes nothing returns nothing
local unit Attacker = GetAttacker()
local group g = CreateGroup()
local unit u
local location p1
if ( ( GetUnitTypeId(Attacker) == 'n001' ) ) then
call DoNothing()
else
if ( ( GetUnitTypeId(Attacker) == 'n002' ) ) then
call DoNothing()
else
if ( ( GetUnitTypeId(Attacker) == 'n000' ) ) then
call DoNothing()
else
call DestroyGroup(g)
set g = null
set u = null
set p1 = null
set Attacker = null
return
endif
endif
endif
if ( udg_TA_PRock[( GetConvertedPlayerId(GetOwningPlayer(Attacker)) - 1 )] == true ) then
set udg_TA_PRock[( GetConvertedPlayerId(GetOwningPlayer(Attacker)) - 1 )] = false
set g = GetUnitsOfPlayerAndTypeId(GetOwningPlayer(Attacker), 'n001')
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
set p1 = GetUnitLoc(u)
call GroupRemoveUnit(g,u)
call CreateNUnitsAtLoc( 1, 'H00D', GetOwningPlayer(GetAttacker()), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 2.00 )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call SetUnitAbilityLevelSwapped( 'A00A', GetLastCreatedUnit(), 1 )
call IssueImmediateOrder( GetLastCreatedUnit(), "roar" )
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(p1)
endloop
call DestroyGroup(g)
set g = GetUnitsOfPlayerAndTypeId(GetOwningPlayer(Attacker), 'n002')
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
set p1 = GetUnitLoc(u)
call GroupRemoveUnit(g,u)
call CreateNUnitsAtLoc( 1, 'H00D', GetOwningPlayer(GetAttacker()), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 2.00 )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call SetUnitAbilityLevelSwapped( 'A00A', GetLastCreatedUnit(), 2 )
call IssueImmediateOrder( GetLastCreatedUnit(), "roar" )
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(p1)
endloop
call DestroyGroup(g)
set g = GetUnitsOfPlayerAndTypeId(GetOwningPlayer(Attacker), 'n000')
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
set p1 = GetUnitLoc(u)
call GroupRemoveUnit(g,u)
call CreateNUnitsAtLoc( 1, 'H00D', GetOwningPlayer(GetAttacker()), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 2.00 )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call SetUnitAbilityLevelSwapped( 'A00A', GetLastCreatedUnit(), 3 )
call IssueImmediateOrder( GetLastCreatedUnit(), "roar" )
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call RemoveLocation(p1)
endloop
call DestroyGroup(g)
set g = null
set u = null
set p1 = null
call IssueImmediateOrderBJ( Attacker, "stop" )
call TriggerSleepAction( 30.00 )
set udg_TA_PRock[( GetConvertedPlayerId(GetOwningPlayer(Attacker)) - 1 )] = true
set Attacker = null
else
call DoNothing()
endif
endfunction
function InitTrig_Misc_BoulderTowerAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( t, Player(4), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( t, function Trig_Misc_BoulderTowerAbility )
set t = null
endfunction
//TESH.scrollpos=29
//TESH.alwaysfold=0
function Trig_Misc_ColdTowerAbility takes nothing returns nothing
local unit Attacker = GetAttacker()
local integer i
local integer ii
local location p1 = GetUnitLoc(GetTriggerUnit())
if ( ( GetUnitUserData(Attacker) == 2 )) then
set Attacker = null
call RemoveLocation(p1)
set p1 = null
return
else
call DoNothing()
endif
if ( ( GetUnitTypeId(Attacker) == 'n004' ) ) then
set i = 1
set ii = 2
else
if ( ( GetUnitTypeId(Attacker) == 'n005' ) ) then
set i = 2
set ii = 3
else
if ( ( GetUnitTypeId(Attacker) == 'n003' ) ) then
set i = 3
set ii = 4
else
set Attacker = null
call RemoveLocation(p1)
set p1 = null
return
endif
endif
endif
call SetUnitUserData( Attacker, 2 )
call CreateNUnitsAtLoc( 1, 'H00E', GetOwningPlayer(Attacker), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', ii )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call SetUnitAbilityLevelSwapped( 'S000', GetLastCreatedUnit(), i )
call IssueImmediateOrder( GetLastCreatedUnit(), "holdposition" )
call RemoveLocation(p1)
set p1 = null
call TriggerSleepAction( 20.00 )
call SetUnitUserData( Attacker, 0 )
set Attacker = null
endfunction
function InitTrig_Misc_ColdTowerAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( t, Player(4), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( t, function Trig_Misc_ColdTowerAbility )
set t = null
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
function Trig_Misc_EnergyTowerAbility takes nothing returns nothing
local integer i
local location p1 = GetUnitLoc(GetAttacker())
local unit u = GetAttacker()
if ( GetUnitLifePercent(GetTriggerUnit()) <= 35.00 ) then
if ( ( GetUnitTypeId(u) == 'n00B' ) ) then
set i = 1
else
if ( ( GetUnitTypeId(u) == 'n00A' ) ) then
set i = 2
else
if ( ( GetUnitTypeId(u) == 'n009' ) ) then
set i = 3
else
call RemoveLocation(p1)
set p1 = null
set u = null
return
endif
endif
endif
else
call RemoveLocation(p1)
set p1 = null
set u = null
return
endif
call AddSpecialEffectLocBJ( p1, "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call CreateNUnitsAtLoc( 1, 'H00B', GetOwningPlayer(GetAttacker()), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 2.00 )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call SetUnitAbilityLevelSwapped( 'A006', GetLastCreatedUnit(), i )
call IssueTargetOrder( GetLastCreatedUnit(), "chainlightning", GetTriggerUnit() )
call IssueImmediateOrder( u, "stop" )
call RemoveLocation(p1)
set p1 = null
set u = null
endfunction
function InitTrig_Misc_EnergyTowerAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( t, Player(4), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( t, function Trig_Misc_EnergyTowerAbility )
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Misc_FireTowerAbility takes nothing returns nothing
local integer i = GetRandomInt(1, 100)
local integer ii
local unit u = GetAttacker()
local unit u2 = GetTriggerUnit()
local location p1
if ( i <= 10 ) then
if ( ( GetUnitTypeId(u) == 'n006' ) ) then
set ii = 29
else
if ( ( GetUnitTypeId(u) == 'n007' ) ) then
set ii = 59
else
if ( ( GetUnitTypeId(u) == 'n008' ) ) then
set ii = 89
else
call RemoveLocation(p1)
set u = null
set u2 = null
set p1 = null
return
endif
endif
endif
else
call RemoveLocation(p1)
set p1 = null
return
endif
call TriggerSleepAction( 0.30 )
if (IsUnitAliveBJ(u) == true) then
set p1 = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'H00A', GetOwningPlayer(u), p1, 0.00 )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 2.00 )
call SetHeroAgi( GetLastCreatedUnit(), ii, true )
call SuspendHeroXP( GetLastCreatedUnit(), true )
call IssueTargetOrder( GetLastCreatedUnit(), "attack", u2 )
else
endif
call RemoveLocation(p1)
set p1 = null
set u = null
set u2 = null
endfunction
function InitTrig_Misc_FireTowerAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( t, Player(4), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( t, function Trig_Misc_FireTowerAbility )
set t = null
endfunction
//TESH.scrollpos=-1
//TESH.alwaysfold=0
function Trig_Misc_RuneLureAbility_Actions takes nothing returns nothing
local unit u = GetKillingUnit()
local unit u2
local group g = CreateGroup()
local integer i = 0
if (GetUnitTypeId(u) == 'n00D') then
if (GetUnitUserData(u) < 10) then
call SetUnitUserData(u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00F', u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00I', u, (GetUnitUserData(u) + 1))
else
set i = 1
endif
else
if (GetUnitTypeId(u) == 'n00E') then
if (GetUnitUserData(u) < 20) then
call SetUnitUserData(u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00F', u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00G', u, (GetUnitUserData(u) + 1))
else
set i = 2
endif
else
if (GetUnitTypeId(u) == 'n00C') then
if (GetUnitUserData(u) < 30) then
call SetUnitUserData(u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00F', u, (GetUnitUserData(u) + 1))
call SetUnitAbilityLevelSwapped('A00H', u, (GetUnitUserData(u) + 1))
else
set i = 3
endif
else
endif
endif
endif
if (i > 0) then
call GroupEnumUnitsOfPlayer(g,GetOwningPlayer(u), null)
loop
set u2 = FirstOfGroup(g)
exitwhen u2 == null
if (u != u2) then
if (GetUnitTypeId(u2) == 'n00D') then
if (GetUnitUserData(u2) < 10) then
call SetUnitUserData(u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00F', u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00I', u2, (GetUnitUserData(u2) + 1))
call GroupClear(g)
else
endif
else
if (i > 1) then
if (GetUnitTypeId(u2) == 'n00E') then
if (GetUnitUserData(u2) < 20) then
call SetUnitUserData(u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00F', u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00G', u2, (GetUnitUserData(u2) + 1))
call GroupClear(g)
else
endif
else
endif
if (i > 2) then
if (GetUnitTypeId(u2) == 'n00C') then
if (GetUnitUserData(u2) < 30) then
call SetUnitUserData(u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00F', u2, (GetUnitUserData(u2) + 1))
call SetUnitAbilityLevelSwapped('A00H', u2, (GetUnitUserData(u2) + 1))
call GroupClear(g)
else
endif
else
endif
else
endif
else
endif
endif
else
endif
call GroupRemoveUnit(g, u2)
endloop
else
endif
call DestroyGroup(g)
set g = null
set u = null
set u2 = null
endfunction
function InitTrig_Misc_RuneLureAbility takes nothing returns nothing
set gg_trg_Misc_RuneLureAbility = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Misc_RuneLureAbility, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Misc_RuneLureAbility, function Trig_Misc_RuneLureAbility_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Misc_RuneLureUpgrade_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if (GetUnitTypeId(u) == 'n00E') then
call SetUnitAbilityLevelSwapped('A00G', u, (GetUnitUserData(u) + 1))
else
if (GetUnitTypeId(u) == 'n00C') then
call SetUnitAbilityLevelSwapped('A00H', u, (GetUnitUserData(u) + 1))
else
endif
endif
set u = null
endfunction
function InitTrig_Misc_RuneLureUpgrade takes nothing returns nothing
set gg_trg_Misc_RuneLureUpgrade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Misc_RuneLureUpgrade, EVENT_PLAYER_UNIT_UPGRADE_FINISH )
call TriggerAddAction( gg_trg_Misc_RuneLureUpgrade, function Trig_Misc_RuneLureUpgrade_Actions )
endfunction
//TESH.scrollpos=45
//TESH.alwaysfold=0
function Trig_Misc_PaladinAbility_Actions takes nothing returns nothing
local location p1 = GetUnitLoc(GetKillingUnit())
local location p2 = PolarProjectionBJ(p1, GetRandomReal(0, 30.00), GetRandomReal(1.00, 360.00))
local integer i = GetConvertedPlayerId(GetOwningPlayer(GetKillingUnit()))
local integer i2 = GetUnitUserData(GetDyingUnit())
if ( GetUnitTypeId(GetKillingUnit()) == 'n00F' ) then
call AdjustPlayerStateBJ( 1, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationTarget.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call CreateTextTagLocBJ( "|Cfffed312+1", p2, 0, 10, 100, 100, 100, 0 )
call SetTextTagSuspended( GetLastCreatedTextTag(), false )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 50.00, 90 )
call SetTextTagAge( GetLastCreatedTextTag(), 1.00 )
call SetTextTagLifespan( GetLastCreatedTextTag(), 5.00 )
call SetTextTagFadepoint( GetLastCreatedTextTag(), 1.00 )
set udg_i_GoldEarned[i2] = ( udg_i_GoldEarned[i2] + 1 )
call TriggerExecute( gg_trg_Multiboard_PlayerStat_Update )
else
if ( GetUnitTypeId(GetKillingUnit()) == 'n00H' ) then
call AdjustPlayerStateBJ( 2, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationTarget.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call CreateTextTagLocBJ( "|Cfffed312+2", p2, 0, 10, 100, 100, 100, 0 )
call SetTextTagSuspended( GetLastCreatedTextTag(), false )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 50.00, 90 )
call SetTextTagAge( GetLastCreatedTextTag(), 1.00 )
call SetTextTagLifespan( GetLastCreatedTextTag(), 5.00 )
call SetTextTagFadepoint( GetLastCreatedTextTag(), 1.00 )
set udg_i_GoldEarned[i2] = ( udg_i_GoldEarned[i2] + 2 )
call TriggerExecute( gg_trg_Multiboard_PlayerStat_Update )
else
if ( GetUnitTypeId(GetKillingUnit()) == 'n00G' ) then
call AdjustPlayerStateBJ( 3, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationCaster.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call AddSpecialEffectLocBJ( p2, "Abilities\\Spells\\Items\\StaffOfPurification\\PurificationTarget.mdl" )
call DestroyEffect(bj_lastCreatedEffect)
call CreateTextTagLocBJ( "|Cfffed312+3", p2, 0, 10, 100, 100, 100, 0 )
call SetTextTagSuspended( GetLastCreatedTextTag(), false )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 50.00, 90 )
call SetTextTagAge( GetLastCreatedTextTag(), 1.00 )
call SetTextTagLifespan( GetLastCreatedTextTag(), 5.00 )
call SetTextTagFadepoint( GetLastCreatedTextTag(), 1.00 )
set udg_i_GoldEarned[i] = ( udg_i_GoldEarned[i2] + 3 )
call TriggerExecute( gg_trg_Multiboard_PlayerStat_Update )
else
endif
endif
endif
call RemoveLocation(p1)
call RemoveLocation(p2)
set p1 = null
set p2 = null
endfunction
function InitTrig_Misc_PaladinAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( t, Player(4), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( t, function Trig_Misc_PaladinAbility_Actions )
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Misc_VortexTowerAbility takes nothing returns nothing
local unit u1 = GetAttacker()
local unit u2 = GetTriggerUnit()
local location p1 = GetUnitLoc(u1)
local location p2 = GetUnitLoc(u2)
if ( GetUnitTypeId(u1) == 'n00L' ) then
else
if ( GetUnitTypeId(u1) == 'n00M' ) then
else
if ( GetUnitTypeId(u1) == 'n00N' ) then
call TriggerSleepAction(( DistanceBetweenPoints(p1, p2) / 1800.00 ))
call UnitAddAbility( 'A00T', u2 )
call SetUnitInvulnerable( u2, true )
else
return
endif
endif
endif
endfunction
function InitTrig_Misc_VortexTowerAbility takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( t, function Trig_Misc_VortexTowerAbility )
set t = null
endfunction
//TESH.scrollpos=63
//TESH.alwaysfold=0
function Trig_Misc_Hints_Init takes nothing returns nothing
local integer i = 1
call ForceAddPlayerSimple( Player(0), udg_PlayerHintGroup )
call ForceAddPlayerSimple( Player(1), udg_PlayerHintGroup )
call ForceAddPlayerSimple( Player(2), udg_PlayerHintGroup )
call ForceAddPlayerSimple( Player(3), udg_PlayerHintGroup )
set udg_s_Hint[i] = "This map is made by SeriousEnemy [Northrend]."
set i = i + 1
set udg_s_Hint[i] = "Visit the hiveworkshop for thousands of maps!"
set i = i + 1
set udg_s_Hint[i] = "Press Esc to enter the control panel."
set i = i + 1
set udg_s_Hint[i] = "Background of tooltips (etc.) have been painted black to make texts more readable."
set i = i + 1
set udg_s_Hint[i] = "Building different towers is the best way to win."
set i = i + 1
set udg_s_Hint[i] = "A few but upgradet towers are better than mass."
set i = i + 1
set udg_s_Hint[i] = "Energy Towers are good at the end of the mazers way."
set i = i + 1
set udg_s_Hint[i] = "Boulder Towers are support towers, they are useless alone."
set i = i + 1
set udg_s_Hint[i] = "Got gold problems? Summon some Paladins."
set i = i + 1
set udg_s_Hint[i] = "Cold Towers are good for slowing down mazers. You just need a few of them."
set i = i + 1
set udg_s_Hint[i] = "Rune Lures get more damage if they kill mazers. Try to find good places to build."
set i = i + 1
set udg_s_Hint[i] = "Fire Towers have got a good ability for doing splash damage. Build them next to Cold Towers."
set i = i + 1
set udg_s_Hint[i] = "You can sell towers for the original price, upgrades are included."
set i = i + 1
set udg_s_Hint[i] = "Mazers try to run to the middle of the map."
set i = i + 1
set udg_s_Hint[i] = "The multiboard shows the earned gold, not the current gold for each player."
set i = i + 1
set udg_s_Hint[i] = "This map is using an automatically Restarting System. Just stay if you want to continue playing."
set i = i + 1
set udg_s_Hint[i] = "You can't help other players with building towers, sharing gold or whatever."
set i = i + 1
set udg_s_Hint[i] = "This map is unprotected. You are allowed to take parts of it, but please give me credits. Never upload a changed version of this map."
set i = i + 1
set udg_s_Hint[i] = "If you need help with some stuff you can find here write me a PM at www.hiveworkshop.com."
set i = i + 1
set udg_s_Hint[i] = "Have fun playing."
set udg_i_HintsMax = i
endfunction
function Trig_Misc_Hints_DisplayHint takes nothing returns nothing
local integer i
set i = GetRandomInt(1, udg_i_HintsMax)
if ( IsPlayerInForce(Player(0), udg_PlayerHintGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(0)), ( "|c0020c000Hint [|r|c00fffc01" + ( I2S(i) + ( "|r|c0020c000/|r|c00fffc01" + ( I2S(udg_i_HintsMax) + ( "|r|c0020c000]:|r |cff87ceeb" + udg_s_Hint[i] ) ) ) ) ) )
else
endif
if ( IsPlayerInForce(Player(1), udg_PlayerHintGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(1)), ( "|c0020c000Hint [|r|c00fffc01" + ( I2S(i) + ( "|r|c0020c000/|r|c00fffc01" + ( I2S(udg_i_HintsMax) + ( "|r|c0020c000]:|r |cff87ceeb" + udg_s_Hint[i] ) ) ) ) ) )
else
endif
if ( IsPlayerInForce(Player(2), udg_PlayerHintGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(2)), ( "|c0020c000Hint [|r|c00fffc01" + ( I2S(i) + ( "|r|c0020c000/|r|c00fffc01" + ( I2S(udg_i_HintsMax) + ( "|r|c0020c000]:|r |cff87ceeb" + udg_s_Hint[i] ) ) ) ) ) )
else
endif
if ( IsPlayerInForce(Player(3), udg_PlayerHintGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(3)), ( "|c0020c000Hint [|r|c00fffc01" + ( I2S(i) + ( "|r|c0020c000/|r|c00fffc01" + ( I2S(udg_i_HintsMax) + ( "|r|c0020c000]:|r |cff87ceeb" + udg_s_Hint[i] ) ) ) ) ) )
else
endif
endfunction
function InitTrig_Misc_Hints takes nothing returns nothing
local trigger t1 = CreateTrigger()
local trigger t2 = CreateTrigger()
call TriggerRegisterTimerEventSingle( t1, 0.50 )
call TriggerRegisterTimerEventPeriodic( t2, 30.00 )
call TriggerAddAction( t1, function Trig_Misc_Hints_Init )
call TriggerAddAction( t2, function Trig_Misc_Hints_DisplayHint )
set t1 = null
set t2 = null
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_Misc_ChangeFoodMessage takes nothing returns nothing
local force f = CreateForce ()
local integer i = 0
loop
exitwhen i == 4
call ForceAddPlayerSimple( Player(i), f )
call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 0 )
set i = i + 1
endloop
set i = 0
call TriggerSleepAction( 90.00 )
loop
exitwhen i == 4
call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 80 )
set i = i + 1
endloop
set i = 0
call TriggerSleepAction( 90.00 )
loop
exitwhen i == 4
call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 100 )
set i = i + 1
endloop
call DestroyForce(f)
set f = null
endfunction
//===========================================================================
function InitTrig_Misc_ChangeFoodMessage takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventPeriodic( t, 270.00 )
call TriggerAddAction( t, function Trig_Misc_ChangeFoodMessage )
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Misc_Music takes nothing returns nothing
local integer i = GetRandomInt(1, 19)
local integer i2 = 1
local real r
local string s
call StopMusic( false )
call SetMusicVolume( 100 )
if i == 1 then
call PlayMusic( gg_snd_01_ArthasTheme )
set s = "Song 01 - Arthas Theme"
set r = 122.40
elseif i == 2 then
call PlayMusic( gg_snd_02_Comradeship )
set s = "Song 02 - Comradeship"
set r = 125.00
elseif i == 3 then
call PlayMusic( gg_snd_03_Credits )
set s = "Song 03 - Credits"
set r = 69.90
elseif i == 4 then
call PlayMusic( gg_snd_04_Human1 )
set s = "Song 04 - Human1"
set r = 273.10
elseif i == 5 then
call PlayMusic( gg_snd_05_Human2 )
set s = "Song 05 - Human2"
set r = 237.00
elseif i == 6 then
call PlayMusic( gg_snd_06_HumanX1 )
set s = "Song 06 - HumanX1"
set r = 284.80
elseif i == 7 then
call PlayMusic( gg_snd_07_NightElf1 )
set s = "Song 07 - NightElf1"
set r = 251.00
elseif i == 8 then
call PlayMusic( gg_snd_08_NightElf2 )
set s = "Song 08 - NightElf2"
set r = 279.70
elseif i == 9 then
call PlayMusic( gg_snd_09_NightElf3 )
set s = "Song 09 - NightElf3"
set r = 260.60
elseif i == 10 then
call PlayMusic( gg_snd_10_NightElfX1 )
set s = "Song 10 - NightElfX1"
set r = 293.90
elseif i == 11 then
call PlayMusic( gg_snd_11_Orc3 )
set s = "Song 11 - Orc3"
set r = 282.80
elseif i == 12 then
call PlayMusic( gg_snd_12_OrcTheme )
set s = "Song 12 - OrcTheme"
set r = 112.60
elseif i == 13 then
call PlayMusic( gg_snd_13_OrcX1 )
set s = "Song 13 - OrcX1"
set r = 325.00
elseif i == 14 then
call PlayMusic( gg_snd_14_PursuitTheme )
set s = "Song 14 - PursuitTheme"
set r = 82.60
elseif i == 15 then
call PlayMusic( gg_snd_15_SadMystery )
set s = "Song 15 - SadMystery"
set r = 84.60
elseif i == 16 then
call PlayMusic( gg_snd_16_TragicConfrontation )
set s = "Song 16 - TragicConfrontation"
set r = 73.50
elseif i == 17 then
call PlayMusic( gg_snd_17_UndeadX1 )
set s = "Song 17 - UndeadX1"
set r = 270.80
elseif i == 18 then
call PlayMusic( gg_snd_18_War2IntroMusic )
set s = "Song 18 - War2IntroMusic"
set r = 81.30
else
call PlayMusic( gg_snd_19_PH1 )
set s = "Song 19 - PH1"
set r = 281.70
endif
if ( IsPlayerInForce(Player(0), udg_PlayerMusicGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(0)), ( "|c001ce6b9Now Playing:|r " + s))
else
endif
if ( IsPlayerInForce(Player(1), udg_PlayerMusicGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(1)), ( "|c001ce6b9Now Playing:|r " + s))
else
endif
if ( IsPlayerInForce(Player(2), udg_PlayerMusicGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(2)), ( "|c001ce6b9Now Playing:|r " + s))
else
endif
if ( IsPlayerInForce(Player(3), udg_PlayerMusicGroup) == true ) then
call DisplayTextToForce( GetForceOfPlayer(Player(3)), ( "|c001ce6b9Now Playing:|r " + s))
else
endif
//Using the next loop to make sure that the music doesn't end instantly, some tracks just sound bad without it
loop
exitwhen i2 == 11
call SetMusicVolume( 100 - (i2 * 8))
call TriggerSleepAction(0.50)
set i2 = i2 + 1
endloop
call TriggerSleepAction(r - 5.00)
call ClearMapMusic( )
call TriggerExecute( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Misc_Music takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventSingle( t, 30.00 )
call TriggerAddAction( t, function Trig_Misc_Music )
set t = null
endfunction