diff options
author | megamage <none@none> | 2009-01-24 11:28:00 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-24 11:28:00 -0600 |
commit | 30f6b38941e907c20dbb68f514eaf1345082abd3 (patch) | |
tree | 883bbfd30c30a2ea093f07fe7195a5d74a7bc2a0 /src | |
parent | f0ebb960642ad0fa43fa49fd3cc76f6516de6cd3 (diff) |
*Update to Mangos 7158.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Chat.cpp | 2 | ||||
-rw-r--r-- | src/game/Object.cpp | 3 | ||||
-rw-r--r-- | src/game/Object.h | 1 | ||||
-rw-r--r-- | src/game/ObjectAccessor.cpp | 6 | ||||
-rw-r--r-- | src/game/ObjectAccessor.h | 2 | ||||
-rw-r--r-- | src/game/PetHandler.cpp | 8 | ||||
-rw-r--r-- | src/game/SharedDefines.h | 2 | ||||
-rw-r--r-- | src/game/Spell.cpp | 3 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 352 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 1 | ||||
-rw-r--r-- | src/game/SpellHandler.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 2 | ||||
-rw-r--r-- | src/shared/Config/dotconfpp/dotconfpp.cpp | 4 | ||||
-rw-r--r-- | src/shared/Database/DBCStructure.h | 3 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
15 files changed, 152 insertions, 241 deletions
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 974a718b15e..09eb5594f62 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1154,7 +1154,7 @@ Creature* ChatHandler::getSelectedCreature() if(!m_session) return NULL; - return ObjectAccessor::GetCreatureOrPet(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection()); + return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection()); } char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 24e97183ec8..5c46ba93a5a 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -58,8 +58,9 @@ uint32 GuidHigh2TypeId(uint32 guid_hi) case HIGHGUID_DYNAMICOBJECT:return TYPEID_DYNAMICOBJECT; case HIGHGUID_CORPSE: return TYPEID_CORPSE; case HIGHGUID_MO_TRANSPORT: return TYPEID_GAMEOBJECT; + case HIGHGUID_VEHICLE: return TYPEID_UNIT; } - return 10; // unknown + return MAX_TYPEID; // unknown } Object::Object( ) diff --git a/src/game/Object.h b/src/game/Object.h index 2e29b4daec1..7db10b1d78d 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -73,6 +73,7 @@ enum TypeID TYPEID_AIGROUP = 8, TYPEID_AREATRIGGER = 9 }; +#define MAX_TYPEID 10 uint32 GuidHigh2TypeId(uint32 guid_hi); diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index dc451011110..3c54244ae13 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -130,7 +130,7 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3 } Creature* -ObjectAccessor::GetCreatureOrPet(WorldObject const &u, uint64 guid) +ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid) { if(Creature *unit = GetPet(guid)) return unit; @@ -166,7 +166,7 @@ ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid) if(IS_PLAYER_GUID(guid)) return FindPlayer(guid); - return GetCreatureOrPet(u, guid); + return GetCreatureOrPetOrVehicle(u, guid); } Corpse* @@ -189,7 +189,7 @@ Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32 if(typemask & TYPEMASK_UNIT) { - obj = GetCreatureOrPet(p,guid); + obj = GetCreatureOrPetOrVehicle(p,guid); if(obj) return obj; } diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index 5d5568c536f..6eb9e6ee0f5 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -141,7 +141,7 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor static Object* GetObjectByTypeMask(Player const &, uint64, uint32 typemask); static Creature* GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint32 npcflagmask); static Creature* GetCreature(WorldObject const &, uint64); - static Creature* GetCreatureOrPet(WorldObject const &, uint64); + static Creature* GetCreatureOrPetOrVehicle(WorldObject const &, uint64); static Unit* GetUnit(WorldObject const &, uint64); static Pet* GetPet(Unit const &, uint64 guid) { return GetPet(guid); } static Player* GetPlayer(Unit const &, uint64 guid) { return FindPlayer(guid); } diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index f7d853c4b29..e5ffd0235e5 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -308,7 +308,7 @@ void WorldSession::HandlePetNameQuery( WorldPacket & recv_data ) void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber) { - Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, petguid); + Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid); if(!pet || !pet->GetCharmInfo() || pet->GetCharmInfo()->GetPetNumber() != petnumber) return; @@ -350,7 +350,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) if(ObjectAccessor::FindPlayer(petguid)) return; - Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, petguid); + Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid); if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm())) { @@ -487,7 +487,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data ) sLog.outDetail( "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid) ); // pet/charmed - Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, guid); + Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if(pet) { if(pet->isPet()) @@ -555,7 +555,7 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket ) if(ObjectAccessor::FindPlayer(guid)) return; - Creature* pet=ObjectAccessor::GetCreatureOrPet(*_player,guid); + Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid); if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm())) { diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 66db2a8a3e8..d5102857ca2 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -391,7 +391,7 @@ enum SpellCategory #define SPELL_ATTR_EX5_UNK6 0x00000040 // 6 #define SPELL_ATTR_EX5_UNK7 0x00000080 // 7 #define SPELL_ATTR_EX5_UNK8 0x00000100 // 8 -#define SPELL_ATTR_EX5_UNK9 0x00000200 // 9 +#define SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY 0x00000200 // 9 begin periodic tick at aura apply #define SPELL_ATTR_EX5_UNK10 0x00000400 // 10 #define SPELL_ATTR_EX5_UNK11 0x00000800 // 11 #define SPELL_ATTR_EX5_UNK12 0x00001000 // 12 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 6869485266a..d0e1e3f9db3 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2238,6 +2238,9 @@ void Spell::handle_immediate() int32 duration = GetSpellDuration(m_spellInfo); if (duration) { + // Apply duration mod + if(Player* modOwner = m_caster->GetSpellModOwner()) + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); m_spellState = SPELL_STATE_CASTING; m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags); SendChannelStart(duration); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6f485561639..661fac9befe 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -116,7 +116,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, // 59 SPELL_AURA_MOD_DAMAGE_DONE_CREATURE implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus &Aura::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE &Aura::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE - &Aura::HandleNULL, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL + &Aura::HandlePeriodicHealthFunnel, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL &Aura::HandleUnused, // 63 SPELL_AURA_PERIODIC_MANA_FUNNEL obsolete? &Aura::HandlePeriodicManaLeech, // 64 SPELL_AURA_PERIODIC_MANA_LEECH &Aura::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED @@ -421,14 +421,19 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false) m_duration = m_maxduration; - if(modOwner) - modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_periodicTimer); - sLog.outDebug("Aura: construct Spellid : %u, Aura : %u Duration : %d Target : %d Damage : %d", m_spellProto->Id, m_spellProto->EffectApplyAuraName[eff], m_maxduration, m_spellProto->EffectImplicitTargetA[eff],damage); m_effIndex = eff; SetModifier(AuraType(m_spellProto->EffectApplyAuraName[eff]), damage, m_spellProto->EffectAmplitude[eff], m_spellProto->EffectMiscValue[eff]); + // Apply periodic time mod + if(modOwner && m_modifier.periodictime) + modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_modifier.periodictime); + + // Start periodic on next tick or at aura apply + if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY)) + m_periodicTimer += m_modifier.periodictime; + m_isDeathPersist = IsDeathPersistentSpell(m_spellProto); m_procCharges = m_spellProto->procCharges; @@ -597,18 +602,8 @@ void Aura::Update(uint32 diff) if(m_isPeriodic && (m_duration >= 0 || m_isPassive || m_permanent)) { m_periodicTimer -= diff; - if(m_periodicTimer <= 0) // tick also at m_periodicTimer==0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N - { - if( m_modifier.m_auraname == SPELL_AURA_MOD_REGEN || - m_modifier.m_auraname == SPELL_AURA_MOD_POWER_REGEN || - // Cannibalize, eating items and other spells - m_modifier.m_auraname == SPELL_AURA_OBS_MOD_HEALTH || - // Eating items and other spells - m_modifier.m_auraname == SPELL_AURA_OBS_MOD_MANA ) - { - ApplyModifier(true); - return; - } + if(m_periodicTimer <= 0) // tick also at m_periodicTimer==0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N + { // update before applying (aura can be removed in TriggerSpell or PeriodicTick calls) m_periodicTimer += m_modifier.periodictime; @@ -809,19 +804,6 @@ void Aura::_AddAura() } } } - // not call total regen auras at adding - switch (m_modifier.m_auraname) - { - case SPELL_AURA_OBS_MOD_HEALTH: - case SPELL_AURA_OBS_MOD_MANA: - m_periodicTimer = m_modifier.periodictime; - break; - case SPELL_AURA_MOD_REGEN: - case SPELL_AURA_MOD_POWER_REGEN: - case SPELL_AURA_MOD_MANA_REGEN_FROM_STAT: - m_periodicTimer = 5000; - break; - } Unit* caster = GetCaster(); @@ -845,6 +827,10 @@ void Aura::_AddAura() //***************************************************** if (!secondaura) { + // Sitdown on apply aura req seated + if (m_spellProto->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED && !m_target->IsSitState()) + m_target->SetStandState(PLAYER_STATE_SIT); + // register aura diminishing on apply if (getDiminishGroup() != DIMINISHING_NONE ) m_target->ApplyDiminishingAura(getDiminishGroup(),true); @@ -2308,54 +2294,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } } -void Aura::HandleAuraPeriodicDummy(bool apply, bool Real) -{ - // spells required only Real aura add/remove - if(!Real) - return; - - Unit* caster = GetCaster(); - - SpellEntry const*spell = GetSpellProto(); - switch( spell->SpellFamilyName) - { - case SPELLFAMILY_ROGUE: - { - // Master of Subtlety - if (spell->Id==31666 && !apply && Real) - { - m_target->RemoveAurasDueToSpell(31665); - break; - } - break; - } - case SPELLFAMILY_HUNTER: - { - // Aspect of the Viper - if (spell->SpellFamilyFlags&0x0004000000000000LL) - { - // Update regen on remove - if (!apply && m_target->GetTypeId() == TYPEID_PLAYER) - ((Player*)m_target)->UpdateManaRegen(); - break; - } - // Explosive Shot - if (spell->SpellFamilyFlags & 0x8000000000000000LL) - { - if (apply && caster) - { - int32 damage = m_modifier.m_amount + caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 8 / 100; - caster->CastCustomSpell(m_target, 53352, &damage, 0, 0, true, 0, this); - } - break; - } - break; - } - } - - m_isPeriodic = apply; -} - void Aura::HandleAuraMounted(bool apply, bool Real) { // only at real add/remove aura @@ -3948,33 +3886,71 @@ void Aura::HandleAuraModStalked(bool apply, bool Real) void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - m_isPeriodic = apply; } void Aura::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - m_isPeriodic = apply; } void Aura::HandlePeriodicEnergize(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; + if (!Real) + return; m_isPeriodic = apply; + + // Replenishment (0.25% from max) + // Infinite Replenishment + if (GetId() == 57669 || + GetId() == 61782) + m_modifier.m_amount = m_target->GetMaxPower(POWER_MANA) * 25 / 10000; } -void Aura::HandlePeriodicHeal(bool apply, bool Real) +void Aura::HandleAuraPowerBurn(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; + m_isPeriodic = apply; +} + +void Aura::HandleAuraPeriodicDummy(bool apply, bool Real) +{ + // spells required only Real aura add/remove + if(!Real) + return; + + // For prevent double apply bonuses + bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading()); + + Unit* caster = GetCaster(); + + SpellEntry const*spell = GetSpellProto(); + switch( spell->SpellFamilyName) + { + case SPELLFAMILY_ROGUE: + { + // Master of Subtlety + if (spell->Id==31666 && !apply) + { + m_target->RemoveAurasDueToSpell(31665); + break; + } + break; + } + case SPELLFAMILY_HUNTER: + { + // Explosive Shot + if (apply && !loading && caster) + m_modifier.m_amount +=caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 8 / 100; + break; + } + } + + m_isPeriodic = apply; +} +void Aura::HandlePeriodicHeal(bool apply, bool Real) +{ m_isPeriodic = apply; // For prevent double apply bonuses @@ -4018,18 +3994,17 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) if(!Real) return; - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - m_isPeriodic = apply; // For prevent double apply bonuses bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading()); - Unit *caster = GetCaster(); - // Custom damage calculation after - if (!apply || loading || !caster) + if (!apply || loading) + return; + + Unit *caster = GetCaster(); + if (!caster) return; switch (m_spellProto->SpellFamilyName) @@ -4204,25 +4179,21 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) void Aura::HandlePeriodicDamagePCT(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - m_isPeriodic = apply; } void Aura::HandlePeriodicLeech(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - m_isPeriodic = apply; } void Aura::HandlePeriodicManaLeech(bool apply, bool Real) { - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; + m_isPeriodic = apply; +} +void Aura::HandlePeriodicHealthFunnel(bool apply, bool Real) +{ m_isPeriodic = apply; } @@ -4467,117 +4438,47 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real) /********************************/ void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real) { - /* - Need additional checking for auras who reduce or increase healing, magic effect like Dumpen Magic, - so this aura not fully working. - */ - if(apply) - { - if(!m_target->isAlive()) - return; - - if((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && !m_target->IsSitState()) - m_target->SetStandState(PLAYER_STATE_SIT); - - if(m_periodicTimer <= 0) - { - m_periodicTimer += m_modifier.periodictime; - - if(m_target->GetHealth() < m_target->GetMaxHealth()) - { - // PeriodicTick can cast triggered spells with stats changes - PeriodicTick(); - } - } - } - m_isPeriodic = apply; } void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real) { - if((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && apply && !m_target->IsSitState()) - m_target->SetStandState(PLAYER_STATE_SIT); - if(apply) - { - if(m_modifier.periodictime == 0) - m_modifier.periodictime = 1000; - if(m_periodicTimer <= 0 && m_target->getPowerType() == POWER_MANA) - { - m_periodicTimer += m_modifier.periodictime; - - if(m_target->GetPower(POWER_MANA) < m_target->GetMaxPower(POWER_MANA)) - { - // PeriodicTick can cast triggered spells with stats changes - PeriodicTick(); - } - } - } + if(m_modifier.periodictime == 0) + m_modifier.periodictime = 1000; + m_periodicTimer = m_modifier.periodictime; m_isPeriodic = apply; } void Aura::HandleModRegen(bool apply, bool Real) // eating { - if(apply) - { - if(!m_target->isAlive()) - return; - - if ((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && !m_target->IsSitState()) - m_target->SetStandState(PLAYER_STATE_SIT); - - if(m_periodicTimer <= 0) - { - m_periodicTimer += 5000; - int32 gain = m_target->ModifyHealth(m_modifier.m_amount); - Unit *caster = GetCaster(); - if (caster) - { - SpellEntry const *spellProto = GetSpellProto(); - if (spellProto) - m_target->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, spellProto); - } - } - } + if(m_modifier.periodictime == 0) + m_modifier.periodictime = 5000; + m_periodicTimer = 5000; m_isPeriodic = apply; } void Aura::HandleModPowerRegen(bool apply, bool Real) // drinking { - if ((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && apply && !m_target->IsSitState()) - m_target->SetStandState(PLAYER_STATE_SIT); + if (!Real) + return; - if(apply && m_periodicTimer <= 0) + Powers pt = m_target->getPowerType(); + if(m_modifier.periodictime == 0) { - m_periodicTimer += 2000; + if (pt == POWER_RAGE) + m_modifier.periodictime = 1000; + else + m_modifier.periodictime = 2000; + } - Powers pt = m_target->getPowerType(); - if(int32(pt) != m_modifier.m_miscvalue) - return; + m_periodicTimer = 5000; - if ( GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED ) - { - // eating anim - m_target->HandleEmoteCommand(EMOTE_ONESHOT_EAT); - } - else if( GetId() == 20577 ) - { - // cannibalize anim - m_target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE); - } + if (m_target->GetTypeId() == TYPEID_PLAYER && m_modifier.m_miscvalue == POWER_MANA) + ((Player*)m_target)->UpdateManaRegen(); - // Warrior talent, gain 1 rage every 3 seconds while in combat - if(pt == POWER_RAGE && m_target->isInCombat()) - { - m_target->ModifyPower(pt, m_modifier.m_amount*10/17); - m_periodicTimer += 1000; - } - } m_isPeriodic = apply; - if (Real && m_target->GetTypeId() == TYPEID_PLAYER && m_modifier.m_miscvalue == POWER_MANA) - ((Player*)m_target)->UpdateManaRegen(); } void Aura::HandleModPowerRegenPCT(bool /*apply*/, bool Real) @@ -5481,14 +5382,6 @@ void Aura::CleanupTriggeredSpells() m_target->RemoveAurasDueToSpell(tSpellId); } -void Aura::HandleAuraPowerBurn(bool apply, bool Real) -{ - if (m_periodicTimer <= 0) - m_periodicTimer += m_modifier.periodictime; - - m_isPeriodic = apply; -} - void Aura::HandleSchoolAbsorb(bool apply, bool Real) { if(!Real) @@ -5687,6 +5580,7 @@ void Aura::PeriodicTick() break; } case SPELL_AURA_PERIODIC_LEECH: + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: { Unit *pCaster = GetCaster(); if(!pCaster) @@ -5699,7 +5593,7 @@ void Aura::PeriodicTick() pCaster->SpellHitResult(m_target,GetSpellProto(),false)!=SPELL_MISS_NONE) return; - // Check for immune (not use charges) + // Check for immune if(m_target->IsImmunedToDamage(GetSpellSchoolMask(GetSpellProto()))) return; @@ -6096,6 +5990,35 @@ void Aura::PeriodicTick() pCaster->DealSpellDamage(&damageInfo, true); break; } + case SPELL_AURA_MOD_REGEN: + { + int32 gain = m_target->ModifyHealth(m_modifier.m_amount); + if (Unit *caster = GetCaster()) + m_target->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto()); + break; + } + case SPELL_AURA_MOD_POWER_REGEN: + { + Powers pt = m_target->getPowerType(); + if(int32(pt) != m_modifier.m_miscvalue) + return; + + if ( GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED ) + { + // eating anim + m_target->HandleEmoteCommand(EMOTE_ONESHOT_EAT); + } + else if( GetId() == 20577 ) + { + // cannibalize anim + m_target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE); + } + + // Warrior talent, gain 1 rage every 3 seconds while in combat + if(pt == POWER_RAGE && m_target->isInCombat()) + m_target->ModifyPower(pt, m_modifier.m_amount*10/17); + break; + } // Here tick dummy auras case SPELL_AURA_PERIODIC_DUMMY: { @@ -6222,29 +6145,6 @@ void Aura::PeriodicDummyTick() // case 33208: break; // // Gossip NPC Periodic - Despawn // case 33209: break; - - // TODO: now its not periodic dummy - need move out from here - // Aspect of the Viper - case 34074: - { - if (m_target->GetTypeId() != TYPEID_PLAYER) - return; - // Should be manauser - if (m_target->getPowerType()!=POWER_MANA) - return; - if (!caster) - return; - // Regen amount is max (100% from spell) on 21% or less mana and min on 92.5% or greater mana (20% from spell) - int mana = m_target->GetPower(POWER_MANA); - int max_mana = m_target->GetMaxPower(POWER_MANA); - int32 base_regen = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, m_target); - float regen_pct = 1.20f - 1.1f * mana / max_mana; - if (regen_pct > 1.0f) regen_pct = 1.0f; - else if (regen_pct < 0.2f) regen_pct = 0.2f; - m_modifier.m_amount = int32 (base_regen * regen_pct); - ((Player*)m_target)->UpdateManaRegen(); - return; - } // // Steal Weapon // case 36207: break; // // Simon Game START timer, (DND) @@ -6470,11 +6370,13 @@ void Aura::PeriodicDummyTick() { if (!caster) return; - // Skip 0 tick + int32 damage = m_modifier.m_amount; + // Full damage to target at 0 tick if (m_duration > m_modifier.periodictime) + { + caster->CastCustomSpell(m_target, 53352, &damage, 0, 0, true, 0, this); return; - int32 damage = caster->CalculateSpellDamage(spell, GetEffIndex(), GetBasePoints(), m_target); - damage+=caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 8 / 100; + } damage/=4; caster->CastCustomSpell(m_target, 56298, &damage, 0, 0, true, 0, this); return; diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 9d680ff8db1..863d46e4a6a 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -150,6 +150,7 @@ class TRINITY_DLL_SPEC Aura void HandleModSpellHitChance(bool Apply, bool Real); void HandleAuraModScale(bool Apply, bool Real); void HandlePeriodicManaLeech(bool Apply, bool Real); + void HandlePeriodicHealthFunnel(bool apply, bool Real); void HandleModCastingSpeed(bool Apply, bool Real); void HandleAuraMounted(bool Apply, bool Real); void HandleWaterBreathing(bool Apply, bool Real); diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index a30dee9d67b..cd8468c4c7b 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -386,7 +386,7 @@ void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket) return; } - Creature* pet=ObjectAccessor::GetCreatureOrPet(*_player,guid); + Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid); if(!pet) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 471ff053550..b90bd733a6d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9559,6 +9559,8 @@ Unit* Creature::SelectHostilTarget() //threat list sorting etc. + if (!this->isAlive()) + return false; //This function only useful once AI has been initialized if (!AI()) return NULL; diff --git a/src/shared/Config/dotconfpp/dotconfpp.cpp b/src/shared/Config/dotconfpp/dotconfpp.cpp index 543e8acf1f4..c46b1fe6fb9 100644 --- a/src/shared/Config/dotconfpp/dotconfpp.cpp +++ b/src/shared/Config/dotconfpp/dotconfpp.cpp @@ -138,7 +138,7 @@ int DOTCONFDocument::cleanupLine(char * line) quoted = !quoted; ++line; continue; } - if(isspace(*line) && !quoted){ + if(isspace((unsigned char)*line) && !quoted){ *bg++ = 0; if(strlen(start)){ @@ -154,7 +154,7 @@ int DOTCONFDocument::cleanupLine(char * line) words.push_back(word); } start = bg; - while(isspace(*++line)) {} + while(isspace((unsigned char)*++line)) {} continue; } diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index 26028245e6e..9c3661ffbac 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -963,7 +963,8 @@ struct MapEntry return !IsDungeon() || MapID==209 || MapID==269 || MapID==309 || // TanarisInstance, CavernsOfTime, Zul'gurub MapID==509 || MapID==534 || MapID==560 || // AhnQiraj, HyjalPast, HillsbradPast - MapID==568 || MapID==615 || MapID==616; // ZulAman, Obsidian Sanctrum, Eye Of Eternity + MapID==568 || MapID==580 || MapID==615 || // ZulAman, Sunwell Plateau, Obsidian Sanctrum + MapID==616; // Eye Of Eternity } bool IsContinent() const diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 573cce31616..7f75b49b7ca 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7154" + #define REVISION_NR "7158" #endif // __REVISION_NR_H__ |