Fletcher

Started by Kazamatta, September 08, 2012, 06:24:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kazamatta

var PCName = Sender.Name

function OnDialog(){
Echo("~<c:White>Jaiken~<>:Good day sir! I am Jaiken, the fletcher in this town. How may I be of assistance?");
AddOption(0,"What do you do here?","op1();","1");
AddOption(0,"Make me some arrows.","op9();","8");
AddOption(0,"Make me a bow.","op18();","20");
AddOption(0,"Nothing for now.","op24();","25");
AddOption(1,"Continue...","op2();","2,4,6");
AddOption(2,"What materials do I need?","op3();","3");
AddOption(3,"Continue...","op4();","1");
AddOption(4,"How much does it cost?","op5();","5");
AddOption(5,"Continue...","op6();","1");
AddOption(6,"Can you do something for me?","op7();","7");
AddOption(7,"Continue...","op8();","0");
AddOption(8,"Continue...","op10();","9,10");
AddOption(9,"Yes, make me some arrows.","op11();","11");
AddOption(10,"I changed my mind.","op16();","19");
AddOption(11,"Continue...","op12();","12");
AddOption(12,"Continue...","op13();","13");
AddOption(13,"Continue...","op14();","14");
AddOption(14,"Continue...","op15();","15,16,17,18");
AddOption(15,"What do you do here?","op1();","1");
AddOption(16,"Make me some arrows.","op9();","8");
AddOption(17,"Make me a bow.","op18();","20");
AddOption(18,"Nothing for now, Goodbye.","op26();","25");
AddOption(19,"Continue...","op17();","0");
AddOption(20,"Continue...","op19();","21,10");
AddOption(21,"Yes make me a bow.","op20();","22");
AddOption(22,"Continue...","op20();","23");
AddOption(23,"Continue...","op22();","24");
AddOption(24,"Continue...","op23();","15,16,17,18");
AddOption(25,"Continue...","op25();","");
ProcessOptions();
}

function op1(){
Echo("~<c:White>"+PCName+"~<>:What do you do here?");
}

function op2(){
Echo("~<c:White>Jaiken~<>:Well I fletch arrows and bows. If you give me the materials and payment of course.");
}

function op3(){
Echo("~<c:White>"+PCName+"~<>:What materials");
}

function op4(){
Echo("~<c:White>Jaiken~<>:Give me a normal piece of wood and any sort of metal bar for arrows. As for bows, you need to give" +
"me a piece of wood and another type of wood that you can identify.");
}

function op5(){
Echo("~<c:White>"+PCName+"~<>:How much does the service cost?");
}

function op6(){
Echo("~<c:White>Jaiken~<>:That depends on the type of arrows or bow you want. The better the item, the higher the price.");
}

function op7(){
Echo("~<c:White>"+PCName+"~<>:Can you do something for me?");
}

function op8(){
Echo("~<c:White>JAiken~<>:Certainly! How may I help.");
}

function op9(){
Echo("~<c:White>"+PCName+"~<>:Make me some arrows.");
}

function op10(){
Echo(~"~<c:White>Jaiken~<>:Are you sure?");
}

function op11(){
Echo("~<c:White>"+PCName+"~<>:Yes, I'm sure.");
}

function op12(){
if (ActivePlayer.ItemExists(10001) == true){
op121();
}
else if (ActivePlayer.ItemExists(10001) == false){
Echo("~<c:White>Jaiken~<>:I'm sorry, but it seems you dont have anywood for me to work with.");
}
}

function op121(){
if (ActivePlayer.ItemExists(10002) == true){
Echo("~<c:White>Jaiken~<>:Okay, I'll make some steel arrows for you. It will cost 100 coins");
}
else if (ActivePlayer.ItemExists(10003) == true){
Echo("~<c:White>Jaiken~<>:Okay, I'll make some iron arrows for you. It will cost 50 coins");
}
else if (ActivePlayer.ItemExists(10004) == true){
Echo("~<c:White>Jaiken~<>:Okay, I'll make some bronze arrows for you. It will cost 25 coins");
}
else{
Echo("~<c:White>Jaiken~<>: I'm sorry, but you dont have metal for me to work with.");
}
}

function op13(){
if (ActivePlayer.ItemExists(10001) == true){
op131();
}
else if (ActivePlayer.ItemExists(10001) == false){
Echo("~<c:White>Jaiken~<>:I'm sorry, but you dont have any wood for me to work with.");
}
}

function op131(){
if (ActivePlayer.ItemExists(10002) == true){
MSG("You hand over the piece of wood, the steel bar and 100 coins.");
}
else if (ActivePlayer.ItemExists(10003) == true){
MSG("You hand over the piece of wood, the iron bar and 50 coins.");
}
else if (ActivePlayer.ItemExists(10004) == true){
MSG("You hand over the piece of wood, the bronze bar and 25 coins.");
}
else{
Echo("~<c:White>Jaiken~<>: I'm sorry, but you dont have any metal for me to work with.");
}
}

function op14(){
if (ActivePlayer.ItemExists(10002) == true || ActivePlayer.ItemExists(10003) == true || ActivePlayer.ItemExists(10003) == true &&
ActivePlayer.ItemExists(10001) == true){
Echo("~<c:Gray>The fletcher quickly takes the materials and begins creating your arrows.");
}
else{
Echo("~<c:White>Jaiken~<>:Well, when you get some more materials come on back.");
}
}

function op15(){
if (ActivePlayer.ItemExists(10002) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 100){
ActivePlayer.RemoveItem(10002);
ActivePlayer.RemoveItem(10001);
AddItem(10011);
PartyGold -= 100;
}
else{
Echo("~<c:White>Jaiken~<>:I have the arrows for you, but it seems you don't have enough coins for me.");
}
}
else if (ActivePlayer.ItemExists(10003) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 50){
ActivePlayer.RemoveItem(10003);
ActivePlayer.RemoveItem(10001);
AddItem(10012);
PartyGold -= 50;
}
else{
Echo("~<c:White>Jaiken~<>:I have the arrows for you, but it seems you don't have enough coins for me.");
}
}
else if (ActivePlayer.ItemExists(10004) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 25){
ActivePlayer.RemoveItem(10004);
ActivePlayer.RemoveItem(10001);
AddItem(10013);
PartyGold -= 25;
}
else{
Echo("~<c:White>Jaiken~<>:I have the arrows for you, but it seems you don't have enough coins for me.");
}
}
else{
Echo("~<c:Gray>Remember you need a piece of wood and a metal bar to have arrows created.");
}
}

function op16(){
Echo("~<c:White>"+PCName+"~<>:I changed my mind.");
}

function op17(){
Echo("~<c:White>Jaiken~<>:Okay. How else may I be of assistance.");
}

function op18(){
Echo("~<c:White>"+PCName+"~<>: Make me a bow.");
}

function op19(){
Echo("~<c:White>Jaiken~<>:Are you sure?");
}

function op20(){
Echo("~<c:White>"+PCName+"~<>:Yes, I'm sure.");
}

function op21(){
if (ActivePlayer.ItemExists(10001) == true && ActivePlayer.ItemExists(10005) == true){
MSG("You hand over a piece of wood, a yew log and 200 coins.");
}
else if (ActivePlayer.ItemExists(10001) == true && ActivePlayer.ItemExists(10006) == true){
MSG("You hand over a piece of wood, a ash log and 100 coins.");
}
else if (ActivePlayer.ItemExists(10001) == true && ActivePlayer.ItemExists(10007) == true){
MSG("You hand over a piece of wood, a oak log and 350 coins.");
}
else{
Echo("~<c:White>Jaiken~<>:I'm sorry, but you don't have the necessary materials for me to make you a bow. Please come back") +
("when you do.");
}
}

function op22(){
if (ActivePlayer.ItemExists(10005) == true || ActivePlayer.ItemExists(10006) == true || ActivePlayer.ItemExists(10007) == true &&
ActivePlayer.ItemExists(10001) == true){
Echo("~<c:Gray>The fetcher quickly take your materials and begins creating your bow.");
}
else{
Echo("~<c:White>Jaiken~<>:I'm sorry, but it seems you don't have the necessary materials.");
}
}

function op23(){
if (ActivePlayer.ItemExists(10005) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 200){
ActivePlayer.RemoveItem(10005);
ActivePlayer.RemoveItem(10001);
AddItem(10008);
PartyGold -= 200;
}
else{
Echo("~<c:White>Jaiken~<>:I have this bow for you but it seems you don't have enough coins for me.");
}
}
else if (ActivePlayer.ItemExists(10006) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 100){
ActivePlayer.RemoveItem(10006);
ActivePlayer.RemoveItem(10001);
AddItem(10009);
PartyGold -= 100;
}
else{
Echo("~<c:White>Jaiken~<>:I have this bow for you but it seems you don't have enough coins for me.");
}
}
else if (ActivePlayer.ItemExists(10007) == true && ActivePlayer.ItemExists(10001) == true){
if (PartyGold >= 350){
ActivePlayer.ItemExists(10007);
ActivePlayer.ItemExists(10001);
AddItem(10010);
PartyGold -= 350;
}
else{
Echo("~<c:White>Jaiken~<>:Ihave this bow for you but it seems you dont have enough enough coins for me.");
}
}
else{
Echo("~<c:White>Jaiken~<>:Remember you need a piece of wood and a peice of some other wood in which you can identify for me") +
("to make you a bow.");
}
}

function op24(){
Echo("~<c:White>"+PCName+"~<>: Nothing for now.");
}

function op25(){
Echo("~<c:White>Jaiken~<>:Come back any time.");
}

function op26(){
Echo("~<c:White>"+PCName+"~<>:Nothing for now. Goodbye.");
}


**credit to Throndir for the script I just modified it for myself.**