Combining MultiSlots with Alternate Attack Algorithms (Dual-Wield Problem)

Hey there!
I am currently working on a project where I want to use DerVVulfman's MultiSlots and Xelias' Alternate Attack Algorithm scripts. The first to have a wider array of equipment options and the ladder to create weapons that scale with attributes other than strength. I am using the default battle system.

Both scripts run fine together. The problem arises when a character dual-wields two weapons with different attributes. Specifically, it seems that the special attribute of the first weapon is applied to both attacks. For example, if a character is wielding a weapon that scales with Intelligence and a weapon that scales with strength, the damage of both attacks scales with Intelligence.

I tried a few things and couldn't find a good solution. Could anyone help me change the attack algorithm script to function with the dual attack?

Many thanks for considering my request!
Apologies. I hardly venture into this forum. Been fairly busy seeing another site going down and actively working to 'archive' contents before they are lost to the ages.

I am unfamiliar with Xelias's work. However, I wondered if what you reported about the application of Stat bonuses were true, so I took a peek at my demo.

Incidentally, you do not seem to be alone in asking about MultiSlots!... a bit of a buzz it seems. However, the issue you have with the weapons appears solely cosmetic.

ow.gif

I did a test play of my demo, adding 5 STR points to the Bronze Sword, and added 5 INT points to the Mythril Sword. Then the Mythril Sword was then added to the hooded thief so it could be given to the player within the demo.

At the start, you can see the hero with but 67 STR and 36 INT before any weapons chosen. And when deciding upon which weapon would be within the Right Hand slot, you can see that the Bronze Sword and Mythril Sword do depict both the ATK and related STATS bonuses therein.

At this point, I selected the Bronze Sword for the Right hand, increasing the ATK score and the player's STR score from 67 to 72. After that, I focused upon putting the Mythril Sword within the Left Hand slot.

Indeed, you do not see the INT point bonus when one is deciding upon which weapon will be within the hero's left hand, only the ATK score appearing to increase. But once the Mythril sword is chosen, the INT score indeed increases from 36 to 41.

A cosmetics issue for the Left Hand alone, though one of a small few that have caught my attention. I cannot say when I will be able to address this as I am working to perform forum archival duties. But it appears something warranting a little attention.

Oh, and thanks to kyonides whom brought this query to my attention.
Apologies. I hardly venture into this forum. Been fairly busy seeing another site going down and actively working to 'archive' contents before they are lost to the ages.

I am unfamiliar with Xelias's work. However, I wondered if what you reported about the application of Stat bonuses were true, so I took a peek at my demo.

Incidentally, you do not seem to be alone in asking about MultiSlots!... a bit of a buzz it seems. However, the issue you have with the weapons appears solely cosmetic.

View attachment 300031
I did a test play of my demo, adding 5 STR points to the Bronze Sword, and added 5 INT points to the Mythril Sword. Then the Mythril Sword was then added to the hooded thief so it could be given to the player within the demo.

At the start, you can see the hero with but 67 STR and 36 INT before any weapons chosen. And when deciding upon which weapon would be within the Right Hand slot, you can see that the Bronze Sword and Mythril Sword do depict both the ATK and related STATS bonuses therein.

At this point, I selected the Bronze Sword for the Right hand, increasing the ATK score and the player's STR score from 67 to 72. After that, I focused upon putting the Mythril Sword within the Left Hand slot.

Indeed, you do not see the INT point bonus when one is deciding upon which weapon will be within the hero's left hand, only the ATK score appearing to increase. But once the Mythril sword is chosen, the INT score indeed increases from 36 to 41.

A cosmetics issue for the Left Hand alone, though one of a small few that have caught my attention. I cannot say when I will be able to address this as I am working to perform forum archival duties. But it appears something warranting a little attention.

Oh, and thanks to kyonides whom brought this query to my attention.

First of all, thank you for taking the time to respond to my query.

I think you actually discovered an issue with your script that is unrelated to my problem.

Xelia's script changes how damage for an attack is calculated through a series of if statements. For example, if you are wielding an intelligence weapon, it changes the self.damage formula to include Int instead of strength.

The issue when combining Xelia's script and yours arises when you equip two weapons with different damage formulas. The attack then uses the damage formula of the weapon in the Right Hand slot for both weapons.

I have done some research since I posted this query, and I think the issue lies with how the system handles attacks. It doesn't recognize each weapon attack as an individual attack. So I am very unsure if this problem can be easily fixed and wouldn't expect to take up your precious time with it.

However, I still added Xelia's original script so that you can look at it if you want to.

Spoiler: Xelia's Alternate Attack Algorithm script
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Alternative Attack Algorithms by Xelias
# Version: 1.00
# Type: Battle Add-ON
# Date v1.00: 7.11.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This work is protected by the following license:
# #----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #----------------------------------------------------------------------------
# How to use this script :
# This allows your weapons to follow different damage algorithms. Before that, you
# MUST place your weapons following a normal algorithm in the
# NORMAL_WEAPONS_IDS, or else... It wouldn't be good for your game.
# Also place all weapons ID except SP damaging and absorbing ones, into the
# "ALL_WEAPONS_IDS", because if you don't, a nasty bug will prevent you from
# dealing damage with normal attack. Cool, huh ?
#
# ATMA_WEAPON_IDS = [X,X...] : A weapon with an ID equal to X will inflict
# more damage depending on the user's HP. If HP are full, attack power is doubled.
# If HP are at minimum, attack power is normal. If HP are equal to half, attack power
# is equal to 1,5 of the normal Attack power, and so on...
# VALIANT_KNIFE_IDS = [X, X...] : The opposite effect of Atma Weapon.
# If HP are at minimum, attack power is doubled, and so on...
# LIMITED_MOON_IDS = [X, X...] : Follows the same formula than Atma Weapon
# but works with SP
# CONFORMER_IDS = [X, X...] : Deals damage based on user's Level.
#At Level 1, attack power is normal. At Level 99, attack power is doubled. You get
# the idea
# MASAMUNE_IDS = [X, X...] : Deals more damage the weaker the enemy is
# For an enemy with 100% HP, attack power is normal. For an enemy with 1 HP,
# attack power is doubled (which is pretty useless). For an enemy with half HP,
# attack power is equal to 1,5 of the normal attack power, and so on...
# PROJECTILE_IDS = [X, X...] : Ignores the opponent's defense in the damage
# calculation. However, the Attack power is halved, preventing an attack to inflict
# max damage at an opponent with max defense. Otherwise, it wouldn't be fair.
# FFXII_KATANA_IDS = [X, X...] : Acts like a Final Fantasy XII Katana, which
# means it inflicts damage based on user's Intelligence instead of Strength
# FFXII_NINJA_SWORDS_IDS = [X, X...] : Acts like a Final Fantasy XII Ninja Sword,
# which means it inflicts damage based on user's Agility instead of Strength
# MIND_BLASTER_IDS = [X, X...] : Damage is inflicted to SP. Damage
# relies also on the opponent's Magic Defense and your Intelligence
# BLOOD_SWORD_IDS = [X, X...] & PERCENT_DRAINED = X :
# some damage is absorbed from the attack. How many? PERCENT_DRAINED %
# GUARD_BREAKER_IDS = [X, X...] : Damage ignores if enemy is defending.
# As simple as that.
# GENJI_WEAPON_IDS = [X, X...] : Critical Hit Ratio is doubled.
# KIKU_ICHIMONJI_IDS = [X, X...] : Critical Hit power is doubled.
#
#
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
OTHER_WEAPONS_IDS = [11]
ALL_WEAPONS_IDS = [10,12,13,14,15,16,17,18,21,22,23,24]

ATMA_WEAPON_IDS = [10]
VALIANT_KNIFE_IDS = [12]
LIMITED_MOON_IDS = [13]
CONFORMER_IDS = [14]
MASAMUNE_IDS = [15]
PROJECTILE_IDS = [16]
FFXII_KATANA_IDS = [17]
FFXII_NINJA_SWORDS_IDS = [18]
MIND_BLASTER_IDS = [19]
BLOOD_SWORD_IDS = [20]
PERCENT_DRAINED = 50
GUARD_BREAKER_IDS = [21]
GENJI_WEAPON_IDS = [23]
KIKU_ICHIMONJI_IDS = [24]

class Game_Battler

def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
# Calculate basic damage
if attacker.is_a?(Game_Actor)
if OTHER_WEAPONS_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
if ATMA_WEAPON_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2,0].max
atk2 = atk * (20 + attacker.str) / 20
self.damage = atk2 + ((atk2*((attacker.hp*100)/attacker.maxhp))/100)
end
if VALIANT_KNIFE_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2,0].max
atk2 = atk * (20 + attacker.str) / 20
minushp = attacker.maxhp - attacker.hp
self.damage = atk2 + ((atk2*((minushp*100)/attacker.maxhp))/100)
end
if LIMITED_MOON_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2,0].max
atk2 = atk * (20 + attacker.str) / 20
self.damage = atk2 + ((atk2*((attacker.sp*100)/attacker.maxsp))/100)
end
if CONFORMER_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2,0].max
atk2 = atk * (20 + attacker.str) / 20
self.damage = atk2 + (atk2*(((attacker.level*100) / 99)/100))
end
if MASAMUNE_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2,0].max
atk2 = atk * (20 + attacker.str) / 20
minushp = self.maxhp - self.hp
self.damage = atk2 + ((atk2*((minushp*100)/self.maxhp))/100)
end
if PROJECTILE_IDS.include?(attacker.weapon_id)
atk = [attacker.atk,0].max
self.damage = atk * (20 + attacker.str) / 20
end
if FFXII_KATANA_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.int) / 20
end
if FFXII_NINJA_SWORDS_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.agi) / 20
end
if BLOOD_SWORD_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
if MIND_BLASTER_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - ((self.pdef+self.mdef)) / 4, 0].max
self.damage = atk * (20 + ((attacker.str + attacker.int)/2)) / 20
end
if GUARD_BREAKER_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
if GENJI_WEAPON_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
if KIKU_ICHIMONJI_IDS.include?(attacker.weapon_id)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
end
if attacker.is_a?(Game_Enemy)
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
end
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if attacker.is_a?(Game_Actor)
if GENJI_WEAPON_IDS.include?(attacker.weapon_id)
if rand(100) < 8 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
end
if KIKU_ICHIMONJI_IDS.include?(attacker.weapon_id)
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 4
self.critical = true
end
end
elsif rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# Guard correction
if self.guarding?
if GUARD_BREAKER_IDS.include?(attacker.weapon_id)
self.damage /=1
end
else
self.damage /=2
end
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Substract damage from HP
if attacker.is_a?(Game_Actor)
if MIND_BLASTER_IDS.include?(attacker.weapon_id)
self.sp -= self.damage
self.damage = sprintf('%+d %s', -self.damage, $data_system.words.sp)
end
if BLOOD_SWORD_IDS.include?(attacker.weapon_id)
healing = (self.damage*PERCENT_DRAINED)/100
self.hp -= self.damage
attacker.hp += healing
end
if ALL_WEAPONS_IDS.include?(attacker.weapon_id)
self.hp -= self.damage
end
else self.hp -= self.damage
end
end
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# When missing
else
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
end

Original thread: https://forums.rpgmakerweb.com/threads/combining-multislots-with-alternate-attack-algorithms-dual-wield-problem.166595/