a_troll_01
Active member
- Joined
- Oct 5, 2006
- RedCents
- 21¢
Just a little plugin that I wrote for fun. It might have some use...or not; but it was fun to do a little poking around.
/tHacks - Help
/tEat - you will not consume food, but you get the benefits of the stats
/tDrink - you will not consume drink, but you get the benefits of the stats
/tStats - raises your stats to 450 client side (I avoided STA, Wis & Int for obvious reasons). No encumber and all that good stuff.
/tResists - Raises your resists to 650 client side.
/tHacks - Help
/tEat - you will not consume food, but you get the benefits of the stats
/tDrink - you will not consume drink, but you get the benefits of the stats
/tStats - raises your stats to 450 client side (I avoided STA, Wis & Int for obvious reasons). No encumber and all that good stuff.
/tResists - Raises your resists to 650 client side.
Rich (BB code):
//
// Plugin: MQ2THack
//
// Version: 1.0 Date: 10/7/2006
//
// Author: a_troll_01 for RedGuides
//
// Commands: /tStats - set all stats to max/normal
// /tResists - set all resists to max/normal
// /tFaerune - place the faerune buff in the bard song window
// /tEat - no longer need to eat
// /tDrink - no longer need to drink
// /tHacks - Plugin help
#include "../MQ2Plugin.h"
PreSetup("MQ2THacks");
// Stats
bool bModifyStats = false;
DWORD MaxStats = 450;
DWORD STR;
DWORD STA;
DWORD CHA;
DWORD DEX;
DWORD INTEL;
DWORD AGI;
DWORD WIS;
DWORD mana;
DWORD baseHP;
// Resists
bool bModifyResists = false;
DWORD MaxResist = 650;
DWORD PR; //SavePoison
DWORD MR; //Save Magic
DWORD DR; //SaveDisease
DWORD CrR; //SaveCorruption
DWORD FR; //SaveFire
DWORD CR; //SaveCold
bool bFaerune=false;
int dFaeruneBuffSlot=30;
bool bEat = true; // You will consume food normally
bool bDrink = true; // You will consume drink normally
char szMsg[MAX_STRING];
PCHARINFO pCharInfo = GetCharInfo();
PCHARINFO2 pCharInfo2 = GetCharInfo2();
VOID ModifyStats(PSPAWNINFO pChar, PCHAR szLine) {
bModifyStats = (bModifyStats==false?true:false);
sprintf(szMsg,"/tHacks msg: Stats set to %s.",(bModifyStats==true?"maximum":"normal"));
WriteChatColor(szMsg,(bModifyStats==true?USERCOLOR_DEFAULT:CONCOLOR_RED));
if (bModifyStats == false){
pCharInfo->STR=STR;
pCharInfo->CHA=CHA;
pCharInfo->DEX=DEX;
pCharInfo->AGI=AGI;
} else if (bModifyStats == true) {
STR = pCharInfo->STR;
STA = pCharInfo->STA;
CHA = pCharInfo->CHA;
DEX = pCharInfo->DEX;
INTEL = pCharInfo->INT;
AGI = pCharInfo->AGI;
WIS = pCharInfo->WIS;
mana=pCharInfo2->Mana;
baseHP=pCharInfo2->BaseHP;
pCharInfo->STR=MaxStats;
pCharInfo->CHA=MaxStats;
pCharInfo->DEX=MaxStats;
pCharInfo->AGI=MaxStats;
pCharInfo->ManaRegenBonus=65;
}
return;
}
VOID ModifyResists(PSPAWNINFO pChar, PCHAR szLine)
{
bModifyResists = (bModifyResists==false?true:false);
sprintf(szMsg,"/tHacks msg: Resists set to %s.",(bModifyResists==true?"maximum":"normal"));
WriteChatColor(szMsg,(bModifyResists==true?USERCOLOR_DEFAULT:CONCOLOR_RED));
if (bModifyResists == false){
pCharInfo->SavePoison = PR;
pCharInfo->SaveMagic = MR;
pCharInfo->SaveDisease = DR;
pCharInfo->SaveCorruption = CrR;
pCharInfo->SaveFire = FR;
pCharInfo->SaveCold = CR;
} else if (bModifyResists == true) {
//set the stats to the maximum
PR=pCharInfo->SavePoison;
MR=pCharInfo->SaveMagic;
DR=pCharInfo->SaveDisease;
CrR=pCharInfo->SaveCorruption;
FR=pCharInfo->SaveFire;
CR=pCharInfo->SaveCold;
pCharInfo->SavePoison = MaxResist;
pCharInfo->SaveMagic = MaxResist;
pCharInfo->SaveDisease = MaxResist;
pCharInfo->SaveCorruption = MaxResist;
pCharInfo->SaveFire = MaxResist;
pCharInfo->SaveCold = MaxResist;
}
return;
}
VOID Faerune(PSPAWNINFO pChar, PCHAR szLine)
{
//idea completely stolen from Fossil on Kenetixeq
PSPELL pSpell = GetSpellByName("Faerune");
bFaerune = (bFaerune==true?false:true);
sprintf(szMsg,"/tHacks msg: Faerune is now %s.",(bModifyResists==true?"on":"off"));
WriteChatColor(szMsg,(bFaerune==true?USERCOLOR_DEFAULT:CONCOLOR_RED));
if(bFaerune==false){
GetCharInfo2()->Buff[dFaeruneBuffSlot].SpellID = (DWORD)0;
GetCharInfo2()->Buff[dFaeruneBuffSlot].Duration = (DWORD)0;
} else {
GetCharInfo2()->Buff[dFaeruneBuffSlot].SpellID = (DWORD)pSpell->ID;
GetCharInfo2()->Buff[dFaeruneBuffSlot].Duration = (DWORD)9990;
}
return;
}
VOID RunSpeed(PSPAWNINFO pChar, PCHAR szLine)
{
sprintf(szMsg,"This function has not been implimented");
WriteChatColor(szMsg,USERCOLOR_DEFAULT);
}
VOID Eat(PSPAWNINFO pChar, PCHAR szLine)
{
bEat = (bEat==false?true:false);
sprintf(szMsg,"tHack msg: You will %s.", (bEat == true?"eat normally":"no longer eat"));
WriteChatColor(szMsg,(bEat==false?USERCOLOR_DEFAULT:CONCOLOR_RED));
}
VOID Drink(PSPAWNINFO pChar, PCHAR szLine)
{
bDrink = (bDrink == false?true:false);
sprintf(szMsg,"tHack msg: You will %s.", (bEat == true?"drink normally":"no longer drink"));
WriteChatColor(szMsg,(bDrink==false?USERCOLOR_DEFAULT:CONCOLOR_RED));
}
VOID LongBuffs(PSPAWNINFO pChar, PCHAR szLine)
{
int i;
WriteChatColor("tHask msg: Increasing duraction of all buffs",USERCOLOR_DEFAULT);
for (i=0;i<23;i++) {
if(GetCharInfo2()->Buff.SpellID > 0) {
GetCharInfo2()->Buff[20+i].SpellID=GetCharInfo2()->Buff.SpellID;
GetCharInfo2()->Buff[20+i].Duration = (DWORD)9990;
GetCharInfo2()->Buff.Duration = (DWORD)9990;
}
}
}
VOID tHacks(PSPAWNINFO pChar, PCHAR szLine)
{
WriteChatColor("/tResists",USERCOLOR_DEFAULT);
WriteChatColor("/tStats",USERCOLOR_DEFAULT);
WriteChatColor("/tFaerune",USERCOLOR_DEFAULT);
WriteChatColor("/tEat",USERCOLOR_DEFAULT);
WriteChatColor("/tDrink",USERCOLOR_DEFAULT);
}
PLUGIN_API VOID SetGameState(DWORD GameState)
{
int i;
//idea completely stolen from Fossil on Kenetixeq
if (bFaerune==true && GameState==GAMESTATE_INGAME) {
if ((ppCharData) && (pCharData)) {
PSPELL pSpell = GetSpellByName("Faerune");
GetCharInfo2()->Buff[dFaeruneBuffSlot].SpellID = (DWORD)pSpell->ID;
GetCharInfo2()->Buff[dFaeruneBuffSlot].Duration = (DWORD)9990;
}
}
for (i=1;i<23;i++) {
if(GetCharInfo2()->Buff.SpellID > 0) {
GetCharInfo2()->Buff[20+i].SpellID=GetCharInfo2()->Buff.SpellID;
GetCharInfo2()->Buff[20+i].Duration = (DWORD)9990;
}
}
}
PLUGIN_API VOID OnPulse(VOID)
{
if (bModifyResists) {
pCharInfo->SavePoison = MaxResist;
pCharInfo->SaveMagic = MaxResist;
pCharInfo->SaveDisease = MaxResist;
pCharInfo->SaveCorruption = MaxResist;
pCharInfo->SaveFire = MaxResist;
pCharInfo->SaveCold = MaxResist;
}
if (bModifyStats) {
pCharInfo->STR=MaxStats;
//pCharInfo->STA=MaxStats;
pCharInfo->CHA=MaxStats;
pCharInfo->DEX=MaxStats;
//pCharInfo->INT=MaxStats;
pCharInfo->AGI=MaxStats;
//pCharInfo->WIS=MaxStats;
}
if (bDrink == false) pCharInfo2->thirstlevel = 6256;
if (bEat == false) pCharInfo2->hungerlevel = 6256;
}
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2THacks");
AddCommand("/thacks",tHacks);
AddCommand("/tstats", ModifyStats);
AddCommand("/tresists", ModifyResists);
AddCommand("/tfaerune", Faerune);
AddCommand("/trun", RunSpeed);
AddCommand("/teat", Eat);
AddCommand("/tdrink", Drink);
AddCommand("/tbuffs", LongBuffs);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2THacks");
AddCommand("/thacks",tHacks);
RemoveCommand("/tstats");
RemoveCommand("/tresists");
RemoveCommand("/tfaerune");
RemoveCommand("/trun");
RemoveCommand("/teat");
RemoveCommand("/tdrink");
RemoveCommand("/tbuffs");
}
Last edited:




If you could repost the plugin again that be cool. Thx