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

Ceremonial Ankh + twist of fate

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
how to make that Ceremonial Ankh with 5 bless and twist
Code:
local blessings = {"\nWisdom of Solitude", "\nSpark of the Phoenix", "\nFire of the Suns", "\nSpiritual Shielding", "\nEmbrace of Tibia"}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local result = "Received blessings:"
	for i = 1, 5 do
		result = getPlayerBlessing(cid, i) and result .. blessings[i] or result
	end
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 20 > result:len() and "No blessings received." or result)
	return TRUE
end
 
Lua:
local t = {'\nWisdom of Solitude', '\nSpark of the Phoenix', '\nFire of the Suns', '\nSpiritual Shielding', '\nEmbrace of Tibia'}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local r = ''

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			r = r .. t[i]
		end
	end
	if getPlayerPVPBlessing(cid) then
		r = r .. '\nTwist of Fate'
	end

	return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, r == '' and 'No blessings received.' or 'Received blessings:' .. r)
end
 
The code posted by Cykotitan isn't woking :C but the topic one is working fine.
I actions.xml you have to put this:
Code:
<action itemid="6561" script="tools/ceremonial_ankh.lua"/>
 
By looking at your xml line, I assume your server has twisted fate as sixth blessing.
You can add it to the table
Code:
local blessings = {"\nWisdom of Solitude", "\nSpark of the Phoenix", "\nFire of the Suns", "\nSpiritual Shielding", "\nEmbrace of Tibia", "\nTwist of Fate"}
Then change 5 to 6
Code:
for i = 1, 6 do

In the script cykotitan posted there is [ i ] missing because of missing tags (old Lua tags don't work anymore).
Code:
r = r .. t[i]
 
Back
Top