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

[C++] Adventure's Blessing

Xtr3m3

Member
Joined
May 14, 2009
Messages
131
Reaction score
11
Any ppl have idea how do this?

oHlw7vP.png


In ProtocolGame::sendReloginWindow(), if you change it to 0x01 then don’t send unfairFightReduction.

NetworkMessage msg;
msg.AddByte(0x28);
if (player->blessings != 0) {
msg.AddByte(0x01);
} else {
msg.AddByte(0x00);
msg.AddByte(unfairFightReduction);
}
writeToOutputBuffer(msg);

But this blessing is only to deaths by players.

Any idea?
 
For this one I stored a new boolean on the player class (for this blessing only), so you can check if monster or player was the lasthit/damagedealer on Player::death, and then check that boolean value in the ProtocolGame::sendReLoginWindow.

I think this isn't the way it works on real tibia tho.
 
This seems achievable in LUA
Update:
locate droploot.lua in creaturescripts,
If your droploot.lua looks like this,
Lua:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end

        if not isPlayer or not player:hasBlessing(6) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    if not item:moveTo(corpse) then
                        item:remove()
                    end
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end
then change it to
Lua:
advbstor = 12345 -- The Adventurers Blessing Storage Key!
local advblevel = 21 -- Level at which lose Adventurers Blessing
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end
        if isPlayer and player:getStorageValue(advbstor) == 1 and player:getLevel() < advblevel then
            return true
        end
        if not isPlayer or not player:hasBlessing(6) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    if not item:moveTo(corpse) then
                        item:remove()
                    end
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end
(note: important changes are 3 lines of code at roughly line 21-23 and the new variables at the top)
then in firstitems.lua after:
Lua:
function onLogin(player)
    if player:getLastLoginSaved() == 0 then
put
Lua:
player:setStorageValue(advbstor,1)
and then finally locate creature.lua in events
and replace
Lua:
function Creature:onTargetCombat(target)
    return true
end
with
Lua:
function Creature.onTargetCombat(self, target)
    if self and target and self:isPlayer() and target:isPlayer() then
        self:setStorageValue(advbstor,-1)
    end
    return true
end
I believe events are TFS 1.x+ exclusive, not tested
 
Last edited:
@Aled This you just post, is to set the golden frame, so that any high level, when you place all the bless you get the hoop and can know if you have the bless? Or only for low levels?
 
Only newbies will get that bless (first login).
Once you attack another player, you lose it.
Once you reach level 21 you will not lose it, but it will no longer take effect.
You will not lose any other bless, items or aol while that bless is active.
 
Simple man, use the golden frame as a spice of blessheck, ie any high level having all the blessings, will have activated the golden frame, and if you do not have them then you can not see the golden frame


Like picture of shivera-global.net :

18034308_202666030237964_5776350372289269195_n.jpg
 
@Aled Exactly!!!! that sea as a kind of blessing that when the player, buy all the blessings have the golden frame, and if the player does not have the blessings, then none will have the golden frame
 
Back
Top