Показать сообщение отдельно
Старый 13.08.2007, 01:21   #91
Leito
Танчики Developer
 
Регистрация: 29.01.2007
Сообщений: 539
Написано 16 полезных сообщений
(для 23 пользователей)
это демонстрация меню. а не игры.

то что осталось за кадром) оброботка команд скриптовой системы. я добрый учитесь))
Function GameScript(Command$)

If Left(command$,9)="setreport" Then
	b=11
	a$=""
	c$=""
	d$=""
	g$=""	
	e=0
	f=0
	While a<>"."
		c$=c$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend	
	a$=""
	While a<>"."
		d$=d$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend
	a$=""
	While a<>"."
		g$=g$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend
	p$=Mid(Command$,b,Len(Command$)-b+1)
	setreport(p$,Int(c$),Int(d$),Int(g$))
End If

If Left(command$,2)="if" Then
	QDSL=0
	b=4
	a$=""
	c$=""
	d$=""
	e=0
	While c$<>"then" 
		If c$="and"
			QDSL=QDSL+1: DimScrLet(QDSL)=1
		End If
		If c$="or" 
			QDSL=QDSL+1: DimScrLet(QDSL)=0
		End If
		c$=""
		While Mid(command$,b,1)<>"(" 
			b=b+1
		Wend
		b=b+1
		While Mid(command$,b,1)<>")"
			a$=Mid(command$,b,1)
			c$=c$+a$
			b=b+1
		Wend
		e=ControlCondition(c$)
		QDSL=QDSL+1
		If e=1
			DimScrLet(QDSL)=1
		Else
			DimScrLet(QDSL)=0
		End If
		b=b+1
		While Mid(command$,b,1)=" " 
			b=b+1
		Wend
		c$=Mid(command$,b,1)
		a$=""
		While a$<>" "
			c$=c$+a$
			b=b+1
			a$=Mid(command$,b,1)
			If a$="" a$=" "
		Wend
	Wend
	If QDSL=1
		ScrLet=DimScrLet(QDSL)
	Else
		i=0
		While QDSL>i+2
			i=i+2
			If DimScrLet(i)=0
				If DimScrLet(i-1)=1 Or DimScrLet(i+1)=1 DimScrLet(i-1)=1 Else DimScrLet(i-1)=0
				For j=i To QDSL-2
					DimScrLet(j)=DimScrLet(j+2)
				Next
				i=i-2
				QDSL=QDSL-2
			End If
		Wend
		While QDSL>1
			If DimScrLet(1)=1 And DimScrLet(3)=1 DimScrLet(1)=1 Else DimScrLet(1)=0
			For j=2 To QDSL-2
				DimScrLet(j)=DimScrLet(j+2)
			Next
			QDSL=QDSL-2
		Wend
		ScrLet=DimScrLet(1)
	End If
End If

If Left(command$,4)="!end" Then
	ScrLet=1
End If

If Left(command$,5)="trade" Then
	If gamescr=7
		norep=8
		TalkUD1=0
		TalkUD2=0
		TalkNum=-2
		;Bagtime()
		;pppp$="qt"
		TalkIS=0
		Menu10Com$=Command$
	Else
		GameScr=11	
		c$=Mid(command$,7,Len(command$)-6)
		For i=1 To QN
			If NPC(i)\ID$ = c$ f=i
		Next	
		Menu11NTN=f
	
		TargetBx1=0
		TargetBy1=0
		TargetBx2=0
		TargetBy2=0			
		Bup1=0
		Bup2=0			
		WhoseInv=2
		Submenu10status=0
		QSellThings=0
		QBuyThings=0
		For i=1 To Qthings
			InvImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+Inventory(i)\ID+".bmp")
			ScaleImage InvImage(i),GK#,GK#
		Next
		
		For i=1 To NPC(Menu11NTN)\Qthings
			InvImage2(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+NPC(Menu11NTN)\Inv[i]\ID+".bmp")
			ScaleImage InvImage2(i),GK#,GK#
		Next
	
		Ib1=LoadImage("data\textures\menu\Menu11\b1.bmp")
		Ib2=LoadImage("data\textures\menu\Menu11\b2.bmp")			
		ScaleImage ib1,GK#,GK#
		ScaleImage ib2,GK#,GK#
		Ib3=LoadImage("data\textures\Menu\Menu11\b41.bmp")
		Ib4=LoadImage("data\textures\Menu\Menu11\b42.bmp")
		Ib5=LoadImage("data\textures\Menu\Menu11\b51.bmp")
		Ib6=LoadImage("data\textures\Menu\Menu11\b52.bmp")
		Ib7=LoadImage("data\textures\Menu\Menu11\b61.bmp")
		Ib8=LoadImage("data\textures\Menu\Menu11\b62.bmp")
		Ib9=LoadImage("data\textures\Menu\Menu11\b71.bmp")
		Ib10=LoadImage("data\textures\Menu\Menu11\b72.bmp")
		Ib17=LoadImage("data\textures\Menu\Menu11\b81.bmp")
		Ib18=LoadImage("data\textures\Menu\Menu11\b82.bmp")			
		Ib19=LoadImage("data\textures\Menu\Menu11\b3.bmp")
		Ib20=LoadImage("data\textures\Menu\Menu11\b11.bmp")			
		Ib21=LoadImage("data\textures\Menu\Menu11\b9.bmp")

		Ib23=LoadImage("data\textures\Menu\Menu11\b101.bmp")
		Ib24=LoadImage("data\textures\Menu\Menu11\b102.bmp")
		Ib25=LoadImage("data\textures\Menu\Menu11\d11.bmp")
		Ib26=LoadImage("data\textures\Menu\Menu11\d12.bmp")			
		ScaleImage ib3,GK#,GK#
		ScaleImage ib4,GK#,GK#
		ScaleImage ib5,GK#,GK#
		ScaleImage ib6,GK#,GK#
		ScaleImage ib7,GK#,GK#
		ScaleImage ib8,GK#,GK#
		ScaleImage ib9,GK#,GK#
		ScaleImage ib10,GK#,GK#
		ScaleImage ib17,GK#,GK#
		ScaleImage ib18,GK#,GK#
		ScaleImage ib19,GK#,GK#						
		ScaleImage ib20,GK#,GK#				
		ScaleImage ib21,GK#,GK#

		ScaleImage ib23,GK#,GK#
		ScaleImage ib24,GK#,GK#																
		ScaleImage ib25,GK#,GK#
		ScaleImage ib26,GK#,GK#	
			
		Ib11=LoadImage("data\textures\Menu\Menu11\c1.bmp")
		Ib12=LoadImage("data\textures\Menu\Menu11\c2.bmp")
		Ib13=LoadImage("data\textures\Menu\Menu11\c12.bmp")
		Ib14=LoadImage("data\textures\Menu\Menu11\c22.bmp")
		Ib15=LoadImage("data\textures\Menu\Menu11\c3.bmp")
		Ib16=LoadImage("data\textures\Menu\Menu11\c4.bmp")
		ScaleImage ib11,GK#,GK#
		ScaleImage ib12,GK#,GK#
		ScaleImage ib13,GK#,GK#
		ScaleImage ib14,GK#,GK#
		ScaleImage ib15,GK#,GK#
		ScaleImage ib16,GK#,GK#
				
		;------???? ???? ? ????------
		ppa=MilliSecs()-pa
		For i=1 To QN
			eea(i)=MilliSecs()-ea(i)
		Next
		;--------------------------------
	End If

End If

If Left(command$,2)="nt" Then
	norep=2
	TalkUD1=0
	TalkUD2=0
	TalkNum=Mid(Command$,4,Len(Command$)-3)
;	pppp$="nt"
	TalkIS=0
End If

If Left(command$,2)="qt" Then
	norep=8
	TalkUD1=0
	TalkUD2=0
	If TalkNum<>-2 TalkNum=-1
;	Bagtime()
;	pppp$="qt"
	TalkIS=0
End If

If Left(command$,9)="addrecord" Then
	b=11
	a$=""
	c$=""
	d$=""
	e=0
	f=0
	While a<>"."
		c$=c$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend
	d$=Mid(command$,b,Len(command$)-b+1)

	For i=1 To Qrec
		If Records(i,0)=Int(c$) e=i
	Next
	
	If e=0
		Qrec=Qrec+1
		Records(Qrec,0)=Int(Float(c$))		
		Records(Qrec,1000)=Records(Qrec,1000)+1
		Records(Qrec,Records(Qrec,1000))=Int(d$)		
	Else
		For i=1 To Records(e,1000)
			If Records(e,i)=Int(d$) f=1
		Next
		If f=0
			Records(e,1000)=Records(e,1000)+1
			Records(e,Records(e,1000))=Int(d$)
		End If
	End If
End If

If Left(command$,12)="changerecord" Then
	b=14
	a$=""
	c$=""
	d$=""
	e=0
	f=0
	While a<>"."
		c$=c$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend
	d$=Mid(command$,b,Len(command$)-b+1)

	For i=1 To Qrec
		If Records(i,0)=Int(c$) e=i
	Next
	
	If e<>0
		Records(e,1001)=Int(d$)
	End If
	command$=""
End If

If Left(command$,9)="addscript" Then
	e=0
	d$=Right(command$,Len(command$)-10)
	For i=1 To QSL
		If ScriptsList(i)=Int(Float(d$)) e=1
	Next
	If  ScriptsControlStatus=0
		If e=0
			QSL=QSL+1
			ScriptsList(QSL)=Int(Float(d$))
		End If
	Else
		If e=0
			QTARS=QTARS+1
			TempAddRemoveScripts(QTARS,1)=Int(Float(d$))
			TempAddRemoveScripts(QTARS,2)=1			
		End If
	End If
End If

If Left(command$,12)="removescript" Then
	e=0
	d$=Right(command$,Len(command$)-13)
	For i=1 To QSL
		If ScriptsList(i)=Int(Float(d$)) e=i
	Next
	If  ScriptsControlStatus=0	
		If e<>0
			QSL = QSL - 1
			For i=e To QSL
				ScriptsList(i)=ScriptsList(i+1)
			Next
			ScriptsList(QSL+1)=0
		End If
	Else
		If e<>0
			QTARS=QTARS+1
			TempAddRemoveScripts(QTARS,1)=Int(Float(d$))
			TempAddRemoveScripts(QTARS,2)=0		
		End If
	End If
End If

If Left(command$,7)="addtalk" Then
	b=8
	a$=""
	c$=""
	d$=""
	f=0
	e=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	For i=1 To QN
		If NPC(i)\ID$ = c$
			f=i
		End If
	Next	
	For i=1 To NPC(f)\QT
		If NPC(f)\Talk[i]=Int(Float(d$)) e=1
	Next
	If e=0 And f<>0
		NPC(f)\QT = NPC(f)\QT + 1
		NPC(f)\Talk[NPC(f)\QT]=Int(Float(d$))
	End If
End If

If Left(command$,10)="removetalk" Then
	b=11
	a$=""
	c$=""
	d$=""
	f=0
	e=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	For i=1 To QN
		If NPC(i)\ID$ = c$
			f=i
		End If
	Next	
	For i=1 To NPC(f)\QT
		If NPC(f)\Talk[i]=Int(Float(d$)) e=i
	Next
	If e<>0 And f<>0
		NPC(f)\QT = NPC(f)\QT - 1
		For i=e To NPC(f)\QT
			NPC(f)\Talk[i]=NPC(f)\Talk[i+1]
		Next
		NPC(f)\Talk[NPC(f)\QT+1]=0
	End If
End If

If Left(command$,14)="changemaintalk" Then
	b=15
	a$=""
	c$=""
	d$=""
	f=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	For i=1 To QN
		If NPC(i)\ID$ = c$
			f=i
		End If
	Next	
	If f<>0
		NPC(f)\maintalk=Int(Float(d$))
	End If
	command$=""
End If

If Left(command$,10)="addbuyitem" Then
	PriceRel=0
	b=11
	a$=""
	c$=""
	d$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	
	For i=1 To QBuyThings
		If BuyThings(i)\ID = Int(Float(c$)) And d$<>"" Then
			BuyThings(i)\quantity = BuyThings(i)\quantity+Int(Float(d$))
			d$=""
		End If
	Next
	If d$<>"" Then 
		QBuyThings=QBuyThings+1
		BuyThings(QBuyThings)=New TypeInventory
		BuyThings(QBuyThings)\ID=Int(Float(c$))
		BuyThings(QBuyThings)\quantity=Int(Float(d$))
	End If
	If (gamescr=11) And d$<>""
		For i=1 To QBuyThings
			If i<>QBuyThings FreeImage BuyThingsImage(i)
			BuyThingsImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+BuyThings(i)\ID+".bmp")
			ScaleImage BuyThingsImage(i),GK#,GK#
		Next	
	End If		
End If

If Left(command$,11)="addsellitem" Then
	PriceRel=0
	b=12
	a$=""
	c$=""
	d$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	
	For i=1 To QSellThings
		If SellThings(i)\ID = Int(Float(c$)) And d$<>"" Then
			SellThings(i)\quantity = SellThings(i)\quantity+Int(Float(d$))
			d$=""
		End If
	Next
	If d$<>"" Then 
		QSellThings=QSellThings+1
		SellThings(QSellThings)=New TypeInventory
		SellThings(QSellThings)\ID=Int(Float(c$))
		SellThings(QSellThings)\quantity=Int(Float(d$))
	End If
	If (gamescr=11) And d$<>""
		For i=1 To QSellThings
			If i<>QSellThings FreeImage SellThingsImage(i)
			SellThingsImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+SellThings(i)\ID+".bmp")
			ScaleImage SellThingsImage(i),GK#,GK#
		Next	
	End If		
End If

If Left(command$,13)="removebuyitem" Then
	PriceRel=0
	b=14
	a$=""
	c$=""
	d$=""
	h=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	
	For i=1 To QBuyThings
		If BuyThings(i)\ID = Int(Float(c$)) And d$<>"" Then
			BuyThings(i)\quantity = BuyThings(i)\quantity-Int(Float(d$))
			If BuyThings(i)\quantity<=0 Then
				QBuyThings=QBuyThings-1
				TargetBx1=0
				TargetBy1=0
				Bup1=0					
				For j=i To QBuyThings
					BuyThings(j)\ID = BuyThings(j+1)\ID
					BuyThings(j)\quantity = BuyThings(j+1)\quantity
				Next
				h=1
			End If
			d$=""
		End If
	Next	
	If gamescr=11 And h=1
		For i=1 To QBuyThings
			FreeImage BuyThingsImage(i)			
			BuyThingsImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+BuyThings(i)\ID+".bmp")
			ScaleImage BuyThingsImage(i),GK#,GK#
		Next	
		FreeImage BuyThingsImage(QBuyThings+1)			
	End If
End If

If Left(command$,14)="removesellitem" Then
	PriceRel=0
	b=15
	a$=""
	c$=""
	d$=""
	h=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	
	For i=1 To QSellThings
		If SellThings(i)\ID = Int(Float(c$)) And d$<>"" Then
			SellThings(i)\quantity = SellThings(i)\quantity-Int(Float(d$))
			If SellThings(i)\quantity<=0 Then
				QSellThings=QSellThings-1
				TargetBx2=0
				TargetBy2=0
				Bup2=0					
				For j=i To QSellThings
					SellThings(j)\ID = SellThings(j+1)\ID
					SellThings(j)\quantity = SellThings(j+1)\quantity
				Next
				h=1
			End If
			d$=""
		End If
	Next	
	If gamescr=11 And h=1
		For i=1 To QSellThings
			FreeImage SellThingsImage(i)			
			SellThingsImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+SellThings(i)\ID+".bmp")
			ScaleImage SellThingsImage(i),GK#,GK#
		Next	
		FreeImage SellThingsImage(QSellThings+1)			
	End If
End If

If Left(command$,7)="additem" Then
	b=8
	a$=""
	c$=""
	d$=""
	c1$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	c1$=c$
	a$=""
	c$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend	
	d$=Mid(command$,b+1,Len(command$)-b)
	If c1$="hero"
		For i=1 To Qthings
			If Inventory(i)\ID = Int(Float(c$)) And d$<>"" Then
				Inventory(i)\quantity = Inventory(i)\quantity+Int(Float(d$))
				d$=""
			End If
		Next
		If d$<>"" Then 
			Qthings=Qthings+1
			Inventory(Qthings)=New TypeInventory
			Inventory(Qthings)\ID=Int(Float(c$))
			Inventory(Qthings)\quantity=Int(Float(d$))
		End If
		If (gamescr=6 Or gamescr=10 Or gamescr=11 Or gamescr=12) And d$<>""
			For i=1 To Qthings
				If i<>Qthings FreeImage InvImage(i)
				InvImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+Inventory(i)\ID+".bmp")
				ScaleImage InvImage(i),GK#,GK#
			Next	
		End If	
	Else
		f=0
		For i=1 To QN
			If NPC(i)\ID$ = c1$
				f=i
			End If
		Next	
		If f<>0
			For i=1 To NPC(f)\Qthings
				If NPC(f)\Inv[i]\ID = Int(Float(c$)) And d$<>"" Then
					NPC(f)\Inv[i]\quantity = NPC(f)\Inv[i]\quantity+Int(Float(d$))
					d$=""
				End If
			Next			
			If d$<>"" Then 
				NPC(f)\Qthings=NPC(f)\Qthings+1
				NPC(f)\Inv[NPC(f)\Qthings]=New TypeInventory
				NPC(f)\Inv[NPC(f)\Qthings]\ID=Int(Float(c$))
				NPC(f)\Inv[NPC(f)\Qthings]\quantity=Int(Float(d$))
			End If	
			If (gamescr=10 Or gamescr=11) And d$<>""
				For i=1 To NPC(f)\Qthings
					If i<>NPC(f)\Qthings FreeImage InvImage2(i)
					InvImage2(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+NPC(f)\Inv[i]\ID+".bmp")
					ScaleImage InvImage2(i),GK#,GK#
				Next	
			End If						
		Else
			For i=1 To QC
				If cont(i)\ID$ = c1$
					f=i
				End If
			Next			

			If f<>0
				For i=1 To cont(f)\Qthings
					If cont(f)\Inv[i]\ID = Int(Float(c$)) And d$<>"" Then
						cont(f)\Inv[i]\quantity = cont(f)\Inv[i]\quantity+Int(Float(d$))
						d$=""
					End If
				Next			
				If d$<>"" Then 
					cont(f)\Qthings=cont(f)\Qthings+1
					cont(f)\Inv[cont(f)\Qthings]=New TypeInventory
					cont(f)\Inv[cont(f)\Qthings]\ID=Int(Float(c$))
					cont(f)\Inv[cont(f)\Qthings]\quantity=Int(Float(d$))
				End If	
				If gamescr=12 And d$<>""
					For i=1 To cont(f)\Qthings
						If i<>cont(f)\Qthings FreeImage InvImage2(i)
						InvImage2(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+cont(f)\Inv[i]\ID+".bmp")
						ScaleImage InvImage2(i),GK#,GK#
					Next	
				End If						
			End If				
		End If
	End If
End If

If Left(command$,10)="removeitem" Then
	b=11
	a$=""
	c$=""
	d$=""
	c1$=""
	h=0
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	c1$=c$
	a$=""
	c$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	d$=Mid(command$,b+1,Len(command$)-b)
	If c1$="hero"
		For i=1 To Qthings
			If Inventory(i)\ID = Int(Float(c$)) And d$<>"" Then
				Inventory(i)\quantity = Inventory(i)\quantity-Int(Float(d$))
				If inventory(i)\quantity<=0 Then
					Qthings=Qthings-1
					TargetBx=0
					TargetBy=0
					Bup=0
					TargetBx1=0
					TargetBy1=0
					Bup1=0					
					For j=i To Qthings
						Inventory(j)\ID = Inventory(j+1)\ID
						Inventory(j)\quantity = Inventory(j+1)\quantity
					Next
					h=1
				End If
				d$=""
			End If
		Next	
		If (gamescr=6 Or gamescr=10 Or gamescr=11 Or gamescr=12) And h=1
			For i=1 To Qthings
				FreeImage InvImage(i)			
				InvImage(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+Inventory(i)\ID+".bmp")
				ScaleImage InvImage(i),GK#,GK#
			Next	
			FreeImage InvImage(Qthings+1)			
		End If
	Else
		f=0
		For i=1 To QN
			If NPC(i)\ID$ = c1$
				f=i
			End If
		Next	
		If f<>0	
			For i=1 To NPC(f)\Qthings
				If NPC(f)\Inv[i]\ID = Int(Float(c$)) And d$<>"" Then
					NPC(f)\Inv[i]\quantity = NPC(f)\Inv[i]\quantity-Int(Float(d$))
					If NPC(f)\Inv[i]\quantity<=0 Then
						NPC(f)\Qthings=NPC(f)\Qthings-1
						TargetBx2=0
						TargetBy2=0
						Bup2=0
						For j=i To NPC(f)\Qthings
							NPC(f)\Inv[j]\ID = NPC(f)\Inv[j+1]\ID
							NPC(f)\Inv[j]\quantity = NPC(f)\Inv[j+1]\quantity
						Next
						h=1
					End If
					d$=""
				End If
			Next
			If gamescr=10 Or gamescr=11 And h=1
				For i=1 To NPC(f)\Qthings
					FreeImage InvImage2(i)			
					InvImage2(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+NPC(f)\Inv[i]\ID+".bmp")
					ScaleImage InvImage2(i),GK#,GK#
				Next	
				FreeImage InvImage2(NPC(f)\Qthings+1)
			End If
		Else
			For i=1 To QC
				If cont(i)\ID$ = c1$
					f=i
				End If
			Next			
			If f<>0
				For i=1 To cont(f)\Qthings
					If cont(f)\Inv[i]\ID = Int(Float(c$)) And d$<>"" Then
						cont(f)\Inv[i]\quantity = cont(f)\Inv[i]\quantity-Int(Float(d$))
						If cont(f)\Inv[i]\quantity<=0 Then
							cont(f)\Qthings=cont(f)\Qthings-1
							TargetBx2=0
							TargetBy2=0
							Bup2=0
							For j=i To cont(f)\Qthings
								cont(f)\Inv[j]\ID = cont(f)\Inv[j+1]\ID
								cont(f)\Inv[j]\quantity = cont(f)\Inv[j+1]\quantity
							Next
							h=1
						End If
						d$=""
					End If
				Next
				If gamescr=12 And h=1
					For i=1 To cont(f)\Qthings
						FreeImage InvImage2(i)			
						InvImage2(i)=LoadImage("DATA\textures\Image\Inventory\Things\"+cont(f)\Inv[i]\ID+".bmp")
						ScaleImage InvImage2(i),GK#,GK#
					Next	
					FreeImage InvImage2(cont(f)\Qthings+1)
				End If
			End If		
		End If
	End If
End If

If Left(command$,6)="change" Then
	b=8
	a$=""
	c$=""
	d$=""
	g$=""	
	e=0
	f=0
	While a<>"." And a<>"="
		c$=c$+a$
		a$=Mid(Command$,b,1)
		b=b+1
	Wend
	e=1
	If a<>"="
		e=2
		a$=""
		While a<>"." And a<>"="
			d$=d$+a$
			a$=Mid(Command$,b,1)
			b=b+1
		Wend
		If a$<>"="
			e=3
			a$=""
			While a<>"="
				g$=g$+a$
				a$=Mid(Command$,b,1)
				b=b+1
			Wend
		End If
	End If
	p$=Mid(Command$,b,Len(Command$)-b+1)
	Select e
	Case 1
		Select c$
		Case "QH"
			QH=CalcExp(p$)
			If QH>24 QH=QH-24
			Select QH
			Case 1			licol=50:licol2=1
			Case 2			licol=67:licol2=1
			Case 3			licol=84:licol2=1		
			Case 4			licol=101:licol2=1		
			Case 5			licol=118:licol2=1		
			Case 6			licol=135:licol2=1			
			Case 7			licol=152:licol2=1		
			Case 8			licol=169:licol2=1		
			Case 9			licol=186:licol2=1		
			Case 10			licol=203:licol2=1		
			Case 11			licol=221:licol2=1		
			Case 12			licol=238:licol2=1		
			Case 13			licol=255:licol2=0		
			Case 14			licol=238:licol2=0
			Case 15			licol=221:licol2=0
			Case 16			licol=203:licol2=0
			Case 17			licol=186:licol2=0
			Case 18			licol=169:licol2=0
			Case 19			licol=152:licol2=0
			Case 20			licol=135:licol2=0
			Case 21			licol=118:licol2=0
			Case 22			licol=101:licol2=0
			Case 23			licol=84:licol2=0
			Case 24			licol=67:licol2=0
			End Select
		End Select
		If Right(c$,1)="#"
			ScriptsVar#(Int(Left(c$,Len(c$)-1)))=CalcExp(p$)
		End If
	Case 2
		Select c$
		Case "hero"
			Select d$
				Case "anim" Player(0)\Anim=CalcExp(p$)
				Case "st" Player(0)\St=CalcExp(p$)
				Case "con" Player(0)\con=CalcExp(p$)
				Case "dex" Player(0)\dex=CalcExp(p$)
				Case "sd" Player(0)\sd=CalcExp(p$)
				Case "gd" Player(0)\gd=CalcExp(p$)
				Case "la" Player(0)\la=CalcExp(p$)
				Case "ha" Player(0)\ha=CalcExp(p$)
				Case "ac" Player(0)\ac=CalcExp(p$)
				Case "ev" Player(0)\ev=CalcExp(p$)
				Case "tr" Player(0)\tr=CalcExp(p$)
				Case "dam" Player(0)\dam=CalcExp(p$)
				Case "asp" Player(0)\asp=CalcExp(p$)
				Case "speed" Player(0)\speed#=CalcExp(p$)
				Case "def" Player(0)\def=CalcExp(p$)
				Case "realhp" Player(0)\realhp=CalcExp(p$)
				Case "maxhp" Player(0)\maxhp=CalcExp(p$)
				Case "crit" Player(0)\crit=CalcExp(p$)
				Case "weight" Player(0)\weight=CalcExp(p$)
				Case "wed" Player(0)\wed=CalcExp(p$)
				Case "wec" Player(0)\wec=CalcExp(p$)
				Case "was" Player(0)\was=CalcExp(p$)
				Case "wet" Player(0)\wet=CalcExp(p$)
				Case "ard" Player(0)\ard=CalcExp(p$)
				Case "art" Player(0)\art=CalcExp(p$)
				Case "distat" Player(0)\distat=CalcExp(p$)
				Case "dac" Player(0)\dac=CalcExp(p$)
				Case "dev" Player(0)\dev=CalcExp(p$)
				Case "ex" Player(0)\Ex=CalcExp(p$)
				Case "lvlexp" Player(0)\lvlexp=CalcExp(p$)
				Case "level" Player(0)\Level=CalcExp(p$)
				Case "charpoints" Player(0)\CharPoints=CalcExp(p$)
				Case "skillpoints" Player(0)\SkillPoints=CalcExp(p$)
				Case "deadmovietime" Player(0)\DeadMovieTime=CalcExp(p$)
				Case "movetype" Player(0)\MoveType=CalcExp(p$)
				Case "qthings" Qthings=CalcExp(p$)
				Case "yaw" 
				Player(0)\Yaw#=CalcExp(p$)
				RotateEntity Player(0)\mesh1,0,Player(0)\Yaw#,0
				Case "x" PositionEntity Player(0)\mesh1,CalcExp(p$),EntityY#(Player(0)\mesh1),EntityZ#(Player(0)\mesh1)
				Case "y" PositionEntity Player(0)\mesh1,EntityX#(Player(0)\mesh1),CalcExp(p$),EntityZ#(Player(0)\mesh1)
				Case "z" PositionEntity Player(0)\mesh1,EntityX#(Player(0)\mesh1),EntityY#(Player(0)\mesh1),CalcExp(p$)
				Case "scalex" 
				Player(0)\ScaleX#=CalcExp(p$)
				ScaleEntity Player(0)\mesh1,Player(0)\ScaleX,Player(0)\ScaleY,Player(0)\ScaleZ
				Case "scaley"
				Player(0)\ScaleY#=CalcExp(p$)
				ScaleEntity Player(0)\mesh1,Player(0)\ScaleX,Player(0)\ScaleY,Player(0)\ScaleZ
				Case "scalez"
				Player(0)\ScaleZ#=CalcExp(p$)
				ScaleEntity Player(0)\mesh1,Player(0)\ScaleX,Player(0)\ScaleY,Player(0)\ScaleZ
				Case "alpha"
				Player(0)\alpha#=CalcExp(p$)
				EntityAlpha Player(0)\mesh1,Player(0)\alpha#
			End Select
		End Select
	Case 3
		Select c$
		Case "NPC"
			For i=1 To QN
				If NPC(i)\ID$ = d$
					f=i
				End If
			Next		
			Select g$
				Case "usetalk" NPC(f)\UseTalk=CalcExp(p$)
				Case "anim" NPC(f)\Anim=CalcExp(p$)
				Case "typeai" NPC(f)\TypeAI=CalcExp(p$)
				Case "dam" NPC(f)\Dam=CalcExp(p$)
				Case "asp"  NPC(f)\Asp=CalcExp(p$)
				Case "speed"  NPC(f)\Speed#=CalcExp(p$)
				Case "def"  NPC(f)\Def=CalcExp(p$)
				Case "realhp"  NPC(f)\realhp=CalcExp(p$)
				Case "maxhp"  NPC(f)\MaxHp=CalcExp(p$)
				Case "crit"  NPC(f)\Crit=CalcExp(p$)
				Case "distat"  NPC(f)\distat=CalcExp(p$)
				Case "ex"  NPC(f)\Ex=CalcExp(p$)
				Case "look"  NPC(f)\look=CalcExp(p$)
;				Case "number"  NPC(f)\Number=CalcExp(p$)
				Case "weight"  NPC(f)\weight=CalcExp(p$)
				Case "alive"  NPC(f)\Alive=CalcExp(p$)
				Case "aggr"  NPC(f)\aggr=CalcExp(p$)
				Case "maintalk"  NPC(f)\maintalk=CalcExp(p$)
				Case "qt"  NPC(f)\QT=CalcExp(p$)
				Case "qthings"  NPC(f)\Qthings=CalcExp(p$)
				Case "yaw" 
				NPC(f)\Yaw#=CalcExp(p$)
				RotateEntity NPC(f)\mesh1,0,NPC(f)\Yaw#,0
				Case "x" PositionEntity NPC(f)\mesh1,CalcExp(p$),EntityY#(NPC(f)\mesh1),EntityZ#(NPC(f)\mesh1)
				Case "y" PositionEntity NPC(f)\mesh1,EntityX#(NPC(f)\mesh1),CalcExp(p$),EntityZ#(NPC(f)\mesh1)
				Case "z" PositionEntity NPC(f)\mesh1,EntityX#(NPC(f)\mesh1),EntityY#(NPC(f)\mesh1),CalcExp(p$)
				Case "scalex" 
				NPC(f)\ScaleX#=CalcExp(p$)
				ScaleEntity NPC(f)\mesh1,NPC(f)\ScaleX,NPC(f)\ScaleY,NPC(f)\ScaleZ
				Case "scaley"
				NPC(f)\ScaleY#=CalcExp(p$)
				ScaleEntity NPC(f)\mesh1,NPC(f)\ScaleX,NPC(f)\ScaleY,NPC(f)\ScaleZ
				Case "scalez"
				NPC(f)\ScaleZ#=CalcExp(p$)
				ScaleEntity NPC(f)\mesh1,NPC(f)\ScaleX,NPC(f)\ScaleY,NPC(f)\ScaleZ	
				Case "alpha"
				NPC(f)\alpha#=CalcExp(p$)
				EntityAlpha NPC(f)\mesh1,NPC(f)\alpha#						
			End Select
		Case "cont"
			
			For i=1 To QC
				If Cont(i)\ID$ = d$
					f=i
				End If
			Next
			
			Select g$
				Case "yaw" 
				cont(f)\Yaw#=CalcExp(p$)
				RotateEntity cont(f)\mesh,0,cont(f)\Yaw#,0
				Case "x" PositionEntity cont(f)\mesh,CalcExp(p$),EntityY#(cont(f)\mesh),EntityZ#(cont(f)\mesh)
				Case "y" PositionEntity cont(f)\mesh,EntityX#(cont(f)\mesh),CalcExp(p$),EntityZ#(cont(f)\mesh)
				Case "z" PositionEntity cont(f)\mesh,EntityX#(cont(f)\mesh),EntityY#(cont(f)\mesh),CalcExp(p$)
				Case "scalex" 
				cont(f)\ScaleX#=CalcExp(p$)
				ScaleEntity cont(f)\mesh,cont(f)\ScaleX,cont(f)\ScaleY,cont(f)\ScaleZ
				Case "scaley"
				cont(f)\ScaleY#=CalcExp(p$)
				ScaleEntity cont(f)\mesh,cont(f)\ScaleX,cont(f)\ScaleY,cont(f)\ScaleZ
				Case "scalez"
				cont(f)\ScaleZ#=CalcExp(p$)
				ScaleEntity cont(f)\mesh,cont(f)\ScaleX,cont(f)\ScaleY,cont(f)\ScaleZ
				Case "alpha"
				cont(f)\alpha#=CalcExp(p$)
				EntityAlpha cont(f)\mesh,cont(f)\alpha#
			End Select
		Case "mesh"
			
			For i=1 To Qmesh
				If Omesh(i)\ID$ = d$
					f=i
				End If
			Next
			
			Select g$
				Case "yaw" 
				OMesh(f)\Yaw#=CalcExp(p$)
				RotateEntity OMesh(f)\mesh,0,OMesh(f)\Yaw#,0
				Case "x" PositionEntity OMesh(f)\mesh,CalcExp(p$),EntityY#(OMesh(f)\mesh),EntityZ#(OMesh(f)\mesh)
				Case "y" PositionEntity OMesh(f)\mesh,EntityX#(OMesh(f)\mesh),CalcExp(p$),EntityZ#(OMesh(f)\mesh)
				Case "z" PositionEntity OMesh(f)\mesh,EntityX#(OMesh(f)\mesh),EntityY#(OMesh(f)\mesh),CalcExp(p$)
				Case "scalex" 
				OMesh(f)\ScaleX#=CalcExp(p$)
				ScaleEntity OMesh(f)\mesh,OMesh(f)\ScaleX,OMesh(f)\ScaleY,OMesh(f)\ScaleZ
				Case "scaley"
				OMesh(f)\ScaleY#=CalcExp(p$)
				ScaleEntity OMesh(f)\mesh,OMesh(f)\ScaleX,OMesh(f)\ScaleY,OMesh(f)\ScaleZ
				Case "scalez"
				OMesh(f)\ScaleZ#=CalcExp(p$)
				ScaleEntity OMesh(f)\mesh,OMesh(f)\ScaleX,OMesh(f)\ScaleY,OMesh(f)\ScaleZ
				Case "alpha"
				OMesh(f)\alpha#=CalcExp(p$)
				EntityAlpha OMesh(f)\mesh,OMesh(f)\alpha#								
			End Select			
		End Select	
	End Select
End If

If Left(command$,8)="boatmove" Then
	b=9
	a$=""
	c$=""
	d$=""
	e=0	
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
	
	e=Int(Float(c$))
	c$=""
	a$=""
	
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(Command$,b,1)
	Wend
		
	boat(e)\X=Int(Float(c$))
	
	d$=Mid(command$,b+1,Len(command$)-b)
	
	boat(e)\Z=Int(Float(d$))
	boat(e)\moving=1
		
	For j=1 To QN
		If NPC(j)\ID$ = boat(e)\NPCname$
			f=j
		End If
	Next

	Animate FindChild(NPC(f)\mesh2,"hero"),1,.25
	Animate FindChild(NPC(f)\mesh2,"weapon"),1,.25
	EntityAlpha FindChild(NPC(f)\mesh2,"hero"),1
	EntityAlpha FindChild(NPC(f)\mesh2,"weapon"),1
	EntityAlpha FindChild(NPC(f)\mesh1,"hero"),0
	EntityAlpha FindChild(NPC(f)\mesh1,"weapon"),0
	
End If

End Function
Остальная часть скриптов.
Function LoadScriptsCommand()
file=ReadFile("DATA\text\scripts.txt")
QSC=0
QHS=0
While Not Eof(file)
	QSC=QSC+1
	ScriptsCommand$(QSC)=ReadLine(file)
	If Left(ScriptsCommand$(QSC),11)="beginscript"
		QHS=QHS+1
		HeadScripts(QHS,1)=Int(Right(ScriptsCommand$(QSC),Len(ScriptsCommand$(QSC))-12))
		HeadScripts(QHS,2)=QSC
	End If
Wend
CloseFile(file)
End Function


Function ScriptsControl()
ScriptsControlStatus=1
For i=1 To QSL
	For j=1 To QHS
		If HeadScripts(j,1)=ScriptsList(i)
			a=HeadScripts(j,2)
			k=a+1
			QTS=0
			While ScriptsCommand$(k)<>"endscript"
				TempScripts$(k-a)=ScriptsCommand$(k)
				k=k+1
				QTS=QTS+1
			Wend
			If QTS<>0
				ScrLet=1
				For k=1 To QTS
					If ScrLet=1
						GameScript(TempScripts$(k))
					Else
						GameScript("!"+TempScripts$(k))
					End If					
				Next
			End If
		End If
	Next
Next
ScriptsControlStatus=0

For i=1 To QTARS
	If TempAddRemoveScripts(i,2)=1
		gamescript("addscript."+Str(TempAddRemoveScripts(i,1)))
	Else
		gamescript("removescript."+Str(TempAddRemoveScripts(i,1)))
	End If
Next
QTARS=0
End Function

Function ControlCondition(Condition$)
e=0
a$=""
b=1
c$=""
d$=""
p1=0
p2=0
While e=0
	c$=c$+a$
	a$=Mid(Condition$,b,1)
	b=b+1
	If a$="=" Or a$="<" Or a=">" Or a="!" Or a="\" Or a="/" e=1
Wend
d$=Mid(Condition$,b,Len(Condition$)-b+1)

p1=CalcExp(c$)
p2=CalcExp(d$)

Select a$
Case "=" If p1=p2 Return 1 Else Return 0
Case "<" If p1<p2 Return 1 Else Return 0
Case ">" If p1>p2 Return 1 Else Return 0
Case "!" If p1<>p2 Return 1 Else Return 0
Case "\" If p1>=p2 Return 1 Else Return 0
Case "/" If p1<=p2 Return 1 Else Return 0
End Select
End Function

Function TransVar#(var$)
check=0
Select var$
Case "QH"
	Return QH
	check=1
Case "gamescr"
	Return GameScr
	check=1	
Case "millisecs"
	Return MilliSecs()
	check=1
End Select

If Right(var$,1)="#"
	Return ScriptsVar#(Int(Left(var$,Len(var$)-1)))
End If
		
If Left(var$,10)="searchitem" Then
	b=11
	e=0
	a$=""
	c$=""
	d$=""
	g$=""
	While a<>"."
		b=b+1
		g$=g$+a$
		a$=Mid(var$,b,1)
	Wend
	a$=""
	While a<>"."
		b=b+1
		c$=c$+a$
		a$=Mid(var$,b,1)
	Wend
	a=""
	d$=Mid(var$,b+1,Len(var$)-b)
	If g$="hero"
		For i=1 To Qthings
			If inventory(i)\ID=Int(c$) And inventory(i)\quantity>=Int(Float(d$))
				e=1
			End If
		Next		
	Else
		f=0
		For i=1 To QN
			If NPC(i)\ID$ = g$
				f=i
			End If
		Next	
		If f<>0
			For i=1 To NPC(f)\Qthings
				If NPC(f)\inv[i]\ID=Int(c$) And NPC(f)\inv[i]\quantity>=Int(Float(d$))
					e=1
				End If
			Next
		Else
			For i=1 To QC
				If Cont(i)\ID$ = g$
					f=i
				End If
			Next
			If f<>0
				For i=1 To cont(f)\Qthings
					If cont(f)\inv[i]\ID=Int(c$) And cont(f)\inv[i]\quantity>=Int(Float(d$))
						e=1
					End If
				Next				
			End If
		End If	
	End If
	Return e
	check=1	
End If

If Left(var$,5)="equip"
	b=7
	c$=""
	a$=""
	d$=""
	While a$<>"."
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	d$=Mid(var$,b,Len(var$)-b+1)
	e=0
	If Int(c$)=0 
		If equip(0)\ID=Int(d$) e=1
	Else
		If equip(1)\ID=Int(d$) e=1
	End If
	Return e
	check=1
End If

If Left(var$,8)="opencont"
	d$=Right(var$,Len(var$)-9)
	e=0
	If GameScr=12
		If cont(Menu12NTC)\ID$=d$ e=1
	End If
	Return e
	check=1
End If

If Left(var$,8)="tradeNPC"
	d$=Right(var$,Len(var$)-9)
	e=0
	If GameScr=11
		If NPC(Menu11NTN)\ID$=d$ e=1
	End If
	Return e
	check=1
End If

If Left(var$,10)="visibility"
	visib#=constant("visibility_degrees")
	b=12
	a$=""
	c$=""
	d$=""
	f=0
	While a$<>"."
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	d$=Mid(var$,b,Len(var$)-b+1)

	For i=1 To QN
		If NPC(i)\ID$=c$ f=i
	Next
	px1#=EntityX#(NPC(f)\mesh1,1)
	pz1#=EntityZ#(NPC(f)\mesh1,1)
	pyaw#=EntityYaw#(NPC(f)\mesh1,1)
	plook#=NPC(f)\look

	If d$="hero"
		px2#=EntityX#(player(0)\mesh1,1)
		pz2#=EntityZ#(player(0)\mesh1,1)
	Else
		For i=1 To QN
			If NPC(i)\ID$=d$ f=i
		Next
		px2#=EntityX#(NPC(f)\mesh1,1)
		pz2#=EntityZ#(NPC(f)\mesh1,1)
	End If	
	
	dist#=Sqr((px1#-px2#)*(px1#-px2#)+(pz1#-pz2#)*(pz1#-pz2#))
	If dist<plook#
		rot#=180+rotate(px1#,pz1#,px2#,pz2#)
		pyaw1#=pyaw# - visib#/2
		pyaw2#=pyaw# + visib#/2
		If pyaw2#>=180 And rot#<0 rot#=rot# + 360
		If pyaw1#<-180 And rot#>0 rot#=rot# - 360
		
		If pyaw1#<rot# And pyaw2#>rot#
			Return 1
		Else
			Return 0
		End If
	Else
		Return 0
	End If
	check=1
End If

If Left(var$,3)="NPC"
	b=5
	a$=""
	c$=""
	d$=""
	f=0
	While a$<>"."
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	d$=Mid(var$,b,Len(var$)-b+1)
	For i=1 To QN
		If NPC(i)\ID$ = c$
			f=i
		End If
	Next
	Select d$
	Case "usetalk" Return NPC(f)\UseTalk
	Case "anim" Return NPC(f)\Anim
	Case "typeai" Return NPC(f)\TypeAI
	Case "dam" Return NPC(f)\Dam
	Case "asp" Return NPC(f)\Asp
	Case "speed" Return NPC(f)\Speed#
	Case "def" Return NPC(f)\Def
	Case "realhp" Return NPC(f)\realhp
	Case "maxhp" Return NPC(f)\MaxHp
	Case "crit" Return NPC(f)\Crit
	Case "distat" Return NPC(f)\distat
	Case "ex" Return NPC(f)\Ex
	Case "look" Return NPC(f)\look
;	Case "number" Return NPC(f)\Number	
	Case "weight" Return NPC(f)\weight
	Case "scalex" Return NPC(f)\ScaleX#
	Case "scaley" Return NPC(f)\ScaleY#
	Case "scalez" Return NPC(f)\ScaleZ#
	Case "yaw" Return NPC(f)\Yaw#
	Case "alive" Return NPC(f)\Alive
	Case "maintalk" Return NPC(f)\maintalk
	Case "qt" Return NPC(f)\QT
	Case "qthings" Return NPC(f)\Qthings
	Case "x" Return EntityX#(NPC(f)\mesh1)
	Case "y" Return EntityY#(NPC(f)\mesh1)
	Case "z" Return EntityZ#(NPC(f)\mesh1)
	End Select
	check=1
End If

If Left(var$,4)="cont"
	b=6
	a$=""
	c$=""
	d$=""
	f=0
	While a$<>"."
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	d$=Mid(var$,b,Len(var$)-b+1)
	For i=1 To QC
		If cont(i)\ID$ = c$
			f=i
		End If
	Next
	Select d$
	Case "scalex" Return cont(f)\ScaleX#
	Case "scaley" Return cont(f)\ScaleY#
	Case "scalez" Return cont(f)\ScaleZ#
	Case "yaw" Return cont(f)\Yaw#
	Case "x" Return EntityX#(cont(f)\mesh)
	Case "y" Return EntityY#(cont(f)\mesh)
	Case "z" Return EntityZ#(cont(f)\mesh)
	End Select
	check=1
End If

If Left(var$,4)="mesh"
	b=6
	a$=""
	c$=""
	d$=""
	f=0
	While a$<>"."
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	d$=Mid(var$,b,Len(var$)-b+1)
	For i=1 To Qmesh
		If Omesh(i)\ID$ = c$
			f=i
		End If
	Next
	Select d$
	Case "scalex" Return Omesh(f)\ScaleX#
	Case "scaley" Return Omesh(f)\ScaleY#
	Case "scalez" Return Omesh(f)\ScaleZ#
	Case "yaw" Return Omesh(f)\Yaw#
	Case "x" Return EntityX#(Omesh(f)\mesh)
	Case "y" Return EntityY#(Omesh(f)\mesh)
	Case "z" Return EntityZ#(Omesh(f)\mesh)
	End Select
	check=1
End If

If Left(var$,4)="hero"
	d$=Mid(var$,6,Len(var$)-5)

	Select d$
	Case "anim" Return Player(0)\Anim
	Case "st" Return Player(0)\St
	Case "con" Return Player(0)\con
	Case "dex" Return Player(0)\dex
	Case "sd" Return Player(0)\sd
	Case "gd" Return Player(0)\gd
	Case "la" Return Player(0)\la
	Case "ha" Return Player(0)\ha
	Case "ac" Return Player(0)\ac
	Case "ev" Return Player(0)\ev
	Case "tr" Return Player(0)\tr
	Case "dam" Return Player(0)\dam
	Case "asp" Return Player(0)\asp
	Case "speed" Return Player(0)\speed#
	Case "def" Return Player(0)\def
	Case "realhp" Return Player(0)\realhp
	Case "maxhp" Return Player(0)\maxhp
	Case "crit" Return Player(0)\crit
	Case "weight" Return Player(0)\weight
	Case "wed" Return Player(0)\wed
	Case "wec" Return Player(0)\wec
	Case "was" Return Player(0)\was
	Case "wet" Return Player(0)\wet
	Case "ard" Return Player(0)\ard
	Case "art" Return Player(0)\art
	Case "distat" Return Player(0)\distat
	Case "dac" Return Player(0)\dac	
	Case "dev" Return Player(0)\dev
	Case "ex" Return Player(0)\Ex
	Case "lvlexp" Return Player(0)\lvlexp
	Case "level" Return Player(0)\Level
	Case "charpoints" Return Player(0)\CharPoints
	Case "skillpoints" Return Player(0)\SkillPoints
	Case "deadmovietime" Return Player(0)\DeadMovieTime
	Case "movetype" Return Player(0)\MoveType
	Case "qthings" Return Qthings
	Case "x" Return EntityX#(Player(0)\mesh1)
	Case "y" Return EntityY#(Player(0)\mesh1)
	Case "z" Return EntityZ#(Player(0)\mesh1)	
	Case "scalex" Return Player(0)\ScaleX#
	Case "scaley" Return Player(0)\ScaleY#
	Case "scalez" Return Player(0)\ScaleZ#
	Case "yaw" Return Player(0)\Yaw#
	End Select	
	check=1
End If
If check=0 Return Float#(var$)
End Function

Function CalcExp#(var$)
QDCE=0
b=1
a$=" "
c$=""
While b=<Len(var$)+1
	Select a$
	Case "+" 
	QDCE=QDCE+1: DimCalcExp(QDCE)=1
	Case "-" 
	QDCE=QDCE+1: DimCalcExp(QDCE)=2
	Case "*" 
	QDCE=QDCE+1: DimCalcExp(QDCE)=3
	Case "/" 
	QDCE=QDCE+1: DimCalcExp(QDCE)=4
	End Select
	a$=""
	c$=""	
	While a$<>"+" And a$<>"-" And a$<>"*" And a$<>"/" And b=<Len(var$)+1
		c$=c$+a$
		a$=Mid(var$,b,1)
		b=b+1
	Wend
	QDCE=QDCE+1
	DimCalcExp(QDCE)=TransVar(c$)
Wend
		i=0
		While QDCE>i+2
			i=i+2
			If DimCalcExp(i)=4
				DimCalcExp(i-1)=DimCalcExp(i-1)/DimCalcExp(i+1)
				For j=i To QDCE-2
					DimCalcExp(j)=DimCalcExp(j+2)
				Next
				i=i-2
				QDCE=QDCE-2
			End If
		Wend
		i=0
		While QDCE>i+2
			i=i+2
			If DimCalcExp(i)=3
				DimCalcExp(i-1)=DimCalcExp(i-1)*DimCalcExp(i+1)
				For j=i To QDCE-2
					DimCalcExp(j)=DimCalcExp(j+2)
				Next
				i=i-2
				QDCE=QDCE-2
			End If
		Wend
		i=0
		While QDCE>i+2
			i=i+2
			If DimCalcExp(i)=2
				DimCalcExp(i-1)=DimCalcExp(i-1)-DimCalcExp(i+1)
				For j=i To QDCE-2
					DimCalcExp(j)=DimCalcExp(j+2)
				Next
				i=i-2
				QDCE=QDCE-2
			End If
		Wend
		i=0
		While QDCE>i+2
			i=i+2
			If DimCalcExp(i)=1
				DimCalcExp(i-1)=DimCalcExp(i-1)+DimCalcExp(i+1)
				For j=i To QDCE-2
					DimCalcExp(j)=DimCalcExp(j+2)
				Next
				i=i-2
				QDCE=QDCE-2
			End If
		Wend		
		Return DimCalcExp#(1)
End Function
(Offline)
 
Ответить с цитированием