Loki Darkheart
Member
Problem
I'm using a script made by Haki that is supposed to add a status effect to selected armor. It removes the status effect when you unequip the piece of equipment. I've modified it to be used for every peice of armor not just chest. Also for weapons. My problem is if say I have a piece of armor that causes the status effect Poison. And an accessory that causes Poison. When I unequip one of those items it drops the status effect even though i'm still wearing on of the items that causes poison. Is there a simple work around for this? If not i'll just use the script for accessories only but it was a thought.
The Code
So without further ado here is the code...
Originally the code only had ASSIGNED_STATUS i added the 2-5, which works except for my above problem. I don't know if this script looks different on XP and VX so I'm using RMXP if that helps anyone out.
Special Thanks for whoever helps me with this issue.
I'm using a script made by Haki that is supposed to add a status effect to selected armor. It removes the status effect when you unequip the piece of equipment. I've modified it to be used for every peice of armor not just chest. Also for weapons. My problem is if say I have a piece of armor that causes the status effect Poison. And an accessory that causes Poison. When I unequip one of those items it drops the status effect even though i'm still wearing on of the items that causes poison. Is there a simple work around for this? If not i'll just use the script for accessories only but it was a thought.
The Code
So without further ado here is the code...
Code:
class Game_Actor < Game_Battler
ASSIGNED_STATUS = {11 => 17, 5 => 17} #Chest Armor => Status
ASSIGNED_STATUS2 = {23 => 3} #Weapon_ID => Status_ID
ASSIGNED_STATUS3 = {8 => 3} #Shield_ID => Status_ID
ASSIGNED_STATUS4 = {10 => 3} #Helmet_ID => Status_ID
ASSIGNED_STATUS5 = {9 => 3} #Accesory_ID => Status_ID
def equip(equip_type, id)
case equip_type
when 0
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
if ASSIGNED_STATUS2[id] != nil
add_state(ASSIGNED_STATUS2[id])
else
remove_state(ASSIGNED_STATUS[@weapon_id])
end
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
if ASSIGNED_STATUS3[id] != nil
add_state(ASSIGNED_STATUS3[id])
else
remove_state(ASSIGNED_STATUS3[@armor1_id])
end
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
if ASSIGNED_STATUS4[id] != nil
add_state(ASSIGNED_STATUS4[id])
else
remove_state(ASSIGNED_STATUS4[@armor2_id])
end
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
if ASSIGNED_STATUS[id] != nil
add_state(ASSIGNED_STATUS[id])
else
remove_state(ASSIGNED_STATUS[@armor3_id])
end
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
if ASSIGNED_STATUS5[id] != nil
add_state(ASSIGNED_STATUS5[id])
else
remove_state(ASSIGNED_STATUS5[@armor4_id])
end
@armor4_id = id
$game_party.lose_armor(id, 1)
end
end
end
end
Originally the code only had ASSIGNED_STATUS i added the 2-5, which works except for my above problem. I don't know if this script looks different on XP and VX so I'm using RMXP if that helps anyone out.
Special Thanks for whoever helps me with this issue.