call FlushHashInteger(TargetIndex)
//��չ�ϣ���е�TargetIndex����λ
call FlushStoredMission(udg_GC,(MissionKey))
//�����Ϸ����udg_GC�� MissionKey����Ŀ
call DisableTriggerCustom(t)
//�رմ�����t
endif
set t=null
//��ձ���t
set U1=null
//��ձ���U1
set U=null
//��ձ���U
set U2=null
//��ձ���U2
set l=null
//��ձ���l
return false
//���� ��
endfunction
function TouZhi_ShiLongQiShi_BianShen takes unit u returns boolean
//�����
return GetUnitTypeId(u)=='H00F' or GetUnitTypeId(u)=='H00E' or GetUnitTypeId(u)=='H00G'
//���� ��λu�ĵ�λ������"����ʿ(����)" ���� ��λu�ĵ�λ������"����ʿ(����)" ���� ��λu�ĵ�λ������"����ʿ(����)"
endfunction
function TouZhi_Acti takes nothing returns nothing
//�����
local unit U1=GetTriggerUnit()
//�����ֲ���λ����U1 ��ʹ֮=������λ
local unit U=TouZhi_PickRandomUnit(U1)
//�����ֲ���λ����U ��ʹ֮= ����TouZhi_PickRandomUnit(��λU1)�ķ���ֵ
local unit U2=GetSpellTargetUnit()
//�����ֲ���λ����U2 ��ʹ֮=����ʩ��Ŀ�굥λ
local trigger t=CreateTrigger()
//�����ֲ�����������t ��ʹ֮= ִ����������Ĵ�����
local string MissionKey=(I2S(H2I((t))))
//�����ֲ��ַ�������MissionKey ��ʹ֮=��������t�ĵ�ַת��Ϊ�ַ���
call SetUnitAnimationByIndex(U1,4)
//���ŵ�λU1��#4����
call PauseUnit(U,true)
//��ͣ��λU
call SetUnitPathing(U,false)
//�رյ�λU����ײ
if TouZhi_ShiLongQiShi(U)==false then
//��� ��λU�ĵ�λ���Ͳ���"�����Ժ������ʿ" ��
call UnitAddAbility(U,'Amrf')
//����λU���"��ѻ��̬"����
call UnitRemoveAbility(U,'Amrf')
//�Ե�λUɾ��"��ѻ��̬"����
endif
call StoreInteger(udg_GC,((I2S(H2I(((U)))))),("state"+("Tossed")),(1))
//����Ϸ����udg_GC�� ����λU�ĵ�ַת��Ϊ�ַ�������Ŀ ��"state"+"Tossed"����� ����������1
call StoreInteger(udg_GC,(MissionKey),("Hero"),H2I((U1)))
//����Ϸ����udg_GC�� MissionKey��Ŀ ��"Hero"����� ������������λU1�ĵ�ַ
call StoreInteger(udg_GC,(MissionKey),("Source"),H2I((U)))
//����Ϸ����udg_GC�� MissionKey��Ŀ ��"Source"����� ������������λU�ĵ�ַ
call StoreInteger(udg_GC,(MissionKey),("TargetIndex"),(SaveHashUnit(U2)))
//����Ϸ����udg_GC�� MissionKey��Ŀ ��"TargetIndex"����� ������������λU2�Ĺ�ϣ������λ
call StoreInteger(udg_GC,(MissionKey),("FX"),H2I((AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCann\\FlakTarget.mdl",U1,"origin"))))
//�ڵ�λU1�Ľ��´���<�����ڻ�(Ŀ��)>������Ч�� �������ĵ�ַ������Ϸ����udg_GC�� MissionKey��Ŀ ��"FX"�����
call StoreReal(udg_GC,(MissionKey),("x0"),((GetUnitX(U2))*1.0))
//����Ϸ����udg_GC�� MissionKey��Ŀ ��"x0"����� ����ʵ������λU2��X����
call StoreReal(udg_GC,(MissionKey),("y0"),((GetUnitY(U2))*1.0))
//����Ϸ����udg_GC�� MissionKey��Ŀ ��"y0"����� ����ʵ������λU2��Y����
call TriggerRegisterTimerEvent(t,0.02,true)
//Ϊ������tע���¼���ÿ0.02�봥��һ��
call TriggerAddCondition(t,Condition(function TouZhi_Main))
//������t���������TouZhi_Main
set U1=null
//��ձ���U1
set U=null
//��ձ���U
set U2=null
//��ձ���U2
set t=null
//��ձ���t
endfunction
function TouZhi_Check takes nothing returns nothing
//�����
local unit U1=GetTriggerUnit()
//�����ֲ���λ����U1 ��ʹ֮=������λ
local unit U=TouZhi_PickRandomUnit(U1)
//�����ֲ���λ����U ��ʹ֮= ����TouZhi_PickRandomUnit(��λU1)�ķ���ֵ
local unit U2=GetSpellTargetUnit()
//�����ֲ���λ����U2 ��ʹ֮=����ʩ��Ŀ�굥λ
if U==null then
//��� ��λU�ǿյ�λ ��
call UnitESCSpell(U1)
//���λU1ȡ��ʹ�ü���
call DisplayErrorMessage(GetOwningPlayer(U1),(GetObjectName(('n0DA'))))
//�Ե�λU1�����������ʾ������Ϣ��"û�п���Ͷ���ĵ�λ"
elseif GetOwningPlayer(U2)==GetOwningPlayer(U)then
//������� ��λU2���������=��λU��������� ��
call UnitESCSpell(U1)
//���λU1ȡ��ʹ�ü���
call DisplayErrorMessage(GetOwningPlayer(U1),(GetObjectName(('n0CY'))))
//�Ե�λU1�����������ʾ������Ϣ��"����Ͷ�����Լ��ĵ�λ"
endif
set U1=null
//��ձ���U1
set U=null
//��ձ���U
set U2=null
//��ձ���U2
endfunction
function TouZhi_Conditi takes nothing returns boolean
//�����
if GetSpellAbilityId()=='A0BZ' then
//��� ʹ�õļ�����"Ͷ��" ��
if GetTriggerEventId()==EVENT_PLAYER_UNIT_SPELL_CAST then
//��� �����¼��ǵ�λ��ʼʩ�ż��� ��
call TouZhi_Check()
//ִ�к���TouZhi_Check()
else
//����
call TouZhi_Acti()
//ִ�к���TouZhi_Acti()
endif
endif
return false
//���� ��
endfunction
function TouZhi_Init takes nothing returns nothing
//�����
local trigger t=CreateTrigger()
//�����ֲ�����������t
call TriggerRegisterAllUnitEvent(t,EVENT_PLAYER_UNIT_SPELL_CAST)
//Ϊ������tע���¼������ⵥλ��ʼʩ�ż���
call TriggerRegisterAllUnitEvent(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
//Ϊ������tע���¼������ⵥλ��������Ч��
call TriggerAddCondition(t,Condition(function TouZhi_Conditi))