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

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2008, 11:49 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default New Special Attack - Immune to Ranged

I don't think there is anything to make NPCs immune to ranged damage yet, but I do think it would be useful for creating some more diverse types of encounters. It would basically be to make NPCs immune to ranged (bow/arrow) and throwing/throwingV2 damage. I am not sure what it would take to code this yet, but I may look into it if I get some time.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 11-18-2008, 12:21 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

After checking into it a bit, it looks like it may be easier than I thought. I am pretty sure that I have the new special attack setting added properly to npc.cpp and mob.h, but I am still not exactly sure on where to put the part for attack.cpp or even if it is correct.

The code in red is the code that would be getting added to the existing code:

attack.cpp - Not sure if this is right yet, or exactly where to put it
Code:
if(skillinuse == ARCHERY || skillinuse == THROWING) {
	if(against->SpecAttacks[IMMUNE_RANGED]) {
		return 0;
	}
}
mob.h
Code:
enum {
	SPECATK_NONE = 0,
	SPECATK_SUMMON,		//S
	SPECATK_ENRAGE,		//E
	SPECATK_RAMPAGE,	//R
	SPECATK_FLURRY,		//F
	SPECATK_TRIPLE,		//T
	SPECATK_QUAD,		//Q
	UNSLOWABLE,			//U
	UNMEZABLE,			//M
	UNCHARMABLE,		//C
	UNSTUNABLE,			//N
	UNSNAREABLE,		//I
	UNFEARABLE,			//D
	IMMUNE_MELEE,		//A
	IMMUNE_MAGIC,		//B
	IMMUNE_FLEEING,		//f
	IMMUNE_MELEE_EXCEPT_BANE,	//O
	IMMUNE_MELEE_NONMAGICAL,	//W
	IMMUNE_AGGRO, //H, wont aggro, ever.
	IMMUNE_RANGED, //P - Projectile
	SPECATK_MAXNUM
				//X,Y,Z are old interactive NPC codes
};

npc.cpp - Slightly modified the format, since it was kinda sloppy and hard to read
Code:
void Mob::NPCSpecialAttacks(const char* parse, int permtag) {
    for(int i = 0; i < SPECATK_MAXNUM; i++)
	{
	    SpecAttacks[i] = false;
        SpecAttackTimers[i] = NULL;
    }
	
	const char* orig_parse = parse;
    while (*parse)
    {
        switch(*parse)
        {
		case 'E':
			SpecAttacks[SPECATK_ENRAGE] = true;
			break;
		case 'F':
			SpecAttacks[SPECATK_FLURRY] = true;
			break;
		case 'R':
			SpecAttacks[SPECATK_RAMPAGE] = true;
			break;
		case 'S':
			SpecAttacks[SPECATK_SUMMON] = true;
			SpecAttackTimers[SPECATK_SUMMON] = new Timer(6000);
			SpecAttackTimers[SPECATK_SUMMON]->Start();
			break;
		case 'T':
			SpecAttacks[SPECATK_TRIPLE] = true;
			break;
		case 'Q':
			//quad requires triple to work properly
			SpecAttacks[SPECATK_TRIPLE] = true;
			SpecAttacks[SPECATK_QUAD] = true;
			break;
		case 'U':
			SpecAttacks[UNSLOWABLE] = true;
			break;
		case 'M':
			SpecAttacks[UNMEZABLE] = true;
			break;
		case 'C':
			SpecAttacks[UNCHARMABLE] = true;
			break;
		case 'N':
			SpecAttacks[UNSTUNABLE] = true;
			break;
		case 'I':
			SpecAttacks[UNSNAREABLE] = true;
			break;
		case 'D':
			SpecAttacks[UNFEARABLE] = true;
			break;
		case 'A':
			SpecAttacks[IMMUNE_MELEE] = true;
			break;
		case 'B':
			SpecAttacks[IMMUNE_MAGIC] = true;
			break;
		case 'f':
			SpecAttacks[IMMUNE_FLEEING] = true;
			break;
		case 'O':
			SpecAttacks[IMMUNE_MELEE_EXCEPT_BANE] = true;
			break;
		case 'W':
			SpecAttacks[IMMUNE_MELEE_NONMAGICAL] = true;
			break;
		case 'H':
			SpecAttacks[IMMUNE_AGGRO] = true;
			break;
		case 'P':
			SpecAttacks[IMMUNE_RANGED] = true;
			break;
		default:
			break;
        }
        parse++;
    }
	
	if(permtag == 1 && this->GetNPCTypeID() > 0){
		if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) {
			LogFile->write(EQEMuLog::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
		}
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 09:13 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3