> For the complete documentation index, see [llms.txt](https://eurekabusiness.caiziii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eurekabusiness.caiziii.com/eurekabusinesscommunity-en/player-guide/customer-behaviors.md).

# Customer Behaviors & AI

This document introduces customer spawning rules, NPC occupational variants, preference mechanics, and continuous purchasing behavior.

***

## 1. Spawning & Store Entry

1. **Shop Status**: When a valid Shop Key rests inside the Key Device, the shop maintains the `OPEN` state.
2. **Entrances & Spawning**:
   * Customers spawn periodically near configured shop entrances.
   * Powered by a Behavior Tree, customers navigate across the sales floor evaluating accessible pedestals.
3. **Shopping Basket**:
   * Each customer carries a virtual shopping basket holding up to 5 distinct item kinds.

***

## 2. Customer Variants Reference

Customers belong to distinct occupational variants with unique models, textures, portraits, and elemental preferences:

| Variant ID                          | Name                   | Model & Portrait                                                                                                                     | Preferred Elements                                                                                                                 | Spawning & Rarity Conditions                                                                   | Shopping & Continue Purchase                                                                      |
| ----------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `customer.default`                  | **Adventurer**         | <p>Classic backpack model<br>Portrait: <code>Gabriel</code></p>                                                                      | General goods                                                                                                                      | 100% base rarity (fallback)                                                                    | Base shopping (1-4 items, 50% willingness, 30% threshold)                                         |
| `customer.mage`                     | **Mage**               | <p>Pointed hood & robe models<br>Portraits: <code>Juan</code>, <code>Valdon</code>, <code>Violetta</code></p>                        | <p>Magic <code>praecantatio</code><br>Aura <code>auram</code><br>Mind <code>cognitio</code></p>                                    | <p><strong>Shop Magic Profile</strong><br>High spawn rate when $\sum \text{Magic} > 4$</p>     | <p><strong>Arcane Appetite</strong><br>$+20% + (\text{Lv} \times 3%)$ when buying magic items</p> |
| `customer.alchemist`                | **Alchemist**          | <p>Potion robe model<br>Portraits: <code>Isaac</code>, <code>Jasper</code>, <code>Maxine</code></p>                                  | <p>Magic <code>praecantatio</code><br>Energy <code>potentia</code><br>Poison <code>venenum</code><br>Taint <code>vitium</code></p> | <p><strong>Potion & Toxin Profile</strong><br>Scales with potion and brewing stock</p>         | <p><strong>Alchemy Appetite</strong><br>$+10%$ for toxins/potions; boosted by greed items</p>     |
| `customer.explorer`                 | **Explorer**           | <p>Trail gear model<br>Portraits: <code>Amelia</code>, <code>Conrad</code>, <code>Dylan</code></p>                                   | <p>Mining <code>perfodio</code><br>Travel <code>iter</code><br>Metal <code>metallum</code><br>Eldritch <code>alienis</code></p>    | <p><strong>Expedition Profile</strong><br>Scales with tools, travel gear, compasses, maps</p>  | <p><strong>Expedition Appetite</strong><br>$+20% + (\text{Lv} \times 2%)$ for travel tools</p>    |
| `customer.miner`                    | **Miner**              | <p>Mining helmets & pack models<br>Portraits: <code>Oscar</code>, <code>Sasha</code>, <code>Evelyn</code>, <code>Salvador</code></p> | <p>Mining <code>perfodio</code><br>Metal <code>metallum</code><br>Earth <code>terra</code></p>                                     | <p><strong>Ore & Metal Profile</strong><br>High spawn rate when $\sum \text{Minerals} > 5$</p> | <p><strong>Mining Appetite</strong><br>$+25% + (\text{Lv} \times 3%)$ for raw ores and metals</p> |
| `customer.recolor_0` \~ `recolor_5` | **Traveler (6 Tints)** | <p>6 custom tinted outfits<br>(Gold, Sky Blue, Emerald, Crimson, Violet, Cyan)</p>                                                   | General goods                                                                                                                      | Fixed 12% rarity                                                                               | Standard shopping (1-2 items, 50% willingness, 20% threshold)                                     |

***

## 3. Shop Element Profiles & Rarity Sampling

* **Shop Element Profile**:
  * Upon customer spawn ticks, the server computes a snapshot of all active pedestal contents, recording distinct elements, maximum levels, and cumulative element sums ($\sum \text{Element}$).
  * Example: A shop exhibiting an Enchanted Book (`praecantatio` Lv.3), Ghast Tear (`praecantatio` Lv.2), and Blaze Rod (`potentia` Lv.2) yields `praecantatio_sum=5` and `potentia_sum=2`.
* **Dynamic Rarity Sampling**:
  * Variant selection algorithms evaluate the Shop Element Profile:
    * High magic levels and sums attract Mages and Alchemists;
    * High mining, earth, and metal sums draw Miners and Explorers.

***

## 4. Continuous Purchase Mechanism

Customers do not always leave immediately after purchasing an item.

```mermaid
flowchart TD
    Bought[Purchase item from current pedestal] --> Roll[Sample Continue Purchase Algorithm]
    Roll -- Success & Basket not full --> Next[Search next pedestal<br>Continue browsing]
    Roll -- Fail or Target count reached --> Queue[Walk to Cash Register<br>Queue for settlement]
```

* **Algorithm Mechanics**:
  * Following each successful purchase, the variant algorithm computes the continuous purchase chance based on item elements and shop atmosphere.
  * **Satisfaction Bonus**: Underpriced bargains or preferred elements substantially increase the chance to continue shopping.
  * **Basket Caps**: Hard limits ensure customers proceed to the cash register once their purchase target is satisfied.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://eurekabusiness.caiziii.com/eurekabusinesscommunity-en/player-guide/customer-behaviors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
