|
楼主 |
发表于 2008-3-12 19:14:02
|
显示全部楼层
目的就在与想用JASS 而不用其他的.
经过zhuzeitou发布的技能,再进行了一番研究后得到下面的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()) == 1 ) ) 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(), 100.00, 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 )
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_Conditions 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(), 1 )
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
这个JASS有伤害了,伤害值固定100.可是改成(敏捷/2 × 技能等级)的话就没伤害了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()) == 1 ) ) 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(GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true)) / 2.00 ) * I2R(GetUnitAbilityLevelSwapped('A049', 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 )
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_Conditions 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(), 1 )
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]
就是把
[codes=jass]function Trig_MRJ_Func003A takes nothing returns nothing
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), 100.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
endfunction[/codes]
改成
[codes=jass]function Trig_MRJ_Func003A takes nothing returns nothing
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true)) / 2.00 ) * I2R(GetUnitAbilityLevelSwapped('A049', GetTriggerUnit())) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
endfunction[/codes]
后无伤害了 |
|