| 08-15-2009, 12:24 PM | #1 |
There were functions such as "GetSpellAbilityId" in Jass. But what can I do If I want get the order string of ability being cast? JASS:call IssueTargetOrderBJ( GetLastCreatedUnit(), <orderstring>, GetSpellAbilityUnit() ) |
| 08-15-2009, 12:40 PM | #2 |
I use JASS:call IssueImmediateOrder(unit,AbilityId2String('rawcodeOfAbility')) |
| 08-15-2009, 02:05 PM | #3 |
Well, then Is the "unit" the target of the order or the caster? |
| 08-15-2009, 02:14 PM | #4 |
bad example, use yours JASS:call IssueTargetOrderBJ( GetLastCreatedUnit(), AbilityId2String('rawcodeOfAbility'), GetSpellAbilityUnit() ) |
| 08-15-2009, 02:24 PM | #5 |
I understand. Thanks a lot By the way, does "GetSpellAbilityUnit()" refer to the caster? |
| 08-15-2009, 02:27 PM | #6 |
I think so, cause for getting the target is GetSpellTargetUnit() |
| 08-15-2009, 03:48 PM | #7 | |
Quote:
Would be better to use GetObjectName instead. |
| 08-16-2009, 01:21 AM | #8 |
GetAbilityId2String doesn't get the raw data integer 'XXXX', it gets these sequence of numbers that looks more liekt his 801381 If you do a test, you can see how they vary. |
| 08-16-2009, 05:35 AM | #9 |
I needn't get ability's raw data like "ANcl". I need to get the data that could be used in issure order. |
| 08-16-2009, 07:20 AM | #10 |
You can get it, but it would be incredibly hard and stupid. You'd have to create a dummy unit, add the ability to it, and then loop through every single OrderId from 851900 to 853000 and check if the unit can be ordered to use that order with a point target, unit target, destructible target, item target, and no target. If any of those return true, then that is the spell's OrderId, and you simply return OrderId2String(<the order>). You'd probably break the OP limit, though. If you know the ability's hotkey, you might be able to do something with ForceUIKey, but I don't know about that. |
| 08-16-2009, 07:57 AM | #11 |
Or you can use an hashtable to link the ability id with their orderid or orderstring. |
| 08-16-2009, 10:48 AM | #12 |
Well, well. I just want to make a "Magic Mirror" ability which bounce spells to the caster. My idea was to create a dummy unit and add the ability of being cast by caster to the dummy unit and order the dummy unit to cast the ability at the original caster. Is it the best way to do this? Must I use the "Issure Order"? Thanks. |
| 08-16-2009, 10:56 AM | #13 |
Yes you must use issue order. If you have no idea about how to use an hashtable or jass in general i can make the code. |
| 08-16-2009, 11:30 AM | #14 |
It's ture that I have no idea of hashtable and I am a greenhand of jass I can only understand jass code but know little about make the code. I tried to make one using GUI but it was nearly impossible. |
| 08-16-2009, 11:47 AM | #15 |
Wait, i guess the dummy's spell must be instant (no time cast), not like the caster's one ? |
