Help - Search - Members - Calendar
Full Version: [SSS] Weapon Attack Replace
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Shanghai
Shanghai Simple Script - Weapon Attack Replace
made by Shanghai



Link/Script
Click here

Introduction
If the actor has a weapon equipped with an attack replacement skill and the actor goes to attack, the actor will instead use the attack replacement skill.

How to Use
CODE
<attack skill: x>
<attack skill: x, x, x>


This belongs in a weapon's notebox. x is the skill ID use for what skill will replace the regular attack when the actor attacks with the weapon. If more than one tag is used or the multiple x tag is used, then the regular attack will choose randomly which of the skills to use.

Compatibility
- Works with Battle Engine Melody

For more Shanghai Simple Scripts
Visit Here.
Xeyla
This would make for a great Wand of Wonder, which comes from the D&D Games. Thanks for sharing this useful script, i was wondering if anyone ever made this before but i never took the time to find out.
leongon
There was one Magic Weapons or something like that, but that one gave a chance to a weapon to cast a skill instead of the normal attack.

A fusion of both will be great, but I see that Shanghai does not apply enhancements by requests normally.
Twilight27
Can you remake the Golden Sun special attack skill feature? As I see it now, the skills replace the ability to attack normally. In Golden Sun however, you could have still attacked normally while having a percentage chance of releasing a special attack (Like unleashing Megido from the Sol Blade... if you've played the games). Will it be possible for you to add that feature?
leongon
People just don't read xD
archeart
ohmy.gif OMG another cool script keep em coming
Paper PokéMaster
QUOTE (Twilight27 @ Jun 1 2010, 09:45 AM) *
Can you remake the Golden Sun special attack skill feature? As I see it now, the skills replace the ability to attack normally. In Golden Sun however, you could have still attacked normally while having a percentage chance of releasing a special attack (Like unleashing Megido from the Sol Blade... if you've played the games). Will it be possible for you to add that feature?


If you wanted it to unleash attack (I tried it. It works), make a skill with the icon of the weapon named Attack. It should have Attack F 100 and Base Damage 1. Make sure it has the same animation as normal attacks and has Physical Attack checked.
Make a different skill that does whatever you want the unleash attack of the weapon to be. It doesn't matter what it does. It could even heal all allies if you wanted.

Go to the weapon, and put in the <attack skil: x> as many IDs of the attack skill you want, and one of the unleash skills.
EX:
<attack skill: 1, 1, 1, 2>
The more of the attack skill you put, the less likely it'll use the unleash skill, so keep that in mind.
Twilight27
QUOTE (Paper PokéMaster @ Jun 1 2010, 02:11 PM) *
QUOTE (Twilight27 @ Jun 1 2010, 09:45 AM) *
Can you remake the Golden Sun special attack skill feature? As I see it now, the skills replace the ability to attack normally. In Golden Sun however, you could have still attacked normally while having a percentage chance of releasing a special attack (Like unleashing Megido from the Sol Blade... if you've played the games). Will it be possible for you to add that feature?


If you wanted it to unleash attack (I tried it. It works), make a skill with the icon of the weapon named Attack. It should have Attack F 100 and Base Damage 1. Make sure it has the same animation as normal attacks and has Physical Attack checked.
Make a different skill that does whatever you want the unleash attack of the weapon to be. It doesn't matter what it does. It could even heal all allies if you wanted.

Go to the weapon, and put in the <attack skil: x> as many IDs of the attack skill you want, and one of the unleash skills.
EX:
<attack skill: 1, 1, 1, 2>
The more of the attack skill you put, the less likely it'll use the unleash skill, so keep that in mind.


Thanks. I had thought about that indeed, though I told myself it would be a 50-50 chance. I didn't think about putting "1" several times. Lol, thanks.
Orias Obderhode
The link for the script is dead, does anyone have a copy of this script?

Thanks!
Orias Obderhode
Thanks for your help, Kread-EX!
chan1990
The reply post also dead. help!!!
Pyro21
QUOTE (chan1990 @ Oct 3 2011, 08:07 AM) *
The reply post also dead. help!!!


This is the one I'm using...I think it's right.

CODE
#===============================================================================
#
# Shanghai Simple Script - Weapon Attack Replace
# Last Date Updated: 2010.05.30
# Level: Normal
#
# If an actor's weapons contain skills and the actor attacks, the actor will use
# that skill instead as a replacement for the regular attack. Makes things like
# Fire Wands actually cast fire.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# <attack skill: x>
# <attack skill: x, x, x>
# This belongs in a weapon's notebox. x is the skill ID use for what skill will
# replace the regular attack when the actor attacks with the weapon. If more
# than one tag is used or the multiple x tag is used, then the regular attack
# will choose randomly which of the skills to use.
#===============================================================================

$imported = {} if $imported == nil
$imported["WeaponAttackReplace"] = true

#==============================================================================
# RPG::Weapon
#==============================================================================

class RPG::Weapon < RPG::BaseItem
  #--------------------------------------------------------------------------
  # # Attack Skills
  #--------------------------------------------------------------------------
  def attack_skills
    return @attack_skills if @attack_skills != nil
    @attack_skills = []
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when /<(?:ATTACK_SKILL|attack skill):[ ](\d+(?:\s*,\s*\d+)*)>/i
        $1.scan(/\d+/).each { |num| @attack_skills.push(num.to_i) }
      end
    }
    return @attack_skills
  end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Attack Skills
  #--------------------------------------------------------------------------
  def attack_skills
    n = []
    for weapon in weapons.compact do n += weapon.attack_skills end
    return n
  end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Attack
  #--------------------------------------------------------------------------
  alias execute_action_attack_sss_weapon_replace execute_action_attack unless $@
  def execute_action_attack
    if @active_battler.actor? and not @active_battler.attack_skills.empty?
      attack_skills = @active_battler.attack_skills
      skill_id = attack_skills[rand(attack_skills.size)]
      @active_battler.action.set_skill(skill_id)
      execute_action_skill
    else
      execute_action_attack_sss_weapon_replace
    end
  end
end

#===============================================================================
#
# END OF FILE
#
#===============================================================================
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.