Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        public void Quit()
        {
            Log.Success("Player", "Quit");

            Leaving = true;

            if (IsMoving)
            {
                SendLocalizeString("", GameData.Localized_text.TEXT_MUST_NOT_MOVE_TO_QUIT);
                return;
            }

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

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

            if (DisconnectTime < 0 || GmLevel >= 1) // Leave
            {
                Dispose();
            }
        }
Ejemplo n.º 3
0
            public KeepGameObject(GameObject_spawn spawn, KeepDoor keepDoor, Keep keep)
            {
                _keep     = keep;
                Spawn     = spawn;
                Name      = spawn.Proto.Name;
                _keepDoor = keepDoor;

                if (Constants.DoomsdaySwitch == 0)
                {
                    if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                    {
                        Realm = keep.Realm;
                        Spawn.Proto.HealthPoints = (uint)_keep.Tier * 10000;
                    }
                }
                else
                {
                    if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                    {
                        Realm = keep.Realm;
                        Spawn.Proto.HealthPoints = 4 * 10000;
                    }
                }

                _enterExitPoints[0] = new Point3D(_keepDoor.Info.TeleportX1, _keepDoor.Info.TeleportY1, _keepDoor.Info.TeleportZ1);
                _enterExitPoints[1] = new Point3D(_keepDoor.Info.TeleportX2, _keepDoor.Info.TeleportY2, _keepDoor.Info.TeleportZ2);

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }
Ejemplo n.º 4
0
 public InstanceSpawn(Creature_spawn spawn, uint bossId, Instance instance) : base(spawn)
 {
     instanceGroupSpawnId = instanceGroupSpawnId;
     bossId   = bossId;
     Instance = instance;
     EvtInterface.AddEventNotify(EventName.OnEnterCombat, OnEnterCombat);
     EvtInterface.AddEventNotify(EventName.OnLeaveCombat, OnLeaveCombat);
 }
 public InstanceSpawn(Creature_spawn spawn, uint instancegroupspawnid, uint bossid, Instance instance) : base(spawn)
 {
     InstanceGroupSpawnID = instancegroupspawnid;
     BossID   = bossid;
     Instance = instance;
     EvtInterface.AddEventNotify(EventName.OnEnterCombat, OnEnterCombat);
     EvtInterface.AddEventNotify(EventName.OnLeaveCombat, OnLeaveCombat);
 }
            public KeepCreature(Creature_spawn spawn, KeepNpcCreature flagGrd, Keep keep) : base(spawn)
            {
                _keep      = keep;
                _flagGrd   = flagGrd;
                IsKeepLord = flagGrd.Info.KeepLord;

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }
Ejemplo n.º 7
0
 public InstanceBossSpawn(Creature_spawn spawn, uint bossId, ushort instanceId, Instance instance) : base(spawn)
 {
     Name       = spawn.Proto.Name;
     BossId     = bossId;
     Instance   = instance;
     InstanceID = instanceId;
     EvtInterface.AddEventNotify(EventName.OnEnterCombat, OnEnterCombat);
     EvtInterface.AddEventNotify(EventName.OnLeaveCombat, OnLeaveCombat);
 }
Ejemplo n.º 8
0
        public KeepCreature(Creature_spawn spawn, KeepNpcCreature flagGuard, BattleFrontKeep keep) : base(spawn)
        {
            _keep       = keep;
            FlagGuard   = flagGuard;
            IsKeepLord  = flagGuard.Info.KeepLord;
            IsPatrol    = flagGuard.Info.IsPatrol;
            DefenceRank = 3;

            EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
        }
Ejemplo n.º 9
0
        public InstanceSpawn(Creature_spawn spawn, uint bossId, Instance instance) : base(spawn)
        {
#pragma warning disable CS1717 // Назначение выполнено для той же переменной
            instanceGroupSpawnId = instanceGroupSpawnId;
#pragma warning restore CS1717 // Назначение выполнено для той же переменной
#pragma warning disable CS1717 // Назначение выполнено для той же переменной
            bossId = bossId;
#pragma warning restore CS1717 // Назначение выполнено для той же переменной
            Instance = instance;
            EvtInterface.AddEventNotify(EventName.OnEnterCombat, OnEnterCombat);
            EvtInterface.AddEventNotify(EventName.OnLeaveCombat, OnLeaveCombat);
        }
Ejemplo n.º 10
0
        public PQuestCreature(Creature_spawn spawn, PQuestObjective objective, PublicQuest publicQuest) : base(spawn)
        {
            _objective   = objective;
            _publicQuest = publicQuest;

            if (objective.Objective.Type == (byte)Objective_Type.QUEST_PROTECT_UNIT)
            {
                EvtInterface.AddEvent(Protected, objective.Objective.Time * 1000, 1);
            }

            EvtInterface.AddEventNotify(EventName.OnLeaveCombat, _publicQuest.MobLeavingCombat);
        }
Ejemplo n.º 11
0
 public Boss(Creature_spawn spawn, uint protoId) : base(spawn)
 {
     BossProtoId = protoId;
     EvtInterface.AddEventNotify(EventName.OnEnterCombat, OnEnterCombat);
     EvtInterface.AddEventNotify(EventName.OnLeaveCombat, OnLeaveCombat);
     CrowdControlImmunities = new List <CrowdControlTypes>();
     BossCombatTimer        = new Timer();
     CanBeKnockedBack       = false; // default : no KD - can be overriden
     CanBeTaunted           = true;
     AddDictionary          = new List <BossSpawn>();
     SpawnDictionary        = new List <BossSpawn>();
 }
Ejemplo n.º 12
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public Player(GameClient Client, Character Info) : base()
        {
            _Client = Client;
            _Info   = Info;
            _Value  = Info.Value;

            Name  = Info.Name;
            Realm = (GameData.Realms)Info.Realm;
            SetPVPFlag(false);

            EvtInterface = AddInterface(EventInterface.GetEventInterface((uint)_Info.CharacterId)) as EventInterface;
            SocInterface = AddInterface <SocialInterface>();
            TokInterface = AddInterface <TokInterface>();
            MlInterface  = AddInterface <MailInterface>();

            EvtInterface.AddEventNotify(EventName.ON_MOVE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_RECEIVE_DAMAGE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_DEAL_DAMAGE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_START_CASTING, CancelQuit);
        }
Ejemplo n.º 13
0
            public KeepGameObject(GameObject_spawn spawn, KeepDoor keepDoor, BattleFrontKeep keep)
            {
                _keep     = keep;
                Spawn     = spawn;
                Name      = spawn.Proto.Name;
                _keepDoor = keepDoor;


                if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                {
                    Realm = keep.Realm;
                    Spawn.Proto.HealthPoints = 4 * 500000;
                    Health = Spawn.Proto.HealthPoints;
                }

                _enterExitPoints[0] = new Point3D(_keepDoor.Info.TeleportX1, _keepDoor.Info.TeleportY1, _keepDoor.Info.TeleportZ1);
                _enterExitPoints[1] = new Point3D(_keepDoor.Info.TeleportX2, _keepDoor.Info.TeleportY2, _keepDoor.Info.TeleportZ2);

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }