
Tudo que Frenesy postou
-
Script Npc
Criei um arquivo .xml na pasta NPC e adicione isso aí em baixo dentro dele. <?xml version="1.0"?> <npc name="NomeDoNPC" script="data/npc/scripts/NomeDoArquivo.lua" walkinterval="2000"> <health now="200" max="200" /> <look type="131" head="38" body="38" legs="38" feet="38" addons="3"/> <parameters> <parameter key="message_greet" value="Ola, |PLAYERNAME|. Em que posso ajuda-lo?" /> </parameters> </npc> Configure o nome do NPC e o Script.
-
Script Npc
-- < Script by Frenesy > -- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'Trocar') or msgcontains(msg, 'changer')) then selfSay('Se você me der 3 Items, lhe darei um muito valioso. Quer trocar?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 and getPlayerItemCount(cid, IDDoItem1) == 1 and getPlayerItemCount(cid, IDDoItem2) == 1 and getPlayerItemCount(cid, IDDoItem3) == 1 then selfSay('Legal, pega aqui seu item novo.', cid) talkState[talkUser] = 0 doPlayerAddItem(cid,IDDoNovoItem, 1) doPlayerRemoveItem(cid, RemoveItem1ID, 1) doPlayerRemoveItem(cid, RemoveItem2ID, 1) doPlayerRemoveItem(cid, RemoveItem3ID, 1) elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 and getPlayerItemCount(cid, IDDoItem1) < 1 or getPlayerItemCount(cid, IDDoItem2) < 1 or getPlayerItemCount(cid, IDDoItem3) < 1 then selfSay('Voce ainda nao tem todos os itens.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'No') or msgcontains(msg, 'nao')) and talkState[talkUser] == 1 then selfSay('Eu nem queria mesmo.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)pedido spells de paralizar
local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_STUN) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_SLEEP) local condition1 = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition1, CONDITION_PARAM_TICKS, 4000) setConditionParam(condition1, CONDITION_PARAM_SPEED, -350) setConditionFormula(condition1, -0.9, 0, -0.9, 0) setCombatCondition(combat1, condition1) arr1 = { {0, 3, 0} } arr2 = { {0, 3, 0} } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) setCombatArea(combat1, area1) setCombatArea(combat2, area2) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 } addEvent(onCastSpell1, 100, parameters) addEvent(onCastSpell2, 200, parameters) return true end
-
(Resolvido)pedido spells de paralizar
Não tenho OTservs 8.54 aqui. O Máximo que eu consigo fazer é isso. Abraços!
-
[Pedido] Teleport Spell
Clique em "Melhor Resposta" para encerrar este tópico.
-
[Pedido] Teleport Spell
local area = { {0,0,0}, {0,3,0}, {0,0,0}, } function onDash(cid) local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, false) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), 2) return TRUE else doMoveCreature(cid, getPlayerLookDirection(cid)) doAreaCombatHealth(0, 1, poslook, area, -getCreatureSpeed(cid)*2/(getCreatureHealth(cid)/300), -getCreatureSpeed(cid)*3/(getCreatureHealth(cid)/30), 9) doCreatureSay(getThingfromPos(poslook).uid, 'Auch', TALKTYPE_MONSTER) doSetItemOutfit(getThingfromPos(poslook).uid, 2317, 1*1000) doSendMagicEffect(getCreaturePosition(getThingfromPos(poslook).uid), 31) return TRUE end end end function onCastSpell(cid, var) local distance = 2 for i = 0, distance do addEvent(onDash,90*i,cid) end return TRUE end function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end
-
Duvidas & Pedido Rápido
Compreendi completamente. <sem sarcasmo> Assim que chegar em casa, colocarei na prática essas informações. Deixarei o tópico aberto caso surja qualquer duvida. Abraços e REP +
-
Talkaction :)
Precisa dizer qual a Storage da sua vip.
-
[Pedido] Teleport Spell
Tenho um desses em casa. To no 'trampo' agora, quando eu voltar - 12:00 - eu disponibilizo pra você.
-
[PEDIDO] NPC MISSAO
Clique em "Melhor resposta" caso pedido foi atendido. Abraços!
-
Duvidas & Pedido Rápido
1 - Se o jogador tiver X storage, ele não pode deslogar. tem como? 2 - Eu tambem não sei. =/ 3 - Não sei por quanto tempo o jogador ficará em determinado local onde não poderá usar magia. como faz pra ficar muted infinitamente até eu dar outro comando fazendo o player voltar ao normal? 4 - Poderia dar um breve exemplo de como usa essa função, me mostrando um script pronto. Coisa simples, rapidim. pf!
-
[PEDIDO] NPC MISSAO
Pra fazer NPC de missão pra verificar quantos monstros você matou, precisa de outros scripts. No caso irei fazer apenas o NPC, e configurei com duas missões. Mission 1 - Pegar 1 Item Mission 2 - Pegar 2 Item -- < Script by Frenesy > --local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1001) == -1 then selfSay('Ola, poderia me ajudar me dando tal item?', cid) talkState[talkUser] = 1 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1) then selfSay('estarei esperando', cid) talkState[talkUser] = 0 setPlayerStorageValue(cid, 1001, 1) setPlayerStorageValue(cid, 1002, 1) elseif(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1002) == 1 then selfSay('Conseguiu recolher os itens?', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 2 and getPlayerItemCount(cid, IDDoItem) < 1 then selfSay('Voce ainda nao tem o item necessarios.', cid) talkState[talkUser] = 0 elseif((msgcontains(msg, 'No') or msgcontains(msg, 'nao')) and talkState[talkUser] == 2) then selfSay('Entao vai la buscar.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and getPlayerStorageValue(cid,1002) == 1 and talkState[talkUser] == 2 and getPlayerItemCount(cid, IDDoItem) == 1 then selfSay('Muito obrigado, aqui está seu premio!', cid) doPlayerAddItem(cid,IDDoItem, 1) -- Recompensa doPlayerRemoveItem(cid, IDDoItem, 1) -- Remove o Item setPlayerStorageValue(cid, 1002, -1) setPlayerStorageValue(cid, 1003, 1) -- Storage pra começar proxima mission. --============ Primeira Mission Completa. Vamos pra segunda. ===============-- elseif(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1003) == 1 then selfSay('Preciso de mais dois outros items. Me ajuda ai, pode ser?', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 3) then selfSay('Beleza, estou esperando.', cid) talkState[talkUser] = 0 setPlayerStorageValue(cid, 1003, -1) setPlayerStorageValue(cid, 1004, 1) elseif(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1004) == 1 then selfSay('Conseguiu recolher os dois itens?', cid) talkState[talkUser] = 4 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 4 and getPlayerItemCount(cid, IDDoItem) < 2 then selfSay('Voce ainda nao tem o item necessarios.', cid) talkState[talkUser] = 0 elseif((msgcontains(msg, 'No') or msgcontains(msg, 'nao')) and talkState[talkUser] == 2) then selfSay('Entao vai la buscar.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and getPlayerStorageValue(cid,1002) == 1 and talkState[talkUser] == 4 and getPlayerItemCount(cid, IDDoItem) == 2 then selfSay('Muito obrigado, aqui está seu premio!', cid) doPlayerAddItem(cid,IDDoItem, 1) -- Recompensa doPlayerRemoveItem(cid, IDDoItem, 2) -- Remove o Item setPlayerStorageValue(cid, 1004, -1) setPlayerStorageValue(cid, 1005, 1) -- Storage pra começar proxima mission. --================= Fim da Mission 2 ===================-- end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Adicionando Mais Missões: Para adicionar mais missões, basta colar essa parte: elseif(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1003) == 1 then selfSay('Preciso de mais dois outros items. Me ajuda ai, pode ser?', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 3) then selfSay('Beleza, estou esperando.', cid) talkState[talkUser] = 0 setPlayerStorageValue(cid, 1003, -1) setPlayerStorageValue(cid, 1004, 1) elseif(msgcontains(msg, 'Quest') or msgcontains(msg, 'mission')) and getPlayerStorageValue(cid,1004) == 1 then selfSay('Conseguiu recolher os dois itens?', cid) talkState[talkUser] = 4 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 4 and getPlayerItemCount(cid, IDDoItem) < 2 then selfSay('Voce ainda nao tem o item necessarios.', cid) talkState[talkUser] = 0 elseif((msgcontains(msg, 'No') or msgcontains(msg, 'nao')) and talkState[talkUser] == 2) then selfSay('Entao vai la buscar.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'sim')) and getPlayerStorageValue(cid,1002) == 1 and talkState[talkUser] == 4 and getPlayerItemCount(cid, IDDoItem) == 2 then selfSay('Muito obrigado, aqui está seu premio!', cid) doPlayerAddItem(cid,IDDoItem, 1) -- Recompensa doPlayerRemoveItem(cid, IDDoItem, 2) -- Remove o Item setPlayerStorageValue(cid, 1004, -1) setPlayerStorageValue(cid, 1005, 1) -- Storage pra começar proxima mission. Abaixo do comentário e modificar as storages o os itens: --================= Fim da Mission 2 ===================--
-
Duvidas & Pedido Rápido
Duvidas: Tem alguma função LUA que não deixe o jogador deslogar? Tem alguma função LUA que não deixe o jogador sair de uma PT? Tem alguma função LUA que não deixe o jogador usar nenhuma magia? Pedido Rápido: Alguem me diz qual é mesmo a função LUA que verifica o nome de um item - sem ser 'getItemName' ou algo assim, é mais um string.lower eu acho, mas não sei usar e nem tenho certeza se é essa. Ex: Tenho um Item que se chama: Armadura do Aprendiz Eu uso um Item nele e ela fica assim: Armadura do Aprendiz [ ] Qual é a função LUA que eu verifico o nome do item para vê se o item tem aquele "[ ]" no final? Tipo: Se item tiver o "[ ]" no final de seu nome, então No Aguardo. Abraços!
-
[PEDIDO] Alavanca para Craftar Itens
function onUse(cid, item, position) if item.itemid == 1945 then if getPlayerItemCount(cid, 2461) == 1 and getPlayerItemCount(cid, 6550) == 2 and getPlayerItemCount(cid, 5911) == 2 and getPlayerItemCount(cid, 6500) == 2 then doPlayerSendTextMessage(cid,25,"Voce criou um Demon Helmet") doSendMagicEffect(getPlayerPosition(cid), 13) doPlayerRemoveItem(cid, 2461, 1) doPlayerRemoveItem(cid, 6550, 2) doPlayerRemoveItem(cid, 5911, 2) doPlayerRemoveItem(cid, 6500, 2) doPlayerAddItem(cid, 2493, 1) else doPlayerSendTextMessage(cid,25,"Voce nao tem todos os items necessarios.") end end elseif item.itemid == 1946 then doTransformItem(item.uid, 1945) end return TRUE end
- Clicar em um item com action [Help]
-
[PEDIDO] NPC Blessed
Tente escrever o nome do arquivo .lua Veja: O Meu NPC se chama Joalheira - Ana Mas eu digito apenas /n ana - que é o nome do arquivo .lua dela - e ela aparece.
-
Clicar em um item com action [Help]
function onUse(cid, item, frompos, item2, topos) if item.uid == 98564 then if getPlayerStorageValue(cid,98564) == -1 then setPlayerStorageValue(cid,98564,1) else doPlayerSendTextMessage(cid,25,"Clique antes da hora!") end end return TRUE end Action.xml <action uniqueid="98564" event="script" value="NomeDoArquivo.lua"/> No Map Editor, coloque a Estátua onde se deve clicar com UniqueID: 98564. E a porta onde se deve passar apenas com storage, basta usar essa porta: E nela, colocar no ActionID: 98564
-
NPC bugado
Imagine que o Script do seu NPC, na parte onde ele fala, esta assim: if(msgcontains(msg, 'Hi') or msgcontains(msg, 'hi')) then selfSay('E so um teste', cid) O "cid" no final, indica que essa fala ele irá dizer no NPC Channel. Se não tivesse esse "cid" no final, ou seja, assim: selfSay('E so um teste') Ele irá falar pelo Default.
-
[PEDIDO] NPC Blessed
O Erro esta dizendo que você apenas errou o nome do NPC, e não tem nada a ver com o script.
-
(Resolvido)pedido spells de paralizar
Eu testei ele aqui e ficou perfeito. Verifique algum erro da sua parte.
-
Spells de transformação.
function onCastSpell(cid, var) if getPlayerVocation(cid) == 1 then if getPlayerLevel(cid) >= 30 then if exhaustion.get(cid,61260) == false then if isPremium(cid) then doPlayerSetVocation(cid,2) doCreatureChangeOutfit(cid, {lookType=11}) doSendMagicEffect(getCreaturePosition(cid), 12) exhaustion.set(cid,61260,0) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendCancel(cid, "Somente Premium podem usar esta magia.") end return true end end elseif getPlayerVocation(cid) == 2 then if getPlayerLevel(cid) >= 40 then if exhaustion.get(cid,61260) == false then if isPremium(cid) then doPlayerSetVocation(cid,3) doCreatureChangeOutfit(cid, {lookType=12}) doSendMagicEffect(getCreaturePosition(cid), 12) exhaustion.set(cid,61260,0) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendCancel(cid, "Somente Premium podem usar esta magia.") end return true end end elseif getPlayerVocation(cid) == 3 then if getPlayerLevel(cid) >= 50 then if exhaustion.get(cid,61260) == false then if isPremium(cid) then doPlayerSetVocation(cid,4) doCreatureChangeOutfit(cid, {lookType=13}) doSendMagicEffect(getCreaturePosition(cid), 12) exhaustion.set(cid,61260,0) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendCancel(cid, "Somente Premium podem usar esta magia.") end return true end end end end
-
NPC de Troca Pokémon
Que tal um possível diálogo. Só pra facilitar ainda mais a minha vida
-
[PEDIDO] NPC Blessed
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'Blessar') or msgcontains(msg, 'blessar')) and getPlayerItemCount(cid, 2342) == 1 then selfSay('Parabens! Você blessou seu helmet, ele tem duração de 4 horas!', cid) doPlayerAddItem(cid,2343, 1) doPlayerRemoveItem(cid, 2342, 1) doSendMagicEffect(getPlayerPosition(cid), 13) elseif(msgcontains(msg, 'Blessar') or msgcontains(msg, 'blessar')) and getPlayerItemCount(cid, 2342) < 1 then selfSay('Voce nao tem o item nescessario.', cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
NPC de Troca Pokémon
Desculpe, não entendi. Você quer que o NPC troque X Item, com determinada quantidade, por outro item. E que esse mesmo NPC venda outros itens pelo 'trade'. É mais ou menos isso? Que itens? Diga-me o que tem em mente. Facilitaria minha vida
-
[8.60] Descola um NPC que vende buffs ae
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end function onThink() npcHandlernThink() end -- Buff Config beginning -- -- configs local config = { storage = 77700, value = 1, } money = 2000 invisibleseconds = 600 magicshieldseconds = 600 regeseconds = 600 speedseconds = 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 -- Configs of buffs local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMagic, CONDITION_PARAM_BUFF, true) setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, skillsseconds * 1000) setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICLEVEL, skillsupgrade['ml']) local combatInvisible = createConditionObject(CONDITION_INVISIBLE) setConditionParam(combatInvisible, CONDITION_PARAM_BUFF, true) setConditionParam(combatInvisible, CONDITION_PARAM_TICKS, invisibleseconds*1000) local conditionMelee = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMelee, CONDITION_PARAM_BUFF, true) 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']) local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionDistance, CONDITION_PARAM_BUFF, true) setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, skillsseconds*1000) setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, skillsupgrade['distance']) local conditionShield = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionShield, CONDITION_PARAM_BUFF, true) setConditionParam(conditionShield, CONDITION_PARAM_TICKS, skillsseconds*1000) setConditionParam(conditionShield, CONDITION_PARAM_SKILL_SHIELD, skillsupgrade['shield']) local combatUtamo = createConditionObject(CONDITION_MANASHIELD) setConditionParam(combatUtamo, CONDITION_PARAM_BUFF, true) setConditionParam(combatUtamo, CONDITION_PARAM_TICKS, magicshieldseconds*1000) local conditionRege = createConditionObject(CONDITION_REGENERATION) setConditionParam(conditionRege, CONDITION_PARAM_BUFF, true) setConditionParam(conditionRege, CONDITION_PARAM_TICKS, regeseconds*1000) setConditionParam(conditionRege, CONDITION_PARAM_HEALTHGAIN, 20) setConditionParam(conditionRege, CONDITION_PARAM_HEALTHTICKS, 2000) local conditionspeed = createConditionObject(CONDITION_HASTE) setConditionParam(conditionspeed, CONDITION_PARAM_BUFF, true) setConditionParam(conditionspeed, CONDITION_PARAM_TICKS, speedseconds*1000) setConditionFormula(conditionspeed, 1.0, -86, 1.0, -86) -- Configs of buffs function magicl(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if (isDruid(cid) or isSorcerer(cid)) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionMagic) npcHandler:say('Your magic level has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, skillsseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You must be a druid or a sorcerer to receive this increment.', cid) end end function invisible(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if (isDruid(cid) or isSorcerer(cid)) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) npcHandler:say('You received invisibility for 10 minutes!', cid) doAddCondition(cid, combatInvisible) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, invisibleseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You must be a druid or a sorcerer to receive this increment.', cid) end end function melee(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if isKnight(cid) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionMelee) npcHandler:say('Your Melee Skills has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, skillsseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You must be a knight to receive this increment.', cid) end end function distance(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if isPaladin(cid) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionDistance) npcHandler:say('Your Distance Skill has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, skillsseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You must be a Paladin to receive this increment.', cid) end end function shield(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if (isPaladin(cid) or isKnight(cid)) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionShield) npcHandler:say('Your Shielding Skill has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, skillsseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You must be a Paladin or a Knight to receive this increment.', cid) end end function magicshield(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if (isPaladin(cid) or isDruid(cid) or isSorcerer(cid)) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, combatUtamo) npcHandler:say('You received a Magic Shield for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, magicshieldseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('Knights can\'t receive this increment.', cid) end end function regener(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if isPlayer(cid) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionRege) npcHandler:say('Your regeneration has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, regeseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You can\'t receive more than two increases.', cid) end end function speed(cid, message, keywords, parameters, node) local guid = getPlayerGUID(cid) if not npcHandler:isFocused(cid) then return false end if isPlayer(cid) and getCreatureStorage(cid, config.storage) == -1 then if getPlayerMoney(cid) >= 5000 then doPlayerRemoveMoney(cid, 5000) doAddCondition(cid, conditionspeed) npcHandler:say('Your speed has increased for 10 minutes!', cid) setPlayerStorageValue(cid, config.storage, config.value) addEvent(db.executeQuery, speedseconds * 1000, "UPDATE `player_storage` SET `key` = " .. config.storage .. ", `value` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;") else npcHandler:say('You don\'t have such money.', cid) end else npcHandler:say('You can\'t receive more than two increases.', cid) end end -- Buff Config End -- keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can increase your {melee}, {distance}, {shielding}, {magic level}, {regeneration}, {invisibility}, {magic shield} and {speed}"}) local node1 = keywordHandler:addKeyword({'magic level'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your magic level for a certain time?'}) node1:addChildKeyword({'yes'}, magicl, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node2 = keywordHandler:addKeyword({'invisibility'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be invisible for a certain time?'}) node2:addChildKeyword({'yes'}, invisible, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node3 = keywordHandler:addKeyword({'melee'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your melee skills for a certain time?'}) node3:addChildKeyword({'yes'}, melee, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node4 = keywordHandler:addKeyword({'distance'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your distance skills for a certain time?'}) node4:addChildKeyword({'yes'}, distance, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node5 = keywordHandler:addKeyword({'shielding'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your shielding skill for a certain time?'}) node5:addChildKeyword({'yes'}, shield, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node6 = keywordHandler:addKeyword({'magic shield'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to receive a magic shield for a certain time?'}) node6:addChildKeyword({'yes'}, magicshield, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node7 = keywordHandler:addKeyword({'regeneration'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your regeneration for a certain time?'}) node7:addChildKeyword({'yes'}, regener, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) local node8 = keywordHandler:addKeyword({'speed'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to increase your speed for a certain time?'}) node8:addChildKeyword({'yes'}, speed, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back if you want an upgrade in your skills.', reset = true}) npcHandler:addModule(FocusModule:new()