Jump to content

maly32167

Members
  • Posts

    72
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by maly32167

  1. Description of the bug? Master of Elements was allowed to procc only from second effect which does not exist in 3.3.2 DBC, i have no idea but i think it was added in 3.3.0 cause neither 3.3.2 nor 3.2.2 has second effect, removing effIndex limitation enables talent proccing. For which repository revision was the patch created? 9377 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f163012..6e0aca1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5505,9 +5505,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if(!procSpell) return false; - if (effIndex!=1) - return true; - // mana cost save int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; basepoints0 = cost * triggerAmount/100;
  2. 3 ? so not flying | 4 ? Edit: ok gonna try Edit again not to make another post Thank You ! InhabitType 3 worked.
  3. Hah i remember doing it on 3.1.3 such way, by loading table into std::map attacked to each zeppelin ID, got it kinda working, NPC was moving but it was crashing a lot on map replacement of Zeppelin and actually it was... glitchy too much so i abandoned my work :<
  4. Hmmm actually i just made it git clone youradress Vehicle I also have the thingy You linked, still vehicles are not capable of flying even with that specific flag(cast) Gonna try cloning master branch then pulling vehicles, though i doubt it will start working Uhm actually flying vehicles cannot move at all, just turn around....
  5. Wojta, any advice how to make Vehicle being able to fly, or its not really working on 3.3.x ? I have compiled and run (after few errors fixing ;p) Your Vehicle branch from Valhalla-Project but i cant get Vehicle (not vehicle only actually) flying, tryed normal flying NPCs with charm spells too, they can only walk on ground.
  6. I am using it for a bit of time already with dead-lock fix i posted up there, seems to work ok, rogues are happy so, its fine
  7. I checked all spells that cause deadloop (enchant has same effect triggered to trigger DealSpellDamage again) it seems to make the thing, its unknown attr but seems its set for all spells that shouldnt trigger anything other than what they have in SpellEffect // Check if effect can trigger anything actually (is this a right ATTR ?) if( spellProto->AttributesEx3 & SPELL_ATTR_EX3_UNK16 ) hasWeaponDmgEffect = false;
  8. It is really unsafe to check only these effects... i mean, it causes proc things on spells triggered from random things like Unfair Advantage dodge-proc Also causes (deadly)deadloop from enchants that have effects specified here if (spellProto->Effect == SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL || spellProto->Effect == SPELL_EFFECT_WEAPON_PERCENT_DAMAGE || spellProto->Effect == SPELL_EFFECT_WEAPON_DAMAGE || spellProto->Effect == SPELL_EFFECT_NORMALIZED_WEAPON_DMG) So for example http://www.wowhead.com/?spell=50401 procced by Rune of Razorice, as effect is SPELL_EFFECT_WEAPON_PERCENT_DAMAGE it procs DealSpellDamage and then again CastItemCombatSpell for itself, and here we go, a nice deadloop ready
  9. Edited: Problem solved, changed from highlight to code to fix some wrong formatted lines of patch Update: Added duration dependecy for same effect value auras
  10. So... as many ppl know mangos lack of general stacking system for same-effect spells which makes some spell to apply twice, which means stacked Blessing of Might and Battleshout etc... Here is something ive already got after some moment spent on trying to get it working diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9f141df..d86f888 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4882,6 +4882,34 @@ SpellCastResult Spell::CheckCast(bool strict) } } + Unit::AuraMap::iterator Aurmap,next; + for (Aurmap = m_caster->GetAuras().begin(); Aurmap != m_caster->GetAuras().end(); Aurmap = next) + { + next = Aurmap; + ++next; + if (!(*Aurmap).second) continue; + + if (!(*Aurmap).second->GetSpellProto()) + continue; + + if((*Aurmap).second->IsPassive()) + continue; + + if( IsPassiveSpell((*Aurmap).second->GetId()) ) + continue; + + SpellEntry const* i_spellProto = (*Aurmap).second->GetSpellProto(); + if( i_spellProto->Id == (*Aurmap).second->GetId() && m_caster == (*Aurmap).second->GetCaster() ) + continue; + + Unit * Target = m_targets.getUnitTarget(); + int32 EffectValue = CalculateDamage(0,Target); + + if( m_spellInfo->EffectApplyAuraName[0] == i_spellProto->EffectApplyAuraName[0] ) + if( (*Aurmap).second->GetModifier()->m_amount > EffectValue || ( (*Aurmap).second->GetModifier()->m_amount == EffectValue && (*Aurmap).second->GetAuraDuration() > Target->CalculateSpellDuration(m_spellInfo, 0, Target) ) ) + return SPELL_FAILED_AURA_BOUNCED; + } + // all ok return SPELL_CAST_OK; } @@ -6139,7 +6167,36 @@ void Spell::FillRaidOrPartyTargets( UnitList &TagUnitMap, Unit* member, Unit* ce { if ((Target==center || center->IsWithinDistInMap(Target, radius)) && (withcaster || Target != m_caster)) + { + bool hasMorePowerful = false; + Unit::AuraMap::iterator Aurmap,next; + for (Aurmap = Target->GetAuras().begin(); Aurmap != Target->GetAuras().end(); Aurmap = next) + { + next = Aurmap; + ++next; + if (!(*Aurmap).second) continue; + + if (!(*Aurmap).second->GetSpellProto()) + continue; + + if((*Aurmap).second->IsPassive()) + continue; + + if( IsPassiveSpell((*Aurmap).second->GetId()) ) + continue; + + SpellEntry const* i_spellProto = (*Aurmap).second->GetSpellProto(); + + if( m_spellInfo->EffectApplyAuraName[0] == i_spellProto->EffectApplyAuraName[0] ) + if( (*Aurmap).second->GetModifier()->m_amount > CalculateDamage(0,Target) || ( (*Aurmap).second->GetModifier()->m_amount == CalculateDamage(0,Target) && (*Aurmap).second->GetAuraDuration() > Target->CalculateSpellDuration(m_spellInfo, 0, Target)) ) + hasMorePowerful = true; + } + + if( hasMorePowerful ) + continue; + TagUnitMap.push_back(Target); + } if (withPets) if (Pet* pet = Target->GetPet()) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 5bda5ee..30a3049 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -24,6 +24,7 @@ #include "World.h" #include "Chat.h" #include "Spell.h" +#include "SpellAuras.h" #include "BattleGroundMgr.h" SpellMgr::SpellMgr() @@ -1301,6 +1302,18 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo) return true; } +bool SpellMgr::IsEffectHigherThanSecond(Aura *spellAura_1, Aura *spellAura_2 ) +{ + SpellEntry const* aurSpellInfo_1 = spellAura_1->GetSpellProto(); + SpellEntry const* aurSpellInfo_2 = spellAura_2->GetSpellProto(); + + if( aurSpellInfo_1->EffectApplyAuraName[0] == aurSpellInfo_2->EffectApplyAuraName[0] ) + if( (spellAura_1->GetModifier()->m_amount >= spellAura_2->GetModifier()->m_amount) ) + return true; + + return false; +} + bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) const { SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 8d8e3d8..7c2f960 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -34,6 +34,7 @@ class Player; class Spell; +class Aura; struct SpellModifier; // only used in code @@ -878,6 +879,7 @@ class SpellMgr bool IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellId_2) const; static bool canStackSpellRanks(SpellEntry const *spellInfo); bool IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) const; + bool IsEffectHigherThanSecond(Aura * spellAura_1, Aura * spellAura_2); SpellEntry const* SelectAuraRankForPlayerLevel(SpellEntry const* spellInfo, uint32 playerLevel) const; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 42d434d..db26549 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3868,6 +3868,28 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) continue; } + if(sSpellMgr.IsEffectHigherThanSecond(Aur, ((*i).second)) ) + { + if(Aur->IsPassive() || ((*i).second)->IsPassive() ) + continue; + + // Its a parent aura (create this aura in ApplyModifier) + if ((*i).second->IsInUse()) + { + sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex()); + continue; + } + + RemoveAurasDueToSpell(i_spellId); + + if( m_Auras.empty() ) + break; + else + next = m_Auras.begin(); + + continue; + } + // non single (per caster) per target spell specific (possible single spell per target at caster) if( !is_spellSpecPerTargetPerCaster && !is_spellSpecPerTarget && sSpellMgr.IsNoStackSpellDueToSpell(spellId, i_spellId) ) { Its just some initial code and may kinda break many things so better don't test it on Your servers What is already added - Same effects will not stack, it will remove weaker effect one, also if target has already more powerful buff with same effect it will return proper error. What must be done to get it more-less "perfect": - When effect has same value (like untalented battle shout and blessing of might) it should apply the one that has longer duration, as now untalented battle shout (shorter duration) will remove untalented blessing of might and should not - Some pet casted spells are still applied even tho target selecting code is there, need to find where its handled yet. (in this case i mean Commanding Shout and Blood Pact of Imps) - Some two-effect spells should be able to be casted even tho more powerful effect is already on target, however only second effect should apply then (as in meaning, Aura should apply but only with effect that differs from effect target already has) - Some triggered auras (mostly from talents) still may have problems after adding this system. - There might be a case where specified effect that shouldnt stack is stored in second or third effect of aura which is not already implemented (only first effects are check yet) Some other things about patch; +class Aura; is added only becouse without it Debug_NoPCH project would not compile, dunno why Patch was tested about stability only with few players so cant really tell much about how it will work on high-population servers. If anyone want to continue work on this, good luck (i will implement duration checks from TODO #1 soon)
  11. Ok well, it might work, then; - Need to correct data1 field as UDB has it wrong (60 should be 83) - Need to find a way how to activate trap remotely from script Thx for reply.
  12. Hello, i was trying to make GameObject class casting spell, actually im not sure if its even done like that on blizzard but what i meant to do is fixing Heigan's Eruption spell, actually not fixing but making it look like that in combat log SPELL_DAMAGE,0xF11002C5AD010715,"Plague Fissure",0x4228,0x050000000016F71D,"playername",0x10511,29371,"Eruption",0x8,6817,0,8,0,0,0,nil,nil,nil As You can see on blizzard spell is casted by "Plague Fissure" which is GameObject (there is also no NPC trigger with such name) I tryed to cast it from boss with adding OrginalCaster guid of object but then it wasnt really casted (or dealt no damage) I tryed rewriting casting code alot but always failed ;p crashes freezes and what not so dunno if its done by NPC trigger that inherits name somehow, but then level of it would be a problem becouse GameObject doesnt have level field (even if taken from uint32 val not really working) If anyone know if its possible i would really appreciate any help ?
  13. That is true, GameObject since adding things like Wintergrasp have their HP, though they arent actually attackable by "melee" but its handled by spells (with effect to deal SiegeDamage), when HP goes to 0 its visual changes and yes, it is not yet implemented on mangos.
  14. Its rev 8647 cause our server is on 3.1.3 too and we just backported this for getting it working
  15. You either have pretty outdated mangos or doing something wrong cause for me they are working just like on blizz (for ~2 weeks already)
  16. if You want f/e make caster face target, use caster->SetOrientation(caster->GetAngle(target)); but also remember about updating position so caster->StopMoving();
  17. Just use InhabitType |= 4 ? (5 for ground+air, 7 for water,ground and air) in creature_template ? Mangos fixed movement of flying creatures sometime ago and it works as good as it should. and yes, might also need movementFlag = 1024 in creature_template_addon(creature_addon)
  18. Why not use mangos iterators for it ? for example CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*m_creature,objectentry,range); MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(m_creature, p_GameObject,go_check); TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, object_checker, *m_creature->GetMap(), *m_creature, range); if (p_GameObject) { // Here You have access to Your gameobject } I didn't test and compile it but should work if You ofc change objectentry, range and pointer (i used m_creature cause You said its creature script)
  19. I actually find AI enabling for pets very usable, Snakes from Snake Trap for example, hardcoding doesnt look good for it though "When you register your script (inside the script itself - newscript->GetAI = &GetAI_whatever; - inside GetAI_whateve), you can always check if this creature is controlled or not. If it is, and you want your custom script to run, you return it, otherwise, you just return petAI" Qsa, i doubt its possible like that cause AI is loaded while loading core, You cant get pointer to creature itself from that point of code
  20. Dunno if its faster/better but here is how i did it: if( (*i)->GetSpellProto()->SpellIconID == 959 && ( GetTypeId() == TYPEID_PLAYER && ((Player*)(this))->m_form != FORM_CAT ) ) continue; to int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const in AuraList iterator along with adding (like everyone else) m_target->UpdateSpeed(MOVE_RUN, true); to void Aura::HandleAuraModShapeshift(bool apply, bool Real) (sorry for lack of patch...)
  21. maly32167

    [Help] groups

    Player *plr = m_caster->getVictim(); if(Group *pGroup = plr->GetGroup()) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* pGroupGuy = itr->getSource(); if(!pGroupGuy) continue; // Add aura here (prolly by pGroupGuy->CastSpell( pGroupGuy, id, true/false); } }
  22. Here are some answers, hope they will help 1) HandleAuraDummy is called from Aura::ApplyModifier with (*this.*AuraHandler [aura])(apply, Real); 2) Apply is set in many places actually so cant really specify it (just look for ApplyModifier and there You have true/false being set, which is sent to HandleAuraDummy 3) Spell:: Delayed() handles spell pushback I cant find removing pet's castbar on death now, also i hope rest is accurate.
×
×
  • 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