Code: Select all
getStaffType = function(self)
--from channel staff. we'll use this to check damage type for all of our staff and shield attacks.
--we changed damtype to kind so it wouldn't be confusing in our callbackOnMeleeAttack. we also added the name field to save ourselves some steps when we want to get the name as a string -- with colors!
local weapon, combat = self:hasStaffWeapon()
local combat = weapon and weapon.combat or false
local trail = "arcanetrail"
local particle = "bolt_arcane"
local explosion = "manathrust"
local name = "#PURPLE#Arcane#LAST#"
local kind = (combat and combat.element) or (combat and combat.damtype) or DamageType.ARCANE
if kind == DamageType.FIRE then explosion = "flame" particle = "bolt_fire" trail = "firetrail" name = "#LIGHT_RED#Fire#LAST#"
elseif kind == DamageType.COLD then explosion = "freeze" particle = "ice_shards" trail = "icetrail" name = "#1133F3#Cold#LAST#"
elseif kind == DamageType.ACID then explosion = "acid" particle = "bolt_acid" trail = "acidtrail" name = "#GREEN#Acid#LAST#"
elseif kind == DamageType.LIGHTNING then explosion = "lightning_explosion" particle = "bolt_lightning" trail = "lightningtrail" name = "#ROYAL_BLUE#Lightning#LAST#"
elseif kind == DamageType.LIGHT then explosion = "light" particle = "bolt_light" trail = "lighttrail" name = "#YELLOW#Light#LAST#"
elseif kind == DamageType.DARKNESS then explosion = "dark" particle = "bolt_dark" trail = "darktrail" name = "#GREY#Darkness#LAST#"
elseif kind == DamageType.NATURE then explosion = "slime" particle = "bolt_slime" trail = "slimetrail" name = "#LIGHT_GREEN#Nature#LAST#"
elseif kind == DamageType.BLIGHT then explosion = "slime" particle = "bolt_slime" trail = "slimetrail" name = "#DARK_GREEN#Blight#LAST#"
elseif kind == DamageType.PHYSICAL then explosion = "dark" particle = "stone_shards" trail = "earthtrail" name = "Physical#LAST#"
elseif kind == DamageType.TEMPORAL then explosion = "light" particle = "temporal_bolt" trail = "lighttrail" name = "#STEEL_BLUE#Temporal#LAST#"
else kind = DamageType.ARCANE explosion = "manathrust" particle = "bolt_arcane" trail = "arcanetrail" name = "#PURPLE#Arcane#LAST#"
end
return {kind = kind, explosion = explosion, particle = particle, trail = trail, name = name} -- half of these we might not use, but since we just coppied the function anyway, we might as well store the info in case we do decide to use it
end

Edit: Image link looks broken. Might just be on my end, but I'll just drop it inline anyhow.
It occurred to me afterward that this could also be wrapped up into hasStaffWeapon(). I'm not really sure which would be more ideal.