Skip to content

Commit

Permalink
POC - GUARDLINE
Browse files Browse the repository at this point in the history
  • Loading branch information
dust765 committed Jan 27, 2022
1 parent 26abcab commit 67aad64
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ commands: see options for a full list

macros: see options for a full list

# POC

proof of concepts

guardlines: show guardlines on land tiles (disabled due to performance)

# Added files

/src/Dust765
Expand Down Expand Up @@ -716,6 +722,14 @@ FILE START END COMMIT

/src/Game/Managers/MacroManager.cs 2534 2541 LOBBY

/src/Game/Map/Chunk.cs 35 38 POC - GUARDLINE

/src/Game/Map/Chunk.cs 70 72 POC - GUARDLINE

/src/Game/Map/Chunk.cs 118 121 POC - GUARDLINE

/src/Game/Map/Chunk.cs 493 515 POC - GUARDLINE

# Introduction
ClassicUO is an open source implementation of the Ultima Online Classic Client. This client is intended to emulate all standard client versions and is primarily tested against Ultima Online free shards.

Expand Down
223 changes: 223 additions & 0 deletions src/Dust765/Dust765/CombatCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
using System.IO;
using System.Runtime.CompilerServices;

// ## BEGIN - END ## // POC - GUARDLINE
//using System.Collections;
// ## BEGIN - END ## // POC - GUARDLINE

namespace ClassicUO.Dust765.Dust765
{
internal static class CombatCollection
Expand Down Expand Up @@ -1863,5 +1867,224 @@ public static void UpdateHamstrung(Mobile mobile)
}
*/
// ## BEGIN - END ## // OUTLANDS
// ## BEGIN - END ## // POC - GUARDLINE
/*
class GuardRegion
{
private int m_Height;
private int m_Width;
private int m_X;
private int m_Y;
public GuardRegion(string line)
{
string[] textArray1 = line.Split(new char[] { ' ' });
this.m_X = int.Parse(textArray1[0]);
this.m_Y = int.Parse(textArray1[1]);
this.m_Width = int.Parse(textArray1[2]);
this.m_Height = int.Parse(textArray1[3]);
}
public static ArrayList guardLines = new ArrayList();
/*
Taken from razorce guardline.def
# Papua
5639 3095 192 223 -128 127
5831 3237 20 30 -128 127
# Delucia
5123 3942 192 122 -128 127
5147 4064 125 20 -128 127
5235 3930 80 12 -128 127
# Yew
92 656 349 225 -30 39
441 746 216 135 0 39
258 881 399 380 0 39
657 922 42 307 0 39
657 806 17 28 0 39
718 874 38 22 0 39
761 741 19 21 0 39
# Wind
5132 3 70 55 -128 127
5132 58 81 68 -128 127
5213 98 39 28 -128 127
5197 126 55 78 -128 127
5252 112 42 58 -128 127
5252 170 32 8 -128 127
5252 178 20 5 -128 127
5252 183 10 10 -128 127
5294 19 72 120 -128 127
5279 57 15 55 -128 127
5286 25 8 32 -128 127
# Jhelom
1303 3670 189 225 -20 127
1338 3895 74 28 -20 127
1383 3951 109 94 -20 127
1494 3767 12 11 -20 127
# Vesper
2893 598 121 50 -10 127
2816 648 249 365 -10 127
2734 944 82 4 -10 127
2728 948 88 53 -10 127
# Minoc
2411 366 135 241 -10 127
2548 495 72 55 -10 127
2564 585 3 42 -10 127
2567 585 61 61 -10 127
2499 627 68 63 -10 127
2694 685 15 16 -10 127
# Serpent's Hold. Get
2868 3324 205 195 0 127
# Magincia
3653 2046 27 48 0 127
3752 2046 52 48 0 127
3680 2045 72 49 0 127
3652 2094 160 180 -128 127
3649 2256 54 47 -128 127
3554 2132 18 18 -128 127
# Nujel'm
3475 1000 360 435 0 127
# Cove
2200 1110 50 50 -10 127
2200 1160 86 86 -10 127
# Ocllo
3587 2456 119 99 -128 127 F
3706 2460 2 95 -128 127 F
3587 2555 106 73 -128 127 F
3590 2628 103 58 -128 127 F
3693 2555 61 144 -128 127 F
3754 2558 7 141 -128 127 F
3761 2555 7 144 -128 50 F
3695 2699 66 13 -128 127 F
# Haven
3590 2460 118 226 -10 127 T
3568 2552 22 79 -10 127 T
3708 2558 53 154 -10 127 T
3695 2686 13 26 -10 127 T
3759 2767 10 10 -10 127 T
# Britain
1416 1498 324 279 -10 127
1500 1408 46 90 0 127
1385 1538 31 239 -10 127
1416 1777 324 60 0 127
1385 1777 31 130 0 127
1093 1538 292 369 0 127
1330 1991 13 13 -10 127
# Skara Brae
638 2062 12 11 0 127
538 2107 150 190 -10 127
# Trinsic
1856 2636 75 28 -10 127
1816 2664 283 231 -10 127
2099 2782 18 25 -10 127
1970 2895 47 32 -10 127
1796 2696 20 67 0 127
1800 2796 16 52 0 127
1823 2943 11 11 -128 127
# Moonglow
4535 844 20 3 0 127
4530 847 31 61 0 127
4521 914 56 49 0 127
4278 915 54 19 0 127
4283 944 53 73 0 127
4377 1015 59 37 -10 127
4367 1050 142 145 0 127
4539 1036 27 18 0 127
4517 1053 23 22 0 127
4389 1198 47 39 0 127
4466 1211 32 25 0 127
4700 1108 17 18 0 127
4656 1127 26 13 0 127
4678 1162 25 25 0 127
4613 1196 23 22 0 127
4646 1212 14 17 0 127
4677 1214 26 22 0 127
4459 1276 16 16 0 127
4622 1316 22 24 0 127
4487 1353 59 21 0 127
4477 1374 69 35 0 127
4659 1387 40 40 0 127
4549 1482 29 27 0 127
4405 1451 23 23 0 127
4483 1468 21 13 0 127
#duel
5307 3681 33 26 -127 127
5158 3436 33 28 -127 127
5848 3500 27 30 -127 127
6055 2324 39 24 -127 127
5757 3658 27 26 -127 127
*/

//ONLY POPULATING TRINSIC ATM FOR TESTING
/*
1856 2636 75 28 -10 127
1816 2664 283 231 -10 127
2099 2782 18 25 -10 127
1970 2895 47 32 -10 127
1796 2696 20 67 0 127
1800 2796 16 52 0 127
1823 2943 11 11 -128 127
*/
/*
public static GuardRegion[] guardLinesRead()
{
guardLines.Add(new GuardRegion("1856 2636 75 28 -10 127"));
guardLines.Add(new GuardRegion("1816 2664 283 231 -10 127"));
guardLines.Add(new GuardRegion("2099 2782 18 25 -10 127"));
guardLines.Add(new GuardRegion("1970 2895 47 32 -10 127"));
guardLines.Add(new GuardRegion("1796 2696 20 67 0 127"));
guardLines.Add(new GuardRegion("1800 2796 16 52 0 127"));
guardLines.Add(new GuardRegion("1823 2943 11 11 -128 127"));
return (GuardRegion[]) guardLines.ToArray(typeof(GuardRegion));
}
public int X
{
get { return m_X; }
set { m_X = value; }
}
public int Y
{
get { return m_Y; }
set { m_Y = value; }
}
public int Length
{
get { return m_Height; }
set { m_Height = value; }
}
public int Width
{
get { return m_Width; }
set { m_Width = value; }
}
}
*/
// ## BEGIN - END ## // POC - GUARDLINE
}
}
35 changes: 35 additions & 0 deletions src/Game/Map/Chunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

using System.Collections.Generic;
using System.Runtime.CompilerServices;
// ## BEGIN - END ## // POC - GUARDLINE
//using ClassicUO.Dust765.Dust765;
//using Microsoft.Xna.Framework;
// ## BEGIN - END ## // POC - GUARDLINE
// ## BEGIN - END ## // OUTLANDS
//using ClassicUO.Dust765.Dust765;
// ## BEGIN - END ## // OUTLANDS
Expand Down Expand Up @@ -63,6 +67,9 @@ internal sealed class Chunk
public int X;
public int Y;

// ## BEGIN - END ## // POC - GUARDLINE
//private GuardRegion[] guard_Regions = GuardRegion.guardLinesRead();
// ## BEGIN - END ## // POC - GUARDLINE

public static Chunk Create(int x, int y)
{
Expand Down Expand Up @@ -108,6 +115,10 @@ public unsafe void Load(int index)
land.X = tileX;
land.Y = tileY;
land.Z = z;
// ## BEGIN - END ## // POC - GUARDLINE
//if (PointInRect(land.X, land.Y))
// land.Hue = 0x33;
// ## BEGIN - END ## // POC - GUARDLINE
land.UpdateScreenPosition();

AddGameObject(land, x, y);
Expand Down Expand Up @@ -478,5 +489,29 @@ public bool HasNoExternalData()

return true;
}

// ## BEGIN - END ## // POC - GUARDLINE
/*
public bool PointInRect(ushort x, ushort y)
{
int count = guard_Regions.Length;
for (int i = 0; i < count; i++)
{
GuardRegion gr = this.guard_Regions[i];
Rectangle rect = new Rectangle(gr.X, gr.Y, gr.Width, gr.Length);
Point tile = new Point(x, y);
if (rect.Contains(tile))
{
return true;
}
}
return false;
}
*/
// ## BEGIN - END ## // POC - GUARDLINE
}
}

0 comments on commit 67aad64

Please sign in to comment.