- Joined
- Sep 10, 2006
- Messages
- 185
-
Shatter
-
Events
- Unit - A unit Is attacked
-
Conditions
- (Unit-type of (Attacking unit)) Equal to Fountain of Blood
-
Actions
- -------- Locals --------
- Custom script: local unit udg_ShatterUnit
- Custom script: local location udg_ShatterPos
- Custom script: local effect udg_ShatterEffect
- -------- Set Variables --------
- Set ShatterUnit = (Attacked unit)
- Set ShatterPos = (Position of ShatterUnit)
- Set ShatterInt = (Random integer number between 1 and 2)
- -------- Actions --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ShatterInt Equal to 1
-
Then - Actions
- Game - Display to (All players) the text: gg
- Special Effect - Create a special effect attached to the origin of ShatterUnit using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
- Set ShatterEffect = (Last created special effect)
- Unit - Pause ShatterUnit
- Wait 2.00 seconds
- Unit - Unpause ShatterUnit
- Special Effect - Destroy ShatterEffect
- Special Effect - Create a special effect at ShatterPos using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
- Set ShatterEffect = (Last created special effect)
- Special Effect - Destroy ShatterEffect
- Unit - Set life of ShatterUnit to ((Life of ShatterUnit) - ((Max life of ShatterUnit) x 0.75))
- Else - Actions
-
If - Conditions
- -------- Null Locals --------
- Custom script: call RemoveLocation(udg_ShatterPos)
- Custom script: set udg_ShatterUnit = null
-
Events
JASS:
function Trig_Shatter_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'nbfl' ) ) then
return false
endif
return true
endfunction
function Trig_Shatter_Func010C takes nothing returns boolean
if ( not ( udg_ShatterInt == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Shatter_Actions takes nothing returns nothing
// Locals
local unit udg_ShatterUnit
local location udg_ShatterPos
local effect udg_ShatterEffect
// Set Variables
set udg_ShatterUnit = GetAttackedUnitBJ()
set udg_ShatterPos = GetUnitLoc(udg_ShatterUnit)
set udg_ShatterInt = GetRandomInt(1, 2)
// Actions
if ( Trig_Shatter_Func010C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_508" )
call AddSpecialEffectTargetUnitBJ( "origin", udg_ShatterUnit, "Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl" )
set udg_ShatterEffect = GetLastCreatedEffectBJ()
call PauseUnitBJ( true, udg_ShatterUnit )
call TriggerSleepAction( 2 )
call PauseUnitBJ( false, udg_ShatterUnit )
call DestroyEffectBJ( udg_ShatterEffect )
call AddSpecialEffectLocBJ( udg_ShatterPos, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
set udg_ShatterEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_ShatterEffect )
call SetUnitLifeBJ( udg_ShatterUnit, ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_ShatterUnit) - ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, udg_ShatterUnit) * 0.75 ) ) )
else
endif
// Null Locals
call RemoveLocation(udg_ShatterPos)
set udg_ShatterUnit = null
endfunction
//===========================================================================
function InitTrig_Shatter takes nothing returns nothing
set gg_trg_Shatter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shatter, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shatter, Condition( function Trig_Shatter_Conditions ) )
call TriggerAddAction( gg_trg_Shatter, function Trig_Shatter_Actions )
endfunction
All that happens is the game display "gg". It's supposed to put the freezing breath art on them, pause them for 2 seconds, then reduce their hp by 25%.
ty to anyone who helps.
EDIT: Added jass version if that helps.