A friend of mine asked me if I could make a simple Class system for his Gold server.
So I made this quick script in JS, since I know close to nothing about GS2 and hope that this will get me started.
After looking at the syntax on Graal Bible, I guess that it looks like a closer derivation of JS than GS1 does, so I hope that this won’t be too hard.
Here it is:
Scenario:
Player walks up to an NPC. NPC prompts him to choose a class.
Giving him the option of several classes (say2 …).
Player says which class he would like and a weapon is assigned to him
(ex: Archer’s get bow, Rogue’s get sword). Keep in mind that
all of the previous weapons (bombs and bow) are removed and 1 new weapon is added.
var player = prompt("Choose a Class!");
var Archer, Rogue;
if (player === "Archer") {
console.log("You chose Archer!");
}
else if (player === "Rogue") {
console.log("You chose Rogue!");
}
else {
console.log("I couldn't understand your pesky accent");
}
Something like this (tried to do it in GS1):
if (playerenters) {
// Add NPC Attributes here
say2 What Class would you like? Archer or Rogue;
}
if (playersays Archer) { // yes, this is wrong...
message You chose Archer!;
triggeraction 0,0,gr.deleteweapon, bow && bomb; //This is where it goes I guess? Removes weapons player has by default.
toweapons custom_bow;
timeout 0.5;
setlevel2 destination.nw,30,30; //Warps player to destination after class has been chosen
}
if (playersays Rogue) {
message You chose Rogue!;
triggeraction 0,0,gr.deleteweapon, bow && bomb;//Removes weapons player has by default
toweapons custom_sword;
timeout 0.5;
setlevel2 destination.nw,30,30; //Warps player to destination after class has been chosen
}
else {
message I couldn't understand your pesky accent!;
}
Help me out here!
Sorry for the GS2 request. I don’t feel like posting anywhere else.
-Thanks!