查看: 6402|回复: 9

[原创发布] 改变普通攻击和防护的插件

[复制链接]
梦石
1
星屑
5195
在线时间
51 小时
注册时间
2015-3-7
回帖
1
发表于 2016-1-3 13:59:59 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
新年新手贴,自己用的时候写的,可能很简陋(我是原脚本盲(ΦωΦ)),需要的小伙伴自提吧。
额。。。祝大家新年快乐(=゚ω゚)=



[pre lang="javascript" line="1" file="NTJ_ChangeBaseSkill.js"]//=============================================================================
// NTJ_ChangeBaseSkill.js
//=============================================================================

/*:
* @plugindesc 通过注释更换 攻击 和 防护的技能id。
*  牛头牛头牛头菌
* @author yorlbgy
*
* @help 更换基本技能:
1、在武器/角色/职业  注释上写<aSkillId: 技能id> 如<aSkillId: 3> 更换普通攻击的技能
   在盾牌/武器/角色/职业  注释上写<gSkillId: 技能id> 如<gSkillId: 3> 更换防护的技能
                                                 
2、在角色和职业上面还可以根据武器类型来分别定义
<aSkillIdWith武器类型id: 技能id>  <aSkillIdWith2: 3> 如果装备的是剑就会用技能3作为普通攻击。
<gSkillIdWith武器类型id: 技能id>  同上。
注意:不要再with和武器类型id之间加空格!

3、bug?:我乡下人不会玩,所以插件还有些问题
        1在横板战斗里面,角色的动作有点问题(我还不会改,以后再改吧。
        2由于没有做逃跑的处理,所以请不要把技能改成逃跑这类特别的技能。
                                                               
4、优先级说明:在多个条件满足的时候,优先级如下
        攻击:武器  > 角色武器类型指定 > 角色 > 职业武器类型指定 > 职业
        防护:盾牌 > 武器  > 角色武器类型指定 > 角色 > 职业武器类型指定 > 职业
5、武器类型:参考武器类型列表
        0:无
        1:匕首
        2:剑
        3:链枷
        4:斧
        5:鞭
        6:杖
        7:弓
        8:弩
        9:枪
        10:爪
        11:手套
        12:矛
*/
(function() {
       
               
               
                var _Game_ActorattackSkillId = Game_Actor.prototype.attackSkillId;
               
                if(!_Game_ActorattackSkillId){
                        _Game_ActorattackSkillId = function(){
                                return 1;
                        }
                }
               
                var My_Game_ActorattackSkillIdStr = function(){
                       
                        if(!this.hasNoWeapons()){
                                for(var i = 0;i<this.weapons().length;i++){
                                        var weaponAttackId = this.weapons().meta.aSkillId;
                                        if(weaponAttackId){
                                                return weaponAttackId;
                                        }
                                }
                       
                                var actorWeaponAttackId = this.actor().meta["aSkillIdWith"+this.weapons()[0].wtypeId];
                                if(actorWeaponAttackId){
                                        return actorWeaponAttackId;
                                }
                               

                        }
                       
                        var actorAttackId = this.actor().meta.aSkillId;
                        if(actorAttackId){
                                return actorAttackId;
                        }
                       
                        if(!this.hasNoWeapons()){
                                var classWeaponAttackId = this.currentClass().meta["aSkillIdWith"+this.weapons()[0].wtypeId];
                                        if(classWeaponAttackId){
                                                return classWeaponAttackId;
                                        }
                        }

                        var classAttackId = this.currentClass().meta.aSkillId;
                        if(classAttackId){
                                return classAttackId;
                        }
                       
                        var result = _Game_ActorattackSkillId.call(this);
                    return result;
                       
                };
               
                Game_Actor.prototype.attackSkillId = function(){
                        var result =  My_Game_ActorattackSkillIdStr.call(this);
                        if(!result) {
                                return 1;
                        }
                        return Number(result);
                }
               
               
               
               
                var _Game_ActorguardSkillId = Game_Actor.prototype.guardSkillId;
               
               
                if(!_Game_ActorguardSkillId){
                        _Game_ActorguardSkillId = function(){
                                return 2;
                        }
                }
               
                var My_Game_ActorguardSkillId = function(){
                        for(var i=0;i<this.armors().length;i++){
                                var shield = this.armors();       
                                if(shield.etypeId == 2){
                                        var guardSkillId = shield.meta.gSkillId;
                                        if(guardSkillId){
                                                return guardSkillId;
                                        }
                                }
                        }
                       
                        if(!this.hasNoWeapons()){
                                for(var i = 0;i<this.weapons().length;i++){
                                        var weaponGuardId = this.weapons().meta.gSkillId;
                                        if(weaponGuardId){
                                                return weaponGuardId;
                                        }
                                }
                       
                                var actorWeaponGuardId = this.actor().meta["gSkillIdWith"+this.weapons()[0].wtypeId];
                                if(actorWeaponGuardId){
                                        return actorWeaponGuardId;
                                }
                               

                        }
                       
                       
                       
                        var actorGuardId = this.actor().meta.gSkillId;
                        if(actorGuardId){
                                return actorGuardId;
                        }
                       
                        if(!this.hasNoWeapons()){
                                var classWeaponGuardId = this.currentClass().meta["gSkillIdWith"+this.weapons()[0].wtypeId];
                                if(classWeaponGuardId){
                                        return classWeaponGuardId;
                                }
                        }
                       
                        var classGuardId = this.currentClass().meta.gSkillId;
                        if(classGuardId){
                                return classGuardId;
                        }
                       
                        var result = _Game_ActorguardSkillId.call(this);
                        return result;
                }
               
               
               
                Game_Actor.prototype.guardSkillId = function(){
                        var result = My_Game_ActorguardSkillId.call(this);
                        if(!result){
                                return 2;
                        }
                        return Number(result);
                };
          
})();[/pre]

评分

参与人数 2梦石 +1 赞 +1 收起 理由
NinjaMajik + 1 认可答案
余烬之中 + 1 原创发布

查看全部评分

梦石
0
星屑
50
在线时间
51 小时
注册时间
2017-2-21
回帖
2
发表于 2017-4-7 17:32:52 | 显示全部楼层
好东西,解决了我一直很困惑的问题
回复

使用道具 举报

梦石
0
星屑
271
在线时间
50 小时
注册时间
2012-2-13
回帖
47
发表于 2017-4-7 18:57:38 | 显示全部楼层
干啥用的这个
回复

使用道具 举报

梦石
0
星屑
284
在线时间
35 小时
注册时间
2017-7-23
回帖
2
发表于 2019-8-12 01:39:41 | 显示全部楼层
非常感谢,帮大忙了!
回复

使用道具 举报

梦石
0
星屑
347
在线时间
53 小时
注册时间
2019-9-11
回帖
15
发表于 2019-9-15 20:32:25 | 显示全部楼层

非常感谢,帮大忙了!
回复

使用道具 举报

梦石
0
星屑
46
在线时间
10 小时
注册时间
2019-11-1
回帖
1
发表于 2019-11-9 06:12:11 | 显示全部楼层
这两天一直在纠结怎么改远程职业的普攻,谢谢楼主
回复

使用道具 举报

梦石
0
星屑
68
在线时间
31 小时
注册时间
2009-7-29
回帖
63
发表于 2020-1-29 03:29:19 | 显示全部楼层
感觉不错哦,谢谢分享!
回复

使用道具 举报

梦石
0
星屑
153
在线时间
33 小时
注册时间
2020-5-16
回帖
14
发表于 2020-5-24 07:04:16 | 显示全部楼层
请问一下,为什么我保存成js格式插件加载后没有反应?
回复

使用道具 举报

梦石
0
星屑
153
在线时间
33 小时
注册时间
2020-5-16
回帖
14
发表于 2020-5-24 07:53:57 | 显示全部楼层
神喵君 发表于 2020-5-24 07:04
请问一下,为什么我保存成js格式插件加载后没有反应?

已经解决问题了
回复

使用道具 举报

梦石
0
星屑
1964
在线时间
217 小时
注册时间
2009-11-10
回帖
202
发表于 2020-10-30 19:46:43 | 显示全部楼层
这个可以啊 很实用啊 谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部