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

[TFS 1.3+] Low Level Protection [PvP Enabled]

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,737
Solutions
7
Reaction score
541
Location
Canada
[Tested on TFS 1.5]

Hey there guys; got tired of the default way of how protection works on most servers; so decided to bring back low level PVP.
The idea is you can set PVP Level to 8 in config.lua and still allow protection until level 100 as long the player does not have a skull.

Special Thanks to @Sarah Wesker for the amazing revscript template system for Sublime!
Without her layouts I would have stuck to the normal scripting style.

Simply download and drag the file into your scripts folder!
scripts/creaturescripts/adventurersBlessing.lua
Lua:
local creatureEvent = CreatureEvent("AdventurersBlessingDeath")

function creatureEvent.onPrepareDeath(creature, killer)
    if(creature:getLevel() <= 100 and creature:getSkull() == 0) then
        for i = 1, 5 do
            if not creature:hasBlessing(i) then
                creature:addBlessing(i, 1)
            end
        end
    creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You were protected by adventurers blessings.")
    else
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You were not protected by adventurers blessings due to being skulled.')
    end
    return true
end

creatureEvent:register()

local creatureEvent = CreatureEvent("AdventurersBlessingLogin")

function creatureEvent.onLogin(player)
    player:registerEvent("AdventurersBlessingDeath")
    return true
end

creatureEvent:register()

You can also add the following to creaturescripts login.lua a message to display this info.
Lua:
--Blessing Protection Status Message
    if(player:hasBlessing(1) and player:hasBlessing(2) and player:hasBlessing(3) and player:hasBlessing(4) and player:hasBlessing(5)) then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are currently protected by blessings.")
        player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
    elseif player:getLevel() <= 100 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,'Your items will be protected on death until level 100 unless you are skulled!')
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,'Purchase blessings using "!bless" to protect yourself during PvP!')
        player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,'You are not protected by blessings, say "!bless" to purchase them!')
    end
[code]
 

Attachments

  • adventurersBlessing.lua
    773 bytes · Views: 8 · VirusTotal
Last edited:
Hey!

So the script works without any issue, my only issue is when a player dies by monsters (without skull) the print is incorrect. Because i have bless and u can see on first line. This confuses me a bit, Even if i die without !bless i get the same print that "You were not protected by ad bless due to being skulled"

Any idea how to fix it ? :)

1667207166706.png
 
Hey!

So the script works without any issue, my only issue is when a player dies by monsters (without skull) the print is incorrect. Because i have bless and u can see on first line. This confuses me a bit, Even if i die without !bless i get the same print that "You were not protected by ad bless due to being skulled"

Any idea how to fix it ? :)

View attachment 71450
That's strange as the script checks if the player has a skull and depending on that it sends the message. What client version are you using? You may need to modify the amount of blessings it checks for.
 
Last edited:
10.98, the blessings are correct to real tibia i belive, tho am using latest tfs 1.4.2 Idk if that could be some issues with that
 
if(creature:getLevel() <= 100 and creature:getSkull() == 0) then
Hey!

So the script works without any issue, my only issue is when a player dies by monsters (without skull) the print is incorrect. Because i have bless and u can see on first line. This confuses me a bit, Even if i die without !bless i get the same print that "You were not protected by ad bless due to being skulled"

Any idea how to fix it ? :)

View attachment 71450
Doesn't work because you are above level 100.
I'd just change the if statement to
Lua:
if creature:getLevel() > 100 then
    return true
end
if creature:getSkull() == SKULL_NONE then
to avoid confusion with the death message
 
10.98, the blessings are correct to real tibia i belive, tho am using latest tfs 1.4.2 Idk if that could be some issues with that
I believe 10/98 uses 6 or 7 blessings since Twist of Fate and some other one was added which would result in line 5 being changed from "for i = 1, 5 do" to "for i = 1, 7 do" however what Merlin stated may help.
 
Back
Top