[Release] Instanced Pap. Maps
Quote:
Originally Posted by
Generic
Requested by :
http://www.valhalladev.com/forum/ide...r-closing.html
Credits to og.Lios of RageZone for the his instanced map thing I just modified a few things
papMap.js
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 --------------------------------------------------------------------------------
Instanced Pap. Maps
-- By ---------------------------------------------------------------------------------------------
Original script by : Lios of Storybox
Modified by : Generic/MiniAxel of Valhalla/RZ
**/
var exitMap;
var minPlayers = 1;
function init() {
instanceId = 1;
}
function setup() {
exitMap = em.getChannelServer().getMapFactory().getMap(910000000); // <exit> to FM
var eim = em.newInstance("papMap");
return eim;
}
function playerEntry(eim, player) {
if(em.getInstance("GuildHome" + player.getGuildId()) == null){
var ghm = em.newInstance("papMap" + player.getPartyId());
}else{
var ghm = em.getInstance("papMap" + player.getPartyId());
}
var map = ghm.getMapInstance(PAP. MAP ID); //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);
}
Add the pap map ID to the above one
Then for the NPC to warp you to the Pap. Map
NPC
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 the Papulatus Map");
}else if(status == 1){
cm.sendNext("Oh well... I guess I'll do just that. Let's see if you're in a party");
}else if(status == 2){
if(cm.getPlayer().getPartyId() > 0){
cm.sendYesNo("It looks like you have one! Would you like to go there?");
}else{
cm.sendOk("You have to be in a party to go there! Sorry!");
cm.dispose();
}
}else if(status == 3){
em = cm.getEventManager("papMap");
if(em == null){
cm.sendOk("Something went wrong...");
cm.dispose();
}else{
em.getIv().invokeFunction("setup", null);
var eim = em.getInstance("papMap");
if(eim == null){
cm.sendOk("Something went wrong!");
cm.dispose()
}else{
eim.registerPlayer(cm.getChar());
cm.dispose();
}
}
}
}
}
Add an NPC in there to leave with this code :
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 pap map");
}else if(status == 1) {
var em = cm.getEventManager("papMap");
var eim = em.getInstance("papMap" + cm.getPlayer().getPartyId())
eim.removePlayer(cm.getChar());
cm.dispose();
}
}
}
Quote from my thread on Valhalla. I suck ass at Javascript so I modified og.Lios' script. Credits to him.
Re: [Release] Instanced Pap. Maps
rofl you may suck ass at javascript, but compared to the people here, you're pro just like how I'm not good at java, but no one here can do anything
good release btw
Re: [Release] Instanced Pap. Maps
Quote:
Originally Posted by
Moogra
rofl you may suck ass at javascript, but compared to the people here, you're pro just like how I'm not good at java, but no one here can do anything
good release btw
I guess. Lol. =p
I still suck at Javascript. D: I'm only decent with Java.
Re: [Release] Instanced Pap. Maps
Re: [Release] Instanced Pap. Maps
Lol, I was just about to release this.
Ahh well, I get creds anyway <3
Good release.
Re: [Release] Instanced Pap. Maps
Re: [Release] Instanced Pap. Maps
theres a difference between java and javascript fyi
Re: [Release] Instanced Pap. Maps
Giving credits is teh win.
Nice.
Javascript </3
Re: [Release] Instanced Pap. Maps
Why would you want to instance pap maps? They aren't instanced in GMS
Re: [Release] Instanced Pap. Maps
Quote:
Originally Posted by
CptObvious
Why would you want to instance pap maps? They aren't instanced in GMS
It was for a request.
Also, There's a huge bug with them. Rofl
Re: [Release] Instanced Pap. Maps
Nice release it would help me alot thanks xD