[Release] Automated Guild home System

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

    [Release] Automated Guild home System

    This is a follow up to my VirtualServ system. This time, it allows guild members into a closed map or group of maps. You decide!

    What this does:
    Code:
    Creates a guild home for the player automatically.  Seriously, it's uber sweet. No more NPC editing for you after this, unless of course you want to throw in functions of your own, which after I'm finished with this project, you most likely won't need to do.

    Changelog:
    Code:
    Version 1.0.0 - Lios. Initial creation
    V. 1.0.1 - Lios. Minor bugfix
    V. 1.0.2 - Lios. Added Screen Shots
    To-Do:
    Code:
    --+Add functions to the guild home NPC.
    How to:

    First, create a file in your event server called multiworld.js.

    In that file, put the following code:
    Code:
    /* 
     * This file is part of the OdinMS Maple Story Server
        Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> 
                           Matthias Butz <matze@odinms.de>
                           Jan Christian Meyer <vimes@odinms.de>
    
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU Affero General Public License version 3
        as published by the Free Software Foundation. You may not use, modify
        or distribute this program under any other version of the
        GNU Affero General Public License.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Affero General Public License for more details.
    
        You should have received a copy of the GNU Affero General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    /**
    -- Odin JavaScript --------------------------------------------------------------------------------
    	Guild Homes
    -- By ---------------------------------------------------------------------------------------------
    	Lios of Storybox
    -- Version Info -----------------------------------------------------------------------------------
    	1.0 - First Version by Lios
    ---------------------------------------------------------------------------------------------------
    **/
    var exitMap;
    var minPlayers = 1;
    
    function init() {
    	instanceId = 1;
    }
    
    function setup() {
    	exitMap = em.getChannelServer().getMapFactory().getMap(910000000); // <exit> to FM
    	var eim = em.newInstance("GuildHome");
    	return eim;
    }
    
    function playerEntry(eim, player) {
    if(em.getInstance("GuildHome" + player.getGuildId()) == null){
    	var ghm = em.newInstance("GuildHome" + player.getGuildId());
    	}else{
    	var ghm = em.getInstance("GuildHome" + player.getGuildId());
    	}
    	var map = ghm.getMapInstance(809050015);  //You may change this to any map you would like.
    	player.changeMap(map, map.getPortal(0));
    }
    
    function playerDisconnected(eim, player) {
    			playerExit(eim, player);
    }
    
    function playerExit(eim, player) {
    	eim.unregisterPlayer(player);
    	player.changeMap(exitMap, exitMap.getPortal(0));
    }
    
    // For offline players
    function removePlayer(eim, player) {
    	eim.unregisterPlayer(player);
    	player.getMap().removePlayer(player);
    	player.setMap(exitMap);
    }
    You can find this line:
    var map = ghm.getMapInstance(809050015); //You may change this to any map you would like.
    And switch out the map ID with any other map you wish. I suggest LMPQ if you don't have it working, or perhaps any of the following ID's:
    Code:
    920011200 -- OPQ End map
    925100700 -- PiratePQ end map

    Close that and save that. Next, add multiworld to the event load in world properties. This should be obvious to figure it out.


    After that, decide which NPC you want to be your warper and place this script into it:
    Code:
    var em;
    function start() { 
     status = -1; 
     action(1, 0, 0); 
    } 
    function action(mode, type, selection) { 
     if (mode == -1) { 
      cm.dispose(); 
     } else { 
      if (status >= 0 && mode == 0) { 
       cm.sendOk("Ok, feel free to hang around!"); 
       cm.dispose(); 
       return; 
      } 
      if (mode == 1) 
       status++; 
      else 
       status--; 
      if (status == 0) { 
        cm.sendNext("Dear lord, help me! I've been enslaved here and they made me warp people to their guild home!"); 
    	}else if(status == 1){
    		cm.sendNext("Oh well... I guess I'll do just that. Let's see if you have a guild home...");
    		}else if(status == 2){
    if(cm.getPlayer().getGuildId() > 0){
    					cm.sendYesNo("It looks like you have one! Would you like to go there?");
    }else{
    cm.sendOk("You have to be in a guild to go there! Sorry!");
    cm.dispose();
    }
    				}else if(status == 3){
    					em = cm.getEventManager("multiworld");
    					if(em == null){
    					cm.sendOk("Something went wrong...");
    					cm.dispose();
    					}else{
    					em.getIv().invokeFunction("setup", null);
    					var eim = em.getInstance("GuildHome");
    						if(eim == null){
    						cm.sendOk("Something went wrong!");
    						cm.dispose()
    						}else{
    						eim.registerPlayer(cm.getChar());
    						cm.dispose();
    						}
    				}
    				}
     } 
     }
    Next, check your guild home map? Are there any NPC's? If so, have them use this script:

    Code:
    var status = 0;
    
    function start() {
    	status = -1;
    	action(1, 0, 0);
    }
    
    function action(mode, type, selection) {
    	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 guild home?");	
    	}else if(status == 1) {
    var em = cm.getEventManager("multiworld");
    var eim = em.getInstance("GuildHome" + cm.getPlayer().getGuildId())
    	eim.removePlayer(cm.getChar());
    	cm.dispose();
    		}
    	}
    }
    If you don't have an NPC on that map, why don't you add one? I'll include a link to a guide on how to do just that soon.

    After that, restart your server and you should be finished!

    Now, some tips!
    Code:
    --+ Choose a guild home Map with no portals, or an NPC that warps you out.  Otherwise, players could leave and train there on their own.
    --+ It's best to make your teleporter, if you have one, do a check to make sure the player is not in a guild home map! Otherwise, the players would be in a world of their own.
    --+ You can do some editing of the maps to make the home more friendly to players!
    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"

    Screen Shots:
    Spoiler:






    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


  2. #2
    Infraction Banned Maple1134 is offline
    MemberRank
    Jun 2008 Join Date
    564Posts

    Re: Automated Guild home System

    I love you. Lawl

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

    Re: Automated Guild home System

    Looks good Well done

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

    Re: Automated Guild home System

    Lol, no problem =]

  5. #5
    Account Upgraded | Title Enabled! JusticeDK is offline
    MemberRank
    Aug 2008 Join Date
    McDonaldLocation
    806Posts

    Re: Automated Guild home System

    ss?

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

    Re: Automated Guild home System

    I'll post a few in a second I guess.

  7. #7
    Infraction Banned Maple1134 is offline
    MemberRank
    Jun 2008 Join Date
    564Posts

    Re: Automated Guild home System

    It lets me go to my Guild Home even though I'm not in a guild >.>

  8. #8
    Infraction Banned Scion is offline
    MemberRank
    Aug 2008 Join Date
    C:\windows\system32Location
    270Posts

    Re: Automated Guild home System

    Looks kind of cool. Great followup of the Virtual Server.

  9. #9
    Infraction Banned Maple1134 is offline
    MemberRank
    Jun 2008 Join Date
    564Posts

    Re: Automated Guild home System

    I think I fixed the problem of people who don't have a guild can go in anyway.

    Switch around

    Code:
    cm.sendYesNo("It looks like you have one! Would you like to go there?");
    and

    Code:
    cm.sendOk("You have to be in a guild to go there! Sorry!");
    cm.dispose();
    Edit: Nevermind I broke it. Lol

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

    Re: Automated Guild home System

    Try the new NPC Script I just added for the warper. That should work.

  11. #11
    Infraction Banned Maple1134 is offline
    MemberRank
    Jun 2008 Join Date
    564Posts

    Re: Automated Guild home System

    I would've never thought of that!

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

    Re: Automated Guild home System

    lol...
    Added in screenshots, my next addition, if not a bug fix, will be an add-on to the guild home NPC.

  13. #13
    Proficient Member CrisTheWind is offline
    MemberRank
    Sep 2008 Join Date
    The CloudsLocation
    156Posts

    Re: Automated Guild home System

    Epically Bumped ;o. i think();

  14. #14
    Infraction Banned Scion is offline
    MemberRank
    Aug 2008 Join Date
    C:\windows\system32Location
    270Posts

    Re: Automated Guild home System

    That looks pretty damn sexy O.o

  15. #15
    om nom nom. Innovative is offline
    MemberRank
    Nov 2007 Join Date
    SydneyLocation
    1,237Posts

    Re: Automated Guild home System

    Awesome release.



Page 1 of 3 123 LastLast

Advertisement