Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
VeryVanilla
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
39
Issues
39
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RG Creators
VeryVanilla
Commits
f181fd9a
Commit
f181fd9a
authored
May 17, 2017
by
Jesse Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated for general release on 5/16. Version 1.00
parent
e60954a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
21 deletions
+35
-21
MQ2AutoLoot/MQ2AutoLoot.cpp
MQ2AutoLoot/MQ2AutoLoot.cpp
+35
-21
No files found.
MQ2AutoLoot/MQ2AutoLoot.cpp
View file @
f181fd9a
...
...
@@ -6,9 +6,8 @@
// and Shutdown for setup and cleanup, do NOT do it in DllMain.
#define PLUGIN_NAME "MQ2AutoLoot" // Plugin Name
#define VERSION 1.00
#define PLUGIN_MSG "\ag[MQ2AutoLoot]\ax "
#define LIVE_VERSION
//#define BETA_VERSION
#define PERSONALBANKER_CLASS 40
#define MERCHANT_CLASS 41
#define GUILDBANKER_CLASS 66
...
...
@@ -16,12 +15,11 @@
#ifndef PLUGIN_API
#include "../MQ2Plugin.h"
PreSetup
(
PLUGIN_NAME
);
PLUGIN_VERSION
(
VERSION
);
#endif PLUGIN_API
#include <chrono>
//typedef std::chrono::high_resolution_clock clock;
//using namespace std::chrono;
//MoveUtils 11.x
PLUGIN_API
bool
bMULoaded
=
false
;
...
...
@@ -29,10 +27,9 @@ bool bMUPointers = false;
bool
*
pbStickOn
;
void
(
*
fStickCommand
)(
PSPAWNINFO
pChar
,
char
*
szLine
);
//MQ2EqBC shit
PLUGIN_API
bool
bEQBCLoaded
=
false
;
bool
bEQBCPointers
=
false
;
bool
*
pbEQBCNames
;
//PLUGIN_API bool bEQBCLoaded = false;
//bool bEQBCPointers = false;
//bool* pbEQBCNames;
...
...
@@ -91,6 +88,7 @@ void DestroyStuff(void);
void
DoLootStuff
(
CHAR
*
szAction
);
void
DoBarterStuff
(
CHAR
*
szAction
);
void
CreateLootEntry
(
CHAR
*
szAction
,
CHAR
*
szEntry
,
PITEMINFO
pItem
);
void
CreateLootINI
(
void
);
#pragma region Inlines
// Returns TRUE if character is in game and has valid character data structures
...
...
@@ -1724,12 +1722,6 @@ void DoBarterStuff(CHAR* szAction)
{
WriteChatf
(
PLUGIN_MSG
":: You need to have least Rain of Fear expansion to use the barter functionality."
);
}
if
(
!
_stricmp
(
szAction
,
"Barter"
))
{
WriteChatf
(
PLUGIN_MSG
":: This command is not activated, it will be added in the next update or two depending on when I get to it."
);
StartLootStuff
=
false
;
return
;
}
// Getting ready to barter by opening the barter window open
if
(
!
_stricmp
(
szAction
,
"Barter"
))
{
...
...
@@ -2498,6 +2490,15 @@ void SetAutoLootVariables()
sprintf_s
(
LootINI
,
"%s
\\
Macros
\\
Loot.ini"
,
gszINIPath
);
// Default location is in your \macros\loot.ini
WritePrivateProfileString
(
GetCharInfo
()
->
Name
,
"lootini"
,
LootINI
,
INIFileName
);
}
LONG
Version
=
GetPrivateProfileInt
(
"Settings"
,
"Version"
,
-
1
,
LootINI
);
if
(
Version
==
-
1
)
{
CreateLootINI
();
CHAR
Version
[
MAX_STRING
]
=
{
0
};
sprintf_s
(
Version
,
"%1.2f"
,
VERSION
);
WritePrivateProfileString
(
"Settings"
,
"Version"
,
Version
,
LootINI
);
}
BarMinSellPrice
=
GetPrivateProfileInt
(
"Settings"
,
"BarMinSellPrice"
,
-
1
,
LootINI
);
if
(
BarMinSellPrice
==
-
1
)
{
...
...
@@ -2516,17 +2517,11 @@ void SetAutoLootVariables()
CursorDelay
=
10
;
WritePrivateProfileString
(
"Settings"
,
"CursorDelay"
,
"10"
,
LootINI
);
}
QuestKeep
=
GetPrivateProfileInt
(
"Settings"
,
"QuestKeep"
,
-
1
,
LootINI
);
if
(
QuestKeep
==
-
1
)
{
QuestKeep
=
10
;
WritePrivateProfileString
(
"Settings"
,
"QuestKeep"
,
"10"
,
LootINI
);
}
SaveBagSlots
=
GetPrivateProfileInt
(
"Settings"
,
"SaveBagSlots"
,
-
1
,
LootINI
);
if
(
SaveBagSlots
==
-
1
)
{
SaveBagSlots
=
0
;
WritePrivateProfileString
(
"Settings"
,
"SaveBagSlots"
,
"
1
"
,
LootINI
);
WritePrivateProfileString
(
"Settings"
,
"SaveBagSlots"
,
"
0
"
,
LootINI
);
}
SpamLootInfo
=
GetPrivateProfileInt
(
"Settings"
,
"SpamLootInfo"
,
-
1
,
LootINI
);
if
(
SpamLootInfo
==
-
1
)
...
...
@@ -2534,6 +2529,12 @@ void SetAutoLootVariables()
SpamLootInfo
=
1
;
WritePrivateProfileString
(
"Settings"
,
"SpamLootInfo"
,
"1"
,
LootINI
);
}
QuestKeep
=
GetPrivateProfileInt
(
"Settings"
,
"QuestKeep"
,
-
1
,
LootINI
);
if
(
QuestKeep
==
-
1
)
{
QuestKeep
=
10
;
WritePrivateProfileString
(
"Settings"
,
"QuestKeep"
,
"10"
,
LootINI
);
}
if
(
GetPrivateProfileString
(
"Settings"
,
"NoDropDefault"
,
0
,
NoDropDefault
,
MAX_STRING
,
LootINI
)
==
0
)
{
sprintf_s
(
NoDropDefault
,
"Quest"
);
...
...
@@ -2682,6 +2683,18 @@ void CreateLootEntry(CHAR* szAction, CHAR* szEntry, PITEMINFO pItem)
}
}
void
CreateLootINI
(
void
)
{
CHAR
INISections
[
MAX_STRING
]
=
"Settings|Global|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z"
;
CHAR
*
pParsedToken
=
NULL
;
CHAR
*
pParsedValue
=
strtok_s
(
INISections
,
"|"
,
&
pParsedToken
);
while
(
pParsedValue
!=
NULL
)
{
WritePrivateProfileString
(
pParsedValue
,
"|==================================="
,
"==================================|"
,
LootINI
);
pParsedValue
=
strtok_s
(
NULL
,
"|"
,
&
pParsedToken
);
}
}
void
AutoLootCommand
(
PSPAWNINFO
pCHAR
,
PCHAR
zLine
)
{
if
(
!
InGameOK
())
return
;
...
...
@@ -2786,6 +2799,7 @@ void AutoLootCommand(PSPAWNINFO pCHAR, PCHAR zLine)
sprintf_s
(
LootINI
,
"%s
\\
Macros
\\
%s.ini"
,
gszINIPath
,
Parm2
);
WritePrivateProfileString
(
GetCharInfo
()
->
Name
,
"lootini"
,
LootINI
,
INIFileName
);
WriteChatf
(
PLUGIN_MSG
":: The location for your loot ini is:
\n
\a
g%s
\a
x"
,
LootINI
);
SetAutoLootVariables
();
}
else
if
(
!
_stricmp
(
Parm1
,
"reload"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment