Page 1 of 2

NPC Stealth

PostPosted: Fri Sep 18, 2009 10:56 am
by Dinberg
It seems that NPC stealth packet does not produce the dark-grey transparent stealth form on npcs. I'm on either 1.95 or 1.98, but the mob doesn't appear shadowy.

Has anyone else used this flag before? I'm guessing somewhere it might not be correctly sent. Anyone know of a cure?

Re: NPC Stealth

PostPosted: Fri Sep 18, 2009 11:10 am
by Graveen
/summon Dunn !!

Re: NPC Stealth

PostPosted: Fri Sep 18, 2009 11:26 am
by Roozzz
Not working and never seen it working.

And we need a packet guy indeed ;)

Re: NPC Stealth

PostPosted: Fri Sep 18, 2009 11:28 am
by Graveen
Dunnerholl is our packet guy ! YAY !

Re: NPC Stealth

PostPosted: Fri Sep 18, 2009 4:24 pm
by Dunnerholl
i think there was some flagchange. can u post the packet that should have the flag set?

Re: NPC Stealth

PostPosted: Fri Sep 18, 2009 4:29 pm
by Kakuri
This hasn't worked in DOL for a long time - I first tried almost a year ago and have never got it to work, so I don't believe it's related to recent clients.

Re: NPC Stealth

PostPosted: Sat Sep 19, 2009 4:12 pm
by Dinberg
Hmm it be sent incorrectly somewhere. What mobs do you know of that stealth?

Re: NPC Stealth

PostPosted: Sat Sep 19, 2009 6:06 pm
by Tolakram
Urchin ambusher (I think that's the name) in Alb SI.

Re: NPC Stealth

PostPosted: Sat Sep 19, 2009 6:46 pm
by Kakuri
Trall the Trickster in Laby looks stealthed.

Re: NPC Stealth

PostPosted: Sat Sep 19, 2009 8:44 pm
by Dunnerholl
will u post how u try it finally?

i think u need to send a 0x4c visual update with mob stealth flag or the 0xda with stealthflag. did u try any of those?

Re: NPC Stealth

PostPosted: Sun Sep 20, 2009 11:38 am
by Dinberg
I havn't had time to return to it as of yet. I will update you if I can

Re: NPC Stealth

PostPosted: Sun Sep 20, 2009 4:20 pm
by Kakuri
PacketLib171.cs, starting at line 160:
Code: Select all
byte flags = (byte)(GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, npc) << 6);
if ((npc.Flags & (uint)GameNPC.eFlags.TRANSPARENT) != 0) flags |= 0x01;
if (npc.Inventory != null) flags |= 0x02; //If mob has equipment, then only show it after the client gets the 0xBD packet
if ((npc.Flags & (uint)GameNPC.eFlags.PEACE) != 0) flags |= 0x10;
if ((npc.Flags & (uint)GameNPC.eFlags.FLYING) != 0) flags |= 0x20;


pak.WriteByte(flags);
pak.WriteByte(0x20); //TODO this is the default maxstick distance

string add = "";
byte flags2 = 0x00;
IControlledBrain brain = npc.Brain as IControlledBrain;
if (m_gameClient.Version >= GameClient.eClientVersion.Version187)
{
if (brain != null)
{
flags2 |= 0x80; // have Owner
}
}
if ((npc.Flags & (uint)GameNPC.eFlags.CANTTARGET) != 0)
if (m_gameClient.Account.PrivLevel > 1) add += "-DOR"; // indicates DOR flag for GMs
else flags2 |= 0x01;
if ((npc.Flags & (uint)GameNPC.eFlags.DONTSHOWNAME) != 0)
if (m_gameClient.Account.PrivLevel > 1) add += "-NON"; // indicates NON flag for GMs
else flags2 |= 0x02;
if ((npc.Flags & (uint)GameNPC.eFlags.TRANSPARENT) != 0) flags2 |= 0x04;
if( npc.ShowQuestIndicator( m_gameClient.Player ) ) flags2 |= 0x08;
I tried "flags |= 0x4c" and "flags |= 0xda" and it did nothing. "flags2 |= 0xda" removes the NPC's name and adds a quest indicator icon over its head.

"flags2 |= 0x4c" makes the NPC stealthed! Yay! But it also adds a quest indicator, and the name remains. (Interestingly, the quest indicator is stealthed, so it's a spinning blue icon.)

So how do I make it so the NPC is just stealthed, no quest indicator?

Re: NPC Stealth

PostPosted: Sun Sep 20, 2009 4:29 pm
by Kakuri
Well, 0x4c minus 0x08 (quest indicator) = 0x44, which works great!

Now it would be wicked to add player-like stealth for mobs so they could be completely invisible at a distance, and only become visible at very close range, also dropping stealth once they enter combat.

Re: NPC Stealth

PostPosted: Sun Sep 20, 2009 4:53 pm
by Graveen
yay !

Re: NPC Stealth

PostPosted: Sun Sep 20, 2009 5:33 pm
by Dinberg
Now it would be wicked to add player-like stealth for mobs so they could be completely invisible at a distance, and only become visible at very close range, also dropping stealth once they enter combat.
Oh no kakuri, you've got me :D

Awesome work!

Have you updated the svn to use these changes? ^^