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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-06-2002, 12:47 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default Basic Feign Death code

After around eight hours of struggling with this, it's complete. It's very crude right now, has no "remember" factor and will only work if you're top on aggro.

Next version should have both of these fixed.

Insert into client_process.cpp:

Where the code for standing up is:
Code:
							if (sa->parameter == 0x64)
							{
//								cout << "Client " << name << " standing" << endl;
								appearance = 0;
								this->SetFeigned(0);
							}
Among skills code:
Code:
					case OP_FeignDeath:
					{
						int feignchance = GetSkill(FEIGN_DEATH);
						int primfeign = GetSkill(FEIGN_DEATH);
						if (primfeign > 100) {
							primfeign = 100;
						}
						int secfeign = GetSkill(FEIGN_DEATH);
						if (secfeign < 101) {
							secfeign = 0;
						}
						else {
							secfeign = secfeign - 100;
							secfeign = secfeign / 2;
						}
						int totalfeign = primfeign + secfeign;
						if (rand()%160 > (totalfeign)) {
							Message(0,"You have fallen to the ground");
							this->SetFeigned(0);
							appearance = 3;
						}
						else {
							this->SetFeigned(1);
							appearance = 3;
						}
						if (rand()%210 > feignchance && rand()%3 == 1 && GetSkill(FEIGN_DEATH) < 200 && GetSkill(FEIGN_DEATH) < this->GetLevel()*5+5 ) {
						    this->SetSkill(25,++pp.skills[25]);
							UpdateWho();
						}
						break;
					}
Client.cpp

Insert to bottom of Client:Client (below isgrouped=false)
Code:
	feigned = 0;
Insert to bottom of client.cpp
Code:
void Client::SetFeigned(int8 in_feigned) {
	feigned=in_feigned;
 }
client.h

Insert below bool GetPVP() { return pp.pvp; }
Code:
	void	SetFeigned(int8 in_feigned);
	int8    GetFeigned()	{ return feigned; }
Insert at bottom of client.h, just above
};
#endif

Code:
	int8 feigned;
npcAI.cpp

Replace if (!sender->IsEngaged()) with:

Code:
if (!sender->IsEngaged() && currentmob->CastToClient()>GetFeigned() != 1)
npc.cpp

And finally, just above if (target->GetID() != this->ownerid && attack_timer->Check()) (line 334) add:

Code:
if (hate_list.GetTop()->CastToClient()->GetFeigned() == 1) {
				RemoveFromHateList(GetHateTop());
			}
There it is
Reply With Quote
 


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:05 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