/// <summary> /// Used to apply changes from Welcome packet to existing character. /// </summary> /// <param name="newGuy">Changes to MainPlayer.ActiveCharacter, contained in a CharacterData object</param> /// <param name="copyPaperdoll">Set to true if paperdoll data from newGuy should be applied to this character</param> public void ApplyData(CharacterData newGuy, bool copyPaperdoll = true) { ID = newGuy.ID; Name = newGuy.Name; PaddedGuildTag = newGuy.GuildTag; if (copyPaperdoll) { //only set the doll graphic info in render data - don't change the paperdoll info! RenderData.SetBoots(newGuy.Boots); RenderData.SetArmor(newGuy.Armor); RenderData.SetHat(newGuy.Hat); RenderData.SetShield(newGuy.Shield); RenderData.SetWeapon(newGuy.Weapon); } Stats.SetHP(newGuy.HP); Stats.SetMaxHP(newGuy.MaxHP); Stats.SetTP(newGuy.TP); Stats.SetMaxTP(newGuy.MaxTP); RenderData.SetDirection(newGuy.Direction); RenderData.SetHairStyle(newGuy.HairStyle); RenderData.SetHairColor(newGuy.HairColor); RenderData.SetGender(newGuy.Gender); RenderData.SetRace(newGuy.Race); RenderData.SetSitting(newGuy.Sitting); RenderData.level = newGuy.Level; RenderData.SetWalkFrame(0); State = RenderData.sitting == SitState.Standing ? CharacterActionState.Standing : CharacterActionState.Sitting; CurrentMap = newGuy.Map; X = newGuy.X; Y = newGuy.Y; //GuildRankNum = newGuy.GuildRankNum; //todo: ??? }
/// <summary> /// Used to apply changes from Welcome packet to existing character. /// </summary> /// <param name="newGuy">Changes to MainPlayer.ActiveCharacter, contained in a CharacterData object</param> /// <param name="copyPaperdoll">Set to true if paperdoll data from newGuy should be applied to this character</param> public void ApplyData(CharacterData newGuy, bool copyPaperdoll = true) { ID = newGuy.ID; Name = newGuy.Name; PaddedGuildTag = newGuy.GuildTag; if (copyPaperdoll) { //todo: is this sufficient? need to check refresh-reply EquipItem(ItemType.Boots, 0, newGuy.Boots, true); EquipItem(ItemType.Armor, 0, newGuy.Armor, true); EquipItem(ItemType.Hat, 0, newGuy.Hat, true); EquipItem(ItemType.Shield, 0, newGuy.Shield, true); EquipItem(ItemType.Weapon, 0, newGuy.Weapon, true); } Stats.SetHP(newGuy.HP); Stats.SetMaxHP(newGuy.MaxHP); Stats.SetTP(newGuy.TP); Stats.SetMaxTP(newGuy.MaxTP); //todo: is this enough for render data to be correct after call to ApplyData? RenderData.SetDirection(newGuy.Direction); RenderData.SetHairStyle(newGuy.HairStyle); RenderData.SetHairColor(newGuy.HairColor); RenderData.SetGender(newGuy.Gender); RenderData.SetRace(newGuy.Race); RenderData.SetSitting(newGuy.Sitting); RenderData.level = newGuy.Level; RenderData.SetWalkFrame(0); State = RenderData.sitting == SitState.Standing ? CharacterActionState.Standing : CharacterActionState.Sitting; CurrentMap = newGuy.Map; //MapIsPk = newGuy.MapIsPk; //todo: ??? X = newGuy.X; Y = newGuy.Y; //GuildRankNum = newGuy.GuildRankNum; //todo: ??? }