Postado Fevereiro 16, 2016 9 anos Boa noite galera do TK, tive um pequeno problema/erro com meu OTserv hoje a noite e infelizmente não tivemos exito ao tentar remove-lo. de qualquer maneira, fiz algumas substituições provisórias e deram certo. Gostaria de publicar aqui o meu erro, juntamente com o script abaixo, para uma melhor visualização do mesmo. http://imgur.com/3PK9AzW o loot.lua segue abaixo: Spoiler 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 -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'}) keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'}) keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'}) keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'}) keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'}) keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'}) keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'}) keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'}) npcHandler:addModule(FocusModule:new()) O killing quest eu removi o mesmo, porém tampoco sei de sua importância , acredito que não fará falta, vocês sabem me dizer para que servem ? Spoiler -- configs pricetobuff = 2000 invisibleseconds = 600 magicshieldseconds = 600 skillsseconds = 600 skillsupgrade = {} skillsupgrade['fist'] = 20 skillsupgrade['club'] = 20 skillsupgrade['sword'] = 20 skillsupgrade['axe'] = 20 skillsupgrade['distance'] = 20 skillsupgrade['shield'] = 20 skillsupgrade['ml'] = 10 -- 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?'}) 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 effect?'}) 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 some time?'}) 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 some time?'}) 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 some time?'}) 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 some time?'}) 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 = "Uhm?"}) keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ya?"}) npcHandler:addModule(FocusModule:new()) Obrigado de verdade.
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.