Jump to content

eggxp

Members
  • Posts

    24
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by eggxp

  1. If you guys are totally on your own, I admire you, as a god..... :cool:
  2. you are right Thank you I found such a packet when I login in dalaran in pub wow. SMSG_COMPRESSED_UPDATE_OBJECT , header is 80 A6 0C F6 01 size is 42511 BTW: how do you guys figer out such things, with help of blizz or just IDA wow.exe?
  3. Patch: 10775 Bug: packet size error in ServerPktHeader if isLargePacket Ticket: https://mangos.lighthouseapp.com/projects/18208-mangos/tickets/658-packet-size-error-in-serverpktheader-if-islargepacket Code: From 1dc248db7504b7f9b3d84b88c9ec9769f7cd7471 Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Mon, 22 Nov 2010 08:56:54 +0800 Subject: [PATCH] [Fix] packet size error for LargePacket --- src/game/WorldSocket.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 413bd4c..8383125 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -167,7 +167,8 @@ int WorldSocket::SendPacket (const WorldPacket& pct) // Dump outgoing packet. sLog.outWorldPacketDump(uint32(get_handle()), pct.GetOpcode(), LookupOpcodeName(pct.GetOpcode()), &pct, false); - ServerPktHeader header(pct.size()+2, pct.GetOpcode()); + int pctSize = pct.size()+2 > 0x7FFF ? pct.size()+3:pct.size()+2; + ServerPktHeader header(pctSize, pct.GetOpcode()); m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength()); if (m_OutBuffer->space () >= pct.size () + header.getHeaderLength() && msg_queue()->is_empty()) -- 1.7.3.1.msysgit.0 in pub wow in dalaran, when player login, the SMSG_COMPRESSED_UPDATE_OBJECT packet size will be > 50000 bytes, and it's a large packet. totalsize = packetSize + 3
  4. eggxp

    Macros

    It's useful, cooooooooooooool!
  5. Base On Patch: 10695 Ticket : https://mangos.lighthouseapp.com/projects/18208-mangos/tickets/656-rollmeleeoutcomeagainst-order-error [FIX]RollMeleeOutcomeAgainst order error. our order is Miss / Dodge / Parry / Block / Critical hit / Glancing Blow / Crushing Blow / Ordinary hit but http://www.wowwiki.com/Attack_table this article say Miss / Dodge / Parry / Glancing Blow / Block / Critical hit / Crushing Blow / Ordinary hit and i believe it's true From 24aeef7839c96eb511d19f65892ae7aedb619ebc Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Mon, 8 Nov 2010 08:33:50 +0800 Subject: [PATCH] [FIX] roll chance table order --- src/game/Unit.cpp | 76 +++++++++++++++++++++++++++++----------------------- 1 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ad97f4b..527354a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2607,8 +2607,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack } } - // parry & block chances - + // parry chances // check if attack comes from behind, nobody can parry or block if attacker is behind if (!pVictim->HasInArc(M_PI_F,this)) { @@ -2633,20 +2632,49 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack return MELEE_HIT_PARRY; } } - - if(pVictim->GetTypeId()==TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) ) - { - tmp = block_chance; - if ( (tmp > 0) // check if unit _can_ block - && ((tmp -= skillBonus) > 0) - && (roll < (sum += tmp))) - { - DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); - return MELEE_HIT_BLOCK; - } - } } + // Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon) + if( attType != RANGED_ATTACK && + (GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->IsPet()) && + pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->IsPet() && + getLevel() < pVictim->GetLevelForTarget(this) ) + { + // cap possible value (with bonuses > max skill) + int32 skill = attackerWeaponSkill; + int32 maxskill = attackerMaxSkillValueForLevel; + skill = (skill > maxskill) ? maxskill : skill; + + tmp = (10 + (victimDefenseSkill - skill)) * 100; + tmp = tmp > 4000 ? 4000 : tmp; + if (roll < (sum += tmp)) + { + DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); + return MELEE_HIT_GLANCING; + } + } + + // block chances + // check if attack comes from behind, nobody can parry or block if attacker is behind + if (!pVictim->HasInArc(M_PI_F,this)) + { + DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: attack came from behind."); + } + else + { + if(pVictim->GetTypeId()==TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) ) + { + tmp = block_chance; + if ( (tmp > 0) // check if unit _can_ block + && ((tmp -= skillBonus) > 0) + && (roll < (sum += tmp))) + { + DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); + return MELEE_HIT_BLOCK; + } + } + } + // Critical chance tmp = crit_chance; @@ -2656,26 +2684,6 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack return MELEE_HIT_CRIT; } - // Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon) - if( attType != RANGED_ATTACK && - (GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->IsPet()) && - pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->IsPet() && - getLevel() < pVictim->GetLevelForTarget(this) ) - { - // cap possible value (with bonuses > max skill) - int32 skill = attackerWeaponSkill; - int32 maxskill = attackerMaxSkillValueForLevel; - skill = (skill > maxskill) ? maxskill : skill; - - tmp = (10 + (victimDefenseSkill - skill)) * 100; - tmp = tmp > 4000 ? 4000 : tmp; - if (roll < (sum += tmp)) - { - DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); - return MELEE_HIT_GLANCING; - } - } - // mobs can score crushing blows if they're 4 or more levels above victim if (GetLevelForTarget(pVictim) >= pVictim->GetLevelForTarget(this) + 4 && // can be from by creature (if can) or from controlled player that considered as creature -- 1.7.3.1.msysgit.0
  6. thank you for reply when can we add the other part patch? [FIX] shaman in team HORDE summon totem display_id error it looks strange now
  7. TICKET: 648 https://mangos.lighthouseapp.com/projects/18208-mangos/tickets/648-shaman-in-team-horde-summon-totem-display_id-error Patch : [10654] [FIX] shaman in team HORDE summon totem display_id error. TAUREN summon totem display_id is same as DRAENEI for example. the bug is made by [10296] Move ChooseDisplayId to Creature class for access from script side [FIX] totem still can't have anim when destroyed. because it's not DEAD From f4077e62a1a4c8c4e0bf0bd16148061c483aa23f Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Fri, 29 Oct 2010 08:45:54 +0800 Subject: [PATCH] [FIX] shaman in team HORDE summon totem display_id error. [FIX] totem still can't have anim when destroyed. because it's not DEAD --- src/game/Creature.cpp | 6 ++++++ src/game/Totem.cpp | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 1a1ba8b..91f4193 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -250,6 +250,12 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data ) return false; } + // for totem(ALLIANCE and HORDE have different totem) + if (team == HORDE && (cinfo->ModelId[2] || cinfo->ModelId[3])) + { + display_id = cinfo->ModelId[2] ? cinfo->ModelId[2] : cinfo->ModelId[3]; + } + CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); if (!minfo) // Cancel load if no model defined { diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 87cb0d5..53600d1 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -106,6 +106,7 @@ void Totem::UnSummon() ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this); } + SetDeathState(DEAD); AddObjectToRemoveList(); } -- 1.7.3.1.msysgit.0
  8. in SMSG_UPDATE_OBJECT, the field: ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET is not meaning duration, Client seems don't use the value. if ENCHANTMENT_DURATION_OFFSET == 0, client will not display aura time in other case, client have no reaction to the value. do any body know what it really means?
  9. seens it's no way to prevent the new field, or am i wrong? :rolleyes:
  10. submitted review patch 2, modified base class for VisibleForInStateResult parameter tested
  11. mm... understood I'll change the patch later
  12. I agree. no. if we do this, if a mage cast spell "stealth" near a shaman with totems, the mage will see all totems destroyed
  13. yes, I thought about that. but if we use target->DestroyForPlayer(this, target->GetDestroyAnim()); the "bool anim" argument is no use, what if someone wanna specify anim but don't wanna change m_destroyAnim? for example: a object with m_destroyAnim = true disappear (invisibility) is different from a object with m_destroyAnim = true *must* start destroy anim
  14. Rev 10640 ticket: https://mangos.lighthouseapp.com/projects/18208-mangos/tickets/641-totem-should-show-anim-when-destroyed show anim when totem destroyed. it's only slowly disappear in current version. From f2ea3f23a0ecb8127951485f6a2f486fe4079a19 Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Mon, 25 Oct 2010 09:16:18 +0800 Subject: [PATCH 1/2][Fix] show anim when totem destroy --- src/game/Object.cpp | 5 +++-- src/game/Object.h | 4 ++++ src/game/Player.cpp | 2 +- src/game/Totem.cpp | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 61677cc..d6f69d1 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -220,7 +220,7 @@ void Object::DestroyForPlayer( Player *target, bool anim ) const { MANGOS_ASSERT(target); - WorldPacket data(SMSG_DESTROY_OBJECT, 8); + WorldPacket data(SMSG_DESTROY_OBJECT, 9); data << GetObjectGuid(); data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation target->GetSession()->SendPacket(&data); @@ -1134,6 +1134,7 @@ void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 phaseMask ) { Object::_Create(guidlow, 0, guidhigh); m_phaseMask = phaseMask; + m_destroyAnim = false; } void WorldObject::Relocate(float x, float y, float z, float orientation) @@ -2084,4 +2085,4 @@ bool WorldObject::IsControlledByPlayer() const default: return false; } -} +} \\ No newline at end of file diff --git a/src/game/Object.h b/src/game/Object.h index 653b169..2919f72 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -492,6 +492,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object bool isActiveObject() const { return m_isActiveObject || m_viewPoint.hasViewers(); } ViewPoint& GetViewPoint() { return m_viewPoint; } + + void SetDestroyAnim(bool anim) {m_destroyAnim = anim;} + bool GetDestroyAnim() { return m_destroyAnim; } protected: explicit WorldObject(); @@ -515,6 +518,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object float m_positionY; float m_positionZ; float m_orientation; + bool m_destroyAnim; ViewPoint m_viewPoint; }; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 85cea3d..09a5952 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19364,7 +19364,7 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe ObjectGuid t_guid = target->GetGUID(); - target->DestroyForPlayer(this); + target->DestroyForPlayer(this, target->GetDestroyAnim()); m_clientGUIDs.erase(t_guid); DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s out of range for player %u. Distance = %f",t_guid.GetString().c_str(),GetGUIDLow(),GetDistance(target)); diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 2b1c968..8300430 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -29,6 +29,7 @@ Totem::Totem() : Creature(CREATURE_SUBTYPE_TOTEM) { m_duration = 0; m_type = TOTEM_PASSIVE; + SetDestroyAnim(true); } void Totem::Update( uint32 time ) -- 1.7.3.1.msysgit.0 ======================================== add patch 2: add destroy anim for all object when destroyed there may be more VisibleForInStateResult enums in furture use From 45fdb768b00d66fa84ca074d25c2c843fd9547b6 Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Mon, 25 Oct 2010 22:29:28 +0800 Subject: [PATCH 2/2] [fix]add destroy anim for all object when destroyed --- src/game/Corpse.cpp | 2 +- src/game/Corpse.h | 2 +- src/game/DynamicObject.cpp | 5 ++++- src/game/DynamicObject.h | 2 +- src/game/GameObject.cpp | 5 ++++- src/game/GameObject.h | 2 +- src/game/Object.cpp | 1 - src/game/Object.h | 12 ++++++++---- src/game/Player.cpp | 10 ++++++++-- src/game/Totem.cpp | 1 - src/game/Unit.cpp | 15 ++++++++++++--- src/game/Unit.h | 4 ++-- 12 files changed, 42 insertions(+), 19 deletions(-) diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 062a005..1fabba9 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -250,7 +250,7 @@ bool Corpse::LoadFromDB(uint32 lowguid, Field *fields) return true; } -bool Corpse::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const +bool Corpse::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result) const { return IsInWorld() && u->IsInWorld() && IsWithinDistInMap(viewPoint, World::GetMaxVisibleDistanceForObject() + (inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false); } diff --git a/src/game/Corpse.h b/src/game/Corpse.h index f72afea..6904052 100644 --- a/src/game/Corpse.h +++ b/src/game/Corpse.h @@ -77,7 +77,7 @@ class Corpse : public WorldObject GridPair const& GetGrid() const { return m_grid; } void SetGrid(GridPair const& grid) { m_grid = grid; } - bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result = NULL) const; Loot loot; // remove insignia ONLY at BG Player* lootRecipient; diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index b2d88f9..a242bc3 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -183,10 +183,13 @@ void DynamicObject::Delay(int32 delaytime) } } -bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const +bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result) const { if(!IsInWorld() || !u->IsInWorld()) + { + if(result) {*result = VISIBLE_FOR_INSTATE_NOT_IN_MAP;} return false; + } // always seen by owner if(GetCasterGUID()==u->GetGUID()) diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index 0907664..d5db699 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -56,7 +56,7 @@ class DynamicObject : public WorldObject return 0.0f; // dynamic object not have real interact size } - bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result = NULL) const; void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); } void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 32bedb3..e7bd9e0 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -676,11 +676,14 @@ void GameObject::SaveRespawnTime() sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); } -bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const +bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *visibleResult) const { // Not in world if(!IsInWorld() || !u->IsInWorld()) + { + if (visibleResult) {*visibleResult = VISIBLE_FOR_INSTATE_NOT_IN_MAP;} return false; + } // invisible at client always if(!GetGOInfo()->displayId) diff --git a/src/game/GameObject.h b/src/game/GameObject.h index f09e749..6cc6622 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -703,7 +703,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void SummonLinkedTrapIfAny(); void TriggeringLinkedGameObject( uint32 trapEntry, Unit* target); - bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *visibleResult = NULL) const; GameObject* LookupFishingHoleAround(float range); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index d6f69d1..19d5723 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1134,7 +1134,6 @@ void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 phaseMask ) { Object::_Create(guidlow, 0, guidhigh); m_phaseMask = phaseMask; - m_destroyAnim = false; } void WorldObject::Relocate(float x, float y, float z, float orientation) diff --git a/src/game/Object.h b/src/game/Object.h index 2919f72..1a539bf 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -60,6 +60,13 @@ enum PhaseMasks PHASEMASK_ANYWHERE = 0xFFFFFFFF }; +enum VisibleForInStateResult +{ + VISIBLE_FOR_INSTATE_NONE = 0, //visible + VISIBLE_FOR_INSTATE_NOT_IN_MAP = 1, + VISIBLE_FOR_INSTATE_NOT_IN_WORLD = 2, +}; + class WorldPacket; class UpdateData; class WorldSession; @@ -473,7 +480,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object bool isVisibleFor(Player const* u, WorldObject const* viewPoint) const { return isVisibleForInState(u,viewPoint,false); } // low level function for visibility change code, must be define in all main world object subclasses - virtual bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const = 0; + virtual bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result = NULL) const = 0; void SetMap(Map * map); Map * GetMap() const { MANGOS_ASSERT(m_currMap); return m_currMap; } @@ -493,8 +500,6 @@ class MANGOS_DLL_SPEC WorldObject : public Object ViewPoint& GetViewPoint() { return m_viewPoint; } - void SetDestroyAnim(bool anim) {m_destroyAnim = anim;} - bool GetDestroyAnim() { return m_destroyAnim; } protected: explicit WorldObject(); @@ -518,7 +523,6 @@ class MANGOS_DLL_SPEC WorldObject : public Object float m_positionY; float m_positionZ; float m_orientation; - bool m_destroyAnim; ViewPoint m_viewPoint; }; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 09a5952..2f12cc1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19357,14 +19357,20 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe { if(HaveAtClient(target)) { - if(!target->isVisibleForInState(this, viewPoint, true)) + VisibleForInStateResult visibleResult = VISIBLE_FOR_INSTATE_NONE; + if(!target->isVisibleForInState(this, viewPoint, true, &visibleResult)) { if (target->GetTypeId()==TYPEID_UNIT) BeforeVisibilityDestroy<Creature>((Creature*)target,this); ObjectGuid t_guid = target->GetGUID(); - target->DestroyForPlayer(this, target->GetDestroyAnim()); + bool anim = false; + if (visibleResult == VISIBLE_FOR_INSTATE_NOT_IN_MAP) + { + anim = true; + } + target->DestroyForPlayer(this, anim); m_clientGUIDs.erase(t_guid); DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s out of range for player %u. Distance = %f",t_guid.GetString().c_str(),GetGUIDLow(),GetDistance(target)); diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 8300430..2b1c968 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -29,7 +29,6 @@ Totem::Totem() : Creature(CREATURE_SUBTYPE_TOTEM) { m_duration = 0; m_type = TOTEM_PASSIVE; - SetDestroyAnim(true); } void Totem::Update( uint32 time ) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2614123..84fed60 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7714,10 +7714,14 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) return gain; } -bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList, bool is3dDistance) const +bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList, bool is3dDistance, VisibleForInStateResult *visibleResult) const { + if(visibleResult) {*visibleResult = VISIBLE_FOR_INSTATE_NONE;} if(!u || !IsInMap(u)) + { + if(visibleResult) {*visibleResult = VISIBLE_FOR_INSTATE_NOT_IN_MAP;} return false; + } // Always can see self if (u==this) @@ -7733,11 +7737,16 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo // not in world if(!at_same_transport && (!IsInWorld() || !u->IsInWorld())) + { + if(visibleResult) {*visibleResult = VISIBLE_FOR_INSTATE_NOT_IN_WORLD;} return false; + } // forbidden to seen (at GM respawn command) if(m_Visibility==VISIBILITY_RESPAWN) + { return false; + } Map& _map = *u->GetMap(); // Grid dead/alive checks @@ -8804,9 +8813,9 @@ void Unit::ApplyDiminishingAura( DiminishingGroup group, bool apply ) } } -bool Unit::isVisibleForInState( Player const* u, WorldObject const* viewPoint, bool inVisibleList ) const +bool Unit::isVisibleForInState( Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result) const { - return isVisibleForOrDetect(u, viewPoint, false, inVisibleList, false); + return isVisibleForOrDetect(u, viewPoint, false, inVisibleList, false, result); } /// returns true if creature can't be seen by alive units diff --git a/src/game/Unit.h b/src/game/Unit.h index 9b7aeba..a3fc558 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1676,12 +1676,12 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void SetVisibility(UnitVisibility x); // common function for visibility checks for player/creatures with detection code - bool isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; + bool isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, bool detect, bool inVisibleList = false, bool is3dDistance = true, VisibleForInStateResult *visibleResult = NULL) const; bool canDetectInvisibilityOf(Unit const* u) const; void SetPhaseMask(uint32 newPhaseMask, bool update);// overwrite WorldObject::SetPhaseMask // virtual functions for all world objects types - bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const; + bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList, VisibleForInStateResult *result = NULL) const; // function for low level grid visibility checks in player/creature cases virtual bool IsVisibleInGridForPlayer(Player* pl) const = 0; bool isInvisibleForAlive() const; -- 1.7.3.1.msysgit.0
  15. Can't check in Spell:CheckCast, because: 1. it's triggered spell 2. triggered spell id is seted in Spell::EffectEnchantItemTmp spell won't check fail if didn't touch effect code
  16. * What bug does the patch fix? What features does the patch add? 1. fix ticet 637: Rockbiter Weapon should not apply to both weapon 2. Totem.h, Totem::m_duration change from uint32 to int32. * For which repository revision was the patch created? Rev. 10636 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. https://mangos.lighthouseapp.com/projects/18208/tickets/637-rockbiter-weapon-should-not-apply-to-both-weapon * Who has been writing this patch? Please include either forum user names or email addresses. me. [email protected] From 37bfd00aa6c85732070c4a90d4fb83ce20a9510c Mon Sep 17 00:00:00 2001 From: eggxp <[email protected]> Date: Fri, 22 Oct 2010 09:16:39 +0800 Subject: [PATCH] 1. fix ticet 637: Rockbiter Weapon should not apply to both weapon 2. Totem.h, Totem::m_duration change from uint32 to int32. --- src/game/Spell.cpp | 6 +++++- src/game/Spell.h | 4 ++++ src/game/SpellEffects.cpp | 23 +++++++++-------------- src/game/Totem.cpp | 2 +- src/game/Totem.h | 2 +- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index c59658e..6e816b9 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -339,6 +339,7 @@ Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid o m_selfContainer = NULL; m_referencedFromCurrentSpell = false; m_executedCurrently = false; + m_notSendCastResult = false; m_delayStart = 0; m_delayAtDamageCount = 0; @@ -2643,7 +2644,10 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) SendChannelUpdate(0); triggeredByAura->SetAuraDuration(0); } - SendCastResult(result); + if(!m_notSendCastResult) + { + SendCastResult(result); + } finish(false); return; } diff --git a/src/game/Spell.h b/src/game/Spell.h index 2bb7e40..ad1b317 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -459,6 +459,9 @@ class Spell CurrentSpellTypes GetCurrentContainer(); + void SetNotSendCastResult(bool not_send) {m_notSendCastResult = not_send;} + bool GetNotSendCastResult() const {return m_notSendCastResult;} + // caster types: // formal spell caster, in game source of spell affects cast Unit* GetCaster() const { return m_caster; } @@ -625,6 +628,7 @@ class Spell float m_castPositionZ; float m_castOrientation; bool m_IsTriggeredSpell; + bool m_notSendCastResult; // if need this can be replaced by Aura copy // we can't store original aura link to prevent access to deleted auras diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 56c494e..a2d13cb 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4767,7 +4767,7 @@ void Spell::EffectEnchantItemTmp(SpellEffectIndex eff_idx) Player* p_caster = (Player*)m_caster; - // Rockbiter Weapon apply to both weapon + // Rockbiter Weapon if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000400000)) { uint32 spell_id = 0; @@ -4794,7 +4794,6 @@ void Spell::EffectEnchantItemTmp(SpellEffectIndex eff_idx) return; } - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); if (!spellInfo) { @@ -4802,19 +4801,15 @@ void Spell::EffectEnchantItemTmp(SpellEffectIndex eff_idx) return; } - for(int j = BASE_ATTACK; j <= OFF_ATTACK; ++j) + if (!itemTarget->IsFitToSpellRequirements(m_spellInfo)) { - if (Item* item = p_caster->GetWeaponForAttack(WeaponAttackType(j))) - { - if (item->IsFitToSpellRequirements(m_spellInfo)) - { - Spell *spell = new Spell(m_caster, spellInfo, true); - SpellCastTargets targets; - targets.setItemTarget( item ); - spell->prepare(&targets); - } - } - } + return; + } + Spell *spell = new Spell(m_caster, spellInfo, true); + SpellCastTargets targets; + targets.setItemTarget( itemTarget ); + spell->SetNotSendCastResult(true); + spell->prepare(&targets); return; } diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 87cb0d5..2b1c968 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -40,7 +40,7 @@ void Totem::Update( uint32 time ) return; } - if (m_duration <= time) + if (m_duration <= int32(time)) { UnSummon(); // remove self return; diff --git a/src/game/Totem.h b/src/game/Totem.h index 57c1686..c489a55 100644 --- a/src/game/Totem.h +++ b/src/game/Totem.h @@ -57,6 +57,6 @@ class Totem : public Creature protected: TotemType m_type; - uint32 m_duration; + int32 m_duration; }; #endif -- 1.7.3.1.msysgit.0 why add m_notSendCastResult? 1. shaman equip a weapon and a shield. 2. use Rockbiter Weapon. target in CMSG_CAST_SPELL is the weapon. 3. use Rockbiter Weapon again. target in CMSG_CAST_SPELL is the shield. problem: out mangos will return SMSG_CAST_FAIL message to client. so client say "no, you can't cast the spell". in pub wow server, blizz will not return SMSG_CAST_FAIL message. so: add m_notSendCastResult. set to true in EffectEnchantItemTmp. why change m_duration from uint32 to int32? because m_duration may be negative in Totem::Update m_duration -= time first post. Sorry for my poor 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