PDA

View Full Version : 6.2 bugfix: Special Attacks on pvp servers!


Dakaar
10-08-2005, 08:21 PM
Hey folks, I started a thread in the support forum but I solved my own problem..... sooo here goes =P

The client does not send a special attack packet if the client does not see that it can attack a player. Ergo If you try to kick a person with a blue name on a pvp server, the client never even sends the packet.

As far as i know, we do not know the pvp value in the current spawn_struct

Hopefully a dev will come in and correct me, but untill then!

in entity.cpp:

change this function!

void EntityList::SendZoneSpawnsBulk(Client* client)
{
//float rate = client->Connection()->GetDataRate();
LinkedListIterator<Mob*> iterator(mob_list);
NewSpawn_Struct ns;
Mob *spawn;
int32 maxspawns=100;

//rate = rate > 1.0 ? (rate < 10.0 ? rate : 10.0) : 1.0;
//maxspawns = (int32)rate * SPAWNS_PER_POINT_DATARATE; // FYI > 10240 entities will cause BulkZoneSpawnPacket to throw exception
if(maxspawns > mob_list.Count())
maxspawns = mob_list.Count();
BulkZoneSpawnPacket* bzsp = new BulkZoneSpawnPacket(client, maxspawns);
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance())
{
spawn = iterator.GetData();
if(spawn && spawn->InZone())
{
if(spawn->IsClient() && spawn->CastToClient()->GMHideMe(client))
continue;
memset(&ns, 0, sizeof(NewSpawn_Struct));
spawn->FillSpawnStruct(&ns, client);
bzsp->AddSpawn(&ns);
+ if(spawn->IsClient())
+ spawn->SendAppearancePacket(AT_PVP, spawn->CastToClient()->GetPVP(),true,true);

}
}
safe_delete(bzsp);
}

in client_packet.cpp around line 5794.
change the IsPVPZone() if statement to read like this:

if(zone->IsPVPZone())
SetPVP(true);

changing m_pp.pvp =1, to SetPVP(true);, this makes it so that your character appears red to itself.


Add also the change in the post below this one, and your players should be 'red' under all circumstances.

Peace 8)

Dakaar
10-08-2005, 08:37 PM
Simpler solution I ended up going with :

in mob.cpp


void Mob::CreateSpawnPacket(EQZonePacket* app, Mob* ForWho) {
app->SetOpcode(OP_NewSpawn);
app->size = sizeof(NewSpawn_Struct);
app->pBuffer = new uchar[app->size];
memset(app->pBuffer, 0, app->size);
NewSpawn_Struct* ns = (NewSpawn_Struct*)app->pBuffer;
FillSpawnStruct(ns, ForWho);
+if(IsClient())
+CastToClient()->SendAppearancePacket(AT_PVP,CastToClient()->GetPVP(),true,true);
}

This + the modified sendzonespawnsbulk() function will cover 100% of instances where a client is sent another client's spawn info.

Magoth78
10-19-2005, 08:47 AM
That would be cool to have thoses PvP changes in the cvs codes, any chance?


Mag