• IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->
MQ2Rez

Plugin - MQ2Rez 3.4

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#1
So...after looking at MQ2Autorez, I decided to take it upon myself to finish what dewey had started and make the next step to have it autoloot as well as take the rez.

Commands:
Rich (BB code):
/rez               -> displays settings
/rez accept on|off -> Toggle auto-accepting rezbox
/rez spawn  on|off -> Toggles going to bind point after death
/rez pct # -> Autoaccepts rezes only if they are higher than # percent
/rez loot on|off -> Toggle looting corpse when opened and when rezzed
/rez silent -> Toggle messages for looting individual items
/rez command on|off -> Toggle use of a command after looting out corpse
/rez setcommand "mycommand" -> Set the command that you want. 
/rez help
/rezzme -- Immediately respawn yourself without a rez. You will *not* regain any experience.
The "mycommand" must be formatted like this: "/memset group" or "/multiline ; /sit ; /memset group ; /mac rezbuffs" etc.

Using the /rezzme command should now loot out your corpse, as well.

Rich (BB code):
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Project: MQ2Rez.cpp
// Author: TheZ, made from an amalgamation of dewey and s0rcier's code
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

#define    PLUGIN_NAME    "MQ2Rez"  	// Plugin Name
#define    PLUGIN_FLAG      0xF9FF   	// Plugin Auto-Pause Flags (see InStat)
#define    CURSOR_WAIT         250      // Cursor Wait After Manipulation
#define    LOOTME_WAIT        2400   	// Lootme Wait Delay to complete operations
#define    LOOTME_MORE         400   	// Lootme More Delay add when receiving new items.

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

#ifndef PLUGIN_API
  #include "../MQ2Plugin.h"
  PreSetup(PLUGIN_NAME);
  #include <map>
#endif PLUGIN_API

#define			NOID        -1
DWORD				Initialized	=false;				// Plugin Initialized?
DWORD				Conditions	=false;				// Window Conditions and Character State
DWORD				SkipExecuted=false;				// Skip Executed Timer
PCONTENTS  	CursorContents();
long       	InStat();
long       	SetBOOL(long Cur, PCHAR Val, PCHAR Sec="", PCHAR Key="");
long       	SetLONG(long Cur, PCHAR Val, PCHAR Sec="", PCHAR Key="", bool ZeroIsOff=false);
void       	WinClick(CXWnd *Wnd, PCHAR ScreenID, PCHAR ClickNotification, DWORD KeyState=0);
bool       	WinState(CXWnd *Wnd);
long       CursorRandom      = 0;        // Cursor Random Wait
DWORD      CursorTimer       = 0;        // Cursor Timer
long       LootMeHandle      = false;    // LootMe Handle?
long       LootMeHandle2      = false;
char       CorpseName[128];              // Corpse Name?
bool       CorpseDone        = false;    // Corpse Done Looting?
bool       CorpseMine        = false;    // Corpse Mine Flags?
long       CorpseLast        = 0;        // Corpse Last Slot Looted?
long       CorpseFind        = 0;        // Corpse Find Item Total?
DWORD      CorpseOpen        = 0;        // Corpse Open Time Counters?
DWORD      CorpseTime        = 0;        // Corpse Time Counters?
long       AutoRezAccept  = false;    // Take Rez box?
int        AutoRezPct     = 0;        // Take Rez %
long       AutoRezSpawn    = false;    // Let respawn window time out or port to bind.
DWORD      AutoRezTimer   = 0;       // How long after zone to take rez.
long       HaveIBeenRezzed = false;
long ClickWait=0;
long LootWait=0;
long RezDone = false;
long RezClicked = false;
long LootSilent = false;
char szCommand[MAX_STRING];
long RezCommandOn = false;
char szTemp[MAX_STRING];
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

bool WinState(CXWnd *Wnd) {
  return (Wnd && ((PCSIDLWND)Wnd)->Show);
}

void WinClick(CXWnd *Wnd, PCHAR ScreenID, PCHAR ClickNotification, DWORD KeyState) {
  if(Wnd) if(CXWnd *Child=Wnd->GetChildItem(ScreenID)) {
    BOOL KeyboardFlags[4];
    *(DWORD*)&KeyboardFlags=*(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags;
    *(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags=KeyState;
    SendWndClick2(Child,ClickNotification);
    *(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags=*(DWORD*)&KeyboardFlags;
  }
}

long SetLONG(long Cur,PCHAR Val, PCHAR Sec, PCHAR Key, bool ZeroIsOff,long Maxi) {
  char ToStr[16]; char Buffer[128]; long Result=atol(Val);
  if(Result && Result>Maxi) Result=Maxi; itoa(Result,ToStr,10);
  if(Sec[0] && Key[0]) WritePrivateProfileString(Sec,Key,ToStr,INIFileName);
  sprintf(Buffer,"%s::%s (\ag%s\ax)",Sec,Key,(ZeroIsOff && !Result)?"\aroff":ToStr);
  WriteChatColor(Buffer);
  return Result;
}

long SetBOOL(long Cur, PCHAR Val, PCHAR Sec, PCHAR Key) {
  char buffer[128]; long result=0;
  if(!strnicmp(Val,"false",5) || !strnicmp(Val,"off",3) || !strnicmp(Val,"0",1))    result=0;
  else if(!strnicmp(Val,"true",4) || !strnicmp(Val,"on",2) || !strnicmp(Val,"1",1)) result=1;
  else result=(!Cur)&1;
  if(Sec[0] && Key[0]) WritePrivateProfileString(Sec,Key,result?"1":"0",INIFileName);
  sprintf(buffer,"%s::%s (%s)",Sec,Key,result?"\agon\ax":"\agoff\ax");
  WriteChatColor(buffer);
  return result;
}

long InStat() {
  Conditions=0x00000000;
  if(WinState(FindMQ2Window("GuildTributeMasterWnd"))) 					Conditions|=0x0001;
  if(WinState(FindMQ2Window("TributeMasterWnd")))      					Conditions|=0x0002;
  if(WinState(FindMQ2Window("GuildBankWnd")))          					Conditions|=0x0004;
  if(WinState((CXWnd*)pTradeWnd))                      					Conditions|=0x0008;
  if(WinState((CXWnd*)pMerchantWnd))                   					Conditions|=0x0010;
  if(WinState((CXWnd*)pBankWnd))                       					Conditions|=0x0020;
  if(WinState((CXWnd*)pGiveWnd))                       					Conditions|=0x0040;
  if(WinState((CXWnd*)pSpellBookWnd))                  					Conditions|=0x0080;
  if(WinState((CXWnd*)pLootWnd))                       					Conditions|=0x0200;
  if(WinState((CXWnd*)pInventoryWnd))                  					Conditions|=0x0400;
  if(WinState((CXWnd*)pCastingWnd))                    					Conditions|=0x1000;
  if(GetCharInfo()->standstate==STANDSTATE_CASTING)    					Conditions|=0x2000;
  if(((((PSPAWNINFO)pCharSpawn)->CastingAnimation)&0xFF)!=0xFF) Conditions|=0x4000;
  if(GetCharInfo()->Stunned)                           					Conditions|=0x0100;
  if((Conditions&0x0600)!=0x0600 && (Conditions&0x0600)) 					Conditions|=0x0800;
  return Conditions;
}

PCONTENTS CursorContents() {
  return GetCharInfo2()->Cursor;
}


PCHAR LootSlot[]=
{
  "LW_LootSlot0",  "LW_LootSlot1",  "LW_LootSlot2",  "LW_LootSlot3",
  "LW_LootSlot4",  "LW_LootSlot5",  "LW_LootSlot6",  "LW_LootSlot7",
  "LW_LootSlot8",  "LW_LootSlot9",  "LW_LootSlot10", "LW_LootSlot11",
  "LW_LootSlot12", "LW_LootSlot13", "LW_LootSlot14", "LW_LootSlot15",
  "LW_LootSlot16", "LW_LootSlot17", "LW_LootSlot18", "LW_LootSlot19",
  "LW_LootSlot20", "LW_LootSlot21", "LW_LootSlot22", "LW_LootSlot23",
  "LW_LootSlot24", "LW_LootSlot25", "LW_LootSlot26", "LW_LootSlot27",
  "LW_LootSlot28", "LW_LootSlot29", "LW_LootSlot30", "LW_LootSlot31"
};

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

bool ShouldILoot(PCONTENTS Item) {
	if(CorpseMine) return true;
  return false;
}

bool GotCorpseName(PSTR Buffer) {
  Buffer[0]=0;
  if(pLootWnd) if(CXWnd *Child=(CXWnd*)pLootWnd->GetChildItem("LW_CorpseName")) {
    char InputCXStr[128];
    ZeroMemory(InputCXStr,sizeof(InputCXStr));
    GetCXStr(Child->WindowText,InputCXStr,sizeof(InputCXStr));
    if(PCHAR CorpsePTR=strstr(InputCXStr,"'s corpse")) CorpsePTR[0]=0;
    if(!pActiveCorpse && InputCXStr[0]) SetCXStr(&Child->WindowText,Buffer);
    else strcpy(Buffer,InputCXStr);
  }
  return (Buffer[0]!=0);
}

BOOL IsWindowOpen(PCHAR WindowName)
{
   PCSIDLWND pWnd=(PCSIDLWND)FindMQ2Window(WindowName);
   if (!pWnd) return false;
   return (BOOL)pWnd->Show;
}




int ExpRezBox(void)
{

   CXWnd *Child;
   CXWnd *pWnd;
   char InputCXStr[128],*p;
   int v;

   pWnd=(CXWnd *)FindMQ2Window("ConfirmationDialogBox");
   if(pWnd)
   {
      if (((PCSIDLWND)(pWnd))->Show==0) return -1;
      Child=pWnd->GetChildItem("cd_textoutput");
      if(Child)
      {
         ZeroMemory(InputCXStr,sizeof(InputCXStr));
         GetCXStr(Child->SidlText,InputCXStr,sizeof(InputCXStr));
         p = strstr(InputCXStr,"(");
         if (!p) return -1;
         v = atoi(p+1);
         p = strstr(p,"percent");
         if (!p) return -1;

         return v;
      }
   }
   return -1;
}



void AutoRezCommand(PSPAWNINFO pCHAR, PCHAR zLine) {
   bool ShowInfo=false;
   bool NeedHelp=false;
  char Parm1[MAX_STRING];
  char Parm2[MAX_STRING];
  GetArg(Parm1,zLine,1);
  GetArg(Parm2,zLine,2);

  if(!stricmp("help",Parm1)) NeedHelp=true;
//Accept rez?
  else if(!stricmp("accept",Parm1) && (!stricmp("on",Parm2)))
     AutoRezAccept=SetBOOL(AutoRezAccept ,Parm2 ,"MQ2Rez","Accept");
  else if(!stricmp("accept",Parm1) && (!stricmp("off",Parm2)))
     AutoRezAccept=SetBOOL(AutoRezAccept ,Parm2,"MQ2Rez","Accept");
//What percent?
  else if(!stricmp("pct",Parm1)) {
     WritePrivateProfileString("MQ2Rez","RezPct",Parm2,INIFileName);
     AutoRezPct=atoi(Parm2);
  }
//Should I spawn first?
  else if(!stricmp("spawn",Parm1) && (!stricmp("on",Parm2)))
     AutoRezSpawn=SetBOOL(AutoRezSpawn ,Parm2 ,"MQ2Rez","Spawn");
  else if(!stricmp("spawn",Parm1) && (!stricmp("off",Parm2)))
     AutoRezSpawn=SetBOOL(AutoRezSpawn ,Parm2,"MQ2Rez","Spawn");
//Should I loot my corpse?
  else if(!stricmp("loot",Parm1) && (!stricmp("on",Parm2)))
    	LootMeHandle=SetBOOL(LootMeHandle ,Parm2 ,"MQ2Rez","Active");
  else if(!stricmp("loot",Parm1) && !stricmp("off",Parm2))
    	LootMeHandle=SetBOOL(LootMeHandle ,Parm2,"MQ2Rez","Active");
//Toggle silent looting
  else if(!stricmp("silent",Parm1) && !stricmp("on",Parm2))
  		LootSilent=SetBOOL(LootSilent ,Parm2,"MQ2Rez","Silent");
  else if(!stricmp("silent",Parm1) && !stricmp("off",Parm2))
  		LootSilent=SetBOOL(LootSilent ,Parm2,"MQ2Rez","Silent");
//Do I want a command executed after being rezed?
  else if(!stricmp("command",Parm1) && !stricmp("on",Parm2))
  		LootSilent=SetBOOL(LootSilent ,Parm2,"MQ2Rez","RezCommandOn");
  else if(!stricmp("command",Parm1) && !stricmp("off",Parm2))
  		LootSilent=SetBOOL(RezCommandOn ,Parm2,"MQ2Rez","RezCommandOn");
//What command should I execute?
 else if(!stricmp("setcommand",Parm1)) {
	  WritePrivateProfileString("MQ2Rez","Command Line",Parm2,INIFileName);
	  WriteChatf("Command set to: \ag%s\ax",Parm2);
  }
//Help??
  else if(!stricmp("",Parm1))
  {
     ShowInfo=TRUE;
     NeedHelp=TRUE;
  }
  if(NeedHelp) {
   WriteChatColor("Usage:");
   WriteChatColor("/rez -> displays settings");
   WriteChatColor("/rez accept on|off -> Toggle auto-accepting rezbox");
   WriteChatColor("/rez spawn  on|off -> Toggles going to bind point after death");
   WriteChatColor("/rez pct # -> Autoaccepts rezes only if they are higher than # percent");
   WriteChatColor("/rez loot on|off -> Toggle looting corpse when opened and when rezzed");
   WriteChatColor("/rez silent -> Toggle messages for looting individual items");
   WriteChatColor("/rez command on|off -> Toggle use of a command after looting out corpse");
   WriteChatColor("/rez setcommand mycommand -> Set the command that you want.");
   WriteChatColor("/rez help");
  }
  if (ShowInfo)
  {
     WriteChatf("MQ2Rez Accept(\ag%s\ax).",(AutoRezAccept?"on":"off"));
     WriteChatf("MQ2Rez Spawn(\ag%s\ax).",(AutoRezSpawn?"on":"off"));
     WriteChatf("MQ2Rez Loot(\ag%s\ax).",(LootMeHandle?"on":"off"));
     WriteChatf("MQ2Rez AcceptPct(\ag%d\ax).",AutoRezPct);
     WriteChatf("MQ2Rez Silent(\ag%s\ax).",(LootSilent?"on":"off"));
     WriteChatf("MQ2Rez Command(\ag%s\ax).",(RezCommandOn?"on":"off"));
     strcpy(szTemp,szCommand);
     WriteChatf("Command line set to: \ag%s\ax",szTemp);
  }
}

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

PLUGIN_API VOID SetGameState(DWORD GameState) {
  if(GameState==GAMESTATE_INGAME) {
  	if(!Initialized) {
      Initialized=true;
      sprintf(INIFileName,"%s\\%s_%s.ini",gszINIPath,EQADDR_SERVERNAME,GetCharInfo()->Name);
      LootMeHandle =GetPrivateProfileInt("MQ2Rez","Active" ,0,INIFileName);
      AutoRezAccept=GetPrivateProfileInt("MQ2Rez","Accept" ,0,INIFileName);
      AutoRezSpawn =GetPrivateProfileInt("MQ2Rez","Spawn"  ,0,INIFileName);
      AutoRezPct   =GetPrivateProfileInt("MQ2Rez","RezPct" ,0,INIFileName);
      LootSilent   =GetPrivateProfileInt("MQ2Rez","Silent" ,0,INIFileName);
      RezCommandOn =GetPrivateProfileInt("MQ2Rez","RezCommandOn" ,0,INIFileName);
      GetPrivateProfileString("MQ2Rez","Command Line","DISABLED",szTemp,MAX_STRING,INIFileName);
      if(!strcmp(szTemp,"DISABLED")) {
		  RezCommandOn = false;
	  } else {
		  strcpy(szCommand,szTemp);
	  }
    }
  } else if(GameState!=GAMESTATE_LOGGINGIN) {
  	if(Initialized) {
  		LootMeHandle=0;
  		Initialized=0;
    }
  }
}

VOID Rezzy(PSPAWNINFO pChar, PCHAR szLine) {
	DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_OptionsList listselect 2");
	DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_SelectButton leftmouseup");
	RezClicked = true;
}

PLUGIN_API VOID InitializePlugin() {
  AddCommand("/rezzme",Rezzy);
  AddCommand("/rez",AutoRezCommand);
}

PLUGIN_API VOID ShutdownPlugin() {
  RemoveCommand("/rez");
  RemoveCommand("/rezzme");
}

typedef struct _FIXLOOTWINDOW {
/*0x000*/ struct _CSIDLWND Wnd;
/*0x160*/ BYTE      Unknown0x160[0x08];
/*0x168*/ DWORD     ItemSlot[0x22];
/*0x1f0*/ PCONTENTS ItemDesc[NUM_INV_SLOTS];
} FIXLOOTWINDOW, *PFIXLOOTWINDOW;

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

PLUGIN_API VOID OnPulse() {
	if (!AutoRezAccept && LootMeHandle) LootMeHandle2= true;

if (RezClicked && ClickWait>35)
	      {
			  DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_OptionsList listselect 2");
	      if(ClickWait>75) return;
	         DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_SelectButton leftmouseup");
	         ClickWait=0;
	         RezClicked=false;
	         RezDone = true;
	         return;
	  }
else if(RezClicked) {
		ClickWait++;
	  return;
}

	if(RezDone && LootWait>35) {

		         DoCommand(GetCharInfo()->pSpawn,"/target mycorpse");
			if(LootWait>65) return;
		         DoCommand(GetCharInfo()->pSpawn,"/loot");
		    if(LootWait>75) return;

			  LootWait=0;
			  RezDone=false;
		      if (LootMeHandle) LootMeHandle2 = true;
		      return;
}
	else if (RezDone) {
		LootWait++;

		return;
	}
	   static int RespawnWndCnt = 0;
	   static int RezBoxCnt = 0;

	   if (IsWindowOpen("RespawnWnd")) {
	      RespawnWndCnt++;
	   }
	   else
	      RespawnWndCnt=0;

	if (AutoRezAccept && (ExpRezBox()>=AutoRezPct) ) {
	      RezBoxCnt++;
	}
	   else
	      RezBoxCnt=0;
	   if (AutoRezSpawn && RespawnWndCnt)
	   {
	      WinClick(FindMQ2Window("RespawnWnd"),"RW_SelectButton","leftmouseup",1);
	      return;
	   }
	   if (AutoRezAccept && RezBoxCnt > 0)
	   {
		   WriteChatColor("Accepting Rez now");
		   DoCommand(GetCharInfo()->pSpawn,"/notify ConfirmationDialogBox Yes_Button leftmouseup");
		   RezClicked = true;
	   }
	    if(Initialized && gbInZone && pCharSpawn && GetCharInfo2() && !(PLUGIN_FLAG&InStat())) {
         DWORD PulseTimer=(DWORD)clock();
	if(LootMeHandle2 && ((PSPAWNINFO)pCharSpawn)->CastingSpellID==NOID) {
        if(GotCorpseName(CorpseName)) {
           if(!CorpseOpen) {
          CorpseMine=(0==stricmp(CorpseName,GetCharInfo()->Name)); if(!CorpseMine) return;
          WriteChatf("MQ2Rez::\ayLOOTING\ax <\ag%s\ax>.",CorpseName);
           CorpseTime=PulseTimer+LOOTME_WAIT;
           CorpseOpen=PulseTimer+500;
           CorpseDone=false;
          CorpseLast=-1;
          CorpseFind=0;
         }
        for(int slot=CorpseFind; slot<=NUM_INV_SLOTS; slot++)
           if(((PFIXLOOTWINDOW)pLootWnd)->ItemSlot[slot]!=0xFFFFFFFF) {
              CorpseTime+=LOOTME_MORE;
              CorpseFind++;
           }
          if(PulseTimer>CorpseTime) {
            if(!CorpseDone) {
            WriteChatf("MQ2Rez::\ayCLOSING\ax <\ag%s\ax>.",CorpseName);
            WinClick((CXWnd*)pLootWnd,"DoneButton","leftmouseup",0);
              CorpseDone=true;
              LootMeHandle2=false;
            }
          }
          if(!CorpseDone && PulseTimer>CorpseOpen)
             for(int slot=(CorpseLast<0)?0:CorpseLast; slot<CorpseFind; slot++) {
                if(PCONTENTS Corpse=((PFIXLOOTWINDOW)pLootWnd)->ItemDesc[slot]) if(ShouldILoot(Corpse)) {
                  if(slot!=CorpseLast) {
               if(!LootSilent) {
				   WriteChatf("MQ2Rez::\ayLOOTING\ax <\ag%s\ax>.",Corpse->Item->Name);
			   }
                     WinClick((CXWnd*)pLootWnd,LootSlot[slot],"rightmouseup",0);
                     CorpseTime=PulseTimer+LOOTME_WAIT;
                     CorpseLast=slot;
              }
                 return;
               }
             }
        return;
      }
      CorpseOpen=false;
      if(RezCommandOn) {
		  strcpy(szTemp,szCommand);
		  HideDoCommand(GetCharInfo()->pSpawn, szTemp, FromPlugin);
	  }
    }
  }
   }
 
Last edited:

Devlin

Well-known member
Joined
May 22, 2006
Likes
56
RedCents
#2
Well done.

I'm looking forward into having this advance into something even more developed than it is now.(not saying it doesnt rock now)
 

Devlin

Well-known member
Joined
May 22, 2006
Likes
56
RedCents
#3
/bump, since i think this is ingeneous and deserves tons of credit to thez for helping the redguides community
 

odessa

Well-known member
Joined
Oct 20, 2005
Likes
123
RedCents
30¢
#4
#define PLUGIN_NAME "MQ2Cursor" // Plugin Name

I am guessing you forgot to change that :)
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#5
*cough* Yeah. I was more focused on getting it working and cutting out the extra code than the nittygritty details. That's the next version ><
 
Joined
Jul 17, 2005
Likes
25
RedCents
21¢
#6
Nice work Z :D
I'm curious though. Does this have the ability to tell if you are being given a 90% or lower rez, and not accept it. Do you plan to eventually include a way to set an acceptable prefered rez % ?
Also how does it handle being chain rezed in raid situations? With this pluged in will it just keep taking rezes untill the user /autorez accept off or unplugs it; Or is there some a check to see if you have regained exp from the rez and auto shut the function down?
If not there are some things to tinker with. :p

Dirty
' . '
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#7
Does this have the ability to tell if you are being given a 90% or lower rez, and not accept it. Do you plan to eventually include a way to set an acceptable prefered rez % ?
It does not have that ability yet, I'll look into that.

Also how does it handle being chain rezed in raid situations? With this pluged in will it just keep taking rezes untill the user /autorez accept off or unplugs it; Or is there some a check to see if you have regained exp from the rez and auto shut the function down?
It doesn't do that either...good ideas. I have an idea on how I could do that...require the rez window to have opened once since your last rez that was handled. I'll code that up and add that in to the next version.
 

1997S10ss

New member
Joined
May 24, 2005
Likes
3
RedCents
#8
Nice one TheZ... I'll have to give this a shot the next time i die... I just tried the other Rezz plugin today and thought that was awesome... Nice to see it taken once step forward.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#9
Finally updated. Everything should be working right.

Changes:
-Condensed all of the rez stuff into the "/rez" command with options as listed above.
-Added in the requested change to have a minimum rez level

DLL has been updated as well. Please let me know if you have any problems.
 

Blaine

New member
Joined
Sep 29, 2006
Likes
0
RedCents
#10
is it sposed to fully loot your corpse? i have it set to take the rez and auto loot but all it does is open the loot window and sit there, not sure if i'm missing something, i use an auto loot macro but it only works after i take rez
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#11
Try reDLing the dll. I fixed that issue and posted it, guess I forgot to bump the post.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#12
Updated to add in the /rez silent command.
 

larry1024

New member
Joined
Mar 8, 2006
Likes
2
RedCents
#13
I'm not getting any info if i just type /rez; though that would display the current settings.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#14
I need some people to test out a new version of this code that includes a feature which allows you to set a command to be executed once your corpse has been looted. Please send me a PM if you are able.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#15
BUMP...new version posted that allows you to define a command or series of commands to be executed after you have looted your corpse. Using the /rezzme command will now cause the plugin to loot your corpse like a regular rez if looting is enabled.

Enjoy!

The format for the new command is as follows:
Rich (BB code):
/rez command on|off -> Toggle use of a command after looting out corpse

/rez setcommand "mycommand" -> Set the command that you want.
The "mycommand" must be formatted like this: "/memset group" or "/multiline ; /sit ; /memset group ; /mac rezbuffs" etc. If you can't get that to work, the command can be manually set in the INI file, too.
 

Devlin

Well-known member
Joined
May 22, 2006
Likes
56
RedCents
#16
Very Very Nice TheZ.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#17
Small update to the code. The "/rez" command which shows you the commands / settings will now show you your OnRez command, when you change the command it should echo, and I changed the way the command is done a small bit, which might help some people that have been having problems.
 

thez

Well-known member
Joined
Jan 9, 2006
Likes
423
RedCents
60¢
#18
Updated source and DLL for TBS expansion.

Since the Redquest one isn't updated, you'll need to overwrite its DLL with this one to get the working version.
 
Joined
Sep 20, 2005
Likes
118
RedCents
643¢
#19
Added delay to mq2rez

Rich (BB code):
/rez delay # -> Delay # seconds before taking rez
Default is 0, like existing instant accept.

Also updated output when toggling options, and the command after rez works correctly now.

Rich (BB code):
/rez command on|off -> Toggle use of a command after taking rez
/rez setcommand mycommand -> Set the command that you want.
Examples:

Takes rez after box has been up for 3 seconds.
Rich (BB code):
/rez delay 3
Sit after getting a rez. There is a built in 4 second delay after zoning or accepting rez before the command is actually executed to account for lag.
Rich (BB code):
/rez command on
/rez setcommand /sit
Any issues let me know.
 
Joined
Jun 15, 2011
Likes
66
RedCents
2,331¢
#21
MQ2Rez - Plugin form of Wait4Rez.mac.

Rich (BB code):
/rez -> displays settings
/rez accept on|off -> Toggle auto-accepting rezbox
/rez spawn  on|off -> Toggles going to bind point after death
/rez pct # -> Autoaccepts rezes only if they are higher than # percent
/rez loot on|off -> Toggle looting corpse when opened and when rezzed
/rez command on|off -> Toggle use of a command after looting out corpse
/rez setcommand "mycommand" -> Set the command that you want to be activated after you are rezzed. 
/rez help
To turn OFF the most annoying feature ever released in a plugin. VTell on death
Rich (BB code):
/rez voice OFF
 
Last edited by a moderator:
Joined
Sep 20, 2005
Likes
118
RedCents
643¢
#22
Added option for how long to wait before returning to bind if no rez

Rich (BB code):
/rez spawn delay 60
/rez spawn on
This will wait 60 seconds for a rez and then return to bind. Defaults to 0 which gives previous behavior. Maskoi you have updated source.
 

Attachments

jimbob

Moderator
Joined
May 31, 2014
Likes
95
RedCents
2,088¢
#23
I don't know if this is the source RG uses to update MQ2Rez, but I made a change to fix an issue with rezzing in PoWar. I was told that the listbox is backwards in PoWar, so rezzes don't work properly. So, I updated MQ2Rez to look for the listbox item that is labeled "Resurrect", and select that one, instead of just selecting #2... It worked fine in my testing of zones outside PoWar, but I have not tested it in PoWar. The source I used is in the thread below:

http://www.macroquest2.com/phpBB3/viewtopic.php?p=170160#p170160

I can compile and upload a .dll if anyone wants to test, so it can be added to the RG compile.
 

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#24
I would test it in Powar before posting.
 

jimbob

Moderator
Joined
May 31, 2014
Likes
95
RedCents
2,088¢
#25
I was going to do that tonight. I forgot earlier, and my server's going down now... So, it will have to wait. :)
 

calaxa

New member
Joined
Jul 21, 2014
Likes
0
RedCents
1,667¢
#26
Jim can you recompile this plugin for new update? I was going to test this today
 

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#28
That version of MQ2Rez is ooold. I am surprised it even works.
 

calaxa

New member
Joined
Jul 21, 2014
Likes
0
RedCents
1,667¢
#29
where's the source for a newer one? I'm tired of having to rez twice in plane of war
 

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#30
We have put some resources in our version so its closed. What exactly is the problem with plane of war Rezs?
Give me a screen shot if you can
 

jimbob

Moderator
Joined
May 31, 2014
Likes
95
RedCents
2,088¢
#31
Here's a compile. Doing some PoWar shit now, so I will test it.
 

Attachments

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#32
I see it now. why the fuck did they do that?
 
Joined
Jan 20, 2013
Likes
66
RedCents
451¢
#33
im still using mq2rez from macroquest2.com :) People wont share source for anyone thats been updated in the last 4 years. After a year of asking I just moved on.
 

calaxa

New member
Joined
Jul 21, 2014
Likes
0
RedCents
1,667¢
#34
They did this whole zone as anti pet, anti box, anti bot. It's always a complete cluster fuck going there but it's easy to get loot there. I even afk farm named but eventually I come back to half my force ending up in the entrance of the mines which is a pain in the ass.
 

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#35
Did not work. Notice the weird small r in the box
First rez message

rez1.jpg

After time out spawns back into plane of war somewhere then was killed again

rez2.jpg
 

jimbob

Moderator
Joined
May 31, 2014
Likes
95
RedCents
2,088¢
#36
Cool. I'll do some testing and update. That way, you can incorporate the changes into the RG version. I am just trying to help fellow MQ2ers. :)
 

Maskoi

So old and salty he grew scales
Moderator
Joined
Sep 28, 2005
Likes
603
RedCents
67,527¢
#37
The zone is totally fucked up. No way you can fix this unless you are in the zone testing.
 

jimbob

Moderator
Joined
May 31, 2014
Likes
95
RedCents
2,088¢
#38
Also, if you look at the source code I posted, instead of checking if you're in PoWar and selecting the first item instead of the second on the rez window, I attempted to get the text from the listbox and check for "Resurrect"... It seemed to work fine in the zones I tested, but I hadn't been able to test it in PoWar. The idea was that if it did work, it should work regardless of the zone... Anyway, I'll get back on it tonight or tomorrow, and see what's going on.

- - - Updated - - -

Yeah, that's what I intend to do this time, so I can see what the plugin is doing realtime. :)

- - - Updated - - -

I would have tested it last night, but I was there with guildies, and I had to tank... lol

- - - Updated - - -

I made a silly error in the code. It is fixed now, and appears to be working. :) I'll kill off my enchanter a couple more times to confirm.

- - - Updated - - -

It definitely works in powar.

Issue was in:
Rich (BB code):
int SelectResurrect(void)
{
	CListWnd *Child;
	CXWnd *pWnd;
	CXStr Text;
	char buf[2048];
	int x=0;

	pWnd=(CXWnd *)FindMQ2Window("RespawnWnd");
	if(!pWnd) return -1;
	if(((PCSIDLWND)(pWnd))->dShow==0) return -1;
	Child=(CListWnd *)pWnd->GetChildItem("rw_optionslist");
	if(!Child) return -1;
	for(x=0; x<Child->Items; x++)
	{
		memset(buf,0,2048);
		Child->GetItemText(&Text,x,1);
		GetCXStr(Text.Ptr, buf, 2048);
		
		//DebugSpew("Item %i: %s", x, buf);
		WriteChatf("MQ2Rez::\aySelectResurrect\ax <\ag %i, %s \ax>.", x, buf);
		if(_strnicmp(buf,"Resurrect",9)==0)
		{
			SendListSelect("RespawnWnd", "RW_OptionsList", x); // I had SendListSelect("RespawnWnd", "RW_OptionsList", 1); from my initial test compile... I forgot to change the 1 to x...
			//DebugSpew("Selected %i: %s", x, buf);
			WriteChatf("MQ2Rez::\aySelectResurrect\ax <\ag %i, %s \ax>.", x, buf);
		}
	}
}
I'll update the code on the MQ2 website. RG is welcome to incorporate this change in their release.

How it works... Instead of:
Rich (BB code):
DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_OptionsList listselect 2");
We use:
Rich (BB code):
SelectResurrect();
The SelectResurrect function selects the proper option from the listbox, regardless of zone. It looks for "Resurrect" in the second column, and selects the row it finds it in. Then, the rest of the plugin operates like before. I left the old code there, commented out, in case it's wanted for something else... I'll clean it up a little, and add a break in the for loop when we find "Resurrect", and re-submit the changes to MQ2 forum.
 

Attachments

Top