Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2008, 10:41 PM
bushman77
Hill Giant
 
Join Date: May 2003
Location: In the bush
Posts: 129
Default mark of retribution

i am playin on peq and when i try to cast mark of retribution it says the tartget is covered in a dull red aura but there is never any damage dealt when the mob strikes another. not sure if it is just this server or is it all servers that do this
Reply With Quote
  #2  
Old 10-16-2008, 02:44 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

From what I can tell, it looks like we currently check for a reverse DS (in zone/bonus.cpp) & count how much it should be (using Mob->ReverseDamageShield), but it doesn't look like we're doing anything with it after that. It looks like we did at one point, but the following is currently commented out of zone/attack.cpp in Mob::DamageShield() (around line 2587):
Code:
/*	int DS = 0;
//	int DSRev = 0;
	int effect_value, dmg, i, z;

	for (i=0; i < BUFF_COUNT; i++)
	{
		if (buffs[i].spellid != SPELL_UNKNOWN)
		{
			for (z=0; z < EFFECT_COUNT; z++)
			{
				if(IsBlankSpellEffect(buffs[i].spellid, z))
					continue;
				
				effect_value = CalcSpellEffectValue(buffs[i].spellid, z, buffs[i].casterlevel, this);
				
				switch(spells[buffs[i].spellid].effectid[z])
				{
					case SE_DamageShield:
					{
						dmg = effect_value;
						DS += dmg;
						spellid = buffs[i].spellid;
						break;
					}
*/
/*
					case SE_ReverseDS:
					{
						dmg = effect_value;
						DSRev += dmg;
						spellid = buffs[i].spellid;
						break;
					}
*/
/*				}
			}
		}
	}
	// there's somewhat of an issue here that the last (slot wise) damage shield
	// will be the one whose spellid is set here
	if (DS) {
	}*/
/*
	if (DSRev)
	{
		this->ChangeHP(attacker, DSRev, spellid);
	}
*/
However, I don't think this is really where a reverse DS belongs. We should probably be checking this in Attack() (so we don't mess with other calls to Damage() & CommonDamage()), and if damage > 0, check to see if there is a reverse DS, and if so, cause the damage to the attacker. I think something like this should do the trick...

In zone/mob.h, around line 164, add:
Code:
	uint16	DamageShieldSpellID;
	int		DamageShield; // this is damage done to mobs that attack this
	int		SpellDamageShield;
	int		ReverseDamageShield; // this is damage done to the mob when it attacks
	uint16	ReverseDamageShieldSpellID;
In zone/bonus.cpp, around line 809, add:
Code:
			case SE_ReverseDS:
			{
				newbon->ReverseDamageShield += effect_value;
				newbon->ReverseDamageShieldSpellID = spell_id;
				break;
			}
In zone/attack.cpp, in Client::Attack() around line 1238, add:
Code:
	//Reverse DS
	//the logic here is that you have to hit something for damage AND the damage has to be done before it will hurt the attacker
	int rev_ds = spellbonuses.ReverseDamageShield; //should be a negative number, don't think items will ever have it
	uint16 rev_ds_spell_id = SPELL_UNKNOWN;

	if(spellbonuses.ReverseDamageShieldSpellID != 0 && spellbonuses.ReverseDamageShieldSpellID != SPELL_UNKNOWN)
		rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;

	if(rev_ds < 0) {
		mlog(COMBAT__HITS, "Applying Reverse Damage Shield of value %d to %s", rev_ds, GetName());
		Damage(other, -rev_ds, rev_ds_spell_id, ABJURE/*hackish*/, false); //attackee will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
	}

	////////////////////////////////////////////////////////////
	////////  PROC CODE
	////////  Kaiyodo - Check for proc on weapon based on DEX
	///////////////////////////////////////////////////////////
And lastly (for NPCs), in zone/attack.cpp in NPC::Attack() around line 2072, add:
Code:
	hidden = false;
	improved_hidden = false;
	
	//Reverse DS
	//the logic here is that you have to hit something for damage AND the damage has to be done before it will hurt the attacker
	int rev_ds = spellbonuses.ReverseDamageShield; //should be a negative number, don't think items will ever have it
	uint16 rev_ds_spell_id = SPELL_UNKNOWN;

	if(spellbonuses.ReverseDamageShieldSpellID != 0 && spellbonuses.ReverseDamageShieldSpellID != SPELL_UNKNOWN)
		rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;

	if(rev_ds < 0) {
		mlog(COMBAT__HITS, "Applying Reverse Damage Shield of value %d to %s", rev_ds, GetName());
		Damage(other, -rev_ds, rev_ds_spell_id, ABJURE/*hackish*/, false); //attackee will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
	}

	//I doubt this works...
	if (!target)
		return true; //We killed them
It would probably be better to just turn that common chunk into a function, Mob::DamageShield, but I don't feel like going back to do that right now. In any case, if someone wants to try this out, feel free, and if it works, we can get it submitted to SVN.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 10-20-2008, 07:03 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

I had a chance to do some testing, worked out a few things (ended up putting this in the DamageShield function), retested, & updated the changes into SVN revision 123.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
Reply


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 07:38 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3