- Joined
- Nov 17, 2010
- Messages
- 6,827
- Solutions
- 586
- Reaction score
- 5,409
Code:
The Forgotten Server, version 0.3.7_SVN (Crying Damson)
The NPC should unfocus from players and say something such as 'Help intruder!'.
To help the NPC will be situated in an area with no monsters, so if a player has a battle sign the NPC will not talk to the player.
After talking with the npc for the first time the npc will act normally forever after, with the exception of not talking to players with a battle sign, simply saying 'Wash off the blood of your battles before talking to me'.
Below is some text to help guide the npc's direction.
Below that is a basic layout of a npc template I generally use.
I hope you have fun making the npc! I most definitely welcome everyone to give it a try!
And of course, a big thank you in advance for anyone willing to fill this request!
Code:
(wb) = with battle sign
(f) = first time talking to npc
(wb) (f) Player: hi | NPC: Wash off the blood of your battles before talking to me. (unfocus)
(f) Player: hi | NPC: Help, intruder! (in local chat) (unfocus) (spawn 10 unique monsters) | Rat,Troll,Minotaur, etc.
(wb) Player: hi | NPC: Wash off the blood of your battles before talking to me. (unfocus)
Player: hi | NPC: Well my battle heartened friend, what can I do for you?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())