Hello,
first*
sorry for my english and my script becaouse i am not scripter heh i am just thinker and remake another npc
second*
so i wanna make all npc (100% RL) from island of destiny and i made druid yandur, maybe only without 2 topics from rl.. but she doesn't speak at goodbye :< i dont know what is problem that it's script xml and lua, please help me :<
XML
LUA
CONTINUED...
first*
sorry for my english and my script becaouse i am not scripter heh i am just thinker and remake another npc
second*
so i wanna make all npc (100% RL) from island of destiny and i made druid yandur, maybe only without 2 topics from rl.. but she doesn't speak at goodbye :< i dont know what is problem that it's script xml and lua, please help me :<
XML
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Druid Yandur" script="data/npc/scripts/DRUID.lua" walkinterval="20000" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="115" body="115" legs="132" feet="115" addons="3"/>
<voices>
<voice text="Are you injured? Come and get a free healing at my little hut." interval2="200" margin="1" yell="no"/>
<voice text="If you like to choose a druid's way of life, talk to me." interval2="200" margin="1" yell="no"/>
<voice text="Sometimes it's not the loudest voice which has the most valuable information to give." interval2="200" margin="1" yell="no"/>
<voice text="Follow your instincts and let nature guide you." interval2="200" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="message_farewell" value="Farewell |PLAYERNAME|, may you always have friends in your company."/>
<parameter key="message_walkaway" value="Leaving without a friendly word... what a pity." />
</parameters>
</npc>
LUA
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic, Town = {}, {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
if (msgcontains(msg, "hello") or msgcontains(msg, "hi")) and (not npcHandler:isFocused(cid)) then
local v = getPlayerVocation(cid)
if v == 0 then
npcHandler:say("Welcome to my humble hut, "..getPlayerName(cid).."! Are you interested in learning something about the druid vocation?", cid)
Topic[cid] = 1
else
npcHandler:say("Sorry you have vocation. Can I help you ?", cid)
Topic[cid] = 0
end
elseif Topic[cid] == 1 then
if msgcontains(msg, "yes") then
npcHandler:say("I\'m happy to hear that, dear "..getPlayerName(cid)..". I\'ll gladly give you some {information} or help you to become a {druid} right away. What would you prefer?", cid)
Topic[cid] = 2
elseif msgcontains(msg, "no") then
npcHandler:say("That\'s sad, but maybe you just lack some information about our beautiful vocation?", cid)
Topic[cid] = 2
else
npcHandler:say("I\'m not quite sure if I understand you, but maybe you\'d like some {information} about druids in general?", cid)
Topic[cid] = 2
end
elseif Topic[cid] == 2 then
if msgcontains(msg, "yes") or msgcontains(msg, "information") then
npcHandler:say("Depending on how much time you have, I can either give you the {short} or the {detailed} version. Choose whatever suits you most!", cid)
Topic[cid] = 3
elseif msgcontains(msg, "druid") then
npcHandler:say("Are you sure that you have all needed information and are ready to become a druid forever?", cid)
Topic[cid] = 17
else
npcHandler:say("No, no, you are given the choice between receiving {information} or becoming a {druid} if you\'ve already made up your mind.", cid)
Topic[cid] = 2
end
elseif Topic[cid] == 3 then
if msgcontains(msg, "short") then
npcHandler:say("In short: Druids are focused on ice, earth and healing magic. We use runes, spells and rods to hunt our enemies and usually try to avoid body contact. Easy, right?", cid)
Topic[cid] = 4
elseif msgcontains(msg, "detailed") or msgcontains(msg, "long") then
npcHandler:say("That\'s wonderful. As a druid, your spirit is close to nature and its powers. Your aim is also to protect your friends with powerful healing magic. Can you follow me so far?", cid)
Topic[cid] = 6
else
npcHandler:say("That's not an option, my impatient young student. Would you like to listen to the {short} version or to the {detailed} version of my druid lecture?", cid)
Topic[cid] = 3
end
elseif Topic[cid] == 4 then
if msgcontains(msg, "yes") then
npcHandler:say("Well, anyway "..getPlayerName(cid)..", after having learnt a few basic things about druids, do you think that vocation would be fine for you?", cid)
Topic[cid] = 5
else
npcHandler:say("Well, anyway "..getPlayerName(cid)..", after having learnt a few basic things about druids, do you think that vocation would be fine for you?", cid)
Topic[cid] = 5
end
elseif Topic[cid] == 5 then
if msgcontains(msg, "yes") then
npcHandler:say("That's good to hear, "..getPlayerName(cid)..". Since this is such an important decision, I have to ask you, though, whether you have gotten all the information that you need?", cid)
Topic[cid] = 17
elseif msgcontains(msg, "no") then
npcHandler:say("Well, the other vocations have their own advantages and disadvantages. Maybe you will find something more suitable for you by talking to {Hykrion}, {Estrella} and {Narai}. Come and talk to me anytime!", cid)
Topic[cid] = 0
else
npcHandler:say("<ahem> This is the point of the conversation where you answer with '{yes}' or '{no}'.", cid)
Topic[cid] = 5
end
elseif Topic[cid] == 6 then
if msgcontains(msg, "yes") then
npcHandler:say("Good. Don\'t assume that druids are weak and can\'t defend themselves. Our magic is as strong as that of sorcerers, just in a different way. Do you understand that so far?", cid)
Topic[cid] = 7
else
npcHandler:say("Well, in short, druids use nature spells and healing magic. Can you follow me so far?", cid)
Topic[cid] = 6
end
elseif Topic[cid] == 7 then
if msgcontains(msg, "yes") then
npcHandler:say("Good. Whereas sorcerers call forth hellfire and death itself, druids ask nature for assistance to conjure powerful ice storms and rock showers. Can you follow me so far?", cid)
Topic[cid] = 8
else
npcHandler:say("To say it in easy words: Druids and sorcerers have similar powers, but different types of spells. Do you understand that so far?", cid)
Topic[cid] = 7
end
elseif Topic[cid] == 8 then
if msgcontains(msg, "yes") then
npcHandler:say("Good. Like all mages, we do not have that much health and should be careful when fighting strong monsters, but we can easily keep our distance and deal great damage anyway. Do you understand?", cid)
Topic[cid] = 9
else
npcHandler:say("I said, the difference between sorcerer and druid spells is the focus. Sorcerers use black magic and druids white magic, so to speak. Can you follow me so far?", cid)
Topic[cid] = 8
end
Last edited by a moderator: