Uh, this should probably go in the subforum for NPC scripting.

Anyway, here's a basic script that'll get you started for your guard NPC.
 Spoiler
PHP Code:
//#CLIENTSIDE //This sets the character look

function onCreated() {
  
this.showCharacter();
  
this.head = "head3.png";
  
this.body = "body2.png";
  
this.attr[1] = "hat49.png";
  
this.dir = 2;
  
this.firing = false;
}
/*
This function is for when the player touches the NPC,
it'll show a message, and face the character.
In scheduleevent, after 5 seconds, it'll call the function to shoot
arrows at whatever direction it was pointing.

this.firing makes sure that you can't repeatedly touch the NPC to keep
it firing.

*/

function onPlayerTouchsMe() {
  if (
this.firing) return;
  
this.firing = true;
  
say2("message here");
  switch (
player.dir) {
  case 
0:
    
this.dir = 2;
    break;
  case 
1:
    
this.dir = 3;
    break;
  case 
2:
    
this.dir = 0;
    break;
  case 
3:
    
this.dir = 1;
    break;
  }
  
scheduleevent(5, "timeToRek");
}
/*With the for loop, the NPC will fire 6 arrows over a time
  of 3 seconds.

*/

function onTimeToRek() {
  for (
i = 0; i <= 5; i++) {
    
shootarrow(this.dir);
    
sleep(.5);
  }
  
this.firing = false;
} 



For your alignment assignment, I'm assuming you're talking about your AP.

You can do something like this to change it:

 Spoiler
PHP Code:
//#CLIENTSIDE

/*
  When the player touches the NPC, it'll assign a number between 0 and 100 as their AP.
  The int() is to round to the nearest integer. You can't set an AP with  decimal points.


*/
function onPlayerTouchsMe() {
  
player.ap = int(random(0, 100));
}

function 
onCreated() {
  
this.showCharacter();
  
this.head = "head3.png";
  
this.body = "body2.png";
  
this.attr[1] = "hat49.png";
  
this.dir = 2;
  
this.chat = "Touch me to set a random AP!";
} 


For those two solutions, you can use a level NPC or class. You'll need to join the class to the NPC though.

To show a message on login, you could use a weapon/class/NPC script for it.
It could go something like this:
 Spoiler
PHP Code:
//#CLIENTSIDE
/*
When the player logins or enters a specific level, and their flag for the tutorial completion if false, it'll display a message.
You'll want to change that whenever they do finish the tutorial so it doesn't keep popping up.
*/
function onPlayerEnters() {
  if (!
clientr.tutorialCompleted) {
    
say2("blahblahblah");
  }
}