• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Bug - movewhenhit doesn't move you out of melee range w/ pet tanking

rodd996

New member
when you pull a mob and it comes to you before the pet picks it up, you then movewhenhit. you still end up being with in the melee range of the mob thus die from melee damage. Is there a way to modify the distance? Thanks
 
Find this code and change this line /declare GotHitDistChk int local 25

Increase 25 to what you want, but be careful you don't increase it to much.


Rich (BB code):
    Sub Event_GotHit(string Line, string AttackingMob)
        /declare GotHitDistChk int local 25
        /varset GotHitToggle 1
        /declare AttackingMobID int local
        /if (${AggroTargetID} && !${Target.ID} && !${ReturnToCamp}) {
            /call CheckForCombat 1 Event_GotHit
        }
        /if (${Pulled} && ${Select[${Role},pullertank,pullerpettank]} && ${NearestSpawn[npc los radius ${CampRadius} targetable].ID}!=${MyTargetID}) {
            /varset MyTargetID 0
            /varset MyTargetName
        } 
        
        /if (${Select[${Role},pettank,pullerpettank,hunterpettank]}) {   
            /doevents flush GotHit        
            /varset AttackingMobID ${NearestSpawn[npc radius 39 targetable "${AttackingMob}"].ID}
            /squelch /target id ${Spawn[${AttackingMobID}].ID}                         
            /delay 5 ${Target.ID}==${AttackingMobID}
            |- If mob that hit me still too close, move to camp or away from mob.
            /if (${GotHitToggle} && ${AttackingMobID}>0) {
                /echo I got hit by >>${AttackingMob}<< ID:${AttackingMobID}!
                /moveto mdist 10
                /if (${Math.Distance[${Me.Y},${Me.X}:${CampYLoc},${CampXLoc}]}>${CampRadius} && !${Select[${Role},hunterpettank]}) {
                    |- Only move away from mob if MoveWhenHit enabled (1)
                    /if (${MoveWhenHit}) {
                        /echo Moving back to camp!
                        /moveto loc ${CampYLoc} ${CampXLoc}
                    }
                } else {
                    |- If mob is in pet attack range from camp, send pet in.
                    /if (${Me.Pet.ID} && ${Math.Distance[${Target.Y},${Target.X}:${CampYLoc},${CampXLoc}]}<=${PetAttackRange}) /pet attack
                    |- Only move away from mob if MoveWhenHit enabled (1)
                    /if (${MoveWhenHit}) {
                        /echo Trying to get away from >>${AttackingMob}<<.
                        /if (${Math.Distance[${Me.Y},${Me.X}:${Target.Y},${Target.X}]}<=${GotHitDistChk}) /moveto loc ${Target.Y} ${Math.Calc[${Target.X}-${GotHitDistChk}]}
                    }
                }
            }
            /if (${MoveWhenHit}) /delay 15 ${Math.Distance[${Me.Y},${Me.X}:${Target.Y},${Target.X}]}>${GotHitDistChk}
            /if (${Target.ID}) /face nolook
            /look 0
        }
    /varset GotHitToggle 0
    /doevents flush GotHit
 
thanks for addressing that for me Chris,
when setting the distance check i figured 25 was a safe amount to check against, since i assumed pet picking up mob fast due to pet speed velocity buff.
Never took into account other pet classes may have slow moving pets... which may be the case in some cases.

Good value should be no higher than 35....

Also consider pet movement is speed for mage pets is greatly reduced when aegis of XXX (multi lines of spell) is on pet... pet gains the hit protection but looses allot of speed.
 
Could always just add GotHitDistChk to the kiss ini file under the pet section and default it to 35. This way anyone could make the change as they see fit without messing with the code. Just a thought.
 
Bug - movewhenhit doesn't move you out of melee range w/ pet tanking

Users who are viewing this thread

Back
Top
Cart