EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Mobs buffing PCs (https://www.eqemulator.org/forums/showthread.php?t=41744)

caravellex 02-03-2018 09:57 PM

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;
}


Kingly_Krab 02-03-2018 10:23 PM

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.

caravellex 02-03-2018 10:26 PM

Fixed
 
What would a script look like to do this?

Do you mean making a quest file for the npc?

Shin Noir 02-03-2018 10:38 PM

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

caravellex 02-03-2018 11:57 PM

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


All times are GMT -4. The time now is 01:56 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.