mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
ad75d9680c
14 changed files with 122 additions and 34 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
|||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`cache_id` int(10) default '0',
|
||||
`required_9025_01_mangos_spell_proc_event` bit(1) default NULL
|
||||
`required_9034_01_mangos_spell_proc_event` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
@ -18529,7 +18529,8 @@ INSERT INTO `spell_proc_event` VALUES
|
|||
(64976, 0x00000000, 4, 0x00000001, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
(65661, 0x00000000, 15, 0x00400011, 0x00020004, 0x00000000, 0x00000010, 0x00000001, 0.000000, 100.000000,0),
|
||||
(64127, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
(67353, 0x00000000, 7, 0x00008000, 0x00100500, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
|
||||
(67353, 0x00000000, 7, 0x00008000, 0x00100500, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
(67667, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
|
||||
|
||||
/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
|
|
|||
5
sql/updates/9034_01_mangos_spell_proc_event.sql
Normal file
5
sql/updates/9034_01_mangos_spell_proc_event.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_9025_01_mangos_spell_proc_event required_9034_01_mangos_spell_proc_event bit;
|
||||
|
||||
DELETE FROM spell_proc_event WHERE entry = '67667';
|
||||
INSERT INTO spell_proc_event VALUES
|
||||
(67667, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
|
||||
|
|
@ -216,6 +216,7 @@ pkgdata_DATA = \
|
|||
9018_01_mangos_spell_bonus_data.sql \
|
||||
9019_01_mangos_spell_threat.sql \
|
||||
9025_01_mangos_spell_proc_event.sql \
|
||||
9034_01_mangos_spell_proc_event.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -412,4 +413,5 @@ EXTRA_DIST = \
|
|||
9018_01_mangos_spell_bonus_data.sql \
|
||||
9019_01_mangos_spell_threat.sql \
|
||||
9025_01_mangos_spell_proc_event.sql \
|
||||
9034_01_mangos_spell_proc_event.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -319,10 +319,18 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
return false;
|
||||
Map* map = source->GetMap();
|
||||
if (!map->Instanceable())
|
||||
return false;
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-instance map %u",
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
InstanceData* data = ((InstanceMap*)map)->GetInstanceData();
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map not have instance script",
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
return data->CheckAchievementCriteriaMeet(criteria_id, source, target, miscvalue1);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "InstanceData.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Map.h"
|
||||
#include "Log.h"
|
||||
|
||||
void InstanceData::SaveToDB()
|
||||
{
|
||||
|
|
@ -27,3 +28,10 @@ void InstanceData::SaveToDB()
|
|||
CharacterDatabase.escape_string(data);
|
||||
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%d'", data.c_str(), instance->GetInstanceId());
|
||||
}
|
||||
|
||||
bool InstanceData::CheckAchievementCriteriaMeet( uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/ )
|
||||
{
|
||||
sLog.outError("Achievement system call InstanceData::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
instance->GetId(),criteria_id);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -73,9 +73,6 @@ class MANGOS_DLL_SPEC InstanceData
|
|||
|
||||
// Achievement criteria additional requirements check
|
||||
// NOTE: not use this if same can be checked existed requirement types from AchievementCriteriaRequirementType
|
||||
virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0);
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4079,21 +4079,35 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
|
||||
// check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
|
||||
if(non_caster_target && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
|
||||
if(non_caster_target)
|
||||
{
|
||||
// check correctness positive/negative cast target (pet cast real check and cheating check)
|
||||
if(IsPositiveSpell(m_spellInfo->Id))
|
||||
// simple cases
|
||||
if (IsExplicitPositiveTarget(m_spellInfo->EffectImplicitTargetA[0]))
|
||||
{
|
||||
if(m_caster->IsHostileTo(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
else if (IsExplicitNegativeTarget(m_spellInfo->EffectImplicitTargetA[0]))
|
||||
{
|
||||
if(m_caster->IsFriendlyTo(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
// TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
|
||||
// check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
|
||||
else if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
|
||||
{
|
||||
// check correctness positive/negative cast target (pet cast real check and cheating check)
|
||||
if(IsPositiveSpell(m_spellInfo->Id))
|
||||
{
|
||||
if(m_caster->IsHostileTo(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_caster->IsFriendlyTo(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(IsPositiveSpell(m_spellInfo->Id))
|
||||
|
|
|
|||
|
|
@ -1381,15 +1381,16 @@ void Aura::HandleAddModifier(bool apply, bool Real)
|
|||
// Add custom charges for some mod aura
|
||||
switch (m_spellProto->Id)
|
||||
{
|
||||
case 17941: // Shadow Trance
|
||||
case 22008: // Netherwind Focus
|
||||
case 31834: // Light's Grace
|
||||
case 34754: // Clearcasting
|
||||
case 34936: // Backlash
|
||||
case 48108: // Hot Streak
|
||||
case 51124: // Killing Machine
|
||||
case 54741: // Firestarter
|
||||
case 57761: // Fireball!
|
||||
case 17941: // Shadow Trance
|
||||
case 22008: // Netherwind Focus
|
||||
case 31834: // Light's Grace
|
||||
case 34754: // Clearcasting
|
||||
case 34936: // Backlash
|
||||
case 44401: // Missile Barrage
|
||||
case 48108: // Hot Streak
|
||||
case 51124: // Killing Machine
|
||||
case 54741: // Firestarter
|
||||
case 57761: // Fireball!
|
||||
SetAuraCharges(1);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2190,6 +2191,14 @@ void Aura::TriggerSpell()
|
|||
// original caster must be target (beacon)
|
||||
target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetGUID());
|
||||
return;
|
||||
// Rapid Recuperation (triggered energize have baspioints == 0)
|
||||
case 56654:
|
||||
case 58882:
|
||||
{
|
||||
int32 mana = m_target->GetMaxPower(POWER_MANA) * m_modifier.m_amount / 100;
|
||||
target->CastCustomSpell(target, trigger_spell_id, &mana, NULL, NULL, true, NULL, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -365,16 +365,12 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SPELLFAMILY_MAGE:
|
||||
{
|
||||
// Arcane Blast
|
||||
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000))
|
||||
{
|
||||
m_caster->CastSpell(m_caster, 36032, true);
|
||||
}
|
||||
// remove Arcane Blast buffs at any non-Arcane Blast arcane damage spell.
|
||||
// NOTE: it removed at hit instead cast because currently spell done-damage calculated at hit instead cast
|
||||
if ((m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_ARCANE) && !(m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000)))
|
||||
m_caster->RemoveAurasDueToSpell(36032); // Arcane Blast buff
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
{
|
||||
// Bloodthirst
|
||||
|
|
@ -475,7 +471,8 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
// found Immolate or Shadowflame
|
||||
if (aura)
|
||||
{
|
||||
int32 damagetick = aura->GetModifier()->m_amount;
|
||||
// DoT not have applied spell bonuses in m_amount
|
||||
int32 damagetick = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellProto(), aura->GetModifier()->m_amount, DOT);
|
||||
damage += damagetick * 4;
|
||||
|
||||
// Glyph of Conflagrate
|
||||
|
|
|
|||
|
|
@ -426,6 +426,40 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IsExplicitPositiveTarget(uint32 targetA)
|
||||
{
|
||||
// positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_SELF:
|
||||
case TARGET_SINGLE_FRIEND:
|
||||
case TARGET_SINGLE_PARTY:
|
||||
case TARGET_CHAIN_HEAL:
|
||||
case TARGET_SINGLE_FRIEND_2:
|
||||
case TARGET_AREAEFFECT_PARTY_AND_CLASS:
|
||||
case TARGET_SELF2:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsExplicitNegativeTarget(uint32 targetA)
|
||||
{
|
||||
// non-positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_CHAIN_DAMAGE:
|
||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||
case TARGET_SINGLE_ENEMY:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
{
|
||||
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
|
||||
|
|
|
|||
|
|
@ -220,6 +220,9 @@ bool IsPositiveSpell(uint32 spellId);
|
|||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex);
|
||||
bool IsPositiveTarget(uint32 targetA, uint32 targetB);
|
||||
|
||||
bool IsExplicitPositiveTarget(uint32 targetA);
|
||||
bool IsExplicitNegativeTarget(uint32 targetA);
|
||||
|
||||
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
|
||||
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2);
|
||||
|
||||
|
|
|
|||
|
|
@ -5965,8 +5965,18 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
|
|||
// This effect only from Rapid Killing (mana regen)
|
||||
if (!(procSpell->SpellFamilyFlags & UI64LIT(0x0100000000000000)))
|
||||
return false;
|
||||
triggered_spell_id = 56654;
|
||||
|
||||
target = this;
|
||||
|
||||
switch(dummySpell->Id)
|
||||
{
|
||||
case 53228: // Rank 1
|
||||
triggered_spell_id = 56654;
|
||||
break;
|
||||
case 53232: // Rank 2
|
||||
triggered_spell_id = 58882;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9026"
|
||||
#define REVISION_NR "9035"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills"
|
||||
#define REVISION_DB_MANGOS "required_9025_01_mangos_spell_proc_event"
|
||||
#define REVISION_DB_MANGOS "required_9034_01_mangos_spell_proc_event"
|
||||
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue