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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2002, 07:32 AM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default On Guard Behavior

Some fun guard behavior tweaks:

Random animations and sayings. I've attached a sample script file that I use in rivervale and the complete changed over wesquests that i've been using.

You'll need to tweak npc.h
Code:
	/******************************************************
	Mob based questing and other goodies
	******************************************************/
	void CheckQuests(char* zonename, char * message, int32 npc_id, int32 item_id = 0, bool IsDoorScript = false);
	bool IsEnd(char* string);
	bool IsCommented(char* string);
	char * rmnl(char* nstring);	
	char * strreplace(char* searchstring, char* searchquery, char* replacement);
And add in this to npc::process
Code:
		/****************************************
		Guards fun anim
		****************************************/

		#define GUARD_ANIMATION_FREQ 500
		if (rand()%GUARD_ANIMATION_FREQ==2)
		if (!IsEngaged() && !ismovinghome) //what are all the guard names?

		if (strstr(GetName(), "Guard") 
			|| strstr(GetName(), "Sentinel") 
			|| strstr(GetName(), "Sentry") 
			|| strstr(GetName(), "Dragoon") ) {
			switch (rand()%12) {
			case 1: DoSocialAnimation(72); break;					 
			case 2: DoSocialAnimation(55); break;
			case 3: DoSocialAnimation(72); break;
			case 4: DoSocialAnimation(31); break;
			case 5: DoSocialAnimation(34); break;
			case 6: DoSocialAnimation(35); break;
			case 7: DoSocialAnimation(72); break;
			case 8: DoSocialAnimation(61); break;
			case 9: DoSocialAnimation(72); break;
			case 10: DoSocialAnimation(55); break;

			case 11: 	
				if (rand()%50==2)
					this->CheckQuests(zone->GetShortName(), "RANDOM_GUARD", this->GetNPCTypeID());
			default:
				DoSocialAnimation(60);
				break;
			
			}
		}
DoSocialAnimations is
Code:
/
*************************************
NPC Social Animation
*************************************/
void NPC::DoSocialAnimation(int num){
	 this->CastToMob()->DoAnim(num);
}
You'll need to have that signature in npc.h (void DoSocialAnimation(int num);

By changing 'name' in the quest file, you could also have town criers, etc.

--MV
Reply With Quote
  #2  
Old 04-27-2002, 08:26 AM
theCoder
Sarnak
 
Join Date: Jan 2002
Posts: 90
Default

That's cool! I think I'm going to have to log onto your server some time just to see all the neat things you're doing

The one comment I have is that it might be better to add a function isGaurd() to the NPC class. This function would just do what your if clause does right now (strstr(getName(), "Gaurd") || ...), but could be easily modified in the future if a gaurd field is added or something.
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 12:35 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3