• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent NPC Task, with choose task - polish edition.

Oskar1121

Excellent OT User
Joined
Jul 15, 2009
Messages
638
Reaction score
552
Location
Poland
~~NPC~~
Search and open folder npc/scripts and make here file about name elementals.lua and paste this:
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
            local cid = cid or 0
            local nid = getNpcCid()
            addEvent(say, delay, param)


        end
    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
local terra = {7884, 7885, 7886, 7887, 7903, 8880}
local randomChance = math.random(1, #terra)
local lightning = {7899, 7893, 7895, 7898, 7901, 8879}
local randomChance = math.random(1, #lightning)
local magma = {7891, 7894, 7899, 7900, 7890, 8877}
local randomChance = math.random(1, #magma)
local glacier = {7888, 7892, 7896, 7897, 7902, 8878}
local randomChance = math.random(1, #glacier)
local quest = 66666
local expo = 66660
local earth = 35003
local energy = 35004
local fire = 35005
local water = 35006
local ilosc = 100
if msgcontains(msg, 'zadanie') then
	delayedSay("Mam dla Ciebie zadanie wymagajace poswiecenia oraz odrobiny czasu. Zainteresowany?", 100, cid)
	talkState[talkUser] = 1
elseif msgcontains(msg, 'nie') and talkState[talkUser] == 1 then
	delayedSay("Jesli zmienisz zdanie to wiesz gdzie mnie szukac.", 100, cid)
	elseif msgcontains(msg, 'tak') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid, quest) == 1 or getPlayerStorageValue(cid, quest) == 3 or getPlayerStorageValue(cid, quest) == 5 or getPlayerStorageValue(cid, quest) == 7) then
	delayedSay("Zanim przyjmiesz ode mnie kolejne zadanie musisz skonczyc poprzednie.", 100, cid)
elseif msgcontains(msg, 'tak') and talkState[talkUser] == 1 then
	delayedSay("Istnieja cztery rodzaje zywiolakow, {ziemia}, {energia}, {ogien} oraz {woda}. Ktorego zadania sie podejmujesz?", 100, cid)
	talkState[talkUser] = 2
	
elseif msgcontains(msg, 'ziemia') and talkState[talkUser] == 2 then
	delayedSay("Swietnie! Musisz zabic " .. ilosc .. " zywiolakow ziemi, gdy tego dokonasz, wroc do mnie po swa nagrode slowami {raport}.", 100, cid)
	delayedSay("Pamietaj, ze mozesz w kazdej chwili przerwac swoj wybor. Wystarczy powiedziec {rezygnuje}.", 6000, cid)
	setPlayerStorageValue(cid, quest, 1)
elseif msgcontains(msg, 'energia') and talkState[talkUser] == 2 then
	delayedSay("Swietnie! Musisz zabic " .. ilosc .. " zywiolakow energii, gdy tego dokonasz, wroc do mnie po swa nagrode slowami {raport}.", 100, cid)
	delayedSay("Pamietaj, ze mozesz w kazdej chwili przerwac swoj wybor. Wystarczy powiedziec {rezygnuje}.", 6000, cid)
	setPlayerStorageValue(cid, quest, 3)
elseif msgcontains(msg, 'ogien') and talkState[talkUser] == 2 then
	delayedSay("Swietnie! Musisz zabic " .. ilosc .. " zywiolakow ognia, gdy tego dokonasz, wroc do mnie po swa nagrode slowami {raport}.", 100, cid)
	delayedSay("Pamietaj, ze mozesz w kazdej chwili przerwac swoj wybor. Wystarczy powiedziec {rezygnuje}.", 6000, cid)
	setPlayerStorageValue(cid, quest, 5)
elseif msgcontains(msg, 'woda') and talkState[talkUser] == 2 then
	delayedSay("Swietnie! Musisz zabic " .. ilosc .. " zywiolakow wody, gdy tego dokonasz, wroc do mnie po swa nagrode slowami {raport}.", 100, cid)
	delayedSay("Pamietaj, ze mozesz w kazdej chwili przerwac swoj wybor. Wystarczy powiedziec {rezygnuje}.", 6000, cid)
	setPlayerStorageValue(cid, quest, 7)
	
elseif msgcontains(msg, 'rezygnuje') and (getPlayerStorageValue(cid, quest) ~= 1) then
	delayedSay("Jestes pewien, ze chcesz zrezygnowac? Utracisz przy tym wszystko co dotychczas osiagnales.", 100, cid)
	talkState[talkUser] = 9
elseif msgcontains(msg, 'nie') and talkState[talkUser] == 9 then
	delayedSay("Wracaj wiec na polowanie i wroc, gdy wykonasz zadanie, ktore Ci powierzylem.", 100, cid)
elseif msgcontains(msg, 'tak') and talkState[talkUser] == 9 and (getPlayerStorageValue(cid, quest) == 1 or getPlayerStorageValue(cid, quest) == 3 or getPlayerStorageValue(cid, quest) == 5 or getPlayerStorageValue(cid, quest) == 7) then
	delayedSay("Heh... Trudno. Jesli chcesz ponownie sprobowac sil powiedz {zadanie}.", 100, cid)
	setPlayerStorageValue(cid, water, -1)
	setPlayerStorageValue(cid, fire, -1)
	setPlayerStorageValue(cid, energy, -1)
	setPlayerStorageValue(cid, earth, -1)
	setPlayerStorageValue(cid, quest, -1)

	
elseif msgcontains(msg, 'raport') and (getPlayerStorageValue(cid, quest) ~= -1) then
	delayedSay("Czy wykonales zadanie, ktore ode mnie przyjales?", 100, cid)
	talkState[talkUser] = 3

elseif msgcontains(msg, 'nie') and talkState[talkUser] == 3 then
	delayedSay("Gdy dokonczysz swe zadanie, wroc do mnie, a nagroda Cie nie ominie.", 100, cid)
elseif msgcontains(msg, 'tak') and talkState[talkUser] == 3 and ((getPlayerStorageValue(cid, quest) == 1 or getPlayerStorageValue(cid, quest) == 3 or getPlayerStorageValue(cid, quest) == 5 or getPlayerStorageValue(cid, quest) == 7) and (getPlayerStorageValue(cid, expo) ~= 0)) then
	delayedSay("Klamiesz! Nie masz wykonane zadania, ktore Ci powierzylem.", 100, cid)
elseif msgcontains(msg, 'tak') and (getPlayerStorageValue(cid, quest) == 2 or getPlayerStorageValue(cid, quest) == 4 or getPlayerStorageValue(cid, quest) == 6 or getPlayerStorageValue(cid, quest) == 8) and (getPlayerStorageValue(cid, expo) == -1) and talkState[talkUser] == 3 then
	delayedSay("Heh... Szybko sie z tym uporales. Mozesz teraz wybrac swoja {nagrode}.", 100, cid)
	doPlayerAddExp(cid, 15000)
    doSendAnimatedText(getPlayerPosition(cid),"15000", TEXTCOLOR_WHITE)
	setPlayerStorageValue(cid, expo, 1)
	talkState[talkUser] = 4
elseif msgcontains(msg, 'tak') and (getPlayerStorageValue(cid, quest) == 2 or getPlayerStorageValue(cid, quest) == 4 or getPlayerStorageValue(cid, quest) == 6 or getPlayerStorageValue(cid, quest) == 8) and (getPlayerStorageValue(cid, expo) == 1) and talkState[talkUser] == 3 then
	delayedSay("Heh... Szybko sie z tym uporales. Mozesz teraz wybrac swoja {nagrode}.", 100, cid)
	talkState[talkUser] = 4	
	
elseif (msgcontains(msg, 'nagroda') or msgcontains(msg, 'nagrode')) and (getPlayerStorageValue(cid, quest) == 2 and getPlayerStorageValue(cid, expo) == 1) and talkState[talkUser] == 4 then
	delayedSay("Oto nagroda za Twe trudy. Oby tak dalej! Jesli chcesz rozpoczac nowe zadanie powiedz {zadanie}.", 100, cid)
	doPlayerAddItem(cid, terra[randomChance], count)
	setPlayerStorageValue(cid, quest, -1)
	setPlayerStorageValue(cid, earth, -1)
	setPlayerStorageValue(cid, expo, -1)
	setPlayerStorageValue(cid, earth, -1)
	
elseif (msgcontains(msg, 'nagroda') or msgcontains(msg, 'nagrode')) and (getPlayerStorageValue(cid, quest) == 4 and getPlayerStorageValue(cid, expo) == 1) and talkState[talkUser] == 4 then
	delayedSay("Oto nagroda za Twe trudy. Oby tak dalej! Jesli chcesz rozpoczac nowe zadanie powiedz {zadanie}.", 100, cid)
	doPlayerAddItem(cid, lightning[randomChance], count)
	setPlayerStorageValue(cid, quest, -1)
	setPlayerStorageValue(cid, lightning, -1)
	setPlayerStorageValue(cid, expo, -1)
	setPlayerStorageValue(cid, energy, -1)
	
elseif (msgcontains(msg, 'nagroda') or msgcontains(msg, 'nagrode')) and (getPlayerStorageValue(cid, quest) == 6 and getPlayerStorageValue(cid, expo) == 1) and talkState[talkUser] == 4 then
	delayedSay("Oto nagroda za Twe trudy. Oby tak dalej! Jesli chcesz rozpoczac nowe zadanie powiedz {zadanie}.", 100, cid)
	doPlayerAddItem(cid, magma[randomChance], count)
	setPlayerStorageValue(cid, quest, -1)
	setPlayerStorageValue(cid, magma, -1)
	setPlayerStorageValue(cid, expo, -1)
	setPlayerStorageValue(cid, fire, -1)
	
elseif (msgcontains(msg, 'nagroda') or msgcontains(msg, 'nagrode')) and (getPlayerStorageValue(cid, quest) == 8 and getPlayerStorageValue(cid, expo) == 1) and talkState[talkUser] == 4 then
	delayedSay("Oto nagroda za Twe trudy. Oby tak dalej! Jesli chcesz rozpoczac nowe zadanie powiedz {zadanie}.", 100, cid)
	doPlayerAddItem(cid, glacier[randomChance], count)
	setPlayerStorageValue(cid, quest, -1)
	setPlayerStorageValue(cid, glacier, -1)
	setPlayerStorageValue(cid, expo, -1)
	setPlayerStorageValue(cid, water, -1)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Now go to folder npc and make here file about name is elementals.xml and paste this:
PHP:
<?xml version="1.0"?>
<npc name="Elemental Wizard" script="elementals.lua" access="3" lookdir="2" walkinterval="2000">
<health now="150" max="150"/>
<look type="130" head="19" body="114" legs="113" feet="94" addons="2"/>
<parameters>
<parameter key="message_greet" value="Witaj |PLAYERNAME|. Czy nie mialbys chwili czasu by mi pomoc? Nagroda za Twoj wysilek bedzie spora! Wystarczy, ze powiesz {zadanie}.."/>
<parameter key="message_farewall" value="Zegnaj!"/>
<parameter key="message_walkaway" value="Moze nastepnym razem..."/>
</parameters>
</npc>
~~CREATURESCRIPTS~~
Search and open folder creaturescripts/scripts and make file about name is elementals.lua and paste this:
PHP:
local monsters = {
	["earth elemental"] = 35003,
	["massive earth elemental"] = 35003,
	["muddy earth elemental"] = 35003,
	["jagged earth elemental"] = 35003,
	["energy elemental"] = 35004,
	["massive energy elemental"] = 35004,
	["charged energy elemental"] = 35004,
	["overcharged energy elemental"] = 35004,
	["fire elemental"] = 35005,
	["massive fire elemental"] = 35005,
	["blazing fire elemental"] = 35005,
	["blistering fire elemental"] = 35005,
	["water elemental"] = 35006,
	["massive water elemental"] = 35006,
	["slick water elemental"] = 35006,
	["roaring water elemental"] = 35006,
	}
function onKill(cid, target)
	if(isPlayer(target) ~= TRUE) then
		local name = getCreatureName(target)
		local monster = monsters[string.lower(name)]
		if(monster) then
			local killedMonsters = getPlayerStorageValue(cid, monster)
			if(killedMonsters == -1) then
				killedMonsters = 1
			end
			if((name == "earth elemental" or name == "massive earth elemental" or name == "muddy earth elemental" or name == "jagged earth elemental") and getPlayerStorageValue(cid, 66666) == 1) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Zabiles " .. killedMonsters .. " sposrod 100 zywiolakow ziemi.")
				setPlayerStorageValue(cid, monster, killedMonsters + 1)
				if getPlayerStorageValue(cid, 35003)>100 then 
					setPlayerStorageValue(cid, 66666, 2)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje! Udalo Ci sie zabic wszystkie 100 zywiolakow ziemi.")
				end
			elseif((name == "energy elemental" or name == "massive energy elemental" or name == "charged energy elemental" or name == "overcharged energy elemental") and getPlayerStorageValue(cid, 66666) == 3) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Zabiles " .. killedMonsters .. " sposrod 100 zywiolakow energii.")
				setPlayerStorageValue(cid, monster, killedMonsters + 1)
				if getPlayerStorageValue(cid, 35004)>100 then 
					setPlayerStorageValue(cid, 66666, 4)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje! Udalo Ci sie zabic wszystkie 100 zywiolakow energii.")
				end
			elseif((name == "fire elemental" or name == "massive fire elemental" or name == "blazing fire elemental" or name == "blistering fire elemental") and getPlayerStorageValue(cid, 66666) == 5) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Zabiles " .. killedMonsters .. " sposrod 100 zywiolakow ognia.")
				setPlayerStorageValue(cid, monster, killedMonsters + 1)
				if getPlayerStorageValue(cid, 35005)>100 then 
					setPlayerStorageValue(cid, 66666, 6)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje! Udalo Ci sie zabic wszystkie 100 zywiolakow ognia.")
				end
			elseif((name == "water elemental" or name == "massive water elemental" or name == "slick water elemental" or name == "roaring water elemental") and getPlayerStorageValue(cid, 66666) == 7) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Zabiles " .. killedMonsters .. " sposrod 100 zywiolakow wody.")
				setPlayerStorageValue(cid, monster, killedMonsters + 1)
				if getPlayerStorageValue(cid, 35006)>100 then 
					setPlayerStorageValue(cid, 66666, 8)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje! Udalo Ci sie zabic wszystkie 100 zywiolakow wody.")
				end
			end			
		end
	end
	return TRUE
end
Now search file login.lua and front this line:
PHP:
return true
end
Paste this:
PHP:
registerCreatureEvent(cid, "Elementals")
Then search file creaturescripts.xml and paste this:
PHP:
<event type="kill" name="Elementals" event="script" value="elementals.lua"/>
!!!WARNING!!!
If you want to, so that NPC working you must change big letters on small.
So, change this:
PHP:
monster name="Earth Elemental"
On this:
PHP:
monster name="earth elemental"

Sorry for my English :/
 
Last edited:
Eng Virsion

PHP:
local keywordHandler = KeywordHandler: new ()
local npcHandler = NpcHandler: new (keywordHandler)
NpcSystem.parseParameters (npcHandler)
local talkState = ()
onCreatureAppear function (cid)
    npcHandler: onCreatureAppear (cid)
end
onCreatureDisappear function (cid)
    npcHandler: onCreatureDisappear (cid)
end
onCreatureSay function (cid, type, msg)
    npcHandler: onCreatureSay (cid, type, msg)
end
onThink function ()
    npcHandler: onThink ()
end
function say (param)
            npcHandler: say (param.text, param.cid)
         end
    delayedSay function (text, delay, c and d)
    if (not npcHandler: isFocused (cid)) then
                return FALSE
     else
         local param = (cid = cid, text = text)
            local or delay delay = 0
            cid = cid local or 0
            local getNpcCid nid = ()
            addEvent (say, delay, param)


        end
    end

creatureSayCallback function (cid, type, msg)
    if (not npcHandler: isFocused (cid)) then
    return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR CONVERSATION_DEFAULT == 0 or c and d and
local terra = (7884, 7885, 7886, 7887, 7903, 8880)
local randomChance = Math.random (1, # terra)
local lightning = (7899, 7893, 7895, 7898, 7901, 8879)
local randomChance = Math.random (1, # lightning)
local magma = (7891, 7894, 7899, 7900, 7890, 8877)
local randomChance = Math.random (1, # magma)
local glacier = (7888, 7892, 7896, 7897, 7902, 8878)
local randomChance = Math.random (1, # glacier)
local quest = 66666
local expo = 66660
local earth = 35003
local energy = 35004
local fire = 35005
local water = 35006
local num = 100
msgcontains if (msg, 'job') then
    delayedSay ("I have for you a task that requires dedication and a little time. Interested?", 100, cid)
    talkState [talkUser] = 1
msgcontains elseif (msg, 'no') and talkState [talkUser] == 1 then
    delayedSay ("If you change your mind you know where to find me.", 100 cid)
    msgcontains elseif (msg, 'yes') and talkState [talkUser] == 1 and (getPlayerStorageValue (cid, quest) == 1 or getPlayerStorageValue (cid, quest) == 3 or getPlayerStorageValue (cid, quest) == 5 or getPlayerStorageValue (cid, quest) == 7) then
    delayedSay ("Before you accept a job more than I need to finish the previous one.", 100 cid)
msgcontains elseif (msg, 'yes') and talkState [talkUser] == 1 then
    delayedSay ("There are four types of elementals, (land), (power), (fire) and (water). the tasks we undertake?", 100, cid)
    talkState [talkUser] = 2
    
msgcontains elseif (msg, 'earth') and talkState [talkUser] == 2 then
    delayedSay ("Great! You have to kill" .. number .. "earth elementals, when that is complete, return to me after SWA reward words (report).", 100 cid)
    delayedSay ("Remember, you can at any time to interrupt their choice. Just tell) (resign.", 6000, cid)
    setPlayerStorageValue (cid, quest, 1)
msgcontains elseif (msg, 'energy') and talkState [talkUser] == 2 then
    delayedSay ("Great! You have to kill" .. number .. "elementals power when that is complete, return to me after SWA reward words (report).", 100 cid)
    delayedSay ("Remember, you can at any time to interrupt their choice. Just tell) (resign.", 6000, cid)
    setPlayerStorageValue (cid, quest, 3)
msgcontains elseif (msg, 'fire') and talkState [talkUser] == 2 then
    delayedSay ("Great! You have to kill" .. number .. "elementals of fire, when that is complete, return to me after SWA reward words (report).", 100 cid)
    delayedSay ("Remember, you can at any time to interrupt their choice. Just tell) (resign.", 6000, cid)
    setPlayerStorageValue (cid, quest, 5)
msgcontains elseif (msg, 'water') and talkState [talkUser] == 2 then
    delayedSay ("Great! You have to kill" .. number .. "elementals of water, when that is complete, return to me after SWA reward words (report).", 100 cid)
    delayedSay ("Remember, you can at any time to interrupt their choice. Just tell) (resign.", 6000, cid)
    setPlayerStorageValue (cid, Quest, 7)
    
msgcontains elseif (msg, 'give up') and (getPlayerStorageValue (cid, quest) ~ = 1) then
    delayedSay ("Are you sure you want to unsubscribe? lose everything at the same time not yet reached.", 100 cid)
    talkState [talkUser] = 9
msgcontains elseif (msg, 'no') and talkState [talkUser] == 9 then
    delayedSay ("Come back so to hunt and return when you perform a task, which confided to you.", 100 cid)
msgcontains elseif (msg, 'yes') and talkState [talkUser] == 9 and (getPlayerStorageValue (cid, quest) == 1 or getPlayerStorageValue (cid, quest) == 3 or getPlayerStorageValue (cid, quest) == 5 or getPlayerStorageValue (cid, quest) == 7) then
    delayedSay ("Heh ... Too bad. If you want to re-try your hand tell (task).", 100 cid)
    setPlayerStorageValue (cid, water, -1)
    setPlayerStorageValue (cid, fire, -1)
    setPlayerStorageValue (cid, energy, -1)
    setPlayerStorageValue (cid, earth, -1)
    setPlayerStorageValue (cid, quest, -1)

    
msgcontains elseif (msg, 'report') and (getPlayerStorageValue (cid, quest) ~ = -1) then
    delayedSay ("Do you have done the job you have accepted me?", 100, cid)
    talkState [talkUser] = 3

msgcontains elseif (msg, 'no') and talkState [talkUser] == 3 then
    delayedSay ("When I finish his task, return to me, and the prize you do not miss.", 100 cid)
msgcontains elseif (msg, 'yes') and talkState [talkUser] == 3 and ((getPlayerStorageValue (cid, quest) == 1 or getPlayerStorageValue (cid, quest) == 3 or getPlayerStorageValue (cid, quest) == 5 or getPlayerStorageValue (cid, quest) == 7) and (getPlayerStorageValue (cid, expo) ~ = 0)) then
    delayedSay ("You lie, I do not have a job done, which confided to you.", 100 cid)
msgcontains elseif (msg, 'yes') and (getPlayerStorageValue (cid, quest) == 2 or getPlayerStorageValue (cid, quest) == 4 or getPlayerStorageValue (cid, quest) == 6 or getPlayerStorageValue (cid, quest) == 8 ) and (getPlayerStorageValue (cid, expo) == -1) and talkState [talkUser] == 3 then
    delayedSay ("Heh ... quickly with that uporales. You can now choose their reward ().", 100 cid)
    doPlayerAddExp (cid, 15000)
    doSendAnimatedText (getPlayerPosition (cid), "15000", TEXTCOLOR_WHITE)
    setPlayerStorageValue (cid, expo, 1)
    talkState [talkUser] = 4
msgcontains elseif (msg, 'yes') and (getPlayerStorageValue (cid, quest) == 2 or getPlayerStorageValue (cid, quest) == 4 or getPlayerStorageValue (cid, quest) == 6 or getPlayerStorageValue (cid, quest) == 8 ) and (getPlayerStorageValue (cid, expo) == 1) and talkState [talkUser] == 3 then
    delayedSay ("Heh ... quickly with that uporales. You can now choose their reward ().", 100 cid)
    talkState [talkUser] = 4
    
elseif (msgcontains (msg, 'award') or msgcontains (msg, 'reward')) and (getPlayerStorageValue (cid, quest) == 2 and getPlayerStorageValue (cid, expo) == 1) and talkState [talkUser] == 4 then
    delayedSay ("This is a reward for thy pains. Keep it on! If you want to start a new task to tell (task).", 100 cid)
    doPlayerAddItem (cid, terra [randomChance], count)
    setPlayerStorageValue (cid, quest, -1)
    setPlayerStorageValue (cid, earth, -1)
    setPlayerStorageValue (cid, expo, -1)
    setPlayerStorageValue (cid, earth, -1)
    
elseif (msgcontains (msg, 'award') or msgcontains (msg, 'reward')) and (getPlayerStorageValue (cid, quest) == 4 and getPlayerStorageValue (cid, expo) == 1) and talkState [talkUser] == 4 then
    delayedSay ("This is a reward for thy pains. Keep it on! If you want to start a new task to tell (task).", 100 cid)
    doPlayerAddItem (cid, lightning [randomChance], count)
    setPlayerStorageValue (cid, quest, -1)
    setPlayerStorageValue (cid, lightning, -1)
    setPlayerStorageValue (cid, expo, -1)
    setPlayerStorageValue (cid, energy, -1)
    
elseif (msgcontains (msg, 'award') or msgcontains (msg, 'reward')) and (getPlayerStorageValue (cid, quest) == 6 and getPlayerStorageValue (cid, expo) == 1) and talkState [talkUser] == 4 then
    delayedSay ("This is a reward for thy pains. Keep it on! If you want to start a new task to tell (task).", 100 cid)
    doPlayerAddItem (cid, magma [randomChance], count)
    setPlayerStorageValue (cid, quest, -1)
    setPlayerStorageValue (cid, magma, -1)
    setPlayerStorageValue (cid, expo, -1)
    setPlayerStorageValue (cid, fire, -1)
    
elseif (msgcontains (msg, 'award') or msgcontains (msg, 'reward')) and (getPlayerStorageValue (cid, quest) == 8 and getPlayerStorageValue (cid, expo) == 1) and talkState [talkUser] == 4 then
    delayedSay ("This is a reward for thy pains. Keep it on! If you want to start a new task to tell (task).", 100 cid)
    doPlayerAddItem (cid, glacier [randomChance], count)
    setPlayerStorageValue (cid, quest, -1)
    setPlayerStorageValue (cid, glacier, -1)
    setPlayerStorageValue (cid, expo, -1)
    setPlayerStorageValue (cid, water, -1)
end
end
npcHandler: setCallback (CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler: AddModule (FocusModule: new ())

REP ?? ;)
 
Back
Top