• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help Monsters and npc talk voc or quest

Vivicotz

New Member
Joined
Aug 18, 2008
Messages
25
Reaction score
0
:confused: I need help to monsters = global:
chakoyes (all)
yakchal
morgaroth
ghazbaran
zoralurk
and in npc quest or voc to talk example in 8.1:
Code:
 if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 10 or getPlayerVocation(cid) == 11 or getPlayerVocation(cid) == 12 or getPlayerVocation(cid) == 13 or getPlayerVocation(cid) == 14 or getPlayerVocation(cid) == 15 or getPlayerVocation(cid) == 16 or getPlayerVocation(cid) == 17 or getPlayerVocation(cid) == 18 or getPlayerVocation(cid) == 19 or getPlayerVocation(cid) == 20 or getPlayerVocation(cid) == 21 or getPlayerVocation(cid) == 22 or getPlayerVocation(cid) == 25 or getPlayerVocation(cid) == 26 or getPlayerVocation(cid) == 27 then
            selfSay('Oi ' .. getCreatureName(cid) .. '! I move you to vip.')
            focus = cid
            talk_start = os.clock()
else
         selfSay('Sorry, you need Vip to go is city.')
focus = 0
end

plx help-me :D:D
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local vocations = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 }
local townPos = { x = 123, y = 456, z = 7 }

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 greetCallback(cid)
    if(isInArray(vocations, getPlayerVocation(cid) == FALSE) then
        npcHandler:say('Sorry, you need VIP account to go there!')
        return false
    else
        return true
    end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. I will move you to VIP city.')

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	if msgcontains(msg, 'travel') or msgcontains(msg, 'citynameherepls') then
		selfSay("I can bring you to citynamehere for goldherepls gold coins. Shall we go?", cid)
		talkState[talkUser] = 1
	elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
		if doPlayerRemoveMoney(cid, goldherepls) == TRUE then
			selfSay("Set the sails!", cid)
			talkState[talkUser] = 0
			doTeleportThing(cid, townPos, 0)
		else
			selfSay("Not enough gold!", cid)
			talkState[talkUser] = 0
		end
	end
	return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Try this one ^^
 
Back
Top