10-13-2009, 06:16 PM
my BS script includes some codes with elements correction.
for this 1st one, my settings is damage no. 1 (can be set up at the begening of the script in the options). So my case is "when 1"
this 2nd one is yours, and it is working:
and then element correction about hp and sp regen, i dont show it cz i dont think it can influct.
another script is Actor Advanced status, it says :
Finally, i have found a script that is working to cancel element. But when i use it,
B, C, D, E, are working. and A is working like B, when it is skill...
for this 1st one, my settings is damage no. 1 (can be set up at the begening of the script in the options). So my case is "when 1"
Code:
def set_attack_damage_value(attacker)
case DAMAGE_ALGORITHM_TYPE
when 0
atk = [attacker.atk - (self.pdef / 2), 0].max
str = [20 + attacker.str, 0].max
when 1
atk = [attacker.atk - ((attacker.atk * self.pdef) / 1000), 0].max
str = [20 + attacker.str, 0].max
when 2
atk = 20
str = [(attacker.str * 4) - (self.dex * 2) , 0].max
when 3
atk = [(10 + attacker.atk) - (self.pdef / 2), 0].max
str = [(20 + attacker.str) - (self.dex / 2), 0].max
end
self.damage = atk * str / 20
self.damage = 1 if self.damage == 0 and (rand(100) > 40)
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
end
this 2nd one is yours, and it is working:
Code:
# Element correction
weapon_elements=[]
if skill.element_set.include?(26)
if user.weapon_id > 0
weapon_elements=[1,4,5,6]&$data_weapons[user.weapon_id].element_set
end
end
self.damage *= elements_correct(skill.element_set | weapon_elements)
self.damage /= 100
end
and then element correction about hp and sp regen, i dont show it cz i dont think it can influct.
another script is Actor Advanced status, it says :
Code:
alias acbs_elements_correct_actorstatus elements_correct
Finally, i have found a script that is working to cancel element. But when i use it,
B, C, D, E, are working. and A is working like B, when it is skill...
Code:
$DUMMY_ELEMENTS = [2,3,7,8,9,10,] # add any dummy element IDs other scripts might use
$DUMMY_STATES = [] # add any dummy state IDs other scripts might use
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
def elements_correct(elements)
multiplier = size = 0
elements.each {|i|
unless $DUMMY_ELEMENTS.include?(i)
multiplier += self.element_rate(i)
size += 1
end}
return (size == 0 ? 100 : multiplier/size)
end
end