Commit ab214606 authored by noobhaxor's avatar noobhaxor

Merge remote-tracking branch 'refs/remotes/origin/master' into Automacros-dev

parents 081c662c 5c9b9f4b
This diff is collapsed.
This diff is collapsed.
......@@ -5,13 +5,14 @@
// v1.03 :: EqMule - 2015-03-09
// v1.04 :: Ctaylor22 - 2016-07-22
// v1.05 :: Sym - 2017-05-04
// v1.06 :: Plure - 2017-05-04
#include "../MQ2Plugin.h"
#include <vector>
#include "mmsystem.h"
#pragma comment(lib, "winmm.lib")
PLUGIN_VERSION(1.05);
PLUGIN_VERSION(1.06);
//#pragma warning(disable:4244)
PreSetup("MQ2Posse");
......@@ -24,6 +25,9 @@ vector <string> vNames;
vector <string> vCommands;
SEARCHSPAWN mySpawn;
//MQ2EQBC shit
bool(*fAreTheyConnected)(char* szName);
bool bPosseEnabled = false;
//bool bZoning = false;
bool bInitDone = false;
......@@ -580,6 +584,37 @@ VOID PosseCommand(PSPAWNINFO pChar, PCHAR zLine) {
}
}
PMQPLUGIN Plugin(char* PluginName)
{
long Length = strlen(PluginName) + 1;
PMQPLUGIN pLook = pPlugins;
while (pLook && _strnicmp(PluginName, pLook->szFilename, Length)) pLook = pLook->pNext;
return pLook;
}
bool HandleEQBC(void)
{
unsigned short sEQBCConnected = 0;
bool bEQBCLoaded = false;
unsigned short(*fisConnected)() = NULL;
fAreTheyConnected = NULL;
if (PMQPLUGIN pLook = Plugin("mq2eqbc"))
{
fisConnected = (unsigned short(*)())GetProcAddress(pLook->hModule, "isConnected");
fAreTheyConnected = (bool(*)(char* szName))GetProcAddress(pLook->hModule, "AreTheyConnected");
bEQBCLoaded = true;
}
if (fisConnected && bEQBCLoaded)
{
sEQBCConnected = fisConnected();
}
if (fisConnected && fAreTheyConnected && sEQBCConnected && bEQBCLoaded)
{
return true;
}
return false;
}
BOOL CheckNames(PCHAR szName) {
CHAR szTemp[MAX_STRING];
if (gGameState==GAMESTATE_INGAME) {
......@@ -592,6 +627,13 @@ BOOL CheckNames(PCHAR szName) {
return true;
}
}
if (HandleEQBC())
{
if (fAreTheyConnected(szName))
{
return true;
}
}
}
}
return false;
......
|---------------------------------------------------------------------------------
|
| KeepToonBuffed.mac by TreeHuginDruid -- Last Edited 5/21/2017
| KeepToonBuffed.mac by TreeHuginDruid -- Last Edited 5/24/2017
|
| This macro is designed to allow an out of group PowerLeveling toon
| to be able to target members of a low level group, heal,
......@@ -27,7 +27,7 @@ Sub Main
|==================== DO NOT ALTER THESE VALUES ====================
/declare MacroName string outer KeepToonBuffed
/declare KeepToonBuffVer string outer 1.8.5
/declare KeepToonBuffVer string outer 1.9.0
/declare IniFileName string outer ${MacroName}_${Me.CleanName}.ini
/call CreateIni
......@@ -90,7 +90,6 @@ Sub Main
|---------------------------------------------------------------------------------
:loop
/if (${HealsOn}) /call CheckMyHealth
/if (${HealsOn}) /call CheckTargetHealth
/if (${BuffsOn}) /call MaintainTargetBuffs
......@@ -218,41 +217,43 @@ Sub CheckMyHealth
|--------------------------------------------------------------------------------
Sub CheckTargetHealth
/declare i int local
/declare j int local
/for i 1 to ${NumberOfToons}
/for j 1 to ${NumberOfToons}
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${i}]}].ID} && ${MyBuffTargetName[${i}].NotEqual[null]}) {
/if (${Debug}) /echo Attempting to target (${MyBuffTargetName[${i}]}) for health check.
/squelch /target id ${Spawn[=${MyBuffTargetName[${i}]}].ID} pc targetable
/delay 10
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${i}]}].ID} || !${Target.Type.Equal[pc]}) /next i
/if ((${Target.PctHPs}<=${HealPct}) && (${Target.Distance}<=${HealSpellRange})) {
|--------------------------------------------------------------------------------
| ADMIN DEBUG FOR HEAL CODE
|--------------------------------------------------------------------------------
/if (${AdminDebug}) {
/echo -----------
/if ((${Target.PctHPs}<=${HealPct}) && (${Target.Distance}<=${HealSpellRange}) && (${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})) {
/echo PC:${Target.Type.Equal[pc]} HEAL:${HealSpell} MANA:(${Me.CurrentMana}>${Spell[${HealSpell}].Mana}) INRANGE:(${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})
/echo "${TargetBuffName[${i}]}" = Heal Should Cast
} else {
/echo PC:${Target.Type.Equal[pc]} HEAL:${HealSpell} MANA:(${Me.CurrentMana}>${Spell[${HealSpell}].Mana}) INRANGE:(${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})
/echo "${TargetBuffName[${i}]}" = Heal will NOT Cast
/echo -----------
/delay 5s
}
}
|--------------------------------------------------------------------------------
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${j}]}].ID} && ${MyBuffTargetName[${j}].NotEqual[null]}) {
/if (${Debug}) /echo Attempting to target (${MyBuffTargetName[${j}]}) for health check.
/squelch /target id ${Spawn[=${MyBuffTargetName[${j}]}].ID} ${Spawn[${MyBuffTargetName[${j}]}].Type} targetable
/delay 10
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${j}]}].ID} || !${Select[${Target.Type},Mercenary,PC,Pet]}) /next j
}
/if (${Debug}) /echo ${MyBuffTargetName[${i}]}'s health at (${Target.PctHPs}), HEAL TIME !!!!
/casting "${HealSpell}" gem8
/call CheckCasting
/call CheckGlobalCooldown
/if ((${Target.PctHPs}<=${HealPct}) && (${Target.Distance}<=${HealSpellRange})) {
|--------------------------------------------------------------------------------
| ADMIN DEBUG FOR HEAL CODE
|--------------------------------------------------------------------------------
/if (${AdminDebug}) {
/echo -----------
/if ((${Target.PctHPs}<=${HealPct}) && (${Target.Distance}<=${HealSpellRange}) && (${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})) {
/echo TargetType:${Select[${Target.Type},Mercenary,PC,Pet]} HEAL:${HealSpell} MANA:(${Me.CurrentMana}>${Spell[${HealSpell}].Mana}) INRANGE:(${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})
/echo "${TargetBuffName[${j}]}" = Heal Should Cast
} else {
/echo TargetType:${Select[${Target.Type},Mercenary,PC,Pet]} HEAL:${HealSpell} MANA:(${Me.CurrentMana}>${Spell[${HealSpell}].Mana}) INRANGE:(${Target.Distance}<=${Spell[${HealSpell}].Range} || ${Target.Distance}<=${Spell[${HealSpell}].AERange})
/echo "${TargetBuffName[${j}]}" = Heal will NOT Cast
/echo -----------
/delay 5s
}
}
|--------------------------------------------------------------------------------
/if (${Debug}) /echo ${MyBuffTargetName[${j}]}'s health at (${Target.PctHPs}), HEAL TIME !!!!
/casting "${HealSpell}" gem8
/call CheckCasting
/call CheckGlobalCooldown
}
/next i
/next j
/squelch /target clear
/return
|---------------------------------------------------------------------------------
......@@ -272,9 +273,9 @@ Sub MaintainTargetBuffs
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${j}]}].ID} && ${MyBuffTargetName[${j}].NotEqual[null]}) {
/if (${Debug}) /echo Attempting to target (${MyBuffTargetName[${j}]}) for buffs.
/squelch /target id ${Spawn[=${MyBuffTargetName[${j}]}].ID} pc targetable
/squelch /target id ${Spawn[=${MyBuffTargetName[${j}]}].ID} ${Spawn[${MyBuffTargetName[${j}]}].Type} targetable
/delay 10
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${j}]}].ID} || !${Target.Type.Equal[pc]}) /next j
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[${j}]}].ID} || !${Select[${Target.Type},Mercenary,PC,Pet]}) /next j
/if (${AssistOn}) /call AssistOnTarget
}
......@@ -290,18 +291,17 @@ Sub MaintainTargetBuffs
}
|--------------------------------------------------------------------------------
/if (!${Target.Buff[${BuffIDName}].ID} && ${Target.Type.Equal[pc]} && (${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) && ${Spell[${SpellToCast}].Stacks} && (${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) && !${Target.Buff[Resurrection Sickness].ID} && !${Target.Buff[Revival Sickness].ID}) {
/if ((${Target.BuffsPopulated}==TRUE) && !${Target.Buff[${BuffIDName}].ID} && ${Select[${Spawn[${MyBuffTargetName[${j}]}].Type},Mercenary,PC,Pet]} && (${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) && ${Spell[${SpellToCast}].Stacks} && (${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) && !${Target.Buff[Resurrection Sickness].ID} && !${Target.Buff[Revival Sickness].ID}) {
|--------------------------------------------------------------------------------
| ADMIN DEBUG FOR BUFF CODE
|--------------------------------------------------------------------------------
/if (${AdminDebug}) {
/echo -----------
/if (!${Target.Buff[${BuffIDName}].ID} && ${Target.Type.Equal[pc]} && (${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) && ${Spell[${SpellToCast}].Stacks} && (${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) && !${Target.Buff[Resurrection Sickness].ID} && !${Target.Buff[Revival Sickness].ID}) {
/echo PC:${Target.Type.Equal[pc]} BUFF:!${Target.Buff[${BuffIDName}].ID} MANA:(${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) STACKS:${Spell[${SpellToCast}].Stacks} INRANGE:(${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) RezSick:!${Target.Buff[Resurrection Sickness].ID} RevivSick:!${Target.Buff[Revival Sickness].ID}
/if ((${Target.BuffsPopulated}==TRUE) && !${Target.Buff[${BuffIDName}].ID} && ${Select[${Spawn[${MyBuffTargetName[${j}]}].Type},Mercenary,PC,Pet]} && (${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) && ${Spell[${SpellToCast}].Stacks} && (${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) && !${Target.Buff[Resurrection Sickness].ID} && !${Target.Buff[Revival Sickness].ID}) {
/echo TargetType:${Select[${Target.Type},Mercenary,PC,Pet]} BUFF:!${Target.Buff[${BuffIDName}].ID} MANA:(${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) STACKS:${Spell[${SpellToCast}].Stacks} INRANGE:(${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) RezSick:!${Target.Buff[Resurrection Sickness].ID} RevivSick:!${Target.Buff[Revival Sickness].ID}
/echo "${BuffIDName}" = Buff is Needed
} else {
/echo PC:${Target.Type.Equal[pc]} BUFF:!${Target.Buff[${BuffIDName}].ID} MANA:(${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) STACKS:${Spell[${SpellToCast}].Stacks} INRANGE:(${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) RezSick:!${Target.Buff[Resurrection Sickness].ID} RevivSick:!${Target.Buff[Revival Sickness].ID}
/echo TargetType:${Select[${Target.Type},Mercenary,PC,Pet]} BUFF:!${Target.Buff[${BuffIDName}].ID} MANA:(${Me.CurrentMana}>${Spell[${SpellToCast}].Mana}) STACKS:${Spell[${SpellToCast}].Stacks} INRANGE:(${Target.Distance}<=${Spell[${SpellToCast}].Range} || ${Target.Distance}<=${Spell[${SpellToCast}].AERange}) RezSick:!${Target.Buff[Resurrection Sickness].ID} RevivSick:!${Target.Buff[Revival Sickness].ID}
/echo "${BuffIDName}" = Buff is NOT Needed
/echo -----------
/delay 5s
......@@ -318,6 +318,7 @@ Sub MaintainTargetBuffs
/next i
/next j
/squelch /target clear
/return
|---------------------------------------------------------------------------------
......@@ -335,12 +336,13 @@ Sub AssistOnTarget
/squelch /target id ${Me.TargetOfTarget.ID}) pet targetable
/delay 10
}
/if (((${Target.Type.Equal[NPC]} || ${Target.Type.Equal[PET]}) && (${Target.PctHPs}>${AssistPct})) || ${Target.Buff[${AssistSpell}].ID}) /return
/if ((${Target.Type.Equal[NPC]} || ${Target.Type.Equal[PET]}) && (${Target.PctHPs}<${AssistPct})) {
/if ((${Target.BuffsPopulated}==TRUE) && ((${Target.Type.Equal[NPC]} || ${Target.Type.Equal[PET]}) && (${Target.PctHPs}>${AssistPct})) || ${Target.Buff[${AssistSpell}].ID}) /return
/if ((${Target.BuffsPopulated}==TRUE) && (${Target.Type.Equal[NPC]} || ${Target.Type.Equal[PET]}) && (${Target.PctHPs}<${AssistPct}) && ${Target.Distance}<=${Spell[${AssistSpell}].Range}) {
/if (${Debug}) /echo Attempting to assist, casting (${AssistSpell}) on (${Target.CleanName}).
/casting "${AssistSpell}" gem8
/call CheckCasting
/call CheckGlobalCooldown
}
}
}
}
......@@ -369,7 +371,7 @@ Sub CheckMana
/if (${HealsOn}) /call CheckMyHealth
/if (${HealsOn}) /call CheckTargetHealth
/if (${BuffsOn}) /call MaintainTargetBuffs
/if (${FollowGroup}) /call FollowAround
/if (${FollowGroup}) /call FollowAround
/delay 6s
/doevents
/if (${Me.Standing} && !${Me.Mount.ID}) /sit
......@@ -391,8 +393,8 @@ Sub CheckMana
Sub FollowAround
/if (${Target.ID}!=${Spawn[=${MyBuffTargetName[1]}].ID} && ${MyBuffTargetName[1].NotEqual[null]}) {
/squelch /target id ${Spawn[=${MyBuffTargetName[1]}].ID} pc targetable
/delay 15
/squelch /target id ${Spawn[=${MyBuffTargetName[1]}].ID} ${Spawn[${MyBuffTargetName[1]}].Type} targetable
/delay 10
}
/if (${Target.Distance} > ${FollowDist}) {
......@@ -400,6 +402,7 @@ Sub FollowAround
/if (${Me.Sitting} && !${Me.Mount.ID}) /stand
/moveto id ${Spawn[=${MyBuffTargetName[1]}].ID} mdist ${MyMDist}
}
/squelch /target clear
/return
|---------------------------------------------------------------------------------
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment