-
Member
[Help][SL 9.2.7] Cast Aoe without circle pending
Hello, I encountered a problem after trying to call a aoe cast, after calling a function, if the right mouse button was pressed, so chracter perform turning instead of strafe
You can see it if you strafe and click aoe spell like Healing Rain, but if you doing it by macro /cast [@cursor] Healing Rain it will casted normally and you will continue to strafe
This is how i do it:
Code:
__int64 some() //(__int64)&dword_1437DF820
{
return (unsigned __int64)(Hook::baseAddress + 0x37DF820);
}
void Cast(int spellid, wGUID target) {
auto a2 = some();
return ((void(__fastcall*)(int, __int64, int, wGUID))(Hook::baseAddress + 0x178FEA0))(spellid, a2, 0, target);
}
Then i do CTM
I think that if there is a call through [@cursor] (calling from Lua_CastSpellByName), then there is a call to another cast function where coordinates are used, or i missing something.
Is it possible to do it without PacketSend by myself?
Last edited by Trogg; 07-20-2024 at 04:56 PM.
-
Member
When i looks at Lua_PlaceRaidMarker, it have "cursor"
Code:
__int64 j_GetInstanceDifficulty()
{
return (__int64)(Hook::baseAddress + 0x17CF7E0);
}
v11 = 0i64;
InstanceDifficulty = j_GetInstanceDifficulty(); // it is not difficulty?
v14 = 0i64;
v13 = 0i64;
v15 = 0;
*(_OWORD *)v16 = 0i64;
*(_OWORD *)v17 = 0i64;
v18 = 0i64;
if ( FrameScript::IsString() )
{
v5 = (unsigned __int8 *)FrameScript::ToLString(a1, 2u, 0i64);
v6 = sub_2379E0(v5, "cursor");
v7 = BYTE4(v14);
if ( !v6 ) // true for v5 == "cursor", v6 returns 0
v7 = 1;
BYTE4(v14) = v7;
}
target.low = 0i64;
spellId = dword_2DDF180[v4];
target.high = 0i64;
Spell_C::Cast(spellId, (castStruct *)&v11, 0i64, &target);// spellId, some, 0, target
struct sometypeAoe {
__int64 v20; //v11
__int64 v21; //InstanceDifficulty
char v23; //v14
__int64 v24; //v13
char v26; //v15
char v27; //v16
int v22; //v17
_int16 v18; //v18
wGUID v35; //figuring in other funcs as guid
};
void _CastAOE(wGUID target) {
sometypeAoe* data = new sometypeAoe{};
data->v20 = 0i64;
data->v21 = sub_17CF7E0();
data->v23 = 1; // from cursor check in Lua_PlaceRaidMarker
data->v24 = 0;
data->v26 = 0;
data->v35 = target;
((void(__fastcall*)(int, sometypeAoe*, int, wGUID))(Hook::baseAddress + 0x178D4E0))(34861, data, 0, 0);
delete data;
}
now, it casting on player position, dunno why not under cursor, but this method somehow affects the cast without confirmation by clicking
any tips to find cast at cursor arg and Vector3 position?
-
There is more than one way to send either right or left clicks. I'm pretty sure the one I'm using can both do movement and place cursor spells.
Code:
// CLICK PACKET
export struct click {
guid mover{}; // 0x0
vector3 location; // 0x10
unsigned int type{}; // 0x1C
};
// GAME OBJECTS
// ------------
// CLICK LOCATION
export int click_to(int64_t L) {
if (lua_gettop(L) > 4 || lua_gettop(L) < 3 || !lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) {
luaL_error(L, "Usage: C.Click(x, y, z [, leftClick])");
lua_pushnil(L);
return 1;
}
auto point = vector3((float) static_cast<float>(lua_tonumber(L, 1)), static_cast<float>(lua_tonumber(L, 2)), static_cast<float>(lua_tonumber(L, 3)));
auto left_click = lua_toboolean(L, 4);
click packet = { {0, 0}, point, 1 };
if (left_click)
packet.type = 4;
click_terrain(&packet);
return 1;
}
edit: something change this no longer does left click as expected
Last edited by Glitt; 08-03-2024 at 08:08 PM.
Reason: packet
-
Member
The question is not how to do left click to confirm (old method is to call Spell_C__Cast then Spell_C__HandleTerrainClick), but how to avoid this confirmation itself, otherwise it leads to partial loss of control over the character (described in the post) except when you use macro /cast [@cursor] for example
-
Originally Posted by
Trogg
The question is not how to do left click to confirm (old method is to call Spell_C__Cast then Spell_C__HandleTerrainClick), but how to avoid this confirmation itself, otherwise it leads to partial loss of control over the character (described in the post) except when you use macro /cast [@cursor] for example
At first, I didn't notice that the old method is no longer working as expected. I know you can use world to screen and post/send a mouse click there, but that is much less desirable than a lua solution.
-
Established Member
Originally Posted by
Trogg
The question is not how to do left click to confirm (old method is to call Spell_C__Cast then Spell_C__HandleTerrainClick), but how to avoid this confirmation itself, otherwise it leads to partial loss of control over the character (described in the post) except when you use macro /cast @
cursor] for example
I never looked into the @cursor, but I do my shit in lua. My spell cast for position ends with this:
Code:
local mouse_down = IsMouseButtonDown(2)
if mouse_down then MouselookStop() end
world.click_at(x, y, z)
if mouse_down then MouselookStart() end
Been doing that for a long time, before the cursor thing came out
-
Post Thanks / Like - 2 Thanks
Glitt,
Trogg (2 members gave Thanks to scizzydo for this useful post)