public static AdjustField ( Point3D &p, Map map, int height, bool mobsBlock ) : bool | ||
p | Point3D | |
map | Map | |
height | int | |
mobsBlock | bool | |
return | bool |
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckSequence()) { SpellHelper.Turn(Caster, p); SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, 0x20B); double duration = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting); int itemID = eastToWest ? 0x3946 : 0x3956; for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false); if (!canFit) { continue; } Item item = new InternalItem(loc, Caster.Map, TimeSpan.FromSeconds(duration), itemID, Caster); item.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(loc, Caster.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5051); } } FinishSequence(); }
public void FinishSequence(IPoint3D p, bool carre) { if (!Owner.CanSee(p)) { Owner.SendLocalizedMessage(500237); // Target can not be seen. } double time = (int)(Owner.Niveau) * (Maitrise / 10.0); time *= getRatio(); m_timer = new InternalTimer(this, time); m_timer.Start(); bool blok = (m_damageWalk < 1); int id = 0x93; if (!carre) { SpellHelper.GetSurfaceTop(ref p); int dx = Owner.Location.X - p.X; int dy = Owner.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; int number = (int)((Owner.Niveau) * (Maitrise / 60.0)); bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Owner.Map, 0x1F6); for (int i = -(number / 2); i < (number / 2); ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); bool canFit = SpellHelper.AdjustField(ref loc, Owner.Map, 22, true); //Effects.SendLocationParticles( EffectItem.Create( loc, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5025 ); if (!canFit) { continue; } Item item = new InternalItem(loc, Owner.Map, Owner, SortNubiaHelper.getMur(energie), time, blok, m_damageWalk); item.Hue = 0; // SortNubiaHelper.getCompColor(competence); m_items.Add(item); //Effects.SendLocationParticles( item, 0x3728, 9, 10, 5025 ); SortNubiaHelper.makeBigSmoke(item.Location, item.Map); //new InternalItem( loc, Caster.Map, Caster ); } } else { Point3D cp = (Point3D)p; int decal = 4; bool eastToWest = true; for (int u = 0; u < 4; u++) { switch (u) { case 0: cp = (Point3D)p; cp.X += decal; eastToWest = false; break; case 1: cp = (Point3D)p; cp.X -= decal; eastToWest = false; break; case 2: cp = (Point3D)p; cp.Y += decal; eastToWest = true; break; case 3: cp = (Point3D)p; cp.Y -= decal; eastToWest = true; break; } for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? cp.X + i : cp.X, eastToWest ? cp.Y : cp.Y + i, cp.Z); bool canFit = SpellHelper.AdjustField(ref loc, Owner.Map, 22, true); //Effects.SendLocationParticles( EffectItem.Create( loc, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5025 ); if (!canFit) { continue; } Item item = new InternalItem(loc, Owner.Map, Owner, SortNubiaHelper.getMur(energie), time, blok, m_damageWalk); item.Hue = 2184; //ohaCompHelper.getCompColor(competence); m_items.Add(item); SortNubiaHelper.makeBigSmoke(item.Location, item.Map); //new InternalItem( loc, Caster.Map, Caster ); } } } }