Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MageSkills = {}
- local RepModules = game.ReplicatedStorage.Modules
- local ServerModules = game.ServerStorage.Modules
- local Events = game.ReplicatedStorage.Events
- local CombatModule = require(RepModules.CombatModule)
- local InputModule = require(RepModules.InputModule)
- local DamageModule = require(ServerModules.DamageModule)
- local StatusModule = require(RepModules.StatusModule)
- local HitModule = require(ServerModules.HitReplicationModule)
- local Assets = game.ReplicatedStorage.ClassAssets.Mage
- local MiscFunctions = require(RepModules.MiscFunctions)
- local tweenservice = game:GetService("TweenService")
- --make sure to add stun to the player
- function lerp(a, b, c)
- return a + (b - a) * c
- end
- local function QuadraticBezier(p0,p1,p2,t)
- local a = p0:Lerp(p1, t)
- local b = p1:Lerp(p2, t)
- return a:Lerp(b, t)
- end
- local function TweenPos(part, pos, dur)
- local tweeninfo = TweenInfo.new(dur, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- local tweenProps = {
- Position = pos
- }
- local tween = tweenservice:Create(part, tweeninfo, tweenProps)
- tween:Play()
- end
- local function FlyTo(Part, endpos, target)
- local Ap = Instance.new("AlignPosition")
- Ap.MaxForce = 10000
- Ap.MaxVelocity = 100
- Ap.ApplyAtCenterOfMass = true
- --Ap.Responsiveness = 10
- if target ~= nil then
- Ap.Mode = Enum.PositionAlignmentMode.TwoAttachment
- local attach1 = Instance.new("Attachment", Part)
- local attach2 = Instance.new("Attachment", target)
- Ap.Attachment0 = attach1
- Ap.Attachment1 = attach2
- else
- Ap.Mode = Enum.PositionAlignmentMode.OneAttachment
- local attach1 = Instance.new("Attachment", Part)
- Ap.Attachment0 = attach1
- Ap.Position = endpos
- end
- Part.Anchored = false
- Ap.Parent = Part
- --
- end
- function lookAt(target, eye)
- local forwardVector = (eye - target).Unit
- local upVector = Vector3.new(0, 1, 0)
- -- You have to remember the right hand rule or google search to get this right
- local rightVector = forwardVector:Cross(upVector)
- local upVector2 = rightVector:Cross(forwardVector)
- return CFrame.fromMatrix(eye, rightVector, upVector2)
- end
- function mageBolt(plr, boltargs)
- local bolt = Assets.MageBolt:Clone()
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local destroyed = false
- bolt.Parent = char.ClassItems
- bolt.CFrame = boltargs.StartCFrame
- task.wait(.1)
- local ClientTable = {}
- ClientTable.Character = char
- ClientTable.Effect = "Mage Bolts"
- ClientTable.Class = "Mage"
- ClientTable.EnemyChar = nil
- Events.ClientEvent:FireAllClients("Effect", ClientTable)
- MiscFunctions.TweenTransparency(bolt, 0, .2)
- MiscFunctions.TweenTransparency(bolt.MeshPart, 0, .2)
- bolt.CFrame = boltargs.StartCFrame
- local Args = {}
- Args.Character = char
- Args.Part = bolt
- Args.Speed = boltargs.BoltSpeed
- Args.MaxDist = boltargs.MaxDistance
- Args.Direction = boltargs.Direction
- Args.Endpos = boltargs.Endpos
- local hitbox = HitModule.CreateRayProjectile(Args)
- task.delay(0.3, function()
- if destroyed ~= true then
- destroyed = true
- local Effect = Instance.new("StringValue", bolt)
- Effect.Name = "Effect"
- MiscFunctions.TweenTransparency(bolt, 1, .2)
- MiscFunctions.TweenTransparency(bolt.MeshPart, 1, .2)
- game.Debris:AddItem(bolt, 0.3)
- end
- end)
- hitbox.Event:Connect(function(rayResult)
- local hit = rayResult.Instance
- if hit == nil then return end
- if hit.Name == "MageBolt" then return end
- local echar = hit.Parent or hit.Parent.Parent
- bolt.Position = rayResult.Position
- destroyed = true
- if echar:FindFirstChild("Humanoid") then
- local damagedata = {
- Blockbreak = false,
- Knockback = false,
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- DamageModule.Damage(char, echar, boltargs.Damage, damagedata)
- end
- local Effect = Instance.new("StringValue", bolt)
- Effect.Name = "Effect"
- hitbox:Destroy()
- MiscFunctions.TweenTransparency(bolt, 1, .2)
- MiscFunctions.TweenTransparency(bolt.MeshPart, 1, .2)
- bolt.Position = rayResult.Position
- game.Debris:AddItem(bolt, 0.5)
- end)
- return bolt
- end
- MageSkills["LightAttack"] = function(plr, InputTable)
- local damagedata = {
- Blockbreak = false,
- Knockback = false,
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "LightATK", false) == "OnCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local destroyed = false
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.Duration = .7
- statusInfo.StatusValue = 5
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "LightATK", true, 1.6)
- task.wait(.1)
- local BoltArgs = {}
- BoltArgs.BoltSpeed = 1
- BoltArgs.Damage = 4
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(0,0,-0.3)
- BoltArgs.MaxDistance = 12
- BoltArgs.Direction = Hrm.CFrame.lookVector
- mageBolt(plr, BoltArgs)
- end
- MageSkills["MediumAttack"] = function(plr, InputTable)
- local damagedata = {
- Blockbreak = false,
- Knockback = false,
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "MediumATK", false) == "OnCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local destroyed = false
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.Duration = 1
- statusInfo.StatusValue = 5
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "MediumATK", true, 2)
- local endpos = (Hrm.CFrame * CFrame.new(0,0,-15)).Position
- task.wait(0.2)
- local BoltArgs = {}
- BoltArgs.BoltSpeed = 1
- BoltArgs.Damage = 4
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(-3,3,0)
- BoltArgs.MaxDistance = 15
- BoltArgs.Direction = (endpos - BoltArgs.StartCFrame.Position).Unit
- BoltArgs.Endpos = endpos
- mageBolt(plr, BoltArgs)
- task.wait(.2)
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(3,3,0)
- BoltArgs.Direction = (endpos - BoltArgs.StartCFrame.Position).Unit
- mageBolt(plr, BoltArgs)
- end
- MageSkills["HeavyAttack"] = function(plr, InputTable)
- if CombatModule.Cooldowns(plr, "HeavyATK", false) == "OnCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local destroyed = false
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.Duration = 2
- statusInfo.StatusValue = 5
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "HeavyATK", true, 3)
- local endpos = (Hrm.CFrame * CFrame.new(0,0,-18)).Position
- local dashargs = {}
- dashargs.MaxForce = math.huge
- dashargs.Vector = -Hrm.CFrame.lookVector
- dashargs.Speed = 30
- dashargs.Duration = .2
- MiscFunctions.LinearProjectile(Hrm, dashargs)
- task.wait(0.5)
- local BoltArgs = {}
- BoltArgs.BoltSpeed = 1
- BoltArgs.Damage = 4
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(-1,-.5,-0.3)
- BoltArgs.MaxDistance = 18
- BoltArgs.Direction = Hrm.CFrame.lookVector
- BoltArgs.Endpos = endpos
- mageBolt(plr, BoltArgs)
- task.wait(.1)
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(1,-.5,-0.3)
- mageBolt(plr, BoltArgs)
- task.wait(.1)
- BoltArgs.StartCFrame = Hrm.CFrame * CFrame.new(0,1,-0.3)
- mageBolt(plr, BoltArgs)
- end
- MageSkills["Flame Bolts"] = function(plr, InputTable)
- --make sure to damage and consistent movement and also tracking
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local hyperArmor = false
- local cancelled = false
- local target = nil
- local damagedata = {
- Blockbreak = false,
- Knockback = false,
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "Mage_FlameBolts", false) == "OnCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.Duration = 1.5
- statusInfo.StatusValue = 5
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "Mage_FlameBolts", true, 5)
- local ClientTable = {}
- ClientTable.Character = char
- ClientTable.Effect = "Flame Bolts"
- ClientTable.Class = "Mage"
- ClientTable.EnemyChar = nil
- Events.ClientEvent:FireAllClients("Effect", ClientTable)
- local anim = CombatModule.LoadAnimation(Assets.Animations.FireBall, plr)
- anim:Play()
- local mouseTargets = HitModule.CheckForPlayersNearPos(InputTable.MousePos, {char})
- if #mouseTargets > 0 then
- target = mouseTargets[1].HumanoidRootPart
- end
- local stunnedEvent = StatusModule.StatusAdded(char, {"Stunned"})
- stunnedEvent.Event:Connect(function(AddedStatus)
- if hyperArmor == true then return end
- cancelled = true
- end)
- task.wait(.8)
- if cancelled == true then return end
- hyperArmor = true
- anim:AdjustSpeed(1)
- for i=1, 3 do
- local Bolt = game.ReplicatedStorage.ClassAssets.Mage.Skills.Effects.SmallFireball:Clone()
- local bp = Instance.new("BodyPosition", Bolt)
- bp.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- local OrbPos = {
- CFrame.new(-12, 0, 7),
- CFrame.new(12, 0, 7),
- CFrame.new(0, 7, 7),
- }
- Bolt.CFrame = Hrm.CFrame-- + OrbPos[1]
- local endpos = InputTable.MousePos.p
- Bolt.Name = "FlameBolt"--..tostring(i)
- Bolt.Parent = char.ClassItems
- bp.Position = (Hrm.CFrame * OrbPos[i]).p
- task.wait(.5)
- bp:Destroy()
- Bolt.Anchored = true
- local Args = {}
- Args.Character = char
- Args.Part = Bolt
- Args.Speed = .9
- Args.MaxDist = 100
- Args.Direction = Bolt.CFrame.LookVector
- Args.Endpos = endpos
- Args.Target = target
- local hitbox = HitModule.CreateRayProjectile(Args)
- hitbox.Event:Connect(function(rayResult)
- local hit = rayResult.Instance
- if hit.Name == "FlameBolt" then return end
- print(hit.Name)
- --if hit.Name == "Baseplate" then return end
- Bolt.Anchored = true
- local Effect = Instance.new("StringValue", Bolt)
- Effect.Name = "Effect"
- local HitPlrs = HitModule.CreateHitbox(Bolt.CFrame, Vector3.new(6,6,6), {char})
- for i, echar in pairs(HitPlrs) do
- DamageModule.Damage(char, echar, 10, damagedata)
- hitbox:Destroy()
- end
- task.delay(0.5, function()
- Bolt:Destroy()
- end)
- end)
- game:GetService("Debris"):AddItem(Bolt,7)
- task.wait(.03)
- end
- end
- MageSkills["Thunder Spear"] = function(plr, InputTable)
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local hyperArmor = false
- local cancelled = false
- local damagedata = {
- Blockbreak = true,
- Knockback = false,
- Stuntime = 1.5,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "Mage_ThunderSpear", false) ~= "OffCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.Duration = 2.5
- statusInfo.StatusValue = 0
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "Mage_ThunderSpear", true, 5)
- local hitboxEvent
- local target
- local Hitbox = Assets.Skills.Effects.ThunderSpearPart:Clone()
- Hitbox.Parent = char.ClassItems
- Hitbox.CFrame = Hrm.CFrame * CFrame.new(5, 1.5, 0)
- Hitbox.Anchored = true
- Hitbox.CFrame = CFrame.lookAt(Hitbox.Position, InputTable.MousePos.Position)
- local ClientTable = {}
- ClientTable.Character = char
- ClientTable.Effect = "Thunder Spear"
- ClientTable.Class = "Mage"
- ClientTable.EffectPart = Hitbox.ThunderSpear
- ClientTable.EnemyChar = nil
- ClientTable.Animation = Assets.Animations.ThunderSpear
- Events.ClientEvent:FireAllClients("Effect", ClientTable)
- local stunnedEvent = StatusModule.StatusAdded(char, {"Stunned"}, 5, "ThunderSpear")
- stunnedEvent.Event:Connect(function(AddedStatus)
- if hyperArmor == true then return end
- StatusModule.DeleteStatus(char, "Attacking")
- cancelled = true
- end)
- task.wait(1.5)
- if cancelled == true then
- Hitbox:Destroy()
- return
- end
- hyperArmor = true
- local MousePos = InputModule.GetMousePos(plr)
- local mouseTargets = HitModule.CheckForPlayersNearPos(MousePos, {char})
- local Args = {}
- Args.Character = char
- Args.Part = Hitbox
- Args.Speed = 2
- Args.MaxDist = 300
- if #mouseTargets > 0 then
- target = mouseTargets[1].HumanoidRootPart
- Args.Direction = (target.Position - Args.Part.Position).Unit
- Args.Endpos = target.Position
- else
- Args.Direction = (MousePos.Position - Args.Part.Position).Unit
- Args.Endpos = MousePos.Position
- end
- local hitbox = HitModule.CreateRayProjectile(Args, true)
- hitbox.Event:Connect(function(rayResult)
- if rayResult == "Finished" then
- Hitbox.Anchored = true
- local Effect = Instance.new("StringValue", Hitbox)
- Effect.Name = "Effect"
- Effect.Value = "Part"
- hitbox:Destroy()
- game.Debris:AddItem(Hitbox, 2)
- return
- end
- local hit = rayResult.Instance
- if hit.Parent == char then return end
- if hit.Parent:FindFirstChild("Humanoid") then -- make sure to add some checks to make sure the enemy isnt blocking
- task.wait(0.3)
- print("we hit something")
- local Values = DamageModule.Damage(char, hit.Parent, 15, damagedata)
- if Values.Damaged == true then
- delay(1.5, function()
- DamageModule.Damage(char, hit.Parent, 10, damagedata)
- end)
- local eHRM = hit.Parent:FindFirstChild("HumanoidRootPart")
- Hitbox.Position = eHRM.Position
- Hitbox.Anchored = true
- local Effect = Instance.new("StringValue", Hitbox)
- Effect.Name = "Effect"
- Effect.Value = "Person"
- hitbox:Destroy()
- game.Debris:AddItem(Hitbox, 2)
- else
- Hitbox.Anchored = true
- local Effect = Instance.new("StringValue", Hitbox)
- Effect.Name = "Effect"
- Effect.Value = "Part"
- hitbox:Destroy()
- game.Debris:AddItem(Hitbox, 2)
- end
- return
- else
- Hitbox.Anchored = true
- local Effect = Instance.new("StringValue", Hitbox)
- Effect.Name = "Effect"
- Effect.Value = "Part"
- hitbox:Destroy()
- game.Debris:AddItem(Hitbox, 2)
- return
- end
- end)
- game.Debris:AddItem(Hitbox, 10)
- end
- MageSkills["Freezing Winds"] = function(plr, InputTable)
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local hyperArmor = false
- local cancelled = false
- local damagedata = {
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "Mage_FreezingWinds", false) ~= "OffCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.StatusValue = 5
- statusInfo.Duration = 6.5
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "Mage_FreezingWinds", true, 20)
- local stunnedEvent = StatusModule.StatusAdded(char, {"Stunned"}, 5)
- stunnedEvent.Event:Connect(function(AddedStatus)
- if hyperArmor == true then return end
- StatusModule.DeleteStatus(char, "Attacking")
- cancelled = true
- end)
- task.wait(1)
- if cancelled == true then
- return
- end
- hyperArmor = true
- local Hitbox = Assets.Skills.Effects.FreezingWinds:Clone()
- Hitbox:SetPrimaryPartCFrame(Hrm.CFrame * CFrame.new(0,0.5, -2))
- local weld = Instance.new("WeldConstraint", Hrm)
- weld.Part0 = weld.Parent
- weld.Part1 = Hitbox.PrimaryPart
- Hitbox.Parent = char.ClassItems
- local ClientTable = {}
- ClientTable.Character = char
- ClientTable.Effect = "Freezing Winds"
- ClientTable.Class = "Mage"
- ClientTable.EnemyChar = nil
- ClientTable.EffectPart = Hitbox
- ClientTable.EffectValue = 5
- Events.ClientEvent:FireAllClients("Effect", ClientTable)
- local ZoneArgs = {}
- ZoneArgs.Container = Hitbox
- ZoneArgs.Duration = 5
- local ignoreList = {char}
- local PlayersInZone, ZoneEvent = HitModule.CreateZoneHitbox(ZoneArgs, ignoreList)
- ZoneEvent.Event:Connect(function(model, Func)
- if Func == "Entered" then
- table.insert(PlayersInZone, model)
- elseif Func == "Exited" then
- local pos = table.find(PlayersInZone, model)
- if pos then
- table.remove(PlayersInZone, pos)
- end
- end
- end)
- local function DamageCheck(damage)
- for i, echar in pairs(PlayersInZone) do
- local Values = DamageModule.Damage(char, echar, damage, damagedata)
- end
- end
- DamageModule.DamageOverTime(DamageCheck, 20, 5, 0.2)
- game.Debris:AddItem(Hitbox, 7)
- end
- MageSkills["Gaia's Protection"] = function(plr, InputTable)
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local hyperArmor = false
- local cancelled = false
- if CombatModule.Cooldowns(plr, "Mage_GaiaProtection", false) ~= "OffCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.StatusValue = 1
- statusInfo.Duration = 2
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "Mage_GaiaProtection", true, 40)
- local stunnedEvent = StatusModule.StatusAdded(char, {"Stunned"}, 5)
- stunnedEvent.Event:Connect(function(AddedStatus)
- if hyperArmor == true then return end
- StatusModule.DeleteStatus(char, "Attacking")
- cancelled = true
- end)
- task.wait(1)
- if cancelled == true then
- return
- end
- hyperArmor = true
- local OldPos = {}
- local Pillars = script.RockWall:Clone()
- Pillars:SetPrimaryPartCFrame(Hrm.CFrame * CFrame.new(0,5,-18))
- for i, pillar in pairs(Pillars:GetChildren()) do
- OldPos[pillar.Name] = pillar.Position
- pillar.CFrame = pillar.CFrame * CFrame.new(0,-pillar.Size.Y, 0)
- end
- Pillars.Parent = workspace.ServerStuff
- local main = Pillars.RockPillarMain
- TweenPos(Pillars.RockPillarMain, OldPos[main.Name], .1)
- task.wait(.2)
- for i=1, 11 do
- local pillar = Pillars:FindFirstChild("RockPillar"..tostring(i))
- TweenPos(pillar, OldPos[pillar.Name], .2)
- task.wait(.2)
- end
- task.delay(8, function()
- for i, pillar in pairs(Pillars:GetChildren()) do
- TweenPos(pillar, (pillar.CFrame * CFrame.new(0,-pillar.Size.Y, 0)).Position, 1)
- game.Debris:AddItem(Pillars, 3)
- end
- end)
- end
- MageSkills["Mana Bomb"] = function(plr, InputTable)
- local char = plr.Character
- local Hrm = char.HumanoidRootPart
- local orb = char.Orb
- local damageChecked = false
- local damagedata = {
- Stun = true,
- Stuntime = game.ReplicatedStorage.GlobalValues.Hitstun.Value,
- KnockbackType = "Ground"
- }
- if CombatModule.Cooldowns(plr, "Mage_ManaBomb", false) ~= "OffCooldown" then return end
- if not StatusModule.CanAttack(plr.Character) then return end
- local statusInfo = {}
- statusInfo.Character = ""
- statusInfo.StatusName = "Attacking"
- statusInfo.DeleteCopy = false
- statusInfo.StatusValue = 0
- statusInfo.Duration = 7
- StatusModule.AddStatus(char, statusInfo)
- CombatModule.Cooldowns(plr, "Mage_ManaBomb", true, 30)
- local flyArgs = {}
- flyArgs.Responsiveness = 10
- flyArgs.Endpos = (Hrm.CFrame * CFrame.new(0, 20, 0)).Position
- flyArgs.Duration = 6
- local ap = MiscFunctions.TrackingProjectile(Hrm, flyArgs)
- task.wait(1)
- local ClientTable = {}
- ClientTable.Character = char
- ClientTable.Effect = "Mana Bomb"
- ClientTable.Class = "Mage"
- ClientTable.EnemyChar = nil
- ClientTable.EffectValue = 0
- Events.ClientEvent:FireAllClients("Effect", ClientTable)
- task.wait(3.5)
- local MainProjectile = Assets.Skills.Effects.SmallManaBomb:Clone()
- MainProjectile.CFrame = Hrm.CFrame * CFrame.new(0,6,0)
- MainProjectile.Parent = char.ClassItems
- local MousePos = InputModule.GetMousePos(plr)
- task.wait(1)
- local Args = {}
- Args.Character = char
- Args.Part = MainProjectile
- Args.Speed = 1.5
- Args.MaxDist = 300
- Args.Direction = (MousePos.Position - MainProjectile.Position).Unit
- Args.Endpos = MousePos.Position
- local hitbox = HitModule.CreateRayProjectile(Args, true)
- hitbox.Event:Connect(function(rayResult)
- local hit = rayResult.Instance
- task.wait(0.2)
- local Effect = Instance.new("StringValue", MainProjectile)
- Effect.Name = "Effect"
- task.delay(1, function()
- MainProjectile:Destroy()
- end)
- task.wait(0.7)
- local explosion = Assets.Skills.Effects.ManaBombExplosion:Clone()
- explosion.CFrame = MainProjectile.CFrame
- explosion.Parent = char.ClassItems
- local size = Vector3.new(30,30,30)
- MiscFunctions.TweenSize(explosion, size, .2)
- local ZoneArgs = {}
- ZoneArgs.Container = explosion
- ZoneArgs.Duration = 5
- local ignoreList = {char}
- local PlayersInZone, ZoneEvent = HitModule.CreateZoneHitbox(ZoneArgs, ignoreList)
- ZoneEvent.Event:Connect(function(model, Func)
- if Func == "Entered" then
- table.insert(PlayersInZone, model)
- elseif Func == "Exited" then
- local pos = table.find(PlayersInZone, model)
- if pos then
- table.remove(PlayersInZone, pos)
- end
- end
- end)
- local function DamageCheck(damage)
- for i, echar in pairs(PlayersInZone) do
- local Values = DamageModule.Damage(char, echar, damage, damagedata)
- end
- end
- if damageChecked == false then
- damageChecked = true
- DamageModule.DamageOverTime(DamageCheck, 40, 5, 0.2)
- end
- task.wait(0.3)
- task.delay(5, function()
- explosion.Transparency = 1
- game.Debris:AddItem(explosion, 4)
- end)
- for i=1, 5 do
- local size = explosion.Size + Vector3.new(2,2,2)
- MiscFunctions.TweenSize(explosion, size, 1, Enum.EasingStyle.Bounce)
- task.wait(1)
- end
- end)
- end
- return MageSkills
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement