//================
function H2I takes handle h returns integer
return h
return 0
endfunction
// ===========================
function LocalVars takes nothing returns gamecache
return udg_hash
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTextTag takes handle subject, string name returns texttag
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
Name | Type | is_array | initial_value |
Alliance_TauntSound | sound | Yes | |
Allunappi | button | No | |
Alluvote | integer | No | |
Alluwarru | unit | No | |
Alwar_on | boolean | No | true |
Arcane | unit | Yes | |
Backstab | real | Yes | |
Backstabuhri | real | Yes | |
Baronefecti | effect | No | |
BaronPommi | unit | No | |
Brilli | group | No | |
BuffTime | real | No | |
Capture | multiboard | No | |
ComboUnits | group | No | |
Conet | group | No | |
createdtext | string | No | |
Death_Timer_Window | timerdialog | Yes | |
Death_Timers | timer | Yes | |
EffectAngle | real | No | |
EffectPoint | location | Yes | |
FrostNovaGroup | group | No | |
FrostNovaLevel | integer | No | |
FrostNovaRange | integer | No | |
FrostNovaTimer | timer | No | |
Game_Time_String | string | No | |
GameOn | boolean | No | |
GhostUnits | group | No | |
hash | gamecache | No | |
HeroLevel | integer | No | |
HeroSkill_learn | heroskillcode | Yes | |
HeroSkill_real | heroskillcode | Yes | |
HeroSkillAsAbility | abilcode | No | |
Horde_TauntSound | sound | Yes | |
Hordenappi | button | No | |
Hordevote | integer | No | |
HordeWarru | unit | No | |
Horwar_on | boolean | No | true |
Hurripoint | location | Yes | |
Hurrireal | real | Yes | |
Hurriunit | unit | Yes | |
Hurriunit2 | unit | Yes | |
Kidney | unit | No | |
Koira | unit | Yes | |
Luciporukka | group | No | |
max | real | No | |
MC | unit | No | |
Mcp | player | No | |
Mis2 | unit | No | |
Misle | unit | No | |
Mislettaja | unit | No | |
Missle | boolean | No | |
Napit | real | No | |
NovaDamage | real | No | |
Player_Hero_Deaths | integer | Yes | |
Player_Hero_Kills | integer | Yes | |
Player_Kill_Streak_Bool | boolean | Yes | |
Player_Kill_Streak_Int | integer | Yes | |
Player_Unit_Heroes | unit | Yes | |
Players_Alliance_East | force | No | |
Players_Horde_West | force | No | |
Poly | unit | Yes | |
Powerhela | real | No | |
Regrowth | unit | Yes | |
retrive | texttag | No | |
seeunit | force | No | |
Shield | unit | Yes | |
ShieldLife | real | No | |
SkillLevel | integer | Yes | |
Soulstone | unit | No | |
spawnpoint | location | No | |
special | real | No | |
SpecialFX | effect | No | |
Stone | item | Yes | |
Surger | unit | No | |
Taikoo | effect | Yes | |
Temp_Int_Multiboard | integer | No | |
TempGroup | group | No | |
TempInt | integer | No | |
TempPlayer | player | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempReal | real | No | |
TempString | string | No | |
TempUnit | unit | No | |
Viper | unit | No | |
Votetus | dialog | No | |
Warlock_demoni | unit | Yes |
****************
*Implimintation*
****************
before implimenting, make sure "automatically create unknown variables
while pasting trigger data" in the prefernces menu is on.
1. Copy PWS ability, buff and dead fixer ability to your map.
2. Copy the trigger folder "Spell" to your map.
3. copy everything in the custom script section
(Click on the map name above the "spell" folder) to your map.
4. Change the raw codes in the "Shield damage" trigger to the ones that show up in your map (Press Ctrl + D to show them.
5. Modify the cast PWS trigger to your spell name and change the shield life formula if neccecary.
function GetShieldBuff takes nothing returns integer
return 'B00Y'
endfunction
function GetShieldDeadFixer takes nothing returns integer
return 'A02X'
endfunction
//====================================================
function Trig_Shield_Damage_Actions_Child takes nothing returns nothing
local timer x = GetExpiredTimer()
local real special = GetHandleReal( x, "special" )
local unit ouch = GetHandleUnit( x, "unit" )
local real dmg = GetHandleReal( x, "dmg" )
if special < 0.00 then
call SetUnitLifeBJ( ouch, ( GetUnitStateSwap(UNIT_STATE_LIFE, ouch) + dmg ) )
set special = RAbsBJ(special)
call SetUnitLifeBJ( ouch, ( GetUnitStateSwap(UNIT_STATE_LIFE, ouch) - special ) )
set special = 0.00
call UnitRemoveBuffBJ( GetShieldBuff(), ouch )
call SetHandleReal( GetTriggerUnit(), "shieldmax", 0.00)
set udg_retrive = GetHandleTextTag( ouch, "float" )
call SetHandleHandle( ouch, "float", null)
call DestroyTextTagBJ( udg_retrive )
else
call SetUnitLifeBJ( ouch, ( GetUnitStateSwap(UNIT_STATE_LIFE, ouch) + dmg ) )
endif
call UnitRemoveAbilityBJ( GetShieldDeadFixer(), ouch )
call SetHandleReal( ouch, "shield", special )
set x = null
endfunction
function Trig_Shield_Damage_Actions takes nothing returns nothing
local timer x = CreateTimer()
local real special = GetHandleReal( GetTriggerUnit(), "shield" )
local effect fx
call UnitAddAbilityBJ( GetShieldDeadFixer(), GetTriggerUnit() )
if GetEventDamage() == 0 then
call UnitRemoveAbilityBJ( GetShieldDeadFixer(), GetTriggerUnit() )
set x = null
return
endif
if special == 0 then
call UnitRemoveAbilityBJ( GetShieldDeadFixer(), GetTriggerUnit())
set x = null
return
endif
if UnitHasBuffBJ(GetTriggerUnit(), GetShieldBuff()) == false then
call SetHandleReal( GetTriggerUnit(), "shieldmax", 0.00)
set udg_retrive = GetHandleTextTag( GetTriggerUnit(), "float" )
call SetHandleHandle( GetTriggerUnit(), "float", null)
call DestroyTextTagBJ( udg_retrive )
call UnitRemoveAbilityBJ( GetShieldDeadFixer(), GetTriggerUnit() )
set x = null
return
endif
set fx = AddSpecialEffectTargetUnitBJ( "origin", GetTriggerUnit(), "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" )
call DestroyEffectBJ( fx )
set special = special - GetEventDamage()
call SetHandleHandle( x, "unit", GetTriggerUnit() )
call SetHandleReal( x, "special", special )
call SetHandleReal( x, "dmg", GetEventDamage() )
call TimerStart(x, 0.01, false, function Trig_Shield_Damage_Actions_Child)
set x = null
endfunction
//===========================================================================
function InitTrig_Shield_Damage takes nothing returns nothing
set gg_trg_Shield_Damage = CreateTrigger( )
call TriggerAddAction( gg_trg_Shield_Damage, function Trig_Shield_Damage_Actions )
endfunction
//===========================================================================
function Trig_Learn_Frost_Nova_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Learn_Frost_Nova_Actions takes nothing returns nothing
set udg_FrostNovaLevel = ( udg_FrostNovaLevel + 1 )
endfunction
//===========================================================================
function InitTrig_Learn_Frost_Nova takes nothing returns nothing
set gg_trg_Learn_Frost_Nova = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Learn_Frost_Nova, GetTriggerUnit, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Learn_Frost_Nova, Condition( function Trig_Learn_Frost_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Learn_Frost_Nova, function Trig_Learn_Frost_Nova_Actions )
endfunction