Forum o OTS

Forum o OTS


#1 2008-05-22 10:04:35

Toomek

Administrator

Zarejestrowany: 2008-05-22
Posty: 11
Punktów :   

[npc] Barman

Skrypt nie mój
Tworzymy plik o nazwie Barman.xml w data/npc i wklejamy tam:

Spoiler:

<npc name="Barman" script="data/npc/scripts/drinks.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
    <health now="150" max="150"/>
    <look type="128" head="20" body="100" legs="50" feet="99" corpse="2212"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Im the bar guy." />
        <parameter key="message_needmoremoney" value="You do not have enough money." />
        <parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you?" />
    </parameters>
</npc>

Następnie w data/npc/scripts tworzymy drinks.lua i wpisujemy:

Spoiler:

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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'lemonade', 'lemondrink'},                     2006, 10,     5,     'lemonade')
shopModule:addBuyableItem({'fruit juice', 'fruitjuice'},                     2006, 10,     21,    'fruit juice')
shopModule:addBuyableItem({'beer', 'b_e_e_r'},                     2006, 10,     3,    'beer')
shopModule:addBuyableItem({'milk', 'm_i_l_k'},                     2006, 10,     6,    'milk')
shopModule:addBuyableItem({'coconut', 'c_o_c_o_n_u_t'},                     2006, 10,     14,    'coconut milk')
shopModule:addBuyableItem({'wine', 'w_i_n_e'},                     2006, 10,     15,    'wine')
shopModule:addBuyableItem({'rum', 'r_u_m'},                     2006, 10,     27,    'rum')

npcHandler:addModule(FocusModule:new())

I mamy Barmana

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.4fpc.pun.pl www.genelia-imran.pun.pl www.eusiowy.pun.pl www.polonistycznie.pun.pl www.haszczaki.pun.pl