Skip to content

Commit

Permalink
Closes #1201 Closes #571 Closes #699 Closes #695 Closes #992 Closes #976
Browse files Browse the repository at this point in the history
 Closes #629 Closes #413 Closes #1094 (#1436)

* Closes #1201

Closes #1201

* Closes #571

Closes #571

* Update updates.sql

* Closes #699

Closes #699

* Update updates.sql

* Update UnitManager.py

* Update GameObjectLootManager.py

* Update FearMovement.py

* Update FearMovement.py

* Update FearMovement.py

* Crushing blow.

* Update UnitManager.py

* Update AuraManager.py

* Specialization..

* Update ExtendedSpellData.py

* Update updates.sql

* Update QuestManager.py

* Update updates.sql

* Fix quest status display bug.

- Unavailable quest due race / class requirements / disabled  should no longer wrongfully display available in the future (gray symbol)

* Update QuestManager.py

* Update updates.sql

* Update updates.sql

* Update QuestHelpers.py

err

* Update ReadItemHandler.py

* CMSG_READ_ITEM

* Modify both UnitFlag and UnitState when possible.

- Fix ConfusedMovement not applying unit flag.

* Update UnitManager.py

* Update updates.sql

* Route all flag changes through setters.

* Update LootManager.py

* Update PlayerManager.py

* Remove gold by surrounding units gold mean.

* Remove second pass for loot generation. Left comment.

* Update updates.sql

* Update PlayerManager.py

* Update PlayerManager.py

* Update GameObjectLootManager.py

* Update UnitManager.py

* Update updates.sql
  • Loading branch information
devw4r authored Sep 11, 2024
1 parent a6df21b commit 2ecb62e
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 95 deletions.
8 changes: 0 additions & 8 deletions database/dbc/DbcDatabaseManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,6 @@ def spell_get_rank_by_id(spell_id):

return DbcDatabaseManager.SpellHolder.spell_get_rank_by_spell(spell)

@staticmethod
def spell_is_specialization(spell_id):
spell = DbcDatabaseManager.SpellHolder.spell_get_by_id(spell_id)
if not spell:
return False
# TODO: Find better way without using hardcoded name?
return 'Specialization' in spell.Name_enUS

@staticmethod
def spell_get_all():
dbc_db_session = SessionHolder()
Expand Down
84 changes: 84 additions & 0 deletions etc/databases/world/updates/updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,89 @@ begin not atomic

insert into applied_updates values ('040920241');
end if;

-- 04/09/2024 2
if (select count(*) from applied_updates where id='040920242') = 0 then
-- Grave Robber
UPDATE `creature_template` SET `display_id1` = '1287', `display_id2` = '1289' WHERE (`entry` = '218');
-- Report to Orgnil (805) should be turned in to Orgnil (3188)
UPDATE `creature_quest_finisher` SET `entry` = '3142' WHERE (`entry` = '3188') and (`quest` = '805');
-- XP 440
UPDATE `quest_template` SET `RewXP` = '440' WHERE (`entry` = '805');
-- Orgnil should start quest 823. (Master Gadrin)
UPDATE `creature_quest_starter` SET `entry` = '3142' WHERE (`entry` = '3188') and (`quest` = '823');
-- Should be turned in to Master Gadrin (3188)
UPDATE `creature_quest_finisher` SET `entry` = '3188' WHERE (`entry` = '3142') and (`quest` = '823');
-- Chain quests, and modify xp to 210.
UPDATE `quest_template` SET `NextQuestId` = '823' WHERE (`entry` = '805');
UPDATE `quest_template` SET `PrevQuestId` = '805', `RewXP` = '210' WHERE (`entry` = '823');
UPDATE `quest_template` SET `PrevQuestId` = '792', `NextQuestId` = '805' WHERE (`entry` = '794');
UPDATE `quest_template` SET `NextQuestInChain` = '823' WHERE (`entry` = '805');

-- 421 Prove Your Worth, 422 Arugal's Folly, 423 Arugal's Folly, 424 Arugal's Folly, 99 Arugal's Folly, 1014 Arugal Must Die
UPDATE `quest_template` SET `NextQuestInChain` = '1014' WHERE (`entry` = '99');
UPDATE `quest_template` SET `PrevQuestId` = '99' WHERE (`entry` = '1014');

-- Chest placement.
UPDATE `spawns_gameobjects` SET `spawn_positionX` = '-5603.735', `spawn_positionY` = '646.926', `spawn_positionZ` = '393.223' WHERE (`spawn_id` = '9940');

-- Gennia Runetotem - Placement.
-- https://archive.thealphaproject.eu/media/Alpha-Project-Archive/Images/Azeroth/Kalimdor/Mulgore/561843-534914_20040426_057.jpg
UPDATE `spawns_creatures` SET `position_x` = '-2291.692', `position_y` = '-457.035', `position_z` = '-5.927', `orientation` = '0.087' WHERE (`spawn_id` = '26903');
-- Narm Skychaser - Placement.
UPDATE `spawns_creatures` SET `position_x` = '-2278.957', `position_y` = '-448.956', `position_z` = '-5.027', `orientation` = '3.88' WHERE (`spawn_id` = '26906');
-- Harken Windtotem - Placement.
UPDATE `spawns_creatures` SET `position_x` = '-2278.524', `position_y` = '-464.750', `position_z` = '-5.92', `orientation` = '2.035' WHERE (`spawn_id` = '24798');
-- Burning Embers - Ignore
UPDATE `spawns_gameobjects` SET `ignored` = '1' WHERE (`spawn_id` = '20439');
UPDATE `spawns_gameobjects` SET `ignored` = '1' WHERE (`spawn_id` = '20468');
UPDATE `spawns_gameobjects` SET `ignored` = '1' WHERE (`spawn_id` = '20445');
-- Fix waypoints for Brave Wildrunner
UPDATE `creature_movement_template` SET `position_z` = '-9.811' WHERE (`entry` = '3222') and (`point` = '4');
UPDATE `creature_movement_template` SET `position_x` = '-2229.903', `position_y` = '-459.384', `position_z` = '-8.333' WHERE (`entry` = '3222') and (`point` = '34');
UPDATE `creature_movement_template` SET `position_x` = '-2244.761', `position_y` = '-485.080', `position_z` = '-6.249' WHERE (`entry` = '3222') and (`point` = '35');
UPDATE `creature_movement_template` SET `position_x` = '-2272.884', `position_y` = '-497.443', `position_z` = '-8.947' WHERE (`entry` = '3222') and (`point` = '36');
UPDATE `creature_movement_template` SET `position_x` = '-2318.375', `position_y` = '-509.266', `position_z` = '-9.314' WHERE (`entry` = '3222') and (`point` = '37');
UPDATE `creature_movement_template` SET `position_x` = '-2294.070', `position_y` = '-434.362', `position_z` = '-5.496' WHERE (`entry` = '3222') and (`point` = '40');
UPDATE `creature_movement_template` SET `position_x` = '-2306.613', `position_y` = '-417.435', `position_z` = '-8.294' WHERE (`entry` = '3222') and (`point` = '41');
UPDATE `creature_movement_template` SET `position_x` = '-2306.613', `position_y` = '-417.435', `position_z` = '-8.294' WHERE (`entry` = '3222') and (`point` = '42');
UPDATE `creature_movement_template` SET `position_x` = '-2306.613', `position_y` = '-417.435', `position_z` = '-8.294' WHERE (`entry` = '3222') and (`point` = '43');

-- Ignore quest A Lesson to Learn (Aquatic Form chain)
UPDATE `quest_template` SET `ignored` = '1' WHERE (`entry` = '27');
-- Ignore quest Finding the Source, invalid items, invalid spells.
UPDATE `quest_template` SET `ignored` = '1' WHERE (`entry` = '974');
-- Enable 'The Great Lift' elevators.
UPDATE `spawns_gameobjects` SET `ignored` = '0' WHERE (`spawn_id` = '16876');
UPDATE `spawns_gameobjects` SET `ignored` = '0' WHERE (`spawn_id` = '16874');
-- Food Crate Z.
UPDATE `spawns_gameobjects` SET `spawn_positionZ` = '-6.55' WHERE (`spawn_id` = '43044');
-- Fix chest state.
UPDATE `spawns_gameobjects` SET `spawn_state` = '1' WHERE (`spawn_id` = '60099');

-- Missing gold for chests.
UPDATE `gameobject_template` SET `mingold` = 267, `maxgold` = 267 WHERE `entry` IN (3714, 4095);
UPDATE `gameobject_template` SET `mingold` = 242, `maxgold` = 242 WHERE `entry` IN (3715, 105579);
UPDATE `gameobject_template` SET `mingold` = 30, `maxgold` = 75 WHERE `entry` IN (106318);
UPDATE `gameobject_template` SET `mingold` = 1879, `maxgold` = 1879 WHERE `entry` IN (131978, 153468);
UPDATE `gameobject_template` SET `mingold` = 401, `maxgold` = 791 WHERE `entry` IN (153451);
UPDATE `gameobject_template` SET `mingold` = 1628, `maxgold` = 2366 WHERE `entry` IN (153462, 153463);

-- Defias Traitor - Spawn time 7-9 minutes. (From 30 seconds)
-- Remove run flag, double the event time limit to 20 minutes.
-- https://crawler.thealphaproject.eu/mnt/crawler/media/Patch-Note/unofficial_beta_patchnotes.txt
UPDATE `spawns_creatures` SET `spawntimesecsmin` = '420', `spawntimesecsmax` = '540' WHERE (`spawn_id` = '90214');
DELETE FROM `quest_start_scripts` WHERE `id`=155;
INSERT INTO `quest_start_scripts` (`id`, `delay`, `priority`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES
(155, 0, 0, 61, 155, 1200, 0, 0, 0, 0, 0, 8, 0, 15502, 1019, 15501, 0, 0, 0, 0, 0, 'The Defias Brotherhood: Start Scripted Map Event'),
(155, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 'The Defias Brotherhood: The Defias Traitor - Say Text'),
(155, 0, 2, 4, 147, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Defias Brotherhood: The Defias Traitor - Remove Questgiver Flag'),
(155, 3, 4, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Defias Brotherhood: The Defias Traitor - Start Waypoints');

-- Chest placement.
UPDATE `spawns_gameobjects` SET `spawn_positionX` = '10720.001', `spawn_positionY` = '758.654', `spawn_positionZ` = '1322.234' WHERE (`spawn_id` = '49528');

insert into applied_updates values ('040920242');
end if;
end $
delimiter ;
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def __init__(self, object_mgr):

# override
def generate_money(self, requester):
money = randint(self.world_object.gobject_template.mingold, self.world_object.gobject_template.maxgold)
self.current_money = money
self.current_money = randint(self.world_object.gobject_template.mingold, self.world_object.gobject_template.maxgold)

# override
def generate_loot(self, requester):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def use_chest(self, player):
self.chest_object.set_state(GameObjectStates.GO_STATE_ACTIVE)

# Player kneel loot.
player.unit_flags |= UnitFlags.UNIT_FLAG_LOOTING
player.set_uint32(UnitFields.UNIT_FIELD_FLAGS, player.unit_flags)
player.set_unit_flag(UnitFlags.UNIT_FLAG_LOOTING, active=True)

# Generate loot if it's empty.
if not self.chest_object.loot_manager.has_loot():
Expand Down
4 changes: 4 additions & 0 deletions game/world/managers/objects/loot/LootManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def generate_loot_groups(self, loot_template):

return loot_groups

# There is evidence of chests offering the same item twice or two different items from the same group.
# The provided evidence is from later builds of the game (Not 0.5.3).
# https://github.com/The-Alpha-Project/alpha-core/issues/699
# Returns the final list of items available for looting.
def process_loot_groups(self, loot_groups, requester) -> list:
loot_item_result = []
Expand Down Expand Up @@ -93,6 +96,7 @@ def process_loot_group(self, group_id, group_loot_items: list, requester):

item_chance = abs(loot_item.ChanceOrQuestChance)
chance = item_chance if item_chance > 0 else split_group_chance

if current_roll < item_chance:
if loot_item.mincountOrRef < 0:
reference_loot_template = WorldDatabaseManager.ReferenceLootTemplateHolder\
Expand Down
21 changes: 21 additions & 0 deletions game/world/managers/objects/spell/ExtendedSpellData.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,27 @@ def get_position_in_front(caster_location):
return caster_location.get_point_in_radius_and_angle(2, 0)


class SpecializationTalents:
_SPECIALIZATION_SPELLS = {
2917, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347,
4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362,
4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 4377,
4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392,
4393, 4394, 4395, 4396, 4397, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449,
4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464,
4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479,
4480, 4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494,
4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4817, 4818, 4819, 4820, 4821, 4822,
4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837,
4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852,
4853, 4854, 4855, 4856, 4857, 4858
}

@staticmethod
def is_specialization_spell(spell_id):
return spell_id in SpecializationTalents._SPECIALIZATION_SPELLS


class ProfessionInfo:
_PROFESSION_SPELLS = {
129: (3273, 3274), # First Aid
Expand Down
3 changes: 3 additions & 0 deletions game/world/managers/objects/spell/SpellManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def load_spells(self):
for spell in RealmDatabaseManager.character_get_spells(self.caster.guid):
self.spells[spell.spell] = spell

def has_spell(self, spell_id):
return spell_id in self.spells

def can_learn_spell(self, spell_id):
if self.caster.get_type_id() != ObjectTypeIds.ID_PLAYER:
return False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def handle_mod_stalked(aura, effect_target, remove):

@staticmethod
def handle_mod_confuse(aura, effect_target, remove):
effect_target.set_unit_state(UnitStates.CONFUSED, not remove, aura.index)
effect_target.set_unit_flag(UnitFlags.UNIT_FLAG_CONFUSED, not remove, aura.index)
if not remove:
if effect_target.get_type_id() == ObjectTypeIds.ID_PLAYER:
effect_target.interrupt_looting()
Expand Down
2 changes: 1 addition & 1 deletion game/world/managers/objects/spell/aura/AuraManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _write_aura_flag_to_unit(self, aura, clear=False, is_refresh=False):
self.current_flags &= ~(0x9 << byte)

field_index = UnitFields.UNIT_FIELD_AURAFLAGS + (aura.index >> 3)
self.unit_mgr.set_uint32(field_index, self.current_flags, force=is_refresh)
self.unit_mgr.set_uint32(field_index, self.current_flags, force=is_refresh or clear)

def get_next_aura_index(self, aura) -> int:
if aura.passive:
Expand Down
Loading

0 comments on commit 2ecb62e

Please sign in to comment.