FIXED: Prevent empty corpses from being looted!

Discussion in 'E3' started by Remi, Jan 15, 2022.

  1. Remi

    Remi Orc Pawn

    Messages:
    44
    e3_Wait4Rez.inc

    Replace the entirety of the Wait4Rez sub routine with the following and your army will no longer loot an empty corpse:

    Code:
    
    |------------------------------------------------------------------------------------|
    |- Adaptation of CorpseExpired (e3_Classes_Cleric.inc                         -------|
    |------------------------------------------------------------------------------------|
    #event CorpseCheck "This corpse #1# be resurrected."
    Sub Event_CorpseCheck(line, CorpseCheck)
      /squelch /declare canLoot int outer 0
      /delay 5
      /if (${CorpseCheck.Equal[cannot]}) /varset canLoot 1
    /return
    
    |------------------------------------------------------------------------------------|
    |- Consents NetBots, loads spells, accepts rez, and loots your body after zoning.   -|
    |------------------------------------------------------------------------------------|
    SUB Wait4Rez(functionCall)
    /if (${Debug} || ${Debug_Wait4Rez}) /echo |- Wait4Rez${If[${Defined[functionCall]}, ${functionCall},]} ==>
        /declare i int local 0
        /if (${functionCall.Equal[LOOT_NOW]}) /goto :Looting
        /echo Awaiting rez: auto-accepting, and looting my corpse...
        |Consent NetBots.
        /for i 1 to ${NetBots.Counts}
          /delay 2
            /consent ${NetBots.Client[${i}]}
        /next i
        |Load Spells.
        /if (${Me.Class.CanCast}) /call check_Gems
      |Wait for Rez------------------------------------------------------|
        :rezmeffs
        /if (${Debug} || ${Debug_Wait4Rez}) /echo |- Wait4Rez -| Waiting to accept rez.
        /call Background_Events
        /delay 10 ${Window[ConfirmationDialogBox].Open}
        /if (!${Window[ConfirmationDialogBox].Open}) /goto :rezmeffs
        |Click yes to rez box.
        /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
        |Wait for zone-----------------------------------------------------|
        :zoneffs
        /if (${Debug} || ${Debug_Wait4Rez}) /echo |- Wait4Rez -| Waiting to zone.
        /delay 300 ${Spawn[${Me}'s].ID}
        /if (!${Spawn[${Me}'s].ID}) /goto :zoneffs
        /delay 30
      |Loot corpse-------------------------------------------------------|
        /docommand ${ChatToggle} Looting...
        :Looting
        /if (${Debug} || ${Debug_Wait4Rez}) /echo |- Wait4Rez -| Attempting to loot my corpse.
     
        /if (!${Defined[lootTotal]}) /declare lootTotal int local 0
        /call TrueTarget ${Spawn[${Me}'s].ID}
        /if (${Target.Distance}<100 && ${Target.CleanName.Equal[${Me}'s corpse]}) {
        |Pull the corpse.
            /if (${Target.Distance}>15) /corpse
            /delay 20 ${Target.Distance}<15
            /consider
            /delay 5
            /doevents CorpseCheck flush
            /delay 5
            /doevents CorpseCheck
            /if (${canLoot}==0) {
              /bc MY CORPSE HAS NOT BEEN REZZED! ABORTING LOOT!
              /keypress esc
              /return
            }
            /loot
            /delay 20 ${Me.State.Equal[BIND]}
            /if (${Me.State.NotEqual[BIND]}) /goto :Looting
        |Wait for all the items on your corpse to appear in your loot window.
            /varset lootTotal -1
            /varset i 0
            :autoxplootlag
            /varcalc i ${i}+1
            /if (${lootTotal}!=${Corpse.Items}) {
                /varset lootTotal ${Corpse.Items}
                /delay 5
                /if (${i}<50) /goto :autoxplootlag
            }
        |Loot All Items.
            /notify LootWnd LootAllButton leftmouseup
            /delay 30s !${Window[LootWnd].Open}
        |Check you don't still have a corpse.
            /if (!${Me.State.Equal[BIND]}) {
                /delay 2s !${Spawn[${Me}'s].ID}
                /if (${Spawn[${Me}'s].ID}) /goto :Looting
            }
            /docommand ${ChatToggle} Ready to die again!
        }
        /doevents flush
        /if (${buffAfterRez} && ${NetBots[${NetBots.Client[1]}].CombatState}>=3) /bc buff me
    /RETURN
    
     
    Last edited: Jan 19, 2022