Spellpack Blood Mage's Flame

PurgeandFire

zxcvmkgdfg
Reaction score
509
Gj, I'm impressed!

Gj waaaks! I'm impressed, it is a good code.

Though there is one thing that you always forget:

GetTriggerUnit() does not need to be set to a variable...

GetTriggerUnit() works and gets the triggering unit. I believe you should only assign it to a variable when passing it through functions...

So, you can just edit your code to this:

(btw: GetTriggerUnit() does not need to be a constant, constants are usually used for strings, rawcodes, and other modifiable things)

JASS:
//**************************************************************************************************
//*Requires the CasterSytem get it now on <a href="http://www.wc3campaigns.net/vexorian" target="_blank" class="link link--external" rel="nofollow ugc noopener">www.wc3campaigns.net/vexorian</a>                            *
//*Polymorph: copy first the latest dummy from the caster system then copy this trigger to your map*
//*and change some fields below                                                                    * 
//**************************************************************************************************

//#Polymorph start#
constant function rpoly takes nothing returns integer
    return &#039;A000&#039; // raw code for polymorph
endfunction

constant function rhex takes nothing returns integer
    return &#039;A001&#039; // raw code of the hex ability used on enemies
endfunction

constant function rstorm takes nothing returns integer
    return &#039;AHtb&#039; //  raw code of the storm bolt, i used normal storm bolt from human
endfunction

constant function shex takes nothing returns string
    return &quot;hex&quot; // base string id for the hex ability
endfunction

constant function sstorm takes nothing returns string
    return &quot;thunderbolt&quot; // base string id for the normal stormbolt
endfunction

constant function tdelay takes nothing returns real
    return 0.35 // the delay on hexing and stunning units again
endfunction

function Trig_Polymorph_Conditions takes nothing returns boolean
    return ( GetSpellAbilityId() == rpoly() )
endfunction

function Polymorph_NoTrig takes nothing returns boolean
    return ( GetTriggerUnit() != GetFilterUnit() )
endfunction

globals
    boolexpr Polymorph_Filter = null
endglobals

function Trig_Polymorph_Actions takes nothing returns nothing
    local group g = CreateGroup()
    local real x = GetUnitX(GetTriggerUnit())
    local real y = GetUnitY(GetTriggerUnit())
    local integer i = 1
    local integer n = GetHeroSkillPoints(GetTriggerUnit()) + 2 // skillpoints of the caster +2 
    call CS_EnumUnitsInAOE(g, x, y, 500.0, Polymorph_Filter)
    loop
        exitwhen i&gt;n
        call PolledWait(tdelay())
        call CasterCastAbilityGroup(GetOwningPlayer(GetTriggerUnit()), rhex(), shex(), g, true)
        call CasterCastAbilityGroup(GetOwningPlayer(GetTriggerUnit()), rstorm(), sstorm(), g, false)
        set i = i + 1
    endloop
    call DestroyGroup(g)                      
    set g = null         
endfunction

//===========================================================================
function InitTrig_Polymorph takes nothing returns nothing
    set Polymorph_Filter = Condition(function Polymorph_NoTrig)
    set gg_trg_Polymorph = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Polymorph, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Polymorph, Condition( function Trig_Polymorph_Conditions ) )
    call TriggerAddAction( gg_trg_Polymorph, function Trig_Polymorph_Actions )
endfunction
//#Polymorph end#


It replaces "u" with GetTriggerUnit()... :)

I hope this helps!
 

Sim

Forum Administrator
Staff member
Reaction score
534
Actually, if you're going to use GetTriggerUnit() many times you're better off with a variable. Saves function calls.
 

waaaks!

Zinctified
Reaction score
255
will be updated IF I will have a chance to, if someone really needs it, then pm me.
-will be updated to non caster system version
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top