Re: Useful scripts repository
Posted: Wed Jan 16, 2013 12:25 pm
Play Correct Party Hurt Sounds Based on Any Race/Gender Combination
This simple script allows you to play the right hurt sounds for any party make-up:
------------------
EDIT - Oops, didn't realize there is a much easier way, simply:
This example damages each player a random amount between 5 and 10, then plays all their hurt sounds (which already accounts for race and gender automatically)
-----
original thread for discussion/questions:
viewtopic.php?p=51233#p51233
This simple script allows you to play the right hurt sounds for any party make-up:
Code: Select all
function partyHurt()
for i=1,4 do
local theRace = party:getChampion(i):getRace()
local theSex = party:getChampion(i):getSex()
champHurt(theRace,theSex)
end
end
function champHurt(race,sex)
if race == "Human" then playSound("damage_human_"..sex)
elseif race == "Minotaur" then playSound("damage_minotaur_"..sex)
elseif race == "Lizardman" then playSound("damage_lizardman_"..sex)
elseif race == "Insectoid" then playSound("damage_insectoid_"..sex)
end
end
EDIT - Oops, didn't realize there is a much easier way, simply:
Code: Select all
function doDamage()
for i=1,4 do
if party:getChampion(i):getEnabled() and
party:getChampion(i):isAlive() then
party:getChampion(i):damage(math.random(5,10),"physical")
party:getChampion(i):playDamageSound()
end
end
end
-----
original thread for discussion/questions:
viewtopic.php?p=51233#p51233