(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > Triggers & Scripts

Triggers & Scripts Discussions regarding GUI triggers & JASS/AI scripts may be found here. Please review the » JASS Tutorials » Trigger Tutorials

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-02-2008, 01:25 AM   #1 (permalink)
 
Supermj's Avatar

JustYourAdverageKlingon
 
Join Date: Jul 2007
Posts: 627

Supermj has little to show at this moment (57)


Detecting if unit has ability/buffs

Is there a condition that checks if a unit has an ability?
The only solution to this I see is to do this:
If - Conditions
((Triggering unit) has buff P ) Equal to True
But I want something like this:
If - Conditions
((Triggering unit) has ability P ) Equal to True
Though, I don't think that that is an option. So I made all the abilities I wanted auras, made them only target self, and made it try to detect it the first way. But the problem is that the aura's don't give the units the buffs, so the triggers are useless. Any body know the problem or an alternative solution?
__________________
If your interested in writing or reading...
then Walton Novels is the place for you!
--------------------------------------------------------------
learn to speak Klingon here!
Supermj is offline  
Old 07-02-2008, 01:48 AM   #2 (permalink)
 
Tigershark's Avatar

Rawr it's a tiger shark!
 
Join Date: Nov 2007
Posts: 40

Tigershark has little to show at this moment (1)


In JASS you can simply do GetUnitAbilityLevel( unit theUnit, integer abilCode )

if that returns a number greater than 0, then the unit has the ability (or buff actually. The GUI actually converts the "Has Buff" to GetUnitAbilityLevel, just using the buff code as the abilCode (I guess when a unit has a buff, they are treated as having that "ability". I don't know).

Hope that helps.
__________________
Tra la la la la.
Tigershark is offline  
Old 07-02-2008, 02:29 AM   #3 (permalink)
 
Eccho's Avatar

Leeched Bashiok's avatar
 
Join Date: Nov 2006
Posts: 1,117

Eccho is just really nice (332)Eccho is just really nice (332)Eccho is just really nice (332)

Zepyhr Challenge #5 Winner: Frost Vortex 

There is one you could do...
(I may not post it with right gui-look)

You can find it under the integer condition section
If - Conditions
(Level of "Your Ability" for "unit" is greater than 0)

If the unit would not have the ability, it will always result to zero, thus a similarity to "false"
Eccho is offline  
Old 07-02-2008, 02:58 AM   #4 (permalink)
 
Supermj's Avatar

JustYourAdverageKlingon
 
Join Date: Jul 2007
Posts: 627

Supermj has little to show at this moment (57)


Haha! it worked! +rep man! you solved all my problems!
__________________
If your interested in writing or reading...
then Walton Novels is the place for you!
--------------------------------------------------------------
learn to speak Klingon here!
Supermj is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Trigger] Unit Damage Detecting from spells xXCRIMINALXx Triggers & Scripts 11 12-23-2007 01:24 PM
[JASS] Detecting if a unit is on water The Outlaw Torn Triggers & Scripts 13 08-24-2007 02:27 AM
Detecting if a unit has an ability enabled Murlok Triggers & Scripts 5 12-30-2005 07:33 AM
Detecting whether a unit is still casting or not meneersleutel Triggers & Scripts 4 08-22-2005 12:58 PM
Detecting buffs after a unit dies Afrite Triggers & Scripts 1 06-23-2004 02:01 PM

All times are GMT. The time now is 01:12 PM.






Your link here 
9 of Cups | Actualities community | Rolex | Credit Cards | Cheap Fragrances
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle