• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Naruto RasenShuriken Jass

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: 1 person
globals
hashtable hash = InitHashtable()
constant integer AbilityID = 'A000'

constant integer DummyOne = 'h000' // effect model

constant integer DummyTwo = 'h001' // rasen shuriken

constant integer DummyThree = 'h002' // Naruto clones

constant integer DummyFour = 'h003' // effect model2

constant integer DummyFive = 'h004' // effect model3

constant integer RasenSpeed = 45

constant integer RasenSlideRaidus = 250 // rasengan Raidus

constant real RasenDamage = 10 // base damage

constant real RasenDamageLvl = 5 // damage lvl

constant real RasenDamageRadius = 520.

constant real RasenSlideDur = 0.80

constant real RasenDamageDur = 3.00

constant real RaidusKillThree = 180.

constant boolean ThreesKill = true

constant boolean ThreeOnly = true

constant string RasenSlideEffect = "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"

constant integer ThreeKillerDummyId= 'u000'

unit Dummy//
endglobals
function KillTrees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction

function UnitCheck takes unit caster, unit u returns boolean
return IsUnitEnemy(u, GetOwningPlayer(caster)) and not (IsUnitType(u, UNIT_TYPE_DEAD) and GetUnitTypeId(u) != 0) and IsUnitType(u, UNIT_TYPE_GROUND) and not IsUnitType(u, UNIT_TYPE_STRUCTURE)
endfunction

function Check_trees takes nothing returns boolean
local destructable dest = GetFilterDestructable()
local boolean result = false
if GetDestructableLife(dest) > 0.405 then
call ShowUnit(Dummy,true)
call SetUnitX(Dummy,GetWidgetX(dest))
call SetUnitY(Dummy,GetWidgetY(dest))
set result = IssueTargetOrder(Dummy,"harvest",dest)
call IssueImmediateOrder(Dummy,"stop")
call ShowUnit(Dummy,false)
set dest = null
return result
endif
set dest = null
return result
endfunction

function PS_KillTrees takes real x, real y, real radius returns nothing
local rect r=Rect(x-radius,y-radius,x+radius,y+radius)
if ThreeOnly then
call EnumDestructablesInRect(r,function Check_trees,function KillTrees)
else
call EnumDestructablesInRect(r,null,function KillTrees)
endif
call RemoveRect(r)
set r=null
endfunction
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// StartSpell
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function Shuriken_Act2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit a = LoadUnitHandle(hash,GetHandleId(t),50)
local unit b = LoadUnitHandle(hash,GetHandleId(t),51)
local group g = CreateGroup()
local unit n
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),DummyFour,GetUnitX(b),GetUnitY(b),0),'BTLF',2)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),DummyFive,GetUnitX(b),GetUnitY(b),0),'BTLF',2)
call GroupEnumUnitsInRange(g,GetUnitX(b),GetUnitY(b),RasenDamageRadius,null)
loop
set n = FirstOfGroup(g)
exitwhen n == null
if UnitCheck(a, n) then
call UnitDamageTarget(a,n,RasenDamage+RasenDamageLvl*I2R(GetUnitAbilityLevel(a,AbilityID)),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
endif
call GroupRemoveUnit(g,n)
endloop
call DestroyGroup(g)
set t = null
set a = null
set b = null
set g = null
set n = null
endfunction

function Shuriken_Act takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit a = LoadUnitHandle(hash,GetHandleId(t),50)
local unit b = LoadUnitHandle(hash,GetHandleId(t),51)
local group g = CreateGroup()
local unit n
local real x =GetUnitX(b)+RasenSpeed*Cos(GetUnitFacing(b)*0.0174)
local real y =GetUnitY(b)+RasenSpeed*Sin(GetUnitFacing(b)*0.0174)
if ThreesKill then
call PS_KillTrees(x,y,RaidusKillThree)
endif
call GroupEnumUnitsInRange(g,GetUnitX(b),GetUnitY(b),RasenSlideRaidus,null)
loop
set n = FirstOfGroup(g)
exitwhen n == null
if IsUnitEnemy(n,GetOwningPlayer(a)) == true and UnitCheck(a, n) then
call SetUnitX(n,GetUnitX(b))
call SetUnitY(n,GetUnitY(b))
endif
call GroupRemoveUnit(g,n)
endloop
call DestroyGroup((g))
if IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) == false then
call SetUnitX(b, x)
call SetUnitY(b, y)
endif
call DestroyEffect(AddSpecialEffect(RasenSlideEffect,GetUnitX(b),GetUnitY(b)))
set t = null
set a = null
set b = null
set g = null
set n = null
endfunction

function Trig_RasenShuriken_Actions takes nothing returns nothing
local unit array v
local unit b
local effect e5
local timer t
local integer j = 1
local unit a = GetTriggerUnit()
local player p = GetOwningPlayer(a)
local real d = bj_RADTODEG * Atan2(GetSpellTargetY() - GetUnitY(a),GetSpellTargetX() - GetUnitX(a))
local unit k1 = CreateUnit(p,DummyThree,GetUnitX(a)+100*Cos(bj_DEGTORAD*(d-70)),GetUnitY(a)+100*Sin(bj_DEGTORAD*(d-70)),d+70)
local unit k2 = CreateUnit(p,DummyThree,GetUnitX(a)+100*Cos(bj_DEGTORAD*(d+50)),GetUnitY(a)+100*Sin(bj_DEGTORAD*(d+50)),d-70)
call PauseUnit(a,true)
call SetUnitInvulnerable( a , true )
call SetUnitAnimation(a,"spell channel two")
call SetUnitAnimation(k1,"spell one")
call SetUnitAnimation(k2,"spell three")
call DestroyEffect((AddSpecialEffect("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",GetUnitX(k1),GetUnitY(k1))))
call DestroyEffect((AddSpecialEffect("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",GetUnitX(k2),GetUnitY(k2))))
call PolledWait(0.10)
set e5 = AddSpecialEffectTarget("NewRasenshuriken.mdx",a,"hand rigth")
call PolledWait(0.50)
call SetUnitAnimation(a,"spell chanell five")
call DestroyEffect((AddSpecialEffect("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",GetUnitX(k1),GetUnitY(k1))))
call DestroyEffect((AddSpecialEffect("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",GetUnitX(k2),GetUnitY(k2))))
call RemoveUnit(k1)
call RemoveUnit(k2)
call TriggerSleepAction(0.60)
call SetUnitAnimation(a,"spell three")
call PolledWait(0.30)
call PauseUnit(a,false)
call SetUnitInvulnerable( a , false )
call DestroyEffect(e5)
set b = CreateUnit(p,DummyTwo,GetUnitX(a),GetUnitY(a),d)
set t = CreateTimer()
call SaveUnitHandle(hash,GetHandleId(t),50,a)
call SaveUnitHandle(hash,GetHandleId(t),51,b)
call TimerStart(t,0.03125,true, function Shuriken_Act)
call PolledWait(RasenSlideDur)
call PauseTimer(t)
call TimerStart(t,0.08,true, function Shuriken_Act2)
loop
exitwhen j < 8
set v[j] = CreateUnit(p,DummyOne,GetUnitX(b),GetUnitY(b),j*45)
set j = j + 1
endloop
call PolledWait(RasenDamageDur)
call RemoveUnit(b)
call PauseTimer(t)
call FlushChildHashtable(hash,GetHandleId(t))
call DestroyTimer(t)
loop
exitwhen j < 16
call RemoveUnit(v[j])
set v[j] = null
set j = j + 1
endloop
set a = null
set b = null
set e5 = null
set k1 = null
set k2 = null
set p = null
set t = null
endfunction

function Trig_RasenShuriken_Conditions takes nothing returns boolean
return GetSpellAbilityId() == AbilityID
endfunction
//===========================================================================
function InitTrig_RasenShuriken takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_RasenShuriken_Conditions ) )
call TriggerAddAction( t, function Trig_RasenShuriken_Actions )
set Dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),ThreeKillerDummyId,0.00,0.00,0.00)
call SetUnitPathing(Dummy,false)
call ShowUnit(Dummy,false)
call UnitAddAbility(Dummy,'Ahrl')
call UnitAddAbility(Dummy,'Aloc')
set t = null
endfunction
Contents

Naruto RasenShuriken Jass upload (Map)

I've honestly no idea what you're saying - lagless code doesn't automatically make it approvable - since it may still leak, be poorly constructed or otherwise break the submission rules, you don't need a creep respawn trigger or anything like that for a submission. As I said in my original post I listed the things that need to be fixed to get these spells into an approvable state
 
The only criticisms levied by my original notes which doesn't apply to this one are not to use terrain deformation (as it doesn't use any) and to have optional texttags (as this doesn't use any)
The remaining 10 criticisms all still apply in addition to inefficiently creating and destroying units
local unit v1 through b8 could all be created through a small loop and have all their things dealt with in said small loop - indeed you only need 1 local unit variable and not 8 anyway
Your kill trees function will also destroy things like bridges which it should not do, it should filter out trees vs other destructible objects (and should also be an option on whether or not the use wants trees destroyed. There are examples on how to do this around the site as well as some systems specifically for that purpose
 

Deleted member 219079

D

Deleted member 219079

соси мой большой член пидар ебаный, мамку твою негеры ебали.
Google translate said:
suck my big dick fucking fagot, nurse your Negeri fucked
D: Come on your spell was nice it fit the Naruto universe, why the hate man!!
 
Top