• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[vJASS] Refactoring from GTrigger to RegisterPlayerUnitEvent

Status
Not open for further replies.
Level 9
Joined
Jun 13, 2008
Messages
353
I have an old spell which uses very old and obsolete libraries. I wanted to upgrade them with their better and up-to-date counterparts.

Converting this part;


Code:
         private static method onInit takes nothing returns nothing
             call GT_AddStartsEffectAction(function thistype.Action,RAWCODE)
             call GT_AddBeginsCastingAction(function thistype.Action2,RAWCODE)

           set thistype.cf = Condition(function thistype.DoDamage)
        endmethod

to this part;

Code:
         private static method onInit takes nothing returns nothing
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, function thistype.Action)
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_CAST, function thistype.Action2)
           
            set thistype.cf = Condition(function thistype.DoDamage)
        endmethod


This causes weird event firing behaviors and the worst is all spells now trigger this custom spell as well.

I'm just started learning this stuff, helps are appreciated.
 
Status
Not open for further replies.
Top