Skip to content

Commit 0409e23

Browse files
committed
add hero lvl
1 parent 94a2787 commit 0409e23

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

TaleKit/Game/Entities/Character.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void Attack(LivingEntity entity, Skill skill)
102102

103103
public void AttackAt(Skill skill, Position target)
104104
{
105-
var canAttack = Position.IsInRange(target, skill.Range) && !skill.IsOnCooldown;
105+
var canAttack = Position.IsInRange(target, skill.Range) && !skill.IsOnCooldown && skill.TargetType == TargetType.NoTarget;
106106
if (!canAttack)
107107
{
108108
return;

TaleKit/Game/Entities/Player.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ public class Player : LivingEntity
1111
public override EntityType EntityType => EntityType.Player;
1212
public GlacernonSide GlacernonSide { get; set; }
1313
public string FamilyName { get; set; }
14+
public int Level { get; set; }
15+
public int HeroLevel { get; set; }
1416
}

TaleKit/Network/Packet/Maps/In.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class InDrop
3939
public class InPlayer
4040
{
4141
public string FamilyName { get; init; }
42+
public int Level { get; init; }
43+
public int HeroLevel { get; init; }
4244
}
4345

4446
public class InBuilder : PacketBuilder<In>
@@ -84,7 +86,9 @@ protected override In CreatePacket(string[] body)
8486
case EntityType.Player:
8587
packet.Player = new InPlayer
8688
{
87-
FamilyName = body[26]
89+
FamilyName = body[26],
90+
Level = body[32].ToInt(),
91+
HeroLevel = body[38].ToInt()
8892
};
8993
break;
9094
}
@@ -153,6 +157,8 @@ protected override void Process(Session session, In packet)
153157
Position = new Position(packet.X, packet.Y),
154158
Map = map,
155159
FamilyName = packet.Player.FamilyName,
160+
Level = packet.Player.Level,
161+
HeroLevel = packet.Player.HeroLevel,
156162
GlacernonSide = GlacernonSide.Angel // TODO : Get from packet
157163
};
158164

0 commit comments

Comments
 (0)