Example #1
0
        public Player Update()
        {
            Dialog dialog = Game.DialogList == null ? (Dialog)null : Game.DialogList.GetDialog("target_dialog", true);
            ProcessCommunicationPointer communicationPointer = Game.Process[this._iBase + (ulong)Game.Resolver["ControllerSingle"]["Brand"].Value].ToBuffered(56UL);

            this.UpdateCamera();
            this.UpdatePosition();
            this._iID = this.GetID(this._iBase);
            if (this._zName == null)
            {
                this._zName = this.GetName(this._iBase);
            }
            if ((int)this._bLevel == 0)
            {
                this._bLevel = Game.Process.GetByte(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["Level"].Value);
            }
            Entity entity;

            if (Game.EntityList != null && (entity = Game.EntityList.GetEntity(this._iID)) != null)
            {
                this._iEntityNode = entity.GetAddress(1);
                base.Update();
                Game.DialogList.GetDialog("skill_delay_dialog", false);
                if (this.IsMoving() && this._iMoveTime < Game.Time())
                {
                    if (this._hMoveCheck.Equals((object)this._hPosition))
                    {
                        this._eActionPending = this._eAction;
                        this.SetAction(eAction.None);
                        this._iActionPending = Game.Time() + 500U;
                    }
                    this._hMoveCheck = this._hPosition;
                    this._iMoveTime  = Game.Time() + 1000U;
                }
                this._eAction = (eAction)Game.Process.GetUnsignedInteger(this._iEntity + (ulong)Game.Resolver["ActorSingle"]["Action"].Value);
                if ((int)this._iActionPending != 0 && this._iActionPending < Game.Time())
                {
                    if ((this._eAction == eAction.MoveForward && this._eActionPending == eAction.MoveForward || this._eAction == eAction.None) && this._eActionPending == eAction.MoveForward)
                    {
                        Player.PostMessage(Game.Process.ProcessWindowHandle, 256U, 144U, 0U);
                        Player.PostMessage(Game.Process.ProcessWindowHandle, 257U, 144U, 0U);
                    }
                    else
                    {
                        this.SetAction(this._eActionPending);
                    }
                    this._iActionPending = 0U;
                }
            }
            try
            {
                uint num = Game.Resolver["ControllerSingleCheat"]["GravitySkills"].Value;
                if (Game.Resolver["ControllerSingleCheat"]["GravityFlying"] != null)
                {
                    if (Game.Resolver["ControllerSingleCheat"]["GravitySkills"] != null)
                    {
                        if (this._iGravityPatchTimer >= Game.Time())
                        {
                            if (!this._bGravityLock)
                            {
                                if (Game.Player.GetStance() != eStance.Normal)
                                {
                                    if (Game.Player.GetStance() != eStance.Combat)
                                    {
                                        goto label_29;
                                    }
                                }
                                Game.Process.SetUnsignedInteger(Game.Player.GetAddress(0) + (ulong)Game.Resolver["ActorSingle"]["Stance"].Value, Game.Player.GetStance() == eStance.Combat ? 5U : 4U);
                                Game.Process.SetByte(Game.Base() + (ulong)Game.Resolver["ControllerSingleCheat"]["GravityFlying"].Value, (byte)0);
                                if ((int)num != 0)
                                {
                                    Game.Process.SetUnsignedShort(Game.Base() + (ulong)num, (ushort)37008);
                                }
                                this._bGravityLock = true;
                            }
                        }
                        else if (this._bGravityLock)
                        {
                            Game.Process.SetUnsignedInteger(Game.Player.GetAddress(0) + (ulong)Game.Resolver["ActorSingle"]["Stance"].Value, Game.Player.GetStance() == eStance.FlyingCombat ? 1U : 0U);
                            Game.Process.SetByte(Game.Base() + (ulong)Game.Resolver["ControllerSingleCheat"]["GravityFlying"].Value, (byte)1);
                            if ((int)num != 0)
                            {
                                Game.Process.SetUnsignedShort(Game.Base() + (ulong)num, (ushort)49203);
                            }
                            this._bGravityLock = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
label_29:
            this._fAttackRange           = Game.Process.GetFloat(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["AttackRange"].Value);
            this._hMoveClick             = new Vector3D(0.0f, 0.0f, 0.0f);
            this._iManaMaximum           = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["ManaMaximum"].Value);
            this._iManaCurrent           = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["ManaCurrent"].Value);
            this._iFlightTimeCurrent     = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["FlightTimeCurrent"].Value);
            this._iFlightTimeMaximum     = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["FlightTimeMaximum"].Value);
            this._iExperienceCurrent     = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["ExperienceCurrent"].Value);
            this._iExperienceRecoverable = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["ExperienceRecoverable"].Value);
            this._iExperienceRequired    = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["ExperienceMaximum"].Value);
            this._iFlightCooldown        = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["FlightCooldownRemainingTime"].Value);
            this._iWorld  = Game.Process.GetUnsignedInteger(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["WorldId"].Value) / 10000U * 10000U;
            this._zMarked = Game.Process.GetString(this._iBase + (ulong)Game.Resolver["ControllerSingle"]["NameSearch"].Value, 128U, MessageHandlerString.Unicode);
            for (uint index = 0; index < 14U; ++index)
            {
                this._hBrand[index + 1U] = communicationPointer.GetUnsignedInteger((ulong)(index * 4U));
            }
            if (dialog != null && dialog.IsVisible())
            {
                ulong address = dialog.GetAddress();
                this._iTargetID = Game.Process.GetUnsignedInteger(address + (ulong)Game.Resolver["ControllerSingle"]["TargetOffset"].Value);
            }
            return(this);
        }