Henesys PQ
Implemented Henesys PQ.
This commit is contained in:
@@ -45,166 +45,84 @@ function action(mode, type, selection) {
|
||||
else
|
||||
status--;
|
||||
|
||||
if (status == 0) {
|
||||
em = cm.getEventManager("HenesysPQ");
|
||||
if(em == null) {
|
||||
cm.sendOk("The Henesys PQ has encountered an error.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendSimple("#e#b<Party Quest: Primrose Hill>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nI'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat. Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (cm.getParty() == null) {
|
||||
cm.sendOk("Hi there! I'm Tory. This place is covered with mysterious aura of the full moon, and no one person can enter here by him/herself.");
|
||||
if(cm.getMapId() == 100000200) {
|
||||
if (status == 0) {
|
||||
em = cm.getEventManager("HenesysPQ");
|
||||
if(em == null) {
|
||||
cm.sendOk("The Henesys PQ has encountered an error.");
|
||||
cm.dispose();
|
||||
} else if(!cm.isLeader()) {
|
||||
cm.sendOk("If you'd like to enter here, the leader of your party will have to talk to me. Talk to your party leader about this.");
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendSimple("#e#b<Party Quest: Primrose Hill>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nI'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat. Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to redeem an event hat.");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (cm.getParty() == null) {
|
||||
cm.sendOk("Hi there! I'm Tory. This place is covered with mysterious aura of the full moon, and no one person can enter here by him/herself.");
|
||||
cm.dispose();
|
||||
} else if(!cm.isLeader()) {
|
||||
cm.sendOk("If you'd like to enter here, the leader of your party will have to talk to me. Talk to your party leader about this.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
var eli = em.getEligibleParty(cm.getParty());
|
||||
if(eli.size() > 0) {
|
||||
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (selection == 1) {
|
||||
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
|
||||
cm.dispose();
|
||||
} else if (selection == 2) {
|
||||
cm.sendOk("#e#b<Party Quest: Primrose Hill>#k#n\r\nCollect primrose seeds from the flowers at the bottom part of the map and drop them by the platforms above the stage. Primrose seed color must match to grow the seeds, so test until you find the correct combination. When all the seeds have been planted, that is, starting second part of the mission, scout the Moon Bunny while it prepares Rice Cakes for the hungry Growlie. Once Growlie becomes satisfied, your mission is complete.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
var eli = em.getEligibleParty(cm.getParty());
|
||||
if(eli.size() > 0) {
|
||||
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
cm.sendYesNo("So you want to exchange #b20 #b#t4001129##k for the event-designed hat?");
|
||||
}
|
||||
} else if (selection == 1) {
|
||||
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("#e#b<Party Quest: Primrose Hill>#k#n\r\nCollect primrose seeds from the flowers at the bottom part of the map and drop them by the platforms above the stage. Primrose seed color must match to grow the seeds, so test until you find the correct combination. When all the seeds have been planted, that is, starting second part of the mission, scout the Moon Bunny while it prepares Rice Cakes for the hungry Growlie. Once Growlie becomes satisfied, your mission is complete.");
|
||||
if(cm.hasItem(4001129, 20)) {
|
||||
if(cm.canHold(1002798)) {
|
||||
cm.gainItem(4001129, -20);
|
||||
cm.gainItem(1002798, 20);
|
||||
cm.sendNext("Here it is. Enjoy!");
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("You don't have enough #t4001129# to buy it yet!");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010100) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("Thank you for aiding in the effort of feeding the Growlie. As a matter of fact, your team has already been rewarded for reaching this far. With this problem now solved, there is another issue happening right now, if you are interessed check #bTommy#k there for the info. So, are you returning straight to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if(cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
}
|
||||
else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010400) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("So, are you returning to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if(cm.getEventInstance() == null) {
|
||||
cm.warp(100000200);
|
||||
} else if(cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
} else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
var status = 0;
|
||||
var chosen = 0;
|
||||
var min = 3;
|
||||
var minLevel = 10;
|
||||
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && status == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
} else {
|
||||
status--;
|
||||
}
|
||||
if (cm.getPlayer().getMapId() == 100000200) {
|
||||
if (cm.getParty() == null || !cm.isLeader()) {
|
||||
if (status == 0) {
|
||||
cm.sendNext("Hi there! I'm Tory. This place is covered with mysterious aura of the full moon, and no one person can enter here by him/herself.");
|
||||
} else if (status == 1) {
|
||||
cm.sendOk("If you'd like to enter here, the leader of your party will have to talk to me. Talk to your party leader about this.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
if (status == 0) {
|
||||
cm.sendNext("I'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat.");
|
||||
} else if (status == 1) {
|
||||
cm.sendSimple("Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?\r\n#b#L0# Yes, I will go.#l");
|
||||
} else if (status == 2) {
|
||||
var party = cm.getPartyMembers();
|
||||
var onmap = 0;
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
if (party.get(i).getMap().getId() == 100000200) {
|
||||
if (party.get(i).getLevel() < minLevel) {
|
||||
cm.sendOk("A member of your party does not meet the level requirement.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
onmap++;
|
||||
}
|
||||
}
|
||||
if (onmap < min) {
|
||||
cm.sendOk("A member of your party is not presently in the map.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getClient().getChannelServer().getMapFactory().getMap(910010000).getAllPlayer().size() > 0) {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var em = cm.getEventManager("HenesysPQ");
|
||||
if (em == null) {
|
||||
cm.sendOk("This PQ is currently broken. Please report it on the forum!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var prop = em.getProperty("state");
|
||||
if (prop == null || prop.equals("0")) { //Start the PQ
|
||||
cm.removeHPQItems();
|
||||
em.setProperty("latestLeader", cm.getPlayer().getName());
|
||||
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
|
||||
cm.sendOk("A party in your name is already registered in this event.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else if (cm.getPlayer().getMap().getId() == 910010100 || cm.getPlayer().getMap().getId() == 910010400) {
|
||||
if (status == 0) {
|
||||
cm.sendSimple("I appreciate you giving some rice cakes for the hungry Growlie. It looks like you have nothing else to do now. Would you like to leave this place?\r\n#L0#I want to give you the rest of my rice cakes.#l\r\n#L1#Yes, please get me out of here.#l");
|
||||
} else if (status == 1) {
|
||||
chosen = selection;
|
||||
if (selection == 0) {
|
||||
if (cm.getPlayer().getGivenRiceCakes() >= 20) {
|
||||
if (cm.getPlayer().getGottenRiceHat()) {
|
||||
cm.sendNext("Do you like the hat I gave you? I ate so much of your rice cake that I will have to say no to your offer of rice cake for a little while.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendYesNo("I appreciate the thought, but I am okay now. I still have some of the rice cakes you gave me stored at home. To show you my appreciation, I prepared a small gift for you. Would you like to accept it?");
|
||||
}
|
||||
}
|
||||
} else if (selection == 1) {
|
||||
cm.warp(100000200);
|
||||
cm.dispose();
|
||||
}
|
||||
cm.dispose();
|
||||
} else if (status == 2) {
|
||||
if (chosen == 1) {
|
||||
if (cm.canHold(1002798)) { // we will let them try again if they can't
|
||||
cm.gainItem(1002798);
|
||||
cm.setGottenRiceHat(true);
|
||||
cm.sendNext("It will really go well with you. I promise.");
|
||||
} else {
|
||||
cm.getPlayer().dropMessage(1, "EQUIP inventory full.");
|
||||
}
|
||||
cm.dispose();
|
||||
} else if (cm.getPlayer().getGivenRiceCakes() < 20) {
|
||||
cm.sendOk("Thank you for rice cake number " + cm.getPlayer().getGivenRiceCakes() + "!! I really appreciate it!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user