• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved [TFS 1.0] Ring Charges

imkingran

Learning everyday.
Premium User
Joined
Jan 15, 2014
Messages
1,317
Solutions
35
Reaction score
435
Hello friends,

My rings that have charges are only lasting for 1 charge. It seems are though the attribute key charges is not actually working. Is there another attribute key that i could use? or is there a different solution to the problem?

If I add it to the loot of a monster with subtype="20" then it will loot a ring with 20 charges but I can't sell it from my NPC with 20 charges.

Code:
    <item id="2164" article="a" name="might ring">
        <attribute key="weight" value="100" />
        <attribute key="slotType" value="ring" />
        <attribute key="charges" value="20" />
        <attribute key="showcharges" value="1" />
        <attribute key="absorbPercentPhysical" value="20" />
        <attribute key="absorbPercentFire" value="20" />
        <attribute key="absorbPercentDeath" value="20" />
        <attribute key="absorbPercentIce" value="20" />
        <attribute key="absorbPercentEnergy" value="20" />
        <attribute key="absorbPercentHoly" value="20" />
        <attribute key="absorbPercentEarth" value="20" />
        <attribute key="showattributes" value="1" />
    </item>
 
<attribute key="charges" value="20" />
<attribute key="showcharges" value="1" />


Hmmm isn't that "showcharges" supposed to be 20 aswell? ^^
I'm no expert, but you should try something with that ;D
 
ha yeah i tried that xD... doesn't work.

I think 1 = true and 0 = false in that case.
 
What is the code of the NPC selling the right?
Or is it a trade system?
Maybe speciffy the charges on the npc itself?

I mean even if you make the ring with /i Might ring it will only have 1 charge. Only way to get one with 20 charges is to loot it from a monsters.

This is the Script for the NPC Yaman:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)
    npcHandler:onCreatureAppear(cid)           
end
function onCreatureDisappear(cid)
    npcHandler:onCreatureDisappear(cid)           
end
function onCreatureSay(cid, type, msg)
    npcHandler:onCreatureSay(cid, type, msg)       
end
function onThink()
    npcHandler:onThink()                   
end

local buyList =
{
    {itemId = 2201, price = 1000}, -- Dragon Necklace
    {itemId = 2215, price = 2000}, -- Dwarven Ring
    {itemId = 2204, price = 2000}, -- Energy Ring
    {itemId = 2205, price = 900}, -- Life Ring
    {itemId = 2164, price = 5000}, -- Might Ring
    {itemId = 2200, price = 700}, -- Protection Amulet
    {itemId = 2216, price = 2000}, -- Ring of Healing
    {itemId = 2170, price = 100}, -- Silver Amulet
    {itemId = 2161, price = 100}, -- Strange Talisman
    {itemId = 2206, price = 2000}, -- Time Ring
}
local sellList =
{
    {itemId = 2327, price = 100}, -- Ankh
    {itemId = 2201, price = 100}, -- Dragon Necklace
    {itemId = 2215, price = 100}, -- Dwarven Ring
    {itemId = 2204, price = 100}, -- Energy Ring
    {itemId = 18412, price = 6500}, -- Glacial Rod
    {itemId = 2183, price = 3000}, -- Hailstorm Rod
    {itemId = 2205, price = 50}, -- Life Ring
    {itemId = 2164, price = 250}, -- Might Ring
    {itemId = 2186, price = 200}, -- Moonlight Rod
    {itemId = 18411, price = 6000}, -- Muck Rod
    {itemId = 2194, price = 50}, -- Mysterious Fetish
    {itemId = 2185, price = 1000}, -- Necrotic Rod
    {itemId = 8911, price = 1500}, -- Northwind Rod
    {itemId = 2200, price = 100}, -- Protection Amulet
    {itemId = 2216, price = 100}, -- Ring of Healing
    {itemId = 2170, price = 50}, -- Silver Amulet
    {itemId = 2182, price = 100}, -- Snakebite Rod
    {itemId = 8912, price = 3600}, -- Springsprout Rod
    {itemId = 2161, price = 30}, -- Strange Talisman
    {itemId = 2181, price = 2000}, -- Terra Rod
    {itemId = 2206, price = 100}, -- Time Ring
    {itemId = 8910, price = 4400}, -- Underworld Rod
}

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
   
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Are all the rings doing that or just that one?
Is the problem in a custom ring or rings that come pre-defined in TFS data pack?
 
Is because your script is not defining charges, same with the /i command.

/i might ring, 20

PD: I don't know if is a bug, but 1.0 works in that way... even with rune charges.
 
Try this function:
Code:
<parameter key="shop_sellable" value="Dwarven ring,2213,100;Energy ring,2167,100;Life ring,2168,50;Might ring,2164,250;Ring of healing,2214,100;Time ring,2169,100;Dragon necklace,2201,100;Protection amulet,2200,100;Strange talisman,2161,30;Silver amulet,2170,50;Hailstorm rod,2183,3000;Moonlight rod,2186,200;Necrotic rod,2185,1000;Snakebite rod,2182,100;Terra rod,2181,2000;Springsprout Rod,8912,3600;Northwind Rod,8911,1500;Underworld Rod,8910,4400;Ankh,2327,100;Mysterious Fetish,2194,50"/>

but in this case:

Might Ring,id,price,charges
 
Last edited by a moderator:
Back
Top