PotionCrate Configuration
A Potion Crate is one inventory item that holds thousands of potions of one kind. Players stop carrying rows of 255 stacks. The file loads at GameServer start and on a plugin reload.
How a player uses it:
| Action | Result |
|---|---|
| Drop a potion stack on the crate | The potions go into the crate |
| Shift + Click a potion in an NPC shop | Bought straight into the crate that already holds that potion |
| Use the last potion of a stack | The stack is refilled from the crate (also for MU Helper and the offline helper) |
| Right-click the crate | One stack comes out into the bag |
| Chaos machine | Craft a crate, raise its level |
File Location#
GameServer/Data/Plugins/Items/PotionCrate.xml
Dependencies#
| Depends On | Purpose |
|---|---|
| Item.xml | The crate item row (Serial="1"). Shipped as Category 14, Index 180 |
| ItemStack.xml | Only items listed there can go into a crate. The crate itself must not be listed |
| CustomItemVisual | Model and inventory pose of the crate (PotionCrate.bmd, potioncrate.OZJ in the client Data/Custom/Item) |
| GameStrings.xml | Recipe texts (11500-11505) and tooltip texts (11510-11515) |
| ChaosMix recipes | Schema of the <Recipe> rows |
Configuration Structure#
<PotionCrate Enabled="1" Debug="0">
<Crate Type="14" Index="180"/>
<Capacity>
<Level Value="0" Potions="1000"/>
<Level Value="1" Potions="2000"/>
</Capacity>
<Potions>
<Potion Type="14" Index="3" Name="Large Healing Potion"/>
</Potions>
<Rules ShopFill="1" AutoRefill="1" BlockSellFilled="1" BlockDropFilled="1"/>
<Recipes>
...
</Recipes>
</PotionCrate>
PotionCrate#
| Attribute | Type | Range | Default | Effect |
|---|---|---|---|---|
| Enabled | int | 0-1 | 0 | 0 turns the feature off: crates are plain items, what is inside is kept for when it is turned on again. The shipped file has Enabled="1". |
| Debug | int | 0-1 | 0 | 1 writes every deposit, take out and refill to the GameServer log. |
Crate#
| Attribute | Type | Range | Default | Effect |
|---|---|---|---|---|
| Type | int | 0-15 | - | Item category of the crate. |
| Index | int | 0-511 | - | Item index inside the category. |
The item needs a row in Item.xml with Serial="1" and must not be in ItemStack.xml. If one of the two is wrong the feature stays off and the GameServer log says why.
Capacity#
One <Level> row per crate level.
| Attribute | Type | Range | Default | Effect |
|---|---|---|---|---|
| Value | int | 0-15 | - | Crate level (+0 to +15). |
| Potions | int | 1 - 2,000,000,000 | - | How many potions a crate of this level holds. |
Levels start at 0 and have no gaps. The highest row is the highest level a crate can reach. A row after a gap is ignored.
Potion#
| Attribute | Type | Range | Default | Effect |
|---|---|---|---|---|
| Type | int | 0-15 | - | Item category. |
| Index | int | 0-511 | - | Item index. |
| Name | text | - | - | Comment for you. Not read. |
An item that does not stack is skipped with a line in the log.
Rules#
| Attribute | Type | Range | Default | Effect |
|---|---|---|---|---|
| ShopFill | int | 0-1 | 1 | 1 = Shift + Click in an NPC shop buys into the crate. |
| AutoRefill | int | 0-1 | 1 | 1 = an emptied bag stack is refilled from a crate. |
| BlockSellFilled | int | 0-1 | 1 | 1 = a crate with potions cannot be sold to an NPC. Selling it deletes the potions. |
| BlockDropFilled | int | 0-1 | 1 | 1 = a crate with potions cannot be dropped. On the ground it would despawn with them. |
Recipes#
Each <Recipe> uses the schema of ChaosMix_Recipes.xml (Display, Requirements, ZenCost, SuccessRate, Options, Sources) plus one <Crate> child. The recipes are added to the chaos machine when the file loads and are gone when the feature is off.
| Attribute | Values | Effect |
|---|---|---|
| Kind | craft | The materials become a new crate +0. The box must not hold a crate. |
| Kind | upgrade | Crate + materials become the same crate one level higher. The box must hold exactly one crate. |
- Do not set
MixIndex. It is assigned at load. MixIDis a label. Keep it between 205 and 255 and different per recipe.- No
<Rewards>. - Write one upgrade recipe per level and give its crate
<Source>that level inLevelMinandLevelMax.
Important Behavior#
- One crate, one kind. A crate holds one potion and one potion level (a +1 potion is its own kind). A crate with 0 potions takes any kind.
- A drained crate keeps its kind. Shop fill and refill still work for it. Dropping another potion on it changes the kind.
- Shop fill needs a crate that already holds that potion. A crate that was never filled is not touched by Shift + Click. Every matching crate is filled as far as the room and the zen go. With no matching crate, or all of them full, Shift + Click buys one bag stack as before.
- Shop fill is zen only. Items priced in WCoin or Goblin Points, and timed items, buy the normal way.
- Refill needs no free cell. It reuses the slot of the emptied stack, so a full bag changes nothing. The crate can sit in the extended inventory.
- Taking a stack out with a full bag is refused with a message. Open stacks of the same potion are filled first; only what is left needs a free cell.
- An upgrade never loses the crate. On a failure the materials are lost, the crate and its potions stay.
- A crate with potions cannot be a material in any other mix. An empty crate can.
- Nothing moves in or out while a trade, a chaos machine or vault window, or a bet duel is open. Potions used during a bet duel run out the normal way.
- A crate trades with what is inside. Trade, vault, guild vault and Market all keep the potions.
- A crate above the highest configured level (after you removed rows) keeps the capacity of the highest row.
- Lowering a capacity below what a crate holds keeps the potions. Nothing more goes in until it is below the limit again.
- Reload: a plugin reload applies every value. The list of crate and potion items is sent to clients at login, so a changed
<Crate>or<Potions>list needs a relog before the drop gesture follows it. - GameServer and client must be updated together.
Examples#
<Recipe MixType="0" MixID="211">
<Display NameText1="11502" DescText1="11503" Width="-1" Height="-1" Category="4" Result="main,1"/>
<Requirements Level="10"/>
<ZenCost Type="A" Value="1000000"/>
<SuccessRate MaxRate="100"><Token Op="MAXRATE"/></SuccessRate>
<Options MixOptionId="1" CharmOptionId="1" ChaosCharmOptionId="1"/>
<Sources>
<Source TypeMin="7348" TypeMax="7348" LevelMin="0" LevelMax="0" CountMin="1" CountMax="1"/>
<Source TypeMin="6159" TypeMax="6159" CountMin="1" CountMax="1"/>
<Source TypeMin="7181" TypeMax="7181" CountMin="1" CountMax="1"/>
<Source TypeMin="7182" TypeMax="7182" CountMin="1" CountMax="1"/>
</Sources>
<Crate Kind="upgrade"/>
</Recipe>
Item numbers are Category x 512 + Index: 7348 = Potion Crate (14,180), 6159 = Jewel of Chaos, 7181 = Jewel of Bless, 7182 = Jewel of Soul.
To sell crates in a shop in place of the craft recipe, add the crate to a shop file and delete the craft recipe.
Common Issues#
| Symptom | Cause | Fix |
|---|---|---|
| Potions dropped on the crate just swap places or do nothing | Client is older than the GameServer, or the potion is not in <Potions> | Update the client. Add the potion and relog |
| "The Potion Crate is not ready yet" | The crate's data has not arrived from the DataServer | Wait a moment. If it stays, relog |
| Shift + Click buys a normal stack | No crate holds that potion yet, or they are full | Drop one stack of that potion on the crate first |
| The crate shows as a wrong or missing model | PotionCrate.bmd / potioncrate.OZJ not in the client, or the CustomItemVisual.xml row is missing | Ship both files in the client patch and copy the row |
| Feature off after an update | Item.xml has no row for the crate item | Copy the Potion Crate row from the new Item.xml |