PE
dúvida

[Irregular] Start Skill Dando Debug Em Knight E

Por pedrizito15, 16 de jun. de 2012 em Scripts

xxxxx
5
1.3k
pedrizito15P
16 de junho de 2012 às 11:28

Galera estou com um server de war e knight fica tomando debug quando loga pela primeiras vez por causa do start skill, e nenhuma classe começa com o skill certo que manda no Start Skill

(exemplo knight está para começar com skill 70 e começa com 96 paladin 70 e começa com 130 mage 60 e começa com 80)

 

Como sei que o debug do knight é no startskill, porque quando removi o startskill Club e Axe knight entrou susegado então acho que é la

 

start skil que estou usando :

 

 

 

 

function onLogin(cid)

local playerVoc = getPlayerVocation(cid)

local reqTries = getPlayerRequiredSkillTries

local skillStor = 56364

local gotSkills = getPlayerStorageValue(cid, 56364)

 

 

if playerVoc == 5 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

 

elseif playerVoc == 6 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

 

elseif playerVoc == 7 and gotSkills == -1 then

doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 60))

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))

setPlayerStorageValue(cid, skillStor, 1)

 

elseif playerVoc == 8 and gotSkills == -1 then

doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 65))

doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 70))

doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 70))

doPlayerAddMagLevel(cid, 8)

setPlayerStorageValue(cid, skillStor, 1)

 

end

return TRUE

end

Editado Junho 16 por pedrizito15

LeoxtibiaL
16 de junho de 2012 às 11:41

Substitua ser arquivo startskill por esse:

 

function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local skillStor = 56364
local gotSkills = getPlayerStorageValue(cid, 56364)

if playerVoc == 5 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 6 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 7 and gotSkills == -1 then
doPlayerSetSkill(cid, SKILL_DISTANCE, 70)
doPlayerSetSkill(cid, SKILL_SHIELDING, 60)
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 8 and gotSkills == -1 then
doPlayerSetSkill(cid, SKILL_SWORD, 70)
doPlayerSetSkill(cid, SKILL_SHIELDING, 65)
doPlayerSetSkill(cid, SKILL_AXE, 70)
doPlayerSetSkill(cid, SKILL_CLUB, 70)
doPlayerSetMagic(cid, 8)
setPlayerStorageValue(cid, skillStor, 1)
end
return TRUE
end

 

E em lib>050-function.lua adicione isso lá no final:

function doPlayerSetSkill(cid, skill, amount)
local pid = getPlayerGUID(cid) 
doRemoveCreature(cid,true)
db.executeQuery("UPDATE `player_skills` SET `value` = ".. amount .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. skill ..";") 
return TRUE
end
function doPlayerSetMagic(cid, amount)
local pid = getPlayerGUID(cid) 
doRemoveCreature(cid,true)
db.executeQuery("UPDATE `players` SET `maglevel` = " .. amount .. " WHERE `id` = "..pid)
return TRUE
end

jhon992J
16 de junho de 2012 às 12:01

Não sei não se o erro ta aew. Quando tu tira esse script os player começam com os skills 10 tudo certinho?

Faiz oque o @Leoxtibia disse, que resolve. A primeira vez que o player tentar logar não vai conseguir, mais depois logara.

Editado Junho 16 por Jhon992

pedrizito15P
16 de junho de 2012 às 14:59

Man Sorcerer e Druid ta Logando normal mais o skill ainda ta errado e knight e druid nem loga loga

Editado Junho 16 por pedrizito15

2 meses depois...
ShockZzS
06 de agosto de 2012 às 14:08

tenho mesmo problema em um sv aqui, kina e pally da debug na 1x vez