|
楼主 |
发表于 2009-1-30 17:27:52
|
显示全部楼层
对啊
所以我修改过一次了的
现在是新的
globals
group DamagedGroup
trigger gg_SpiritLightening
endglobals
function SpiritLightening_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function SpiritLightening_owningplayerboolean takes nothing returns boolean
return ( GetOwningPlayer(GetEnumUnit()) != ForcePickRandomPlayer(GetPlayersAllies(GetOwningPlayer(GetTriggerUnit()))) )
endfunction
function SpiritLightening_damagedunitboolean takes nothing returns boolean
return ( GetEnumUnit() != GroupPickRandomUnit(DamagedGroup) )
endfunction
function SpiritLightening_hero takes nothing returns boolean
return ( IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == true )
endfunction
function SpiritLightening_boolean1 takes nothing returns boolean
return GetBooleanAnd( SpiritLightening_owningplayerboolean(), SpiritLightening_damagedunitboolean() )
endfunction
function SpiritLightening_boolean takes nothing returns boolean
return GetBooleanAnd( SpiritLightening_boolean1(), SpiritLightening_hero() )
endfunction
function SpiritLightening_Actions takes nothing returns nothing
local unit ThunderAim
local real ManaDamage
local integer forloopAindex
local integer forloopAindexend
local effect array Buffeffect
local effect array Lighteneffect
local location AimDot
set ThunderAim = GetSpellAbilityUnit()
set ManaDamage = ( 60.00 + I2R( GetUnitAbilityLevel(GetTriggerUnit(), 'A000')) * 35)
set forloopAindex = 1
set forloopAindexend = ( GetUnitAbilityLevel(GetTriggerUnit(), 'A000') + 1 )
loop
exitwhen forloopAindex > forloopAindexend
set AimDot = GetUnitLoc(ThunderAim)
call UnitDamageTargetBJ( GetTriggerUnit(), ThunderAim, RMinBJ(ManaDamage, GetUnitState(GetTriggerUnit(), UNIT_STATE_MANA)), false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
call SetUnitManaBJ( ThunderAim, RMaxBJ(0.00, ( GetUnitState(ThunderAim, UNIT_STATE_MANA) - ManaDamage )) )
call AddSpecialEffectTargetUnitBJ( "origin", ThunderAim, "Abilities\\\\Spells\\\\NightElf\\\\ManaBurn\\\\ManaBurnTarget.mdl" )
set Buffeffect[forloopAindex] = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "overhead", ThunderAim, "Abilities\\\\Spells\\\\Other\\\\Monsoon\\\\MonsoonBoltTarget.mdl" )
set Lighteneffect[forloopAindex] = GetLastCreatedEffectBJ()
call GroupAddUnitSimple( ThunderAim, DamagedGroup )
set ThunderAim = null
set ThunderAim = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(500.00, AimDot, Condition(function SpiritLightening_boolean)))
set forloopAindex = forloopAindex + 1
endloop
set forloopAindex = 1
loop
exitwhen forloopAindex > forloopAindexend
call TriggerSleepAction( 0.10 )
call DestroyEffect(Buffeffect[forloopAindex])
call DestroyEffect(Lighteneffect[forloopAindex])
set Buffeffect[forloopAindex] = null
set Lighteneffect[forloopAindex] = null
endloop
call RemoveLocation(AimDot)
set AimDot = null
call GroupClear(DamagedGroup)
set DamagedGroup = null
endfunction
//===========================================================================
function Jass_SpiritLightening takes nothing returns nothing
set gg_SpiritLightening = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_SpiritLightening, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_SpiritLightening, Condition( function SpiritLightening_Conditions ) )
call TriggerAddAction( gg_SpiritLightening, function SpiritLightening_Actions )
endfunction
JASSSHOP的报错信息如图
|
|