ZoriaRPG icon

Hate Spell Item (Bane Weapon)

ZoriaRPG | PRO | 09/05/19 12:12:49 PM UTC | 0 ⭐ | 828 👁️ | Never ⏰ | []
C++ |

960 B

|

None

|

0 👍

/

0 👎

item script hatespell
{
    void run(int errSfx, int affectedItemClass, int multiplier)
    {
        bool do_disable;
        if ( Game->Counter[this->CostCounter] < this->Cost )
        {
            Audio->PlaySound(errSfx); Quit();
        }
        
        int tempitmpower[256];
        for ( int q = 0; q < 256; ++q )
        {
            itemdata theItem = Game->LoadItemData(q);
            if ( theItem->Class == affectedItemClass )
            {
                tempitmpower[q] = theItem->Power+1;
                theItem->Power *= multiplier;
            }
        }
        while((Game->Counter[this->CostCounter] -= this->Cost) > 0)
        {
            if (( Hero->PressA && Hero->ItemA == this->ID ) ||( Hero->PressB && Hero->ItemB == this->ID ) )
            {
                break;
            }
            Waitframe();
        }
        Audio->PlaySound(this->UseSound);
        for ( int q = 0; q < 256; ++q )
        {
            itemdata theItem = Game->LoadItemData(q);
            if ( theItem->Class == affectedItemClass )
            {
                if ( tempitmpower[q] )
                {
                    theItem->Power = tempitmpower[q]-1;
                }
            }
        }   
        Quit();
    }
        
}

Comments