在TGS\Script下添加装备专卖.txt
unit 装备专卖; interface function GetToken (aStr, aToken, aSep : String) : String; function CompareStr (aStr1, aStr2 : String) : Boolean; function callfunc (aText: string): string; procedure print (aText: string); function Random (aScope: integer): integer; function Length (aText: string): integer; procedure Inc (aInt: integer); procedure Dec (aInt: integer); function StrToInt (astr: string): integer; function IntToStr (aInt: integer): string; procedure exit; procedure OnGetResult (aStr : String); procedure OnLeftClick (aStr : String); implementation procedure OnLeftClick (aStr : String); var Str : String; Race : Integer; begin Str := callfunc ('getsenderrace'); Race := StrToInt (Str); if Race = 1 then begin Str := 'showwindow .\help\装备专卖.txt 0'; print (Str); exit; end; end; procedure OnGetResult (aStr : String); var Str, Name : String; 装备, 货币, 数量, 价格 : String; begin if aStr = 'close' then begin exit; end; if aStr <> '' then begin 价格 := GetToken(aStr, 装备, '_'); 数量 := GetToken(价格, 货币, '/'); Str := 'getsenderitemexistence ' + 货币; Str := Str + ':'; Str := Str + 数量; Str := callfunc(Str); if Str = 'false' then begin Str := 'say 缺少' + 货币; Str := Str + ':'; Str := Str + 数量; print(Str); exit; end; Str := 'getsenderitem ' + 货币; Str := Str + ':'; Str := Str + 数量; print(Str); Str := 'putsendermagicitem ' + 装备; Str := Str + ':1 @装备专卖 4'; print(Str);
这里还可以加一句公告XXX花多少交易币买了什么装备 留着大家自己添加吧
exit; end;
end; end. 在TGS\Help下添加装备专卖.txt
<trade> <title>装备购买</title> <text> 可以交易币跟我购买装备 </text> <command send="close">关闭</command> <body> <a send="男子血魔道袍_交易币/40">用「40交易币」换取男子血魔道袍 <a send="女子血魔道袍_交易币/40">用「40交易币」换取女子血魔道袍 <a send="男子血魔头盔_交易币/40">用「40交易币」换取男子血魔头盔 <a send="女子血魔头盔_交易币/40">用「40交易币」换取女子血魔头盔 <a send="男子血魔护腕_交易币/40">用「40交易币」换取男子血魔护腕 <a send="女子血魔护腕_交易币/40">用「40交易币」换取男子血魔护腕 <a send="男子血魔战靴_交易币/40">用「40交易币」换取男子血魔战靴 <a send="女子血魔战靴_交易币/40">用「40交易币」换取男子血魔战靴 </body> </trade>
|