• 🏆 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!

[JASS] GetItemTarget() ?

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
Hello people,,

I have recently tried some stuff with Items,,
But i see no GetItemTarget() or something that returns what unit/widget has been targeted by an item,, Any way to check it? If not then i need to rewrite it all again ><,,
PLEASE tell me i dont have to and that there is a way to do so,,

Thanks

-Yixx,,-
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
You have got to be kidding me,,
Is there any other way of checking it?
Or can i maybe make it add some buff and check for it?
there HAS to be a way =\,,,
Seriously, i am gonna cry if there is none,, because i changed the system to items (instead of abilitys) because it would be easier,,
I will try something with buffs,,
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
I added an custom ability to the items (all te same) which has no effect,,
'Item - Target' is it called,, Out of stupidity (and from doing it automatically) i did GetSpellTargetUnit(),,
But it did not seem to work the way it should,, So, do i need to change something in the ability to maybe make that work? Cause that would save my ass =D
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Items with an ability based of Steal (Aste),, I edited the values to no mana, no cooldown (0), and on both hero and normal 5 seconds duration,,
The effects are taken away and stuff,,

I added the ability (called 'Item - Target') to all the items that i use (all target items,, items with a target),,

Now i want to know: What unit is it casted on? (I added the Event UNIT_USE_ITEM),, I know the event makes it seem that there is no such thing as "ItemTarget" , but i need to know if there is some way to check,,
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Ok, so i guess i need to add some buff to the unit to check,,
Seems the only way to me =\,,

What ability to base the item ability off then? Cuz i guess i will just add a buff and check for that (since there are only 6 to 1 units who are able to be casted on),,

EDIT: "Item Purge" maybe?

RE-EDIT: nvm,, trying now with a buff,,

RE-RE-EDIT: (urgh, im gettin tired of the 'RE-'s,, )
It worked with the Buff Check =D,, and it immediately removes the buff also (SetUnitAbilityLevel())

Now one more thing: GroupPickRandomUnit(UnitGroup) returns nothing =\,,
I am SURE that i added units to it, but somehow it keeps returning nothing =\,,
FirstOfGroup is no option, since i want a random one,, i guess i will make a custom function for it,,,

THANKS! =D the buff thing didnt work out that well after all
So i decided i would use Reaper2008's idea, only WITH my idea,,
The event Reaper2008 said is used to assign the target,,
The EVENT_UNIT_USE_ITEM is used to check what item and assign a trigger to it =D
THANKS soo much,, you guys REALLY saved my ass ^^

+rep to all =D
 
Last edited:
Status
Not open for further replies.
Top