Skip to content

Commit b63e853

Browse files
committed
prepare merge
1 parent 6650ea7 commit b63e853

6 files changed

Lines changed: 102 additions & 42 deletions

File tree

sql/updates/world/3.3.5/2026_05_250_00_world.sql renamed to sql/updates/world/3.3.5/2026_07_16_00_world.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup`
1818
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ConditionStringValue1`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
1919
(15,1541,0,0,0,47,0,3628,10,0,'',0,0,0,'',"Group 0: Show Gossip Option 0 if player has taken quest 'You Are Rakh'likh, Demon'"),
2020
(15,1541,0,0,0,2,0,10757,1,0,'',0,0,0,'',"Group 0: Show Gossip Option 0 if player has item 'Ward of the Defiler'"),
21-
(15,1541,0,0,0,60,0,0,0,0,'',1,0,0,'',"Group 0: Show Gossip Option 0 if player is not in group"),
21+
(15,1541,0,0,0,60,0,0,0,0,'',0,0,0,'',"Group 0: Show Gossip Option 0 if player is not in group"),
2222

2323
(15,1541,1,0,0,47,0,3628,10,0,'',0,0,0,'',"Group 0: Show Gossip Option 1 if player has taken quest 'You Are Rakh'likh, Demon'"),
2424
(15,1541,1,0,0,2,0,10757,1,0,'',0,0,0,'',"Group 0: Show Gossip Option 1 if player has item 'Ward of the Defiler'"),
25-
(15,1541,1,0,0,60,0,0,0,0,'',0,0,0,'',"Group 0: Show Gossip Option 1 if player is in group");
25+
(15,1541,1,0,0,60,0,1,0,0,'',0,0,0,'',"Group 0: Show Gossip Option 1 if player is in group");
2626

27-
UPDATE `spell_script_names` SET `ScriptName` = 'spell_eastern_kingdoms_teleport_to_razelikh_group' WHERE `ScriptName` = 'spell_razelikh_teleport_group';
27+
UPDATE `spell_script_names` SET `ScriptName` = 'spell_blasted_lands_teleport_to_razelikh_group' WHERE `ScriptName` = 'spell_razelikh_teleport_group';

src/server/game/Conditions/ConditionMgr.cpp

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "DatabaseEnv.h"
2222
#include "GameEventMgr.h"
2323
#include "GameObject.h"
24+
#include "Group.h"
2425
#include "InstanceScript.h"
2526
#include "Log.h"
2627
#include "LootMgr.h"
@@ -127,8 +128,28 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
127128
{ "Private Object", false, false, false, false },
128129
{ "String ID", false, false, false, true },
129130
{ "Label", false, false, false, false },
131+
{ "Group status", true, false, false, false }
130132
};
131133

134+
static bool MeetsGroupStatusCondition(Player const* player, GroupStatusCondition status)
135+
{
136+
Group const* group = player->GetGroup();
137+
switch (status)
138+
{
139+
case GroupStatusCondition::NotInGroup:
140+
return group == nullptr;
141+
case GroupStatusCondition::InGroup:
142+
return group != nullptr;
143+
case GroupStatusCondition::InGroupButNotInRaid:
144+
return group && !group->isRaidGroup();
145+
case GroupStatusCondition::InRaid:
146+
return group && group->isRaidGroup();
147+
case GroupStatusCondition::NotInGroupOrNotInRaid:
148+
return !group || !group->isRaidGroup();
149+
}
150+
return false;
151+
}
152+
132153
// Checks if object meets the condition
133154
// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: SmartAI)
134155
bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
@@ -548,10 +569,10 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
548569
condMeets = go->HasStringId(ConditionStringValue1);
549570
break;
550571
}
551-
case CONDITION_GROUP:
572+
case CONDITION_GROUP_STATUS:
552573
{
553-
if (Player* player = object->ToPlayer())
554-
condMeets = player->GetGroup();
574+
if (Player const* player = object->ToPlayer())
575+
condMeets = MeetsGroupStatusCondition(player, GroupStatusCondition(ConditionValue1));
555576
break;
556577
}
557578
default:
@@ -756,7 +777,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
756777
case CONDITION_STRING_ID:
757778
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_GAMEOBJECT;
758779
break;
759-
case CONDITION_GROUP:
780+
case CONDITION_GROUP_STATUS:
760781
mask |= GRID_MAP_TYPE_MASK_PLAYER;
761782
break;
762783
default:
@@ -2410,12 +2431,18 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
24102431
return false;
24112432
}
24122433
break;
2434+
case CONDITION_GROUP_STATUS:
2435+
if (cond->ConditionValue1 > uint32(GroupStatusCondition::NotInGroupOrNotInRaid))
2436+
{
2437+
TC_LOG_ERROR("sql.sql", "{} has non invalid group status condition value1 ({}), skipped.", cond->ToString(true), cond->ConditionValue1);
2438+
return false;
2439+
}
2440+
break;
24132441
case CONDITION_IN_WATER:
24142442
case CONDITION_CHARMED:
24152443
case CONDITION_TAXI:
24162444
case CONDITION_GAMEMASTER:
24172445
case CONDITION_STRING_ID:
2418-
case CONDITION_GROUP:
24192446
default:
24202447
break;
24212448
case CONDITION_BATTLE_PET_COUNT:

src/server/game/Conditions/ConditionMgr.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ enum ConditionTypes
9595
CONDITION_PRIVATE_OBJECT = 57, // 0 0 0 true if entity is private object
9696
CONDITION_STRING_ID = 58,
9797
CONDITION_LABEL = 59, // only for master branch
98-
CONDITION_GROUP = 60, // 0 0 0 true if player is in group
98+
CONDITION_GROUP_STATUS = 60, // GroupStatus 0 0 true if player group status is (0 = not in group, 1 = in group, 2 = in group but not in raid, 3 = in raid group, 4 = not in group or not in raid)
9999
CONDITION_MAX
100100
};
101101

@@ -184,6 +184,15 @@ enum InstanceInfo
184184
INSTANCE_INFO_DATA64
185185
};
186186

187+
enum class GroupStatusCondition : uint32
188+
{
189+
NotInGroup = 0,
190+
InGroup = 1,
191+
InGroupButNotInRaid = 2,
192+
InRaid = 3,
193+
NotInGroupOrNotInRaid = 4
194+
};
195+
187196
enum MaxConditionTargets
188197
{
189198
MAX_CONDITION_TARGETS = 3

src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -200,36 +200,6 @@ class spell_eastern_kingdoms_thaumaturgy_channel : public AuraScript
200200
}
201201
};
202202

203-
/*######
204-
## Quest 3628: You Are Rakh'likh, Demon
205-
######*/
206-
207-
enum YouAreRakhlikhDemon
208-
{
209-
SPELL_TELEPORT_TO_RAZELIKH_GROUP = 27694
210-
};
211-
212-
// 27686 - Teleport to Razelikh (GROUP)
213-
class spell_eastern_kingdoms_teleport_to_razelikh_group : public SpellScript
214-
{
215-
PrepareSpellScript(spell_eastern_kingdoms_teleport_to_razelikh_group);
216-
217-
bool Validate(SpellInfo const* /*spellInfo*/) override
218-
{
219-
return ValidateSpellInfo({ SPELL_TELEPORT_TO_RAZELIKH_GROUP });
220-
}
221-
222-
void HandleScript(SpellEffIndex /*effIndex*/)
223-
{
224-
GetHitUnit()->CastSpell(nullptr, SPELL_TELEPORT_TO_RAZELIKH_GROUP, true);
225-
}
226-
227-
void Register() override
228-
{
229-
OnEffectHitTarget += SpellEffectFn(spell_eastern_kingdoms_teleport_to_razelikh_group::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
230-
}
231-
};
232-
233203
void AddSC_eastern_kingdoms()
234204
{
235205
RegisterSpellScript(spell_eastern_kingdoms_duskwither_spire_up);
@@ -239,5 +209,4 @@ void AddSC_eastern_kingdoms()
239209
RegisterSpellScript(spell_eastern_kingdoms_dead_scar_bombing_run);
240210
RegisterSpellScript(spell_eastern_kingdoms_dawnblade_attack);
241211
RegisterSpellScript(spell_eastern_kingdoms_thaumaturgy_channel);
242-
RegisterSpellScript(spell_eastern_kingdoms_teleport_to_razelikh_group);
243212
}

src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void AddSC_zulgurub();
177177
void AddSC_eastern_kingdoms();
178178
//void AddSC_alterac_mountains();
179179
//void AddSC_arathi_highlands();
180-
//void AddSC_blasted_lands();
180+
void AddSC_blasted_lands();
181181
void AddSC_duskwood();
182182
void AddSC_eastern_plaguelands();
183183
void AddSC_elwynn_forest();
@@ -358,7 +358,7 @@ void AddEasternKingdomsScripts()
358358
AddSC_eastern_kingdoms();
359359
//AddSC_alterac_mountains();
360360
//AddSC_arathi_highlands();
361-
//AddSC_blasted_lands();
361+
AddSC_blasted_lands();
362362
AddSC_duskwood();
363363
AddSC_eastern_plaguelands();
364364
AddSC_elwynn_forest();
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3+
*
4+
* This program is free software; you can redistribute it and/or modify it
5+
* under the terms of the GNU General Public License as published by the
6+
* Free Software Foundation; either version 2 of the License, or (at your
7+
* option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+
* more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include "ScriptMgr.h"
19+
#include "SpellScript.h"
20+
#include "Unit.h"
21+
22+
/*######
23+
## Quest 3628: You Are Rakh'likh, Demon
24+
######*/
25+
26+
enum YouAreRakhlikhDemon
27+
{
28+
SPELL_TELEPORT_TO_RAZELIKH_GROUP = 27694
29+
};
30+
31+
// 27686 - Teleport to Razelikh (GROUP)
32+
class spell_blasted_lands_teleport_to_razelikh_group : public SpellScript
33+
{
34+
PrepareSpellScript(spell_blasted_lands_teleport_to_razelikh_group);
35+
36+
bool Validate(SpellInfo const* /*spellInfo*/) override
37+
{
38+
return ValidateSpellInfo({ SPELL_TELEPORT_TO_RAZELIKH_GROUP });
39+
}
40+
41+
void HandleScript(SpellEffIndex /*effIndex*/)
42+
{
43+
GetHitUnit()->CastSpell(nullptr, SPELL_TELEPORT_TO_RAZELIKH_GROUP, true);
44+
}
45+
46+
void Register() override
47+
{
48+
OnEffectHitTarget += SpellEffectFn(spell_blasted_lands_teleport_to_razelikh_group::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
49+
}
50+
};
51+
52+
void AddSC_blasted_lands()
53+
{
54+
RegisterSpellScript(spell_blasted_lands_teleport_to_razelikh_group);
55+
}

0 commit comments

Comments
 (0)