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

vial of oil npc trade problem !

Cooklin

New Member
Joined
Dec 27, 2015
Messages
13
Reaction score
0
Guys I'm struggling with liquids problem
I'm using 0.4 rev3884
I can buy vial of blood but can't buy vial of oil, slime etc higher than 7 I think it looks like:
08PyKOf.png


in npc:
vial of oil,2006,20,11

someone knows something about this?
 
Npc for Sell Oil:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Oil Npc" script="OilNpc.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100" />
    <look type="759" head="78" body="63" legs="97" feet="76" addons="2"/> -- CHANGE THE LOOKTYPE
    <parameters>
        <parameter key="module_shop" value="1" />
        <parameter key="shop_buyable" value="
          
          
            vial of oil,2006,10000,11;" /> -- 10K THE OIL ;)
      
    </parameters>
</npc>
 
No it doesn't work on 0.4 r3884 i tried

Alright, try this:

Add this to const.h below "const uint8_t fluidMap[] = { ... };":
Code:
const uint8_t clientToServerFluidMap[] = {
    FLUID_EMPTY,
    FLUID_WATER,
    FLUID_MANA,
    FLUID_BEER,
    FLUID_MUD,
    FLUID_BLOOD,
    FLUID_SLIME,
    FLUID_RUM,
    FLUID_LEMONADE,
    FLUID_MILK,
    FLUID_WINE,
    FLUID_LIFE,
    FLUID_URINE,
    FLUID_OIL,
    FLUID_FRUITJUICE,
    FLUID_COCONUTMILK,
};

Add this to tools.h below "FileType_t { ... };":

Code:
uint8_t serverFluidToClient(uint8_t serverFluid);
uint8_t clientFluidToServer(uint8_t clientFluid);

Add this to tools.cpp below "SkillIdNames skillIdNames[] = { ... };":

Code:
uint8_t serverFluidToClient(uint8_t serverFluid)
{
    uint8_t size = sizeof(clientToServerFluidMap) / sizeof(uint8_t);
    for (uint8_t i = 0; i < size; ++i) {
        if (clientToServerFluidMap[i] == serverFluid) {
            return i;
        }
    }
    return 0;
}

uint8_t clientFluidToServer(uint8_t clientFluid)
{
    uint8_t size = sizeof(clientToServerFluidMap) / sizeof(uint8_t);
    if (clientFluid >= size) {
        return 0;
    }
    return clientToServerFluidMap[clientFluid];
}

THREE TIMES in game.cpp change "subType = reverseFluidMap[count];" to:

Code:
subType = clientFluidToServer(count);

On protocolgame.cpp change "msg->put<char>(fluidMap[item.subType % 8]);" to :

Code:
msg->put<char>(serverFluidToClient(item.subType));

That should work
 
Back
Top