Spell 1000 Hammers

Tyman2007

Ya Rly >.
Reaction score
74
Well... 1000 hammers is metaphorically speaking. it's max amount of hammers it can throw is 75.. unless you change it of course.

I made this in 15 minutes. Don't expect a non-cliche or a professional spell because this is really the first vJass spell i've posted.

GUI/JASS/vJass: vJass
Leakless: Maybe. It's leaning towards leakless.
Lagless: Depends on how much you've set the amount thrown.
MUI/MPI: MUI
Import Difficulty: Easy
Requirements: NewGen


Picc.png

UPDATE: Fixed a bug where it would select dead units as well.

UPDATE: Fixed a MAJOR bug which made the spell only hit 1 or 0 units.

Spell:

JASS:
scope HammerSpell initializer Init

globals
    private constant integer SpellID = 'AHtc'         //The rawcode of the spell you are using.
    private constant integer DummyID = 'h000'         //The rawcode of the dummy unit.
    private constant integer ExpirID = 'BTLF'         //The Expiration Timer Type. (DO NOT CHANGE)
    private constant string BaseID = "thunderbolt"    //The order string of the base spell.
    private constant integer Units = 25               //Number of added units hit per spell level.
    private constant real Range = 300.00              //Range of the spell
    private constant string Missle = "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl" //If you use a different spell model then change this to that.
    private boolean Preloaded = false                 //Checks to see if model is preloaded.
    private location temp_point                       //Temperary Point. (DO NOT CHANGE)
    private group temp_group                          //Temperary Unit Group. (DO NOT CHANGE)
    private group temp_group2                         //Temperary Unit Group. (DO NOT CHANGE)
endglobals

//Do not edit below these lines unless you know what you're doing.//
////////////////////////////////////////////////////////////////////
//                                                                //
//                                                                //
////////////////////////////////////////////////////////////////////
//Do not edit below these lines unless you know what you're doing.//



private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellID
endfunction

private function Cond1 takes nothing returns boolean
    return IsUnitAliveBJ(GetEnumUnit()) == true
endfunction

private function Cond2 takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true
endfunction

private function UGConds takes nothing returns boolean
    return GetBooleanAnd( Cond1(), Cond2() )
endfunction

private function UGActions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, DummyID, GetOwningPlayer(GetTriggerUnit()), temp_point, bj_UNIT_FACING )
    call IssueTargetOrder( GetLastCreatedUnit(), BaseID, GetEnumUnit() )
    call UnitApplyTimedLife(GetLastCreatedUnit(), ExpirID, 0.50)
endfunction


private function Actions takes nothing returns nothing
    if (Preloaded == false) then
        call DestroyEffect (AddSpecialEffect (Missle, 0, 0))
        set Preloaded = true
    endif
    set temp_point = GetUnitLoc(GetTriggerUnit())
    set temp_group = GetUnitsInRangeOfLocMatching(( Range * I2R(GetUnitAbilityLevel(GetTriggerUnit(), SpellID)) ), temp_point, Condition(function Cond2))
    set temp_group2 = GetRandomSubGroup(( Units * GetUnitAbilityLevel(GetTriggerUnit(),SpellID)), temp_group)
    call ForGroup( temp_group2, function UGActions)
    call RemoveLocation(temp_point)
    call DestroyGroup(temp_group)
    call DestroyGroup(temp_group2)
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( trig, Condition( function Conditions ) )
    call TriggerAddAction( trig, function Actions )
endfunction

endscope


EDIT: Added new map.
EDIT2: Forgot to remove temp_group 2
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
[Negative?]
Seems like a mass storm bolt.


[Positives]
Looks leakless.
 

DrEvil

FCRI Associate!
Reaction score
111
Nice Job

Im not realy a guy for looking at JASS code but , for once i actually understand what all this JASS code does.

" Picks [ 25 X level of spell ] units and sends hammers towards them stuning for 3 seconds. "
 

quraji

zap
Reaction score
144
If you don't want people changing certain variables, put them in a separate globals block. As a side note, I find those "Do not edit below unless you know what you are doing" messages funny. Like some people who actually don't know (jass) are just going to go in and change things all willy-nilly. :p
 

DrEvil

FCRI Associate!
Reaction score
111
Why would you do that ?



I killed all the little f*ckers with a lag avalanche of hammers

14,000 range
35,000 hammers per level


lol took a few seconds to start but then they stunned


And again i say

I like this spell , hope it gets approved Tyman2007
 

Flare

Stops copies me!
Reaction score
662
You're using a number of BJ's unnecessarily (CreateNUnitsAtLoc, UnitApplyTimedLifeBJ, IssueTargetOrderBJ, ForGroupBJ(!), GetUnitAbilityLevelSwapped, GetLastCreatedUnit instead of bj_lastCreatedUnit) and you've got a leak
Code:
GetRandomSubGroup

Also, there's no need for a variable for GetEnumUnit (since you're only using it once anyway), and there's no need to null it since it's a single global

You could handle the preloading in the same trigger (just use a boolean constant to determine whether it's enabled or not), and there's no need to preload the caster/targets (since that probably won't be applicable in the map that's importing the spell). You could really simply the preloading to
JASS:
call DestroyEffect (AddSpecialEffect ("Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 0, 0)) //Store that model file as a constant, so that people will be allowed to use a different projectile model and still allow for preloading
 

DrEvil

FCRI Associate!
Reaction score
111
Yea i just kind of re-read and figured out what he said lol

Im still learning so ive gotta ( trial n error ) some things .

" Like learning to walk , once you learn ( jass ) theres no going back to the old times , e.g. crawling ( gui )
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
JASS:
//Make us all private. We want to be private globals.
globals
    constant integer SpellID = 'AHtc'         //The rawcode of the spell you are using.
    constant integer DummyID = 'h000'         //The rawcode of the dummy unit.
    constant integer ExpirID = 'BTLF'         //The Expiration Timer Type. (DO NOT CHANGE)
    constant string BaseID = "thunderbolt"    //The order string of the dummy spell.
    constant integer Units = 25               //Number of added units hit per spell level.
    constant real Range = 300.00              //Range of the spell per level.
    unit temp_unit                            //Temperary Unit. (DO NOT CHANGE)
    location temp_point                       //Temperary Point. (DO NOT CHANGE)
    group temp_group                          //Temperary Unit Group. (DO NOT CHANGE)
endglobals
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Don't expect a non-cliche or a professional spell because this is really the first vJass spell i've posted.

I'd expect there?
 

Tyman2007

Ya Rly >.
Reaction score
74
Technically yes. Making spells does pay if you work for something like blizzard in making spells.
 

DrEvil

FCRI Associate!
Reaction score
111
Technically yes. Making spells does pay if you work for something like blizzard in making spells.

The ONLY place you would probably ever get paid for making spells on THEIR game .

Well who else will pay you to make spells , not for there own product ( even if you could make it like however )
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • 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 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