Ir para conteúdo
  • Cadastre-se

(Resolvido)Erro em npc de skill


Ir para solução Resolvido por KotZletY,

Posts Recomendados

O script da esses erros monstro ao pedir a skill pro npc:

 

<?xml version="1.0"?>
<npc name="Raphael" script="data/npc/scripts/raphael.lua" access="3" lookdir="2" walkinterval="2000">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="132" head="20" body="39" legs="45" feet="7" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello, |PLAYERNAME|. I can {magic shield} and {invisible}, upgrade your 'melee', {magic}, {distance} and {shield} skills."/>
</parameters>
</npc>
-- configs
pricetobuff = 2000
invisibleseconds = 600
magicshieldseconds = 6000
skillsseconds = 6000
skillsupgrade = {}
skillsupgrade['fist'] = 20
skillsupgrade['club'] = 20
skillsupgrade['sword'] = 20
skillsupgrade['axe'] = 20
skillsupgrade['distance'] = 20
skillsupgrade['shield'] = 20
skillsupgrade['ml'] = 20
-- end configs
 
 
-- invisible combat
local combatInvisible = createCombatObject()
setCombatParam(combatInvisible, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combatInvisible, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(condition, CONDITION_PARAM_TICKS, invisibleseconds*1000)
setCombatCondition(combatInvisible, condition)
 
-- utamo combat
local combatUtamo = createCombatObject()
setCombatParam(combatUtamo, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatUtamo, COMBAT_PARAM_AGGRESSIVE, 0)
 
local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, magicshieldseconds*1000)
setCombatCondition(combatUtamo, condition)
 
-- melee condition
local conditionMelee = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMelee, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_FIST, skillsupgrade['fist'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_CLUB, skillsupgrade['club'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_SWORD, skillsupgrade['sword'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_AXE, skillsupgrade['axe'])
 
-- distance condition
local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, skillsupgrade['distance'])
 
-- shield condition
local conditionShield = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionShield, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionShield, CONDITION_PARAM_SKILL_SHIELD, skillsupgrade['shield'])
 
-- ml condition
local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICPOINTS, skillsupgrade['ml'])
 
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
 
function buff(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
message = parameters.message
 
doCombat(cid, buff, numberToVariant(cid))
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
function buffMelee(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
errors = 0
message = parameters.message
voc = getPlayerVocation(cid)
 
if buff == conditionMagic and (isKnight(cid) or isPaladin(cid)) then
npcHandler:say("Only master sorcerers and elder druids can upgrade their magic skills.", cid)
errors = 1
end
 
 
if errors == 0 then
doTargetCombatCondition(0, cid, buff, CONST_ME_MAGIC_RED)
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
end
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
 
 
 
local node1 = keywordHandler:addKeyword({'invisible'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be invisible for 3 hours?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatInvisible, message = 'Now you are invisible!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to get magic shield shield for 3 hours?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatUtamo, message = 'Your magic shield is on!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'melee'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your melee skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMelee, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your shield skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionShield, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'distance'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your distance skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionDistance, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your magic skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMagic, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "offer ? do you mean price? 6kk each buff. buy anything or leave me alone"})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "whats going on with you dude?"})
 
npcHandler:addModule(FocusModule:new())

 

xd.png

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites
  • Solução

@jNo

Spoiler

-- configs
pricetobuff = 2000
invisibleseconds = 600
magicshieldseconds = 6000
skillsseconds = 6000
skillsupgrade = {}
skillsupgrade['fist'] = 20
skillsupgrade['club'] = 20
skillsupgrade['sword'] = 20
skillsupgrade['axe'] = 20
skillsupgrade['distance'] = 20
skillsupgrade['shield'] = 20
skillsupgrade['ml'] = 20
errors = -1
-- end configs
 
 
-- invisible combat
local combatInvisible = createCombatObject()
setCombatParam(combatInvisible, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combatInvisible, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(condition, CONDITION_PARAM_TICKS, invisibleseconds*1000)
setCombatCondition(combatInvisible, condition)
 
-- utamo combat
local combatUtamo = createCombatObject()
setCombatParam(combatUtamo, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatUtamo, COMBAT_PARAM_AGGRESSIVE, 0)
 
local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, magicshieldseconds*1000)
setCombatCondition(combatUtamo, condition)
 
-- melee condition
local conditionMelee = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMelee, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_FIST, skillsupgrade['fist'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_CLUB, skillsupgrade['club'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_SWORD, skillsupgrade['sword'])
setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_AXE, skillsupgrade['axe'])
 
-- distance condition
local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, skillsupgrade['distance'])
 
-- shield condition
local conditionShield = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionShield, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionShield, CONDITION_PARAM_SKILL_SHIELD, skillsupgrade['shield'])
 
-- ml condition
local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICPOINTS, skillsupgrade['ml'])
 
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
 
function buff(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
message = parameters.message
 
doCombat(cid, buff, numberToVariant(cid))
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
function buffMelee(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if doPlayerRemoveMoney(cid, pricetobuff) == TRUE then
buff = parameters.buff
errors = 0
message = parameters.message
voc = getPlayerVocation(cid)
 
if buff == conditionMagic and (isKnight(cid) or isPaladin(cid)) then
npcHandler:say("Only master sorcerers and elder druids can upgrade their magic skills.", cid)
errors = 1
end
 
 
if errors == 0 then
doTargetCombatCondition(0, cid, buff, CONST_ME_MAGIC_RED)
npcHandler:say(message, cid)
keywordHandler:moveUp(1)
return true
end
else
npcHandler:say("You need ".. pricetobuff .." gold coins to buff yourself.", cid)
end
end
 
 
 
 
local node1 = keywordHandler:addKeyword({'invisible'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be invisible for 3 hours?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatInvisible, message = 'Now you are invisible!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to get magic shield shield for 3 hours?'})
node1:addChildKeyword({'yes'}, buff, {buff = combatUtamo, message = 'Your magic shield is on!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'melee'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your melee skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMelee, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your shield skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionShield, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'distance'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your distance skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionDistance, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
local node1 = keywordHandler:addKeyword({'magic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to upgrade your magic skills for 3 hours?'})
node1:addChildKeyword({'yes'}, buffMelee, {buff = conditionMagic, message = 'Your skills had been upgraded!'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
 
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "offer ? do you mean price? 6kk each buff. buy anything or leave me alone"})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "whats going on with you dude?"})
 
npcHandler:addModule(FocusModule:new())

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

@KotZletY da esse erro abaixo na imagem, e todos os npcs param de funcionar.

 

O erro começa assim que eu dou hi

 

 

Sem título.png

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites

@jNo hm... você trocou de distro recentemente ? Se sim mude a pasta lib do npc, para a da nova distro!

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
2 horas atrás, KotZletY disse:

@jNo hm... você trocou de distro recentemente ? Se sim mude a pasta lib do npc, para a da nova distro!

Resolveu, obrigado, rep

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo