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

Partner System

Wake

Member
Joined
Oct 1, 2012
Messages
130
Reaction score
12
Location
São Paulo - Brazil
Dear Otlanders!!!

Partner System

Details:
- The most useful system for OpenTibia already created. It is a system that encourages players to invite friends to play and win your server for it! See:
*
The veteran (player who will invite) sends through the command / partner invitation, an invitation NAME invited to accept the partnership.
The Guest reads, verifies that the person knows, and type / partner accept, NomeDoVeterano.
*
From now on, all the guest kill, give 10% (configurable) the experience gained from killing monsters that guest.
*
Example: I am the player A, player B and the call to play my server, he accepts. Now if player B kill a monster of 1000 xp, the player wins the 100 exp bonus! The guest did not lose anything, so get a nice friendship of the player who will certainly try to protect him and encourages him to play!

Create a new XML file and paste:

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Partner System" version="1.0" author="Luckyoak" contact="none" enabled="yes">
<config name="partner_config"><![CDATA[
-------- CONFIGS --------
waittime = 24 -- Tempo de espera em horas para convidar alguém novamente
storage = 4651
level = 100 -- Level necessário para convidar alguém
maxlevel = 50 -- Level máximo para alguém virar partner e para ter bônus de EXP
maxp = 5 -- Maximo de partners que alguém pode ter
rate = 1.1 -- Rate do bônus
-------- CONFIGS --------
]]></config>
<talkaction words="!partner" event="buffer"><![CDATA[
domodlib('partner_config')
local pid = getPlayerByNameWildcard(param)
local pst = getPlayerStorageValue(cid, 9155)
local stor = getPlayerStorageValue(cid, 9157)

if param ~= "aceitar" and param ~= "rejeitar" then
if not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(pid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..param.." não encontrado.") return true
elseif pid == cid then
doPlayerSendCancel(cid, "Você não pode convidar a si mesmo.") return true
elseif getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "Você precisa ser level "..level.." para usar esse comando.") return true
elseif getPlayerLevel(pid) > maxlevel then
doPlayerSendCancel(cid, "O player "..param.." é level muito alto para ser seu partner.") return true
elseif stor >= maxp then
doPlayerSendCancel(cid, "Você já atingiu seu limite de partners.") return true
elseif getPlayerStorageValue(pid, 9158) >= 1 then
doPlayerSendCancel(cid, "Este player já foi partner de alguém.") return true
elseif exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..exhaustion.get(cid, storage/3600).." horas para utilizar esse comando novamente.") return true
elseif getPlayerStorageValue(pid, 9156) == 1 then
doPlayerSendCancel(cid, "Este player já possui um convite pendente.") return true
end

exhaustion.set(cid, storage, waittime*60*60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Convite enviado à "..param..".")
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, ""..getCreatureName(cid).." está te convidando para ser seu partner. Use o comando !partner aceitar ou rejeitar.")
setPlayerStorageValue(pid, 9156, 1)
setPlayerStorageValue(pid, 9155, cid)
return true
else
if getPlayerStorageValue(cid, 9156) < 1 then
doPlayerSendCancel(cid, "Você não possui convites pendentes.") return true
elseif param == "aceitar" then
if not isCreature(pst) then doPlayerSendCancel(cid, "Espere o player ficar online para você aceitar seu convite.") return true
end
if getPlayerStorageValue(pst, 9157) == -1 then
setPlayerStorageValue(pst, 9157, 1)
else
setPlayerStorageValue(pst, 9157, getPlayerStorageValue(pst, 9157)+1)
end
setPlayerStorageValue(cid, 9158, 1)
doPlayerSendTextMessage(pst, MESSAGE_STATUS_CONSOLE_ORANGE, "Convite aceito. O player "..getCreatureName(cid).." agora é seu partner.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você agora é partner de "..getCreatureName(pst)..". Você será deslogado em 5 segundos.")
addEvent(doRemoveCreature, 5000, cid)
setPlayerStorageValue(cid, 9156, -1)
elseif param == "rejeitar" then
if not isCreature(pst) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você rejeitou o convite.")
setPlayerStorageValue(cid, 9156, -1) return true
end
doPlayerSendTextMessage(pst, MESSAGE_STATUS_CONSOLE_ORANGE, "Seu convite foi rejeitado.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você rejeitou o convite de "..getCreatureName(pst)..".")
setPlayerStorageValue(cid, 9156, -1)
end
end
return true
]]></talkaction>
<event type="login" name="PartnerSyst" event="script"><![CDATA[
domodlib('partner_config')
function onLogin(cid)
registerCreatureEvent(cid, "PartnerSyst")

if getPlayerStorageValue(cid, 9158) == 1 then
doPlayerSetExperienceRate(cid, rate)
doPlayerPopupFYI(cid, "Você obteve "..(rate*10-1).."% de bônus de experiência até o level "..maxlevel..".")
setPlayerStorageValue(cid, 9158, 2)
end

if getPlayerLevel(cid) > maxlevel and getPlayerStorageValue(cid, 9158) == 2 then
doPlayerSetExperienceRate(cid, 1.0)
doPlayerPopupFYI(cid, "Seu bônus de partner acabou por você ter atingido o level "..maxlevel..".")
setPlayerStorageValue(cid, 9158, 3)
end
return true
end
]]></event>
</mod>

Thanks!!!
 
Last edited:
Okey. Player A invite plate B and player B got a bonus % exp....
But WHY player A don't got bonus? -.^ he have nothing for invite -.^ so he don't start invite person because have nothing :D
can fix that?
 
and this:
9.81


[7/10/2013 16:7:33] Description:
[7/10/2013 16:7:33] [string "LuaInterface::loadBuffer"]:24: attempt to concatenate a boolean value
 
Okey. Player A invite plate B and player B got a bonus % exp....
But WHY player A don't got bonus? -.^ he have nothing for invite -.^ so he don't start invite person because have nothing :D
can fix that?

Seems like you didn't get it...
 
Look..
Could you fix that:
Player A invite player B and player B have % much exp and player A have too.

Because look hat dialog:
B: Please invite me
A: No
B: Why?
A: Because you got % exp but i don't have % exp and i have nothing in that.
 

Similar threads

Back
Top