Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? tfs 0.4

 

Qual o motivo deste tópico? Boa tarde galera do TK! <3 

Bom, estou precisando de ajuda para adaptar um NPC que encontrei aqui no TK 

nele encontro um bug por exemplo o (mana shield) ele não está funcionando.

Mas eu tenho uma ídeia para esse NPCS que eu poderia usar como exemplo o imbuements. Primeiramente o meu servidor é um derivado do tibia DBO e nele existe muitas vocações e seria de grande ajuda se o npc não checasse Vocations, para ser mais especifico qualquer players poderia comprar.

OBS: não tive como testar os buffs como "fist, club, sword, axe, distance, shield e ml" pois eles precisam de vocações "knight, sorcerers, druids e paladins".

Vamos ao que preciso que seja feito no NPCS...

Preciso que para cada "buff" que o npcs venda a moeda de troca seja outra, poderia da como exemplo scarabs coins, talons, dragons hams etc... 

Exemplo: 

Player: Hi

Npcs: Hello, |PLAYERNAME|. I can 'heal', 'haste', 'mana shield', invisible',  'melee', 'magic', 'distance' and 'shield' skills

Player: magic

Npcs: Você tem os seguintes items '10 talons', '2 dragons hams'? [yes]

Player: yes

Npcs: você ganhou 3 magic level por 2 horas.

 

E assim com todos os outros buffs e skill, precisando de x items e x quantidade para ganhar o buff/skill por 1 ou 2 horas.

Só podera comprar 1 buff/skill por vez, e se poder adcionar um efeito para especificar cada buff seria ótimo, por exemplo : quando comprar o skill magic o player irá ficar com um efeito nele até o buff acabar.

Resumindo: tirar a checagem de vocação e adcionar uma tabela para configurar X items e o time de cada buff. 

 

 

Você tem o código disponível? Se tiver publique-o aqui: 

-- configs
pricetobuff = 1000

hasteseconds = 120

invisibleseconds = 120

magicshieldseconds = 120

skillsseconds = 200

skillsupgrade = {}

skillsupgrade['fist'] = 20

skillsupgrade['club'] = 20

skillsupgrade['sword'] = 20

skillsupgrade['axe'] = 20

skillsupgrade['distance'] = 20

skillsupgrade['shield'] = 20

skillsupgrade['ml'] = 10

-- end configs

 

 

-- heal combat

local combatHeal = createCombatObject()

setCombatParam(combatHeal, COMBAT_PARAM_TYPE, COMBAT_HEALING)

setCombatParam(combatHeal, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

setCombatParam(combatHeal, COMBAT_PARAM_AGGRESSIVE, FALSE)

setCombatParam(combatHeal, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

setCombatFormula(combatHeal, COMBAT_FORMULA_LEVELMAGIC, 99, 99, 99, 99)

 

-- haste combat

local combatHaste = createCombatObject()

setCombatParam(combatHaste, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

setCombatParam(combatHaste, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)

setConditionParam(condition, CONDITION_PARAM_TICKS, hasteseconds*1000)

setConditionFormula(condition, 99, 99, 99, 99)

setCombatCondition(combatHaste, condition)

 

-- 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 sorcerers and druids can upgrade their magic skills.", cid)

errors = 1

end

 

if buff == conditionMelee or buff == conditionShield and (isSorcerer(cid) or isDruid(cid)) then

npcHandler:say("Only knights and paladins can upgrade their melee and shield skills.", cid)

errors = 1

end

 

if buff == conditionDistance and (isDruid(cid) or isKnight(cid) or isSorcerer(cid)) then

npcHandler:say("Only paladins can upgrade their distance 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({'heal'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be healed?'})

node1:addChildKeyword({'yes'}, buff, {buff = combatHeal, message = 'Now you are fully restored!'})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

local node1 = keywordHandler:addKeyword({'haste'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be hasted?'})

node1:addChildKeyword({'yes'}, buff, {buff = combatHaste, message = 'Now you are fully hasted!'})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

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()) 

 

 

 

Editado por hiquezerah
esqueci de mencionar uma inforamação importante, desculpe-me (veja o histórico de edições)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo