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
And at the end of data\talkactions\talkactions.xml add:
TFS 0.3.4 PL 2:
Older TFS:
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
TFS 0.3.4 PL 2:
Code:
<talkaction words="!bless" event="script" value="bless.lua"/>
Code:
<talkaction words="!bless" script="bless.lua"/>
Last edited: