/*

filename    assassin
password    release
changedby   Darg
EmailAdd    Mark Pringle darg@valhalla.com
request     compile
version     21
END HEADER*/


#define _GUILD_ASSASSIN


#include
#define ASSASSIN_ONGOING "Assassin Quest Ongoing"
#define ASSASSIN_COMPLETE "Assassin Quest Complete"
#define ASSASSIN_QUITTER "Khorsabad Assassin Quitter"
#define ROOM_BASICS \
  movement SECT_INSIDE \
  flags {UNIT_FL_NO_WEATHER, UNIT_FL_INDOORS, UNIT_FL_NO_TELEPORT} \
  ALWAYS_LIGHT
#define ASSASSIN_BASICS \
  race RACE_HUMAN \
  sex SEX_MALE \
  level 120 \
  height 180 \
  weight 145 \
  exp 0 \
  NATURAL_DEF(WPN_FIST, ARM_HLEATHER) \
  alignment -800 \
  money 5 COPPER_PIECE \
  MSET_ABILITY(20,20,10,15,20,5,5,5) \
  MSET_WEAPON(5,15,10,5,5,10) \
  MSET_SPELL(4,4,4,4,4,10,4,4,4,4,4) \
  flags {UNIT_FL_NO_TELEPORT}

%zone assassin
title "Assassins Guild"
lifespan 20
reset RESET_ANYHOW

creators {"Elminster"}

notes
"This is the guild for the assassins.
Email any comments to jmg3128@tam2000.tamu.edu (Elminster).&n
Present caretaker of the guilds can be reached at whistler@valhalla.com.&n
"

help
"This is the infamous guild of the Assassins, the masters of
quick and silent death. Welcome.&n"

%dil

dilbegin nokill();
var
       pc : unitptr;
       room : unitptr;
code
{
       heartbeat := 3 * PULSE_SEC;

       :start:
       wait(SFB_COM,  self.position == POSITION_FIGHTING );
       pc := self.fighting;
       if (pc.level > 200) goto start;
       if (command("flee"))
               block;

self.hp := self.max_hp;
act("At the sounds of battle, black-covered shapes slip quietly into the "+
"room.", A_SOMEONE, pc, self, null, TO_ALL);
act("&c+wA sudden blow in the back of your head sends you spinning into"+
"the murky depths of unconsciousness!&cw",A_SOMEONE,pc,self,null,TO_CHAR);
act("One of them deliverers a sharp blow in the back of $1s head, sending "+
"$1m down to the ground!", A_SOMEONE,pc,self,null,TO_REST);
pc.hp := 0;
act("You feel yourself being dragged away somewhere..."
,A_SOMEONE, pc, self, null, TO_CHAR);
position_update(pc);
act("Two assassins grab $1n and drag him out of the Guild, dumping "+
"$1m in the streets.",A_SOMEONE, pc, self, null, TO_REST);
room := findroom("square@udgaard");
link(pc,room);
act("Two dark-clad shapes appear, dragging an unconscious figure between "+
"them and dump $1m unceremoniously on the street."
,A_SOMEONE,pc,self,null,TO_REST);
       :gone:
unsecure(pc);
goto start;
}
dilend


%rooms
/* ---------------------------- GUILD HALL ------------------------------- */

    entrance
names {"foyer","entrance","assassin guild"}
title "Foyer of the Assassin's Guild"
descr
"   The entire room seems filled with shadow despite many sources of light.
You wonder if the guild is still in operation as no one seems to occupy the
place.  Doorways lead in all directions, including west back out on to the
street."
ROOM_BASICS
flags {UNIT_FL_NO_WEATHER, UNIT_FL_INDOORS}
east to hallway_1;
north to skill_room descr "A dark room.";
south to weapon_room descr "A dark room.";
end

   hallway_1
title "Hallway"
descr
"   This hallway extends east from the foyer.  The dark passage has doorways
leading to rooms to the north and south, an additional doorway leads back west
into the foyer.  The hallway continues to the east."
ROOM_BASICS
west to entrance;
north to ability_room descr "A dark room.";
south to spell_room descr "A dark room.";
east to hallway_2;
end

 hallway_2
title "Hallway"
descr
"  The hallway leads back west, but ends in a wall to the east.  The only
doorway leading from this darkened hall is to the north."
ROOM_BASICS
west to hallway_1;
north to master_room descr "A dark room.";
end

 skill_room
title "The Skill Training Room"
descr
"   A stuffed dummy stands prominently in the center of the shadowed room.
Various other devices fill the room, most seemingly to have some use in
honing an assassin's skills.  A doorway leads south back into the foyer."
extra {"stuffed dummy","dummy"}
"The stuffed dummy is covered with many small bells and is slitted in many
places."
ROOM_BASICS
south to entrance;
end

 weapon_room
title "The Weapon Training Room"
descr
"   Among this shadowed room lies racks of weapons that an assassin would
use.  Charts showing vital parts of many varied monsters show the best
place to place the killing dagger.  Stuffed dummies are marked up with
practice blows."
ROOM_BASICS
north to entrance;
end

 master_room
title "The Guild Master's Room"
descr
"   Shadows fill the corners of this room, providing ample places for someone
to hide.  A desk stands near the north wall, but is currently free of any
adornments.  A board hangs on the east wall."

extra {"board"}
"&l  This is a chalkboard, and written on it are a few imperative commands:
WORSHIP :   To get the Assassin quest, you must worship the master
JOIN :      In order to join this guild, you must complete 'Assassin
     quest'.
INSULT :    Insult the master twice to quit the assassin guild.

&fThe Assassin guild welcomes all people wishing to join us at a cost of
one gold piece.
If you choose to leave this guild and seek your own path of seeing
you must first complete a special service towards the faithful members
of this society as well as pay one platinum piece. Know that
we will not accept you as a member again if you choose to do so."
ROOM_BASICS
south to hallway_2;
end

 spell_room
title "The Training Room of Special Skills"
descr
"   Strange devices fill this room.  Judging from what you see, you guess this
is where assassins train their special skills."
ROOM_BASICS
north to hallway_1;
end

 ability_room
title "Ability Training Room"
descr
"   Various tools fill this room.  There are weights, parallel bars, good
books, and mirrors with makeup.  You wonder if this room is used to train
assassins in their various ability scores.  This room, like all the others,
is dark."
ROOM_BASICS
south to hallway_1;
end

    back_room
names {"back room"}
title "A hidden back room of the Assassin's Guild"
descr
"   Well, I suppose you want something to actually be described here, huh?"
ROOM_BASICS
end

%mobiles
/* ----------------------------- ASSASSINS ------------------------------- */

 master_trainer
names {"ja'afar", "master", "assassin"}
title "the Master Assassin"
descr
"The black-robed Master Assassin can barely be discerned from the shadows."
extra {}
"The Master stays nearly hidden within the shadows.  His cold eyes carefully
watch your movements for any signs of deception."
ASSASSIN_BASICS
exp -100

dilbegin prg1();
var
 pc:   unitptr;
 item: unitptr;
code
{
 :init:
 heartbeat := PULSE_SEC*4;

 :start:
 wait (SFB_CMD, activator.type == UNIT_ST_PC);

 pc := activator;
 if (command("worship"))
 goto stuff;

 else goto start;

:stuff:
   if (pc.guild $= GUILD_ASSASSIN)
   {
     secure(pc,lostpc);
     exec("say Do you feel that you have been a good assassin lately?",
self);
     pause;
     exec("say Well, you obviously haven't been using the proper weapon.",
self);
     pause;
     exec("say take this, if this can't make you kill better, nothing
will. " +
   " go now, and may all your kills be swift.", self);
     pause;
     exec("say and also take this, it will show your membership as an " +
   "Assassin.  Wear it proudly.", self);
     act(" The master Assassin pulls some items from underneath the folds
of " +
  " his cloak and gives it to you.",A_ALWAYS,self,null,null,TO_CHAR);
     item := load ("death_bringer@assassin");
     item.height := pc.height;
     link(item,pc);
     item := load ("dark_talisman@assassin");
     item.height := pc.height;
     link(item,pc);
     unsecure(pc);
     goto start;
   }
   else goto start;

 :lostpc:
 unsecure(pc);
 exec("say How dare that fool leave before I finish!", self);
 exec("emote spits.",self);
 goto start;
}
dilend


special SFUN_GUILD_MASTER
"&lGuild               = ~"+GUILD_ASSASSIN+"~
Guild Enter Quest    = ~~
Guild Enter Cost     = "+(1*GOLD_MULT)+"&n
Guild Leave Quest    = ~~
Guild Leave Cost     = "+(1*PLATINUM_MULT)+"&n
Guild Exclude Quest  = ~~"

special SFUN_GUILD_TITLES
GUILD_ASSASSIN+"&l
the %s the Novice Cutthroat
the %s the Novice Cutthroat
the %s the Cutthroat
the %s the Cutthroat
the %s the Master Cutthroat
the %s the Master Cutthroat
the %s Novice Hitman
the %s Novice Hitman
the %s Hitman
the %s Hitman
the %s Master Hitman
the %s Master Hitman
the %s Hidden Blade
the %s Hidden Blade
the %s Quick Blade
the %s Quick Blade
the %s Shadow Blade
the %s Shadow Blade
the %s Lord of the Shadows
the %s Lady of the Shadows
the %s Silent Strike
the %s Silent Strike
the %s Quick Strike
the %s Quick Strike
the %s Death Strike
the %s Death Strike
the %s Novice Immolator
the %s Novice Immolator
the %s Immolator
the %s Immolator
the %s Master Immolator
the %s Master Immolator
the %s Novice Slayer
the %s Novice Slayer
the %s Slayer
the %s Slayer
the %s Master Slayer
the %s Master Slayer
the %s Assassin
the %s Assassin
the %s True Assassin
the %s True Assassin
the %s Master Assassin
the %s Master Assassin
the %s Ultimate Quick Blade
the %s Ultimate Quick Blade"
dilcopy nokill@assassin();
end

 weapon_trainer
names {"Khaveen", "assassin","teacher","master"}
title "Khaveen"
descr "Khaveen is here to teach you the finer points of weapon use."
extra {}
"You realize that you are standing before one of the greatest masters of
weapon use on the entire continent."
ASSASSIN_BASICS
exp -100
special SFUN_GUILD_BASIS GUILD_ASSASSIN
special SFUN_MEMBERS_ONLY "Khorsabad Assassin#$1n hisses, 'Members only.'"

#define _WEAPON
#include "guilddef.h"
#undef _WEAPON
dilcopy nokill@assassin();
end

 spell_trainer
names {"Aziza","assassin","teacher","woman"}
title "Aziza"
descr "Aziza is here to teach the special skills of the assassins."
extra {}
"One of the most famous women assassins of all ages will assist you in your
training..."
ASSASSIN_BASICS
exp -100
sex SEX_FEMALE
special SFUN_GUILD_BASIS GUILD_ASSASSIN
special SFUN_MEMBERS_ONLY "Khorsabad Assassin#$1n says, 'But you are not a
member.'"

#define _SPELL
#include "guilddef.h"
#undef _SPELL
dilcopy nokill@assassin();
end

 skill_trainer
names {"Ferrari","assassin","teacher"}
title "Ferrari"
descr "Ferrari stands here to teach you the tricks of the trade."
extra {}
"Although slightly ageing, he is still one of the most infamous assassins
of all ages."

ASSASSIN_BASICS
exp -100

special SFUN_GUILD_BASIS GUILD_ASSASSIN
special SFUN_MEMBERS_ONLY "Khorsabad Assassin#$1n says, 'I only educate
assassins.'"

#define _SKILL
#include "guilddef.h"
#undef _SKILL
dilcopy nokill@assassin();
end


 ability_trainer
names {"Sharki","assassin","trainer","teacher"}
title "Sharki"
descr "Sharki stands here waiting to aid your advancement of abilities."
ASSASSIN_BASICS
exp -100

special SFUN_GUILD_BASIS GUILD_ASSASSIN
special SFUN_MEMBERS_ONLY "Khorsabad Assassin#$1n says, 'You are no
assassin.'"

#define _ABILITY
#include "guilddef.h"
#undef _ABILITY
dilcopy nokill@assassin();
end

 assassin_guard
names {"assassin guard","guard","assassin"}
title "an assassin guard"
descr "A vague feeling of being watched washes over you..."
extra {}
"Whoa! If you didn't knew he was there, you'd never seen the guy! Clad
all in black, he watches you intently from the shadows."
ASSASSIN_BASICS
special SFUN_GUILD_BASIS GUILD_ASSASSIN
special SFUN_GUILD_GUARD_WAY
""+"east"+"#"+GUILD_ASSASSIN+"#wharf_3#guard
#A whisper from the shadows stops you 'One step further and you are dead,
$3n...'
#A whisper from the shadows stops $3n 'One step further and you are dead,
$3n...'"
end

 shadow_assassin
names {"shadow assassin", "shadow", "assassin"}
title "the Shadow Assassin"
descr
"The black-robed Shadow Assassin can barely be discerned from the shadows."
extra {}
"The Shadow stays nearly hidden within the shadows.  His cold eyes carefully
watch your movements for any signs of movement."
ASSASSIN_BASICS

dilbegin prg2();
var
 pc:   unitptr;
 item: unitptr;
code
{
 :init:
 heartbeat := PULSE_SEC*4;

 :start:
 wait (SFB_CMD, activator.type == UNIT_ST_PC);
 secure(pc,lostpc);
 pc := activator;
 if (pc.guild $= GUILD_ASSASSIN)
 {
 exec("tell "+pc.name+" Hello, fellow assassin.  Would you like to " +
      "journey to our guild to increase your powerful skills?  Just nod if
" +
      "you wish to go.", self);
 if (command("nod"))
   {
   act("The Shadow Assassin throws a smoke bomb upon the ground, when the "+
"smoke clears you find yourself in a different place!"
,A_ALWAYS,pc,null,null,TO_CHAR);
   act("The Shadow Assassin throws a smoke bomb upon the ground, when the "+
"smoke clears, $1n is gone!",A_ALWAYS,pc,null,null,TO_REST);
   link(pc, findroom("entrance@assassin"));

     }
}
unsecure(pc);
:lostpc:
goto start;
}
dilend

end
 shdw2_assassin

names {"shadow assassin", "shadow", "assassin"}
title "the Shadow Assassin"
descr
"The black-robed Shadow Assassin can barely be discerned from the shadows."
extra {}
"The Shadow stays nearly hidden within the shadows.  His cold eyes carefully
watch your movements for any signs of movement."
ASSASSIN_BASICS

dilbegin prg3();
var
 pc:   unitptr;
 item: unitptr;
code
{
 :init:
 heartbeat := PULSE_SEC*4;

 :start:
 wait (SFB_CMD, activator.type == UNIT_ST_PC);
 secure(pc,lostpc);
 pc := activator;
 if (pc.guild $= GUILD_ASSASSIN)
 {
 exec("say Hello, fellow assassin.  Would you like a lift back to
midgaard? " +
      "Just nod if you wish to go.", self);
 if (command("nod"))
   {
   act("The Shadow Assassin throws a smoke bomb upon the ground, when the "+
"smoke clears you find yourself in a different place!"
,A_ALWAYS,pc,null,null,TO_CHAR);
   act("The Shadow Assassin throws a smoke bomb upon the ground, when the "+
"smoke clears, $1n is gone!",A_ALWAYS,pc,null,null,TO_REST);
   link(pc, findroom("market_sq@midgaard"));

     }
}
unsecure(pc);
:lostpc:
goto start;
}
dilend

end

%objects
/* ------------------------ LIST ------------------------------ */

 captain_dagger
names {"dagger"}
title "a dagger"
descr "A sleek dagger lies here."
extra {}
"The dagger feels like it is meant to kill on specific target but is
otherwise normal."
extra {"$identify"}
"This dagger is designed to kill the captain of the guard in Khorsabad.
Backstab the captain to accomplish your mission.&n"
manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
WEAPON_DEF(WPN_DAGGER, 1, 1)
SKILL_TRANSFER(SKI_BACKSTAB,3)
weight 1

dilbegin prg4();
var
 pc:   unitptr;
 opp:  unitptr;
code
{
 :start:
 wait (SFB_CMD, (activator.type == UNIT_ST_PC) and
  (self.equip == WEAR_WIELD) and
  (command("backstab")));
 if (not(ASSASSIN_ONGOING in activator.quests))
   goto start;
 opp := findunit(activator, argument, FIND_UNIT_SURRO, null);
 if (not((opp.nameidx $= "captain") and (opp.zoneidx $= "midgaard")))
   goto start;
 pc := activator;
 secure(pc, start);

 :loop:
 wait(SFB_COM, TRUE);
 if ((pc.fighting.nameidx $= "captain") and
     (pc.fighting.zoneidx $= "midgaard"))
 {
   act("Blood pours out from the wound in the $3N's back.",
A_HIDEINV, pc, null, pc.fighting, TO_CHAR);
   pc.fighting.hp := 1;
   subextra(pc.quests, ASSASSIN_ONGOING);
   addextra(pc.quests, {ASSASSIN_COMPLETE},"");
   destroy(self);
 }
 else
   goto loop;
}
dilend

end

  dark_talisman
names {"Black Lotus Talisman","talisman","lotus"}
title "a Black Lotus Talisman"
descr "A small talisman in the shape of a black lotus flower lies here."
extra {}
"This dark talisman has been used by assassins for years to show their
membership in the assassin's guild. The black lotus flower is a talisman
of good luck."
extra {"$identify"}
"This talisman can only be worn by assassins and will increase their
agility.&n"
extra {"$improved identify"}
"The bonus to Dex is +1. A dexterity of 20 is required to wear this
talisman.&n"
manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_NECK}
flags {UNIT_FL_MAGIC}
type ITEM_WORN
DEX_TRANSFER(+1)
weight 0
cost 1 IRON_PIECE
rent 50 IRON_PIECE
dilcopy guild_restrict@function({GUILD_ASSASSIN},0,25,"");
dilcopy abi_restrict@function(ABIL_DEX,20,0,0,"");
end



   death_bringer
names {"Death Bringer","short sword","sword","bringer"}
title "Death Bringer"
descr "A black, sleek short sword lies here."
extra {}
"This sleek, elegant weapon is perfectly balanced and razor sharp, perfect
for back stabbing! Engraved upon its side are the words 'Death Bringer',
written in arabic."
extra {"engraving"}
"The arabic letters spell 'Death Bringer'.&n"
extra {"$identify"}
"This powerful weapon will drain the health of your opponent and transfer
it to you..&n"
extra {"$improved identify"}
"This weapon has a craftsmanship and magical modifier of 0."
WEAPON_DEF(WPN_SHORT_SWORD,0,0)
manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
weight 4
cost 1 IRON_PIECE
rent 150 IRON_PIECE
dilcopy guild_restrict@function({GUILD_ASSASSIN},0,25,"");
dilcopy abi_restrict@function(ABIL_DEX,20,0,0,"");


dilbegin death();
var
       storenum        :       integer;        num             :       integer;
       num2            :       integer;
       diff            :       integer;
lev  : integer;
mag_skill : integer;
skill_com : integer;
       dex_skill       :       integer;
sho_skill : integer;
code
{
  :init:
  heartbeat := PULSE_SEC*4;

  :start:
  wait(SFB_COM, ((self.outside.fighting) and
      (self.equip == WEAR_WIELD)));

  if (self.outside.guild $= GUILD_ASSASSIN)
  {
     num2 := rnd(1, 5);
     storenum := self.outside.fighting.max_hp / (4 * num2);      sho_skill := self.outside.weapons[WPN_SHORT_SWORD];
     mag_skill := self.outside.abilities[ABIL_MAG];
     dex_skill := self.outside.abilities[ABIL_DEX];
     skill_com := ((sho_skill + mag_skill + dex_skill) / 3);
     num2 := rnd(0, 99);
     if ((skill_com*num2)/100 >= 25)
     {
        num := rnd(0, 99);
       lev := self.outside.level;
if ((lev*num)/100 >= 15)
        {
           act("Your sword glows as it absorbs your opponents life energy!",
               A_ALWAYS, self.outside, null, null,TO_CHAR);
    act(""+self.outside.name+"'s Death Dealer glows as it steals " +
    "the life force from "+self.outside.fighting.name+".", A_ALWAYS,
    self.outside, null, null, TO_REST);
        }
        else
            pause;
            goto start;

   }
}
}
dilend


end

 master_cape
names {"black cape","cape"}
title "a black velvet cape"
descr "A black cape of soft velvet lies here."
extra {}
"A beautiful and soft cape of black velvet."
manipulate {MANIPULATE_TAKE,MANIPULATE_WEAR_ABOUT}
ARMOUR_CLOTHES(0,0)
weight 1
rent 60 IRON_PIECE
end

 bokken
names {"bokken","katana","sword","replica"}
title "a bokken sword"
descr "A wooden replica of a katana sword lies here."
extra {}
"A wooden replica of a katana sword, used for training purposes only."
manipulate {MANIPULATE_TAKE,MANIPULATE_WIELD}
WEAPON_DEF(WPN_KATANA,-3,0)
cost 1 COPPER_PIECE
weight 2
end

 dark_katana
names {"dark-bladed katana","katana","sword"}
title "a dark-bladed katana"
descr "A dark-bladed katana sword lies here."
extra {}
"The blade of this katana has been covered in some dark, oily substance,
making it black and mate. The handle bears the insignia of the Assassin Guild."
extra {"$identify"}
"This katana will raise your Dexterity as well as your katana skills and
hide skills.&n"
extra {"$improved identify"}
"The katana and hide skills will raise with 3%, Dexterity with 2 points.&n
The katana is a weapon of craftsmanship 5 and magic bonus 5.&n"
manipulate {MANIPULATE_TAKE,MANIPULATE_WIELD}
WEAPON_DEF(WPN_KATANA,0,0)
weight 2
cost 3 GOLD_PIECE
rent 68 IRON_PIECE
dilcopy guild_restrict@function({GUILD_ASSASSIN},0,10,"");
end

 dark_wakiz
names {"dark-bladed wakizashi","wakizashi","sword"}
title "a dark-bladed wakizashi"
descr "A dark-bladed wakizashi sword lies here."
extra {}
"The blade of this wakizashi has been covered in some dark, oily substance,
making it black and mate. The handle bears the insignia of the Assassin Guild."
extra {"$identify"}
"This wakizashi will raise your Dexterity as well as your wakizashi and
hide skills.&n"
extra {"$improved identify"}
"The wakizashi and hide skills will raise with 3%, Dexterity with 2 points.&n
The wakizashi is a weapon of craftsmanship 5 and magic bonus 5.&n"
manipulate {MANIPULATE_TAKE,MANIPULATE_WIELD}
WEAPON_DEF(WPN_WAKIZASHI,0,0)
weight 1
cost 3 GOLD_PIECE
rent 68 IRON_PIECE
dilcopy guild_restrict@function({GUILD_ASSASSIN},0,10,"");
end

%reset


load master_trainer into master_room max 1
{
equip dark_talisman   WEAR_NECK_1
equip master_cape   WEAR_ABOUT
}

load skill_trainer into skill_room max 1
{
equip dark_talisman   WEAR_NECK_1
equip master_cape   WEAR_ABOUT
equip death_bringer   WEAR_WIELD
}

load weapon_trainer into weapon_room max 1
{
equip dark_talisman   WEAR_NECK_1
equip master_cape   WEAR_ABOUT
equip bokken    WEAR_WIELD
}

load spell_trainer into spell_room max 1
{
equip dark_talisman   WEAR_NECK_1
equip master_cape   WEAR_ABOUT
}

load ability_trainer into ability_room max 1
{
equip dark_talisman   WEAR_NECK_1
equip master_cape   WEAR_ABOUT
equip dark_katana   WEAR_WIELD
}

load shadow_assassin into royal_bridge@midgaard max 1
{
   equip dark_talisman                     WEAR_NECK_1
equip dark_katana   WEAR_WIELD
}
load shdw2_assassin into entrance@assassin max 1
{
       equip dark_talisman                     WEAR_NECK_1
equip dark_katana   WEAR_WIELD
}


%end