Ü Pendragon
Member
- Joined
- Apr 10, 2017
- Messages
- 51
- Reaction score
- 6
Hi guys, I have a problem with these bless. I am not a programmer or anything so I think they work badly. The script grants the 8 blessings and when you die by pvp you lose the twist of fate (1) and by putting bless again you can. But they accumulate, now you have double the blessings. To some extent, if you die 30 times in pvp, you won't spend 30 times on bless monsters. (why does it accumulate)
I also thought about whether it is possible to add that the limit is 1. But I think this is not the best way to solve it. Thanks in advance.
Lua:
local talk = TalkAction("!bless")
function talk.onSay(cid)
local player = Player(cid)
local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
if(player:hasBlessing(1) and player:hasBlessing(2) and player:hasBlessing(3) and player:hasBlessing(4) and player:hasBlessing(5) and player:hasBlessing(6) and player:hasBlessing(7) and player:hasBlessing(8)) then
player:sendCancelMessage("You already have been blessed!", cid)
elseif player:removeMoney(totalBlessPrice) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
for b = 1, 8 do
player:addBlessing(b, 1)
end
player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
else
player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
end
end
talk:separator(" ")
talk:register()
Post automatically merged:
I also thought about whether it is possible to add that the limit is 1. But I think this is not the best way to solve it. Thanks in advance.