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:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top