Skip to content

Commit

Permalink
Fixed server start
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkulya committed May 31, 2024
1 parent 254397a commit d438348
Show file tree
Hide file tree
Showing 209 changed files with 11,357 additions and 10,232 deletions.
12 changes: 0 additions & 12 deletions sql/Update/characters/characters_2024_02_12_23_12.sql

This file was deleted.

12 changes: 1 addition & 11 deletions src/server/game/Entities/Item/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ void Item::SaveToDB(SQLTransaction& trans)

stmt->setInt16 (++index, GetItemRandomPropertyId());
stmt->setUInt32(++index, GetDynamicUInt32Value(ITEM_DYNAMIC_MODIFIERS, ITEM_MODIFIER_INDEX_REFORGE));
stmt->setUInt32(++index, GetDynamicUInt32Value(ITEM_DYNAMIC_MODIFIERS, ITEM_MODIFIER_INDEX_TRANSMOGRIFICATION));
stmt->setUInt32(++index, GetDynamicUInt32Value(ITEM_DYNAMIC_MODIFIERS, ITEM_MODIFIER_INDEX_UPGRADE));
stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY));
stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME));
Expand All @@ -394,17 +395,6 @@ void Item::SaveToDB(SQLTransaction& trans)
trans->Append(stmt);
}

stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE_TRANSMOG);

This comment has been minimized.

Copy link
@Nightprince

Nightprince May 31, 2024

Contributor

Why did you revert it? What was problem?

This comment has been minimized.

Copy link
@alexkulya

alexkulya Jun 1, 2024

Author Owner

This change caused errors at startup.

This comment has been minimized.

Copy link
@Nightprince

Nightprince Jun 1, 2024

Contributor

what is your error?

This comment has been minimized.

Copy link
@ReyDonovan

ReyDonovan Jun 1, 2024

хватит издеваться над ядром, много сломали, минимум исправили, фикс лута сундоков вообще сломали

This comment has been minimized.

Copy link
@Nightprince

Nightprince Jun 1, 2024

Contributor

хватит издеваться над ядром, много сломали, минимум исправили, фикс лута сундоков вообще сломали

What does chest loot have to do with transmog? 😊

This comment has been minimized.

Copy link
@alexkulya

alexkulya Jun 1, 2024

Author Owner

хватит издеваться над ядром, много сломали, минимум исправили, фикс лута сундоков вообще сломали

Хорошо. Ещё разок объясню. У меня нет свободного времени 24/7 для добавления исправлений и обновлений. Поясняю. Коммит с сундуками отключает их хаковую реализацию анимации открытия, но лут никаким образом не ломает, но исправляет баг с открытием при повторном их спавне. Сегодня вечером я закрываю репозиторий, т.к. надоело выслушивать претензии. Добавляйте на здоровье исправления, которые работают на 100%.

stmt->setUInt32(0, guid);
trans->Append(stmt);

if (GetDynamicUInt32Value(ITEM_DYNAMIC_MODIFIERS, ITEM_MODIFIER_INDEX_TRANSMOGRIFICATION) != 0)
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_INSTANCE_TRANSMOG);
stmt->setUInt32(0, guid);
stmt->setUInt32(1, GetDynamicUInt32Value(ITEM_DYNAMIC_MODIFIERS, ITEM_MODIFIER_INDEX_TRANSMOGRIFICATION));
trans->Append(stmt);
}
break;
}
case ITEM_REMOVED:
Expand Down
4 changes: 0 additions & 4 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5343,10 +5343,6 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
stmt->setUInt32(0, guid);
trans->Append(stmt);

stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE_TRANSMOG_BY_OWNER);
stmt->setUInt32(0, guid);
trans->Append(stmt);

stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE_BY_OWNER);
stmt->setUInt32(0, guid);
trans->Append(stmt);
Expand Down
83 changes: 17 additions & 66 deletions src/server/game/Scripting/ScriptMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1241,88 +1241,39 @@ class ScriptMgr
};

template <class T>
struct atrigger_script : public SpellAreaTriggerScript
struct aura_script : SpellScriptLoader
{
atrigger_script(char const* name) : SpellAreaTriggerScript(name) { }
IAreaTrigger* GetInterface() const override { return new T(); }
aura_script(char const* name) : SpellScriptLoader(name) { }
AuraScript* GetAuraScript() const override { return new T(); }
};

template <class T>
struct spell_script_name : SpellScriptLoader
struct spell_script : SpellScriptLoader
{
spell_script_name(char const* name) : SpellScriptLoader(name) { }
spell_script(char const* name) : SpellScriptLoader(name) { }
SpellScript* GetSpellScript() const override { return new T(); }
};

template <class T>
struct aura_script_name : SpellScriptLoader
{
aura_script_name(char const* name) : SpellScriptLoader(name) { }
AuraScript* GetAuraScript() const override { return new T(); }
};

template <class S>
class GenericSpellScriptLoader : public SpellScriptLoader
{
public:
GenericSpellScriptLoader(char const* name) : SpellScriptLoader(name) { }
SpellScript* GetSpellScript() const { return new S(); }
};
#define register_spell_script(spell_script) new GenericSpellScriptLoader<spell_script>(#spell_script)

template <class A>
class GenericAuraScriptLoader : public SpellScriptLoader
{
public:
GenericAuraScriptLoader(char const* name) : SpellScriptLoader(name) { }
AuraScript* GetAuraScript() const { return new A(); }
};
#define register_aura_script(aura_script) new GenericAuraScriptLoader<aura_script>(#aura_script)

template <class S, class A>
class GenericSpellAndAuraScriptLoader : public SpellScriptLoader
{
public:
GenericSpellAndAuraScriptLoader(char const* name) : SpellScriptLoader(name) { }
SpellScript* GetSpellScript() const { return new S(); }
AuraScript* GetAuraScript() const { return new A(); }
};
#define register_spell_and_aura_script_pair(spell_script, aura_script) new GenericSpellAndAuraScriptLoader<spell_script, aura_script>(#spell_script)

template <class AI>
class GenericCreatureScript : public CreatureScript
{
public:
GenericCreatureScript(char const* name) : CreatureScript(name) { }
CreatureAI* GetAI(Creature* creature) const { return new AI(creature); }
};
#define register_creature_script(ai_name) new GenericCreatureScript<ai_name>(#ai_name)

template <class AI, AI*(*AIFactory)(Creature*)>
class FactoryCreatureScript : public CreatureScript
struct atrigger_script : public SpellAreaTriggerScript
{
public:
FactoryCreatureScript(char const* name) : CreatureScript(name) { }
CreatureAI* GetAI(Creature* creature) const { return AIFactory(creature); }
atrigger_script(char const* name) : SpellAreaTriggerScript(name) { }
IAreaTrigger* GetInterface() const override { return new T(); }
};
#define register_creature_script_with_factory(ai_name, factory_fn) new FactoryCreatureScript<ai_name, &factory_fn>(#ai_name)

template <class AI>
class GenericGameObjectScript : public GameObjectScript
template <class T>
struct creature_script: public CreatureScript
{
public:
GenericGameObjectScript(char const* name) : GameObjectScript(name) { }
GameObjectAI* GetAI(GameObject* go) const { return new AI(go); }
creature_script(char const* name) : CreatureScript(name) { }
CreatureAI* GetAI(Creature* creature) const override { return new T(creature); }
};
#define register_gameobject_script(ai_name) new GenericGameObjectScript<ai_name>(#ai_name)

template <class AI>
class GenericPetScript : public CreatureScript
// For derives from PetAI to prevent crashes on spawn without player owner
template <class T>
struct pet_script : public CreatureScript
{
public:
GenericPetScript(char const* name) : CreatureScript(name) { }
CreatureAI* GetAI(Creature* creature) const { return ScriptMgr::CanHavePetAI(creature) ? new AI(creature) : NULL; }
pet_script(char const* name) : CreatureScript(name) { }
CreatureAI* GetAI(Creature* creature) const override { return ScriptMgr::CanHavePetAI(creature) ? new T(creature) : nullptr; }
};
#define register_pet_script(ai_name) new GenericPetScript<ai_name>(#ai_name)

#endif
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/boss_balinda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,5 @@ struct boss_balinda : public ScriptedAI
void AddSC_boss_balinda()
{
new npc_water_elemental("npc_water_elemental");
register_creature_script(boss_balinda);
new creature_script<boss_balinda>("boss_balinda");
};
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/boss_drekthar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ struct boss_drekthar : public ScriptedAI

void AddSC_boss_drekthar()
{
register_creature_script(boss_drekthar);
new creature_script<boss_drekthar>("boss_drekthar");
}
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/boss_galvangar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ struct boss_galvangar : public ScriptedAI

void AddSC_boss_galvangar()
{
register_creature_script(boss_galvangar);
new creature_script<boss_galvangar>("boss_galvangar");
}
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/boss_vanndar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ struct boss_vanndar : public ScriptedAI

void AddSC_boss_vanndar()
{
register_creature_script(boss_vanndar);
new creature_script<boss_vanndar>("boss_vanndar");
}
6 changes: 3 additions & 3 deletions src/server/scripts/Battlegrounds/deepwind_gorge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class spell_dg_capturing : public SpellScript

void AddSC_deepwind_gorge()
{
register_creature_script(npc_dg_cart);
register_aura_script(spell_mine_cart);
register_spell_script(spell_dg_capturing);
new creature_script<npc_dg_cart>("npc_dg_cart");
new aura_script<spell_mine_cart>("spell_mine_cart");
new spell_script<spell_dg_capturing>("spell_dg_capturing");
}
16 changes: 8 additions & 8 deletions src/server/scripts/Battlegrounds/isle_of_conquest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ class spell_ioc_repair_cannon : public AuraScript

void AddSC_isle_of_conquest()
{
register_creature_script(boss_isle_of_conquest);
register_creature_script(npc_four_car_garage);
register_creature_script(npc_ioc_gunship_captain);
register_creature_script(npc_ioc_keep_cannon);
register_spell_script(spell_ioc_gunship_portal);
register_aura_script(spell_ioc_parachute_ic);
register_spell_script(spell_ioc_launch);
register_aura_script(spell_ioc_repair_cannon);
new creature_script<boss_isle_of_conquest>("boss_isle_of_conquest");
new creature_script<npc_four_car_garage>("npc_four_car_garage");
new creature_script<npc_ioc_gunship_captain>("npc_ioc_gunship_captain");
new creature_script<npc_ioc_keep_cannon>("npc_ioc_keep_cannon");
new spell_script<spell_ioc_gunship_portal>("spell_ioc_gunship_portal");
new aura_script<spell_ioc_parachute_ic>("spell_ioc_parachute_ic");
new spell_script<spell_ioc_launch>("spell_ioc_launch");
new aura_script<spell_ioc_repair_cannon>("spell_ioc_repair_cannon");
}
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/silvershard_mines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ class spell_defending_cart_arua : public SpellScript

void AddSC_silvershard_mines()
{
register_spell_script(spell_defending_cart_arua);
new spell_script<spell_defending_cart_arua>("spell_defending_cart_arua");
}
2 changes: 1 addition & 1 deletion src/server/scripts/Battlegrounds/temple_of_kotmogu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ class spell_orb_of_power : public AuraScript

void AddSC_temple_of_kotmogu()
{
register_aura_script(spell_orb_of_power);
new aura_script<spell_orb_of_power>("spell_orb_of_power");
}
Original file line number Diff line number Diff line change
Expand Up @@ -812,4 +812,4 @@ void AddSC_boss_halfus_wyrmbreaker()
new go_whelp_cage();
new spell_halfus_stone_grip();
new spell_halfus_fireball_barrage();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1535,22 +1535,22 @@ void AddSC_boss_theralion_and_valiona()
{
new boss_theralion();
new boss_valiona();
register_creature_script(npc_dazzling_destruction_stalker);
new creature_script<npc_dazzling_destruction_stalker>("npc_dazzling_destruction_stalker");
new npc_fabolous_flames();
new npc_valiona_twilight_flames();
new npc_unstable_twilight();
new npc_collapsing_twilight_portal();
//new npc_theralion_flight_target_stalker();
new npc_twilight_sentry();
new npc_twilight_rift();
register_creature_script(npc_theralion_twilight_fiend);
new creature_script<npc_theralion_twilight_fiend>("npc_theralion_twilight_fiend");
new spell_valiona_blackout();
new spell_valiona_twilight_meteorite();
new spell_valiona_twilight_flame_dmg_1();
new spell_valiona_twilight_flame_dmg_2();
register_spell_script(spell_theralion_dazzling_destruction);
new spell_script<spell_theralion_dazzling_destruction>("spell_theralion_dazzling_destruction");
new spell_theralion_dazzling_destruction_dmg();
new spell_valiona_devouring_flames_dmg();
new spell_twilight_shift_stack();
new spell_shifting_reality();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,6 @@ void AddSC_blackrock_caverns()
{
new npc_raz_the_crazed();
new blackrock_caverns_teleport();
register_spell_script(spell_aggro_nearby_target);
new spell_script<spell_aggro_nearby_target>("spell_aggro_nearby_target");
new AreaTrigger_at_second_bridge_blackrock_caverns();
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,5 @@ void AddSC_boss_ascendant_lord_obsidius()
{
new boss_ascendant_lord_obsidius();
new npc_shadow_of_obsidius();
register_aura_script(spell_crepuscular_veil);
new aura_script<spell_crepuscular_veil>("spell_crepuscular_veil");
}
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,5 @@ void AddSC_boss_corla_herald_of_twilight()
new boss_corla_herald_of_twilight();
new npc_twilight_zealot();
new npc_corla_netheressence_trigger();
register_aura_script(spell_twilight_evolution);
}
new aura_script<spell_twilight_evolution>("spell_twilight_evolution");
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@ class spell_superheated_quicksilver_armor : public AuraScript
void AddSC_boss_karsh_steelbender()
{
new boss_karsh_steelbender();
register_aura_script(spell_superheated_quicksilver_armor);
new aura_script<spell_superheated_quicksilver_armor>("spell_superheated_quicksilver_armor");
}
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ class spell_romogg_skullcracker_eff : public SpellScript
void AddSC_boss_romogg_bonecrusher()
{
new boss_romogg_bonecrusher();
register_spell_script(spell_chains_of_woe);
register_spell_script(spell_chains_of_woe_eff);
register_spell_script(spell_chains_of_woe_teleport);
register_spell_script(spell_skullcracker);
register_aura_script(spell_chains_of_woe_caster_aura);
register_spell_script(spell_romogg_skullcracker_eff);
new spell_script<spell_chains_of_woe>("spell_chains_of_woe");
new spell_script<spell_chains_of_woe_eff>("spell_chains_of_woe_eff");
new spell_script<spell_chains_of_woe_teleport>("spell_chains_of_woe_teleport");
new spell_script<spell_skullcracker>("spell_skullcracker");
new aura_script<spell_chains_of_woe_caster_aura>("spell_chains_of_woe_caster_aura");
new spell_script<spell_romogg_skullcracker_eff>("spell_romogg_skullcracker_eff");
}
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,5 @@ struct npc_brewmaiden : public ScriptedAI
void AddSC_boss_coren_direbrew()
{
new npc_coren_direbrew();
register_creature_script(npc_brewmaiden);
new creature_script<npc_brewmaiden>("npc_brewmaiden");
}
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,8 @@ void AddSC_boss_omnotron_defence_system()
new spell_omnotron_active_trigger();
new spell_magmatron_flamethrower();
new spell_magmatron_barrier();
register_spell_script(spell_omnotron_static_shock);
register_spell_script(spell_omnotron_arcane_annihilator);
register_spell_script(spell_omnotron_poison_bomb);
register_spell_script(spell_omnotron_flamethower);
}
new spell_script<spell_omnotron_static_shock>("spell_omnotron_static_shock");
new spell_script<spell_omnotron_arcane_annihilator>("spell_omnotron_arcane_annihilator");
new spell_script<spell_omnotron_poison_bomb>("spell_omnotron_poison_bomb");
new spell_script<spell_omnotron_flamethower>("spell_omnotron_flamethower");
}
Original file line number Diff line number Diff line change
Expand Up @@ -440,5 +440,5 @@ void AddSC_boss_ragnaros()
new boss_ragnaros();
new npc_son_of_flame();
new npc_majordomo_executus_ragnaros();
register_spell_script(spell_summon_ragnaros);
new spell_script<spell_summon_ragnaros>("spell_summon_ragnaros");
}
4 changes: 2 additions & 2 deletions src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class spell_deadmines_off_line : public SpellScriptLoader

void AddSC_deadmines()
{
register_creature_script(npc_deadmines_prototype_reaper);
new creature_script<npc_deadmines_prototype_reaper>("npc_deadmines_prototype_reaper");
new go_defias_cannon();
new go_deadmines_teleport();
new spell_deadmines_off_line();
}
}
24 changes: 12 additions & 12 deletions src/server/scripts/EasternKingdoms/GrimBatol/boss_erudax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,15 +605,15 @@ class spell_erudax_umbral_mending : public SpellScript
void AddSC_boss_erudax()
{
new boss_erudax();
register_creature_script(npc_erudax_faceless_corruptor);
register_creature_script(npc_alexstrasza_egg);
register_creature_script(npc_shadow_gale_stalker);
register_creature_script(npc_erudax_twilight_hatchling);

register_spell_script(spell_erudax_shadow_gale);
register_spell_script(spell_erudax_shadow_gale_launcher);
register_spell_script(spell_erudax_shield_of_nightmares);
register_spell_script(spell_erudax_twilight_corruption);
register_aura_script(spell_erudax_twilight_corruption_aura);
register_spell_script(spell_erudax_umbral_mending);
}
new creature_script<npc_erudax_faceless_corruptor>("npc_erudax_faceless_corruptor");
new creature_script<npc_alexstrasza_egg>("npc_alexstrasza_egg");
new creature_script<npc_shadow_gale_stalker>("npc_shadow_gale_stalker");
new creature_script<npc_erudax_twilight_hatchling>("npc_erudax_twilight_hatchling");

new spell_script<spell_erudax_shadow_gale>("spell_erudax_shadow_gale");
new spell_script<spell_erudax_shadow_gale_launcher>("spell_erudax_shadow_gale_launcher");
new spell_script<spell_erudax_shield_of_nightmares>("spell_erudax_shield_of_nightmares");
new spell_script<spell_erudax_twilight_corruption>("spell_erudax_twilight_corruption");
new aura_script<spell_erudax_twilight_corruption_aura>("spell_erudax_twilight_corruption_aura");
new spell_script<spell_erudax_umbral_mending>("spell_erudax_umbral_mending");
}
Loading

0 comments on commit d438348

Please sign in to comment.