=ȡ()
Ƿ=1
=1
ֻȡƷ="ç ˿   "
ﱣ()
()

ͼ="Ͽ"
=""
NPC="Ǯ"
NPC=""


function (,ͼ,npc,Ի)
    if (ȡ () == 2) then
           ()
          ȴ()
    end
  
    while (ȡ() == -1) do
        ٻ()

        Ѱ·2(ͼ,npc)
        (npc)
        ȴ()
        Ի(Ի)
        ȴ()
        if (Ѱı(ȡԻ(),"5") > 0) then
            ӡϢ("Ѿ5")
            return -1
        else
            ()
        end
        ȴ()
        
    end
           return 0
end

function (,ͼ,npc,Ի1,ͼ)
    while(ȡ() == 0) do
        if(ȡͼ() == ͼ) then
            ٻ()
            Ѱ·2(ͼ,npc)
            ȴ()
            if((npc) == true) then
                ȴ()
                if(Ի(Ի1) == true) then
                      ȴ()                     
                        if(Ѱı(ȡԻ(),"ʧ") > 0 ) then
                            ӡϢ("ʧ,")
                            ()
                            ȴ(3)
                        elseif (Ѱı(ȡԻ(),"")<= 0 ) then
                           жϵͼ()
                        end
                end
            end
          
        end
      if ȡͼ() == ͼ then
          break;
      end
    end    
end
function (,ͼ,npc,Ի,Ƿ)
 while(ȡ() == 1) do
        Ѱ·2(ͼ,npc)
        ȴ()
        (npc)
        ȴ()
        Ի()
        ȴ()
   if Ƿ~=nil then
        ()
        ȴ()
   end
        ()
        ȴ()
 end
 while(ȡ() == 2) do
        ӡϢ("ʧ,")
        ()
        ȴ()
 end
end

function ӳ(,ͼ,x,y,˴)
       if(ȡͼ() == ͼ) then
          while(ȡΧ()>0 and ȡ() == 0) do
	       ɱ(0,1,˴)
	       ȴ()
               (ֻȡƷ)
	  end
            ٻ()            
	    Ѱ·(x,y)
          while(ȡΧ()>0 and ȡ() == 0) do
	       ɱ(0,1,˴)
	       ȴ()
               (ֻȡƷ)
	  end
       end
end




function ()
        
    while(ȡ() == 0 and ȡͼ() == ͼ) do
        local ׶,listNum,killedNum=ȡ() 
          --ӡϢ(׶.."|"..listNum.."|"..killedNum)
        if ׶==1 or ׶==0 then
             if (listNum==0 or listNum==1)and killedNum~=30 then    --SongBing
               ӳ(,ͼ,191,144)
               ӳ(,ͼ,203,136)
               ӳ(,ͼ,167,135)
               ӳ(,ͼ,169,118)
               ӳ(,ͼ,199,133)
             elseif (listNum==1 and killedNum==30) or (listNum==2 and killedNum==0) then   --FuDuTong
                 ӳ(,ͼ,183,123)
             elseif (listNum==2 or listNum==3 ) and killedNum~=6  then   --FeiLei
                 =ȡλ()
                 ӡϢ("λ"..)
               if ==1 or ==3 or ==6 then
                   
                    ӳ(,ͼ,204,100)
               else
                    ӳ(,ͼ,210,120)
               end
             elseif listNum==3 or listNum==4  or listNum==5 then   --DuTong
                    ӳ(,ͼ,192,57)
             end

        elseif ׶==2 then
             if (listNum==0 or listNum==1) and killedNum ~=30 then  --HongXiong
               ӳ(,ͼ,148,65)
               ӳ(,ͼ,137,76)
               ӳ(,ͼ,130,46)
               ӳ(,ͼ,106,51)
               ӳ(,ͼ,85,43)
               ӳ(,ͼ,68,44)
               ӳ(,ͼ,67,69)
               ӳ(,ͼ,55,45)
             elseif listNum==1 then  --HongXiong_Boss
                ӳ(,ͼ,55,45)
             end
        elseif ׶==3 then
                ӳ(,ͼ,53,186,"ɽկ")
        end
    end
end


if (ȡ () == 2) then
           ()
          ȴ(2)
end

if(Ѱı(ͼ,ȡͼ()) <= 0) then
        ԶѪ(80)
end
 
if(ȡ(,1) == false or ȡ() == 0) then
    while(Ѱı(ͼ,ȡͼ()) == -1) do
        ٻ()
        ͼѰ·(NPC,131,258) 
            
        if (,NPC,NPC,)==-1 then
             goto en
        end  
        if(Ƿ==1) then
           while(ȡ() <  and ȡͼ() == NPC) do 
               ӡϢ("")
               ͼѰ·(NPC,131,258) 		   
               ȴ()
           end
           ӡϢ("")
        end
        (,NPC,NPC,"",ͼ)
    end 

     while(Ѱı(ͼ,ȡͼ()) ~= -1 and ȡ() == 0) do
         ()
     end
end
   if  ȡ() == 1 and ͼ==ȡͼ()  then
        Ѱ·(67,197)
        ȴ()
        ("αӦ")
        ȴ()
        Ի("뿪")
        ȴ()
        Ի("뿪")
        жϵͼ()
   end 
(,NPC,NPC,) 
::en::