Jump to content
  • 0

Get current player & actions


Question

Posted

Hi, all!
I'm interesting in getting some answers to questions:

 

 

  • 1. How to properly get current player instance (variable).
  • 2. How to get current player actions/events (ex. mouse clicks, left+right mouse click)
  • 3. Is it possible to make character running (Run + Point view), when (both / LEFT + RIGHT) mouse is clicked?

    Lineage 2 Interlude / Java server


Thank you!

11 answers to this question

Recommended Posts

  • 1
Posted

Add listeners to all incoming packets like MoveBackToLocation, RequestActionUse, RequestMagicSkillUse, RequestBypassToServer and etc. Or one global network handler listener. And after you can processing all character's actions for any your wishes.

  • Like 1
  • 1
Posted (edited)
55 minutes ago, BrabusLV said:

 

I'm looking for user.ini, but i have no idea, how to get both pressed

Maybe you know where to send me closer to my answer? :D 

 

And yes, about Instance... Maybe it is class but the fact, if i want to get current player nick, what i should write?


LeftMouse=PlayerPawnMoveTo 
RightMouse=CameraRotationModeOn | CameraRotationModeOff | FixedDefaultCamera OnRelease MaxPressedTime=200.0 
;RightMouse=CameraRotationModeOn | CameraRotationModeOff 
;MiddleMouse=CameraRotationModeOn | CameraRotationModeOff 
;MiddleMouse=FixedDefaultCamera
;End=FixedDefaultCamera
MiddleMouse=

I'm not into client things . You could create a topic in client section in order to get all the things you need from people who are working on client.

 

About the nick, depends where you want to get the name. If for example you want just to send a message in player when he enter in the world, you have to code in EnterWorld.java . There you can see from other lines that already exists a variable that control the player . for example in my sources this variable is called 'player'. So the only thing you have to code is -> player.sendMessage("hi");.

'player' could be named as activeChar or 'client'. 

Then, since you got the 'player' instance, you can get the name from the methods of this class. Usually the method is getName() but idk what you are using. so -> player.getName(); should return the name of the player.

Edited by Creamy G Colin
  • Like 1
  • 1
Posted
6 hours ago, BrabusLV said:

Ok thank you, last question, does in lineage 2 interlude works command MoveForward?

RightMouse=MoveForward

Can i do something like this?

Not sure what is this but, considering to that name i think somewhere should be located all the opcodes of the packets that have to send in server side. so MoveForward have an opcode. (Client side is not l2.ini. do a deep search :P)

 

And again, a client dev can help you more than us.

  • 0
Posted

1) not sure what you need. By instance you mean the class?

2) you can only get the location where the player wants to go. not the mouse click action itself.

3) maybe , its clearly client thing

 

You should define what you want to do . Maybe there are other ways to do them

  • 0
Posted (edited)

Ok thank you guys ;)

I wanted to create choice for player: to run in client while left+right mouse pressed (like in World of Warcraft)

Edited by BrabusLV
selected properly word :)
  • 0
Posted (edited)
5 minutes ago, BrabusLV said:

Ok thank you guys ;)

I wanted to create choice for player: to run in client while left+right mouse clicked (like in World of Warcraft)

Its definitely client thing. you should handle both mouse actions . When the keys pressed together, you should send the action to server and if one of them will release then stop the action .

 

Edit: You can take a look how the 'arrows' are working 

Edited by Creamy G Colin
  • 0
Posted (edited)
10 minutes ago, Creamy G Colin said:

Its definitely client thing. you should handle both mouse actions . When the keys pressed together, you should send the action to server and if one of them will release then stop the action 

 

I'm looking for user.ini, but i have no idea, how to get both pressed

Maybe you know where to send me closer to my answer? :D 

 

And yes, about Instance... Maybe it is class but the fact, if i want to get current player nick, what i should write?

LeftMouse=PlayerPawnMoveTo 
RightMouse=CameraRotationModeOn | CameraRotationModeOff | FixedDefaultCamera OnRelease MaxPressedTime=200.0 
;RightMouse=CameraRotationModeOn | CameraRotationModeOff 
;MiddleMouse=CameraRotationModeOn | CameraRotationModeOff 
;MiddleMouse=FixedDefaultCamera
;End=FixedDefaultCamera
MiddleMouse=
Edited by BrabusLV
  • 0
Posted

You not need get character nick cause incoming packet have Client instance and for client instance attached unique Player instance. Just get player nick from server side like:

final String nickname = getClient().getActingPlayer().getName();

All what you need - it's catch necessary action from client. server side already have all properties about owner character and target object.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 新品上线! 提供高级订阅账号,支持热门AI服务:Gemini Pro 和 Perplexity AI。 ➡ Gemini Pro 订阅 + 2TB 谷歌云存储(绑定您的 Google 账号,有效期1年)| 需要访问您的 Google 账号 | 价格:6美元起 ➡ Perplexity AI Pro 订阅(绑定您的账号,有效期1年)| 需要访问您的账号 | 价格:6美元起 欢迎通过我们的网站或 Telegram 机器人购买! 有效链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 其他服务: 购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账号。 以下是我们平台最新的促销与特别优惠列表: 1. 促销码 OCTOBER2025(8% 折扣),适用于十月期间在我们的网站或机器人中购物!首次购买可使用促销码 SOCNET(15% 折扣)。 2. 获取1美元余额或10–20%折扣 —— 注册后在我们网站的论坛帖子中留言,格式为:"SEND ME BONUS, MY USERNAME IS..."。 3. 首次试用 SMM 面板即可获得1美元奖励 —— 只需在我们网站(支持中心)提交主题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和购买 Stars 的机器人中赠送 Telegram Stars! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop✅ ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord 服务器:https://discord.gg/y9AStFFsrh✅ 联系方式与支持: ➡ Telegram:https://t.me/socnet_support✅ ➡ WhatsApp:https://wa.me/79051904467✅ ➡ Discord:socnet_support ✅ ➡ ✉ 邮箱:solomonbog@socnet.store ✅
    • 新品上线! 提供高级订阅账号,支持热门AI服务:Gemini Pro 和 Perplexity AI。 ➡ Gemini Pro 订阅 + 2TB 谷歌云存储(绑定您的 Google 账号,有效期1年)| 需要访问您的 Google 账号 | 价格:6美元起 ➡ Perplexity AI Pro 订阅(绑定您的账号,有效期1年)| 需要访问您的账号 | 价格:6美元起 欢迎通过我们的网站或 Telegram 机器人购买! 有效链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 其他服务: 购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账号。 以下是我们平台最新的促销与特别优惠列表: 1. 促销码 OCTOBER2025(8% 折扣),适用于十月期间在我们的网站或机器人中购物!首次购买可使用促销码 SOCNET(15% 折扣)。 2. 获取1美元余额或10–20%折扣 —— 注册后在我们网站的论坛帖子中留言,格式为:"SEND ME BONUS, MY USERNAME IS..."。 3. 首次试用 SMM 面板即可获得1美元奖励 —— 只需在我们网站(支持中心)提交主题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和购买 Stars 的机器人中赠送 Telegram Stars! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop✅ ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord 服务器:https://discord.gg/y9AStFFsrh✅ 联系方式与支持: ➡ Telegram:https://t.me/socnet_support✅ ➡ WhatsApp:https://wa.me/79051904467✅ ➡ Discord:socnet_support ✅ ➡ ✉ 邮箱:solomonbog@socnet.store ✅
    • New Products! Accounts with premium subscriptions for popular AI services Gemini Pro and Perplexity AI. ➡ Gemini Pro Subscription + 2TB Google Storage on your Google Account for 1 YEAR | Requires access to your Google account | Price from: $6 ➡ Perplexity AI Pro Subscription ON YOUR ACCOUNT for 1 YEAR | Requires access to your account | Price from: $6 Shop in our online store or through our Telegram bot! Active Links: Digital goods store (Website): Go Store Telegram bot: Go Other services: Telegram bot for purchasing Telegram Stars: Go SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) in October! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ Contacts and Support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅
    • New Products! Accounts with premium subscriptions for popular AI services Gemini Pro and Perplexity AI. ➡ Gemini Pro Subscription + 2TB Google Storage on your Google Account for 1 YEAR | Requires access to your Google account | Price from: $6 ➡ Perplexity AI Pro Subscription ON YOUR ACCOUNT for 1 YEAR | Requires access to your account | Price from: $6 Shop in our online store or through our Telegram bot! Active Links: Digital goods store (Website): Go Store Telegram bot: Go Other services: Telegram bot for purchasing Telegram Stars: Go SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) in October! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ Contacts and Support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅
    • you can expose him here 🙂 let everyone see what kind of person he is and exactly what he is selling.  
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock