• 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!

getQuestName(uid) -> Tells the player what quest is done

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
Using an easy table we can tell the player the name of the quest is he doing when opens the chest.

Lua:
function getQuestName(uid)
    local table = {
        [13333] = "Spike Sword",
        [40000] = "Pits of Inferno",
        [1320] = "Demon Oak",
    }
return table[uid]
end

actions/quest/system.lua
..last lines
Lua:
        if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
                result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
        else
                result = "You have found " .. result .. ". You have completed the "..getQuestName(item.uid).." quest!"
                setPlayerStorageValue(cid, storage, 1)
                if(questsExperience[storage] ~= nil) then
                        doPlayerAddExp(cid, questsExperience[storage])
                        doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
 
Code:
local table = {
	[13333] = "Spike Sword",
	[40000] = "Pits of Inferno",
	[1320] = "Demon Oak",
}

function getQuestName(uid)
	return table[uid]
end

Better :peace:
 
Back
Top