//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_CustomValue | integer | 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=7
//TESH.alwaysfold=0
function Trig_A1_Actions takes nothing returns nothing
local unit u
call BJDebugMsg("If you want to preview the ability, type 'test' without the quotes!!!")
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=29
//TESH.alwaysfold=0
function Trig_A2_Actions takes nothing returns nothing
local unit array c
local unit array t
local integer i
call SetUserControlForceOff(GetPlayersAll())
if (GetLocalPlayer()==Player(0)) then
call CameraSetupApplyForceDuration(gg_cam_Camara,true,0)
endif
set c[2]=CreateUnit(Player(0),'Obla',-1600,0,0)
set c[3]=CreateUnit(Player(0),'Obla',-1600,150,0)
set c[1]=CreateUnit(Player(0),'Obla',-1600,-150,0)
set t[2]=CreateUnit(Player(1),'hfoo',-1250,0,180)
set t[3]=CreateUnit(Player(1),'hfoo',-1250,150,180)
set t[1]=CreateUnit(Player(1),'hfoo',-1250,-150,180)
set i=1
loop
exitwhen i>3
call UnitRemoveAbility(t[i],'Aatk')
call UnitRemoveAbility(t[i],'Amov')
call UnitRemoveAbility(c[i],'Aatk')
call UnitAddAbility(c[i],'A000')
call SetUnitAbilityLevel(c[i], 'A000', i)
set i=i+1
endloop
call TriggerSleepAction(2)
set i=1
loop
exitwhen i>3
call IssueTargetOrder(c[i],"absorb",t[i])
call CreateTextTagLocBJ("Fatal sword - Level: "+I2S(i),GetUnitLoc(c[i]),0,10,100,100,100,0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(),false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(),64,90)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(),4)
call SetTextTagLifespanBJ(GetLastCreatedTextTag(),5)
call TriggerSleepAction(0.2)
set i=i+1
endloop
call TriggerSleepAction(3)
set i=1
loop
exitwhen i>3
call RemoveUnit(c[i])
call RemoveUnit(t[i])
set i=i+1
endloop
if (GetLocalPlayer()==Player(0)) then
call CameraSetupApplyForceDuration(gg_cam_Camara2,true,0)
endif
call SetUserControlForceOn(GetPlayersAll())
endfunction
function InitTrig_A2 takes nothing returns nothing
set gg_trg_A2=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_A2,Player(0),"test",true)
call TriggerAddAction(gg_trg_A2,function Trig_A2_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=54
//TESH.alwaysfold=0
//*************************************************************
//TEST THE SPELL FIRST TO CONFIGURE ANYTHING BELOW THIS
//*************************************************************
function FS_Ability takes nothing returns integer
return 'A000'
//Raw code of the ability
endfunction
function FS_Animation takes nothing returns integer
return 2
//Animation index
endfunction
function FS_ChargeTime takes nothing returns real
return 0.2
//Time to charge the attack
endfunction
function FS_DistanceM takes nothing returns real
return 150.
//Distance after the attack
endfunction
function FS_Effect1 takes nothing returns string
return "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
//Weapon effect
endfunction
function FS_Effect1AP takes nothing returns string
return "weapon"
//Weapon attach point
endfunction
function FS_Effect2 takes nothing returns string
return "Abilities\\Spells\\Undead\\OrbOfDeath\\OrbOfDeathMissile.mdl"
//Movement effect
endfunction
function FS_Effect3 takes nothing returns string
return "Objects\\Spawnmodels\\Undead\\UndeadBlood\\UndeadBloodNecromancer.mdl"
//Blood effect
endfunction
function FS_Velocity takes nothing returns real
return 1600.
//Movement speed
endfunction
function FS_Range takes nothing returns real
return 125.
//Attack range
endfunction
function FS_AttackType takes nothing returns attacktype
return ATTACK_TYPE_NORMAL
//Attack type
endfunction
function FS_DamageType takes nothing returns damagetype
return DAMAGE_TYPE_NORMAL
//Damage type
endfunction
function FS_WeaponType takes nothing returns weapontype
return WEAPON_TYPE_METAL_MEDIUM_SLICE
//Weapon type
endfunction
function FS_Damage takes integer level returns real
return 175. * level
//Damage per level
endfunction
function FS_RechargeEnergy takes nothing returns real
return 2.
//Time to recharge the energy
endfunction
function FS_TimerInterval takes nothing returns real
return 0.025
//FPS || Default = 0.025 (1 / 0.025 = 40 FPS)
endfunction
//*************************************************************
//TOUCH ANYTHING BELOW THIS ONLY IF YOU KNOW JASS
//*************************************************************
function FS_Distance takes unit c, unit tar returns real
return SquareRoot((GetUnitX(tar) - GetUnitX(c)) * (GetUnitX(tar) - GetUnitX(c)) + (GetUnitY(tar) - GetUnitY(c)) * (GetUnitY(tar) - GetUnitY(c)))
endfunction
function FS_Loop takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = GetHandleId(t)
local unit c = LoadUnitHandle(udg_FS_HashTable, i, 0)
local unit tar = LoadUnitHandle(udg_FS_HashTable, i, 1)
local integer level = LoadInteger(udg_FS_HashTable, i, 2)
local real ready = LoadReal(udg_FS_HashTable, i, 3)
local real distance = LoadReal(udg_FS_HashTable, i, 4)
local real angle = LoadReal(udg_FS_HashTable, i, 5)
local boolean finish = LoadBoolean(udg_FS_HashTable, i, 6)
local boolean attack = LoadBoolean(udg_FS_HashTable, i, 7)
local real interval = LoadReal(udg_FS_HashTable, i, 9)
local real wait = LoadReal(udg_FS_HashTable, i, 10)
local real x
local real y
local real int = FS_TimerInterval()
if distance < FS_DistanceM() and not IsTerrainPathable(GetUnitX(c), GetUnitY(c), PATHING_TYPE_WALKABILITY) == true then
if ready > int and not finish and not IsUnitType(c, UNIT_TYPE_DEAD) then
call SaveReal(udg_FS_HashTable, i, 3, ready - int)
else
call SaveBoolean(udg_FS_HashTable, i, 6, true)
endif
if finish then
set x = GetUnitX(c) + FS_Velocity() * int * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(c) + FS_Velocity() * int * Sin(angle * bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(FS_Effect2(), x, y))
if distance > (0. - 10.) and not attack then
if FS_Distance(c, tar) <= FS_Range() then
call DestroyEffect(LoadEffectHandle(udg_FS_HashTable, i, 8))
call UnitDamageTarget(c, tar, FS_Damage(level), true, false, FS_AttackType(), FS_DamageType(), FS_WeaponType())
call SetUnitTimeScale(c, 0)
call SaveBoolean(udg_FS_HashTable, i, 7, true)
else
call LoadEffectHandle(udg_FS_HashTable, i, 8)
call SaveBoolean(udg_FS_HashTable, i, 7, true)
endif
endif
if attack then
call DestroyEffect(AddSpecialEffectTarget(FS_Effect3(), tar, "chest"))
call DestroyEffect(AddSpecialEffectTarget(FS_Effect3(), c, "weapon"))
endif
call SetUnitX(c, x)
call SetUnitY(c, y)
call SaveReal(udg_FS_HashTable, i, 4, distance + FS_Velocity() * int)
endif
else
if wait > int and attack then
call SaveReal(udg_FS_HashTable, i, 10, wait - int)
else
call SetUnitPathing(c, true)
call SetUnitTimeScale(c, 1)
call SetUnitAnimation(c, "stand")
call PauseUnit(c, false)
call PauseTimer(t)
call FlushChildHashtable(udg_FS_HashTable, i)
call DestroyTimer(t)
endif
endif
set c = null
set tar = null
set t = null
endfunction
function FS_Actions takes nothing returns boolean
local unit c
local unit tar
local integer level
local timer t
local integer i
local real int = FS_TimerInterval()
if GetSpellAbilityId() == FS_Ability() then
set c = GetTriggerUnit()
set tar = GetSpellTargetUnit()
set level = GetUnitAbilityLevel(c, FS_Ability())
set t = CreateTimer()
set i = GetHandleId(t)
call SaveAgentHandle(udg_FS_HashTable, i, 0, c)
call SaveAgentHandle(udg_FS_HashTable, i, 1, tar)
call SaveInteger(udg_FS_HashTable, i, 2, level)
call SaveReal(udg_FS_HashTable, i, 3, FS_ChargeTime())
call SaveReal(udg_FS_HashTable, i, 4, 0 - FS_Distance(c, tar))
call SaveReal(udg_FS_HashTable, i, 5, bj_RADTODEG * Atan2(GetUnitY(tar) - GetUnitY(c), GetUnitX(tar) - GetUnitX(c)))
call SaveBoolean(udg_FS_HashTable, i, 6, false)
call SaveBoolean(udg_FS_HashTable, i, 7, false)
call SaveAgentHandle(udg_FS_HashTable, i, 8, AddSpecialEffectTarget(FS_Effect1(), c, FS_Effect1AP()))
call SaveReal(udg_FS_HashTable, i, 9, 0)
call SaveReal(udg_FS_HashTable, i, 10, FS_RechargeEnergy())
call TimerStart(t, int, true, function FS_Loop)
call PauseUnit(c, true)
call SetUnitPathing(c, false)
call SetUnitAnimation(c, "stand")
call SetUnitAnimationByIndex(c, FS_Animation())
set c = null
set tar = null
set t = null
endif
return false
endfunction
function InitTrig_FS takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function FS_Actions))
set udg_FS_HashTable = InitHashtable()
set t = null
endfunction