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.

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 02-03-2018, 10:23 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Use mob_list instead of npc_list or client_list. Not sure why you're wanting them to do this from the source though, you can just script this.
Reply With Quote
  #3  
Old 02-03-2018, 10:26 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default Fixed

What would a script look like to do this?

Do you mean making a quest file for the npc?
Reply With Quote
  #4  
Old 02-03-2018, 10:38 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

http://www.eqemulator.org/forums/showthread.php?t=40898
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #5  
Old 02-03-2018, 11:57 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

ahh I see!
the difference would be that I wanted any NPC globally to buff the player if they get high enough faction. So editing the source code works well
Reply With Quote
Reply

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 04:40 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