mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Features] Appearance Effects will now be sent to clients upon zone in. GM commands. (#1874)
* start * working * Update perl_mob.cpp * updates * Update perl_mob.cpp * illusion behavior * rework start * fix later * Update mob.cpp * rework * updates * Update mob.cpp * update * gm command updates * updates * Update CMakeLists.txt * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. remove debugs * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. perl fix * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. space fix * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. minor fix * Update CMakeLists.txt * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. cleaned up some inconsistency * [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
This commit is contained in:
+84
-2
@@ -480,6 +480,11 @@ Mob::Mob(
|
||||
Vulnerability_Mod[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) {
|
||||
appearance_effects_id[i] = 0;
|
||||
appearance_effects_slot[i] = 0;
|
||||
}
|
||||
|
||||
emoteid = 0;
|
||||
endur_upkeep = false;
|
||||
degenerating_effects = false;
|
||||
@@ -2385,7 +2390,8 @@ void Mob::SendIllusionPacket(
|
||||
uint32 in_drakkin_heritage,
|
||||
uint32 in_drakkin_tattoo,
|
||||
uint32 in_drakkin_details,
|
||||
float in_size
|
||||
float in_size,
|
||||
bool send_appearance_effects
|
||||
)
|
||||
{
|
||||
uint8 new_texture = in_texture;
|
||||
@@ -2494,6 +2500,10 @@ void Mob::SendIllusionPacket(
|
||||
/* Refresh armor and tints after send illusion packet */
|
||||
SendArmorAppearance();
|
||||
|
||||
if (send_appearance_effects) {
|
||||
SendSavedAppearenceEffects(nullptr);
|
||||
}
|
||||
|
||||
LogSpells(
|
||||
"Illusion: Race [{}] Gender [{}] Texture [{}] HelmTexture [{}] HairColor [{}] BeardColor [{}] EyeColor1 [{}] EyeColor2 [{}] HairStyle [{}] Face [{}] DrakkinHeritage [{}] DrakkinTattoo [{}] DrakkinDetails [{}] Size [{}]",
|
||||
race,
|
||||
@@ -2869,7 +2879,7 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32
|
||||
6 = right foot
|
||||
9 = Face
|
||||
|
||||
value#ground = 1, will place the effect on ground, of corresponding slot is set to 0 effect is permanenant, if > 0 will fade if mob death/despawn.
|
||||
value#ground = 1, will place the effect on ground, this is permanenant
|
||||
*/
|
||||
|
||||
//higher values can crash client
|
||||
@@ -2892,6 +2902,22 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32
|
||||
value5slot = 1;
|
||||
}
|
||||
|
||||
if (!value1ground && parm1) {
|
||||
SetAppearenceEffects(value1slot, parm1);
|
||||
}
|
||||
if (!value2ground && parm2) {
|
||||
SetAppearenceEffects(value2slot, parm2);
|
||||
}
|
||||
if (!value3ground && parm3) {
|
||||
SetAppearenceEffects(value3slot, parm3);
|
||||
}
|
||||
if (!value4ground && parm4) {
|
||||
SetAppearenceEffects(value4slot, parm4);
|
||||
}
|
||||
if (!value5ground && parm5) {
|
||||
SetAppearenceEffects(value5slot, parm5);
|
||||
}
|
||||
|
||||
LevelAppearance_Struct* la = (LevelAppearance_Struct*)outapp->pBuffer;
|
||||
la->spawn_id = GetID();
|
||||
la->parm1 = parm1;
|
||||
@@ -2920,6 +2946,62 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Mob::SetAppearenceEffects(int32 slot, int32 value)
|
||||
{
|
||||
for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) {
|
||||
if (!appearance_effects_id[i]) {
|
||||
appearance_effects_id[i] = value;
|
||||
appearance_effects_slot[i] = slot;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::GetAppearenceEffects()
|
||||
{
|
||||
//used with GM command
|
||||
if (!appearance_effects_id[0]) {
|
||||
Message(Chat::Red, "No Appearance Effects exist on this mob");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) {
|
||||
Message(Chat::Red, "ID: %i :: App Effect ID %i :: Slot %i", i, appearance_effects_id[i], appearance_effects_slot[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::ClearAppearenceEffects()
|
||||
{
|
||||
for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) {
|
||||
appearance_effects_id[i] = 0;
|
||||
appearance_effects_slot[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::SendSavedAppearenceEffects(Client *receiver = nullptr)
|
||||
{
|
||||
if (!appearance_effects_id[0]) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (appearance_effects_id[0]) {
|
||||
SendAppearanceEffect(appearance_effects_id[0], appearance_effects_id[1], appearance_effects_id[2], appearance_effects_id[3], appearance_effects_id[4], receiver,
|
||||
appearance_effects_slot[0], 0, appearance_effects_slot[1], 0, appearance_effects_slot[2], 0, appearance_effects_slot[3], 0, appearance_effects_slot[4], 0);
|
||||
}
|
||||
if (appearance_effects_id[5]) {
|
||||
SendAppearanceEffect(appearance_effects_id[5], appearance_effects_id[6], appearance_effects_id[7], appearance_effects_id[8], appearance_effects_id[9], receiver,
|
||||
appearance_effects_slot[5], 0, appearance_effects_slot[6], 0, appearance_effects_slot[7], 0, appearance_effects_slot[8], 0, appearance_effects_slot[9], 0);
|
||||
}
|
||||
if (appearance_effects_id[10]) {
|
||||
SendAppearanceEffect(appearance_effects_id[10], appearance_effects_id[11], appearance_effects_id[12], appearance_effects_id[13], appearance_effects_id[14], receiver,
|
||||
appearance_effects_slot[10], 0, appearance_effects_slot[11], 0, appearance_effects_slot[12], 0, appearance_effects_slot[13], 0, appearance_effects_slot[14], 0);
|
||||
}
|
||||
if (appearance_effects_id[15]) {
|
||||
SendAppearanceEffect(appearance_effects_id[15], appearance_effects_id[16], appearance_effects_id[17], appearance_effects_id[18], appearance_effects_id[19], receiver,
|
||||
appearance_effects_slot[15], 0, appearance_effects_slot[16], 0, appearance_effects_slot[17], 0, appearance_effects_slot[18], 0, appearance_effects_slot[19], 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::SendTargetable(bool on, Client *specific_target) {
|
||||
auto outapp = new EQApplicationPacket(OP_Untargetable, sizeof(Untargetable_Struct));
|
||||
Untargetable_Struct *ut = (Untargetable_Struct*)outapp->pBuffer;
|
||||
|
||||
Reference in New Issue
Block a user