Achievement + KillSay FIX
This commit is contained in:
parent
2aabcd17d7
commit
d293851dd1
@ -39,7 +39,7 @@
|
||||
|
||||
#define CATHOOK_VERSION_MAJOR "0"
|
||||
#define CATHOOK_VERSION_MINOR "5"
|
||||
#define CATHOOK_VERSION_PATCH "1"
|
||||
#define CATHOOK_VERSION_PATCH "2"
|
||||
|
||||
#define CON_NAME "cat"
|
||||
#define CON_PREFIX CON_NAME "_"
|
||||
|
@ -69,6 +69,7 @@ void hack::InitHacks() {
|
||||
ADD_HACK(SpyAlert);
|
||||
ADD_HACK(Glow);
|
||||
ADD_HACK(KillSay);
|
||||
ADD_HACK(AchievementHack);
|
||||
}
|
||||
|
||||
ConCommand* hack::c_Cat = 0;
|
||||
@ -208,4 +209,5 @@ void hack::Shutdown() {
|
||||
DELETE_HACK(SpyAlert);
|
||||
DELETE_HACK(Glow);
|
||||
DELETE_HACK(KillSay);
|
||||
DELETE_HACK(AchievementHack);
|
||||
}
|
||||
|
38
cathook/src/hacks/Achievement.cpp
Normal file
38
cathook/src/hacks/Achievement.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Achievement.cpp
|
||||
*
|
||||
* Created on: Jan 20, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#include "Achievement.h"
|
||||
#include "../common.h"
|
||||
#include "../sdk.h"
|
||||
|
||||
DEFINE_HACK_SINGLETON(AchievementHack);
|
||||
|
||||
const char* AchievementHack::GetName() { return "ACHIEVEMENT"; }
|
||||
|
||||
AchievementHack::AchievementHack() {
|
||||
c_Unlock = CreateConCommand(CON_PREFIX "achievement_unlock", &CC_Achievement_Unlock, "Unlocks all achievements.");
|
||||
c_Lock = CreateConCommand(CON_PREFIX "achievement_lock", &CC_Achievement_Unlock, "Locks all achievements.");
|
||||
}
|
||||
|
||||
void CC_Achievement_Unlock(const CCommand& args) {
|
||||
for (int i = 0; i < interfaces::achievements->GetAchievementCount(); i++) {
|
||||
interfaces::achievements->AwardAchievement(interfaces::achievements->GetAchievementByIndex(i)->GetAchievementID());
|
||||
}
|
||||
}
|
||||
|
||||
void CC_Achievement_Lock(const CCommand& args) {
|
||||
for (int i = 0; i < interfaces::achievements->GetAchievementCount(); i++) {
|
||||
interfaces::stats->ClearAchievement(interfaces::achievements->GetAchievementByIndex(i)->GetName());
|
||||
}
|
||||
interfaces::stats->StoreStats();
|
||||
interfaces::stats->RequestCurrentStats();
|
||||
}
|
||||
|
||||
bool AchievementHack::CreateMove(void*, float, CUserCmd*) { return true; }
|
||||
void AchievementHack::PaintTraverse(void*, unsigned int, bool, bool) {}
|
||||
void AchievementHack::LevelInit(const char*) {}
|
||||
void AchievementHack::LevelShutdown() {}
|
26
cathook/src/hacks/Achievement.h
Normal file
26
cathook/src/hacks/Achievement.h
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Achievement.h
|
||||
*
|
||||
* Created on: Jan 20, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#ifndef HACKS_ACHIEVEMENT_H_
|
||||
#define HACKS_ACHIEVEMENT_H_
|
||||
|
||||
#include "IHack.h"
|
||||
|
||||
class AchievementHack : public IHack {
|
||||
public:
|
||||
DECLARE_HACK_METHODS();
|
||||
AchievementHack();
|
||||
ConCommand* c_Unlock;
|
||||
ConCommand* c_Lock;
|
||||
};
|
||||
|
||||
void CC_Achievement_Unlock(const CCommand& args);
|
||||
void CC_Achievement_Lock(const CCommand& args);
|
||||
|
||||
DECLARE_HACK_SINGLETON(AchievementHack);
|
||||
|
||||
#endif /* HACKS_ACHIEVEMENT_H_ */
|
@ -48,6 +48,7 @@ const char* KillSay::ComposeKillSay(IGameEvent* event) {
|
||||
if (!event) return 0;
|
||||
int vid = event->GetInt("userid");
|
||||
int kid = event->GetInt("attacker");
|
||||
if (kid == vid) return 0;
|
||||
if (interfaces::engineClient->GetPlayerForUserID(kid) != interfaces::engineClient->GetLocalPlayer()) return 0;
|
||||
char* msg = strfmt("%s", m_KillSays[rand() % m_nKillSays]);
|
||||
player_info_s info;
|
||||
|
@ -25,5 +25,6 @@
|
||||
#include "Trigger.h"
|
||||
#include "Glow.h"
|
||||
#include "KillSay.h"
|
||||
#include "Achievement.h"
|
||||
|
||||
#endif /* HACKS_HACKLIST_H_ */
|
||||
|
@ -125,7 +125,7 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
SAFE_CALL(((FrameStageNotify_t*)hooks::hkClient->GetMethod(hooks::offFrameStageNotify))(thisptr, stage));
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
if (g_Settings.bHackEnabled->GetBool() && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
|
||||
//if (g_Settings.bHackEnabled->GetBool() && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
|
||||
/*if (stage == 5 && g_Settings.bNoFlinch->GetBool()) {
|
||||
static Vector oldPunchAngles = Vector();
|
||||
Vector punchAngles = CE_VECTOR(g_pLocalPlayer->entity, netvar.vecPunchAngle);
|
||||
@ -145,7 +145,7 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
|
||||
}
|
||||
}*/
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
}
|
||||
//}
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
//logging::Info("fsi end");// TODO dbg
|
||||
SEGV_END;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "sharedobj.h"
|
||||
#include "logging.h"
|
||||
#include "copypasted/CSignature.h"
|
||||
#include "sdk.h"
|
||||
|
||||
#include <steam/isteamclient.h>
|
||||
|
||||
@ -33,6 +34,8 @@ IGameMovement* interfaces::gamemovement = 0;
|
||||
IInput* interfaces::iinput = 0;
|
||||
IMatSystemSurface* interfaces::matsurface = 0;
|
||||
ISteamUser* interfaces::user = 0;
|
||||
IAchievementMgr* interfaces::achievements = 0;
|
||||
ISteamUserStats* interfaces::stats = 0;
|
||||
|
||||
void interfaces::CreateInterfaces() {
|
||||
interfaces::centerPrint = reinterpret_cast<ICenterPrint*>(sharedobj::client->fptr("VCENTERPRINT002", nullptr));
|
||||
@ -60,4 +63,6 @@ void interfaces::CreateInterfaces() {
|
||||
interfaces::iinput = **(reinterpret_cast<IInput***>((uintptr_t)1 + gSignatures.GetClientSignature("A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF 92 B4 00 00 00 A1 ? ? ? ? 8B 10")));
|
||||
interfaces::matsurface = **reinterpret_cast<IMatSystemSurface***>((uintptr_t)19 + gSignatures.GetClientSignature("FF 92 94 02 00 00 8B 8D C4 FE FF FF 89 85 B0 FE FF FF A1 ? ? ? ? 8B 10 89 4C 24 0C"));
|
||||
interfaces::user = interfaces::steamClient->GetISteamUser(su, sp, "SteamUser018");
|
||||
interfaces::achievements = interfaces::engineClient->GetAchievementMgr();
|
||||
interfaces::stats = interfaces::steamClient->GetISteamUserStats(su, sp, "STEAMUSERSTATS_INTERFACE_VERSION011");
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ class IGameMovement;
|
||||
class IInput;
|
||||
class IMatSystemSurface;
|
||||
class ISteamUser;
|
||||
class IAchievementMgr;
|
||||
class ISteamUserStats;
|
||||
|
||||
namespace interfaces {
|
||||
|
||||
@ -54,6 +56,8 @@ extern IGameMovement* gamemovement;
|
||||
extern IInput* iinput;
|
||||
extern IMatSystemSurface* matsurface;
|
||||
extern ISteamUser* user;
|
||||
extern IAchievementMgr* achievements;
|
||||
extern ISteamUserStats* stats;
|
||||
|
||||
void CreateInterfaces();
|
||||
|
||||
|
@ -40,8 +40,10 @@
|
||||
#include <iserver.h>
|
||||
#include <view_shared.h>
|
||||
#include <basehandle.h>
|
||||
#include <iachievementmgr.h>
|
||||
#include <VGuiMatSurface/IMatSystemSurface.h>
|
||||
#include <steam/isteamuser.h>
|
||||
#include <steam/steam_api.h>
|
||||
|
||||
#include "sdk/in_buttons.h"
|
||||
#include "sdk/iinput.h"
|
||||
|
Reference in New Issue
Block a user