Jump to content

darkstalker

Members
  • Posts

    717
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by darkstalker

  1. need official info on whats the correct attack distance, maybe depends on class/form or weapon you using
  2. ceil rounds up the number, meaningless to use on an integer value i think he uses ceil to only return 0 value when its effectively 0 (not rounded down)
  3. there is in Player::Update if (hasUnitState(UNIT_STAT_MELEE_ATTACKING)) { Unit *pVictim = getVictim(); if (pVictim && !IsNonMeleeSpellCasted(false)) { // default combat reach 10 // TODO add weapon,skill check float pldistance = ATTACK_DISTANCE; if (isAttackReady(BASE_ATTACK)) { if(!IsWithinDistInMap(pVictim, pldistance)) { setAttackTimer(BASE_ATTACK,100); if(m_swingErrorMsg != 1) // send single time (client auto repeat) { SendAttackSwingNotInRange(); m_swingErrorMsg = 1; } } ... in Object.h ATTACK_DISTANCE is set to 5.0f
  4. dont do this: *(uint32 *)&spell->AttributesEx2=0; instead: SpellEntry *spell = const_cast<SpellEntry*>(sSpellStore.LookupEntry(i)); spell->AttributesEx2 = 0; a lot cleaner and type safe -- reading the fixes, some of them are uber hacky.. casting bestial wrath while on bladestorm rofl
  5. you doing integer division here then casting to float, decimal data is already lost uint32 GetEndTimeMinutes() { return ceil(float(m_EndTimer / MINUTE / IN_MILISECONDS)); } so its better to do: uint32 GetEndTimeMinutes() { return ceil(float(m_EndTimer) / (MINUTE * IN_MILISECONDS)); }
  6. on retail you cant interact with mobs in a different floor level (unreachable by melee range), any ranged attacks in that situation its just evaded, but that was on TBC, dunno now.
  7. the trainable spell seems to be 64382 (damage), and it doesnt have SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY like 64380 (script effect) didnt test yet, but if 64382 its the spell casted by client then 64380 needs to be added as precast spell to remove immunity so the dmg part can land
  8. the wowiki page in line of sight is contradictory, and maybe outdated like most of the content there. I'm just following common sense here anyway i dont care much about being a bug-to-bug copy of retail, if you like this patch just use it. I would like more ppl to test it on live servers to see if it causes problems.
  9. i think its pretty obvious that terrain should block LoS currently you can send ppl through the ground with some spells because of this feature missing
  10. that hunk conflict shows two addition lines that didnt match context, you should be able to safely remove the conflict markers and compile the result
  11. a log rotation feature would be nice
  12. Made this because of mangos currently doesn't support LoS blocking because of ground level differences, so tried to implement it. Seems to work, at least cant shoot to the WSG graveyard from below anymore, but more testing is needed, and maybe a better way to do it if possible. diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 687202c..13b288b 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1275,8 +1275,32 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const { float x,y,z; GetPosition(x,y,z); + z += 2.0f; + oz += 2.0f; + + // check for line of sight because of terrain height differences + Map const *map = GetBaseMap(); + float dx = ox - x, dy = oy - y, dz = oz - z; + float dist = sqrt(dx*dx + dy*dy + dz*dz); + if (dist > ATTACK_DISTANCE && dist < MAX_VISIBILITY_DISTANCE) + { + uint32 steps = uint32(dist / TERRAIN_LOS_STEP_DISTANCE); + float step_dist = dist / (float)steps; // to make sampling intervals symmetric in both directions + float inc_factor = step_dist / dist; + float incx = dx*inc_factor, incy = dy*inc_factor, incz = dz*inc_factor; + float px = x, py = y, pz = z; + for (; steps; --steps) + { + if (map->GetHeight(px, py, pz, false) > pz) + return false; // found intersection with ground + px += incx; + py += incy; + pz += incz; + } + } + VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); - return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f); + return vMapManager->isInLineOfSight(GetMapId(), x, y, z, ox, oy, oz); } bool WorldObject::GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D /* = true */) const diff --git a/src/game/Object.h b/src/game/Object.h index 4707f47..3678140 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -39,6 +39,7 @@ #define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects #define MAX_STEALTH_DETECT_RANGE 45.0f +#define TERRAIN_LOS_STEP_DISTANCE 3.0f enum TypeMask { edit: updated patch to fix some problems (los block in only one direction because of asymmetric sampling)
  13. * What bug does the patch fix? What features does the patch add? Implements critical strike damage reduction for periodic damage over time spells. * For which repository revision was the patch created? 8904 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. dont know anyone * Who has been writing this patch? Please include either forum user names or email addresses. darkstalker diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 9a65053..73331a5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6439,7 +6439,11 @@ void Aura::PeriodicTick() // send critical in hit info for threat calculation if (isCrit) + { cleanDamage.hitOutCome = MELEE_HIT_CRIT; + // Resilience - reduce crit damage + pdamage -= m_target->GetSpellCritDamageReduction(pdamage); + } // only from players // FIXME: need use SpellDamageBonus instead?
  14. i hate when ppl post videos as "proof", its like the worst way of doing it only real proof is formulas ;>
  15. sounds interesting what you use for drawing, opengl?
  16. i had one possible implementation here http://www.getmangos.eu/community/showthread.php?t=10520 still had that target problem (only thing that made me not make a patch) had to do a ugly hack to workaround it. So its doing this correct? or still hacky? + // SPELL_EFFECT_SUMMON_ALL_TOTEMS not have any implicit target + if(m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON_ALL_TOTEMS) + AddUnitTarget(m_caster, i);
  17. add debug info to your crash dumps (dont delete the .pdb files) so they are readable
  18. Some spells have EffectImplicitTargetA = 46 (TARGET_SCRIPT_COORDINATES) or 36 (TARGET_SCRIPT), is possible to write code that selects the target? only thing i found is a db table (spell_script_target) who can select nearest creature/go, but that doesn't fit in a lot of situations.
  19. you need 3.2.2a dbc files for official supported mangos
  20. hit cap for whites is around 800
  21. something like this Unit::AuraList const& auras = m_caster->GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL); for (Unit::AuraList::const_iterator it = auras.begin(); it != auras.end(); it++) if ((*it)->GetId() == 29723 || (*it)->GetId() == 29724 || (*it)->GetId() == 29725) { lastrage = (*it)->GetSpellProto()->EffectBasePoints[1] + 1; break; }
  22. the remaining rage value is stored in EffectBasePoints[1] SELECT Id,SpellName,Rank,EffectBasePoints1+1 FROM `spell` WHERE Id IN (29723,29725,29724); 29723 Sudden Death Rank 1 3 29725 Sudden Death Rank 2 7 29724 Sudden Death Rank 3 10 ... always when i see a bunch of HasAura()'s i wonder why not implement something like GetTalentRank(), talents dont change continuoulsy so can be a constant time lookup
×
×
  • 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