Jump to content

Area of effect weapon attack?


Recommended Posts

Is it possible to make a area of effect attack or spell? I want to make a item or weapon cast a spell that freezes every mob within a set area.

Also is it possible to add a lighting fx to a heal spell when used on another player?

Link to comment
Share on other sites

Yes, it is possible. Make your item (art etc), implement in game. Then ask for help to make it better. :-)

Heres the lua for the weapon, I can make it heal people but it doesnt show the lighting fx when cast, and Id like to add a area of effect freezing attack on it.

tanto.lua

Link to comment
Share on other sites

local function HealFunc(inst, target)	print(inst, target)	local caster = inst.components.inventoryitem.owner	caster = caster or target			if SanityCheck(caster) then		--target.components.health:DoDelta(25)		--AOE		local pt = target:GetPosition()		local range = 10		local must_tags = {"player"}		local players = TheSim:FindEntities(pt.x,pt.y,pt.z,range,must_tags)		--All players in range 10 near target		for _,v in ipairs(players) do 			if v.components.health and v.components.health.currenthealth > 0 then				v.components.health:DoDelta(25)			end		end	else		inst.components.talker:Say("Doge need much sanity.")	endend

  • Like 1
Link to comment
Share on other sites

I was going more for that when you right click on the weapon in the equip slot that it would cast freeze in a  area, and for just right clicking a mob/player that it would heal them 25hp and play the lightning fx, so like a primary heal and a secondary aoe freeze, which I dont get how to do.

 

 

local function HealFunc(inst, target)	print(inst, target)	local caster = inst.components.inventoryitem.owner	caster = caster or target			if SanityCheck(caster) then		--target.components.health:DoDelta(25)		--AOE		local pt = target:GetPosition()		local range = 10		local must_tags = {"player"}		local players = TheSim:FindEntities(pt.x,pt.y,pt.z,range,must_tags)		--All players in range 10 near target		for _,v in ipairs(players) do 			if v.components.health and v.components.health.currenthealth > 0 then				v.components.health:DoDelta(25)			end		end	else		inst.components.talker:Say("Doge need much sanity.")	endend

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...