Player Hangouts

Page 1 of 9 123456789 LastLast
Results 1 to 15 of 133
  1. #1
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Player Hangouts

    Yeah, I know, you're probably sick of all these instance releases, but they're fun for me :3

    Anyway, it basically gives players their own room for a certain amount of mesos.

    Changelog:
    Code:
    Version 1.0.0 - Lios. Initial Version
    Todo:
    Code:
    --+Add passwords.
    How to do it:

    First, create a file called playerHangout.js in your events folder in scripting. Put the following code in it:

    PHP Code:
    /**
    -- StoryBox JavaScript --------------------------------------------------------------------------------
        Hangout instances
    -- By ---------------------------------------------------------------------------------------------
        Lios of Storybox
        Ragezone Account: og.Lios
    -- Version Info -----------------------------------------------------------------------------------
        1.0 - Lios. First version.
    ---------------------------------------------------------------------------------------------------
    **/

    var eim;
    var 
    exitMap;
    var 
    instanceName;
    var 
    prh;
    var 
    exitMapNum 910000000;  //Edit this to whichever map you please.  Default is Free Market
    var HangoutMap;
    var 
    HangoutMapInt 920011200//Edit this to whichever map you would like the home to be. Default is OPQ End Map.
    function init(){
    instanceName "Hangout_";
    em.getIv().invokeFunction("setup",null);
    }

    function 
    setup(){
        
    exitMap em.getChannelServer().getMapFactory().getMap(exitMapNum); // exits to exitMapNum
        
    var eim em.newInstance(instanceName);        //These two lines are basically Worthless, as the default instance is never used. 
        
    return eim;                                    //However, we need to call an instance whenever initiating an event.
    }

    function 
    playerEntry(eimplayer){
    var 
    mostRecentRoom "Hangout_" em.getProperty("mRR");
    if(
    em.getInstance(mostRecentRoom) == null){
        
    em.newInstance(mostRecentRoom); //Only occurs when player makes a n
        
    }
        
    prh em.getInstance(mostRecentRoom);
        
    map prh.getMapInstance(HangoutMapInt);  //You may change this to any map you would like.
        
    player.changeMap(mapmap.getPortal(0));
    }

    function 
    playerDisconnected(eimplayer) {
                
    playerExit(eimplayer);
    }

    function 
    playerExit(eimplayer) {
        
    eim.unregisterPlayer(player);
        
    player.changeMap(exitMapexitMap.getPortal(0));
    }
    //For those dced
    function removePlayer(eimplayer) {
        
    eim.unregisterPlayer(player);
        
    player.getMap().removePlayer(player);
        
    player.setMap(exitMap);

    Save that and close it. Next, add the instance to world.properties. This should be simple.

    After that, stick this into any NPC you'd like. This will be your warper:
    PHP Code:
    var roomName;
    var 
    Pass;
    var 
    em;
    var 
    eim;
    var 
    lazy;
    var 
    cost 1000000//Cost of the hangout. Defaults to 1,000,000
    function start() { 
     
    status = -1
     
    action(100); 

    function 
    action(modetypeselection) { 
     if (
    mode == -1) { 
      
    cm.dispose(); 
     } else { 
      if (
    status >= && mode == 0) { 
       
    cm.sendOk("Ok, feel free to hang around!"); 
       
    cm.dispose(); 
       return; 
      } 
      if (
    mode == 1
       
    status++; 
      else 
       
    status--; 
      if (
    status == 0) { 
        
    cm.sendNext("Hey there! I'm in charge of #rPlayer Hangouts!#k"); 
        }else if(
    status == 1){
                
    cm.sendSimple("How may I help you?#b\r\n\r\n#L0#What are Player Hangouts About?#l\r\n#L1#I would like to create a room#l\r\n#L2#I would like to enter a room#l\r\n#k");
                }else if(
    status == 2){
                if(
    selection == 0){
                    
    cm.sendNext("Player hangouts are personalized rooms that allow you to hang out with friends. They're private places where you can have discussions with your friends and others. It costs #r" cost "#k Mesos to create a hangout, but once you leave the hangout, you can go back for free, so long as there isn't a server restart and you remember your room name!");
                    
    status 0;            
                }else if(
    selection == 1){
                    
    status 1336;
        
    cm.sendGetText("Please enter the name of the room you wish to create");
                }else{
                    
    cm.sendGetText("Please enter the name of the room you wish to enter");
                }
                }else if(
    status == 3){
                    
    roomName "Hangout_" cm.getText();
                    
    lazy cm.getText();
                    
    em cm.getEventManager("playerHangout");
                    
    teim em.getInstance(roomName);
                    if(
    teim == null){
                    
    cm.sendOk("Either you made a mistake, or that room doesn't exist! Try again.");
                    
    status 1;
                    }else{
                    
    cm.sendNext("Perfect! We'll be on our way!");
                    }
                }else if(
    status == 4){
                    
    eim em.getInstance("Hangout_");
                    
    em.setProperty("mRR"lazy);
                    
    eim.registerPlayer(cm.getChar());
                    
    cm.sendOk("All right! Have fun~!");
                    
    cm.dispose();
                }else if(
    status == 1337){
                
    em cm.getEventManager("playerHangout");
                    
    roomName cm.getText();
                    var 
    teim em.getInstance("Hangout_" roomName);
                    if(
    teim != null){
                    
    cm.sendOk("There's already a room with that name taken! Please enter another room name.");
                    
    status 0;
                    }else{
                        
    cm.sendAcceptDecline("Please confirm the following details:\r\n\r\nRoom Name: #r" roomName "#k\r\n\r\nCreating this room will cost #b" cost "#k mesos.\r\n\r\nNote: When giving your friends this information, remember that rooms are CaSe-sEnSiTiVe!\r\n\r\nDo you accept all information above?");
                    }
        }else if(
    status == 1338){
        
    em.setProperty("mRR"roomName);
        
    eim em.getInstance("Hangout_");
        if(
    eim == null){
        
    cm.sendOk("Something went wrong...");
        
    cm.dispose();
        }else{
        
    eim.registerPlayer(cm.getChar());
        
    cm.gainMeso(-cost);
        
    cm.sendOk("Have fun!");
        
    cm.dispose();
    }
        }
    }

    Save that and close that.

    Next, put the following NPC script in the NPC that is in your Hangout map.

    PHP Code:
    var status 0;

    function 
    start() {
        
    status = -1;
        
    action(100);
    }

    function 
    action(modetypeselection) {
        if (
    mode == -1) {
            
    cm.dispose();
        } else {
            if (
    mode == 0) {
                
    cm.sendOk("Alright, see you next time.");
                
    cm.dispose();
                return;
            }
            
    status++;
            if (
    status == 0) {
    cm.sendYesNo("Would you like to leave the player hangout?");    
        }else if(
    status == 1) {
    var 
    em cm.getEventManager("playerHangout");
    var 
    eim em.getInstance("Hangout_");
        
    eim.removePlayer(cm.getChar());
        
    cm.dispose();
            }
        }

    Save and Close.

    Restart the server and you should be good.

    I'm hoping by now you all know how to work with instances. I've commented the lines so that hopefully anyone who can analyze a script can learn to script themselves.

    Credits to myself on everything.

    Screen Shots:
    Spoiler:






    If you have any suggestions/questions/comments, please do make them!
    Just a note, this, along with most of my releases, are Storybox originals. If you plan to use them in a repack, please give credit to "Lios of Storybox"

    Thank you for using this release!

    Also, please post if you're planning to use this for your server. I like to know where my releases are going and if they're popular ;) <3
    Last edited by og.Lios; 27-12-08 at 06:13 AM. Reason: Added Screen Shots.


  2. #2
    Alpha Member Markii is offline
    MemberRank
    Nov 2008 Join Date
    NewyorkLocation
    1,917Posts

    Re: Player Hangouts

    lol Get freaky with a girl in there own Room

  3. #3
    Account Upgraded | Title Enabled! maplepuppet is offline
    MemberRank
    Nov 2008 Join Date
    New JerseyLocation
    905Posts

    Re: Player Hangouts

    Awsome release. Markii, I think it is a public room or something you pay for.
    Also a suggestion to people, you should add monster spawns to the map to make it worth the pay.

  4. #4
    Proficient Member -SakaeSushi- is offline
    MemberRank
    Dec 2008 Join Date
    N/ALocation
    165Posts

    Re: Player Hangouts

    nice job = ]

  5. #5
    Account Upgraded | Title Enabled! Mgssidley is offline
    MemberRank
    Apr 2008 Join Date
    443Posts

    Re: Player Hangouts

    Lawl, should make it so others can join a room but need to enter a password.

  6. #6
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Player Hangouts

    First I'm going to attempt to get passwords working. For some reason, it never thinks they're the right password even when they are. Anyway, I'll be adding in a mob spawning code and a few other optional codes too.

    EDIT: Yeah, look at the ToDo list for a list of things I'm going to add to it soon.

  7. #7
    Alpha Member Markii is offline
    MemberRank
    Nov 2008 Join Date
    NewyorkLocation
    1,917Posts

    Re: Player Hangouts

    Quote Originally Posted by maplepuppet View Post
    Awsome release. Markii, I think it is a public room or something you pay for.
    Also a suggestion to people, you should add monster spawns to the map to make it worth the pay.
    Its a room for 1 person only so it might be private

  8. #8
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Player Hangouts

    It's a room for multiple people. If another player knows the name of the room you're in, they can go to it.

    Added Screen Shots =]

  9. #9
    Account Upgraded | Title Enabled! Lanny is offline
    MemberRank
    Aug 2008 Join Date
    In your screen!Location
    399Posts

    Re: Player Hangouts

    Dayum bitch your on a release streak =O

  10. #10
    Account Upgraded | Title Enabled! ~_AustraliaMS_~ is offline
    MemberRank
    Aug 2008 Join Date
    AustraliaLocation
    663Posts

    Re: Player Hangouts

    nice release man!

  11. #11
    Account Upgraded | Title Enabled! Haiku01 is offline
    MemberRank
    Jul 2008 Join Date
    celtic.zapto.orgLocation
    437Posts

    Re: Player Hangouts

    Next, you shall turn it into a Player Home and allow a player to buy a different design of maps for there own choice and choose prices for them =P.

  12. #12
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Player Hangouts

    BAH YOU PEOPLE KEEP STEALING MY IDEAS D:

    Ahh well, so long as I complete them before someone else does...

    Haiku, I'm planning to do that after I finish the guild home script ;)

  13. #13
    Member dragonsin53 is offline
    MemberRank
    Sep 2008 Join Date
    82Posts

    Re: Player Hangouts

    Nice release,i may use it xD

  14. #14
    Account Upgraded | Title Enabled! KidFlow is offline
    MemberRank
    Oct 2008 Join Date
    Above the skyLocation
    1,257Posts

    Re: Player Hangouts

    Nice, Passwords still broke?

  15. #15
    Infraction Banned viinnh is offline
    MemberRank
    Sep 2008 Join Date
    AustraliaLocation
    1,189Posts

    Re: [release]Player Hangouts

    hey but may i ask one thing i.. are different room names dif places ?



Page 1 of 9 123456789 LastLast

Advertisement