Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Aion 5.8 emulator improvement community project

Joined
Dec 6, 2013
Messages
391
Reaction score
813
This project is a continuation of the work Robyson did packaging the code from an Encom release that was based on Aion-Lightning. All credits that we are aware of are listed on the github site as well as in the code.

————————————————————————————————————

(also contains the login fix for the client)

(back up client and overwrite with this)





- thank you MATTYOne

NotAion 5.8 client - torrent



How to compile by MATTYOne

to use with that post's instructions. Everything needed to compile is contained within, no other installations are needed. Important - make sure the path you put this in has no spaces in it.

Initial setup and updating

links to all 5.x patch notes



NEW - latest build and instructions to update by dezalmado - 2024-01-15

- these are much lower than the included ones

————————————————————————————————————

I want to give a big thanks to dezalmado. He is the one who actually got this started over in the SPP thread. I just set this one up to have the work he has done in one place, and invite others to join in our efforts.

————————————————————————————————————

In addition to the long list of people involved in the creation and refinement of this emulator that are listed on the github page, I would like to thank those who have contributed here:

fixes / guidance:
- Angry Catster
- Beckupgaming
- BlueGalaxy
- cinus
- DainAvenger
- dezalmado
- FrozenKiller
- kortana
- Magenik
- MATTYOne
- Novichok
- podpol
- qingqing
- Robyson
- sunbsn
- VNickXXL on github
- WIZARDMASTER
- yecgaaj

testing / bug reports:
- topaz
- lorendur
- Taylory

And of course a huge thank you to MentaL for this site that brought us all together and allows us to collaborate.

—————————————————————————————————————

This source is based on an Encom release, and their code was adapted from Aion-Lightning. We are not removing any credits from the source, and if anyone has further credits that were removed before, we would be happy to add them back in.
We are just trying to make as many improvements/fixes as we can and share it with everyone, while giving proper credit for all the work done before.

This thread was created in "Aion Development" for a reason. We need people who can actually create fixes, help troubleshoot, or provide detailed bug reports. We asssume that you have at least a basic understanding of:

- compiling the source
- configuring the server to run for testing purposes
- how emulators work

There's are tons of tutorials in the forums that have everything you need to learn this. I am by no means a pro coder or developer. Everything I know about setting up emulators I learned from information on this website. If you do not possess that knowledge, don't want to educate yourself, and just want to play the game, that's ok, but you should just stick with Robson's original release for now. All of his releases are easy to set up and amongst the most bug-free that are publicly shared.

Any questions you have about setting up an emulator or errors you get that are not specifically code bugs should be asked in the help section, not here.
 
Last edited:
Newbie Spellweaver
Joined
Mar 7, 2022
Messages
56
Reaction score
100
Thank you all very much, there are still people continuing this work on version 5.8.

I've started testing with this emulator and have asked some friends to join in and hopefully follow up with some more help.

I'll also provide some fixes later on that I know will make the emulator better.

Let me start with the 2 fixes I know of.
1. the sell item issue in the carry-on store. (CM_BUY_ITEM.java)
In the item panel, selling items doesn't work.

Java:
package com.aionemu.gameserver.network.aion.clientpackets;

import com.aionemu.gameserver.dataholders.DataManager;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.VisibleObject;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.templates.tradelist.TradeListTemplate;
import com.aionemu.gameserver.model.templates.tradelist.TradeNpcType;
import com.aionemu.gameserver.model.trade.RepurchaseList;
import com.aionemu.gameserver.model.trade.TradeList;
import com.aionemu.gameserver.network.aion.AionClientPacket;
import com.aionemu.gameserver.network.aion.AionConnection.State;
import com.aionemu.gameserver.services.PrivateStoreService;
import com.aionemu.gameserver.services.RepurchaseService;
import com.aionemu.gameserver.services.TradeService;
import com.aionemu.gameserver.utils.audit.AuditLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CM_BUY_ITEM extends AionClientPacket
{
    private static final Logger log = LoggerFactory.getLogger(CM_BUY_ITEM.class);
    private int sellerObjId;
    private int tradeActionId;
    private int amount;
    private int itemId;
    private long count;
    private boolean isAudit;
    private TradeList tradeList;
    private RepurchaseList repurchaseList;
   
    public CM_BUY_ITEM(int opcode, State state, State... restStates) {
        super(opcode, state, restStates);
    }
   
    @Override
    protected void readImpl() {
        Player player = getConnection().getActivePlayer();
        sellerObjId = readD();
        tradeActionId = readH();
        amount = readH();
        if (amount < 0 || amount > 36) {
            isAudit = true;
            AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM amount: " + amount);
            return;
        } if (tradeActionId == 2) {
            repurchaseList = new RepurchaseList(sellerObjId);
        } else {
            tradeList = new TradeList(sellerObjId);
        }
        for (int i = 0; i < amount; i++) {
            itemId = readD();
            count = readQ();
            if (count < 0 || (itemId <= 0 && tradeActionId != 0) || itemId == 190000073 || itemId == 190000074 || count > 20000) {
                isAudit = true;
                AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM item: " + itemId + " count: " + count);
                break;
            } switch (tradeActionId) {
                case 0: //[Private Store]
                case 1: //[Sell To Shop]
                case 17: //[Pet Seller]
                case 18: //Inventory Shop
                case 19: //Inventory to Shop x64
                     tradeList.addSellItem(itemId, count);
                break;
                case 2: //[Repurchase]
                    repurchaseList.addRepurchaseItem(player, itemId, count);
                break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    tradeList.addBuyItem(itemId, count);
                break;
            }
        }
    }
   
    @Override
    protected void runImpl() {
        Player player = getConnection().getActivePlayer();
        if (isAudit || player == null) {
            return;
        }
        VisibleObject target = player.getKnownList().getKnownObjects().get(sellerObjId);
        //added x64 enum
        if (tradeActionId != 18 && target == null && tradeActionId != 19) {
            return;
        } if (target instanceof Player && tradeActionId == 0) {
            Player targetPlayer = (Player) target;
            PrivateStoreService.sellStoreItem(targetPlayer, player, tradeList);
        } else if (target instanceof Npc) {
            Npc npc = (Npc) target;
            TradeListTemplate tlist = DataManager.TRADE_LIST_DATA.getTradeListTemplate(npc.getNpcId());
            TradeListTemplate purchaseTemplate = DataManager.TRADE_LIST_DATA.getPurchaseListTemplate(npc.getNpcId());
            switch (tradeActionId) {
                case 1: //Sell To Shop [Panesterra 4.7]
                    if (npc.getObjectTemplate().getTitleId() == 357001 || //Belus Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357002 || //Belus Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357013 || //Aspida Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357014 || //Aspida Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357025 || //Atanatos Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357026 || //Atanatos Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357037 || //Disilon Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357038 || //Disilon Abyss Equipment Merchand.
                        //Sell To Shop [Purchase List AP 4.3]
                        npc.getObjectTemplate().getTitleId() == 463209 ||
                        npc.getObjectTemplate().getTitleId() == 463222 ||
                        npc.getObjectTemplate().getTitleId() == 463224 ||
                        npc.getObjectTemplate().getTitleId() == 463230 ||
                        npc.getObjectTemplate().getTitleId() == 463491 ||
                        npc.getObjectTemplate().getTitleId() == 463492 ||
                        npc.getObjectTemplate().getTitleId() == 463493 ||
                        npc.getObjectTemplate().getTitleId() == 463495 ||
                        npc.getObjectTemplate().getTitleId() == 463628 ||
                        npc.getObjectTemplate().getTitleId() == 463648 ||
                        npc.getObjectTemplate().getTitleId() == 464194 ||
                        npc.getObjectTemplate().getTitleId() == 464201 ||
                        npc.getObjectTemplate().getTitleId() == 466388 ||
                        //Sell To Shop [Purchase List AP 4.8]
                        npc.getObjectTemplate().getTitleId() == 314357 || //Ancient Icon Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314358 || //Ancient Seal Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314359 || //Ancient Goblet Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314360 || //Ancient Crown Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 357852 ||
                        npc.getObjectTemplate().getTitleId() == 358081 ||
                        npc.getObjectTemplate().getTitleId() == 358082 ||
                        npc.getObjectTemplate().getTitleId() == 358083 ||
                        npc.getObjectTemplate().getTitleId() == 358086 ||
                        npc.getObjectTemplate().getTitleId() == 358096 ||
                        npc.getObjectTemplate().getTitleId() == 358100 ||
                        npc.getObjectTemplate().getTitleId() == 358113 ||
                        npc.getObjectTemplate().getTitleId() == 358114 ||
                        npc.getObjectTemplate().getTitleId() == 358510 || //Ancien Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 358540 || //Ancien Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 370408 || //Ancien Icon Custodian.
                        npc.getObjectTemplate().getTitleId() == 370409 || //Ancien Seal Custodian.
                        npc.getObjectTemplate().getTitleId() == 370410 || //Ancien Goblet Custodian.
                        npc.getObjectTemplate().getTitleId() == 370411 || //Ancien Crown Custodian.
                        //Sell To Shop [Purchase List AP 5.3/5.5]
                        npc.getObjectTemplate().getTitleId() == 468783) {
                        TradeService.performSellForAPToShop(player, tradeList, purchaseTemplate);
                    }
                    //Sell To Shop [Purchase List Kinah 4.3]
                    else if (npc.getObjectTemplate().getTitleId() == 463203 ||
                        npc.getObjectTemplate().getTitleId() == 463206 ||
                        npc.getObjectTemplate().getTitleId() == 463490) {
                        TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                    } else {
                        TradeService.performSellToShop(player, tradeList);
                    }
                break;
                case 2: //[Repurchase]
                    RepurchaseService.getInstance().repurchaseFromShop(player, repurchaseList);
                break;
                case 13: //[Buy From Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.NORMAL) {
                        TradeService.performBuyFromShop(npc, player, tradeList);
                    }
                break;
                case 14: //[Buy From Abyss Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.ABYSS) {
                        TradeService.performBuyFromAbyssShop(npc, player, tradeList);
                    }
                break;
                case 15: //[Buy From Reward Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.REWARD) {
                        TradeService.performBuyFromRewardShop(npc, player, tradeList);
                    }
                break;
                case 17: //[Pet Seller]
                    TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                break;
                default:
                    log.info(String.format("Unhandle shop action unk1: %d", tradeActionId));
                break;
            }
        } if (tradeActionId == 18 || tradeActionId == 19 ) { //Inventory Shop
            TradeService.performSellToShop(player, tradeList);
        }
    }
}

2, The issue of some humanoid npc's death status being abnormal (which may still be incorrect)
After defeating some humanoid npc, if you don't pick up the item, then after a while, or after you leave that npc for 100 yards, it may become incorrectly standing.

Java:
    @Override
    protected void writeImpl(AionConnection con) {
        writeF(_npc.getX());
        writeF(_npc.getY());
        writeF(_npc.getZ());
        writeD(_npc.getObjectId());
        writeD(npcId);
        writeD(npcId);
        //fix
        writeC(npcTypeId);
        if (_npc.getLifeStats().isAlreadyDead() && _npc.getState() == 47) {
            _npc.setState(39);
        }
        writeH(_npc.getState());
        writeC(_npc.getHeading());
        writeD(npcTemplate.getNameId());
        writeD(npcTemplate.getTitleId());
        writeH(0x00);
        writeC(0x00);
        writeD(0x00);

I learned these fixes from the internet and can't remember where or who they came from, so if the author sees them, please remind me and I'll revise them.
 
Last edited:
Joined
Sep 21, 2013
Messages
2,319
Reaction score
3,114
2, The issue of some humanoid npc's death status being abnormal (which may still be incorrect)
After defeating some humanoid npc, if you don't pick up the item, then after a while, or after you leave that npc for 100 yards, it may become incorrectly standing.

Java:
    @Override
    protected void writeImpl(AionConnection con) {
        writeF(_npc.getX());
        writeF(_npc.getY());
        writeF(_npc.getZ());
        writeD(_npc.getObjectId());
        writeD(npcId);
        writeD(npcId);
        //fix
        writeC(npcTypeId);
        if (_npc.getLifeStats().isAlreadyDead() && _npc.getState() == 47) {
            _npc.setState(39);
        }
        writeH(_npc.getState());
        writeC(_npc.getHeading());
        writeD(npcTemplate.getNameId());
        writeD(npcTemplate.getTitleId());
        writeH(0x00);
        writeC(0x00);
        writeD(0x00);

I learned these fixes from the internet and can't remember where or who they came from, so if the author sees them, please remind me and I'll revise them.
Just don't forget that this fix is in SM_NPC_INFO.java :ROFLMAO:
 
Junior Spellweaver
Joined
Mar 2, 2023
Messages
196
Reaction score
326
If someone has a desire, we can team up to work on the assembly. Private messages are always open :)
 
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144
If someone has a desire, we can team up to work on the assembly. Private messages are always open :)
Not private. I liked this issue of sharing the fixes as it helps everyone. I'm not a programmer and I don't understand anything about Java and other coding languages. I just like the game and I like fixing things to distract myself.
 
Joined
Dec 6, 2013
Messages
391
Reaction score
813
2, The issue of some humanoid npc's death status being abnormal (which may still be incorrect)
After defeating some humanoid npc, if you don't pick up the item, then after a while, or after you leave that npc for 100 yards, it may become incorrectly standing.
Thank you for sharing this, I had this on my issue list as well. In other games, we called this "T-posing" as the npc is just standing with their arms out, like a "T".

Not private. I liked this issue of sharing the fixes as it helps everyone. I'm not a programmer and I don't understand anything about Java and other coding languages. I just like the game and I like fixing things to distract myself.
Could you also share your source when you post an update? That way everyone who wants to contribute is working from the same latest version.


And if anyone can tell me how I can post twice in a row without them automatically merging into one like this, I would appreciate it.
 
Last edited:
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144

Thank you all very much, there are still people continuing this work on version 5.8.

I've started testing with this emulator and have asked some friends to join in and hopefully follow up with some more help.

I'll also provide some fixes later on that I know will make the emulator better.

Let me start with the 2 fixes I know of.
1. the sell item issue in the carry-on store. (CM_BUY_ITEM.java)
In the item panel, selling items doesn't work.

Java:
package com.aionemu.gameserver.network.aion.clientpackets;

import com.aionemu.gameserver.dataholders.DataManager;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.VisibleObject;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.templates.tradelist.TradeListTemplate;
import com.aionemu.gameserver.model.templates.tradelist.TradeNpcType;
import com.aionemu.gameserver.model.trade.RepurchaseList;
import com.aionemu.gameserver.model.trade.TradeList;
import com.aionemu.gameserver.network.aion.AionClientPacket;
import com.aionemu.gameserver.network.aion.AionConnection.State;
import com.aionemu.gameserver.services.PrivateStoreService;
import com.aionemu.gameserver.services.RepurchaseService;
import com.aionemu.gameserver.services.TradeService;
import com.aionemu.gameserver.utils.audit.AuditLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CM_BUY_ITEM extends AionClientPacket
{
    private static final Logger log = LoggerFactory.getLogger(CM_BUY_ITEM.class);
    private int sellerObjId;
    private int tradeActionId;
    private int amount;
    private int itemId;
    private long count;
    private boolean isAudit;
    private TradeList tradeList;
    private RepurchaseList repurchaseList;
  
    public CM_BUY_ITEM(int opcode, State state, State... restStates) {
        super(opcode, state, restStates);
    }
  
    @Override
    protected void readImpl() {
        Player player = getConnection().getActivePlayer();
        sellerObjId = readD();
        tradeActionId = readH();
        amount = readH();
        if (amount < 0 || amount > 36) {
            isAudit = true;
            AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM amount: " + amount);
            return;
        } if (tradeActionId == 2) {
            repurchaseList = new RepurchaseList(sellerObjId);
        } else {
            tradeList = new TradeList(sellerObjId);
        }
        for (int i = 0; i < amount; i++) {
            itemId = readD();
            count = readQ();
            if (count < 0 || (itemId <= 0 && tradeActionId != 0) || itemId == 190000073 || itemId == 190000074 || count > 20000) {
                isAudit = true;
                AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM item: " + itemId + " count: " + count);
                break;
            } switch (tradeActionId) {
                case 0: //[Private Store]
                case 1: //[Sell To Shop]
                case 17: //[Pet Seller]
                case 18: //Inventory Shop
                case 19: //Inventory to Shop x64
                     tradeList.addSellItem(itemId, count);
                break;
                case 2: //[Repurchase]
                    repurchaseList.addRepurchaseItem(player, itemId, count);
                break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    tradeList.addBuyItem(itemId, count);
                break;
            }
        }
    }
  
    @Override
    protected void runImpl() {
        Player player = getConnection().getActivePlayer();
        if (isAudit || player == null) {
            return;
        }
        VisibleObject target = player.getKnownList().getKnownObjects().get(sellerObjId);
        //added x64 enum
        if (tradeActionId != 18 && target == null && tradeActionId != 19) {
            return;
        } if (target instanceof Player && tradeActionId == 0) {
            Player targetPlayer = (Player) target;
            PrivateStoreService.sellStoreItem(targetPlayer, player, tradeList);
        } else if (target instanceof Npc) {
            Npc npc = (Npc) target;
            TradeListTemplate tlist = DataManager.TRADE_LIST_DATA.getTradeListTemplate(npc.getNpcId());
            TradeListTemplate purchaseTemplate = DataManager.TRADE_LIST_DATA.getPurchaseListTemplate(npc.getNpcId());
            switch (tradeActionId) {
                case 1: //Sell To Shop [Panesterra 4.7]
                    if (npc.getObjectTemplate().getTitleId() == 357001 || //Belus Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357002 || //Belus Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357013 || //Aspida Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357014 || //Aspida Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357025 || //Atanatos Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357026 || //Atanatos Abyss Equipment Merchand.
                        npc.getObjectTemplate().getTitleId() == 357037 || //Disilon Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 357038 || //Disilon Abyss Equipment Merchand.
                        //Sell To Shop [Purchase List AP 4.3]
                        npc.getObjectTemplate().getTitleId() == 463209 ||
                        npc.getObjectTemplate().getTitleId() == 463222 ||
                        npc.getObjectTemplate().getTitleId() == 463224 ||
                        npc.getObjectTemplate().getTitleId() == 463230 ||
                        npc.getObjectTemplate().getTitleId() == 463491 ||
                        npc.getObjectTemplate().getTitleId() == 463492 ||
                        npc.getObjectTemplate().getTitleId() == 463493 ||
                        npc.getObjectTemplate().getTitleId() == 463495 ||
                        npc.getObjectTemplate().getTitleId() == 463628 ||
                        npc.getObjectTemplate().getTitleId() == 463648 ||
                        npc.getObjectTemplate().getTitleId() == 464194 ||
                        npc.getObjectTemplate().getTitleId() == 464201 ||
                        npc.getObjectTemplate().getTitleId() == 466388 ||
                        //Sell To Shop [Purchase List AP 4.8]
                        npc.getObjectTemplate().getTitleId() == 314357 || //Ancient Icon Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314358 || //Ancient Seal Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314359 || //Ancient Goblet Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 314360 || //Ancient Crown Administration Officer.
                        npc.getObjectTemplate().getTitleId() == 357852 ||
                        npc.getObjectTemplate().getTitleId() == 358081 ||
                        npc.getObjectTemplate().getTitleId() == 358082 ||
                        npc.getObjectTemplate().getTitleId() == 358083 ||
                        npc.getObjectTemplate().getTitleId() == 358086 ||
                        npc.getObjectTemplate().getTitleId() == 358096 ||
                        npc.getObjectTemplate().getTitleId() == 358100 ||
                        npc.getObjectTemplate().getTitleId() == 358113 ||
                        npc.getObjectTemplate().getTitleId() == 358114 ||
                        npc.getObjectTemplate().getTitleId() == 358510 || //Ancien Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 358540 || //Ancien Relic Supervisor.
                        npc.getObjectTemplate().getTitleId() == 370408 || //Ancien Icon Custodian.
                        npc.getObjectTemplate().getTitleId() == 370409 || //Ancien Seal Custodian.
                        npc.getObjectTemplate().getTitleId() == 370410 || //Ancien Goblet Custodian.
                        npc.getObjectTemplate().getTitleId() == 370411 || //Ancien Crown Custodian.
                        //Sell To Shop [Purchase List AP 5.3/5.5]
                        npc.getObjectTemplate().getTitleId() == 468783) {
                        TradeService.performSellForAPToShop(player, tradeList, purchaseTemplate);
                    }
                    //Sell To Shop [Purchase List Kinah 4.3]
                    else if (npc.getObjectTemplate().getTitleId() == 463203 ||
                        npc.getObjectTemplate().getTitleId() == 463206 ||
                        npc.getObjectTemplate().getTitleId() == 463490) {
                        TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                    } else {
                        TradeService.performSellToShop(player, tradeList);
                    }
                break;
                case 2: //[Repurchase]
                    RepurchaseService.getInstance().repurchaseFromShop(player, repurchaseList);
                break;
                case 13: //[Buy From Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.NORMAL) {
                        TradeService.performBuyFromShop(npc, player, tradeList);
                    }
                break;
                case 14: //[Buy From Abyss Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.ABYSS) {
                        TradeService.performBuyFromAbyssShop(npc, player, tradeList);
                    }
                break;
                case 15: //[Buy From Reward Shop]
                    if (tlist != null && tlist.getTradeNpcType() == TradeNpcType.REWARD) {
                        TradeService.performBuyFromRewardShop(npc, player, tradeList);
                    }
                break;
                case 17: //[Pet Seller]
                    TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                break;
                default:
                    log.info(String.format("Unhandle shop action unk1: %d", tradeActionId));
                break;
            }
        } if (tradeActionId == 18 || tradeActionId == 19 ) { //Inventory Shop
            TradeService.performSellToShop(player, tradeList);
        }
    }
}

2, The issue of some humanoid npc's death status being abnormal (which may still be incorrect)
After defeating some humanoid npc, if you don't pick up the item, then after a while, or after you leave that npc for 100 yards, it may become incorrectly standing.

Java:
    @Override
    protected void writeImpl(AionConnection con) {
        writeF(_npc.getX());
        writeF(_npc.getY());
        writeF(_npc.getZ());
        writeD(_npc.getObjectId());
        writeD(npcId);
        writeD(npcId);
        //fix
        writeC(npcTypeId);
        if (_npc.getLifeStats().isAlreadyDead() && _npc.getState() == 47) {
            _npc.setState(39);
        }
        writeH(_npc.getState());
        writeC(_npc.getHeading());
        writeD(npcTemplate.getNameId());
        writeD(npcTemplate.getTitleId());
        writeH(0x00);
        writeC(0x00);
        writeD(0x00);

I learned these fixes from the internet and can't remember where or who they came from, so if the author sees them, please remind me and I'll revise them.
thank you very much for sharing here it is already with your changes that you sent the code.
 
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144
Here the files of all the corrections made so far in SVN.

Fix 1: "A Rabbit Out Of Water"This fix includes the code to correct the quest "A Rabbit Out Of Water" in which the animation of the frog following you was buggy, and the mission was considered complete before even reaching the location.
Fix 2: "DecomposeAction"This fix addresses the issue where players were unable to decompose more than one item in the box or choose a specific number of items to decompose from the box.
Fix 3: "Sale In Private Store"This fix resolves the problem related to selling items from your "private store" inventory.
Fix 4: "Anomaly With Humanoid NPC"This fix resolves the issue with Humanoid NPCs, where upon their defeat, if you walked away and returned to the location, they appeared with the standing animation as if they were still alive.
The rest of the corrections are performed directly on the Game Server file. These are additional elements such as missions, quests, events, event buff NPCs and other elements, the details of which I don't fully remember at this time. these are files for those who want to put the fix in their own svn.
 
Newbie Spellweaver
Joined
Sep 6, 2015
Messages
60
Reaction score
112
Robyson

Iam out of Aion for a long time but correct me if iam wrong but i don't think this isn't working in CM_BUY_ITEM

Java:
if (tradeActionId != 18 && target == null && tradeActionId != 19) {
    return;
}

I know its not your code but if i remember correct that won't work :O


I think it should be something like that

Java:
if (tradeActionId != 18 && target == null  || tradeActionId != 19 && target == null) {
    return;
}
 
Last edited:
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144
Robyson

Iam out of Aion for a long time but correct me if iam wrong but i don't think this is working in CM_BUY_ITEM

Java:
if (tradeActionId != 18 && target == null && tradeActionId != 19) {
    return;
}

I know its not your code but if i remember correct that won't work :O


I think it should be something like that

Java:
if (tradeActionId != 18 && target == null  || tradeActionId != 19 && target == null) {
    return;
}
when I found out, organize differently than you, but yours is better. ^^``
Code:
        if (tradeActionId == 19 && target == null) {
            TradeService.performSellToShop(player, tradeList); // Sell from Inventory
        }
Code:
        else if (tradeActionId == 18) {
            tradeList = new TradeList(0);
        }
It was these two parts that I managed to make the change in the encom when I changed it if I'm not mistaken but I took it from the emulator Aion_GER_5.8_rev279_Full to apply it in the encom. but I also don't remember very well, but I remember that it's on the line where there's number 18 and number 19 on the ecom it was like this.
Code:
        } if (tradeActionId == 18) { //Inventory Shop
            TradeService.performSellToShop(player, tradeList);
        }
Code:
        VisibleObject target = player.getKnownList().getKnownObjects().get(sellerObjId);
        if (tradeActionId != 18 && target == null) {
            return;
there was no line with 19 so I added the line with 19 to the aion "Aion_GER_5.8_rev279_Full"
 
Newbie Spellweaver
Joined
Sep 6, 2015
Messages
60
Reaction score
112
Java:
package com.aionemu.gameserver.network.aion.clientpackets;

import com.aionemu.gameserver.dataholders.DataManager;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.VisibleObject;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.templates.tradelist.TradeListTemplate;
import com.aionemu.gameserver.model.templates.tradelist.TradeNpcType;
import com.aionemu.gameserver.model.trade.RepurchaseList;
import com.aionemu.gameserver.model.trade.TradeList;
import com.aionemu.gameserver.network.aion.AionClientPacket;
import com.aionemu.gameserver.network.aion.AionConnection.State;
import com.aionemu.gameserver.services.PrivateStoreService;
import com.aionemu.gameserver.services.RepurchaseService;
import com.aionemu.gameserver.services.TradeService;
import com.aionemu.gameserver.utils.audit.AuditLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CM_BUY_ITEM extends AionClientPacket
{
    private static final Logger log = LoggerFactory.getLogger(CM_BUY_ITEM.class);
    private int sellerObjId;
    private int tradeActionId;
    private int amount;
    private int itemId;
    private long count;
    private boolean isAudit;
    private TradeList tradeList;
    private RepurchaseList repurchaseList;
   
    public CM_BUY_ITEM(int opcode, State state, State... restStates) {
        super(opcode, state, restStates);
    }
   
    @Override
    protected void readImpl() {
        Player player = getConnection().getActivePlayer();
        sellerObjId = readD();
        tradeActionId = readH();
        amount = readH();
        
        if (amount < 0 || amount > 36) {
            isAudit = true;
            AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM amount: " + amount);
            return;
        }
        
        tradeActionId == 2 ? repurchaseList = new RepurchaseList(sellerObjId) : tradeList = new TradeList(sellerObjId);
        
        for (int i = 0; i < amount; i++) {
            itemId = readD();
            count = readQ();
            
            if (count < 0 || (itemId <= 0 && tradeActionId != 0) || itemId == 190000073 || itemId == 190000074 || count > 20000) {
                isAudit = true;
                AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM item: " + itemId + " count: " + count);
                return;
            }

            switch (tradeActionId) {
                case 0:  //[Private Store]
                case 1:  //[Sell To Shop]
                case 17: //[Pet Seller]
                case 18: //Inventory Shop
                case 19: //Inventory to Shop x64
                    tradeList.addSellItem(itemId, count);
                    break;
                case 2:  //[Repurchase]
                    repurchaseList.addRepurchaseItem(player, itemId, count);
                    break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    tradeList.addBuyItem(itemId, count);
                    break;
                default:
                    isAudit = true;
                    AuditLogger.info(player, "Unknown TradeActionId: " + tradeActionId);
                    break;
            }
        }
    }
   
    @Override
    protected void runImpl() {
        Player player = getConnection().getActivePlayer();
        if (isAudit || player == null) {
            return;
        }
        VisibleObject target = player.getKnownList().getKnownObjects().get(sellerObjId);
        //added x64 enum
        if (tradeActionId != 18 && target == null || tradeActionId != 19 && target == null) {
            return;
        }

        if (target instanceof Player && tradeActionId == 0) {
            Player targetPlayer = (Player) target;
            PrivateStoreService.sellStoreItem(targetPlayer, player, tradeList);
        } else if (target instanceof Npc) {
            Npc npc = (Npc) target;
            TradeListTemplate tlist = DataManager.TRADE_LIST_DATA.getTradeListTemplate(npc.getNpcId());
            TradeListTemplate purchaseTemplate = DataManager.TRADE_LIST_DATA.getPurchaseListTemplate(npc.getNpcId());
            
            switch (tradeActionId) {
                case 1: //Sell To Shop [Panesterra 4.7]
                    switch (npc.getObjectTemplate().getTitleId()) {
                        case 357001:
                        case 357001: //Belus Relic Supervisor.
                        case 357002: //Belus Abyss Equipment Merchand.
                        case 357013: //Aspida Relic Supervisor.
                        case 357014: //Aspida Abyss Equipment Merchand.
                        case 357025: //Atanatos Relic Supervisor.
                        case 357026: //Atanatos Abyss Equipment Merchand.
                        case 357037: //Disilon Relic Supervisor.
                        case 357038: //Disilon Abyss Equipment Merchand.
                        //Sell To Shop [Purchase List AP 4.3]
                        case 463209: 
                        case 463222: 
                        case 463224: 
                        case 463230: 
                        case 463491: 
                        case 463492: 
                        case 463493: 
                        case 463495: 
                        case 463628: 
                        case 463648: 
                        case 464194: 
                        case 464201: 
                        case 466388: 
                        //Sell To Shop [Purchase List AP 4.8]
                        case 314357: //Ancient Icon Administration Officer.
                        case 314358: //Ancient Seal Administration Officer.
                        case 314359: //Ancient Goblet Administration Officer.
                        case 314360: //Ancient Crown Administration Officer.
                        case 357852: 
                        case 358081: 
                        case 358082: 
                        case 358083: 
                        case 358086: 
                        case 358096: 
                        case 358100: 
                        case 358113: 
                        case 358114: 
                        case 358510: //Ancien Relic Supervisor.
                        case 358540: //Ancien Relic Supervisor.
                        case 370408: //Ancien Icon Custodian.
                        case 370409: //Ancien Seal Custodian.
                        case 370410: //Ancien Goblet Custodian.
                        case 370411: //Ancien Crown Custodian.
                        //Sell To Shop [Purchase List AP 5.3/5.5]
                        case 468783:
                            TradeService.performSellForAPToShop(player, tradeList, purchaseTemplate);
                            break;
                        //Sell To Shop [Purchase List Kinah 4.3]
                        case 463203: 
                        case 463206:
                        case 463490:
                            TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                            break;
                        default:
                            TradeService.performSellToShop(player, tradeList);
                            break;
                    }
                    break;
                case 2: //[Repurchase]
                    RepurchaseService.getInstance().repurchaseFromShop(player, repurchaseList);
                    break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    if (tlist != null) {
                        switch (tlist.getTradeNpcType()) {
                            case NORMAL:
                                TradeService.performBuyFromShop(npc, player, tradeList);
                                break;
                            case ABYSS:
                                TradeService.performBuyFromAbyssShop(npc, player, tradeList);
                                break;
                            case REWARD:
                                TradeService.performBuyFromRewardShop(npc, player, tradeList);
                                break;
                            default:
                                break;
                        }
                    }
                    break;
                case 17: //[Pet Seller]
                    TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                    break;
                case 18:
                case 19:
                    TradeService.performSellToShop(player, tradeList);  
                    break;
                default:
                    log.info(String.format("Unhandle shop action unk1: %d", tradeActionId));
                    break;
            }
        }
    }
}

Some small cleanup for the eyes ^^
But its untested and could be wrong in case 15:

Can't remember if it has to be case TradeNpcType.NORMAL or simply case NORMAL: etc ^^
 
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144
Java:
package com.aionemu.gameserver.network.aion.clientpackets;

import com.aionemu.gameserver.dataholders.DataManager;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.VisibleObject;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.templates.tradelist.TradeListTemplate;
import com.aionemu.gameserver.model.templates.tradelist.TradeNpcType;
import com.aionemu.gameserver.model.trade.RepurchaseList;
import com.aionemu.gameserver.model.trade.TradeList;
import com.aionemu.gameserver.network.aion.AionClientPacket;
import com.aionemu.gameserver.network.aion.AionConnection.State;
import com.aionemu.gameserver.services.PrivateStoreService;
import com.aionemu.gameserver.services.RepurchaseService;
import com.aionemu.gameserver.services.TradeService;
import com.aionemu.gameserver.utils.audit.AuditLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CM_BUY_ITEM extends AionClientPacket
{
    private static final Logger log = LoggerFactory.getLogger(CM_BUY_ITEM.class);
    private int sellerObjId;
    private int tradeActionId;
    private int amount;
    private int itemId;
    private long count;
    private boolean isAudit;
    private TradeList tradeList;
    private RepurchaseList repurchaseList;
  
    public CM_BUY_ITEM(int opcode, State state, State... restStates) {
        super(opcode, state, restStates);
    }
  
    @Override
    protected void readImpl() {
        Player player = getConnection().getActivePlayer();
        sellerObjId = readD();
        tradeActionId = readH();
        amount = readH();
       
        if (amount < 0 || amount > 36) {
            isAudit = true;
            AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM amount: " + amount);
            return;
        }
       
        tradeActionId == 2 ? repurchaseList = new RepurchaseList(sellerObjId) : tradeList = new TradeList(sellerObjId);
       
        for (int i = 0; i < amount; i++) {
            itemId = readD();
            count = readQ();
           
            if (count < 0 || (itemId <= 0 && tradeActionId != 0) || itemId == 190000073 || itemId == 190000074 || count > 20000) {
                isAudit = true;
                AuditLogger.info(player, "Player might be abusing CM_BUY_ITEM item: " + itemId + " count: " + count);
                return;
            }

            switch (tradeActionId) {
                case 0:  //[Private Store]
                case 1:  //[Sell To Shop]
                case 17: //[Pet Seller]
                case 18: //Inventory Shop
                case 19: //Inventory to Shop x64
                    tradeList.addSellItem(itemId, count);
                    break;
                case 2:  //[Repurchase]
                    repurchaseList.addRepurchaseItem(player, itemId, count);
                    break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    tradeList.addBuyItem(itemId, count);
                    break;
                default:
                    isAudit = true;
                    AuditLogger.info(player, "Unknown TradeActionId: " + tradeActionId);
                    break;
            }
        }
    }
  
    @Override
    protected void runImpl() {
        Player player = getConnection().getActivePlayer();
        if (isAudit || player == null) {
            return;
        }
        VisibleObject target = player.getKnownList().getKnownObjects().get(sellerObjId);
        //added x64 enum
        if (tradeActionId != 18 && target == null || tradeActionId != 19 && target == null) {
            return;
        }

        if (target instanceof Player && tradeActionId == 0) {
            Player targetPlayer = (Player) target;
            PrivateStoreService.sellStoreItem(targetPlayer, player, tradeList);
        } else if (target instanceof Npc) {
            Npc npc = (Npc) target;
            TradeListTemplate tlist = DataManager.TRADE_LIST_DATA.getTradeListTemplate(npc.getNpcId());
            TradeListTemplate purchaseTemplate = DataManager.TRADE_LIST_DATA.getPurchaseListTemplate(npc.getNpcId());
           
            switch (tradeActionId) {
                case 1: //Sell To Shop [Panesterra 4.7]
                    switch (npc.getObjectTemplate().getTitleId()) {
                        case 357001:
                        case 357001: //Belus Relic Supervisor.
                        case 357002: //Belus Abyss Equipment Merchand.
                        case 357013: //Aspida Relic Supervisor.
                        case 357014: //Aspida Abyss Equipment Merchand.
                        case 357025: //Atanatos Relic Supervisor.
                        case 357026: //Atanatos Abyss Equipment Merchand.
                        case 357037: //Disilon Relic Supervisor.
                        case 357038: //Disilon Abyss Equipment Merchand.
                        //Sell To Shop [Purchase List AP 4.3]
                        case 463209:
                        case 463222:
                        case 463224:
                        case 463230:
                        case 463491:
                        case 463492:
                        case 463493:
                        case 463495:
                        case 463628:
                        case 463648:
                        case 464194:
                        case 464201:
                        case 466388:
                        //Sell To Shop [Purchase List AP 4.8]
                        case 314357: //Ancient Icon Administration Officer.
                        case 314358: //Ancient Seal Administration Officer.
                        case 314359: //Ancient Goblet Administration Officer.
                        case 314360: //Ancient Crown Administration Officer.
                        case 357852:
                        case 358081:
                        case 358082:
                        case 358083:
                        case 358086:
                        case 358096:
                        case 358100:
                        case 358113:
                        case 358114:
                        case 358510: //Ancien Relic Supervisor.
                        case 358540: //Ancien Relic Supervisor.
                        case 370408: //Ancien Icon Custodian.
                        case 370409: //Ancien Seal Custodian.
                        case 370410: //Ancien Goblet Custodian.
                        case 370411: //Ancien Crown Custodian.
                        //Sell To Shop [Purchase List AP 5.3/5.5]
                        case 468783:
                            TradeService.performSellForAPToShop(player, tradeList, purchaseTemplate);
                            break;
                        //Sell To Shop [Purchase List Kinah 4.3]
                        case 463203:
                        case 463206:
                        case 463490:
                            TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                            break;
                        default:
                            TradeService.performSellToShop(player, tradeList);
                            break;
                    }
                    break;
                case 2: //[Repurchase]
                    RepurchaseService.getInstance().repurchaseFromShop(player, repurchaseList);
                    break;
                case 13: //[Buy From Shop]
                case 14: //[Buy From Abyss Shop]
                case 15: //[Buy From Reward Shop]
                    if (tlist != null) {
                        switch (tlist.getTradeNpcType()) {
                            case NORMAL:
                                TradeService.performBuyFromShop(npc, player, tradeList);
                                break;
                            case ABYSS:
                                TradeService.performBuyFromAbyssShop(npc, player, tradeList);
                                break;
                            case REWARD:
                                TradeService.performBuyFromRewardShop(npc, player, tradeList);
                                break;
                            default:
                                break;
                        }
                    }
                    break;
                case 17: //[Pet Seller]
                    TradeService.performSellForKinahToShop(player, tradeList, purchaseTemplate);
                    break;
                case 18:
                case 19:
                    TradeService.performSellToShop(player, tradeList); 
                    break;
                default:
                    log.info(String.format("Unhandle shop action unk1: %d", tradeActionId));
                    break;
            }
        }
    }
}

Some small cleanup for the eyes ^^
But its untested and could be wrong in case 15:

Can't remember if it has to be case TradeNpcType.NORMAL or simply case NORMAL: etc ^^
When you have some time, take a look at the "Decomposition" file. I still have doubts, as I want some packages, the animation does not show when "decomposing", but at least it is working when selecting a number "X" when decomposing.
 
Joined
Sep 21, 2013
Messages
2,319
Reaction score
3,114
Robyson

Iam out of Aion for a long time but correct me if iam wrong but i don't think this isn't working in CM_BUY_ITEM

Java:
if (tradeActionId != 18 && target == null && tradeActionId != 19) {
    return;
}

I know its not your code but if i remember correct that won't work :O


I think it should be something like that

Java:
if (tradeActionId != 18 && target == null  || tradeActionId != 19 && target == null) {
    return;
}
Hello my friend FrozenKiller!! How long has it been since we've spoken?
Good Times of AionGer ;) How are you doing? Hope all is well with you and family.

I tested with both, but this one is working better...
Java:
if (tradeActionId != 18 && target == null && tradeActionId != 19) {
    return;
}
 
Newbie Spellweaver
Joined
Sep 6, 2015
Messages
60
Reaction score
112
dezalmado

did you check if the parameters for SM_ITEM_USAGE_ANIMATION is sent in the correct order ?

It should be:

playerObjId, targetObjId, itemObjId, itemId, time, animationsId

A long time ago Falke and me had similar problems with AionGer and the parameter was sent in the wrong order.

Robyson

Hello my friend FrozenKiller!! How long has it been since we've spoken?
Good Times of AionGer ;) How are you doing? Hope all is well with you and family.

I tested with both, but this one is working better...
Java:
if (tradeActionId != 18 && target == null && tradeActionId != 19) {
    return;
}

tradeActionId != 18 && target == null && tradeActionId != 19
this cant work because tradeActionId is only send once so it can't be !=18 and !=19 ^^ :p

Yes long time Ago but still alive and nearly daily watching your work and help here xD
How about you everything OK ?
 
Joined
Oct 5, 2018
Messages
774
Reaction score
1,144
dezalmado

did you check if the parameters for SM_ITEM_USAGE_ANIMATION is sent in the correct order ?

It should be:

playerObjId, targetObjId, itemObjId, itemId, time, animationsId

A long time ago Falke and me had similar problems with AionGer and the parameter was sent in the wrong order.




this cant work because tradeActionId is only send once so it can't be !=18 and !=19 ^^ :p

Yes long time Ago but still alive and nearly daily watching your work and help here xD
How about you everything OK ?
I haven't checked yet I'll take a look.
 
Joined
Sep 21, 2013
Messages
2,319
Reaction score
3,114
this cant work because tradeActionId is only send once so it can't be !=18 and !=19 ^^ :p

Yes long time Ago but still alive and nearly daily watching your work and help here xD
How about you everything OK ?
Hello!! Yes i'm fine ;)

Yes it's working, using bin32 or bin64...
aion_tets - Aion 5.8 emulator improvement community project - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Back
Top