public void OnLearnSkill(stLearnSkillPetUserCmd_CS cmd) { IPet pet = GetPetByThisID(cmd.id); if (pet != null) { ShowTipsEnum(LocalTextType.Pet_Skill_jinengxuexichenggong); // ShowTips(108507); pet.AddPetSkill(cmd.skill, cmd.skill_idx); } DispatchValueUpdateEvent(new ValueUpdateEventArgs() { key = PetDispatchEventString.PetSkillInit.ToString() }); if (CurFightingPet != 0) { stShowPetSkill showPet = new stShowPetSkill(); showPet.bShow = true; EventEngine.Instance().DispatchEvent((int)GameEventID.SKILL_SHOWPETSKILL, showPet); } stPetGetSkill ps = new stPetGetSkill(); ps.petID = cmd.id; ps.skillID = (uint)cmd.skill; EventEngine.Instance().DispatchEvent((int)GameEventID.SKILLSYSTEM_PETGETSKILL, ps); }
void onClick_Shengji_Btn(GameObject caster) { if (CurPet != null) { if (!CheckItem()) { return; } List <PetSkillObj> skillList = CurPet.GetPetSkillList(); bool hasShoudong = false; string skillname = ""; foreach (var obj in skillList) { if (obj.id == (int)CurSkillDataBase.wdID) { TipsManager.Instance.ShowTips(LocalTextType.Pet_Skill_yijingxuehuilegaijineng); //TipsManager.Instance.ShowTipsById(108013 ); return; } SkillDatabase db = GameTableManager.Instance.GetTableItem <SkillDatabase>((uint)obj.id, 1); if (db != null) { if (db.petType == (int)PetSkillType.Initiative) { skillname = db.strName; hasShoudong = true; } } } if (CurSkillDataBase.petType == (int)PetSkillType.Initiative) { if (hasShoudong) { string tipstr = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.Pet_Skill_shoudongjinengfugaixuexitishi, skillname); TipsManager.Instance.ShowTipWindow(TipWindowType.Custom, tipstr, () => { stLearnSkillPetUserCmd_CS stcmd = new stLearnSkillPetUserCmd_CS(); stcmd.id = CurPet.GetID(); stcmd.auto_buy = bAutoFull; stcmd.skill = (int)CurSkillDataBase.wdID; NetService.Instance.Send(stcmd); }, null, null, CommonData.GetLocalString("提示"), CommonData.GetLocalString("替换"), CommonData.GetLocalString("取消")); return; } } stLearnSkillPetUserCmd_CS cmd = new stLearnSkillPetUserCmd_CS(); cmd.id = CurPet.GetID(); cmd.skill = (int)CurSkillDataBase.wdID; cmd.auto_buy = bAutoFull; NetService.Instance.Send(cmd); } }
public void OnLearnSkill(stLearnSkillPetUserCmd_CS cmd) { DataManager.Manager <PetDataManager>().OnLearnSkill(cmd); }