- Joined
- Feb 9, 2015
- Messages
- 108
Request for a taunt spell like in DotA "Legion Comander" - "Duel" or "Axe" - "Bersekers Call"
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
Also works, but is a bit ugly
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
And this one must be set in the header file.
- 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
It requires a hashtable so you also need this: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
- Initialize
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set Hashtable = (Last created hashtable)