• 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 z NPC od misji i questlogiem

Status
Not open for further replies.

Tom

New Member
Joined
Nov 5, 2008
Messages
40
Reaction score
0
Witam od dłuższego czasu mam pewien problem.
Znalazłem npc z misją, wszystko ok npc daje misje all działa, ale teraz jest problem.
Nie wiem, które to startstorageid, startvalue , endvalue itp

Oto skrypt:
PHP:
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, 'quest')) then 
selfSay('To start this quest tell {mission}', cid) --This is just an example, In this script added 4 mission for you ;) 
end 
    if(msgcontains(msg, 'mission')) then 
        if(getPlayerStorageValue(cid,700) < 1) then 
            selfSay('Your first mission will be to get 100 {tarantula egg}.', cid) 
            talkState[talkUser] = 1 
        elseif (getPlayerStorageValue(cid,701) < 1) then 
                selfSay('Your next mission will be to get 150 {strands of medusa hair}.', cid) 
                talkState[talkUser] = 1 
        elseif (getPlayerStorageValue(cid,702) < 0) then 
                selfSay('Your next mission will be to get 300 {red dragon scales}.', cid) 
                talkState[talkUser] = 1 
        elseif (getPlayerStorageValue(cid,703) < 0) then 
                selfSay('Your next mission will be to get 400 {green dragon scales}.', cid) 
                talkState[talkUser] = 1 
                 
                 
                 
                 
        elseif (getPlayerStorageValue(cid,703) == 1) then --zmieniac w zaleznosci od ostatniego storage!! 
                selfSay('You have done all missions.', cid) 
                talkState[talkUser] = 1 
                 
                 
                 
                 
        end 
        --------------------------------------- 
        elseif(msgcontains(msg, 'tarantula egg') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,700) < 1)) then 
        if(doPlayerRemoveItem(cid, 11198, 100) == TRUE) then 
            setPlayerStorageValue(cid,700,1) 
            doPlayerAddPercentLevel(cid, 5)  
            selfSay('Thank you.', cid) 
            talkState[talkUser] = 0 
        else 
            selfSay('To end mission you need have 100 {tarantula egg}.', cid) 
        end 
        --------------------------------------- 
        elseif(msgcontains(msg, 'strands of medusa hair') and talkState[talkUser] == 1  and (getPlayerStorageValue(cid,701) < 1) and (getPlayerStorageValue(cid,700) == 1)) then 
        if(doPlayerRemoveItem(cid, 11226, 150) == TRUE) then 
            setPlayerStorageValue(cid,701,1) 
            doPlayerAddPercentLevel(cid, 7)  
            selfSay('Thank you.', cid) 
            talkState[talkUser] = 0 
        else 
            selfSay('To end mission you need have 150 {strands of medusa hair}.', cid) 
        end 
        --------------------------------------- 
        elseif(msgcontains(msg, 'red dragon scales') and talkState[talkUser] == 1  and (getPlayerStorageValue(cid,702) < 1) and (getPlayerStorageValue(cid,701) == 1)) then 
        if(doPlayerRemoveItem(cid, 5882, 300) == TRUE) then 
            setPlayerStorageValue(cid,702,1) 
            doPlayerAddPercentLevel(cid, 6)  
            selfSay('Thank you.', cid) 
            talkState[talkUser] = 0 
        else 
            selfSay('To end mission you need have 300 {red dragon scales}.', cid) 
        end 
        --------------------------------------- 
        elseif(msgcontains(msg, 'green dragon scales') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,703) < 1) and (getPlayerStorageValue(cid,702) == 1)) then 
        if(doPlayerRemoveItem(cid, 5920, 400) == TRUE) then 
            setPlayerStorageValue(cid,703,1) 
            doPlayerAddPercentLevel(cid, 5)  
            selfSay('Thank you.', cid) 
            talkState[talkUser] = 0 
        else 
            selfSay('To end mission you need have 400 {green dragon scales}.', cid) 
        end 
        ------------------------------------------ 
         
    end 
end     
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

a oto quests.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<quests>
	<quest name="Tarantule Hunting" startstorageid="700" startstoragevalue="1">
		<mission name="Tarantule Hunting" storageid="701" startvalue="1" endvalue="1">
			<missionstate id="1" description="Collect 100 tarantule egg"/>
		</mission>
		<mission name="Ruly's Revenge" storageid="30031" startvalue="4" endvalue="6">
			<missionstate id="4" description="You received a document with instructions from Ruly, follow them."/>
			<missionstate id="5" description="Go back to Ruly and tell him that you followed his instructions to the end."/>
			<missionstate id="6" description="You got a reward from Ruly, he was very thankful with that you helped him to take his revenge."/>
		</mission>
	</quest>
</quests>

Bardzo proszę o pomoc. Nie wiem co wpisać w : startstorageid, startstoragevalue, storage id, startvalue, endvalue.
 
W startstorageid wpisujesz -1, gdyż gdybym ja robił skrypt wyglądałoby to mniej więcej tak

PHP:
setPlayerStorageValue(cid, storageID, -1)

Ale nie musisz o tym wiedzieć.

getPlayerStorageValue(cid, storageID) - pobiera od gracza pewną wartość, mianowicie jeżeli "klucz" nie został użyty wartość domyślna musi wynosić "-1".

Jeżeli się mylę, to mnie poprawcie.
Startstorageid - "-1"
Startvalue - "-1"
Endvalue - "1"
storageid - "ID klucza, te UID z Map Edytora, obudź się, kurwa.
Poczytaj o systemie kluczy, na sam początek, bo kurwa bez tego ani rusz."

Nad resztą popracuj, pomyśl, wytęż wyobraźnię.
Gotowców na Polish Boardzie nie robimy.​
 
Last edited:
Status
Not open for further replies.
Back
Top