XP - Most Hated

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

XP - Most Hated

Post by Gangrenous » Sat May 14, 2016 6:56 am

Doing a preliminary test of dragging NPC's to the guards, it appears you do not have to do any damage at all and get XP. I am thinking we need to do a check for most hated on giving XP out. If I remember right XP was handing out if you do over half damage. It would also be good to have a rule for those who want to change that, maybe "GuardsStealXP", and if anything on the hate list of the dead is not a player, then no XP. Thoughts? I am going to make a change on my end and paste it here sometime this weekend.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: XP - Most Hated

Post by Jabantiz » Sat May 14, 2016 5:19 pm

I would say if you need to go to a guard then you should get no xp at all, however with roaming guards that could be a problem. How does this work on live?

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: XP - Most Hated

Post by Gangrenous » Sat May 14, 2016 6:04 pm

Good question.

IMHO, if the guard is even on the hate list, you really should get no XP. Basically if anyone other then a player in on the hate list, I do not want them getting XP on my server. I was working on this morning but everytime I referenced MostHated I was getting a crash, then I decided to work on the yard. It may be Sunday night before I get back on it.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: XP - Most Hated

Post by Gangrenous » Sun May 15, 2016 9:04 am

I have worked some code in and it should work, but does not. I am thinking it is Brain()->GetMostHated(). When I run an NPC to the guard, even though I have not damaged it, I am supposedly still high on the hate list. Even after the guard kills the NPC I am the top of the hate list some of the time, but not all of the time.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: XP - Most Hated

Post by Gangrenous » Sun May 15, 2016 10:21 am

Looking at it, there seems to be an issue. I think the hate is added after the NPC is dead, not sure why the hp check is there. But lets say you run by an NPC, 50 points of hate is added to you. Then you run it to a guard, 50 points is added to the guard. Then the guard hits an NPC for 80 points of damage, killing it instantly. The hate checks for HP, the mob has 0, it is dead, no hate is added. So you end up having the same exact hate as the guard. I think the damage needs to be added after the hate is added. This is where I moved it.

Code: Select all

	else{
		hit_result = DAMAGE_PACKET_RESULT_SUCCESSFUL;
		GetZone()->CallSpawnScript(victim, SPAWN_SCRIPT_HEALTHCHANGED, this);
		damage = victim->CheckWards(damage, damage_type);
		if (victim->IsNPC() && victim->GetHP() > 0) {
			((Entity*)victim)->AddHate(this, damage);
		
		victim->TakeDamage(damage);
Capture.JPG
You do not have the required permissions to view the files attached to this post.
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests