- Dołączył
- Styczeń 24, 2009
- Posty
- 2256
- Liczba reakcji
- 331
Odp: Questy na zam?wienie.
NPC numer I:
Cia?o demca:
Usuwanie kamienia:
Dziennik tego typa w dedzie:
Mnich potem.
NPC numer I:
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 say(param)
npcHandler:say(param.text,param.cid)
end
function delayedSay(text, delay, cid)
if(not npcHandler:isFocused(cid)) then
return FALSE
else
local param = {cid = cid, text = text}
local delay = delay or 0
addEvent(say, delay, param)
end
end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local storage_1 = 2500
local numer_klucza = 5435
local text_pierwszej_ksiazki = "Musisz zabic archdemona i zdobyc jakis tam amulet."
local text_drugiej_ksiazki = "Zdobadz holy icon."
local text_trzeciej_ksiazki = "Poloz cialo demona na oltarzu i polej je woda swiecona."
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if getPlayerLevel(cid) >= 170 then
if msgcontains(msg, "mission") then
if isInArray({-1,1,3}, getPlayerStorageValue(cid, storage_1)) then
selfSay("Naprawde chcesz mi pomoc?!", cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage_1) == 0 then
if getPlayerItemCount(cid, 7890) >= 1 then
selfSay("Swietnie! Misja 1 zaliczona.Bye!", cid)
setPlayerStorageValue(cid, storage_1, 1)
doPlayerRemoveItem(cid, 7890, 1)
end
elseif getPlayerStorageValue(cid, storage_1) == 2 then
if getPlayerItemCount(cid, 6561) >= 1 then
selfSay("Swietnie! Misja 2 zaliczona. Bye", cid)
setPlayerStorageValue(cid, storage_1, 3)
doPlayerRemoveItem(cid, 6561, 1)
end
elseif getPlayerStorageValue(cid, storage_1) == 5 then
selfSay("Swietnie! Misja 3 zaliczona. Bye", cid)
setPlayerStorageValue(cid, storage_1, 6)
elseif getPlayerStorageValue(cid, storage_1) == 7 then
if getPlayerItemCount(cid, 2325) >= 1 then
selfSay("Swietnie! Misja 4 zaliczona. Bye", cid)
setPlayerStorageValue(cid, storage_1, 8)
doPlayerRemoveItem(cid, 2325, 1)
end
elseif getPlayerStorageValue(cid, storage_1) == 10 then
if getPlayerItemCount(cid, 5808) >= 1 then
selfSay("Swietnie! Misja 5 zaliczona. Bye", cid)
setPlayerStorageValue(cid, storage_1, 11)
doPlayerRemoveItem(cid, 5808, 1)
end
end
elseif msgcontains(msg, "tak") or msgcontains(msg, "yes") then
if talkState[talkUser] == 1 then
if isInArray({-1,1,3}, getPlayerStorageValue(cid, storage_1)) then
selfSay("To swietnie! Sluchaj tu masz dalsze instrukcje co robic dalej!", cid)
if getPlayerStorageValue(cid, storage_1) == -1 then
setPlayerStorageValue(cid, storage_1, 0)
local ksiazka1 = doPlayerAddItem(cid, 1977, 1)
doItemSetAttribute(ksiazka1, "description", text_pierwszej_ksiazki)
elseif getPlayerStorageValue(cid, storage_1) == 1 then
setPlayerStorageValue(cid, storage_1, 2)
local ksiazka2 = doPlayerAddItem(cid, 1977, 1)
doItemSetAttribute(ksiazka2, "description", text_drugiej_ksiazki)
elseif getPlayerStorageValue(cid, storage_1) == 3 then
setPlayerStorageValue(cid, storage_1, 4)
doPlayerAddItem(cid, 7494, 1)
local ksiazka3 = doPlayerAddItem(cid, 1977, 1)
doItemSetAttribute(ksiazka3, "description", text_trzeciej_ksiazki)
local klucz = doPlayerAddItem(cid, 2091, 1)
doItemSetAttribute(klucz, "aid", numer_klucza)
end
end
if getPlayerStorageValue(cid, storage_1) == 6 then
selfSay("Sluchaj wiec uwaznie! Tam skad kosciste potwory pochodza. Miejsce w ktorym zlo przewaza nad dobrem. Tamtejsze miejsce bowiem, jest otoczone poteznymi potworami. Ich jad moze Cie otruc i spowodowac smierc! Wiec uwazaj! Czym predzej skryj sie w tamtejszej dziurze. Tam zlo Cie nie ominie! Dalsze wskazowki znajdziesz po drodze! Czytaj wszelakie napotkane przez siebie ksiazki! Ulatwia Ci zadanie", cid)
setPlayerStorageValue(cid, storage_1, 7)
elseif getPlayerStorageValue(cid, storage_1) == 9 then
selfSay("Na cmentarzysku w Edron wlasnie pojawil sie Orshabaal Brother. Zabij go dla mnie. Wiem, zabijanie nie jest w granicach chrzescijanskiej godnosci, ale takie bestie trzeba tepic. Zdobadz dla mnie jego /'centrum zarzadzania/'", cid)
setPlayerStorageValue(cid, storage_1, 10)
elseif getPlayerStorageValue(cid, storage_1) == 11 then
selfSay("A wiec sluchaj! Moi podopieczni maja dla Ciebie pewne insygnia. Tak, mowie tu o krzyzu. Pozycz od nich jeden i spytaj sie NPC Filcha o dalsze wskazowki", cid)
setPlayerStorageValue(cid, storage_1, 12)
end
end
elseif msgcontains(msg, "holy water") and getPlayerStorageValue(cid, storage_1) == 4 then
doPlayerAddItem(cid, 7494, 1)
end
else
selfSay("Nie masz wymaganego lvla", cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage_1 = 2500
local pos = {x=1000,y=1000,z=7}
local cialo_demca = getThingFromPos(pos)
if item.itemid == 7494 then
if itemEx.itemid == 2916 then
if cialo_demca.itemid == 2916 and getPlayerStorageValue(cid, storage_1) == 4 then
doSendMagicEffect(fromPosition, CONST_ME_HOLYAREA)
setPlayerStorageValue(cid, storage_1, 5)
doTransfotmItem(item.uid, 2006)
end
else
doTransfotmItem(item.uid, 2006)
end
end
return true
end
PHP:
function onUse(cid, item, frompos, itemEx, topos)
local pozycja_kamienia = {x=1000,y=1000,z=7,stackpos=1} --ustawiasz wspolrzedne kamienia, musisz sprawdzic ile itemow znajduje sie pod kamieniem, jesli zadnego to stackpos zostawiasz rowne 1, jesli jest jeden border to na 2, jesli border i kamyk to 3, jesli dwa bordery to rowniez 3. Chyba rozumiesz.
local gdzie_jest_kamien = getThingfromPos(pozycja_kamienia)
local id_kamienia = 1304
if item.uid == 5000 then
if item.itemid == 1945 then
if gdzie_jest_kamien.itemid == id_kamienia then
doRemoveItem(gdzie_jest_kamien.uid, 1)
doTransformItem(item.uid,item.itemid+1)
end
elseif item.itemid == 1946 then
doCreateItem(id_kamienia, 1, pozycja_kamienia)
doTransformItem(item.uid,item.itemid-1)
end
end
return true
end
PHP:
function onUse(cid, item, frompos, itemEx, topos)
local tresc = "tresc dziennika"
if item.uid == 5001 then
local itemus = doPlayerAddItem(cid, 2325, 1)
doItemSetAttribute(itemus, "description", tresc)
end
return true
end
.