robe help

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Damo307
Expert Poster
Posts: 79
Joined: Fri Jul 07, 2006 1:32 am

robe help

Post by Damo307 »

Hey could anyone help me with a script for a robe that changes colours every time you put it on?
Ultimate`
New User
Posts: 23
Joined: Fri Jul 07, 2006 9:54 pm

Post 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.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post 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
Ultimate`
New User
Posts: 23
Joined: Fri Jul 07, 2006 9:54 pm

Post by Ultimate` »

Thanks for that :P so it will change colours when you put it on?
Post Reply