i use this to be able to click on position for all AOE spells
Code:
class TerrainClickData
{
public:
int64_t guid;
Vector3 pos;
int32_t click_type;
TerrainClickData(int64_t Guid, Vector3 vector3, int32_t _click_type = 0)
{
guid = Guid;
pos = vector3;
click_type = _click_type;
}
};
static int32_t CastOnTerrain(TerrainClickData* data)
{
return reinterpret_cast<int32_t(__cdecl*)(TerrainClickData*)>(0x80C340)(data);
}
function method
Code:
inline auto ClickOnPosition(int state)
{
int x = ToNumber(state, 1);
int y = ToNumber(state, 2);
int z = ToNumber(state, 3);
Vector3 pos;
pos.X = x;
pos.Y = y;
pos.Z = z;
if (!pos.Invalid())
{
auto Position = new TerrainClickData(0, pos);
Interact::CastOnTerrain(Position);
delete[] Position;
}
else
{
DisplayError(state, "the vector3 you added are invalid.");
}
FrameScriptPushNil(state);
return 0;
}
enjoy, if you need any help let me know.