View Single Post
  #7  
Old 10-01-2008, 03:33 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

This corrects another exploit -
Quote:
If you are using FD (Feign Death) and you have a group of bots, you can send the bots and they will get killed but you won't get involved in combat. After that, you can re-summon your bots and send them again...
In client.cpp at around line 1842 (on my client.cpp it's on line 1914)
replace this
Code:
#ifdef EQBOTS

		// there seems to be a bug where the hate list doesn't get cleared, even if
		// the mob forgets about the feigner.
		hate_list.Wipe();

#endif //EQBOTS
With this;
Code:
#ifdef EQBOTS

		// there seems to be a bug where the hate list doesn't get cleared, even if
		// the mob forgets about the feigner.
		hate_list.Wipe();

	// Angelox Added for FDead Exploit
	Mob *clientmob = CastToMob();
	if(clientmob) {
		int16 cmid = GetID();
		if(clientmob->IsBotRaiding()) {
			BotRaids* br = entity_list.GetBotRaidByMob(clientmob);
			if(br) {
				br->RemoveRaidBots();
				br = NULL;
			}
		}
		if(clientmob->IsGrouped()) {
			Group *g = entity_list.GetGroupByMob(clientmob);
			if(g) {
				bool hasBots = false;
				for(int i=5; i>=0; i--) {
					if(g->members[i] && g->members[i]->IsBot()) {
						hasBots = true;
						g->members[i]->Kill();
					}
				}
				if(hasBots) {
					if(g->BotGroupCount() <= 1) {
						g->DisbandGroup();
					}
				}
			}
		}
		database.CleanBotLeader(cmid);
	}

#endif //EQBOTS
What happens is FD, will clear the bots out, but not the group Which makes it a fair play.

I also added this check in groups.cpp, around line 834 ;
change this;
Code:
#ifdef EQBOTS

int Group::BotGroupCount() {
	int count = 0;
	for(int i=count; i<MAX_GROUP_MEMBERS; i++) {
		if(members[i] && (members[i]->GetMaxHP()>0))
			count++;
	}
	return count;
}

#endif //EQBOTS
to this;
Code:
int Group::BotGroupCount() {
	int count = 0;
	for(int i=count; i<MAX_GROUP_MEMBERS; i++) {
		if(members[i] && (members[i]->GetMaxHP()>0))
			count++;
	}
	return (count,database.GroupCount(GetID())); //angelox add
}
This enabled me to invite PC members to the group (first) then add bots. On zoning, the bots poof, but the PC group stays intact.

This is all tested, the PC group part i tested as best I could from two PC's in the Lan. Posted with my database for anyone who wants to try it out.
I'm planning on re-arranging my Bot SpellLists, so they match the ones in PEQ., Then the code will be made compatible with the PEQ database too.