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

[JASS] Customised Phoenix Fire Ability

Status
Not open for further replies.
Level 3
Joined
Jul 15, 2007
Messages
36
Is it possible to start a trigger on a unit being hit by a phoenix fire effect?

Can't seem to find a "Unit gains buff" (using the buff of phoenix fire) event, and not sure if i can do it via a condition after the "Unit is attacked" event triggers.

Essentially trying to JASS-enhance the attack given to a unit by an item.

Any help would be appreciated.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
No, it should be possiable since correct me if I am wrong but when the phoenix fire deals damage it also attaches to buff, thus I just told you what event to use. After it is hit with it and it is confermed to be phoenix fire, you just disable the trigger and via a timer, enable it when the buff should expire, this will stop other damage triggering it.

JASS is an absoulte must for this.
 
Level 3
Joined
Jul 15, 2007
Messages
36
Nope. I would suggest you use dummy units

Sorry - any chance of a link to a tutorial / explanation?

when the phoenix fire deals damage it also attaches to buff, thus I just told you what event to use.

Yes, it does attach a buff (I was already figuring on this, and making custom buffs for each copy of phoenix fire); so you suggest I should use:
JASS:
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Creepdeath, Player(11), EVENT_UNIT_DAMAGED )
and then decide what attack has been applied via the buff?

however, how do i work out the buff? (either as a condition script or within the called function: I.E. how do i analyze what buffs are on a unit?) Is it "UnitHasBuffBJ(GetTriggerUnit(), 'B00A'")" (returns a boolean)?

Although, looking at the script for "UnitHasBuffBJ()"
JASS:
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
    return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction
Thus, is there an "becomes the target of an ability" event I can use? (I.E. "EVENT_UNIT_SPELL_EFFECT" or EVENT_PLAYER_UNIT_SPELL_EFFECT)

Cheers and thanks for help so far
 
JASS:
EVENT_UNIT_SPELL_EFFECT
is for a unit event such as:
JASS:
native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event
//
JASS:
EVENT_PLAYER_UNIT_SPELL_EFFECT
is for playerunitevents such as:
JASS:
native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
//

TriggerRegisterAnyUnitEventBJ takes a playerunitevent as well.
 
Level 3
Joined
Jul 15, 2007
Messages
36
In terms of the event, "EVENT_UNIT_DAMAGED", being of type unitevet rather than playerunitevent, can only be applied to a specific unit, which it takes as an argument in;

"native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event"

So i can't use it as a generic unit event; the unit has to be pre-defined. (i.e pre-existing on the map, it would seem; it is a unit, not a unittype variable.

Experimenting with the spell effect events, and ability events, to see if they fire.

Dil999:
As to dummy units, again I run into the trouble of identifying where to make them / what to give them (and presumably the event is a generic unit is issued an order at an object? i.e. to actually do the JASS enhancement on the attacked unit)

Purge:
Ty, but do you know if they can detect when a unit gets a buff / gets the effect of a spell? Specifically the phoenix fire buff / spell?
 
Level 7
Joined
Jun 10, 2007
Messages
225
You would need to use an attackdetect system to detect when a unit is hit, and if the attacker meets a certain conditions then do actions. You can use shadow1500's Any Unit Is Damaged script on wc3jass.com to make a unit is damaged into a generic event.
 
Status
Not open for further replies.
Top