Hello Dear Hive Members,
I am trying to create a "spell return" trigger that would reflect back spells to their casters when a target has a specific custom buff.
If you know DotA/DotA², then you will understand that the objective is to reproduce the Lotus Orb object effect.
I imagined this simple algorithm :
* Event : When a unit casts a spell with a unit as a target
* Condition : Target unit of ability being cast has buff "Spell return"
* Actions :
- Create a Dummy unit on the target unit
- Add the same ability to it
- Order it to cast this ability on the initial caster
My current trigger looks like this (forgive me, I am using World Editor in French but you should understand most of it or at least the principle) :
This does not work. (I always have the message "FAIL", see above code).
Correct me if I'm wrong, but I think the problem is with the 2nd parameter of IssueTargetOrderById(...) which should be an ability string like "A000".
I have looked everywhere on the Internet, but I have never found anyone using something else than a ****ing CONSTANT string as second parameter of IssueTargetOrderById(..., <???>, ...).
Can you guys tell me how I can retrieve dynamically the code ("A002", "Aabs" etc.) of the ability being cast ?
(Ideally I would prefer a full GUI solution but as I think that's not possible, (minimal) custom calls to JASS will be OK).
In case I have not made myself clear, don't hesitate to ask details.
Thanks for your help
I am trying to create a "spell return" trigger that would reflect back spells to their casters when a target has a specific custom buff.
If you know DotA/DotA², then you will understand that the objective is to reproduce the Lotus Orb object effect.
I imagined this simple algorithm :
* Event : When a unit casts a spell with a unit as a target
* Condition : Target unit of ability being cast has buff "Spell return"
* Actions :
- Create a Dummy unit on the target unit
- Add the same ability to it
- Order it to cast this ability on the initial caster
My current trigger looks like this (forgive me, I am using World Editor in French but you should understand most of it or at least the principle) :
Code:
Renvoi de sorts spell
Events
Unité - A unit Commence le lancement d'une compétence
Conditions
((Target unit of ability being cast) has buff Renvoi de sorts ) Egal à TRUE
Actions
Unité - Order (Triggering unit) to Arrêter
Set _point1 = (Position of (Target unit of ability being cast))
Unité - Create 1 Dummy for (Owner of (Target unit of ability being cast)) at _point1 facing Orientation bâtiment par défaut degrees
Unité - Add (Ability being cast) to (Last created unit)
Unité - Set level of (Ability being cast) for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
Unité - Add a 10.00 second Générique expiration timer to (Last created unit)
-------- - --------
Set _bool_SpellCastOk = TRUE
Set _ability1 = (Ability being cast)
Set _unit_SpellCaster = (Last created unit)
Set _unit_TargetUnit = (Triggering unit)
Custom script: set udg__bool_SpellCastOk = IssueTargetOrderById(udg__unit_SpellCaster, udg__ability1, udg__unit_TargetUnit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
_bool_SpellCastOk Egal à TRUE
Alors - Actions
Partie - Display to (All players) for 10.00 seconds the text: (Renvoi de sorts |c00ff40ff40successful|r : + (Name of (Ability being cast)))
Sinon - Actions
Partie - Display to (All players) for 10.00 seconds the text: (Renvoi de sorts |c00ff0000FAIL|r : + (Name of (Ability being cast)))
-------- - --------
Custom script: call RemoveLocation(udg__point1)
This does not work. (I always have the message "FAIL", see above code).
Correct me if I'm wrong, but I think the problem is with the 2nd parameter of IssueTargetOrderById(...) which should be an ability string like "A000".
I have looked everywhere on the Internet, but I have never found anyone using something else than a ****ing CONSTANT string as second parameter of IssueTargetOrderById(..., <???>, ...).
Can you guys tell me how I can retrieve dynamically the code ("A002", "Aabs" etc.) of the ability being cast ?
(Ideally I would prefer a full GUI solution but as I think that's not possible, (minimal) custom calls to JASS will be OK).
In case I have not made myself clear, don't hesitate to ask details.
Thanks for your help