Ejemplo n.º 1
0
 public static void OnUnmountTaxi(Character ch,Trajet t)
 {
     ch.MountModel = (int)0;
     ch.taxiOn = false;
     ch.Copper =(uint)(ch.Copper - ch.TaxiPrice);
     if(ch.Summon != null) ch.Summon.Freeze = false;
     int offset = 4;
     ch.Speed = 8f;
     ch.RunSpeed = 7f;
     Converter.ToBytes( 1, ch.tempBuff, ref offset );
     Converter.ToBytes( (byte)0, ch.tempBuff, ref offset );
     ch.PrepareUpdateData( ch.tempBuff, ref offset , UpdateType.UpdateFull, false );
     ch.Send( OpCodes.SMSG_UPDATE_OBJECT, ch.tempBuff, offset );
     ch.ItemsUpdate();
     ch.ForcePosition(t[t.Count - 1].x,t[t.Count - 1].y,t[t.Count - 1].z,ch.Orientation);
 }
Ejemplo n.º 2
0
        public static void TaxiMountAndMove(Character ch, TaxiPath path)
        {
            PathForTaxi taxiPFT = new PathForTaxi(path.Id,ch);
            int MountId = 0;
            foreach(Object o in ch.KnownObjects)
            {
                if(o is TaxiVendor)	if((o as TaxiVendor).MountId != 0)	MountId = (o as TaxiVendor).MountId;
            }
            if (MountId == 0) MountId = 1147;
            ch.MountModel = (int)MountId;
            ch.taxiOn = true;
            ch.GodMode = true;
            ch.UnInteractible = true;
            if(ch.Summon != null) ch.Summon.Freeze = true;
            ch.Speed = 20f;
            ch.RunSpeed = 40f;
            int offset = 4;
            Converter.ToBytes( 1, ch.tempBuff, ref offset );
            Converter.ToBytes( (byte)0, ch.tempBuff, ref offset );
            ch.PrepareUpdateData( ch.tempBuff, ref offset , UpdateType.UpdateFull, false );
            ch.Send( OpCodes.SMSG_UPDATE_OBJECT, ch.tempBuff, offset );
            ch.ItemsUpdate();

            ch.MoveTaxiTo(taxiPFT.T,taxiPFT.mapIds, taxiPFT.mapChange);
        }
Ejemplo n.º 3
0
        public void Summon(Mobile c)
        {
            if (c.Summon != null)
            {
                c.Summon.Delete();
                if (World.allMobiles.Contains(c.Summon))
                {
                    World.Remove(c.Summon, c);
                }
            }
            ConstructorInfo ci = World.MobilePool(mountId);
            BaseCreature    bc = (BaseCreature)ci.Invoke(null);

            bc.Faction    = c.Faction;
            bc.AIEngine   = new SummonedAI(c, bc);
            bc.SummonedBy = c;
            c.Summon      = bc;
            bc.Level      = c.Level;
            bc.Stamina    = bc.Str = bc.Iq = bc.Spirit = bc.HitPoints = bc.BaseHitPoints = bc.Agility = bc.BaseMana = 0;
            bc.InitStats();
            //	bc.AIEngine = new SummonedAI( c, bc );
            if (c.Classe == Classes.Warlock)
            {
                #region Fel Intellect
                if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417)
                {
                    if (c.HaveTalent(Talents.FelIntellect))
                    {
                        AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelIntellect);
                        float      bm = (float)bc.BaseMana;
                        bm         += bm * ((float)ae.S1) / 100f;
                        bc.BaseMana = bc.Mana = (int)bm;
                    }
                }
                #endregion
                #region Fel Stamina
                if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417)
                {
                    if (c.HaveTalent(Talents.FelStamina))
                    {
                        AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelStamina);
                        float      bm = (float)bc.BaseHitPoints;
                        bm += bm * ((float)ae.S1) / 100f;
                        bc.BaseHitPoints = bc.HitPoints = (int)bm;
                    }
                }
                #endregion
            }

            World.Add(bc, c.X, c.Y, c.Z, c.MapId);
            if (c is Character)
            {
                //	c.SendSmallUpdate( new int[] { (int)UpdateFields.UNIT_FIELD_CHARM, (int)UpdateFields.UNIT_FIELD_SUMMON }, new object[] { bc.Guid, bc.Guid } );

                Character ch     = c as Character;
                int       offset = 4;
                Converter.ToBytes(1, c.tempBuff, ref offset);
                Converter.ToBytes((byte)0, c.tempBuff, ref offset);
                c.PrepareUpdateData(c.tempBuff, ref offset, UpdateType.UpdateFull, false);
                //				bc.PrepareUpdateData( c.tempBuff, ref offset , UpdateType.UpdateFull, false );
                ch.Send(OpCodes.SMSG_UPDATE_OBJECT, c.tempBuff, offset);
                ch.ItemsUpdate();

                if (bc.Id == 89 || bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 304 || bc.Id == 417)
                {
                    ch.SendPetActionBar();
                }
            }
        }