Advertisement
Guest User

cpq

a guest
Mar 7th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. /*
  2. This file is part of the OdinMS Maple Story Server
  3. Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
  4. Matthias Butz <matze@odinms.de>
  5. Jan Christian Meyer <vimes@odinms.de>
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU Affero General Public License as
  9. published by the Free Software Foundation version 3 as published by
  10. the Free Software Foundation. You may not use, modify or distribute
  11. this program under any other version of the GNU Affero General Public
  12. License.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU Affero General Public License for more details.
  18.  
  19. You should have received a copy of the GNU Affero General Public License
  20. along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. var status = 0;
  23. var party;
  24.  
  25. function start(chrs) {
  26. status = -1;
  27. party = chrs;
  28. action(1, 0, 0);
  29. }
  30.  
  31. function action(mode, type, selection) {
  32. if (mode == -1) {
  33. cm.getChar().setChallenged(false);
  34. cm.dispose();
  35. } else {
  36. if (mode == 0) {
  37. cm.sendOk("Come back once you have thought about it some more.");
  38. cm.getChar().setChallenged(false);
  39. cm.dispose();
  40. return;
  41. }
  42. }
  43. if (mode == -1)
  44. cm.dispose();
  45. else {
  46. if (mode == 1)
  47. status++;
  48. else
  49. status--;
  50. if (status == 0) {
  51. if (cm.getParty().getMembers().size() == party.size()){
  52. cm.getPlayer().setChallenged(true);
  53. var snd = "";
  54. for (var i = 0; i < party.size(); i++)
  55. snd += "#b" + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + party.get(i).getJobNameById(party.get(i).getJobId()) + "#k\r\n\r\njoin?";
  56. cm.sendAcceptDecline(snd); //<---------------------------------------
  57. } else {
  58. return;
  59. }
  60. } else if (status == 1) {
  61. var ch = cm.getChrById(party.get(0).getId());//<---------------------------------------
  62. cm.startCPQ(ch, ch.getMapId() + 1);//<---------------------------------------
  63. ch.getParty().setEnemy(cm.getPlayer().getParty());//<---------------------------------------
  64. cm.getChar().getParty().setEnemy(ch.getParty());//<---------------------------------------
  65. cm.getChar().setChallenged(false);//<---------------------------------------
  66. cm.dispose();
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement