mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-04 15:43:52 +00:00
Zoning into a new zone did not properly display PCs with tree/object illusions
and NPCs wearing gear in non-weapon slots. The illusion thing: Not sure why, but te opcode for BulkZoneSpawn doesn't display the tree/object illusions. I did notice that even OP_Illusion gets rejected by the client if sent before Client_Ready. Maybe that is why. The BULKSpawns cannot be sent that late, I tried moving it in the sequence but it never did the illusions correctly, at any point. So, we new new the single spawn OP code for PCs with those illusions. This works. The NPC gear thing. Same story with BulkZoneSpawn, Not sure why. The data is sent correctly. So now we update the client zoning in (only them) with what the NPCs are wearing. Every othe client already is up to date.
This commit is contained in:
parent
94d118fdf8
commit
a5872b165f
@ -47,6 +47,8 @@
|
||||
#define IKSAR 128
|
||||
#define VAHSHIR 130
|
||||
#define CONTROLLED_BOAT 141
|
||||
#define MINOR_ILL_OBJ 142
|
||||
#define TREE 143
|
||||
#define IKSAR_SKELETON 161
|
||||
#define FROGLOK 330
|
||||
#define FROGLOK2 74 // Not sure why /who all reports race as 74 for frogloks
|
||||
|
||||
@ -1149,19 +1149,50 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
|
||||
NewSpawn_Struct ns;
|
||||
Mob *spawn;
|
||||
uint32 maxspawns = 100;
|
||||
EQApplicationPacket *app;
|
||||
|
||||
if (maxspawns > mob_list.size())
|
||||
maxspawns = mob_list.size();
|
||||
BulkZoneSpawnPacket *bzsp = new BulkZoneSpawnPacket(client, maxspawns);
|
||||
|
||||
int32 race=-1;
|
||||
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
|
||||
spawn = it->second;
|
||||
if (spawn && spawn->InZone()) {
|
||||
if (spawn->IsClient() && (spawn->CastToClient()->GMHideMe(client) ||
|
||||
spawn->CastToClient()->IsHoveringForRespawn()))
|
||||
continue;
|
||||
memset(&ns, 0, sizeof(NewSpawn_Struct));
|
||||
spawn->FillSpawnStruct(&ns, client);
|
||||
bzsp->AddSpawn(&ns);
|
||||
|
||||
race = spawn->GetRace();
|
||||
|
||||
// Illusion races on PCs don't work as a mass spawn
|
||||
// But they will work as an add_spawn AFTER CLIENT_CONNECTED.
|
||||
if (spawn->IsClient() && (race == MINOR_ILL_OBJ || race == TREE)) {
|
||||
app = new EQApplicationPacket;
|
||||
spawn->CreateSpawnPacket(app);
|
||||
client->QueuePacket(app, true, Client::CLIENT_CONNECTED);
|
||||
safe_delete(app);
|
||||
}
|
||||
else {
|
||||
memset(&ns, 0, sizeof(NewSpawn_Struct));
|
||||
spawn->FillSpawnStruct(&ns, client);
|
||||
bzsp->AddSpawn(&ns);
|
||||
}
|
||||
|
||||
// On NPCs wearing gear from loottable or previously traded
|
||||
// to them, mass spawn does not properly update the visual look.
|
||||
// (Bulk packet sends the same info - client just doesn't use it.
|
||||
// except on primary/secondary - tested on multiple client types)
|
||||
// Do that using a Wear Change now.
|
||||
if (!spawn->IsClient()) {
|
||||
const Item_Struct *item;
|
||||
for (int i=0; i< 7 ; ++i) {
|
||||
item=database.GetItem(spawn->GetEquipment(i));
|
||||
if (item != 0) {
|
||||
spawn->SendWearChange(i,client);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
safe_delete(bzsp);
|
||||
|
||||
12
zone/mob.cpp
12
zone/mob.cpp
@ -2540,7 +2540,7 @@ uint32 NPC::GetEquipment(uint8 material_slot) const
|
||||
return equipment[invslot];
|
||||
}
|
||||
|
||||
void Mob::SendWearChange(uint8 material_slot)
|
||||
void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
||||
{
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
|
||||
WearChange_Struct* wc = (WearChange_Struct*)outapp->pBuffer;
|
||||
@ -2552,7 +2552,15 @@ void Mob::SendWearChange(uint8 material_slot)
|
||||
wc->color.Color = GetEquipmentColor(material_slot);
|
||||
wc->wear_slot_id = material_slot;
|
||||
|
||||
entity_list.QueueClients(this, outapp);
|
||||
if (!one_client)
|
||||
{
|
||||
entity_list.QueueClients(this, outapp);
|
||||
}
|
||||
else
|
||||
{
|
||||
one_client->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
|
||||
}
|
||||
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ public:
|
||||
void SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5,
|
||||
Client *specific_target=nullptr);
|
||||
void SendTargetable(bool on, Client *specific_target = nullptr);
|
||||
virtual void SendWearChange(uint8 material_slot);
|
||||
virtual void SendWearChange(uint8 material_slot, Client *one_client = nullptr);
|
||||
virtual void SendTextureWC(uint8 slot, uint16 texture, uint32 hero_forge_model = 0, uint32 elite_material = 0,
|
||||
uint32 unknown06 = 0, uint32 unknown18 = 0);
|
||||
virtual void SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user