View Single Post
  #1  
Old 02-20-2008, 02:27 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Error changing body,head,shield

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.+= .5;
  
this.shieldpower 1;
}

function 
reload(pars)
  {
  
this.chat pars// this is for diagnostics.
  
for(0<= 4i++)
    {
    
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(
0pobj.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.headimgthis.shieldimg,this.bodyimgthis.nickthis.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 
Reply With Quote