• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction !bless Buys all 5 with 1 command - RL tibia costs!

jerryb1988

Member
Joined
Mar 10, 2008
Messages
79
Reaction score
5
Originally posted by Mazen Here.

I fixed his 2 errors and added a cost system like RL tibia (based on level)

Create a new file in data\talkactions\scripts\ called bless.lua
Code:
function onSay(cid, words, param)
local fail = 0

	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
	
	if cost > 20000 then
		cost = 20000
	end

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
And at the end of data\talkactions\talkactions.xml add:
TFS 0.3.4 PL 2:
Code:
<talkaction words="!bless" event="script" value="bless.lua"/>
Older TFS:
Code:
<talkaction words="!bless" script="bless.lua"/>
 
Last edited:
Does this also work like an AOL?

Blessings that make you not lose any loot without aol.
 
Back
Top