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

tfs 1.5 8.6 pool of blood in venom race monsters

Jeyci

Banned User
Joined
May 6, 2023
Messages
289
Solutions
3
Reaction score
36
as title says. when i kill a monster the splash is not slime instead it's blood. how to solve this?
items.xml
Lua:
    <item id="1" name="water" />
    <item id="10" name="lifefluid" />
    <item id="3" name="beer" />
    <item id="4" name="slime" />
    <item id="5" name="lemonade" />
    <item id="6" name="milk" />
    <item id="7" name="manafluid" />
    <item id="2" name="blood" />
    <item id="11" name="oil" />
    <item id="13" name="urine" />
    <item id="14" name="coconut milk" />
    <item id="15" name="wine" />
    <item id="19" name="mud" />
    <item id="21" name="fruit juice" />
    <item id="26" name="lava" />
    <item id="27" name="rum" />
    <item id="28" name="swamp" />
    <item id="35" name="tea" />
    <item id="43" name="mead" />
bug.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Bug" namedescription="a bug" race="venom" experience="18" speed="160" manacost="250">
    <health now="29" max="29" />
    <look type="45" corpse="5990" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="1" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag illusionable="1" />
        <flag convinceable="1" />
        <flag pushable="1" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="90" />
        <flag runonhealth="0" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-23" />
    </attacks>
    <defenses armor="2" defense="2" />
    <elements>
        <element firePercent="-10" />
    </elements>
    <loot>
        <item name="gold coin" countmax="6" chance="50000" />
        <item id="2679" countmax="3" chance="3000" /><!-- cherry -->
    </loot>
</monster>

Lua:
<item id="2902" article="a" name="dead bug">
        <attribute key="weight" value="10000" />
        <attribute key="containerSize" value="10" />
        <attribute key="decayTo" value="2903" />
        <attribute key="duration" value="900" />
        <attribute key="corpseType" value="venom" />
    </item>
    <item id="2903" article="a" name="dead bug">
        <attribute key="weight" value="10000" />
        <attribute key="decayTo" value="2904" />
        <attribute key="duration" value="600" />
        <attribute key="corpseType" value="venom" />
    </item>
    <item id="2904" article="a" name="dead bug">
        <attribute key="weight" value="10000" />
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="600" />
        <attribute key="corpseType" value="venom" />
    </item>
Code:
 
Last edited:
Solution
Add this for items.xml ;)
Lua:
</item>
    <item id="2016" article="a" name="pool">
        <attribute key="decayTo" value="2017" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2017" article="a" name="pool">
        <attribute key="decayTo" value="2018" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2018" article="a" name="pool">
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="600" />
    </item>
    <item id="2019" article="a" name="pool">
        <attribute key="decayTo" value="2020" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2020" article="a" name="pool">
        <attribute key="decayTo" value="2021" />...
as title says. when i kill a monster the splash is not slime instead it's blood. how to solve this?
items.xml
Lua:
    <item id="1" name="water" />
    <item id="10" name="lifefluid" />
    <item id="3" name="beer" />
    <item id="4" name="slime" />
    <item id="5" name="lemonade" />
    <item id="6" name="milk" />
    <item id="7" name="manafluid" />
    <item id="2" name="blood" />
    <item id="11" name="oil" />
    <item id="13" name="urine" />
    <item id="14" name="coconut milk" />
    <item id="15" name="wine" />
    <item id="19" name="mud" />
    <item id="21" name="fruit juice" />
    <item id="26" name="lava" />
    <item id="27" name="rum" />
    <item id="28" name="swamp" />
    <item id="35" name="tea" />
    <item id="43" name="mead" />
bug.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Bug" namedescription="a bug" race="venom" experience="18" speed="160" manacost="250">
    <health now="29" max="29" />
    <look type="45" corpse="5990" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="1" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag illusionable="1" />
        <flag convinceable="1" />
        <flag pushable="1" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="90" />
        <flag runonhealth="0" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-23" />
    </attacks>
    <defenses armor="2" defense="2" />
    <elements>
        <element firePercent="-10" />
    </elements>
    <loot>
        <item name="gold coin" countmax="6" chance="50000" />
        <item id="2679" countmax="3" chance="3000" /><!-- cherry -->
    </loot>
</monster>

Updated: Nevermind, I don't think the fluidSource and corpseType are related to it, if you have it as venom it should be working fine.
 
Last edited:
Updated: Nevermind, I don't think the fluidSource and corpseType are related to it, if you have it as venom it should be working fine.
Lua:
    </item>
    <item id="2902" article="a" name="dead bug">
        <attribute key="weight" value="10000" />
        <attribute key="containerSize" value="10" />
        <attribute key="decayTo" value="2903" />
        <attribute key="duration" value="900" />
        <attribute key="corpseType" value="venom" />
    </item>


must add that in order to display "pool of blood" when monsters dies, instead of pool of life fluid had to change
Lua:
<item id="10" name="lifefluid" />
it was 2
Code:
<item id="2" name="blood" />
it was 10

up!
 
Last edited:
up!
Post automatically merged:

Lua:
void Game::combatGetTypeInfo(CombatType_t combatType, Creature* target, TextColor_t& color, uint8_t& effect)
{
    switch (combatType) {
    case COMBAT_PHYSICALDAMAGE: {
        Item* splash = nullptr;
        switch (target->getRace()) {
        case RACE_VENOM:
            color = TEXTCOLOR_LIGHTGREEN;
            effect = CONST_ME_HITBYPOISON;
            splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_SLIME);
            break;
        case RACE_BLOOD:
            color = TEXTCOLOR_RED;
            effect = CONST_ME_DRAWBLOOD;
            if (const Tile* tile = target->getTile()) {
                if (!tile->hasFlag(TILESTATE_PROTECTIONZONE)) {
                    splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD);
                }
            }

Seems to be that only the second value is taken i replaced fluid_blood by slime and it changed but can't use both. any ideas?
 
Last edited:
But do you get the pool of blood only when hitting or also when it dies? because you would also need to check this one:
Item* Creature::dropCorpse()
In both situations. About the other code, it looks good.
Untitled.png
Lua:
bool Creature::dropCorpse(Creature* lastHitCreature, Creature* mostDamageCreature, bool lastHitUnjustified, bool mostDamageUnjustified)
{
    if (!lootDrop && getMonster()) {
        if (master) {
            //scripting event - onDeath
            const CreatureEventList& deathEvents = getCreatureEvents(CREATURE_EVENT_DEATH);
            for (CreatureEvent* deathEvent : deathEvents) {
                deathEvent->executeOnDeath(this, nullptr, lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
            }
        }

        g_game.addMagicEffect(getPosition(), CONST_ME_POFF);
    }
    else {
        Item* splash;
        switch (getRace()) {
        case RACE_VENOM:
            splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_SLIME);
            break;

        case RACE_BLOOD:
            splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_BLOOD);
            break;

        default:
            splash = nullptr;
            break;
        }

        Tile* tile = getTile();

        if (splash) {
            g_game.internalAddItem(tile, splash, INDEX_WHEREEVER, FLAG_NOLIMIT);
            g_game.startDecay(splash);
        }

        Item* corpse = getCorpse(lastHitCreature, mostDamageCreature);
        if (corpse) {
            g_game.internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
            g_game.startDecay(corpse);
        }

        //scripting event - onDeath
        for (CreatureEvent* deathEvent : getCreatureEvents(CREATURE_EVENT_DEATH)) {
            deathEvent->executeOnDeath(this, corpse, lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
        }

        if (corpse) {
            dropLoot(corpse->getContainer(), lastHitCreature);
        }
    }

    return true;
}
 

Attachments

Last edited:
Add this for items.xml ;)
Lua:
</item>
    <item id="2016" article="a" name="pool">
        <attribute key="decayTo" value="2017" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2017" article="a" name="pool">
        <attribute key="decayTo" value="2018" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2018" article="a" name="pool">
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="600" />
    </item>
    <item id="2019" article="a" name="pool">
        <attribute key="decayTo" value="2020" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2020" article="a" name="pool">
        <attribute key="decayTo" value="2021" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2021" article="a" name="pool">
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="60" />
    </item>
 
Solution
Add this for items.xml ;)
Lua:
</item>
    <item id="2016" article="a" name="pool">
        <attribute key="decayTo" value="2017" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2017" article="a" name="pool">
        <attribute key="decayTo" value="2018" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2018" article="a" name="pool">
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="600" />
    </item>
    <item id="2019" article="a" name="pool">
        <attribute key="decayTo" value="2020" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2020" article="a" name="pool">
        <attribute key="decayTo" value="2021" />
        <attribute key="duration" value="45" />
    </item>
    <item id="2021" article="a" name="pool">
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="60" />
    </item>
fixed the problem, thank you very much
 

Similar threads

Back
Top