Skip to content

Commit

Permalink
FIXES_AND_FEATURES
Browse files Browse the repository at this point in the history
  • Loading branch information
dust765 committed Nov 3, 2021
1 parent a793a3c commit 1f50438
Show file tree
Hide file tree
Showing 12 changed files with 694 additions and 31 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ alt="chat on Discord"></a>
# Project dust765
This project is to address a problem constructed within the toxicity of this community. This is to show the community, open source projects are not meant for cliques and high school drama but rather the expansion of something greater, innovation. -A penny for your thoughts, the adder that prays beneath the rose.

# contact

Discord: dust765#2787

# feature showcase

[Video Part 1 on MetaCafe]( https://www.metacafe.com/watch/12177837/project-dust765/)
[Video Part 1 on YouTube](https://youtu.be/074Osj1Fcrg)

[Video Part 2 on MetaCafe](https://www.metacafe.com/watch/12177839/project-dust765-2/)
[Video Part 2 on YouTube](https://youtu.be/P7YBrI3s6ZI)

[Video Part 3 on MetaCafe](https://www.metacafe.com/watch/12177847/project-dust765-3/)
[Video Part 3 on YouTube](https://youtu.be/aqHiiOhx8Q8)

# art / hue changes

Expand Down Expand Up @@ -90,13 +94,15 @@ Ignore stamina check

Block Wall of Stone

Block Energy Field

# misc 2

wireframe view

hue impassable tiles

transparent / invisible house and items by Z level from player
transparent / invisible house and items by Z level from player and min Z from ground

ignore list for circle of transparency (txt file created in your /Data/Client folder)

Expand Down Expand Up @@ -128,7 +134,7 @@ UI UCC AL - Is an autoloot feature / UI. Only works with GridLoot enabled. You c

UI UCC BUFFBAR - Provides a visible timer for next swing and disarm. You can enable lines individually enable them and also lock the UI to prevent moving it. There is a txt in /Data/Client to modify the timers for weapons. It does NOT change calculation with SSI or the like.

UI UCC SELF - Is an Automation feature to bandaid yourself, use pouches and pots and auto rearms a weapon after being disarmed.
UI UCC SELF - Is an Automation feature to bandaid yourself, use pouches, pots and enhanced apple (auto rearms a weapon after being disarmed).

Checkboxes on the UI

Expand Down Expand Up @@ -206,6 +212,8 @@ auto add marker for T-Maps

-engage (auto pathfind and attack lasttarget)

-autorange (auto show range indicator when weapon is equipped)

# outlands

disabled features due to client enforcement
Expand Down
15 changes: 15 additions & 0 deletions src/Configuration/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ internal sealed class Profile
public bool BlockWoSFelOnly { get; set; } = false;
public uint BlockWoSArt { get; set; } = 1872;
public bool BlockWoSArtForceAoS { get; set; } = false;
public bool BlockEnergyF { get; set; } = false;
public bool BlockEnergyFFelOnly { get; set; } = false;
public uint BlockEnergyFArt { get; set; } = 1872;
public bool BlockEnergyFArtForceAoS { get; set; } = false;
public bool BlackOutlineStatics { get; set; } = false;
// ## BEGIN - END ## // MISC
// ## BEGIN - END ## // MACROS
Expand All @@ -368,6 +372,7 @@ internal sealed class Profile
public int TransparentHousesTransparency { get; set; }
public bool InvisibleHousesEnabled { get; set; } = false;
public int InvisibleHousesZ { get; set; }
public int DontRemoveHouseBelowZ { get; set; } = 5;
public bool IgnoreCoTEnabled { get; set; } = false;
public bool ShowDeathOnWorldmap { get; set; } = false;
// ## BEGIN - END ## // MISC2
Expand Down Expand Up @@ -452,6 +457,10 @@ internal sealed class Profile
// ## BEGIN - END ## // SELF
public bool UOClassicCombatSelf { get; set; } = false;
public Point UOClassicCombatSelfLocation { get; set; } = new Point(25, 25);
public bool UOClassicCombatSelf_ColoredPouches { get; set; } = false;
public ushort UOClassicCombatSelf_ColoredPouchesColor { get; set; } = 38;
public bool UOClassicCombatSelf_AutoEApple { get; set; } = true;
public uint UOClassicCombatSelf_EAppleCooldown { get; set; } = 31000;
public bool UOClassicCombatSelf_AutoBandage { get; set; } = true;
public bool UOClassicCombatSelf_AutoPouche { get; set; } = true;
public bool UOClassicCombatSelf_AutoCurepot { get; set; } = true;
Expand Down Expand Up @@ -517,6 +526,12 @@ internal sealed class Profile
public string LobbyIP { get; set; } = "127.0.0.1";
public string LobbyPort { get; set; } = "2596";
// ## BEGIN - END ## // LOBBY
// ## BEGIN - END ## // AUTOS
public bool AutoRangeDisplayAlways { get; set; } = false;
public bool AutoRangeDisplayActive { get; set; } = false;
public int AutoRangeDisplayActiveRange { get; set; } = 10;
public ushort AutoRangeDisplayHue { get; set; } = 0x0074;
// ## BEGIN - END ## // AUTOS
// ## BEGIN - END ## // BASICSETUP
public bool ShowJournalClient { get; set; } = true;
public bool ShowJournalObjects { get; set; } = true;
Expand Down
284 changes: 284 additions & 0 deletions src/Dust765/Autos/AutoRangeDisplay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
#region license

// Copyright (C) 2020 project dust765
//
// This project is an alternative client for the game Ultima Online.
// The goal of this is to develop a lightweight client considering
// new technologies.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;

using ClassicUO.Configuration;
using ClassicUO.Game.GameObjects;
using ClassicUO.Dust765.Shared;
using ClassicUO.Game;
using ClassicUO.Game.Data;
using ClassicUO.Game.Managers;
using ClassicUO.Utility;

namespace ClassicUO.Dust765.Autos
{
internal class AutoRangeDisplay
{
public static bool IsEnabled { get; set; }
public static Thread a_AutoRangeThread;

private static Item _tempItemInLeftHand; //temp var
private static Item _tempItemInRightHand;

//WEAPONS LIST
public static readonly List<ushort> WeaponsList = new List<ushort>();

//##AutoRangeDisplay Toggle##//
public static void Toggle()
{
GameActions.Print(String.Format("Auto AutoRangeDisplay:{0}abled", (IsEnabled = !IsEnabled) == true ? "En" : "Dis"), 70);
}

//##Register Command and Perform Checks##//
public static void Initialize()
{
CommandManager.Register("autorange", args => Toggle());

LoadFile();

a_AutoRangeThread = new Thread(new ThreadStart(DoAutoRange))
{
IsBackground = true
};

if (ProfileManager.CurrentProfile.AutoRangeDisplayAlways)
{
IsEnabled = true;
}
}

//##Default AutoRangeDisplay Status on GameLoad##//
static AutoRangeDisplay()
{
if (ProfileManager.CurrentProfile.AutoRangeDisplayAlways)
{
GameActions.Print(String.Format("Auto AutoRangeDisplay:Enabled"), 70);
IsEnabled = true;
}
else
IsEnabled = false;
}

//##Perform AutoRangeDisplay Update on Toggle/Player Death##//
public static void Update()
{
if (!IsEnabled) // || World.Player.IsDead)
DisableAutoRangeDisplay();

if (IsEnabled)
EnableAutoRangeDisplay();
}

//##Enable AutoRangeDisplay##//
private static void EnableAutoRangeDisplay()
{
if (!a_AutoRangeThread.IsAlive)
{
a_AutoRangeThread = new Thread(new ThreadStart(DoAutoRange))
{
IsBackground = true
};
a_AutoRangeThread.Start();
}
}

//##Disable AutoRangeDisplay##//
private static void DisableAutoRangeDisplay()
{
if (a_AutoRangeThread.IsAlive)
{
a_AutoRangeThread.Abort();
}
}

//##Perform AutoRangeDisplay Checks##//
private static void DoAutoRange()
{
DateTime dateTime = DateTime.Now;
while (true)
{

//if (World.Player == null || World.Player.IsDead)
// DisableAutoRangeDisplay();

if (World.Player == null || World.Player.IsDead || ProfileManager.CurrentProfile == null)
return;

_tempItemInLeftHand = null;
_tempItemInRightHand = null;
_tempItemInLeftHand = World.Player.FindItemByLayer(Layer.OneHanded);
_tempItemInRightHand = World.Player.FindItemByLayer(Layer.TwoHanded);

int range = 0;
int index = 0;

if (_tempItemInRightHand != null)
{
index = WeaponsList.IndexOf(_tempItemInRightHand.Graphic);

if (index != 0)
{
range = WeaponsList[index + 1];

ProfileManager.CurrentProfile.AutoRangeDisplayActive = true;
ProfileManager.CurrentProfile.AutoRangeDisplayActiveRange = range;
} else
{
ProfileManager.CurrentProfile.AutoRangeDisplayActive = false;
}
}
if (_tempItemInLeftHand != null)
{
index = WeaponsList.IndexOf(_tempItemInLeftHand.Graphic);

if (index != 0)
{
range = WeaponsList[index + 1];

ProfileManager.CurrentProfile.AutoRangeDisplayActive = true;
ProfileManager.CurrentProfile.AutoRangeDisplayActiveRange = range;
}
else
{
ProfileManager.CurrentProfile.AutoRangeDisplayActive = false;
}
}

if (_tempItemInRightHand == null && _tempItemInLeftHand == null)
ProfileManager.CurrentProfile.AutoRangeDisplayActive = false;

Thread.Sleep(50);
}
}

//##Perform Ninja Trigger##//
private static void NinjaItem()
{

}

//##Perform Message##//
public static void Print(string message, MessageColor color = MessageColor.Default)
{
GameActions.Print(message, (ushort) color, MessageType.System, 1);
}

//GET WEAPON SPEED FROM FILE OR CREATE IT
public static void LoadFile()
{
string path = Path.Combine(CUOEnviroment.ExecutablePath, "Data", "Client");

if (!Directory.Exists(path))
Directory.CreateDirectory(path);

string autorange = Path.Combine(path, "autorange.txt");

if (!File.Exists(autorange))
{
using (StreamWriter writer = new StreamWriter(autorange))
{
//0x13B1, 0x13B2 bow / 0x26C2, 0x26CC comp / 0x26C3, 0x26CD repeating / 0x27A5, 0x27F0 yumi / 0xF4F, 0xF50 xbow / 0x13FC, 0x13FD heavy xbow
//0x2D1E, 0x2D2A elven comp, 0x2D1F, 0x2D2B magical shortbow
ushort[] weapons = {

0x13B1, 0x13B2, 0x26C2, 0x26CC, 0x26C3, 0x26CD, 0x27A5, 0x27F0,
0xF4F, 0xF50, 0x13FC, 0x13FD, 0x2D1E, 0x2D2A, 0x2D1F, 0x2D2B
};

for (int i = 0; i < weapons.Length; i++)
{
ushort graphic = weapons[i];
ushort flag = 10;

switch (graphic)
{
case 0x13B1:
case 0x13B2:
flag = 10;
break;

case 0x26C2:
case 0x26CC:
flag = 10;
break;

case 0x26C3:
case 0x26CD:
flag = 7;
break;

case 0x27A5:
case 0x27F0:
flag = 10;
break;

case 0xF4F:
case 0xF50:
flag = 8;
break;

case 0x13FC:
case 0x13FD:
flag = 8;
break;

case 0x2D1E:
case 0x2D2A:
flag = 10;
break;

case 0x2D1F:
case 0x2D2B:
flag = 10;
break;
}

writer.WriteLine($"{graphic}={flag}");
}
}
}

TextFileParser autorangeParser = new TextFileParser(File.ReadAllText(autorange), new[] { ' ', '\t', ',', '=' }, new[] { '#', ';' }, new[] { '"', '"' });

while (!autorangeParser.IsEOF())
{
var ss = autorangeParser.ReadTokens();
if (ss != null && ss.Count != 0)
{
if (ushort.TryParse(ss[0], out ushort graphic))
{
WeaponsList.Add(graphic);
}

if (ushort.TryParse(ss[1], out ushort f))
{
WeaponsList.Add(f);
}
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/Dust765/Dust765/ClilocTriggers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public void OnMessage(string text, ushort hue, string name, bool isunicode = tru
UOClassicCombatSelf?.ClilocTriggerFSFullStamina();
return;
}
if (text.StartsWith("A tasty bite of the enchanted apple lifts all curses from your soul."))
{
UOClassicCombatSelf?.ClilocTriggerEApple();
return;
}

}
public void OnCliloc(uint cliloc)
Expand Down
Loading

0 comments on commit 1f50438

Please sign in to comment.