Well, what I tried to do cannot be done without arrays.
So, I came up with a script to fetch the data from object
description, possibly remove that data before a player gets
to see it and then apply it to the objects according to
their stats in description and a calculated medium of players
in the certain area.
The object stored variables cannot be used, due to the fact
nobody really wants to write the extra SetLocalString() for each
stat that is going to be specified to the object. It would look
too messy in the end.
Current script be below.
string gs_Balance_GetSTR (string this) {
string STR = "";
string DEX = "";
string CON = "";
string WIS = "";
string INT = "";
string CHA = "";
string bonus = "";
string levels = "";
int slength = 3;
int pos = 0;
int nlength = 3;
//VERIFY STRENGTH
if (FindSubString(this, "STR:", pos) != -1) {
pos= FindSubString(this, "STR:");
STR = GetSubString(this, pos + slength, nlength);
// VERIFY DEXTERITY
if (FindSubString(this, "DEX:", pos) != -1) {
pos = FindSubString(this, "DEX:");
DEX = GetSubString(this, pos + slength, nlength);
// VERIFY CONSTITUTION
if (FindSubString(this, "CON:", pos) != -1) {
pos = FindSubString(this, "CON:");
CON = GetSubString(this, pos + slength, nlength);
// VERIFY WISDOM
if (FindSubString(this, "WIS:", pos) != -1) {
pos = FindSubString(this, "WIS:");
WIS = GetSubString(this, pos + slength, nlength);
// VERIFY INTELLIGENCE
if (FindSubString(this, "INT:", pos) != -1) {
pos = FindSubString(this, "INT:");
INT = GetSubString(this, pos + slength, nlength);
// VERIFY CHARISMA
if (FindSubString(this, "CHA:", pos) != -1) {
pos = FindSubString(this, "CHA:");
CHA = GetSubString(this, pos + slength, nlength);
}
// END
}
// END
}
// END
}
// END
}
// END
}
//END
return "";
}
Modifié par OffGraphic, 01 février 2012 - 11:33 .