Reconstruction des customs detruits par git clean : loot packs (8 ScriptName item) + raciaux worgen (quetes 14222/14375)
Ces fichiers n avaient jamais ete commites. Regle : tout custom est desormais tracke. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* SylvaniaCore : packs d'equipement « loot-driven » (reconstruit 23/07/2026).
|
||||
* Des items conteneurs (Baleful/Dauntless etc.) n'ouvraient aucun loot au clic :
|
||||
* a l'utilisation, on deverse leur loot template d'item puis on consomme l'objet.
|
||||
* Bindings DB : item_script_names (8 ScriptName loot_item_*).
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Item.h"
|
||||
#include "LootMgr.h"
|
||||
|
||||
class loot_item_pack_base : public ItemScript
|
||||
{
|
||||
public:
|
||||
loot_item_pack_base(char const* name) : ItemScript(name) { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
uint32 entry = item->GetEntry();
|
||||
player->AutoStoreLoot(entry, LootTemplates_Item, true);
|
||||
player->DestroyItemCount(entry, 1, true);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#define REGISTER_LOOT_PACK(name) new loot_item_pack_base(#name)
|
||||
|
||||
void AddSC_custom_loot_packs()
|
||||
{
|
||||
REGISTER_LOOT_PACK(loot_item_generic_pack);
|
||||
REGISTER_LOOT_PACK(loot_item_leggings_of_the_foregone);
|
||||
REGISTER_LOOT_PACK(loot_item_gloves_of_the_foregone);
|
||||
REGISTER_LOOT_PACK(loot_item_shoulders_of_the_foreseen);
|
||||
REGISTER_LOOT_PACK(loot_item_cloak_of_the_foreseen);
|
||||
REGISTER_LOOT_PACK(loot_item_chest_of_the_foregone);
|
||||
REGISTER_LOOT_PACK(loot_item_unsullied_plate_helmet);
|
||||
REGISTER_LOOT_PACK(loot_item_champion_equipment_147432);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* SylvaniaCore : raciaux worgen a la validation des quetes de Gilneas
|
||||
* (reconstruit 23/07/2026). Le gate Blizzlike vit dans Player::AddSpell
|
||||
* (68992 Sombre Course <- quete 14222, 68996 Deux Formes <- quete 14375) ;
|
||||
* ce script apprend le sort des que la quete correspondante est rendue,
|
||||
* sans attendre un relog ou une montee de niveau.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum WorgenRacials
|
||||
{
|
||||
SPELL_DARKFLIGHT = 68992,
|
||||
SPELL_TWO_FORMS = 68996,
|
||||
QUEST_DARKFLIGHT = 14222,
|
||||
QUEST_TWO_FORMS = 14375,
|
||||
RACE_WORGEN_ID = 22,
|
||||
};
|
||||
|
||||
class custom_worgen_racials : public PlayerScript
|
||||
{
|
||||
public:
|
||||
custom_worgen_racials() : PlayerScript("custom_worgen_racials") { }
|
||||
|
||||
void OnQuestStatusChange(Player* player, uint32 questId) override
|
||||
{
|
||||
if (player->getRace() != RACE_WORGEN_ID)
|
||||
return;
|
||||
|
||||
if (questId == QUEST_DARKFLIGHT && player->GetQuestRewardStatus(QUEST_DARKFLIGHT) && !player->HasSpell(SPELL_DARKFLIGHT))
|
||||
player->LearnSpell(SPELL_DARKFLIGHT, false);
|
||||
if (questId == QUEST_TWO_FORMS && player->GetQuestRewardStatus(QUEST_TWO_FORMS) && !player->HasSpell(SPELL_TWO_FORMS))
|
||||
player->LearnSpell(SPELL_TWO_FORMS, false);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_custom_worgen_racials()
|
||||
{
|
||||
new custom_worgen_racials();
|
||||
}
|
||||
Reference in New Issue
Block a user