Smart person plz help!

  • Thread starter Thread starter spectre237
  • Start date Start date
only import the trigger editor: hold
forget about the object editor:
when u copy and paste a custom script it wont copy the varibles beause u are not using GUI what u have to do is : add those Varibles
Go to Varibles and Creat Those and will work fine DOnt miss the letters.
Type:_Unit-Group Name:_casters
Type:_Trigger Name:_castertrigger
Type:_real Name:_castervars
Type:_game cache Name:_cscache
Type:_integer Name:_currentabi
Type:_unit Name:_currentcaster
Type:_unit Name:_currenthurter
Type:_real Name:_delayhack
Type:_point Name:_PointVar
Type:_point Name:_PointVar2
Type:_real Name:_RealVar
Type:_point Name:_sourcehack
Type:_game cache Name:_spellevents
Type:_game cache Name:_spelltemplates
 
Mmm, ok I think that's it see I didn't actually recreate all the variables, only the ones that looked like were needed. Dang that must be the prolem, wonder why I didn't think of that before. :banghead:

K, Ima create the varialbes real quick and I'll get right back to ya, Thanks!
 
Dangit! Ok, I created all variables that weren't already there by default, and good news and bad new....

Good News: Issue solved!, not getting that error anymore, thanks!

Bad News: It messed up another one of my triggers sigh... :(
 
and i got the problem solve :) well in the trigger editor there's a custom script free place. i think u forget to copy that. open again the map of veroxian and press in the map it wil show a huge file on the right size. select all and copy and paste to your map and save ;)
here >>
 
Hmmm well the thing is that it does indeed work with those variables, you think copy/paste the free script will solve the issue with my other trigger???

EDIT: Ok isnt what you're showing me in the screenshot just an image of the caster system? Maby I'm looking at the wrong thing.

AND HOW DO YOU GET YOUR EDITOR TO LOOK SO KEWL??? :eek:
 
yes, without the script it will give an error and will unable the triggers
world of warcraft desktop.
and check again the varibles
 
K all variables appear to be correct. :)

The trigger that it cancelled is the ability 'fireshield', another of Vex's. It could be that he's got another version out there in template-form. I might have to check for that.
 
and now add this to the custom Script.
-Click on the name of map in the right side of the screen will show "Custom Script Code" then paste to there.
edit: the template triggers are fixed??
edit: i gonna sleep now post any other question and i think veroxian would help you. :)
 
Ok I added that script, although wasn't that just adding the caster system again?
 
Well yes the slash template is fixed, yay! But it messed up this 'flaming shield' trigger of mine hehe.
 
Yeah man you've helped me a ton, thanks so much! I'm sure I can find some way to fix this little issue. Night. :)
 
How can I edit this spell???

--------------------------------------------------------------------------------
K New Issue!!!!!!!!!!!

Ok, see I've got this 'Omnislash' type ability, it's really kewl. Thanks Vex!

Anyway the deal is I need to edit it so that the hero becomes invulnerable for it's duration.

The entire script runs as follows:


PHP:
//***************************************************************************************************
//*
//* Slash Template
//* ÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻ
//* Requires:
//*          -A triggerer ability ( Unit targetable please)
//*          -The Caster System
//*          -The Alternative Spell Templates System
//*          -This Trigger
//*
//* Art: The Triggerer ability has art fields that are considered:
//* - Caster effect is attached twice to the hero during the slash.
//* - Second and Third Caster Effects are attachment points for the Caster Effect
//* - Special effect is used on the feet of the hero before teleporting to slash
//* - Target art is the target effect, or the periodic damage effect if used, and the
//*   second target effect is its attachment point.
//*
//***************************************************************************************************

//===================================================================================================
// Slash Template Configuration:
//
function SlashTemplateSetup takes nothing returns nothing
 local integer D //An integer variable we use later to save the Damage Options so we give them to the templates
 local integer s //An integer variable we use later to save the rawcodes of spells to save some time

 //===================================================================================================
 // Template Info:
 //
 // Template Name Id = "SlashTemplate"
 //
 // The hero just gets teleported and attacks the targets fast, it looks nice and allows to cast
 // a spell, do damage, damage per second, and also has options for the way to choose targets and
 // factor for each target and that stuff.
 //
 //
 // integer "totalhits"  The maximum number of hits done per cast
 // real    "dmg"        The initial damage
 // real    "PDmg"       The initial Periodic Damage
 // real    "PDmgPeriod" The period of the Periodic Damage
 // real    "PDmgDur"    The Duration of the periodic Damage
 //
 // real    "dmgfct"     The factor per target for the damage, each time the unit hits a target,
 //                      the damage will be multiplied by this value to get reduced or incremented
 //
 // integer "Spell"      Rawcode of the Spell to cast (if any)
 // real    "SpellHeight" Height of the caster that casts the spell to cast
 // integer "OrderId"    Order Id of that spell
 // real    "RecDelay"   Caster Recycle delay for that spell
 //
 //
 // real    "area"       The new target detection range
 // integer "canrepeat"  Is 1 if the slash can repeat targets, otherwise 0
 //
 // integer "SelMethod"  Is 0 if the slash should pick the closest unit, 1 to pick random units
 // integer "SlashKind"  The kind of the Slash, 0 will try to get to the back of the unit, 1
 //                      will attack in random direction, and 2 is a combination of both
 //
 // integer "AngleKind"  Is 0 for the default angle kind, is 1 to multiple the angle by -1
 //
 // string  "animation"  The animation used by the slash
 //
 // integer "colorize"   If it is 1 enables casting unit "colorizing"
 // integer "SlashColor" Color in 0xAARRGGBB form for the duration of the slash 
 // integer "EndColor"   Color in 0xAARRGGBB form after the slash (original color of the hero)
 // 

 // integer "DamageOptions" Caster System Damage Options in saveable form, used to determine which
 //                         units can be attacked by the slash, if the damage factor is 0 the unit
 //                         is not affected by the target spells nor damage, otherwise the value
 //                         is only important as a damage factor.


 //===================================================================================================
 // Slash template Defaults:
 //
    call SetTemplateDefaultInt(   "SlashTemplate", "totalhits", 1) //Default Total Hits is 1
    call SetTemplateDefaultInt(   "SlashTemplate", "canrepeat", 0) //Can't repeat targets
    call SetTemplateDefaultReal(  "SlashTemplate", "area", 100)    //Default area is 100
    call SetTemplateDefaultReal(  "SlashTemplate", "dmg", 150)     //Default initial damage is 150
    call SetTemplateDefaultReal(  "SlashTemplate", "dmgfct", 1)    //Default damage factor is 1
    call SetTemplateDefaultString("SlashTemplate", "animation", "attack slam") //Default animation is attack slam
    call SetTemplateDefaultInt(   "SlashTemplate", "SlashColor", 0xFFFFFFFF)   //Default slash color is 255-255-255-255
    call SetTemplateDefaultInt(   "SlashTemplate", "EndColor"  , 0xFFFFFFFF)   //Default end color is 255-255-255-255

 //===================================================================================================
 // Cold Slash ('A006')
 //
 set s=SetSpellTemplate('A006',"SlashTemplate")
 set D=0                                                //Cold Slash Options :
 set D=DamageTypes(ATTACK_TYPE_NORMAL,DAMAGE_TYPE_COLD) //Cold spell damage
 set D=DamageOnlyEnemies()                              //Only hurt enemies
 set D=CreateDamageOptions(D)                           //Save the damage options

    call SetAbilityDataInt( s,"totalhits",1,3) //Level 1: 3 hits
    call SetAbilityDataInt( s,"totalhits",2,5) //Level 2: 5 hits
    call SetAbilityDataInt( s,"totalhits",3,7) //Level 3: 7 hits

    call SetAbilityDataReal(s,"dmg",1,150) //Level 1: 150 damage
    call SetAbilityDataReal(s,"dmg",2,200) //Level 2: 200 damage
    call SetAbilityDataReal(s,"dmg",3,250) //Level 3: 250 damage

    call SetAbilityDataReal(s,"area",1,360) //Level 1: 360 area
    call SetAbilityDataReal(s,"area",2,370) //Level 2: 370 area
    call SetAbilityDataReal(s,"area",3,380) //Level 3: 380 area


    call SetAbilityDataInt( s,"DamageOptions",0,D)   //Using the damage options saved before

    call SetAbilityDataString(s,"animation",0,"attack slam") //Use attack slam animation

 //===================================================================================================
 // Fire Slash ('A00D')
 //
 set s=SetSpellTemplate('A00D',"SlashTemplate")
 set D=0                                                //Fire Slash Options :
 set D=DamageTypes(ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE) //Fire spell damage
 set D=DamageOnlyEnemies()                              //Only hurt enemies
 set D=CreateDamageOptions(D)                           //Save the damage options

    call SetAbilityDataInt( s,"totalhits",0,5) //5 Hits

    call SetAbilityDataReal(s,"dmg",1,200) //Level 1: 200 damage
    call SetAbilityDataReal(s,"dmg",2,270) //Level 2: 270 damage
    call SetAbilityDataReal(s,"dmg",3,340) //Level 3: 340 damage

    call SetAbilityDataReal(s,"area",0,500) //Always 500 of area

    call SetAbilityDataInt( s,"SlashKind",0,2)   //Slash Kind is 2
    call SetAbilityDataInt( s,"canrepeat",0,1)   //It can repeat targets!

    call SetAbilityDataReal(s,"dmgfct",0,0.75) //Will lose 25% of the damage per target

    call SetAbilityDataString(s,"animation",0,"attack") //Use attack animation

    call SetAbilityDataInt( s,"DamageOptions",0,D)   //Using the damage options saved before


endfunction

//===================================================================================================
function SlashTemplate_DoSpell takes player ow, unit t, integer s, integer l returns nothing
 local integer ab=GetAbilityDataInt(s,l,"Spell")

    if (ab!=0) then
        call CasterCastAbilityEx(ow,GetUnitX(t),GetUnitY(t),GetAbilityDataReal(s,l,"SpellHeight"),ab,l,I2S(GetAbilityDataInt(s,l,"OrderId") ),t,GetAbilityDataReal(s,l,"RecDelay") )
    endif
endfunction
    

function SlashTemplate_Colorize takes unit u, integer rgb returns nothing
 local integer Y=rgb+IntegerTertiaryOp(rgb<0,0x80000000,0)
 local integer Z
 local integer r
 local integer g
 local integer b

    set Z=Y/0x100
    set b=Y-(Z*0x100)
    set Y=Z/0x100
    set g=Z-(Y*0x100)
    set Z=Y/0x100
    set r=Y-(Z*0x100)
    if (rgb<0) then
        set Z=Z+128
    endif
    call SetUnitVertexColor(u,r,g,b,Z)
endfunction

function SlashTemplate takes nothing returns nothing
 local unit u=GetTriggerUnit()
 local integer s=GetSpellAbilityId()
 local integer l=GetUnitAbilityLevel( u, s )
 local group targetlog=CreateGroup()
 local group inrange=CreateGroup()
 local integer i=GetAbilityDataInt( s,l, "totalhits")
 local unit target=GetSpellTargetUnit()
 local unit picked
 local unit other=GetSpellTargetUnit()
 local real grad=GetUnitX( u)
 local real damage=GetAbilityDataReal(s,l,"dmg")
 local effect fx1=AddSpellEffectTargetById( s, EFFECT_TYPE_CASTER, u, GetAbilityEffectById(s,EFFECT_TYPE_CASTER,1))
 local effect fx2=AddSpellEffectTargetById( s, EFFECT_TYPE_CASTER, u, GetAbilityEffectById(s,EFFECT_TYPE_CASTER,2))

 local real x
 local real y
 local real tx
 local real ty
 local real d
 local integer dop
 local real fc

 local real dmgps=GetAbilityDataReal(s,l,"PDmg")
 local real period=GetAbilityDataReal(s,l,"PDmgPeriod")
 local real dur=GetAbilityDataReal(s,l,"PDmgDur")

 local integer ki=GetAbilityDataInt(s,l,"SlashKind")

 local boolean closest=(GetAbilityDataInt(s,l,"SelMethod")==0)
 local boolean color = (GetAbilityDataInt(s,l,"colorize")==1 )

    call PauseUnit(u, true)
    call SetUnitPathing(u,false)
    if (color) then
        call SlashTemplate_Colorize(u,GetAbilityDataInt(s,l,"SlashColor"))
    endif

    loop
        call GroupAddUnit( targetlog,target)
        set x=GetUnitX(u)
        set y=GetUnitY(u)
        set tx=GetUnitX(target)
        set ty=GetUnitY(target)

        call DestroyEffect( AddSpellEffectById( s, EFFECT_TYPE_SPECIAL, x,y ) )

        call SetUnitAnimation( u, GetAbilityDataString(s,l,"animation") )
        call TriggerSleepAction(0)

        if ((ki==0) or ((ki==2) and (GetRandomInt(0,1)==0))) then
            set grad=Atan2( ty - y, tx - x )
        else
            set grad=GetRandomReal(0,2*bj_PI)
        endif
        set x=100*Cos(grad)
        set y=100*Sin(grad)
        if (GetAbilityDataInt(s,l,"AngleKind")==1) then
            set x=-x
            set y=-y
        endif
        set x=tx+x
        set y=ty+y
        
        call SetUnitFacing( u, grad*bj_RADTODEG )
        call SetUnitPosition( u, x, y )

        set dop=LoadDamageOptions(GetAbilityDataInt(s,l,"DamageOptions"))
        set fc=GetDamageFactorByOptions(u,target,dop)

        if (fc!=0) then
            call UnitDamageTarget( u,target, damage*fc,true,false,null,null,null)
            call SlashTemplate_DoSpell(GetOwningPlayer(u),target,s,l)
            if (dmgps!=0) then
                call UnitDamageUnitTimed(u,dmgps*fc,period,dur,target,GetAbilityEffectById(s,EFFECT_TYPE_TARGET,0),GetAbilityEffectById(s,EFFECT_TYPE_TARGET,1),null,null)
            else
                call DestroyEffect( AddSpellEffectTargetById( s, EFFECT_TYPE_TARGET, target, GetAbilityEffectById(s,EFFECT_TYPE_TARGET,1) ) )
            endif
        endif




        call TriggerSleepAction(0)

        set x=GetAbilityDataReal(s,l,"dmgfct")
        set damage=damage*x
        set dmgps=dmgps*x

        set x=GetUnitX(u)
        set y=GetUnitY(u)
        set tx=GetUnitX(target)
        set ty=GetUnitY(target)

        set i=i-1
        exitwhen (i==0) or (GetWidgetLife(u)<1)
        call GroupClear(inrange)
        call GroupEnumUnitsInRange(inrange, tx, ty , GetAbilityDataReal(s,l,"area") , null)
        set target=null
        set other=null
        if closest then
            set grad=1000000
        else
            set grad=0
        endif
        set dop=LoadDamageOptions(GetAbilityDataInt(s,l,"DamageOptions"))
        loop
            set picked=FirstOfGroup(inrange)
            exitwhen (picked==null)
            set fc=GetDamageFactorByOptions(u,picked,dop)
            if (fc!=0) then
                if closest then
                    set d=SquareRoot( Pow(x-GetUnitX(picked),2) + Pow(y-GetUnitY(picked),2) )
                else
                    set d=GetRandomInt(0,R2I(grad+1))
                endif
                if (d <= grad) then
                    if not( IsUnitInGroup(picked,targetlog) ) then
                        if closest then
                            set grad=d
                        endif
                        set target=picked
                    endif
                    if not(closest) then
                        set grad=grad+1
                    endif
                    set other=picked
                endif
            endif
            call GroupRemoveUnit(inrange,picked)
        endloop
        if (target==null) and (GetAbilityDataInt(s,l,"canrepeat") == 1) then
            set target=other
        endif
        exitwhen (target==null)
    endloop
    if (color) then
        call SlashTemplate_Colorize(u,GetAbilityDataInt(s,l,"EndColor"))
    endif
    call DestroyEffect( AddSpellEffectTargetById( s, EFFECT_TYPE_SPECIAL, u, "origin" ) )
    call PauseUnit(u,false)
    call SetUnitPathing(u,true)
    call SetUnitPosition(u, GetUnitX(u), GetUnitY(u) )
 call DestroyEffect(fx1)
 call DestroyEffect(fx2)
 set fx1=null
 set fx2=null
 set u=null
 call DestroyGroup(targetlog)
 set targetlog=null
 call DestroyGroup(inrange)
 set inrange=null
 set target=null
 set other=null
endfunction

function InitTrig_Slash_Template takes nothing returns nothing
    call ExecuteFunc("SlashTemplateSetup")
//Must use ExecuteFunc to prevent the Map init thread from getting too long and crash.
endfunction


Any help you could provide would be most appreciated. :)
 
Bumping this to try to prevent spectre237 from making more topics about this same problem.
 
Ok, here is the spell with making invulnerable included, you can switch it on and off in "Slash Template Configuration":

Code:
//**********************************************************************  *****************************
//*
//* Slash Template
//* ÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻ
//* Requires:
//*          -A triggerer ability ( Unit targetable please)
//*          -The Caster System
//*          -The Alternative Spell Templates System
//*          -This Trigger
//*
//* Art: The Triggerer ability has art fields that are considered:
//* - Caster effect is attached twice to the hero during the slash.
//* - Second and Third Caster Effects are attachment points for the Caster Effect
//* - Special effect is used on the feet of the hero before teleporting to slash
//* - Target art is the target effect, or the periodic damage effect if used, and the
//*   second target effect is its attachment point.
//*
//**********************************************************************  *****************************

//======================================================================  =============================
// Slash Template Configuration:
//
// Here you can set the invulnerability of the caster:

function CasterInvulnerable takes nothing returns boolean
   return true // Change true to false to disable invulnerability
endfunction

// And Vex's original configuration:

function SlashTemplateSetup takes nothing returns nothing
local integer D //An integer variable we use later to save the Damage Options so we give them to the templates
local integer s //An integer variable we use later to save the rawcodes of spells to save some time

//======================================================================  =============================
// Template Info:
//
// Template Name Id = "SlashTemplate"
//
// The hero just gets teleported and attacks the targets fast, it looks nice and allows to cast
// a spell, do damage, damage per second, and also has options for the way to choose targets and
// factor for each target and that stuff.
//
//
// integer "totalhits"  The maximum number of hits done per cast
// real    "dmg"        The initial damage
// real    "PDmg"       The initial Periodic Damage
// real    "PDmgPeriod" The period of the Periodic Damage
// real    "PDmgDur"    The Duration of the periodic Damage
//
// real    "dmgfct"     The factor per target for the damage, each time the unit hits a target,
//                      the damage will be multiplied by this value to get reduced or incremented
//
// integer "Spell"      Rawcode of the Spell to cast (if any)
// real    "SpellHeight" Height of the caster that casts the spell to cast
// integer "OrderId"    Order Id of that spell
// real    "RecDelay"   Caster Recycle delay for that spell
//
//
// real    "area"       The new target detection range
// integer "canrepeat"  Is 1 if the slash can repeat targets, otherwise 0
//
// integer "SelMethod"  Is 0 if the slash should pick the closest unit, 1 to pick random units
// integer "SlashKind"  The kind of the Slash, 0 will try to get to the back of the unit, 1
//                      will attack in random direction, and 2 is a combination of both
//
// integer "AngleKind"  Is 0 for the default angle kind, is 1 to multiple the angle by -1
//
// string  "animation"  The animation used by the slash
//
// integer "colorize"   If it is 1 enables casting unit "colorizing"
// integer "SlashColor" Color in 0xAARRGGBB form for the duration of the slash
// integer "EndColor"   Color in 0xAARRGGBB form after the slash (original color of the hero)
//

// integer "DamageOptions" Caster System Damage Options in saveable form, used to determine which
//                         units can be attacked by the slash, if the damage factor is 0 the unit
//                         is not affected by the target spells nor damage, otherwise the value
//                         is only important as a damage factor.


//======================================================================  =============================
// Slash template Defaults:
//
    call SetTemplateDefaultInt(   "SlashTemplate", "totalhits", 1) //Default Total Hits is 1
    call SetTemplateDefaultInt(   "SlashTemplate", "canrepeat", 0) //Can't repeat targets
    call SetTemplateDefaultReal(  "SlashTemplate", "area", 100)    //Default area is 100
    call SetTemplateDefaultReal(  "SlashTemplate", "dmg", 150)     //Default initial damage is 150
    call SetTemplateDefaultReal(  "SlashTemplate", "dmgfct", 1)    //Default damage factor is 1
    call SetTemplateDefaultString("SlashTemplate", "animation", "attack slam") //Default animation is attack slam
    call SetTemplateDefaultInt(   "SlashTemplate", "SlashColor", 0xFFFFFFFF)   //Default slash color is 255-255-255-255
    call SetTemplateDefaultInt(   "SlashTemplate", "EndColor"  , 0xFFFFFFFF)   //Default end color is 255-255-255-255

//======================================================================  =============================
// Cold Slash ('A006')
//
set s=SetSpellTemplate('A006',"SlashTemplate")
set D=0                                                //Cold Slash Options :
set D=DamageTypes(ATTACK_TYPE_NORMAL,DAMAGE_TYPE_COLD) //Cold spell damage
set D=DamageOnlyEnemies()                              //Only hurt enemies
set D=CreateDamageOptions(D)                           //Save the damage options

    call SetAbilityDataInt( s,"totalhits",1,3) //Level 1: 3 hits
    call SetAbilityDataInt( s,"totalhits",2,5) //Level 2: 5 hits
    call SetAbilityDataInt( s,"totalhits",3,7) //Level 3: 7 hits

    call SetAbilityDataReal(s,"dmg",1,150) //Level 1: 150 damage
    call SetAbilityDataReal(s,"dmg",2,200) //Level 2: 200 damage
    call SetAbilityDataReal(s,"dmg",3,250) //Level 3: 250 damage

    call SetAbilityDataReal(s,"area",1,360) //Level 1: 360 area
    call SetAbilityDataReal(s,"area",2,370) //Level 2: 370 area
    call SetAbilityDataReal(s,"area",3,380) //Level 3: 380 area


    call SetAbilityDataInt( s,"DamageOptions",0,D)   //Using the damage options saved before

    call SetAbilityDataString(s,"animation",0,"attack slam") //Use attack slam animation

//======================================================================  =============================
// Fire Slash ('A00D')
//
set s=SetSpellTemplate('A00D',"SlashTemplate")
set D=0                                                //Fire Slash Options :
set D=DamageTypes(ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE) //Fire spell damage
set D=DamageOnlyEnemies()                              //Only hurt enemies
set D=CreateDamageOptions(D)                           //Save the damage options

    call SetAbilityDataInt( s,"totalhits",0,5) //5 Hits

    call SetAbilityDataReal(s,"dmg",1,200) //Level 1: 200 damage
    call SetAbilityDataReal(s,"dmg",2,270) //Level 2: 270 damage
    call SetAbilityDataReal(s,"dmg",3,340) //Level 3: 340 damage

    call SetAbilityDataReal(s,"area",0,500) //Always 500 of area

    call SetAbilityDataInt( s,"SlashKind",0,2)   //Slash Kind is 2
    call SetAbilityDataInt( s,"canrepeat",0,1)   //It can repeat targets!

    call SetAbilityDataReal(s,"dmgfct",0,0.75) //Will lose 25% of the damage per target

    call SetAbilityDataString(s,"animation",0,"attack") //Use attack animation

    call SetAbilityDataInt( s,"DamageOptions",0,D)   //Using the damage options saved before


endfunction

//======================================================================  =============================
function SlashTemplate_DoSpell takes player ow, unit t, integer s, integer l returns nothing
local integer ab=GetAbilityDataInt(s,l,"Spell")

    if (ab!=0) then
        call CasterCastAbilityEx(ow,GetUnitX(t),GetUnitY(t),GetAbilityDataReal(s,l,  "SpellHeight"),ab,l,I2S(GetAbilityDataInt(s,l,"OrderId") ),t,GetAbilityDataReal(s,l,"RecDelay") )
    endif
endfunction
    

function SlashTemplate_Colorize takes unit u, integer rgb returns nothing
local integer Y=rgb+IntegerTertiaryOp(rgb<0,0x80000000,0)
local integer Z
local integer r
local integer g
local integer b

    set Z=Y/0x100
    set b=Y-(Z*0x100)
    set Y=Z/0x100
    set g=Z-(Y*0x100)
    set Z=Y/0x100
    set r=Y-(Z*0x100)
    if (rgb<0) then
        set Z=Z+128
    endif
    call SetUnitVertexColor(u,r,g,b,Z)
endfunction

function SlashTemplate takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer s=GetSpellAbilityId()
local integer l=GetUnitAbilityLevel( u, s )
local group targetlog=CreateGroup()
local group inrange=CreateGroup()
local integer i=GetAbilityDataInt( s,l, "totalhits")
local unit target=GetSpellTargetUnit()
local unit picked
local unit other=GetSpellTargetUnit()
local real grad=GetUnitX( u)
local real damage=GetAbilityDataReal(s,l,"dmg")
local effect fx1=AddSpellEffectTargetById( s, EFFECT_TYPE_CASTER, u, GetAbilityEffectById(s,EFFECT_TYPE_CASTER,1))
local effect fx2=AddSpellEffectTargetById( s, EFFECT_TYPE_CASTER, u, GetAbilityEffectById(s,EFFECT_TYPE_CASTER,2))

local real x
local real y
local real tx
local real ty
local real d
local integer dop
local real fc

local real dmgps=GetAbilityDataReal(s,l,"PDmg")
local real period=GetAbilityDataReal(s,l,"PDmgPeriod")
local real dur=GetAbilityDataReal(s,l,"PDmgDur")

local integer ki=GetAbilityDataInt(s,l,"SlashKind")

local boolean closest=(GetAbilityDataInt(s,l,"SelMethod")==0)
local boolean color = (GetAbilityDataInt(s,l,"colorize")==1 )

    call PauseUnit(u, true)
    call SetUnitPathing(u,false)
    if (color) then
        call SlashTemplate_Colorize(u,GetAbilityDataInt(s,l,"SlashColor"))
    endif
    if CasterInvulnerable() then
        call SetUnitInvulnerable(u,true)
    endif

    loop
        call GroupAddUnit( targetlog,target)
        set x=GetUnitX(u)
        set y=GetUnitY(u)
        set tx=GetUnitX(target)
        set ty=GetUnitY(target)

        call DestroyEffect( AddSpellEffectById( s, EFFECT_TYPE_SPECIAL, x,y ) )

        call SetUnitAnimation( u, GetAbilityDataString(s,l,"animation") )
        call TriggerSleepAction(0)

        if ((ki==0) or ((ki==2) and (GetRandomInt(0,1)==0))) then
            set grad=Atan2( ty - y, tx - x )
        else
            set grad=GetRandomReal(0,2*bj_PI)
        endif
        set x=100*Cos(grad)
        set y=100*Sin(grad)
        if (GetAbilityDataInt(s,l,"AngleKind")==1) then
            set x=-x
            set y=-y
        endif
        set x=tx+x
        set y=ty+y
        
        call SetUnitFacing( u, grad*bj_RADTODEG )
        call SetUnitPosition( u, x, y )

        set dop=LoadDamageOptions(GetAbilityDataInt(s,l,"DamageOptions"))
        set fc=GetDamageFactorByOptions(u,target,dop)

        if (fc!=0) then
            call UnitDamageTarget( u,target, damage*fc,true,false,null,null,null)
            call SlashTemplate_DoSpell(GetOwningPlayer(u),target,s,l)
            if (dmgps!=0) then
                call UnitDamageUnitTimed(u,dmgps*fc,period,dur,target,GetAbilityEffectById(  s,EFFECT_TYPE_TARGET,0),GetAbilityEffectById(s,EFFECT_TYPE_TARGET,1),n  ull,null)
            else
                call DestroyEffect( AddSpellEffectTargetById( s, EFFECT_TYPE_TARGET, target, GetAbilityEffectById(s,EFFECT_TYPE_TARGET,1) ) )
            endif
        endif




        call TriggerSleepAction(0)

        set x=GetAbilityDataReal(s,l,"dmgfct")
        set damage=damage*x
        set dmgps=dmgps*x

        set x=GetUnitX(u)
        set y=GetUnitY(u)
        set tx=GetUnitX(target)
        set ty=GetUnitY(target)

        set i=i-1
        exitwhen (i==0) or (GetWidgetLife(u)<1)
        call GroupClear(inrange)
        call GroupEnumUnitsInRange(inrange, tx, ty , GetAbilityDataReal(s,l,"area") , null)
        set target=null
        set other=null
        if closest then
            set grad=1000000
        else
            set grad=0
        endif
        set dop=LoadDamageOptions(GetAbilityDataInt(s,l,"DamageOptions"))
        loop
            set picked=FirstOfGroup(inrange)
            exitwhen (picked==null)
            set fc=GetDamageFactorByOptions(u,picked,dop)
            if (fc!=0) then
                if closest then
                    set d=SquareRoot( Pow(x-GetUnitX(picked),2) + Pow(y-GetUnitY(picked),2) )
                else
                    set d=GetRandomInt(0,R2I(grad+1))
                endif
                if (d <= grad) then
                    if not( IsUnitInGroup(picked,targetlog) ) then
                        if closest then
                            set grad=d
                        endif
                        set target=picked
                    endif
                    if not(closest) then
                        set grad=grad+1
                    endif
                    set other=picked
                endif
            endif
            call GroupRemoveUnit(inrange,picked)
        endloop
        if (target==null) and (GetAbilityDataInt(s,l,"canrepeat") == 1) then
            set target=other
        endif
        exitwhen (target==null)
    endloop
    if (color) then
        call SlashTemplate_Colorize(u,GetAbilityDataInt(s,l,"EndColor"))
    endif
    call DestroyEffect( AddSpellEffectTargetById( s, EFFECT_TYPE_SPECIAL, u, "origin" ) )
    call PauseUnit(u,false)
    call SetUnitPathing(u,true)
    call SetUnitPosition(u, GetUnitX(u), GetUnitY(u) )
    if CasterInvulnerable() then
        call SetUnitInvulnerable(u,false)
    endif
call DestroyEffect(fx1)
call DestroyEffect(fx2)
set fx1=null
set fx2=null
set u=null
call DestroyGroup(targetlog)
set targetlog=null
call DestroyGroup(inrange)
set inrange=null
set target=null
set other=null
endfunction

function InitTrig_Slash_Template takes nothing returns nothing
    call ExecuteFunc("SlashTemplateSetup")
//Must use ExecuteFunc to prevent the Map init thread from getting too long and crash.
endfunction

No need to credit me (although I'd like it :)) because I just added a few lines. Feel free to post/pm if it doesn't work. I checked it as good as possible, but it might fail, ya know?
 
No it's perfect and I'll definitely credit you. You're awesome. Thanks!! ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.
  • U Uberplayer:
    Thanks for everything!
  • XXXconanXXX XXXconanXXX:
    And we JUST got a new warcraft 3 campaign after 20 years! Bummer lol. Thanks for building and maintaining such an awesome community over the years TheHelper! Forums like these are definitely a relic of their time, and in its heyday it really was the place to be in its niche. Hopefully the discord community stays active!
  • WildTurkey WildTurkey:
    All the best helper
  • WildTurkey WildTurkey:
    Thanks for what you have done for me and my family
  • WildTurkey WildTurkey:
    I wish you all the best and am saddened to say goodbye
  • The Helper The Helper:
    That is fantastic WildTurkey I am so happy to hear that! Bless you and your family!
  • The Helper The Helper:
    and i dont think I am going to close the site it is just likely to change drastically but I am working on something for the interim still fleshing it out. Most of the forums are going to be gone though and the NUON site and Warcraft sites will probably to to different hosts. I might keep the news forum though :)
    +1
  • The Helper The Helper:
    So I paired down the forums to what is going to be in the interim
  • The Helper The Helper:
    I might also just go for one news forum and make it Headline News only all that sub forum stuff was busy work on my part i think :)
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    I know right
    +1
  • Varine Varine:
    It's been great guys, I appreciate you having kept it up for so long! I feel like this has been a big part of my growing up in life, and I do very much appreciate everything that this forum has been able to give to me. So thank you.
    +2
  • Varine Varine:
    If there's bits still around I am willing to bet I will be, but I honestly wouldn't be too upset if some of my teenager posts were to no longer be around. I was a little fucking problem back then
    +1
  • Varine Varine:
    I'm going on a backpacking trip pretty soon. I've been trying to do it for a few years now and it just couldn't happen. I'll be by myself, and I think it'll be really good for me. My pack is already too heavy so I can't bring alcohol, and that might be a benefit to me. Like had that probation and couldn't drink, but it's a bit different when you can't do something voluntarily versus threat of literal imprisonment
    +1
  • Varine Varine:
    The trail is 40 miles altogether, but I'm planning on cutting cross country a bit because I want to camp on top of this mountain. I'm bringing a little telescope, if there's still a place for it I'll post some pictures when I get back!
    +2
  • jonas jonas:
    honestly there's nothing on that trip that would become better by drinking
  • jonas jonas:
    looking forward to those pictures
  • The Helper The Helper:
    Happy Thursday people! I think I have come up with a new direction for the site. One that will never fizzle out because a game is not popular anymore. I think I am going to try to make TheHelper.net a place that helps people with real stuff as much as it did with game technical support back in the day. Stay tuned...
    +3

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top