• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Taunt Spell

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hmm taunt system.

Don't have the time to make it but for the one who will here is a concept:

Save the unit that the taunted unit is supposed to be attacking.
When a unit gains an order... of anything, re-order him to attack the target.
(You need a 0 second timer for that.)

gl
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Also works, but is a bit ugly :D

I just realized that this one can be done with my Effect Over Time System...
However that resource is not yet approved nor finished so you might want to wait a week and then you can use the final version.


  • Legion Commander Duel Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Duel (Legion Commander)
    • Actions
      • Custom script: call EOT_Set_Default_Variables()
      • Set EOT_Param_Source = (Triggering unit)
      • Set EOT_Param_Target = (Target unit of ability being cast)
      • Set EOT_Param_Duration = (3.25 + (0.75 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Set EOT_Param_Buff = Custom Duel
      • Set EOT_Param_Buff_Holder = Duel (Buff Holder)
      • Set TempAbility = (Ability being cast)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
      • Custom script: call EOT_Save_Unit(0, GetTriggerUnit())
      • Custom script: call EOT_Set_Default_Variables()
      • Set EOT_Param_Source = (Triggering unit)
      • Set EOT_Param_Target = (Triggering unit)
      • Set EOT_Param_Duration = (3.25 + (0.75 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Set EOT_Param_Buff = Custom Duel
      • Set EOT_Param_Buff_Holder = Duel (Buff Holder)
      • Set EOT_Param_Type = (Real(TempInteger))
      • Set EOT_Param_Positive = True
      • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
      • Custom script: call EOT_Save_Unit(0, GetSpellTargetUnit())
  • Legion Commander Duel Effect
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Set EOT_Param_Target = (Triggering unit)
      • Set TempAbility = Duel (Legion Commander)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
        • Then - Actions
          • Custom script: set udg_TempUnit = EOT_Load_Unit(0)
          • Custom script: IssueOrderToAttack(GetTriggerUnit(), udg_TempUnit)
        • Else - Actions
  • Legion Commander Duel Kill
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set EOT_Param_Target = (Triggering unit)
      • Set TempAbility = Duel (Legion Commander)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
        • Then - Actions
          • Custom script: set udg_TempUnit = EOT_Load_Unit(0)
          • Set EOT_Param_Target = (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
            • Then - Actions
              • Trigger - Run EOT_Trigger_Destroy_EOT (ignoring conditions)
              • -------- give bonus damage to udg_TempUnit (TempUnit) --------
            • Else - Actions
        • Else - Actions
And this one must be set in the header file.
JASS:
function IssueUnitToAttack_Callback takes nothing returns nothing
    local timer t = GetExpiredTimer()
	call IssueTargetOrder(LoadUnitHandle(udg_Hashtable, GetHandleId(t), 0), "attack", LoadUnitHandle(udg_Hashtable, GetHandleId(t), 1))
    call FlushChildHashtable(udg_Hashtable, GetHandleId(t))
    call DestroyTimer(t)
    set t = null
endfunction
function IssueUnitToAttack takes unit whichUnit, unit target returns nothing
    local timer t = CreateTimer()
    call TimerStart(t, 0, false, function IssueUnitToStop_Callback)
    call SaveUnitHandle(udg_Hashtable, GetHandleId(t), 0, whichUnit)
    call SaveUnitHandle(udg_Hashtable, GetHandleId(t), 1, target)
    set t = null
endfunction
It requires a hashtable so you also need this:
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)
 
Level 7
Joined
Feb 9, 2015
Messages
108
Also works, but is a bit ugly :D

I just realized that this one can be done with my Effect Over Time System...
However that resource is not yet approved nor finished so you might want to wait a week and then you can use the final version.


  • Legion Commander Duel Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Duel (Legion Commander)
    • Actions
      • Custom script: call EOT_Set_Default_Variables()
      • Set EOT_Param_Source = (Triggering unit)
      • Set EOT_Param_Target = (Target unit of ability being cast)
      • Set EOT_Param_Duration = (3.25 + (0.75 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Set EOT_Param_Buff = Custom Duel
      • Set EOT_Param_Buff_Holder = Duel (Buff Holder)
      • Set TempAbility = (Ability being cast)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
      • Custom script: call EOT_Save_Unit(0, GetTriggerUnit())
      • Custom script: call EOT_Set_Default_Variables()
      • Set EOT_Param_Source = (Triggering unit)
      • Set EOT_Param_Target = (Triggering unit)
      • Set EOT_Param_Duration = (3.25 + (0.75 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Set EOT_Param_Buff = Custom Duel
      • Set EOT_Param_Buff_Holder = Duel (Buff Holder)
      • Set EOT_Param_Type = (Real(TempInteger))
      • Set EOT_Param_Positive = True
      • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
      • Custom script: call EOT_Save_Unit(0, GetSpellTargetUnit())
  • Legion Commander Duel Effect
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Set EOT_Param_Target = (Triggering unit)
      • Set TempAbility = Duel (Legion Commander)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
        • Then - Actions
          • Custom script: set udg_TempUnit = EOT_Load_Unit(0)
          • Custom script: IssueOrderToAttack(GetTriggerUnit(), udg_TempUnit)
        • Else - Actions
  • Legion Commander Duel Kill
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set EOT_Param_Target = (Triggering unit)
      • Set TempAbility = Duel (Legion Commander)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = (Real(TempInteger))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
        • Then - Actions
          • Custom script: set udg_TempUnit = EOT_Load_Unit(0)
          • Set EOT_Param_Target = (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
            • Then - Actions
              • Trigger - Run EOT_Trigger_Destroy_EOT (ignoring conditions)
              • -------- give bonus damage to udg_TempUnit (TempUnit) --------
            • Else - Actions
        • Else - Actions
And this one must be set in the header file.
JASS:
function IssueUnitToAttack_Callback takes nothing returns nothing
    local timer t = GetExpiredTimer()
	call IssueTargetOrder(LoadUnitHandle(udg_Hashtable, GetHandleId(t), 0), "attack", LoadUnitHandle(udg_Hashtable, GetHandleId(t), 1))
    call FlushChildHashtable(udg_Hashtable, GetHandleId(t))
    call DestroyTimer(t)
    set t = null
endfunction
function IssueUnitToAttack takes unit whichUnit, unit target returns nothing
    local timer t = CreateTimer()
    call TimerStart(t, 0, false, function IssueUnitToStop_Callback)
    call SaveUnitHandle(udg_Hashtable, GetHandleId(t), 0, whichUnit)
    call SaveUnitHandle(udg_Hashtable, GetHandleId(t), 1, target)
    set t = null
endfunction
It requires a hashtable so you also need this:
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)

Ty so much :D
+REP
 
Status
Not open for further replies.
Top