Ir para conteúdo

fokus090

Cavaleiro
  • Total de itens

    190
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Tudo que fokus090 postou

  1. function onSay(cid, words, param) newpos = {x=1130, y=1145, z=7} if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") else doTeleportThing(cid,newpos) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para Eremo Island(aol seller)") end return TRUE end
  2. 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, 'Poke Ball') or msgcontains(msg, 'poke ball')) then selfSay('Tem certeza que deseja comprar {10 Poke Balls} + {1 Great Ball} ({Bônus})?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) then selfSay('Você adquiriu {10 Poke Balls} + {1 Great Ball} ({Bônus})', cid) doPlayerAddItem(cid,pokeballID,10) doPlayerAddItem(cid,greatballID,1) talkState[talkUser] = 0 elseif(msgcontains(msg, 'No') or msgcontains(msg, 'no')) then selfSay('Bem, então em quê posso ajuda-lo?', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Small Potion') or msgcontains(msg, 'small potion')) then selfSay('Tem certeza que deseja comprar {10 Small potions} + {1 Great Potion ({Bônus})?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) then selfSay('Você adquiriu {10 Small potions} + {1 Great Potion ({Bônus})', cid) doPlayerAddItem(cid,smallpotionID,10) doPlayerAddItem(cid,greatpotionID,1) talkState[talkUser] = 0 elseif(msgcontains(msg, 'No') or msgcontains(msg, 'no')) then selfSay('Bem, então em quê posso ajuda-lo?', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você precisa colocar a ID das coisas que comprou e do Item Bônus. Edite : doPlayerAddItem(cid,pokeballID,10) doPlayerAddItem(cid,greatballID,1) doPlayerAddItem(cid,smallpotionID,10) doPlayerAddItem(cid,greatpotionID,1) Abraços !! :smile_positivo:
  3. fokus090

    /ban

    Em relação ao /Ban, eu não sei oque fazer. Mas em relação ao Scripting da Demon Oak. LINK Abraços !! :smile_positivo:
  4. fokus090

    Help Pz Plx

    if getTilePzInfo(getPlayerPosition(cid)) == false and getTilePzInfo(getCreatureSummons(cid)) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você nao pode usar magias dentro de area de proteção.") return true end Não faço idêia se funciona, pois não tenho OT Pokemon em meu PC. Mas tenta aí, qualquer coisa só avisar. Abraços !! :smile_positivo:
  5. SIM! Basta usar o SQLite Studios 1.1. Geralmente vem em alguns OTs (como o Alissow OTs por exemplo.) Usando o programa, abra o DataBase de seu OT (arquivo no formato .s3db). Vá na aba Players e renomei o Account Manager. Se eu entendi, você quer que o Account Manager, na hora de criar vocações, dê mais opções de vocações, além das 4 vocações básicas. Para isso basta colocar o FromVoc igual ao ID da vocação. Exemplo: Repare que a Vocation ID é igual ao FromVoc. Caso queira fazer outras vocações apareça no Account Manager, basta colocar o FromVoc igual ao ID da mesma vocação. Espero ter ajudado. Abraços !! :smile_positivo:
  6. Sim, foi eu que fiz. Tava tendo aulas de scripting nesses dias e esse script foi como um exercício pra mim. Foi um Prazer ajudar. Abraços !! :smile_positivo:
  7. fokus090

    Key

    Exatamente isso. Você poe Action ID: 9999 na chave e coloca na Porta a Action ID: 9999. Mas caso queira receber a chave através de uma Quest (Abrindo um Baú ou um corpo...), segue baixo: local quest = 18977 local id = 2229 local act = 9999 function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid,quest) == -1 then local key = doPlayerAddItem(cid,id,1) if key then doItemSetAttribute(key, "aid", act) doSendMagicEffect(getThingPos(cid),12) setPlayerStorageValue(cid,quest,1) end else doSendMagicEffect(getThingPos(cid),2) end end Configuração: Abraços !! :smile_positivo:
  8. Cara, eu até posso fazer o NPC pra você, mas a explicação esta um pouco confusa. Poderia criar um diálogo que você gostaria que eu coloca-se no NPC. Facilitaria o meu trabalho. Abraços !! :smile_positivo:
  9. Claro Parceiro, segue aí abaixo:: function onCombat(cid, target) local storage = 30000 local valor = 1 local MonsterName = "NomeDoMonstro" if getCreatureName(cid) == MonsterName and getPlayerStorageValue(target, storage) == valor then doMonsterChangeTarget(cid) return FALSE end return TRUE end Só não consegui fazer ainda pro monstro não seguir o Player. Tipo, ele não ataca o Player que tem a Storage, mas fica em cima do Player. Por isso coloquei a função "doMonsterChangeTarget(cid)" ali no monstro. Abraços !! :smile_positivo:
  10. 2º Pedido apenas. O 1º Pedido ja foi atendido. Se o Jogador Eliminar o Monstro, e esse jogador tiver a Storage 30001, então todos os Outros jogadores que tambem possui a Storage 30001, recebe a Storage 30002.
  11. Data/XML/vocation.xml Exclua tudo e cole isso lá dentro. <?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no" droploot="no"> <formula meleeDamage="2.5" distDamage="2.5" wandDamage="2.5" magDamage="2.5" magHealingDamage="2.5" defense="2.5" magDefense="2.5" armor="2.5"/> <skill fist="2.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="25" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="2.5" distDamage="2.5" wandDamage="2.5" magDamage="2.5" magHealingDamage="2.5" defense="2.5" magDefense="2.5" armor="2.5"/> <skill fist="2.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="25" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="2.5" distDamage="2.5" wandDamage="2.5" magDamage="2.5" magHealingDamage="2.5" defense="2.5" magDefense="2.5" armor="2.5"/> <skill fist="2.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.4" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="2.5" distDamage="2.5" wandDamage="2.5" magDamage="2.5" magHealingDamage="2.5" defense="2.5" magDefense="2.5" armor="2.5"/> <skill fist="2.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="2.5" distDamage="2.5" wandDamage="2.5" magDamage="2.5" magHealingDamage="2.5" defense="2.5" magDefense="2.5" armor="2.5"/> <skill fist="2.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="6" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="7" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="8" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="25" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="9" name="Spin Assassin" description="an Spin Assassin" needpremium="1" gaincap="20" gainhp="15" gainmana="30" gainhpticks="1" gainhpamount="20" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.5" attackspeed="350" soulmax="300" gainsoulticks="20" fromvoc="5" lessloss="30"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="0.9" club="0.9" sword="0.9" axe="0.9" distance="0.9" shielding="0.9" fishing="0.9" experience="1.0"/> </vocation> <vocation id="10" name="Spin Assassin" description="an Spin Assassin" needpremium="1" gaincap="20" gainhp="15" gainmana="30" gainhpticks="1" gainhpamount="20" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.5" attackspeed="350" soulmax="300" gainsoulticks="20" fromvoc="6" lessloss="30"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="0.9" club="0.9" sword="0.9" axe="0.9" distance="0.9" shielding="0.9" fishing="0.9" experience="1.0"/> </vocation> <vocation id="11" name="Spin Assassin" description="an Spin Assassin" needpremium="1" gaincap="20" gainhp="15" gainmana="30" gainhpticks="1" gainhpamount="20" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.5" attackspeed="350" soulmax="300" gainsoulticks="20" fromvoc="7" lessloss="30"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="0.9" club="0.9" sword="0.9" axe="0.9" distance="0.9" shielding="0.9" fishing="0.9" experience="1.0"/> </vocation> <vocation id="12" name="Spin Assassin" description="an Spin Assassin" needpremium="1" gaincap="20" gainhp="15" gainmana="30" gainhpticks="1" gainhpamount="20" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.5" attackspeed="350" soulmax="300" gainsoulticks="20" fromvoc="8" lessloss="30"> <formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.0" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/> <skill fist="0.9" club="0.9" sword="0.9" axe="0.9" distance="0.9" shielding="0.9" fishing="0.9" experience="1.0"/> </vocation> </vocations> Faça a Quest novamente e veja se deu certo. Abraços !! :smile_positivo:
  12. Gostaria de saber apenas que função usa para o monstro perder o alvo.
    Tipo, to desenvolvendo um script onde o monstro não ataca quem tiver "X" Storage. Esta tudo certo, mas eu tambem queria que o Monstro não ficasse com o Alvo ensina do Player. Então quero saber como faz pro monstro perder o alvo.
    Abraços !!
  13. fokus090

    Uma Duvida Rapida!

    Gostaria de saber apenas que função usa para o monstro perder o alvo. Tipo, to desenvolvendo um script onde o monstro não ataca quem tiver "X" Storage. Esta tudo certo, mas eu tambem queria que o Monstro não ficasse com o Alvo ensina do Player. Então quero saber como faz pro monstro perder o alvo. Abraços !! :smile_positivo:
  14. Não pode fazer com que 4 vocações torne-se apenas uma por causa disso ... fromvoc="6"> Se quer que as 4 vocações iniciais torne-se 1 só depois da Quests, então você tem que criar 4 Tags de vocações. Assim: Voc ID: 1 --< Sorcerer >-- Voc ID: 2 --< Druid >-- Voc ID: 3 --< Paladin >-- Voc ID: 4 --< Knight >-- Depois da Quests Voc ID: 5 fromvoc="1" --< Mixed Assassin >-- Voc ID: 6 fromvoc="2" --< Mixed Assassin >-- Voc ID: 7 fromvoc="3" --< Mixed Assassin >-- Voc ID: 8 fromvoc="4" --< Mixed Assassin >-- É só depois da Quest, as vocações de ID: 5 á 8 terem os mesmos nomes. Espero ter ajudado! Abraços !! :smile_positivo:
  15. fokus090

    [Pedido] Monstros

    Olá Galerinha do :XTibia_smile: . Bem, preciso de 2 Scrpters que finalizar um Projeto que tenho em mente. Segue Abaixo: :-: 1º Pedido :-: :forward: Script de um Monstro que só ataca quem não tiver a Storage definida no Script. Ex: Existe 100 Players no OT. 50 Players tem a Storage 30000. 50 Players tem a Storage 30001 Quero que o Monstro ataque apenas os Jogadores que possui a Storage 30001. Ignorando os Players que possui a Storage 30000. Importante dizer que os Players que possui a Storage 30000 não poderá atacar o monstro (Não sei se isso é possível, mas...) :-: 2º Pedido :-: :forward: Quero que ao Eliminar o Monstro, dê uma Storage apenas para quem possui determinada Storage. E um pouco confuso mas eu vou Explicar. Ex: Existe 100 Players no OT. 50 Players tem a Storage 30000. 50 Players tem a Storage 30001 Se o Jogador Eliminar o Monstro, e esse jogador tiver a Storage 30001, então todos os Outros jogadores que tambem possui a Storage 30001, recebe a Storage 30002. Não sei se o meu pedido será atendido, pois não tenho idêia se o que eu pedi é fácil de ser criado. Mas conto com a sorte e colaboração de todos. Abraços !! :smile_positivo:
  16. 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 local node1 = keywordHandler:addKeyword({'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) local node1 = keywordHandler:addKeyword({'promotion vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to vocation vip you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 30000, level = 20, promotion = 2, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new()) Dialogo: HI Promotion Vip Yes Tenta aí! Abraços!! :smile_positivo:
  17. 2º Pedido Clique Aqui! Abraços !! :smile_positivo:
  18. 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, 'curar') then local max = getCreatureMaxHealth(cid) local max = getCreatureMaxMana(cid) doCreatureAddHealth(cid, max) doCreatureAddMana(cid, max) doSendMagicEffect(getCreaturePosition(cid), 12) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Tentah aí! Abraços !! :smile_positivo:
  19. Tutorial, criando novas Vocações: Clique Aqui! by: XJhoow Abraços !! :smile_positivo:
  20. NPC: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {}[/i] [i]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[/i] [i]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, 'curar') then local max = getCreatureMaxHealth(cid) local max = getCreatureMaxMana(cid) doCreatureAddHealth(cid, max) doCreatureAddMana(cid, max) doSendMagicEffect(getCreaturePosition(cid), 12) end end[/i] [i]npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Aol: CreatureScripts.xml <event type="preparedeath" name="forever amulet" event="script" value="aol.lua"/> Creaturescripts/Scripts function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if (getCreatureSkullType(cid) >= 4) then if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then doCreatureSetDropLoot(cid, false) end return true end return true end Agora vá na pasta Login e adicione isso: registerCreatureEvent(cid, "forever amulet") Obs: Nos items Xml procure o Id 2196 e coloque isto <attribute key="preventDrop" value="1" /> Não sei como por o efeito que você quer. Portas: E as portas ... bem. Essa eu ainda não sei como fazer, mas deve da um trabalho. Abraços !! :smile_positivo:
  21. 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, 'exori')) then selfSay('voce gostaria de aprender exori?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8) then if(getPlayerLevel(cid) >= 200 and getPlayerLearnedInstantSpell(cid, "Exori") == FALSE) then doPlayerLearnInstantSpell(cid, "Exori") selfSay('Agora voce aprendeu a magia exori.', cid) else selfSay('Voce ja aprendeu esta magia ou não possui nivel suficiente.', cid) end else selfSay('Apenas Knights e Elite Knights podem aprender esta magia.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Certo então.', cid) end if(msgcontains(msg, 'exura')) then selfSay('voce gostaria de aprender exura?', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then if getPlayerVocation(cid) > 0 then if(getPlayerLevel(cid) >= 10 and getPlayerLearnedInstantSpell(cid, "Exura") == FALSE) then doPlayerLearnInstantSpell(cid, "Exura") selfSay('Agora voce aprendeu a magia exura.', cid) else selfSay('Voce ja aprendeu esta magia ou não possui nivel suficiente.', cid) end else selfSay('Apenas jogadores com vocações podem aprender esta magia.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Certo então.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Tentah aí. Abraços!! :smile_positivo:
  22. function onUse(cid, item, frompos, item2, topos) voc = getPlayerVocation(cid) queststatus = getPlayerStorageValue(cid,11566) if voc == 1 then if queststatus == -1 then doPlayerAddItem(cid,9778,1) setPlayerStorageValue(cid,11566,1) else doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 2 then if queststatus == -1 then doPlayerAddItem(cid,9778,1) setPlayerStorageValue(cid,11566,1) else doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 3 then if queststatus == -1 then doPlayerAddItem(cid,9777,1) setPlayerStorageValue(cid,11566,1) else doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 4 then if queststatus == -1 then doPlayerAddItem(cid,9776,1) setPlayerStorageValue(cid,11566,1) doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 5 then if queststatus == -1 then doPlayerAddItem(cid,9778,1) setPlayerStorageValue(cid,11566,1) doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 6 then if queststatus == -1 then doPlayerAddItem(cid,9778,1) setPlayerStorageValue(cid,11566,1) doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 7 then if queststatus == -1 then doPlayerAddItem(cid,9777,1) setPlayerStorageValue(cid,11566,1) doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end elseif voc == 8 then if queststatus == -1 then doPlayerAddItem(cid,9776,1) setPlayerStorageValue(cid,11566,1) else doPlayerSendTextMessage(cid,22,"Você já recebeu o seu prêmio.") end else return 0 end return 1 end Tag: <action actionid="0000" script="NomeDoArquivo.lua"/> Configuração: Os Números de 1 a 8 são os IDs da vocação. ID: 1 = Sorcerer ; ID: 2 = Druid ... ID: 5 = Master Sorcerer ; ID: 6 = Elder Druid ... E assim por diante. Basta mudar a recompensa de cada vocação. Abraços !! :smile_positivo:
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...