Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes.gui meaning not in jass or vjass?
scope TimeBomb initializer Init
globals
//ability that is used to palce bombs (single target)
private constant integer TRIGGER_SPELL = 'A000'
//ability the bombed unit has to display the buff (tornado slow aura)
private constant integer BUFF_SPELL = 'A001'
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
endglobals
private function GetBombDelay takes integer level returns real
return 5.-1*level
endfunction
private function GetBombTargetDamage takes integer level returns real
return 50.*level
endfunction
private function GetBombAOEDamage takes integer level returns real
return 50.*level
endfunction
private function GetBombAOERange takes integer level returns real
return 150.+50*level
endfunction
//Return true, if the target should be damaged by the area of effect
private function AllowedTargets takes unit caster, unit target returns boolean
return TRUE
endfunction
/*====================================================================
======================= END OF CONFIGURATION =========================
====================================================================*/
globals
private hashtable hash
private group bombedUnits
endglobals
private function DeathConditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), bombedUnits)
endfunction
private function DeathActions takes nothing returns nothing
local unit target = GetTriggerUnit()
call UnitRemoveAbility(target, BUFF_SPELL)
call FlushChildHashtable(hash, GetHandleId(target))
call GroupRemoveUnit(bombedUnits, target)
set target = null
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == TRIGGER_SPELL
endfunction
private function Explode takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer h = GetHandleId(t)
local unit caster = LoadUnitHandle(hash, h, 0)
local unit target = LoadUnitHandle(hash, h, 1)
local integer level = LoadInteger(hash, h, 2)
local group g = CreateGroup()
local unit u
local integer bombCount
if(not IsUnitInGroup(target, bombedUnits)) then
call PauseTimer(t)
call DestroyTimer(t)
call DestroyGroup(g)
set u = null
set g = null
set caster = null
set target = null
set t = null
return
endif
call UnitDamageTarget(caster, target, GetBombTargetDamage(level), TRUE, FALSE, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
call GroupEnumUnitsInRange(g, GetUnitX(target), GetUnitY(target), GetBombAOERange(level), null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if(AllowedTargets(caster, u) )then
call UnitDamageTarget(caster, u, GetBombAOEDamage(level), TRUE, FALSE, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
endif
endloop
call FlushChildHashtable(hash, h)
set h = GetHandleId(target)
set bombCount = LoadInteger(hash, h, 0)-1
call SaveInteger(hash, h, 0, bombCount)
if(bombCount == 0) then
call UnitRemoveAbility(target, BUFF_SPELL)
call FlushChildHashtable(hash, h)
call GroupRemoveUnit(bombedUnits, target)
endif
call PauseTimer(t)
call DestroyTimer(t)
call DestroyGroup(g)
set u = null
set g = null
set caster = null
set target = null
set t = null
endfunction
private function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local integer level = GetUnitAbilityLevel(caster, TRIGGER_SPELL)
local timer t = CreateTimer()
local integer h = GetHandleId(t)
call TimerStart(t, GetBombDelay(level), FALSE, function Explode)
call SaveUnitHandle(hash, h, 0, caster)
call SaveUnitHandle(hash, h, 1, target)
call SaveInteger(hash, h, 2, level)
call UnitAddAbility(target, BUFF_SPELL)
set h = GetHandleId(target)
call SaveInteger(hash, h, 0, LoadInteger(hash, h, 0)+1)
call GroupAddUnit(bombedUnits, target)
set caster = null
set target = null
set t = null
endfunction
private function Init takes nothing returns nothing
local trigger trg = CreateTrigger( )
local integer i = 0
call TriggerRegisterAnyUnitEventBJ( trg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( trg, Condition( function Conditions ) )
call TriggerAddAction( trg, function Actions )
set trg = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trg, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( trg, Condition( function DeathConditions ) )
call TriggerAddAction( trg, function DeathActions )
set hash = InitHashtable()
set bombedUnits = CreateGroup()
set trg = null
endfunction
endscope
A000: yesSo basically replace the A000 with the ability used to place the bomb and A001 with the bomb's buff and it's ready to go?
That's pretty much what I did, but I avoided using waits.Can't this simply be done using one ability that has a buff plus a simple trigger.
Doom silences the target and cyclone cyclones the target. If these effects are not intended, these abilities cannot be used for this.Let's see, you could use "Doom" since its un-dispell-able or maybe cyclone (it could be made un-dispell-able), there are a few other abilities
Untitled Trigger 12

Events


Unit - A unit Begins casting an ability

Conditions


(Ability being cast) Equal to Shadow Strike (Custom)

Actions


Set BUnit = (Target unit of ability being cast)


Set BCastingUnit = (Casting unit)


Wait 10.00 game-time seconds


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(BUnit is alive) Equal to True



Then - Actions




Unit - Cause BCastingUnit to damage circular area after 0.00 seconds of radius 500.00 at (Position of BUnit), dealing 500.00 damage of attack type Spells and damage type Normal




Special Effect - Create a special effect attached to the overhead of BUnit using Abilities\Weapons\FragDriller\FragDriller.mdl




Special Effect - Destroy (Last created special effect)



Else - Actions
@Kaijyuu
I've tried just putting land mines and giving them a health regeneration of -2.0 but they don't explode when it hits 0 hp
In Red Alert 2, Yuri Prime is a stolen-tech unit which can be unlocked when a Soviet-controlled spy (either by mind-controlling a spy or by obtaining access to the Allied techtree) infiltrates a Soviet battle lab. An Allied spy infiltrating Soviet battle lab and having an access to Soviet barracks (also built or captured) will have the same effect.
Yuri Prime himself is simply a much more powerful version of the Psi-Corps trooper. In Yuri's Revenge, the unit was changed and given the role of the standard commando unit of Yuri's Army.
