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

Amulet With Bless

Joined
Sep 29, 2009
Messages
224
Reaction score
0
I Have One Amulet And I Need When Player Use This, He Win All Bless.

Here:
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
		    if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
                doCreatureSetDropLoot(cid, false)       
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
        return true
		    end
        end
    end
    return true
end

Thx
 
PHP:
-- edited by kazz

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if (isPlayer(cid) == TRUE) then
		if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
			if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
				doCreatureSetDropLoot(cid, FALSE)       
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
			end
			if not(getPlayerBlessing(cid, bless[i])) then
				for i = 1, table.maxn(bless) do
					doPlayerAddBlessing(cid, bless[i])
				end 
			end
		end
	end
	return TRUE
end

Try this! =)
 
Or equiping the amulet
Lua:
function onEquip(cid, item, slot)

	if(slot == CONST_SLOT_NECKLACE) then
		if(item.itemid == AMULET_OF_LOSS_ID) then
			for i = 1, 5 do
				if not getPlayerBlessing(cid, i) then
					doPlayerAddBlessing(cid, i)
				end
			end
		end
	end
	return true
end

This goes in movements
 
Or equiping the amulet
Lua:
function onEquip(cid, item, slot)

	if(slot == CONST_SLOT_NECKLACE) then
		if(item.itemid == AMULET_OF_LOSS_ID) then
			for i = 1, 5 do
				if not getPlayerBlessing(cid, i) then
					doPlayerAddBlessing(cid, i)
				end
			end
		end
	end
	return true
end

This goes in movements

You buy only ONE amulet, equip, de-equip and send for all your friends, all now have blessings! \o/
Is only equip to add blessings, but and on de-equip?

Creaturescripts best solution for now..
Or have removeBlessings function?
 
Thx For 2
More I Have Other Problem.

When Player Dead With Amulet, The "PK" No Win Frag ;/

When I Fixed ?

Obs: The Amulet Work With "White PK, No PK". I Need Work Bless For All Pks And Function doCreatureSetDropLoot(cid, FALSE) For RedSKull, BlackSkull
 
PHP:
-- edited by kazz

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if (isPlayer(cid) == TRUE) then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
            if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
                doCreatureSetDropLoot(cid, FALSE)      
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
            end
            if not(getPlayerBlessing(cid, bless[i])) then
                for i = 1, table.maxn(bless) do
                    doPlayerAddBlessing(cid, bless[i])
                end
            end
        end
    end
    return TRUE
end

Try this! =)

Does anyone know what this number 1 to 5 is for? can i remove this line? I just want when I die it disappears item at once
local bless = {1, 2, 3, 4, 5} <<<<<
 
when I die and it does not disappear item, how do I
put remove item when die?
Lua:
-- edited by kazz

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if (isPlayer(cid) == true) then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
            if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
                doCreatureSetDropLoot(cid, FALSE)     
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
            end
            if not(getPlayerBlessing(cid, bless[i])) then
                for i = 1, table.maxn(bless) do
                    doPlayerAddBlessing(cid, bless[i])
                end
            end
        end
        doPlayerRemoveItem(cid, amulet, 1)
    end
    return true
end
 
Lua:
-- edited by kazz

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if (isPlayer(cid) == true) then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
            if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
                doCreatureSetDropLoot(cid, FALSE)    
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
            end
            if not(getPlayerBlessing(cid, bless[i])) then
                for i = 1, table.maxn(bless) do
                    doPlayerAddBlessing(cid, bless[i])
                end
            end
        end
        doPlayerRemoveItem(cid, amulet, 1)
    end
    return true
end
dude, you solved the problem here thanks😁
 
Lua:
-- edited by kazz

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if (isPlayer(cid) == true) then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
            if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
                doCreatureSetDropLoot(cid, FALSE)    
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
            end
            if not(getPlayerBlessing(cid, bless[i])) then
                for i = 1, table.maxn(bless) do
                    doPlayerAddBlessing(cid, bless[i])
                end
            end
        end
        doPlayerRemoveItem(cid, amulet, 1)
    end
    return true
end

when I die I would like the amulet to become another item like id 2196 to 2000, how do I do it?
 
Lua:
local blessings = {1, 2, 3, 4, 5}
local amuletId = 2196
local transformId = ITEM_ID

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    local amuletSlot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
    if amuletSlot.itemid ~= amuletId then
        return true
    end

    if getCreatureSkullType(cid) >= SKULL_RED then
        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
    end

    for i = 1, #blessings do
        if not getPlayerBlessing(cid, blessings[i]) then
            doPlayerAddBlessing(cid, blessings[i])
        end
    end

    doTransformItem(amuletSlot.uid, transformId)
    return true
end
 
Lua:
local blessings = {1, 2, 3, 4, 5}
local amuletId = 2196
local transformId = ITEM_ID

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    local amuletSlot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
    if amuletSlot.itemid ~= amuletId then
        return true
    end

    if getCreatureSkullType(cid) >= SKULL_RED then
        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
    end

    for i = 1, #blessings do
        if not getPlayerBlessing(cid, blessings[i]) then
            doPlayerAddBlessing(cid, blessings[i])
        end
    end

    doTransformItem(amuletSlot.uid, transformId)
    return true
end
[Warning - Event::checkScript] Event onDeath not found. scripts/droploot.lua
 
Back
Top