コード例 #1
0
 public void UpdateMobControl(Character who)
 {
     Mobs.ForEach(m => { if (m.Controller == who)
                         {
                             UpdateMobControl(m, false, null);
                         }
                  });
 }
コード例 #2
0
        public void ShowObjects(Character chr)
        {
            if (HasClock)
            {
                MapPacket.SendMapClock(chr, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
            }

            if (chr.Pets.GetEquippedPet() != null)
            {
                Pet pet = chr.Pets.GetEquippedPet();
                pet.Position = new Pos(chr.Position);
                pet.Foothold = chr.Foothold;
                pet.Stance   = 0;
            }
            chr.Pets.SpawnPet();
            Characters.ForEach(p =>
            {
                if (p != chr)
                {
                    MapPacket.SendCharacterEnterPacket(p, chr);
                    MapPacket.SendCharacterEnterPacket(chr, p);
                    p.Pets.SpawnPet(chr);
                    if (p.Summons.mSummon != null)
                    {
                        SummonPacket.SendShowSummon(p, p.Summons.mSummon, false, chr);
                    }
                    if (p.Summons.mPuppet != null)
                    {
                        SummonPacket.SendShowSummon(p, p.Summons.mPuppet, false, chr);
                    }
                }
            });
            Life[(int)SpawnTypes.Npc].ForEach(n => { MapPacket.ShowNPC(n, chr); });

            Mobs.ForEach(m =>
            {
                if (m.HP != 0)
                {
                    if (m.ControlStatus == MobControlStatus.ControlNone)
                    {
                        UpdateMobControl(m, true, chr);
                    }
                    else
                    {
                        MobPacket.SendMobSpawn(chr, m, 0, null, false, true);
                        UpdateMobControl(m, false, null);
                    }
                }
            });

            foreach (KeyValuePair <int, Drop> drop in Drops)
            {
                drop.Value.ShowDrop(chr);
            }



            if (mWeatherID != 0)
            {
                MapPacket.SendWeatherEffect(ID, chr);
            }
        }