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

Lua [TFS 1.2] Forever And Skull Amulet

S

Shadow_

Guest
Hello All,
i was trying to add skull amulet and forever amulet to my ot and when i serached i found this one for 0.4 tfs but i'am using 1.2
CreatureEvent - Forever-Skull amulet <count Frags>
i tried to use it saying it may work but it didn't can anybody give me skull amulet script ? or recode this one cause idk where is the problem
Anyway Thanks.
 
Solution
Hello All,
i was trying to add skull amulet and forever amulet to my ot and when i serached i found this one for 0.4 tfs but i'am using 1.2
CreatureEvent - Forever-Skull amulet <count Frags>
i tried to use it saying it may work but it didn't can anybody give me skull amulet script ? or recode this one cause idk where is the problem
Anyway Thanks.
Code:
ITEM_AMULETOFSKULL = 26131
ITEM_AMULETOFFOREVER = 25423

local onDropItems = function(player, corpse, magicEffect)
if not corpse then
return
end
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
if item then
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
if...
could you send your playerdeath.lua from creaturescripts folder?
PlayerDeath.lua
Code:
local deathListEnabled = true
local maxDeathRecords = 5

function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local playerId = player:getId()
    if nextUseStaminaTime[playerId] ~= nil then
        nextUseStaminaTime[playerId] = nil
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
    if not deathListEnabled then
        return
    end

    local byPlayer = 0
    local killerName
    if killer ~= nil then
        if killer:isPlayer() then
            byPlayer = 1
        else
            local master = killer:getMaster()
            if master and master ~= killer and master:isPlayer() then
                killer = master
                byPlayer = 1
            end
        end
        killerName = killer:getName()
    else
        killerName = "field item"
    end

    local byPlayerMostDamage = 0
    local mostDamageKillerName
    if mostDamageKiller ~= nil then
        if mostDamageKiller:isPlayer() then
            byPlayerMostDamage = 1
        else
            local master = mostDamageKiller:getMaster()
            if master and master ~= mostDamageKiller and master:isPlayer() then
                mostDamageKiller = master
                byPlayerMostDamage = 1
            end
        end
        mostDamageName = mostDamageKiller:getName()
    else
        mostDamageName = "field item"
    end

    local playerGuid = player:getGuid()
    db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. byPlayer .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (unjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
    local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)

    local deathRecords = 0
    local tmpResultId = resultId
    while tmpResultId ~= false do
        tmpResultId = result.next(resultId)
        deathRecords = deathRecords + 1
    end

    if resultId ~= false then
        result.free(resultId)
    end

    local limit = deathRecords - maxDeathRecords
    if limit > 0 then
        db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
    end

    if byPlayer == 1 then
        local targetGuild = player:getGuild()
        targetGuild = targetGuild and targetGuild:getId() or 0
        if targetGuild ~= 0 then
            local killerGuild = killer:getGuild()
            killerGuild = killerGuild and killerGuild:getId() or 0
            if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer:getId()) then
                local warId = false
                resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "))")
                if resultId ~= false then
                    warId = result.getDataInt(resultId, "id")
                    result.free(resultId)
                end

                if warId ~= false then
                    db.asyncQuery("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(killerName) .. ", " .. db.escapeString(player:getName()) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ")")
                end
            end
        end
    end
end

Droploot.lua
Code:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end

        if not isPlayer or not player:hasBlessing(6) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    if not item:moveTo(corpse) then
                        item:remove()
                    end
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end
Forever Amulet ID : 25423
Skull Amulet ID : 26131
 
Last edited by a moderator:
PlayerDeath.lua
Code:
local deathListEnabled = true
local maxDeathRecords = 5

function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local playerId = player:getId()
    if nextUseStaminaTime[playerId] ~= nil then
        nextUseStaminaTime[playerId] = nil
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
    if not deathListEnabled then
        return
    end

    local byPlayer = 0
    local killerName
    if killer ~= nil then
        if killer:isPlayer() then
            byPlayer = 1
        else
            local master = killer:getMaster()
            if master and master ~= killer and master:isPlayer() then
                killer = master
                byPlayer = 1
            end
        end
        killerName = killer:getName()
    else
        killerName = "field item"
    end

    local byPlayerMostDamage = 0
    local mostDamageKillerName
    if mostDamageKiller ~= nil then
        if mostDamageKiller:isPlayer() then
            byPlayerMostDamage = 1
        else
            local master = mostDamageKiller:getMaster()
            if master and master ~= mostDamageKiller and master:isPlayer() then
                mostDamageKiller = master
                byPlayerMostDamage = 1
            end
        end
        mostDamageName = mostDamageKiller:getName()
    else
        mostDamageName = "field item"
    end

    local playerGuid = player:getGuid()
    db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. byPlayer .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (unjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
    local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)

    local deathRecords = 0
    local tmpResultId = resultId
    while tmpResultId ~= false do
        tmpResultId = result.next(resultId)
        deathRecords = deathRecords + 1
    end

    if resultId ~= false then
        result.free(resultId)
    end

    local limit = deathRecords - maxDeathRecords
    if limit > 0 then
        db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
    end

    if byPlayer == 1 then
        local targetGuild = player:getGuild()
        targetGuild = targetGuild and targetGuild:getId() or 0
        if targetGuild ~= 0 then
            local killerGuild = killer:getGuild()
            killerGuild = killerGuild and killerGuild:getId() or 0
            if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer:getId()) then
                local warId = false
                resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "))")
                if resultId ~= false then
                    warId = result.getDataInt(resultId, "id")
                    result.free(resultId)
                end

                if warId ~= false then
                    db.asyncQuery("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(killerName) .. ", " .. db.escapeString(player:getName()) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ")")
                end
            end
        end
    end
end

Droploot.lua
Code:
local deathListEnabled = true
local maxDeathRecords = 5

function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local playerId = player:getId()
    if nextUseStaminaTime[playerId] ~= nil then
        nextUseStaminaTime[playerId] = nil
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
    if not deathListEnabled then
        return
    end

    local byPlayer = 0
    local killerName
    if killer ~= nil then
        if killer:isPlayer() then
            byPlayer = 1
        else
            local master = killer:getMaster()
            if master and master ~= killer and master:isPlayer() then
                killer = master
                byPlayer = 1
            end
        end
        killerName = killer:getName()
    else
        killerName = "field item"
    end

    local byPlayerMostDamage = 0
    local mostDamageKillerName
    if mostDamageKiller ~= nil then
        if mostDamageKiller:isPlayer() then
            byPlayerMostDamage = 1
        else
            local master = mostDamageKiller:getMaster()
            if master and master ~= mostDamageKiller and master:isPlayer() then
                mostDamageKiller = master
                byPlayerMostDamage = 1
            end
        end
        mostDamageName = mostDamageKiller:getName()
    else
        mostDamageName = "field item"
    end

    local playerGuid = player:getGuid()
    db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. byPlayer .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (unjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
    local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)

    local deathRecords = 0
    local tmpResultId = resultId
    while tmpResultId ~= false do
        tmpResultId = result.next(resultId)
        deathRecords = deathRecords + 1
    end

    if resultId ~= false then
        result.free(resultId)
    end

    local limit = deathRecords - maxDeathRecords
    if limit > 0 then
        db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
    end

    if byPlayer == 1 then
        local targetGuild = player:getGuild()
        targetGuild = targetGuild and targetGuild:getId() or 0
        if targetGuild ~= 0 then
            local killerGuild = killer:getGuild()
            killerGuild = killerGuild and killerGuild:getId() or 0
            if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer:getId()) then
                local warId = false
                resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "))")
                if resultId ~= false then
                    warId = result.getDataInt(resultId, "id")
                    result.free(resultId)
                end

                if warId ~= false then
                    db.asyncQuery("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(killerName) .. ", " .. db.escapeString(player:getName()) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ")")
                end
            end
        end
    end
end
Forever Amulet ID : 25423
Skull Amulet ID : 26131
you posted the same script for droploot.lua, that's actually the one i need my bad
 
you posted the same script for droploot.lua, that's actually the one i need my bad
Then where is the problem ? o_O
Edit Sry 1 second i will post it idk what happened to be the same
@Static_ Edited sry for that
Forgot to tell you the effect also not working
 
Last edited by a moderator:
Lua:
local forever_amulet = 25423
local skull_amulet = 26131

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    local skulled = isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull())
    if amulet then
        if amulet.itemid == forever_amulet and not skulled then
            return true
        elseif amulet.itemid == skull_amulet and skulled then
            player:removeItem(skull_amulet, 1, -1, false)
        elseif amulet.itemid == ITEM_AMULETOFLOSS and not skulled then
            local isPlayer = false
            if killer then
                if killer:isPlayer() then
                    isPlayer = true
                else
                    local master = killer:getMaster()
                    if master and master:isPlayer() then
                        isPlayer = true
                    end
                end
            end
     
            if not isPlayer or not player:hasBlessing(6) then
                player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
            end
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    if not item:moveTo(corpse) then
                        item:remove()
                    end
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end
try this out
if you're skulled and you wear skull amulet it will take that away instead of your items
if you're not skulled and you have forever amulet it will do nothing and won't take away your amulet
 
i want the amulet to stay its forever skull amulet

and if you can i want to fix the effect it is added in the script but its not working
@Static_
 
Last edited by a moderator:
@Static_ i test your script and tried to fix it but i found that you made amulet of loss ( normal aol ) prevent drop loot when you are red/black skull can you fix it ?
 
I made this last week to learn a bit about lua, it might work for you on the part of being infinite if you want.
Player needs to carry certain item in order to be blessed automatically.
This does not work with skulls since I didn't code it. You can code it youself.
Create you tag in XML and add your register to login.lua.
I dont think the hasAllBlessings is trully necessary as I made it to fit my needs.

deathBless.lua:
Lua:
config = {
    id = 2195, -- id do item
    bless = 6, -- quantidade de blessings do servidor
    remover = true, -- remover item? true/false
    minLvl = 100 -- level minimo
    }
   
-- hasAllBlessings(player) by Luiz Henrique Marsilio.
function hasAllBlessings(player) --Verifica se o player tem todas blessings
    local cont = 0
    for i=1,config.bless do
        if player:hasBlessing(i) then
            cont = cont+1
        end
    end
    if cont >= config.bless then -- se nao tiver alguma bless prossegue com o sitema
        return true
    else
        return false
    end
end

function onPrepareDeath(creature, killer)

    if not creature:isPlayer() then
        return true
    end
    if hasAllBlessings(creature) then -- function by Luiz Henrique Marsilio
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You are already protected by blessings.")
        return true
    end
    if creature:getLevel() >= config.minLvl then
        if creature:getItemCount(config.id) >= 1 then
            for i = 1, config.bless do
                creature:addBlessing(i)
            end
            if config.remover then
                creature:removeItem(config.id, 1)
                creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You were protected by a blessing charm.")
            end
            creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the charm before dying.")
        else
            creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You were not wearing a blessing charm and was not blessed when died.")
        end
    else
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You need level " .. config.minLvl .. " or higher to be automatic blessed.")
    end
    return true
end
 
Hello All,
i was trying to add skull amulet and forever amulet to my ot and when i serached i found this one for 0.4 tfs but i'am using 1.2
CreatureEvent - Forever-Skull amulet <count Frags>
i tried to use it saying it may work but it didn't can anybody give me skull amulet script ? or recode this one cause idk where is the problem
Anyway Thanks.
Code:
ITEM_AMULETOFSKULL = 26131
ITEM_AMULETOFFOREVER = 25423

local onDropItems = function(player, corpse, magicEffect)
if not corpse then
return
end
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
if item then
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
if not item:moveTo(corpse) then
item:remove()
end
end
end
end
end

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
return true
end

local onDropSuccess = true
local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
if amulet then
if amulet.itemid == ITEM_AMULETOFFOREVER and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
player:say('Forever Amulet!', TALKTYPE_MONSTER_SAY)
elseif amulet.itemid == ITEM_AMULETOFSKULL then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
player:say('Skull Amulet!', TALKTYPE_MONSTER_SAY)
elseif amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
local isPlayer = false
if killer then
if killer:isPlayer() then
isPlayer = true
else
local master = killer:getMaster()
if master and master:isPlayer() then
isPlayer = true
end
end
end

if not isPlayer or not player:hasBlessing(6) then
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
end
onDropSuccess = false
end
end

if onDropSuccess then
onDropItems(player, corpse)
end

if not player:getSlotItem(CONST_SLOT_BACKPACK) then
player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
end
return true
end
;)
 
Last edited:
Solution
Code:
ITEM_AMULETOFSKULL = 26131
ITEM_AMULETOFFOREVER = 25423

local onDropItems = function(player, corpse)
if not corpse then
return
end
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
if item then
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
if not item:moveTo(corpse) then
item:remove()
end
end
end
end
end

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
return true
end

local onDropSuccess = true
local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
if amulet then
if amulet.itemid == ITEM_AMULETOFFOREVER and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
elseif amulet.itemid == ITEM_AMULETOFSKULL then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
end

if amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
local isPlayer = false
if killer then
if killer:isPlayer() then
isPlayer = true
else
local master = killer:getMaster()
if master and master:isPlayer() then
isPlayer = true
end
end
end

if not isPlayer or not player:hasBlessing(6) then
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
end
onDropSuccess = false
end
end

if onDropSuccess then
onDropItems(player, corpse)
end

if not player:getSlotItem(CONST_SLOT_BACKPACK) then
player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
end
return true
end
;)
you have never gave me not working sript !! thank you bro :D
 
Code:
ITEM_AMULETOFSKULL = 26131
ITEM_AMULETOFFOREVER = 25423

local onDropItems = function(player, corpse, magicEffect)
if not corpse then
return
end
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
if item then
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
if not item:moveTo(corpse) then
item:remove()
end
end
end
end
end

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
return true
end

local onDropSuccess = true
local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
if amulet then
if amulet.itemid == ITEM_AMULETOFFOREVER and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
player:say('Forever Amulet!', TALKTYPE_MONSTER_SAY)
elseif amulet.itemid == ITEM_AMULETOFSKULL then
onDropSuccess = false
player:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
player:say('Skull Amulet!', TALKTYPE_MONSTER_SAY)
elseif amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
local isPlayer = false
if killer then
if killer:isPlayer() then
isPlayer = true
else
local master = killer:getMaster()
if master and master:isPlayer() then
isPlayer = true
end
end
end

if not isPlayer or not player:hasBlessing(6) then
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
end
onDropSuccess = false
end
end

if onDropSuccess then
onDropItems(player, corpse)
end

if not player:getSlotItem(CONST_SLOT_BACKPACK) then
player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
end
return true
end
;)
where to put this file?
 
Back
Top