Page 2 of 2

Re: Magic Dead Zone

Posted: Tue Oct 30, 2012 12:11 am
by strangely
Oooh, thank you so much!

Re: Magic Dead Zone

Posted: Sun Jan 06, 2013 3:05 pm
by hyteria
hello ,

dont understand where i m suposed to put this

-- Add the onCastSpell hook and have it run a script called antimagic inside a Lua script entity called checkAntiMagic
cloneObject{
name = "party",
baseObject = "party",

onCastSpell = function(self, spell)
local returnValue = checkAntiMagic.antimagic()
return returnValue
end,
}

i made a party.lua to add it with an entry on init.lua who load it , create the antimagic zone object and add the script lua in game , but game crash when i cast a spell (

Re: Magic Dead Zone

Posted: Sun Jan 06, 2013 4:53 pm
by Komag
You can just add the cloneObject of the party in your objects.lua

Then in the editor you make a script entity called checkAntiMagic with a function called antimagic() and add whatever code in there you want to check for, such as the party being on a certain level, the party holding a certain item or not, etc, and have it return false whenever you want the party to not cast magic

Re: Magic Dead Zone

Posted: Sun Jan 06, 2013 5:01 pm
by hyteria
thx komag this work if i put

cloneObject{
name = "party",
baseObject = "party",

onCastSpell = function(self, spell)
local returnValue = checkAntiMagic.antimagic()
return returnValue
end,
}

in the object.lua and remove what i have done in a party.lua :)