aggro(), healthchanged() and death()
Posted: Fri Feb 06, 2009 12:39 am
LE (or anyone), we're having a problem with 2 functions in our aggro NPC lua's. Here's the script content:
Basically, these are generic "grobin" mobs in GFay that upon aggro, sometimes will shout some silly thing at you as they attack. So I am trying to use the LUA function for aggro(), and it doesn't seem to work. Note though, that my defenders in Queen's Colony use aggro(), but I do not always hear it. They shout it when they aggro one of the invaders that walk up.
Secondly is the healthchanged(), and this one is probably the one we're looking to understand more. Trying a little math to get the 50% health mark, then shouting some grobin "battle" chant at that point, but the mobs stay silent. We have not gotten this to work as far as I know.
Lastly, death() - no bad news here, this one seems to work ok. =) Just wanted to set up the entire flow of what the script is trying to accomplish. Any experts want to review my script and tell me where I'm going wrong, please do.
TIA,
-J
PS: Before you say my math.random() can choose -- say nothing, I know. And I've tried forcing things to no random, still no convos.
Code: Select all
function aggro(NPC, Spawn)
FaceTarget(NPC, Spawn)
choice = math.random(1,5)
if choice == 1 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_aggro_68f43c9.mp3", "Arroop!", "", 789139818, 1768762311, Spawn)
elseif choice == 2 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_aggro_c809bb68.mp3", "I grow bigger than you!", "", 1365081195, 1786804084, Spawn)
else
-- say nothing
end
end
function healthchanged(NPC)
if GetCurrentHP(NPC) <= (GetMaxHP(NPC) / 2) then
choice = math.random(1,5)
if choice == 1 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_25d9a433.mp3", "Grum! Grum! ", "", 1460066353, 1003945639, Spawn)
elseif choice == 2 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_4e5ee4ae.mp3", "Smash the squishies.", "", 3016834030, 2330929155, Spawn)
elseif choice == 3 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_603b0f3b.mp3", "Run away from the mines!", "", 861506750, 2339330363, Spawn)
elseif choice == 4 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_cf61b767.mp3", "Groblin's go!", "", 1309387887, 223459313, Spawn)
else
-- say nothing
end
end
end
function death(NPC, Spawn)
choice = math.random(1,5)
if choice == 1 then
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_death_31b8eb31.mp3", "I shall grow no more!", "", 2582377610, 2713862197, Spawn)
end
endSecondly is the healthchanged(), and this one is probably the one we're looking to understand more. Trying a little math to get the 50% health mark, then shouting some grobin "battle" chant at that point, but the mobs stay silent. We have not gotten this to work as far as I know.
Lastly, death() - no bad news here, this one seems to work ok. =) Just wanted to set up the entire flow of what the script is trying to accomplish. Any experts want to review my script and tell me where I'm going wrong, please do.
TIA,
-J
PS: Before you say my math.random() can choose -- say nothing, I know. And I've tried forcing things to no random, still no convos.