Exemple #1
0
        // theese attributes are not serializable
        public void HandleSpecialBuff(int skillid)
        {
            try
            {
                string series = Data.SkillBase[skillid].Series.Remove(Data.SkillBase[skillid].Series.Length - 2);
                switch (series)
                {
                    case "SKILL_OP_HARMONY":
                    case "SKILL_CH_WATER_HARMONY":

                        spez_obj so = new spez_obj();

                        so.Name = series;
                        so.ID = skillid;
                        so.spezType = 0x850;
                        so.Radius = Data.SkillBase[skillid].Distance / 10;
                        so.Ids = new Global.ID(Global.ID.IDS.Object);
                        so.UniqueID = so.Ids.GetUniqueID;

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

                        Systems.SpecialObjects.Add(so);
                        so.SpawnMe(Data.SkillBase[skillid].Properties1["dura"]);

                        break;
                }
            }
            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Exemple #2
0
 ///////////////////////////////////////////////////////////////////////////
 // World spawning objects
 ///////////////////////////////////////////////////////////////////////////
 public static byte[] ObjectSpawn(spez_obj so)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_SOLO_SPAWN);
     Writer.DWord(0xFFFFFFFF);                                           //Static
     Writer.DWord(so.spezType);                                           //Type
     Writer.DWord(so.ID);                                                //skillid
     Writer.DWord(so.UniqueID);                                          //UniqueID of spawn
     Writer.Byte(so.xSec);                                               //XSec
     Writer.Byte(so.ySec);                                               //Ysec
     Writer.Float(Formule.packetx((float)so.x, so.xSec));       //X
     Writer.Float(so.z);                                                 //Z
     Writer.Float(Formule.packety((float)so.y, so.ySec));       //Y
     Writer.Word(0);                                                     //Angle
     Writer.Byte(1);                                                     //Static
     return Writer.GetBytes();
 }
Exemple #3
0
 public static double gamedistance(spez_obj p1, DarkEmu_GameServer.character._pos p2)
 {
     // Nukei: for test with range checking on objects, maybe faster than only calculating distance
     if ((p1.xSec >= p2.xSec - 1) && (p1.xSec <= p2.xSec + 1) && (p1.ySec >= p2.ySec - 1) && (p1.ySec <= p2.ySec + 1))
     {
         return gamedistance((float)p1.x, (float)p1.y, p2.x, p2.y);
     }
     else
     {
         return 99999999999999;
     }
 }