Spell Scatter Shot

Carl-Fredrik

New Member
Reaction score
51
Pros:
Really cool spell
Usable in many games
Nice special effects

Cons:
Too long casting time
Damage is done before the explosion
Imballanced
 

Flare

Stops copies me!
Reaction score
662
Pros:
Really cool spell
Usable in many games
Nice special effects

Cons:
Too long casting time
Damage is done before the explosion
Imballanced

That's for the end-user to determine, since damage is changeable via the SS_DamagePerBall and, to an extent, SS_BallPerLevel, and casting time is changeable in Object Editor
 
W

War-Crafter

Guest
This is the trigger im using from your map but it isnt working. i have everything i was suppose to copy from your map but i think theres a problem with the trigger. Can you tell me what is wrong with it.

//@@@@@@@@@@@@@@@@@@@@@@@@ Implementation Instructions @@@@@@@@@@@@@@@@@@@@@@@@@@@@
//1) Copy this trigger.
//2) Copy the Ability "Scatter Shot" from the Object Editor.
//3) Copy the Ability "Kaboom - Energy Ball" from the Object Editor.
//4) Copy the Dummy unit "EnergyBall" from the Object Editor.
//5) Copy the sound from the sound editor
//6) Make sure to see if the variable name of the sound have changed and just simply change it's name to the name used here - ShootSound.
//7) Export the texture Green_Glow2 from the Import Manager to your computer and import it to the requested map.
//8) after you have imported the texture just change the path of the texture to "Textures\Green_Glow2.blp" and that's it.
//9) Make sure to check if the Raw Id of the ability "Scatter Shot" and the unit "EnergyBall" are the same as the constants.
//10) If you don't know how to check the Raw Id simply go to the object editor and press CTRL+D and you will see it right away.
//11) Check the constant functions if you wanna change things in the skills like Damage,Raw Id and etc'.
//12) ~Have Fun~ :p

//@@@@@@@@@@@@@@@@@@@@@@@@@@@ Constants Start Here @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

//Make sure the raw id of the ability "Scatter Shot" is the same as the one below if not change it.
constant function SS_AbilityId takes nothing returns integer
return 'A000'
endfunction

//Make sure the raw id of the dummy unit "EnergyBall" is the same as the one below if not change it.
constant function SS_DummyId takes nothing returns integer
return 'n000'
endfunction

//This Constant changes the damage per ball which is by default 40.00.
constant function SS_DamagePerBall takes nothing returns real
return 40.00
endfunction

//This Constant changes the number of balls per level which is by default 25 multiplied by the level of the skill.
constant function SS_BallPerLevel takes integer level returns integer
return 25*level
endfunction

//This is the sound variable name in case you wanna pick another name for it just do - gg_snd_<Your variable name> make sure your variable has the same name as well.
//
constant function SS_SoundVariable takes nothing returns sound
return gg_snd_ShootSound
endfunction
//@@@@@@@@@@@@@@@@@@@@@@@@@@@ Constants End Here @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//From this point on unless you know JASS i suggest not to touch anything.


function SS_Condition takes nothing returns boolean
return (GetSpellAbilityId()== SS_AbilityId())
endfunction



function SS_Actions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local real heroX = GetUnitX(hero)
local real heroY = GetUnitY(hero)
local unit target = GetSpellTargetUnit()
local real targetX = GetUnitX(target)
local real targetY = GetUnitY(target)
local real randomX
local real randomY
local real randomZ
local real ballX
local real ballY
local real dx
local real dy
local real distance
local real rate
local unit array ball
local real ms = GetUnitMoveSpeed(target)
local real height = GetUnitFlyHeight(target)
local sound shot = SS_SoundVariable()
local integer level = GetUnitAbilityLevel(hero,SS_AbilityId())
local integer i = 1
call SetUnitAnimation(hero,"stand")
call SetUnitMoveSpeed(target,0)
call SetUnitInvulnerable(hero,true)
call TriggerSleepAction(0.5)
call SetUnitTimeScale(hero,5)
call PauseUnit(hero,true)
loop
exitwhen(i>SS_BallPerLevel(level))
call StopSound(shot,false,false)
call SetUnitAnimation(hero,"attack 3")
call StartSound(shot)
set ball = CreateUnit(GetOwningPlayer(hero),SS_DummyId(),heroX,heroY,GetUnitFacing(hero))
set randomX = GetRandomReal(targetX-450,targetX+450)
loop
exitwhen(randomX >= targetX+150 or randomX <= targetX-150)
set randomX = GetRandomReal(targetX-450,targetX+450)
endloop
set randomY = GetRandomReal(targetY-450,targetY+450)
loop
exitwhen(randomY >= targetY+150 or randomY <= targetY-150)
set randomY = GetRandomReal(targetY-450,targetY+450)
endloop
call IssuePointOrder(ball,"move",randomX,randomY)
set ballX = GetUnitX(ball)
set ballY = GetUnitY(ball)
set dx = randomX-ballX
set dy = randomY-ballY
set distance = SquareRoot(dx*dx+dy*dy)
set randomZ = GetRandomReal(50,500)
set rate = randomZ/(distance/522)
call SetUnitFlyHeight(ball,randomZ,rate)
call TriggerSleepAction(-1)
set i = i+1
endloop
call TriggerSleepAction(2.5)
call SetUnitTimeScale(hero,1)
call SetUnitAnimation(hero,"spell")
set i = 1
loop
exitwhen (i>SS_BallPerLevel(level))
if(GetUnitState(target,UNIT_STATE_LIFE) <= 0.405) then
set i = SS_BallPerLevel(level)+1
else
set ballX = GetUnitX(ball)
set ballY = GetUnitY(ball)
set dx = targetX-ballX
set dy = targetY-ballY
set distance = SquareRoot(dx*dx+dy*dy)
set randomZ = GetUnitFlyHeight(ball)+50
set rate = randomZ/(distance/522)
call SetUnitFlyHeight(ball,height+50,rate)
call IssueTargetOrder(ball,"selfdestruct",target)
call TriggerSleepAction(-1)
call UnitDamageTarget(hero,target,SS_DamagePerBall(),true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
set i = i+1
endif
endloop
set i=1
call TriggerSleepAction(0)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",targetX,targetY))
call TriggerSleepAction(0.5)
loop
exitwhen (i>SS_BallPerLevel(level))
call KillUnit(ball)
set ball = null
set i = i+1
endloop
call TriggerSleepAction(0.5)
call PauseUnit(hero,false)
call SetUnitMoveSpeed(target,ms)
call SetUnitInvulnerable(hero,false)
set hero = null
set target = null
set shot = null
endfunction

//===========================================================================
function InitTrig_Scatter_Shot takes nothing returns nothing
set gg_trg_Scatter_Shot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Scatter_Shot,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(gg_trg_Scatter_Shot,Condition(function SS_Condition))
call TriggerAddAction( gg_trg_Scatter_Shot,function SS_Actions)
endfunction
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
sorry i wasn't here
could post me the errors u get?
and did u make sure to follow instructions?
 

guitar89

New Member
Reaction score
0
I kinda have some problem too, i copied the trigger, 'scatter shot', 'kaboom',
'energy ball' and sound. I correct the skill for energy ball from burrow(my custom skill) to kaboom, and the raw ID of 'energy ball', sound and 'scatter shot' into constant. But my skill got some buggy, my hero keep casting many times if the target didn't dies, no manacost and cooldown. I reimport follow those above and check manacost & cooldown on 'scatter shot'. Could you tell me my problem ? thank.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
pheraphs i paused it too quickly but i guess it shouldn't have been a problem if you haven't touched anything in the scatter shot ability (the channel based) make sure you haven't changed anything regarding time.

just to make sure i understood - the skill loops until no mana or targets right?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top