[@PK赛EI执行]
{
#IF
hour 2
#ACT
;;;SendCmd  "E001,40,20" Referee Hide  ;;NPC隐藏
ResetMapAttr "E001"   ;;恢复默认
ChangeMapAttr "E001" "SAFE" 
ChangeMapAttr "E001" "NoSpell"
LineMsg "Grobal" "(*) Tournament will start in 5 minutes, to participate visit 'Tournament NPC' In Bichon!"
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 活动开启 1
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 产生PK王 0
Delaygoto "Grobal" 60 @jingxingPK5 10021
break

[@jingxingPK5]
#IF
#ACT
LineMsg "Grobal" "(*) Tournament will start in 4 minutes, to participate visit 'Tournament NPC' In Bichon!"
Delaygoto "Grobal" 60 @jingxingPK4 10022
break


[@jingxingPK4]
#IF
#ACT
LineMsg "Grobal" "(*) Tournament will start in 3 minutes, to participate visit 'Tournament NPC' In Bichon!"
Delaygoto "Grobal" 60 @jingxingPK3 10022
break



[@jingxingPK3]
#IF
#ACT
LineMsg "Grobal" "(*) Tournament will start in 2 minutes, to participate visit 'Tournament NPC' In Bichon!"
Delaygoto "Grobal" 60 @jingxingPK2 10023
break

[@jingxingPK2]
#IF
#ACT
LineMsg "Grobal" "(*) Tournament will start in 1 minute, to participate visit 'Tournament NPC' In Bichon! Hurry!"
Delaygoto "Grobal" 60 @jingxingPK1 10023
break

[@jingxingPK1]
#IF
CheckHum "E001" 3 ;;是否达到比赛要求人数
#ACT
mov  D5 0
mov  D6 0
ResetMapAttr "E001"   ;;恢复默认
SetEventMap "E001"    ;;设置地图
ChangeMapAttr "E001" "NOCHAT"  ;;禁止说话
LineMsg "Grobal" "(*) Tournament has started, let us look forward to the birth of the PK Leader!"
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 活动开启 2
goto @检测PK人数
#ELSEACT
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 活动开启 0
LineMsg "Grobal" "(*) Not enough players, the Tournament has been canceled!"
ResetMapAttr "E001"   ;;恢复默认
MapTing E001 0 160 230
ClearDelaygoto 10021
ClearDelaygoto 10022
ClearDelaygoto 10023
Close

[@检测PK人数]
#ACT
loadvalue D3 "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 产生PK王
inc D5  1
inc D6  1

#IF
!CheckHum "E001" 2
#ACT
;;;SendCmd  "E001,40,20" Referee Show  ;;显示NPC

#IF
!CheckHum "E001" 2
Equal D3 1
#ACT
loadvalue A1 "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] PK王名字
loadvalue D4 "PlayerParam\混乱PK大赛.ini" [获胜次数] %A1
LineMsg "Grobal" "(*) Todays PK Leader has been born! It is “<$OUTPUT(A1)>” total wins <$OUTPUT(D4)>, Congratulations!"
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 产生PK王 0
SAVEVALUE  "PlayerParam\混乱PK大赛.ini" [混乱PK大赛] 活动开启 0
ResetMapAttr "E001"   ;;恢复默认
MapTing E001 0 160 230
ClearDelaygoto 10024
break

#ELSEACT
Delaygoto "Grobal" 60 @检测PK人数 10024      ;;重复判断
GOTO @MAP动作
break

[@MAP动作]
#IF
CheckHum "E001" 2
Equal D6 5 ;;每11分钟放火墙
#ACT
MapSpell [Firewall] "E001,24,11,27,43, +d100, +t30, +h
MapSpell [Firewall] "E001,13,22,40,27, +d100, +t30, +h
MapSpell [Firewall] "E001,29,29,38,38, +d100, +t30, +h
MapSpell [Firewall] "E001,28,13,36,21, +d100, +t30, +h
mov  D6 0
break

#IF
CheckHum "E001" 5
Equal D5 10  ;10分钟掉落物品
#ACT
DropItemMap "E001,40,40,15" Gingseng 2 50    ;;地图掉落物品
mov  D5 0
break
}