Jump to content

Photo

Cane of Byrna ext


  • Please log in to reply
2 replies to this topic

#1 eNJuR

eNJuR

    Junior

  • Members
  • Real Name:Nathan
  • Location:Sol system

Posted 05 September 2010 - 06:21 PM

I'm not normally one to make a script request, but this time I think I'll break down and ask.

What I want to do, is as long as the Cane of Byrna is active, Link (silently) has the boots. If the cane is turned off or runs out of magic, take the boots away. Can someone help please?

#2 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 07 September 2010 - 11:08 AM

In theory, this should be very simple to do...

CODE

const int CANE_COST = 0; //Set to the cost per frame,second or whatever of the cane (in 32nds of a magic bar)
const int BOOT = 0; //Set to the ID of the boot item.

item script CaneBootAdd
{
    void run()
    {
        if(Link->Item[BOOT] && Link->MP > CANE_COST)
        {
            Link->Item[BOOT] = true;
        }
        else()
        {
            Link->Item[boot] = false;
        }
    }

}

global script slot2
{
    void run()
    {
        while(true)
        {
            Waitframe();
            if(Link->MP < CANE_COST)
            {
                Link->Item[BOOT] = false;    
            }
        }
    }
}


The second global script can easily be added to your own and is only there to check to see if Link runs out of MP to use the cane, in which it rids of the boots.

It's not tested, but it seems simple enough to me. Here's hoping that I didn't make a really stupid typo like I'm prone to.

Hope it's of some help.

EDIT: Yep. I made a stupid mistake. Of course. icon_xd.gif Fixed it.

#3 eNJuR

eNJuR

    Junior

  • Members
  • Real Name:Nathan
  • Location:Sol system

Posted 07 September 2010 - 06:13 PM

Alright! Thanks a ton!!! icon_biggrin.gif


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users