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

Problem Loot (Bag) in TFS 1.3

Fabi Marzan

Well-Known Member
Joined
Aug 31, 2020
Messages
135
Solutions
6
Reaction score
67
Hello I have a problem with the loot that when I kill the monster that contains a bag it does not tell me what is inside the bag.

Some more explanatory images:

The monster has a bag inside..
bag.png
When I kill the monster, it doesn't tell me what's inside the bag..
Screenshot_99.png
As you saw, it does not tell me if I release royal helmet or not.
Screenshot_100.png

I do not know why, but with this error I cannot use the autoloot correctly since it does not collect the items in bags. Neither does the Loot channel that does not get all the items that the monster dropped.

If you could help me, I would really appreciate it.
 
I also had this problem on my server. The easiest way to solve it is to remove the bag loot from all monsters and increase the capacity of the corpses in items.xml The loot will be all inside the creature and you won't have problems with the autoloot.
Post automatically merged:

Use some mass editing program like notepad and it will be easy.
 
I also had this problem on my server. The easiest way to solve it is to remove the bag loot from all monsters and increase the capacity of the corpses in items.xml The loot will be all inside the creature and you won't have problems with the autoloot.
Post automatically merged:

Use some mass editing program like notepad and it will be easy.
If I was also thinking about that and I will have to, thank you for answering.
 
If you don't want to go thru all these xml files, you can add check in monster loot to ignore bags or any specific item id to avoid dropping them into corpse.
Another fix would be to make the code stop adding rest of the loot to the slot with bag. I don't recall tfs ever doing that, so it might be custom code that acts like this?
 
Si no desea revisar todos estos archivos xml, puede agregar el botín de registro de monstruos para ignorar las bolsas o cualquier identificación de artículo específico para evitar dejarlos caer en el cadáver.
Otra solución sería hacer que el código deje de agregar el resto del botín a la ranura con la bolsa. No recuerdo que tfs haya hecho eso alguna vez, por lo que podría ser un código personalizado que actúe así.
@Nekiro
If the tfs I have is customized by a server called "Baiak Thunder" that the console brought me and I used it for my project since it contained already implemented systems. And maybe that's why I have that problem with the bag.

I already made that solution of removing monster bags, since it is not that my server has a lot of monsters either. And it didn't take me that much work to go from xml to xml to remove it.

But it would still be nice if there was a cleaner solution to do this without eliminating bags.
 
the only reason why monsters still have bag in 8.6 datapacks is because people were too lazy to remove them, cipsoft removed them at 8.54 update and made monster corpses with more slots...
 
Hello im using nekiro 772 server with converted cipsoft mon files to revscripts, the scripts and loading monsters are working good.
I want certain items to be dropped inside backpack, the problem is that in cipsoft files it does not display which lots are going to being dropped inside a bag
Lua:
# Tibia - graphical Multi-User-Dungeon
# MonsterRace File
# 2005/10/12 - 16:37:51

RaceNumber    = 35
Name          = "demon"
Article       = "a"
Outfit        = (35, 0-0-0-0)
Corpse        = 4097
Blood         = Fire
Experience    = 6000
SummonCost    = 0
FleeThreshold = 0
Attack        = 80
Defend        = 65
Armor         = 40
Poison        = 0
LoseTarget    = 10
Strategy      = (70, 10, 10, 10)

Flags         = {KickBoxes,
                 KickCreatures,
                 SeeInvisible,
                 Unpushable,
                 NoSummon,
                 NoIllusion,
                 NoConvince,
                 NoBurning,
                 NoPoison,
                 NoEnergy,
                 NoLifeDrain,
                 NoParalyze}

Skills        = {(HitPoints, 8200, 0, 8200, 0, 0, 0),
                 (GoStrength, 80, 0, 80, 0, 0, 0),
                 (CarryStrength, 800, 0, 800, 0, 0, 0),
                 (FistFighting, 120, 120, 120, 50, 1000, 5)}

Spells        = {Actor (13) -> Healing (120, 30) : 7,
                 Victim (7, 0, 0) -> Damage (512, 70, 30) : 8,
                 Origin (0, 13) -> Summon (49, 1) : 12,
                 Destination (7, 4, 6, 7) -> Damage (4, 155, 45) : 3,
                 Destination (7, 4, 0, 0) -> Field (1) : 7,
                 Angle (0, 8, 12) -> Damage (8, 360, 60) : 10}

Inventory     = {(3420, 1, 7),
                 (3356, 1, 12),
                 (3275, 1, 200),
                 (3320, 1, 40),
                 (3731, 6, 200),
                 (3281, 1, 20),
                 (3031, 100, 700),
                 (3031, 100, 600),
                 (3031, 100, 500),
                 (3031, 100, 400),
                 (3063, 1, 11),
                 (3364, 1, 4),
                 (3306, 1, 15),
                 (3284, 1, 6),
                 (3366, 1, 1),
                 (3414, 1, 5),
                 (3048, 1, 2),
                 (3060, 1, 30),
                 (3055, 1, 7),
                 (2848, 1, 13),
                 (3098, 1, 5),
                 (3032, 1, 110),
                 (3049, 1, 14),
                 (3034, 1, 35)}

Talk          = {"#Y MUHAHAHAHA!",
                 "#Y I SMELL FEEEEEAAAR!",
                 "#Y CHAMEK ATH UTHUL ARAK!",
                 "Your resistance is futile!",
                 "#y Your soul will be mine!"}
revscript
Code:
local mType = Game.createMonsterType("demon")
local monster = {}

monster.name = "demon"
monster.description = "a demon"
monster.experience = 6000
monster.outfit = {
    lookType = 35,
    lookHead = 0,
    lookBody = 0,
    lookLegs = 0,
    lookFeet = 0,
    lookAddons = 0,
    lookMount = 0
}

monster.health = 8200
monster.maxHealth = 8200
monster.runHealth = 0
monster.race = "fire"
monster.corpse = 2916
monster.speed = 200
monster.summonCost = 0

monster.changeTarget = {
    interval = 2000,
    chance = 10
}

monster.targetstrategy = {
    nearest = 70,
    weakest = 10,
    mostdamage = 10,
    random = 10,
}

monster.flags = {
    attackable = true,
    hostile = true,
    summonable = false,
    convinceable = false,
    illusionable = false,
    boss = false,
    ignoreSpawnBlock = false,
    pushable = false,
    canPushItems = true,
    canPushCreatures = true,
    staticAttackChance = 90,
    targetDistance = 1,
    healthHidden = false,
    canWalkOnEnergy = false,
    canWalkOnFire = false,
    canWalkOnPoison = false
}

monster.light = {
    level = 0,
    color = 0
}

monster.voices = {
    interval = 5000,
    chance = 10,
    {text = "MUHAHAHAHA!", yell = true},
    {text = "I SMELL FEEEEEAAAR!", yell = true},
    {text = "CHAMEK ATH UTHUL ARAK!", yell = true},
    {text = "Your resistance is futile!", yell = false},
    {text = "Your soul will be mine!", yell = true}
}

monster.immunities = {
    {type = "paralyze", condition = true},
    {type = "outfit", condition = false},
    {type = "invisible", condition = true},
    {type = "drunk", condition = true},
    {type = "bleed", condition = false}
}

monster.elements = {
    {type = COMBAT_PHYSICALDAMAGE, percent = 0},
    {type = COMBAT_ENERGYDAMAGE, percent = 100},
    {type = COMBAT_EARTHDAMAGE, percent = 100},
    {type = COMBAT_FIREDAMAGE, percent = 100},
    {type = COMBAT_LIFEDRAIN, percent = 100},
    {type = COMBAT_MANADRAIN, percent = 0},
    {type = COMBAT_DROWNDAMAGE, percent = 0},
    {type = COMBAT_ICEDAMAGE, percent = 0},
    {type = COMBAT_HOLYDAMAGE , percent = 0},
    {type = COMBAT_DEATHDAMAGE , percent = 0}
}

monster.attacks = {
    {name ="melee", interval = 2000, chance = 100, skill = 120, attack = 80},
    {name ="combat", interval = 2000, chance = 13, type = COMBAT_MANADRAIN, minDamage = -40, maxDamage = -100, range = 7},
    {name ="combat", interval = 2000, chance = 33, type = COMBAT_FIREDAMAGE, minDamage = -110, maxDamage = -200, range = 7, radius = 7, target = true, shootEffect = CONST_ANI_FIRE, effect = CONST_ME_FIREAREA},
    {name ="firefield", interval = 2000, chance = 14, range = 7, radius = 1, target = true, shootEffect = CONST_ANI_FIRE},
    {name ="combat", interval = 2000, chance = 10, type = COMBAT_ENERGYDAMAGE, minDamage = -300, maxDamage = -420, length = 8, spread = 0, effect = CONST_ME_ENERGYHIT}
}

monster.defenses = {
    defense = 65,
    armor = 40,
    {name ="combat", interval = 2000, chance = 14, type = COMBAT_HEALING, minDamage = 90, maxDamage = 150, effect = CONST_ME_MAGIC_BLUE}
}

monster.maxSummons = 1
monster.summons = {
    {name = "fireelemental", chance = 8, interval = 2000, max = 1}
}

monster.loot = {
    {id = 2520, chance = 700},
    {id = 2462, chance = 1200},
    {id = 2387, chance = 20000},
    {id = 2432, chance = 4000},
    {id = 2795, chance = 20000, maxCount = 6},
    {id = 2393, chance = 2000},
    {id = 2148, chance = 70000, maxCount = 100},
    {id = 2148, chance = 60000, maxCount = 100},
    {id = 2148, chance = 50000, maxCount = 100},
    {id = 2148, chance = 40000, maxCount = 100},
    {id = 2179, chance = 1100},
    {id = 2470, chance = 400},
    {id = 2418, chance = 1500},
    {id = 2396, chance = 600},
    {id = 2472, chance = 100},
    {id = 2514, chance = 500},
    {id = 2164, chance = 200},
    {id = 2176, chance = 3000},
    {id = 2171, chance = 700},
    {id = 1982, chance = 1300},
    {id = 2214, chance = 500},
    {id = 2149, chance = 11000},
    {id = 2165, chance = 1400},
    {id = 2151, chance = 3500}
}

mType:register(monster)
is there an easy manner of do this inside monsters eventcallback?
Code:
local ec = EventCallback

ec.onDropLoot = function(self, corpse)
    if configManager.getNumber(configKeys.RATE_LOOT) == 0 then
        return
    end

    local player = Player(corpse:getCorpseOwner())
    local mType = self:getType()
    if not player or player:getStamina() > 840 then
        local monsterLoot = mType:getLoot()
        for i = 1, #monsterLoot do
            local item = corpse:createLootItem(monsterLoot[i])
            if not item then
                print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
            end
        end

        if player then
            local text = ("Loot of %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
            local party = player:getParty()
            if party then
                party:broadcastPartyLoot(text)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, text)
            end
        end
    else
        local text = ("Loot of %s: nothing (due to low stamina)"):format(mType:getNameDescription())
        local party = player:getParty()
        if party then
            party:broadcastPartyLoot(text)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, text)
        end
    end
end

ec:register()
 
Back
Top