Jump to content

Feanordev

Members
  • Posts

    66
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Feanordev

  1. Updated: Now dispel chances are properly taken for caster/target. thx for pointing out as I didnt test at diff targets, now everything is fine.

    diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
    index 40c9709..ee7d6bc 100644
    --- a/src/game/SpellEffects.cpp
    +++ b/src/game/SpellEffects.cpp
    @@ -9041,9 +9041,34 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
            {
                // Random select buff for dispel
                SpellAuraHolder *holder = steal_list[urand(0, list_size-1)];
    -            // Not use chance for steal
    -            // TODO possible need do it
    -            success_list.push_back(SuccessList::value_type(holder->GetId(),holder->GetCasterGuid()));
    +
    +            int32 miss_chance = 0;
    +            // Apply dispel mod from aura caster
    +
    +            Unit * caster = holder->GetCaster();
    +            Unit * target = holder->GetTarget();
    +            if(!caster || !target)
    +                continue;
    +
    +            if (Player* modOwner = caster->GetSpellModOwner())
    +            {
    +                modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
    +                miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
    +            }
    +
    +            if (caster != target)
    +            {
    +                if (Player* modOwner = target->GetSpellModOwner())
    +                {
    +                    modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
    +                    miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
    +                }
    +            }
    +
    +            // Try dispel
    +            if (!roll_chance_i(miss_chance))
    +                success_list.push_back(SuccessList::value_type(holder->GetId(),holder->GetCasterGuid()));
    +            else m_caster->SendSpellMiss(unitTarget, holder->GetSpellProto()->Id, SPELL_MISS_RESIST);
    
                // Remove buff from list for prevent doubles
                for (StealList::iterator j = steal_list.begin(); j != steal_list.end(); )
    
    

  2. Then change

    WorldSession::HandleChannelPasswordOpcode

    WorldSession::HandleChannelSetOwnerOpcode

    etc...

    add this for example to each to prevent handling slash commands... (or send proper message to player that he has no priviledges to do it)

    if (GetSecurity < SEC_MODERATOR)

    return;

  3. Yes Im sure about aura's casters DISPEL_RESIST mod (for example Silent Resolve talent of priest - it reduces change your helpful spells will be dispelled - therfore if you buff someone else, it must be chance lowering must be taken from aura caster itself)

    Also I have used this patch for almost 1 year now and everything seems to work pretty much fine :)

  4. Well I remember Ascent implemented somekind of this idea tho it wasnt based on different boxes, the idea was to handle map as... per map, every crash was unloading map and reloading it so if crash happened to instance, it was only single instance being shut-down and rest of world was still up. Afaik this idea was abandoned long time ago so dunno if its anyhow related nowadays...

  5. Little bit of bump as its kinda important, I'm not sure how properly it was working before rewrite but nowadays many encounters are pretty heavy (tank must run all the time to keep boss faced, otherway it tries to run behind him, making encounters like Grobbulus randomly wipe raid cause of his frontal breath and adds spawn cause of that :P) I hadn't time to check how this class works but adding just 90 left/right degrees limit should fix all the problems imo

  6. Since last rewrite there are a lot of problems which appeared for tanks:

    ObjectPosSelector should have max angle... if you tank more than ~6 mobs, some go behind you - they should not.

    If you tank 2 mobs, they are switching left / right sides constantly, makes unable to properly face some bosses which should be always infront of you.

  7. I have a question, when exactly to use const_iterator ?

    Ive read its good to use only when you do not modify container as it wont be allowed, however;

    I just managed to compile such code

    std::set<ObjectGuid> sSet;

    std::set<ObjectGuid>::const_iterator itr = sSet.begin();

    sSet.erase(itr);

    Should be this disallowed by compilator ? (Same goes about list and all other containers)

    Ah I found my answer:

    Interestingly at least in N3092 for C++0x, containers' erase and insert methods indeed take const_iterator.

    Can be closed / removed.

  8. This is what I got at AI of ormorok in Nexus

    He casts spikes in b, f, l, r directions

    SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
                   SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
                   SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
                   SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
                   SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
                   SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
                   SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
                   SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));

    I guess you can use it to evaluate it for your use

  9. Dunno if its that

    sLog.outError("Not controlled pet %d lost view from owner, removed. Owner = %d, distance = %d, pet GUID = ", GetGUID(),owner->GetObjectGuid(), GetDistance2d(owner), owner->GetPetGuid().GetCounter());

    look %d %d %d and you provide GetGUID, GetObjectGuid, Distance and Counter (3 vs 4) - fix structure of errorLog then change GetGUID to GetObjectGuid().GetCounter() maybe - this is multipet custom code by the way...

×
×
  • 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