updated for mythic changes

This commit is contained in:
2025-11-21 18:53:14 -05:00
parent 3404bdc1d5
commit dcbffdf161
3 changed files with 170 additions and 164 deletions

View File

@@ -1,166 +1,149 @@
const creatures = {};
const creatureCombat = {};
const allCreatures =
[
{
"entry": 12099,
"rank": 1,
"name": "Firesworn"
},
{
"entry": 11669,
"rank": 1,
"name": "Flame Imp"
},
{
"entry": 12118,
"rank": 3,
"name": "Lucifron"
},
{
"entry": 12119,
"rank": 1,
"name": "Flamewaker Protector"
},
{
"entry": 12264,
"rank": 3,
"name": "Shazzrah"
},
{
"entry": 12057,
"rank": 3,
"name": "Garr"
},
{
"entry": 11671,
"rank": 1,
"name": "Core Hound"
},
{
"entry": 12056,
"rank": 3,
"name": "Baron Geddon"
},
{
"entry": 12101,
"rank": 1,
"name": "Lava Surger"
},
{
"entry": 11673,
"rank": 1,
"name": "Ancient Core Hound"
},
{
"entry": 12098,
"rank": 3,
"name": "Sulfuron Harbinger"
},
{
"entry": 11662,
"rank": 1,
"name": "Flamewaker Priest"
},
{
"entry": 11982,
"rank": 3,
"name": "Magmadar"
},
{
"entry": 11988,
"rank": 3,
"name": "Golemagg the Incinerator"
},
{
"entry": 11672,
"rank": 1,
"name": "Core Rager"
},
{
"entry": 11659,
"rank": 1,
"name": "Molten Destroyer"
},
{
"entry": 11658,
"rank": 1,
"name": "Molten Giant"
},
{
"entry": 11668,
"rank": 1,
"name": "Firelord"
},
{
"entry": 11666,
"rank": 1,
"name": "Firewalker"
},
{
"entry": 12100,
"rank": 1,
"name": "Lava Reaver"
},
{
"entry": 11667,
"rank": 1,
"name": "Flameguard"
},
{
"entry": 11665,
"rank": 1,
"name": "Lava Annihilator"
},
{
"entry": 12076,
"rank": 1,
"name": "Lava Elemental"
},
{
"entry": 12259,
"rank": 3,
"name": "Gehennas"
},
{
"entry": 11661,
"rank": 1,
"name": "Flamewaker"
}
]
// const creatures = {};
// const creatureCombat = {};
// // const allCreatures =
// // [
// // {
// // "entry": 12099,
// // "rank": 1,
// // "name": "Firesworn"
// // },
// // {
// // "entry": 11669,
// // "rank": 1,
// // "name": "Flame Imp"
// // },
// // {
// // "entry": 12118,
// // "rank": 3,
// // "name": "Lucifron"
// // },
// // {
// // "entry": 12119,
// // "rank": 1,
// // "name": "Flamewaker Protector"
// // },
// // {
// // "entry": 12264,
// // "rank": 3,
// // "name": "Shazzrah"
// // },
// // {
// // "entry": 12057,
// // "rank": 3,
// // "name": "Garr"
// // },
// // {
// // "entry": 11671,
// // "rank": 1,
// // "name": "Core Hound"
// // },
// // {
// // "entry": 12056,
// // "rank": 3,
// // "name": "Baron Geddon"
// // },
// // {
// // "entry": 12101,
// // "rank": 1,
// // "name": "Lava Surger"
// // },
// // {
// // "entry": 11673,
// // "rank": 1,
// // "name": "Ancient Core Hound"
// // },
// // {
// // "entry": 12098,
// // "rank": 3,
// // "name": "Sulfuron Harbinger"
// // },
// // {
// // "entry": 11662,
// // "rank": 1,
// // "name": "Flamewaker Priest"
// // },
// // {
// // "entry": 11982,
// // "rank": 3,
// // "name": "Magmadar"
// // },
// // {
// // "entry": 11988,
// // "rank": 3,
// // "name": "Golemagg the Incinerator"
// // },
// // {
// // "entry": 11672,
// // "rank": 1,
// // "name": "Core Rager"
// // },
// // {
// // "entry": 11659,
// // "rank": 1,
// // "name": "Molten Destroyer"
// // },
// // {
// // "entry": 11658,
// // "rank": 1,
// // "name": "Molten Giant"
// // },
// // {
// // "entry": 11668,
// // "rank": 1,
// // "name": "Firelord"
// // },
// // {
// // "entry": 11666,
// // "rank": 1,
// // "name": "Firewalker"
// // },
// // {
// // "entry": 12100,
// // "rank": 1,
// // "name": "Lava Reaver"
// // },
// // {
// // "entry": 11667,
// // "rank": 1,
// // "name": "Flameguard"
// // },
// // {
// // "entry": 11665,
// // "rank": 1,
// // "name": "Lava Annihilator"
// // },
// // {
// // "entry": 12076,
// // "rank": 1,
// // "name": "Lava Elemental"
// // },
// // {
// // "entry": 12259,
// // "rank": 3,
// // "name": "Gehennas"
// // },
// // {
// // "entry": 11661,
// // "rank": 1,
// // "name": "Flamewaker"
// // }
// // ]
// Every time the core hound respawns it needs to have 20% health reduction
const weakenCoreHounds: creature_event_on_spawn = (event: number, creature: Creature): boolean => {
if(!creatures[creature.GetGUID()]) {
creatures[creature.GetGUID()] = 1;
} else {
creatures[creature.GetGUID()]++;
}
// // Every time the core hound respawns it needs to have 20% health reduction
// // const weakenCoreHounds: creature_event_on_spawn = (event: number, creature: Creature): boolean => {
// // if(!creatures[creature.GetGUID()]) {
// // creatures[creature.GetGUID()] = 1;
// // } else {
// // creatures[creature.GetGUID()]++;
// // }
if(creatures[creature.GetGUID()] < 5 && creatures[creature.GetGUID()] > 1) {
creature.SetHealth(creature.GetMaxHealth() * 0.8);
}
// // if(creatures[creature.GetGUID()] < 5 && creatures[creature.GetGUID()] > 1) {
// // creature.SetHealth(creature.GetMaxHealth() * 0.8);
// // }
return false; // return true to stop normal action
};
// // return false; // return true to stop normal action
// // };
RegisterCreatureEvent(11669, CreatureEvents.CREATURE_EVENT_ON_SPAWN, (...args) => weakenCoreHounds(...args));
// // RegisterCreatureEvent(11671, CreatureEvents.CREATURE_EVENT_ON_SPAWN, (...args) => weakenCoreHounds(...args));
const flameDamage: creature_event_on_enter_combat = (event: number, creature: Creature, target: Unit): boolean => {
// cast scald to give all enemies a flame damage over time effect
creature.CastSpell(target, 52530);
return false; // return true to stop normal action
};
// Let them have flame damage
for(const creature of allCreatures) {
if(creature.name === 'Flame Imp') {
continue;
}
RegisterCreatureEvent(creature.entry, CreatureEvents.CREATURE_EVENT_ON_ENTER_COMBAT, (...args) => flameDamage(...args));
}

View File

@@ -94,6 +94,28 @@ export const STAT_ADVANCEMENT_SPELLS = {
const RARE_ITEM_REQUIREMENT = 20;
const MYTHIC_ITEM_REQUIREMENT = 5;
function getRareRequirementForMaterial(materialId: number): number {
// Ore, cloth, leather, essence = 20
if (materialId === 1 || materialId === 2) return 20; // cloth
if (materialId === 5 || materialId === 6) return 20; // ore
if (materialId === 7 || materialId === 8) return 20; // leather
if (materialId === 11 || materialId === 12) return 20; // essence
// Gem, alchemy = 5
if (materialId === 3 || materialId === 4) return 5; // alchemy
if (materialId === 9 || materialId === 10) return 5; // gem
// Cold, flame, arcane, dark, earth = 10
if (materialId === 13 || materialId === 14) return 10; // cold
if (materialId === 15 || materialId === 16) return 10; // flame
if (materialId === 17 || materialId === 18) return 10; // arcane
if (materialId === 19 || materialId === 20) return 10; // dark
if (materialId === 21 || materialId === 22) return 10; // earth
// Fallback to default rare requirement
return RARE_ITEM_REQUIREMENT;
}
// Get the total number of items in the stack for the given item
function GetTotalStackCount(item: Item): number {
if (!item) return 0;
@@ -286,7 +308,8 @@ PrintInfo(`materialId: ${materialId} and spell: ${spell.GetEntry()}`);
}
if(IsRareFusionItem(fusedItemEntry)) {
if(target.GetCount() < RARE_ITEM_REQUIREMENT) {
const rareRequirement = getRareRequirementForMaterial(materialId);
if(target.GetCount() < rareRequirement) {
player.SendBroadcastMessage("You do not have enough materials to apply fusion");
player.PlayDistanceSound(847);
return false;
@@ -304,8 +327,8 @@ PrintInfo(`materialId: ${materialId} and spell: ${spell.GetEntry()}`);
player.RemoveItem(target, MAX_STACK_SIZE);
} else {
totalFused = Math.floor(Math.random() * 3) + 1;
removeCount = RARE_ITEM_REQUIREMENT;
target.SetCount(target.GetCount() - RARE_ITEM_REQUIREMENT);
removeCount = rareRequirement;
target.SetCount(target.GetCount() - rareRequirement);
player.SaveToDB();
player.RemoveItem(target, 1);
}
@@ -351,4 +374,4 @@ PrintInfo(`materialId: ${materialId} and spell: ${spell.GetEntry()}`);
// );
// Register
RegisterPlayerEvent(PlayerEvents.PLAYER_EVENT_ON_SPELL_CAST, (...args) => MythicMaterialFusion(...args));
RegisterPlayerEvent(PlayerEvents.PLAYER_EVENT_ON_SPELL_CAST, (...args) => MythicMaterialFusion(...args));