Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def change_equip(slot_id, item_id)
- return unless trade_item_with_party(equip_object(slot_id, item_id), equip_object(slot_id, @equips[slot_id]), slot_id)
- @equips[slot_id] = item_id
- $network.send_player_equip(self, slot_id)
- if slot_id == 0
- weapon = $data_weapons[item_id]
- if weapon
- weapon.features.each{ |feat|
- next unless feat.code == 43
- @hotbar.each_with_index{|value, index|
- next unless value.type == Enums::Hotbar::NONE
- change_hotbar(index, Enums::Hotbar::SKILL, feat.data_id)
- break
- }
- }
- else
- @hotbar.each_with_index{ |value, index|
- next if value.type != Enums::Hotbar::SKILL || (value.type == Enums::Hotbar::SKILL && skill_learn?(value.item_id))
- change_hotbar(index, Enums::Hotbar::NONE, 0)
- }
- end
- else
- armor = $data_armors[item_id]
- if armor
- armor.features.each{ |feat|
- next unless feat.code == 43
- @hotbar.each_with_index{|value, index|
- next unless value.type == Enums::Hotbar::NONE
- change_hotbar(index, Enums::Hotbar::SKILL, feat.data_id)
- break
- }
- }
- else
- @hotbar.each_with_index{ |value, index|
- next if value.type != Enums::Hotbar::SKILL || (value.type == Enums::Hotbar::SKILL && skill_learn?(value.item_id))
- change_hotbar(index, Enums::Hotbar::NONE, 0)
- }
- end
- end
- # Se o equipamento que aumentava HP e/ou MP máximo foi removido
- refresh
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement