Newbie Spellweaver
- Joined
- Dec 13, 2009
- Messages
- 75
- Reaction score
- 2
Hello everyone!
I am currently learning to script NPC's, and i am facing a problem.
The problem is,
i am making an starting npc, and the player is able to choose the job they would like to become.
Now when doing this, i am using sendSimple, and after that i use a case to give the selections an action.
But the thing is, when they select "Explorer" , they still need to select what kind of explorer they want to be.
Now, this would be a case inside of a case..
Could someone explain me how to do this?
here is the code:
Thanks in advance guys!
I am currently learning to script NPC's, and i am facing a problem.
The problem is,
i am making an starting npc, and the player is able to choose the job they would like to become.
Now when doing this, i am using sendSimple, and after that i use a case to give the selections an action.
But the thing is, when they select "Explorer" , they still need to select what kind of explorer they want to be.
Now, this would be a case inside of a case..
Could someone explain me how to do this?
here is the code:
Code:
function start() {
cm.sendSimple("Hello, Welcome to TroepieMS! My task here at TroepieMS is to help you start your journey. Please start by using the job you would like to be.\r\n\
#L1#Explorer (Warrior/Magician/Bowman/Thief/Pirate/Dual Blade/Cannoneer)\r\n\
#L2#Cygnus Knights (Dawn Warrior/Blaze Wizard/Wind Archer/Night Walker/Thunder Breaker/Mihile)\r\n\
#L3#Resistance (Battle Mage/Wild Hunter/Mechanic/Demon Slayer)\r\n\
#L4#Heroes (Aran/Evan/Mercedes/Phantom)\r\n\ "); // Choose your job
}
function action(mode, type, selection) {
switch (selection) {
case 1:
cm.sendSimple("Good choice! What kind of explorer would you like to become?\r\n\
#L1#Warrior\r\n\
#L2#Magician\r\n\
#L3#Bowman\r\n\
#L4#Thief\r\n\
#L5#Pirate\r\n\
#L6#Dual Blade\r\n\
#L7#Cannoneer\r\n\ "); //Choose your job (more specific)
switch (selection) {
case 100:
cm.sendNext("Allright!");
}
break;
case 2:
cm.sendSimple("Good Choice! What kind of Cygnus knight would you like to become?\r\n\
#L1#Dawn Warrior\r\n\
#L2#Blaze Wizard\r\n\
#L3#Wind Archer\r\n\
#L4#Night Walker\r\n\
#L5#Thunder Breaker\r\n\
#L6#Mihile\r\n\ "); //Choose your job (more specific)
break;
case 3:
cm.sendSimple("Good Choice! What kind of Resistance would you like to become?\r\n\
#L1#Batt Hunter\r\n\
#L3#Mechanic\r\n\
#L4#Demonle Mage\r\n\
#L2#Wild Slayer\r\n\ "); //Choose your job (more specific)
break;
case 4:
cm.sendSimple("Good Choice! What kind of Hero would you like to become?\r\n\
#L1#Aran\r\n\
#L2#Evan\r\n\
#L3#Mercedes\r\n\
#L4#Phantom\r\n\ "); //Choose your job (more specific)
break;
}
if (mode == 0){
cm.dispose();
}
}
Thanks in advance guys!