Skip to content

Commit 07dc76f

Browse files
author
T.Rock
committed
Updates to create wizards that can deal valid damage to npc mobs.
1 parent 2acefb1 commit 07dc76f

7 files changed

+40
-16
lines changed

AtlasSimulator.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AssemblyName>AtlasSimulator</AssemblyName>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="MySql.Data" Version="8.0.27" />
9+
<PackageReference Include="MySql.Data" Version="8.0.29" />
1010
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
1111
</ItemGroup>
1212
<ItemGroup>

Client.cs

+3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ private void ProcessReceivedPackage(byte[] buffer, int pos, int bodyLen, byte ms
288288
case 0x4E:
289289
HandleControlledHorse(buffer, pos, bodyLen);
290290
break;
291+
case 0xD0:
292+
HandleLOSCheck(buffer, pos, bodyLen);
293+
break;
291294
}
292295
}
293296

Client_MessageHandlers.cs

+9
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ private void HandleGameOpenReply(byte[] buffer, int pos, int bodyLen)
7373
SendWorldInitRequest();
7474
}
7575

76+
private void HandleLOSCheck(byte[] buffer, int pos, int bodyLen)
77+
{
78+
var player = ReadUShort(buffer, ref pos);
79+
var target = ReadUShort(buffer, ref pos);
80+
var unknwn1 = ReadUShort(buffer, ref pos);
81+
var unknwn2 = ReadUShort(buffer, ref pos);
82+
SendLOSCheck(player, target);
83+
}
84+
7685
private void HandleStatusUpdate(byte[] buffer, int pos, int bodyLen)
7786
{
7887
//Console.WriteLine("Calling HandleStatusUpdate - NI");

Client_Messages.cs

+16
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,22 @@ public void SendUseSpell(ushort speedData, byte spellLevel, byte spellLineIndex)
181181
Send(buffer, pos);
182182
}
183183

184+
public void SendLOSCheck(ushort player, ushort targetOID)
185+
{
186+
//Console.WriteLine("Calling SendUseSkill: " + spellType.ToString());
187+
var buffer = System.Buffers.ArrayPool<byte>.Shared.Rent(WriterBufferSize);
188+
var pos = WriteHeader(buffer, 0xD0);
189+
WriteUShort(buffer, ref pos, player);
190+
WriteUShort(buffer, ref pos, targetOID);
191+
WriteUShort(buffer, ref pos, 0);
192+
WriteUShort(buffer, ref pos, 0);
193+
194+
WriteLength(buffer, pos);
195+
pos = AppendChecksum(buffer, 0, pos);
196+
197+
Send(buffer, pos);
198+
}
199+
184200
private void SendPositionUpdate()
185201
{
186202
//Console.WriteLine("Calling SendPositionUpdate");

PlayerCreator.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void CreateAccount(IPlayerClass pc)
6565
{
6666
Name = pc.accountName,
6767
Password = CryptPassword(pc.password),
68-
PrivLevel = (uint)3,
68+
PrivLevel = (uint)1,
6969
Realm = (int)1,
7070
CreationDate = DateTime.Now,
7171
DiscordID = "AtlasSimulator",
@@ -87,8 +87,8 @@ public void CreateAccount(IPlayerClass pc)
8787
_dbConnection.Open();
8888
Console.WriteLine(String.Format("Creating account named {0}!", pc.accountName));
8989
string dateString = account.CreationDate.ToString("yyyy-MM-dd HH:mm:ss.fff");
90-
sql = String.Format("INSERT INTO account(Name,password,CreationDate,Realm,PrivLevel,Language,Account_ID,DiscordID) " +
91-
"VALUES('{0}','{1}','{2}',{3},{4},'{5}','{6}','{7}');", account.Name, account.Password, dateString, account.Realm, account.PrivLevel, account.Language, account.Name, account.DiscordID);
90+
sql = String.Format("INSERT INTO `atlas`.`account`(`Name`,`Password`,`CreationDate`,`Realm`,`PrivLevel`,`Status`,`LastLoginIP`,`LastClientVersion`,`Language`,`IsMuted`,`LastTimeRowUpdated`,`Account_ID`,`IsWarned`,`IsTester`,`DiscordID`,`CharactersTraded`,`SoloCharactersTraded`,`Realm_Timer_Realm`,`Realm_Timer_Last_Combat`)" +
91+
" VALUES('{0}','{1}','{2}',{3}, '{4}', '0', '127.0.0.1', '1124', '{5}', '0', '{6}', '{7}', '0', '0', '{8}', '0', '0', '{9}', '0001-01-01 00:00:15');", account.Name, account.Password, dateString, account.Realm, account.PrivLevel, account.Language, dateString, account.Name, account.DiscordID, account.Realm);
9292
cmd = new MySqlCommand(sql, _dbConnection);
9393
cmd.ExecuteNonQuery();
9494
_dbConnection.Close();

playerclasses/ClassHelpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static ClassData GetWizardData()
3838
int creationModel = 12352;
3939
int realm = 1;
4040
int classid = 7;
41-
string specString = "Earth Magic|50;Cold Magic|50;Fire Magic|50";
41+
string specString = "Earth Magic|1;Cold Magic|50;Fire Magic|1";
4242
return new ClassData(wizardRaceSelection, creationModel,classid,realm,specString);
4343
}
4444
}

playerclasses/Wizard.cs

+7-11
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,16 @@ public Wizard(string acc, string pw, string cn, GLocation initialGLocation)
2727
ClassHelpers.ClassData wizzyData = ClassHelpers.GetWizardData();
2828

2929
sql = String.Format(
30-
"INSERT INTO `atlas`.`dolcharacters` (`Constitution`, `Dexterity`, `Strength`, `Quickness`, `Intelligence`," +
31-
" `Piety`, `Empathy`, `Charisma`, `MaxEndurance`, `Endurance`, `Concentration`, `AccountName`, `AccountSlot`," +
32-
"`Name`, `Race`, `Level`, `Class`, `Realm`, `CreationModel`, `CurrentModel`, `Region`, `Xpos`," +
33-
" `Ypos`, `Zpos`, `BindXpos`, `BindYpos`, `BindZpos`, `BindRegion`, `MaxSpeed`, `SerializedSpecs`, `DOLCharacters_ID`)" +
34-
" VALUES('400', '400', '400', '400', '10000', '400', '400', '400', '100', '100', '100'," +
35-
" '{0}', '1', '{1}', '{2}', '50', '{3}', '{4}', '{5}', '{5}', '{6}', '{7}'," +
36-
" '{8}', '{9}','{7}', '{8}', '{9}', '{5}', '191', '{10}', '{11}');",
37-
accountName, charname, wizzyData._validRaces[0], wizzyData._classID, wizzyData._realm, wizzyData._creationModel,
38-
initialGLocation.zone, initialGLocation.x,
39-
initialGLocation.y, initialGLocation.z, wizzyData._specString, IDGenerator.GenerateID());
30+
"INSERT INTO `atlas`.`dolcharacters`(`HasGravestone`,`GravestoneRegion`,`Constitution`,`Dexterity`,`Strength`,`Quickness`,`Intelligence`,`Piety`,`Empathy`,`Charisma`,`BountyPoints`,`RealmPoints`,`RealmLevel`,`Experience`,`MaxEndurance`,`Health`,`Mana`,`Endurance`,`Concentration`,`AccountName`,`AccountSlot`,`CreationDate`,`LastPlayed`,`Name`,`GuildID`,`Gender`,`Race`,`Level`,`Class`,`Realm`,`CreationModel`,`CurrentModel`,`Region`,`ActiveWeaponSlot`,`Xpos`,`Ypos`,`Zpos`,`BindXpos`,`BindYpos`,`BindZpos`,`BindRegion`,`BindHeading`,`BindHouseXpos`,`BindHouseYpos`,`BindHouseZpos`,`BindHouseRegion`," +
31+
"`BindHouseHeading`,`DeathCount`,`ConLostAtDeath`,`Direction`,`MaxSpeed`,`Copper`,`Silver`,`Gold`,`Platinum`,`Mithril`,`SerializedCraftingSkills`,`SerializedAbilities`,`SerializedSpecs`,`SerializedRealmAbilities`,`DisabledSpells`,`DisabledAbilities`,`SerializedFriendsList`,`SerializedIgnoreList`,`IsCloakHoodUp`,`IsCloakInvisible`,`IsHelmInvisible`,`SpellQueue`,`IsLevelSecondStage`,`FlagClassName`,`Advisor`,`GuildRank`,`PlayedTime`,`DeathTime`,`RespecAmountAllSkill`,`RespecAmountSingleSkill`,`RespecAmountRealmSkill`,`RespecAmountDOL`,`RespecAmountChampionSkill`,`IsLevelRespecUsed`,`RespecBought`,`SafetyFlag`," +
32+
"`CraftingPrimarySkill`,`CancelStyle`,`IsAnonymous`,`CustomisationStep`,`EyeSize`,`LipSize`,`EyeColor`,`HairColor`,`FaceType`,`HairStyle`,`MoodType`,`UsedLevelCommand`,`CurrentTitleType`,`KillsAlbionPlayers`,`KillsMidgardPlayers`,`KillsHiberniaPlayers`,`KillsAlbionDeathBlows`,`KillsMidgardDeathBlows`,`KillsHiberniaDeathBlows`,`KillsAlbionSolo`,`KillsMidgardSolo`,`KillsHiberniaSolo`,`CapturedKeeps`,`CapturedTowers`,`CapturedRelics`,`KillsDragon`,`DeathsPvP`,`KillsLegion`,`KillsEpicBoss`,`GainXP`,`GainRP`,`Autoloot`,`LastFreeLeveled`,`LastFreeLevel`,`GuildNote`,`ShowXFireInfo`,`NoHelp`,`ShowGuildLogins`,`Champion`," +
33+
"`ChampionLevel`,`ChampionExperience`,`ML`,`MLExperience`,`MLLevel`,`MLGranted`,`RPFlag`,`IgnoreStatistics`,`NotDisplayedInHerald`,`ActiveSaddleBags`,`LastTimeRowUpdated`,`DOLCharacters_ID`,`LastLevelUp`,`PlayedTimeSinceLevel`,`ReceiveROG`,`HCFlag`,`HCCompleted`,`isBoosted`,`HideSpecializationAPI`)" +
34+
" VALUES('0','0','400','377','400','385','9955','400','400','400','0','0',1,171175293372,'100','652','4488','0','100','{0}','100','2000-01-01 00:00:00','2022-06-28 01:27:34','{1}','c97275ad-136f-4b36-ba4c-7b8a2cdc1a2f','1','1',50,'7','1','12352','12352','1','1','390452','748464','370','390452','748464','370','12352','0','0','0','0','0','0','0','0','0','191','84','63','257','0','0','1|1;2|1;3|1;4|1;6|1;7|1;8|1;9|1;10|1;11|1;12|1;13|1;14|1;15|1','Sprint|0;Weaponry: Staves|0;AlbArmor|1;QuickCast|0','Earth Magic|1;Cold Magic|50;Fire Magic|1','','','','','','0','0','0','1','0','0','0','0','358','0','0','0','0','0','0','0','0','1','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','1','1','2022-06-28 00:42:57','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2022-06-28 05:27:34','{2}','2022-06-28 01:27:34','358','1','0','0','0','0');",
35+
accountName, charname, IDGenerator.GenerateID());
36+
4037

4138
// setup actions
4239
_actionTimer = new Timer(ActionCallback, null, 850, 1000);
43-
4440
}
4541
public void login()
4642
{

0 commit comments

Comments
 (0)