Changing a currency packet--.. content? Plus Emulator.

Results 1 to 2 of 2
  1. #1
    Enthusiast Luicy is offline
    MemberRank
    Feb 2018 Join Date
    47Posts

    Changing a currency packet--.. content? Plus Emulator.

    Hi,

    so I've just gotten back to retros and C# and I'm now trying to implement a "level/experience points" feature, only thing is that, at this very specific section I'm at now, I've gotten stuck at. What I'm trying to do is be able to send a packet with information of that currency is ​x, amount is x.

    That's something I've already managed to do, and it's working fine. The issue I'm having is that what I want to do is display the experience points together with a slash and then the amount of experience points they require to have before they level up. This is basically how it looks clientsidely right now:
    Spoiler:
    If you yet don't understand my issue, I want simply that the 205 (x) is displayed as: x / y. X being current experience points amount, y being for example 1000, 2000, 3000 - the amount of experience points they require for the next level. How can this be achieved?


    PHP Code:
    namespace Plus.Communication.Packets.Outgoing.Inventory.Purse
    {
        class 
    HabboActivityPointNotificationComposer ServerPacket
        
    {
            public 
    HabboActivityPointNotificationComposer(int Balanceint Notifint currencyType 0)
                : 
    base(ServerPacketHeader.HabboActivityPointNotificationMessageComposer)
            {
                
    base.WriteInteger(Balance);
                
    base.WriteInteger(Notif);
                
    base.WriteInteger(currencyType);
            }
        }

    - - - Updated - - -

    So I managed to find the associated ActionScript code related to this area, however when I attempt to save and compile the code, the client crashes upon hotel view loading.

    PHP Code:
    package §_-2ST§
    {
       
    import §_-0Qu§.§_-6kX§;
       
    import §_-1Cg§.HabboToolbar;
       
    import §_-1Cg§.§_-0ck§;
       
    import §_-1Cg§.§_-55V§;
       
    import §_-1lq§.ICoreLocalizationManager;
       
    import §_-3pm§.§_-2Iy§;
       
    import §_-3pm§.§_-6Dw§;
       
    import §_-59z§.§_-1Uy§;
       
    import §_-5Xu§.§_-2P1§;
       
    import §_-5ts§.CurrencyIndicatorBase;
       
    import §_-OK§.WindowMouseEvent;
       
    import flash.events.IEventDispatcher;
       
       public class 
    §_-5ZG§ extends CurrencyIndicatorBase
       
    {
          
          private static const 
    §_-Iq§:uint 4286084205;
          
          private static const 
    §_-520§:uint 4283781966;
          
          private static const 
    §_-4Nc§:Array = ["toolbar_credit_icon_0","toolbar_credit_icon_1","toolbar_credit_icon_2","toolbar_credit_icon_1","toolbar_credit_icon_0"];
           
          
          private var 
    §_-rS§:§_-2P1§;
          
          private var 
    §_-4Q7§:int = -1;
          
          private var 
    §_-By§:HabboToolbar;
          
          public function 
    §_-5ZG§(param1:HabboToolbarparam2:§_-6kX§param3:§_-1Uy§param4:§_-2P1§param5:ICoreLocalizationManager)
          {
             
    super(param2,param3);
             
    this.§_-By§ param1;
             
    this.§_-rS§ param4;
             
    this.§_-1SR§ §_-Iq§;
             
    this.§_-v4§ §_-520§;
             
    this.§_-480§ "amount";
             
    this.§_-4n-§ param5.getLocalization("purse.snowflakes.zero.amount.text","Info");
             
    createWindow("purse_indicator_seasonal_xml",null);
             
    window.findChildByName("seasonal_icon").style §_-6Dw§.§_-3p§(this.§_-6ja§(),param1,true);
             
    this.setAmount(0);
             
    param1.extensionView.attachExtension(§_-0ck§.§_-em§,window,§_-55V§.§_-07i§);
             
    this.registerUpdateEvents(param4.events);
          }
          
          private function 
    §_-6ja§() : int
          
    {
             return 
    this.§_-By§.getInteger("seasonalcurrencyindicator.currency",1);
          }
          
          private function 
    §_-3vP§() : String
          
    {
             return 
    this.§_-By§.getProperty("seasonalcurrencyindicator.page");
          }
          
          
    override public function registerUpdateEvents(k:IEventDispatcher) : void
          
    {
             if(!
    k)
             {
                return;
             }
             
    k.addEventListener(§_-2Iy§.§_-164§,this.§_-3aG§);
          }
          
          
    override protected function onContainerClick(k:WindowMouseEvent) : void
          
    {
             
    this.§_-rS§.openCatalogPage(this.§_-3vP§());
          }
          
          public function 
    §_-3aG§(k:§_-2Iy§) : void
          
    {
             if(
    k.activityPointType == this.§_-6ja§())
             {
                
    this.setAmount(k.balance);
                if(
    this.§_-4Q7§ != -1)
                {
                   
    §_-5AF§(this.§_-4Q7§,k.balance);
                }
                
    this.§_-4Q7§ k.balance;
             }
          }
          
          
    override protected function setAmount(param1:intparam2:int = -1) : void
          
    {
             var 
    _loc3_:String param1.toString();
             if(
    param1 == 0)
             {
                
    _loc3_ this.§_-4n-§;
                
    §_-1vp§(true);
             }
             else
             {
                
    §_-1vp§(false);
             }
             
    §_-0iP§(_loc3_);
          }
       }

    The important function in this snip is-
    Code:
    override protected function setAmount(param1:int, param2:int = -1) : void
    And
    Code:
    var _loc3_:String = param1.toString();
    However I'm not able to change a single line without the client crashing upon load, even though the AS is fine. Any suggestions?


  2. #2
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: Changing a currency packet--.. content? Plus Emulator.

    Try using jpex.

    What you want is going to be a pain in the ass to implement though and I don't really have a straight answer to what you need to modify.

    Its easy to replace an existing currency. Its a pain in the ass to add a new one, let alone add a new bar to the list.



Advertisement