qwasniak
Advanced User
- Joined
- May 9, 2013
- Messages
- 303
- Reaction score
- 7
No to zaczynamy !
do data/npc/nasznpc.xml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<npc name="NAZWA" script="nasznpc.lua" walkinterval="350000" floorchange="0" speed="0">
<health now="100" max="100"/>
<look type="194" head="114" body="94" legs="94" feet="57"/>
<parameters>
<parameter key="message_greet" value="Czesc |PLAYERNAME|! Potrzebuje 30 miesek, zdobedziesz je z Dragon?w. Masz je moze? Jesli masz wpisz {mam} A otrzymasz ode mnie Prezent !"/>
</parameters>
</npc>[/XML]
Pozniej data/npc/scripts/nasznpc.lua
[LUA]local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, "mam") then
if(doPlayerRemoveItem(cid, 2671, 30)) then
doPlayerAddItem(cid, 9941, 1)
else
selfSay("Hej ! Nie masz tych przedmiot?w", cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
[/LUA]
Okej a tutaj link do przentu : http://tibia.net.pl/threads/581326-Event-box-%21?p=1680544#post1680544
Licze na rep
do data/npc/nasznpc.xml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<npc name="NAZWA" script="nasznpc.lua" walkinterval="350000" floorchange="0" speed="0">
<health now="100" max="100"/>
<look type="194" head="114" body="94" legs="94" feet="57"/>
<parameters>
<parameter key="message_greet" value="Czesc |PLAYERNAME|! Potrzebuje 30 miesek, zdobedziesz je z Dragon?w. Masz je moze? Jesli masz wpisz {mam} A otrzymasz ode mnie Prezent !"/>
</parameters>
</npc>[/XML]
Pozniej data/npc/scripts/nasznpc.lua
[LUA]local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, "mam") then
if(doPlayerRemoveItem(cid, 2671, 30)) then
doPlayerAddItem(cid, 9941, 1)
else
selfSay("Hej ! Nie masz tych przedmiot?w", cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
[/LUA]
Okej a tutaj link do przentu : http://tibia.net.pl/threads/581326-Event-box-%21?p=1680544#post1680544
Licze na rep