Jump to content

kich0

Members
  • Posts

    144
  • Joined

  • Last visited

  • Donations

    0.00 GBP 

Posts posted by kich0

  1. i agree on timer, its done very bad (integrated in weather system) and sWorld.SendWorldText, I don't really see the need for separate table (you can update it with SQL query on crash), nice idea on Problem with inviting player...severinfo command is easy to manipulate, just set number of player +49 or whatever the fake player number is

  2. I've set it on purpose because its not like fake player is going to respond to a whisper... but I think something like this would do the trick for your request

    ChatHandler.cpp

    if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
               {
               QueryResult *result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE name = '%s' OR online>1", to.c_str());
               if (result)
               {
                   Field *fields = result->Fetch();
                   uint64 plrguid = fields[0].GetUInt64();
                   GetPlayer()->Whisper(msg, lang, plrguid);
                   while ( result->NextRow() );
                   delete result;
               }
               else
               {
                   sWorld.SendWorldText(LANG_NOT_WHISPER);
                   return;
               }
           }

  3. they do with every SavetoDB call interval. (every 15 minutes or so - cofig option : PlayerSave.Interval = 900000)

    @@ -1404,6 +1404,10 @@ void Player::Update( uint32 p_time )

    // m_nextSave reseted in SaveToDB call

    SaveToDB();

    DETAIL_LOG("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());

    + // If Fake WHO List system on then change player position with every SavePlayer Interval (usually 15min)

    + if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))

    + CharacterDatabase.PExecute("UPDATE characters SET zone = (FLOOR(50 * RAND()) + 1) WHERE online>1");

    + CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<5");

    }

    else

    m_nextSave -= p_time;

    zone is update completely randomly by DB field.

  4. Any news & opcodes are welcome! good job mate, anyways I spoke with cromon about that...

    Blizz made a new patch so they implemented new opcodes.

    If you have opcode in 4.0.1, it's very easy to convert it for 4.0.3.

    what if structure completely changes ? :P

  5. For MaNGOS rev.[10648]

    diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
    index 69888fb..3fc66c7 100644
    --- a/src/game/ChatHandler.cpp
    +++ b/src/game/ChatHandler.cpp
    @@ -209,8 +209,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
                uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
                if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
                {
    +                // If Fake WHO List system on then show player DND
    +                if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
    +                {
    +                    sWorld.SendWorldText(LANG_NOT_WHISPER);
    +                    return;
    +                }
    +                else
    +                {
                    SendPlayerNotFoundNotice(to);
                    return;
    +                }
                }
    
                if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
    diff --git a/src/game/Language.h b/src/game/Language.h
    index 32c6dc3..4b52de2 100644
    --- a/src/game/Language.h
    +++ b/src/game/Language.h
    @@ -896,7 +896,8 @@ enum MangosStrings
        // Room for old clients 2.x           1300-1399 not used
        // Room for old clients 1.x           1400-1499 not used
    
    -    // FREE IDS                           1500-9999
    +    LANG_NOT_WHISPER                    = 1501,
    +    // FREE IDS                           1502-9999
    
        // Use for not-in-offcial-sources patches
        //                                    10000-10999
    diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
    index e5a7b9a..4e2dda2 100644
    --- a/src/game/MiscHandler.cpp
    +++ b/src/game/MiscHandler.cpp
    @@ -249,6 +249,39 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
                break;
        }
    
    +    if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST) && clientcount < 49)
    +    {
    +        // Fake players on WHO LIST                            0,   1,    2,   3,    4,   5     6
    +        QueryResult *result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone,gender FROM characters WHERE online>1");
    +        if (result)
    +        {
    +            do
    +            {
    +                Field *fields = result->Fetch();
    +
    +                std::string pname = fields[1].GetCppString();    // player name
    +                std::string gname;                                // guild name
    +                uint32 lvl = fields[4].GetUInt32();                // player level
    +                uint32 class_ = fields[3].GetUInt32();            // player class
    +                uint32 race = fields[2].GetUInt32();            // player race
    +                uint32 pzoneid = fields[5].GetUInt32();            // player zone id
    +                uint8 gender = fields[6].GetUInt8();            // player gender
    +
    +                data << pname;                              // player name
    +                data << gname;                              // guild name
    +                data << uint32(lvl);                        // player level
    +                data << uint32(class_);                     // player class
    +                data << uint32(race);                       // player race
    +                data << uint8(gender);                      // player gender
    +                data << uint32(pzoneid);                    // player zone id
    +
    +                if ((++clientcount) == 49)
    +                    break;
    +            } while (result->NextRow());
    +        }
    +        delete result;
    +    }
    +
        uint32 count = m.size();
        data.put( 0, clientcount );                             // insert right count, listed count
        data.put( 4, count > 50 ? count : clientcount );        // insert right count, online count
    diff --git a/src/game/Player.cpp b/src/game/Player.cpp
    index 517e8ce..7e47e0c 100644
    --- a/src/game/Player.cpp
    +++ b/src/game/Player.cpp
    @@ -1404,6 +1404,10 @@ void Player::Update( uint32 p_time )
                // m_nextSave reseted in SaveToDB call
                SaveToDB();
                DETAIL_LOG("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
    +            // If Fake WHO List system on then change player position with every SavePlayer Interval (usually 15min)
    +            if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
    +                CharacterDatabase.PExecute("UPDATE characters SET zone = (FLOOR(50 * RAND()) + 1) WHERE online>1");
    +                CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<5");
            }
            else
                m_nextSave -= p_time;
    diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp
    index 9fc8a1e..fa9c1ea 100644
    --- a/src/game/Weather.cpp
    +++ b/src/game/Weather.cpp
    @@ -49,6 +49,14 @@ bool Weather::Update(time_t diff)
        if(m_timer.Passed())
        {
            m_timer.Reset();
    +
    +        // If Fake WHO List system on then update level of fake plyer with every weather change interval (we will set it on 90 minutes)
    +        if (sWorld.getConfig(CONFIG_BOOL_FAKE_WHO_LIST))
    +        {
    +        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<80");
    +        CharacterDatabase.PExecute("UPDATE characters SET level=level+2 WHERE online>1 AND level BETWEEN 5 and 19");
    +        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level BETWEEN 20 and 40");
    +        }
            // update only if Regenerate has changed the weather
            if(ReGenerate())
            {
    diff --git a/src/game/World.cpp b/src/game/World.cpp
    index 4fb965c..ebad12b 100644
    --- a/src/game/World.cpp
    +++ b/src/game/World.cpp
    @@ -551,6 +551,7 @@ void World::LoadConfigSettings(bool reload)
        setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_MAIL,    "AllowTwoSide.Interaction.Mail", false);
        setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST,            "AllowTwoSide.WhoList", false);
        setConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND,          "AllowTwoSide.AddFriend", false);
    +    setConfig(CONFIG_BOOL_FAKE_WHO_LIST,                      "Fake.WHO.List", false);
    
        setConfig(CONFIG_UINT32_STRICT_PLAYER_NAMES,  "StrictPlayerNames",  0);
        setConfig(CONFIG_UINT32_STRICT_CHARTER_NAMES, "StrictCharterNames", 0);
    diff --git a/src/game/World.h b/src/game/World.h
    index 3d10f21..3b2cfaf 100644
    --- a/src/game/World.h
    +++ b/src/game/World.h
    @@ -283,6 +283,7 @@ enum eConfigBoolValues
        CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_MAIL,
        CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST,
        CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND,
    +    CONFIG_BOOL_FAKE_WHO_LIST,
        CONFIG_BOOL_INSTANCE_IGNORE_LEVEL,
        CONFIG_BOOL_INSTANCE_IGNORE_RAID,
        CONFIG_BOOL_CAST_UNSTUCK,
    diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
    index 235b42a..03a4a23 100644
    --- a/src/mangosd/mangosd.conf.dist.in
    +++ b/src/mangosd/mangosd.conf.dist.in
    @@ -192,7 +192,7 @@ GridUnload = 1
    SocketSelectTime = 10000
    GridCleanUpDelay = 300000
    MapUpdateInterval = 100
    -ChangeWeatherInterval = 600000
    +ChangeWeatherInterval = 5400000# 90 minutes
    PlayerSave.Interval = 900000
    PlayerSave.Stats.MinLevel = 0
    PlayerSave.Stats.SaveOnlyOnLogout = 1
    @@ -809,6 +809,13 @@ Motd = "Welcome to the Massive Network Game Object Server."
    #        Default: 1 (allow)
    #                 0 (not allow)
    #
    +#    Fake.WHO.List
    +#        Add fake players to fill in WHO LIST (who is online list, "O" button) if there is less then
    +#        49 real players online (need to set online=2 in character database in order to work)
    +#        Default: 0 (disabled)
    +#                 1 (enabled)
    +#
    +#
    ###################################################################################################################
    
    AllowTwoSide.Accounts = 1
    @@ -821,6 +828,7 @@ AllowTwoSide.Interaction.Mail = 0
    AllowTwoSide.WhoList = 0
    AllowTwoSide.AddFriend = 0
    TalentsInspecting = 1
    +Fake.Who.List = 0
    
    ###################################################################################################################
    # CREATURE SETTINGS
    
    

    INSERT INTO `mangos_string` VALUES
    ('1501', 'Player wishes to not be disturbed and cannot receive whisper messages.', null, null, null, null, null, null, null, null);

  6. I managed to get it working on [10598]

    diff --git a/sql/CUSTOM SQL PATCH/mangos_mirror_image.sql b/sql/CUSTOM SQL PATCH/mangos_mirror_image.sql
    new file mode 100644
    index 0000000..308c94a
    --- /dev/null
    +++ b/sql/CUSTOM SQL PATCH/mangos_mirror_image.sql    
    @@ -0,0 +1,15 @@
    +-- Mirror Immage stats
    +UPDATE creature_template SET
    +speed_walk = 2.5, modelid_1 = 11686, modelid_2 = 11686, minlevel = 80, maxlevel = 80, AIName = 'EventAI', ScriptName = 'mob_mirror_image' WHERE entry = 31216; 
    +
    +-- Mirror Image AI scripts
    +DELETE FROM creature_ai_scripts WHERE creature_id = 31216; 
    +INSERT INTO creature_ai_scripts VALUES 
    +(3121601,31216,4,0,100,6, 0,0,0,0, 29,10,0,0, 20,0,0,0, 0,0,0,0, 'Mirror Immage - ranged movement when in combat'), 
    +(3121602,31216,0,0,100,7, 1000,2000,4000,5000, 11,59638,1,0, 0,0,0,0, 0,0,0,0, 'Mirror Immage - frostbolt'),
    +(3121603,31216,0,0,100,7, 1000,2000,4000,5000, 11,42802,1,0, 0,0,0,0, 0,0,0,0, 'Mirror Immage - fireball');  
    +
    +DELETE FROM spell_bonus_data WHERE entry IN (59637,59638);
    +INSERT INTO spell_bonus_data VALUES
    +(59637, 0.10, 0, 0, 'Mirror Image - Fire Blast'),
    +(59638, 0.05, 0, 0, 'Mirror Image - Frostbolt');
    \\ No newline at end of file
    diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp
    index 4f0fbe0..d6c3e4c 100644
    --- a/src/game/Opcodes.cpp
    +++ b/src/game/Opcodes.cpp
    @@ -1051,8 +1051,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
        /*0x3FE*/ { "MSG_GUILD_BANK_MONEY_WITHDRAWN",               STATUS_LOGGEDIN, &WorldSession::HandleGuildBankMoneyWithdrawn   },
        /*0x3FF*/ { "MSG_GUILD_EVENT_LOG_QUERY",                    STATUS_LOGGEDIN, &WorldSession::HandleGuildEventLogQueryOpcode  },
        /*0x400*/ { "CMSG_MAELSTROM_RENAME_GUILD",                  STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    -    /*0x401*/ { "CMSG_GET_MIRRORIMAGE_DATA",                    STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    -    /*0x402*/ { "SMSG_MIRRORIMAGE_DATA",                        STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    +    /*0x401*/ { "CMSG_GET_MIRRORIMAGE_DATA",                    STATUS_LOGGEDIN, &WorldSession::HandleMirrorImageDataRequest    },
    +    /*0x402*/ { "SMSG_MIRRORIMAGE_DATA",                        STATUS_LOGGEDIN, &WorldSession::Handle_ServerSide               },
        /*0x403*/ { "SMSG_FORCE_DISPLAY_UPDATE",                    STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
        /*0x404*/ { "SMSG_SPELL_CHANCE_RESIST_PUSHBACK",            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
        /*0x405*/ { "CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT",        STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
    index 8524a73..50479e2 100644
    --- a/src/game/SpellAuraDefines.h
    +++ b/src/game/SpellAuraDefines.h
    @@ -282,7 +282,7 @@ enum AuraType
        SPELL_AURA_COMPREHEND_LANGUAGE = 244,
        SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245,
        SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL = 246,
    -    SPELL_AURA_247 = 247,
    +    SPELL_AURA_CLONE_CASTER = 247,
        SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
        SPELL_AURA_CONVERT_RUNE = 249,
        SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
    @@ -314,7 +314,7 @@ enum AuraType
        SPELL_AURA_276 = 276,                                   // Only "Test Mod Damage % Mechanic" spell, possible mod damage done
        SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
        SPELL_AURA_MOD_DISARM_RANGED = 278,
    -    SPELL_AURA_279 = 279,
    +    SPELL_AURA_INITIALIZE_IMAGES = 279,
        SPELL_AURA_MOD_TARGET_ARMOR_PCT = 280,
        SPELL_AURA_MOD_HONOR_GAIN = 281,
        SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
    diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
    index 29edbc9..356931f 100644
    --- a/src/game/SpellAuras.cpp
    +++ b/src/game/SpellAuras.cpp
    @@ -297,7 +297,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
        &Aura::HandleComprehendLanguage,                        //244 SPELL_AURA_COMPREHEND_LANGUAGE
        &Aura::HandleNoImmediateEffect,                         //245 SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS     implemented in Unit::CalculateSpellDuration
        &Aura::HandleNoImmediateEffect,                         //246 SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL implemented in Unit::CalculateSpellDuration
    -    &Aura::HandleNULL,                                      //247 target to become a clone of the caster
    +    &Aura::HandleAuraCloneCaster,                           //247 SPELL_AURA_CLONE_CASTER
        &Aura::HandleNoImmediateEffect,                         //248 SPELL_AURA_MOD_COMBAT_RESULT_CHANCE         implemented in Unit::RollMeleeOutcomeAgainst
        &Aura::HandleAuraConvertRune,                           //249 SPELL_AURA_CONVERT_RUNE
        &Aura::HandleAuraModIncreaseHealth,                     //250 SPELL_AURA_MOD_INCREASE_HEALTH_2
    @@ -329,7 +329,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
        &Aura::HandleNULL,                                      //276 mod damage % mechanic?
        &Aura::HandleNoImmediateEffect,                         //277 SPELL_AURA_MOD_MAX_AFFECTED_TARGETS Use SpellClassMask for spell select
        &Aura::HandleNULL,                                      //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
    -    &Aura::HandleNULL,                                      //279 visual effects? 58836 and 57507
    +    &Aura::HandleAuraInitializeImages,                      //279 SPELL_AURA_INITIALIZE_IMAGES
        &Aura::HandleModTargetArmorPct,                         //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT
        &Aura::HandleNoImmediateEffect,                         //281 SPELL_AURA_MOD_HONOR_GAIN             implemented in Player::RewardHonor
        &Aura::HandleAuraIncreaseBaseHealthPercent,             //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
    @@ -4364,6 +4364,7 @@ void Aura::HandleAuraModDecreaseSpeed(bool apply, bool Real)
            }
        }
    
    +    target->UpdateSpeed(MOVE_WALK, true);
        target->UpdateSpeed(MOVE_RUN, true);
        target->UpdateSpeed(MOVE_SWIM, true);
        target->UpdateSpeed(MOVE_FLIGHT, true);
    @@ -4377,6 +4378,7 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
    
        Unit *target = GetTarget();
    
    +    target->UpdateSpeed(MOVE_WALK, true);
        target->UpdateSpeed(MOVE_RUN, true);
        target->UpdateSpeed(MOVE_SWIM, true);
        target->UpdateSpeed(MOVE_FLIGHT, true);
    @@ -7329,8 +7331,13 @@ void Aura::PeriodicDummyTick()
            case SPELLFAMILY_MAGE:
            {
                // Mirror Image
    -//            if (spell->Id == 55342)
    -//                return;
    +            if (spell->Id == 55342)
    +            {
    +                // Set name of summons to name of caster
    +                //target->CastSpell(target, m_spellProto->EffectTriggerSpell[m_effIndex], true);
    +                target->CastSpell(target, GetSpellProto()->EffectTriggerSpell[m_effIndex], true);
    +                m_isPeriodic = false;
    +            }
                break;
            }
            case SPELLFAMILY_DRUID:
    @@ -8980,3 +8987,72 @@ void SpellAuraHolder::UnregisterSingleCastHolder()
            m_isSingleTarget = false;
        }
    }
    +
    +void Aura::HandleAuraInitializeImages(bool Apply, bool Real)
    +{
    +    Unit* target = GetTarget();
    +
    +    if (!Real || !Apply || !target || target->GetTypeId() != TYPEID_UNIT)
    +        return;
    +    Unit* caster = GetCaster();
    +    if (!caster)
    +        return;
    +    //Unit* creator = Unit::GetUnit(*target,target->GetCreatorGUID());
    +    //hackfix Unit* creator = GetCaster();
    +    Unit *creator = ObjectAccessor::GetUnit(*target, target->GetCreatorGUID());
    +    if (!creator)
    +        creator = caster;
    +    Creature* pImmage = (Creature*)target;
    +    if (creator != caster || pImmage->isPet())
    +        return;
    +
    +    // set stats and visual
    +    pImmage->SetDisplayId(creator->GetDisplayId());
    +    pImmage->SetLevel(creator->getLevel());
    +    pImmage->SetMaxHealth(creator->GetMaxHealth()/5);
    +    pImmage->SetHealth(creator->GetHealth()/2);
    +    pImmage->SetDisplayId(creator->GetDisplayId());
    +    pImmage->SetMaxPower(POWER_MANA, creator->GetMaxPower(POWER_MANA));
    +    pImmage->SetPower(POWER_MANA, creator->GetPower(POWER_MANA));
    +    pImmage->SetPvP(true);
    +    pImmage->setFaction(creator->getFaction());
    +    pImmage->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
    +    pImmage->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
    +    pImmage->SetUInt32Value(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNK2 | UNIT_FLAG2_REGENERATE_POWER);
    +    if (creator->IsPvP())
    +    {
    +      pImmage->SetPvP(true);
    +    }
    +    if (creator->isInCombat() && pImmage->isAlive())
    +    {
    +    pImmage->CastSpell(pImmage, 58838, true);
    +    }
    +      else
    +   {
    +       pImmage->GetMotionMaster()->Clear();
    +       pImmage->GetMotionMaster()->MoveFollow(creator, pImmage->GetDistance(creator), pImmage->GetAngle(creator));
    +   }
    +}
    +
    +void Aura::HandleAuraCloneCaster(bool Apply, bool Real)
    +{
    +    error_log("HandleAuraCloneCaster");
    +    if (!Real || !Apply)
    +        return;
    +
    +    Unit* target = GetTarget();
    +    if (!target)
    +        return;
    +
    +    Unit* creator = GetCaster();
    +    if (!creator)
    +        return;
    +
    +    Unit * caster = GetCaster();
    +    if (!caster)
    +        return;
    +
    +    // Set item visual
    +    target->SetDisplayId(caster->GetDisplayId());
    +    target->SetUInt32Value(UNIT_FIELD_FLAGS_2, 2064);
    +}
    \\ No newline at end of file
    diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
    index eea9f72..67fc35d 100644
    --- a/src/game/SpellAuras.h
    +++ b/src/game/SpellAuras.h
    @@ -362,6 +362,8 @@ class MANGOS_DLL_SPEC Aura
            void HandleModTargetArmorPct(bool Apply, bool Real);
            void HandleAuraModAllCritChance(bool Apply, bool Real);
            void HandleAuraOpenStable(bool apply, bool Real);
    +        void HandleAuraInitializeImages(bool Apply, bool Real);
    +        void HandleAuraCloneCaster(bool Apply, bool Real);
    
            virtual ~Aura();
    
    diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
    index 43d9be9..4738b18 100644
    --- a/src/game/SpellEffects.cpp
    +++ b/src/game/SpellEffects.cpp
    @@ -2666,6 +2666,14 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex)
        // special cases
        switch(triggered_spell_id)
        {
    +        // Mirror Image
    +    case 58832:
    +        {
    +            // Glyph of Mirror Image
    +            if (m_caster->HasAura(63093))
    +                m_caster->CastSpell(m_caster, 65047, true); // Mirror Image
    +            break;
    +        }
            // Vanish (not exist)
            case 18461:
            {
    diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
    index 73ea871..c15ee75 100644
    --- a/src/game/SpellHandler.cpp
    +++ b/src/game/SpellHandler.cpp
    @@ -598,3 +598,89 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
            }
        }
    }
    +
    +void WorldSession::HandleMirrorImageDataRequest( WorldPacket& recv_data )
    +{
    +    sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA");
    +    uint64 guid;
    +    recv_data >> guid;
    +
    +    // Get unit for which data is needed by client
    +    Unit *unit = ObjectAccessor::GetUnit(*_player, guid);
    +    if (!unit)
    +        return;
    +
    +    // Get creator of the unit
    +    Unit *creator = ObjectAccessor::GetUnit(*_player, unit->GetCreatorGUID());
    +    if (!creator)
    +        creator = unit;
    +
    +    if (!creator)
    +        return;
    +
    +    WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68);
    +    data << (uint64)guid;
    +    data << (uint32)creator->GetDisplayId();
    +    if (creator->GetTypeId() == TYPEID_PLAYER)
    +    {
    +        Player* pCreator = (Player *)creator;
    +        data << (uint8)pCreator->getRace();                         // race
    +        data << (uint8)pCreator->getGender();                       // gender
    +        data << (uint8)pCreator->getClass();                        // class
    +        data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 0);     // skin
    +        data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 1);     // face
    +        data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 2);     // hair
    +        data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 3);     // haircolor
    +        data << (uint8)pCreator->GetByteValue(PLAYER_BYTES_2, 0);   // facialhair
    +
    +        data << (uint32)0;                                          // unknown
    +
    +        static const EquipmentSlots ItemSlots[] =
    +        {
    +            EQUIPMENT_SLOT_HEAD,
    +            EQUIPMENT_SLOT_SHOULDERS,
    +            EQUIPMENT_SLOT_BODY,
    +            EQUIPMENT_SLOT_CHEST,
    +            EQUIPMENT_SLOT_WAIST,
    +            EQUIPMENT_SLOT_LEGS,
    +            EQUIPMENT_SLOT_FEET,
    +            EQUIPMENT_SLOT_WRISTS,
    +            EQUIPMENT_SLOT_HANDS,
    +            EQUIPMENT_SLOT_BACK,
    +            EQUIPMENT_SLOT_TABARD,
    +            EQUIPMENT_SLOT_END
    +        };
    +
    +        // Display items in visible slots
    +        for (EquipmentSlots const* itr = &ItemSlots[0]; *itr != EQUIPMENT_SLOT_END; ++itr)
    +            if (Item const* item =  pCreator->GetItemByPos(INVENTORY_SLOT_BAG_0, *itr))
    +                data << (uint32)item->GetProto()->DisplayInfoID;    // display id
    +            else
    +                data << (uint32)0;                                  // no item found, so no id
    +
    +        if (Item const* item = pCreator->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
    +            unit->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, item->GetProto()->ItemId);
    +        if (Item const* item = pCreator->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
    +            unit->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, item->GetProto()->ItemId);
    +    }
    +    else
    +    {
    +        // Skip player data for creatures
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +        data << (uint32)0;
    +    }
    +
    +    SendPacket( &data );
    +}
    \\ No newline at end of file
    diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
    index 79a2438..22bc32c 100644
    --- a/src/game/SpellMgr.cpp
    +++ b/src/game/SpellMgr.cpp
    @@ -701,6 +701,7 @@ bool IsPositiveEffect(uint32 spellId, SpellEffectIndex effIndex)
                            return true;                        // some expected positive spells have SPELL_ATTR_EX_NEGATIVE or unclear target modes
                        break;
                    case SPELL_AURA_ADD_TARGET_TRIGGER:
    +                case SPELL_AURA_INITIALIZE_IMAGES:
                        return true;
                    case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
                        if (spellId != spellproto->EffectTriggerSpell[effIndex])
    diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
    index f1fdd64..8563e4b 100644
    --- a/src/game/TemporarySummon.cpp
    +++ b/src/game/TemporarySummon.cpp
    @@ -104,18 +104,13 @@ void TemporarySummon::Update( uint32 diff )
                    return;
                }
    
    -            if (!isInCombat())
    +            if (m_timer <= diff)
                {
    -                if (m_timer <= diff)
    -                {
    -                    UnSummon();
    -                    return;
    -                }
    -                else
    -                    m_timer -= diff;
    +                UnSummon();
    +                return;
                }
    -            else if (m_timer != m_lifetime)
    -                m_timer = m_lifetime;
    +            else
    +                m_timer -= diff;
                break;
            }
            case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
    @@ -127,18 +122,13 @@ void TemporarySummon::Update( uint32 diff )
                    return;
                }
    
    -            if (!isInCombat() && isAlive() )
    +            if (m_timer <= diff)
                {
    -                if (m_timer <= diff)
    -                {
    -                    UnSummon();
    -                    return;
    -                }
    -                else
    -                    m_timer -= diff;
    +                UnSummon();
    +                return;
                }
    -            else if (m_timer != m_lifetime)
    -                m_timer = m_lifetime;
    +            else
    +                m_timer -= diff;
                break;
            }
            default:
    diff --git a/src/game/Unit.h b/src/game/Unit.h
    index 25cca37..0fb1e7f 100644
    --- a/src/game/Unit.h
    +++ b/src/game/Unit.h
    @@ -580,6 +580,8 @@ enum UnitFlags2
        UNIT_FLAG2_FEIGN_DEATH          = 0x00000001,
        UNIT_FLAG2_UNK1                 = 0x00000002,           // Hides unit model (show only player equip)
        UNIT_FLAG2_COMPREHEND_LANG      = 0x00000008,
    +    UNIT_FLAG2_UNK2                 = 0x00000010,
    +    //UNIT_FLAG2_MIRROR_IMAGE         = 0x00000010,
        UNIT_FLAG2_FORCE_MOVE           = 0x00000040,
        UNIT_FLAG2_DISARM               = 0x00000400,           // disarm or something
        UNIT_FLAG2_REGENERATE_POWER     = 0x00000800,
    diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h
    index 8af868e..d0f6ec9 100644
    --- a/src/game/WorldSession.h
    +++ b/src/game/WorldSession.h
    @@ -762,6 +762,7 @@ class MANGOS_DLL_SPEC WorldSession
            void HandleCalendarGetNumPending(WorldPacket& recv_data);
    
            void HandleSpellClick(WorldPacket& recv_data);
    +        void HandleMirrorImageDataRequest(WorldPacket& recv_data);
            void HandleAlterAppearanceOpcode(WorldPacket& recv_data);
            void HandleRemoveGlyphOpcode(WorldPacket& recv_data);
            void HandleCharCustomizeOpcode(WorldPacket& recv_data);
    -- 
    1.7.0.2
    
    

  7. updated version for [10526]

    diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
    index d2de87f..b0af3e5 100644
    --- a/src/game/ChatHandler.cpp
    +++ b/src/game/ChatHandler.cpp
    @@ -209,8 +209,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
                uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
                if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
                {
    -                SendPlayerNotFoundNotice(to);
    +                QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s' AND online != 0", to.c_str());
    +                if (!result)
    +                    SendPlayerNotFoundNotice(to);
    +
                    return;
    +
    +                delete result;
                }
    
                if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
    diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
    index b465803..32473f6 100644
    --- a/src/game/MiscHandler.cpp
    +++ b/src/game/MiscHandler.cpp
    @@ -249,6 +249,39 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
                break;
        }
    
    +    if (clientcount < 49) // Only add Fake Players if online players count is under 49
    +    {
    +        // Fake players on WHO LIST                            0,   1,    2,   3,    4,   5     6
    +        QueryResult *result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone,gender FROM characters WHERE online>1");
    +        if (result)
    +        {
    +            do
    +            {
    +                Field *fields = result->Fetch();                // Get Info from SQL Query
    +
    +                std::string pname = fields[1].GetCppString();    // player name
    +                std::string gname;                                      // guild name
    +                uint8 lvl = fields[4].GetUInt8();                        // player level
    +                uint32 class_ = fields[3].GetUInt32();               // player class
    +                uint32 race = fields[2].GetUInt32();                 // player race
    +                uint32 pzoneid = fields[5].GetUInt32();            // player zone
    +                uint8 gender = fields[6].GetUInt8();                // player gender
    +
    +                data << pname;                              // player name
    +                data << gname;                              // guild name
    +                data << uint32(lvl);                        // player level
    +                data << uint32(class_);                     // player class
    +                data << uint32(race);                       // player race
    +                data << uint8(gender);                      // player gender
    +                data << uint32(pzoneid);                    // player zone id
    +
    +                if ((++clientcount) == 49)
    +                    break;
    +            } while (result->NextRow());
    +        }
    +        delete result;
    +    }
    +
        uint32 count = m.size();
        data.put( 0, clientcount );                             // insert right count, listed count
        data.put( 4, count > 50 ? count : clientcount );        // insert right count, online count
    

  8. you didn't understood my question...nevermind

    updated patch due to recent gender field change in [10318]

    diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
    index 6d778db..6217dc4 100644
    --- a/src/game/ChatHandler.cpp
    +++ b/src/game/ChatHandler.cpp
    @@ -209,8 +209,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
                uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
                if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
                {
    -                SendPlayerNotFoundNotice(to);
    +                QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s' AND online != 0", to.c_str());
    +                if (!result)
    +                    SendPlayerNotFoundNotice(to);
    +
                    return;
    +
    +                delete result;
                }
    
                if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
    diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
    index 6e4f43c..105bb65 100644
    --- a/src/game/MiscHandler.cpp
    +++ b/src/game/MiscHandler.cpp
    @@ -249,11 +249,44 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
                break;
        }
    
    +    if (clientcount < 49)
    +    {
    +        // Fake players on WHO LIST                            0,   1,    2,   3,    4,   5     6
    +        QueryResult *result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone,gender FROM characters WHERE online>1");
    +        if (result)
    +        {
    +            do
    +            {
    +                Field *fields = result->Fetch();
    +
    +                std::string pname = fields[1].GetCppString();
    +                std::string gname;
    +                uint8 lvl = fields[4].GetUInt8();
    +                uint32 class_ = fields[3].GetUInt32();
    +                uint32 race = fields[2].GetUInt32();
    +                uint32 pzoneid = fields[5].GetUInt32();
    +                uint8 gender = fields[6].GetUInt8();
    +
    +                data << pname;                              // player name
    +                data << gname;                              // guild name
    +                data << uint32(lvl);                        // player level
    +                data << uint32(class_);                     // player class
    +                data << uint32(race);                       // player race
    +                data << uint8(gender);                      // player gender
    +                data << uint32(pzoneid);                    // player zone id
    +
    +                if ((++clientcount) == 49)
    +                    break;
    +            } while (result->NextRow());
    +        }
    +        delete result;
    +    }
    +
        uint32 count = m.size();
        data.put( 0, clientcount );                             // insert right count, listed count
        data.put( 4, count > 50 ? count : clientcount );        // insert right count, online count
    
        SendPacket(&data);
        DEBUG_LOG( "WORLD: Send SMSG_WHO Message" );
    }
    
    

  9. i think you didn't understand my question I know why you didn't remove any original code but I'm asking why use in sql query WHERE online = 2 , wouldn't it be simplier to use where online != 0 because it would show real & fake players.

    i've done few mods so it can compile with clean mangos

    Working nice with 10298 :)

    diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
    index 6d778db..347ec1f 100644
    --- a/src/game/ChatHandler.cpp
    +++ b/src/game/ChatHandler.cpp
    @@ -209,7 +209,10 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
                uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
                if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
                {
    -                SendPlayerNotFoundNotice(to);
    +                QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s' AND online != 0", to.c_str());
    +                if (!result)
    +                    SendPlayerNotFoundNotice(to);
    +
                    return;
                }
    
    diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
    index 6e4f43c..0046bfc 100644
    --- a/src/game/MiscHandler.cpp
    +++ b/src/game/MiscHandler.cpp
    @@ -249,11 +249,43 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
                break;
        }
    
    +    if (clientcount < 49)
    +    {
    +        // Fake players on WHO LIST                            0,   1,    2,   3,    4,   5
    +        QueryResult *result = CharacterDatabase.Query("SELECT guid,name,race,class,level,zone FROM characters WHERE online>1");
    +        if (result)
    +        {
    +            do
    +            {
    +                Field *fields = result->Fetch();
    +
    +                std::string pname = fields[1].GetCppString();
    +                std::string gname;
    +                uint8 lvl = fields[4].GetUInt8();
    +                uint32 class_ = fields[3].GetUInt32();
    +                uint32 race = fields[2].GetUInt32();
    +                uint32 pzoneid = fields[5].GetUInt32();
    +
    +                data << pname;                              // player name
    +                data << gname;                              // guild name
    +                data << uint32(lvl);                        // player level
    +                data << uint32(class_);                     // player class
    +                data << uint32(race);                       // player race
    +                data << uint8(0);                           // new 2.4.0
    +                data << uint32(pzoneid);                    // player zone id
    +
    +                if ((++clientcount) == 49)
    +                    break;
    +            } while (result->NextRow());
    +        }
    +     delete result;
    +    }
    +
        uint32 count = m.size();
        data.put( 0, clientcount );                             // insert right count, listed count
        data.put( 4, count > 50 ? count : clientcount );        // insert right count, online count
    
        SendPacket(&data);
    
        DEBUG_LOG( "WORLD: Send SMSG_WHO Message" );
    }
    
    

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