发新话题
打印

[讨论] 初级魔力lua解析

求助大神指点一下,GA能用的宠物技能学习卷放到CGMSV上就老提示宠物技能栏已满呢??bbs.mocwww.com2 S5 U$ {  E5 j( R

9 _$ S( ~6 M+ [2 D2 E9 T7 g妖城在线论坛bbs.mocwww.com" d7 }% D5 I" k& _% A
: ^7 I+ l+ a3 u6 L! o8 f
if _Select==2 or _Seqno==99999 then魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表9 c1 e& K; ?% [
                return. ^7 j, O- H& b/ S3 i
        end
) a' e6 u5 J% u% d& z—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲートbbs.mocwww.com  g7 h6 M8 H7 H% y' E4 T% [# j
        if _Seqno==10 then
1 y: \+ z/ C8 \4 {7 l/ {2 ybbs.mocwww.com                --Get Session魔力私服,最新魔力宝贝私服技术交流% J  G* V; z& R' i! ]- ]3 Z* i
                SelectPetSlot[_PlayerIndex] = _Data-1
5 Y. H# y+ Q3 O  d  o—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                local tItemSlot = SelectItemSlot[_PlayerIndex]魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表. P# k. S! D! ?8 J2 t
                local tPetSlot = SelectPetSlot[_PlayerIndex]—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート  V5 q( Z  I' p3 q' g1 W. @
                --Get Pet Databbs.mocwww.com6 W  q  [) {; r. A* w& P
                local tPetIndex = Char.GetPet(_PlayerIndex, tPetSlot)—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート  c% d# C! x* z, R. r2 T
                if tPetIndex<0 thenbbs.mocwww.com4 U8 \, F0 b( H9 }$ v0 I1 D8 C- {
                        return 0bbs.mocwww.com3 K( J0 M! ]6 }' D! P
                end—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート2 _) |) L* ^0 t$ ~5 ~3 Z
                local tPetName = Char.GetData(tPetIndex, %对象_名字%)
1 n0 \, K# b, N' {) g                local tPetID = Char.GetData(tPetIndex, 68)& T& W( R' i$ b3 V% v9 H  A! |
                local tPetLv = Char.GetData(tPetIndex, %对象_等级%)
3 J! y& T( S2 v) h8 A) p妖城在线论坛                local tPetGetLv = Char.GetData(tPetIndex, %宠物_获取时等级%)妖城在线论坛9 ^4 c' B7 t8 _
                local tPetTechSlotMax = Char.GetData(tPetIndex, %宠物_技能栏%)bbs.mocwww.com  c4 i+ G* D- b0 y8 J; h! W" B
                --Get Item Data—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート+ D( u* }: }: K: |0 N, B
                local tItemIndex = Char.GetItemIndex(_PlayerIndex, tItemSlot)魔力私服,最新魔力宝贝私服技术交流% h  V# L' a* Q3 w5 i% \
                if tItemIndex<0 then
  S" o0 N. W/ l                        return 0魔力私服,最新魔力宝贝私服技术交流( m% C  B9 D0 K* q
                end
5 D+ w# q4 x! R: K# }7 g1 A魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表                local tItemName = Item.GetData(tItemIndex, %道具_名字%)bbs.mocwww.com. G) k) W9 G7 F' f# Z* @( }- ]
                local tItemID = Item.GetData(tItemIndex, %道具_ID%)妖城在线论坛8 S. Z, }7 E  a0 H
                local tTechType = Item.GetData(tItemIndex, %道具_特殊类型%) or 0
$ w1 x/ A. \1 o                local tTechID = Item.GetData(tItemIndex, %道具_子参一%) or 0妖城在线论坛( V' q6 i' w0 g. P; T. A) c
                local tPreTechID = Item.GetData(tItemIndex, %道具_子参二%) or 07 K$ u3 _2 h* c) o& f  V
                        print("\n=================调试信息====================")
( c$ G4 E& X/ ]% i1 y) ], n魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表                        print("tItemID=" .. tItemID)魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表$ F1 c% p1 Y" l; T  m7 P9 ?4 g7 m
                        print("tItemName=" .. tItemName)—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート4 k$ \$ f! Z0 R
                        print("tTechType=" .. tTechType)
; y0 ?* Z/ j& t/ e—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                        print("tTechID=" .. tTechID)
  @) C/ ^. D1 t—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                        print("tPreTechID=" .. tPreTechID)
- ]* w4 y+ u7 P. e5 D魔力私服,最新魔力宝贝私服技术交流                        print("NorPreTechID=" .. NorPreTechID)
8 b7 u4 Y  T6 Ybbs.mocwww.com                        print("TechSlot=" .. #PetTechNpc_GetTechList(tPetIndex) .. "/" .. tPetTechSlotMax)
8 o4 ?5 @% d, f/ K  h9 L! wbbs.mocwww.com                        print("InTable=" .. PetTechNpc_GetTechPos(tPetIndex, tPreTechID))魔力私服,最新魔力宝贝私服技术交流8 R% M7 W& E# w3 E( c: W
                --Check Type妖城在线论坛" R% F6 x6 {' X! P3 `
                if tTechType==1 then
2 h# {, J4 U0 Mbbs.mocwww.com                        if PetTechNpc_CheckInTable(SPetListA, tPetID)~=true then妖城在线论坛$ H0 f( B- A' e$ T
                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:特定宠物")—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート) z6 y) _' m0 b/ _, z0 }( n
                                return 0魔力私服,最新魔力宝贝私服技术交流9 t% y* l$ e; F9 P
                        end
# G2 f0 W& T" ^* `$ Y, a( {                elseif tTechType==2 then
5 @- C4 c5 t0 o- k, f8 Pbbs.mocwww.com                        if PetTechNpc_CheckInTable(SPetListB, tPetID)~=true then# P% |' o' L" o0 r6 O* h4 |, q
                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:特定宠物")妖城在线论坛- O9 S- C" f; V3 ?) i
                                return 0
7 R. r* @* f- [3 bbbs.mocwww.com                        end
4 ^% j' [1 {8 Pbbs.mocwww.com                elseif tTechType==3 then
+ Q# P" L5 N6 C; I/ m( ~bbs.mocwww.com                        if tPetGetLv>1 then, U1 {1 L! ?+ d" Z$ L
                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:非野生"). ~) n9 F4 C4 @& |: |. X
                                return 0魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表  ]' _$ f  Q. u* u0 P
                        endbbs.mocwww.com* E* L5 M, @! ^) }+ l- S  n  I4 C" D
                elseif tTechType==4 then
. Y5 ^2 O" }) }" i0 s9 X                        if tPetLv<PetMaxLevel then
4 p! e% n# F/ g, R2 X& C                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:满级")bbs.mocwww.com) `: l5 j+ W( L: r
                                return 0妖城在线论坛7 O/ o, ^. ^: E4 o4 o
                        end妖城在线论坛+ j0 L0 d* |7 y% H
                endbbs.mocwww.com, K; `" A1 @1 r5 ?
                --Check NorPreTechID
( Y5 B& H# k1 k. w% S魔力私服,最新魔力宝贝私服技术交流                if tPreTechID==NorPreTechID and        #PetTechNpc_GetTechList(tPetIndex)>=tPetTechSlotMax and PetTechNpc_GetTechPos(tPetIndex, tPreTechID)<0 then魔力私服,最新魔力宝贝私服技术交流0 G. H$ Z4 W8 @! o
                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:请先学习【高阶技能栏】技能")
2 l8 E3 T( Z" t) E6 }+ S* I—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                                return 0bbs.mocwww.com! e$ Y( s3 F! Z. N0 n9 A+ c5 o$ s
                end
. D+ k" z1 D, ~: s0 L                --Check PreTech
. z8 C& N: Z# k/ ?! P7 k魔力私服,最新魔力宝贝私服技术交流                if tPreTechID>0 and tPreTechID~=NorPreTechID then
( y7 w$ F3 T0 r6 u& {                        if PetTechNpc_GetTechPos(tPetIndex, tPreTechID)<0 then
  C' A5 g* r2 m. E4 q. l妖城在线论坛                                NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:前置技能")
. j4 Q: s9 P* ?9 g% ?魔力私服,最新魔力宝贝私服技术交流                                return 0魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表9 f0 O) R) U4 Z& s2 }
                        end
5 [; x6 t2 _, |( M+ \: U) ebbs.mocwww.com                end
  L) {$ ^2 I# f" O魔力私服,最新魔力宝贝私服技术交流                --Check Slot
0 n4 t4 h% S) G  u. h. D4 W—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                if tPreTechID<=0 and #PetTechNpc_GetTechList(tPetIndex)>=tPetTechSlotMax thenbbs.mocwww.com4 e4 E; N/ e5 ~6 V  b  t
                        NLG.SystemMessage(_PlayerIndex, "[错误] 你选择的宠物不满足以下学习条件:技能栏已满")- d* F1 U- G* {3 L1 x# U2 l
                        return 0魔力私服,最新魔力宝贝私服技术交流- x5 O4 q) K4 X3 [  `3 y
                end魔力私服,最新魔力宝贝私服技术交流8 T* R" q/ n7 J3 K+ H
                --Del PreTech妖城在线论坛# T; z9 P0 ~. o3 n% z- Y
                if tPreTechID>0 then
9 S! p$ r# d+ `* M% l0 _—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                        local tPreTechPos = PetTechNpc_GetTechPos(tPetIndex, tPreTechID)
! D; {+ ^; ^! Z—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート                        Pet.DelSkill(tPetIndex, tPreTechPos)
) D. S0 g2 U/ \                end
( i9 Z6 L0 l) v4 Bbbs.mocwww.com                --Add Techbbs.mocwww.com8 w- ~4 [2 F2 L- z7 }
                local rt = Pet.AddSkill(tPetIndex, tTechID); [) n3 [$ K/ m& J# d
                if rt~=1 then
  I' }/ {$ t: a& R1 W6 Q                        NLG.SystemMessage(_PlayerIndex, "[错误] 未知原因错误")
7 K0 {( a6 X0 d, Lbbs.mocwww.com                        return 0—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート6 q. s) H( O. h5 B6 \( I1 R
                end魔力私服,最新魔力宝贝私服技术交流" W- C* N% [. B- Z3 F
                --Del Item—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート8 Q! r/ @( w( P  r7 B
                Char.DelItem(_PlayerIndex, tItemID, 1)
( o4 Q& x. O9 \: W# J魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表                --Up Pet—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート. ]( S# k5 Z& a- E# x
                Pet.UpPet(_PlayerIndex, tPetIndex)
2 z. p( s7 b1 x2 K3 V                NLG.SystemMessage(_PlayerIndex, "你的宠物" .. tPetName .. "学会了新技能。")
  [4 N. B/ j7 w! I" `6 v        return 1
; f: Z7 w( M5 O3 s妖城在线论坛        end—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート  }$ a& S* F; H$ o4 h- H
end魔力私服,最新魔力宝贝私服技术交流5 E# U& K" W7 U
魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表- `0 n& [8 d9 J& B3 i
--使用道具
5 e+ ]6 A* B0 P. ^- Z+ y  ^NL.RegItemString(nil, "PetTechNpc_ItemUse", "LUA_usePetTech");魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表% z9 t2 J: |2 @7 m; T
function PetTechNpc_ItemUse(_PlayerIndex, _ToPlayerIndex, _Slot)* E& t! f! s* K: j+ Z2 g: \9 \2 A
        SelectItemSlot[_PlayerIndex] = _Slot
% G+ q0 c* t+ s—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート        PetTechNpc_Talked( tbl_LuaNpcIndex["PetTechNpc"], _PlayerIndex, 1)
7 p. i1 d- H6 w2 pbbs.mocwww.com        return 1
$ i3 V9 [2 v5 }# ~' c9 S魔力私服,最新魔力宝贝私服技术交流end

TOP

提示lua道具被重复注册怎么处理啊????

TOP

发新话题