• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Burning oil and berserker's call

Status
Not open for further replies.
Level 5
Joined
Aug 9, 2012
Messages
119
Guys, how can i make that passive burning oil skill,
Having a delay between each scorching damage duration,
Like... After the first hit, the burning oil scorch the earth,
And how create interval before the next attack scorch the earth by attack too...
Maybe 3 second once, should i use trigger?

And I'm looking everywhere with berserker's call spell trigger :(
In Gui but haven't got the working one, most of them doesn't work properly... X_X I'm so confused...

Its like... Make 300AoE enemy units attacking caster,
For 3second, while they can't cast or using item...
Simple as that , but pain in gui x_x

Thx
 
Level 5
Joined
Aug 9, 2012
Messages
119
Noooo, it can be stop whenever the enemy (player) wants, just stop, and they will stop attacking the caster :(
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
You add the units around the Berserker's call to a Unit Group and save the target (The caster) in their ID. Then, every 0.03 seconds, if they're current order is not "Attack" the caster, you order the unit to attack the caster. You start a timer too with the duration. When the timer expires you remove all the units from the group and check if the group is empty. Then you turn off the loop trigger.
 
Level 5
Joined
Aug 9, 2012
Messages
119
HoW bout this?
I use roar as template, inncreasing self defense, for duration of
1,5s / 2.25s / 3s

The trigger is, when i cast roar, i pick all enemy unit nearby into group
Turning on new trigger

Every 0.05 ,
IF the caster still having roar buff,
I make all unit from prev group attack the caster,
Else, i will make all unit from that group stop and turn off this trigger and destroy group...
Still, thts not reallyy working :(

Since enemy... Can still use item and skill
U know like dota, its not silence, but no mattter what,
U can't castt a skill :(
If use item, one best way is to stun enemy,
But if enemy get stunned? They won't be able to attack u
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
:ogre_rage: BEHOLD

JASS:
/***********************************************************************/
/**************              Configurables                **************/
/***********************************************************************/

globals
    integer = SpartBRage_AbilityId = 'A000'         // The Ability Id
    real SpartBRage_Duration = 1.25                 // This will be multiplied by ability level
    real SpartBRage_Radius = 350                    // Radius of effect
    string SpartBRage_Effect = "Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnBirthMissile.mdl" // The model string
    
    
/***********************************************************************/
/**************  From now on, don't touch if you're not   **************/
/**************     sure. In any case, make a backup      **************/
/**************                                           **************/
/**************       Feel free to delete comments        **************/
/***********************************************************************/
    
    hashtable SpartBRage_Hash = InitHashtable()
    group SpartBRage_Group = CreateGroup()
endglobals

// Trigger Conditions
function Trig_SpartBRage_Cast_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpartBRage_AbilityId
endfunction

// Timer Actions
function SpartBRage_TimerActions takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer timerId = GetHandleId(t)
    local hashtable h = SpartBRage_Hash
    local unit u = LoadUnitHandle(h, timerId, 0)
    local effect e = LoadEffectHandle(h, timerId, 1)
    
    call DestroyEffect(e) // Destroy Effect
    call GroupRemoveUnit(SpartBRage_Group, u) // Remove Unit from Group
    
    call FlushChildHashtable(h, timerId) // Flush Timer Hash Data
    call FlushChildHashtable(h, GetHandleId(u)) // Flush Unit Hash Data
    
    // Check if group is empty
    set bj_groupCountUnits = 0
    call ForGroup(SpartBRage_Group, function CountUnitsInGroupEnum)
    if bj_groupCountUnits == 0 then
        call DisableTrigger(gg_trg_SpartBRage_Prevent) // Disable trigger 
    endif
    
    // Clearing leaks
    set t = null
    set u = null
    set e = null
endfunction

// Trigger Actions
function Trig_SpartBRage_Cast_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local group g1 = bj_lastCreatedGroup
    local timer t
    local integer timerId
    local integer unitId
    local unit fog
    local real duration = SpartBRage_Duration * GetUnitAbilityLevel(u, SpartBRage_AbilityId) // This is the duration formula.
    local effect e
    local hashtable h = SpartBRage_Hash
    local group g2 = SpartBRage_Group

    // Enum units around caster in a temp group (g1)
    call GroupEnumUnitsInRange(g1, GetUnitX(u), GetUnitY(u), SpartBRage_Radius, null)
    loop
        set fog = FirstOfGroup(g1)
        set unitId = GetHandleId(fog)
        exitwhen fog == null
        
        // Check if they're enemies and they're alive
        if IsUnitEnemy(fog, GetTriggerPlayer()) == true and GetWidgetLife(fog) > 0 then
        
            // Check if the unit is already in the group (under effect of Berserker)
            if IsUnitInGroup(fog, g2) == true then
                set t = LoadTimerHandle(h, unitId, 1)
                set timerId = GetHandleId(t)
                set e = LoadEffectHandle(h, timerId, 1)
                call DestroyEffect(e) // Destroy Effect
                call PauseTimer(t) // Pause timer
                call DestroyTimer(t) // Destroy Timer
                call GroupRemoveUnit(g2, fog) // Remove Unit from group
                call FlushChildHashtable(h, timerId) // Flush Timer Hash Data
                call FlushChildHashtable(h, unitId) // Flush Unit Hash Data
            endif
            
                set t = CreateTimer() // Create a timer for this unit
                set timerId = GetHandleId(t)
                call TimerStart(t, duration, false, function SpartBRage_TimerActions) // Start the Timer
                set e = AddSpecialEffectTarget(SpartBRage_Effect, fog, "chest") // Add the Effect
                call SaveUnitHandle(h, timerId, 0, fog) // Save Unit in Timer
                call SaveEffectHandle(h, timerId, 1, e) // Save Effect in Timer
                call SaveUnitHandle(h, unitId, 0, u)    // Save Target in Unit
                call SaveTimerHandle(h, unitId, 1, t)   // Save Timer in Unit
                call IssueTargetOrder(fog, "attack", u) // Order unit to attack
                call GroupAddUnit(g2, fog)              // Add the unit to the group of units under berserk effect
        endif
        call GroupRemoveUnit(g1, fog) // Remove the unit from the temp group (g1)
    endloop
    
    call EnableTrigger(gg_trg_SpartBRage_Prevent) // Turn on the Trigger that prevents the unit from doing other stuff
    
    // Clearing leaks
    set u = null
    set g1 = null
    set g2 = null
    set t = null
    set fog = null
    set e = null
    set h = null
endfunction

//===========================================================================
function InitTrig_SpartBRage_Cast takes nothing returns nothing
    set gg_trg_SpartBRage_Cast = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SpartBRage_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_SpartBRage_Cast, Condition( function Trig_SpartBRage_Cast_Conditions ) )
    call TriggerAddAction( gg_trg_SpartBRage_Cast, function Trig_SpartBRage_Cast_Actions )
endfunction

JASS:
function Trig_SpartBRage_Prevent_Conditions takes nothing returns boolean
    return IsUnitInGroup(GetTriggerUnit(), udg_SpartBRage_Group) == true
endfunction

function Trig_SpartBRage_Prevent_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer i = GetHandleId(u)
    local unit target = LoadUnitHandle(udg_SpartBRage_Hash, i, 0)
    call IssueTargetOrder( u, "attack", target)
    set u = null
    set target = null
endfunction

//===========================================================================
function InitTrig_SpartBRage_Prevent takes nothing returns nothing
    local trigger t 
    set gg_trg_SpartBRage_Prevent = CreateTrigger(  )
    set t = gg_trg_SpartBRage_Prevent
    call DisableTrigger(t)
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( t, Condition( function Trig_SpartBRage_Prevent_Conditions ) )
    call TriggerAddAction( t, function Trig_SpartBRage_Prevent_Actions )
    set t = null
endfunction


About the Scorching Earth thing, you have to use OOL (orb of lightning) ability, add it 3 seconds cooldown, and make the under-effect ability be the scorched earth. This is an orb effect tough, and it only works when you give explicit order of attack. Auto acquired target and attacks doesn't trigger the ability. Same is done for timed critical, timed sange, and almos any other timed thing :p
 

Attachments

  • SpartBRage.w3x
    20.4 KB · Views: 55
Level 5
Joined
Aug 9, 2012
Messages
119
Thxxx a looot brooo, ill try it sooooon about OOL,
And x_x
I guuess its about time i. Learn about jass T_T


First , cann u tell me how to import jass code into other map?
 
Level 5
Joined
Aug 9, 2012
Messages
119
Copy the trigger, ctrl + c then ctrl + v.


Strange...
Failed...

I copyy the 2 trigger, then create two var, uunigroup n hast used by, change ability I'd into mine, but still... Even can't be save,thts 83 line error x_x
Expected name???? Most of it in comment line :|
What did i missed?
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Strange...
Failed...

I copyy the 2 trigger, then create two var, uunigroup n hast used by, change ability I'd into mine, but still... Even can't be save,thts 83 line error x_x
Expected name???? Most of it in comment line :|
What did i missed?

Try making a new empty trigger. Go to Edit >> Convert to Custom Text and it will be in JASS. Just maybe CnP the JASS Code to your Empty JASS trigger.
 
Level 5
Joined
Aug 9, 2012
Messages
119
well,
after looking for help by googling :D

first mistake is i dont import or save using JNGP
then after i use it,
still 5 line error,
then look for the error and search for it

then i disable UMSWE
when i change it back to normal exact same coding,
save it...

it said success now :vw_wtf:

can someone explain it a bit to me? :goblin_jawdrop:

thank you








and dear Spartipilo,
have you test the map using two hero?
one is just luring and get attacked,
the other casting your skill,

ive try ur code, IT WORKS at the first time,
the second is just fine, then the third or so?
the enemy have got their special effect attach to them , lava spawn,
BUT... they are not attacking you anymore, they are not taunted at all,
but the special effect remain there, >.<
something wrong?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
See in my signature last JNPG and JassHelper versions.

When you cast Berserker Rage it picks unit around and adds them to a group and starts a timer. The timer data is saved on the unit, and the unit data is saved on the timer. If you cast the ability again the timer data is taken from the unit and deleted, then replaced with the new-cast data. I can't imagine how that can turn into unit not being forced to attack.

There's no need to create nothing but the triggers. Everything the ability needs is created within these 2 triggers. You may just need to create 2 triggers with the same names OR (i'm not sure) rename the triggers after you pasted the code on them (then Wc3 automatically adjusts some names)

I improved a bit the duration formula and default radius, and fixed a bug/crash (infinite loop) with the prevent thing. Tested with allies (ordering to do other stuff myself) and with enemies and works great.

I must confess that the "Prevent" trigger works but too slow. Wc3 takes some time to detect orders and re-order something after that. I think that a 0.03 loop with periodic check of order would be faster but a lot heavier. Which to use depends on how much the gameability is affected by one or another. (ofc i just made the "easy/short" one :D)


JASS:
/***********************************************************************/
/**************              Configurables                **************/
/***********************************************************************/

globals
    integer = SpartBRage_AbilityId = 'A000'         // The Ability Id
    real SpartBRage_Duration = 0.75                 // This will be multiplied by ability level + 1.25
    real SpartBRage_Radius = 275                    // Radius of effect
    string SpartBRage_Effect = "Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnBirthMissile.mdl" // The model string
    
    
/***********************************************************************/
/**************  From now on, don't touch if you're not   **************/
/**************     sure. In any case, make a backup      **************/
/**************                                           **************/
/**************       Feel free to delete comments        **************/
/***********************************************************************/
    
    hashtable SpartBRage_Hash = InitHashtable()
    group SpartBRage_Group = CreateGroup()
endglobals

// Trigger Conditions
function Trig_SpartBRage_Cast_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpartBRage_AbilityId
endfunction

// Timer Actions
function SpartBRage_TimerActions takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer timerId = GetHandleId(t)
    local hashtable h = SpartBRage_Hash
    local unit u = LoadUnitHandle(h, timerId, 0)
    local effect e = LoadEffectHandle(h, timerId, 1)
    
    call DestroyEffect(e) // Destroy Effect
    call GroupRemoveUnit(SpartBRage_Group, u) // Remove Unit from Group
    
    call FlushChildHashtable(h, timerId) // Flush Timer Hash Data
    call FlushChildHashtable(h, GetHandleId(u)) // Flush Unit Hash Data
    
    // Check if group is empty
    set bj_groupCountUnits = 0
    call ForGroup(SpartBRage_Group, function CountUnitsInGroupEnum)
    if bj_groupCountUnits == 0 then
        call DisableTrigger(gg_trg_SpartBRage_Prevent) // Disable trigger 
    endif
    
    // Clearing leaks
    set t = null
    set u = null
    set e = null
endfunction

// Trigger Actions
function Trig_SpartBRage_Cast_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local group g1 = bj_lastCreatedGroup
    local timer t
    local integer timerId
    local integer unitId
    local unit fog
    local real duration = 1.25 + (SpartBRage_Duration * GetUnitAbilityLevel(u, SpartBRage_AbilityId)) // This is the duration formula.
    local effect e
    local hashtable h = SpartBRage_Hash
    local group g2 = SpartBRage_Group

    // Enum units around caster in a temp group (g1)
    call GroupEnumUnitsInRange(g1, GetUnitX(u), GetUnitY(u), SpartBRage_Radius, null)
    loop
        set fog = FirstOfGroup(g1)
        set unitId = GetHandleId(fog)
        exitwhen fog == null
        
        // Check if they're enemies and they're alive
        if IsUnitEnemy(fog, GetTriggerPlayer()) == true and GetWidgetLife(fog) > 0 then
        
            // Check if the unit is already in the group (under effect of Berserker)
            if IsUnitInGroup(fog, g2) == true then
                set t = LoadTimerHandle(h, unitId, 1)
                set timerId = GetHandleId(t)
                set e = LoadEffectHandle(h, timerId, 1)
                call DestroyEffect(e) // Destroy Effect
                call PauseTimer(t) // Pause timer
                call DestroyTimer(t) // Destroy Timer
                call GroupRemoveUnit(g2, fog) // Remove Unit from group
                call FlushChildHashtable(h, timerId) // Flush Timer Hash Data
                call FlushChildHashtable(h, unitId) // Flush Unit Hash Data
            endif
            
                set t = CreateTimer() // Create a timer for this unit
                set timerId = GetHandleId(t)
                call TimerStart(t, duration, false, function SpartBRage_TimerActions) // Start the Timer
                set e = AddSpecialEffectTarget(SpartBRage_Effect, fog, "chest") // Add the Effect
                call SaveUnitHandle(h, timerId, 0, fog) // Save Unit in Timer
                call SaveEffectHandle(h, timerId, 1, e) // Save Effect in Timer
                call SaveUnitHandle(h, unitId, 0, u)    // Save Target in Unit
                call SaveTimerHandle(h, unitId, 1, t)   // Save Timer in Unit
                call IssueTargetOrder(fog, "attack", u) // Order unit to attack
                call GroupAddUnit(g2, fog)              // Add the unit to the group of units under berserk effect
        endif
        call GroupRemoveUnit(g1, fog) // Remove the unit from the temp group (g1)
    endloop
    
    call EnableTrigger(gg_trg_SpartBRage_Prevent) // Turn on the Trigger that prevents the unit from doing other stuff
    
    // Clearing leaks
    set u = null
    set g1 = null
    set g2 = null
    set t = null
    set fog = null
    set e = null
    set h = null
endfunction

//===========================================================================
function InitTrig_SpartBRage_Cast takes nothing returns nothing
    set gg_trg_SpartBRage_Cast = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SpartBRage_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_SpartBRage_Cast, Condition( function Trig_SpartBRage_Cast_Conditions ) )
    call TriggerAddAction( gg_trg_SpartBRage_Cast, function Trig_SpartBRage_Cast_Actions )
endfunction
JASS:
function Trig_SpartBRage_Prevent_Conditions takes nothing returns boolean
    return IsUnitInGroup(GetTriggerUnit(), SpartBRage_Group) == true and GetIssuedOrderId() != 851983
endfunction

function Trig_SpartBRage_Prevent_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer i = GetHandleId(u)
    local unit target = LoadUnitHandle(SpartBRage_Hash, i, 0)
    call IssueTargetOrder( u, "attack", target)
    set u = null
    set target = null
endfunction

//===========================================================================
function InitTrig_SpartBRage_Prevent takes nothing returns nothing
    set gg_trg_SpartBRage_Prevent = CreateTrigger(  )
    call DisableTrigger(gg_trg_SpartBRage_Prevent)
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SpartBRage_Prevent, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SpartBRage_Prevent, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SpartBRage_Prevent, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_SpartBRage_Prevent, Condition( function Trig_SpartBRage_Prevent_Conditions ) )
    call TriggerAddAction( gg_trg_SpartBRage_Prevent, function Trig_SpartBRage_Prevent_Actions )
endfunction


By the way, this isn't some hard-impossible-to-learn jass. This is basically a GUI script turned to JASS, replaced GUI globals with JASS globals, replaced BJ's by their natives, using X/Y over locations, and using some easy jass tricks (like first of group) to improve stuff. Also using locals to make it easier to read.

If you want to customize or change or add or substract something, just let me know.
 
Level 5
Joined
Aug 9, 2012
Messages
119
ummm thx bro, u know ive looking for this spell , just this once, for quite long time,
havent found the working one :( , need it for iconic hero, that really need this things to sync and having good game balance.

but... the latest map? :D no attachment?


i cant just copas those trigger, the problem is always on JNGP error undeclared whatever T_T

i know jass code is a bit same with GUI, i can read it , i get it, but not all,
just their own function command , >.<


ohh by the way, about the OOL, adding burning oil effect into it,
adding cooldown, even add chance of hitting to cast burning oil,
it doesnt work, since burning oil is 100% casted after your range damage HIT target >.<
but its okay, i combine it with critical strike, so 66% critical, 34% burning oil,
both will not trigger at the same time, so at least it prevent creating too much scorching earth that can slow the process
thx for all the participant here
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I didn't post the map because you can just Copy/paste each trigger on the ones you have working already.

The code is error-less. If it gives you error is because you don't have last JNPG, or last JassHelper, or correct Wc3 installation or correct NewGen Editor configuration. You can check for latest version of both in my signature.

You can give cooldown to Orb Of Lightning, not to Scorching Earth, that will make Scorching Earth have cooldown :p
 
Level 5
Joined
Aug 9, 2012
Messages
119
okaaaaaayy im workiing on it now,
got to finish it once aand for all ^^
:grin::grin::grin::grin:

well, that orb, i already adding cooldown too :(
it DOESNT work >.<

burning oil is always on, every hit of your Range attack,
doesnt matter anything, ive tried it >.<
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Damn it... I remember i did a timed triggered burning oil once... I also remember deleting it. It was such an awesome TD... anyway, just let me know if you need something else with the berserker thing.
 
Level 5
Joined
Aug 9, 2012
Messages
119
Okayyyy , thx. Sir:D
And sry for late reply, kind a busy this few days
Found no problem, but haven't try with ohers player as beta,
N yeah :( if its because of orb, itt can't :(
But well.. No prob :) hehe
 
Level 5
Joined
Aug 9, 2012
Messages
119
Okayyyy , thx. Sir:D
And sry for late reply, kind a busy this few days
Found no problem, but haven't try with ohers player as beta,
N yeah :( if its because of orb, itt can't :(
But well.. No prob :) hehe
 
Status
Not open for further replies.
Top