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!

Butterfly RP

Status
Not open for further replies.
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Butterfly RP is a roleplay emulator based on Butterfly r96c.

I have already coded a lot of stuff for this emulator and have it running on my public hotel for testing. It is far from finished.

Here are the current features and related poop, there are a lot so sorry if I forget any:

  1. Saving user room on log out
  2. Saving user coordinates on log out
  3. Placing user in the same square and room they logged off on and in, when logging on again
  4. Pathfinder issues addressed and fixed
  5. Hitting system
  6. Dynamic weaponry system, with both melee and ranged weapon support and ability to add/remove weapons in seconds
  7. Dynamic job system
  8. Timer tracking
  9. Arrest warrant system
  10. Prison system
  11. Taxi system
  12. Hospital system
  13. Police system
  14. Drugs system (drugs act as powerups, eg. heal user, give advantages in battle)
  15. MDMA, Cocaine, Marijuana & Heroin (see 14.)
  16. Hiring, Promoting, Demoting & Firing for corporation managers/owners
  17. 911 system
  18. Banking system (withdrawals and deposits)
  19. ATM money machine withdrawals
  20. Pay money to other players
  21. Ammo for weapons, not unlimited ammo like other rp emulators
  22. Reloading for weapons, unlike other emulators
  23. Fully dynamic gang system, with in-game badge display linked up to CMS via mus also
  24. Marriage system
  25. Sex (satire mainly, but also heals you to maximum health)
  26. Strength levels (higher the str, higher you hit when you're using fists)
  27. Defence levels (higher the def, the higher your max hit points)
  28. Agility levels (higher the agil, the more chance you have to dodge attacks)
  29. Dynamic property system, users can buy from the government then sell and buy from each other
  30. Bank robbery system
  31. Ability to pay bail whilst in prison
  32. Bounty system
  33. UNIQUE: Zombie infection mode
  34. Ability to gamble at slot machines
  35. Weapon attachments (Red dot increases range, FMJ increases damage, Fast mags reduces reload time)

Screenshots

  1. Statistics (1):
  2. Statistics (2):
  3. Statistics (3):
  4. Slot machines:
  5. ask for more or play to see for yourself

Code snippets

Code:
        internal void SetBounty()
        {
            if (Params.Length >= 1)
            {
                int Amount;
                string User = Params[1].ToString();


                if (Session.GetHabbo().PlacedBountyTrigger)
                {
                    TimeSpan SinceLastBounty = DateTime.Now - Session.GetHabbo().LastPlacedBountyAt;


                    if (SinceLastBounty.Minutes < 30)
                    {
                        Session.SendNotif("You can only place 1 bounty every 30 minutes.");
                        return;
                    }
                }


                if (Int32.TryParse(Params[2], out Amount))
                {
                    if (Amount < 250)
                    {
                        Session.SendNotif("You must place a bounty of at least $250.");
                        return;
                    }


                    GameClient Player = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(User);


                    if (Player != null && !ButterflyEnvironment.Bounties.ContainsKey(Player))
                    {
                        if (Session.GetHabbo().Credits >= Amount)
                        {
                            Session.GetHabbo().Credits -= Amount;
                            Session.GetHabbo().UpdateCreditsBalance();


                            ButterflyEnvironment.Bounties.Add(Player, Amount);


                            ServerMessage HotelAlert = new ServerMessage(808);
                            HotelAlert.AppendStringWithBreak("Message from the Agency");
                            HotelAlert.AppendStringWithBreak("A bounty of $" + Amount.ToString() + " has been placed on " + Player.GetHabbo().Username + "!");
                            ButterflyEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);


                            Session.GetHabbo().PlacedBountyTrigger = true;
                            Session.GetHabbo().LastPlacedBountyAt = DateTime.Now;
                        }
                    }
                }
            }
        }

Code:
internal void Taze()
        {
            bool IsPolice = (ButterflyEnvironment.PoliceCorporations.Contains(Session.GetHabbo().JobId)) ? true : false;


            if (IsPolice && Session.GetHabbo().JobRank > 0 && Session.GetHabbo().IsWorking || Session.GetHabbo().Rank >= 10)
            {
                string TargetUser = MergeParams(Params, 1);


                if (TargetUser == null)
                {
                    return;
                }


                Room TargetRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                GameClient Criminal = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(TargetUser);


                if (TargetRoom == null || Criminal == null)
                {
                    return;
                }


                if (ButterflyEnvironment.Warrants.ContainsKey(Criminal.GetHabbo().Id))
                {
                    RoomUser Rival = TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Criminal.GetHabbo().Id);
                    RoomUser Me = TargetRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);


                    if (Rival != null && Me != null)
                    {
                        if (Rival.GetClient().GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId &&
                            (Rival.X == Me.X - 3) || (Rival.X == Me.X + 3) || (Rival.Y == Me.Y - 3) || (Rival.Y == Me.Y + 3)
                            || (Rival.X == Me.X - 2) || (Rival.X == Me.X + 2) || (Rival.Y == Me.Y - 2) || (Rival.Y == Me.Y + 2)
                            || (Rival.X == Me.X - 1) || (Rival.X == Me.X + 1) || (Rival.Y == Me.Y - 1) || (Rival.Y == Me.Y + 1))
                        {
                            Rival.CanWalk = false;
                            Rival.TazedAt = DateTime.Now;
                            Rival.IsTazed = true;


                            Me.Chat(Session, "*Shoots a tazer at " + Criminal.GetHabbo().Username + ", stunning them*", true);
                            Criminal.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(53);
                        }
                        else
                        {
                            Me.Chat(Session, "*Shoots a tazer at " + Criminal.GetHabbo().Username + ", but misses them*", true);
                        }
                    }
                }
                else
                {
                    Session.SendNotif("You cannot taze users without an arrest warrant!");
                }
            }
        }

Code:
internal void Use()
        {
            string WhatToUse = MergeParams(Params, 1);


            if (WhatToUse != null)
            {
                switch (WhatToUse.ToLower())
                {
                    case "cocaine":
                        {
                            if (Session.GetHabbo().CocaineEffects || Session.GetHabbo().CocaineInventory < 1)
                                break;


                            Session.GetHabbo().CocaineInventory -= 1;
                            Session.GetHabbo().StartCocaineTimer();


                            break;
                        }


                    case "weed":
                        {
                            if (Session.GetHabbo().IsSmokingWeed || Session.GetHabbo().WeedInventory < 1)
                            {
                                break;
                            }


                            Session.GetHabbo().StartedSmokingAt = DateTime.Now;
                            Session.GetHabbo().IsSmokingWeed = true;
                            Session.GetHabbo().WeedInventory = Session.GetHabbo().WeedInventory - 1;
                            Session.GetHabbo().SmokingStage = 1;


                            Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username).Chat(Session, "*Lights up a blunt and starts smoking*", true);


                            break;
                        }


                    case "heroin":
                        {
                            if (Session.GetHabbo().HeroinInventory < 1 || Session.GetHabbo().HasHeroinEffects)
                            {
                                break;
                            }


                            RoomUser Me = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);


                            if (Me == null)
                                break;


                            Session.GetHabbo().HasHeroinEffects = true;
                            Session.GetHabbo().InjectedHeroinAt = DateTime.Now;
                            Session.GetHabbo().HitPoints += 75;
                            Session.GetHabbo().HeroinInventory -= 1;


                            Me.Chat(Session, "*Injects a dose of heroin*", true);
                            Me.ForceWhisper(Session, "You have injected heroin and your health has been boosted by 75 for 30 seconds.");


                            break;
                        }


                    default:
                        {
                            break;
                        }
                }


                return;
            }
        }

Basically every emulator out there for roleplay hotels suck, and the ones that are decent are buggy as hell. (anyone remember uber v1? lol)

This emulator is stable and doesn't have cpu spikes, or spikes of any kind for that matter.

I have been developing this for the last 5 or 6 months, hell, maybe even longer. My code might not be on-par, i have no clue. This was my first proper c# project and its the only one i'm interested in continuing, habbo-wise anyway.

I want to make this open source once I am finished, so any ideas you have for features will be appreciated. Things on the emu run fine right now so im not looking for any advice on making things run smoother.

Mostly everything is threaded, but not everything, some stuff still runs in the room user cycle but I've moved a lot of poop out of there 'cause it was crashing rooms. Issue is still there, but will continue moving stuff from there to the dedicated rp thread i got going on. As you can see in the last snippet, im still working on moving things to timers and threads.

This emu is super Ducking noob friendly, everything is modifiable via db or config file and requires no reboot to change values from the database, only from the config file.

My code is probably quite primitive to some of the better developers out there, but please do remember im a php developer by trade and im only really just starting to pick up c# properly.

I think thats everything.... rate... dont slate. Even though half of you are only here to be dicks (like myself 95% of the time - this is a serious thread so please stay serious)

Thanks for your time.
 
Last edited:
Retired
Loyal Member
Joined
May 5, 2007
Messages
497
Reaction score
665
What is this? And why are you even basing it on r96c
 
Experienced Elementalist
Joined
Jun 16, 2010
Messages
249
Reaction score
76
Best of luck. Can you post the link to your public test private server so we can experience the features you've currently implemented and offer feedback?
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
For the love of God, quit programming. Everything you touched either has backdoors, exploits or just messed up.

Any examples of your 'multi threading' approach?

Also clean up your algorithms. For example this can be simplified:

Code:
(Rival.X == Me.X - 3) || (Rival.X == Me.X + 3) || (Rival.Y == Me.Y - 3) || (Rival.Y == Me.Y + 3)
|| (Rival.X == Me.X - 2) || (Rival.X == Me.X + 2) || (Rival.Y == Me.Y - 2) || (Rival.Y == Me.Y + 2)
|| (Rival.X == Me.X - 1) || (Rival.X == Me.X + 1) || (Rival.Y == Me.Y - 1) || (Rival.Y == Me.Y + 1)

I have made simplified versions for atm machines and slot machines, i havent got around to working on the very first features i coded for this...

As for your other opinions, keep them to yourself.



Please for the love of god, change/fix up your pathfinder.

Not really an important issue at the moment, its butterflys stock pathfinder so ya.



What is this? And why are you even basing it on r96c

I'm basing it off r96c because its the most stable and reliable source i had at the time. Plus im used to it after having it for so long. And there was no way i was writing from scratch.



Best of luck. Can you post the link to your public test private server so we can experience the features you've currently implemented and offer feedback?

Shorty is correct. The test server is .
 
Last edited by a moderator:
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Funny how I'm trying to give you advise however it yet again shwos that you cannot take any critisism and don't want to improve yourself. I suggest you to have this thread removed as you don't want any feedback.

I listen to everyone that can communicate in a proper way.

I don't need you to tell me what I already know. You should have read this part of my OP:

My code is probably quite primitive to some of the better developers out there, but please do remember im a php developer by trade and im only really just starting to pick up c# properly.

And I have no plans of communicating with you in any sort of way, your opinions aren't needed, i'm only asking for ideas for features.
 
R.I.P Millercent
Loyal Member
Joined
Nov 6, 2012
Messages
2,230
Reaction score
314
Having working friend stream on a RP is actually a pretty good feature. Same with toll gates. You should make purchasable cars via catalogue then when using them (the enable) it enables fast walk as well so it's like you're driving.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Having working friend stream on a RP is actually a pretty good feature. Same with toll gates. You should make purchasable cars via catalogue then when using them (the enable) it enables fast walk as well so it's like you're driving.

Toll gates aren't needed on here, because if you're working, you have rights to toggle gates/furni but not move them around.

As for cars, I was thinking of taking a different approach. Making them visit a dealership to purchase, then instead of using a taxi they can use their car to travel to other rooms instantly, using fuel/gas for each trip and eventually needing to refuel the car.

I don't like the idea of using the enables for a couple of reasons, the first being that other emulators do this and I'm not interested in copying, and, the second being that the pixel cars look horrendous and newby.

Friend Stream could be cool, like an in-game facebook. I could do all that via the CMS though, I could make a lot more customizable things.

I've started developing a Housekeeping alongside this, which fully interacts with the Emulator via sockets. I'm using Bootstrap for it, too. Started to fall in love with it, even though I'm not a front-end developer.
 
Not so spooky...
Loyal Member
Joined
May 22, 2010
Messages
1,017
Reaction score
276
Nice dev jonteh, Will be interesting to see the full outcome of this dev, Looks great so far keep it up.

And idea if you did have the friendstream as a sort of (In game facebook) sort of thing you could maybe have something in game like the internet where people have to top up to use it.

(Not sure if this could be done)

But yeah as said before good luck
I for one shall be moving my hotel over to this once released. :)
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Nice dev jonteh, Will be interesting to see the full outcome of this dev, Looks great so far keep it up.

And idea if you did have the friendstream as a sort of (In game facebook) sort of thing you could maybe have something in game like the internet where people have to top up to use it.

(Not sure if this could be done)

But yeah as said before good luck
I for one shall be moving my hotel over to this once released. :)

Thanks. And yeah, I think other RPs have implemented cell phones etc to charge for pixels, but I don't really like that idea. Friend stream is a good one, though. Might have to do it.
 
R.I.P Millercent
Loyal Member
Joined
Nov 6, 2012
Messages
2,230
Reaction score
314
One thing I haven't seen is an RP where you walk in those clothe changing booths and it gives you a random outfit. The random outfits can be selected from pre-made setups in the database maybe?

Might also be handy if you fixed up the wired issues that r96 had (moving wired reset sometimes, some wired aren't coded) so room builders can make awesome rooms. Also, HC gifts. I remember Aaron doing it for PhoenixRP. They're cool on RP's especially if you make the Executice HC items the gifts. After x days get to pick out of x items then as time goes on you unlock more different gifts to choose from.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
One thing I haven't seen is an RP where you walk in those clothe changing booths and it gives you a random outfit. The random outfits can be selected from pre-made setups in the database maybe?

Might also be handy if you fixed up the wired issues that r96 had (moving wired reset sometimes, some wired aren't coded) so room builders can make awesome rooms. Also, HC gifts. I remember Aaron doing it for PhoenixRP. They're cool on RP's especially if you make the Executice HC items the gifts. After x days get to pick out of x items then as time goes on you unlock more different gifts to choose from.

HC has been removed in this Emulator, or at least, most functionality is removed and once your subscription expires, it auto renews you. I don't see the need for any sort of Habbo Club on a RP.

As for wired, it's not needed. When you taxi to a room, the Emulator handles it and moves you to a designated spot.

I want to make it so in order to furnish your property/house, you must visit a furniture store and make that the only room you can open the catalogue in. I think that would be cool.

As for the random outfits, what's the point? :p
 
Joined
Aug 24, 2012
Messages
603
Reaction score
300
Funny how I'm trying to give you advise however it yet again shwos that you cannot take any critisism and don't want to improve yourself. I suggest you to have this thread removed as you don't want any feedback.

I listen to everyone that can communicate in a proper way.

Can't take any criticism? Coming from you? Are you shitting me?
- Jonteh, nice project. Can't wait to see the outcome! :)
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547


I have coded vehicles as a replacement for using the taxi service, if you can afford it. Vehicle and gas prices are defined in the configuration file.

- code removed due to feature thiefs -

In a future update, I will make it only charge you for the gas you need to fill your tank, but as this feature will not be tested until Monday (when I update my hotel) I'm going to leave it as is.



I have actually decided to update my hotel with the latest build - cars seem to be working great.

I've also added the ability to purchase drinks and snacks from vending machines for $5 by double clicking them. If you health is below your max capacity, then it'll heal you 10 hit points, or to max health if you're less than 10 points from max hp.
 
Last edited:
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
You're here on a public forum. If you don't want opions to be given you shouldn't have posted this thread in the first place.

I'm here to give you tips on how I think you can improve the emulator and share ideas.

But i dont need your tips, you don't even play rp hotels so how would you know whats good for it? This is for those who are actually a part of a RP retro lol
 
Status
Not open for further replies.
Back
Top