Jump to content

Photo

Is this possiable.


  • Please log in to reply
7 replies to this topic

#1 Soarin

Soarin

    Chosen One

  • Members

Posted 17 June 2007 - 10:55 PM

i was wondering is it possiable to script a sword that drains magic and health. I want to know if this is possiable to have an item like this that can kill link after the tiem drains magic and health.

Edited by bringer of destruction, 17 June 2007 - 11:04 PM.


#2 NoeL

NoeL

    Legend

  • Members
  • Real Name:Jerram

Posted 17 June 2007 - 11:01 PM

I assume so. Script the item to reduce health/magic every X frames it's equipped icon_shrug.gif

#3 Soarin

Soarin

    Chosen One

  • Members

Posted 17 June 2007 - 11:04 PM

Thank you Noel.

#4 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 18 June 2007 - 09:46 AM

This is MOCK CODE, and will more than likely not work. Don't bother copying and pasting it into a script for that reason. It's just the general path it may look like before its alpha phase.

CODE
//This script removes magic and health every few moments while using it.

import "std.zh"
item script SwordDrainer {
   int linksworduse;  // I hope to god this does something helpful, lol...
   if (Action = 2) {
      Link->HP = Link->HP - 2;
      Link->MP = Link->MP - 2;
   Waitframe();
    }
}


It totally sucks, and is completely incorrect. Most likely.

#5 Soarin

Soarin

    Chosen One

  • Members

Posted 18 June 2007 - 11:25 AM

That gives mer a general idea of what i have to do.

Edited by bringer of destruction, 18 June 2007 - 11:31 AM.


#6 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 12 September 2007 - 01:26 AM

Since item scripts activate when you press the button of the item, all you'd need is this; .....I think.



CODE

item script SwordDrainer {
             void run(){
                         int hp_drain = 1;
                         int mp_drain = 1;
                  //    int rupee_drain = 1;
                         if (hp_drain > 0){
                                  Link->HP = Link->HP - hp_drain;
                      } if (mp_drain > 0){
                                  Link->MP = Link->MP - mp_drain;
               //     } if (rupee_drain > 0){
                //               Game->Counter[CR_RUPEES] -= rupee drain;
              //                 Game->PlaySound(insert sfx here);
                      }
                      Waitframe();
           }
}


Although here's a neat idea;

CODE

item script SwordDrainer {
             void run(){
                         int hp_drain = 1;
                         int mp_drain = 1;
                  //    int rupee_drain = 1;

                      if (Link->Item[----item ID here-----] == false){

                                    if (hp_drain > 0){
                                              Link->HP = Link->HP - hp_drain;
                                  } if (mp_drain > 0){
                                              Link->MP = Link->MP - mp_drain;
                          //     } if (rupee_drain > 0){
                            //               Game->Counter[CR_RUPEES] -= rupee drain;
                          //                 Game->PlaySound(insert sfx here);
                                 }
                      }
                      Waitframe();
           }
}


You can take away the negative effects of the sword if you have another item!

ie, cursed sword untill you beat a boss and get the amulet of remove_curse, then it becomes the master sword!

btw; just remove the // if you want to curse rupees. and fill in the blanks with ID numbers in std.zh
also adjust this; int hp_drain = 1; to whatever you want. ie: int hp_drain = 1,000,000; !

have fun.

#7 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 12 September 2007 - 03:50 AM

Increasing health and magic when you hit an enemy should be doable... but truly "draining magic" might not be, because enemies don't have magic meters.

That's just what I've gathered, though.

#8 Mitchfork

Mitchfork

    no fun. not ever.

  • Contributors
  • Real Name:Mitch
  • Location:Alabama

Posted 12 September 2007 - 10:08 PM

QUOTE(Radien @ Sep 12 2007, 03:50 AM) View Post
Increasing health and magic when you hit an enemy should be doable... but truly "draining magic" might not be, because enemies don't have magic meters.

That's just what I've gathered, though.
No no, he's talking about draining Link's magic, cursed weapon style.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users