public PET_SKILL Pet_GetSkill(int nIndex, int nSkillIndex) { if (nIndex < 0 || nIndex >= GAMEDEFINE.HUMAN_PET_MAX_COUNT) { return(null); } if (nSkillIndex < 0 || nSkillIndex >= GAMEDEFINE.MAX_PET_SKILL_COUNT) { return(null); } PET_SKILL pPetSkill = null; for (int i = 0; i < GAMEDEFINE.MAX_PET_SKILL_COUNT; i++) { pPetSkill = (m_listPet[nIndex])[i]; if (pPetSkill != null && pPetSkill.m_pDefine != null && pPetSkill.m_nPosIndex == nSkillIndex) { return(pPetSkill); } } if (pPetSkill == null || pPetSkill.m_pDefine == null) { return(null); } return(pPetSkill); }
//得到解释 public override string GetDesc() { PET_SKILL pSkill = GetPetSkillImpl(); if (pSkill != null) { if (pSkill.m_pDefine != null) { // 得到技能对应的心法数据 int iPetLevel = GetMyPetLevel(); if (iPetLevel >= 0) { // 技能数据id int iSkillData_V1ID = pSkill.m_pDefine.m_anSkillByLevel[0]; //搜索纪录 _DBC_SKILLDATA_V1_DEPLETE pSkillData_V1 = CDataBaseSystem.Instance.GetDataBase <_DBC_SKILLDATA_V1_DEPLETE>((int)DataBaseStruct.DBC_SKILLDATA_V1_DEPLETE).Search_Index_EQU(iSkillData_V1ID); if (pSkillData_V1 != null) { return(pSkillData_V1.szDesc2); } } } return("ERROR"); } else { return("ERROR"); // } }
//根据技能跟新 public void Update_PetSkill(PET_SKILL pPetSkill) { if (pPetSkill == null) { throw new NullReferenceException("petskill is null in Update_PetSkill()"); } //引用 m_idPetSkillImpl = pPetSkill.m_nPosIndex; //此技能是属于第几只宠物的。 m_nPetNum = pPetSkill.m_nPetNum; // m_idPetSkillImpl = pPetSkill->m_pDefine->m_nID; //名称 m_strName = pPetSkill.m_pDefine.m_lpszName; //图标 m_strIconName = pPetSkill.m_pDefine.m_lpszIconName; // SetCheckState(pPetSkill->m_bCanUse);//此设计为2005年邱果口述,无文档 SetCheckState(false); //根据BUG 4396杨婷所提而更改 //通知UI UpdateToRefrence(); }
//激活动作 public override void DoAction() { //检查冷却是否结束 if (!CoolDownIsOver()) { return; } PET_SKILL pSkill = GetPetSkillImpl(); if (pSkill == null) { return; } SDATA_PET pThisOwner = CDataPool.Instance.Pet_GetPet(m_nPetNum); if (!CObjectManager.Instance.getPlayerMySelf().GetCharacterData().isFightPet(pThisOwner.GUID)) { GameProcedure.s_pEventSystem.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "你不能使用未放出宠物的技能"); return; } if (GetPetSkillImpl() != null && GetPetSkillImpl().m_pDefine != null) { //POINT pt = CGameProcedure::s_pInputSystem->MouseGetPos(); //fVector3 fvMouseHitPlan; //CObjectManager::GetMe()->GetMouseOverObject(pt.x, pt.y, fvMouseHitPlan); CObject pTargetObj = CObjectManager.Instance.GetMainTarget(); //根据操作类型 switch ((ENUM_SELECT_TYPE)GetPetSkillImpl().m_pDefine.m_nSelectType) { case ENUM_SELECT_TYPE.SELECT_TYPE_NONE: case ENUM_SELECT_TYPE.SELECT_TYPE_CHARACTER: { CDataPool.Instance.Pet_SendUseSkillMessage(GetPetIndex(), (short)GetPetSkillImpl().m_pDefine.m_nID, ((pTargetObj != null)?(pTargetObj.ServerID):(MacroDefine.INVALID_ID)), -1, -1); //恢复激活Action CActionSystem.Instance.SetDefaultAction(GameProcedure.s_pGameInterface.Skill_GetActive()); } break; case ENUM_SELECT_TYPE.SELECT_TYPE_POS: { CActionSystem.Instance.SetDefaultAction(this); } break; case ENUM_SELECT_TYPE.SELECT_TYPE_SELF: default: { throw new Exception("Invalid pet skill select type:" + GetPetSkillImpl().m_pDefine.m_nSelectType); } break; } } }
public PET_SKILL TargetPet_GetSkill(int nSkillIndex) { PET_SKILL pPetSkill = m_TargetPet[nSkillIndex]; if (pPetSkill == null || (pPetSkill.m_pDefine == null)) { return(null); } return(pPetSkill); }
// 宠物技能类型,0:物功,1:法功,2:护主,3:防御,4:复仇; public int GetPetSkillType() { PET_SKILL pSkill = GetPetSkillImpl(); if (pSkill != null && pSkill.m_pDefine != null) { return(pSkill.m_pDefine.m_nTypeOfPetSkill); } return(-1); }
//得到定义ID public override int GetDefineID() { PET_SKILL pSkill = GetPetSkillImpl() as PET_SKILL; if (pSkill == null) { return(-1); } return(pSkill.m_pDefine.m_nID); }
public void Pet_SetSkill(int nIndex, int nSkillIndex, PET_SKILL pPetSkillData, bool bClearOld) { if ((m_listPet[nIndex])[nSkillIndex] != null && bClearOld) { (m_listPet[nIndex])[nSkillIndex] = null; } (m_listPet[nIndex])[nSkillIndex] = pPetSkillData; ////通知ActionSystem。 CActionSystem.Instance.UserPetSkill_Update(nIndex); }
//得到冷却状组ID public override int GetCoolDownID() { PET_SKILL pSkill = GetPetSkillImpl(); if (pSkill == null) { return(-1); } return(pSkill.m_pDefine.m_nCooldownID); }
public void TargetPet_SetSkill(int nSkillIndex, PET_SKILL pPetSkillData, bool bClearOld) { PET_SKILL theSkill = m_TargetPet[nSkillIndex]; if (pPetSkillData == null && theSkill != null && bClearOld) { m_TargetPet[nSkillIndex] = null; m_TargetPet[nSkillIndex] = pPetSkillData; //通知ActionSystem。 CActionSystem.Instance.CleanInvalidAction(); } }
//宠物五行属性技能学习数据访问 public void PetSkillStudy_MenPaiList_AddSkill(int skillId) { PET_SKILL sk = new PET_SKILL(); sk.m_bCanUse = false; sk.m_nPetNum = GAMEDEFINE.MENPAI_PETSKILLSTUDY_PETNUM; sk.m_nPosIndex = m_petSkillStudyList.Count; _DBC_SKILL_DATA pDefine = CSkillDataMgr.Instance.GetSkillData((uint)skillId); if (pDefine != null) { sk.m_pDefine = pDefine; m_petSkillStudyList.Add(sk); } }
void OnEvent(GAME_EVENT_ID eventid, List <string> vParam) { switch (eventid) { case GAME_EVENT_ID.GE_CHANGE_BAR: { for (int i = 0; i < MAX_SHORTCUT_COUNT; i++) { int actionID = CActionSystem.Instance.MainMenuBar_Get(i); mItems[i] = null; CActionItem pItem = CActionSystem.Instance.GetActionByActionId(actionID); if (pItem != null) { switch (pItem.GetType()) { case ACTION_OPTYPE.AOT_SKILL: { SCLIENT_SKILL pSkill = pItem.GetImpl() as SCLIENT_SKILL; if (pSkill == null) { break; } mItems[i] = pItem; } break; case ACTION_OPTYPE.AOT_PET_SKILL: { PET_SKILL pPetSkill = pItem.GetImpl() as PET_SKILL; if (pPetSkill == null) { break; } mItems[i] = pItem; } break; } } } } break; } }
public void Pet_SetSkill(int nIndex, int nSkillIndex, ref _OWN_SKILL Skill) { if (nIndex < 0 || nIndex >= (int)PET_INDEX.PET_INDEX_SELF_NUMBERS) { return; } PET_SKILL theSkill = (m_listPet[nIndex])[nSkillIndex]; _DBC_SKILL_DATA pDefine = CDataBaseSystem.Instance.GetDataBase <_DBC_SKILL_DATA>((int)DataBaseStruct.DBC_SKILL_DATA).Search_Index_EQU(Skill.m_nSkillID); LogManager.LogWarning("Pet_SetSkill index " + nIndex + " SkillIndex " + nSkillIndex + " SkillID " + Skill.m_nSkillID); if (theSkill == null) { if (pDefine != null) { PET_SKILL newSkill = new PET_SKILL(); newSkill.m_pDefine = pDefine; newSkill.m_nPetNum = nIndex; newSkill.m_nPosIndex = nSkillIndex; newSkill.m_bCanUse = true; (m_listPet[nIndex])[nSkillIndex] = newSkill; } } else { if (pDefine != null) { theSkill.m_pDefine = pDefine; theSkill.m_nPetNum = nIndex; theSkill.m_nPosIndex = nSkillIndex; theSkill.m_bCanUse = true; } else { (m_listPet[nIndex])[nSkillIndex] = null; } } //通知ActionSystem。 CActionSystem.Instance.UserPetSkill_Update(nIndex); }
public void TargetPet_SetSkill(int nSkillIndex, ref _OWN_SKILL Skill) { PET_SKILL theSkill = m_TargetPet[nSkillIndex]; int nIndex = (int)PET_INDEX.TARGETPET_INDEX; _DBC_SKILL_DATA pDefine = CDataBaseSystem.Instance.GetDataBase <_DBC_SKILL_DATA>((int)DataBaseStruct.DBC_SKILL_DATA).Search_Index_EQU(Skill.m_nSkillID); if (theSkill == null) { if (pDefine != null) { PET_SKILL newSkill = new PET_SKILL(); newSkill.m_pDefine = pDefine; newSkill.m_nPetNum = nIndex; newSkill.m_nPosIndex = nSkillIndex; newSkill.m_bCanUse = true; m_TargetPet[nSkillIndex] = newSkill; } } else { if (pDefine != null) { theSkill.m_pDefine = pDefine; theSkill.m_nPetNum = nIndex; theSkill.m_bCanUse = true; } else { m_TargetPet[nSkillIndex] = null; } } //通知ActionSystem。 CActionSystem.Instance.UserTargetPetSkill_Update(); }
//公用函数接口 public void PET_DETAIL_ATTRIB2SDATA_PAT(_PET_DETAIL_ATTRIB pIn, SDATA_PET pOut) { if ((object)pIn == null || pOut == null) { return; } //清除旧数据 pOut.CleanUp(); pOut.IsPresent = 2; //基本数据转换 pOut.GUID = pIn.m_GUID; // ID pOut.idServer = (uint)pIn.m_ObjID; // 所有Obj类型的ObjID pOut.DataID = pIn.m_nDataID; // Data ID,宠物类型 pOut.Name = UIString.Instance.GetUnicodeString(pIn.m_szName); pOut.AIType = pIn.m_nAIType; // 性格 pOut.SpouseGUID = pIn.m_SpouseGUID; // 配偶的GUID pOut.Level = pIn.m_nLevel; // 等级 pOut.Exp = pIn.m_nExp; // 经验 pOut.HP = pIn.m_nHP; // 血当前值 pOut.HPMax = pIn.m_nHPMax; // 血最大值 pOut.Age = pIn.m_nLife; // 当前寿命 pOut.EraCount = pIn.m_byGeneration; // 几代宠 pOut.Happiness = pIn.m_byHappiness; // 快乐度 pOut.AttPhysics = pIn.m_nAtt_Physics; // 物理攻击力 pOut.AttMagic = pIn.m_nAtt_Magic; // 魔法攻击力 pOut.DefPhysics = pIn.m_nDef_Physics; // 物理防御力 pOut.DefMagic = pIn.m_nDef_Magic; // 魔法防御力 pOut.Hit = pIn.m_nHit; // 命中率 pOut.Miss = pIn.m_nMiss; // 闪避率 pOut.Critical = pIn.m_nCritical; // 会心率 pOut.ModelID = pIn.m_nModelID; // 外形 pOut.MountID = pIn.m_nMountID; // 座骑ID pOut.AttrStrApt = pIn.m_StrPerception; // 力量资质 pOut.AttrConApt = pIn.m_ConPerception; // 体力资质 pOut.AttrDexApt = pIn.m_DexPerception; // 身法资质 pOut.AttrSprApt = pIn.m_SprPerception; // 灵气资质 pOut.AttrIntApt = pIn.m_IntPerception; // 定力资质 pOut.AttrStr = pIn.m_Str; // 力量 pOut.AttrCon = pIn.m_Con; // 体力 pOut.AttrDex = pIn.m_Dex; // 身法 pOut.AttrSpr = pIn.m_Spr; // 灵气 pOut.AttrInt = pIn.m_Int; // 定力 pOut.Basic = pIn.m_GenGu; // 根骨 pOut.Pot = pIn.m_nRemainPoint; // 潜能点 //技能转换 int minSkill = ((int)ENUM_PET_SKILL_INDEX.PET_SKILL_INDEX_NUMBERS > GAMEDEFINE.MAX_PET_SKILL_COUNT) ? GAMEDEFINE.MAX_PET_SKILL_COUNT : (int)ENUM_PET_SKILL_INDEX.PET_SKILL_INDEX_NUMBERS; for (int i = 0; i < minSkill; ++i) { PET_SKILL theSkill = pOut[i]; _DBC_SKILL_DATA pDefine = CSkillDataMgr.Instance.GetSkillData((uint)pIn.m_aSkill[i].m_nSkillID); if (theSkill != null) { PET_SKILL newSkill = new PET_SKILL(); newSkill.m_pDefine = pDefine; newSkill.m_nPetNum = GAMEDEFINE.MENPAI_PETSKILLSTUDY_PETNUM - (i + 1); //no need to set if only shown. newSkill.m_nPosIndex = i; newSkill.m_bCanUse = true; pOut[i] = newSkill; } else { theSkill.m_pDefine = pDefine; theSkill.m_nPetNum = GAMEDEFINE.MENPAI_PETSKILLSTUDY_PETNUM - (i + 1); //no need to set if only shown. theSkill.m_bCanUse = true; theSkill.m_nPosIndex = i; } } }
public void Pet_CopyToTarget(SDATA_PET pSourcePet) { SDATA_PET pTargetPet = CDataPool.Instance.TargetPet_GetPet(); pTargetPet.CleanUp(); CActionSystem.Instance.CleanInvalidAction(); pTargetPet.IsPresent = pSourcePet.IsPresent; pTargetPet.GUID = pSourcePet.GUID; pTargetPet.idServer = pSourcePet.idServer; pTargetPet.DataID = pSourcePet.DataID; pTargetPet.AIType = pSourcePet.AIType; pTargetPet.Name = pSourcePet.Name; pTargetPet.Level = pSourcePet.Level; pTargetPet.Exp = pSourcePet.Exp; pTargetPet.HP = pSourcePet.HP; pTargetPet.HPMax = pSourcePet.HPMax; pTargetPet.Age = pSourcePet.Age; pTargetPet.EraCount = pSourcePet.EraCount; pTargetPet.Happiness = pSourcePet.Happiness; pTargetPet.SpouseGUID = pSourcePet.SpouseGUID; pTargetPet.ModelID = pSourcePet.ModelID; pTargetPet.MountID = pSourcePet.MountID; pTargetPet.AttPhysics = pSourcePet.AttPhysics; pTargetPet.AttMagic = pSourcePet.AttMagic; pTargetPet.DefPhysics = pSourcePet.DefPhysics; pTargetPet.DefMagic = pSourcePet.DefMagic; pTargetPet.Hit = pSourcePet.Hit; pTargetPet.Miss = pSourcePet.Miss; pTargetPet.Critical = pSourcePet.Critical; pTargetPet.AttrStrApt = pSourcePet.AttrStrApt; pTargetPet.AttrConApt = pSourcePet.AttrConApt; pTargetPet.AttrDexApt = pSourcePet.AttrDexApt; pTargetPet.AttrSprApt = pSourcePet.AttrSprApt; pTargetPet.AttrIntApt = pSourcePet.AttrIntApt; pTargetPet.AttrStr = pSourcePet.AttrStr; pTargetPet.AttrCon = pSourcePet.AttrCon; pTargetPet.AttrDex = pSourcePet.AttrDex; pTargetPet.AttrSpr = pSourcePet.AttrSpr; pTargetPet.AttrInt = pSourcePet.AttrInt; pTargetPet.Basic = pSourcePet.Basic; pTargetPet.Pot = pSourcePet.Pot; pTargetPet.AttrSprBring = pSourcePet.AttrSprBring; pTargetPet.AttrIntBring = pSourcePet.AttrIntBring; pTargetPet.AttrStrBring = pSourcePet.AttrStrBring; pTargetPet.AttrDexBring = pSourcePet.AttrDexBring; pTargetPet.AttrConBring = pSourcePet.AttrConBring; PET_SKILL pDestPetSkill = null; PET_SKILL pSourcePetSkill = null; for (int i = 0; i < (int)ENUM_PET_SKILL_INDEX.PET_SKILL_INDEX_NUMBERS; i++) { pSourcePetSkill = pSourcePet[i]; if (pSourcePetSkill != null) { pDestPetSkill = pTargetPet[i]; if (pDestPetSkill == null) { pTargetPet[i] = new PET_SKILL(); pDestPetSkill = pTargetPet[i]; } pDestPetSkill.m_bCanUse = pSourcePetSkill.m_bCanUse; pDestPetSkill.m_nPetNum = (int)PET_INDEX.TARGETPET_INDEX; //pPetSourceData->m_aSkill[i]->m_nPetNum; pDestPetSkill.m_nPosIndex = i; //pPetSourceData->m_aSkill[i]->m_nPosIndex; pDestPetSkill.m_pDefine = pSourcePetSkill.m_pDefine; } } CActionSystem.Instance.UserTargetPetSkill_Update(); }
//拖动结束 public override void NotifyDragDropDragged(bool bDestory, string szTargetName, string szSourceName) { if (bDestory) { char cSourceType = szSourceName[0]; switch (cSourceType) { case 'M': //主菜单 { int nIndex = szSourceName[1] - '0'; nIndex = szSourceName[2] - '0' + nIndex * 10; CActionSystem.Instance.MainMenuBar_Set(nIndex, -1); } break; default: break; } } //拖动到空白地方 if (szTargetName == null || szTargetName[0] == '\0') { return; } char cSourceName = szSourceName[0]; char cTargetType = szTargetName[0]; //如果不是拖到快捷栏,返回 if (cSourceName == 'M' && cTargetType != 'M') { return; } int nOldTargetId = -1; int nPet_Num = -1; PET_SKILL pPetSkill = GetPetSkillImpl(); switch (cTargetType) { case 'M': //主菜单 { //如果不是手动的技能,不能放如快捷栏 if (pPetSkill.m_pDefine.m_nOperateModeForPetSkill != (int)PET_SKILL_OPERATEMODE.PET_SKILL_OPERATE_NEEDOWNER) { break; } /////////////////////////////////////////////////// //要是以后策划改主意了,就把这段注释掉。 nPet_Num = GetPetIndex(); //modified by ss 将getnum 接口换成 getpetindex if (nPet_Num >= 0 && nPet_Num < GAMEDEFINE.HUMAN_PET_MAX_COUNT) { SDATA_PET My_Pet = CDataPool.Instance.Pet_GetPet(nPet_Num); //如果不是放出的宠物,就不要放在快捷 if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().isFightPet(My_Pet.GUID)) { break; } } /////////////////////////////////////////////////// int nIndex = szTargetName[1] - '0'; nIndex = szTargetName[2] - '0' + nIndex * 10; //查询目标位置原来的内容 nOldTargetId = CActionSystem.Instance.MainMenuBar_Get(nIndex); CActionSystem.Instance.MainMenuBar_Set(nIndex, GetID()); } break; default: break; } switch (cSourceName) { case 'M': { int nIndex = szSourceName[1] - '0'; nIndex = szSourceName[2] - '0' + nIndex * 10; CActionSystem.Instance.MainMenuBar_Set(nIndex, nOldTargetId); } break; default: break; } CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_SUPERTOOLTIP, "0"); }
public void Pet_SetSkill(int nIndex, int nSkillIndex, PET_SKILL pPetSkillData, bool bClearOld) { mPetDataPool.Pet_SetSkill(nIndex, nSkillIndex, pPetSkillData, bClearOld); }
bool CanUseSkill(CActionItem skillItem, CObject_Character target) { if (skillItem == null) { return(false); } if (target == null) { return(false); } if (target.IsDie()) { return(false); } switch (skillItem.GetType()) { case ACTION_OPTYPE.AOT_SKILL: { SCLIENT_SKILL pSkill = skillItem.GetImpl() as SCLIENT_SKILL; if (pSkill == null) { break; } Vector3 avatarPos = CObjectManager.Instance.getPlayerMySelf().GetPosition(); Vector3 avatarPosOnPlane = new Vector3(avatarPos.x, 0, avatarPos.z); Vector3 targetPos = new Vector3(-1, 0, -1); int ServerID = -1; targetPos = new Vector3(target.GetPosition().x, 0, target.GetPosition().z); ServerID = target.ServerID; Vector3 PosOnPlane = new Vector3(targetPos.x, 0, targetPos.z); float dir = Vector3.Angle(avatarPosOnPlane, PosOnPlane); OPERATE_RESULT result = pSkill.IsCanUse(CObjectManager.Instance.getPlayerMySelf().ID, pSkill.m_nLevel, ServerID, targetPos.x, targetPos.z, dir); if (result == OPERATE_RESULT.OR_OK) { return(true); } } break; case ACTION_OPTYPE.AOT_PET_SKILL: { PET_SKILL pPetSkill = skillItem.GetImpl() as PET_SKILL; if (pPetSkill == null) { break; } if (Interface.Pet.Instance.IsFighting(pPetSkill.m_nPetNum)) { return(true); } } break; } return(false); }