战网中国

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2031|回复: 12
打印 上一主题 下一主题

哎,虽然不报什么希望,还是发出来,希望有人看了能解决

[复制链接]

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
跳转到指定楼层
楼主
发表于 2013-11-24 19:54:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
韩国3.6 AUTOBUS功能中关于崔凡克杀议会成员(3c)的模块。
这个模块本身没有什么问题,但是这个模块是针对非资料片里冰封球法师,在装备不好的时候,跟3C打游击战用的。我想改到资料片里使用,但在资料片里用这个脚本,无论是Blizzard法师、纯电法、TP+ BH PAL一用这个脚本就会弹错。具体是SorceressAttack这个函数报错,我只想改成像普通MF那样攻击,怎么改都不行,请哪位大哥抽时间看看怎么改动下……
回复

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
沙发
 楼主| 发表于 2013-11-24 19:57:14 | 只看该作者
function SorceressAttack(target, isBoss, maxAttacks, conviction)
    {
        var _index = [isBoss ? 1 : 3, 5, 7];
        var i;
        for (i = 0; i < _index.length; i++)
        {
            if (MyConfig_AttackSkill[_index][0] > -1 && ((conviction > 1 && (My.Attack.CheckConvictionSkillDamage(_index) || My.Attack.CheckConvictionPhysicalDamage(target))) || My.Attack.GetResistance(target, My.Attack.skillDamage[_index]) < 100))
                return SorceressCast(target, isBoss, _index, maxAttacks, conviction);
        }
        if ((isBoss || My.Unit.IsBaalSummon(target)) && My.Attack.CheckMercAttack(target) && My.Attack.CheckSafe())
        {
            var _pos;
            var _iAttack, _targetHp;
            var _checkMonster, _isTelekinesis;
            var _merc = NTC_GetMerc();
            if (_merc)
            {
                _checkMonster  = MyConfig_CheckMonster[0];
                _isTelekinesis = NTC_GetSkillLevel(43) > 0;
                _iAttack       = 0;
                _targetHp      = target.hp;
                MyConfig_MercAttack[0]   = false;
                MyConfig_CheckMonster[0] = false;
                while (My.Unit.CheckLife(target))
                {
                    My.Attack.SorceressStaticField(target, MyConfig_SorceressStaticKeep[isBoss ? 0 : 1], MyConfig_SorceressStaticSkip[isBoss ? 0 : 1], MyConfig_SorceressStaticUse[0]);
                    if (GetDistance(me, target) > 7 || !CheckCollision(me, target, 1))
                    {
                        _pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, 6, 1);
                        _pos ? My.Move.MoveTo(target.areaid, _pos[0], _pos[1], 0) : My.Move.MoveTo(target.areaid, target.x, target.y, 0);
                    }
                    if (!My.Attack.ClearPosition(15))
                        Delay(1000);
                    if (_isTelekinesis)
                    {
                        NTC_SwapWeapons(0);
                        while (GetDistance(me, target) <= 4 && My.Unit.CheckLife(target))
                            NTC_CastSkill(43, NTC_HAND_RIGHT, target);
                    }
                    if (GetDistance(target, _merc) > 7)
                        My.Move.MoveTo(target.areaid, target.x, target.y, 0);
                    if ((++_iAttack % 15) == 0)
                    {
                        if (target.hp < _targetHp)
                            _targetHp = target.hp;
                        else
                        {
                            MyConfig_CheckMonster[0] = _checkMonster;
                            MyConfig_MercAttack[0]   = true;
                            return false;
                        }
                    }
                }
                MyConfig_CheckMonster[0] = _checkMonster;
                MyConfig_MercAttack[0]   = true;
                return true;
            }
        }
        return false;
    }
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
板凳
 楼主| 发表于 2013-11-24 19:57:28 | 只看该作者
function SorceressCast(target, isBoss, index, maxAttacks, conviction)
    {
        var _iAttack   = 0;
        var _iRetry    = 0;
        var _attacks   = isBoss ? 8 : (MyConfig_AttackSkill[index][0] == 64) ? 2 : (MyConfig_AttackSkill[index][0] == 49 || MyConfig_AttackSkill[index][0] == 53) ? 3 : 4;
        var _isFailure = false;
        var _option1   = { target: target, boss: isBoss, index: index, flying: !isBoss && My.Unit.IsFlying(target), vulture: !isBoss && My.Unit.IsVulture(target) };
        var _option2   = { target: target, boss: false, index: index + 1, flying: _option1.flying, vulture: _option1.vulture };
        var _targetHp  = target.hp;

        while (My.Unit.CheckLife(target))
        {
            if (_iAttack > maxAttacks && maxAttacks > 0)
                return false;

            if (MyConfig_AttackSkill[index][0] != 42)
            {
                if (!MyConfig_TravincalSafe || _isFailure)
                {
                    if (!My.Attack.Collision(_option1))
                        return false;
                }
                else
                    SorceressTravincalCollision(_option1);
            }

            if ((_iAttack % 3) == 0)
                My.Precast.CheckPrecast(1);

            if (conviction > 1)
            {
                if (!My.Attack.CheckConvictionResistance(target, index, conviction, _iAttack > 2))
                    return false;
            }

            if (_iAttack == 0 && index > 0)
                My.Attack.SorceressStaticField(target, MyConfig_SorceressStaticKeep[isBoss ? 0 : 1], MyConfig_SorceressStaticSkip[isBoss ? 0 : 1], MyConfig_SorceressStaticUse[isBoss ? 0 : 1]);

            if (!My.Unit.CheckLife(target))
                return true;

            if (MyConfig_AttackSkill[index][0] != 42)
            {
                NTC_SwapWeapons(0);
                NTC_CastSkill(MyConfig_AttackSkill[index][0], My.Attack.skillHand[index], target);
            }
            else
                My.Attack.SorceressStaticField(target, MyConfig_SorceressStaticKeep[isBoss ? 0 : 1], MyConfig_SorceressStaticSkip[isBoss ? 0 : 1], MyConfig_SorceressStaticSkill, (index > 0) ? 65535 : 1);

            if (index == 0)
                return !My.Unit.CheckLife(target);

            if (MyConfig_AttackSkill[index + 1][0] > -1 && My.Attack.GetResistance(target, My.Attack.skillDamage[index + 1]) < 100)
            {
                if (MyConfig_AttackSkill[index + 1][0] != 42)
                {
                    while (me.GetSkillStatus(MyConfig_AttackSkill[index][0]) == 8 || (MyConfig_SorceressStaticSkill > 0 && MyConfig_AttackSkill[index][0] == 42 && Math.floor(target.hp * 100 / target.hpmax) < MyConfig_SorceressStaticSkill))
                    {
                        if (!My.Unit.CheckLife(target))
                            return true;

                        if (!MyConfig_TravincalSafe)
                        {
                            if (!My.Attack.Collision(_option2))
                                break;
                        }
                        else
                            SorceressTravincalCollision(_option2);

                        if (me.GetSkillStatus(MyConfig_AttackSkill[index + 1][0]) != 8)
                        {
                            NTC_SwapWeapons(0);
                            NTC_CastSkill(MyConfig_AttackSkill[index + 1][0], My.Attack.skillHand[index + 1], target);
                        }
                        else
                            Delay(NTC_DELAY_FRAME);
                    }
                }
                else
                    My.Attack.SorceressStaticField(target, MyConfig_SorceressStaticKeep[isBoss ? 0 : 1], MyConfig_SorceressStaticSkip[isBoss ? 0 : 1], MyConfig_SorceressStaticSkill, 65535, MyConfig_AttackSkill[index][0]);
            }

            while (me.GetSkillStatus(MyConfig_AttackSkill[index][0]) == 8)
            {
                if (!My.Unit.CheckLife(target))
                    return true;

                Delay(NTC_DELAY_FRAME);
            }

            if ((++_iAttack % _attacks) == 0 && maxAttacks > 0)
            {
                if (target.hp < _targetHp)
                {
                    _isFailure = false;
                    _targetHp  = target.hp;
                }
                else if (_iRetry++ < (isBoss ? 2 : 1))
                {
                    if (!My.Move.MoveTo(target.areaid, target.x, target.y, 0))
                        return false;

                    _isFailure = true;
                }
                else
                    return false;
            }
        }

        return true;
    }

    function SorceressTravincalCollision(option)
    {
        var _countMonster1 = [[0, My.Attack.travincalWaypoint.x + 97, My.Attack.travincalWaypoint.y - 91], [0, My.Attack.travincalWaypoint.x + 70, My.Attack.travincalWaypoint.y - 81], [0, My.Attack.travincalWaypoint.x + 72, My.Attack.travincalWaypoint.y - 102]];
        var _countMonster2 = [[0, My.Attack.travincalWaypoint.x + 63, My.Attack.travincalWaypoint.y - 65], [0, My.Attack.travincalWaypoint.x + 92, My.Attack.travincalWaypoint.y - 65]];
        var _countMonster3 = [[0, My.Attack.travincalWaypoint.x + 85, My.Attack.travincalWaypoint.y - 65], [0, My.Attack.travincalWaypoint.x + 115, My.Attack.travincalWaypoint.y - 65]];
        var i;
        var _unit;
        var _unitX, _unitY, _location;

        if (option.target.x >= (My.Attack.travincalWaypoint.x + 68) && option.target.y >= (My.Attack.travincalWaypoint.y - 102) && option.target.x <= (My.Attack.travincalWaypoint.x + 108) && option.target.y <= (My.Attack.travincalWaypoint.y - 81))
            _location = (option.target.x >= (My.Attack.travincalWaypoint.x + 90) && option.target.y >= (My.Attack.travincalWaypoint.y - 87)) ? 3 : 1;
        else if (option.target.y <= (My.Attack.travincalWaypoint.y - 58))
            _location = (option.target.x <= (My.Attack.travincalWaypoint.x + 90)) ? 2 : 3;
        else
            return My.Attack.Collision(option);

        _unit = NTC_FindUnit(NTC_UNIT_MONSTER);
        if (_unit)
        {
            do
            {
                if ((_unit.classid == 345 || _unit.classid == 346) && My.Unit.CheckLife(_unit))
                {
                    _unitX = _unit.x;
                    _unitY = _unit.y;

                    switch (_location)
                    {
                    case 1:
                        for (i = 0; i < _countMonster1.length; i++)
                        {
                            if (GetDistance(_unitX, _unitY, _countMonster1[1], _countMonster1[2]) <= 7)
                                _countMonster1[0]++;
                        }
                        break;
                    case 2:
                        for (i = 0; i < _countMonster2.length; i++)
                        {
                            if (GetDistance(_unitX, _unitY, _countMonster2[1], _countMonster2[2]) <= 7)
                                _countMonster2[0]++;
                        }
                        break;
                    case 3:
                        for (i = 0; i < _countMonster3.length; i++)
                        {
                            if (GetDistance(_unitX, _unitY, _countMonster3[1], _countMonster3[2]) <= 7)
                                _countMonster3[0]++;
                        }
                        break;
                    }
                }
            } while (_unit.GetNext());
        }

        switch (_location)
        {
        case 1: _countMonster1.sort(My.Common.SortAscending); return My.Move.MoveTo(me.areaid, _countMonster1[0][1], _countMonster1[0][2]);
        case 2: _countMonster2.sort(My.Common.SortAscending); return My.Move.MoveTo(me.areaid, _countMonster2[0][1], _countMonster2[0][2]);
        case 3: _countMonster3.sort(My.Common.SortAscending); return My.Move.MoveTo(me.areaid, _countMonster3[0][1], _countMonster3[0][2]);
        }
    }
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
地板
 楼主| 发表于 2013-11-24 19:58:16 | 只看该作者
....
贴上来没法看,在韩国BOT3.6的scripts\\NTBot\\bots\\AutoBusDriver.ntj里,
回复 支持 反对

使用道具 举报

25

主题

264

帖子

2098

积分

精灵王

Rank: 6Rank: 6

积分
2098

社区居民忠实会员

5#
发表于 2013-11-24 20:28:31 | 只看该作者
MyConfig_TravincalSafe  把这个变量设为FALSE就行了吧
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
6#
 楼主| 发表于 2013-11-24 20:34:22 | 只看该作者
我试试……
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
7#
 楼主| 发表于 2013-11-24 20:50:41 | 只看该作者
MyConfig_TravincalSafe   这个变量的取当前游戏难度的,貌似是个解决方案。
因为在普通难度,CHAR就是直接上去硬拼,噩梦难度据是打游击。
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
8#
 楼主| 发表于 2013-11-24 20:56:21 | 只看该作者
现在问题是我应该怎么修改呢?
    MyConfig_TravincalSafe        = me.diff;
md.diff改成什么代表普通难度?
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
9#
 楼主| 发表于 2013-11-24 20:59:35 | 只看该作者
MyConfig_TravincalSafe 按道理应该是一个整型数据吧,怎么在后面的语句中被拿来做IF的判定条件,作为布尔型变量,对JSP语法不是很了解
回复 支持 反对

使用道具 举报

18

主题

86

帖子

450

积分

骑士

Rank: 4

积分
450
10#
 楼主| 发表于 2013-11-24 21:00:52 | 只看该作者
在NTBOT中,0代表普通难度,1代表噩梦,2代表地狱吗?
这样就好理解了,试试……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|BattleCN ( 陕ICP备05006600号 )

GMT+8, 2025-2-12 02:27 , Processed in 0.058658 second(s), 22 queries .

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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