[Updated] Tarile

Started by Kazamatta, April 14, 2012, 02:45:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kazamatta

Tarile ownes and operates Fallig Inn, the first place you go, This script goes under the NPC tab( can also be placed under script tab if wanted).

var Tarile = "~<c:Orange>Tarile: ~<>";

function who_jerald(){
  Echo("\n"+Tarile+"He is a blacksmith here in town. All the loggers and farmers here rely on him. He use to be a adventurer, " +
       "but gave it up when his wife died on one adventure they set out on together.");
}

function any_jobs(){
  Echo("\n"+Tarile+"You can do a few odd end jobs like cutting wood or helping the blacksmith Jerald." );
}

function any_adv(){
  Echo("\n"+Tarile+"In this town I do not know of any but people have been hearing strange sounds at night. Jerald claims to " +
       "a good bit of knowlege about the situation. Go and speak to him he might have something for you.");
}


function str_snd(){
  Echo("\n"+Tarile+"Yes people have been hearing really strange sounds when outside at night. There has been a few people go " +
       "and try to find the source of these wierd sounds,but none have returned. I don't know any more than that but Jerald " +
       "claims to have more knowledge of it. You should go and speak to him.");
}

function rooms(){
  if(Switch("MEETING_IN_LIKAIR") == 1){
    Echo("\n"+Tarile+"+Sure I got a room avalible, follow me I'll show you the way to it." );
    PartyGold -= 5;
    Echo("\nThe party lost 5 gold coins");
    BeginOptions();
    AddOption(0,"Continue...","","");
    ProcessOptions();
    Msg("You spend the night at Falling Inn.");
    SetSwitch("MEETING_IN_LIKAIR",0);
    AlterExitVisibility(7896,7894,true);
    Echo("\nYou hear a banging at the door. It's Tarile telling you that it is morning tie and to wake up.");
}
  else{
    Echo("\n"+Tarile+"I am sure you don't plan on sleeping all day now do you?");
    RestParty(10000);
    Echo("You rest enough to restore your endurance and mana");
  }
}


function go_ahead(){
  Echo("\n"+Tarile+"Go ahead. I have no problem answering your questions.");
}

function weapons_here(){
  Echo("\n"+Tarile+"Not that i know of but you can go and talk to Jerald. He might have something he can give you.");
}

function smtn_else(){
  Echo("\n"+Tarile+"Yes. What is it you want to ask?");
}

function all_done(){
  Echo("\n"+Tarile+"OK");
}

function light_needed(){
  Echo("\n"+Tarile+"Light?. Yes, of course. Take this with you.");
  AddItem(9001010);
  SetSwitch("NEED_LIGHT",0);
}

function OnDialog(){
  Echo("\n"+Tarile+"Yes?");
  ClearOptions();
  if( Switch("NEED_LIGHT") == 0 ){
    AddOption(0,"Do you mind if I ask you a few questions?", "go_ahead();","1,5,7,8,3");
    AddOption(1,"Do you know anywhere we can find some weapons and armor?","weapons_here();","2,4,3");
    AddOption(2,"Who is Jerald?","who_jerald();","4,3");
    AddOption(3,"Thank You, that's all I wanted to ask.","all_done();","");
    AddOption(4,"I want to ask something else","smtn_else();","1,5,7,8,3");
    AddOption(5,"Are there any jobs we can do here in town?","any_jobs();","6");
    AddOption(6,"No, I mean something more along the lines of an adventure.","any_adv();","2,4,3");
    AddOption(7,"I heard people hear strange sounds here sometimes.","str_snd();","2,3");
    if(Switch("MEETING_IN_LIKAIR") == 1)
      AddOption(8,"Do you have any rooms to rent?","rooms();","");
    else
      AddOption(8,"We would like to get some rest now.","rooms();","");
  }
  else{
    AddOption(0,"We need some light to enter the mines. Can you help us?", "light();","1");
    AddOption(1,"Thanks","","");
  }
  ProcessOptions();
}

Throndir

It's been awhile since I looked at the specific LT commands. But are you positive you can use Switch like that? I thought Switch was only for Switch-Case, and can't be used as a variable in the sense that you can do that. But I'm not 100% sure either. Have you tried running your scripts and debugging? There was also some script errors I see in this.

Kazamatta

I put it in there and it wan't the problem all my errors was mainly leaving out certain symbols when typing because I got so much wrote down that i can just have it laid out on table and use other scripts i did similar for quick reference.