找回密码
 点一下
查看: 1558|回复: 6

求助:请高手帮忙看看我这技能下面哪里错了?

  [复制链接]
发表于 2008-3-17 21:41:00 | 显示全部楼层 |阅读模式
由于JASS无人回答,故发到技能区
如题:我是想让英雄在拿到装备后可以加强技能杀伤力,在没拿到时是((技能×敏捷)/4)的伤害,在拿到装备后是((技能×敏捷)/2)的伤害.JASS如下:请问哪里错了,应该怎么改?
[codes=jass]//===========================================================================
// Trigger: MRJ
//===========================================================================
function Trig_MRJ_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'o000' ) ) then
        return false
    endif
    if ( not ( GetTriggerUnit() == GetKillingUnitBJ() ) ) then
        return false
    endif
    if ( not ( GetUnitUserData(GetTriggerUnit()) != 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_MRJ_Func002Func003001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true )
endfunction

function Trig_MRJ_Func002Func003001003002 takes nothing returns boolean
    return ( IsPlayerInForce(GetOwningPlayer(GetFilterUnit()), GetPlayersAllies(GetOwningPlayer(GetTriggerUnit()))) == false )
endfunction

function Trig_MRJ_Func002Func003001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_MRJ_Func002Func003001003001(), Trig_MRJ_Func002Func003001003002() )
endfunction

function Trig_MRJ_Func002Func003A takes nothing returns nothing
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( I2R(GetUnitUserData(GetTriggerUnit())) / 4.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
endfunction

function Trig_MRJ_Func002Func002001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true )
endfunction

function Trig_MRJ_Func002Func002001003002 takes nothing returns boolean
    return ( IsPlayerInForce(GetOwningPlayer(GetFilterUnit()), GetPlayersAllies(GetOwningPlayer(GetTriggerUnit()))) == false )
endfunction

function Trig_MRJ_Func002Func002001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_MRJ_Func002Func002001003001(), Trig_MRJ_Func002Func002001003002() )
endfunction

function Trig_MRJ_Func002Func002A takes nothing returns nothing
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( I2R(GetUnitUserData(GetTriggerUnit())) / 2.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
endfunction

function Trig_MRJ_Conditions takes nothing returns nothing
    if ( Trig_MRJ_Func002C() ) then
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_MRJ_Func002Func002001003)), function Trig_MRJ_Func002Func002A )
    else
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_MRJ_Func002Func003001003)), function Trig_MRJ_Func002Func003A )
    endif
    call RemoveLocation(GetUnitLoc(GetTriggerUnit()))
    call DestroyForce(GetPlayersAllies(GetOwningPlayer(GetTriggerUnit())))
endfunction

//===========================================================================
function InitTrig_MRJ takes nothing returns nothing
    set gg_trg_MRJ = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MRJ, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_MRJ, Condition( function Trig_MRJ_Conditions ) )
    call TriggerAddAction( gg_trg_MRJ, function Trig_MRJ_Actions )
endfunction

//===========================================================================
// Trigger: MRJ1
//===========================================================================
function Trig_MRJ1_Actions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'o000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_MRJ1_Actions takes nothing returns nothing
    call SetUnitUserData( GetTriggerUnit(), ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetSummoningUnit(), true) * GetUnitAbilityLevelSwapped('A049', GetSummoningUnit()) ) )
endfunction

function Trig_MRJ1_Func002C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'o000' ) ) then
        return false
    endif
    if ( not ( UnitHasItemOfTypeBJ(GetSummoningUnit(), 'nspi') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_MRJ1_Actions takes nothing returns nothing
    call SetUnitUserData( GetTriggerUnit(), ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetSummoningUnit(), true) * GetUnitAbilityLevelSwapped('A049', GetSummoningUnit()) ) )
endfunction

//===========================================================================
function InitTrig_MRJ1 takes nothing returns nothing
    set gg_trg_MRJ1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MRJ1, EVENT_PLAYER_UNIT_SUMMON )
    call TriggerAddCondition( gg_trg_MRJ1, Condition( function Trig_MRJ1_Conditions ) )
    call TriggerAddAction( gg_trg_MRJ1, function Trig_MRJ1_Actions )
endfunction[/codes]
发表于 2008-3-17 21:52:06 | 显示全部楼层
具体是什么错误?
回复

使用道具 举报

发表于 2008-3-17 21:58:53 | 显示全部楼层
怎么这么多action??
回复

使用道具 举报

发表于 2008-3-17 21:59:16 | 显示全部楼层
我是在休假后来职业审贴的~~
不过似乎LZ的问题不在我的能力范围之内!
偶今天就代替LZ守侯高手出现吧
回复

使用道具 举报

发表于 2008-3-17 22:05:29 | 显示全部楼层
去哪休假了,真爽....
回复

使用道具 举报

发表于 2008-3-17 22:38:04 | 显示全部楼层
代码不全,Trig_MRJ_Func002C函数没有定义,Trig_MRJ_Conditions函数重复了,并且函数返回值都不同。看楼主的函数名,应该是T转成J的,但是怎么会重名?
回复

使用道具 举报

 楼主| 发表于 2008-3-18 06:23:23 | 显示全部楼层
恩 问题已经解决 自己研究出来的 哈哈
[codes=jass]//===========================================================================
// Trigger: MRJ
//===========================================================================
function Trig_MRJ_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'o000' ) ) then
        return false
    endif
    if ( not ( GetTriggerUnit() == GetKillingUnitBJ() ) ) then
        return false
    endif
    if ( not ( GetUnitUserData(GetTriggerUnit()) != 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_MRJ_Func003001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true )
endfunction

function Trig_MRJ_Func003001003002 takes nothing returns boolean
    return ( IsPlayerInForce(GetOwningPlayer(GetFilterUnit()), GetPlayersAllies(GetOwningPlayer(GetTriggerUnit()))) == false )
endfunction

function Trig_MRJ_Func003001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_MRJ_Func003001003001(), Trig_MRJ_Func003001003002() )
endfunction

function Trig_MRJ_Func003A takes nothing returns nothing
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( I2R(GetUnitUserData(GetTriggerUnit())) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
endfunction

function Trig_MRJ_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_MRJ_Func003001003)), function Trig_MRJ_Func003A )
    call RemoveLocation(GetUnitLoc(GetTriggerUnit()))
    call DestroyForce(GetPlayersAllies(GetOwningPlayer(GetTriggerUnit())))
endfunction

//===========================================================================
function InitTrig_MRJ takes nothing returns nothing
    set gg_trg_MRJ = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MRJ, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_MRJ, Condition( function Trig_MRJ_Conditions ) )
    call TriggerAddAction( gg_trg_MRJ, function Trig_MRJ_Actions )
endfunction

//===========================================================================
// Trigger: MRJ1
//===========================================================================
function Trig_MRJ1_Func001001001 takes nothing returns boolean
    return ( UnitHasItemOfTypeBJ(GetSummoningUnit(), 'nspi') == true )
endfunction

function Trig_MRJ1_Func001001002 takes nothing returns boolean
    return ( GetUnitTypeId(GetTriggerUnit()) == 'o000' )
endfunction

function Trig_MRJ1_Func001001 takes nothing returns boolean
    return GetBooleanAnd( Trig_MRJ1_Func001001001(), Trig_MRJ1_Func001001002() )
endfunction

function Trig_MRJ1_Actions takes nothing returns nothing
    if ( Trig_MRJ1_Func001001() ) then
        call SetUnitUserData( GetTriggerUnit(), ( ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetSummoningUnit(), true) / 2 ) * GetUnitAbilityLevelSwapped('A049', GetSummoningUnit()) ) )
    else
        call SetUnitUserData( GetTriggerUnit(), ( ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetSummoningUnit(), true) / 4 ) * GetUnitAbilityLevelSwapped('A049', GetSummoningUnit()) ) )
    endif
endfunction

//===========================================================================
function InitTrig_MRJ1 takes nothing returns nothing
    set gg_trg_MRJ1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MRJ1, EVENT_PLAYER_UNIT_SUMMON )
    call TriggerAddAction( gg_trg_MRJ1, function Trig_MRJ1_Actions )
endfunction[/codes]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-6-27 17:57 , Processed in 0.032002 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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