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!

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

Newbie Spellweaver
Joined
Feb 3, 2018
Messages
47
Reaction score
16
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 [SUB]​x, [/SUB]amount is [SUB]x[/SUB].

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:
Luicy - Changing a currency packet--.. content? Plus Emulator. - RaGEZONE Forums
If you yet don't understand my issue, I want simply that the 205 ([SUP]x[/SUP]) is displayed as: [SUB]x[/SUB] / [SUB]y[/SUB]. [SUB]X[/SUB] being current experience points amount, [SUP]y[/SUP] being for example 1000, 2000, 3000 - the amount of experience points they require for the next level. How can this be achieved?


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



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:
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:HabboToolbar, param2:§_-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:int, param2: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?
 
Back
Top