EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   CoH Hate List Wipe (https://www.eqemulator.org/forums/showthread.php?t=26552)

seveianrex 10-18-2008 10:13 AM

CoH Hate List Wipe
 
{spell_effects.cpp}

~1734, find

Code:

                                        CastToClient()->cheat_timer.Start(3500, false);
                                        CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
                                        Message(15, "You have been summoned!");

Add:
Code:

                                        WhipeHateList();

Congdar 10-18-2008 12:16 PM

This change would wipe the hate list of the character being CoH'd is that what you want?

So_1337 10-18-2008 12:45 PM

That's what it does on Live. Good fix =)

cavedude 10-18-2008 12:58 PM

KLS changed the spelling to the correct WipeHateList(); in Rev 108 just so you know ;)

KLS 10-18-2008 04:49 PM

Yeah seeing whipehatelist all the time was just too much for me sorry.

trevius 10-18-2008 05:00 PM

Can you Garuntee that you got them all? LOL JK! I know the Garuntee spelling error isn't in actual code, but seeing that note everywhere has made me want to run the comments through spell checker lol. I give 3 cheers for the whipehatelist change lol.

cavedude 10-19-2008 10:39 PM

I got a report on PEQ that this isn't working: http://www.projecteq.net/phpBB2/viewtopic.php?t=5836

It may have not been merged in correctly, might want to double check SVN. I did use the correct spelling.

AndMetal 10-20-2008 01:38 AM

It looks like this was merged correctly, so unfortunately we can't blame it on you this time cd :D
Code:

Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp        (revision 112)
+++ spell_effects.cpp        (revision 113)
@@ -1763,6 +1763,7 @@
                                        CastToClient()->cheat_timer.Start(3500, false);
                                        CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
                                        Message(15, "You have been summoned!");
+                              WipeHateList();
                                }
                                else
                                        caster->Message(13, "This spell can only be cast on players.");

The issue is that we're wiping the hate list for the client it's being cast on, and not from the mobs that have them on their hate list.

To wipe from the mob hate list, I think we can use EntityList::ClearFeignAggro & EntityList::ClearZoneFeignAggro:
Code:

                        case SE_SummonPC:
                        {
                        if(IsClient()){
                                        CastToClient()->cheat_timer.Start(3500, false);
                                        CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
                                        Message(15, "You have been summoned!");
                                        entity_list.ClearFeignAggro(CastToClient()); //clear aggro just like FD
                                        entity_list.ClearZoneFeignAggro(CastToClient()); //clear any aggro that didn't succeed from FD
                                        WipeHateList(); //wipe client's hate list

                                }
                                else
                                        caster->Message(13, "This spell can only be cast on players.");

                                break;
                        }

Ideally, we might want to make a new function, EntityList::ClearZoneAggro(), that just does what both of the 2 do, but in 1 function:
Code:

void EntityList::ClearZoneAggro(Client* targ)
{
        LinkedListIterator<NPC*> iterator(npc_list);
        iterator.Reset();
        while(iterator.MoreElements())
        {
                if (iterator.GetData()->CheckAggro(targ))
                        iterator.GetData()->RemoveFromHateList(targ);

                iterator.GetData()->RemoveFromFeignMemory(targ);
                iterator.Advance();
        }
}

Anyone wanna give this a shot?

Congdar 10-20-2008 08:57 AM

Quote:

Originally Posted by Congdar (Post 158564)
This change would wipe the hate list of the character being CoH'd is that what you want?

Quote:

Originally Posted by So_1337 (Post 158566)
That's what it does on Live. Good fix =)

Quote:

Originally Posted by AndMetal (Post 158670)
The issue is that we're wiping the hate list for the client it's being cast on, and not from the mobs that have them on their hate list.

See... this is why I ask these questions.

So_1337 10-20-2008 09:22 AM

I misunderstood the question, then. I was speaking from a generality of the player should no hate on them after it's cast, I didn't realize it wasn't being whiped (/tease KLS) off the NPCs, which you seemed to understand =P

Good catch, then, and sorry I didn't know enough to follow it.

AndMetal 10-20-2008 08:33 PM

Fixed & tested in SVN Revision 124.


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

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