Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
For each (Integer CT_Looper) from 1 to CT_Index, do (Actions)
Loop - Actions
-------- - --------
-------- check if unit has buff --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(CT_Target[CT_Looper] has buff CT_Buff) Equal to False
Then - Actions
-------- - --------
-------- deindex --------
Set CT_Caster[CT_Looper] = CT_Caster[CT_Index]
Set CT_Target[CT_Looper] = CT_Target[CT_Index]
Set CT_Damage[CT_Looper] = CT_Damage[CT_Index]
Set CT_Looper = (CT_Looper - 1)
Set CT_Index = (CT_Index - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CT_Index Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Trigger - Turn off Curse of Terror Effect <gen>
Else - Actions
Else - Actions
Curse of Terror Effect
Events
Unit - A unit Starts the effect of an ability
Conditions
((Triggering unit) has buff CT_Buff) Equal to True
Actions
Set CT_TempCaster = (Triggering unit)
-------- - --------
-------- find and deal damage to casting unit --------
For each (Integer CT_Looper) from 1 to CT_Index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CT_TempCaster Equal to CT_Target[CT_Looper]
Then - Actions
Unit - Cause CT_Caster[CT_Looper] to damage CT_Target[CT_Looper], dealing CT_Damage[CT_Looper] damage of attack type CT_AttackType and damage type CT_DamageType
Special Effect - Create a special effect attached to the CT_Attach of CT_Target[CT_Looper] using CT_UnitSFX
Special Effect - Destroy (Last created special effect)
Else - Actions
v1.9 - minor update added the line on cast trigger that updates the caster not just the damage
- removed the lag caused by "0.00" in the damage interval
v1.8 - removed the line that gives neutral passive vision.
- dummy unit is only moved when there is an instance of cast
- triggering unit is now stored in a variable in the effect trigger
- unit group is now removed and now only checks if unit has the buff
- importing instructions has been changed to read me
- the spell works the same it does not stack and only the last instance of the spell is applied
v1.7 - code has been optimized.
- dummy ability is added to the dummy on init
- dummy ability is no longer added/removed
- ability level is set before the loop
v1.6 - minor change you wont feel the difference
v1.5 - Everything has been redone.
- Now uses one dummy caster.
- Now uses 0.03 periodic event instead of 1 second.
- Now turns of the effect trigger when no unit has the buff.
- Now allows attributes as bonus damage.
- Removed the duration from the configurables.
- Code has been simplified.
v1.4 - added the documentaton for easier modification. (APPROVED)
v1.3 - fixed a bug.
v1.2 - reverted to the first version. known bugs doesn't exist.
v1.1 - fixed the bug (thanks to Dat-C3); found another bug.
v1.0 - initial release
IcemanBo for teaching that moving the dummy only once per cast is possible
Dat-C3 for offering help during the early versions.
BPower for explaining the one dummy caster concept.
deathismyfriend and GywGod133 for noticing the timer.
Maker for showing what needs to be improved.
17th Oct 2015
Bribe: A neat spell which works properly. Like a custom mana flare which penalizes spell casting. This would have been a good contender for the Deception Contest!
Curse of Terror v1.4 | Reviewed by Maker | 05.01.15...
17th Oct 2015
Bribe: A neat spell which works properly. Like a custom mana flare which penalizes spell casting. This would have been a good contender for the Deception Contest!
Curse of Terror v1.4 | Reviewed by Maker | 05.01.15
[COLOR="gray"
[COLOR="gray"
[COLOR="gray"
[COLOR="gray"
[COLOR="gray"
[COLOR="gray"
Concept[/COLOR]]
An area of effect spell which causes affected units to take damage
when they cast spells.
Triggers[/COLOR]]
The spell is leakless and MUI
The effect trigger should be turned off when
there are no units with the buff
The effect trigger only needs one condition, unit has buff
Use only one dummy unit per cast
I don't think you should do this
Unit Group - Remove all units from CT_AffectedUnits[CT_Index]
Using single 1 second timer is problematic.
The spell can last 7-7.999... seconds.
Objects[/COLOR]]
No unnecessary objects
Good tooltip
The dummy should be configured to be able to cast spells instantly
The death type of the dummy should be Can't raise, does not decay
@deathismyfriend, i think you missed the idea about the 1.00 second delay.
the cast trigger stores the units in the selected area.
the timer trigger removes the unit that can be damaged when they cast spell.
the last trigger damages the casting units.
i dont see why this should be 0.03 seconds.
@Dat-C3 -> please show me the way. You're talking about the unit group deindexing? or about detecting who to damage and where the damage came from?
i know this can be coded like this add units to unitgroup[1] for units affected by level 1 spell, unitgroup[2] for units affected by level 2 spell and so on.. i did it like this for games that needs hero attributes based damage.
Yours was almost perfect, just a few things missing and/or needing editing.
I also changed your timer event to shut up death over there. It is better honestly because Game time is a bad value to rely on it because it is actually similar to Global Integer A & B. He is wrong though, if you use a triggered timer then you don't really need 0.03 depending on the spell and in your case the best value is 1.00. Though what happens when someone purges or dispels your buff? Is that intended to save casters from your spell?
I know it isn't as important for GUI'ers, but I think we should start learning how to null our unit variables, after using a temp unit variable just set it to no unit. Same for the other unit variables, it is worth it in order to obtain a "perfect" as possible spell/system.
By the way to catch auto-heal and other auto-cast spells I suggest another trigger on top of the ones so far, sure you'll end up making your spell into more of a system but at least you'll be able to catch bugged spells/abilities. I actually already made one into your test-map for you to start you off with.
I left examples of displaying if you caught an ability cast or order cast inside the map. Since orders can't be custom-made there is a limit which also makes it easier to catch the spells but also sad that they can't be stacked easily.
People will likely complain that the heal order isn't in a variable, I wouldn't worry too much about it since there's only one instance/use of it per run. If there is any bugs I do apologize, I usually don't stack events in complicated spells.
Oh, and don't increase variable arrays in the variable manager/editor, it is bad to do so because it adds load time onto the map and wc3 auto-increases them with every new index/integer add EXCEPT for a few such as unit group which I showed you already how to fix within your triggers. You require JASS/custom script in order to do so, but it is only three lines... So it shouldn't be a big deal, one to set it, one to destroy it, one to null it.
Edit: Yeah I know, I dislike the extra variables but they're also good to make it easier to configure/edit your spell. So I didn't bother with that and left it alone even though you can use equations to reduce however don't worry about it, that part is just fine. Posting triggers as well shortly for you so all you have to do is click quote my reply then copy [trigger=] to the end part. I am sure you know that though.
[trigger=init]
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Set CT_Ability = Curse of Terror
Set CT_AoE[1] = 300.00
Set CT_AoE[2] = 300.00
Set CT_AoE[3] = 300.00
Set CT_AreaSFX = Abilities\Spells\Items\AItb\AItbTarget.mdl
Set CT_Attach = overhead
Set CT_Buff = Curse of Terror (Buff)
Set CT_Damage[1] = 60.00
Set CT_Damage[2] = 120.00
Set CT_Damage[3] = 180.00
Set CT_DamageType = Unknown
Set CT_DummyAbility = Curse of Terror (Dummy)
Set CT_Duration[1] = 5
Set CT_Duration[2] = 7
Set CT_Duration[3] = 10
Set CT_UnitSFX = Abilities\Spells\Items\AIil\AIilTarget.mdl
Set CT_DummyType = Dummy
[/trigger]
[trigger=cast]
Curse of Terror Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to CT_Ability
Actions
Set CT_Index = (CT_Index + 1)
Set CT_Caster[CT_Index] = (Triggering unit)
Set CT_Player[CT_Index] = (Triggering player)
Set CT_Level[CT_Index] = (Level of CT_Ability for CT_Caster[CT_Index])
Set CT_Point = (Target point of ability being cast)
Special Effect - Create a special effect at CT_Point using CT_AreaSFX
Special Effect - Destroy (Last created special effect)
Set CT_TimeLeft[CT_Index] = CT_Duration[CT_Level[CT_Index]]
Custom script: set udg_CT_AffectedUnits[udg_CT_Index] = CreateGroup()
Set CT_AffectedUnits[CT_Index] = (Units within CT_AoE[CT_Level[CT_Index]] of CT_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equ
Unit Group - Add all units of CT_AffectedUnits[CT_Index] to CT_DamageGroup
Custom script: call RemoveLocation(udg_CT_Point)
Unit Group - Pick every unit in CT_AffectedUnits[CT_Index] and do (Actions)
Loop - Actions
Set CT_Target = (Picked unit)
Set CT_Point = (Position of CT_Target)
Unit - Create 1 CT_DummyType for CT_Player[CT_Index] at CT_Point facing Default building facing degrees
Set CT_Dummy = (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to CT_Dummy
Unit - Add CT_DummyAbility to CT_Dummy
Unit - Set level of CT_DummyAbility for CT_Dummy to CT_Level[CT_Index]
Unit - Order CT_Dummy to Neutral Alchemist - Acid Bomb CT_Target
Custom script: call RemoveLocation(udg_CT_Point)
Set CT_Dummy = No unit
Set CT_Target = No unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CT_Index Equal to 1
Then - Actions
Countdown Timer - Start CT_Timer as a Repeating timer that will expire in 1.00 seconds
Else - Actions
[/trigger]
[trigger=run]
Curse of Terror Duration
Events
Time - CT_Timer expires
Conditions
Actions
For each (Integer CT_LoopInteger) from 1 to CT_Index, do (Actions)
Loop - Actions
Set CT_TimeLeft[CT_LoopInteger] = (CT_TimeLeft[CT_LoopInteger] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CT_TimeLeft[CT_LoopInteger] Equal to 0
Then - Actions
Unit Group - Remove all units of CT_AffectedUnits[CT_LoopInteger] from CT_DamageGroup
Unit Group - Remove all units from CT_AffectedUnits[CT_LoopInteger]
Custom script: call DestroyGroup(udg_CT_AffectedUnits[udg_CT_LoopInteger])
Set CT_AffectedUnits[CT_LoopInteger] = CT_AffectedUnits[CT_Index]
Custom script: set udg_CT_AffectedUnits[udg_CT_Index] = null
Set CT_Caster[CT_LoopInteger] = CT_Caster[CT_Index]
Set CT_Damage[CT_LoopInteger] = CT_Damage[CT_Index]
Set CT_Level[CT_LoopInteger] = CT_Level[CT_Index]
Set CT_Player[CT_LoopInteger] = CT_Player[CT_Index]
Set CT_TimeLeft[CT_LoopInteger] = CT_TimeLeft[CT_Index]
Set CT_LoopInteger = (CT_LoopInteger - 1)
Set CT_Index = (CT_Index - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CT_Index Equal to 0
Then - Actions
Countdown Timer - Pause CT_Timer
Else - Actions
Else - Actions
[/trigger]
[trigger=Cast/Order Catching]
Curse of Terror Effect
Events
Unit - A unit Starts the effect of an ability
Unit - A unit Is issued an order targeting an object
Conditions
((Triggering unit) is in CT_DamageGroup) Equal to True
((Triggering unit) has buff CT_Buff) Equal to True
Actions
For each (Integer CT_LoopInteger) from 1 to CT_Index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Target unit of ability being cast) Equal to No unit
(Issued order) Equal to (Order(heal))
Then - Actions
Unit Group - Pick every unit in CT_AffectedUnits[CT_LoopInteger] and do (Actions)
Loop - Actions
Set CT_Target = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to CT_Target
Then - Actions
Special Effect - Create a special effect attached to the CT_Attach of CT_Target using CT_UnitSFX
Special Effect - Destroy (Last created special effect)
Unit - Cause CT_Caster[CT_LoopInteger] to damage CT_Target, dealing CT_Damage[CT_Level[CT_LoopInteger]] damage of attack type CT_AttackType and damage type CT_DamageType
Else - Actions
Set CT_Target = No unit
Else - Actions
Unit Group - Pick every unit in CT_AffectedUnits[CT_LoopInteger] and do (Actions)
Loop - Actions
Set CT_Target = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to CT_Target
Then - Actions
Special Effect - Create a special effect attached to the CT_Attach of CT_Target using CT_UnitSFX
Special Effect - Destroy (Last created special effect)
Unit - Cause CT_Caster[CT_LoopInteger] to damage CT_Target, dealing CT_Damage[CT_Level[CT_LoopInteger]] damage of attack type CT_AttackType and damage type CT_DamageType
Else - Actions
Set CT_Target = No unit
[/trigger]
Both depending on the type of cast, they won't double-cast because of the condition I put there. Since like you said you can't catch auto-cast heals which is the bug that is fixed by using it's order to catch it and since its an order then target unit of ability being cast will return null/no unit.
Solid spell idea. You could use just one Dummy Caster unit, instead of one per spell instance.
To achieve this you have to create an unit on map initialization and set it to a unit variable (this is your dummy caster).
Now during each spell cast, change the owner of the dummy caster unit to the spell triggering player.
--> eventually set the unit position to the desired target coordiantes ( required in case of spells like hoofstomp for instance)
--> order the dummy ability ( and optionally: reset the owner to neutral passive).
Solid spell idea. You could use just one Dummy Caster unit, instead of one per spell instance.
To achieve this you have to create an unit on map initialization and set it to a unit variable (this is you dummy caster).
Now during each spell cast, change the owner of the dummy caster unit to the spell triggering player.
--> eventually set the unit position to the desired target coordiantes ( required in case of spells like hoofstomp for instance)
--> order the dummy ability ( and reset the owner to neutral passive).
That's a bit advanced which is why I didn't say anything.
However agreed, but I think that should of wait for a bit until he finished the other parts and then tell him and let him search through hive's spells to find examples and/or figure it out in object editor.
@BPower-> that's how to prevent the creation of dummy units per spell instance right?
EDIT: i've tried creating a dummy caster. the result was only one unit gets the debuff. perhaps, the process happens too fast that the dummy caster is moved before it can cast.
this is correct right? on map init i added these lines ->
Set CT_Point = (Random point in (Playable map area))
Unit - Create 1 CT_DummyType for Neutral Passive at CT_Point facing Default building facing degrees
Set CT_Dummy = (Last created unit)
Unit - Add CT_DummyAbility to CT_Dummy
Custom script: call RemoveLocation(udg_CT_Point)
and on the cast trigger i added these lines ->
Unit Group - Pick every unit in CT_AffectedUnits[CT_Index] and do (Actions)
Loop - Actions
Set CT_Target = (Picked unit)
Set CT_Point = (Position of CT_Target)
Unit - Move CT_Dummy instantly to CT_Point
Unit - Change ownership of CT_Dummy to CT_Player[CT_Index] and Change color
Unit - Set level of CT_DummyAbility for CT_Dummy to CT_Level[CT_Index]
Unit - Order CT_Dummy to Neutral Alchemist - Acid Bomb CT_Target
Custom script: call RemoveLocation(udg_CT_Point)
Spell has been updated with slightly new triggers
Edit: Reverted the spell to the first version. Waiting for approval.
no. 1.00 seconds is the right time here. what the 1.00 second here is counting down the duration of the spell. im not trying to catch the spell cast with the timer.
Sichtbarkeit - Create an initially Aktiviert visibility modifier for Neutral passiv emitting Sichtbarkeit across (Playable map area)
The dummy unit should only be moved once to target location, not potentialy more often.
Store "(TriggeringUnit)" into a variable in your effect trigger.
Why do you need the "DamageGroup"? Can't you simply check for the buff?
Maybe it would make sense to only apply new damage if new damage is higher than the current one.
But this would not refresh the duration, and finding a compromise would be not worth it,
so it is up to you which way you go.
And I recommend you to change the name of the trigger sheet "Importing Instructions" to "ReadMe",
because it's not only import instructions, but there is also a very important note about the spell duration.
thanks for the review. ill be making the updates next week.
Edit: wow that was a thorough review. you even read the importing instructions. btw i i think ill go with the newest applied buff being applied to the unit and not allow the effect to stack. also the unit group is for checking if the unit is already in the loop. you're suggesting that i shouldnt check the unit group and just check if the unit has the buff before applying the buff yes?
For me, yes. I thought the buff check can replace the unit group check.
It does not change much, but if group is not needed, it is just useless overhead.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.