Example #1
0
    /// <summary>
    /// 宠物当前经验 战斗中获得的经验不用这条消息
    /// </summary>
    /// <param name="cmd"></param>

    public void OnPetCurExp(stExpPetUserCmd_S cmd)
    {
        IPet pet = GetPetByThisID(cmd.id);

        if (pet != null)
        {
            int oldExp = pet.GetProp((int)PetProp.LevelExp);
            pet.SetProp((int)PetProp.LevelExp, cmd.exp);
            int delta = cmd.exp - oldExp;
            if (delta > 0)
            {
                string txt = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.Talk_System_zhanghunhuodejingyan, GetPetName(pet), delta);
                ChatDataManager.SendToChatSystem(txt);
            }
        }
        DispatchValueUpdateEvent(new ValueUpdateEventArgs()
        {
            key = PetDispatchEventString.PetRefreshProp.ToString()
        });
    }
Example #2
0
 public void OnPetCurExp(stExpPetUserCmd_S cmd)
 {
     DataManager.Manager <PetDataManager>().OnPetCurExp(cmd);
 }