• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Problem ze skryptem na Quest

Status
Not open for further replies.

Hitsugaya

New Member
Joined
Mar 28, 2008
Messages
90
Reaction score
0
Location
Poland, Łódź, RTK
Witam. :) Zapewne zostanę zbluzgany no ale.. Problem jest następujący.
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


    if msgcontains(msg, 'mission') then
	if getPlayerStorageValue(cid, 30045) == -1 then
		npcHandler:say('I lost my baby seal dool in my home, can you help me the found dool?', cid)
		talkState[talkUser] = 1
         elseif getPlayerStorageValue(cid, 30046) == 1 then
                npcHandler:say('Own. you have a baby seal from me?', cid)
                talkState[talkUser] = 2
        elseif getPlayerStorageValue(cid, 30046) == 2 then
                npcHandler:say('Sorry...but you already have complete my service. Good Bye', cid)
                talkState[talkUser] = 3
        end
        
    elseif talkState[talkUser] == 1 then
        if msgcontains(msg, 'yes') then
                npcHandler:say('Great. you have acess to enter in my home, report your mission afterwards..', cid)
                setPlayerStorageValue(cid,30045,1)
		        local chave = doCreateItemEx(2092, 1)
		        doSetItemActionId(chave, 4849)
		        doPlayerAddItemEx(cid, chave, 1)
                talkState[talkUser] = 2
                else
                selfSay('You already have the service. Come back have them...', cid)
        end

    elseif talkState[talkUser] == 2 then
        if msgcontains(msg, 'yes') then
                npcHandler:say('Thank you! now you have acess to enter in my Training Room.', cid)
	            if doPlayerRemoveItem(cid,7183,1) == TRUE then
                setPlayerStorageValue(cid,30046,2)
                setPlayerStorageValue(cid,60034,1)
                talkState[talkUser] = 3
                else
                npcHandler:say('Sorry...but you dont have item. Come back have them', cid)
            end
            end
            end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Jest problem z tym skryptem. Chodzi o to żeby iść do NPCa który daje nam misję. Mówię Hi - mission on pyta sie mnie czy pomogę znaleźć jego seal dolla. No to ja yes daje mi klucz. ale kiedy wracam z dollem to odpowiedzi nie ma.

Code:
12:10 Dufi: Welcome, Koks! I have been expecting you.
12:10 Koks [156]: mission
Co z tym zrobić ?? Nie jestem skrypterem więc się na tym nie znam :(
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dufi" script="data/npc/scripts/postmanquest.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="80" head="0" body="0" legs="0" feet="0" addons="0"/>
    <parameters> 
        <parameter key="module_shop" value="1"/> 
        <parameter key="shop_buyable" value="Amulet of Loss,2173,10000"/> 
    </parameters> 
</npc>

Proszę

PS. Proszę się nie sugerować nazwą postmanquest :P
 
Code:
    <parameters> 
        <parameter key="module_shop" value="1"/> 
        <parameter key="shop_buyable" value="Amulet of Loss,2173,10000"/> 
    </parameters>

Usuń to?
Lub zamiast mission pisz trade :)
 
Status
Not open for further replies.
Back
Top