public static List <int> ProcessExtensionProps(List <int> extensionPropsIDList, int skillID, int actionType) { List <int> list = new List <int>(); List <int> result; if (null == extensionPropsIDList) { result = list; } else { Dictionary <int, byte> dict = new Dictionary <int, byte>(); for (int i = 0; i < extensionPropsIDList.Count; i++) { int id = extensionPropsIDList[i]; ExtensionPropItem extensionPropItem = ExtensionPropsMgr.FindCachingItem(id); if (null != extensionPropItem) { if (extensionPropItem.ActionType == actionType) { if (extensionPropItem.NeedSkill.Count > 0) { if (!extensionPropItem.NeedSkill.ContainsKey(skillID)) { goto IL_C2; } } int rndNum = Global.GetRandomNumber(0, 101); if (rndNum <= extensionPropItem.Probability) { list.Add(id); dict[id] = 1; } } } IL_C2 :; } List <int> returnList = new List <int>(); for (int i = 0; i < list.Count; i++) { int id = list[i]; ExtensionPropItem extensionPropItem = ExtensionPropsMgr.FindCachingItem(id); if (null != extensionPropItem) { if (extensionPropItem.PrevTuoZhanShuXing.Count > 0) { foreach (int key in extensionPropItem.PrevTuoZhanShuXing.Keys) { if (!dict.ContainsKey(key)) { } } } returnList.Add(id); } } result = returnList; } return(result); }
public static void ExecuteExtensionPropsActions(List <int> list, IObject self, IObject obj) { if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { int id = list[i]; ExtensionPropItem extensionPropItem = ExtensionPropsMgr.FindCachingItem(id); if (null != extensionPropItem) { IObject targetObj; if (0 == extensionPropItem.ActionType) { targetObj = self; if (0 != extensionPropItem.TargetType) { targetObj = obj; } } else { targetObj = obj; if (0 != extensionPropItem.TargetType) { targetObj = self; } } List <MagicActionItem> magicActionItemList = null; if (GameManager.SystemMagicActionMgr.BossAIActionsDict.TryGetValue(extensionPropItem.ID, out magicActionItemList) && null != magicActionItemList) { for (int j = 0; j < magicActionItemList.Count; j++) { MagicAction.ProcessAction(self, targetObj, magicActionItemList[j].MagicActionID, magicActionItemList[j].MagicActionParams, -1, -1, 0, 1, -1, 0, 0, -1, 0, false, false, 1.0, 1, 0.0); } } GameManager.ClientMgr.NotifySpriteExtensionPropsHited(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, self, targetObj.GetObjectID(), (int)targetObj.CurrentPos.X, (int)targetObj.CurrentPos.Y, id); } } } }