Jump to content

debilvul

Members
  • Posts

    21
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

About debilvul

  • Birthday 01/01/1

debilvul's Achievements

Member

Member (2/3)

0

Reputation

  1. Is there a way how to learn Dual Talents by command? For example .cast or .learn since the DB is unsupported
  2. well i figured that out myself:D but i've stopped working on this
  3. couldn't be at least implemented this part? Yes it doesn't solve this issue completely but i think it's still better with this patch
  4. of course, before this patch when you were MCd only faction was changed, so you could polymorph them, my patch only makes the MCd ones attack another
  5. converted to the Player.cpp and added some fixes From 1e9f700be3e7bcd0e6e1e6304f1ddb3f67a81ea4 Mon Sep 17 00:00:00 2001 From: unknown <> Date: Sat, 7 Nov 2009 11:17:30 +0100 Subject: [PATCH] added support for charming players --- src/game/Player.cpp | 30 ++++++++++++++++++++++++++++++ src/game/Player.h | 2 ++ src/game/SpellAuras.cpp | 8 ++++++++ 3 files changed, 40 insertions(+), 0 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index bdf6b53..cc79241 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4065,6 +4065,36 @@ void Player::SetMovement(PlayerMovementType pType) GetSession()->SendPacket( &data ); } +void Player::SetCharmed(bool apply, uint64 casterGUID, uint32 spellID) +{ + SetClientControl(this, !apply); + + if (apply) + if (Unit* pCaster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL)) + { + std::list<HostilReference*>& threatlist = pCaster->getThreatManager().getThreatList(); + if (threatlist.size()) + for (uint8 i = 0;i < 3;++i) + { + std::list<HostilReference*>::iterator itr = threatlist.begin(); + advance(itr,(rand() % (threatlist.size()))); + if (Unit* pTarget = Unit::GetUnit((*pCaster), (*itr)->getUnitGuid())) + if (pTarget != this || !pTarget->isAlive()) + { + GetMotionMaster()->MoveChase(pTarget); + Attack(pTarget,true); //attack to make a victim for further attacks + break; + } + } + } + + if (!apply) + { + GetMotionMaster()->Clear(); + AttackStop(); + } +} + /* Preconditions: - a resurrectable corpse must not be loaded for the player (only bones) - the player must be in world diff --git a/src/game/Player.h b/src/game/Player.h index a6b1ea7..4afa91b 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1811,6 +1811,8 @@ class MANGOS_DLL_SPEC Player : public Unit void SetMovement(PlayerMovementType pType); + void SetCharmed(bool apply, uint64 casterGUID, uint32 spellID) + void JoinedChannel(Channel *c); void LeftChannel(Channel *c); void CleanupChannels(); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8af7235..ba0b645 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3490,6 +3490,11 @@ void Aura::HandleModCharm(bool apply, bool Real) if( apply ) { + //cannot charm only one player enemy + if(m_target->GetTypeId() == TYPEID_PLAYER) + if(caster->getThreatManager().getThreatList().size() < 2) + return; + m_target->SetCharmerGUID(GetCasterGUID()); m_target->setFaction(caster->getFaction()); m_target->CastStop(m_target == caster ? GetId() : 0); @@ -3578,6 +3583,9 @@ void Aura::HandleModCharm(bool apply, bool Real) ((Creature*)m_target)->AI()->AttackedBy(caster); } } + + if(m_target->GetTypeId() == TYPEID_PLAYER) + ((Player*)m_target)->SetCharmed(apply, GetCasterGUID(), GetId()); } void Aura::HandleModConfuse(bool apply, bool Real) -- 1.6.3.msysgit.0
  6. okay, then for(uint8 i = 0; i < threatlist.size();++i) could work:) anyway, feel free to modify and reply and ofc i forgot this condition: replace if (pTarget != this) with if (pTarget != this || !pTarget->isAlive())
  7. What bug does the patch fix? What features does the patch add? Implements that players affected with aura type charm start attacking other players. (Mind controls casted by NPCs on players) For which repository revision was the patch created? 8756 Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. i made a bug report but noone replied Who has been writing this patch? Please include either forum user names or email addresses. myself, debilvul From 213c15bc172895a4f229ec6296810a24db21ee28 Mon Sep 17 00:00:00 2001 From: unknown <Tygr@.(none)> Date: Mon, 2 Nov 2009 13:46:50 +0100 Subject: [PATCH] [8756]Added new function SetPlayerCharmed to make work charm effects on players --- src/game/SpellAuras.cpp | 3 +++ src/game/Unit.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/game/Unit.h | 1 + 3 files changed, 48 insertions(+), 0 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8af7235..b16435f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3578,6 +3578,9 @@ void Aura::HandleModCharm(bool apply, bool Real) ((Creature*)m_target)->AI()->AttackedBy(caster); } } + + if(m_target->GetTypeId() == TYPEID_PLAYER) + m_target->SetPlayerCharmed(apply, GetCasterGUID(), GetId()); } void Aura::HandleModConfuse(bool apply, bool Real) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ac5f15d..1d90aea 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -180,6 +180,17 @@ void Unit::Update( uint32 p_time ) if(!IsInWorld()) return; + // handling charmed effects on players + if (GetTypeId() == TYPEID_PLAYER) + if (HasAuraType(SPELL_AURA_MOD_CHARM)) + if (isAttackReady()) + //If we are within range melee the target + if (IsWithinDistInMap(getVictim(), ATTACK_DISTANCE)) + { + AttackerStateUpdate(getVictim()); + resetAttackTimer(); + } + /*if(p_time > m_AurasCheck) { m_AurasCheck = 2000; @@ -11859,6 +11870,39 @@ void Unit::SetConfused(bool apply, uint64 const& casterGUID, uint32 spellID) ((Player*)this)->SetClientControl(this, !apply); } +void Unit::SetPlayerCharmed(bool apply, uint64 casterGUID, uint32 spellID) +{ + if (GetTypeId() != TYPEID_PLAYER) + return; + + ((Player*)this)->SetClientControl(this, !apply); + + if (apply) + if (Unit* pCaster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL)) + { + std::list<HostilReference*>& threatlist = pCaster->getThreatManager().getThreatList(); + if (threatlist.size()) + for (; + { + std::list<HostilReference*>::iterator itr = threatlist.begin(); + advance(itr,(rand() % (threatlist.size()))); + if (Unit* pTarget = Unit::GetUnit((*pCaster), (*itr)->getUnitGuid())) + if (pTarget != this) + { + GetMotionMaster()->MoveChase(pTarget); + Attack(pTarget,true); //attack to make a victim for further attacks + break; + } + } + } + + if (!apply) + { + GetMotionMaster()->Clear(); + AttackStop(); + } +} + void Unit::SetFeignDeath(bool apply, uint64 const& casterGUID, uint32 spellID) { if( apply ) diff --git a/src/game/Unit.h b/src/game/Unit.h index b481c37..47ef114 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1510,6 +1510,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void SetFeared(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0, uint32 time = 0); void SetConfused(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0); + void SetPlayerCharmed(bool apply, uint64 const& caterGUID = 0,uint32 spellID = 0); void SetFeignDeath(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0); void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); } -- 1.6.3.msysgit.0
  8. i can't run on version 3.2.2 at the moment so i need to pull some 3.1.3 version is this possible in git? How to do that?
  9. Charming effects aren't working on players, it only modifies their faction So i suggest that we add a new function in Unit something like this: void Unit::SetPlayerCharmed(bool apply, uint64 casterGUID, uint32 spellID) { ((Player*)this)->SetClientControl(this, !apply); if(apply) if(Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL)) GetMotionMaster()->MoveChase(caster->getVictim()); } and in Aura::HandleModCharm if(m_target->GetTypeId() == TYPEID_PLAYER) m_target->SetPlayerCharmed(apply, GetCasterGUID(), GetId()); the thing is that i'd add for the charmed player for melee attack his target if ready but i don't know there to put this code if(isAttackReady()) { //If we are within range melee the target if (IsWithinDistInMap(getVictim(), ATTACK_DISTANCE)) { AttackerStateUpdate(getVictim()); resetAttackTimer(); } } anyone can help?
  10. but in scriptdev2 they tell you that it could be only hacked, because activate object isn't handled by the core yet
  11. Any progress of this? was this ever working or?
  12. And how to decode the data? just add an event in client and try to find out which field is it assigned to? or are there any else tactics?
  13. omg, 3 minutes, check http://thottbot.com/s46584
  14. Here's the thing, There are three Blood Siphon spells in Hakkar: http://www.thottbot.com/s24324 http://www.thottbot.com/s24322 http://www.thottbot.com/s24323 They are connected How should it work: Spell 24324 should apply stun for all players affected and in spell_scripts decide which player has a debuff http://www.thottbot.com/s24321. Affected Players should cast 24323, not affected 24322 How does it work: spell 24324 doesn't do a thing spells 24323 and 24322 work only when cast from players on Hakkar 24322 had entry in spell_scripts_target, for 24323 i had to add it i would add the entry for 24324 in Spell_scripts but i don't know how to make the check if target is affected byt spell 24321 or has its aura
×
×
  • 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