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

[7.72] OTHire 0.0.1b - Based in OTServ Trunk (Latest)

I can't get the "change citizen" portals to work properly, what is wrong in my script?
I get no errors in the console, but the teleport has no effect at all.

<movevent event="StepIn" uniqueid="8003" script="citizen/thais.lua"/>

Lua:
function onStepIn(cid, item, position, fromPosition)

local pos = {x = 32369, y = 32241, z = 7}

    if isPlayer(cid) == 1 then
        doTeleportThing(cid, pos)
        doPlayerSetTown(cid, 3)
        doSendMagicEffect(getCreaturePosition(cid), 12)
    end
end

function onAddItem(moveitem, tileitem, position)
    local pos = {x = 32369, y = 32242, z = 6}
    doTeleportThing(moveitem.uid, pos)
        doSendMagicEffect(pos, 13)
end
 
  • tray this



  • Code:
    --Example change voc and masterpos--
    
    function onStepIn(cid, item, pos)
        if item.actionid==50101 then
            newpos = {x=32369, y=32241, z=7}
            doPlayerSetTown(cid, 3)
            doPlayerSendTextMessage(cid,22,"You have changed your residence to Thais")
            doTeleportThing(cid,newpos)
            doSendMagicEffect(newpos,12)
            return 1
        end
    end
 
What's the point of item.actionid== x if you set movements on actionid already? (Just asking)
Also, make local variables please.

@Eldora; make sure that this TP in RME has no "destination" set
 
Undefined variable: rankcolor in C:\wamp\www\guilds.php on line 215

PHP:
        <?php
        //data_dump($players, false, "Data");
        foreach ($players as $player) {
[INDENT]            if ($rankcolor !== true && $rankcolor !== false) {                          <---------------- line 215[/INDENT][/I]
                $checkname = $player['rank_name'];
                $rankcolor = true;
            }
            elseif ($player['rank_name'] !== $checkname) {
                $checkname = $player['rank_name'];
                if ($rankcolor === true) {
                    $rankcolor = false;
                } else {
                $rankcolor = true;
                }
            }
            if ($rankcolor === true) {
            echo '<tr class="lightborder">';
            } else echo '<tr class="darkborder">';
            echo '<td>'. $player['rank_name'] .'</td>';
            echo '<td><a href="characterprofile.php?name='. $player['name'] .'">'. $player['name'] .'</a>';
            if (!empty($player['guildnick'])) {
                echo ' ('. $player['guildnick'] .')';
            }
            echo '</td>';
            echo '<td>'. $player['level'] .'</td>';
            echo '<td>'. $config['vocations'][$player['vocation']] .'</td>';
            echo '</tr>';
        }
        ?>

Can anyone help me with this?
 
Undefined variable: rankcolor in C:\wamp\www\guilds.php on line 215
Can anyone help me with this?


Unrelated to the topic. You should use the support section.

But while we're at it: $rankcolor doesn't exist since it's not defined anywhere, you just start to check its value out of nowhere. And secondly, the first statement is checking if rankcolor is not true and if it's not false. There are only two states of "true or false" so it's pointless to check both in the same case
 
--should players be able to rope creatures (like at older versions of tibia)?
can_rope_creatures = true


Why doesn't it work to rope creatures (Monsters nor Players)?

-----------------------------------------------------------------------------------------------

Why doesn't UH trap work? - Thought this was default on othire?

-----------------------------------------------------------------------------------------------

Also, why does charges not show on runes?

Example:

Code (Lua):

Lua:
<item id="2263" article="an" name="sudden death rune">
        <attribute key="runeSpellName" value="adori vita vis"/>
        <attribute key="weight" value="120"/>
        <attribute key="charges" value="1"/>
    </item>

22:46 You see an sudden death rune.
It weighs 1.20 oz.
ID: 2263
Position: [33213, 31890, 7]
 
anyone can tell me where is the code related to teleport player to temple when player are over unwalkable tiles?
 
Its not done, nor perfect yet. But feel free to contribute.

Teleport thing is in map.cpp Map::placreature
 
Another problem :/
i wanna run this server with real map.
buy every real map which i try to put in my server to run have any errors.
all time i got errors with items.otb version or with items on map and i cant run my server because of this.
do you have any real map with items, spawns and houses compatible with this server?
 
Another problem :/
i wanna run this server with real map.
buy every real map which i try to put in my server to run have any errors.
all time i got errors with items.otb version or with items on map and i cant run my server because of this.
do you have any real map with items, spawns and houses compatible with this server?
In RME folder in clients.xml set:
HTML:
<client name="7.6" otb="7.60" visible="true" data_directory="760">
            <otbm version="1"/> //SET IT TO 2
            <extensions from="7.6" to="7.6"/>
            <data format="7.55" dat="0x439D5A33" spr="0x439852BE"/>
        </client>

Then open & save map. It should work.
 
Someone has problems with item charges? for example my player uses the Stone Skin Amulet and dont remove charges, im debug BlockHit but it says he convert the item lol, and nothing happen in game.

My item in items.xml

XML:
<item id="2197" article="a" name="stone skin amulet">
        <attribute key="weight" value="760" />
        <attribute key="slotType" value="necklace"/>
        <attribute key="charges" value="5" />
        <attribute key="showcharges" value="1" />
        <attribute key="absorbPercentPhysical" value="80"/>
    </item>

C++:
BlockType_t Player::blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage, bool checkDefense /* = false*/, bool checkArmor /* = false*/)
{
    BlockType_t blockType = Creature::blockHit(attacker, combatType, damage, checkDefense, checkArmor);

    if(attacker)
        sendCreatureSquare(attacker, SQ_COLOR_BLACK);

    if(blockType != BLOCK_NONE)
        return blockType;

    if(damage != 0){
        //reduce damage against inventory items
        Item* item = NULL;
        for(int32_t slot = SLOT_FIRST; slot < SLOT_LAST; ++slot){
            if(!(item = getEquippedItem((slots_t)slot)))
                continue;

            const ItemType& it = Item::items[item->getID()];

            if(it.abilities.absorb.reduce(combatType, damage))
            {
                std::cout << " yes " << slot << std::endl;
                std::cout << slot << "item->getCharges() = " << item->getCharges() << "it.charges = " << it.charges << std::endl;
                if(item->getCharges())
                    std::cout << slot << " debug if it has charges " << std::endl;
                if(g_game.transformItem(item, item->getID(), item->getCharges() - 1)){ std::cout << "converted" << std::endl; } else std::cout << "Cant transform it " << std::endl;
            }
        }

        if(damage <= 0){
            damage = 0;
            return BLOCK_DEFENSE;
        }
    }
    return blockType;
}
 
Config should have something with remove charges, check that first
 
Config should have something with remove charges, check that first

That was the first thing that i do, but this isn't amulet related.
Code:
remove_rune_charges = true
remove_weapon_charges = true

Added items in movements and none.

I "fix" it temporaly idk if is good way, the only problem that i get is when item have 1 charges it work like has 2.

Changing this functions to

C++:
void setCharges(uint16_t n) {
            setIntAttr(ATTR_ITEM_CHARGES, n);
        }
        uint16_t getCharges() const {
            return (uint16_t)getIntAttr(ATTR_ITEM_CHARGES);
        }

and BlockHit to:

C++:
BlockType_t Player::blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage, bool checkDefense /* = false*/, bool checkArmor /* = false*/)
{
    BlockType_t blockType = Creature::blockHit(attacker, combatType, damage, checkDefense, checkArmor);

    if(attacker)
        sendCreatureSquare(attacker, SQ_COLOR_BLACK);

    if(blockType != BLOCK_NONE)
        return blockType;

    if(damage != 0)
    {
        //reduce damage against inventory items
        Item* item = NULL;
        for(int32_t slot = SLOT_FIRST; slot < SLOT_LAST; ++slot)
        {
            if(!(item = getEquippedItem((slots_t)slot)))
                continue;

            const ItemType& it = Item::items[item->getID()];

            if(it.abilities.absorb.reduce(combatType, damage))
            {
                if((item->getCharges() - 1) > 0)
                {
                    //g_game.transformItem(item, item->getID(), item->getCharges() - 1) to this.
                    item->setCharges((item->getCharges() - 1));
                }
                else
                {
                   // And if the next block the item has 0 charges then remove it.
                   g_game.internalRemoveItem(item);
                }
            }
        }

        if(damage <= 0){
            damage = 0;
            return BLOCK_DEFENSE;
        }
    }
    return blockType;
}
 
Last edited:
Back
Top