From 6820ca8bdae4fabcc09b1df6fc75852c9c6ba1d3 Mon Sep 17 00:00:00 2001 From: Ric101 Date: Sat, 25 May 2013 07:51:23 +0100 Subject: Core/Conditions: Implement CONDITION_CREATURE_TYPE - 24 --- src/server/game/Conditions/ConditionMgr.cpp | 18 +++++++++++++++--- src/server/game/Conditions/ConditionMgr.h | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 67c81b35065..d89b885af42 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -317,6 +317,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = unit->HasUnitState(ConditionValue1); break; } + case CONDITION_CREATURE_TYPE: + { + if (Creature* creature = object->ToCreature()) + condMeets = creature->GetCreatureTemplate()->type == ConditionValue1; + break; + } default: condMeets = false; break; @@ -1988,9 +1994,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } break; } - case CONDITION_UNUSED_24: - TC_LOG_ERROR(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring"); - return false; + case CONDITION_CREATURE_TYPE: + { + if (!cond->ConditionValue1 || cond->ConditionValue1 > CREATURE_TYPE_GAS_CLOUD) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureType condition has non existing CreatureType in value1 (%u), skipped", cond->ConditionValue1); + return false; + } + break; + } default: break; } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index b49626747a6..8ef085d2d3c 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -57,7 +57,7 @@ enum ConditionTypes CONDITION_UNIT_STATE = 21, // unitState 0 0 true if unit has unitState CONDITION_MAPID = 22, // map_id 0 0 true if in map_id CONDITION_AREAID = 23, // area_id 0 0 true if in area_id - CONDITION_UNUSED_24 = 24, // + CONDITION_CREATURE_TYPE = 24, // cinfo.type 0 0 true if creature_template.type = value1 CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement) -- cgit v1.2.3 From 6fe47e7fccbb7e0cd0eee5ec721b06afe2201524 Mon Sep 17 00:00:00 2001 From: Ric101 Date: Sat, 25 May 2013 08:57:49 +0100 Subject: Core/Conditions: Missing grid search support for CONDITION_CREATURE_TYPE --- src/server/game/Conditions/ConditionMgr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index d89b885af42..6cde8bcbcb4 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -484,6 +484,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_UNIT_STATE: mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_CREATURE_TYPE: + mask |= GRID_MAP_TYPE_MASK_CREATURE; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; -- cgit v1.2.3 From 0d0baf004d58f5752f3ec3e0341d6e2cbbc8bd04 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Tue, 30 Jul 2013 15:46:56 +0200 Subject: Scripts/DrakTharonKeep: fix copy paste fail Closes #10402 --- .../Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index ed7647be89c..99a4ce77623 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -96,13 +96,13 @@ class instance_drak_tharon_keep : public InstanceMapScript float z = creature->GetPositionZ(); if (x < -374.0f && x > -379.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) - NovosCrystalGUIDs[0] = creature->GetGUID(); + NovosSummonerGUIDs[0] = creature->GetGUID(); else if (x < -379.0f && x > -385.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) - NovosCrystalGUIDs[1] = creature->GetGUID(); + NovosSummonerGUIDs[1] = creature->GetGUID(); else if (x < -374.0f && x > -385.0f && y > -827.0f && y < -820.0f && z < 60.0f && z > 58.0f) - NovosCrystalGUIDs[2] = creature->GetGUID(); + NovosSummonerGUIDs[2] = creature->GetGUID(); else if (x < -338.0f && x > -344.0f && y > -727.0f && y < 721.0f && z < 30.0f && z > 26.0f) - NovosCrystalGUIDs[3] = creature->GetGUID(); + NovosSummonerGUIDs[3] = creature->GetGUID(); } uint64 GetData64(uint32 type) const OVERRIDE -- cgit v1.2.3 From a7d876e8b570f023db3bf8903f04d251445b8dc1 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 30 Jul 2013 15:34:38 +0100 Subject: Config: Change ProcessPriority default to 0 (Normal) On Linux, superuser (root) is required to set a process high priority and we shouldn't force that. (It's already set to 0 (Normal) in worldserver\Master.cpp and authserver\Main.cpp) --- src/server/authserver/authserver.conf.dist | 8 ++++---- src/server/worldserver/worldserver.conf.dist | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/server') diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 0a50601f86d..3c811eda3b3 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -82,11 +82,11 @@ UseProcessors = 0 # # ProcessPriority # Description: Process priority setting for Windows and Linux based systems. -# Details: On Linux, a nice value of -15 is used. On Windows, process is set to HIGH class. -# Default: 1 - (High) -# 0 - (Normal) +# Details: On Linux, a nice value of -15 is used. (requires superuser). On Windows, process is set to HIGH class. +# Default: 0 - (Normal) +# 1 - (High) -ProcessPriority = 1 +ProcessPriority = 0 # # RealmsStateUpdateDelay diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index aac04fe9337..c4e19e851b3 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -160,11 +160,11 @@ UseProcessors = 0 # # ProcessPriority # Description: Process priority setting for Windows and Linux based systems. -# Details: On Linux, a nice value of -15 is used. On Windows, process is set to HIGH class. -# Default: 1 - (High) -# 0 - (Normal) +# Details: On Linux, a nice value of -15 is used. (requires superuser). On Windows, process is set to HIGH class. +# Default: 0 - (Normal) +# 1 - (High) -ProcessPriority = 1 +ProcessPriority = 0 # # Compression -- cgit v1.2.3 From bab04cc5f806c2dd42df561f5da4013ab95a51de Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 30 Jul 2013 23:57:04 +0200 Subject: Core/Spells: Fix try for logic fail in 4ba3c2e51df0485449a4bd01f162faa719334be9 --- .../2013_07_31_00_world_spell_script_names.sql | 4 ++ .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 59 ++++++++++++++++++++++ src/server/scripts/Spells/spell_generic.cpp | 32 ------------ 3 files changed, 63 insertions(+), 32 deletions(-) create mode 100644 sql/updates/world/2013_07_31_00_world_spell_script_names.sql (limited to 'src/server') diff --git a/sql/updates/world/2013_07_31_00_world_spell_script_names.sql b/sql/updates/world/2013_07_31_00_world_spell_script_names.sql new file mode 100644 index 00000000000..27779d0da45 --- /dev/null +++ b/sql/updates/world/2013_07_31_00_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (50341,50344); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(50341, 'spell_oculus_touch_the_nightmare'), +(50344, 'spell_oculus_dream_funnel'); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index e5f8cce6c46..e6969d1f519 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -520,6 +520,63 @@ public: } }; + +class spell_oculus_touch_the_nightmare : public SpellScriptLoader +{ + public: + spell_oculus_touch_the_nightmare() : SpellScriptLoader("spell_oculus_touch_the_nightmare") { } + + class spell_oculus_touch_the_nightmare_SpellScript : public SpellScript + { + PrepareSpellScript(spell_oculus_touch_the_nightmare_SpellScript); + + void HandleDamageCalc(SpellEffIndex /*effIndex*/) + { + SetHitDamage(int32(GetCaster()->CountPctFromMaxHealth(30))); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_oculus_touch_the_nightmare_SpellScript::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_oculus_touch_the_nightmare_SpellScript(); + } +}; + +class spell_oculus_dream_funnel: public SpellScriptLoader +{ + public: + spell_oculus_dream_funnel() : SpellScriptLoader("spell_oculus_dream_funnel") { } + + class spell_oculus_dream_funnel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_oculus_dream_funnel_AuraScript); + + void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + if (Unit* caster = GetCaster()) + amount = int32(caster->CountPctFromMaxHealth(5)); + + canBeRecalculated = false; + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_oculus_dream_funnel_AuraScript(); + } +}; + void AddSC_oculus() { new npc_verdisa_beglaristrasz_eternos(); @@ -527,4 +584,6 @@ void AddSC_oculus() new npc_ruby_emerald_amber_drake(); new spell_gen_stop_time(); new spell_call_ruby_emerald_amber_drake(); + new spell_oculus_touch_the_nightmare(); + new spell_oculus_dream_funnel(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 13a19ca5b23..2e6594714c9 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1296,36 +1296,6 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader } }; -class spell_gen_dream_funnel: public SpellScriptLoader -{ - public: - spell_gen_dream_funnel() : SpellScriptLoader("spell_gen_dream_funnel") { } - - class spell_gen_dream_funnel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_dream_funnel_AuraScript); - - void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) - { - if (GetCaster()) - amount = GetCaster()->GetMaxHealth() * 0.05f; - - canBeRecalculated = false; - } - - void Register() OVERRIDE - { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_gen_dream_funnel_AuraScript(); - } -}; - class spell_gen_ds_flush_knockback : public SpellScriptLoader { public: @@ -3679,7 +3649,6 @@ void AddSC_generic_spell_scripts() new spell_gen_clone_weapon(); new spell_gen_clone_weapon_aura(); new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); - new spell_gen_count_pct_from_max_hp("spell_gen_30pct_count_pct_from_max_hp", 30); new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); new spell_gen_create_lance(); new spell_gen_creature_permanent_feign_death(); @@ -3689,7 +3658,6 @@ void AddSC_generic_spell_scripts() new spell_gen_defend(); new spell_gen_despawn_self(); new spell_gen_divine_storm_cd_reset(); - new spell_gen_dream_funnel(); new spell_gen_ds_flush_knockback(); new spell_gen_dummy_trigger(); new spell_gen_dungeon_credit(); -- cgit v1.2.3 From f04217300c13586faef25fbf1804272f28313eae Mon Sep 17 00:00:00 2001 From: joschiwald Date: Wed, 31 Jul 2013 11:07:58 +0200 Subject: Core/Battleground: fix type mismatch Ref #10320 --- src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Battlegrounds/Battleground.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index ca9f8f5891b..bd8db17b025 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1425,7 +1425,7 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid) } } -void Battleground::RelocateDeadPlayers(uint32 queueIndex) +void Battleground::RelocateDeadPlayers(uint64 queueIndex) { // Those who are waiting to resurrect at this node are taken to the closest own node's graveyard std::vector& ghostList = m_ReviveQueue[queueIndex]; diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 8bcd5d8683c..52f86b98b79 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -376,7 +376,7 @@ class Battleground void RemovePlayerFromResurrectQueue(uint64 player_guid); /// Relocate all players in ReviveQueue to the closest graveyard - void RelocateDeadPlayers(uint32 queueIndex); + void RelocateDeadPlayers(uint64 queueIndex); void StartBattleground(); -- cgit v1.2.3