Exemplo n.º 1
0
        public WorldSendUnitWalking(WorldObject obj)
            : base(0)
        {
            WorldObjectStatusChangeList sc = WorldObject.GetStatusChange(obj);
            WorldObjectViewData         vd = WorldObject.GetViewData(obj);
            string name  = WorldObject.GetName(obj);
            ushort speed = WorldObject.GetSpeed(obj);

            Writer.Position = 0;
            Write((short)0x7f7);
            Write((short)(69 + name.Length));

            Write((byte)obj.GetPacketType());
            Write((uint)(obj is Character ? (obj as Character).Account.ID : obj.ID)); // For Character, send accountID as unique ID
            Write((ushort)speed);                                                     // status_get_speed(bl);
            Write((short)(sc != null ? sc.Option1 : 0));                              // (sc) ? sc->opt1 : 0;
            Write((short)(sc != null ? sc.Option2 : 0));                              // (sc) ? sc->opt2 : 0;
            Write((int)(sc != null ? sc.Option : 0));                                 // (sc) ? sc->option : 0;
            Write((short)vd.Class);                                                   // vd->class_;
            Write((short)vd.HairStlye);                                               // vd->hair_style;
            Write((short)vd.Weapon);                                                  // vd->weapon;
            Write((short)vd.Shield);                                                  // vd->shield;
            Write((short)vd.HeadBottom);                                              // vd->head_bottom
            Write((int)Timer.Ticks);
            Write((short)vd.HeadTop);                                                 // vd->head_top;
            Write((short)vd.HeadMid);                                                 // vd->head_mid;

            Write((short)vd.HairColor);                                               // vd->hair_color;
            Write((short)vd.ClothesColor);                                            // vd->cloth_color;
            Write((short)0);                                                          // (sd) ? sd->head_dir : 0;


            Write((int)0);                             // status_get_guild_id(bl);
            Write((short)0);                           // status_get_emblem_id(bl);
            Write((short)0);                           // (sd) ? sd->status.manner : 0;

            Write((int)(sc != null ? sc.Option3 : 0)); // (sc) ? sc->opt3 : 0;

            Write((byte)0);                            // (sd) ? sd->status.karma : 0;
            Write((byte)vd.Sex);                       // vd->sex;
            Write((obj as WorldObjectUnit).Location);
            Write((byte)(obj is Character ? 5 : 0));   // (sd) ? 5 : 0;
            Write((byte)(obj is Character ? 5 : 0));   // (sd) ? 5 : 0;
            Write((short)WorldObject.GetLevel(obj));   // clif_setlevel(status_get_lv(bl));

            Write((short)0);                           // sd ? sd->state.user_font : 0;
            int pos = Writer.Position;

            Write(name);
            pos = Writer.Position;
        }
Exemplo n.º 2
0
		private short CalculateHit(WorldObjectStatusChangeList sc, short hit) {
			return hit;
		}
Exemplo n.º 3
0
		private short CalculateFlee(WorldObjectStatusChangeList sc, short flee) {
			return flee;
		}
Exemplo n.º 4
0
		private ushort CalculateAgi(WorldObjectStatusChangeList sc, ushort agi) {
			return agi;
		}
Exemplo n.º 5
0
		private void CalculateRegenRate(WorldObjectRegenerationData data, WorldObjectStatusChangeList sc) {

		}
Exemplo n.º 6
0
		private ushort CalculateLuk(WorldObjectStatusChangeList sc, ushort luk) {
			return luk;
		}
Exemplo n.º 7
0
		private ushort CalculateInt(WorldObjectStatusChangeList sc, ushort int_) {
			return int_;
		}
Exemplo n.º 8
0
		private ushort CalculateMatk(WorldObjectStatusChangeList sc, ushort matk) {
			return matk;
		}
Exemplo n.º 9
0
		private short CalculateAspdRate(WorldObjectStatusChangeList sc, short aspdRate) {
			return aspdRate;
		}
Exemplo n.º 10
0
		private byte CalculateElementLevel(WorldObjectStatusChangeList sc, byte eleLevel) {
			return eleLevel;
		}
Exemplo n.º 11
0
		private uint CalculateMaxSP(WorldObjectStatusChangeList sc, uint maxSP) {
			return maxSP;
		}
Exemplo n.º 12
0
		private EElement CalculateElement(WorldObjectStatusChangeList sc, EElement ele) {
			return ele;
		}
Exemplo n.º 13
0
		private EMonsterMode CalculateMode(WorldObjectStatusChangeList sc, EMonsterMode mode) {
			return mode;
		}
Exemplo n.º 14
0
		public Character(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
			BaseStatus = new WorldObjectStatus(this);
			BattleStatus = new WorldObjectStatus(this);
			ViewData = new WorldObjectViewData();
			StatusChange = new WorldObjectStatusChangeList();

			// TODO: i dont where eAthena initialize them realy..
			//		 they using struct, which cant be null x.x
			Regen = new WorldObjectRegenerationData(this);
			HPRegen = new StatusVariationData();
			SPRegen = new StatusVariationData();
			SRegen = new CharacterRegenerationData();
			SSRegen = new CharacterRegenerationData();
		}
Exemplo n.º 15
0
		private ushort CalculateWatk(WorldObjectStatusChangeList sc, ushort watk) {
			return watk;
		}
Exemplo n.º 16
0
		private ushort CalculateDmotion(WorldObjectStatusChangeList sc, ushort dmotion) {
			return dmotion;
		}
Exemplo n.º 17
0
		private ushort CalculateBatk(WorldObjectStatusChangeList sc, ushort batk) {
			return batk;
		}
Exemplo n.º 18
0
		private short CalculateCrit(WorldObjectStatusChangeList sc, short crit) {
			return crit;
		}
Exemplo n.º 19
0
		private ushort CalculateDex(WorldObjectStatusChangeList sc, ushort dex) {
			return dex;
		}
Exemplo n.º 20
0
		private ushort CalculateSpeed(WorldObjectStatusChangeList sc, ushort speed) {
			return speed;
		}
Exemplo n.º 21
0
		private ushort CalculateVit(WorldObjectStatusChangeList sc, ushort vit) {
			return vit;
		}
Exemplo n.º 22
0
		private short CalculateDef2(WorldObjectStatusChangeList sc, short def2) {
			return def2;
		}
Exemplo n.º 23
0
		private ushort CalculateStr(WorldObjectStatusChangeList sc, ushort str) {
			return str;
		}
Exemplo n.º 24
0
		private byte CalculateDef(WorldObjectStatusChangeList sc, byte def) {
			return def;
		}
Exemplo n.º 25
0
		public Monster(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
			DamageLog = new MonsterDamageLog();
			SkillDelays = new List<uint>();
			StatusChange = new WorldObjectStatusChangeList();
			LootItem = new List<Item>();
			Regen = new WorldObjectRegenerationData(this);
		}
Exemplo n.º 26
0
        public WorldSendUnitIdle(WorldObject obj, bool spawn)
            : base(0)
        {
            string                      name   = WorldObject.GetName(obj);
            WorldObjectStatus           status = WorldObject.GetStatusData(obj);
            WorldObjectViewData         vd     = WorldObject.GetViewData(obj);
            WorldObjectStatusChangeList sc     = WorldObject.GetStatusChange(obj);
            ushort                      speed  = WorldObject.GetSpeed(obj);

            Writer.Position = 0;
            Write((short)(spawn ? 0x7f8 : 0x7f9));
            Write((short)((spawn ? 62 : 63) + name.Length));
            Write((byte)obj.GetPacketType());
            Write((uint)(obj is Character ? (obj as Character).Account.ID : obj.ID));      // For Character, send accountID as unique ID
            Write((ushort)speed);                                                          // status_get_speed(bl);
            Write((short)(sc != null ? sc.Option1 : 0));                                   // (sc) ? sc->opt1 : 0;
            Write((short)(sc != null ? sc.Option2 : 0));                                   // (sc) ? sc->opt2 : 0;
            Write((int)(sc != null ? sc.Option : 0));                                      // (sc) ? sc->option : 0;
            Write((short)(obj is NpcScript ? (obj as NpcScript).Class : (short)vd.Class)); // vd->class_;
            Write((short)(vd != null ? vd.HairStlye : 0));                                 // vd->hair_style;
            Write((short)(vd != null ? vd.Weapon : 0));                                    // vd->weapon;
            Write((short)(vd != null ? vd.Shield : 0));                                    // vd->shield;
            Write((short)(vd != null ? vd.HeadBottom : 0));                                // vd->head_bottom
            Write((short)(vd != null ? vd.HeadTop : 0));                                   // vd->head_top;
            Write((short)(vd != null ? vd.HeadMid : 0));                                   // vd->head_mid;

            // TODO: implementieren!

            /*
             * if (bl->type == BL_NPC && vd->class_ == FLAG_CLASS) {	//The hell, why flags work like this?
             *      WBUFL(buf, 22) = status_get_emblem_id(bl);
             *      WBUFL(buf, 26) = status_get_guild_id(bl);
             * }
             */

            Write((short)(vd != null ? vd.HairColor : 0));    // vd->hair_color;
            Write((short)(vd != null ? vd.ClothesColor : 0)); // vd->cloth_color;
            Write((short)0);                                  // (sd) ? sd->head_dir : 0;


            Write((int)0);                             // status_get_guild_id(bl);
            Write((short)0);                           // status_get_emblem_id(bl);
            Write((short)0);                           // (sd) ? sd->status.manner : 0;

            Write((int)(sc != null ? sc.Option3 : 0)); // (sc) ? sc->opt3 : 0;

            Write((byte)0);                            // (sd) ? sd->status.karma : 0;
            Write((byte)(vd != null ? vd.Sex : 0));    // vd->sex;
            Write((obj as WorldObjectUnit).Location);
            Write((byte)(obj is Character ? 5 : 0));   // (sd) ? 5 : 0;
            Write((byte)(obj is Character ? 5 : 0));   // (sd) ? 5 : 0;
            if (!spawn)
            {
                Write((byte)(vd != null ? vd.DeadSit : 0)); // vd->dead_sit;
            }
            Write((short)WorldObject.GetLevel(obj));        // clif_setlevel(status_get_lv(bl));

            Write((short)0);                                // sd ? sd->state.user_font : 0;
            int pos = Writer.Position;

            Write(name);
            pos = Writer.Position;
        }