Jump to content

Revils

Members
  • Posts

    57
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Revils

  1. Last time I checked it wasnt working: this type of GO with negative value despawns after first player use, no matter specified time (and for OS means only one player can enter the Twilight portal, and this is not right since it should last 30 secs) If I recall correctly data5 e data3 fields are not used in this case and while trying to figure what's wrong I got lost in: GameObject::Update // since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless m_respawnTime = m_spawnedByDefault ? time(NULL) + m_respawnDelayTime : 0;
  2. It isnt that ugly, cause there are already a few of them, anyway: I know, I mean that to add an hardcode value rather than a "rule" is a bit ugly but for this case an execption as you posted it's the only way I can imagine to solve this and other similar problems with other spells
  3. * What bug does the patch fix? What features does the patch add? Fix AOE spell 61632 that should affect only friendly units (boss's adds and not players). * For which repository revision was the patch created? 10675 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. none that I know. * Who has been writing this patch? Please include either forum user names or email addresses. Revils diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 5aa713f..5e47727 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -700,6 +700,7 @@ bool IsPositiveEffect(uint32 spellId, SpellEffectIndex effIndex) case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: case SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT: case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: + case SPELL_AURA_MOD_HASTE: if(spellproto->CalculateSimpleValue(effIndex) > 0) return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE or unclear target modes break; @@ -782,6 +783,7 @@ bool IsPositiveEffect(uint32 spellId, SpellEffectIndex effIndex) switch(spellproto->Id) { case 802: // Mutate Bug, wrongly negative by target modes + case 61632: // Sartharion Berserk return true; case 36900: // Soul Split: Evil! case 36901: // Soul Split: Good Since it's a spell with TARGET_CASTER_COORDINATES/TARGET_AREAEFFECT_INSTANT its targets depends by IsPositiveEffect so I add an exception for SPELL_AURA_MOD_SCALE and I add a rule for SPELL_AURA_MOD_HASTE (it's similar to SPELL_AURA_MOD_SPELL_CRIT_CHANCE) to make it positive. I didn't find much info so I'm not sure if spell max affected targets must be limited (from data is 0) otherwise all mobs in instance will get the buff.
  4. * What bug does the patch fix? What features does the patch add? Fix ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE and ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM never checked while looting items with group roll for example Sinister Calling 2nd criteria (no problem with master loot and free for all) * For which repository revision was the patch created? 10675 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. none that I know. * Who has been writing this patch? Please include either forum user names or email addresses. Revils diff --git a/src/game/Group.cpp b/src/game/Group.cpp index dd4b371..5d47f5f 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -851,6 +851,9 @@ void Group::CountTheRoll(Rolls::iterator& rollI) roll->getLoot()->NotifyItemRemoved(roll->itemSlot); --roll->getLoot()->unlootedCount; player->StoreNewItem( dest, roll->itemid, true, item->randomPropertyId); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, roll->itemid, item->count); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, roll->getLoot()->loot_type, item->count); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, roll->itemid, item->count); } else { @@ -903,6 +906,9 @@ void Group::CountTheRoll(Rolls::iterator& rollI) roll->getLoot()->NotifyItemRemoved(roll->itemSlot); --roll->getLoot()->unlootedCount; player->StoreNewItem( dest, roll->itemid, true, item->randomPropertyId); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, roll->itemid, item->count); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, roll->getLoot()->loot_type, item->count); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, roll->itemid, item->count); } else {
  5. spell 24732 second effect uses SPELL_AURA_MOD_SILENCE that is always considered negative in IsPositiveEffect() so no other way than add a ugly exception in that function.
  6. How sp/haste buffs from procs from different trinkets or with wrath totem or demonic aura are handled?
  7. me too, and it totally solved the problem with combat log no more working
  8. this happens because the model id for the flying mount for that alliance flightmaster is set to 0 on dbc so mangos will skip that taxi node.
  9. I'm the only one with the problem that using mirror image while in raid will make everyone appear with the caster name?
  10. Well since we have some fixed value from DBCs for some spells and also from SPELL_THREAT table it do matters where we multiply... Anyway scaling the threat value on SendThreatUpdate seems the quickiest way but, despite my initial throughs, I think that the right way should be to move the whole threat math from float to integer like it's done for damage and healing. Also there's another big issue: Mangos allows negative threat values while I'm pretty sure clients can't ever display it value less than 0 (now there's an unexpected signed to unsigned conversion on SendThreatUpdate that borks threat meters) so IHMO it's another reason to calculate threat as an pure unsigned integer. For differences between mangos and offy, as we said, surely some spells, mainly those used by tanks, should generate more threat as documented on wowwiki so something like this could be a start: - if(spellProto && IsDamageToThreatSpell(spellProto)) - pVictim->AddThreat(this, float(damage*2), (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); - else - pVictim->AddThreat(this, float(damage), (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); + float DtTcoef = DamageToThreatSpell(spellProto); + pVictim->AddThreat(this, float(damage*DtTcoef), (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); -bool Unit::IsDamageToThreatSpell(SpellEntry const * spellInfo) const +float Unit::DamageToThreatSpell(SpellEntry const * spellInfo) const { if (!spellInfo) - return false; + return 1.0f; uint32 family = spellInfo->SpellFamilyName; uint64 flags = spellInfo->SpellFamilyFlags; if ((family == 5 && flags == 256) || //Searing Pain (family == 6 && flags == 8192) || //Mind Blast (family == 11 && flags == 1048576)) //Earth Shock - return true; + return 2.0f; - return false; + // Rune Strike return 1.75f + // Death and Decay return 1.9f + // Icy Touch return 7.0f + // Thunder Clap return 1.85f + // Swipe (Bear) return 1.5f + + return 1.0f; // default it should be completed with the usual spellfamily&spellflags switches for all the spells that doesn't scales 1:1 with damage (I'm not sure if there are also some healing spell with differenct coefficient than the default 0.5).
  11. I confirm this fix is needed since it solves an exploit with gaining full runic power. Interesting to note that on DBC Dirge rank 2 got different procflags than rank 1 since it got also proc on periodic damage that's really a non sense.
  12. http://www.wowwiki.com/Judgement Thatìs why I put in code that all melee spells that doesn't require a weapon equiped, like judgements, use GetMaxSkillValueForLevel(). The part about can't be dodge is handled elsewere
  13. so also wowwiki confirms what I wrote
  14. Mine was a replay to Darkstalker's post about why on mangos we got a lower 2 order magnitute not why tanks compared to DPS do less threat... In other words using Tonian67 example: Imagine player A with 12345.678 threat and player B with 12345.000 so for the server A > B, now they are both sent as 12346 so for the client A = B which is wrong due to the loss of precision by the uint32 conversion. Also, as the screenshot suggests, on offy OMEN should show 1234568 and not 12346. Alternatively it's possible to calculate threat as damage*100 rather then damage*1, in the end it will give the same results, the only problem could be how this ratio works with some aura/effect that add/remove an hardcode flat value For DnD, I simple gave an example of a spell, but surely there are others, where threat value is wrong and with actual revision it can not be fixed by simply updating values on DB. For Searing Pain, Mind Blast, Earth Shock, threat is calculated using an hardcoded 2x by Unit::IsDamageToThreatSpell, I think we agree that maybe a more general approch using vaules from DB would be better. About Fade and Shadowmeld spells both add a big flat negative value, I didn't test yet but I suspect there could be some signed to unsigned conversion that gives problems
  15. Usually 1 damage does 1 threat so for dps classes TPS matches the DPS like we see on offy's screenshots (from 2k to 6k sounds realistic) while mangos, as you noted, gives just 1/100th of DPS as TPS. I think the problem is how threath is sent on SMSG_THREATUPDATES messages: threat is calculated usually as 1:1 from damage or 2:1 for IsDamageToThreatSpell (what's that?) and it's stored as float since it can be modified by some aura coefficients. When treath is sent to client with Unit::SendThreathUpdate the value is converted with uint32((*itr)->getThreat()) and the decimal fraction is lost due to truncate while, IMHO, it should be sent as uint32((*itr)->getThreat()*100) so 2 decimal fraction is preserved and thus it will explain the 2 orders of magnitude. For the DK treath, for example, DnD should give 1.9*damage as threat but actualy it can't be done since table SPELL_THREAT only allows a fixed valued per spell and, I'm not sure, only as immediate effect.
  16. Using this patch I noticed alot of misses with some palaind's spells like judgements, hammer of wrath and avenger shield: these spells are defined as damage class ranged so Unit::MeleeSpellHitResult wrongly looks for a ranged skill weapon despite these spells doesn't requires a weapon equipped and as result we got 0 and, since miss chance is now based on weapon skill difference, a base miss change of 60%. To solve it I modified the patch above to include a check to use max skill level in case the melee spell doesn't require a weapon. p.s. bump!
  17. patch updated for 10457 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8428cf2..136b759 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3043,7 +3043,7 @@ float Unit::MeleeMissChanceCalc(const Unit *pVictim, WeaponAttackType attType) c return 0.0f; // Base misschance 5% - float misschance = 5.0f; + float missChance = 5.0f; // DualWield - Melee spells and physical dmg spells - 5% , white damage 24% if (haveOffhandWeapon() && attType != RANGED_ATTACK) @@ -3051,63 +3051,51 @@ float Unit::MeleeMissChanceCalc(const Unit *pVictim, WeaponAttackType attType) c bool isNormal = false; for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i) { - if( m_currentSpells[i] && (GetSpellSchoolMask(m_currentSpells[i]->m_spellInfo) & SPELL_SCHOOL_MASK_NORMAL) ) + if (m_currentSpells[i] && (GetSpellSchoolMask(m_currentSpells[i]->m_spellInfo) & SPELL_SCHOOL_MASK_NORMAL)) { isNormal = true; break; } } - if (isNormal || m_currentSpells[CURRENT_MELEE_SPELL]) - misschance = 5.0f; - else - misschance = 24.0f; + if (!isNormal && !m_currentSpells[CURRENT_MELEE_SPELL]) + missChance += 19.0f; } - // PvP : PvE melee misschances per leveldif > 2 - int32 chance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7; + int32 skillBonus = int32(pVictim->GetDefenseSkillValue(this)) - int32(this->GetWeaponSkillValue(attType, pVictim)); - int32 leveldif = int32(pVictim->getLevelForTarget(this)) - int32(getLevelForTarget(pVictim)); - if(leveldif < 0) - leveldif = 0; + if (abs(skillBonus) <= 10) + missChance += skillBonus * 0.1f; + else + missChance += 1.0f + (skillBonus - 10) * 0.4f; // Hit chance from attacker based on ratings and auras - float m_modHitChance; if (attType == RANGED_ATTACK) - m_modHitChance = m_modRangedHitChance; - else - m_modHitChance = m_modMeleeHitChance; - - if(leveldif < 3) - misschance += (leveldif - m_modHitChance); + missChance -= m_modRangedHitChance; else - misschance += ((leveldif - 2) * chance - m_modHitChance); + missChance -= m_modMeleeHitChance; // Hit chance for victim based on ratings if (pVictim->GetTypeId()==TYPEID_PLAYER) { if (attType == RANGED_ATTACK) - misschance += ((Player*)pVictim)->GetRatingBonusValue(CR_HIT_TAKEN_RANGED); + missChance += ((Player*)pVictim)->GetRatingBonusValue(CR_HIT_TAKEN_RANGED); else - misschance += ((Player*)pVictim)->GetRatingBonusValue(CR_HIT_TAKEN_MELEE); + missChance += ((Player*)pVictim)->GetRatingBonusValue(CR_HIT_TAKEN_MELEE); } // Modify miss chance by victim auras if(attType == RANGED_ATTACK) - misschance -= pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE); + missChance -= pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE); else - misschance -= pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE); - - // Modify miss chance from skill difference ( bonus from skills is 0.04% ) - int32 skillBonus = int32(GetWeaponSkillValue(attType,pVictim)) - int32(pVictim->GetDefenseSkillValue(this)); - misschance -= skillBonus * 0.04f; + missChance -= pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE); // Limit miss chance from 0 to 60% - if ( misschance < 0.0f) + if (missChance < 0.0f) return 0.0f; - if ( misschance > 60.0f) + if (missChance > 60.0f) return 60.0f; - return misschance; + return missChance; } uint32 Unit::GetDefenseSkillValue(Unit const* target) const
  18. patch updated for 10457 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8428cf2..12bc683 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2728,44 +2728,41 @@ bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const * /*spellProto*/, Weap float Unit::MeleeSpellMissChance(Unit *pVictim, WeaponAttackType attType, int32 skillDiff, SpellEntry const *spell) { // Calculate hit chance (more correct for chance mod) - int32 HitChance; + float hitChance = 0.0f; // PvP - PvE melee chances - int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7; - int32 leveldif = pVictim->getLevelForTarget(this) - getLevelForTarget(pVictim); - if(leveldif < 3) - HitChance = 95 - leveldif; - else - HitChance = 93 - (leveldif - 2) * lchance; + if (pVictim->GetTypeId() == TYPEID_PLAYER) + hitChance = 95.0f + skillDiff * (skillDiff > 0 ? 0.02f : 0.04f); + else if (skillDiff < -10) + hitChance = 94.0f + (skillDiff + 10) * 0.4f; + else + hitChance = 95.0f + skillDiff * 0.1f; // Hit chance depends from victim auras - if(attType == RANGED_ATTACK) - HitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE); + if (attType == RANGED_ATTACK) + hitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE); else - HitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE); + hitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE); // Spellmod from SPELLMOD_RESIST_MISS_CHANCE - if(Player *modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, HitChance); + if (Player *modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, hitChance); // Miss = 100 - hit - float miss_chance= 100.0f - HitChance; + float missChance = 100.0f - hitChance; // Bonuses from attacker aura and ratings if (attType == RANGED_ATTACK) - miss_chance -= m_modRangedHitChance; + missChance -= m_modRangedHitChance; else - miss_chance -= m_modMeleeHitChance; - - // bonus from skills is 0.04% - miss_chance -= skillDiff * 0.04f; + missChance -= m_modMeleeHitChance; // Limit miss chance from 0 to 60% - if (miss_chance < 0.0f) + if (missChance < 0.0f) return 0.0f; - if (miss_chance > 60.0f) + if (missChance > 60.0f) return 60.0f; - return miss_chance; + return missChance; } // Melee based spells hit result calculations @@ -2777,7 +2774,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) attType = RANGED_ATTACK; // bonus from skills is 0.04% per skill Diff - int32 attackerWeaponSkill = int32(GetWeaponSkillValue(attType,pVictim)); + int32 attackerWeaponSkill = (spell->EquippedItemClass == ITEM_CLASS_WEAPON) ? int32(GetWeaponSkillValue(attType,pVictim)) : GetMaxSkillValueForLevel(); int32 skillDiff = attackerWeaponSkill - int32(pVictim->GetMaxSkillValueForLevel(this)); int32 fullSkillDiff = attackerWeaponSkill - int32(pVictim->GetDefenseSkillValue(this));
  19. On Unit::SpellHitResult // Check for immune if (pVictim->IsImmunedToSpell(spell)) return SPELL_MISS_IMMUNE; // All positive spells can`t miss // TODO: client not show miss log for this spells - so need find info for this in dbc and use it! if (IsPositiveSpell(spell->Id)) return SPELL_MISS_NONE; // Check for immune if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell))) return SPELL_MISS_IMMUNE; so in case of a positive spell there's a check if the victim IsImmunedToSpell but not if ImmunedToDamage while later in DoSpellHitOnUnit, if the same spell is a delayed spell, there are checks for both cases // Recheck immune (only for delayed spells) if (m_spellInfo->speed && ( unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) || unit->IsImmunedToSpell(m_spellInfo))) { if (realCaster) realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE); there's a reason for this different approach or just an exception for !isPositive is missing on recheck immune?
  20. * What bug does the patch fix? What features does the patch add? add a missing check to prevent mobs with AI to attack players despite some UNIT_FLAGS as answer to a "CallForHelp" from another mob * For which repository revision was the patch created? 10403 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. none * Who has been writing this patch? Please include either forum user names or email addresses. Revils diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ed675c4..c63a58b 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1703,6 +1703,9 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / if (isCivilian()) return false; + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE)) + return false; + // skip fighting creature if (isInCombat()) return false; p.s. I'm not sure if UNIT_STAT_STUNNED should be checked too
  21. I'd like to know too... I think that darkstalker is talking about a mob mind controlling a player not viceversa For http://www.wowhead.com/spell=28410 I had to add: - &Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM (22 spells) + &Aura::HandleModCharm, //177 SPELL_AURA_AOE_CHARM (22 spells) This way the player loses control since it becomes charmed but movement and casting should be handled but some sort of AI with own threat list and movement generators. As workaround it's still possible to make cast players on a boss SD2 scripts and using SetConfused(true) makes them moving random so they are things that the core already can do. p.s. for http://www.wowhead.com/spell=55479 on Spell::SetTargetMap + case 55479: // Force Obedience unMaxTargets = 1; break; should do the trick
  22. Revils

    Battle Log

    It's just a temporary fix, in a raid it will last for few seconds that's why I think it's related to some aura's opcode
  23. Revils

    Battle Log

    I did a whole NAXX 10 without paladins but also without warlocks and It was the only time I got no problem with combat log so maybe it's related with some pet opcode
  24. Revils

    Battle Log

    I think it's related to some paladin's aura: raiding without a paladin in group will gives no problems, while having at least one you are sure the COMBAT LOG will stop working after few minutes. I'ts hard to understand which spell blocks the combat log but I think it's started with 3.3.3 version
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use