maxxx2021
Members-
Posts
17 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Everything posted by maxxx2021
-
[patch] CreatureScriptSpawn (Horde/Alliance/Progress)
maxxx2021 replied to Auntie Mangos's topic in OldCore modifications
Hi every one. As have shown sniff from official server, isn't present phases in dungeon for team control. I has written a patch which realizes creature spawn in dungeon depending on that has come. And as spawn and despawn creature during the necessary moments. It is necessary for dungeon: Pit Of Saron, Culling Of Stratholme, Icecrown Citadel and etc. For change map event in script: map->ProcessMapEvent(event); patch on github: Patch Fix for patch: Fix Test for YTDB: INSERT INTO creature_script_spawn SELECT guid, '469', '0', '0', 'Nexus Horde Soldiers' FROM creature WHERE map = 576 AND phaseMask = 128; INSERT INTO creature_script_spawn SELECT guid, '67', '0', '0', 'Nexus Alliance Soldiers' FROM creature WHERE map = 576 AND phaseMask = 64; UPDATE creature SET phaseMask = 1 WHERE phaseMask = 128 AND map = 576; UPDATE creature SET phaseMask = 1 WHERE phaseMask = 64 AND map = 576; -
Some change on old patch. Fix attack timers and remove new Field: Patch On Git
-
Need remove UNIT_FIELD_BASEATTACKTIME_2 ? Patch with removed UNIT_FIELD_BASEATTACKTIME_2: Patch Here
-
But in sniff "UNIT_FIELD_BASEATTACKTIME_2" use how time for Off Hand attack. UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0038 UNIT_FIELD_BASEATTACKTIME + 1 in core = OBJECT_END + 0x0039 now UNIT_FIELD_BASEATTACKTIME_2 = OBJECT_END + 0x0039 How in sniff
-
if (m_creature->isAttackReady(attType) && m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) If attack ready (change timer) and victim in the attack distance: m_creature->AttackerStateUpdate(m_creature->getVictim(), attType); "the main-attack is done if possible, and if it was done, the off-attack is skipped - is this correct?" Yes its right! P.S. In any way he not strike if the getVictim is far.
-
fixed
-
Hi everyone. I would write a patch that NPC could attack the left hand if they have in it the weapon. Your opinion is necessary. Patch on github: https://github.com/bwsrv/mangos/commit/c6c041d1309076e9d0063876505e400e19930cfc Some change on old patch. Fix attack timers and remove new Field: Patch On Git
-
http://ru-mangos.ru/showthread.php?p=2359
-
In the duel use flag on player, use him on the mirror image.
-
I saw as clones used fire ball. Probably it depends on that on what branch the magician?
-
enum { SPELL_FROSTBOLT = 59638, SPELL_FIREBALL = 59637 }; struct MANGOS_DLL_DECL npc_mirror_imageAI : public ScriptedAI { npc_mirror_imageAI(Creature *pCreature) : ScriptedAI(pCreature) { Reset(); } uint32 m_uiFrostBoltTimer; void Reset() { m_uiFrostBoltTimer = 1000; } void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (m_uiFrostBoltTimer < uiDiff) { if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROSTBOLT) == CAST_OK) m_uiFrostBoltTimer = urand(3600, 4000); }else m_uiFrostBoltTimer -= uiDiff; } }; CreatureAI* GetAI_npc_mirror_image(Creature* pCreature) { return new npc_mirror_imageAI(pCreature); } And use m_creature->GetLevel for spells. newscript = new Script; newscript->Name = "npc_mirror_image"; newscript->GetAI = &GetAI_npc_mirror_image; newscript->RegisterSelf();
-
I will saying thanks when i see fully work only my eye. But i have not microsoft visual studio now.
-
Hmmmm... Animation? This is patch fully realised jumped or only animations?
-
Hmmm... Phhhhh... Vehicle make information from Client DBC or he make from DB Mangos?
-
May be. I don't known. I think this is aura. But I'am can not that happened with mobs. Who can help me for repair this spell?
-
This is work code and he clone my face and item. but need AI and clean trash. diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index eab30ba..f20a287 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -7362,8 +7362,12 @@ 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 + m_target->CastSpell((Unit *)NULL, m_spellProto->EffectTriggerSpell[m_effIndex], true); + m_isPeriodic = false; + } break; } case SPELLFAMILY_DRUID: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 58384f4..371a634 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2068,6 +2068,15 @@ void Spell::EffectTriggerSpell(uint32 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: { @@ -3852,6 +3861,16 @@ void Spell::EffectSummonWild(uint32 i, uint32 forceFaction) summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); summon->SetCreatorGUID(m_caster->GetGUID()); + //Mirror image + if(creature_entry == 31216) + { + summon->SetLevel(m_caster->getLevel()); + summon->SetMaxHealth(m_caster->GetMaxHealth()); + summon->SetHealth(m_caster->GetHealth()); + summon->SetDisplayId(m_caster->GetDisplayId()); + summon->SetMaxPower(POWER_MANA, m_caster->GetMaxPower(POWER_MANA)); + summon->SetPower(POWER_MANA, m_caster->GetPower(POWER_MANA)); + summon->SetPvP(true); + summon->setFaction(m_caster->getFaction()); + //m_caster->CastSpell(summon, 45204, false); + //m_caster->CastSpell((Unit*)NULL, 58838, true); + summon->SetUInt32Value(UNIT_FIELD_FLAGS_2, 2064); + if (m_caster->GetTypeId()== TYPEID_PLAYER) + { + if (Item const* item = ((Player *)m_caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, item->GetProto()->ItemId); + if (Item const* item = ((Player *)m_caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, item->GetProto()->ItemId); + } + else + { + summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)); + summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1)); + summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2)); + } + + WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68); + data << (uint32)m_caster->GetDisplayId(); + if (m_caster->GetTypeId() == TYPEID_PLAYER) + { + Player* pCreator = (Player *)m_caster; + 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; + } + } + if(forceFaction) summon->setFaction(forceFaction); }diff --git a/sql/evo-X Update/Spells/evo_X_Spell1_mangos.sql b/sql/evo-X Update/Spells/evo_X_Spell1_mangos.sql new file mode 100644 index 0000000..d908b77 --- /dev/null +++ b/sql/evo-X Update/Spells/evo_X_Spell1_mangos.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; \\ No newline at end of file diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 04f7317..2b29f71 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::HandleMirrrorImageDataRequest }, + /*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 a784d2f..e5c2513 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_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 f20a287..7ca4371 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 @@ -7844,3 +7844,42 @@ void Aura::HandleAllowOnlyAbility(bool apply, bool Real) m_target->UpdateDamagePhysical(RANGED_ATTACK); m_target->UpdateDamagePhysical(OFF_ATTACK); } + +void Aura::HandleAuraInitializeImages(bool Apply, bool Real) +{ + if (!Real || !Apply) + return; + + Unit* caster = GetCaster(); + if (!caster) + return; + + // Set item visual +} + +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 5698f36..731fbd0 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -215,6 +215,8 @@ class MANGOS_DLL_SPEC Aura void HandleModTargetArmorPct(bool Apply, bool Real); void HandleAuraModAllCritChance(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 433f266..f6318c5 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -575,3 +575,83 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data ) } } } +void WorldSession::HandleMirrrorImageDataRequest( 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, + E QUIPMENT_SLOT_CHEST, + EQUIPMENT_SLOT_WAIST, + EQUIPMENT_SLOT_LEGS, + EQUIPMENT_SLOT_FEET, + E QUIPMENT_SLOT_WRISTS, + EQUIPMENT_SLOT_HANDS, + EQUIPMENT_SLOT_BACK, + EQUIPMENT_SLOT_TABARD, + E QUIPMENT_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 aa69a84..90c98c8 100644 --- a/src/game/WorldSession.h +++ b/src/game/WoÇrldSession.h @@ -730,6 +730,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);
Contact Us
To contact us
click here
You can also email us at [email protected]
Privacy Policy | Terms & Conditions
You can also email us at [email protected]
Privacy Policy | Terms & Conditions
Copyright © getMaNGOS. All rights Reserved.
This website is in no way associated with or endorsed by Blizzard Entertainment®
This website is in no way associated with or endorsed by Blizzard Entertainment®