* -Exported additional entity IDs for dropped items to perl upon EVENT_CLICK_OBJECT (clicker_id) and EVENT_PLAYER_PICKUP ($picked_up_entity_id)

-Identified Size / SolidType fields in newer clients and properly exported it to EQEmu for use in UF, RoF, RoF2 via perl accessors. (Should work in LUA, no testing was done though for LUA)
-Added a sanity check for size to objects. Any size over 5000.f seems to crash the newer clients' graphical engines and PEQ has some containers filled in with bogus values.
-Added the ability to return a value on perl function EVENT_PLAYER_PICKUP which sends a fake dropped item ID to the client to generate the appropriate client response so the item can stay on the ground and not be 'picked up'. Should also work in LUA, didn't test LUA.
-Renamed unknown008 and unknown010 to size and solidtype respectively for objects.
This commit is contained in:
SecretsOTheP
2015-05-06 18:50:08 -04:00
parent 690274338d
commit 4a4a0c5e8b
8 changed files with 54 additions and 37 deletions
+23 -23
View File
@@ -8549,20 +8549,20 @@ void command_object(Client *c, const Seperator *sep)
od.object_type = atoi(row[7]);
icon = atoi(row[8]);
od.unknown008 = atoi(row[9]);
od.unknown010 = atoi(row[10]);
od.size = atoi(row[9]);
od.solidtype = atoi(row[10]);
od.unknown020 = atoi(row[11]);
switch (od.object_type) {
case 0: // Static Object
case staticType: // Static Object unlocked for changes
if (od.unknown008 == 0) // Unknown08 field is optional Size parameter for static objects
od.unknown008 = 100; // Static object default Size is 100%
if (od.size == 0) // Unknown08 field is optional Size parameter for static objects
od.size = 100; // Static object default Size is 100%
c->Message(0, "- STATIC Object (%s): id %u, x %.1f, y %.1f, z %.1f, h %.1f, model %s, "
"size %u, solidtype %u, incline %u",
(od.object_type == 0) ? "locked" : "unlocked", id, od.x, od.y, od.z,
od.heading, od.object_name, od.unknown008, od.unknown010, od.unknown020);
od.heading, od.object_name, od.size, od.solidtype, od.unknown020);
break;
case OT_DROPPEDITEM: // Ground Spawn
@@ -8620,10 +8620,10 @@ void command_object(Client *c, const Seperator *sep)
switch (od.object_type) {
case 0: // Static Object
if ((sep->argnum - col) > 3) {
od.unknown008 = atoi(sep->arg[4 + col]); // Size specified
od.size = atoi(sep->arg[4 + col]); // Size specified
if ((sep->argnum - col) > 4) {
od.unknown010 = atoi(sep->arg[5 + col]); // SolidType specified
od.solidtype = atoi(sep->arg[5 + col]); // SolidType specified
if ((sep->argnum - col) > 5)
od.unknown020 = atoi(sep->arg[6 + col]); // Incline specified
@@ -8922,16 +8922,16 @@ void command_object(Client *c, const Seperator *sep)
return;
}
od.unknown008 = atoi(sep->arg[4]);
od.size = atoi(sep->arg[4]);
o->SetObjectData(&od);
if (od.unknown008 == 0) // 0 == unspecified == 100%
od.unknown008 = 100;
if (od.size == 0) // 0 == unspecified == 100%
od.size = 100;
c->Message(0, "Static Object %u set to %u%% size. Size will take effect when you commit to the "
"database with '#object Save', after which the object will be unchangeable until "
"you unlock it again with '#object Edit' and zone out and back in.",
id, od.unknown008);
id, od.size);
} else if (strcmp(sep->arg[3], "solidtype") == 0) {
if (od.object_type != staticType) {
@@ -8946,13 +8946,13 @@ void command_object(Client *c, const Seperator *sep)
return;
}
od.unknown010 = atoi(sep->arg[4]);
od.solidtype = atoi(sep->arg[4]);
o->SetObjectData(&od);
c->Message(0, "Static Object %u set to SolidType %u. Change will take effect when you commit "
"to the database with '#object Save'. Support for this property is on a "
"per-model basis, mostly seen in smaller objects such as chests and tables.",
id, od.unknown010);
id, od.solidtype);
} else if (strcmp(sep->arg[3], "icon") == 0) {
if ((od.object_type < 2) || (od.object_type == staticType)) {
@@ -9239,24 +9239,24 @@ void command_object(Client *c, const Seperator *sep)
"unknown08 = %u, unknown10 = %u, unknown20 = %u "
"WHERE ID = %u",
zone->GetZoneID(), zone->GetInstanceVersion(), od.x, od.y, od.z,
od.heading, od.object_name, od.object_type, icon, od.unknown008,
od.unknown010, od.unknown020, id);
od.heading, od.object_name, od.object_type, icon, od.size,
od.solidtype, od.unknown020, id);
else if (id == 0)
query = StringFormat("INSERT INTO object "
"(zoneid, version, xpos, ypos, zpos, heading, objectname, "
"type, icon, unknown08, unknown10, unknown20) "
"VALUES (%u, %u, %.1f, %.1f, %.1f, %.1f, '%s', %u, %u, %u, %u, %u)",
zone->GetZoneID(), zone->GetInstanceVersion(), od.x, od.y, od.z,
od.heading, od.object_name, od.object_type, icon, od.unknown008,
od.unknown010, od.unknown020);
od.heading, od.object_name, od.object_type, icon, od.size,
od.solidtype, od.unknown020);
else
query = StringFormat("INSERT INTO object "
"(id, zoneid, version, xpos, ypos, zpos, heading, objectname, "
"type, icon, unknown08, unknown10, unknown20) "
"VALUES (%u, %u, %u, %.1f, %.1f, %.1f, %.1f, '%s', %u, %u, %u, %u, %u)",
id, zone->GetZoneID(), zone->GetInstanceVersion(), od.x, od.y, od.z,
od.heading, od.object_name, od.object_type, icon, od.unknown008,
od.unknown010, od.unknown020);
od.heading, od.object_name, od.object_type, icon, od.size,
od.solidtype, od.unknown020);
results = database.QueryDatabase(query);
if (!results.Success()) {
@@ -9314,12 +9314,12 @@ void command_object(Client *c, const Seperator *sep)
memcpy(door.dest_zone, "NONE", 5);
if ((door.size = od.unknown008) == 0) // unknown08 = optional size percentage
if ((door.size = od.size) == 0) // unknown08 = optional size percentage
door.size = 100;
switch (
door.opentype =
od.unknown010) // unknown10 = optional request_nonsolid (0 or 1 or experimental number)
od.solidtype) // unknown10 = optional request_nonsolid (0 or 1 or experimental number)
{
case 0:
door.opentype = 31;
@@ -9576,8 +9576,8 @@ void command_object(Client *c, const Seperator *sep)
strn0cpy(od.object_name, row[4], sizeof(od.object_name));
od.object_type = atoi(row[5]);
icon = atoi(row[6]);
od.unknown008 = atoi(row[7]);
od.unknown010 = atoi(row[8]);
od.size = atoi(row[7]);
od.solidtype = atoi(row[8]);
od.unknown020 = atoi(row[9]);
if (od.object_type == 0)