Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2011, 01:55 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

I did a debug of this, and had the same issue. The problem is that when the spell is cast, it ends up calling Bot::SpellEffect, which calls Mob::SpellEffect

Code:
case SE_SummonCorpse:
			{
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Summon Corpse: %d", effect_value);
#endif
				// can only summon corpses of clients
				if(IsClient()) {
					Client* TargetClient = 0;
					if(this->GetTarget())
						TargetClient = this->GetTarget()->CastToClient();
					else
						TargetClient = this->CastToClient();

					// We now have a valid target for this spell. Either the caster himself or a targetted player. Lets see if the target is in the group.
					Group* group = entity_list.GetGroupByClient(TargetClient);
					if(group) {
						if(!group->IsGroupMember(TargetClient)) {
							Message(13, "Your target must be a group member for this spell.");
							break;
						}
					}
					else {
						if(TargetClient != this->CastToClient()) {
							Message(13, "Your target must be a group member for this spell.");
							break;
						}
					}

					// Now we should either be casting this on self or its being cast on a valid group member
					if(TargetClient) {
						Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient);
						if(corpse) {
							if(TargetClient == this->CastToClient())
								Message_StringID(4, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
							else
								Message_StringID(4, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName());
							
							corpse->Summon(CastToClient(), true, true);
						}
						else {
							// No corpse found in the zone
							Message_StringID(4, CORPSE_CANT_SENSE);
						}
					}
					else {
						Message_StringID(4, TARGET_NOT_FOUND);
						LogFile->write(EQEMuLog::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id);
					}
				}

				break;
			}
where it basically just checks to see if the caster is a client and if the target is a client, and if so, does what it is supposed to do. How this worked before for bots is beyond me. I don't see any change to this code that would have caused it to not work correctly.

I'd have to dig a bit deeper, but if anyone else has any ideas, please let me know.
Reply With Quote
  #2  
Old 12-10-2011, 01:58 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I had problems getting them to rez like 2 years ago, someone fixed it...now not working again. I can see if I can pull my last source and see what changed.
Reply With Quote
  #3  
Old 01-10-2012, 12:54 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Quote:
Originally Posted by bad_captain View Post
I did a debug of this, and had the same issue. The problem is that when the spell is cast, it ends up calling Bot::SpellEffect, which calls Mob::SpellEffect

Code:
case SE_SummonCorpse:
			{
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Summon Corpse: %d", effect_value);
#endif
				// can only summon corpses of clients
				if(IsClient()) {
					Client* TargetClient = 0;
					if(this->GetTarget())
						TargetClient = this->GetTarget()->CastToClient();
					else
						TargetClient = this->CastToClient();

					// We now have a valid target for this spell. Either the caster himself or a targetted player. Lets see if the target is in the group.
					Group* group = entity_list.GetGroupByClient(TargetClient);
					if(group) {
						if(!group->IsGroupMember(TargetClient)) {
							Message(13, "Your target must be a group member for this spell.");
							break;
						}
					}
					else {
						if(TargetClient != this->CastToClient()) {
							Message(13, "Your target must be a group member for this spell.");
							break;
						}
					}

					// Now we should either be casting this on self or its being cast on a valid group member
					if(TargetClient) {
						Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient);
						if(corpse) {
							if(TargetClient == this->CastToClient())
								Message_StringID(4, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
							else
								Message_StringID(4, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName());
							
							corpse->Summon(CastToClient(), true, true);
						}
						else {
							// No corpse found in the zone
							Message_StringID(4, CORPSE_CANT_SENSE);
						}
					}
					else {
						Message_StringID(4, TARGET_NOT_FOUND);
						LogFile->write(EQEMuLog::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id);
					}
				}

				break;
			}
where it basically just checks to see if the caster is a client and if the target is a client, and if so, does what it is supposed to do. How this worked before for bots is beyond me. I don't see any change to this code that would have caused it to not work correctly.

I'd have to dig a bit deeper, but if anyone else has any ideas, please let me know.
But the bot is the caster, and the player is in the group with the bot, so the code would work I would think. I am seriously hoping I have time to look at this tomorrow.
Reply With Quote
  #4  
Old 01-10-2012, 12:39 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

I forgot I did a little more testing on this. The part where it actually gets the corpse to summon fails. It just didn't find one even though I was looking at it. I'm in the process of moving my office to the basement so I'm without my server to look further into this right now. Maybe by this weekend if I can get my ethernet rewired by then.
Reply With Quote
  #5  
Old 01-10-2012, 12:41 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

So what is your best guess on the cause ?

You can actually see the spell cast, so I would not think it would be anywhere in the code for the EqEmulator itself. It would be in the bot code correct ??
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:16 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3