Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-03-2018, 09:57 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default Mobs buffing PCs

Hello, I've been trying to make NPCs buff players.

When I change this line of code from NPC_LIST to CLIENT_LIST the npcs buff players, but no longer buff other NPCS, how would I change it so they would buff both players and NPCS.

Code:
//Only iterate through NPCs
	for (auto it = client_list.begin(); it != client_list.end(); ++it) {
		Mob* mob = it->second;
	
		if (mob->GetReverseFactionCon(caster) >= FACTION_KINDLY) {
			continue;
		}

		if (DistanceSquared(caster->GetPosition(), mob->GetPosition()) > iRange2) {
			continue;
		}

		if ((iSpellTypes & SpellType_Buff) && !RuleB(NPC, BuffFriends)) {
			if (mob != caster)
				iSpellTypes = SpellType_Heal;
		}

		if (caster->AICastSpell(mob, 100, iSpellTypes))
			return true;
	}
	return false;
}
Reply With Quote
 

Thread Tools
Display Modes

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 02:46 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