Addon Npc Para Forgotten Server

lithium
em NPCs, monsters e raids

lithium

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/06Posts: 190

Oi galera

estou postando aqui um script de NPC de Addons para o Forgotten Server

100% feito por mim!

 

vamos ao script

 

Crie um arquivo chamado Varkhal.xml em data/npc/ e cole isso:

------------------------------------------------------------------------
------------- Addon NPC for Forgotten Server ---------------
---------------------- Script by Lithium --------------------------
------------------------------------------------------------------------
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

function creatureSayCallback(cid, type, msg)
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    if(npcHandler.focus ~= cid) then
        return false
    end

      if msgcontains(msg, 'addons') or msgcontains(msg, 'addon')  or msgcontains(msg, 'addoner') then
          selfSay('I sell the first addon for 5k and the second addon for 10k.')
    elseif getPlayerPremiumDays(cid) > 0 then
        if msgcontains(msg, 'first addon') then
            selfSay('Do you want to buy the first addon for 5k?')
            talk_state = 1
        elseif msgcontains(msg, 'second addon') then
            selfSay('Do you want to buy the second addon for 10k?')
            talk_state = 2            
        elseif talk_state == 1 then
            if msgcontains(msg, 'yes') then
                  if doPlayerRemoveMoney(cid,5000) then
                    if getPlayerSex(cid) == 1 then
                        for x = 128, 134 do
                            doPlayerAddOutfit(cid, x, 1)
                        end
                        for y = 143, 146 do
                            doPlayerAddOutfit(cid, y, 1)
                        end        
                        for z = 151, 154 do
                            doPlayerAddOutfit(cid, z, 1)                     
                        end                 
                    else
                        for x = 136, 142 do
                            doPlayerAddOutfit(cid, x, 1)
                        end
                        for y = 147, 150 do
                            doPlayerAddOutfit(cid, y, 1)
                        end        
                        for z = 155, 158 do
                            doPlayerAddOutfit(cid, z, 1)
                        end
                    end
                    selfSay('You have now the first addon!')
                else
                    selfSay('Sorry, you don\'t have enough money.')
                end
             end
            talk_state = 0
        elseif talk_state == 2 then
            if msgcontains(msg, 'yes') then
                if doPlayerRemoveMoney(cid,10000) then
                    if getPlayerSex(cid) == 1 then
                        for x = 128, 134 do
                            doPlayerAddOutfit(cid, x, 2)
                        end
                        for y = 143, 146 do
                            doPlayerAddOutfit(cid, y, 2)
                        end        
                        for z = 151, 154 do
                            doPlayerAddOutfit(cid, z, 2)                     
                        end                 
                    else
                        for x = 136, 142 do
                            doPlayerAddOutfit(cid, x, 2)
                        end
                        for y = 147, 150 do
                            doPlayerAddOutfit(cid, y, 2)
                        end        
                        for z = 155, 158 do
                            doPlayerAddOutfit(cid, z, 2)
                        end
                    end
                    selfSay('You have now the second addon!')
                else
                    selfSay('Sorry, you don\'t have enough money.')
                end
             end
            talk_state = 0            
        elseif msgcontains(msg, 'bye') then
            selfSay('Good bye!')

            talk_state = 0
        end
    else
        selfSay('You need a premium account to buy \'addons\', there\'s nothing else you can do here..')
    end
    return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Creditos: 100% Lithium

 

Comentários please ;)

-LMS-

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 28/03/07Posts: 43Char no Tibia: Rezhos

Opa, npc muito bom, esse Jiddo System é maravilhoso, vlw ^^



Att,
Leandro Sousa
webdesigner
leandro_lms@yahoo.com.br

skynagerloas

Ex-Moderador
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 13/11/05Posts: 715Char no Tibia: Lord'Skyxt

Mexendo com script agora Lithium?

São os Addon's novos?

Abraços.

Atenciosamente, Sky - Lord'Skyxt;

 

Antes de postar, leia isso:



Regras.

[Lord'SkyXT] [FloGão]

lithium

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/06Posts: 190

to mexendo com scripts para ot porque estou fazendo um server utilizando o forgotten server como no forgotten não vem com esse npc eu mesmo fiz ;)

krynox

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/12/05Posts: 18

Eh pra quem usa forgotten eh muito bom...e eu usei num otservzim que tenho aqui funciono direitim!!

<<<<Kry>>>>

Exordium

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 24/01/06Posts: 190

Yeah! muito bom

Lithium sempre ajudando, principalmente com quem usa o forgotten :D

 

flw.

Sou fã de:







garep

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/01/06Posts: 118Char no Tibia: Bahanot

tipow temque ser todos os addons de uma so fez ??? tem como por de uma em uma não !