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
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:
EDIT: Added new map.
EDIT2: Forgot to remove temp_group 2
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
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 = 039;AHtc039; //The rawcode of the spell you are using.
private constant integer DummyID = 039;h000039; //The rawcode of the dummy unit.
private constant integer ExpirID = 039;BTLF039; //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