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

(Request) !bless including Aol!(RL Tibia Blessing)

Fyruz

★★★★★
Joined
Feb 7, 2009
Messages
556
Reaction score
19
Location
127.0.0.1
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end

I rep+++
 
It should be done by creaturescripts:
creaturescripts.xml add
Code:
<event type="preparedeath" name="onPrepareDeath" event="script" value="blessingdeath.lua"/>
login.lua add
Code:
	registerCreatureEvent(cid, "onPrepareDeath")
blessingdeath.lua
LUA:
function onPrepareDeath(cid)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doCreatureSetDropLoot(cid, false)
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
		doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
	end
return 1
end
Rep++
 
This with the same money thing and all no lose item when die :)

ok look , This is talkaction script :
LUA:
function onSay(cid, words, param)
local price = 10000
        if getPlayerLevel(cid) >= 31 and getPlayerLevel(cid) < 120 then
              price = ( getPlayerLevel(cid) - 20) * 1000
        elseif getPlayerLevel(cid) >= 120 then
              price = 100000
        end
 
		if getPlayerBlessing(cid,5) and getPlayerBlessing(cid,4) and getPlayerBlessing(cid,3) and getPlayerBlessing(cid,2) and getPlayerBlessing(cid,1) then
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed.")
              doSendMagicEffect(getPlayerPosition(cid), 2)
         return true
		 end
		if getPlayerMoney(cid) < price then
               doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You dont have enough money, you need "..price.." gold.")
           return true
        end
 
		if doPlayerRemoveMoney(cid, price) == TRUE then
 
			  for i = 1,5 do
                      doPlayerAddBlessing(cid,i)
               end
 
					 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings for 100k!")
					  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
        else
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 100,000 gp in backpack for blessings.")
					 doSendMagicEffect(getPlayerPosition(cid), 2)
        end
 
 
return TRUE
end

Now lets make when you have bless you lose no item.
Go to creaturescripts--> scripts--> creatre new loss.lua
[paste]
LUA:
function onLogin(cid)
 if getPlayerLossPercent(cid, 3) ~= 100 or getPlayerLossPercent(cid, 4) ~= 100 then
      doPlayerSetLossPercent(cid, 3, 100)
      doPlayerSetLossPercent(cid, 4, 100)
 end
registerCreatureEvent(cid, "log")
return true
end
function onPrepareDeath(cid, deathList)
 if getPlayerBlessing(cid,1) and getPlayerBlessing(cid,2) and getPlayerBlessing(cid,3) and getPlayerBlessing(cid,4) and getPlayerBlessing(cid,5) then
   doPlayerSetLossPercent(cid, 3, 0)
   doPlayerSetLossPercent(cid, 4, 0)
  end
return true
end

Now go to creaturescript --> creaturescript.xml
[paste these lines in it]
Code:
<event type="preparedeath" name="log" event="script" value="loss.lua"/>
<event type="login" name="tab" event="script" value="loss.lua"/>
 
Back
Top