public override void OnTerminate() { // DisplayID Manager.LocalPlayer.SetDescriptor <uint>(WoWUnitFields.UNIT_FIELD_DISPLAYID, DefaultDisplayID); // Scale Manager.LocalPlayer.SetDescriptor <float>(WoWObjectFields.OBJECT_FIELD_SCALE_X, DefaultScale); // UpdateModel _UpdateModel = Manager.Memory.RegisterDelegate <UpdateModelDelegate>((IntPtr)UpdateModel_Offset); _UpdateModel(Manager.LocalPlayer.Pointer, 1); }
public override void OnTick() { if (Manager.LocalPlayer.TargetGuid != 0) { if (tmpGUID != Manager.LocalPlayer.Target.Guid) { tmpGUID = Manager.LocalPlayer.Target.Guid; _localLoc = Manager.LocalPlayer.Location; _tmpLoc = Manager.LocalPlayer.Target.Location; Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Pointer + (uint)Pointers.PositionPointers.UNIT_X), _tmpLoc.X); Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Pointer + (uint)Pointers.PositionPointers.UNIT_Y), _tmpLoc.Y); Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Pointer + (uint)Pointers.PositionPointers.UNIT_Z), _tmpLoc.Z + 0.05f); //WoWScript.ExecuteNoResults("JumpOrAscendStart()"); //WoWScript.ExecuteNoResults("MoveForwardStart()"); //WoWScript.ExecuteNoResults("MoveForwardStop()"); //WoWScript.ExecuteNoResults("MoveForwardStop()"); //DisplayID //_tmpDisplayID = Manager.LocalPlayer.Target.GetDescriptor<uint>(WoWUnitFields.UNIT_FIELD_NATIVEDISPLAYID); Manager.LocalPlayer.SetDescriptor <uint>(WoWUnitFields.UNIT_FIELD_DISPLAYID, _tmpDisplayID); Print("Changing display ID from {0} to {1}", DefaultDisplayID, _tmpDisplayID); // Scale // Crash due to getdescriptor unavailable to Target //TmpScale = Manager.LocalPlayer.Target.GetDescriptor<uint>(0x0004); //Manager.LocalPlayer.SetDescriptor<float>(WoWObjectFields.OBJECT_FIELD_SCALE_X, TmpScale); //Print("Changing scale from {0:1} to {1:1}", DefaultScale, TmpScale); //UpdateModel _UpdateModel = Manager.Memory.RegisterDelegate <UpdateModelDelegate>((IntPtr)UpdateModel_Offset); _UpdateModel(Manager.LocalPlayer.Pointer, 1); //forceLocCheck = true; Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Target.Pointer + (uint)Pointers.PositionPointers.UNIT_X), _localLoc.X); Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Target.Pointer + (uint)Pointers.PositionPointers.UNIT_Y), _localLoc.Y); Manager.Memory.Write <float>(new IntPtr((uint)Manager.LocalPlayer.Target.Pointer + (uint)Pointers.PositionPointers.UNIT_Z), _localLoc.Z + 0.05f); } } }