Skip to content

Commit

Permalink
Merge pull request #4532 from TeoTwawki/shutYerBeakFella
Browse files Browse the repository at this point in the history
Colibri animation corrections
  • Loading branch information
claywar authored Sep 21, 2023
2 parents c2c63ae + 5ee7d81 commit 9710f54
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
18 changes: 11 additions & 7 deletions scripts/mixins/families/colibri_mimic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ g_mixins = g_mixins or {}
g_mixins.families = g_mixins.families or {}

g_mixins.families.colibri_mimic = function(colibriMob)
-- initial state 0
local closedBeak = 4
local openBeak = 5

colibriMob:addListener('MAGIC_TAKE', 'COLIBRI_MIMIC_MAGIC_TAKE', function(target, caster, spell)
if
target:getAnimationSub() == 4 and
target:getAnimationSub() ~= openBeak and
spell:tookEffect() and
(caster:isPC() or caster:isPet()) and
(spell:getSpellGroup() ~= xi.magic.spellGroup.BLUE or target:getLocalVar('[colibri]reflect_blue_magic') == 1)
then
target:setLocalVar('[colibri]spellToMimic', spell:getID()) -- which spell to mimic
target:setLocalVar('[colibri]castWindow', os.time() + 30) -- after thirty seconds, will stop attempting to mimic
target:setLocalVar('[colibri]castTime', os.time() + 6) -- enforce a delay between original spell, and mimic spell.
target:setAnimationSub(1)
target:setAnimationSub(openBeak)
end
end)

Expand All @@ -37,7 +41,7 @@ g_mixins.families.colibri_mimic = function(colibriMob)
local castTime = mob:getLocalVar('[colibri]castTime')
local osTime = os.time()

if mob:getAnimationSub() == 1 then
if mob:getAnimationSub() == openBeak then
if
spellToMimic > 0 and
osTime > castTime and
Expand All @@ -48,12 +52,12 @@ g_mixins.families.colibri_mimic = function(colibriMob)
mob:setLocalVar('[colibri]spellToMimic', 0)
mob:setLocalVar('[colibri]castWindow', 0)
mob:setLocalVar('[colibri]castTime', 0)
mob:setAnimationSub(4)
mob:setAnimationSub(closedBeak)
elseif spellToMimic == 0 or osTime > castWindow then
mob:setLocalVar('[colibri]spellToMimic', 0)
mob:setLocalVar('[colibri]castWindow', 0)
mob:setLocalVar('[colibri]castTime', 0)
mob:setAnimationSub(4)
mob:setAnimationSub(closedBeak)
end
end
end)
Expand All @@ -62,8 +66,8 @@ g_mixins.families.colibri_mimic = function(colibriMob)
mob:setLocalVar('[colibri]spellToMimic', 0)
mob:setLocalVar('[colibri]castWindow', 0)
mob:setLocalVar('[colibri]castTime', 0)
if mob:getAnimationSub() == 1 then
mob:setAnimationSub(4)
if mob:getAnimationSub() ~= closedBeak then
mob:setAnimationSub(closedBeak)
end
end)
end
Expand Down
16 changes: 8 additions & 8 deletions sql/mob_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ INSERT INTO `mob_pools` VALUES (746,'Clot','Clot',66,0x0000260100000000000000000
INSERT INTO `mob_pools` VALUES (747,'Cloud_Hippogryph','Cloud_Hippogryph',140,0x0000550500000000000000000000000000000000,6,6,2,240,100,0,1,1,0,0,0,0,238,131,0,0,0,0,0,140,140);
INSERT INTO `mob_pools` VALUES (748,'Cluckatrice','Cluckatrice',70,0x0000200100000000000000000000000000000000,1,8,11,240,100,0,1,0,0,0,0,0,0,643,0,0,0,0,0,70,70);
INSERT INTO `mob_pools` VALUES (749,'Cluster','Cluster',68,0x0000220100000000000000000000000000000000,1,1,11,240,100,0,1,0,0,0,0,0,766,131,4,0,0,0,0,68,68);
INSERT INTO `mob_pools` VALUES (750,'Coastal_Colibri','Coastal_Colibri',72,0x0000B50800000000000000000000000000000000,6,6,2,240,100,0,0,0,1,0,0,0,0,131,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (750,'Coastal_Colibri','Coastal_Colibri',72,0x0000B50800000000000000000000000000000000,6,6,2,240,100,0,0,0,1,0,0,0,0,131,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (751,'Coastal_Opo-opo','Coastal_Opo-opo',188,0x0000A00100000000000000000000000000000000,1,1,7,200,100,0,0,0,1,0,0,0,608,131,0,0,0,0,0,188,188);
INSERT INTO `mob_pools` VALUES (752,'Coastal_Sahagin','Coastal_Sahagin',213,0x0000370500000000000000000000000000000000,10,10,5,240,100,0,1,0,1,0,0,0,205,133,0,0,6,0,0,213,213);
INSERT INTO `mob_pools` VALUES (753,'Cobalt_Quadav','Cobalt_Quadav',202,0x0000910200000000000000000000000000000000,7,7,4,265,100,0,1,1,1,2,0,0,0,3,0,0,4,0,0,202,202);
Expand All @@ -818,7 +818,7 @@ INSERT INTO `mob_pools` VALUES (761,'Cogtooth_Skagnogg','Cogtooth_Skagnogg',190,
INSERT INTO `mob_pools` VALUES (762,'Coinbiter_Cjaknokk','Coinbiter_Cjaknokk',334,0x0000FF0700000000000000000000000000000000,8,8,5,240,100,0,1,1,1,2,0,32,305,669,8,0,5,0,0,334,334);
INSERT INTO `mob_pools` VALUES (763,'Cointeach','Cointeach',73,0x0000310700000000000000000000000000000000,4,1,11,240,100,0,1,0,0,0,0,0,579,131,0,0,2,0,0,0,73);
INSERT INTO `mob_pools` VALUES (764,'Cold_Gigas','Cold_Gigas',126,0x0000C40200000000000000000000000000000000,1,1,11,240,100,0,1,0,1,0,0,0,4773,131,0,0,0,0,0,126,126);
INSERT INTO `mob_pools` VALUES (765,'Colibri','Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,220,100,0,0,0,0,0,0,0,99,131,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (765,'Colibri','Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,220,100,0,0,0,0,0,0,0,99,131,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (766,'Colo-colo','Colo-colo',46,0x0000010100000000000000000000000000000000,8,8,7,240,100,0,1,0,1,18,0,0,0,3,0,0,59,0,0,46,46);
INSERT INTO `mob_pools` VALUES (767,'Colorful_Leshy','Colorful_Leshy',245,0x0000870100000000000000000000000000000000,1,1,7,240,100,0,1,0,0,2,0,0,0,133,0,0,0,0,0,245,245);
INSERT INTO `mob_pools` VALUES (768,'Colorful_Treant','Colorful_Treant',245,0x0000870100000000000000000000000000000000,1,1,7,240,100,0,1,0,0,0,0,0,0,133,0,0,0,0,0,245,245);
Expand Down Expand Up @@ -1855,7 +1855,7 @@ INSERT INTO `mob_pools` VALUES (1798,'Graviton','Graviton',282,0x0000D7040000000
INSERT INTO `mob_pools` VALUES (1799,'Greatclaw','Greatclaw',77,0x0000640100000000000000000000000000000000,7,7,4,240,100,0,1,0,0,0,0,0,0,133,0,0,0,0,0,77,77);
INSERT INTO `mob_pools` VALUES (1800,'Greater_Amphiptere','Greater_Amphiptere',6,0x0000AE0800000000000000000000000000000000,1,1,0,240,100,0,1,1,1,2,0,2,1,2177,12,0,0,0,1024,6,6);
INSERT INTO `mob_pools` VALUES (1801,'Greater_Cockatrice','Greater_Cockatrice',70,0x0000200100000000000000000000000000000000,1,1,11,240,100,0,1,0,0,0,0,0,164,131,8,0,0,0,0,70,70);
INSERT INTO `mob_pools` VALUES (1802,'Locus_Colibri','Locus_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,1,0,0,0,240,133,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (1802,'Locus_Colibri','Locus_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,1,0,0,0,240,133,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (1803,'Greater_Gayla','Greater_Gayla',46,0x0000000100000000000000000000000000000000,1,1,11,240,100,0,1,0,0,0,0,0,503,643,8,0,0,0,0,46,46);
INSERT INTO `mob_pools` VALUES (1804,'Greater_Gaylas','Greater_Gaylas',47,0x0000040100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,0,0,64,141,643,8,0,0,0,0,47,47);
INSERT INTO `mob_pools` VALUES (1805,'Greater_Gnole','Greater_Gnole',132,0x0000F10700000000000000000000000000000000,2,2,1,480,100,0,1,0,1,2,0,0,0,129,4,0,0,0,0,132,132);
Expand Down Expand Up @@ -2449,7 +2449,7 @@ INSERT INTO `mob_pools` VALUES (2392,'Leshachikha','Leshachikha',216,0x000088010
INSERT INTO `mob_pools` VALUES (2393,'Leshonki','Leshonki',216,0x0000880100000000000000000000000000000000,1,1,7,240,100,0,0,0,1,2,0,32,185,159,0,0,0,0,0,216,216);
INSERT INTO `mob_pools` VALUES (2394,'Leshy','Leshy',245,0x0000840100000000000000000000000000000000,1,1,7,240,100,0,0,0,0,0,0,0,258,131,0,0,0,0,0,245,245);
INSERT INTO `mob_pools` VALUES (2395,'Lesser_Arimaspi','Lesser_Arimaspi',4,0x0000090100000000000000000000000000000000,11,4,5,240,100,0,1,0,1,2,0,0,0,135,0,0,164,0,0,4,4);
INSERT INTO `mob_pools` VALUES (2396,'Lesser_Colibri','Lesser_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,0,0,0,0,257,129,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (2396,'Lesser_Colibri','Lesser_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,0,0,0,0,257,129,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (2397,'Lesser_Gaylas','Lesser_Gaylas',47,0x0000040100000000000000000000000000000000,1,1,11,240,100,0,1,0,1,0,0,64,431,643,8,0,0,0,0,47,47);
INSERT INTO `mob_pools` VALUES (2398,'Lesser_Manticore','Lesser_Manticore',179,0x0000920100000000000000000000000000000000,1,1,7,360,100,0,1,0,0,0,0,0,523,129,0,0,0,0,0,179,179);
INSERT INTO `mob_pools` VALUES (2399,'Lesser_Roc','Lesser_Roc',125,0x0000500100000000000000000000000000000000,1,3,11,240,100,0,0,0,1,0,0,0,394,131,0,0,0,0,0,125,125);
Expand Down Expand Up @@ -4959,11 +4959,11 @@ INSERT INTO `mob_pools` VALUES (4902,'Velkk_Ravager','Velkk_Ravager',342,0x0000D
INSERT INTO `mob_pools` VALUES (4903,'Velkk_Manipulator','Velkk_Manipulator',342,0x0000DD0900000000000000000000000000000000,4,4,9,280,100,0,1,0,1,0,0,0,0,131,0,0,2,0,0,342,342);
INSERT INTO `mob_pools` VALUES (4904,'Crevice_Tarichuk','Crevice_Tarichuk',98,0x0000460500000000000000000000000000000000,1,1,8,240,100,0,1,0,1,0,0,0,0,131,0,0,0,0,0,98,98);
INSERT INTO `mob_pools` VALUES (4905,'Monolithic_Boulder','Monolithic_Boulder',237,0x00002C0600000000000000000000000000000000,1,1,0,32767,100,0,0,0,0,0,0,0,7,135,0,0,0,0,0,0,237);
INSERT INTO `mob_pools` VALUES (4906,'Resilient_Colibri','Resilient_Colibri',287,0x0000B80600000000000000000000000000000000,1,1,2,220,100,0,1,0,0,2,56,0,1,131,4,0,0,0,0,287,287);
INSERT INTO `mob_pools` VALUES (4906,'Resilient_Colibri','Resilient_Colibri',287,0x0000B80600000000000000000000000000000000,1,1,2,220,100,0,1,0,0,2,56,0,1,131,0,0,0,0,0,287,287);
INSERT INTO `mob_pools` VALUES (4907,'Precipice_Vulture','Precipice_Vulture',55,0x0000BD0100000000000000000000000000000000,1,1,5,240,100,0,1,0,1,2,0,0,7,131,8,0,0,0,0,55,55);
INSERT INTO `mob_pools` VALUES (4908,'Embattled_Roc','Embattled_Roc',125,0x0000500100000000000000000000000000000000,1,1,11,240,100,0,1,0,0,0,0,0,1,131,0,0,0,0,0,125,125);
INSERT INTO `mob_pools` VALUES (4909,'Gorge_Vulture','Gorge_Vulture',55,0x0000BD0100000000000000000000000000000000,1,1,5,240,100,0,1,0,1,2,0,0,7,131,8,0,0,0,0,55,55);
INSERT INTO `mob_pools` VALUES (4910,'Undaunted_Colibri','Undaunted_Colibri',287,0x0000B80600000000000000000000000000000000,1,1,2,220,100,0,1,0,0,2,56,0,7,131,4,0,0,0,0,287,287);
INSERT INTO `mob_pools` VALUES (4910,'Undaunted_Colibri','Undaunted_Colibri',287,0x0000B80600000000000000000000000000000000,1,1,2,220,100,0,1,0,0,2,56,0,7,131,0,0,0,0,0,287,287);
INSERT INTO `mob_pools` VALUES (4911,'Avian_Roost','Avian_Roost',237,0x0000F50A00000000000000000000000000000000,1,1,0,32767,100,0,0,0,0,2,0,0,1,1153,0,0,0,0,0,0,237);
INSERT INTO `mob_pools` VALUES (4912,'Foraging_Apkallu','Foraging_Apkallu',27,0x0000170800000000000000000000000000000000,2,2,1,480,100,0,1,0,1,0,0,0,1,131,0,0,0,0,0,27,27);
INSERT INTO `mob_pools` VALUES (4913,'Trembling_Tulfaire','Trembling_Tulfaire',454,0x0000230A00000000000000000000000000000000,1,1,2,240,100,0,1,0,1,0,0,0,1,131,8,0,0,0,0,454,454);
Expand Down Expand Up @@ -5043,7 +5043,7 @@ INSERT INTO `mob_pools` VALUES (4986,'Riverscum','Riverscum',66,0x00002701000000
INSERT INTO `mob_pools` VALUES (4987,'Canyon_Apkallu','Canyon_Apkallu',27,0x0000170800000000000000000000000000000000,2,2,1,480,100,0,0,0,1,0,0,0,1,129,0,0,0,0,0,27,27);
INSERT INTO `mob_pools` VALUES (4988,'Dirtcaked_Jagil','Dirtcaked_Jagil',197,0x00005D0100000000000000000000000000000000,1,1,7,240,100,0,1,0,0,0,0,0,1,129,0,0,0,0,0,709,197);
INSERT INTO `mob_pools` VALUES (4989,'Cliffclinger_Toad','Cliffclinger_Toad',196,0x0000BF0800000000000000000000000000000000,1,1,0,240,100,0,0,0,0,0,0,0,1,129,0,0,0,0,0,196,196);
INSERT INTO `mob_pools` VALUES (4990,'Longface_Colibri','Longface_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,1,0,0,0,1,129,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (4990,'Longface_Colibri','Longface_Colibri',72,0x0000B80600000000000000000000000000000000,5,5,2,200,100,0,0,0,1,0,0,0,1,129,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (4991,'Spinescent_Protuberance','Spinescent_Protuberance',239,0x0000F40A00000000000000000000000000000000,1,1,7,32767,100,0,1,1,0,0,0,0,1,129,0,0,0,0,0,0,239);
INSERT INTO `mob_pools` VALUES (4992,'Velkk_Inquisitor','Velkk_Inquisitor',342,0x0000DD0900000000000000000000000000000000,4,4,9,280,100,0,1,0,1,0,0,0,0,129,0,0,2,0,0,342,342);
INSERT INTO `mob_pools` VALUES (4993,'Velkk_Defiler','Velkk_Defiler',342,0x0000D80900000000000000000000000000000000,8,8,9,280,100,0,1,0,1,0,0,0,0,129,0,0,0,0,0,342,342);
Expand Down Expand Up @@ -6489,7 +6489,7 @@ INSERT INTO `mob_pools` VALUES (6445,'Ba_past','Ba_past',55,0x0000BC010000000000
INSERT INTO `mob_pools` VALUES (6446,'Eschan_Vulture','Eschan_Vulture',55,0x0000BD0100000000000000000000000000000000,1,1,2,240,100,0,0,0,1,0,0,0,0,131,0,0,0,0,0,55,55);
INSERT INTO `mob_pools` VALUES (6447,'Jubjub_past','Jubjub_past',55,0x0000BD0100000000000000000000000000000000,1,1,2,240,100,0,0,0,1,0,0,0,298,129,0,0,0,0,0,55,55);
INSERT INTO `mob_pools` VALUES (6448,'Nightmare_Raven_HI','Nightmare_Raven_HI',55,0x0000BD0100000000000000000000000000000000,1,1,5,240,100,0,1,0,1,0,0,0,1551,133,0,0,0,0,0,55,55);
INSERT INTO `mob_pools` VALUES (6449,'Colibri_past','Colibri_past',72,0x0000B50800000000000000000000000000000000,5,5,2,220,100,0,0,0,0,0,0,0,99,129,4,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (6449,'Colibri_past','Colibri_past',72,0x0000B50800000000000000000000000000000000,5,5,2,220,100,0,0,0,0,0,0,0,99,129,0,0,0,0,0,72,72);
INSERT INTO `mob_pools` VALUES (6450,'Ancient_Bat_LDT','Ancient_Bat_LDT',46,0x0000000100000000000000000000000000000000,1,1,11,240,100,0,1,0,1,0,0,0,239,1665,8,0,0,0,0,46,46);
INSERT INTO `mob_pools` VALUES (6451,'Warren_Bat','Warren_Bat',46,0x0000000100000000000000000000000000000000,1,1,11,240,100,0,1,0,1,0,0,0,239,643,8,0,0,0,0,46,46);
INSERT INTO `mob_pools` VALUES (6452,'Black_Bat_past','Black_Bat_past',46,0x0000000100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,0,0,0,244,641,16,0,0,0,0,46,46);
Expand Down

0 comments on commit 9710f54

Please sign in to comment.