mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-01 03:03:39 +00:00
Enhanced Targeting functionality
This commit is contained in:
parent
610f0b092f
commit
28960ad24f
1 changed files with 17 additions and 0 deletions
|
|
@ -6029,7 +6029,24 @@ class WorldSessionActor extends Actor
|
|||
|
||||
case msg @ TargetingImplantRequest(list) =>
|
||||
log.info("TargetingImplantRequest: "+msg)
|
||||
val targetInfo: List[TargetInfo] = list.flatMap(x => {
|
||||
continent.GUID(x.target_guid) match {
|
||||
case Some(player: Player) =>
|
||||
val health = player.Health.toFloat / player.MaxHealth
|
||||
val armor = if (player.MaxArmor > 0) {
|
||||
player.Armor.toFloat / player.MaxArmor
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
Some(TargetInfo(player.GUID, health, armor))
|
||||
case _ =>
|
||||
log.warn(s"Target info requested for guid ${x.target_guid} but is not a player")
|
||||
None
|
||||
}
|
||||
})
|
||||
|
||||
sendResponse(TargetingInfoMessage(targetInfo))
|
||||
case msg @ ActionCancelMessage(u1, u2, u3) =>
|
||||
log.info("Cancelled: "+msg)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue