Page 1 of 1

New LUA Function: PerformCameraShake

Posted: Thu Nov 02, 2017 2:25 pm
by Ememjr
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

Code: Select all

lua_register(state, "PerformCameraShake", EQ2Emu_lua_PerformCameraShake);
add this to LuaFunctions.h

Code: Select all

int	EQ2Emu_lua_PerformCameraShake(lua_State* state);
add this to LuaFunctions.cpp

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;
}

Re: New LUA Function: PerformCameraShake

Posted: Thu Jul 05, 2018 2:18 pm
by Ememjr
hmm Apparently this never got added to the code, way back when i was not able to commit

Re: New LUA Function: PerformCameraShake

Posted: Thu Jul 05, 2018 9:05 pm
by Jabantiz
That would just be me completely forgetting to do it, sorry.

As you have commit rights now feel free to add it to dev svn.

Re: New LUA Function: PerformCameraShake

Posted: Mon Mar 11, 2019 2:01 pm
by Ememjr
this has finally been committed