Jump to content

anti-freak

Members
  • Posts

    21
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

anti-freak's Achievements

Member

Member (2/3)

0

Reputation

  1. What bug does the patch fix? What features does the patch add? I have a problem to cast a aoe spell from a possed pet. I usually recive the message "unvalid target", so I did some core research and find out, that aoe spells which are casted on caster itself, cannot be completed. So I try to fix that problem and find a solution. The spell I have problems with is this. feel free to complete the if cases. For which repository revision was the patch created? s1327 Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. no Who has been writing this patch? Please include either forum user names or email addresses. me [== c++ ==] diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3b21888..6738973 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5011,12 +5011,16 @@ SpellCastResult Spell::CheckPetCast(Unit* target) else { bool duelvsplayertar = false; + bool bIsAOESpell = false; for(int j = 0; j < MAX_EFFECT_INDEX; ++j) { //TARGET_DUELVSPLAYER is positive AND negative duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER); + // ToDo: add here more ImplicitTargets + if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_CASTER_COORDINATES) + bIsAOESpell |= true; } - if(m_caster->IsFriendlyTo(target) && !duelvsplayertar) + if(m_caster->IsFriendlyTo(target) && !duelvsplayertar && !bIsAOESpell) { return SPELL_FAILED_BAD_TARGETS; }
  2. Mangos Verion: all until current Who wrote this patch: me what does it change: temporarysummoned creatures now set the "UNIT_FIELD_SUMMONEDBY" value, so the "GetOwner()" and "GetOwnerGuid()" function are working correct. diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp index 7d3ad3d..052ad70 100644 --- a/src/game/TemporarySummon.cpp +++ b/src/game/TemporarySummon.cpp @@ -156,6 +156,8 @@ void TemporarySummon::Summon(TempSummonType type, uint32 lifetime, uint32 spawnP m_timer = lifetime; m_lifetime = lifetime; + SetGuidValue(UNIT_FIELD_SUMMONEDBY, m_summoner); + AIM_Initialize(); GetMap()->Add((Creature*)this); }
  3. Why should a unit get aggro from the mob, when he is out of range? Range Targets CAN NOT get aggro (but taunt aura applys). In my oppinion it doesn´make sense. Also I told you some points why I wont do it generel for non movement mobs. The manual change give you much more controle over your mob.
  4. Hmm, I don´t know if I understand you right, but taunt will be checked bevore the check if its in range. When the warri is out of range he wont become the target.
  5. What does the patch do?: The patch adds a bool to the "Unit" class, which allows you to say if the boss should prefere melee targets or not. The core doesn´t support standing bosses very well (the only way was to modify the aggro in the SD2 scripts). I decided to make it not static for bosses which can´t move, because sometimes bosses (like alar) stand still (plattforme phase) and later they move around (second phase). Who wrote this patch?: me For which rev is it?: s1009 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a914c0d..54b61cc 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -255,6 +255,8 @@ Unit::Unit() // remove aurastates allowing special moves for(int i=0; i < MAX_REACTIVE; ++i) m_reactiveTimer[i] = 0; + + m_bPrefereMeleeTargets = false; } Unit::~Unit() @@ -7670,6 +7672,27 @@ bool Unit::SelectHostileTarget() }while (aura != tauntAuras.begin()); } } + + //get the melee target with most thread + if (m_bPrefereMeleeTargets) + { + ThreatList const& tList = m_ThreatManager.getThreatList(); + uint32 UnitThread = 0; + if (!tList.empty()) + { + for (ThreatList::const_iterator i = tList.begin(); i != tList.end(); ++i) + { + uint64 uiGuid = (*i)->getUnitGuid(); + //If we are within range melee the target + Unit *pUnit = GetMap()->GetPlayer(uiGuid); + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER && IsWithinDistInMap(pUnit, ATTACK_DISTANCE) && (*i)->getThreat() > UnitThread) + { + UnitThread = (*i)->getThreat(); + target = pUnit; + } + } + } + } // No taunt aura or taunt aura caster is dead, standard target selection if (!target && !m_ThreatManager.isThreatListEmpty()) diff --git a/src/game/Unit.h b/src/game/Unit.h index 6ac79c4..890d0b2 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1779,6 +1779,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void AddPetAura(PetAura const* petSpell); void RemovePetAura(PetAura const* petSpell); + //target selections + void SetPrefereMeleeTargets(bool bPrefere = true) { m_bPrefereMeleeTargets = bPrefere; } + protected: explicit Unit (); @@ -1857,6 +1860,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject uint64 m_TotemSlot[MAX_TOTEM_SLOT]; + bool m_bPrefereMeleeTargets; + private: // Error traps for some wrong args using // this will catch and prevent build for any cases when all optional args skipped and instead triggered used non boolean type // no bodies expected for this declarations
  6. What bug does the patch fix? What features does the patch add? this spell should ignore his knockback and dmg effekt if target is in water. (the lurker below: spout) For which repository revision was the patch created? [s1009] Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. No. Who has been writing this patch? Please include either forum user names or email addresses. me diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 930ff5c..49f7fcd 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3739,6 +3739,10 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar itemTarget = pItemTarget; gameObjTarget = pGOTarget; + //ignore knockback from spout (the lurker below) + if(m_spellInfo->Id == 37433 && unitTarget && unitTarget->IsInWater()) + return; + uint8 eff = m_spellInfo->Effect[i]; damage = int32(CalculateDamage(i, unitTarget) * DamageMultiplier); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index eb2aa20..f4c8687 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -356,6 +356,10 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx) case 38441: damage = unitTarget->GetMaxHealth() / 2; break; + case 37433: + if (unitTarget && unitTarget->IsInWater()) + return; + break; } break; }
  7. ok, that looks like, if you didn´t get some response for your patch In my lurker script I had an issue with this patch, because, everytime when I want to turn him around (while casting spoute), and the melees are going away from him, he targets the another target, and so the "turn" was interupted (he turns, but the model still looks to his victim). So I thought, that a methode to deactivate this bool is needed. Of course, thats a speciel problem, but howewer, I wrote the patch for this boss So, I think, there is core support needed. My way or another, thats your part to decide.
  8. Yeah, thats what I did. Lookup for a melee in range, when there is no one, target a range target, whats wrong with this? Thats the effect you describe, "prefere a melee target".
  9. Yeah, I know, but the target can be a range unit, and thats the problem. The boss should only melee a melee target, nothing else, because otherwise there is no melee dmg (because it does not moving to his target). I hope you understand now what I want to tell you
  10. Ok, hi^^ The problem i have is, that bosses like lurker mussn´t move. So caster, or better, units auf of melee range can´t getting aggro from this boss. I did some research for this problem, an i found some ugly methods to do this. Modify thread list and something else, nothing rly fine code. So I did something else. I put a bool in Unit class which checks if you can target a non melee target or not. The second thing I did, is to check this bool in "SelectHostileTarget", and lookup threadlist for a melee target if bool is false. The question is, is this a good idea for you, or just another ugly method? Or you have a better idea to realize that? Here is the code for the modifications i did: http://paste2.org/p/1384540
  11. hmm, only 4revs over mine >.< ok, close and forget
  12. What bug does the patch fix? There are some quest where you have to kill creatures for a minipet (to feed it or something like that). I found some code parts in SD2 which are not supported in mangos (function not called). I added a call in the dealdamage function, and a prototype in the creatureAI class. Who has been writing this patch? me diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 60b619c..141ba27 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -101,6 +101,9 @@ class MANGOS_DLL_SPEC CreatureAI // Called when the creature kills a unit virtual void KilledUnit(Unit *) {} + // Called when its owner kills a unit + virtual void OwnerKilledUnit(Unit* /*pVictim*/) {} + // Called when the creature summon successfully other creature virtual void JustSummoned(Creature* ) {} diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4ce0ade..d43c622 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -785,6 +785,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // Call KilledUnit for creatures if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI()) ((Creature*)this)->AI()->KilledUnit(pVictim); + // Call OwnerKilledUnit for MiniPets + else if(GetTypeId() == TYPEID_PLAYER) + { + Player *pPlayer = dynamic_cast<Player*>(this); + if (pPlayer && pPlayer->GetMiniPet()) + pPlayer->GetMiniPet()->AI()->OwnerKilledUnit(pVictim); + } // 10% durability loss on death // clean InHateListOf
  13. So, which are the next steps? Do you add this funktion, oder make it possible in the existing code? I´m interested in this because its stupid work to add this by myself
  14. Yes, it is a trap, but not linked. the flame (this GO) should spawn after a short time, after you used 5 barrels.
  15. I think, you don´t understand the problem. Yes, I spawn a GO at the same place as every time, not dynamic, but I can´t despawn it at your way. When you add this funktion, I can post my blizzlike nonhacky caverns of time 1 script, when not, it doesn´t make sense to post anything, beacause it wouldn´t work. Plz don´t understand me wrong, I worked at this problem a few days, I tryed everything to make it possible. Like vladimir said, there is a conflict with the traps... so far
×
×
  • 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