- Joined
- May 12, 2018
- Messages
- 145
Hello there. I just entered Jass script.
I am using Warcraft Reforged latest patch and its editor, but I'm in trouble now.
This is the work I am making and want to make.
1. Replicate Devour Magic ability and change the appropriate target to Tree, etc. to remove the effectiveness of basic ability.
2. When using DevourMagicReplicated ability, Detect whether there is Corpses within the target area or whether AbilityCaster has 75 HP over.
2.1 If there is a Corpse within the target area, pick a Corpse closest to the center of target area. and set the TempPoint to that Corpse's location and remove the targeted Corpse.
2.2 If there is no Corpse and AbilityCaster has 75 HP over, remove AbilityCaster's HP 75 and It uses the initially specified target area as it is.
3. Returning true either of the two conditions, generate Blight in the target area(TempPoint) and exerts an Abolish Magic effect on all units within the 200 range of TempPoint.
This is the custom script I'm writing.
I'm writing scripts little by little, but I couldn't complete them due to problems on the way. I ask for your understanding on this.
Whenever I use this ability, there is a lag(no lag when I turn off this trigger), and from the second loop, it does not work as desired.
I think the second loop will run after first loop exited, so I wrote the script like this, but this was not answer I guess.
Or do I have to learn struct and library and etc. ? I'm also reading JASS Tutorial, but this is not easy either.
I am using Warcraft Reforged latest patch and its editor, but I'm in trouble now.
This is the work I am making and want to make.
1. Replicate Devour Magic ability and change the appropriate target to Tree, etc. to remove the effectiveness of basic ability.
2. When using DevourMagicReplicated ability, Detect whether there is Corpses within the target area or whether AbilityCaster has 75 HP over.
2.1 If there is a Corpse within the target area, pick a Corpse closest to the center of target area. and set the TempPoint to that Corpse's location and remove the targeted Corpse.
2.2 If there is no Corpse and AbilityCaster has 75 HP over, remove AbilityCaster's HP 75 and It uses the initially specified target area as it is.
3. Returning true either of the two conditions, generate Blight in the target area(TempPoint) and exerts an Abolish Magic effect on all units within the 200 range of TempPoint.
This is the custom script I'm writing.
I'm writing scripts little by little, but I couldn't complete them due to problems on the way. I ask for your understanding on this.
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Mad Ritual // (this is a DevourMagicDuplicated
-
-
Actions
-
Custom script: local group UGDeadSearch = CreateGroup()
-
Custom script: local group UGDead = CreateGroup()
-
Custom script: local unit UnitDead
-
Custom script: local unit UnitDead2
-
Custom script: local unit Ucr
-
Custom script: local unit UnitCast = GetSpellAbilityUnit()
-
Custom script: local player Pc = GetOwningPlayer(UnitCast)
-
Custom script: local real xT
-
Custom script: local real yT
-
Custom script: local effect Effect
-
-------- Initial --------
-
Custom script: set udg_TempPoint = GetSpellTargetLoc()
-
Custom script: call GroupEnumUnitsInRangeOfLoc(UGDeadSearch, udg_TempPoint, 200, null)
-
Custom script: loop
-
Custom script: set UnitDead = FirstOfGroup(UGDeadSearch)
-
Custom script: exitwhen UGDeadSearch == null
-
Custom script: if GetUnitTypeId(UnitDead) == 0 or IsUnitType(UnitDead, UNIT_TYPE_DEAD) then // Detect the Dead by Hiveworkshop, Zwiebelchen --------
-
Custom script: call GroupAddUnit ( UGDead, UnitDead )
-
Custom script: else
-
Custom script: endif
-
Custom script: call GroupRemoveUnit(UGDeadSearch, UnitDead)
-
Custom script: set UnitDead = null
-
Custom script: endloop
-
Custom script: if ( CountUnitsInGroup(UGDead) >= 1 ) then
-
Custom script: loop
-
Custom script: set UnitDead2 = FirstOfGroup(UGDead)
-
Custom script: exitwhen UGDead == null
-
Custom script: call GroupRemoveUnit(UGDead, UnitDead2)
-
Custom script: set UnitDead2 = null
-
Custom script: endloop
-
Custom script: set xT = GetLocationX(udg_TempPoint)
-
Custom script: set yT = GetLocationY(udg_TempPoint)
-
Custom script: set Ucr = CreateUnit((Pc), 'u003', xT,yT, 0) // u003 is Locust.
-
Custom script: call UnitAddAbility(Ucr, 'A06B') // A06B is Blight ( from 'Abgs')
-
Custom script: call UnitApplyTimedLife(Ucr, 'BTLF', 1.00)
-
Custom script: set Ucr = null
-
Custom script: set Effect = AddSpecialEffectLoc( "Objects\\Spawnmodels\\Undead\\UCancelDeath\\UCancelDeath.mdl" , udg_TempPoint)
-
Custom script: call DestroyEffect(Effect)
-
Custom script: set Effect = null
-
Custom script: set Effect = AddSpecialEffectTarget( "Objects\\Spawnmodels\\NightElf\\NightElfLargeDeathExplode\\NightElfLargeDeathExplode.mdl", UnitCast, "origin")
-
Custom script: call DestroyEffect(Effect)
-
Custom script: set Effect = null
-
Custom script: endif
-
Custom script: set Effect = null
-
Custom script: set Ucr = null
-
Custom script: set UnitDead = null
-
Custom script: set UnitDead2 = null
-
Custom script: set UnitCast = null
-
Custom script: set Pc = null
-
Custom script: call DestroyGroup(UGDead)
-
Custom script: set UGDead = null
-
Custom script: call DestroyGroup(UGDeadSearch)
-
Custom script: set UGDeadSearch = null
-
Custom script: set udg_TempPoint = null
-
Whenever I use this ability, there is a lag(no lag when I turn off this trigger), and from the second loop, it does not work as desired.
I think the second loop will run after first loop exited, so I wrote the script like this, but this was not answer I guess.
Or do I have to learn struct and library and etc. ? I'm also reading JASS Tutorial, but this is not easy either.
Last edited: