janek obarzanek
Advanced User
- Dołączył
- Marzec 11, 2009
- Posty
- 341
- Liczba reakcji
- 21
Mam problem z npc! gdy do nich pisze pisz? mi na default a chcia?bym ?eby pisali mi automatycznie na NPC channel
To przk?adowy scrypt NPC na moim ots-ie
Przk?adowy NPC.xml
a to crypt do niego
data/npc/scripts/rings.lua
Prosz? o syzbka pomoc dam repucika
To przk?adowy scrypt NPC na moim ots-ie
Przk?adowy NPC.xml
PHP:
<?xml version="1.0"?>
<npc name="Jubiler" script="data/npc/scripts/rings.lua">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="114" body="119" legs="132" feet="114"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|.Sell almulets and rings." />
<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>
a to crypt do niego
data/npc/scripts/rings.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'sword ring'}, 2207, 200, 'sword ring')
shopModule:addBuyableItem({'club ring'}, 2209, 200, 'club ring')
shopModule:addBuyableItem({'axe ring'}, 2208, 200, 'axe ring')
shopModule:addBuyableItem({'power ring'}, 2166, 200, 'power ring')
shopModule:addBuyableItem({'energy ring'}, 2167, 500, 'energy ring')
shopModule:addBuyableItem({'life ring'}, 2168, 1500, 'life ring')
shopModule:addBuyableItem({'time ring'}, 2169, 1000, 'time ring')
shopModule:addBuyableItem({'might ring'}, 2164, 2000, 'might ring')
shopModule:addBuyableItem({'ring of healing'}, 2214, 3000, 'ring of healing')
shopModule:addBuyableItem({'stealth ring'}, 2165, 1000, 'stealth ring')
shopModule:addBuyableItem({'stone skin amulet'}, 2197, 2000, 'stone skin amulet')
shopModule:addBuyableItem({'protection amulet'}, 2200, 200, 'protection amulet')
shopModule:addBuyableItem({'elven amulet'}, 2198, 500, 'elven amulet')
shopModule:addBuyableItem({'platinum amulet'}, 2171, 2000, 'platinum amulet')
shopModule:addBuyableItem({'dragon necklace'}, 2201, 1000, 'dragon necklace')
shopModule:addBuyableItem({'garlic necklace'}, 2199, 500, 'garlic necklace')
shopModule:addBuyableItem({'dwarven ring'}, 2213, 2000, 'dwarven ring')
shopModule:addSellableItem({'Black Pearl'}, 2144, 300, 'Black Pearl')
shopModule:addSellableItem({'White Pearl'}, 2143, 200, 'White Pearl')
shopModule:addSellableItem({'Talon'}, 2151, 400, 'Talon')
shopModule:addSellableItem({'Small Topaz'}, 9970, 200, 'Small Topaz')
shopModule:addSellableItem({'Small Sapphire'}, 2146, 250, 'Small Sapphire')
shopModule:addSellableItem({'Small Ruby'}, 2147, 250, 'Small Ruby')
shopModule:addSellableItem({'Small Emerald'}, 2149, 250, 'Small Emerald')
shopModule:addSellableItem({'Small Diamond'}, 2145, 300, 'Small Diamond')
shopModule:addSellableItem({'Small Amethyst'}, 2150, 200, 'Small Amethyst')
shopModule:addSellableItem({'Scarab coin'}, 2159, 1000, 'Scarab coin')
npcHandler:addModule(FocusModule:new())
Prosz? o syzbka pomoc dam repucika