#include #include "artefact.h" /* John May's Artefact scrambler This code isnt copyright and can be used/changed/edited etc.. by anyone who wished to do so. All I ask is my name is still credited with any work/program etc produced. V:1.1 21:02:97 First written. V:1.2 04:03:97 Fixed Preset artefact rarities. Fixed Calris -20 to hit Changed levels to level + rand(9) Changed from using my memory library to malloc for non pc compilers Changed the insert mods a little. Changes the INT/STR/WIS/CHAR/DEX to 2 at the start Changed Blows to max of 2 V:1.3 05:03:97 Changed my random to C Changed the progam to just use one c file no linking and 100% Ansi for those lovely Unix type people!. Makes the main file a bit messy but easy to compile. V:1.4 11:03:97 Thanks to Frank Muzzulini & Tom Konrad for input, and bug spotting. Fixed a bug trashing AC values on cloaks and some armour. Changed my random name allocation code. Changed blows to only work on weapons. Changed speed to only work on light items. Made the code a bit more Unix friendly. Tweaked here and there. Fixed VERY RARE items with no powers. Toned down the speed items ( happy now Tom ??? ) V:1.5 13:03:97 Changed the way curse items work. Made telepathy more likely on Helms. Move the bows levels a little. Took #brands/slays off bows and insert extra shots etc.. Only blessed non priestly type weapons Updated to 2.8.1. V:1.6 19:03:97 Moved some the powers insertion levels a bit deeper. After extensive playtesting 2500 feet+ and 2 GCV's. I found the resists on the better armors to be lacking. I have now changed the way resists are inserted making them MORE likley to appear on armour than weapons. Made sure Items cant have more than one Immunity. V:1.7 18:06:97 Fixed The Glaive of pain to 2d6. Thanks for that one Greg! V:1.8 07:07:97 Made Blessed weapons have Wis Bonus. Made Brands/Resists make more sense Made To Hits and Damage on Weapons More Random. Made Weapons of Extra Base Damage. Made Con More Likely on Armour. */ #define POWERS_PER_ITEM 4 #define POWERS_LEVEL_DIVIDE 15 /************************************************************************************************/ artefact *first_artefact_ptr; artefact *artefact_ptr; artefact *temp_ptr; FILE *fp; char buffer[64]; char buffer1[64]; char buffer2[64]; char buffer3[64]; char buffer4[64]; char buffer5[64]; char buffer6[256]; char buffer7[256]; uword names_buffer[ART_MAX-1]; /************************************************************************************************/ void main(void) { uword seed; uword count; uword num; /* Get Random Seed */ printf("Input seed 0-65535\n"); scanf ("%d",&seed); /* Init Random */ srand(seed); /* Open File and print header random */ init_file(); /* Create artefacts in Ram */ init_artefacts(); /* Start inserting powers */ printf("Inserting Free Action\n"); insert_powers(80,FREE_ACT,15,20,1); insert_powers(30,FREE_ACT,8,12,1); insert_powers(15,FREE_ACT,4,8,1); printf("Inserting Resist Fire\n"); insert_resists(60,RES_FIRE,17,22,2); insert_resists(40,RES_FIRE,10,15,2); insert_resists(25,RES_FIRE,8,10,2); printf("Inserting Resist Cold\n"); insert_resists(60,RES_COLD,15,20,2); insert_resists(40,RES_COLD,13,15,2); insert_resists(25,RES_COLD,8,10,2); printf("Inserting Resist Elec\n"); insert_resists(60,RES_ELEC,5,10,2); insert_resists(40,RES_ELEC,5,9,2); insert_resists(25,RES_ELEC,5,7,2); printf("Inserting Resist Acid\n"); insert_resists(60,RES_ACID,12,15,2); insert_resists(40,RES_ACID,8,10,2); insert_resists(25,RES_ACID,6,8,2); printf("Inserting Fire Brand\n"); insert_powers(55,BRAND_FIRE,8,10,1); insert_powers(30,BRAND_FIRE,4,5,1); printf("Inserting Cold Brand\n"); insert_powers(55,BRAND_COLD,8,10,1); insert_powers(30,BRAND_COLD,4,5,1); printf("Inserting Elec Brand\n"); insert_powers(55,BRAND_ELEC,2,3,1); insert_powers(30,BRAND_ELEC,2,3,1); printf("Inserting See Invisible\n"); insert_powers(100,SEE_INVIS,8,15,1); insert_powers(30,SEE_INVIS,20,25,1); insert_powers(15,SEE_INVIS,3,5,1); printf("Inserting Lights\n"); insert_powers(40,LITE,5,5,1); insert_powers(25,LITE,5,5,1); insert_powers(15,LITE,5,5,1); printf("Inserting Regeneration\n"); insert_powers(100,REGEN,10,15,1); insert_powers(50,REGEN,20,25,1); printf("Inserting Aggravate\n"); insert_powers(80,AGGRAVATE,2,3,1); insert_powers(60,AGGRAVATE,1,3,1); insert_powers(40,AGGRAVATE,1,3,1); printf("Inserting ESP\n"); insert_powers(70,TELEPATHY,1,2,1); insert_powers(40,TELEPATHY,2,3,1); insert_powers(25,TELEPATHY,1,1,1); printf("Inserting Slay Animal\n"); insert_powers(55,SLAY_ANIMAL,3,5,2); insert_powers(30,SLAY_ANIMAL,8,10,2); printf("Inserting Slay Undead\n"); insert_powers(80,SLAY_UNDEAD,8,10,2); insert_powers(50,SLAY_UNDEAD,2,4,2); printf("Inserting Slay Demon\n"); insert_powers(90,SLAY_DEMON,5,7,2); insert_powers(40,SLAY_DEMON,5,7,2); printf("Inserting Slay Orc\n"); insert_powers(70,SLAY_ORC,4,6,2); insert_powers(35,SLAY_ORC,18,20,2); printf("Inserting Slay Troll\n"); insert_powers(70,SLAY_TROLL,4,6,2); insert_powers(35,SLAY_TROLL,20,25,2); printf("Inserting Slay Gaint\n"); insert_powers(70,SLAY_GIANT,2,4,2); insert_powers(50,SLAY_GIANT,6,8,2); printf("Inserting Slay Evil\n"); insert_powers(80,SLAY_EVIL,8,10,2); insert_powers(30,SLAY_EVIL,10,15,2); printf("Inserting Slay Dragon\n"); insert_powers(80,SLAY_DRAGON,2,4,2); insert_powers(40,SLAY_DRAGON,4,6,2); printf("Inserting Kill Dragon\n"); insert_powers(70,KILL_DRAGON,1,2,2); insert_powers(40,KILL_DRAGON,6,8,2); printf("Inserting Hold Life\n"); insert_powers(80,HOLD_LIFE,4,7,2); insert_powers(30,HOLD_LIFE,1,2,2); printf("Inserting Resist Shards\n"); insert_resists(85,RES_SHARDS,1,2,2); insert_resists(30,RES_SHARDS,2,4,2); printf("Inserting Resist Blind\n"); insert_resists(100,RES_BLIND,1,1,2); insert_resists(40,RES_BLIND,5,7,2); printf("Inserting Resist Confusion\n"); insert_resists(75,RES_CONF,3,5,2); insert_resists(30,RES_CONF,3,5,2); printf("Inserting Resist Lite\n"); insert_resists(100,RES_LITE,8,12,2); insert_resists(40,RES_LITE,6,8,2); printf("Inserting Resist Sound\n"); insert_resists(100,RES_SOUND,1,2,2); insert_resists(35,RES_SOUND,2,3,2); insert_resists(25,RES_SOUND,1,2,2); printf("Inserting Resist Nexus\n"); insert_resists(100,RES_NEXUS,2,3,2); insert_resists(50,RES_NEXUS,2,3,2); insert_resists(40,RES_NEXUS,1,2,2); insert_resists(30,RES_NEXUS,1,1,2); printf("Inserting Resist Posion\n"); insert_resists(100,RES_POIS,2,2,2); insert_resists(60,RES_POIS,2,2,2); insert_resists(30,RES_POIS,2,2,2); insert_resists(20,RES_POIS,1,1,2); printf("Inserting Resist Dark\n"); insert_resists(100,RES_DARK,5,7,2); insert_resists(40,RES_DARK,3,3,2); printf("Inserting Resist Chaos\n"); insert_resists(100,RES_CHAOS,1,1,2); insert_resists(80,RES_CHAOS,1,1,2); insert_resists(70,RES_CHAOS,1,2,2); insert_resists(40,RES_CHAOS,1,2,2); insert_resists(30,RES_CHAOS,1,2,2); printf("Inserting Resist Nether\n"); insert_resists(100,RES_NETHER,2,3,2); insert_resists(40,RES_NETHER,2,2,2); insert_resists(25,RES_NETHER,1,2,2); printf("Inserting Resist Disenchant\n"); insert_resists(100,RES_DISEN,1,1,2); insert_resists(80,RES_DISEN,1,2,2); insert_resists(40,RES_DISEN,1,2,2); insert_resists(30,RES_DISEN,1,1,2); insert_resists(20,RES_DISEN,1,1,2); printf("Inserting Fire Immunitiy\n"); insert_powers(100,IM_FIRE,1,1,2); insert_powers(90,IM_FIRE,1,1,2); insert_powers(80,IM_FIRE,1,1,2); printf("Inserting Cold Immunitiy\n"); insert_powers(100,IM_COLD,1,1,2); insert_powers(70,IM_COLD,1,1,2); insert_powers(50,IM_COLD,1,1,2); printf("Inserting Elec Immunitiy\n"); insert_powers(90,IM_ELEC,1,1,2); insert_powers(80,IM_ELEC,1,2,2); insert_powers(30,IM_ELEC,1,2,2); printf("Inserting Acid Immunitiy\n"); insert_powers(60,IM_ACID,1,1,2); insert_powers(50,IM_ACID,1,2,2); insert_powers(40,IM_ACID,1,2,2); printf("Inserting Tunnel\n"); insert_powers((random_range(1,80)),TUNNEL,1,1,1); printf("Inserting Speed\n"); insert_mods(random_range(70,80),SPEED,1,10,15,10); insert_mods(random_range(60,70),SPEED,1,10,15,10); insert_mods(random_range(50,60),SPEED,1,10,12,10); insert_mods(random_range(40,50),SPEED,1,5,10,10); insert_mods(random_range(30,40),SPEED,1,5,10,10); insert_mods(random_range(25,30),SPEED,1,1,5,10); insert_mods(random_range(20,25),SPEED,1,1,5,10); printf("Inserting Infra\n"); insert_mods(20,INFRA,5,2,5,5); printf("Inserting Stealth\n"); insert_mods(5,STEALTH,5,1,4,5); insert_mods(20,STEALTH,5,1,4,10); insert_mods(50,STEALTH,5,1,4,15); printf("Inserting Wis\n"); insert_mods(30,WIS,14,1,2,7); insert_mods(60,WIS,14,2,4,10); printf("Inserting Blessed\n"); insert_powers(100,BLESSED,1,1,1); insert_powers(90,BLESSED,1,1,1); insert_powers(80,BLESSED,1,1,1); insert_powers(70,BLESSED,1,1,1); insert_powers(60,BLESSED,1,1,1); insert_powers(50,BLESSED,1,1,1); insert_powers(40,BLESSED,1,1,1); insert_powers(30,BLESSED,1,1,1); insert_powers(20,BLESSED,1,1,1); printf("Inserting Int\n"); insert_mods(20,INT,10,2,2,7); insert_mods(50,INT,10,2,3,10); printf("Inserting Dex\n"); insert_mods(35,DEX,16,2,3,7); insert_mods(60,DEX,16,3,4,10); printf("Inserting Str\n"); insert_mods(30,STR,15,2,3,7); insert_mods(70,STR,15,3,4,7); printf("Inserting Slow Digest\n"); insert_powers(90,SLOW_DIGEST,6,8,1); insert_powers(30,SLOW_DIGEST,7,10,1); printf("Inserting Feather Fall\n"); insert_powers(60,FEATHER,2,2,2); insert_powers(45,FEATHER,2,4,2); insert_powers(20,FEATHER,3,4,2); printf("Inserting Chr\n"); insert_mods(5,CHR,9,1,2,7); insert_mods(50,CHR,9,2,3,10); printf("Inserting Con\n"); insert_mods(40,CON,14,2,3,8); insert_mods(80,CON,14,3,4,10); printf("Inserting Blows\n"); insert_mods(30,BLOWS,3,1,2,10); insert_mods(60,BLOWS,3,2,2,15); printf("Inserting Sust Str\n"); insert_powers(70,SUST_STR,2,3,1); insert_powers(45,SUST_STR,2,4,1); printf("Inserting Sust Dex\n"); insert_powers(80,SUST_DEX,2,3,1); insert_powers(35,SUST_DEX,4,5,1); printf("Inserting Sust Int\n"); insert_powers(70,SUST_INT,2,3,1); insert_powers(20,SUST_INT,2,3,1); printf("Inserting Sust Wis\n"); insert_powers(80,SUST_WIS,2,3,1); insert_powers(45,SUST_WIS,2,3,1); printf("Inserting Sust Con\n"); insert_powers(70,SUST_CON,2,3,1); insert_powers(55,SUST_CON,2,3,1); printf("Inserting Sust Chr\n"); insert_powers(70,SUST_CHR,1,1,1); insert_powers(30,SUST_CHR,1,2,1); printf("Inserting Cursed\n"); /* CURSE A GLOVES */ insert_curse(random_range(52,59),random_range(3,5),random_range(3,5),10,1,"of Shadows"); /* CURSE AN ARMOUR */ insert_curse(random_range(19,25),0,0,20,1,"of Mordor"); /* CURSE A CROWN */ insert_curse(random_range(35,42),0,0,10,1,"of Gorthaur"); /* CURSE A CLOAK */ insert_curse(random_range(44,50),0,0,15,1,"of Gorgoroth"); /* CURSE AN EDGED WEAPON */ insert_curse(random_range(64,91),random_range(5,10),random_range(5,10),0,1,"of Utumno"); /* CURSE A HAFTED WEAPON */ insert_curse(random_range(112,122),random_range(5,10),random_range(5,10),0,1,"of The Nazgul"); scramble_weapons(); /* Start printing artefact to a_info.new file */ artefact_ptr = first_artefact_ptr; count = 0; do { sprintf(buffer6,""); sprintf(buffer7,""); activate_artefact(); if (count <12) { if (strlen(buffer6) > 2) { strcat(buffer6,"| INSTA_ART "); } else { strcat(buffer6,"F:INSTA_ART "); } } /* Preset artefacts */ if (artefact_ptr->artefact_number == ART_GROND) { artefact_ptr->artefact_gold = 500000; artefact_ptr->artefact_level = 100; artefact_ptr->artefact_rarity = 1; artefact_ptr->artefact_num_powers = 1; strcpy(artefact_ptr->artefact_name,"'Grond'"); sprintf(buffer6,"F:KILL_DRAGON | SLAY_ANIMAL | SLAY_EVIL | IMPACT | SLAY_UNDEAD | SLAY_DEMON | SLAY_TROLL |"); sprintf(buffer7,"F:SLAY_ORC | RES_ACID | RES_ELEC | RES_FIRE | RES_COLD | SEE_INVIS | TELEPATHY | AGGRAVATE | SHOW_MODS | INSTA_ART"); } if (artefact_ptr->artefact_number == ART_POWER) { artefact_ptr->artefact_level = 100; artefact_ptr->artefact_gold = 5000000; artefact_ptr->artefact_stat_mod = 5; artefact_ptr->artefact_num_powers = 1; artefact_ptr->artefact_rarity = 100; strcpy(artefact_ptr->artefact_name,"of Power (The One Ring)"); sprintf(buffer6,"F:STR | INT | WIS | DEX | CON | CHR | SPEED | HIDE_TYPE | ACTIVATE | CURSED | HEAVY_CURSE | PERMA_CURSE | SUST_INT | SUST_WIS"); sprintf(buffer7,"F:AGGRAVATE | DRAIN_EXP | SEE_INVIS | REGEN | IM_FIRE | IM_COLD | IM_ELEC | IM_ACID | SUST_STR | SUST_DEX | SUST_CON | INSTA_ART | SUST_CHR "); } if (artefact_ptr->artefact_number == ART_MORGOTH) { artefact_ptr->artefact_level = 100; artefact_ptr->artefact_gold = 10000000; artefact_ptr->artefact_stat_mod = 125; artefact_ptr->artefact_rarity = 1; artefact_ptr->artefact_num_powers = 1; strcpy(artefact_ptr->artefact_name,"of Morgoth"); sprintf(buffer6,"F:STR | INT | WIS | DEX | CON | CHR | INFRA | HIDE_TYPE | RES_ACID | RES_ELEC | RES_FIRE | RES_COLD | RES_POIS | RES_LITE | RES_DARK "); sprintf(buffer7,"F:RES_CONF | RES_NEXUS | LITE | SEE_INVIS | TELEPATHY | CURSED | HEAVY_CURSE | PERMA_CURSE INSTA_ART"); } if ((artefact_ptr->artefact_num_powers == 0) && (count != 0)) { /* FUDGE IF ITEM HAS NO POWER GIVE IT A RESIST (NOT TOO POWERFUL) */ num = (1 << (random_range(5, 15))); artefact_ptr->artefact_flags2 |= num; artefact_ptr->artefact_gold += 2000; } if (artefact_ptr->artefact_number >= ART_BELTHRONDING) { if (strlen(buffer7) < 2) { strcat(buffer7,"F:"); } else { strcat(buffer7,"| "); } if (random_range(1,100) < 50) { strcat(buffer7,"XTRA_SHOTS "); } else { strcat(buffer7,"XTRA_MIGHT "); } } print_artefact(); save_artefact(); artefact_ptr = artefact_ptr->artefact_next; count++; } while (artefact_ptr != NULL); fclose(fp); /* Free Memory usage */ artefact_ptr = first_artefact_ptr; while (artefact_ptr != NULL) { temp_ptr = artefact_ptr; artefact_ptr = artefact_ptr->artefact_next; free(temp_ptr); } /* Bye Bye... */ printf("All Done!\n"); printf("a_info.new produced.\n"); printf("Version 2.8.1 Angband assumed.\n"); printf("Edit the a_info.new for insctructions and to change the version number.\n"); printf("Any Problems/Questions Contact johnmay@claranet.co.uk\n\n"); printf("Enjoy...\n"); } void init_artefacts(void) { uword loop,num,tmp; artefact_init **artefact_list_ptr; artefact_init *artefact_init_ptr; first_artefact_ptr = NULL; for(loop=0; loop <= ART_MAX-1; loop++) { names_buffer[loop] = loop; } for(loop=0; loop <= ART_MAX-2; loop++) { num = random_range(loop, ART_MAX-1); tmp = names_buffer[loop]; names_buffer[loop] = names_buffer[num]; names_buffer[num] = tmp; } first_artefact_ptr = NULL; artefact_list_ptr = artefact_ptrs; for (loop = 0;loop < ART_MAX;loop++) { artefact_ptr = alloc_artefact(); if (artefact_ptr == NULL) { printf("Cannot Allocate Ram!"); exit(0); } artefact_init_ptr = artefact_ptrs[loop]; artefact_ptr->artefact_idx = loop; artefact_ptr->artefact_number = artefact_init_ptr->a_number; artefact_ptr->artefact_class = artefact_init_ptr->a_class; artefact_ptr->artefact_type = artefact_init_ptr->a_type; artefact_ptr->artefact_level = artefact_init_ptr->a_level; artefact_ptr->artefact_gold = 1000; if (loop != 0) { artefact_ptr->artefact_level += random_range(0,9); } if (artefact_ptr->artefact_level > 90) { artefact_ptr->artefact_level = 90; } artefact_ptr->artefact_rarity = (artefact_init_ptr->a_level/2)+1; artefact_ptr->artefact_weight = artefact_init_ptr->a_weight; artefact_ptr->artefact_base_ac = artefact_init_ptr->a_base_ac; artefact_ptr->artefact_to_hit = artefact_init_ptr->a_to_hit; artefact_ptr->artefact_to_damage = artefact_init_ptr->a_to_damage; artefact_ptr->artefact_to_ac = artefact_init_ptr->a_to_ac; artefact_ptr->artefact_flags2 = artefact_init_ptr->a_flags; num = names_buffer[loop]; strcpy (artefact_ptr->artefact_name,valar_names[num]); } } void print_artefact(void) { uword loop; ulong num,flag; sprintf(buffer1,artefact_names[artefact_ptr->artefact_idx]); sprintf(buffer2,"N:%d:%s",artefact_ptr->artefact_number,artefact_ptr->artefact_name); sprintf(buffer3,"I:%d:%d:%d",artefact_ptr->artefact_class,artefact_ptr->artefact_type,artefact_ptr->artefact_stat_mod); sprintf(buffer4,"W:%d:%d:%d:%d",artefact_ptr->artefact_level,artefact_ptr->artefact_rarity,artefact_ptr->artefact_weight,artefact_ptr->artefact_gold); sprintf(buffer,artefact_damages[artefact_ptr->artefact_idx]); if (artefact_ptr->artefact_extra_damage != 0) { if ((*buffer-'0') + artefact_ptr->artefact_extra_damage <= 9) { printf("Extra %d to damage dice on weapon ",artefact_ptr->artefact_extra_damage); printf("%s\n",artefact_ptr->artefact_name); *buffer += artefact_ptr->artefact_extra_damage; } } sprintf(buffer5,"P:%d:%s:%d:%d:%d",artefact_ptr->artefact_base_ac,buffer,artefact_ptr->artefact_to_hit,artefact_ptr->artefact_to_damage,artefact_ptr->artefact_to_ac); if (artefact_ptr->artefact_flags1 != 0) { if (strlen(buffer6) == 0) { sprintf(buffer6,"F:"); } flag = 1; for (loop = 0;loop <=31;loop++) { num = artefact_ptr->artefact_flags1; num &= flag; if (num != 0) { if (strlen(buffer6) > 2) { strcat(buffer6,"| "); } strcat(buffer6,flags1_name[loop]); strcat(buffer6," "); } flag <<= 1; } } if (artefact_ptr->artefact_flags2 != 0) { if (strlen(buffer7) == 0) { sprintf(buffer7,"F:"); } flag = 1; for (loop = 0;loop <=31;loop++) { num = artefact_ptr->artefact_flags2; num &= flag; if (num != 0) { if (strlen(buffer7) > 2) { strcat(buffer7,"| "); } strcat(buffer7,flags2_name[loop]); strcat(buffer7," "); } flag <<= 1; } strcat(buffer7,"\n"); } } void save_artefact(void) { fputs(buffer1,fp); fputs("\n\n",fp); fputs(buffer2,fp); fputs("\n",fp); fputs(buffer3,fp); fputs("\n",fp); fputs(buffer4,fp); fputs("\n",fp); fputs(buffer5,fp); fputs("\n",fp); fputs(buffer6,fp); if (strlen(buffer6) > 0) { fputs("\n",fp); } fputs(buffer7,fp); fputs("\n\n",fp); } void activate_artefact(void) { /* A bit Naff but there you go. It works... */ if (artefact_ptr->artefact_number == ART_NARTHANC) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_NIMTHANC) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_DETHANC) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_RILIA) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_BELANGIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_DAL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_RINGIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_ANDURIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_FIRESTAR) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_FEANOR) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_THEODEN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_TURMIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_CASPANION) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_AVAVIR) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_TARATOL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_ERIRIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_OLORIN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_EONWE) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_LOTHARANG) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_CUBRAGOL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_ARUNRUTH) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_AEGLOS) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_OROME) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_SOULKEEPER) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_BELEGENNON) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_CELEBORN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_LUTHIEN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_ULMO) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_COLLUIN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_HOLCOLLETH) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_THINGOL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_COLANNON) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_TOTILA) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_CAMMITHRIM) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_PAURHACH) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_PAURNIMMEN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_PAURAEGEN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_PAURNEN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_FINGOLFIN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_HOLHENNETH) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_GONDOR) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_RAZORBACK) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_BLADETURNER) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_GALADRIEL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_ELENDIL) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_THRAIN) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_INGWE) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_CARLAMMAS) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_TULKAS) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_NARYA) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_NENYA) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_VILYA) { strcat(buffer6,"F:ACTIVATE "); } if (artefact_ptr->artefact_number == ART_POWER) { strcat(buffer6,"F:ACTIVATE "); } } artefact *alloc_artefact() { artefact *last_artefact_ptr; artefact *new_artefact_ptr; artefact *temp_ptr; new_artefact_ptr = malloc(sizeof(artefact)); /* IF NO MEMORY FOR artefact THEN LEAVE */ if (new_artefact_ptr == NULL) { return(NULL); } memset (new_artefact_ptr,0,sizeof(artefact)); /* IF A PREVIOUS artefact THEN POINT IT TO NEW RECORD */ if (first_artefact_ptr != NULL) { last_artefact_ptr = first_artefact_ptr; do { temp_ptr = last_artefact_ptr; last_artefact_ptr = last_artefact_ptr->artefact_next; } while (last_artefact_ptr != NULL); last_artefact_ptr = temp_ptr; last_artefact_ptr->artefact_next = new_artefact_ptr; new_artefact_ptr->artefact_prev = last_artefact_ptr; } else { first_artefact_ptr = new_artefact_ptr; artefact_ptr = new_artefact_ptr; new_artefact_ptr->artefact_prev = NULL; } return (new_artefact_ptr); } void init_file(void) { fp = fopen("a_info.new","wb"); if (fp == NULL) { printf("Error Cant Open Output file!"); exit(0); } fputs ("# File: a_info.txt\n\n\n",fp); fputs ("# This file is used to initialize the ""lib/raw/a_info.raw"" file, which is\n",fp); fputs ("# used to initialize the ""artifact"" information for the Angband game.\n\n",fp); fputs ("# Do not modify this file unless you know exactly what you are doing,\n",fp); fputs ("# unless you wish to risk possible system crashes and broken savefiles.\n\n",fp); fputs ("# After modifying this file, delete the ""lib/raw/a_info.raw"" file.\n\n\n",fp); fputs ("# The artifact indexes are defined in ""defines.h"", and must not be changed.\n\n",fp); fputs ("# Artifacts 1-15 are ""special"", 16-63 are ""armor"", and 64-127 are ""weapons"".\n\n",fp); fputs ("# Hack -- ""Grond"" and ""Morgoth"" MUST have a rarity of one, or they might\n",fp); fputs ("# not be dropped when Morgoth is killed. Note that they, like the ""special\n",fp); fputs ("# artifacts, are never created ""accidentally"".\n\n\n",fp); /* A Credit for all my hard work :-) */ fputs ("# Note Thie file has been Scrambled by John May's artefact scrammbler (V:1.8) 7:7:97\n\n",fp); fputs ("# Version stamp\n\n",fp); /* Assume Angband 2.8.1 */ fputs ("V:2.8.1\n\n",fp); } void insert_powers(uword level,ulong power,uword min_number,uword max_number,uword flags) { uword number; uword number2; uword number1; ulong bits_flags = 0; ulong power_bits; power_bits = 1; power_bits <<= power; number = random_range(min_number,max_number); do { artefact_ptr = first_artefact_ptr; artefact_ptr = artefact_ptr->artefact_next; do { if (((artefact_ptr->artefact_number != ART_GROND) && (artefact_ptr->artefact_number != ART_MORGOTH) && (artefact_ptr->artefact_number != ART_POWER))) { if (artefact_ptr->artefact_level == level) { number2 = random_range(1,100); number1 = random_range(1,POWERS_PER_ITEM); number1 += level/POWERS_LEVEL_DIVIDE; /* FUDGE TO MAKE TELEPATH MORE OFTEN ON HELMS */ if ((flags == 1) && (power == TELEPATHY)) { if ((artefact_ptr->artefact_number >= ART_BERUTHIEL) && (artefact_ptr->artefact_number <= ART_GONDOR)) { number1 = 100; number2 = 0; } } if ((number1 > artefact_ptr->artefact_num_powers) && (number2 > (level/3))) { bits_flags = artefact_ptr->artefact_flags1; if (flags == 2) { bits_flags = artefact_ptr->artefact_flags2; } bits_flags &= power_bits; if (((flags == 1) && (power >= BLESSED) && ((artefact_ptr->artefact_number < ART_MAEDHROS) || (artefact_ptr->artefact_number >= ART_BELTHRONDING)))) { /* FUDGE ONLY BRAND WEAPONS */ bits_flags = 1; } if ((flags == 1) && (power == BRAND_FIRE) && ((artefact_ptr->artefact_flags2&(1<artefact_flags2&(1<artefact_flags2&(1<artefact_number > ART_GROND)) { /* FUDGE ONLY BLESS NON PRIESTLY WEAPONS */ bits_flags = 1; } if (((flags == 2) && (power >= SLAY_ANIMAL) && ((artefact_ptr->artefact_number < ART_MAEDHROS) || (artefact_ptr->artefact_number >= ART_BELTHRONDING)))) { /* FUDGE ONLY SLAY WEAPONS */ bits_flags = 1; } if ((flags == 2) && (power <= IM_COLD)) { /* FUDGE ONLY ONE IMMUN PER ITEM */ if ((artefact_ptr->artefact_flags2 &((1<artefact_rarity += 5; if (artefact_ptr->artefact_rarity > 100) { artefact_ptr->artefact_rarity = 100; } artefact_ptr->artefact_num_powers++; if (flags == 2) { artefact_ptr->artefact_flags2 |= power_bits; } else { artefact_ptr->artefact_flags1 |= power_bits; } artefact_ptr->artefact_gold += 2000; number--; if ((flags == 1) && (power == BLESSED)) { /* BLESSED WEAPONS WIS+ */ artefact_ptr->artefact_flags1 |= 1<artefact_stat_mod = random_range((level/50)+2,(level/50)+3); artefact_ptr->artefact_gold += 2000; } } } } } artefact_ptr = artefact_ptr->artefact_next; } while ((artefact_ptr != NULL) && (number != 0)); level--; } while ((number != 0) && (level != 0)); } void insert_resists(uword level,ulong power,uword min_number,uword max_number,uword flags) { uword number; uword number1; uword number2; ulong bits_flags = 0; ulong power_bits; power_bits = 1; power_bits <<= power; number = random_range(min_number,max_number); do { artefact_ptr = first_artefact_ptr; number1 = random_range(2,15); do { artefact_ptr = artefact_ptr->artefact_next; number1--; } while (number1 !=0); do { if (((artefact_ptr->artefact_number != ART_GROND) && (artefact_ptr->artefact_number != ART_MORGOTH) && (artefact_ptr->artefact_number != ART_POWER))) { if (artefact_ptr->artefact_level == level) { number2 = random_range(3,10); if ((artefact_ptr->artefact_number <= ART_VILYA) || (artefact_ptr->artefact_number >= ART_MAEDHROS)) { /* FUDGE, ARMOR GETS MOST RESISTS */ number2 = random_range(1,6); } number1 = random_range(1,POWERS_PER_ITEM); number1 += level/POWERS_LEVEL_DIVIDE; if ((number1 > artefact_ptr->artefact_num_powers) && (number2 > 5)) { bits_flags = artefact_ptr->artefact_flags1; if (flags == 2) { bits_flags = artefact_ptr->artefact_flags2; } bits_flags &= power_bits; if (bits_flags == 0) { artefact_ptr->artefact_rarity += 5; if (artefact_ptr->artefact_rarity > 100) { artefact_ptr->artefact_rarity = 100; } artefact_ptr->artefact_num_powers++; if (flags == 2) { artefact_ptr->artefact_flags2 |= power_bits; } else { artefact_ptr->artefact_flags1 |= power_bits; } artefact_ptr->artefact_gold += 2000; number--; } } } } artefact_ptr = artefact_ptr->artefact_next; } while ((artefact_ptr != NULL) && (number != 0)); level--; } while ((number != 0) && (level != 0)); } void insert_mods(uword level,ulong power,uword number,uword stat_mod1,uword stat_mod2,uword low_power) { ulong bits_flags = 0; ulong power_bits; uword start_level; uword num,num1; start_level = level; power_bits = 1; power_bits <<= power; do { artefact_ptr = first_artefact_ptr; num = random_range(5,16); do { artefact_ptr = artefact_ptr->artefact_next; num--; } while (num !=0); do { bits_flags = artefact_ptr->artefact_flags1; bits_flags &= (1<artefact_level == level) && (bits_flags == 0)) { num1 = artefact_ptr->artefact_number; if ((power == BLOWS) && (artefact_ptr->artefact_number < ART_MAEDHROS)) { /* FUDGE, ONLY ALLOW BLOWS TO WEAPONS */ num1 = ART_GROND; } if ((power == CON) && (artefact_ptr->artefact_number > ART_MAEDHROS)) { /* CON MOSTLY ON ARMOUR */ if (random_range(1,100) > 50) { num1 = ART_GROND; } } if ((power == BLOWS) && (artefact_ptr->artefact_weight > 150)) { /* FUDGE, ONLY ALLOW BLOWS TO LIGHT WEAPONS */ num1 = ART_GROND; } if ((power == BLOWS) && (num1 >= ART_BELTHRONDING)) { /* FUDGE, DONT ALLOW BLOWS TO BOWS */ num1 = ART_GROND; } if ((power == SPEED) && (artefact_ptr->artefact_weight >= 100)) { /* FUDGE, ONLY SPEED ON LIGHT ITEMS */ num1 = ART_GROND; } if (((num1 != ART_GROND) && (num1 != ART_MORGOTH) && (num1 != ART_POWER))) { bits_flags = artefact_ptr->artefact_flags1; bits_flags &= power_bits; if (bits_flags == 0) { if (artefact_ptr->artefact_num_powers < low_power) { artefact_ptr->artefact_flags2 |= (1<artefact_stat_mod = num; artefact_ptr->artefact_flags1 |= power_bits; artefact_ptr->artefact_gold += 1250; artefact_ptr->artefact_num_powers++; artefact_ptr->artefact_rarity += 5; if (artefact_ptr->artefact_rarity > 100) { artefact_ptr->artefact_rarity = 100; } number--; } } else { if (artefact_ptr->artefact_num_powers < low_power) { low_power = artefact_ptr->artefact_num_powers; } } } } artefact_ptr = artefact_ptr->artefact_next; } while ((artefact_ptr != NULL) && (number != 0)); level++; if (level == 100) { level = start_level; number--; } } while (number != 0); } void insert_curse(uword level,uword stat1,uword stat2,uword stat3,uword stat4,char *name) { uword num; uword loop; artefact_ptr = first_artefact_ptr; while (artefact_ptr->artefact_number != level) { artefact_ptr = artefact_ptr->artefact_next; } if (stat3 != 0) { /* CURSING ARMOUR/CROWN/CLOAK/GLOVES */ /* SO LETS MAKE THEM TEMPTING !!!! */ for(loop = 0; loop <= (artefact_ptr->artefact_stat_mod) + 1; loop++) { num = (1 << (random_range(9, 19))); artefact_ptr->artefact_flags2 |= num; artefact_ptr->artefact_gold += 2000; } artefact_ptr->artefact_to_ac = -stat3; } if (stat1 != 0) { artefact_ptr->artefact_flags1 |= (1 << AGGRAVATE); artefact_ptr->artefact_to_hit -= random_range(stat1,(stat1+15)); artefact_ptr->artefact_to_damage -= random_range(stat2,(stat2+15)); if ((artefact_ptr->artefact_to_hit >= 0) && (artefact_ptr->artefact_to_damage >= 0)) { if (random_range(1,100) < 50) { artefact_ptr->artefact_to_hit = -10; } else { artefact_ptr->artefact_to_damage = -10; } } } strcpy(artefact_ptr->artefact_name,name); artefact_ptr->artefact_flags1 |= (1 << CURSED); artefact_ptr->artefact_flags1 |= (1 << HEAVY_CURSE); if (artefact_ptr->artefact_stat_mod != 0) { artefact_ptr->artefact_stat_mod = -(artefact_ptr->artefact_stat_mod); } return; } void scramble_weapons() { uword num; uword loop; uword level; artefact_ptr = first_artefact_ptr; do { if ((artefact_ptr->artefact_flags1 & (1<artefact_number >= ART_MAEDHROS) && (artefact_ptr->artefact_number <= ART_BELTHRONDING)) { level = artefact_ptr->artefact_level; artefact_ptr->artefact_to_hit = random_range((level/4)+2,(level/4)+7); artefact_ptr->artefact_to_damage = random_range((level/4)+2,(level/4)+7); } if (random_range(1,100) > (level/2)+40) { artefact_ptr->artefact_to_ac = random_range((level/5)+1,(level/5)+5); } else { if (random_range(1,100) < 25) { if (artefact_ptr->artefact_num_powers < 7) { artefact_ptr->artefact_extra_damage = random_range((level/25)+1,(level/25)+2); } } } } artefact_ptr = artefact_ptr->artefact_next; } while (artefact_ptr != NULL); } uword random_range(uword start, uword end) { float normalised_random; normalised_random = rand(); normalised_random /= (float)RAND_MAX; normalised_random *= ((end + 1) - start); normalised_random += start; return ((uword)normalised_random); } char *valar_names[] = { "of Manwe", "of Ulmo", "of Aule", "of Orome", "of Mandos", "of Lorien", "of Astaldo", "of Varda", "of Nessa", "of Namo", "of Yavanna", "of Irmo", "of Vaire", "of Este", "of Nienna", "of Vana", "of Ilmare", "of Eonwe", "of Salmar", "of Tilion", "of Osse", "of Uinen", "of Ben-ader", "of Goldberry", "of Melian", "of Finwe", "of Elwe", "of Ingwe", "of Galadriel", "of Elendil", "of Thrain", "of Carlammas", "of Barahir", "of Isildur", "of Thorin", "of Celegorm", "of Anarion", "of Beruthiel", "of Thranduil", "of Thengel", "of Hammerhand", "of Dor-Lomin", "of Gorlim", "of Fingolfin", "of Feanor", "of Thror", "of Maedhros", "of Rilia", "of Theoden", "of Eorlingas", "of Durin", "of Balli Stonehand", "of Olorin", "of Amras", "of Voronwe", "of Thorondor", "of Thranduil", "of Telemnar", "of Telchar", "of Gwaihir", "of Lothlorien", "of Gondolin", "of Menegoth", "of Thrain", "of Nain", "of Dain", "of Tirion", "of Bilbo", "of Frodo", "of Gimli", "of Legolas", "of Aragorn", "of The Grey Havens", "of Arien", "of Azaghal", "of Barahir", "of Beor", "of Bereg", "of Ciryon", "of Curufin", "of Earendil", "of Katie", "of Gemma", "of Gondor", "of The Shire", "of Rohan", "of Fangorn", "of Beleriand", "of Nargothrond", "of Doriath", "of Mirkwood", "of Moria", "of Eriador", "of Valinor", "of Eldarmar", "of Tol Eressa", "of Numenor", "of Harad", "of Andram", "of Rivendell", "of Minas Ithil", "of Minas Morgul", "of Minas Anor", "of Rhun", "of Arnor", "of Thingol", "of Nevrast", "of Falas", "of Himlad", "of Vinyamar", "of Lammoth", "of Thargelion", "of Estolad", }; char *flags1_name[] = { "STR", "INT", "WIS", "DEX", "CON", "CHR", "STEALTH", "SEARCH", "INFRA", "SPEED", "CURSED", "HEAVY_CURSE", "LITE", "SEE_INVIS", "TELEPATHY", "SLOW_DIGEST", "REGEN", "AGGRAVATE", "SUST_STR", "SUST_INT", "SUST_WIS", "SUST_DEX", "SUST_CON", "SUST_CHR", "FREE_ACT", "BLESSED", "TUNNEL ", "BRAND_ACID", "BRAND_ELEC", "BRAND_FIRE", "BRAND_COLD", "BLOWS", }; char *flags2_name[] = { "IM_ACID", "IM_ELEC", "IM_FIRE", "IM_COLD", "HOLD_LIFE", "RES_ACID", "RES_ELEC", "RES_FIRE", "RES_COLD", "RES_POIS", "RES_LITE", "RES_DARK", "RES_BLIND", "RES_CONF", "RES_SOUND", "RES_SHARDS", "RES_NETHER", "RES_NEXUS", "RES_CHAOS", "RES_DISEN", "HIDE_TYPE", "SHOW_MODS", "FEATHER", "SLAY_ANIMAL", "SLAY_EVIL", "SLAY_UNDEAD", "SLAY_DEMON", "SLAY_ORC", "SLAY_TROLL", "SLAY_GIANT", "SLAY_DRAGON", "KILL_DRAGON", }; char *artefact_names[] = { "# The Phial of Galadriel", "# The Star of Elendil", "# The Arkenstone of Thrain", "# The Amulet of Carlammas", "# The Amulet of Ingwe", "# The Necklace of the Dwarves", "# The Ring of Barahir", "# The Ring of Tulkas", "# The Ring of Power (Narya)", "# The Ring of Power (Nenya)", "# The Ring of Power (Vilya)", "# The Ring of Power (The One Ring)", "# The Multi-Hued Dragon Scale Mail Razorback", "# The Power Dragon Scale Mail Bladeturner", "# The Adamantite Plate Mail Soulkeeper", "# The Full Plate Armour of Isildur", "# The Metal Brigandine Armour of the Rohirrim", "# The Mithril Chain Mail Belegennon", "# The Mithril Plate Mail of Celeborn", "# The Chain Mail of Arvedui", "# The Augmented Chain Mail of Caspanion", "# The Soft Leather Armour Hithlomir", "# The Leather Scale Mail Thalkettoth", "# The Small Metal Shield of Thorin", "# The Large Leather Shield of Celegorm", "# The Large Metal Shield of Anarion", "# The Massive Iron Crown of Morgoth", "# The Iron Crown of Beruthiel", "# The Hard Leather Cap of Thranduil", "# The Metal Cap of Thengel", "# The Steel Helm of Hammerhand", "# The Iron Helm of Dor-Lomin", "# The Iron Helm Holhenneth", "# The Iron Helm of Gorlim", "# The Golden Crown of Gondor", "# The Cloak Colluin", "# The Cloak Holcolleth", "# The Cloak of Thingol", "# The Cloak of Thorongil", "# The Cloak Colannon", "# The Shadow Cloak of Luthien", "# The Shadow Cloak of Tuor", "# The Set of Leather Gloves Cambeleg", "# The Set of Leather Gloves Cammithrim", "# The Set of Gauntlets Paurhach", "# The Set of Gauntlets Paurnimmen", "# The Set of Gauntlets Pauraegen", "# The Set of Gauntlets Paurnen", "# The Set of Gauntlets Camlost", "# The Set of Cesti of Fingolfin", "# The Pair of Hard Leather Boots of Feanor", "# The Pair of Soft Leather Boots Dal-i-thalion", "# The Pair of Metal Shod Boots of Thror", "# The Main Gauche of Maedhros", "# The Dagger Angrist", "# The Dagger Narthanc", "# The Dagger Nimthanc", "# The Dagger Dethanc", "# The Dagger of Rilia", "# The Dagger Belangil", "# The Bastard Sword Calris", "# The Broad Sword Arunruth", "# The Broad Sword Glamdring", "# The Broad Sword Aeglin", "# The Broad Sword Orcrist", "# The Two-Handed Sword Gurthang", "# The Two-Handed Sword Zarcuthra", "# The Two-Handed Sword Mormegil", "# The Cutlass Gondricam", "# The Executioners Sword Crisdurian", "# The Katana Aglarang", "# The Long Sword Ringil", "# The Long Sword Anduril", "# The Long Sword Anguirel", "# The Long Sword Elvagil", "# The Rapier Forasgil", "# The Sabre Careth Asdriag", "# The Small Sword Sting", "# The Scimitar Haradekket", "# The Short Sword Gilettar", "# The Blade of Chaos Doomcaller", "# The Beaked Axe of Theoden", "# The Glaive of Pain", "# The Halberd Osondir", "# The Pike Til-i-arc", "# The Spear Aeglos", "# The Spear of Orome", "# The Spear Nimloth", "# The Lance of Eorlingas", "# The Great Axe of Durin", "# The Great Axe of Eonwe", "# The Battle Axe of Balli Stonehand", "# The Battle Axe Lotharang", "# The Lochaber Axe Mundwine", "# The Broad Axe Barukkheled", "# The Trident of Wrath", "# The Trident of Ulmo", "# The Scythe Avavir", "# The Mighty Hammer Grond", "# The Flail Totila", "# The Two-Handed Flail Thunderfist", "# The Morning Star Bloodspike", "# The Morning Star Firestar", "# The Mace Taratol", "# The War Hammer of Aule", "# The Quarterstaff Nar-i-vagil", "# The Quarterstaff Eriril", "# The Quarterstaff of Olorin", "# The Mace of Disruption Deathwreaker", "# The Lucerne Hammer Turmil", "# The Long Bow Belthronding", "# The Long Bow of Bard", "# The Light Crossbow Cubragol", }; // '# The Phial of Galadriel' artefact_init artefact1 = { 1,39,4,1,1,10,0,0,0,0, 0}; // '# The Star of Elendil' artefact_init artefact2 = { 2,39,5,30,25,5,0,0,0,0, 0}; // '# The Arkenstone of Thrain' artefact_init artefact3 = { 3,39,6,50,50,5,0,0,0,0, 0}; // '# The Amulet of Carlammas' artefact_init artefact4 = { 4,40,10,50,10,3,0,0,0,0, 0}; // '# The Amulet of Ingwe' artefact_init artefact5 = { 5,40,11,65,30,3,0,0,0,0, 0}; // '# The Necklace of the Dwarves' artefact_init artefact6 = { 6,40,12,70,50,3,0,0,0,0, 0}; // '# The Ring of Barahir' artefact_init artefact7 = { 8,45,32,50,25,2,0,0,0,0, 0}; // '# The Ring of Tulkas' artefact_init artefact8 = { 9,45,33,70,50,2,0,0,0, 0}; // '# The Ring of Power (Narya)' artefact_init artefact9 = { 10,45,34,70,30,2,0,0,0, 0}; // '# The Ring of Power (Nenya)' artefact_init artefact10 = { 11,45,35,80,40,2,0,0,0, 0}; // '# The Ring of Power (Vilya)' artefact_init artefact11 = { 12,45,36,90,50,2,0,0,0,0, 0}; // '# The Ring of Power (The One Ring)' artefact_init artefact12 = { 13,45,37,100,100,2,0,0,0,0, 0}; // '# The Multi-Hued Dragon Scale Mail 'Razorback'' artefact_init artefact13 = { 16,38,6,90,9,500,30,-4,0,25, }; // '# The Power Dragon Scale Mail 'Bladeturner'' artefact_init artefact14 = { 17,38,30,95,3,600,50,-8,0,35, 0}; // '# The Adamantite Plate Mail 'Soulkeeper'' artefact_init artefact15 = { 19,37,30,75,9,420,40,-4,0,20, 0}; // '# The Full Plate Armour of Isildur' artefact_init artefact16 = { 20,37,15,45,3,300,25,0,0,25, 0}; // '# The Metal Brigandine Armour of the Rohirrim' artefact_init artefact17 = { 21,37,9,30,3,200,19,0,0,15, 0}; // '# The Mithril Chain Mail 'Belegennon'' artefact_init artefact18 = { 22,37,20,40,3,150,28,-1,0,20, 0}; // '# The Mithril Plate Mail of Celeborn' artefact_init artefact19 = { 23,37,25,40,3,250,35,-3,0,25, 0}; // '# The Chain Mail of Arvedui' artefact_init artefact20 = { 24,37,4,20,3,220,14,-2,0,15, 0}; // '# The Augmented Chain Mail of Caspanion' artefact_init artefact21 = { 25,37,6,25,9,270,16,-2,0,20, 0}; // '# The Soft Leather Armour 'Hithlomir'' artefact_init artefact22 = { 27,36,4,20,3,80,4,0,0,20, 0}; // '# The Leather Scale Mail 'Thalkettoth'' artefact_init artefact23 = { 28,36,11,20,3,60,11,-1,0,25, 0}; // '# The Small Metal Shield of Thorin' artefact_init artefact24 = { 30,34,3,30,6,65,3,0,0,25, 0}; // '# The Large Leather Shield of Celegorm' artefact_init artefact25 = { 31,34,4,30,3,60,4,0,0,20, 0}; // '# The Large Metal Shield of Anarion' artefact_init artefact26 = { 32,34,5,40,9,120,5,0,0,20, 0}; // '# The Massive Iron Crown of Morgoth' artefact_init artefact27 = { 34,33,50,100,1,20,0,0,0,0, 0}; // '# The Iron Crown of Beruthiel' artefact_init artefact28 = { 35,33,10,40,12,20,0,0,0,20, 0}; // '# The Hard Leather Cap of Thranduil' artefact_init artefact29 = { 36,32,2,20,2,15,2,0,0,10, 0}; // '# The Metal Cap of Thengel' artefact_init artefact30 = { 37,32,3,10,2,20,3,0,0,12, 0}; // '# The Steel Helm of Hammerhand' artefact_init artefact31 = { 38,32,6,20,2,60,6,0,0,20, 0,}; // '# The Iron Helm of Dor-Lomin' artefact_init artefact32 = { 39,32,5,40,12,75,5,0,0,20, 0}; // '# The Iron Helm 'Holhenneth'' artefact_init artefact33 = { 40,32,5,20,5,75,5,0,0,10, }; // '# The Iron Helm of Gorlim' artefact_init artefact34 = { 41,32,5,20,5,75,5,0,0,10, 0}; // '# The Golden Crown of Gondor' artefact_init artefact35 = { 42,33,11,40,40,30,0,0,0,15, }; // '# The Cloak 'Colluin'' artefact_init artefact36 = { 44,35,1,5,45,5,1,0,0,15, 0}; // '# The Cloak 'Holcolleth'' artefact_init artefact37 = { 45,35,1,5,45,10,1,0,0,4, 0}; // '# The Cloak of Thingol' artefact_init artefact38 = { 46,35,1,10,90,10,1,0,0,18, 0}; // '# The Cloak of Thorongil' artefact_init artefact39 = { 47,35,1,5,20,20,1,0,0,10, 0}; // '# The Cloak 'Colannon'' artefact_init artefact40 = { 48,35,1,5,10,30,1,0,0,15, 0}; // '# The Shadow Cloak of Luthien' artefact_init artefact41 = { 49,35,6,40,40,5,6,0,0,20, 0}; // '# The Shadow Cloak of Tuor' artefact_init artefact42 = { 50,35,6,40,40,5,6,0,0,12, 0}; // '# The Set of Leather Gloves 'Cambeleg'' artefact_init artefact43 = { 52,31,1,10,6,5,1,8,8,15, 1 << SHOW_MODS}; // '# The Set of Leather Gloves 'Cammithrim'' artefact_init artefact44 = { 53,31,1,10,3,5,1,0,0,10, 0}; // '# The Set of Gauntlets 'Paurhach'' artefact_init artefact45 = { 54,31,2,10,20,25,2,0,0,15, 0}; // '# The Set of Gauntlets 'Paurnimmen'' artefact_init artefact46 = { 55,31,2,10,20,25,2,0,0,15, 0}; // '# The Set of Gauntlets 'Pauraegen'' artefact_init artefact47 = { 56,31,2,10,20,25,2,0,0,15, 0}; // '# The Set of Gauntlets 'Paurnen'' artefact_init artefact48 = { 57,31,2,10,20,25,2,0,0,15, 0}; // '# The Set of Gauntlets 'Camlost'' artefact_init artefact49 = { 58,31,2,10,20,25,2,11,12,0, 1 << SHOW_MODS}; // '# The Set of Cesti of Fingolfin' artefact_init artefact50 = { 59,31,5,40,15,40,5,10,10,20, 1 << SHOW_MODS}; // '# The Pair of Hard Leather Boots of Feanor' artefact_init artefact51 = { 60,30,3,40,120,40,3,0,0,20, 0}; // '# The Pair of Soft Leather Boots 'Dal-i-thalion'' artefact_init artefact52 = { 61,30,2,10,25,20,2,0,0,15, 0}; // '# The Pair of Metal Shod Boots of Thror' artefact_init artefact53 = { 62,30,6,30,25,80,6,0,0,20, 0}; // '# The Main Gauche of Maedhros' artefact_init artefact54 = { 64,23,5,15,30,30,0,12,15,0, 1 << SHOW_MODS}; // '# The Dagger 'Angrist'' artefact_init artefact55 = { 65,23,4,20,80,12,0,10,15,5, 1 << SHOW_MODS}; // '# The Dagger 'Narthanc'' artefact_init artefact56 = { 66,0,4,4,10,12,0,4,6,0, 1 << SHOW_MODS}; // '# The Dagger 'Nimthanc'' artefact_init artefact57 = { 67,23,4,3,10,12,0,4,6,0, 1 << SHOW_MODS}; // '# The Dagger 'Dethanc'' artefact_init artefact58 = { 68,23,4,5,10,12,0,4,6,0, 1 << SHOW_MODS}; // '# The Dagger of Rilia' artefact_init artefact59 = { 69,23,4,5,40,12,0,4,3,0, 1 << SHOW_MODS}; // '# The Dagger 'Belangil'' artefact_init artefact60 = { 70,23,4,10,40,12,0,6,9,0, 1 << SHOW_MODS}; // '# The Bastard Sword 'Calris'' artefact_init artefact61 = { 71,0,21,30,15,140,0,20,20,0, 1 << SHOW_MODS}; // '# The Broad Sword 'Arunruth'' artefact_init artefact62 = { 72,23,16,20,45,150,0,20,12,0, 1 << SHOW_MODS}; // '# The Broad Sword 'Glamdring'' artefact_init artefact63 = { 73,23,16,20,20,150,0,10,15,0, 1 << SHOW_MODS}; // '# The Broad Sword 'Aeglin'' artefact_init artefact64 = { 74,23,16,20,90,150,0,12,16,0, 1 << SHOW_MODS}; // '# The Broad Sword 'Orcrist'' artefact_init artefact65 = { 75,23,16,20,20,150,0,10,15,0, 1 << SHOW_MODS}; // '# The Two-Handed Sword 'Gurthang'' artefact_init artefact66 = { 76,23,25,30,30,200,0,13,17,0, 1 << SHOW_MODS}; // '# The Two-Handed Sword 'Zarcuthra'' artefact_init artefact67 = { 77,23,25,30,180,250,0,19,21,0, 1 << SHOW_MODS}; // '# The Two-Handed Sword 'Mormegil'' artefact_init artefact68 = { 78,23,25,30,15,250,0,19,21,0, 1 << SHOW_MODS}; // '# The Cutlass 'Gondricam'' artefact_init artefact69 = { 79,23,12,20,8,110,0,10,11,0, 1 << SHOW_MODS}; // '# The Executioner's Sword 'Crisdurian'' artefact_init artefact70 = { 80,23,28,40,15,260,0,18,19,0, 1 << SHOW_MODS}; // '# The Katana 'Aglarang'' artefact_init artefact71 = { 81,0,20,30,25,50,0,0,0,0, 1 << SHOW_MODS}; // '# The Long Sword 'Ringil'' artefact_init artefact72 = { 82,23,17,55,120,130,0,22,25,0, 1 << SHOW_MODS}; // '# The Long Sword 'Anduril'' artefact_init artefact73 = { 83,23,17,25,40,130,0,10,15,5, 1 << SHOW_MODS}; // '# The Long Sword 'Anguirel'' artefact_init artefact74 = { 84,23,17,20,30,130,0,8,12,0, 1 << SHOW_MODS}; // '# The Long Sword 'Elvagil'' artefact_init artefact75 = { 85,23,17,20,15,130,0,2,7,0, 1 << SHOW_MODS}; // '# The Rapier 'Forasgil'' artefact_init artefact76 = { 86,23,7,15,8,40,0,12,19,0, 1 << SHOW_MODS}; // '# The Sabre 'Careth Asdriag'' artefact_init artefact77 = { 87,23,11,15,8,50,0,6,8,0, 1 << SHOW_MODS}; // '# The Small Sword 'Sting'' artefact_init artefact78 = { 88,23,8,20,15,75,0,7,8,0, 1 << SHOW_MODS}; // '# The Scimitar 'Haradekket'' artefact_init artefact79 = { 89,23,18,20,8,130,0,9,11,0, 1 << SHOW_MODS}; // '# The Short Sword 'Gilettar'' artefact_init artefact80 = { 90,23,10,20,8,80,0,3,7,0, 1 << SHOW_MODS}; // '# The Blade of Chaos 'Doomcaller'' artefact_init artefact81 = { 91,23,30,70,25,180,0,18,28,0, (1 << RES_CHAOS) | (1 << SHOW_MODS)}; // '# The Beaked Axe of Theoden' artefact_init artefact82 = { 93,22,10,20,15,180,0,8,10,0, 1 << SHOW_MODS}; // '# The Glaive of Pain' artefact_init artefact83 = { 94,22,13,30,25,190,0,0,30,0, 1 << SHOW_MODS}; // '# The Halberd 'Osondir'' artefact_init artefact84 = { 95,22,15,20,8,190,0,6,9,0, 1 << SHOW_MODS}; // '# The Pike 'Til-i-arc'' artefact_init artefact85 = { 96,22,8,20,15,160,0,10,12,10, 1 << SHOW_MODS}; // '# The Spear 'Aeglos'' artefact_init artefact86 = { 97,22,2,15,45,50,0,15,25,5, 1 << SHOW_MODS}; // '# The Spear of Orome' artefact_init artefact87 = { 98,22,2,15,45,50,0,15,15,0, 1 << SHOW_MODS}; // '# The Spear 'Nimloth'' artefact_init artefact88 = { 99,22,2,15,12,50,0,11,13,0, 1 << SHOW_MODS}; // '# The Lance of Eorlingas' artefact_init artefact89 = { 100,22,20,20,23,360,0,3,21,0, 1 << SHOW_MODS}; // '# The Great Axe of Durin' artefact_init artefact90 = { 101,22,25,30,90,230,0,10,20,15, 1 << SHOW_MODS}; // '# The Great Axe of Eonwe' artefact_init artefact91 = { 102,22,25,30,120,230,0,15,18,8, 1 << SHOW_MODS}; // '# The Battle Axe of Balli Stonehand' artefact_init artefact92 = { 103,22,22,30,15,170,0,8,11,5, 1 << SHOW_MODS}; // '# The Battle Axe 'Lotharang'' artefact_init artefact93 = { 104,22,22,30,15,170,0,4,3,0, 1 << SHOW_MODS}; // '# The Lochaber Axe 'Mundwine'' artefact_init artefact94 = { 105,22,28,30,8,250,0,12,17,0, 1 << SHOW_MODS}; // '# The Broad Axe 'Barukkheled'' artefact_init artefact95 = { 106,22,11,20,8,160,0,13,19,0, 1 << SHOW_MODS}; // '# The Trident of Wrath' artefact_init artefact96 = { 107,22,5,15,35,300,0,16,18,0, 1 << SHOW_MODS}; // '# The Trident of Ulmo' artefact_init artefact97 = { 108,22,5,30,90,100,0,15,19,0, 1 << SHOW_MODS}; // '# The Scythe 'Avavir'' artefact_init artefact98 = { 109,22,17,40,8,250,0,8,8,10, 1 << SHOW_MODS}; // '# The Mighty Hammer 'Grond'' artefact_init artefact99 = { 111,21,50,100,1,1000,0,5,25,10, 0}; // '# The Flail 'Totila'' artefact_init artefact100 = { 112,21,13,20,8,150,0,6,8,0, 1 << SHOW_MODS}; // '# The Two-Handed Flail 'Thunderfist'' artefact_init artefact101 = { 113,21,18,45,38,300,0,5,18,0, 1 << SHOW_MODS}; // '# The Morning Star 'Bloodspike'' artefact_init artefact102 = { 114,21,12,20,30,150,0,8,22,0, 1 << SHOW_MODS}; // '# The Morning Star 'Firestar'' artefact_init artefact103 = { 115,21,12,20,15,150,0,5,7,2, 1 << SHOW_MODS}; // '# The Mace 'Taratol'' artefact_init artefact104 = { 116,21,5,20,15,200,0,12,12,0, 1 << SHOW_MODS}; // '# The War Hammer of Aule' artefact_init artefact105 = { 117,21,8,40,75,120,0,19,21,5, 1 << SHOW_MODS}; // '# The Quarterstaff 'Nar-i-vagil'' artefact_init artefact106 = { 118,21,3,20,18,150,0,10,20,0, 1 << SHOW_MODS}; // '# The Quarterstaff 'Eriril'' artefact_init artefact107 = { 119,21,3,20,18,150,0,3,5,0, 1 << SHOW_MODS}; // '# The Quarterstaff of Olorin' artefact_init artefact108 = { 120,21,3,30,105,150,0,10,13,0, 1 << SHOW_MODS}; // '# The Mace of Disruption 'Deathwreaker'' artefact_init artefact109 = { 121,21,20,80,38,400,0,18,18,0, 1 << SHOW_MODS | (1<