I try this
http://www.mmowned.com/forums/world-...thout-ctm.html
but it won't work
Here is how I do it :
call HandleTerrainClick and then call Lua function CastSpellByID
But nothing happened.
Is there any hints? Thanks!~
I try this
http://www.mmowned.com/forums/world-...thout-ctm.html
but it won't work
Here is how I do it :
call HandleTerrainClick and then call Lua function CastSpellByID
But nothing happened.
Is there any hints? Thanks!~
hm. tbh never tried this. but what about doing it just like a player would do it?
1. cast spell
2. send the terrainclick
would somehow make a little bit more sense in that order
Cast spell. Click terrain.
Works flawlessly for me.
Don't believe everything you think.
I assume you are trying to do this for botting purposes, so my answer probably isn't relevant.
I wanted to create a single hotkey that would use my frost trap (trap launcher) and launch it at my current mouse position, so I did the following: (Probably could have done it better, but it works for me!)
Two things to note:Code:clsMyMemory.DoString("CastSpellByID(77769)"); //Trap Launcher Thread.Sleep(300); clsMyMemory.DoString("CastSpellByID(82941)"); //Ice Trap(Frost - Trap Launcher) Thread.Sleep(100); clsMyMemory.DoString("CameraOrSelectOrMoveStart()"); clsMyMemory.DoString("CameraOrSelectOrMoveStop()");
1)The 300ms delay is only because Trap Launcher sends a cast to the server to get the buff that allows you to cast the trap launcher version of the trap. Its probably better to handle this with a loop to check UnitBuff("player", "Trap Launcher") but I was being lazy when I was writing this.
2) I am not so sure how necessary the 100ms sleep is, my thought when I was writing this is that I would have to give the client time to register that the spell was ready to cast before trying to click the terrain. This may or may not be necessary.
EDIT: Btw, wouldn't you have to call TerrainClick AFTER calling CastSpellByID? Your OP has it the other way around.
Last edited by Xelper; 01-24-2011 at 11:09 AM.
I send a CMSG_CAST_SPELL packet with the target coördinates.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
Sorry~
I call in the wrong order
Thank you guys
How to call HandleTerrainClick?
can anyone make a complete code?
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
Thanks all, I'll try it.
------------------------------
If not me than who?