/
lib/banish/
lib/d/coronos/
lib/d/coronos/w/alena/
lib/d/coronos/w/angel/
lib/d/coronos/w/angel/caves/
lib/d/coronos/w/angel/caves/monst/
lib/d/coronos/w/angel/city/chambers/
lib/d/coronos/w/angel/city/monst/
lib/d/coronos/w/angel/city/obj/
lib/d/coronos/w/angel/city/streets/
lib/d/coronos/w/angel/farms/plains/
lib/d/coronos/w/angel/monst/
lib/d/tempus/
lib/d/tempus/w/angel/
lib/d/tempus/w/kingbill/
lib/d/tempus/w/mirak/
lib/d/tempus/w/mirak/monst/
lib/d/tempus/w/mirak/obj/
lib/d/tempus/w/relgar/planes/baat/
lib/d/tempus/w/sarak/
lib/d/tempus/w/serepion/mon/
lib/d/tempus/w/valrejn/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/include/fn_specs/
lib/info/
lib/inherit/base/
lib/log/
lib/log/mailbox/
lib/log/main/
lib/news/
lib/obj/party/
lib/objects/componen/
lib/open/
lib/open/party/
lib/open/paste/
lib/open/spells/
lib/open/valrejn/
lib/players/
lib/players/alena/
lib/players/alena/obj/
lib/players/alena/open/
lib/players/alena/private/
lib/players/angel/
lib/players/angel/obj/
lib/players/ash/
lib/players/biggs/
lib/players/biggs/food/
lib/players/biggs/gobkeep/
lib/players/biggs/mnstr/
lib/players/biggs/town/caves/
lib/players/biggs/town/tower/
lib/players/biggs/wpns/
lib/players/calris/
lib/players/deathurg/
lib/players/deathurg/open/
lib/players/deathurg/private/thief/
lib/players/dogberry/
lib/players/dogberry/library/
lib/players/dogberry/open/
lib/players/epsilon/
lib/players/epsilon/private/
lib/players/farewell/
lib/players/hippo/
lib/players/hippo/open/
lib/players/hippo/tools/
lib/players/jimpa/
lib/players/josh/
lib/players/josh/room/
lib/players/josh/room/mage/dungeon/
lib/players/josh/room/mage/dungeon/obj/
lib/players/josh/wep/
lib/players/kingbill/
lib/players/metatron/
lib/players/miette/
lib/players/mirak/
lib/players/mirak/open/
lib/players/parsilan/
lib/players/relgar/
lib/players/relgar/private/
lib/players/sarak/
lib/players/sarak/bugs/
lib/players/sarak/feelings/
lib/players/sarak/magical/
lib/players/sarak/minotaur/island/
lib/players/sarak/open/
lib/players/sarak/private/
lib/players/serepion/
lib/players/serepion/open/
lib/players/serepion/private/
lib/players/spike/
lib/players/spike/open/
lib/players/spike/private/
lib/players/spike/seaworld/
lib/players/valrejn/
lib/players/valrejn/open/
lib/players/valrejn/private/
lib/players/virus/
lib/players/wrath/
lib/players/wrath/arm/
lib/players/wrath/mon/
lib/players/wrath/room/
lib/players/wrath/room/entry/
lib/players/wrath/room/zolgath/
lib/players/wrath/weap/
lib/players/zil/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/library/
lib/room/city/library/open/books/
lib/room/city/shop/
lib/room/death/
lib/room/death/open/
lib/room/island/
lib/room/keeps/
lib/room/registry/
lib/room/ships/crew/
lib/room/ships/open/
lib/room/ships/open/types/bounty/
lib/room/ships/open/types/nebula/
lib/room/ships/open/types/phoenix/
lib/secure/udp_cmd_/
lib/skills/
lib/skills/fighter/
lib/skills/psionici/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/no_banis/
lib/usr/players/
/* Aurora - Chosen Prophet of the All-God
 */
#include <mudlib.h>
#define OBJ	"d/coronos/w/angel/city/obj"

status cure_wounds();
status cure_disease();
status dispel_magic();
int calc_money(int amount);

inherit MONSTER;
object symb;


void reset(status arg) {
  ::reset(arg);
  if(arg) return;

  set_name("aurora");
  set_gender(2);
  set_magic_resist(75);
  set_wc(30);
  set_level(30);
  set_ac(30);
  set_short("High priestess Aurora, servant of the All-God");
  set_long(
     "With blue eyes and a young delicate face, there is an eternal   \n"+
     "peace within this young woman. Even though only in her youth     \n"+
     "she is the most powerful cleric, one chosen by the most powerful \n"+
     "of all gods - the All-God.\n");

  load_spells(30, ({ "cure serious wounds",
	"cure light wounds",
	"curse",
	"bless",
	"call lightning",
	"flamestrike",
	"holy strike",
	"cure critical wounds",
	"barkskin",
	"holy word",
	"starburst",
  }));


  load_chat(5, ({ "Aurora says: Welcome child.\n",
     "Aurora prays before the altar.\n",
     "Aurora prays earnestly.\n",
     "Aurora says: have you come to pray, my child?\n",
     "Aurora smiles happily.\n",
     "Aurora says: Worship with me, my child.\n"
  }));

  load_a_chat(8, ({ "Aurora says: My Lord will protect me.\n",
     "Aurora exclaims: Oh Lord, protect me.\n",
     "Aurora says: The All-God will strike you down.\n",
     "Aurora asks: Why do you attack me?\n"
  }));
  
  move_object(clone_object(OBJ+"/ring"), this_object());
  move_object(clone_object(OBJ+"/mace"), this_object());
  init_command("wield mace");
  init_command("wear ring");

  symb = clone_object(ARMOUR);
  symb -> set_type("amulet");
  symb -> set_name("symbol");
  symb -> set_ac(1);
  symb -> set_weight(1);
  symb -> set_value(300);
  symb -> set_short("A holy symbol");  
  symb -> set_alias("holy symbol");
  symb -> set_long(
     "This is a platinum holysymbol to the All-God. It gives off a \n"+
     "soft light and is perhaps magical in nature.\n");
  move_object(symb, this_object());
  init_command("wear symbol");

}
void init() {
  ::init();
  call_out("welcome", 1, this_player());
  add_action("pray", "pray");
}

hit_player() {
  object obj;
  obj = this_player();
  if(obj -> query_level() < 15) {
    this_object() -> stop_all_fight();
    this_player() -> stop_all_fight();
    say("Aurora says: I wouldn't do that if I were you "+ 
        obj->query_name() +"\n");
    return 0;
  }
}

void welcome(object obj) {
    if(this_player()->query_ghost()) {
      write("Aurora exclaims: I shall pray to the All-God to raise you!\n");
      obj->toggle_ghost();
      return;
    }
    say("Aurora says: Welcome, "+ this_player()->query_name() +". "+
        "Please worship with me.\n");
    return;
}

status pray() {
  if(!this_player()->query_ghost()) {
    write("Aurora says: I can offer you the following services.\n\n"+
          "Cure Light Wounds......100 coins \n"+
          "Cure Disease...........200 coins \n"+
          "Dispel Magic...........500 coins \n"+
          "Aurora says: Tell me which service you wish, "+
           this_player()->query_name() +"?\n");
    return 1;
  }
  this_player()->toggle_ghost();
  return 1;
}


void catch_tell(string str) {
  call_out("delay_catch",1,str);
}

void delay_catch(string str) {
  string tmp1, tmp2;
  
  if(this_object()->query_attack()) return;
  if(environment(this_player()) != environment()) {
    if(sscanf(str, "%stell%s", tmp1, tmp2)) {
      write("Aurora says: I hear you. But my powers can only be given "+
            "in my presence.\n");
    }
    return;
  }
  if(sscanf(str, "%scure light wounds%s", tmp1, tmp2)) {
    cure_wounds();
  }
  else if(sscanf(str, "%scure disease%s", tmp1, tmp2)) {
    cure_disease();
  }
  else if(sscanf(str, "%sdispel magic%s", tmp1, tmp2)) {
    dispel_magic();
  }
  else if(sscanf(str, "%shullo%s", tmp1, tmp2)) {
    say("Aurora says: Hullo, my child.\n");
  }
}

status cure_wounds() {
  int mon;
  mon = 100;

  mon = calc_money(100);

  if(this_player()->query_money() < mon) {
    write("Aurora says: But you don't have enough money for the donation.\n");
    return 1;
  }
  say("Aurora begins a silent prayer.\n");
  say("Aurora touches the wounds of "+ this_player()->query_name() +"\n"+
  this_player()->query_possessive() +" wounds are healed.\n", this_player());

  tell_object(this_player(), "Aurora touches your wounds.\n"+
                             "You are healed.\n");
  this_player()->add_money(-mon);
  this_player()->adj_hp(2 * (random(4) + 1));
  return 1;
}

status cure_disease() {
  object disease;
  int mon;
  mon = calc_money(200);

  if(this_player()->query_money() < mon) {
    say("Aurora says: But you don't have enough money for the donation.\n");
    return 1;
  }
  if(present("Disease", this_player()));
    disease = present("Disease", this_player());
  if(!disease) {
    say("Aurora says: But you have no diseases, "
        + this_player()->query_name() +"\n");
    return 1;
  }
  say("Aurora begins a silent prayer.\n");
  say("Aurora lays her hands upon "+ this_player()->query_name()
     +" and\nheals "+ this_player()->query_possessive()
     +" diseases.\n", this_player());

  tell_object(this_player(), "Aurora lays her hands on you and "+
    "cures your diseases.\n");
  this_player()->add_money(-mon);
  destruct(disease);
  return 1;
}

status dispel_magic() {
  int i, j;
  int mon;
  object *obj;

  mon = calc_money(500);
  obj = all_inventory(this_player());

  if(this_player()->query_money() < 500) {
    say("Aurora says: But you don't have enough money for the donation.\n");
    return 1;
  }
  say("Aurora begins a silent prayer.\n");
  for(i=0; i<sizeof(obj); i++) {
    if(obj[i] -> dispel_magic()) {
      if(obj[i] -> short())
        say(obj[i] -> short() +" is dispelled.\n");
      else
        say("Something is dispelled.\n");
      j++;
    }
  }
  if(!j) {
    say("Nothing happens.\n");
  }
  this_player()->add_money(-mon);
  return 1;
}

int calc_money(int amount) {
  int bargain, my_stat;

  bargain = (int)this_player()->query_charisma();
  my_stat = 12;

  if(random(bargain) > random(my_stat)) 
    amount -= amount/4;
  else
    amount += amount/3;

  write(query_name()+" haggles with you over the price.\n");
  write(query_name()+" takes "+MONEY->convert(amount)+" coins for "+
  query_possessive()+" prayers.\n");
  return amount;
}