Ir para conteúdo

Featured Replies

Postado
local starterpokes = {
["Totodile"] = {x = 53, y = 70, z = 7},
["Chikorita"] = {x = 51, y = 70, z = 7},
["Cyndaquil"] = {x = 49, y = 70, z = 7},
["Charmander"] = {x = 43, y = 70, z = 7},
["Bulbasaur"] = {x = 45, y = 70, z = 7},
["Squirtle"] = {x = 47, y = 70, z = 7},
}


local btype = "normal"

function onUse(cid, item, frompos, item2, topos)

	if getPlayerLevel(cid) > 8 then
	return true
	end

	local pokemon = ""

	for a, b in pairs (starterpokes) do
		if isPosEqualPos(topos, b) then
			pokemon = a
		end
	end

	if pokemon == "" then return true end
	
	if getPlayerStorageValue(cid, 9658754) ~= 1 then              --alterado v2.7 -opicional-
       sendMsgToPlayer(cid, 27, "Você precisa fala com prof Robert primeiro! [Dica Escreva HI e depois city] e escolha sua cidade e fala [YES]")
       return true
    end

	addPokeToPlayer(cid, pokemon, level, extrastr, nil, 0, btype, true)    --alterado v2.9
   doPlayerAddItem(cid, 2394, 10)
   doPlayerAddItem(cid, 2148, 50)   
   doPlayerAddItem(cid, 12222, 10) 
  doPlayerAddItem(cid, 10223, 1)                                       
   --alterado v2.9

	doPlayerSendTextMessage(cid, 27, "Você tem o seu primeiro pokemon! Você também recebeu algumas pokeballs para ajudá-lo em sua Jornada.")
	doPlayerSendTextMessage(cid, 27, "Não se esqueça de usar a sua pokedex em todos os pokemon desconhecido!.")

	doSendMagicEffect(getThingPos(cid), 29)
	doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	doSendMagicEffect(getThingPos(cid), 27)
	doSendMagicEffect(getThingPos(cid), 29)

return TRUE
end

Tag do xml

<action itemid="1740" event="script" value="starter.lua"/>

 

 

 

npc robert xml.

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Professor Robert" script="profrobert.lua" floorchange="0" speed="0">
<health now="150" max="150"/>
<look type="522" head="97" body="114" legs="114" feet="0"/>
 
<parameters>
 
<parameter key="message_greet" value="Hello |PLAYERNAME|, what city do you want to begin your jorney? Fale {City}"/>
 
</parameters>
</npc>

 
script.lua

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
 
local places = {
["saffron"] = 1,
["cerulean"] = 2,
["lavender"] = 3,
["fuchsia"] = 4,
["celadon"] = 5, 
["viridian"] = 6, 
["vermilion"] = 7, 
["pewter"] = 8,                      
["cinnabar"] = 10,
}
       
        if msgcontains(string.lower(msg), 'city') or msgcontains(string.lower(msg), 'citys') then
           if getPlayerStorageValue(cid, 9658754) == 1 then
              selfSay("Você já escolheu sua cidade inicial!", cid)
              return true
           else
              selfSay("Você pode escolher sua cidade inicial: {Saffron, Cerulean, Lavender, Fuchsia, Celadon, Viridian, Vermilion, Pewter ou Cinnabar}.", cid) 
              return true
           end
        elseif places[string.lower(msg)] then
           city = string.lower(msg)
           selfSay("Tem certeza que você quer começar em {".. doCorrectString(msg) .."}?", cid) 
           talkState[talkUser] = 2
           return true
       elseif msgcontains(msg, "yes") or msgcontains(msg, "Yes") and talkState[talkUser] == 2 then   
           if getPlayerStorageValue(cid, 9658754) == 1 then
              selfSay("Você já escolheu sua cidade inicial!", cid)
              return true
           else
              selfSay("OK... Agora sua cidade iniciante é ".. doCorrectString(city)..". Você pode escolher seu pokemon e tenha uma boa jornada!", cid)
              doPlayerSetTown(cid, places[city])
              setPlayerStorageValue(cid, 9658754, 1)
              return true
           end
        elseif msgcontains(msg, "no") or msgcontains(msg, "No") and talkState[talkUser] == 2 then  
           selfSay("Ok then... say again what city you want to begin!", cid)
           talkState[talkUser] = 0
           return true 
        end
 
return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())             

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

 

 

  • Respostas 16
  • Visualizações 6.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Bom acho que posso li ajudar    Vai em Data/action/Copia qualquer arquivo .lua renomeia para pokemonbau.lua local btype = "ultra" local pokemon = "Mewtwo"   local storage = 747474 -- storage     f

  • tenta essa  function onUse(cid, item, frompos, item2, topos) local zub = {x=850,y=1077,z=5} local cat = {x=852,y=1077,z=5} local pid = {x=854,y=1077,z=5} local pox = getPlayerPosition(cid)   if getPl

  • local starterpokes = { ["Totodile"] = {x = 53, y = 70, z = 7}, ["Chikorita"] = {x = 51, y = 70, z = 7}, ["Cyndaquil"] = {x = 49, y = 70, z = 7}, ["Charmander"] = {x = 43, y = 70, z = 7}, ["Bulbasaur"]

  • 4 months later...
Postado

Dependendo da base do seu pokémon, esse script ja deve ter nele basta copiar e editar!

 

Mas onde está o script?

 

Simples, sabe aquela quest inicial que você escolhe um pokemon, isso mesmo, o script dela é basicamente o que você quer fazer.

 

 

O que editar?

 

Dependendo da base do poke poucas coisas, será actionid e a storage . E também poderá ter que remover a parte que teleporta o player a determinada posição ou alterar para posição ao seu gosto.

 

OBS: terá que edita coisas do tipo: tipo de pokebola, nome pokémon e até msm level dele de acordo com seu servidor(mas são as coisas mais básicas que qualque um que se diga scripter ou até mesmo Otadmin tem que saber.

 

 

 

Ajudei? Da REP+!! Não Cai a Mão!

 

Até!

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