Design: Stealth/invis

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Design: Stealth/invis

Post by thefoof » Fri Aug 09, 2013 3:14 am

Just posting some design ideas for stealth abilities for later =).

1. Add stealth, invis, see stealth and see invis bool values to entities in the info struct

2. Add a check in the vis packet to check stealth/invis, set visual_flag as 1 if either are true; also force crouching while stealthed.

3. Add a (zoneserver iterator?) to check if spawns are either grey, or if a player has see-invis/stealth, add spawn access to players that meet these requirements only - friendly players should show regardless(ex: not a hostile pvp faction)

4. Add a see invis/stealth check for mob agro (could possibly just make this part of the spawn access check - not entirely sure how mobs will behave without access to a player)

5. Add an lua function to set stealthed/invis and another for the visions

6. While invis or stealthed set speed to whatever that spawn's stealth speed is set to (default is 0)

7. Finally add a check for if a player either casts, or gets attacked to cancel stealth/invis.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Design: Stealth/invis

Post by thefoof » Fri Aug 09, 2013 10:38 pm

Okay I implemented some of this today. Here's some new lua functions, I'll document them properly in the next couple of days:

Stealth(Spawn, type) where spawn is the spawn to be stealthed, type is the type of stealth (1 = stealth anything else is invis)

IsInvis(Spawn) returns a true or false if the spawn is invis or not.

IsStealthed(Spawn) returns a true or false if the spawn is stealthed or not.

I got NPCs to crouch while stealthed but I couldn't figure out how to do this for players. I haven't even touched the aggro or spawn access portions of this yet.

Being damaged by DamageSpawn(), using an auto attack or casting will also break stealth/invis.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Design: Stealth/invis

Post by Jabantiz » Mon Aug 19, 2013 5:22 pm

thefoof wrote:I got NPCs to crouch while stealthed but I couldn't figure out how to do this for players.
You need to send a server control flag packet to force the player to crouch, I just put that packet into its own function to make it easier to use. So to get the player to crouch you would need to add the following to the lua function

Code: Select all

Client* client = spawn->GetZone()->GetClientBySpawn(spawn);
if (client)
    ClientPacketFunctions::SendServerControlFlags(client, 2, 2, 1);
To cancel the crouch you will need to send

Code: Select all

ClientPacketFunctions::SendServerControlFlags(client, 2, 2, 0);
This works just like the lua function SetServerControlFlag()

All known values for the server control packet are listed in the function in ClientPacketFunctions.cpp

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Design: Stealth/invis

Post by thefoof » Mon Aug 19, 2013 5:24 pm

Yeah I actually tried sending that packet but the players were able to cancel the crouch. Where on live it's forced (I believe?) Guess I should confirm that

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests