war stomp type spell with jass

arcimondor

New Member
Reaction score
0
i got no idea how to do jass spells, so im looking for someone to make me one :D.
spell i want is basicly like warstomp, stun and dmg, but i want to change effect spell does when casted.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You don't need jass for instant spells... Just pick nearby enemy units when its cast and order a dummy unit cast Storm bolt on Picked unit.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Easy. Ad stun buff, damagd unit, wait, remove stun buff
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
Ad stun buff

you sure that action exists? btw my cat pwns yours :D

JASS:
scope warstomp initializer init

globals
     private group G = CreateGroup
     private unit Caster
     private unit Picked
     private unit Dummy
     private constant real radius = 250. //aka Area of Effect
endglobals

private function cond takes nothing returns boolean
     return GetSpellAbilityId() == <spell's raw code>
endfunction

private function filterFunc takes nothing returns boolean
     local real x = GetUnitX(GetFilterUnit() )
     local real y = GetUnitY(GetFilterUnit() )

     set Picked = GetFilterUnit()
     if IsUnitEnemy(Picked, GetOwningPlayer(Caster)) == true and GetWidgetLife(Picked) > 0. then
        set Dummy = CreateUnit(GetOwningPlayer(Caster), 'dummy's raw code', x, y, 0.)
        call UnitAddAbility(Dummy, 'storm bolt's raw code')
        call IssueTargetOrder(Dummy, "stormbolt", Picked)
        call UnitApplyTimedLife(Dummy, 'BTLF', 1.00)
     endif
      
     return false
endfunction

private function actions takes nothing returns nothing
     local real x
     local real y

     set Caster = GetTriggerUnit()
     set x = GetUnitX(Caster)
     set y = GetUnitY(Caster)

     call GroupEnumUnitsInRange(G, x, y, radius, Condition(function filterFunc) )    
endfunction

private function init takes nothing returns nothing
     local trigger t = CreateTrigger()

     call RegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
     call TriggerAddCondition(t, Condition(function cond))
     call TriggerAddAction(t, function actions)

     set t = null
endscope
 

arcimondor

New Member
Reaction score
0
you sure that action exists? btw my cat pwns yours :D

JASS:
scope warstomp initializer init

globals
     private group G = CreateGroup
     private unit Caster
     private unit Picked
     private unit Dummy
     private constant real radius = 250. //aka Area of Effect
endglobals

private function cond takes nothing returns boolean
     return GetSpellAbilityId() == <spell's raw code>
endfunction

private function filterFunc takes nothing returns boolean
     local real x = GetUnitX(GetFilterUnit() )
     local real y = GetUnitY(GetFilterUnit() )

     set Picked = GetFilterUnit()
     if IsUnitEnemy(Picked, GetOwningPlayer(Caster)) == true and GetWidgetLife(Picked) > 0. then
        set Dummy = CreateUnit(GetOwningPlayer(Caster), 'dummy's raw code', x, y, 0.)
        call UnitAddAbility(Dummy, 'storm bolt's raw code')
        call IssueTargetOrder(Dummy, "stormbolt", Picked)
        call UnitApplyTimedLife(Dummy, 'BTLF', 1.00)
     endif
      
     return false
endfunction

private function actions takes nothing returns nothing
     local real x
     local real y

     set Caster = GetTriggerUnit()
     set x = GetUnitX(Caster)
     set y = GetUnitY(Caster)

     call GroupEnumUnitsInRange(G, x, y, radius, Condition(function filterFunc) )    
endfunction

private function init takes nothing returns nothing
     local trigger t = CreateTrigger()

     call RegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
     call TriggerAddCondition(t, Condition(function cond))
     call TriggerAddAction(t, function actions)

     set t = null
endscope
thank you. next problem is how i use this?:banghead:. i never used jass spells before.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Here's a JASS version (No vJASS at all):
JASS:
//Custom War Stomp
//Made by Wolfie[NoCT]
//Made for arcimondor

//===========================
//=====   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))
        loop
        set FoG = FirstOfGroup(g)
        exitwhen FoG == null
            set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DUMID(), GetUnitX(FoG), GetUnitY(FoG), bj_UNIT_FACING)
            call UnitAddAbility(u, DUMSPELLID())
            call SetUnitAbilityLevel(u, DUMSPELLID(), GetUnitAbilityLevel(u, SPELLID()))
            call IssueTargetOrder(u, SPELLORDER(), FoG)
            call UnitApplyTimedLife(u, 'BTLF', 1.)
            call GroupRemoveUnit(g, FoG)
        endloop
        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
 

Viikuna

No Marlo no game.
Reaction score
265
Honestly, those really suck. Why on earth you create dummies dynamicly? And groups? Jesus..

JASS:


scope WarStomp initializer init
//====================================================================================
//ASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDA
//==================================================================================
globals
            private constant integer ABILITY_ID = 'A000'
            private constant integer DEALERS_HAND = 'A001'
            private constant integer DEALER_ID = 'n000'
            private constant real AOE = 250.0
            private constant real DAMAGE = 25.0
            private constant string EFFECT_PATH = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"

//====================================================================================
//ASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDASDASDASDASDASDASDASDDDDASD
//====================================================================================    
    private group TempG = CreateGroup()
    private unit TempU
    private player TempP
    private integer TempInt
    private filterfunc F
    private unit Dealer
endglobals

private function Filtteri takes nothing returns boolean
    local unit u=GetFilterUnit()
    if not IsUnitAlly(u,TempP) and GetWidgetLife(u) > 0.405 then
         call SetUnitX(Dealer,GetUnitX(u))
         call SetUnitY(Dealer,GetUnitY(u))
         call IssueTargetOrder(Dealer,"thunderbolt",u)
         call UnitDamageTarget(TempU,u,DAMAGE*TempInt,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
    endif
    set u=null
    return false
endfunction

private function YesWeCan takes nothing returns nothing
     local unit u = GetTriggerUnit()
     local real x = GetUnitX(u)
     local real y = GetUnitY(u)
     set TempInt=GetUnitAbilityLevel(u,ABILITY_ID)
     set TempP=GetOwningPlayer(u)
     set TempU=u
     call DestroyEffect(AddSpecialEffect(EFFECT_PATH,x,y))
     call SetUnitAbilityLevel(Dealer,DEALERS_HAND,TempInt)
     call GroupEnumUnitsInRange(TempG,x,y,AOE,F)
     set u = null
endfunction

private function CanWeStomp takes nothing returns boolean
    return GetSpellAbilityId() == ABILITY_ID
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function CanWeStomp))
    call TriggerAddAction(t,function YesWeCan)
    set F = Filter(function Filtteri)
    set Dealer = CreateUnit(Player(13),DEALER_ID,0.0,0.0,0.0)
endfunction

endscope
 

Chosendeath

New Member
Reaction score
0
Honestly, all the people posting with vJass are not realizing that the poster is someone who is completely new to JASS. Someone who doesn't know or care what vJass is... So to the person who originally posted this: USE Wolfie's way! All that private function/variable shit doesn't EXIST in regular World Editor, you have to download a program that is VERY annoying to install.

Edit: PS: If you attempt to use theirs without first downloading vJass, you will get a shitload of compile errors.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
VERY annoying to install

download NewGen and extract it to the warcraft folder?

on a wood pc it's done in 3 minutes
 

arcimondor

New Member
Reaction score
0
so how do i get spell into game? i have no idea how jass work with WE, or how i can get unit to have my jass spell
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
first, create a new trigger, go to Edit > Convert to custom text

then copy any of the codes posted above (whatever you want)

then make a new ability, press Ctrl+D to see it's raw code

it should be something like 'A000'

then use that code to determine whenever the spell is casted (by coping it to the Jass code posted, in my code I wrote where you should paste it)

same for the dummy's raw code
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
I still think you don't need jass for this... but I guess it's always good to learn for when you really need it? *shrugs*
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Sorry, I forgot to attach my map.
Here you go:
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))
        loop
        set FoG = FirstOfGroup(g)
        exitwhen FoG == null
            set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DUMID(), GetUnitX(FoG), GetUnitY(FoG), bj_UNIT_FACING)
            call UnitAddAbility(u, DUMSPELLID())
            call SetUnitAbilityLevel(u, DUMSPELLID(), GetUnitAbilityLevel(u, SPELLID()))
            call IssueTargetOrder(u, SPELLORDER(), FoG)
            call UnitApplyTimedLife(u, 'BTLF', 1.)
            call GroupRemoveUnit(g, FoG)
        endloop
        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: 124

wraithseeker

Tired.
Reaction score
122
Use Viikuna's one it's much more efficient.

Wolfie what you are doing is that you are doing a instant loop and creating one dummy unit per enumed unit to stun them which could have been replaced by 1 dummy unit instead. You forgot to null group g and just make it into a global group since its instant but you have to do a GroupClear before you call a groupenumunitsinrange.

EDIT: Oh he can't use vJASS well, make them into global groups with udg_prefix :)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Using one dummy didn't work:
JASS:
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
    
//===========================================================================
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
 
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