在线时间 小时
注册时间2016-11-25
最后登录1970-1-1
|
发表于 2017-11-2 13:18:56
|
显示全部楼层
{) a: c' `7 c! g9 g0 s1 i
int ItemID = Value("MainMaterialID");
& } R% @8 F& n7 V# _ int MainOrd;3 N' @8 s7 J) F/ Y8 e
int SubItemID = Value("SubMaterialID");
9 w8 S% h: L- _& q int SubOrd;
0 v$ z1 D/ ?5 q) M+ z4 s int ExchangeOrd;$ i l. H6 e- u2 Q6 L
MainOrd = GetItemOrdByCount(ItemID,1);* n! A3 @/ O$ K( I0 ~6 t
if(MainOrd == 0)
8 T! Q! R6 _& K2 i4 m {6 ]3 c }, g' P: `+ ?/ A n4 X1 e
MainOrd = GetFirstItemOrd(ItemID);
/ R+ [" @0 p# [. n6 t ExchangeOrd = GetFirstEmptyPlace(0);4 M& G1 h' _3 N. m1 T' H
if(ExchangeOrd == 0). I3 `( P9 R q$ G) y- G; U+ h
{
" X: @2 o3 g! G( S8 R% y6 C ShowText("No Empty Place for MainItem");" A' D. m- w7 o/ `7 \( h% P, h
return;* G6 k/ `+ ?; z( k& @1 Z
}
9 u* c' w+ q8 Y$ S ExchangeItem(MainOrd,ExchangeOrd,1);
! r' p# q ?" V) L MainOrd = GetItemOrdByCount(ItemID,1);
4 e! o# Y" S& v# e4 t0 d if(MainOrd == 0)
! v- t) ~; y& s1 n4 c5 W- A% C' ~ {
z5 _5 z4 n( L; K" n% b2 e ShowText("Exchange Item Failure");* l; [3 ]* a8 U7 g& V" m
return; c# T% G" O1 j9 m8 H7 N' p: b
}" c: j9 `# E; o, \4 p# H: B
}
/ Y) h; I! N/ {- [; }: v6 h
( p3 |& v! c% b4 ]- u5 @ SubOrd = GetItemOrdByCount(SubItemID,1);
% }7 r* o% ^' P% N& n2 n if(SubOrd == 0)) ^- d& g! Q. ~8 f6 g _9 k- U" q; Y
{0 r" u; _. W$ I1 F
SubOrd = GetFirstItemOrd(SubItemID);
- U$ U0 s' N* ]# `& } t* A: i; Z% a7 ~ if(SubOrd == 0)7 D+ y a8 G5 _% ^
{% E% P6 A5 s( J- @/ w0 d
ShowText("No SubItem");
' J0 `, e0 v _$ H# [0 _ return;
2 W& J' d, g- l- ?9 k' E. r }
6 U$ j( P: I, }, K8 g0 {7 h# _ ExchangeOrd = GetFirstEmptyPlace(0);
1 H8 [0 U) @; ], l2 G3 T; j+ P if(ExchangeOrd == 0)0 A# _4 ?0 g! v$ R: D
{
& a8 `4 {6 S5 k( \8 T. W; q3 E- |' } ShowText("No Empty Place for SubItem");; v6 R6 \- }" b7 Y% B
return;7 s, n) p' L+ S) F* z6 V. C5 u
}$ d# {( y+ f& Y; H% h9 {
ExchangeItem(SubOrd,ExchangeOrd,1);' k& e, r+ I4 @7 h' X
SubOrd = GetItemOrdByCount(SubItemID,1);
4 d/ _2 g0 P4 M7 h7 N if(SubOrd == 0)
/ r1 z+ o7 K# P! m$ o {
" R6 n3 m- p/ ?$ Z! p+ x ShowText("Exchange Item Failure"); u9 ?- o. J5 Z: e) ~8 p/ s
return;
: o s6 a; ^: u2 Q' l; S }
3 G4 Q' a& U5 ~( i( }$ m }4 X; U, y3 ^. l( l o9 I
BeginCompoundItem(MainOrd,SubOrd);
8 n7 O% b( E+ s7 M# i- s9 o, q
# K2 u+ o2 a( _" r. A5 S* ] while(1). p; c. f9 H' ?( J" {
{
. J- j5 i5 P! y$ w( I MainOrd = Value("CompoundOrd");# I3 _% R) }+ j4 J6 Z
if(MainOrd == 0)
5 N- k0 C4 O/ {# ?, @& w3 } {
% b1 i% x4 R% W4 Y! ? ShowText("CompoundItem Failure");
4 f2 s- f3 Y# ^1 ?' o, O return;# U+ M0 z# s+ o
}
3 D( z: g7 K- b6 E SubOrd = GetItemOrdByCount(SubItemID,1);
1 f% l' z6 h. M if(SubOrd == 0)# N$ M5 A0 B) O0 x8 ?9 u8 k
{9 q! B1 X' d/ `$ f- {6 l( p
SubOrd = GetFirstItemOrd(SubItemID);8 A% r; I: e7 f; d" d0 |
if(SubOrd == 0)- N( X! O1 Q, f2 H4 M" P9 }
{8 Y: J `+ B1 O4 E6 u
ShowText("No SubItem");1 z# x5 w6 Y5 u6 w
return;( e" J# W$ T* p1 i, {1 R8 n
}6 j# k/ D. s# D" G
ExchangeOrd = GetFirstEmptyPlace(0);6 M1 V, o2 O. B+ r8 d
if(ExchangeOrd == 0)
% ^1 H1 l$ u( y6 w {/ _$ V& P+ a4 l) } W# D
ShowText("No Empty Place for SubItem");
$ t: w; r% c* |, k$ a return;5 c5 L" R* y6 f( N: F
}
6 l- D2 L6 W/ e2 u( ^ ExchangeItem(SubOrd,ExchangeOrd,1);
5 R" H$ L+ n4 }6 c/ D2 N SubOrd = GetItemOrdByCount(SubItemID,1);
* m/ m! S; h. y4 z% { if(SubOrd == 0)
& y1 n V" j. g: w+ g" v {7 a: }6 ~# H7 K+ y& n. f+ `
ShowText("Exchange Item Failure");5 B0 ~; E0 y6 y7 w/ O
return;6 v1 m5 b9 ^. d, W% N
}- F1 `" ]( _7 v* k. f. Y4 [; \
} 0 `& b. t8 Q, a/ ?+ _
BeginCompoundItem(MainOrd,SubOrd);. C1 K7 t0 j$ _% J" O3 b
Yield(0); 4 D; T8 ?8 @$ b3 z( e' a/ U/ a
} / i0 z; { f0 `- h/ n5 d8 A
} |
|