Dummy Caster v1.4

This bundle is marked as approved. It works and satisfies the submission rules.
  • Like
Reactions: deepstrasz and KnnO

Description

Triggers

Changelogs

Dummy Caster


This is the Dummy Caster system,this allows you to use dummy to cast abilities based on your orders.
This system is good for stunning,nova,and destroy trees.
Doesnt support summonings and channeling.
If you want a vJASS version:
MUIDummyCasterbyMcKill2009

Dummy Caster

Example Point

Example Unit

  • Dummy Caster
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_DC_Hash = InitHashtable()
      • -------- ---------------------------- --------
      • -------- Creating Dummy --------
      • -------- ---------------------------- --------
      • Set DC_Loc = (Center of (Playable map area))
      • For each (Integer DC_I) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Player(DC_I)) at DC_Loc facing Default building facing degrees
          • Set DC_DummyCaster[DC_I] = (Last created unit)
      • Custom script: call RemoveLocation(udg_DC_Loc)
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function resets the dummy caster --------
      • -------- ---------------------------- --------
      • Custom script: function DummyCasterReset takes nothing returns nothing
      • -------- ---------------------------- --------
      • -------- you can remove this line if you want --------
      • -------- ---------------------------- --------
      • Custom script: call DisplayTextToForce( GetPlayersAll(), ( "Dummy Caster casted" + GetAbilityName(udg_DC_AddedAbil) ) )
      • -------- ---------------------------- --------
      • Set DC_Loc = (Center of (Playable map area))
      • Unit - Move DC_DummyCaster[DC_ID] instantly to DC_Loc
      • Custom script: call RemoveLocation(udg_DC_Loc)
      • Custom script: call UnitRemoveAbility(udg_DC_DummyCaster[udg_DC_ID],udg_DC_AddedAbil)
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function applies the ability to the dummy caster --------
      • -------- ---------------------------- --------
      • Custom script: function ApplyDummyCaster takes nothing returns nothing
      • Custom script: call UnitAddAbility(udg_DC_DummyCaster[udg_DC_ID],udg_DC_AddedAbil)
      • Custom script: call SetUnitAbilityLevel(udg_DC_DummyCaster[udg_DC_ID],udg_DC_AddedAbil,udg_DC_Level)
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function orders the dummy caster to target unit --------
      • -------- Use call ExecuteFunc("OrderDummyCasterTargetUnit") --------
      • -------- ---------------------------- --------
      • Custom script: function OrderDummyCasterTargetUnit takes nothing returns nothing
      • Custom script: call ApplyDummyCaster()
      • Unit - Move DC_DummyCaster[DC_ID] instantly to DC_Loc
      • Custom script: call IssueTargetOrder(udg_DC_DummyCaster[udg_DC_ID],udg_DC_Order,udg_DC_Target)
      • Custom script: call DummyCasterReset()
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function orders the dummy caster to target point --------
      • -------- Use call ExecuteFunc("OrderDummyCasterTargetPoint") --------
      • -------- ---------------------------- --------
      • Custom script: function OrderDummyCasterTargetPoint takes nothing returns nothing
      • Custom script: call ApplyDummyCaster()
      • Unit - Move DC_DummyCaster[DC_ID] instantly to DC_Loc
      • Custom script: call IssuePointOrderLoc(udg_DC_DummyCaster[udg_DC_ID],udg_DC_Order,udg_DC_TargetLoc)
      • Custom script: call DummyCasterReset()
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function orders the dummy caster to target destructable --------
      • -------- This is good for destroying trees --------
      • -------- Use call ExecuteFunc("OrderDummyCasterTargetDest") --------
      • -------- ---------------------------- --------
      • Custom script: function OrderDummyCasterTargetDest takes nothing returns nothing
      • Custom script: call ApplyDummyCaster()
      • Unit - Move DC_DummyCaster[DC_ID] instantly to DC_Loc
      • Custom script: call IssueTargetDestructableOrder(udg_DC_DummyCaster[udg_DC_ID],udg_DC_Order,udg_DC_TargetDest)
      • Custom script: call DummyCasterReset()
      • Custom script: endfunction
      • -------- ---------------------------- --------
      • -------- This function orders the dummy caster with no target --------
      • -------- Use call ExecuteFunc("OrderDummyCasterNoTarget") --------
      • -------- ---------------------------- --------
      • Custom script: function OrderDummyCasterNoTarget takes nothing returns nothing
      • Custom script: call ApplyDummyCaster()
      • Unit - Move DC_DummyCaster[DC_ID] instantly to DC_Loc
      • Custom script: call IssueImmediateOrder(udg_DC_DummyCaster[udg_DC_ID],udg_DC_Order)
      • Custom script: call DummyCasterReset()
[trigger=]Target Point
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Thunder Clap Ex
Actions
Set DC_Caster = (Triggering unit)
Set DC_TargetLoc = (Position of DC_Caster)
-------- ---------------------------- --------
-------- Thunder Clap orders dummy to cast Carrion Swarm --------
-------- ---------------------------- --------
Custom script: set udg_DC_AddedAbil = 'AUcs'
Set DC_Order = carrionswarm
Set DC_Loc = (Position of DC_Caster)
Set DC_Level = (Level of (Ability being cast) for DC_Caster)
Custom script: call ExecuteFunc("OrderDummyCasterTargetPoint")
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call RemoveLocation(udg_DC_TargetLoc)
[/trigger]
[trigger=]Target Unit
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Storm Bolt Ex
Actions
Set DC_Caster = (Triggering unit)
Set DC_Target = (Target unit of ability being cast)
-------- ---------------------------- --------
-------- Storm Bolt orders dummy to cast Banish --------
-------- ---------------------------- --------
Custom script: set udg_DC_AddedAbil = 'AHbn'
Set DC_Order = banish
Set DC_Loc = (Position of DC_Caster)
Set DC_Level = (Level of (Ability being cast) for DC_Caster)
Custom script: call ExecuteFunc("OrderDummyCasterTargetUnit")
Custom script: call RemoveLocation(udg_DC_Loc)
[/trigger]
v1.0
-Released
v1.1
-Removed Configuration(due to the Timed Lightning Issue)
v1.2
-Fixed SetUnitAbilityLevel script
v1.3
-Added new function(ApplyDummyCaster)
v1.4
-Fixed kill application.(due to defskulls)
Contents

Dummy Caster v1.3 (Map)

Reviews
16:00, 25th Oct 2012 Magtheridon96: Approved.
Level 29
Joined
Mar 10, 2009
Messages
5,016
Mckill2009,flame strike is a channeling ability
that's what I said >>> coz not all abilities are instant cast like flamestrike, it has a delay
im using location instead of coordinates because it might cause bugs.
ex.when i used coordinates,the units selection circle is moved,but not the model
use SetUnitPosition instead os SetUnitX/Y
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
How can you approve this bugged system ?
Try let the Dummy casts Slow (Sorceress) to multiple picked units (or even single unit).

You'll notice, it can't.

Why ?
Because it only corresponds to only (Triggering player)'s unit which in this case, it will only cast the spell if the dummy's owning player is the player casting the spell.

Solution:
Create each player their own dummy unit and make it array for each instance.
Dummy[1] for Player 1
-----
Dummy[12] for Player 12

Just noticed this just now while I was experimenting some things.
And please, before you start any argument, I think you should try it first (I was weird too).

Also, it is better this way, create each player their own dummy unit, why ?
Because certain game (such as DotA) will count as Player Kill like dummy casting Storm Bolt that deals damage. So, what if the dummy kills the unit ?
The trigger interprets as Neutral Passive kills the unit, does that mean NP will get the gold ? No.
This is why it is nice to have each dummy for each player.
 
Top