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

Guild for tp

xzh89

New Member
Joined
Jul 14, 2013
Messages
5
Reaction score
0
Hi everyone, I want to know if there is a way to make the player automatically join an guild when going through a TP.

Tibia versión 8.6.

Thank you.
 
Last edited:
Hi,
Do you mean when a player goes into a teleport he joins a specific guild.
Or he joins a guild he has an invite too inside of the guild invites table.
 
and also you are missing all the information:
 
Hi,
Do you mean when a player goes into a teleport he joins a specific guild.
Or he joins a guild he has an invite too inside of the guild invites table.
Yes, i mean when a player goes into a teleport he joins a specific guild.

Ir diferent color name or adding nick next to name.


Im working on a team battle ot but i dont want color outfit uf it can be. I wanna other sistem if it is posibol.
and also you are missing all the information:
What i did bad? Can you tell me please
 
Last edited:
Yes, i mean when a player goes into a teleport he joins a specific guild.

Im working on a team battle ot but i dont want color outfit uf it can be. I wanna other sistem if it is posibol.

What i did bad? Can you tell me please
#5?
 
Why are you making a player join a guild? That's just silly. I can only presume this is a 0.3.7 request.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="compelled-alliance" version="0.1" author="Lessaire" contact="otland.net" enabled="yes">

    <lib name="rude-otadmin"><![CDATA[
-- Set the guild id of the guild the player will be forcefully enrolled into here
GUILDID = ???
    ]]></lib>

    <movevent type="StepIn" uniqueid="8675309" event="script"><![CDATA[
domodlib('rude-otadmin')

function onStepIn(cid, item, position, fromPosition)
    local callback = function(guid)
        local cid = getPlayerByGUID(guid)
        if (isCreature(cid)) then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest member of " .. getPlayerGuildName(cid) .. ".")
        end

    end
    if (item.uniqueid == 8675309) then
        addEvent(callback, 1000, getPlayerGUID(cid))
        doPlayerSetGuildId(cid, GUILDID)
    end

    return true
end
    ]]></movevent>


</mod>
 
Why are you making a player join a guild? That's just silly. I can only presume this is a 0.3.7 request.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="compelled-alliance" version="0.1" author="Lessaire" contact="otland.net" enabled="yes">

    <lib name="rude-otadmin"><![CDATA[
-- Set the guild id of the guild the player will be forcefully enrolled into here
GUILDID = ???
    ]]></lib>

    <movevent type="StepIn" uniqueid="8675309" event="script"><![CDATA[
domodlib('rude-otadmin')

function onStepIn(cid, item, position, fromPosition)
    local callback = function(guid)
        local cid = getPlayerByGUID(guid)
        if (isCreature(cid)) then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest member of " .. getPlayerGuildName(cid) .. ".")
        end

    end
    if (item.uniqueid == 8675309) then
        addEvent(callback, 1000, getPlayerGUID(cid))
        doPlayerSetGuildId(cid, GUILDID)
    end

    return true
end
    ]]></movevent>


</mod>
mod name="compelled-alliance" YOU ARE THE BEST WE HAVE! 😂
 
O
Why are you making a player join a guild? That's just silly. I can only presume this is a 0.3.7 request.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="compelled-alliance" version="0.1" author="Lessaire" contact="otland.net" enabled="yes">

    <lib name="rude-otadmin"><![CDATA[
-- Set the guild id of the guild the player will be forcefully enrolled into here
GUILDID = ???
    ]]></lib>

    <movevent type="StepIn" uniqueid="8675309" event="script"><![CDATA[
domodlib('rude-otadmin')

function onStepIn(cid, item, position, fromPosition)
    local callback = function(guid)
        local cid = getPlayerByGUID(guid)
        if (isCreature(cid)) then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest member of " .. getPlayerGuildName(cid) .. ".")
        end

    end
    if (item.uniqueid == 8675309) then
        addEvent(callback, 1000, getPlayerGUID(cid))
        doPlayerSetGuildId(cid, GUILDID)
    end

    return true
end
    ]]></movevent>


</mod>
i do it because im working on a team battle ot.

But i don’t like force the color of outfit.

Can you explain me more the code please?
 
team battle ot.
Fun.

Can you explain me more the code please?
No.

But i don’t like force the color of outfit.
I think it is you who should explain.
I believe you are perhaps looking at this problem the wrong way, and an entirely differently solution could be crafted.


What is it you are actually trying to achieve? What's wrong with colored outfits?
 
I think people would like to be able to change the color of the outfit freely.

I'm working on a team ot war rpg with his story, missions for his set (tier set) and more

I do not think of a purely war ot entering, warfare and nothing else. So I think the issue of not being able to change color can become a long-term problem.

So a solution that occurred to me was that, that when starting choose for a teleport to which guild they want to belong. And that those two guils are at war.

Another thing to differentiate could be the name in another color. Or next to the name a nick for example.

Or if you have any suggestion they are also accepted.

A greeting
 
So for this particular OT, guilds are not a player managed thing at all?

You are re-purposing the guild system to be factions instead. That's fine, and I would probably do the same think if I were making such a server. In which case the code I provided should work, presuming you are on a 0.X fork and not a 1.X fork.

LUA:
function onStepIn(cid, item, position, fromPosition)
    local callback = function(guid)
        local cid = getPlayerByGUID(guid)
        if (isCreature(cid)) then
            local message = "You are the newest member of " .. getPlayerGuildName(cid) .. "."
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
        end

    end
    if (item.uniqueid == 8675309) then
        addEvent(callback, 1000, getPlayerGUID(cid))
        doPlayerSetGuildId(cid, GUILDID)
    end

    return true
end

When the player steps on the tile:
a closure is defined.
the tile's uniqueid is sanity checked against it's expected value.
if fails: return true, because this is not our tile and we have no reason to block the event listener chain
if pass:
schedule execution of the closure, in one second, using player GUID as parameter.
then set player guild to the guild ID defined it the config.
then return true, we've done our event, the chain may proceed.


When closure is called:
use provided GUID parameter to retrieve creature ID if the matching player object exists, assigned to a variable
sanity check the variable, is it a creature?
if fail: do nothing, the player no longer exists
if pass: retrieve their guild name, send them a message.

We used a delay here because guild changes make a SQL call. Though we could reduce it to 500ms without hurting anything.
 
Last edited:
Back
Top