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

[help] Forever amulet - Skull, Red Skull, Black Skull

gianflogao

Member
Joined
Jun 6, 2014
Messages
134
Solutions
2
Reaction score
13
I need an amulet forever, as the title, skull, red skull, black skull and receives "bless" when use.
 
tfs 0.4 8.6

i using script above;
Code:
function onEquip(cid, item, slot)
    if not getPlayerBlessing(cid,5) then
        for i = 1,5 do
            doPlayerAddBlessing(cid,i)
        end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The amulet has shielded you with the 5 blessings!")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
    end
return true
end

I wanted to add more skull, skull and red and black skull to not miss anything when you die!

@magista
 
Last edited by a moderator:
well,, the Script i will write now is not mine it based on @JDB script
at first
in creaturescripts/creaturescripts.xml add this
Code:
<event type="preparedeath" name="SkullAmulet" event="script" value="script.lua"/>
then
in creaturescripts/scripts/login.lua add this
Code:
registerCreatureEvent(cid, "SkullAmulet")
then
create file and name it script.lua in creaturescripts/scripts
paste this in it
Code:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}


function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected.")

        end
    end
    return true
    end
 
Last edited:
well,, the Script i will write now is not mine it based on @JDB script
at first
in creaturescripts/creaturescripts.xml add this
Code:
<event type="preparedeath" name="SkullAmulet" event="script" value="script.lua"/>
then
in creaturescripts/scripts/login.lua add this
Code:
registerCreatureEvent(cid, "SkullAmulet")
then
create file and name it script.lua in creaturescripts/scripts
paste this in it
Code:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}


function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected.")

        end
    end
    return true
    end

How to associate automatic bless together?
 
@FearWar
I'm sorry for late answering.
Could u explain what do you mean ?

Together in this script:

Code:
local corpse_ids = {
    [0] = 3065,
    [1] = 3058
}


function onPrepareDeath(cid, deathList)
    if getCreatureSkullType(cid) < 6 then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
        doCreatureSetDropLoot(cid, false)
        doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected.")

        end
    end
    return true
    end

Wanted to add 5 blessings when equipped.
 
@FearWar
This will be in creaturescripts
make a new file name it necklacebless.lua
Code:
function onLogin(cid)
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 AND getPlayerBlessing(cid,1)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed by Forever aol")
else
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings from Forever aol!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
end
return true
end

in login.lua
Code:
registerCreatureEvent(cid, "BlessAmulet")

in creaturescripts.xml
Code:
<event type="login" name="BlessAmulet" event="script" value="necklacebless.lua"/>

now movements
you will create new file name it necklacebless.lua
Code:
function onEquip(cid, item, slot)
if getPlayerBlessing(cid,1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed by Forever aol")
else
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings from Forever aol!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
end
return true
end

now movements.xml
Code:
<movevent event="Equip" itemid="2196" function="onEquipItem" slot="necklace" script="necklacebless.lua"/>

remember i just wrote those scripts now and not tested
have fun
 
Back
Top