Jump to content

Scripting NPC Barco/Tapete para Vip e Free


Recommended Posts

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

Dae galera, gostaria que o mesmo NPC funcione para vip e para quem não é vip. Nesse exemplo, coloquei abaixo, a cidade Balneario Camboriu como cidade vip...

Player: Hi, Balneario, yes
NPC: Vc não é Vip...

E para as outras cidades o Free Acc  poderá viajar, ou seja, o mesmo npc fala com Vip e quem não é Vip. Acho que da pra entender hehe

 

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

NPC: Pino.lua

local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        
        
        
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Darashia on Darama for 40 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 40, destination = {x=33270, y=32441, z=6} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
        
    local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Svargrond for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32253, y=31097, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
        
    local travelNode = keywordHandler:addKeyword({'femor hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
            
            local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
       
    local travelNode = keywordHandler:addKeyword({'zao'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Zao for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

	local travelNode = keywordHandler:addKeyword({'balneario camboriu'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Balneario Camboriu for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

        npcHandler:addModule(FocusModule:new()) 

Pino.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Pino" script="data/npc/scripts/Pino.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="115" body="0" legs="67" feet="114" addons="0"/>
<voices>
<voice text="Feel the wind in your hair during one of my carpet rides!" interval2="120" margin="1" yell="no"/>
</voices>
<parameters>
        <parameter key="message_greet" value="Greetings, traveller |PLAYERNAME|. Where do you want me to fly you?"/>
        <parameter key="message_farewell" value="Good bye!"/>
		<parameter key="message_walkaway" value="Good bye!" />
</parameters>
</npc>

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Link to post
Share on other sites

23 horas atrás, stauro disse:

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

 

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


NPC: Pino.lua

local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        
        
        
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Darashia on Darama for 40 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 40, destination = {x=33270, y=32441, z=6} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
        
    local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Svargrond for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32253, y=31097, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
        
    local travelNode = keywordHandler:addKeyword({'femor hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
            
            local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})
       
    local travelNode = keywordHandler:addKeyword({'zao'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Zao for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

	local travelNode = keywordHandler:addKeyword({'balneario camboriu'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Balneario Camboriu for 60 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'})

        npcHandler:addModule(FocusModule:new()) 

Pino.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Pino" script="data/npc/scripts/Pino.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="115" body="0" legs="67" feet="114" addons="0"/>
<voices>
<voice text="Feel the wind in your hair during one of my carpet rides!" interval2="120" margin="1" yell="no"/>
</voices>
<parameters>
        <parameter key="message_greet" value="Greetings, traveller |PLAYERNAME|. Where do you want me to fly you?"/>
        <parameter key="message_farewell" value="Good bye!"/>
		<parameter key="message_walkaway" value="Good bye!" />
</parameters>
</npc>

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

UP

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Bruce Pereira
      Eu quero colocar uma storage nesse jutsu de dash, para poder criar outros jutsus, eu criei 3 dashs em meu servidor mas ta bugando. exemplo: uso o dash 1 aparece o efeito do dash 2, uso dash 2 e aparece o efeito do dash 3, eu tentei colocar uma storage mas não consegui.
       
      script sem edição minha \/
       
       
    • By stauro
      Alguém poderia me ajudar a colocar bonus exp no meu cast system?
       
       
       
       
       
       
       
       function onSay(cid, words, param, channel) local tmp = param:explode(" ") if not(tmp[1]) then return doPlayerSendCancel(cid, "Parameters needed") end if tmp[1] == "on" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast has started.") doPlayerSetCastState(cid, true) doPlayerSave(cid) elseif getPlayerCast(cid).status == false then return doPlayerSendCancel(cid, "Your cast has to be running for this action.") elseif tmp[1] == "off" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast has ended.") doPlayerSetCastState(cid, false) doPlayerSave(cid) elseif isInArray({"pass", "password", "p"}, tmp[1]) then if not(tmp[2]) then return doPlayerSendCancel(cid, "You need to set a password") end if tmp[2]:len() > 10 then return doPlayerSendCancel(cid, "The password is too long. (Max.: 10 letters)") end if tmp[2] == "off" then doPlayerSetCastPassword(cid, "") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password has been removed.") else doPlayerSetCastPassword(cid, tmp[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password was set to: " .. tmp[2]) end elseif isInArray({"desc", "description", "d"}, tmp[1]) then local d = param:gsub(tmp[1]..(tmp[2] and " " or ""), "") if not(d) or d:len() == 0 then return doPlayerSendCancel(cid, "You need to specify a description.") end if d:len() > 50 then return doPlayerSendCancel(cid, "The description is too long. (Max.: 50 letters)") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast description was set to: ") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, d) doPlayerSetCastDescription(cid, d) elseif tmp[1] == "ban" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify a spectator that you want to ban.") end if doPlayerAddCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been banned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be banned.") end elseif tmp[1] == "unban" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify the person you want to unban.") end if doPlayerRemoveCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unbanned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unbanned.") end elseif param == "bans" then local t = getCastBans(cid) local text = "Cast Bans:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No bans." end doShowTextDialog(cid, 5958, text) elseif tmp[1] == "mute" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify a spectator that you want to mute.") end if doPlayerAddCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been muted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be muted.") end elseif tmp[1] == "unmute" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify the person you want to unmute.") end if doPlayerRemoveCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unmuted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unmuted.") end elseif param == "mutes" then local t = getCastMutes(cid) local text = "Cast Mutes:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No mutes." end doShowTextDialog(cid, 5958, text) elseif param == "viewers" then local t = getCastViewers(cid) local text, count = "Cast Viewers:\n#Viewers: |COUNT|\n\n", 0 for _,v in pairs(t) do count = count + 1 text = text .. "*" .. v.name .."\n" end if text == "Cast Viewers:\n#Viewers: |COUNT|\n\n" then text = "Cast Viewers:\n\nNo viewers." end text = text:gsub("|COUNT|", count) doShowTextDialog(cid, 5958, text) elseif param == "status" then local t, c = getCastViewers(cid), getPlayerCast(cid) local count = 0 for _,v in pairs(t) do count = count + 1 end doShowTextDialog(cid, 5958, "Cast Status:\n\n*Viewers:\n " .. count .. "\n*Description:\n "..(c.description == "" and "Not set" or c.description).."\n*Password:\n " .. (c.password == "" and "Not set" or "Set - '"..c.password.."'")) elseif param == "update" then if getPlayerStorageValue(cid, 656544) > os.time() then return doPlayerSendCancel(cid, "You used this command lately. Wait: " .. (getPlayerStorageValue(cid, 656544)-os.time()) .. " sec.") end doPlayerSave(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The cast settings have been updated.") doPlayerSetStorageValue(cid, 656544, os.time()+60) end return true end  
       
       
    • By stauro
      Alguém sabe como adicionar atributo de sorte no item? Tipo  "Luck + 2%"
      Não consigo achar nenhum item que tenha pra eu copiar, os itens que eu sei não estão com esse atributo
       
       
       
       
         
       
       
      Resolvido.
    • By Bruce Pereira
      Alguém me ajudar a adicionar uma storage nessa script, tentei de varias formas e não consegui.
       
       
    • By raphadoidera
      .Qual servidor ou website você utiliza como base? 
      8.60
      Qual o motivo deste tópico? 
      Esse script de trap está dando exhausted no combo. Eu queria que o char depois de usar a Trap, continuasse combando no alvo. Alguém pode ajudar?
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

      WhatsApp_Video_2021-05-03_at_16_03_21.mp4 @139 salva nessa irmão?
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo