|
@@ -10628,59 +10628,8 @@ void Commands::Command_Test(Client* client, EQ2_16BitString* command_parms) {
|
|
|
else if (atoi(sep->arg[0]) == 27) {
|
|
|
Spawn* target = client->GetPlayer()->GetTarget();
|
|
|
PacketStruct* packet2 = configReader.getStruct("WS_HearSimpleDamage", client->GetVersion());
|
|
|
- if (packet2 && target && sep->IsSet(2)) {
|
|
|
- packet2->setSubstructDataByName("header", "defender", client->GetPlayer()->GetIDWithPlayerSpawn(target));
|
|
|
- packet2->setSubstructDataByName("header", "defender_proxy", client->GetPlayer()->GetIDWithPlayerSpawn(target));
|
|
|
- packet2->setSubstructDataByName("header", "attacker", client->GetPlayer()->GetIDWithPlayerSpawn(client->GetPlayer()));
|
|
|
- packet2->setArrayLengthByName("num_dmg", 1);
|
|
|
- packet2->setArrayDataByName("damage_type", atoi(sep->arg[1]));
|
|
|
- packet2->setArrayDataByName("damage", atoi(sep->arg[2]));
|
|
|
- packet2->setDataByName("spell", 1);
|
|
|
- packet2->setDataByName("spell_name", "Testing");
|
|
|
- EQ2Packet* app = packet2->serialize();
|
|
|
- if (sep->IsSet(4)) {
|
|
|
- int16 offset = atoi(sep->arg[3]);
|
|
|
- uchar* ptr2 = app->pBuffer;
|
|
|
- ptr2 += offset;
|
|
|
- if (sep->IsNumber(4)) {
|
|
|
- int32 value1 = atol(sep->arg[4]);
|
|
|
- if (value1 > 0xFFFF)
|
|
|
- memcpy(ptr2, (uchar*)&value1, 4);
|
|
|
- else if (value1 > 0xFF)
|
|
|
- memcpy(ptr2, (uchar*)&value1, 2);
|
|
|
- else
|
|
|
- memcpy(ptr2, (uchar*)&value1, 1);
|
|
|
- }
|
|
|
- else {
|
|
|
- int8 len = strlen(sep->arg[4]);
|
|
|
- memcpy(ptr2, (uchar*)&len, 1);
|
|
|
- ptr2 += 1;
|
|
|
- memcpy(ptr2, sep->arg[4], len);
|
|
|
- }
|
|
|
- }
|
|
|
- if (sep->IsSet(6)) {
|
|
|
- int16 offset = atoi(sep->arg[5]);
|
|
|
- uchar* ptr2 = app->pBuffer;
|
|
|
- ptr2 += offset;
|
|
|
- if (sep->IsNumber(6)) {
|
|
|
- int32 value1 = atol(sep->arg[6]);
|
|
|
- if (value1 > 0xFFFF)
|
|
|
- memcpy(ptr2, (uchar*)&value1, 4);
|
|
|
- else if (value1 > 0xFF)
|
|
|
- memcpy(ptr2, (uchar*)&value1, 2);
|
|
|
- else
|
|
|
- memcpy(ptr2, (uchar*)&value1, 1);
|
|
|
- }
|
|
|
- else {
|
|
|
- int8 len = strlen(sep->arg[6]);
|
|
|
- memcpy(ptr2, (uchar*)&len, 1);
|
|
|
- ptr2 += 1;
|
|
|
- memcpy(ptr2, sep->arg[6], len);
|
|
|
- }
|
|
|
- }
|
|
|
- DumpPacket(app);
|
|
|
- client->QueuePacket(app);
|
|
|
- safe_delete(packet2);
|
|
|
+ if (packet2 && target && sep->IsSet(4)) {
|
|
|
+ client->GetPlayer()->GetZone()->SendDamagePacket(client->GetPlayer(), target, atoul(sep->arg[1]), atoul(sep->arg[2]), atoul(sep->arg[3]), atoul(sep->arg[4]), sep->arg[5] != nullptr ? sep->arg[5] : "");
|
|
|
}
|
|
|
}
|
|
|
else if (atoi(sep->arg[0]) == 28 && sep->IsNumber(1)) {
|