From ade7dab6c99da97c1463ea94f6e3b844d96986b7 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Sun, 18 Dec 2022 07:19:28 -0600 Subject: [PATCH 1/3] Fire Elemental on Wrath --- core/parser.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/parser.lua b/core/parser.lua index 7cdcf92f..b3615e49 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -2116,6 +2116,25 @@ --alvo_name = "Fire Spirit" end + --If fire elemental totem on Wrath, then ignore the summon of the fire elemental totem itself and instead create the Greater Fire Elemental early. + --Greater Fire Elemental and Fire Elemental Totem have the same serial besides the npc id. + --There are cases where the Greater Fire Elemental could attack and the SWING_DAMAGE event happens before the spell_summon for it. Same frame. + --[[12/14 21:14:44.545 SPELL_SUMMON,Player-4384-03852552,"Toekruh-Mankrik",0x512,0x0,Creature-0-4391-615-3107-15439-00001A8313,"Fire Elemental Totem",0xa28,0x0,2894,"Fire Elemental Totem",0x1 + 12/14 21:14:44.545 SWING_DAMAGE,Creature-0-4391-615-3107-15438-00001A8313,"Greater Fire Elemental",0x2112,0x0,Creature-0-4391-615-3107-28860-00001A8258,"Sartharion",0xa48,0x0,Creature-0-4391-615-3107-15438-00001A8313,Creature-0-4391-615-3107-15439-00001A8313,4274,4274,0,0,0,-1,0,0,0,3261.68,530.04,155,3.3324,208,188,187,-1,4,0,0,0,nil,nil,nil + 12/14 21:14:44.545 SPELL_CAST_SUCCESS,Creature-0-4391-615-3107-15438-00001A8313,"Greater Fire Elemental",0x2112,0x0,Creature-0-4391-615-3107-28860-00001A8258,"Sartharion",0xa48,0x0,57984,"Fire Blast",0x4,Creature-0-4391-615-3107-15438-00001A8313,Creature-0-4391-615-3107-15439-00001A8313,4274,4274,0,0,0,-1,0,0,0,3261.68,530.04,155,3.3324,208 + 12/14 21:14:44.545 SPELL_CAST_SUCCESS,Creature-0-4391-615-3107-15439-00001A8313,"Fire Elemental Totem",0x2112,0x0,0000000000000000,nil,0x80000000,0x80000000,32982,"Fire Elemental Totem",0x1,Creature-0-4391-615-3107-15439-00001A8313,Player-4384-03852552,3888,3888,0,0,0,-1,0,0,0,3257.01,531.82,155,5.1330,208 + 12/14 21:14:44.545 SPELL_SUMMON,Creature-0-4391-615-3107-15439-00001A8313,"Fire Elemental Totem",0x2112,0x0,Creature-0-4391-615-3107-15438-00001A8313,"Greater Fire Elemental",0x2112,0x0,32982,"Fire Elemental Totem",0x1 + ]] + if(isWOTLK) then + if(npcId == 15439) then + alvo_serial = alvo_serial:gsub("-15439-", "-15438-") + alvo_name = "Greater Fire Elemental" + --Don't need to set the pet flags since it is a guardian and will always hit the 2nd part of tabela_pets:Adicionar + elseif (npcId == 15438) then + return + end + end + --pet summon another pet local sou_pet = container_pets [who_serial] if (sou_pet) then --okey, ja � um pet From 171d3393d20b03fc61a7bfb77f63f0cbe95e0908 Mon Sep 17 00:00:00 2001 From: Flamanis Date: Sun, 18 Dec 2022 07:22:38 -0600 Subject: [PATCH 2/3] Don't overwrite the summon of the totem, just create the elemental instead. --- core/parser.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/parser.lua b/core/parser.lua index b3615e49..b2c7ff9f 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -2127,9 +2127,7 @@ ]] if(isWOTLK) then if(npcId == 15439) then - alvo_serial = alvo_serial:gsub("-15439-", "-15438-") - alvo_name = "Greater Fire Elemental" - --Don't need to set the pet flags since it is a guardian and will always hit the 2nd part of tabela_pets:Adicionar + _detalhes.tabela_pets:Adicionar(alvo_serial:gsub("-15439-", "-15438-"), "Greater Fire Elemental", alvo_flags, who_serial, who_name, who_flags) elseif (npcId == 15438) then return end From 2c8a2cedb8f93aafb0a79722592f63630be94b1e Mon Sep 17 00:00:00 2001 From: Flamanis Date: Sun, 18 Dec 2022 07:29:43 -0600 Subject: [PATCH 3/3] Gsub uses patterns. Escape the special characters --- core/parser.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/parser.lua b/core/parser.lua index b2c7ff9f..1f658437 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -2127,7 +2127,7 @@ ]] if(isWOTLK) then if(npcId == 15439) then - _detalhes.tabela_pets:Adicionar(alvo_serial:gsub("-15439-", "-15438-"), "Greater Fire Elemental", alvo_flags, who_serial, who_name, who_flags) + _detalhes.tabela_pets:Adicionar (alvo_serial:gsub("%-15439%-", "%-15438%-"), "Greater Fire Elemental", alvo_flags, who_serial, who_name, who_flags) elseif (npcId == 15438) then return end