PDA

View Full Version : mark of retribution


bushman77
10-14-2008, 10:41 PM
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

AndMetal
10-16-2008, 02:44 AM
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):

/* 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:

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:

case SE_ReverseDS:
{
newbon->ReverseDamageShield += effect_value;
newbon->ReverseDamageShieldSpellID = spell_id;
break;
}


In zone/attack.cpp, in Client::Attack() around line 1238, add:

//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:

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.

AndMetal
10-20-2008, 07:03 PM
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.