设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 110|回复: 0

[转载发布] Josephkhland's DnD Style Damage Formula DFWAS

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 10:03:57 | 显示全部楼层 |阅读模式
    So actuall this is my first script. (DFWAS -> Damage for weapons and Spells). 

    I have created 2 methods that can be used in the Damage Formula and change the Combat to a style similar to Dungeons and Dragons 3.5 edition (DnD) combat.

    What I mean : 

    Well in DnD 3.5 each PC and NPC has an attack bonus and an Armor class.

    Attack bonus derives from this equation: class bonus + Strength or Dexterity modifier (depends on the weapon and feats)

    Armor class derives from this equation : 10 + armor bonus + (shield bonus) + dexterity modifier +(miscelanious)

    In this script I didn't create any new Stats so: 

    The attack Bonus comes from : Attack Parameter + Agility bonus (since there is no strength I use agility for all weapons)

    and

    The Armor class comes from : Defence Parameter (Which includes Armors and shields) + Agility.

    So the attacker rolls a 20 sided Dice and adds his attack bonus. If he surpasses his targets armor class means he has hitted his target. 
    Then he deals damage equal to his Weapon Damage range (Each weapon may roll with different dices) and also adds his

    strength or dexterity bonus (depends on weapon, I haven't included this in my script).

    I have not created a complete weapon's list in the script so that users can create their own.

    Also in the script, I have a second method for spells.
    Some spells in DnD are like weapons, while others set a Difficulty that the defender must surpass with a dice check (DC).
     There are some others that auto-hit , I have included those for no reason in the script but anyway...

    The spells that work like weapons , are not exaclty the same as weapons. 
    For spells there is also a spellcasting ability bonus (In DnD it is either Intelligence , Wisdom or charisma check -depends on class). In my script I create this with this equation: (Magical Attack / 10 + magical Defence ) / 2

    So for this type of spells : Attack Parameter + Spellcasting bonus + Agility must surpass Armor class in order to hit.

    Spells tha set a DC , may set a Reflex/Agility DC , Fortitude/Max Health DC, Will DC (there are spots for other DCs as well) . The DC is set by this equation : 11 + spellcasting bonus. 

    Here is the script

    Spoiler#--------------------------------------------------------------------------  #--------------------------------------------------------------------------  # DnD Style dmg Formula - Damage for weapons and Spells.   # DnD DFWAS v 1.0  #--------------------------------------------------------------------------  #--------------------------------------------------------------------------    ###########################################################################  ###########################################################################  ### SCRIPT BY Josephkhland ################################################  ### ###################### ################################################  ##  ######################  ###############################################  #    ####################    ##############################################  #-------------------------------------------------------------------------#  ## USAGE ##---------------------------------------------------------------#  ##----------------------------# WEAPONS #---------------------------------#  ## - In the weapon configuration section below set your weapons.#---------#  ## - In the skills you wish to use the following formula just write #-----#  ##                                                                       ##  ##            a.dnd_wpn(a,                                             ##  ##                                                                       ##  ##----------------------------# MAGIC #----------------------------------##  ##                                                                       ##  ##            a.dnd_magic(a,b,magic,effect,id)                           ##  ##                                                                       ##  ##       magic : use an int. Selects in what way to determine if you     ##  ##               succeed or not. 1 for CERTAIN HITS, 2 for SPELLS with   ##  ##               Attack Bonus and Spellcasting ability.                  ##  ##               3 for setting Reflex DC, 4 for Fortitude DC, 5 for Will ##  ##               DC. You may create your own.                            ##   ##      effect : use an int. You may found magic effects at the end of   ##  ##               script, in the method of dnd_magic. You can add your    ##  ##               own effects if you want.By default set to 0             ##  ##          id : use an int. If you have chosen an effect that adds a    ##  ##               state or anything else with an id just right the id of  ##  ##               the item you want it. By default it is set to 1         ##  ##-----------------------------------------------------------------------##  ###########################################################################  ###########################################################################  ###########################################################################  ## I hope you like my script. It is uncomplete yet, if you want you cans ##  ## suggest some improvements.                                            ##  ##                                                                       ##  ## It is not exaclty DnD since I use the original stats ( I just reduced ##  ## them to values close to thos of DnD).                                 ##  ## Reflex DCs are countered with agility                                 ##  ## Fortitude DCs are countered by Max HP / 10                            ##  ## Will DCs are countered by (Magic attack/10 + Magic Defence)/2 + 1     ##   ###########################################################################  ###########################################################################            class Game_Battler < Game_BattlerBase  #-------------------------------------------------------------------------#  # Formula for Weapons and Monsters   #-------------------------------------------------------------------------#    def dnd_wpn(a,     attackBonus = a.atk + a.agi    rolledNumber = 1 + rand(20)    is_it_a_hit = rolledNumber + attackBonus    if a.actor? #If user is an ACTOR      #Weapon enumeration ( ADD ANY MORE WEAPON WITH POSSIBLE DAMAGE HERE)      if a.weapons.include?($data_weapons[2]) #Quarterstaff        staff_double = rand(2)        if staff_double == 0          @wpn_dmg = (1 + rand(6))        else          msgbox_p("Staff Lands two strikes")          @wpn_dmg = 2 + rand(6) + rand(6)        end      elsif a.weapons.include?($data_weapons[3])        @wpn_dmg = (1 + rand(6))      elsif a.weapons.include?($data_weapons[4])        @wpn_dmg = (1 + rand(8))      else        @wpn_dmg = 1 + rand(3)      end    else # If user is a MONSTER, you can edit the following section.       @wpn_dmg = 1 +rand(6)    end    #Return value, if attack is NOT MAGIC    if rolledNumber == 20                     # If critical hit      @custom_Formula_Result = @wpn_dmg * 2    elsif is_it_a_hit > b.def + b.agi         # if simple hit      @custom_Formula_Result = @wpn_dmg    else                                      # if no hit      @custom_Formula_Result = 0    end    return @custom_Formula_Result  end  #--------------------------------------------------------------------------##  # Effects on magic success                                                 ##  #--------------------------------------------------------------------------##  #Method: dnd_magic start---------------------------------------------------##  def dnd_magic(a,b,magic,effect = 1,id = 1)    attackBonus = a.atk + a.agi    rolledNumber = 1 + rand(20)    is_it_a_hit = rolledNumber + attackBonus    spellcasting_abilityBonus = (a.mat / 10 + a.mdf) /2     if magic == 1              # CERTAIN HIT MAGIC      #If you want an effect for all your Certain hit spells put it here.    elsif magic == 2           # USE SPELLCASTING Ability Bonus + Attack Bonus      is_it_a_hit += spellcasting_abilityBonus      if is_it_a_hit > b.def + b.agi        msgbox_p("Spell Success")      else        msgbox_p("Spell Fail")        return 0      end    elsif magic >= 3          # Countered as a DC      spell_DC = 11 + spellcasting_abilityBonus       if magic == 3   # Reflex DC - Agility check        if spell_DC < 1 + rand(20) + b.agi        else          return 0        end      elsif magic == 4       #Fortitude DC - MHP check        if spell_DC < 1 + rand(20) + b.hp / 10        else          return 0        end      elsif magic == 5       #Will DC - WillPower check        willpower = ( b.mat / 10 + b.mdf ) / 2 + 1        if spell_DC < willpower        else          return 0        end      end    end    ## Determining effect Based on argument    if effect == 0 # Damage 1      return (a.mat - b.mdf)    elsif effect == 1 # Add State to user      a.add_state(id)       elsif effect == 2      b.add_state(id) # Add State to target    #elsif effect == 3   # Add your own effects here    end  end  #-------------------------------------------------------------dnd_magic end##end #Game_Battler 



     

    Well in order to balance the stats, I have these Parameter Ranges (for a Mage class):

    Max HP : 6 to 105
    Max Mp: 60 to 1050
    Attack : 1 to 7

    DEF : 10 stable

    MAT : 5 to 50

    MDF : 1 to 15 

    AGI : 1 to 4

    Luck : 9 stable

    Sorry I don't know how to make scripts that support notetags , so I tried to make it as user-friendly as I could without them.
    I hope you like my script and tell me if there can be any improvement...
     


    本贴来自国际rpgmaker官方论坛作者:Josephkhland处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/josephkhlands-dnd-style-damage-formula-dfwas.40852/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 12:38 , Processed in 0.091870 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表