war stomp type spell with jass

Viikuna

No Marlo no game.
Reaction score
265
Remember to A) Set spell mana cost to 0 B) Set spell casting time to 0 C) Set dummies casting animation time thingies to 0 D) Make sure that your dummy has sight on target E) Make sure that your dummy is inside spell casting range F) Everything else I forgot to say

Like usually, it works if you do it right.

And you should use only 1 dummy for stunning only. Deal damage with triggers, so caster gets credit from kill, etc.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
It doesn't even cast once.
All those things I've done also.
And shooting a Storm Bolt works fine instead of DamageTarget() because the dummy is the casting player's unit.
 

Viikuna

No Marlo no game.
Reaction score
265
And it totally fucks up when you try to get killing unit for some other spell..

Wait, I uploads a testmap.


edit. AssAssTidies. ( This test map contains a vJassed WarStomp )
 

Attachments

  • AssAssTidies.w3x
    126.7 KB · Views: 159

WolfieeifloW

WEHZ Helper
Reaction score
372
I've never had a problem with it.
Plus damaging the target is inaccurate since it damages the target instantly.
Unless you do some kind of projectile system which for something like this is totally unneeded.
 

Viikuna

No Marlo no game.
Reaction score
265
Well, for example a spell that gives mana to your hero everytime he kills a unit would fail. ( Example lamely taken from DotA )

And test map is up now. Feel free to test one dummy method in action.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Ahh I see what you mean now.

I don't get your test map at all but I did my own test and I see :p .
 

Viikuna

No Marlo no game.
Reaction score
265
Using one dummy is the best way, unless you need your dummy to channel something.

In that case you need more of them, but you should still recycle them, because CreateUnit is slow with many o´s.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I couldn't get one dummy to work for some reason.
JASS:
// +------------------------------------------------------+
// |                                                      |
// |             -=-=- Custom War Stomp -=-=-             |
// |          -=-=- Created by Wolfie[NoCT] -=-=-         |
// |           -=-=- Created for arcimondor -=-=-         |
// |                                                      |
// +------------------------------------------------------+
// |                                                      |
// |                   How To Implement                   |
// |                                                      |
// +------------------------------------------------------+
// |                                                      |
// |   Create a new trigger in your map                   |
// |   Rename the trigger to 'WarStompCustom'             |
// |   Convert it to custom text                          |
// |   Replace the code with this script                  |
// |   Copy the custom abilities from this map to yours   |
// |   Copy the custom units from this map to yours       |
// |                                                      |
// +------------------------------------------------------+

//===========================
//=====   MODIFY HERE   =====
//=====   MODIFY HERE   =====
//=====   MODIFY HERE   =====
//===========================
    function SPELLID takes nothing returns integer
        return 'A000'
        //Rawcode of the 'War Stomp Custom' ability
    endfunction
    
    function DUMSPELLID takes nothing returns integer
        return 'A001'
        //Rawcode of the 'War Stomp Stun' ability
    endfunction
    
    function SPELLORDER takes nothing returns string
        return "thunderbolt"
        //'Order String - Use/Turn On' of the 'War Stomp Stun' ability
    endfunction
    
    function DUMID takes nothing returns integer
        return 'n000'
        //Rawcode of the 'Dummy' unit
    endfunction
    
    function RANGE takes nothing returns real
        return 450.
        //AoE of the stomp
    endfunction
    
//=====================================
//=====   DON'T TOUCH PAST HERE   =====
//=====   DON'T TOUCH PAST HERE   =====
//=====   DON'T TOUCH PAST HERE   =====
//=====================================
    function Conditions takes nothing returns boolean
        return (GetSpellAbilityId() == SPELLID())
    endfunction
    
    function Grouping takes nothing returns boolean
        return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
    endfunction
    
    function Actions takes nothing returns nothing
        local group g = CreateGroup()
        local unit u
        local unit FoG
        
        call GroupEnumUnitsInRange(g, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), RANGE(), Condition(function Grouping))
        set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DUMID(), GetUnitX(FoG), GetUnitY(FoG), bj_UNIT_FACING)
        call UnitAddAbility(u, DUMSPELLID())
        call SetUnitAbilityLevel(u, DUMSPELLID(), GetUnitAbilityLevel(u, SPELLID()))
        loop
        set FoG = FirstOfGroup(g)
        exitwhen FoG == null
            call IssueTargetOrder(u, SPELLORDER(), FoG)
            call GroupRemoveUnit(g, FoG)
        endloop
        call UnitApplyTimedLife(u, 'BTLF', 1.)
        set u = null
        call DestroyGroup(g)
    endfunction

//===========================================================================
    function InitTrig_WarStompCustom takes nothing returns nothing
        local trigger t = CreateTrigger()
    
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Condition(function Conditions))
        call TriggerAddAction(t, function Actions)
    endfunction
    
//End of spell
//End of spell
//End of spell
 

Attachments

  • opt-Custom_War_Stomp.w3x
    15.3 KB · Views: 133

Viikuna

No Marlo no game.
Reaction score
265
That probably because you create your dummy in point GetUnitX(null) , GetUnitY(null)

Just check my testmap. It does this all correctly.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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