Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] mob->AppearanceEffects improved functionality. #1821

Merged
merged 10 commits into from Nov 27, 2021

Conversation

KayenEQ
Copy link
Contributor

@KayenEQ KayenEQ commented Nov 24, 2021

Credit to Natedog who figured out what extra parameters actually did!

SendAppearanceEffect packet has 3 different parameters, with up to 5 different effects per packet
parm1 = graphic animation
parm1slot (formerly parm1a) = location on body of the graphic animation
0 = pelvis1
1 = pelvis2
2 = helm
3 = Offhand
4 = Mainhand
5 = left foot
6 = right foot
9 = Face
parm1ground (formerly parm1b) = place graphic on the ground. If this is set and and slot > 0, it will follow the mob and be removed upon zoning/death, if slot set to zero it will be perma set to be on ground in that location

Original Perl function Mob->SendAppearanceEffect has been expanded to accept slot and ground parameters

Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null]), [uint32 value1slot = 1], [uint32 value1ground = 1], [uint32 value2slot = 1], [uint32 value2ground = 1], [uint32 value3slot = 1], [uint32 value3ground = 1], [uint32 value4slot = 1], [uint32 value4ground = 1], [uint32 value5slot = 1], [uint32 value5ground = 1]")

Example: $client->SendAppearanceEffect(8,10,27,28,31,0, 1,0,2,0,3,0,4,0,5,0);

This will send 5 different graphics, with id 8 going to pelvis, id 10 going to helm, id 27 going to off hand, id 28 going to main hand, id 31 going to left foot.

New Perl functions added for simple use cases for just sending effects that go on the mob, and just sending effects that go on the ground.

Usage: Mob::SendAppearanceEffectActor(THIS, int32 param_1, uint32 value1slot = 0, [int32 param_2 = 0] [uint32 value2slot = 0], [int32 param_3 = 0] [uint32 value3slot = 0], [int32 param_4 = 0] [uint32 value4slot = 0], [int32 param_5 = 0], [uint32 value5slot = 0], [Client* single_client_to_send_to = null])");

Example $client->SendAppearanceEffectActor(8, 9) ... can add up to 5 effects
Send effect id 8 to helm,

Usage: Mob::SendAppearanceEffectGround(THIS, int32 param_1, uint32 value1slot = 1, [int32 param_2 = 0] [uint32 value2slot = 1], [int32 param_3 = 0] [uint32 value3slot = 1], [int32 param_4 = 0] [uint32 value4slot = 1], [int32 param_5 = 0], [uint32 value5slot = 1], [Client* single_client_to_send_to = null])

Example $client->SendAppearanceEffectGround(100, 0) ... can add up to 5 effects
Send effect id 100 to the ground permanently,

Example $client->SendAppearanceEffectGround(100, 1) ... can add up to 5 effects
Send effect id 100 to the ground around the mob, which will be removed when mob zones or dies.

11/26 Added perl method that can be used to remove the AppearanceEffect from a character without them die/zoning.
"Usage: Mob::RemoveAllAppearanceEffects(THIS)");
Be aware anything that sends an illusion packet will remove an ApperanceEffect.

Note: Many appearance effects are only temporary and can't be used as permanent.
Note: I do not personally intend to add support to lua, anyone who is capable is more than welcome to do so.

@Kinglykrab
Copy link
Contributor

Kinglykrab commented Nov 24, 2021

Maybe we could make use of a hash for the Perl methods similar to expedition stuff and summoning bagged items?

Edit: By this I mean take in a hash for the effect values that is variable length and defaults the values otherwise.

Could also convert the send appearance method to take in a custom data structure so it doesn’t have nearly 20 parameters.

@KayenEQ
Copy link
Contributor Author

KayenEQ commented Nov 25, 2021

The two new functions are very straight forward and do not require a ton of parameters. For normal usage you would likely only use 2 parameters in the function. Not a ton of situations where you need to send 5 different effect ids. It's not worth over complicating. The one that has 16 parameters now in it would really be only for advanced use cases.

@Kinglykrab
Copy link
Contributor

Sounds good to me. Just wanted to make sure it’s not a normal use case to have all 17 parameters.

@Kinglykrab
Copy link
Contributor

Maybe we can give the Perl croaks more verbose descriptions of the parameters. Like effect1, effect_slot1, etc.

@KayenEQ
Copy link
Contributor Author

KayenEQ commented Nov 25, 2021

Good idea. Did it.

zone/perl_mob.cpp Outdated Show resolved Hide resolved
perl method RemoveAppearanceEffect to remove the apperanceeffect
@KayenEQ
Copy link
Contributor Author

KayenEQ commented Nov 26, 2021

Update added perl function that can be used to remove the AppearanceEffect

@Kinglykrab
Copy link
Contributor

Should it be called RemoveAllAppearanceEffects or something since you can't remove a singular effect?

@Natedog2012
Copy link
Contributor

Should it be called RemoveAllAppearanceEffects or something since you can't remove a singular effect?

Sounds like a reasonable change after that this seems really close to merge?

@Kinglykrab
Copy link
Contributor

Should it be called RemoveAllAppearanceEffects or something since you can't remove a singular effect?

Sounds like a reasonable change after that this seems really close to merge?

Yeah, absolutely ready for merge after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants