Mass root, Damage over time trigger

Furch4s

New Member
Reaction score
0
Hello, I've been having some problems with this spell i'm making. I firstly did it in GUI and then converted it to Jass and started editing. I added local variables to make sure the trigger rememberd the targets and dummy even though i inserted a wait command.

But now when i save i get tons of errors. Could someone look thru the code and see if they can find the problem? I will highlight the part that I altered after converting to jass

JASS:
function Trig_Force_of_Nature_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A066' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Force_of_Nature_Copy_Func003001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) == false )
endfunction

function Trig_Force_of_Nature_Copy_Func003001003002 takes nothing returns boolean
    return ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Trig_Force_of_Nature_Copy_Func003001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_Force_of_Nature_Copy_Func003001003001(), Trig_Force_of_Nature_Copy_Func003001003002() )
endfunction


----------------------------thi is where i edited-----------------------------------------------------------------------
function Trig_Force_of_Nature_Copy_Func003A takes nothing returns nothing
local unit ua = GetTriggeringUnit()
local unit ub = CreateNUnitsAtLoc( 1, 'h010', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetEnumUnit()), 0.00 )
local unit uc = GetEnumUnit()

    call UnitApplyTimedLifeBJ( 3.50, 'BTLF', u2 )
    call UnitAddAbilityBJ( 'A06F', u2 )
    call IssueTargetOrderBJ( u2, "entanglingroots", GetEnumUnit() )
    call UnitDamageTargetBJ( u2, u3, ( ( 15.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())) ) + ( 0.25 * udg_Spell_Power[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
    call TriggerSleepAction( 0.50 )
    call UnitDamageTargetBJ( u2, u3, ( ( 15.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())) ) + ( 0.25 * udg_Spell_Power[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
    call TriggerSleepAction( 0.50 )
    call UnitDamageTargetBJ( u2, u3, ( ( 15.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())) ) + ( 0.25 * udg_Spell_Power[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
    call TriggerSleepAction( 0.50 )
    call UnitDamageTargetBJ( u2, u3, ( ( 15.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())) ) + ( 0.25 * udg_Spell_Power[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
endfunction
------------------------this is where i edited---------------------------------------------------------
function Trig_Force_of_Nature_Copy_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(350.00, GetSpellTargetLoc(), Condition(function Trig_Force_of_Nature_Copy_Func003001003)), function Trig_Force_of_Nature_Copy_Func003A )
endfunction

//===========================================================================
function InitTrig_Force_of_Nature_Copy takes nothing returns nothing
    set gg_trg_Force_of_Nature_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Force_of_Nature_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Force_of_Nature_Copy, Condition( function Trig_Force_of_Nature_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Force_of_Nature_Copy, function Trig_Force_of_Nature_Copy_Actions )
endfunction


Thanks! :)
 

Dirac

22710180
Reaction score
147
Even if fixed (and fixing converted GUI is such a huge pain) it wouldn't work, you're using waits inside ForGroup calls, that causes some major bugs.
Download vJass, read some tutorials, search for a good DoT system, profit!
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
[ljass]local unit ua = GetTriggeringUnit()[/ljass] --> [ljass]local unit ua = GetTriggerUnit()[/ljass]

swap the line that ub and uc are on then change ub

[ljass]local unit ub = CreateNUnitsAtLoc(1, 'h010', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetEnumUnit()), 0.00)[/ljass]
-->
[ljass]local unit ub = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'h010', GetUnitX(uc), GetUnitY(uc), 0)[/ljass]

then get rid of bjs, IE:

[ljass]call UnitApplyTimedLifeBJ(3.5, 'BTLF', u2)[/ljass] --> [ljass]call UnitApplyTimedLife(u2, 'BTLF', 3.5)[/ljass]

because they are just a function that calls another function, here is the function UnitApplyTimedLifeBJ:

JASS:
function UnitApplyTimedLifeBJ takes real duration, integer buffId, unit whichUnit returns nothing
    call UnitApplyTimedLife(whichUnit, buffId, duration)
endfunction
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
The beauty of vJass.
Actually one dummy per map is enough, as the spell casting is instant if you set the animation time for the dummy to 0.000
JASS:
library ForceOfNature initializer OnInit requires GT, TimerUtils, GroupUtils, DummyCaster
	
    globals
        private constant integer ABIL_ID='A066'
        private constant integer ENTANGLE_ID='A06F'
    endglobals
    
    private function DamageTimeout takes integer level returns real
        return 0.5
    endfunction
    
    private function DamageTimes takes integer level returns real
        return 4
    endfunction
    
    private function DamageMultiplier takes integer level returns real
        return 0.25
    endfunction
    
    private function Radius takes integer level returns real
        return 350.0
    endfunction
    
    private struct Data
        private static thistype temp
        unit caster
        player owner
        integer level
        real damage
        integer tick
        timer t
        group g
        
        private static method filt takes nothing returns boolean
            return IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)==false and IsUnitEnemy(GetFilterUnit(),thistype.temp.owner)
        endmethod
        
        private static method entangle takes nothing returns nothing
            call IssueTargetOrder(DUMMY,"entangle",GetEnumUnit())
        endmethod
        
        private static method damageUnits takes nothing returns nothing
            call UnitDamageTarget(thistype.temp.caster,GetEnumUnit(),thistype.temp.damage,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_LIGHTNING,null)
        endmethod
        
        private static method periodic takes nothing returns nothing
            local thistype this=GetTimerData(GetExpiredTimer())
            set this.tick=this.tick-1
            set thistype.temp=this
            call ForGroup(this.g,function thistype.damageUnits)
            if this.tick<=0 then
                call ReleaseGroup(this.g)
                call ReleaseTimer(this.t)
                call this.destroy()
            endif
        endmethod
        
        static method action takes nothing returns boolean
            local thistype this=thistype.allocate()
            set this.caster=GetTriggerUnit()
            set this.owner=GetOwningPlayer(this.caster)
            set this.level=GetUnitAbilityLevel(this.caster,ABIL_ID)
            set this.damage=DamageMultiplier(this.level)*udg_Spell_Power[GetPlayerId(this.owner)]
            set this.tick=DamageTimes(this.level)
            set this.g=NewGroup()
            set thistype.temp=this
            call GroupEnumUnitsInRange(this.g,GetUnitX(this.caster),GetUnitY(this.caster),Radius(this.level),Condition(function thistype.filt))
            call UnitAddAbility(DUMMY,ENTANGLE_ID)
            call ForGroup(this.g,function thistype.entangle)
            set this.t=NewTimer()
            call SetTimerData(this.t,this)
            call TimerStart(this.t,DamageTimeout(this.level),true,function thistype.periodic)
            return false
        endmethod
    endstruct
    
    private function OnInit takes nothing returns nothing
        call GT_AddStartsEffectAction(function Data.action,ABIL_ID)
    endfunction
    
endlibrary
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
>The beauty of vJass.

Beauty is in the eye of the beholder =)

JASS:





module MassRootDamageOverTime

enum mass-root-damage-over-time
{
    int        id                = 'MRDO'
    real       delay             = 0.5
    int        repeatbase        = 4
    real       rangebase         = 350
    real       damagefactor      = 0.25
    attacktype attack-type       = ATTACK_TYPE_NORMAL
    damagetype damage-type       = DAMAGE_TYPE_LIGHTNING
    weapontype weapon-type       = WEAPON_TYPE_WHOKNOWS
    xeffect    fx                = Effect("NightElf/Keeper of the Grove/Entangle")
} conf;

event.onspelleffect += func(unit trigger_unit(u))
{
    var ulvl   = u.ability_level(conf.id)
    var repeat = ulvl * conf.repeatbase

    while repeat > 0
    {
        for units_in_range(u.x, u.y, conf.rangebase * ulvl) -> $curr_unit
        {
            if curr_unit.is_alive() and u.owner.is_enemy(curr_unit)
            {
                u.damage(curr_unit, u.intelligence * conf.damagefactor, conf.attack-type, conf.damage-type, conf.weapon-type)
                u.effect(curr_unit, conf.fx)
            } 
        }

        repeat--
        sleep(conf.delay)
    }
}
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top