Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2008, 09:36 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default Sneaking and Hiding NPCs?

Question: is it posible to tell npc to hide or sneak? Specialy if they rogues by class?

I know that giving npc air elemental spells will make it cast invis on itself, but is there any other way?

I belive there were some hiding rogues in Dulak Harbor on Guntak they would suddenly appear and attack. On other hand they could have been just trigered trap-spawns

Overall it woudl be nice if npc rogues would all be hiden until you agro them

Also I belive back in Crustal Coverns (or Dragon Necropolis?) the phase spiders were actualy able to become invisable while attacking - it was imposible to fight them wihout see invis ability

do any of these work or can be implemented?
Reply With Quote
  #2  
Old 09-19-2008, 09:56 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Currently no but they're really interesting ideas so I wouldn't put it out of the question of being implemented in the future.
Reply With Quote
  #3  
Old 09-19-2008, 10:10 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

I am glad to hear that you like it =)

Specialy would be interesting if Rogue npc would first start out hidden, and when player walks into agro range, rather than just to rush at him, they would sneak up to him quetly and open up with a backstab =)
Reply With Quote
  #4  
Old 09-19-2008, 11:58 PM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Yeah I remember the Dulak Harbor Rogues, they weren't trap spawns, they were actually there hiding. You could see them with see invis on. Very nice idea though, I haven't even though about that
Reply With Quote
  #5  
Old 09-22-2008, 10:06 PM
merb
Sarnak
 
Join Date: Jul 2005
Location: Ohio
Posts: 72
Default

It would be possible, but it'd take watcher mobs or something of that sort.

For example, you could place an invisible watcher mob at the entrance to a cave with a proximity set so that when a player gets close enough, a mob will spawn and probably emote or shout something.

I'm no quest expert, so I'm not too sure how to set up proximity signals on mobs, but I've seen things like that done before.
__________________
Building Server
Legends of Time - Full Custom/Legit Roleplay, need devs
Reply With Quote
  #6  
Old 09-22-2008, 11:09 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This would be pretty simple just using the new quest commands.

Create your sneaking NPC as race 240 and I think gender 0. Then run this script:

Code:
sub EVENT_AGGRO {

  quest::npcrace(433);
  quest::npcgender(2);
  quest::say("DIE!");

}
That should do what you want. Though, I am sure you could customize it and add more wherever you like.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 09-23-2008, 12:12 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

you can also make a simple prox trap.
You make an invis npc triger holder with folowing script (below) who will spawn an actual npc, and then can either be set of wait timer or depop to prevent chain spawning (unles its your intent) (in PoJ on death Row there are crates in the ground- when steped on it will spawn a banshee every 60 seconds)

Quote:

sub EVENT_SPAWN
{

my $x;
my $y;
my $z;
my $h;

$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();

quest::set_proximity( $x-25,$x+25,$y-25,$y+25,$z-25,$z+25);
}


sub EVENT_ENTER
{
my $x;
my $y;
my $z;
my $h;

$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();

quest::spawn2(9999,0,0,$x,$y,$z,$h);
quest::depop();
}


but of course this wasnt what i was refering to - I want actual npc rogues =)
Reply With Quote
  #8  
Old 09-23-2008, 02:13 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by ChaosSlayer View Post
but of course this wasnt what i was refering to - I want actual npc rogues =)
Here's how the server handles Hide when the client sends the OP_Hide packet:
zone/client_packet.cpp
Code:
void Client::Handle_OP_Hide(const EQApplicationPacket *app)
{
	if(!HasSkill(HIDE)) {
		return; //You cannot hide if you do not have hide
	}
	
	if(!p_timers.Expired(&database, pTimerHide, false)) {
		Message(13,"Ability recovery time not yet met.");
		return;
	}
	int reuse = HideReuseTime - GetAA(209);
	p_timers.Start(pTimerHide, reuse-1);
	
	float hidechance = ((GetSkill(HIDE)/250.0f) + .25) * 100;
	float random = MakeRandomFloat(0, 100);
	CheckIncreaseSkill(HIDE,15);					
	if (random < hidechance) {
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
		SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
		sa_out->spawn_id = GetID();
		sa_out->type = 0x03;
		sa_out->parameter = 1;
		entity_list.QueueClients(this, outapp, true);
		safe_delete(outapp);
		if(GetAA(aaShroudofStealth)){
			improved_hidden = true;
			hidden = true;
		}
		else
			hidden = true;
	}
	if(GetClass() == ROGUE){
		EQApplicationPacket *outapp = new EQApplicationPacket(OP_SimpleMessage,sizeof(SimpleMessage_Struct));
		SimpleMessage_Struct *msg=(SimpleMessage_Struct *)outapp->pBuffer;
		msg->color=0x010E;
		if (!auto_attack && entity_list.Fighting(this)) {
			if (MakeRandomInt(0, 300) < (int)GetSkill(HIDE)) {
				msg->string_id=343;
				entity_list.Evade(this); 
			} else {
				msg->string_id=344;
			}
		} else {
			if (hidden){
				msg->string_id=346;
			}
			else {
				msg->string_id=345;
			}
		}
		FastQueuePacket(&outapp);
	}
	return;
}
The code below the blue text is just the evasion code for rogues, which we don't really need to worry about.

Looking at the code, it looks like all that's done is, when the client hides, it sends out a SpawnAppearance packet. It uses a type of 0x03, which is visibility, and a paramater of 1 for hidden, 0 for not hidden. Elsewhere in the code, if you do something to break invis, it will send 0, otherwise it'll continue to stay 1. In the case of a Rogue NPC, you should be able to do the same thing, you just have to figure out how to trigger it in the first place, which would probably be on spawning, but also maybe with a variable, just in case you don't want rogues to hide on you. The unhide would more than likely come into the aggro or attack code (probably attack if memory serves me on how it worked in Live, but it also depends if your NPCs are Hiding & Sneaking at the same time). In addition, if you want to create NPCs, like the spiders in Crystal Caverns whose invis isn't removed on aggro, combat, moving, etc, you just wouldn't send the packet removing invis.

I know it's not the code to actually get it working, but hopefully this points someone in the right direction.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:06 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3