Log in

View Full Version : exori vis in lua file



jollebollen
12-08-2015, 09:58 PM
How to add a second spell to this script? If I make another line it doesn't work.


local Spells = {
{words = 'exori flam', hppc = 0, range = 3, mana = 20, list = {'necromancer', 'priestess', 'vampire', 'mummy', 'gravedigger', 'blood hand', 'stalker', 'shadow pupil', 'skeleton warrior', 'skeleton', 'skeleton warrior', 'pirate skeleton', 'pirate ghost', 'tarnished spirit', 'ghost', 'zombie', 'lich', 'death blob', 'vampire bride', 'vampire viscount', 'banshee'}
}

local PvPRadiusSafety = 3

function SafeRadius(radius)
for n, c in Creature.iPlayers() do
if c:DistanceFromSelf() < radius then
return true
end
end
end

BattleMessageProxy.OnReceive('shooter', function(proxy, message)
local givendmg = string.match(message, "(.+) due to your attack.")
if (givendmg) then
local id = Self.TargetID()
if (id ~= 0) then
local mp = Self.Mana()
local c = Creature.New(id)
for i = 1, #Spells do
if table.contains(Spells[i].list, c:Name():lower()) then
if Self.CanCastSpell(Spells[i].words) and mp > Spells[i].mana and c:HealthPercent() >= Spells[i].hppc then
local isUnsafe = SafeRadius(PvPRadiusSafety)
if not (isUnsafe) and c:DistanceFromSelf() <= Spells[i].range then
if c:isTarget() then
Self.Cast(Spells[i].words, Spells[i].mana)
end
end
break
end
end
end
end
end
end)

jollebollen
12-09-2015, 12:41 AM
to make it easier:

local Spells = {
{words = 'exori vis', hppc = 0, range = 3, mana = 20, list = {'water elemental', 'quara hydromancer scout'}}
}

local PvPRadiusSafety = 3

function SafeRadius(radius)
for n, c in Creature.iPlayers() do
if c:DistanceFromSelf() < radius then
return true
end
end
end

BattleMessageProxy.OnReceive('shooter', function(proxy, message)
local givendmg = string.match(message, "(.+) due to your attack.")
if (givendmg) then
local id = Self.TargetID()
if (id ~= 0) then
local mp = Self.Mana()
local c = Creature.New(id)
for i = 1, #Spells do
if table.contains(Spells[i].list, c:Name():lower()) then
if Self.CanCastSpell(Spells[i].words) and mp > Spells[i].mana and c:HealthPercent() >= Spells[i].hppc then
local isUnsafe = SafeRadius(PvPRadiusSafety)
if not (isUnsafe) and c:DistanceFromSelf() <= Spells[i].range then
if c:isTarget() then
Self.Cast(Spells[i].words, Spells[i].mana)
end
end
break
end
end
end
end
end
end)

jollebollen
12-10-2015, 10:18 PM
nobody knows how to add more than 1 spell in this script? =p =)

jollebollen
12-12-2015, 03:11 AM
praying for someone to help me :D it's such a safe exori vis script just need to have another spell in it xD

jollebollen
12-13-2015, 04:46 AM
did all scripters leave xeno or what 0.0 :p

globalcheater
12-13-2015, 09:31 AM
did all scripters leave xeno or what 0.0 :p

no but i seems to be very lazy man which all problems send into help thread while u could use learn some basics.

jollebollen
12-13-2015, 09:35 AM
When adding another spell the table would become this for example:

local Spells = {
{words = 'exori flam', hppc = 0, range = 3, mana = 20, list = {'necromancer', 'priestess', 'vampire', 'mummy', 'gravedigger', 'blood hand', 'stalker', 'shadow pupil', 'skeleton warrior', 'skeleton', 'skeleton warrior', 'pirate skeleton', 'pirate ghost', 'tarnished spirit', 'ghost', 'zombie', 'lich', 'death blob', 'vampire bride', 'vampire viscount', 'banshee'},
{words = 'exori vis', hppc = 0, range = 3, mana = 20, list = {'frost dragon', 'frost dragon hatchling'}
}
I have not tested it but from reading the code this should work just fine.

thanks i will try it, thank you so much man ive been sarching for days but all scripts lua were deleted it seems from xenoforums :/

jollebollen
12-13-2015, 09:43 AM
When adding another spell the table would become this for example:

local Spells = {
{words = 'exori flam', hppc = 0, range = 3, mana = 20, list = {'necromancer', 'priestess', 'vampire', 'mummy', 'gravedigger', 'blood hand', 'stalker', 'shadow pupil', 'skeleton warrior', 'skeleton', 'skeleton warrior', 'pirate skeleton', 'pirate ghost', 'tarnished spirit', 'ghost', 'zombie', 'lich', 'death blob', 'vampire bride', 'vampire viscount', 'banshee'},
{words = 'exori vis', hppc = 0, range = 3, mana = 20, list = {'frost dragon', 'frost dragon hatchling'}
}
I have not tested it but from reading the code this should work just fine.



Hey it didn't work, I got this error:

10:42 XenoScript Error:
Line #: 6
Error: '}' expected (to close '{' at line 2) near 'local'
This is an error with user-input and should not be reported as a bug with XenoBot.

i copy the important text ^

Thanks in advance, I appreciate it very much

jollebollen
12-14-2015, 11:26 AM
Sorry my fault jollebollen.

local Spells = {
{words = 'exori flam', hppc = 0, range = 3, mana = 20, list = {'necromancer', 'priestess', 'vampire', 'mummy', 'gravedigger', 'blood hand', 'stalker', 'shadow pupil', 'skeleton warrior', 'skeleton', 'skeleton warrior', 'pirate skeleton', 'pirate ghost', 'tarnished spirit', 'ghost', 'zombie', 'lich', 'death blob', 'vampire bride', 'vampire viscount', 'banshee'}},
{words = 'exori vis', hppc = 0, range = 3, mana = 20, list = {'frost dragon', 'frost dragon hatchling'}}
}

Thank you I will try it later! THANKS!!!!!!!