Jump to content

tere

Members
  • Posts

    8
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by tere

  1. Hello Community, i have ported the mirror image code from infinitycore to mangos, works not right, can anyone test this please, and me help to complete this?

    So the mage mirror images

    only irritating but brilliant

    the mirror must makes 3 duplicates of the Player, taht works not right, and i need help to fix this spell.

    here from Infinitycore: http://bitbucket.org/kane/infinitycore/changeset/ce5fde00e028/

    and here from Trinitycore2: http://dev.trinitycore.org/trinitycore2/changeset/aaf54c52f352/

    Original Author is QAston and Drahy.

    commit 17dd1b73d9d89d4c87263edf6c3d941507b3a71d
    Author: Thyros <Thyros@.(none)>
    Date:   Fri Jul 24 18:24:01 2009 +0200
    
       - Mirror Image.
    
    diff --git a/sql/uecore-fixes/Revision 213/213_mirror_image.sql b/sql/uecore-fixes/Revision 213/213_mirror_image.sql
    new file mode 100644
    index 0000000..07baab9
    --- /dev/null
    +++ b/sql/uecore-fixes/Revision 213/213_mirror_image.sql    
    @@ -0,0 +1,5 @@
    +DELETE FROM `spell_script_target` WHERE `entry` IN (58836);
    +INSERT INTO `spell_script_target` VALUES
    (58836, 1, 31216);
    +
    +UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216;
    +UPDATE `creature_template` SET `spell1`=59638, `spell2` = 59637 WHERE `entry`=31216
    diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp
    index 6309378..31bd98d 100644
    --- a/src/game/Opcodes.cpp
    +++ b/src/game/Opcodes.cpp
    @@ -1051,7 +1051,7 @@ 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                     },
    +    /*0x401*/ { "CMSG_GET_MIRRORIMAGE_DATA",                    STATUS_NEVER,    &WorldSession::HandleMirrrorImageDataRequest   },
        /*0x402*/ { "SMSG_MIRRORIMAGE_DATA",                        STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
        /*0x403*/ { "SMSG_FORCE_DISPLAY_UPDATE",                    STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
        /*0x404*/ { "SMSG_SPELL_CHANCE_RESIST_PUSHBACK",            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
    index 1641796..05f9158 100644
    --- a/src/game/SpellAuraDefines.h
    +++ b/src/game/SpellAuraDefines.h
    @@ -289,7 +289,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,
    @@ -321,7 +321,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_ARMOR_PENETRATION_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 50ffcf9..77bb76b 100644
    --- a/src/game/SpellAuras.cpp
    +++ b/src/game/SpellAuras.cpp
    @@ -299,7 +299,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
        &Aura::HandleComprehendLanguage,                        //244 Comprehend language
        &Aura::HandleNULL,                                      //245 SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS
        &Aura::HandleNoImmediateEffect,                         //246 SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL
    -    &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
    @@ -331,7 +331,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::HandleModArmorPenetrationPct,                    //280 SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
        &Aura::HandleNULL,                                      //281 SPELL_AURA_MOD_HONOR_GAIN
        &Aura::HandleAuraIncreaseBaseHealthPercent,             //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
    @@ -7999,3 +7999,42 @@ bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
        }
        return false;
    }
    +
    +void Aura::HandleAuraInitializeImages(bool Apply, bool Real)
    +{
    +    if (!Real || !Apply)
    +        return;
    +
    +    Unit* caster = GetCaster();
    +    if (!caster)
    +        return;
    +
    +    // Set item visual
    +    if (caster->GetTypeId()== TYPEID_PLAYER)
    +    {
    +        if (Item const* item = ((Player *)caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
    +            m_target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, item->GetProto()->ItemId);
    +        if (Item const* item = ((Player *)caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
    +            m_target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, item->GetProto()->ItemId);
    +    }
    +    else
    +    {
    +        m_target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
    +        m_target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
    +        m_target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
    +    }
    +}
    +
    +void Aura::HandleAuraCloneCaster(bool Apply, bool Real)
    +{
    +    if (!Real || !Apply)
    +        return;
    +
    +    Unit * caster = GetCaster();
    +    if (!caster)
    +        return;
    +
    +    // Set item visual
    +    m_target->SetDisplayId(caster->GetDisplayId());
    +    m_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 061373f..6382570 100644
    --- a/src/game/SpellAuras.h
    +++ b/src/game/SpellAuras.h
    @@ -57,18 +57,9 @@ class MANGOS_DLL_SPEC Aura
    
        public:
            //aura handlers
    -        void HandleNULL(bool, bool)
    -        {
    -            // NOT IMPLEMENTED
    -        }
    -        void HandleUnused(bool, bool)
    -        {
    -            // NOT USED BY ANY SPELL OR USELESS
    -        }
    -        void HandleNoImmediateEffect(bool, bool)
    -        {
    -            // aura not have immediate effect at add/remove and handled by ID in other code place
    -        }
    +        void HandleNULL(bool, bool) { /* Not implemented. */ }
    +        void HandleUnused(bool, bool) { /* Not used or useless. */ }
    +        void HandleNoImmediateEffect(bool, bool) { /* Aura does not have immediate effect at add/remove and handled by ID in other place. */ }
            void HandleBindSight(bool Apply, bool Real);
            void HandleModPossess(bool Apply, bool Real);
            void HandlePeriodicDamage(bool Apply, bool Real);
    @@ -213,6 +204,8 @@ class MANGOS_DLL_SPEC Aura
            void HandleNoReagentUseAura(bool Apply, bool Real);
            void HandlePhase(bool Apply, bool Real);
            void HandleAllowOnlyAbility(bool Apply, bool Real);
    +        void HandleAuraInitializeImages(bool Apply, bool Real);
    +        void HandleAuraCloneCaster(bool Apply, bool Real);
    
            virtual ~Aura();
    
    diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
    index 82c6123..7e7167e 100644
    --- a/src/game/SpellHandler.cpp
    +++ b/src/game/SpellHandler.cpp
    @@ -612,3 +612,82 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
            }
        }
    }
    +
    +void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data )
    +{
    +    sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA");
    +    CHECK_PACKET_SIZE(recv_data, 8);
    +    uint64 guid;
    +    recv_data >> guid;
    +
    +    // Get unit for which data is needed by client
    +    Unit *unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL);
    +    if (!unit)
    +        return;
    +
    +    // Get creator of the unit
    +    Unit *creator = ObjectAccessor::GetObjectInWorld(unit->GetCreatorGUID(), (Unit*)NULL);
    +    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
    +    }
    +    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/WorldSession.h b/src/game/WorldSession.h
    index 69bcb1d..052eaf2 100644
    --- a/src/game/WorldSession.h
    +++ b/src/game/WorldSession.h
    @@ -713,6 +713,7 @@ class MANGOS_DLL_SPEC WorldSession
            void HandleCalendarGetNumPending(WorldPacket& recv_data);
    
            void HandleSpellClick(WorldPacket& recv_data);
    +        void HandleMirrrorImageDataRequest(WorldPacket & recv_data);
            void HandleAlterAppearance(WorldPacket& recv_data);
            void HandleRemoveGlyph(WorldPacket& recv_data);
            void HandleCharCustomize(WorldPacket& recv_data);

    SD2:

    i'm not sure of is needed this code.

    Index: scripts/npc/npcs_special.cpp
    ===================================================================
    --- scripts/npc/npcs_special.cpp    (revision 1262)
    +++ scripts/npc/npcs_special.cpp    (working copy)
    @@ -1288,7 +1288,33 @@
        }
        return true;
    }
    +/* Need more Review!
    +struct MANGOS_DLL_DECL npc_mirror_image : public ScriptedAI
    +{
    +    npc_mirror_image(Creature* pCreature) : ScriptedAI(pCreature) {}
    +    Unit * owner;
    +    void Reset()
    +    {
    +        if (m_creature->isSummon())
    +            owner = ((Summon*)m_creature)->GetOwner();
    +        if (!owner)
    +            return;
    +        m_creature->SetDisplayId(owner->GetDisplayId());
    +        owner->SetLevel(owner->getLevel());
    +        // Inherit Master's Threat List (not yet implemented)
    +        owner->CastSpell((Unit*)NULL, 58838, true);
    +        // here mirror image casts on summoner spell (not present in client dbc) 49866
    +        // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?)
    +        // Clone Me!
    +        owner->CastSpell(m_creature, 45204, false);
    +    }
    +};
    
    +CreatureAI* GetAI_npc_mirror_image(Creature* pCreature)
    +{
    +    return new npc_mirror_image(pCreature);
    +}
    +*/
    void AddSC_npcs_special()
    {
        Script *newscript;
    @@ -1354,4 +1380,9 @@
        newscript->pGossipHello = &GossipHello_npc_sayge;
        newscript->pGossipSelect = &GossipSelect_npc_sayge;
        newscript->RegisterSelf();
    +
    +    /*newscript = new Script;
    +    newscript->Name = "npc_mirror_image";
    +    newscript->GetAI = &GetAI_npc_mirror_image;
    +    newscript->RegisterSelf();*/
    }

    Thanks in Advance.

    Spell clone not work.. :(

  2. why there are needed new fields for energy? energy is alwasy 100, no? look at rouges or DK ghoul

    and why do you added this ?

    + UNIT_FIELD_BASE_ENERGY                   = OBJECT_END + 0x0080, // Size: 1, Type: INT, Flags: PUBLIC

    it was a mistake I, but I managed to solve the problem (+ UNIT_FIELD_BASE_ENERGY = OBJECT_END + 0x0080, // Size: 1, Type: INT, Flags: PUBLIC)

    I managed to solve the problem of energy for vehicles, thanks for answering me, your work is very good vehicles.

    But now only stated that the passengers (creature_templates_addons) could attack the top of the tanks and catapults. you know how it works?

  3. they are using more energy types - energy, mana and i heard something about fuel too, but not confirmed. i didnt tried vehicles with energy yet.

    // creature.cpp

    is to add energy in the table DATA BASE minenergy maxenergy.

    I tried and worked but you need the update in the DATA BASE for the NPC VEHICLES, work with energy

    // mana

    uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);

    uint32 maxmana = std::max(cinfo->maxmana, cinfo->minmana);

    uint32 mana = minmana + uint32(rellevel*(maxmana - minmana));

    +// energy

    + uint32 minenergy = std::min(cinfo->maxenergy, cinfo->minenergy);

    + uint32 maxenergy = std::max(cinfo->maxenergy, cinfo->minenergy);

    + uint32 energy = minenergy + uint32(rellevel*(maxenergy - minenergy));

    SetCreateMana(mana);

    SetMaxPower(POWER_MANA, mana); //MAX Mana

    SetPower(POWER_MANA, mana);

    + SetCreateEnergy(energy);

    + SetMaxPower(POWER_ENERGY, energy); //MAX Energy

    + SetPower(POWER_ENERGY, energy);

    // TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc)

    SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, health);

    SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, mana);

    + SetModifierValue(UNIT_MOD_ENERGY, BASE_VALUE, energy);

    // UpdateFields.h

    UNIT_FIELD_RANGED_ATTACK_POWER_MODS = OBJECT_END + 0x0079, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER

    + UNIT_FIELD_BASE_ENERGY = OBJECT_END + 0x0080, // Size: 1, Type: INT, Flags: PUBLIC

    // DATA BASE

    ALTER TABLE creature_template

    ADD COLUMN minenergy int(10) unsigned NOT NULL default '0' AFTER maxmana,

    ADD COLUMN maxenergy int(10) unsigned NOT NULL default '0' AFTER minenergy;

    But probleman update create DATA BASE. :(

  4. yes i know there are merge errors if mangos had updated something in their code. But i am not here 24/7 to make it always updated, if there is a error, solve it by hand, or use older mangos revision or just wait for me to update it

    btw : i finally fixed client errors, so its usable now in bigger events...

    hi y use you core.. but very playes mont in vehicle , crash client error..

    you repair is it?

    thanxx sorry bad english

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