protected void MarkWarningMessageByEffect(EntityParent caster, int effectID, XPoint basePoint) { if (basePoint == null) { return; } Effect effect = DataReader <Effect> .Get(effectID); if (effect == null) { return; } if (effect.aiEffectMove != 1) { return; } if (effect.range == null) { return; } if (effect.range.get_Count() < 3) { return; } float casterRadius = 0f; if (caster.Actor) { casterRadius = XUtility.GetHitRadius(caster.Actor.FixTransform); } this.MarkWarningMessage(basePoint.ApplyOffset(effect.offset), effect.range, casterRadius); this.MarkWarningMessage(basePoint.ApplyOffset(effect.offset), effect.range2, casterRadius); }
public static void AppBlink(Effect effectData, EntityParent caster, XPoint basePoint, bool isCommunicateMix) { Pos pos = new Pos(); Vector2 vector = new Vector2(); Vector3 vector2 = Vector3.get_zero(); Vector3 vector3 = caster.Actor.FixTransform.get_forward(); EffectBasePointType @base = (EffectBasePointType)effectData.@base; if (@base != EffectBasePointType.SpawnPoint) { vector2 = basePoint.ApplyOffset(effectData.offset).position; } else { vector2 = LocalAgent.GetSpawnPosition(effectData.summonId); } if (effectData.blinkPoint != 0) { vector3 = LocalAgent.GetSpawnPosition(effectData.blinkPoint) - vector2; } pos.x = (float)((int)vector2.x * 100); pos.y = (float)((int)vector2.z * 100); vector.x = vector3.x; vector.y = vector3.z; LocalBattleProtocolSimulator.SendTeleport(caster.ID, pos); }
public override void ClientHandleHit(EntityParent caster, Effect effectData, XPoint basePoint) { if (!this.ownerActor) { return; } AvatarModel avatarModel = DataReader <AvatarModel> .Get(this.owner.FixModelID); XPoint xPoint = basePoint.ApplyOffset(effectData.offset); string hitAction = this.ownerActor.GetHitAction(effectData.hitAction); float num = 0f; float hitMoveTime = 0f; if (effectData.hitMove != null && effectData.hitMove.get_Count() > 1) { num = effectData.hitMove.get_Item(0) * avatarModel.hitMove; hitMoveTime = effectData.hitMove.get_Item(1); } Vector3 arg_157_0; if (effectData.hitBase == 1) { Vector3 vector = new Vector3(xPoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, xPoint.position.z - this.ownerActor.FixTransform.get_position().z); arg_157_0 = vector.get_normalized(); } else { Vector3 vector2 = new Vector3(basePoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, basePoint.position.z - this.ownerActor.FixTransform.get_position().z); arg_157_0 = vector2.get_normalized(); } Vector3 hitMoveDir = arg_157_0; string curActionStatus = this.ownerActor.CurActionStatus; if (num == 0f) { this.ownerActor.ClientPlayHit(hitAction, effectData.hitstraight, effectData.hitActionPriority, true); } else { this.ownerActor.ClientPlayHitMove(hitAction, hitMoveDir, num, hitMoveTime, effectData.hitstraight, effectData.hitActionPriority, delegate(Vector3 toPos, Vector3 dir) { }); } if (caster != null && caster.IsEntitySelfType && caster.Actor && this.ownerActor.CurActionStatus == hitAction && ActionStatusName.IsSkillAction(curActionStatus)) { WaveBloodManager.Instance.ThrowBlood(HPChangeMessage.GetBreakMessage(this.owner, caster)); } }
public virtual void ClientHandleHit(EntityParent caster, Effect effectData, XPoint basePoint) { if (!this.ownerActor) { return; } AvatarModel avatarModel = DataReader <AvatarModel> .Get(this.owner.FixModelID); XPoint xPoint = basePoint.ApplyOffset(effectData.offset); string hitAction = this.ownerActor.GetHitAction(effectData.hitAction); float num = 0f; float hitMoveTime = 0f; if (effectData.hitMove != null && effectData.hitMove.get_Count() > 1) { num = effectData.hitMove.get_Item(0) * avatarModel.hitMove; hitMoveTime = effectData.hitMove.get_Item(1); } Vector3 arg_157_0; if (effectData.hitBase == 1) { Vector3 vector = new Vector3(xPoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, xPoint.position.z - this.ownerActor.FixTransform.get_position().z); arg_157_0 = vector.get_normalized(); } else { Vector3 vector2 = new Vector3(basePoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, basePoint.position.z - this.ownerActor.FixTransform.get_position().z); arg_157_0 = vector2.get_normalized(); } Vector3 hitMoveDir = arg_157_0; if (num == 0f) { this.ownerActor.ClientPlayHit(hitAction, effectData.hitstraight, effectData.hitActionPriority, true); } else { this.ownerActor.ClientPlayHitMove(hitAction, hitMoveDir, num, hitMoveTime, effectData.hitstraight, effectData.hitActionPriority, delegate(Vector3 toPos, Vector3 dir) { }); } }
protected void SetDefaultFollowSelf() { XPoint arg_66_0 = new XPoint { position = EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position(), rotation = EntityWorld.Instance.EntSelf.Actor.FixTransform.get_rotation() }; List <int> list = new List <int>(); list.Add(0); list.Add((int)(-TaskNPCBehavior.FollowSelfStopDistance * 100f)); XPoint xPoint = arg_66_0.ApplyOffset(list); NavMeshHit navMeshHit; if (NavMesh.SamplePosition(xPoint.position, ref navMeshHit, 500f, -1)) { this.transform.set_position(navMeshHit.get_position()); this.navMeshAgent.Warp(this.transform.get_position()); } this.transform.set_forward(new Vector3(EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position().x - this.transform.get_position().x, 0f, EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position().z - this.transform.get_position().z)); }
protected void SetPosition() { XPoint arg_68_0 = new XPoint { position = this.Entity.Owner.Actor.FixTransform.get_position(), rotation = this.Entity.Owner.Actor.FixTransform.get_rotation() }; List <int> list = new List <int>(); list.Add(0); list.Add((int)(-ActorCityPet.StopDistance * 100f)); XPoint xPoint = arg_68_0.ApplyOffset(list); NavMeshHit navMeshHit; if (this.FixNavAgent && NavMesh.SamplePosition(xPoint.position, ref navMeshHit, 50f, -1)) { this.FixTransform.set_position(navMeshHit.get_position()); this.FixNavAgent.Warp(this.FixTransform.get_position()); } this.FixTransform.set_rotation(this.Entity.Owner.Actor.FixTransform.get_rotation()); }
public void HandleHit(Effect effectData, XPoint basePoint) { XPoint xPoint = basePoint.ApplyOffset(effectData.offset); string hitAction = this.GetHitAction(effectData.hitAction); float num = 0f; float hitMoveTime = 0f; if (effectData.hitMove != null && effectData.hitMove.get_Count() > 1) { num = effectData.hitMove.get_Item(0); hitMoveTime = effectData.hitMove.get_Item(1); } Vector3 arg_128_0; if (num == 0f) { arg_128_0 = Vector3.get_zero(); } else if (effectData.hitBase == 1) { Vector3 vector = new Vector3(xPoint.position.x - base.get_transform().get_position().x, 0f, xPoint.position.z - base.get_transform().get_position().z); arg_128_0 = vector.get_normalized(); } else { Vector3 vector2 = new Vector3(basePoint.position.x - base.get_transform().get_position().x, 0f, basePoint.position.z - base.get_transform().get_position().z); arg_128_0 = vector2.get_normalized(); } Vector3 hitMoveDir = arg_128_0; if (num == 0f) { this.ClientPlayHit(hitAction, effectData.hitstraight, effectData.hitActionPriority); } else { this.ClientPlayHitMove(hitAction, hitMoveDir, num, hitMoveTime, effectData.hitstraight, effectData.hitActionPriority); } }
protected List <ActorModel> CheckCandidatesByEffectShape(List <ActorModel> candidates, Actor casterActor, XPoint basePoint, Effect effectData) { List <ActorModel> list = new List <ActorModel>(); if (casterActor == null) { return(list); } if (basePoint == null) { return(list); } GraghMessage graghMessage = null; GraghMessage graghMessage2 = null; bool flag = true; XPoint xPoint = basePoint.ApplyOffset(effectData.offset).ApplyOffset(effectData.offset2).ApplyForwardFix(effectData.forwardFixAngle); if (effectData.range.get_Count() > 2) { int num = Mathf.Abs(effectData.range.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Rect, 0f, 0f, (float)effectData.range.get_Item(1) * 0.01f, (float)effectData.range.get_Item(2) * 0.01f); } } else { graghMessage = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Sector, (float)effectData.range.get_Item(1) * 0.01f, (float)effectData.range.get_Item(2), 0f, 0f); } } if (effectData.range2.get_Count() > 2) { if (effectData.range2.get_Item(0) < 0) { flag = false; } int num = Mathf.Abs(effectData.range2.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage2 = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Rect, 0f, 0f, (float)effectData.range2.get_Item(1) * 0.01f, (float)effectData.range2.get_Item(2) * 0.01f); } } else { graghMessage2 = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Sector, (float)effectData.range2.get_Item(1) * 0.01f, (float)effectData.range2.get_Item(2), 0f, 0f); } } if (graghMessage != null) { graghMessage.DrawShape(Color.get_red()); } if (graghMessage2 != null) { if (flag) { graghMessage2.DrawShape(Color.get_red()); } else { graghMessage2.DrawShape(Color.get_blue()); } } for (int i = 0; i < candidates.get_Count(); i++) { if (!(candidates.get_Item(i) == null)) { bool flag2 = false; float hitRadius = XUtility.GetHitRadius(candidates.get_Item(i).get_transform()); bool flag3 = graghMessage != null && graghMessage.InArea(candidates.get_Item(i).get_transform().get_position(), hitRadius); bool flag4 = graghMessage2 != null && graghMessage2.InArea(candidates.get_Item(i).get_transform().get_position(), hitRadius); if (flag) { if (flag3 || flag4) { flag2 = true; } } else if (flag3 && !flag4) { flag2 = true; } if (flag2) { list.Add(candidates.get_Item(i)); } } } return(list); }
protected static void SummonMonster(Effect effectData, EntityParent caster, XPoint basePoint, int monsterTypeID, int pointGroupID) { if (caster == null) { return; } switch (effectData.@base) { case 1: case 2: LocalAgent.SummonMonster(monsterTypeID, caster.Lv, caster.ID, caster.Camp, basePoint.ApplyOffset(effectData.offset).position); break; case 3: if (caster.Actor) { LocalAgent.SummonMonster(monsterTypeID, caster.Lv, caster.ID, caster.Camp, pointGroupID, caster.Actor.FixTransform.get_rotation(), effectData.offset); } break; case 5: if (effectData.coord != null && effectData.coord.get_Count() >= 3) { Vector3 vector = new Vector3((float)effectData.coord.get_Item(0) * 0.01f, (float)effectData.coord.get_Item(1) * 0.01f, (float)effectData.coord.get_Item(2) * 0.01f); Vector3 vector2 = Vector3.get_forward(); if (effectData.orientation != null && effectData.orientation.get_Count() >= 3) { vector2 = new Vector3((float)effectData.orientation.get_Item(0) * 0.01f, (float)effectData.orientation.get_Item(1) * 0.01f, (float)effectData.orientation.get_Item(2) * 0.01f) - vector; } LocalAgent.SummonMonster(monsterTypeID, caster.Lv, caster.ID, caster.Camp, new XPoint { position = vector, rotation = Quaternion.LookRotation(vector2) }.ApplyOffset(effectData.offset).position); } break; } }
protected Hashtable CheckCandidatesByEffectShape(List <EntityParent> candidates, List <ContainerGear> containers, Actor casterActor, XPoint basePoint, Effect effectData) { Hashtable hashtable = new Hashtable(); if (casterActor == null) { return(hashtable); } if (basePoint == null) { return(hashtable); } List <EntityParent> list = new List <EntityParent>(); List <ContainerGear> list2 = new List <ContainerGear>(); GraghMessage graghMessage = null; GraghMessage graghMessage2 = null; bool flag = true; XPoint xPoint = basePoint.ApplyOffset(effectData.offset).ApplyOffset(effectData.offset2).ApplyForwardFix(effectData.forwardFixAngle); if (effectData.range.get_Count() > 2) { int num = Mathf.Abs(effectData.range.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Rect, 0f, 0f, (float)effectData.range.get_Item(1) * 0.01f, (float)effectData.range.get_Item(2) * 0.01f); } } else { graghMessage = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Sector, (float)effectData.range.get_Item(1) * 0.01f, (float)effectData.range.get_Item(2), 0f, 0f); } } if (effectData.range2.get_Count() > 2) { if (effectData.range2.get_Item(0) < 0) { flag = false; } int num = Mathf.Abs(effectData.range2.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage2 = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Rect, 0f, 0f, (float)effectData.range2.get_Item(1) * 0.01f, (float)effectData.range2.get_Item(2) * 0.01f); } } else { graghMessage2 = new GraghMessage(new XPoint { position = xPoint.position, rotation = xPoint.rotation }, GraghShape.Sector, (float)effectData.range2.get_Item(1) * 0.01f, (float)effectData.range2.get_Item(2), 0f, 0f); } } if (graghMessage != null) { graghMessage.DrawShape(Color.get_red()); } if (graghMessage2 != null) { if (flag) { graghMessage2.DrawShape(Color.get_red()); } else { graghMessage2.DrawShape(Color.get_blue()); } } for (int i = 0; i < candidates.get_Count(); i++) { if (candidates.get_Item(i) != null) { if (candidates.get_Item(i).Actor) { bool flag2 = false; float hitRadius = XUtility.GetHitRadius(candidates.get_Item(i).Actor.FixTransform); bool flag3 = graghMessage != null && graghMessage.InArea(candidates.get_Item(i).Actor.FixTransform.get_position(), hitRadius); bool flag4 = graghMessage2 != null && graghMessage2.InArea(candidates.get_Item(i).Actor.FixTransform.get_position(), hitRadius); if (flag) { if (flag3 || flag4) { flag2 = true; } } else if (flag3 && !flag4) { flag2 = true; } if (flag2) { list.Add(candidates.get_Item(i)); } } } } for (int j = 0; j < containers.get_Count(); j++) { if (containers.get_Item(j)) { if (containers.get_Item(j).get_gameObject()) { bool flag5 = false; bool flag6 = graghMessage != null && graghMessage.InArea(containers.get_Item(j).get_transform().get_position(), containers.get_Item(j).hitRange); bool flag7 = graghMessage2 != null && graghMessage2.InArea(containers.get_Item(j).get_transform().get_position(), containers.get_Item(j).hitRange); if (flag) { if (flag6 || flag7) { flag5 = true; } } else if (flag6 && !flag7) { flag5 = true; } if (flag5) { list2.Add(containers.get_Item(j)); } } } } hashtable.Add("Entity", list); hashtable.Add("Container", list2); return(hashtable); }
protected void DrawServerRange(BattleAction_UpdateEffect data) { if (this.owner.Actor.FixTransform == null) { return; } Effect effect = DataReader <Effect> .Get(data.effectId); GameObject gameObject = GameObject.Find("ServerEffectPainter"); if (gameObject == null) { gameObject = new GameObject(); gameObject.set_name("ServerEffectPainter"); } gameObject.get_transform().set_position(new Vector3(data.pos.x * 0.01f, this.owner.Actor.FixTransform.get_position().y, data.pos.y * 0.01f)); gameObject.get_transform().set_forward(new Vector3(data.vector.x, 0f, data.vector.y)); XPoint xPoint = new XPoint { position = gameObject.get_transform().get_position(), rotation = gameObject.get_transform().get_rotation() }; XPoint theFixBasePoint = xPoint.ApplyOffset(effect.offset).ApplyOffset(effect.offset2).ApplyForwardFix(effect.forwardFixAngle); GraghMessage graghMessage = null; GraghMessage graghMessage2 = null; bool flag = true; if (effect.range.get_Count() > 2) { int num = Mathf.Abs(effect.range.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage = new GraghMessage(theFixBasePoint, GraghShape.Rect, 0f, 0f, (float)effect.range.get_Item(1) * 0.01f, (float)effect.range.get_Item(2) * 0.01f); } } else { graghMessage = new GraghMessage(theFixBasePoint, GraghShape.Sector, (float)effect.range.get_Item(1) * 0.01f, (float)effect.range.get_Item(2), 0f, 0f); } } if (effect.range2.get_Count() > 2) { if (effect.range2.get_Item(0) < 0) { flag = false; } int num = Mathf.Abs(effect.range2.get_Item(0)); if (num != 1) { if (num == 2) { graghMessage2 = new GraghMessage(theFixBasePoint, GraghShape.Rect, 0f, 0f, (float)effect.range2.get_Item(1) * 0.01f, (float)effect.range2.get_Item(2) * 0.01f); } } else { graghMessage2 = new GraghMessage(theFixBasePoint, GraghShape.Sector, (float)effect.range2.get_Item(1) * 0.01f, (float)effect.range2.get_Item(2), 0f, 0f); } } if (graghMessage != null) { graghMessage.DrawShape(Color.get_black()); } if (graghMessage2 != null) { if (flag) { graghMessage2.DrawShape(Color.get_black()); } else { graghMessage2.DrawShape(Color.get_black()); } } }