Nie tylko o tibii...
SKRYPT NIE MÓJ!!!
Przedstawiam wam npc, który sprzedaje potions (tylko i wyłącznie potions).
Wchodzimy w data/npc robimy plik o nazwie. Chevran.xml dajemy do niego to :
Spoiler:
<npc name="Chevran" script="data/npc/scripts/potions.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="128" head="134" body="119" legs="116" feet="76" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell health potions and mana potions." />
<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>
Potem wchodzimy w data/npc/scripts i robimy plik o nazwie potions.lua i dajemy do niego to :
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({'manapotion', 'manapotion'}, 7620, 100, 'mana potion')
shopModule:addBuyableItem({'healthpotion', 'healthpotion'}, 7618, 100, 'health potion')
shopModule:addBuyableItem({'strong mana potion', 'strong mana potion'}, 7589, 300, 'strong mana potion')
shopModule:addBuyableItem({'strong health potion', 'strong health potion'}, 7588, 300, 'strong health potion')
shopModule:addBuyableItem({'great mana potion', 'great mana potion'}, 7590, 500, 'great mana potion')
shopModule:addBuyableItem({'great health potion', 'great health potion'}, 7591, 500, 'great health potion')
npcHandler:addModule(FocusModule:new())
Npc sprzedaje takie potionki :
Spoiler:
mana potion, healthpotion, strong mana potion, strong health potion, great mana potion, great health potion.
Offline
latwo może nie ale trudno też nie ponieważ większość to podstawowe funkcje NPC
a reszta to skopiować od innego npc co coś sprzedaje ustawić tekst jaki trzeba powiedzieć zmienić id kupowanego przedmiotu i cene
Offline
Myślisz że każdy kto pisze takie skrypty to sam pisze wszyściuteńko?
Nikomu się nie chce zupełnie wszystkiego pisać.
Offline