public void Give(SkillId id, SkillRank rank)
{
var skill = this.Get(id);
if (skill == null)
{
this.Add(skill = new Skill(_creature, id, rank, _creature.RaceId));
Send.SkillInfo(_creature, skill);
if (_creature.Region != Region.Limbo)
Send.RankUp(_creature);
ChannelServer.Instance.Events.OnSkillRankChanged(_creature, skill);
}
else
{
this.RemoveBonuses(skill);
skill.ChangeRank(rank);
Send.SkillRankUp(_creature, skill);
if (_creature.Region != Region.Limbo)
Send.RankUp(_creature, skill.Info.Id);
this.AddBonuses(skill);
}
Send.StatUpdate(_creature, StatUpdateType.Private,
Stat.Str, Stat.Int, Stat.Dex, Stat.Will, Stat.Luck,
Stat.Life, Stat.LifeInjured, Stat.LifeMaxMod, Stat.LifeMax, Stat.Mana, Stat.ManaMaxMod, Stat.ManaMax, Stat.Stamina, Stat.Hunger, Stat.StaminaMaxMod, Stat.StaminaMax
);
Send.StatUpdate(_creature, StatUpdateType.Public, Stat.Life, Stat.LifeInjured, Stat.LifeMaxMod, Stat.LifeMax);
this.RankChanged.Raise(_creature, skill);
}