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

Amulets problems

Na Amigo

The crazy girl
Joined
Jun 5, 2017
Messages
254
Solutions
3
Reaction score
18
Location
Egypt
hello i want make those amulets 2198,7890,7888,7887,7889,2197,2131,2130,2201
if you died it remove and protect and prevent this voc "25" for no loss items i've changed the deathlosspercent at my confing to 0 i want another way
i've test with movement
Code:
Equip and DeEquip with slot  necklace
but it dosent work i want another method creaturescript or something like that to solve this
 
Won't work for red/black skull.

use this creaturescript type
Code:
preparedeath
use these in the .lua script
Lua:
getPlayerVocation(cid) == 25
getPlayerSlotItem(cid, slot_item_is_in)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doRemoveItem(item.uid)
 
Won't work for red/black skull.

use this creaturescript type
Code:
preparedeath
use these in the .lua script
Lua:
getPlayerVocation(cid) == 25
getPlayerSlotItem(cid, slot_item_is_in)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doRemoveItem(item.uid)
i don't understand sorry could you give me the full script caus i got this error
Code:
Loading creaturescripts... [Error - LuaInterface::loadFile] data/creaturescripts/scripts/preparedeath.lua:1: unexpected symbol near '=='
[11:56:59.682] [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/preparedeath.lua)
[11:56:59.682] data/creaturescripts/scripts/preparedeath.lua:1: unexpected symbol near '=='
and i want make the aols working for all vocation and the unique too
 
Look around this website for some scripting tutorials. Also there are a bunch of codes that you can look through to figure this kind of thing out.
 
try this I guess
Lua:
local amulets = {2198,7890,7888,7887,7889,2197,2131,2130,2201}

function onPrepareDeath(cid, deathList)
    if isInArray(amulets, getPlayerSlotItem(cid, CONST_SLOT_AMULET).itemid) then
        doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_AMULET).uid, 1)
        if getPlayerVocation(cid) == 25 then
            doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        end
    end
    return true
end
 
try this I guess
Lua:
local amulets = {2198,7890,7888,7887,7889,2197,2131,2130,2201}

function onPrepareDeath(cid, deathList)
    if isInArray(amulets, getPlayerSlotItem(cid, CONST_SLOT_AMULET).itemid) then
        doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_AMULET).uid, 1)
        if getPlayerVocation(cid) == 25 then
            doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        end
    end
    return true
end
this worked only for voc 25 but while die the amulet didn't down i want make it down for all vocations
 
Can I get that in proper english?
I don't understand the request.
my vocation 25 when die the -->> "amulet"does not fall and the other vocation does not fall too i want it fall ok?

Can I get that in proper english?
I don't understand the request.
You succeeded in making the amulet no down items at voc 25

i want the amulets down for all vocation and pervent voc 25 for lossing the other items like helmet and armor and bag and legs and boots and wand and ring
 
Last edited by a moderator:
Lua:
local amulets = {2198,7890,7888,7887,7889,2197,2131,2130,2201}

function onPrepareDeath(cid, deathList)
    local amulet = getPlayerSlotItem(cid, CONST_SLOT_AMULET)
    if not amulet then
        return true
    end
    if isInArray(amulets, amulet.itemid) then
        if getPlayerVocation(cid) == 25 then
            doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        else
            doRemoveItem(amulet.uid, 1)
        end
    end
    return true
end
 
Lua:
local amulets = {2198,7890,7888,7887,7889,2197,2131,2130,2201}

function onPrepareDeath(cid, deathList)
    local amulet = getPlayerSlotItem(cid, CONST_SLOT_AMULET)
    if not amulet then
        return true
    end
    if isInArray(amulets, amulet.itemid) then
        if getPlayerVocation(cid) == 25 then
            doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        else
            doRemoveItem(amulet.uid, 1)
        end
    end
    return true
end
Lua:
local amulets = {2198,7890,7888,7887,7889,2197,2131,2130,2201}

function onPrepareDeath(cid, deathList)
    local amulet = getPlayerSlotItem(cid, CONST_SLOT_AMULET)
    if not amulet then
        return true
    end
    if isInArray(amulets, amulet.itemid) then
        if getPlayerVocation(cid) == 25 then
            doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        else
            doRemoveItem(amulet.uid, 1)
        end
    end
    return true
end
this not working too static
here is some explain vedio
 
Show us how you created that amulet in items.xml
Code:
<item id="7888" article="an" name="Ice King Amulet" plural="">
    <attribute key="weight" value="10" />
    <attribute key="description" value="protection all +30%" />
    <attribute key="armor" value="45" />
    <attribute key="slotType" value="necklace" />
    <attribute key="manaGain" value="25000" />
    <attribute key="healthGain" value="25000" />
    <attribute key="manaTicks" value="1900" />
    <attribute key="HealthTicks" value="1900" />
   
  </item>
 
Back
Top