Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2009, 11:49 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default /assist question

Its been so long since I played on live, I'm not sure I remember accurately how /assist worked on live. I know that when you /assist a mob or player that has a target, you got their target. But what happened when you /assist a mob or player that does not have a target? Currently, the emu sets the target to yourself. This can be misleading since I have more than once thought, "now why does that mob have me targeted?"

What I can't remember is when you /assist someone who doesn't have a target, does your target get cleared or does it just stay with the same target you had before the /assist command? I'd like to create patches to correct this, but I need to know what the proper behavior is before I do.
Reply With Quote
  #2  
Old 06-12-2009, 02:47 PM
WillowyLady
Sarnak
 
Join Date: Aug 2003
Location: Recycle Bin
Posts: 90
Default

I seem to think that if the player / npc had no target when assisted, nothing would show on HoTT.
__________________
I'll be back!

Reply With Quote
  #3  
Old 06-12-2009, 02:53 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

That may be true, but I'm trying to fix the /assist behavior. I hadn't been using HoTT because leadership abilities were not working. Now that group leadership is working, I do use it if the group leader has the ability, but that is not always the case. So I still want to fix /assist.
Reply With Quote
  #4  
Old 06-12-2009, 02:56 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

In my opinion, clearing the target when using /assist on a PC/NPC with nothing targeted is the only logical choice.

Leaving it at the last thing you had targeted on a failed /assist is only going to make you wonder whether your PC/NPC actually had that last thing targeted, too, similar to the problem of targeting oneself upon failure.

The only consistent and unambiguous choice is for /assist to always set your target to that of your target's target, even when that's nothing at all.

The only question I have after that is whether /assist has a maximum range. /target has a maximum range, but once you do have something targeted, you can keep that target as long as you're in the zone and you're both alive.

Can you then /assist something that's across the zone but that you still have targeted? Or, does /assist have a range limit like /target, which is the way I would assume it to work?

- Shendare
Reply With Quote
  #5  
Old 06-12-2009, 03:30 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Quote:
Originally Posted by Shendare View Post
In my opinion, clearing the target when using /assist on a PC/NPC with nothing targeted is the only logical choice.

Leaving it at the last thing you had targeted on a failed /assist is only going to make you wonder whether your PC/NPC actually had that last thing targeted, too, similar to the problem of targeting oneself upon failure.

The only consistent and unambiguous choice is for /assist to always set your target to that of your target's target, even when that's nothing at all.
I agree, but I want to try to match live, even if it doesn't follow the most logical choice. Although, I could easily make it a rule so the behavior is selectable.

However, I was unable to get the client to clear the target on an /assist so I would need someone to get a packet trace of that happening (if that is the behavior on live) so I know what packet to send the client.

Quote:
Originally Posted by Shendare View Post
The only question I have after that is whether /assist has a maximum range. /target has a maximum range, but once you do have something targeted, you can keep that target as long as you're in the zone and you're both alive.

Can you then /assist something that's across the zone but that you still have targeted? Or, does /assist have a range limit like /target, which is the way I would assume it to work?

- Shendare
The emu code has range limits on /assist already. If you try to /assist beyond that range, you get the same behavior as if your target had no target.
Reply With Quote
  #6  
Old 06-12-2009, 05:02 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I just checked Live and /assist on an NPC that is not aggro'd does nothing at all. It keeps your target on the NPC you already have targeted.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 06-12-2009, 05:27 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Thanks Trev. I'll code it and submit it.
Reply With Quote
  #8  
Old 06-22-2009, 01:30 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Made it a rule so people can choose the existing behavior or one that is more live like.

Code:
Index: common/ruletypes.h
===================================================================
--- common/ruletypes.h  (revision 701)
+++ common/ruletypes.h  (working copy)
@@ -189,6 +189,7 @@
 RULE_REAL ( Combat, AgiHitFactor, 0.01)
 RULE_INT ( Combat, MinRangedAttackDist, 25) //Minimum Distance to use Ranged Attacks
 RULE_REAL ( Combat, ArcheryStationaryPenalty, 1.0)     //Damage Penalty for moving or rooted targets.  1 = 50% penalty (Default), 2 = no penalty, 0 = 100% penalty
+RULE_BOOL ( Combat, AssistNoTargetSelf, true)  //when assisting a target that does not have a target true = target self, false = leave target as was before assist
 RULE_CATEGORY_END()

 RULE_CATEGORY( NPC )
Index: zone/client_packet.cpp
===================================================================
--- zone/client_packet.cpp      (revision 701)
+++ zone/client_packet.cpp      (working copy)
@@ -2058,7 +2058,7 @@

        EQApplicationPacket* outapp = app->Copy();
        eid = (EntityId_Struct*)outapp->pBuffer;
-       eid->entity_id = GetID();
+       if (RuleB(Combat, AssistNoTargetSelf)) eid->entity_id = GetID();
        if(entity && entity->IsMob())
        {
                Mob *assistee = entity->CastToMob();
And the SQL for the rule:

Code:
INSERT INTO `rule_values` VALUES ('1', 'Combat:AssistNoTargetSelf', 'true','When assisting a target without a target: true = target self, false = leave target as was before assist (this is the behavior on live)');
Reply With Quote
  #9  
Old 07-01-2009, 02:58 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

This has been committed to svn.
Reply With Quote
  #10  
Old 07-01-2009, 11:02 AM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

Question: Why is this a sticky?
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
Reply With Quote
  #11  
Old 07-01-2009, 11:35 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

It was made a sticky so a dev would remember to commit it. I just recently got access to the SVN so committed it myself. However, I have no way to remove the sticky on this post so I'm waiting on someone else to do it.
Reply With Quote
  #12  
Old 07-01-2009, 11:41 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

If ending up with no target is the Live-like behavior, why isn't that the default rule value?
Reply With Quote
  #13  
Old 07-01-2009, 02:42 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

It's not ending up with no target. You end up with the target you had before the /assist. In any case, I wasn't sure if it would confuse people if the change happened unexpectedly so I took the safer default of the prior behavior. That can easily be changed.
Reply With Quote
Reply


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 07:37 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