Advertisement
Guest User

npc

a guest
Jul 24th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. function start() {
  2. cm.sendOk("I am an NPC without a status.");
  3. cm.dispose();
  4. }
  5. Another NPC not requiring status
  6.  
  7. function start() {
  8. cm.sendOk("Here is another example of an NPC without status.");
  9. }
  10.  
  11. function action(mode, type, selection) {
  12. cm.warp(100000000, 0);
  13. cm.gainItem(4001126, 1);
  14. cm.sendOk("See? Here, I warped you and gave you an item without using status.");
  15. cm.dispose();
  16. }
  17.  
  18. NPC requiring status
  19.  
  20. var status;
  21.  
  22. function start() {
  23. status = -1;
  24. action(1, 0, 0);
  25. }
  26.  
  27. function action(mode, type, selection) {
  28. if (mode == 1) {
  29. status++;
  30. }else{
  31. status--;
  32. }
  33. if (status == 0) {
  34. cm.sendNext("Go ahead and press Next so I can proceed to the next status.");
  35. } else if (status == 1) {
  36. cm.sendSimple("Would you like to see how I use status again? \r\n #L0# Yes. #l \r\n #L1# No. #l");
  37. } else if (status == 2) {
  38. if (selection == 0) {
  39. cm.sendOk("Here I am, in another status. As you can see from the script, this window is in status 2.");
  40. cm.dispose();
  41. } else if (selection == 1) {
  42. cm.sendOk("Well, sucks to be you, don't it? This window is also in status 2 :) ");
  43. cm.dispose();
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement