Exemplo n.º 1
0
        public void StartInit()
        {
            RemovePlayer(this);
            Client.State = (int)eClientState.WorldEnter;
            SendMoney();
            SendStats();
            SendSpeed();
            SendInited();
            SendRankUpdate(this);
            SendXp();
            SendRenown();
            TokInterface.SendAllToks();
            SendSkills();
            Health = TotalHealth;
            // ItmInterface.SendAllItems(this);
            AbtInterface.SendAbilities();



            PacketOut Out = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);

            Out.WriteByte(1);
            Out.WriteByte(1);
            Out.WriteUInt16(0x300);
            Out.WriteUInt16(8159);
            Out.WriteByte(1);
            SendPacket(Out);

            QtsInterface.SendQuests();

            SendInitComplete();
            SocInterface.SendFriends();
        }
Exemplo n.º 2
0
        public override void OnLoad()
        {
            _Client.State = (int)eClientState.WorldEnter;

            if (!_Inited)
            {
                EvtInterface.Obj = this;
                EvtInterface.AddEventNotify("Playing", Save);
                EvtInterface.Start();

                ItmInterface.Load(CharMgr.GetItemChar(_Info.CharacterId));
                StsInterface.Load(CharMgr.GetCharacterInfoStats(_Info.CareerLine, _Value.Level));
                QtsInterface.Load(this._Info.Quests);
                TokInterface.Load(_Info.Toks);
                SocInterface.Load(_Info.Socials);
                AbtInterface.Load();
                StsInterface.ApplyStats();

                SetLevel(_Value.Level);
                SetRenownLevel(_Value.RenownRank);
                SetOffset((UInt16)(_Value.WorldX >> 12), (UInt16)(_Value.WorldY >> 12));
                _Inited = true;
            }

            base.OnLoad();

            StartInit();
        }
Exemplo n.º 3
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead);

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);


            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleDeathRewards(credited);
            }

            AiInterface.ProcessCombatEnd();

            SetRespawnTimer();

            EvtInterface.RemoveEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);

            if (!FlagGuard.Info.KeepLord)
            {
                _keep.OnKeepNpcAttacked(0);
                return;
            }

            /*Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord slain by " + killer.Name + " of " + (killer.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"));*/

            if (_keep.Realm == killer.Realm)
            {
                /*if (FlagGuard.Info.KeepLord)
                 *  Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord respawned.");*/
                _logger.Debug($"Kill request from own realm {killer.Name} {_keep.Realm}");
                FlagGuard.Creature = new KeepCreature(Spawn, FlagGuard, _keep);
                Region.AddObject(FlagGuard.Creature, Spawn.ZoneId);
                Destroy();
            }
            else
            {
                _keep.OnLordKilled();
            }
        }
Exemplo n.º 4
0
Arquivo: Player.cs Projeto: uvbs/DoR
        public void StartInit()
        {
            RemovePlayer(this);
            Client.State = (int)eClientState.WorldEnter;
            SendMoney();
            SendStats();
            SendSpeed(Speed);
            SendInited();
            SendRankUpdate(this);
            SendXpTable();
            WorldMgr.GeneralScripts.OnWorldPlayerEvent("SEND_PACKAGES", this, null);
            SendXp();
            SendRenown();
            TokInterface.SendAllToks();
            SendSkills();
            SendUpdateState();

            /*{
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_INFLUENCE_INFO);
             *  Out.WriteHexStringBytes("00000000");
             *  SendPacket(Out);
             * }
             * {
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_PLAY_TIME_STATS);
             *  Out.WriteHexStringBytes("000000000000000000000000");
             *  SendPacket(Out);
             * }
             *
             * {
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_TACTICS);
             *  Out.WriteHexStringBytes("0300");
             *  SendPacket(Out);
             * }
             *
             * {
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_MORALE_LIST);
             *  Out.WriteHexStringBytes("00 00 00 00 00 00 00 00 00 00 00".Replace(" ", string.Empty));
             *  SendPacket(Out);
             * }*/

            Health = TotalHealth;
            ItmInterface.SendAllItems(this);
            AbtInterface.SendAbilities();

            QtsInterface.SendQuests();
            MvtInterface.CurrentMount.SendMount(this);

            SendInitComplete();
            SocInterface.SendFriends();

            if (GetGroup() != null)
            {
                GetGroup().Update();
            }

            SendMessage(0, "MOTD: Welcome to WarEmu", "", SystemData.ChatLogFilters.CHATLOGFILTERS_CITY_ANNOUNCE);

            MlInterface.SendMailCounts();
        }
Exemplo n.º 5
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);
            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleDeathRewards(credited);
            }

            ClearTrackedDamage();

            _buildState = EConstructionState.Destroying;

            foreach (Player plr in _interactors)
            {
                plr.Palisade = null;
            }

            _interactors.Clear();

            foreach (NewBuff buff in _interactionBuffs)
            {
                buff.BuffHasExpired = true;
            }

            _interactionBuffs.Clear();

            GroundTarget gt = new GroundTarget(_constructor, new Point3D(WorldPosition), GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt, Zone.ZoneId);

            gt.BuffInterface.QueueBuff(new BuffQueueInfo(_constructor, 40, AbilityMgr.GetBuffInfo(23762)));

            gt.SetExpiry(TCPManager.GetTimeStampMS() + 5000);
        }
Exemplo n.º 6
0
        public override void Dispose()
        {
            ItmInterface.Stop();
            CbtInterface.Stop();
            StsInterface.Stop();
            QtsInterface.Stop();
            MvtInterface.Stop();
            AbtInterface.Stop();
            EvtInterface.Stop();
            AiInterface.Stop();

            base.Dispose();
        }
Exemplo n.º 7
0
Arquivo: Player.cs Projeto: uvbs/DoR
        public void Quit(bool CloseClient)
        {
            try
            {
                if (IsMoving)
                {
                    SendLocalizeString("", GameData.Localized_text.TEXT_MUST_NOT_MOVE_TO_QUIT);
                    return;
                }

                if (CbtInterface.IsFighting())
                {
                    SendLocalizeString("", GameData.Localized_text.TEXT_CANT_QUIT_IN_COMBAT);
                    return;
                }

                if (AbtInterface.IsCasting())
                {
                    SendLocalizeString("", GameData.Localized_text.TEXT_CANT_QUIT_YOURE_CASTING);
                    return;
                }

                if (IsDead)
                {
                    SendLocalizeString("", GameData.Localized_text.TEXT_CANT_QUIT_YOURE_DEAD);
                    return;
                }

                if (DisconnectTime >= DISCONNECT_TIME)
                {
                    EvtInterface.AddEvent(Quit, 5000, 5);
                }

                Leaving = true;

                SendLocalizeString("" + DisconnectTime / 1000, GameData.Localized_text.TEXT_YOU_WILL_LOG_OUT_IN_X_SECONDS);
                DisconnectTime  -= 5000;
                this.CloseClient = CloseClient;

                if (!IsDisposed && (DisconnectTime < 0 || GmLevel >= 1))  // Leave
                {
                    Dispose();
                }
            }
            catch (Exception e)
            {
                Log.Error("Quit", e.ToString());
            }
        }
Exemplo n.º 8
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead); // Death State

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);

            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            AiInterface.ProcessCombatEnd();

            EvtInterface.AddEvent(RezUnit, 10000, 1); // Clear the object in 10 seconds.

            if (_ownerUILinked)
            {
                SendPetRemove(true);

                IPetCareerInterface petInterface = Owner.CrrInterface as IPetCareerInterface;

                petInterface?.Notify_PetDown();

                _ownerUILinked = false;
            }
        }
Exemplo n.º 9
0
        public override void Update()
        {
            long Tick = TCPManager.GetTimeStampMS();

            UpdateHealth(Tick);
            UpdateActionPoints(Tick);
            EvtInterface.Update(Tick);

            CbtInterface.Update(Tick);
            ItmInterface.Update(Tick);
            StsInterface.Update(Tick);
            QtsInterface.Update(Tick);
            MvtInterface.Update(Tick);
            AbtInterface.Update(Tick);
            AiInterface.Update(Tick);

            if (NextSend < Tick)
            {
                NextSend = Tick + STATE_INTERVAL;
                SendState(null);
            }

            base.Update();
        }
Exemplo n.º 10
0
 public void Fire()
 {
     AbtInterface.StartCast(this, 9101, 1);
 }