Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- --------------------------------
- Server:
- Example Script
- --------------------------------
- NPC Title:
- Quest / Multi-Function NPC
- --------------------------------
- Created by:
- Ryuuzi/Pikachu
- --------------------------------
- Version:
- 1.0 - Script Started
- --------------------------------
- **/
- var status;
- var questAct = false;
- var shopAct = false;
- var talkAct = false;
- var doingQuest = false;
- function start() {
- if (!cm.doingQuest()) {
- 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");
- } else {
- doingQuest = true;
- }
- }
- function action(mode, type, selection) {
- if (mode == -1) {
- cm.dispose();
- return;
- } else {
- if (mode == 1) {
- status++;
- } else {
- status--;
- }
- }
- if (!questAct && !shopAct && !talkAct) {
- if (selection == 0) {
- questAct = true;
- } else if (selection == 1) {
- shopAct = true;
- } else if (selection == 2) {
- talkAct = true;
- }
- }
- if (questAct) {
- questAct(selection);
- } else if (shopAct) {
- shopAct(selection);
- } else if (talkAct) {
- talkAct(selection);
- } else if (doingQuest) {
- doingQuest(selection);
- }
- }
- function questAct(selection) {
- // Starting Quest Stuff
- }
- function shopAct(selection) {
- // Shopping / Other Features you Wanna add
- }
- function talkAct(selection) {
- // Random talk added
- }
- function doingQuest(selection) {
- if (cm.doingQuest(1000)) {
- if (cm.canComplete()) {
- // Finishing quest stuff for quest 1000
- } else {
- // Can't finish quest 1000
- }
- } else {
- // Doing some other quest that doesn't involve this NPC
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement