//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
HM_ActiveHeathBar | boolean | No | |
HM_ActiveManaBar | boolean | No | |
HM_Caster | unit | Yes | |
HM_Change_Unit | unit | No | |
HM_Current_Player | player | No | |
HM_Current_Unit | unit | No | |
HM_Data | integer | No | |
HM_DEAD_LOC | real | No | |
HM_Do_Changes | boolean | No | |
HM_Do_Hide | boolean | No | |
HM_EMPTY_MODEL | string | No | |
HM_HandleId | integer | No | |
HM_Hashtable | hashtable | No | |
HM_HP_Z | real | No | |
HM_Illusion_Group | group | No | |
HM_Illusion_Unit | unit | Yes | |
HM_LightningFE | lightning | Yes | |
HM_LightningH | lightning | Yes | |
HM_LightningM | lightning | Yes | |
HM_LightningSE | lightning | Yes | |
HM_Location | location | No | |
HM_LONG | real | No | |
HM_Loop | integer | No | |
HM_MUI | integer | No | |
HM_MUI_Data | integer | Yes | |
HM_PERIODIC | real | No | |
HM_Player | player | Yes | |
HM_Player_Integer | integer | No | |
HM_Release | boolean | Yes | |
HM_SAFE | real | No | |
HM_Scale | real | Yes | |
HM_TIMER | timer | No | |
HM_Unit_Handle | integer | Yes | |
HM_UnitAddBars | unit | No | |
HM_UnitHandleId | integer | Yes | |
HM_UnitSetScale | real | No | |
HM_Z_OFFSET | real | No | |
HP_MODEL | string | No | |
MN_MODEL | string | No | |
TEST_ONLY_Integer | integer | No |
//TESH.scrollpos=1
//TESH.alwaysfold=0
function UnitIllusion takes nothing returns boolean
local unit f = GetFilterUnit()
local integer i
if IsUnitIllusion(f) and GetUnitTypeId(f) == GetUnitTypeId(udg_HM_Caster[udg_HM_Data]) then
set udg_HM_Illusion_Unit[udg_HM_Data] = f
endif
set f = null
return false
endfunction
function Trig_Illusion_Checker_Plugin_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 11
//I think I don't need to using boolean to check Players are playing or not
call GroupEnumUnitsOfPlayer(udg_HM_Illusion_Group,Player(i),function UnitIllusion)
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Illusion_Checker_Plugin takes nothing returns nothing
set gg_trg_Illusion_Checker_Plugin = CreateTrigger( )
call TriggerAddAction( gg_trg_Illusion_Checker_Plugin, function Trig_Illusion_Checker_Plugin_Actions )
endfunction
//TESH.scrollpos=25
//TESH.alwaysfold=0
function Trig_HM_Hide_Bars_To_Player_Actions takes nothing returns nothing
local real alphaNum = 1.
local integer h = GetHandleId(udg_HM_Current_Unit)
local integer curData = LoadInteger(udg_HM_Hashtable,2,h)
local boolean curHidden
local integer curPlayer
//
if curData > 0 then
if udg_HM_Current_Unit != null then
if udg_HM_Current_Player != null then
//
set curPlayer = GetPlayerId(udg_HM_Current_Player)
// Special case: hidden units.
if not udg_HM_Do_Hide and IsUnitHidden(udg_HM_Current_Unit) then
debug call BJDebugMsg("Can't show bars: the unit is hidden.")
else
//
if udg_HM_Do_Hide then
set alphaNum = 0.
endif
//
call SaveBoolean(udg_HM_Hashtable,11+curPlayer,h,udg_HM_Do_Hide)
//
if GetLocalPlayer() == udg_HM_Current_Player then
call SetLightningColor(udg_HM_LightningH[curData],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningM[curData],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningSE[curData],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningFE[curData],1.,1.,1.,alphaNum)
endif
endif
//
set udg_HM_Current_Player = null
//
else
debug call BJDebugMsg("Can't operate bars: Did you add the current player you want to hide heath/mana bar ?.")
endif
//
set udg_HM_Current_Unit = null
//
else
debug call BJDebugMsg("Can't operate bars: Did you add the current unit have heath/mana bar ?.")
endif
else
debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
endif
endfunction
//===========================================================================
function InitTrig_HM_Hide_Bars_To_Player takes nothing returns nothing
set gg_trg_HM_Hide_Bars_To_Player = CreateTrigger( )
call TriggerAddAction(gg_trg_HM_Hide_Bars_To_Player, function Trig_HM_Hide_Bars_To_Player_Actions)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Execution_Actions takes nothing returns nothing
local real alphaNum = 1.
// Special case: hidden units.
if not udg_HM_Do_Hide and IsUnitHidden(udg_HM_Current_Unit) then
debug call BJDebugMsg("Can't show bars: the unit is hidden.")
else
//
if udg_HM_Do_Hide then
set alphaNum = 0.
endif
//
if GetLocalPlayer() == udg_HM_Current_Player then
call SetLightningColor(udg_HM_LightningH[udg_HM_Data],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningM[udg_HM_Data],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningSE[udg_HM_Data],1.,1.,1.,alphaNum)
call SetLightningColor(udg_HM_LightningFE[udg_HM_Data],1.,1.,1.,alphaNum)
endif
endif
//
endfunction
//===========================================================================
function InitTrig_HM_Hide_Bars_To_Player_Execution takes nothing returns nothing
set gg_trg_HM_Hide_Bars_To_Player_Execution = CreateTrigger( )
call TriggerAddAction(gg_trg_HM_Hide_Bars_To_Player_Execution, function Execution_Actions)
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Hide_Bars_All_Player_Actions takes nothing returns nothing
local integer i = 0
local player casterOwner = udg_HM_Current_Player
local integer curData = LoadInteger(udg_HM_Hashtable,2,GetHandleId(udg_HM_Current_Unit))
local player curPlayer
if curData > 0 then
if udg_HM_Current_Unit != null then
if udg_HM_Current_Player != null then
loop
exitwhen i > 11
set curPlayer = Player(i)
if curPlayer != casterOwner then
set udg_HM_Current_Player = curPlayer
call TriggerExecute(gg_trg_HM_Hide_Bars_To_Player)
endif
set i = i + 1
endloop
//
set udg_HM_Current_Player = null
//
else
debug call BJDebugMsg("Can't operate bars: Did you add the current player you want to hide heath/mana bar ?.")
endif
else
debug call BJDebugMsg("Can't operate bars: Did you add the current unit have heath/mana bar ?.")
endif
else
debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
endif
endfunction
//===========================================================================
function InitTrig_Hide_Bars_All_Players takes nothing returns nothing
set gg_trg_Hide_Bars_All_Players = CreateTrigger( )
call TriggerAddAction( gg_trg_Hide_Bars_All_Players, function Trig_Hide_Bars_All_Player_Actions )
endfunction
//TESH.scrollpos=65
//TESH.alwaysfold=0
function Trig_Change_Data_Actions takes nothing returns nothing
local integer curData = LoadInteger(udg_HM_Hashtable,2,GetHandleId(udg_HM_Current_Unit))
//
if curData > 0 then
if udg_HM_Current_Unit != null then
if udg_HM_Change_Unit != null then
if udg_HM_Caster[curData] != udg_HM_Change_Unit then
set udg_HM_Caster[curData] = udg_HM_Change_Unit
else
debug call BJDebugMsg("Can't operate bars: Current unit fit with the unit unit want to transfer heath/mana bar >.<.")
endif
//
set udg_HM_Change_Unit = null
//
else
debug call BJDebugMsg("Can't operate bars: Did you add the unit you want to transfer heath/mana bar ?.")
endif
//
if udg_HM_Do_Changes then
//
if udg_HM_UnitSetScale > 0. then
set udg_HM_Scale[curData] = udg_HM_UnitSetScale
endif
//
set udg_HM_UnitSetScale = 0.
//
if udg_HM_ActiveHeathBar then
if udg_HM_LightningH[curData] != null then
debug call BJDebugMsg("Can't operate this action: HP bar already exist.")
else
set udg_HM_LightningH[curData] = AddLightning(udg_HP_MODEL,true,0.,0.,0.,0.)
set udg_HM_LightningFE[curData] = AddLightning(udg_HM_EMPTY_MODEL,true,0.,0.,0.,0.)
endif
elseif udg_HM_ActiveManaBar then
if udg_HM_LightningM[curData] != null then
debug call BJDebugMsg("Can't operate this action: MP bar already exist.")
else
set udg_HM_LightningM[curData] = AddLightning(udg_MN_MODEL,true,0.,0.,0.,0.)
set udg_HM_LightningSE[curData] = AddLightning(udg_HM_EMPTY_MODEL,true,0.,0.,0.,0.)
endif
endif
//
if not udg_HM_ActiveHeathBar then
if udg_HM_LightningH[curData] == null then
debug call BJDebugMsg("Can't operate this action: HP bar does not exist.")
else
call DestroyLightning(udg_HM_LightningH[curData])
call DestroyLightning(udg_HM_LightningFE[curData])
set udg_HM_LightningH[curData] = null
set udg_HM_LightningFE[curData] = null
endif
elseif not udg_HM_ActiveManaBar then
if udg_HM_LightningM[curData] == null then
debug call BJDebugMsg("Can't operate this action: MP bar does not exist.")
else
call DestroyLightning(udg_HM_LightningM[curData])
call DestroyLightning(udg_HM_LightningSE[curData])
set udg_HM_LightningM[curData] = null
set udg_HM_LightningSE[curData] = null
endif
endif
//
set udg_HM_ActiveHeathBar = false
set udg_HM_ActiveManaBar = false
endif
//
set udg_HM_Current_Unit = null
//
else
debug call BJDebugMsg("Can't operate bars: Did you add the current unit have heath/mana bar ?.")
endif
else
debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
endif
//
endfunction
//===========================================================================
function InitTrig_Change_Data takes nothing returns nothing
set gg_trg_Change_Data = CreateTrigger( )
call TriggerAddAction( gg_trg_Change_Data, function Trig_Change_Data_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Remove_Bars_Actions takes nothing returns nothing
local integer curData = LoadInteger(udg_HM_Hashtable,2,GetHandleId(udg_HM_Current_Unit))
//
if curData > 0 then
if udg_HM_Current_Unit != null then
set udg_HM_Release[curData] = true
else
debug call BJDebugMsg("Can't operate bars: Did you add the current unit have heath/mana bar ?.")
endif
//
set udg_HM_Current_Unit = null
//
else
debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
endif
endfunction
//===========================================================================
function InitTrig_Remove_Bars takes nothing returns nothing
set gg_trg_Remove_Bars = CreateTrigger( )
call TriggerAddAction( gg_trg_Remove_Bars, function Trig_Remove_Bars_Actions )
endfunction
//TESH.scrollpos=7
//TESH.alwaysfold=0
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
// M A N A/ H E A T H B A R S S Y S T E M
// =======
// System created by:
// - Elphis
// What system does:
// This system allow you to create a mana/hp bars on unit :)
//
// H O W T O I M P O R T
// 1: Export LightningData.slk, nhocklanhox6-Elphis.blp, nhocklanhox6-Nyuu.blp, Elphis-Nyuu and import it into your map
// 2: Change path of LightningData.slk = Splats\LightningData.slk
// 3: Change path of nhocklanhox6-Nyuu.blp = ReplaceableTextures\Manabar\nhocklanhox6-Nyuu.blp
// 4: Change path of nhocklanhox6-Elphis.blp = ReplaceableTextures\Manabar\nhocklanhox6-Elphis.blp
// 5: Change path of Elphis-Nyuu = ReplaceableTextures\HitPointBar\Elphis-Nyuu.blp
// WARNING: DO NOT CHANGE THIS PATH, IF YOU CHAGE THIS PATH, ALL LIGHTNING WILL CRASH
// Go to: File -> Preferences -> General -> Check the box labelled "Automatically create unknown variables while pasting trigger data"
// 5: Copy all trigger of folder Resources into your map
// 6: Read the Example Folder
// 7: Enjoy :D
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************