Jump to content

KAPATEJIb

Members
  • Posts

    436
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by KAPATEJIb

  1. That patch cause a script dev 2 errors

    Linking...
        Creating library ..\\..\\..\\..\\bin\\win32_release/MaNGOSScript.lib and object ..\\..\\..\\..\\bin\\win32_release/MaNGOSScript.exp
    mob_event_ai.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl urand(unsigned int,unsigned int)" (?urand@@YAIII@Z) referenced in function "public: virtual void __thiscall Mob_EventAI::Reset(void)" (?Reset@Mob_EventAI@@UAEXXZ)
    ..\\..\\..\\..\\bin\\win32_release/MaNGOSScript.dll : fatal error LNK1120: 1 unresolved externals
    Build log was saved at "file://c:\\Documents and Settings\\Администратор\\Рабочий стол\\EmulatorX\\Source\\src\\bindings\\ScriptDev2\\VC80\\ScriptDev2__Win32_Release\\BuildLog.htm"
    ScriptDev2 - 2 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    As i understand the problem in

                                                    (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);

    in mob_event_ai.cpp. How i can fix it?

  2. Patch is not outdated, for correct interrupt spells by charm, fear and stun we still need to use that patch; for silence case - all ok.

    Here update for last revisions

    Index: src/game/SpellAuras.cpp
    ===================================================================
    --- src/game/SpellAuras.cpp        (revision 4917)
    +++ src/game/SpellAuras.cpp        (working copy)
    @@ -1850,7 +1850,7 @@
                    {
                            m_target->SetCharmerGUID(GetCasterGUID());
                            m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
    -
    +                        m_target->Cancelcast();
                            caster->SetCharm(m_target);
    
                            if(caster->getVictim()==m_target)
    @@ -1960,6 +1960,7 @@
            if( apply )
            {
                    m_target->addUnitState(UNIT_STAT_CONFUSED);
    +                m_target->Cancelcast();
                    m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
    
                    if(m_target->GetTypeId() == TYPEID_PLAYER)
    @@ -2027,6 +2028,7 @@
            if( Apply )
            {
                    m_target->addUnitState(UNIT_STAT_FLEEING);
    +                m_target->Cancelcast();
                    m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
    
                    // only at real add aura
    @@ -2162,6 +2164,7 @@
                    m_target->SetUInt64Value (UNIT_FIELD_TARGET, 0);
    
                    m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
    +                m_target->Cancelcast();
    
                    if (caster)
                    {
    Index: src/game/Unit.cpp
    ===================================================================
    --- src/game/Unit.cpp        (revision 4917)
    +++ src/game/Unit.cpp        (working copy)
    @@ -943,6 +943,13 @@
            DEBUG_LOG("DealDamageEnd");
    }
    
    +void Unit::Cancelcast()
    +{
    +        for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
    +                if (m_currentSpells[i])
    +                        InterruptSpell(i);
    +}
    +
    void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
    {
            SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
    Index: src/game/Unit.h
    ===================================================================
    --- src/game/Unit.h        (revision 4917)
    +++ src/game/Unit.h        (working copy)
    @@ -755,6 +755,7 @@
                            return NULL;
                    }
                    bool Attack(Unit *victim, bool playerMeleeAttack = false);
    +                void Cancelcast();
                    bool AttackStop();
                    void RemoveAllAttackers();
                    AttackerSet const& getAttackers() const { return m_attackers; }

  3. I'm using another patch, and that feature works perfect

    Index: src/game/SpellAuras.cpp
    ===================================================================
    --- src/game/SpellAuras.cpp        (revision 4374)
    +++ src/game/SpellAuras.cpp        (working copy)
    @@ -1769,7 +1769,7 @@
                            m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
    
                            caster->SetCharm(m_target);
    -
    +                        m_target->Cancelcast();
                            if(caster->getVictim()==m_target)
                                    caster->AttackStop();
                            m_target->CombatStop();
    @@ -1877,6 +1877,7 @@
            if( apply )
            {
                    m_target->addUnitState(UNIT_STAT_CONFUSED);
    +                m_target->Cancelcast();
                                                                                                                            // probably wrong
                    m_target->SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16));
    
    @@ -1927,6 +1928,8 @@
            if( Apply )
            {
                    m_target->addUnitState(UNIT_STAT_FLEEING);
    +                m_target->Cancelcast();
    +                // m_target->AttackStop();
                    m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE | UNIT_FLAG_FLEEING);
    
                    // only at real add aura
    @@ -2028,6 +2031,7 @@
                    m_target->addUnitState(UNIT_STAT_STUNDED);
                    m_target->SetUInt64Value (UNIT_FIELD_TARGET, 0);
                    m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
    +                m_target->Cancelcast();
    
                    // Stop attack if spell has knockout effect
                    if (caster && (GetSpellProto()->Mechanic == MECHANIC_KNOCKOUT))
    @@ -2289,7 +2293,10 @@
                    return;
    
            if(apply)
    +        {
                    m_target->m_silenced = true;
    +                m_target->Cancelcast();
    +        }
            else
            {
                    // Real remove called after current aura remove from lists, check if other similar auras active
    Index: src/game/Unit.cpp
    ===================================================================
    --- src/game/Unit.cpp        (revision 4374)
    +++ src/game/Unit.cpp        (working copy)
    @@ -6911,3 +6911,10 @@
                            return true;
            return false;
    }
    +
    +void Unit::Cancelcast()
    +{
    +        for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
    +                if (m_currentSpells[i])
    +                        InterruptSpell(i);
    +}
    Index: src/game/Unit.h
    ===================================================================
    --- src/game/Unit.h        (revision 4374)
    +++ src/game/Unit.h        (working copy)
    @@ -751,6 +751,7 @@
                            return NULL;
                    }
                    bool Attack(Unit *victim, bool playerMeleeAttack = false);
    +                void Cancelcast();
                    bool AttackStop();
                    void RemoveAllAttackers();
                    AttackerSet const& getAttackers() const { return m_attackers; }

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