[Release] OdinTeh/MoopleDev Zakum Squad NPC
take note this is a basic release, given that my limitation of time, I'm releasing this, I have add just two pic in case some one tries to be funny and prove the release isn't working, have fun :) hopefully you guys can get it fully working, It is a lot of work but it is possible also thanks @Lefide :)
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/>.
*/
importPackage(java.lang);
importPackage(net.sf.odinms.server);
importPackage(net.sf.odinms.tools);
/*
Id: 2030013 : Adobis
@Author ExtremeDevilz
// Done
create zakum squad, member are able to join upon it creation
member can join and leave from the squad
list check of more > 30
upon ldr forming the squad and entering, display msg only to squad members and allow them to be warp inside
todo:
party check if level 50 above, only level 50 above can be ldr (bypass for gm !)
check if ldr is applying consecutive
only 6 or more in the squad list is able to enter (bypass for gm !)
add to Suspended List when press expel only 10 is allowed if more then 10 display -> message
Re-accept a member from the Suspended List
fixed timer runs out o.o warping and timer not display upon enter the map (maplemap ?);
*/
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("Talk to me if you want to become the leader of the squad.");
cm.dispose();
return;
}
if (mode == 1) {
status++;
} else {
status--;
}
if (status == 0) {
if (cm.getSquadState(MapleSquadType.ZAKUM) == 0) {
cm.sendYesNo("Would you like to become the leader of the Zakum Expedition Squad?");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.sendSimple("Greetings, leader of the Zakum Expedition Squad. What would you like to do? \r\n#b#L0# Check out the list of the Squad#l\r\n#L1# Expel a member from the Squad#l\r\n#L2# Re-accept a member from the Suspended List#l\r\n#r#L3# Form the Squad and enter#l#k");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && !cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.sendSimple("What would you like to do?\r\n#b#L0# Enter the Zakum Expedition Squad#l\r\n#L1# Leave the Zakum Expedition Squad#l\r\n#L2# Check out the list of the Squad.#k");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 2 && cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.warp("280030000");
} else if (!cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.sendOk("The application process for the Zakum Expedition Squad had already been concluded.");
cm.dispose();
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 3) { // checked if spawned o.o then set it to started
cm.sendOk ("The battle against Zakum has already started.");
cm.dispose();
}
} else if (status == 1) {
if (cm.createMapleSquad(MapleSquadType.ZAKUM) != null) {
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getClock(300)); // 300 Seconds == 5 Mins
cm.mapMessage(6, cm.getPlayer().getName() + " has been appointed the leader of the Zakum Expedition Squad. To those willing to participate in the Expedition Squad, APPLY NOW!");
cm.sendOk("You have been appointed the leader of the Zakum Expedition Squad. You'll now have 5 minutes to form the squad and have every member enter the mission.");
cm.dispose();
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
var noOfChars = cm.numSquadMembers(MapleSquadType.ZAKUM);
if (selection == 0) {
var toSend = "The total number of applicants are #b" + noOfChars + "#k, and the list of the applicants is as follows.\r\n";
for (var i = 1; i <= noOfChars; i++) {
toSend += "#L";
toSend += i;
toSend += "# ";
toSend += i;
toSend += " - ";
toSend += cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName();
toSend += "#l";
}
cm.sendOk(toSend);
cm.dispose();
} else if (selection == 1) {
var toSend = "Which of these members would you like to expel?\r\n";
for (var i = 1; i <= noOfChars; i++) {
toSend += "#L";
toSend += i;
toSend += "# ";
toSend += i;
toSend += " - ";
toSend += cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName();
toSend += "#l";
}
cm.sendOk(toSend);
cm.dispose();
// TODO : Ban
} else if (selection == 2) {
cm.sendOk("Code Me !");
cm.dispose();
} else if (selection == 3) {
if (cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.warp("280030000");
cm.setSquadState(MapleSquadType.ZAKUM, 2);
if (cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.mapMessage(5, "The leader of the squad has entered the map. Please enter the map before time runs out on the squad.");
}
}
}
} else {
if (selection == 0) {
if (cm.canAddSquadMember(MapleSquadType.ZAKUM) && !cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.addSquadMember(MapleSquadType.ZAKUM);
cm.sendOk("You have been enrolled in the Zakum Expedition Squad.");
cm.dispose();
} else if (cm.canAddSquadMember(MapleSquadType.ZAKUM) && cm.numSquadMembers(MapleSquadType.ZAKUM) > 29) {
cm.sendOk("Unable to apply for a spot due to number of applicants already reaching the maximum.");
cm.dispose();
} else {
cm.sendOk("You are already part of the expedition squad.");
cm.dispose();
}
} else if (selection == 1) {
if (cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.removeSquadMember(MapleSquadType.ZAKUM, cm.getPlayer() , false);
cm.sendOk("You have formally withdrawn from the squad.");
cm.dispose();
} else {
cm.sendOk("Unable to leave the squad due to the fact that you're not participating in the Zakum Participation Squad.");
cm.dispose();
}
} else if (selection == 2) {
var noOfChars = cm.numSquadMembers(MapleSquadType.ZAKUM);
var toSend = "The total number of applicants are #b" + noOfChars + "#k, and the list of the applicants is as follows.\r\n";
for (var i = 1; i <= noOfChars; i++) {
toSend += "#L";
toSend += i;
toSend += "# ";
toSend += i;
toSend += " - ";
toSend += cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName();
toSend += "#l";
}
cm.sendOk(toSend);
cm.dispose();
}
}
} else if (status == 2) {
cm.setSquadState(MapleSquadType.ZAKUM, 1);
}
}
}
http://i.imgur.com/hIfxULk.png
http://i.imgur.com/zvVVND5.png
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
1. This belongs here.
2. What exactly did you fix/change? I believe it already existed, correct me if I'm wrong.
3. I also believe a lot of references are from Vana's scripts, so might wanna add a credit there.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
Quote:
Originally Posted by
Fraysa
1. This belongs
here.
2. What exactly did you fix/change? I believe it already existed, correct me if I'm wrong.
3. I also believe a lot of references are from Vana's scripts, so might wanna add a credit there.
1. yes it does, it was posted in the wrong section, might have overlooked it
2. I wrote the script from scratch, functions existed in odinteh and the script that danny wrote was not even gms like, so I rewrote it.
3. nope.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
So the text is 100% gms-like? Also what's this, lol.
Code:
cm.warp("280030000");
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
Quote:
Originally Posted by
Cygnus
So the text is 100% gms-like? Also what's this, lol.
Code:
cm.warp("280030000");
the text is gms-alike, that is a warp function to warp you to the selected map.
pretty much is like 40% completed, It is just too much work and I have been researching for the past 2 weeks.
I think the methods can be improved, given that this is my first npc script. there is still much work to be done. feel free to complete it. given that no one cares about anything in terms of getting odin to gms standard I can see this thread will die soon and I find it pretty sad the state of how the private server has become for odin based. I'm sorry to say this but what is the point of keeping the source private and I would rather support open source emulator cause end of the day it would have beaten most of the server out there. updating to version isn't difficult and so is fixing bugs people seems to don't understand that working as a team has its advantage of getting things done better. I think Vana is the only one which has proved this, coming from a source that was far worst then odin back then which was Titan 0.0.8.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
Quote:
Originally Posted by
ExtremeDevilz
the text is gms-alike, that is a warp function to warp you to the selected map.
pretty much is like 40% completed, It is just too much work and I have been researching for the past 2 weeks.
I think the methods can be improved, given that this is my first npc script. there is still much work to be done. feel free to complete it. given that no one cares about anything in terms of getting odin to gms standard I can see this thread will die soon and I find it pretty sad the state of how the private server has become for odin based. I'm sorry to say this but what is the point of keeping the source private and I would rather support open source emulator cause end of the day it would have beaten most of the server out there. updating to version isn't difficult and so is fixing bugs people seems to don't understand that working as a team has its advantage of getting things done better. I think Vana is the only one which has proved this, coming from a source that was far worst then odin back then which was Titan 0.0.8.
Why do you have to talk so much bullshit every time you post anything? People don't care about GMS-Like content simply because the era of "open source" is gone. It's not 2008 anymore; people don't share and release stuff for the community for fun anymore, they'd rather keep them private and make profit off of it. There's nothing wrong with it, it's their choice.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
I know what it is, my remark was meant at the quotation of the map id. It's unnecessary and ugly (in my opinion...). It's not bad for your first script, but it could be shortened a bit. For example, status--; will never be reached since you already have a sendOk for mode == 0, even if you hadn't had it, you wouldn't have had the use for it since you have no dialogue option where going backwards is an option. Also, this to me is a waste of lines and makes the script less readable (although, I suppose that's a matter of preference, idk).
Code:
toSend += "#L";
toSend += i;
toSend += "# ";
toSend += i;
toSend += " - ";
toSend += cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName();
toSend += "#l";
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
Quote:
Originally Posted by
Fraysa
Why do you have to talk so much bullshit every time you post anything? People don't care about GMS-Like content simply because the era of "open source" is gone. It's not 2008 anymore; people don't share and release stuff for the community for fun anymore, they'd rather keep them private and make profit off of it. There's nothing wrong with it, it's their choice.
I don't see how is this related to the release, if you find it bullshit why do you always replied to most of my thread. secondly I don't think you have the right to say that the era of open source is gone, cause you were never a part of it. Also keep in mind let stay on topic regarding this release.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
Quote:
Originally Posted by
ExtremeDevilz
Also keep in mind let stay on topic regarding this release.
You're telling me to stay on-topic but you're the one who went off-topic first.
Quote:
Originally Posted by
ExtremeDevilz
I don't see how is this related to the release, if you find it bullshit why do you always replied to most of my thread.
To show to you how dumb you are sometimes.
Quote:
Originally Posted by
ExtremeDevilz
secondly I don't think you have the right to say that the era of open source is gone, cause you were never a part of it.
Uhh.. yeah.. do I really need to compare my contribution to yours?
EDIT: Okay, I'm going to compare it after all because I'm pretty bored. Let's take this release as an example. First, you ask if anyone has gotten the Zakum squad script working. Why? Possibly because you want to copy it. I wouldn't be surprised as it happened before. Then, you ask how to fix your script. No words, seriously. It's been what? 7 years since you started calling yourself a programmer/joined RaGEZONE? Are you really asking such simple question?
Okay, let's continue a few weeks before that..
You release a fix for the Zakum spawn which does absolutely nothing. Before that, you release "Better AES Encryption". I must say, that was really gold. You added an author tag even though you didn't write one line of the code AND you couldn't even explain what's "better" with it simply because it is not better.
Moving on..
More useless crap, more useless crap, more useless crap, more useless crap, more useless crap, more useless crap and more useless crap.
I could go on forever but I think that's enough.
Re: [Release] OdinTeh/MoopleDev Zakum Squad NPC
cm.sendOk for selections will DC unless your source converts it to cm.sendSimple.
Code:
var toSend = "The total number of applicants are #b" + noOfChars + "#k, and the list of the applicants is as follows.\r\n";
for (var i = 1; i <= noOfChars; i++) {
toSend += "#L";
toSend += i;
toSend += "# ";
toSend += i;
toSend += " - ";
toSend += cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName();
toSend += "#l";
}
cm.sendOk(toSend);
Code:
importPackage(java.lang);
importPackage(net.sf.odinms.server);
importPackage(net.sf.odinms.tools);
var status = 0;
function start() {
if (cm.getSquadState(MapleSquadType.ZAKUM) == 0) {
cm.sendYesNo("Would you like to become the leader of the Zakum Expedition Squad?");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.sendSimple("Greetings, leader of the Zakum Expedition Squad. What would you like to do? \r\n#b#L0# Check out the list of the Squad#l\r\n#L1# Expel a member from the Squad#l\r\n#L2# Re-accept a member from the Suspended List#l\r\n#r#L3# Form the Squad and enter#l#k");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && !cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.sendSimple("What would you like to do?\r\n#b#L0# Enter the Zakum Expedition Squad#l\r\n#L1# Leave the Zakum Expedition Squad#l\r\n#L2# Check out the list of the Squad.#k");
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 2 && cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.warp(280030000);
} else if (!cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.sendOk("The application process for the Zakum Expedition Squad had already been concluded.");
cm.dispose();
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 3) { // checked if spawned o.o then set it to started
cm.sendOk("The battle against Zakum has already started.");
cm.dispose();
}
}
function action(mode,type,selection) {
if (mode == 0 && status == 0) {
cm.sendOk("Talk to me if you want to become the leader of the squad.");
cm.dispose();
} else if (mode < 1) {
cm.dispose();
return;
} else
status++;
if (status == 1) {
if (cm.createMapleSquad(MapleSquadType.ZAKUM) != null) {
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getClock(300)); // 300 Seconds == 5 Mins
cm.mapMessage(6, cm.getPlayer().getName() + " has been appointed the leader of the Zakum Expedition Squad. To those willing to participate in the Expedition Squad, APPLY NOW!");
cm.sendOk("You have been appointed the leader of the Zakum Expedition Squad. You'll now have 5 minutes to form the squad and have every member enter the mission.");
cm.dispose();
} else if (cm.getSquadState(MapleSquadType.ZAKUM) == 1 && cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
var squadMembers = cm.numSquadMembers(MapleSquadType.ZAKUM);
if (selection == 0) {
var message = "The total number of applicants are #b"+squadMembers+"#k, and the list of the applicants is as follows.\r\n";
for (var i = 1; i <= squadMembers; i++) {
message += "#L"+i+"# "+i+" - "+cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName()+"#l";
} cm.sendSimple(message);
cm.dispose();
} else if (selection == 1) {
var message = "Which of these members would you like to expel?\r\n";
for (var i = 1; i <= squadMembers; i++) {
message += "#L"+i+"# "+i+" - "+cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName()+"#l";
} cm.sendSimple(message);
cm.dispose();
} else if (selection == 2) {
cm.sendOk("Code me!");
cm.dispose();
} else if (selection == 3) {
if (cm.checkSquadLeader(MapleSquadType.ZAKUM)) {
cm.warp(280030000);
cm.setSquadState(MapleSquadType.ZAKUM, 2);
if (cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.mapMessage(5, "The leader of the squad has entered the map. Please enter the map before time runs out on the squad.");
}
}
}
} else {
if (selection == 0) {
if (cm.canAddSquadMember(MapleSquadType.ZAKUM) && !cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.addSquadMember(MapleSquadType.ZAKUM);
cm.sendOk("You have been enrolled in the Zakum Expedition Squad.");
} else if (cm.canAddSquadMember(MapleSquadType.ZAKUM) && cm.numSquadMembers(MapleSquadType.ZAKUM) > 29) {
cm.sendOk("Unable to apply for a spot due to number of applicants already reaching the maximum.");
} else {
cm.sendOk("You are already part of the expedition squad.");
}
} else if (selection == 1) {
if (cm.isSquadMember(MapleSquadType.ZAKUM)) {
cm.removeSquadMember(MapleSquadType.ZAKUM, cm.getPlayer(), false);
cm.sendOk("Yo have formally withdrawn from the squad.");
} else {
cm.sendOk("Unable to leave the squad due to the fact that you're not participating in the Zakum Participation Squad.");
}
} else if (selection == 2) {
var squadMembers = cm.numSquadMembers(MapleSquadType.ZAKUM);
var message = "The total number of applicants are #b"+squadMembers+"#k, and the list of the applicants is as follows.\r\n";
for (var i = 1; i <= squadMembers; i++) {
message += "#L"+i+"# "+i+" - "+cm.getSquadMember(MapleSquadType.ZAKUM, i - 1).getName()+"#l";
} cm.sendOk(message);
} cm.dispose();
}
} else if (status == 2) {
cm.setSquadState(MapleSquadType.ZAKUM, 1);
}
}