- Joined
- Sep 10, 2022
- Messages
- 141
Hello everyone, I am stuck with something I cannot solve with anything.
I have the trigger that casts custom rejunevation every time I threw an acid bomb of the alchemist that I made into the Healing Bomb.
Here is the trigger:
Key points:
The healing bomb is based on the alchemist's bomb; I set the damage to 0 and the armor reduction to 0.
When the bomb lands, I create a dummy unit that applies rejuvenation of durid of the claw and then destroys it.
I tried changing the duration of the acid bomb itself—from 0.01 (because I didn't want the bomb buff to linger) to the default value of 16, but it didn't help. I'm at a loss as to what the problem could be.
There are other custom spells on the map I ported to, but since I created a trigger that works off of local variables, there shouldn't be any conflicts.
I have the trigger that casts custom rejunevation every time I threw an acid bomb of the alchemist that I made into the Healing Bomb.
Here is the trigger:
-
Healing Bomb New
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Healing Bomb
-
-

Actions
-


Custom script: local unit caster = GetTriggerUnit()
-


Custom script: local unit target = GetSpellTargetUnit()
-


Custom script: local real dx = GetUnitX(target) - GetUnitX(caster)
-


Custom script: local real dy = GetUnitY(target) - GetUnitY(caster)
-


Custom script: local real dist = SquareRoot(dx * dx + dy * dy)
-


Custom script: local integer lvl = GetUnitAbilityLevel(caster, 'A02O')
-


Custom script: local real targetX
-


Custom script: local real targetY
-


Custom script: local group g
-


Custom script: local unit u
-


Custom script: local unit dummy
-


Custom script: call TriggerSleepAction(dist / 700.0)
-


Custom script: set targetX = GetUnitX(target)
-


Custom script: set targetY = GetUnitY(target)
-


Custom script: set g = CreateGroup()
-


Custom script: call GroupEnumUnitsInRange(g, targetX, targetY, 200.0, null)
-


Custom script: loop
-


Custom script: set u = FirstOfGroup(g)
-


Custom script: exitwhen u == null
-


Custom script: call GroupRemoveUnit(g, u)
-


Custom script: if IsUnitAliveBJ(u) and IsUnitAlly(u, GetOwningPlayer(caster)) then
-


Custom script: set dummy = CreateUnit(GetOwningPlayer(caster), 'h002', targetX, targetY, 0)
-


Custom script: call UnitAddAbility(dummy, 'A02Q')
-


Custom script: call SetUnitAbilityLevel(dummy, 'A02Q', lvl)
-


Custom script: call IssueTargetOrder(dummy, "rejuvination", u)
-


Custom script: call UnitApplyTimedLife(dummy, 'BTLF', 2.0)
-


Custom script: endif
-


Custom script: endloop
-


Custom script: call DestroyGroup(g)
-


Custom script: set caster = null
-


Custom script: set target = null
-


Custom script: set g = null
-


Custom script: set u = null
-


Custom script: set dummy = null
-
-
Key points:
The healing bomb is based on the alchemist's bomb; I set the damage to 0 and the armor reduction to 0.
When the bomb lands, I create a dummy unit that applies rejuvenation of durid of the claw and then destroys it.
I tried changing the duration of the acid bomb itself—from 0.01 (because I didn't want the bomb buff to linger) to the default value of 16, but it didn't help. I'm at a loss as to what the problem could be.
There are other custom spells on the map I ported to, but since I created a trigger that works off of local variables, there shouldn't be any conflicts.

