Shadow Dan
Sh4dowDan
Tested on TFS 0.4 - works
data/creaturescripts/scripts/blessCheck.lua
data/creaturescripts/creaturescripts.xml
data/creaturescripts/scripts/login.lua
yes = have blessing
no = no bless
v1.0 by zbizu
data/creaturescripts/scripts/blessCheck.lua
Lua:
function onLogin(cid)
if(getPlayerBlessing(cid, 1)) then
first = "yes"
else
first = "no"
end
if(getPlayerBlessing(cid, 2)) then
second = "yes"
else
second = "no"
end
if(getPlayerBlessing(cid, 3)) then
third = "yes"
else
third = "no"
end
if(getPlayerBlessing(cid, 4)) then
fourth = "yes"
else
fourth = "no"
end
if(getPlayerBlessing(cid, 5)) then
fifth = "yes"
else
fifth = "no"
end
doPlayerSendTextMessage(cid,20,'Your blessings: 1='.. first ..' 2='.. second ..' 3='.. third ..' 4='.. fourth ..' 5='.. fifth ..'')
return true
end
data/creaturescripts/creaturescripts.xml
XML:
<event type="login" name="BlessCheck" event="script" value="blessCheck.lua"/>
Lua:
registerCreatureEvent(cid, "BlessCheck")
yes = have blessing
no = no bless
v1.0 by zbizu
Lua:
function onLogin(cid)
local BLESSINGS, amount, missing = {"Wisdom of Solitude", "Spark of the Phoenix", "Fire of the Suns", "Spiritual Shielding", "Embrace of Tibia"}, 0, {}
for i = 1, 5 do
if getPlayerBlessing(cid, i) then amount = (amount+1) else table.insert(missing, BLESSINGS[i]) end
end
if amount == 1 then s='' else s='s' end
doPlayerSendTextMessage(cid,20,'You have '..amount..' blessing'..s..' ('.. amount*20 ..'%).\nMissing blessings: '..table.concat(missing, ", "))
return true
end
Last edited: