The idea here is to use a DB NPC to keep track of data for statues so players without RC can change statues has they see fit without frequently having to have staff update levels for them. This also prevents update levels/level overwrites/not being in the level for an extended amount of time from changing how the class looks.
However, right now, only the colors, hat, nick, and AP change effectively.
The bodyimg, headimg, and shieldimg stay at head0.png, shield1.png, and body.png.
Any ideas as to why?
Class "statue"
PHP Code:
function onCreated()
{
showcharacter();
this.x += .5;
this.shieldpower = 1;
}
function reload(pars)
{
this.chat = pars; // this is for diagnostics.
for(i = 0; i <= 4; i++)
{
this.colors[i] = pars[i];
}
this.headimg = pars[5];
this.shieldimg = pars[6];
this.bodyimg = pars[7];
this.nick = pars[8];
this.ap = pars[9];
this.attr[1] = pars[10];
}
function copyPlayer(pobj)
{
this.shieldimg = pobj.shieldimg;
for(i = 0; i < pobj.colors.size(); i++)
this.colors[i] = pobj.colors[i];
this.headimg = pobj.headimg;
this.nick = pobj.nick;
this.ap = pobj.ap;
this.attr[1] = pobj.attr[1];
this.bodyimg = pobj.bodyimg;
this.sprite = 0;
}
function updateLook()
{
DB_Statues.(this.level @ "_" @ this.acc) = {this.colors[0], this.colors[1], this.colors[2], this.colors[3], this.colors[4], this.headimg, this.shieldimg,this.bodyimg, this.nick, this.ap,this.attr[1]};
}
function getLook()
{
return DB_Statues.(this.level @ "_" @ this.acc);
}
function reset()
{
showcharacter();
}
Level NPC
PHP Code:
function onCreated()
{
join("statue");
this.acc = "Mark Sir Link";
reload(getLook());
}
function onPlayerChats()
{
if(player.account == this.acc && player.chat.starts("copy"))
{
copyPlayer(findplayer(player.account));
this.nick = "";
updateLook();
}
}
DB_Statue flags:
PHP Code:
guildrommiel_sumi_spar.nw_Mark Sir Link=orange,white,black,black,black,classichead-ghosthawk.png,classicshield-ghosthawk.png,body.png,"",81,hat104.png