• 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] Aol System

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
870
Solutions
2
Reaction score
49
Using Tfs 1.2
Requirement:
1. If you are not wearing aol it should be item id:6300 if you wear aol it should change to id:6301
(I dont have function transformEquipTo and transformDeEquipTo so i cant do it by myself )
2. Slot
Untitled.png

3. If you die you lose aol but all items stays in bag and slot, so basically you dont lose anything just aol
 
Using Tfs 1.2
Requirement:
1. If you are not wearing aol it should be item id:6300 if you wear aol it should change to id:6301
(I dont have function transformEquipTo and transformDeEquipTo so i cant do it by myself )
2. Slot
Untitled.png

3. If you die you lose aol but all items stays in bag and slot, so basically you dont lose anything just aol
How can you not have those functions?
It's part of items.xml and is used in literally hundreds of items.

and amulet of loss is already built into items.xml as well.
XML:
<attribute key="preventDrop" value="1"/>
 
How can you not have those functions?
It's part of items.xml and is used in literally hundreds of items.

and amulet of loss is already built into items.xml as well.
XML:
<attribute key="preventDrop" value="1"/>
I think i had error i'm not sure, but i'll try it out again then. <attribute key="preventDrop" value="1"/> then aol will never disappear when you die, or i'm mistaking something?
 
If you have a standard distribution, it should already be setup and ready to go.
Just go in-game and test.
 
don't you have otland/forgottenserver ?
If you want your aol to have an id other than the standard just change ITEM_AMULETOFLOSS to that id
Change id? But there is no id's in this script
Lua:
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 hasSkull = isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull())
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not hasSkull 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
        local lossPercent = player:getLossPercent()
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if hasSkull or math.random(item:isContainer() and 100 or 1000) <= lossPercent 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
so i dont know what you mean by change id.
 
I think you need to re download tfs 1.2 and re-add ur c++ scripts again and you will have the normal functions that we have + you doesn’t have item ids in ur playerdeath script because you can add item ids in const.h

Check this link : otland/forgottenserver and you should have attribute prevent loss anyway
 
Last edited by a moderator:
I think you need to re download tfs 1.2 and re-add ur c++ scripts again and you will have the normal functions that we have + you doesn’t have item ids in ur playerdeath script because you can add item ids in const.h

Check this link : otland/forgottenserver and you should have attribute prevent loss anyway
Why should i download new source its like saying drop all your work just because you dont have preventdrop function while you could just insert into your server.
ITEM_AMULETOFLOSS is 2173 (standard aol id) so if you have another item as aol change ITEM_AMULETOFLOSS to that item.id, in this case 6301
Yea i know what you mean now. So how to make if item is deEquiped it changes to id 6300, if you Equiped that item goes to 6301?
 
don't you have rings that transform such as energy ring, stealth ring, etc? are they not working?
 
don't you have rings that transform such as energy ring, stealth ring, etc? are they not working?
Yea i do have but its not changing it always stays in the same id but in description it says changing to id blabla something like this, so i dont know why its not working i replicated just like energy ring
XML:
    <item id="12757" article="a" name="AOL"> //OFF
        <attribute key="weight" value="500" />
        <attribute key="slotType" value="necklace" />
        <attribute key="transformEquipTo" value="12758" />
    </item>
    <item id="12758" article="a" name="AOL"> //ON
        <attribute key="weight" value="500" />
        <attribute key="slotType" value="necklace" />
        <attribute key="transformDeEquipTo" value="12757" />
    </item>
 
I'd recommend to get the latest 1.3 sources. Afaik there's no good way to do what you want without source edits anyways
 
I'd recommend to get the latest 1.3 sources. Afaik there's no good way to do what you want without source edits anyways
Nah dude this not a solution. I paid money for some changes in my source so why should i drop everything out? So its better to wait till someone with high level of c++, lua, etc skills will show me correct wait to achieve what i need.
 
Yea i do have but its not changing it always stays in the same id but in description it says changing to id blabla something like this, so i dont know why its not working i replicated just like energy ring
XML:
    <item id="12757" article="a" name="AOL"> //OFF
        <attribute key="weight" value="500" />
        <attribute key="slotType" value="necklace" />
        <attribute key="transformEquipTo" value="12758" />
    </item>
    <item id="12758" article="a" name="AOL"> //ON
        <attribute key="weight" value="500" />
        <attribute key="slotType" value="necklace" />
        <attribute key="transformDeEquipTo" value="12757" />
    </item>
movement.xml
Check how any ring or armor is placed in there.
You need items.xml + movements.xml to work in tandem.
 
Back
Top