Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAttackRange and sending Attack / Move commands #56

Open
AndrewBraunEE opened this issue Dec 14, 2020 · 2 comments
Open

GetAttackRange and sending Attack / Move commands #56

AndrewBraunEE opened this issue Dec 14, 2020 · 2 comments

Comments

@AndrewBraunEE
Copy link

A couple quick questions about developing on this SDK:

  1. Is there a way to access the a hero's attack range? I see CDotaBaseNPC has a GetAttackRange() function, but I didn't see this for CDotaPlayers, so I was wondering if there is any way of accessing that.

  2. Let's say I want to send a "move" or "attack" command for my local player to a creep unit or hero unit. How would I do that? (I think previously there was a prepareUnitOrders that was devirtualized, is the new method just sending the packet / sendMsg now?).

@LWSS
Copy link
Owner

LWSS commented Dec 14, 2020

1- I would just use the datamap offsets for most things.
2- Yeah you could just send a protobuf, the prepareUnitOrders() hook really wasn't that useful to me. It did get devirtualized, that is correct, so I just removed it. You could also sig the function and call it manually if you really wanted, and honestly could get away with hardhooking it on linux.

Also understand that CDotaPlayers do not have an attack range, the CBasePlayer/CDotaPlayer is just an "eye in the sky" that can send orders to heroes.

@AndrewBraunEE
Copy link
Author

I learned the hardway awhile ago about the CDotaPlayer and CDotaBaseNPC while reversing (which I suck at) lol.

Looks like I can just iterate on the entitylist and match that to my CDotaPlayer to find the relevant CDotaBaseNPC for my hero.

I'll use the datamap offset most likely for all these CBaseNPC / hero offsets, unless the SDK has a getter function already.

How would I go about sending a protobuf directly and not hooking prepareUnitOrders()? I can probably call prepareUnitOrders (if that's easier), but I'd imagine that it'd be a lot harder to send a protobuf directly (for code maintenance reasons when there are updates). But I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants