Boa noite Galerinha tibiaking ! Bom seguinte estou com script de sistema jinchuurikis ele funciona tudo normal porem estou com um pequeno problema no qual não estou conseguindo resolver se alguem puder me extender a mão creio que me ajudará muito .. Bom vamos la.
O script em si funciona certinho add a biju capturada os atributos e efeitos normalmente porem quando alguem que já possui uma biju selada desloga aparece o seguinte erro no onlogin.. ja fiz oque eu podia e não conseguo ajustar isso alguma luz pode me ajudar por favor ....
Segue abaixo o script
BIJUU_SYSTEM = {
BIJUUS = {
["biju ichibi"] = {id = 1, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 0, speed= 0, glove = 0, sword = 0, distance =15, defense = 10, health = 0, chakra = 0, effect= 498, time= 5, transform= {lookType = 157, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Monday", "Wednesday", "Friday", "Sunday"}, chance = 100, position={x=963, y=657, z=6}}},
["biju nibi"] = {id = 2, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 0, speed= 15, glove = 0, sword = 0, distance = 10, defense = 0, health = 0, chakra = 10000, effect= 499, time= 5, transform= {lookType = 158, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Tuesday" , "Thursday", "Saturday", "Sunday"}, chance = 100, position={x=969, y=682, z=6}}},
["biju sanbi"] = {id = 3, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 0, speed= 0, glove = 0, sword = 0, distance =0, defense = 10, health = 10000, chakra = 0, effect= 500, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Monday", "Tuesday" , "Thursday", "Friday", "Saturday"}, chance = 100, position={x=988, y=653, z=6}}},
["biju yonbi"] = {id = 4, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 10, speed= 0, glove = 15, sword = 0, distance =0, defense = 0, health = 0, chakra = 0, effect= 501, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Tuesday" , "Thursday", "Friday", "Sunday"}, chance = 100, position={x=1019, y=666, z=6}}},
["biju rokubi"] = {id = 6, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 10, speed= 0, glove = 0, sword = 0, distance =10, defense = 0, health = 0, chakra = 0, effect= 502, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Monday","Tuesday", "Wednesday", "Saturday"}, chance = 100, position={x=992, y=675, z=5}}},
["biju gobi"] = {id = 5, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 0, speed= 10, glove = 0, sword = 15, distance =0, defense = 0, health = 0, chakra = 0, effect= 503, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Tuesday" ,"Wednesday", "Friday", "Saturday"}, chance = 100, position={x=1003, y=682, z=6}}},
["biju shichibi"] = {id = 7, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 0, speed= 10, glove = 10, sword = 0, distance =0, defense = 0, health = 0, chakra = 0, effect= 504, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Monday","Wednesday", "Saturday"}, chance = 100, position={x=974, y=663, z=5}}},
["biju hachibi"] = {id = 8, catch = {chance = 100, minHp = 20}, haste = 0, ninjutsu= 10, speed= 0, glove = 0, sword = 10, distance =0, defense = 0, health = 10000, chakra = 10000, effect= 505, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Tuesday" , "Sunday"}, chance = 100, position={x=987, y=666, z=6}}},
["biju kyuubi"] = {id = 9, catch = {chance = 90, minHp = 20}, haste = 0, ninjutsu= 10, speed= 10, glove = 0, sword = 0, distance =0, defense = 0, health = 10000, chakra = 10000, effect= 506, time= 5, transform= {lookType = 1493, duration= 30, cooldown={storageId=5675620, time=60}}, spawn = {days = {"Tuesday" ,"Saturday"}, chance = 100, position={x=1006, y=668, z=7}}},
},
DURATION = 7 * 24 * 60 * 60,
DURATION_STORAGE = 6420432,
BIJUU_ID_STORAGE = 320432,
ANIMATION = {
onCatch = {effectId = 1, offset ={x=0, y=0}},
},
WARNS = {
showBijuuNameOnSpawn = false,
onCatchBijuu = true
}
}
BIJUU_SYSTEM.BIJUU_LIST = {}
for _, b in pairs(BIJUU_SYSTEM.BIJUUS) do
table.insert(BIJUU_SYSTEM.BIJUU_LIST, {name=_, id=b.id})
end
if not BIJUU_SYSTEM.GAME_BIJUUS then
BIJUU_SYSTEM.GAME_BIJUUS = {}
end
BIJUU_SYSTEM.spawnBijuu = function()
local rBijuu = BIJUU_SYSTEM.getBijuuById(BIJUU_SYSTEM.BIJUU_LIST[math.random(#BIJUU_SYSTEM.BIJUU_LIST)].id)
local i = 0
while isInArray(rBijuu.spawn.days, os.date("%A")) or i > 1000 do
rBijuu = BIJUU_SYSTEM.getBijuuById(BIJUU_SYSTEM.BIJUU_LIST[math.random(#BIJUU_SYSTEM.BIJUU_LIST)].id)
i = i + 1
end
if BIJUU_SYSTEM.GAME_BIJUUS[rBijuu.id] or rBijuu.spawn.chance < math.random(1, 100) then
return false
end
local bijuuCID = doSummonCreature(rBijuu.name, rBijuu.spawn.position)
if bijuuCID and bijuuCID > 0 then
registerCreatureEvent(bijuuCID, "bijuuDeath")
BIJUU_SYSTEM.GAME_BIJUUS[rBijuu.id] = bijuuCID
if not BIJUU_SYSTEM.WARNS.showBijuuNameOnSpawn then
doBroadcastMessage("A ".. rBijuu.name .." acabou de nascer na Ilha das Bijus, corra para captura-la Ninjas e Obter seus Poderes se tornando um jinchuuriki e conseguir Drops Raros Lembre-se a cada 3 Horas um Biju Invade a Ilha.")
else
doBroadcastMessage("A ".. rBijuu.name .." acabou de nascer na Ilha das Bijus, corra para captura-la Ninjas e Obter seus Poderes se tornando um jinchuuriki e conseguir Drops Raros. Lembre-se a cada 3 Horas um Biju Invade a Ilha.")
end
end
end
BIJUU_SYSTEM.onBijuuDeath = function(cid, attacker, captured)
if BIJUU_SYSTEM.GAME_BIJUUS[BIJUU_SYSTEM.getBijuuByName(getCreatureName(cid)).id] then
BIJUU_SYSTEM.GAME_BIJUUS[BIJUU_SYSTEM.getBijuuByName(getCreatureName(cid)).id] = nil
if BIJUU_SYSTEM.WARNS.onCatchBijuu and isPlayer(attacker) and captured then
doBroadcastMessage("O jogador ".. getCreatureName(attacker) .." acaba de capturar a bijuu ".. getCreatureName(cid) .. ".")
end
end
end
BIJUU_SYSTEM.getBijuuById = function(id)
for name, data in pairs(BIJUU_SYSTEM.BIJUUS) do
if data.id == id then
local returnValue = data
returnValue.name = name
return returnValue
end
end
return nil
end
BIJUU_SYSTEM.getBijuuByName = function(name)
return BIJUU_SYSTEM.BIJUUS[name:lower()]
end
BIJUU_SYSTEM.getPlayerBijuu = function(cid)
local bijuuStorage = getPlayerStorageValue(cid, BIJUU_SYSTEM.BIJUU_ID_STORAGE)
local bijuu = BIJUU_SYSTEM.getBijuuById(bijuuStorage)
if bijuu then
local bijuuTimeLeft = getPlayerStorageValue(cid, BIJUU_SYSTEM.DURATION_STORAGE) - os.time()
if bijuuTimeLeft > 0 then
bijuu.timeLeft = bijuuTimeLeft
return bijuu
end
end
return nil
end
BIJUU_SYSTEM.doPlayerCatchBijuu = function(cid, bijuuId)
local bijuu = BIJUU_SYSTEM.getBijuuById(bijuuId)
if bijuu then
if bijuu.catch.chance >= math.random(100) then
doPlayerSetStorageValue(cid, BIJUU_SYSTEM.BIJUU_ID_STORAGE, bijuu.id)
doPlayerSetStorageValue(cid, BIJUU_SYSTEM.DURATION_STORAGE, os.time() + BIJUU_SYSTEM.DURATION)
doPlayerPopupFYI(cid, string.format("Você capturou a %s.", bijuu.name))
local description = string.format("%s\nJinchuuriki da %s, expire em %s.", getPlayerSpecialDescription(cid), bijuu.name, os.date("%x", getPlayerStorageValue(cid, BIJUU_SYSTEM.DURATION_STORAGE)))
doPlayerSetSpecialDescription(cid, description)
else
doPlayerPopupFYI(cid, string.format("Você falhou ao tentar capturar a bijuu %s.", bijuu.name))
end
return true
end
return false
end
BIJUU_SYSTEM.doPlayerTryCatchBijuu = function(cid, target)
if BIJUU_SYSTEM.getPlayerBijuu(cid) then
return false
end
if isMonster(target) then
local bijuu = BIJUU_SYSTEM.getBijuuByName(getCreatureName(target))
if bijuu then
local hpPercent = (getCreatureHealth(target) * 100) / getCreatureMaxHealth(target)
if hpPercent > bijuu.catch.minHp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "A Bijuu precisa estar com no minimo 20% pontos de vida.")
return false
elseif BIJUU_SYSTEM.doPlayerCatchBijuu(cid, bijuu.id) then
local targetPos = getCreaturePosition(target)
local animation = BIJUU_SYSTEM.ANIMATION.onCatch
doSendMagicEffect({x= targetPos.x + animation.offset.x, y= targetPos.y + animation.offset.y, z=targetPos.z}, animation.effectId)
BIJUU_SYSTEM.onBijuuDeath(target, cid, true)
doRemoveCreature(target)
return true
end
end
end
return false
end
BIJUU_SYSTEM.doPlayerTransformInBijuu = function(cid)
local bijuu = BIJUU_SYSTEM.getPlayerBijuu(cid)
if bijuu then
local transform = bijuu.transform
local cooldown = exhaustion.get(cid, transform.cooldown.storageId)
if cooldown then
doPlayerPopupFYI(cid, string.format("Aguarde %d segundos para ativar novamente.", cooldown))
return false
end
doPlayerSetStorageValue(cid, 5675621, getPlayerVocation(cid))
doPlayerSetStorageValue(cid, 5675622, os.time() + transform.duration)
local outfit = getCreatureOutfit(cid)
outfit.lookType = transform.lookType
doSetCreatureOutfit(cid, outfit, transform.duration * 1000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Você ficará transformado na bijuu por %d segundos.", transform.duration))
addEvent(function(cid)
if isCreature(cid) then
doPlayerSetVocation(cid, getPlayerStorageValue(cid, 5675621))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O tempo no modo bijuu acabou.")
end
end, transform.duration * 1000, cid)
exhaustion.set(cid, transform.cooldown.storageId, transform.cooldown.time)
end
return true
end
BIJUU_SYSTEM.onPlayerLogin = function(cid)
local bijuu = BIJUU_SYSTEM.getPlayerBijuu(cid)
local stor2 = getPlayerStorageValue(cid, BIJUU_SYSTEM.DURATION_STORAGE)
if stor2 > 0 and stor2 < os.time() then
doPlayerSetStorageValue(cid, BIJUU_SYSTEM.BIJUU_ID_STORAGE, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua bijuu expirou.")
end
if bijuu then
local description = string.format("%s\nJinchuuriki da %s, expira dia %s.", getPlayerSpecialDescription(cid), bijuu.name, os.date("%x", stor2))
doPlayerSetSpecialDescription(cid, description)
end
end
BIJUU_SYSTEM.effectBijuu = function(cid)
local bijuu = BIJUU_SYSTEM.getPlayerBijuu(cid)
if not isCreature(cid) then return LUA_ERROR end
if bijuu then
local position = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
if isCreature(cid) then
doSendMagicEffect(position, bijuu.effect)
addEvent(BIJUU_SYSTEM.effectBijuu, bijuu.time*1000, cid)
end
end
end
BIJUU_SYSTEM.addBuff = function(cid)
local bijuu = BIJUU_SYSTEM.getPlayerBijuu(cid)
if not isCreature(cid) then return LUA_ERROR end
if bijuu then
local bonus = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(bonus, CONDITION_PARAM_SUBID, 840)
setConditionParam(bonus, CONDITION_PARAM_BUFF, 1)
setConditionParam(bonus, CONDITION_PARAM_TICKS, -1)
setConditionParam(bonus, CONDITION_PARAM_STAT_MAGICLEVEL, bijuu.ninjutsu)
setConditionParam(bonus, CONDITION_PARAM_SKILL_FIST, bijuu.speed)
setConditionParam(bonus, CONDITION_PARAM_SKILL_CLUB, bijuu.glove)
setConditionParam(bonus, CONDITION_PARAM_SKILL_SWORD, bijuu.sword)
setConditionParam(bonus, CONDITION_PARAM_SKILL_DISTANCE, bijuu.distance)
setConditionParam(bonus, CONDITION_PARAM_SKILL_SHIELD, bijuu.defense)
setConditionParam(bonus, CONDITION_PARAM_STAT_MAXHEALTH, bijuu.health)
setConditionParam(bonus, CONDITION_PARAM_STAT_MAXMANA, bijuu.chakra)
doAddCondition(cid, bonus)
end
end
Alguem por favor pode me ajudar ?