//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
DamageBlockingAbility | abilcode | No | |
DamageEvent | real | No | |
DamageEventAmount | real | No | |
DamageEventExplodesUnit | boolean | No | |
DamageEventOverride | boolean | No | |
DamageEventPrevAmt | real | No | |
DamageEventSource | unit | No | |
DamageEventsWasted | integer | No | |
DamageEventTarget | unit | No | |
DamageEventTrigger | trigger | No | |
DamageEventType | integer | No | |
DamageModifierEvent | real | No | |
DamageTypeDOT | integer | No | |
DamageTypeRanged | integer | No | |
DamageTypeSpell | integer | No | |
DemoVelocity | real | No | |
DmgEvLife | real | No | |
DmgEvN | integer | No | |
DmgEvStack | unit | Yes | |
DmgEvTimer | timer | No | |
DmgTypPrev | integer | No | |
FS_HashTable | hashtable | No | |
MA_MagicCount | integer | Yes | |
Point | location | No | |
TempUnit | unit | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
uinidne | integer | No | |
UnitDamageRegistered | boolean | Yes | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
UnitIndexLock | integer | Yes | |
Valor | integer | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_A1_Actions takes nothing returns nothing
local unit u
call GroupEnumUnitsInRect(bj_lastCreatedGroup,bj_mapInitialPlayableArea,null)
loop
set u=FirstOfGroup(bj_lastCreatedGroup)
exitwhen u==null
call GroupRemoveUnit(bj_lastCreatedGroup,u)
if IsUnitEnemy(u,Player(0)) then
call UnitRemoveAbility(u,'Aatk')
call UnitRemoveAbility(u,'Amov')
else
//call UnitRemoveAbility(u,'Aatk')
call SelectUnitAddForPlayer(u, GetOwningPlayer(u))
call SetHeroLevel(u,10,false)
endif
endloop
call TriggerSleepAction(0.5)
call StopMusicBJ(false)
call EndThematicMusicBJ()
call PlayThematicMusicBJ("KhaosMachine.mp3")
call CreateFogModifierRectBJ(true,Player(0),FOG_OF_WAR_VISIBLE,GetPlayableMapRect())
endfunction
function InitTrig_A1 takes nothing returns nothing
set gg_trg_A1=CreateTrigger()
call TriggerAddAction(gg_trg_A1,function Trig_A1_Actions)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_A3_Actions takes nothing returns nothing
call StopMusicBJ(false)
call EndThematicMusicBJ()
call PlayThematicMusicBJ("KhaosMachine.mp3")
endfunction
function InitTrig_A3 takes nothing returns nothing
set gg_trg_A3=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(gg_trg_A3,6.85)
call TriggerAddAction(gg_trg_A3,function Trig_A3_Actions)
endfunction
//TESH.scrollpos=51
//TESH.alwaysfold=0
//*************************************************************
//TEST THE SPELL FIRST TO CONFIGURE ANYTHING BELOW THIS
//*************************************************************
function MA_HeroAbility takes nothing returns integer
return 'A001'
//Rawcode of the hero spell
endfunction
function MA_DMGBonusAbilityInfo takes nothing returns integer
return 'A002'
//Rawcode of the damage bonus ability for the hero
endfunction
function MA_SPDBonusAbilityInfo takes nothing returns integer
return 'A003'
//Rawcode of the speed bonus ability for the hero
endfunction
function MA_DamageAbility takes nothing returns integer
return 'A005'
//Rawcode of the ability that gives the damage bonus to the hero
endfunction
function MA_SpeedAbility takes nothing returns integer
return 'A004'
//Rawcode of the ability that gives the speed bonus to the hero
endfunction
function MA_Dummy takes nothing returns integer
return 'u000'
//Rawcode of the dummy that cast the bonus spells
endfunction
function MA_DamageOrder takes nothing returns string
return "innerfire"
//The order to cast the damage bonus spell
endfunction
function MA_SpeedOrder takes nothing returns string
return "bloodlust"
//The order to cast the speed bonus spell
endfunction
function MA_ChargesPerLevel takes integer level returns integer
return 5 + 15 * level
//Max charges per level, you can change this relationated with the bonus spells on the object editor
endfunction
//*************************************************************
//TOUCH ANYTHING BELOW THIS ONLY IF YOU KNOW JASS
//*************************************************************
function MA1_Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
if GetLearnedSkill() == MA_HeroAbility() and GetLearnedSkillLevel() == 1 then
call UnitAddAbility(u, MA_DMGBonusAbilityInfo())
call UnitAddAbility(u, MA_SPDBonusAbilityInfo())
endif
set u = null
return false
endfunction
function MA2_Actions takes nothing returns boolean
local unit a = udg_DamageEventSource
local unit t = udg_DamageEventTarget
local texttag tt
local integer i
local integer level
local string st
if IsUnitEnemy(a, GetOwningPlayer(t)) and GetUnitAbilityLevel(a, MA_HeroAbility()) > 0 and not IsUnitType(t, UNIT_TYPE_DEAD) and not IsUnitType(t, UNIT_TYPE_STRUCTURE) and not IsUnitType(t, UNIT_TYPE_MAGIC_IMMUNE) then
set i = GetUnitUserData(a)
set level = GetUnitAbilityLevel(a, MA_HeroAbility())
if udg_MA_MagicCount[i] < MA_ChargesPerLevel(level) then
set udg_MA_MagicCount[i] = udg_MA_MagicCount[i] + 1
if GetLocalPlayer() == GetOwningPlayer(a) then
set st = I2S(udg_MA_MagicCount[i])
endif
set tt = CreateTextTag()
call SetTextTagText(tt, st, 0.028)
call SetTextTagPos(tt, GetUnitX(a), GetUnitY(a) + 75, 160)
call SetTextTagColor(tt, 100, 180, 255, 255)
call SetTextTagVisibility(tt, true)
call SetTextTagVelocity(tt, 0, 0.03)
call SetTextTagFadepoint(tt, 0.25)
call SetTextTagLifespan(tt, 0.4)
call SetTextTagPermanent(tt, false)
endif
endif
set a = null
set t = null
return false
endfunction
function MA3_Actions takes nothing returns boolean
local unit caster = GetTriggerUnit()
local integer unitId = GetUnitUserData(caster)
local integer abilityId
local unit dummy
if udg_MA_MagicCount[unitId] > 0 then
set abilityId = GetSpellAbilityId()
if abilityId == MA_DMGBonusAbilityInfo() then
set dummy = CreateUnit(GetOwningPlayer(caster), MA_Dummy(), GetUnitX(caster), GetUnitY(caster), 0)
call UnitAddAbility(dummy, MA_DamageAbility())
call SetUnitAbilityLevel(dummy, MA_DamageAbility(), udg_MA_MagicCount[unitId])
call IssueTargetOrder(dummy, MA_DamageOrder(), caster)
call UnitApplyTimedLife(dummy, 'BTLF', 0.5)
set udg_MA_MagicCount[unitId] = 0
set dummy = null
elseif abilityId == MA_SPDBonusAbilityInfo() then
set dummy = CreateUnit(GetOwningPlayer(caster), MA_Dummy(), GetUnitX(caster), GetUnitY(caster), 0)
call UnitAddAbility(dummy, MA_SpeedAbility())
call SetUnitAbilityLevel(dummy, MA_SpeedAbility(), udg_MA_MagicCount[unitId])
call IssueTargetOrder(dummy, MA_SpeedOrder(), caster)
call UnitApplyTimedLife(dummy, 'BTLF', 0.5)
set udg_MA_MagicCount[unitId] = 0
set dummy = null
endif
endif
set caster = null
return false
endfunction
function InitTrig_MA takes nothing returns nothing
local trigger t = CreateTrigger()
local unit u = CreateUnit(Player(0), MA_Dummy(), 0, 0, 0)
call UnitAddAbility(u, MA_DMGBonusAbilityInfo())
call UnitAddAbility(u, MA_SPDBonusAbilityInfo())
call UnitAddAbility(u, MA_SpeedAbility())
call UnitAddAbility(u, MA_DamageAbility())
call RemoveUnit(u)
set u = null
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t, Condition(function MA1_Actions))
set t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_DamageEvent", EQUAL, 1.00)
call TriggerAddCondition(t, Condition(function MA2_Actions))
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function MA3_Actions))
set t = null
endfunction