Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <class.h>
- #include <combat.h>
- #include <ansi.h>
- inherit "obj/weapon";
- #define TPS this_player()->query_possessive()
- #define TPN this_player()->query_name()
- object tpqa;
- object xxxx;
- object blah;
- object checktarget;
- string sighttarget;
- string temp;
- string clanname;
- void init() {
- weapon::init();
- if(environment(this_object())==this_player()) {
- add_action("_store","store");
- add_action("_summon","summon");
- add_action("_sight","sight");
- }
- }
- create() {
- ::create();
- seteuid("torvald");
- set_id(({ "Sword of Omens", "sword of omens", "sword" }));
- set_short("Sword of Omens");
- set_long("The Sword of Omens has a spiraled metal hilt with a wickedly\n"+
- "curved hand guard. At the base of its long blade rests a ruby\n"+
- "cats eye gem that allows you to summon help or sight <player>.\n");
- set_weight(6);
- set_class(20);
- set_value(15000);
- set_two_handed(1);
- set_type(PARRY);
- set_no_dull(1);
- set("magic", 1);
- set_hit_func(this_object());
- set_wield_func(this_object());
- set_bonus_func(this_object());
- }
- int check_bonus(object attacker) {
- return (random(26));
- }
- weapon_hit(object attacker_ob) {
- int dam;
- tpqa = this_player()->query_attack();
- xxxx = tpqa->query_name();
- dam = random(26);
- if (dam < 10) {
- tell_object(environment(this_object()),
- "%^RED%^Your sword engulfs "+xxxx+" in a blinding crimson light.%^RESET%^\n");
- tell_object(attacker_ob,"%^RED%^"+TPN+"'s sword engulfs you in a blinding crimson light.%^RESET%^\n");
- tell_room(environment(environment(this_object())),environment(this_object())->query_name()+"'s sword engulfs "+xxxx+" in a blinding crimson light.\n", ({environment(this_object()),attacker_ob}));
- }
- else if (dam < 20) {
- tell_object(environment(this_object()),
- "%^RED%^You parry "+xxxx+"'s attack with a flurry of clanging blows.%^RESET%^\n");
- tell_object(attacker_ob,"%^RED%^"+TPN+" parries your attack with a flurry of clanging blows.%^RESET%^\n");
- tell_room(environment(environment(this_object())),environment(this_object())->query_name()+" parries "+xxxx+"'s attack with a flurry of clanging blows.\n", ({environment(this_object()),attacker_ob}));
- }
- else if (dam < 25) {
- tell_object(environment(this_object()),
- "%^RED%^You thrust your sword deep into "+xxxx+" and twist the blade sharply!%^RESET%^\n");
- tell_object(attacker_ob,"%^RED%^"+TPN+" thrusts "+TPS+" sword deep into your side with a sharp twist!%^RESET%^\n");
- tell_room(environment(environment(this_object())),environment(this_object())->query_name()+" thrusts "+TPS+" sword deep into "+xxxx+" with a sharp twist!\n", ({environment(this_object()),attacker_ob}));
- }
- }
- query_save_item()
- {
- return 0;
- }
- int dest_when_sold() {
- return 1;
- }
- wield_func() {
- int lvlcheck;
- int flag;
- flag= 0;
- lvlcheck=(int)this_player()->query_level();
- // NOT USING SET_CLASSES_ALLOWED HERE BECAUSE I WANT THE DAMAGE EFFECT
- // WHEN OTHER CLASSES TRY TO WIELD THE SWORD- Torvald 09 June 2000
- if ((member_array(this_player()->query_class(),({ FIGHTER,PALADIN,KNIGHT })) >= 0) && (lvlcheck > 19)) {
- tell_object(this_player(),
- "%^RED%^You grasp the Sword of Omens and it extends to its full length.%^RESET%^\n");
- flag=0;
- return 1;
- }
- else {
- if(member_array(this_player()->query_class(),({ FIGHTER,PALADIN,KNIGHT })) < 0) {
- tell_object(environment(this_object()),"You are not a master of the sword!\n");
- flag= 1;
- }
- if (lvlcheck < 20) {
- tell_object(environment(this_object()),"You are too inexperienced to handle this powerful weapon.\n");
- flag= 1;
- }
- if (flag) {
- tell_object(environment(this_object()),"%^YELLOW%^%^BOLD%^The Eye of Thundera glows red hot and burns your hand!%^RESET%^\n");
- tell_room(environment(environment(this_object())),
- environment(this_object())->query_name()+" tries to grasp "+TPS+" sword but the hilt glows red hot!\n", ({environment(this_object())}));
- environment(this_object())->reduce_hit_point(20);
- }
- // Discreetly trying to eliminate the What? msg while keeping the ansi in if(flag)- Torvald 26 Mar 00
- notify_fail(" \n");
- return 0;
- }
- }
- // CODE BELOW WRITTEN BY TORVALD ON 20 NOV 1999
- // PREVENTS STORING OF ITEM IN ALL CLAN HALLS, GUILDS, NIRVANA, & INN ROOMS
- // GREAT FOR KEEPING THOSE BOOT ITEMS EXPOSED & VULNERABLE
- int _store(string str) {
- if((str && (str=="sword" || str=="sword of omens" || str=="Sword of Omens")) && present("locker",environment(environment(this_object())))) {
- environment(this_object())->force_us("drop Sword of Omens");
- return 1;
- }
- else notify_fail("What?\n");
- return 0;
- }
- int drop() {
- temp = explode(file_name(environment(this_player())), "/");
- if ((temp[2] == "inn" || temp[2] == "Daemon" || temp[2] == "nirvana" || temp[1] == "clans" || temp[2] == "store" || temp[2] == "storage" || temp[2] == "armory" || temp[2] == "backroom" || temp[2] == "rooms")) {
- notify_fail(
- "This weapon cannot enforce justice when locked away in storage.\n"+
- "The sword evaporates into the ground in a puddle of molten metal!\n");
- call_out("remove", 0);
- tell_room(environment(environment(this_object())),
- environment(this_object())->query_name()+" tries to store "+TPS+" sword here but fails.\n", ({environment(this_object())}));
- tell_room(environment(environment(this_object())),
- environment(this_object())->query_name()+"'s sword suddenly evaporates in a puddle of molten metal!\n", ({environment(this_object())}));
- return 2;
- }
- else weapon::un_wield(this_object());
- return 0;
- }
- int _summon(string str) {
- clanname = "/clan/obj/clan_daemon"->query_clan(""+this_player()->query_real_name()+"");
- if(str && (str=="help")) {
- write("You thrust the Sword of Omens above your head.\n");
- say(TPN+" thrusts the Sword of Omens above "+TPS+" head.\n");
- this_player()->force_us("say thunder, thunder, THUNDER, THUNDERCATS... HO!\n");
- tell_room(environment(environment(this_object())),"%^RED%^A crimson beacon bursts forth from the Eye of the sword and pierces the sky.%^RESET%^\n");
- if(present("headband",this_player())) {
- tell_object(filter(map("/clan/obj/clan_daemon"->query_clan_data()[""+clanname+""]["members"],(: find_player :)),(: $1 :)),"%^RED%^You see a beacon of crimson light pierce the sky!%^RESET%^\n", ({environment(this_object())}));
- tell_object(filter(map("/clan/obj/clan_daemon"->query_clan_data()[""+clanname+""]["members"],(: find_player :)),(: $1 :)),TPN+" needs help at "+environment(this_player())->query_short()+"!\n", ({environment(this_object())}));
- write("You summon the aid of your clan members.\n");
- }
- if(!present("headband",this_player())) {
- write("You are not in a clan so your efforts to summon help are futile.\n");
- }
- return 1;
- }
- else notify_fail("What?\n");
- return 0;
- }
- int _sight(string str) {
- if(!str) {
- notify_fail("Syntax: sight <player>.\n");
- return 0;
- }
- write("You raise the Sword of Omens and gaze into the Eye of Thundera.\n");
- say(TPN+" raises the Sword of Omens and gazes into the Eye of Thundera.\n");
- this_player()->force_us("say Sword of Omens, give me sight beyond sight!\n");
- tell_room(environment(environment(this_object())),"%^RED%^The ruby eye on the sword opens with a crimson light.%^RESET%^\n");
- if(!find_player(""+lower_case(str)+"")) { call_out("do_close",3); notify_fail(" \n"); return 0; }
- if(wizardp(find_player(""+lower_case(str)+""))) {
- call_out("do_obscure",3);
- notify_fail(" \n");
- return 0;
- }
- sighttarget=str;
- checktarget=find_living(""+sighttarget+"");
- if(!checktarget) {
- call_out("do_close",3);
- notify_fail(" \n");
- return 0;
- }
- else tell_object(this_player(),"The Eye of Thundera reveals an image of "+capitalize(str)+" at "+environment(find_player(""+lower_case(str)+""))->query_short()+".\n");
- return 1;
- }
- void do_close() {
- tell_object(this_player(),"The Eye of Thundera shimmers briefly, then closes.\n");
- return;
- }
- void do_obscure() {
- tell_object(this_player(),"The Eye of Thundera is obscured by powerful magic.\n");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement