Release [Release] Mu Alfa v12 - Season 6 with Advanced AI Bots + Source Code

CreadorMU

Curious
gemgem
Administrator
Programmer C++
3D Designer
Special Effects
Marketing
WebMaster
Linux OS
Android Dev
A.I Trainer

Reputation:

Zf9yuk6.png


Mu Alfa v12: "Where Artificial Intelligence Comes to Life"
The Future of Mu Online Servers, Today. And the Source Code is Yours.

TSOJLw9.jpeg

Hello, My community,

Forget everything you know about server bots. We were tired of static worlds where NPCs are just decorations. That's why we created **Mu Alfa v12**, a project designed to breathe life into the continent of Mu with an AI system that creates allies, rivals, and a world that feels truly dynamic and unpredictable.

This is not just another set of files; this is an ecosystem.

Introducing the "Living AI" System

We have developed a revolutionary bot system that goes beyond simple automation. Our bots have their own alliances, objectives, and rivalries.

1. The Allies: Intelligent Support Parties

We've created bots designed to be the perfect party members. They don't just wait for an invitation; they take the initiative to build efficient teams and help you conquer the biggest challenges.
  • Proactive Party Formation: Bots with Party Mode enabled will actively scan their surroundings for solo players (both real and other bots) and send them party invitations to form effective leveling teams.
  • Tactical Buff Support: In a party, support bots (like Elves) use our "Intelligent Buffing" logic. They will keep you and the entire party buffed, but only when it's tactically necessary, saving mana and acting like seasoned players.
  • Coordinated Team Play (Leader/Follower): This is a game-changer. Watch as our bots form squads. "Follower" bots will protect and move in formation with their "Leader," creating an organized team play that will leave you amazed.
  • Efficient Group Looting: Bots will pick up valuable items based on their class-specific loot list, making party grinding more efficient and profitable for everyone.



2. The Adversaries: PvP Hunters

But not everything in this world is friendly. For players seeking a real challenge, we've created a faction of bots that hunt you.
  • A Constant Threat: Bots in PvP Mode are predators. They use their "Hunter AI" not only for monsters but to actively track down real players in a wide radius. If they see you, they will follow.
  • Ruthless Combat: They won't wait for you to attack first. Once they lock onto you, they will engage with their full set of skills. Prepare for unexpected and brutal duels.
  • The World is Their Arena: With these bots, no leveling spot is truly safe anymore. Any map can turn into a battlefield, forcing you to always be on your guard, improve your gear, and master your PvP skills. Be careful, because they will kill you.
t0BlRTN.jpeg


The Result? An Unpredictable and Addictive World.

This dual system creates a dynamic, unscripted gameplay experience. One moment, you might find a friendly party of bots that invite you to join them. The next, you could be ambushed by a lone, lethal PvP bot on your way to Lost Tower. This generates unique stories and a constant sense of life that will keep your players engaged day after day.

Download & Community

The future is open-source and collaborative. The complete project is available to everyone.

GitHub Repository:
https://github.com/creadormu

Thank you for your time. I hope you enjoy Mu Alfa v12, and that together, we can take the Mu Online community to the next level.

vwAeTRt.jpeg

TyZ8tzL.jpeg


sgTmOey.jpeg


SYSTEMS INCLUDE
Custom Mount
Custom Pet
Custom Monster
Custom Map
Custom Item
Custom Wing
Custom Reset
Custom Drop
4 interfaces available
Custom Jewel
Custom Mix
Custom Box
Custom Glove
Custom Cloak

ADDITIONAL
Dynamic and static effects
Glow color
Sets Animes
Sets until Season 17
Pets Pokemon y Digimon


ESPECIAL PANEL
Change Class
Change Quest
Buy VIP
Ranking
Time Events
Smith Shop
Custom titles
Jewel Bank
Party Search
Multiple Baúls

BOTS's CONFIGURATION

Once you have implemented the MU Server and everything is working normally, go to GameServer.exe and in the Menu choose: AI and click on: Reload AI
QTJ4P34.png


Then click: ADD IA
S4nEgCU.png


Also, every time you close gameserver.exe, you must first click on: DELETE IA to avoid confusion. It is also suggested to click on: DISCONNECT ALL to avoid losing any user information and interpreting it as a bug.

The configurations for this system are in just two files: BotPhrases.txt and IA.xml, both located in the same location as GameServer.exe.

NOTE: If you create 700 accounts, you can upload 700 bots, which will be difficult for real users to distinguish and will load in 1 minute.

Finally, the IA.xml file is where you must add the accounts and configure them.


MEGA:
Mu Server: https://mega.nz/file/Bq1W2DzL#KIjgyH5KsMRmBcbMrwK5doB2OFLM2Ne0T82iLDYfx1w
Cliente MU: https://mega.nz/file/02FGSCBT#nqoPrjSm1VGL6TU2rWZU3sVNC5I92QfHm0ALniuQ-8E
Código Fuente: https://mega.nz/file/E7NgxJqI#1OycWoiqOTQoM4Fh6o8UrpHGTwky978j2oYr8qW7sPM

MEDIAFIRE:
Mu Server: https://www.mediafire.com/file/oueyhuhi1fdn174/MuServerS6EPI20(MuAlpha).zip/file
Cliente MU: https://www.mediafire.com/file/8nukm80harthsw4/Cliente_6_Episodio_20_%28Mu_Alfa_v1%29.zip/file
Código Fuente: https://www.mediafire.com/file/2xph5yp4jxxm23n/Fuente_Season_6_Episodio_20_%28Mu_Alfa_v1%29.zip/file

Password: www.creadormu.com

SQL SERVER 2012: (You can use: 2012, 2014, 2016)
MEGA: https://mega.nz/file/BwICWaIT#jjz5n8NfvKIFhcXZFlyu-H90hASw2crJcIKTfOyfnCk


UPDATE: 2 (31/05/2025)

Bash:
CHANGELOG:
- Talking bots now have a fourth kind of messages, that is used when they are in PVP.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/l2NwlJoA#dL0iSPwTG8A1jGMc40mxw8HLz35ZXlJTVCUSP8Q4OMs
Mediafire: https://www.mediafire.com/file/i14ogmv5nr9g1n0/UPDATE+2+-+Mu+Alfa.zip/file



UPDATE: 3 (01/06/2025)

Bash:
CHANGELOG:
- Talking bots now can speak depending on the map.
- Now BotPhrases.txt has a priority option for messages.
- Party system optimized.
- Talking bots also can use phrases depending on the class.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/5zFEjYqa#QjH86L5q7omMiGLpw888il62aVQBS2bVQlpQVCi9mb8
Media: https://www.mediafire.com/file/qpnciqznqlg2667/UPDATE+3+-+Mu+Alfa.zip/file


UPDATE: 4 (05/06/2025)

Bash:
CHANGELOG:
- Talking bots now recognize the names of near-real players.
- Timer system for messages optimized
- Botphrases.txt comes with 100 phrases per category, in total above 1500.
- Talking bots now recollect Zen.
- Talking bots also collect jewels with an animation like real players.
- Xshop visual bug with armors. FIXED!
- Large HP bar of monster. FIXED!
- Visual bug with armors in inventory. ¡FIXED!

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/N2EVxBCD#JxIBPiuhtBb3C7njJxb21zhxfUNdn0SC67CutBqwrFo
Mediafire:



UPDATE: 5 (09/06/2025)

Bash:
CHANGELOG:
- Bots now speak in both chats, with the /post command and with the personal chat, the bubble that appears above the character.
- Talking Bot System source code optimized. (0% errors, 0% warnings)

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/U78W2DLQ#sp8HgSnMjywJMPRQyfymimDE43L5rjYnvNxnL3lSdiU
Mediafire: https://www.mediafire.com/file/wb6qy1hmmrcms44/UPDATE+5+-+Mu+Alfa.zip/file


UPDATE: 5.5 (11/06/2025)

Bash:
CHANGELOG:
Available Personality Packs in Update 5.5:

    - English (International Gamer Slang)
    - Portuguese (Brazilian Slang & Culture)
    - Spanish (Argentinian Slang & Culture)
    - Spanish (Chilean Slang & Culture)
    - Spanish (Uruguayan Slang & Culture)
    - Mexico (Mexican Slang & Culture)
    - Korean (Korean Gaming Slang & Memes)
    - Japanese (Japanese Gaming Slang & Culture)
    - Chinese (Mandarin - Chinese Gaming Slang & Memes)
    - Filipino (Tagalog/Taglish Gamer Slang)
    - And of course, the original Peruvian Spanish version.

INSTRUCTIONS:
1) Just rename the BotPhrases(eng).txt to BotPhrases.txt and replace with the one on :\MuServerS6EPI20\GameServerwith the, just that.

DOWNLOAD:

Mega: https://mega.nz/file/t2cWGDBC#khEsYp2T4FP_x8-ZPaVEIX9eUZVXhHpluZ5gle7vPB0
MediaFire: https://www.mediafire.com/file/3mky0yiycoxk0up/UPDATE+5.5+-+Mu+Alfa.zip/file


UPDATE: 6 (21/06/2025)

Bash:
CHANGELOG:
    - Bots now can collect jewels directly to the jewel bank.
    - All the character's skills are optimized.
    - Bot as Elf Energy is working, ideal for a party.
    - Bots give buffs as soon as you enter a party.
    - When bots reach level 400, they reset automatically and keep points.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/xztjQTyI#AWOXJV6jLg-Y0Y39n_994Tdh99sX0jRmp7_UWWgtZVs
MediaFire:
https://www.mediafire.com/file/p3l7r2b54slcjbb/UPDATE+6+-+Mu+Alfa.zip/file


UPDATE: 6.1 (21/06/2025)

Bash:
CHANGELOG:
    -  IA.xml optimized for collocate bots depending of maps (Example: map=2 is Noria).
    - SQL Query for create 100 account with characters in a second. (Take as example)
    - IA.xml reloaded with 109 bots. (MuOnline.bak also included)
    - Optimized system for reducing consuming of memory.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: MediaFire:
UPDATE: 6.8 (02/07/2025)

Bash:
CHANGELOG:
    - Bots can now communicate based on the time of day: morning, afternoon, or evening.
    - All phrases from each category have been recalibrated to ensure they appear with equal priority.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/A312WJ4b#9Xws3kr-YCFteTfkrtWXgSCtv28qrJNu9cZH79KHg8Y
MediaFire: https://www.mediafire.com/file/np0mhz1uqug62u0/UPDATE+6.8+-+Mu+Alfa.zip/file



UPDATE: 7 (02/07/2025)

Bash:
CHANGELOG:
    -  Bots can now respond when you send a message nearby to them.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/Z6sV0JIB#3hTYDmH8e3OE5Umt8AcI2j4kfsYY60Na_9RSXNB1sLU
MediaFire: https://www.mediafire.com/file/a2vwmml9qn1s52z/UPDATE+7+-+Mu+Alfa.zip/file



UPDATE: 7.5 (02/07/2025)

Bash:
CHANGELOG:
    - Bots are now capable of recognizing keywords when you speak nearby in three specific situations: "Hello," "Goodbye," and "How are you?" They will respond accordingly.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/x3NHiaLY#Efwxz9mTBKTKCCErf-sLJz5lua6wCkBdkfZYc1_dyxw
MediaFire: https://www.mediafire.com/file/hzwgnpato0cxzey/UPDATE+7.5+-+Mu+Alfa.zip/file




UPDATE: 8 (03/07/2025)

Bash:
CHANGELOG:
    - There is a new file named "Answering.txt" that detects keywords used by real users. The bot will respond based on the context of the detected keywords.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/53MDlCSK#wnwqq1pmLHGYPaA2K5yTO71dQkRqEASqW-P2-pnWM_c
MediaFire: https://www.mediafire.com/file/26e35rg7h515gay/UPDATE+8+-+Mu+Alfa.zip/file


UPDATE: 9 (03/07/2025)


Bash:
CHANGELOG:
    - Now, bots can utilize two attacking skills, which enhance realism and intelligence.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/p3Mn0DiC#4gv5j5emO6cVgPQlpBi3Ct7JJ5NGxTGBavbxD1VgWak
MediaFire: https://www.mediafire.com/file/hx1i4y74y979l97/UPDATE+9+-+Mu+Alfa.zip/file



UPDATE: 10 (17/08/2025)


Bash:
CHANGELOG:
    - Bots are now able to receive trades and read the requirements and reward information from the new file, FakeBotTrade.txt.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/HP5TmQLB#gb2nPZk5oJccTUgxzI8FDVTybFDu9m2F7y4Tx_cCUxs
MediaFire: https://www.mediafire.com/file/zkspm7r7vy4tv4r/UPDATE+10+-+Mu+Alfa.rar/file

UPDATE: 10.5 (17/08/2025)


Bash:
CHANGELOG:
- The trade bot system for the AI with bots was optimized for improved performance.

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/ebhFgLCb#ZVGcWrS4jBJ4AGWkq7WWza0pT8N84SaU3MdiisnrTrM
MediaFire: https://www.mediafire.com/file/8nhbhr54uazbiru/UPDATE+10.5+-+Mu+Alfa.zip/file


UPDATE: 11 (17/08/2025)

4XR50VE.jpeg


j1PlwE7.jpeg


Usliskz.jpeg


Bash:
CHANGELOG:
- The bots equipped with AI can now communicate, asking for items to trade and offering rewards in return.
- A new category has been added to BotPhrases.txt: "TRADE," which includes "placeholder tags" for required items and reward items, example:
Buying {item_required} for {item_reward}!
Trading {item_required} -> {item_reward}!

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/CeZimYID#cMMszqmQR8y6DOl3qPvZD9_6bSOvEBPMAABxaXR6HT4
MediaFire: https://www.mediafire.com/file/e2ct9y1ipic35zj/UPDATE+11+-+Mu+Alfa.zip/file


UPDATE: 12 (21/08/2025)


Bash:
CHANGELOG:

"This system now properly handles both regular inventory items AND the counter-based jewel bank system that the bots use for automatic jewel collection!"

How It Works Now:
- Bot has Chaos on Inventory and 50 Chaos jewels in bank
- Player requests trade for Chaos jewel
- System checks: ✅ Found 50 Chaos in bank (Priority is Jewel Bank then inventory)
- Trade starts: Creates Chaos jewel from bank counter (50→49)
- Player sees: Chaos jewel in trade window (At 99% not ready yet)
- Trade completes: Player gets the jewel, bot's counter decreases

INSTRUCTIONS:
1) Just copy, paste and replace the original files with the updated ones, just that.

DOWNLOAD:

Mega: https://mega.nz/file/aKAWUDoA#tH-hncFxk4GSf3QcCzgJR7W3qAWZyg8Nx3nhH7WrliU
MediaFire: https://www.mediafire.com/file/k3la3phjhh4c884/UPDATE+12+-+Mu+Alfa.zip/file
 
Last edited:
Admin plss ADD BotPhrases for Filipino words Thank you
Hello, my friend. In the Mu Alfa Update 5.5, you already have a file named BotPhrases(Phi).txt. Just rename it to BotPhrases.txt and replace it in the MuServer/GameServer directory. That’s all.
 

Attachments

¿Ya vieron el tutorial que se hizo en vivo de cómo utilizar Mu Alfa Season 6?
 
En esta fase beta de Mu Despertar Season 6 Episodio 3, que dispone de Mu Alfa, mostramos como agregar un Bot desde 0,
Finally, since the next video, everything is going to be in English.
 

It appears our video tutorial platform is superior to YouTube regarding how shares are displayed on a forum like this one.
 
This code updates the trade function on the FakeBots using AI to achieve the Mu Alfa v10.5:

C++:
// Fixed version of your trade functions

bool CFakeOnline::CanTradeWithBot(const LPOBJ lpBot)
{
    if (!lpBot || !lpBot->Account[0]) return false;
    std::string acc = trim(lpBot->Account);
    std::transform(acc.begin(), acc.end(), acc.begin(), ::toupper);
    auto it = m_TradeData.find(acc);
    if (it != m_TradeData.end()) {
        LogAdd(LOG_BLUE, "[FakeBot][CanTradeWithBot] Bot %s (Account: %s) SÍ está en la lista de trade.", lpBot->Name, lpBot->Account);
        return true;
    }
    LogAdd(LOG_RED, "[FakeBot][CanTradeWithBot] Bot %s (Account: %s) NO está en la lista de trade.", lpBot->Name, lpBot->Account);
    return false;
}

bool CFakeOnline::HandleFakeBotTrade(int playerIndex, LPOBJ lpBot) {
    LogAdd(LOG_RED, "[FakeBotTrade] Se intentó trade con %s por %s", lpBot->Name, gObj[playerIndex].Name);
    
    // FIX 1: Proper account key handling
    std::string acc = trim(lpBot->Account);
    std::transform(acc.begin(), acc.end(), acc.begin(), ::toupper);
    
    auto it = m_TradeData.find(acc);
    if (it == m_TradeData.end()) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Este bot no puede hacer trade.");
        return false;
    }

    const auto& config = it->second;
    if (config.requiredItems.empty()) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: No hay requerimientos configurados.");
        return false;
    }

    // Validar cantidad de ítems
    int itemCount = CountTradeItems(playerIndex);
    if (itemCount != config.requiredItems.size()) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Debes poner %d items requeridos.", config.requiredItems.size());
        return false;
    }

    // FIX 2: Proper item validation including type check
    std::vector<bool> reqFound(config.requiredItems.size(), false);
    
    for (int n = 0; n < TRADE_SIZE; n++) {
        CItem* pItem = &(gObj[playerIndex].Trade[n]);
        if (!pItem->IsItem()) continue;
        
        for (size_t reqIdx = 0; reqIdx < config.requiredItems.size(); reqIdx++) {
            if (reqFound[reqIdx]) continue; // Already found this requirement
            
            const auto& req = config.requiredItems[reqIdx];
            if (pItem->m_Index == req.Type &&              // Check item type
                pItem->m_Level >= req.LevelMin &&
                pItem->m_Option3 >= req.OptionMin &&
                pItem->m_Option2 >= req.Luck &&
                pItem->m_Option1 >= req.Skill &&
                pItem->m_NewOption >= req.Exc &&
                pItem->m_Durability >= req.Dur) {
                reqFound[reqIdx] = true;
                break;
            }
        }
    }

    // Check if all requirements are met
    for (size_t i = 0; i < reqFound.size(); i++) {
        if (!reqFound[i]) {
            gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Los items no cumplen con los requisitos.");
            return false;
        }
    }

    // FIX 3: Better inventory space check
    if (config.rewardItems.empty()) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: No hay recompensas configuradas.");
        return false;
    }

    // Check space for reward items
    for (const auto& reward : config.rewardItems) {
        if (gItemManager.CheckItemInventorySpace(&gObj[playerIndex],
            gItemManager.GetItemWidth(reward.Type),
            gItemManager.GetItemHeight(reward.Type)) == 0) {
            gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: No tienes espacio en inventario.");
            return false;
        }
    }

    // FIX 4: Success rate check
    if (config.successRate < 100) {
        int random = rand() % 100;
        if (random >= config.successRate) {
            gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: El trade falló por suerte.");
            return false;
        }
    }

    // FIX 5: Give all reward items, not just first one
    for (const auto& reward : config.rewardItems) {
        GDCreateItemSend(playerIndex, 235, 0, 0, reward.Type, reward.LevelMin, 0,
            reward.Skill, reward.Luck, reward.OptionMin, -1, reward.Exc, 0, 0, 0, 0, 0xFE, 0);
    }

    // FIX 6: Proper trade completion
    gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Trade completado con éxito.");
    
    // Clear trade items and close trade window
    for (int i = 0; i < TRADE_SIZE; i++) {
        gObj[playerIndex].Trade[i].Clear();
    }
    
    // Close trade interface
    gTrade.GCTradeResultSend(playerIndex, 1); // 1 = success
    
    return true;
}

// FIX 7: Improved config loading with proper bot indexing
void CFakeOnline::LoadFakeBotTradeConfig(const char* path) {
    LogAdd(LOG_BLUE, "[FakeBotTrade] Intentando cargar archivo: %s", path);

    FILE* file = fopen(path, "r");
    if (!file) {
        LogAdd(LOG_RED, "[FakeBotTrade] ERROR: No se pudo abrir el archivo %s", path);
        return;
    }

    int section = 0;
    char line[256];
    int botsCargados = 0, itemsReq = 0, rewards = 0;
    std::vector<std::string> botAccounts; // Store bot accounts in order

    auto clean_upper = [](const char* input) -> std::string {
        std::string s = input ? input : "";
        size_t start = s.find_first_not_of(" \t\r\n");
        size_t end = s.find_last_not_of(" \t\r\n");
        s = (start == std::string::npos) ? "" : s.substr(start, end - start + 1);
        std::transform(s.begin(), s.end(), s.begin(), ::toupper);
        return s;
    };

    while (fgets(line, sizeof(line), file)) {
        line[strcspn(line, "\r\n")] = 0;
        if (line[0] == '/' || line[0] == 0) continue;

        if (strncmp(line, "end", 3) == 0) {
            section++;
            continue;
        }

        // SECTION 0: Bots
        if (section == 0) {
            char* token = strtok(line, " \t");
            if (!token) continue;
            int index = atoi(token);

            token = strtok(NULL, " \t");
            if (!token) continue;
            char acc[32] = { 0 };
            strncpy(acc, token, sizeof(acc) - 1);

            token = strtok(NULL, " \t");
            if (!token) continue;
            char tradeName[32] = { 0 };
            strncpy(tradeName, token, sizeof(tradeName) - 1);

            token = strtok(NULL, " \t");
            if (!token) continue;
            int rate = atoi(token);

            std::string accKey = clean_upper(acc);
            FAKEBOT_TRADE_ITEM& trade = m_TradeData[accKey];
            trade.tradeName = tradeName;
            trade.successRate = rate;
            
            botAccounts.push_back(accKey); // Store in order
            botsCargados++;
        }
        // SECTION 1: Requirements - use ordered bot accounts
        else if (section == 1) {
            char* token = strtok(line, " \t");
            if (!token) continue;
            int botIndex = atoi(token);

            if (botIndex < 0 || botIndex >= botAccounts.size()) continue;

            int type, index, lvl, opt, luck, skill, exc, dur;
            token = strtok(NULL, " \t"); if (!token) continue; type = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; index = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; lvl = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; opt = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; luck = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; skill = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; exc = atoi(token);
            token = strtok(NULL, " \t"); if (!token) continue; dur = atoi(token);

            MixesItems item;
            item.Type = GET_ITEM(type, index);
            item.LevelMin = (BYTE)lvl;
            item.LevelMax = (BYTE)lvl;
            item.OptionMin = (BYTE)opt;
            item.OptionMax = (BYTE)opt;
            item.Luck = (BYTE)luck;
            item.Skill = (BYTE)skill;
            item.Exc = (BYTE)exc;
            item.Dur = (BYTE)dur;

            // Use ordered account access
            std::string accKey = botAccounts[botIndex];
            m_TradeData[accKey].requiredItems.push_back(item);
            itemsReq++;
        }
        // SECTION 2: Rewards (unchanged)
        else if (section == 2) {
            char* token = strtok(line, " \t");
            if (!token) continue;
            char tradeName[32] = { 0 };
            strncpy(tradeName, token, sizeof(tradeName) - 1);

            int data[10] = { 0 };
            for (int i = 0; i < 10; ++i) {
                token = strtok(NULL, " \t");
                if (!token) break;
                data[i] = atoi(token);
            }
            if (token == NULL) continue;

            MixesItems reward;
            reward.Type = GET_ITEM(data[0], data[1]);
            reward.LevelMin = (BYTE)data[2];
            reward.LevelMax = (BYTE)data[3];
            reward.OptionMin = (BYTE)data[4];
            reward.OptionMax = (BYTE)data[5];
            reward.Luck = (BYTE)data[6];
            reward.Skill = (BYTE)data[7];
            reward.Exc = (BYTE)data[8];
            reward.Dur = (BYTE)data[9];

            for (auto it = m_TradeData.begin(); it != m_TradeData.end(); ++it) {
                if (strcmp(it->second.tradeName.c_str(), tradeName) == 0) {
                    it->second.rewardItems.push_back(reward);
                    rewards++;
                }
            }
        }
    }

    fclose(file);
    LogAdd(LOG_GREEN, "[FakeBotTrade] Carga completa: Bots: %d | Items requeridos: %d | Recompensas: %d", botsCargados, itemsReq, rewards);
}

// FIX 8: Add this function to check before starting trade
bool CFakeOnline::CanStartTradeWithBot(int playerIndex, LPOBJ lpBot) {
    if (!lpBot || !CanTradeWithBot(lpBot)) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Este bot no puede hacer trade.");
        return false;
    }
    
    if (gObj[playerIndex].Interface.use != 0) {
        gNotice.NewNoticeSend(playerIndex, 0, 0, 0, 0, 0, "FakeBot: Ya estás en una ventana.");
        return false;
    }
    
    return true;
}
 

Attachments

hi can you please make an tutorial how to install serverfiles + Source Code ? :0002:
 
Last edited:
Back
Top