Os pets (summons de lvl 200), estava, atacando os players que estão na party com as magias em areas, porem foi alterado o creature.lua nos events, apenas adicionados alguns comandos, ele parou de acertar os players na party com as spells em area porem gera um erro no console.
Erro:
Lua Script Error: [Event Interface]
data/events/scripts/creature.lua:Creature@onTargetCombat
data/global.lua:211: bad argument #1 to 'pairs' (table expected, got nil)
Linha de erro :
for _, targetColumn in pairs(array) do
Codigo adicionado no creature.lua em events:
Spoiler
if self:isPlayer() and target:isPlayer() then
local party, guild = self:getParty(), self:getGuild()
if party or guild then
local targetParty, targetGuild = target:getParty(), target:getGuild()
if targetParty and targetParty == party or targetGuild and targetGuild == guild then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
elseif self:isMonster() and target:isPlayer() then
local master = self:getMaster()
if master and master:isPlayer() then
local party, targetParty = target:getParty(), master:getParty()
if (party ~= nil and targetParty ~= nil) and party == targetParty then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
local guild, targetGuild = target:getGuild(), master:getGuild()
if (guild ~= nil and targetGuild ~= nil) and guild == targetGuild then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
if not isInArray(skullTypes, target:getSkull()) and not isInArray(skullTypes, master:getSkull()) then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
end
end
Codigo no global.lua:
Spoiler
table.contains = function(array, value)
for _, targetColumn in pairs(array) do
if targetColumn == value then
return true
end
end
return false
end
Base: TFS 1.3 Custom
Os pets (summons de lvl 200), estava, atacando os players que estão na party com as magias em areas, porem foi alterado o creature.lua nos events, apenas adicionados alguns comandos, ele parou de acertar os players na party com as spells em area porem gera um erro no console.
Erro:
Lua Script Error: [Event Interface] data/events/scripts/creature.lua:Creature@onTargetCombat data/global.lua:211: bad argument #1 to 'pairs' (table expected, got nil)
Linha de erro :
for _, targetColumn in pairs(array) do
Codigo adicionado no creature.lua em events:
if self:isPlayer() and target:isPlayer() then
local party, guild = self:getParty(), self:getGuild()
if party or guild then
local targetParty, targetGuild = target:getParty(), target:getGuild()
if targetParty and targetParty == party or targetGuild and targetGuild == guild then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
elseif self:isMonster() and target:isPlayer() then
local master = self:getMaster()
if master and master:isPlayer() then
local party, targetParty = target:getParty(), master:getParty()
if (party ~= nil and targetParty ~= nil) and party == targetParty then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
local guild, targetGuild = target:getGuild(), master:getGuild()
if (guild ~= nil and targetGuild ~= nil) and guild == targetGuild then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
if not isInArray(skullTypes, target:getSkull()) and not isInArray(skullTypes, master:getSkull()) then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
end
end
Codigo no global.lua:
table.contains = function(array, value)
for _, targetColumn in pairs(array) do
if targetColumn == value then
return true
end
end
return false
end
Compartilhar este post
Link para o post
Compartilhar em outros sites