Page 1 of 1

robe help

Posted: Sat Dec 09, 2006 7:45 pm
by Damo307
Hey could anyone help me with a script for a robe that changes colours every time you put it on?

Posted: Sat Dec 09, 2006 7:49 pm
by Ultimate`
Yeah, this would be awesome to know. I would like to make a script for certain items so they change colours every time you do something.

Posted: Sat Dec 09, 2006 8:15 pm
by CWO
basically you can go into your itemdesc.cfg and create a new entry for your new robe. Something like this

Code: Select all

Armor (PUT VALID OBJTYPE HERE!)
{
    Name            Robe
    Graphic         0x1f03
    AR              4
    Coverage        Body
    Coverage        Legs/feet
    Coverage        Arms
    VendorSellsFor  68
    VendorBuysFor   34
    maxhp           20
    equipscript     (PUT SCRIPT YOU WANT TO RUN ON EQUIP HERE!)
}
change the 2 lines I have in caps and parentheses to valid entries.

Now in the equip script, you want something like

Code: Select all

use util;

program equip(who, robe)
     var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 }; //Put all valid colors here separated by commas.
     var rint := RandomInt(validcolors.size())+1;
     var color := validcolors[rint];
     robe.color := color;
     return 1;
endprogram

Posted: Sat Dec 09, 2006 8:37 pm
by Ultimate`
Thanks for that :P so it will change colours when you put it on?