Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Olá Turma estou criando meu server e gostaria de por uma quest onde existisse um NPC, ao falar mission, o npc mandaria você pegar 10 "shards"

ao retornar a ele com os 10 shards em mão. ele pegaria o seus Shards. E iria liberar uma storage, para que você pudesse passar por uma porta..

 

Ou seja você só teria acesso para passar por tal porta apos entregar os 10 shards ao NPC...

 

 

Obrigado. Espero Ajudas.

Meus Trabalhos:

 

*Spell Rajada de Flechas: http://migre.me/eI3aE

 

 

 

 

gif1705.gif

 

  • Respostas 13
  • Visualizações 2.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • GiovaniRodrigo
    GiovaniRodrigo

    Vamos começar pelo NPC. Crie um arquivo chamado npcquest.lua na pasta data/npc/scripts e cole isso dentro   Crie um arquivo chamado Npc Quest.xml na pasta data/npc e cole isso dentro   &l

  • principe sharingan
    principe sharingan

    Então no caso você quer um NPC de Task certo ?

  • principe sharingan
    principe sharingan

    Bom, agora eu estou em casa e to com meu pc  º/ Vi que pelo jeito a Script não deu muito certo, então vamo lá....     Vá em data/npc e crie um arquivo taskshards.XML e põe isso dentro:   N

Postado
  • Este é um post popular.

Vamos começar pelo NPC.

Crie um arquivo chamado npcquest.lua na pasta data/npc/scripts e cole isso dentro

 

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

local itemId = 7290
local countItem = 10

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, 'mission') then
                    if getPlayerStorageValue(cid, 30003) == -1 then
                              npcHandler:say('Good, I need you to pick up some '.. getItemNameById(itemId) ..' for me, to be more exact I need '.. countItem ..', you think you can do this task?', cid)
                              talkState[talkUser] = 1
                    else
                              npcHandler:say('Have you done this task for me, skirt here and of chance to another.', cid)
                    end
          elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
                    npcHandler:say('Excellent! Collect '.. countItem ..' '.. getItemNameById(itemId) ..' and come back talking about {'.. getItemNameById(itemId) ..'}.', cid)
                    talkState[talkUser] = 2
                    setPlayerStorageValue(cid, 30003, 1)

          elseif talkState[talkUser] == 2 then
                    if msgcontains(msg, 'shard') then
                              if getPlayerStorageValue(cid, 30003) == 1 then
                                        if getPlayerItemCount(cid, itemId) == countItem then
                                                  doPlayerRemoveItem (cid, itemId, countItem)
                                                  setPlayerStorageValue(cid, 30003,  2)
                                                  talkState[talkUser] = 0
              npcHandler:say('Thank you! Now you have permission to pass the door.', cid)
                                        else
                                                  npcHandler:say('You did not collected the items I asked, refreshing your memory, I asked to collect '.. countItem ..' '.. getItemNameById(itemId) ..'.', cid)
                                        end
                              else
                                        npcHandler:say('Not asked you nothing.', cid)
                              end
                    else
                              npcHandler:say('So GET OUT IMMEDIATELY.', cid)
                    end
          end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Crie um arquivo chamado Npc Quest.xml na pasta data/npc e cole isso dentro

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nome Npc" script="data/npc/scripts/npcquest.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1">
          <health now="150" max="150"/>
          <look type="128" head="97" body="100" legs="115" feet="114" corpse="2212"/>
          <parameters>
                    <parameter key="message_greet" value="Hello, |PLAYERNAME|! Would like to do a {mission} for me?"/>
                    <parameter key="message_walkaway" value="Hey Hey, where you go?"/>
                    <parameter key="message_farewell" value="Goodbye |PLAYERNAME|."/>
          </parameters>
</npc>

 

Configurando

 

<npc name="Nome Npc" script="data/npc/scripts/npcquest.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1">

 

name="Nome Npc"                    //Nome do NPC

 

Agora vamos para a porta

 

Actions

Crie um arquivo chamado storagedoor.lua na pasta data/action/scripts e cole isso dentro

 

function onUse(cid, item, frompos, item2, topos)
          if getPlayerStorageValue(cid, 30003) >= 1 then
                    doTransformItem(item.uid,item.itemid+1)
                    doTeleportThing(cid, topos)
          else
                    doPlayerSendTextMessage(cid, 22, 'You don\'t have access to area.')
          end
end

 

Adicione a seguinte linha no arquivo actions.xml que esta na pasta data/actions

 

<action actionid="4587" event="script" value="storagedoor.lua" />

 

Movements

Crie um arquivo chamado storagedoor.lua na pasta data/movements/scripts e cole isso

 

function onStepOut(cid, item, position, fromposition)
          doTransformItem(item.uid,item.itemid-1)
end

 

Adicione a seguinte linha no arquivo movements.xml que esta na pasta data/movements

 

<movements type="StepOut" actionid="4587" event="script" value="storagedoor.lua" />

 

MapEditor

No MapEditor coloque a porta com o Action ID 4587

 

Não testei caso der erro avise.

Dúvidas? Me avise.

 

@EDIT

Editei o script do NPC pois tinha esquecido de algo.

 

(OBS: Use portas que ela fechada seja um ID antes da aberta, ex: Fechada: 5112 e Aberta: 5113)

 

Att.

Giovani Rodrigo

Editado por GiovaniRodrigo (veja o histórico de edições)

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

Postado

Parabéns Giovani, como não estou em casa fico agradecido de disponibilizar para ele esta Script. Já que no momento não estou com ela em meu PC pois não estou com ele agr ! rsrs' Ganhou meu Rep+ 

Editado por principe sharingan (veja o histórico de edições)

eR3Xwgv.png?1
 

Postado

Obrigado, fico feliz em ajudar o pessoal daqui do fórum.

 

Att.

Giovani Rodrigo

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo