Skip to content

Commit

Permalink
PoopBlanc - Update
Browse files Browse the repository at this point in the history
- Fix Butt Stuff
- Fix Unload Stuff
- Fix R Stuff
  • Loading branch information
tr33s committed Feb 24, 2017
1 parent 9ee195e commit a3ed88b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Binary file modified PopBlanc/PopBlanc.dll
Binary file not shown.
22 changes: 11 additions & 11 deletions PopBlanc/PopBlanc/PopBlanc.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <map>
#include "PluginSDK.h"
#include "Utility.h"
#include <string>

PluginSetup("PopBlanc - Trees");

IMenu* MainMenu;
Expand Down Expand Up @@ -47,8 +47,7 @@ ISpell2* R;
IUnit* Player;

std::map<ISpell2*, IMenuOption*> SpellMenuMap;

const char* QBuff = "LeblancPMark";
const char* PassiveBuff = "LeblancPMark";
const char* EBuff = "LeblancE";

static bool IsKeyDown(IMenuOption* menuOption)
Expand All @@ -58,15 +57,17 @@ static bool IsKeyDown(IMenuOption* menuOption)

bool IsPassiveActive(IUnit* unit, float delay = 0)
{
auto data = unit->GetBuffDataByName(QBuff);
auto bName = unit->GetType() == FL_CREEP ? "leblancpminion" : PassiveBuff;
auto i = unit->GetBuffDataByName(bName);

if (GBuffData->IsValid(data) && GBuffData->IsActive(data))
if (GBuffData->IsValid(i) && GBuffData->IsActive(i))
{
auto duration = (GGame->Time() - GBuffData->GetStartTime(data)) * 1000;
auto duration = (GGame->Time() - GBuffData->GetStartTime(i)) * 1000;
// can improve this to take into account spell delay + ping/2
return duration >= 1400 && duration < 3800;
}


return false;
}

Expand Down Expand Up @@ -99,17 +100,17 @@ bool bCastSpell(ISpell2* spell, IUnit* target)

bool IsFirstW()
{
return strcmp(Player->GetSpellBook()->GetName(kSlotW), "LeblancW") == 0;
return Player->GetSpellLevel(kSlotW) > 0 && strcmp(Player->GetSpellBook()->GetName(kSlotW), "LeblancW") == 0;
}

bool IsFirstR()
{
return Player->GetSpellBook()->GetToggleState(kSlotR) == 1;
return Player->GetSpellLevel(kSlotR) > 0 && strcmp(Player->GetSpellBook()->GetName(kSlotR), "LeblancRToggle") == 0;;
}

bool IsRActive()
{
return Player->GetSpellBook()->GetToggleState(kSlotR) == 2;
return Player->GetSpellLevel(kSlotR) > 0 && strcmp(Player->GetSpellBook()->GetName(kSlotR), "LeblancR") == 0;;
}

bool CastSecondW()
Expand All @@ -126,7 +127,7 @@ bool CastRSpell(IUnit* target)
}

// must be reworked
if (Utility::CountBuffs(Utility::GetEnemiesInRange(target, 500), QBuff) > 0)
if (Utility::CountBuffs(Utility::GetEnemiesInRange(target, 500), PassiveBuff) > 0)
{
if (bCastSpell(W, target) && IsFirstW() && W->CastOnTargetAoE(target, 3, kHitChanceMedium))
{
Expand Down Expand Up @@ -155,7 +156,6 @@ void PrintBuff(IUnit* unit)

for (auto i : vecBuffs)
{
GBuffData->GetBuffName(i);
GUtility->LogConsole(GBuffData->GetBuffName(i));
}
}
Expand Down
3 changes: 2 additions & 1 deletion PopBlanc/PopBlanc/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
std::vector<IUnit*> enemies;
std::vector<IUnit*> allies;
IUnit* player;
std::vector<int> goodTypes{ FL_HERO, FL_CREEP };
std::vector<int> goodTypes{FL_HERO, FL_CREEP};

Utility::Utility()
{
enemies = GEntityList->GetAllHeros(false, true);
Expand Down

0 comments on commit a3ed88b

Please sign in to comment.