TeleportOtherStart() public static method

public static TeleportOtherStart ( ) : byte[]
return byte[]
Ejemplo n.º 1
0
        void Player_Scroll_CallBack(object e)
        {
            try
            {
                if (Character.Information.Scroll == false)
                {
                    return;
                }

                Character.InGame = false;

                BuffAllClose();

                DeSpawnMe();
                ObjectDeSpawnCheck();
                client.Send(Packet.TeleportOtherStart());

                Teleport_UpdateXYZ(Character.Information.Place);
                client.Send(Packet.TeleportImage(Data.PointBase[Character.Information.Place].xSec, Data.PointBase[Character.Information.Place].ySec));
                Character.Teleport = true;
                Timer.Scroll.Dispose();
                Timer.Scroll = null;
                Character.Information.Scroll = false;
                Character.State.Sitting      = false;
                Character.Position.Walking   = false;
            }

            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Ejemplo n.º 2
0
        //###########################################################################################
        // Cave teleports
        //###########################################################################################
        void TeleportCave(int number)
        {
            try// Changed to cavePointbase for the telepad locations
            {
                BuffAllClose();

                DeSpawnMe();
                ObjectDeSpawnCheck();
                this.client.Send(Packet.TeleportOtherStart());

                this.Character.Position.xSec = Data.cavePointBase[number].xSec;
                this.Character.Position.ySec = Data.cavePointBase[number].ySec;
                this.Character.Position.x    = (float)Data.cavePointBase[number].x;
                this.Character.Position.z    = (float)Data.cavePointBase[number].z;
                this.Character.Position.y    = (float)Data.cavePointBase[number].y;
                this.Character.InGame        = false;
                this.Character.Teleport      = true;

                this.client.Send(Packet.TeleportImage(Data.cavePointBase[number].xSec, Data.cavePointBase[number].ySec));
                this.Character.Teleport = true;
                Timer.Scroll.Dispose();
                Timer.Scroll = null;
                this.Character.Information.Scroll = false;
            }
            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Ejemplo n.º 3
0
        //###########################################################################################
        // Thief scrolls
        //###########################################################################################
        void HandleThiefScroll(int ItemID)
        {
            try
            {
                //TODO: Add check if user is wearing thief suit.
                if (Character.Position.Walking)
                {
                    return;
                }
                if (Character.Action.PickUping)
                {
                    return;
                }
                if (Character.Stall.Stallactive)
                {
                    return;
                }

                BuffAllClose();

                DeSpawnMe();
                ObjectDeSpawnCheck();
                client.Send(Packet.TeleportOtherStart());

                byte  xSec = 182;
                byte  ySec = 96;
                float x    = 9119;
                float z    = 3;
                float y    = 890;

                Character.Position.xSec = xSec;
                Character.Position.ySec = ySec;
                Character.Position.x    = x;
                Character.Position.z    = z;
                Character.Position.y    = y;

                UpdateXY();

                client.Send(Packet.TeleportImage(xSec, ySec));
                Character.Teleport = true;
                Timer.Scroll.Dispose();
                Timer.Scroll = null;
                Character.Information.Scroll = false;
            }
            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Ejemplo n.º 4
0
        //###########################################################################################
        // Reverse scrolls
        //###########################################################################################
        void HandleReverse(int itemid, byte select, int objectlocationid)
        {
            try
            {
                //Remove loc // add loc to case 7
                if (Character.Position.Walking)
                {
                    StopMovementTimer();
                }
                if (Character.Action.PickUping)
                {
                    return;
                }
                if (Character.Stall.Stallactive)
                {
                    return;
                }
                Character.Information.Scroll = true;
                StopTimers();
                switch (select)
                {
                //Move to return point
                case 2:
                    Send(Packet.StatePack(Character.Information.UniqueID, 0x0B, 0x01, false));
                    StartScrollTimer(1000);
                    SavePlayerReturn();
                    break;

                //Move to last recall point
                case 3:
                    MsSQL ms = new MsSQL("SELECT * FROM character_rev WHERE charname='" + Character.Information.Name + "'");
                    using (SqlDataReader reader = ms.Read())
                    {
                        while (reader.Read())
                        {
                            byte  xSec = reader.GetByte(2);
                            byte  ySec = reader.GetByte(3);
                            float x    = reader.GetInt32(4);
                            float z    = reader.GetInt32(6);
                            float y    = reader.GetInt32(5);

                            BuffAllClose();
                            DeSpawnMe();
                            ObjectDeSpawnCheck();
                            client.Send(Packet.TeleportOtherStart());
                            //Set state
                            this.Character.InGame   = false;
                            Character.Position.xSec = xSec;
                            Character.Position.ySec = ySec;
                            Character.Position.x    = x;
                            Character.Position.z    = z;
                            Character.Position.y    = y;

                            client.Send(Packet.TeleportImage(xSec, ySec));
                            Character.Teleport           = true;
                            Timer.Scroll                 = null;
                            Character.Information.Scroll = false;
                        }
                    }
                    ms.Close();
                    break;

                //Teleport to map location
                case 7:
                    BuffAllClose();
                    ObjectDeSpawnCheck();
                    DeSpawnMe();

                    client.Send(Packet.TeleportOtherStart());

                    Character.Position.xSec = Data.ReverseData[objectlocationid].xSec;
                    Character.Position.ySec = Data.ReverseData[objectlocationid].ySec;
                    Character.Position.x    = (float)Data.ReverseData[objectlocationid].x;
                    Character.Position.z    = (float)Data.ReverseData[objectlocationid].z;
                    Character.Position.y    = (float)Data.ReverseData[objectlocationid].y;
                    //Set state
                    this.Character.InGame = false;

                    client.Send(Packet.TeleportImage(Data.ReverseData[objectlocationid].xSec, Data.ReverseData[objectlocationid].ySec));
                    Character.Teleport           = true;
                    Timer.Scroll                 = null;
                    Character.Information.Scroll = false;
                    break;
                }
            }

            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Ejemplo n.º 5
0
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Player Death
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public void Player_Up()
 {
     try
     {
         /////////////////////////////////////////////////////////////////////////////////////
         // Normal Death / Return to return point
         /////////////////////////////////////////////////////////////////////////////////////
         //Normal death
         if (Character.State.Die && Character.State.DeadType == 1)
         {
             if (Character.Information.Level <= 11)
             {
                 //Check if character is walking should not be happening
                 if (Character.Position.Walking)
                 {
                     return;
                 }
                 //Stop berserk timer if it were active
                 StopBerserkTimer();
                 //Start sending packets for teleport
                 client.Send(Packet.TeleportOtherStart());
                 //Reset state information
                 Send(Packet.StatePack(this.Character.Information.UniqueID, 0, 1, false));
                 //Set the character hp to max hp / 2
                 this.Character.Stat.SecondHp = this.Character.Stat.Hp / 2;
                 //this.Character.State.SafeState = true;
                 //NotAttackableTimer(5000);
                 this.UpdateHp();
                 //Send packet for updating hp
                 client.Send(Packet.UpdatePlayer(this.Character.Information.UniqueID, 0x20, 1, this.Character.Stat.SecondHp));
                 //Set bool
                 Character.State.Die = false;
                 //Send state pack
                 Send(Packet.StatePack(this.Character.Information.UniqueID, 4, 0, false));
             }
             else
             {
                 //Check if character is walking should not be happening
                 if (Character.Position.Walking)
                 {
                     return;
                 }
                 //Save information for reverse scrolls
                 SavePlayerReturn();
                 //Close buffs
                 BuffAllClose();
                 //Set bool ingame
                 Character.InGame = false;
                 //Despawn
                 DeSpawnMe();
                 //Despawn objects
                 ObjectDeSpawnCheck();
                 //Send teleport packet
                 client.Send(Packet.TeleportOtherStart());
                 //Update location
                 Teleport_UpdateXYZ(Character.Information.Place);
                 //Set hp to max hp / 2
                 this.Character.Stat.SecondHp = this.Character.Stat.Hp / 2;
                 //Send teleport image
                 client.Send(Packet.TeleportImage(Data.PointBase[Character.Information.Place].xSec, Data.PointBase[Character.Information.Place].ySec));
                 //Set bools
                 Character.Teleport  = true;
                 Character.State.Die = false;
             }
         }
         else if (Character.State.Die && Character.State.DeadType == 2)
         {
             //Check if character is walking should not be happening
             if (Character.Position.Walking)
             {
                 return;
             }
             //Stop berserk timer if it were active
             StopBerserkTimer();
             //Start sending packets for teleport
             client.Send(Packet.TeleportOtherStart());
             //Reset state information
             Send(Packet.StatePack(this.Character.Information.UniqueID, 0, 1, false));
             //Set the character hp to max hp / 2
             this.Character.Stat.SecondHp = this.Character.Stat.Hp / 2;
             //this.Character.State.SafeState = true;
             //NotAttackableTimer(5000);
             this.UpdateHp();
             //Send packet for updating hp
             client.Send(Packet.UpdatePlayer(this.Character.Information.UniqueID, 0x20, 1, this.Character.Stat.SecondHp));
             //Set bool
             Character.State.Die = false;
             //Send state pack
             Send(Packet.StatePack(this.Character.Information.UniqueID, 4, 0, false));
         }
         else
         {
             Console.WriteLine("Unknown dead type: " + Character.State.DeadType + "");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Death error {0}", ex);
         Systems.Debugger.Write(ex);
     }
 }