New LUA Function: PerformCameraShake
Posted: Thu Nov 02, 2017 2:25 pm
this is a new lua funtion for a camera shake, i dont know what values do what yet, will add those later, values may be retrieved from ANAL
useage
PerformCameraShake(Spawn,52429,15948)
Param1 is the player
Param2 is the first value
Param3 is the second value
add this to void LuaInterface::RegisterFunctions(lua_State* state) {
in
LuaINterface.cpp
add this to LuaFunctions.h
add this to LuaFunctions.cpp
useage
PerformCameraShake(Spawn,52429,15948)
Param1 is the player
Param2 is the first value
Param3 is the second value
add this to void LuaInterface::RegisterFunctions(lua_State* state) {
in
LuaINterface.cpp
Code: Select all
lua_register(state, "PerformCameraShake", EQ2Emu_lua_PerformCameraShake);Code: Select all
int EQ2Emu_lua_PerformCameraShake(lua_State* state);Code: Select all
int EQ2Emu_lua_PerformCameraShake(lua_State* state){
if (!lua_interface)
return 0;
Client* client = 0;
Spawn* player = lua_interface->GetSpawn(state);
if (player->GetZone())
client = player->GetZone()->GetClientBySpawn(player);
if (!client){
lua_interface->LogError("LUA PerformCameraShake command error: could not find client");
return 0;
}
int16 value1 = lua_interface->GetInt16Value(state,2);
int16 value2 = lua_interface->GetInt16Value(state,3);
PacketStruct* packet = configReader.getStruct("WS_PerformCameraShakeMsg", client->GetVersion());
if (packet){
packet->setDataByName("unknown1", value1);
packet->setDataByName("unknown2", value2);
client->QueuePacket(packet->serialize());
safe_delete(packet);
}
return 0;
}