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

TalkAction Show players online who have not done an specific quest

Jetro

jangeldev
Joined
Aug 1, 2011
Messages
452
Reaction score
68
Location
Venezuela
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 :)

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)
data/talkactions/scripts/scriptname.lua
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


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 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 :p.
Regards
 
Last edited:
When i saw the thread title I couldnt think of any reason this would be useful. Then I read your post you gave a pretty good reason. I remember in my OT people would always complain about finding other players to do a quest with. simple script good idea.
 
Simple modification and it can be used to see who is online, 100+ who have not done annihilator quest :3

Useful for looking after online players who wants to team up to anni. :D
 
the script is better from day to day :)
add to table of quests somethink like this:
level_required =

because for some quests player must have lvl >= x

for example for PoI quest, Dhq, Inquistion
etc.
 
the script is better from day to day :)
add to table of quests somethink like this:
level_required =

because for some quests player must have lvl >= x

for example for PoI quest, Dhq, Inquistion
etc.
thanks :d, added required level
 
Back
Top