Full Version : Changing maps on young player's death
xmlspawner >>Scripting Support >>Changing maps on young player's death


<< Prev | Next >>

Zyle- 02-21-2006
I'm trying to make it so that wherever a young player dies, they'll be transported back to our Luna healer. The playermobile code I've messed with is below. They get sent to the correct location, however their map is still set to the one they died on. I tried a few things to change the map, but couldn't get it to compile. Any help would be appreciated tongue.gif

CODE


private static Point3D[] m_MalasDeathDestinations = new Point3D[]
  {
   new Point3D(  948,  570, -90 )
  };


 public Point3D GetYoungDeathDestination()
 {
  if ( this.Region is Jail )
   return Point3D.Zero;

  Point3D[] list;

  if ( this.Map == Map.Trammel )
   list = m_MalasDeathDestinations;
  else if ( this.Map == Map.Felucca )
   list = m_MalasDeathDestinations;
  else if ( this.Map == Map.Ilshenar )
   list = m_MalasDeathDestinations;
  else if ( this.Map == Map.Malas )
   list = m_MalasDeathDestinations;
  else if ( this.Map == Map.Tokuno )
   list = m_MalasDeathDestinations;
  else
   return Point3D.Zero;



Dian- 02-21-2006
can you post the OnDeath code as well, what you have posted is incomplete, and cant really follow it... is that also in your PlayerMobile script?

Zyle- 02-21-2006
It's indeed in PlayerMobile which is why I didn't post it all wink.gif Anyway, the OnDeath hint was enough - I have it working now. Don't know how I overlooked that before, my brain's frazzled. Thanks biggrin.gif

Dian- 02-21-2006
Seems the better way to have done it though would be using,
this.MoveToWorld( Poind3D loc, Map map )

Galfaroth- 02-21-2006
I think it should seem now like:
CODE

public Point3D GetYoungDeathDestination()
{
 if ( this.Region is Jail )
  return Point3D.Zero;

 if ( this.Map != null )
   this.MoveToWorld( (  948,  570, -90 ), map.Trammel );//or any map you'd like
 else
  return Point3D.Zero;
}

Zyle- 02-21-2006
Thanks guys, I'll have a fiddle around with that smile.gif