/*
 * Example of Guild Stat Bonus for Mages of Nirvana
 * This code can be used in an object that inherits
 * obj/armor.c or obj/weapon.c
 *
 * Typical mage bonuses should range from 1 to 5
 * with 1 being the lowest bonus and 5 being the highest
 */

#define MAGE_GUILD_STATS ({"conjuration","enchantment","evocation","illusion","necromancy"})
#define BONUS_AMOUNT	3

string mage_bonus_stat;

/*
 * randomly select which stat is going to be bonused
 * this is done in the intial object setup, ie: reset(), and should not be changed
 */

reset(arg) {
  if(arg) return;
  ::reset(arg);
  /* rest of reset stuff in here ... */
  mage_bonus_stat = MAGE_GUILD_STATS[random(sizeof(MAGE_GUILD_STATS)-1)];
}

query_guild_bonus()
{
	return BONUS_AMOUNT;
}

add_guild_bonus()
{
  if(this_player() && this_player()->query_guild_name() == "mage")
  {
	present("mageobj", this_player())->add_guild_bonus(mage_bonus_stat, BONUS_AMOUNT);
  }
}

remove_guild_bonus()
{
  if(this_player() && this_player()->query_guild_name() == "mage")
  {
	present("mageobj", this_player())->add_guild_bonus(mage_bonus_stat, -BONUS_AMOUNT);
  }
}

