Well, I might just as well ask here... Any idea why this script doesn't even seem to launch?
OnModuleLoad
#include "mod_color"
void main()
{
string sDesc = ""; //
GiveGoldToCreature(GetFirstPC(), 1); // //
int r=0,g=0,b=0;
while (r+g+b != 27)
{
sDesc += ColorString("XXXXXX\\n", r*25+30, g*25+30, b*25+30, 1); //
SetCustomToken(6000 + r*100 + g*10 + b*1, ColorString("", r*25+30, g*25+30, b*25+30));
if ((g == 9) && (b == 9)) {r++; g=0; b=0;}
else if ((b == 9)) { g++; b=0;}
else { b++;}
}
GiveGoldToCreature(GetFirstPC(), 2); // //
SetCustomToken(7000, "</c>");
SetDescription(GetObjectByTag("thechest"), sDesc); //
}
mod_color
const string COLORTOKEN = " ##################$%&'()*+,-./0123456789:;;==?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[[]^_`abcdefghijklmnopqrstuvwxyz{|}~~€Â‚ƒ„…†‡ˆ‰Š‹ŒÂŽÂ‘’“â€â€¢â€“—˜™š›œÂžŸ¡¡¢£¤¥¦§¨©ª«¬¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÃÂÃÄÅÆÇÈÉÊËÌÃÃŽÃÃÑÒÓÔÕÖ×ØÙÚÛÜÃÞßà áâãäåæçèéêëìÃîïðñòóôõö÷øùúûüýþþ";
// returns a properly color-coded sText string based on specified RGB values
// ends color mode after sText if iEnd = 1
string ColorString(string sText, int nRed=255, int nGreen=255, int nBlue=255, int iEnd = 0);
string ColorString(string sText, int nRed=255, int nGreen=255, int nBlue=255, int iEnd = 0)
{
string sEnd = "";
if (iEnd = 1) {sEnd = "</c>";}
return "<c" + GetSubString(COLORTOKEN, nRed, 1) + GetSubString(COLORTOKEN, nGreen, 1) + GetSubString(COLORTOKEN, nBlue, 1) + ">" + sText + sEnd;
}
Im not getting the 1 or 2 gold I put in the script for testing.
Modifié par Xardex, 03 juin 2011 - 06:59 .