[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
You can also add the following to creaturescripts login.lua a message to display this info.
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.lua773 bytes · Views: 8 · VirusTotal
Last edited: