Hi all, this is a very simple script but maybe it can be useful to someone. Basically makes easier the team search to a quest using a simple command: "!quest [nameofquest]" . It shows all the players online who have not done the quest, it is too easy to configure ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Update log
data/talkactions/scripts/scriptname.lua
data/talkactions/talkactions.xml
Here is an image:
Now, how to configure it?
just add lines in the table quest like this one:
It's the name of the quest.
It's the storage of the quest.
It's the higher value of the storage.
level required for the quest
Feel free to express any suggestions, questions or criticism
.
Regards
Update log
Code:
[B]v1.0 Rev: 3:[/B]
[B]Rev: 2 - [10 / 01 / 2012][/B]
Show players by vocations.
Show the number of players by each voc.
Show the players sorted by him/her level.
[B]Rev: 3 - [10 / 01 / 2012][/B]
Added required level.(small fix)
Lua:
local quest =
{
["DHQ"] = {storage = 2121, value = 3, level = 50},
["ANIHI"] = {storage = 1212, value = 1, level = 100},
}
local chest = 1740
function onSay(cid, words, param, channel)
quests = quest [param]
if (param == "" or not param) then
return doPlayerSendCancel(cid, "Command param required.")
end
if (quests) then
local sorcs = {}
local druids = {}
local pallies = {}
local kinas = {}
local name,voc,level = "","",0
for _,on in pairs (getPlayersOnline()) do
if (getPlayerStorageValue(on, quests.storage) < quests.value and getPlayerLevel(on) >= quest.level) then
name, voc, level = getCreatureName(on), getPlayerVocationName(on), getPlayerLevel(on)
if ( isSorcerer(on)) then
table.insert(sorcs, name.. " ["..level.."]" )
elseif ( isDruid(on)) then
table.insert(druids, name.. " ["..level.."]")
elseif (isPaladin(on)) then
table.insert(pallies, name.. " ["..level.."]")
elseif (isKnight(cid)) then
table.insert(kinas, name.. " ["..level.."]")
end
end
end
local np = "There are not players."
local str = "Players List: \n"
str = str.. "Sorcerers (".. #sorcs..")\n".. (#sorcs == 1 and sorcs[1] or #sorcs > 1 and not table.sort(sorcs, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (sorcs, ", ").."." or np).. " \n"
str = str.. "Druids ("..#druids..")\n".. (#druids == 1 and druids[1] or #druids > 1 and not table.sort(druids, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (druids, ", ").."." or np).. "\n"
str = str.. "Pallies ("..#pallies..")\n"..(#pallies == 1 and pallies[1] or #pallies > 1 and not table.sort(pallies, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (pallies, ", ").."." or np).. "\n"
str = str.. "Kinas ("..#kinas..")\n".. (#kinas == 1 and kinas[1] or #kinas > 1 and not table.sort(kinas, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (kinas, ", ").."." or np)
doShowTextDialog(cid, chest, str)
else
doPlayerSendCancel(cid, "There is not exist a quest called "..param..".")
end
return true
end
data/talkactions/talkactions.xml
XML:
<talkaction words="!quest" event="script" value="scriptname.lua"/>
Here is an image:
![nQc0D.png](/proxy.php?image=http%3A%2F%2F3.imgland.net%2FnQc0D.png&hash=e46e658bbc05ca7672ae1c9ceed0359c)
Now, how to configure it?
just add lines in the table quest like this one:
Code:
["[COLOR="#008000"]Example[/COLOR]"] = {[COLOR="#FF0000"]storage[/COLOR] = 1000, [COLOR="#800080"]value[/COLOR] = 2343, [COLOR="#008080"]level[/COLOR] = 100},
It's the storage of the quest.
It's the higher value of the storage.
level required for the quest
Feel free to express any suggestions, questions or criticism
Regards
Last edited: