From b5cc9f3f20dd4140dd8bc4685b3f6637898003da Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sun, 9 Jul 2017 18:55:39 +0300 Subject: [PATCH] Spell Book ESP #185 --- src/hacks/ESP.cpp | 7 +++++++ src/itemtypes.cpp | 4 ++++ src/itemtypes.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index a19815cb..4ba4ca9b 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -26,6 +26,7 @@ CatVar item_health_packs(CV_SWITCH, "esp_item_health", "1", "Health packs", "Sho CatVar item_powerups(CV_SWITCH, "esp_item_powerups", "1", "Powerups", "Show powerups"); CatVar item_money(CV_SWITCH, "esp_money", "1", "MvM money", "Show MvM money"); CatVar item_money_red(CV_SWITCH, "esp_money_red", "1", "Red MvM money", "Show red MvM money"); +CatVar item_spellbooks(CV_SWITCH, "esp_spellbooks", "1", "Spellbooks", "Spell Books"); CatVar entity_id(CV_SWITCH, "esp_entity_id", "1", "Entity ID", "Used with Entity ESP. Shows entityID"); CatVar tank(CV_SWITCH, "esp_show_tank", "1", "Show tank", "Show tank"); CatVar box_esp(CV_SWITCH, "esp_box", "1", "Box", "Draw 2D box with healthbar. fancy."); @@ -367,6 +368,12 @@ void _FASTCALL ProcessEntity(CachedEntity* ent) { } else if (item_weapon_spawners && ent->m_ItemType >= ITEM_TF2C_W_FIRST && ent->m_ItemType <= ITEM_TF2C_W_LAST) { AddEntityString(ent, format(tf2c_weapon_names[ent->m_ItemType - ITEM_TF2C_W_FIRST], " SPAWNER")); if (CE_BYTE(ent, netvar.bRespawning)) AddEntityString(ent, "-- RESPAWNING --"); + } else if (item_spellbooks && (ent->m_ItemType == ITEM_SPELL || ent->m_ItemType == ITEM_SPELL_RARE)) { + if (ent->m_ItemType == ITEM_SPELL) { + AddEntityString(ent, "Spell", colors::green); + } else { + AddEntityString(ent, "Rare Spell", colors::FromRGBA8(139, 31, 221, 255)); + } } } else if (ent->m_Type == ENTITY_BUILDING && buildings) { if (!ent->m_bEnemy && !teammates) return; diff --git a/src/itemtypes.cpp b/src/itemtypes.cpp index 05180f79..f6c7b1e5 100644 --- a/src/itemtypes.cpp +++ b/src/itemtypes.cpp @@ -61,6 +61,10 @@ ItemManager::ItemManager() : mapper() { RegisterModelMapping("models/items/healthkit.mdl", ITEM_HEALTH_MEDIUM); //RegisterModelMapping("models/pickups/pickup_powerup_reflect.mdl", ITEM_POWERUP_REFLECT); + // Spellbooks + RegisterModelMapping("models/props_halloween/hwn_spellbook_upright.mdl", ITEM_SPELL); + RegisterModelMapping("models/props_halloween/hwn_spellbook_upright_major.mdl", ITEM_SPELL_RARE); + RegisterSpecialMapping([](CachedEntity* ent) -> bool { return ent->m_iClassID == CL_CLASS(CTFAmmoPack); }, ITEM_AMMO_MEDIUM); diff --git a/src/itemtypes.h b/src/itemtypes.h index 3e47eab8..d6d2913f 100644 --- a/src/itemtypes.h +++ b/src/itemtypes.h @@ -144,6 +144,9 @@ enum k_EItemType { ITEM_HL_BATTERY, + ITEM_SPELL, + ITEM_SPELL_RARE, + ITEM_COUNT };