Jump to content

pasdVn

Members
  • Posts

    261
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by pasdVn

  1. Ok. The second one was in fact just an example how warnings are printed out normally (as much as I understand it), and how C::B can parse and recognize them as warnings.

    The question is, if the first message is really a kind of error/warning, or if it just missdirected to std::error.

    If it is a warning, why has it not the format of other warnings.

    If it is an error, why is the build successfull^^?

  2. Hey guys,

    stupid topic-subject, but I did not find a better one :x. I want to use Codblocks as an confortable IDE to develope mangos at linux (ubuntu in detail). Therefore I use the auto-generated makefiles, what works quite well. I just have a single problem when building the "thread building blocks" library: During the buildprocess there is a single output at std:error:

    ../../../dep/tbb/build/Makefile.tbb:39: CONFIG: cfg=release arch=intel64 compiler=gcc os=linux runtime=cc4.4.4_libc2.12.1_kernel2.6.35

    I would not mind this sensless error/warning, but Codeblocks can not parse this output and so identifies this as an error (so the build was not successfull for C::B). As much as I could find out, normal warnings of gcc always consist of line that prints out the file and and a next one, that specifies the line and contains the word "warning" like this (C::B uses regexes to parse this output):

    ../../../../src/game/vmap/MapTree.cpp: In member function 'bool VMAP::StaticMapTree::LoadMapTile(uint32, uint32, VMAP::VMapManager2*)':
    ../../../../src/game/vmap/MapTree.cpp:383: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result

    Can anybody give me a hint, what the error/warning above is about, or how I can fix it, that it get's printed to std::out? I not very used to the whole gnu autobuild tools and have no idea where to start to fix it.

    As a walkaround I could redirect std::error to /dev/null or anywhere else, but I don't want to do it, if I don't have to :-/.

    pasdVn

  3. Hey guys,

    need the help of one of you pros one more time ;-) It is probably more a generic programming problem. That is why I post it here.

    Following szenario: I want to access the class PetAI from an extern scripting project (to be more specific: scriptdev2). I use the following code (just a minimal example):

    /* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    */
    
    /* ScriptData
    SDName: Pet_Scripts
    SD%Complete: ??
    SDComment: Here is the place for scripted AI for guardian and mini pets.
    SDCategory: Pets
    EndScriptData */
    
    #include "precompiled.h"
    #include "PetAI.h"
    
    struct MANGOS_DLL_DECL pet_simple_guardianAI : public PetAI
    {
       pet_simple_guardianAI(Creature* pCreature): PetAI(pCreature)
       {
       }
    };
    
    
    CreatureAI* GetAI_pet_simple_guardian(Creature* pCreature)
    {
       if (pCreature->isPet())
           return new pet_simple_guardianAI(pCreature);
       else
           return NULL;
    }
    
    void AddSC_pets()
    {
       Script *newscript;
    
       newscript = new Script;
       newscript->Name = "pet_simple_guardian";
       newscript->GetAI = &GetAI_pet_simple_guardian;
       newscript->RegisterSelf();
    }
    

    I ofc also added the declaration and call in ScriptLoader.cpp and defined PetAI as MANGOS_DLL_SPEC to get acess from the extern dll.

    The Problem: Code compiles and works until the pet (guardian pet) get's delete (and thus the AI). I always a get a crash at the destructor which I can not really understand.

    > msvcr90d.dll!operator delete(void * pUserData=0x6eaebee0) Line 52 + 0x51 bytes C++

    mangosscript.dll!std::allocator<std::_Tree_nod<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::_Node>::Deallocate(std::_Tree_nod<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::_Node * _Ptr=0x6eaebee0, unsigned int __formal=1) Line 140 + 0x9 bytes C++

    mangosscript.dll!std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::_Erase(std::_Tree_nod<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::_Node * _Rootnode=0x6eaebee0) Line 1173 C++

    mangosscript.dll!std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::clear() Line 972 C++

    mangosscript.dll!std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::erase(std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::const_iterator _First=27, std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::const_iterator _Last=1065353216) Line 938 C++

    mangosscript.dll!std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::_Tidy() Line 1421 + 0xaa bytes C++

    mangosscript.dll!std::_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >::~_Tree<std::_Tset_traits<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64>,0> >() Line 541 C++

    mangosscript.dll!std::set<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64> >::~set<unsigned __int64,std::less<unsigned __int64>,std::allocator<unsigned __int64> >() + 0x2b bytes C++

    mangosscript.dll!PetAI::~PetAI() + 0x54 bytes C++

    mangosscript.dll!pet_simple_guardianAI::~pet_simple_guardianAI() + 0x2b bytes C++

    mangosscript.dll!pet_simple_guardianAI::`scalar deleting destructor'() + 0x2b bytes C++

    mangosd.exe!Creature::~Creature() Line 149 + 0x28 bytes C++

    mangosd.exe!Pet::~Pet() Line 59 + 0x45 bytes C++

    mangosd.exe!Pet::`scalar deleting destructor'() + 0x16 bytes C++

    mangosd.exe!Map::DeleteFromWorld<Creature>(Creature * obj=0x6e8a4000) Line 248 + 0x22 bytes C++

    mangosd.exe!Map::Remove<Creature>(Creature * obj=0x6e8a4000, bool remove=true) Line 733 C++

    mangosd.exe!Map::RemoveAllObjectsInRemoveList() Line 1521 C++

    mangosd.exe!MapManager::RemoveAllObjectsInRemoveList() Line 276 + 0x1d bytes C++

    mangosd.exe!World::Update(unsigned int diff=141) Line 1553 C++

    mangosd.exe!WorldRunnable::run() Line 61 C++

    mangosd.exe!ACE_Based::Thread::ThreadTask(void * param=0x72085900) Line 187 + 0xf bytes C++

    ACEd.dll!ACE_OS_Thread_Adapter::invoke() Line 90 + 0x9 bytes C++

    ACEd.dll!ace_thread_adapter(void * args=0x0bc319d8) Line 124 + 0xf bytes C++

    msvcr90d.dll!_callthreadstartex() Line 348 + 0xf bytes C

    msvcr90d.dll!_threadstartex(void * ptd=0x0bc35988) Line 331 C

    kernel32.dll!76751194()

    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

    ntdll.dll!77cab495()

    ntdll.dll!77cab468()

    I guess, that is somehow to do with the dll export (I do not really understand that much of those things) as the code runs _without_ problems at linux.

    I already tried various things, as definig the destructor explicit in PetAI/ pet_simple_guardianAI, make it virtual (althoug it anway only is called via CreatureAI pointers), using a class instead of a struct etc.

    Did not have success until now. Always the same crash.

    Hope anybody of you can give me a hint.

    Greetings pasdVn

    Edit: Omg. Finally I got it work! I defined an empty destructor for petAI, but not in the header, but in the cpp file. Probably he had problems, when calling the default destructor of a mangos-own function (bt: mangosscript.dll!PetAI::~PetAI() + 0x54 bytes C++ ).

  4. Hey guys,

    here comes just a little patch to fix a custom behaviour of the paladins Blessing of Kings and Blessign of sanctuary. The stat percent aura of sanctuary (sta and str) should NOT be applied when BoK is already on this player.

    diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
    index f2641e5..a5e29a5 100644
    --- a/src/game/SpellAuras.cpp
    +++ b/src/game/SpellAuras.cpp
    @@ -3023,6 +3023,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                    case 20911:                                 // Blessing of Sanctuary
                    case 25899:                                 // Greater Blessing of Sanctuary
                    {
    +                    // check for (Greater) Blessing of Kings
    +                    if (target->GetAura(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_PALADIN, UI64LIT(0x0000000001000000)))
    +                        break;
    +
                        if (apply)
                            target->CastSpell(target, 67480, true, NULL, this);
                        else
    @@ -6975,6 +6979,24 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
                    else if (!apply)
                        caster->RemoveAurasDueToSpell(64364);
                }
    +            if (m_spellProto->SpellFamilyFlags &            // (Greater) Blessing of Kings
    +                UI64LIT(0x0000000001000000))
    +            {
    +                // check for (Greater) Blessing of Sanctuary
    +                if (!m_target->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_PALADIN, UI64LIT(0x0000000010000000))
    +                    break;
    +
    +                if (!apply)
    +                {
    +                    cast_at_remove = true;
    +                    spellId1 = 67480;
    +                }
    +                else
    +                    m_target->RemoveAurasDueToSpell(67480);
    +
    +                break;
    +            }
    +
                if (m_spellProto->Id == 31884)                  // Avenging Wrath
                {
                    if(!apply)
    
    

    • * the hardcoded "4" does not fit in any case (neither immolate, nor shadowflame)
      * the dot damage also needs a custom calculation (don't know if this worked before the dmg calc. patch somehow!?)

    diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
    index e6de009..0d2af4a 100644
    --- a/src/game/SpellEffects.cpp
    +++ b/src/game/SpellEffects.cpp
    @@ -515,8 +515,14 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
                        // found Immolate or Shadowflame
                        if (aura)
                        {
    -                        int32 damagetick = aura->GetModifier()->m_amount;
    -                        damage += damagetick * 4;
    +                        // get damage of dot aura
    +                        int32 basepoints = aura->GetModifier()->m_amount;
    +                        basepoints *= aura->GetAuraMaxDuration() / aura->GetModifier()->periodictime;
    +
    +                        // 60% of the dot aura damage is direct damage, value stored in basepoints of effect 1
    +                        damage = basepoints * m_currentBasePoints[EFFECT_INDEX_1] / 100;
    +                        // 40% of the dot aura damage is dot damage, value stored in basepoints of effect 2
    +                        m_currentBasePoints[EFFECT_INDEX_1] = basepoints * m_currentBasePoints[EFFECT_INDEX_2] / (100 * GetSpellAuraMaxTicks(m_spellInfo));
    
                            // Glyph of Conflagrate
                            if (!m_caster->HasAura(56235))
    

    Problem we still have with this and similar spells is, that they additionally get their 'own' bonuses applied in spelldamagebonusdone() as they are no DIRECT_DAMAGE. Maybe there exists an attribute or anything that we could use?

  5. Just a small fix: The dmg of the dispel trigger should use the basevalue, not the modified one (new splitted damge calc system...).

    diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
    index 3cc6fe0..d057dde 100644
    --- a/src/game/Unit.cpp
    +++ b/src/game/Unit.cpp
    @@ -4288,7 +4288,9 @@ void Unit::RemoveSingleAuraDueToSpellByDispel(uint32 spellId, uint64 casterGUID,
        {
            if (Aura* dotAura = GetAura(SPELL_AURA_PERIODIC_DAMAGE,SPELLFAMILY_WARLOCK,UI64LIT(0x010000000000),0x00000000,casterGUID))
            {
    -            int32 damage = dotAura->GetModifier()->m_amount*9;
    +            // use clean value for initial damage
    +            int32 damage = dotAura->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_0);
    +            damage *= 9;
    
                // Remove spell auras from stack
                RemoveSingleSpellAurasByCasterSpell(spellId, casterGUID, AURA_REMOVE_BY_DISPEL);
    
    

  6. Hi,

    currently it is possible, that temporary summons are abled to respawn, if the left lifetime of the summon (TemporarySummon::m_timer) when the creature get's killed, is greater than Creature::m_deathTimer + 25s (default respawn time).

    In this case Creature::Update will remove the corpse and respawn the summon.

    From 10e25b27b930627be9ee40ceec923d02d69207ec Mon Sep 17 00:00:00 2001
    From: pasdVn <[email protected]>
    Date: Fri, 9 Apr 2010 11:21:54 +0200
    Subject: [PATCH] Fixed respawn bug for temporary summons.
    
    ---
    src/game/Creature.cpp        |    4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)
    
    diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
    index b50d4aa..b0c193c 100644
    --- a/src/game/Creature.cpp
    +++ b/src/game/Creature.cpp
    @@ -365,6 +365,10 @@ void Creature::Update(uint32 diff)
                break;
            case DEAD:
            {
    +            // no respawn handling for temporary summons
    +            if (isTemporarySummon())
    +                break;
    +
                if( m_respawnTime <= time(NULL) )
                {
                    DEBUG_LOG("Respawning...");
    -- 
    1.6.5.1.1367.gcd48
    
    

    Alternative fixes could be:

    • * always unsummon if m_deathState == DEAD (so if the corpse is removed). Imo you don't need any summon that is dead and without corpse anymore (as it should never respawn)
      * set m_respawnDelay to some days in the constructor of temporarySummon (or somewhere else), but I think that is crap
  7. Yes, you are right. This is caused by this patches.

    I took my old version of the 3rd part again (the workaround), so that pets will keep their percental heath/mana when (re)applying stamina/intellect scaling aura (what should fix this problem).

    Also merged/rebase branch and patches with/onto [9635] (but no merge errors, so it's not really needed).

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