Jump to content

Photo

Slash Scroll Scripting Help


  • Please log in to reply
2 replies to this topic

#1 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 12 April 2018 - 03:54 AM

item script SlashScroll{
    void run(){
 
        if ( !(Game->Generic[GEN_CANSLASH]) ) Game->Generic[GEN_CANSLASH] = 1;
    else Game->Generic[GEN_CANSLASH] = 0;
    }
}
-----------------------------------------------------------------------------------------------------------
I want to modify the script so that the sword can do less damage when slashing. Either if you can affect the sword's power directly or having me use a separate sword with less power, I'm okay with both options. Thank you in advance. :)


#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 April 2018 - 07:51 AM

item script SlashScroll
{
    void run()
    {
 
        if ( !(Game->Generic[GEN_CANSLASH]) ) Game->Generic[GEN_CANSLASH] = 1;
        else Game->Generic[GEN_CANSLASH] = 0;
    }
}
-----------------------------------------------------------------------------------------------------------
I want to modify the script so that the sword can do less damage when slashing. Either if you can affect the sword's power directly or having me use a separate sword with less power, I'm okay with both options. Thank you in advance. :)

Do you mean, that all swords have half power as soon as the player acquires the scroll?

global script OnContinue
{
     void run()
     {
          HalfPowerSwords();
     }
}

item script SlashScrollPickup
{
     void run()
     {
          HalfPowerSwords();
     }
}          

void HalfPowerSwords()
{
     itemdata id;
     for ( int q = 1; q < 256; ++q )
     {
          if !(Game->Generic[GEN_CANSLASH]) { return; }
          id = Game->LoadItemData(q);
          if ( id->Family == IC_SWORD )
          {
               id->Power = id->Power * 0.5;
          }
     }
}
Assign the item pickup script to the Pickup slot of your slash scroll item, and assign the global script to the continue slot.

#3 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 12 April 2018 - 10:28 PM

This is the action script version, i want it so you can toggle on and off slash, and while slash is on, the swords power is halved. And when it's off,  the sword's power goes back to normal, this applies to all swords.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users