Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

stuff #4426

Merged
merged 14 commits into from
Aug 18, 2021
2 changes: 2 additions & 0 deletions Horion.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
<ClCompile Include="Horion\Module\Modules\TriggerBot.cpp" />
<ClCompile Include="Horion\Module\Modules\Twerk.cpp" />
<ClCompile Include="Horion\Module\Modules\VanillaPlus.cpp" />
<ClCompile Include="Horion\Module\Modules\ViewModel.cpp" />
<ClCompile Include="Horion\Module\Modules\Velocity.cpp" />
<ClCompile Include="Horion\Module\Modules\Waypoints.cpp" />
<ClCompile Include="Horion\Module\Modules\Xray.cpp" />
Expand Down Expand Up @@ -548,6 +549,7 @@
<ClInclude Include="Horion\Module\Modules\TriggerBot.h" />
<ClInclude Include="Horion\Module\Modules\Twerk.h" />
<ClInclude Include="Horion\Module\Modules\VanillaPlus.h" />
<ClInclude Include="Horion\Module\Modules\ViewModel.h" />
<ClInclude Include="Horion\Module\Modules\Velocity.h" />
<ClInclude Include="Horion\Module\Modules\Waypoints.h" />
<ClInclude Include="Horion\Module\Modules\Xray.h" />
Expand Down
15 changes: 9 additions & 6 deletions Horion/Command/Commands/EnchantCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ bool EnchantCommand::execute(std::vector<std::string>* args) {
C_InventoryAction* firstAction = nullptr;
C_InventoryAction* secondAction = nullptr;

ItemDescriptor* desc = nullptr;
desc = new ItemDescriptor((*item->item)->itemId, 0);

if (isAuto) {
{
firstAction = new C_InventoryAction(supplies->selectedHotbarSlot, item, nullptr);
firstAction = new C_InventoryAction(supplies->selectedHotbarSlot, desc, nullptr, item, nullptr, item->count);
if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0)
secondAction = new C_InventoryAction(0, nullptr, item, 32766, 100);
secondAction = new C_InventoryAction(0, nullptr, desc, nullptr, item, item->count, 32766, 100);
else
secondAction = new C_InventoryAction(0, nullptr, item, 507, 99999);
secondAction = new C_InventoryAction(0, nullptr, desc, nullptr, item, item->count, 507, 99999);
manager->addInventoryAction(*firstAction);
manager->addInventoryAction(*secondAction);
delete firstAction;
Expand Down Expand Up @@ -159,10 +162,10 @@ bool EnchantCommand::execute(std::vector<std::string>* args) {

if (isAuto) {
if (strcmp(g_Data.getRakNetInstance()->serverIp.getText(), "mco.mineplex.com") == 0)
firstAction = new C_InventoryAction(0, item, nullptr, 32766, 100);
firstAction = new C_InventoryAction(0, desc, nullptr, item, nullptr, item->count, 32766, 100);
else
firstAction = new C_InventoryAction(0, item, nullptr, 507, 99999);
secondAction = new C_InventoryAction(supplies->selectedHotbarSlot, nullptr, item);
firstAction = new C_InventoryAction(0, desc, nullptr, item, nullptr, item->count, 507, 99999);
secondAction = new C_InventoryAction(supplies->selectedHotbarSlot, nullptr, desc, nullptr, item, item->count);
manager->addInventoryAction(*firstAction);
manager->addInventoryAction(*secondAction);
delete firstAction;
Expand Down
4 changes: 2 additions & 2 deletions Horion/Command/Commands/NbtCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ bool NbtCommand::execute(std::vector<std::string>* args) {
boy->write(build);
delete boy;
} else {
if (pointingStruct->entityPtr != nullptr) {
if (pointingStruct->getEntity() != nullptr) {
if (g_Data.getRakNetInstance()->serverIp.getTextLength() >= 1) {
clientMessageF("%sNBT tags for mobs only works in local world!", RED);
return true;
}
pointingStruct->entityPtr->save(tag.get());
pointingStruct->getEntity()->save(tag.get());
tag->write(build);
} else if (blockActor != nullptr) {
blockActor->save(tag.get());
Expand Down
10 changes: 6 additions & 4 deletions Horion/DrawUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,16 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo
rectPos.w = textPos.y + textHeight + 2.f * textSize;
vec4_t subRectPos = rectPos;
subRectPos.y = subRectPos.w - 1.f * textSize;
fillRectangle(rectPos, MC_Color(13, 29, 48), 0.8f);
fillRectangle(subRectPos, MC_Color(28, 107, 201), 0.9f);
auto nametagsMod = moduleMgr->getModule<NameTags>();
FloppyDolphin57 marked this conversation as resolved.
Show resolved Hide resolved
fillRectangle(rectPos, MC_Color(13, 29, 48), nametagsMod->opacity);
if (nametagsMod->underline) {
fillRectangle(subRectPos, MC_Color(30, 110, 20), 0.9f);
}
drawText(textPos, &text, MC_Color(255, 255, 255), textSize);

static auto nameTagsMod = moduleMgr->getModule<NameTags>();

if (ent->getEntityTypeId() == 63 && nameTagsMod->displayArmor) { // is player, show armor
if (ent->getEntityTypeId() == 319 && nameTagsMod->displayArmor) { // is player, show armor
auto* player = reinterpret_cast<C_Player*>(ent);
float scale = textSize * 0.6f;
float spacing = scale + 15.f;
Expand All @@ -399,7 +402,6 @@ void DrawUtils::drawNameTags(C_Entity* ent, float textSize, bool drawHealth, boo
DrawUtils::drawItem(stack, vec2_t(rectPos.z - 1.f - 15.f * scale, y), 1.f, scale, stack->isEnchanted());
}
}

}
}
}
Expand Down
1 change: 1 addition & 0 deletions Horion/Module/ModuleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void ModuleManager::initModules() {
this->moduleList.push_back(std::shared_ptr<IModule>(new Compass()));
this->moduleList.push_back(std::shared_ptr<IModule>(new Radar()));
this->moduleList.push_back(std::shared_ptr<IModule>(new VanillaPlus()));
this->moduleList.push_back(std::shared_ptr<IModule>(new ViewModel()));
this->moduleList.push_back(std::shared_ptr<IModule>(new Twerk()));
this->moduleList.push_back(std::shared_ptr<IModule>(new FollowPathModule()));

Expand Down
1 change: 1 addition & 0 deletions Horion/Module/ModuleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#include "Modules/Compass.h"
#include "Modules/Radar.h"
#include "Modules/VanillaPlus.h"
#include "Modules/ViewModel.h"
#include "Modules/Twerk.h"

#ifdef _DEBUG
Expand Down
4 changes: 2 additions & 2 deletions Horion/Module/Modules/AutoClicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ void AutoClicker::onTick(C_GameMode* gm) {
if (!moduleMgr->getModule<NoSwing>()->isEnabled())
localPlayer->swingArm();

if (pointing->entityPtr != 0)
gm->attack(pointing->entityPtr);
if (pointing->hasEntity() != 0)
gm->attack(pointing->getEntity());
else if (breakBlocks) {
bool isDestroyed = false;
gm->startDestroyBlock(pointing->block, pointing->blockSide, isDestroyed);
Expand Down
4 changes: 2 additions & 2 deletions Horion/Module/Modules/CrystalAura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void CrystalAura::onTick(C_GameMode* gm) {
CPlace(gm, i->getPos());
else {
auto ptr = g_Data.getClientInstance()->getPointerStruct();
if (ptr->entityPtr == nullptr && ptr->rayHitType == 0)
if (ptr->getEntity() == nullptr && ptr->rayHitType == 0)
CPlace(gm, &ptr->block.toFloatVector());
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ void CrystalAura::onPreRender(C_MinecraftUIRenderContext* renderCtx) {

auto ptr = g_Data.getClientInstance()->getPointerStruct();
if (ptr != nullptr)
if (ptr->entityPtr == nullptr && ptr->rayHitType == 0)
if (ptr->getEntity() == nullptr && ptr->rayHitType == 0)
if (g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 49 ||
g_Data.getLocalPlayer()->region->getBlock(ptr->block)->toLegacy()->blockId == 7) {
DrawUtils::setColor(.75f, .25f, .5f, 1.f);
Expand Down
2 changes: 1 addition & 1 deletion Horion/Module/Modules/MidClick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const char* MidClick::getModuleName() {
}

void MidClick::onTick(C_GameMode* gm) {
C_Entity* entity = g_Data.getClientInstance()->getPointerStruct()->entityPtr;
C_Entity* entity = g_Data.getClientInstance()->getPointerStruct()->getEntity();
if (entity == nullptr)
return;

Expand Down
41 changes: 22 additions & 19 deletions Horion/Module/Modules/NameTags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include "../../../Utils/Target.h"
#include "../ModuleManager.h"

NameTags::NameTags() : IModule(0, Category::VISUAL, "Shows better nametags above players that can be seen from a lot more far aways") {
this->registerBoolSetting("Display Armor", &this->displayArmor, this->displayArmor);
NameTags::NameTags() : IModule(0, Category::VISUAL, "Shows betterar aways") {
this->registerBoolSetting("Underline", &this->underline, this->underline);
this->registerBoolSetting("Armor", &this->displayArmor, this->displayArmor);
this->registerFloatSetting("Opacity", &this->opacity, this->opacity, 0.f, 1.f);
}

NameTags::~NameTags() {
Expand All @@ -14,7 +16,7 @@ const char* NameTags::getModuleName() {
return ("NameTags");
}

void drawNameTags(C_Entity* ent, bool isRegularEntitie) {
void drawNameTags(C_Entity* ent, bool) {
C_LocalPlayer* localPlayer = g_Data.getLocalPlayer();
static auto nameTagsMod = moduleMgr->getModule<NameTags>();

Expand All @@ -29,26 +31,27 @@ void drawNameTags(C_Entity* ent, bool isRegularEntitie) {
DrawUtils::drawNameTags(ent, fmax(0.6f, 3.f / dist));
DrawUtils::flush();
}

}
}

void NameTags::onPreRender(C_MinecraftUIRenderContext* renderCtx) {
C_LocalPlayer* localPlayer = g_Data.getLocalPlayer();
if (localPlayer == nullptr || !GameData::canUseMoveKeys()) return;

if (nameTags.size() > 100)
nameTags.clear();

if (localPlayer != nullptr && GameData::canUseMoveKeys()) {
std::vector<C_Entity*> temp;
for (int i = 0; i < g_Data.getEntityList()->getListSize(); i++)
temp.push_back(g_Data.getEntityList()->get(i));
std::sort(temp.begin(), temp.end(), [localPlayer](const C_Entity* lhs, const C_Entity* rhs) {
return localPlayer->getPos()->dist(*lhs->getPos()) > localPlayer->getPos()->dist(*rhs->getPos());
});
for (C_Entity* ent : temp)
drawNameTags(ent, true);
} else {
nameTags.clear();
}
if (ingameNametagSetting)
if (!gotPrevSetting) {
lastSetting = *ingameNametagSetting;
gotPrevSetting = true;
*ingameNametagSetting = false;
} else
*ingameNametagSetting = false; //disable other ppl's nametags

g_Data.forEachEntity(drawNameTags);
}

void NameTags::onDisable() {
if (ingameNametagSetting && gotPrevSetting) {
*ingameNametagSetting = lastSetting;
gotPrevSetting = false;
}
}
7 changes: 7 additions & 0 deletions Horion/Module/Modules/NameTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ class NameTags : public IModule {
public:
std::set<std::string> nameTags;
bool displayArmor = true;
bool underline = true;
float opacity = 0.2f;
NameTags();
~NameTags();

bool* ingameNametagSetting = nullptr;
bool lastSetting = true;
bool gotPrevSetting = false;

// Inherited via IModule
virtual const char* getModuleName() override;
virtual void onPreRender(C_MinecraftUIRenderContext* renderCtx) override;
virtual void onDisable() override;
};
4 changes: 2 additions & 2 deletions Horion/Module/Modules/Nbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ void Nbt::onTick(C_GameMode* gm) {
PointingStruct* pointingStruct = g_Data.getClientInstance()->getPointerStruct();

if (GameData::isRightClickDown()) { // && Utils::getClipboardText() != this->lastCopy) {
if (pointingStruct->entityPtr != nullptr) {
if (pointingStruct->getEntity() != nullptr) {

if (!(g_Data.getRakNetInstance()->serverIp.getTextLength() < 1))
return;
std::unique_ptr<CompoundTag> tag = std::make_unique<CompoundTag>();
pointingStruct->entityPtr->save(tag.get());
pointingStruct->getEntity()->save(tag.get());
std::stringstream build;
tag->write(build);
auto str = build.str();
Expand Down
2 changes: 1 addition & 1 deletion Horion/Module/Modules/TriggerBot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const char* TriggerBot::getModuleName() {
}
void TriggerBot::onTick(C_GameMode* gm) {
C_LocalPlayer* localPlayer = g_Data.getLocalPlayer();
C_Entity* target = g_Data.getClientInstance()->getPointerStruct()->entityPtr;
C_Entity* target = g_Data.getClientInstance()->getPointerStruct()->getEntity();

Odelay++;
if (target != 0 && Odelay >= delay) {
Expand Down
40 changes: 40 additions & 0 deletions Horion/Module/Modules/ViewModel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "ViewModel.h"


ViewModel::ViewModel() : IModule(0, Category::VISUAL, "Custom item view model") {
this->registerBoolSetting("Reset", &this->Reset, this->Reset);
this->registerBoolSetting("Translate", &this->doTranslate, this->doTranslate);
this->registerBoolSetting("Scale", &this->doScale, this->doScale);

this->registerFloatSetting("TranslateX", &this->xTrans, 0.f, -2.f, 2.f);
this->registerFloatSetting("TranslateY", &this->yTrans, 0.f, -2.f, 2.f);
this->registerFloatSetting("TranslateZ", &this->zTrans, 0.f, -2.f, 2.f);

this->registerFloatSetting("ScaleX", &this->xMod, 1.f, 0.f, 2.f);
this->registerFloatSetting("ScaleY", &this->yMod, 1.f, 0.f, 2.f);
this->registerFloatSetting("ScaleZ", &this->zMod, 1.f, 0.f, 2.f);
}

ViewModel::~ViewModel() {
}

const char* ViewModel::getModuleName() {
return "ViewModel";
}

void ViewModel::onTick(C_GameMode* gm) {
if (g_Data.getLocalPlayer() == nullptr)
return;

if (Reset) {
xTrans = 0.f;
yTrans = 0.f;
zTrans = 0.f;

xMod = 1.f;
yMod = 1.f;
zMod = 1.f;
Reset = false;
}
}

27 changes: 27 additions & 0 deletions Horion/Module/Modules/ViewModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once
#include "Module.h"
class ViewModel : public IModule {
private:
int delay = 0;

public:
bool Reset = false;
bool doTranslate = true;
bool doScale = true;

float float1 = 0;
float xMod = 1.f;
float yMod = 1.f;
float zMod = 1.f;

float xTrans = 0.f;
float yTrans = 0.f;
float zTrans = 0.f;

ViewModel();
~ViewModel();

// Inherited via IModule
virtual const char* getModuleName() override;
virtual void onTick(C_GameMode* gm) override;
};
25 changes: 23 additions & 2 deletions Horion/Module/Modules/Xray.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
#include "Xray.h"

Xray::Xray() : IModule(VK_NUMPAD6, Category::VISUAL, "X-Ray view!") {
Xray::Xray() : IModule(0, Category::VISUAL, "Allows you to see certain blocks easier") {
}

Xray::~Xray() {
}

const char* Xray::getModuleName() {
return ("X-Ray");
return ("Xray");
}

void Xray::onEnable() {
if (smoothLightningSetting != nullptr) {
if (!gotSmoothInfo) {
gotSmoothInfo = true;
wasSmooth = *smoothLightningSetting;
}
*smoothLightningSetting = 0;
}
}

void Xray::onTick(C_GameMode* gm) {
onEnable(); // yes lol
FloppyDolphin57 marked this conversation as resolved.
Show resolved Hide resolved
}

void Xray::onDisable() {
if (smoothLightningSetting != nullptr && gotSmoothInfo) {
*smoothLightningSetting = wasSmooth;
}
gotSmoothInfo = false;
}
7 changes: 7 additions & 0 deletions Horion/Module/Modules/Xray.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
#include "Module.h"
class Xray : public IModule {
public:
bool* smoothLightningSetting = nullptr;
bool gotSmoothInfo = false;
bool wasSmooth = false;

Xray();
~Xray();

// Inherited via IModule
virtual const char* getModuleName() override;
virtual void onTick(C_GameMode* gm) override;
virtual void onDisable() override;
virtual void onEnable() override;
};
Loading