Advertisement
Nmb1Gamer

Untitled

Feb 14th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. --------------------------------
  3. Server:
  4.     Example Script
  5. --------------------------------
  6. NPC Title:
  7.     Quest / Multi-Function NPC
  8. --------------------------------
  9. Created by:
  10.     Ryuuzi/Pikachu
  11. --------------------------------
  12. Version:
  13.     1.0 - Script Started
  14. --------------------------------
  15. **/
  16.  
  17. var status;
  18. var questAct = false;
  19. var shopAct = false;
  20. var talkAct = false;
  21. var doingQuest = false;
  22.  
  23. function start() {
  24.     if (!cm.doingQuest()) {
  25.         cm.sendSimple("What did you want info on? #b\r\n\r\n#L0#Quests#l \r\n#L1#Shop#l \r\n#L2#Talk#l");
  26.     } else {
  27.         doingQuest = true;
  28.     }
  29. }
  30.  
  31. function action(mode, type, selection) {
  32.     if (mode == -1) {
  33.         cm.dispose();
  34.         return;
  35.     } else {
  36.         if (mode == 1) {
  37.             status++;
  38.         } else {
  39.             status--;
  40.         }
  41.     }
  42.     if (!questAct && !shopAct && !talkAct) {
  43.         if (selection == 0) {
  44.             questAct = true;
  45.         } else if (selection == 1) {
  46.             shopAct = true;
  47.         } else if (selection == 2) {
  48.             talkAct = true;
  49.         }
  50.     }
  51.     if (questAct) {
  52.         questAct(selection);
  53.     } else if (shopAct) {
  54.         shopAct(selection);
  55.     } else if (talkAct) {
  56.         talkAct(selection);
  57.     } else if (doingQuest) {
  58.         doingQuest(selection);
  59.     }
  60. }
  61.  
  62. function questAct(selection) {
  63.     // Starting Quest Stuff
  64. }
  65.  
  66. function shopAct(selection) {
  67.     // Shopping / Other Features you Wanna add
  68. }
  69.  
  70. function talkAct(selection) {
  71.     // Random talk added
  72. }
  73.  
  74. function doingQuest(selection) {
  75.     if (cm.doingQuest(1000)) {
  76.         if (cm.canComplete()) {
  77.             // Finishing quest stuff for quest 1000
  78.         } else {
  79.             // Can't finish quest 1000
  80.         }
  81.     } else {
  82.         // Doing some other quest that doesn't involve this NPC
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement