Buenas! estaba intentando crear un spell en base a funciones de otras habilidades que descargue, el spell consiste en esto, el héroe lanza un conjunto de pilar de rocas seguidas en linea recta y cuando la distancia entre una roca y el héroe sea mayor que o igual a 1200, se detenga el detonador, pero me salen los siguientes errores: el primer error es que no se eliminan el grupo de unidades creadas y el segundo es que no funciona otra vez el detonador correctamente, pues se crean las unidades en otro punto, distancia o algo así. Creo que los errores son debidos a los códigos jass que de eso no se nada. Aquí les dejo mis funciones. Gracias!
[gui]Roca Afilada
Acontecimientos
Unidad - A unit Inicia el efecto de una habilidad
Condiciones
(Ability being cast) Igual a Roca Afilada
Acciones
Set One[1] = (Casting unit)
Set OneL[1] = (Position of One[1])
Set OneR[1] = (Real(((Fuerza of One[1] (Incluir bonuses)) x 95)))
Set OneR[2] = (Facing of One[1])
Unidad - Activar pausa One[1]
Animación - Play One[1]'s attack slam animation
Detonador - Turn on Roca Afilada Loop
[/gui]
[gui]Roca Afilada Loop
Acontecimientos
Tiempo - Every 0.03 seconds of game time
Condiciones
Acciones
Set OneR[3] = (OneR[3] + 20.00)
Set OneL[3] = (OneL[1] offset by (OneR[3] + 50.00) towards OneR[2] degrees)
Efecto especial - Create a special effect at OneL[3] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
Efecto especial - Destroy (Last created special effect)
Unidad - Create 1 Rock for (Owner of One[1]) at OneL[3] facing OneR[2] degrees
Set One[2] = (Last created unit)
Unidad - Turn collision for One[2] Apagado
Set OneR[32] = (OneR[32] + 20.00)
Set OneL[4] = (OneL[1] offset by OneR[32] towards OneR[2] degrees)
Set OneG[1] = (Units within 350.00 of OneL[4] matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of (Owner of One[1])) Igual a True)))
Custom script: set bj_wantDestroyGroup = true
Grupo de unidad - Pick every unit in OneG[1] and do (Actions)
Bucle: Acciones
Set OneL[1] = (Position of One[1])
Set OneL[31] = (Position of One[2])
Set OneR[38] = (Distance between OneL[1] and OneL[31])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
OneR[38] Mayor que o igual a 1200.00
Entonces: Acciones
Unidad - Desactivar pausa One[1]
Unidad - Kill One[2]
Detonador - Turn off (This trigger)
Custom script: call RemoveLocation(udg_OneL[1])
Custom script: call RemoveLocation(udg_OneL[3])
Custom script: call RemoveLocation(udg_OneL[4])
Custom script: call RemoveLocation(udg_OneL[31])
Otros: Acciones
Unidad - Cause One[1] to damage (Picked unit), dealing OneR[2] damage of attack type Conjuros and damage type Demolición
[/gui]

