足球的腳本 大家交流
發表於 : 週三 10月 16, 2002 7:34 pm
這是足球的一套系統 發表給大家看看
有心玩sphere的人可以參考看看..當然還有後期的一些更改
大家自己慢慢去增加吧
[itemdef i_soccer_ball]
id=i_cannon_ball
name=Soccer Ball
type=t_soccer_ball
on=@create
color=029
attr=08010
on=@dclick
if <distance>>2
src.sysmessage You're too far.
return 1
else
SRC.STAM=<SRC.STAM>-5
f_calcio
IF (<eval (<SRC.STR>+rand(100))><<80)
src.emote can't shoot the ball!
elseif <src.dir>==0
var.mov=0 -1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==1)
var.mov=1 -1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==2)
var.mov=1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==3)
var.mov=1 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==4)
var.mov=0 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==5)
var.mov=-1 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==)
var.mov=1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==6)
var.mov=-1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==7)
var.mov=-1 -1 0
src.emote shoots the ball!
f_shoot
return 1
endif
endif
ON=@TIMER
IF (<VAR.TIME>>>0)
MOVE=<VAR.MOV>
VAR.TIME=<EVAL (<VAR.TIME>-1)>
f_shoot
ENDIF
ON=@CLICK
if <distance>>2
src.sysmessage You're too far.
return 1
IF (<eval (<SRC.STR>+rand(100))><<80)
src.emote can't stop the ball!
else
src.emote stops the ball!
TIMER=-1
endif
[function f_calcio]
if (rand(10)==0)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-1)>
elseif (rand(10)==1)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-2)>
elseif (rand(10)==2)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-3)>
elseif (rand(10)==3)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+1)>
elseif (rand(10)==4)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+2)>
elseif (rand(10)==5)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+3)>
else
var.time=<eval ((<SRC.STAM>+<SRC.STR>)/10)>
endif
[typedef t_soccer_ball]
on=@step
IF (<eval (<SRC.DEX>+rand(100))><<110)
TIMER=-1
src.emote loses the ball!
elseif <src.dir>==0
f_step
move=0 -1 0
elseif <src.dir>==1
f_step
move=1 -1 0
elseif <src.dir>==2
f_step
move=1 0 0
elseif <src.dir>==3
f_step
move=1 1 0
elseif <src.dir>==4
f_step
move=0 1 0
elseif <src.dir>==5
f_step
move=-1 1 0
elseif <src.dir>==6
f_step
move=-1 0 0
elseif <src.dir>==7
f_step
move=-1 -1 0
endif
[function f_shoot]
TIMER=1
//STR gain
IF ((<SRC.STR><<60) && (rand(25)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<70) && (rand(30)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<80) && (rand(40)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<90) && (rand(45)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<100) && (rand(50)==1))
SRC.STR=<SRC.STR>+1
ENDIF
[function f_step] //DEX gain
IF ((<SRC.DEX><<60) && (rand(10)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<70) && (rand(20)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<80) && (rand(30)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<90) && (rand(40)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<100) && (rand(50)==1))
SRC.DEX=<SRC.DEX>+1
ENDIF
有心玩sphere的人可以參考看看..當然還有後期的一些更改
大家自己慢慢去增加吧
[itemdef i_soccer_ball]
id=i_cannon_ball
name=Soccer Ball
type=t_soccer_ball
on=@create
color=029
attr=08010
on=@dclick
if <distance>>2
src.sysmessage You're too far.
return 1
else
SRC.STAM=<SRC.STAM>-5
f_calcio
IF (<eval (<SRC.STR>+rand(100))><<80)
src.emote can't shoot the ball!
elseif <src.dir>==0
var.mov=0 -1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==1)
var.mov=1 -1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==2)
var.mov=1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==3)
var.mov=1 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==4)
var.mov=0 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==5)
var.mov=-1 1 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==)
var.mov=1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==6)
var.mov=-1 0 0
src.emote shoots the ball!
f_shoot
return 1
elseif (<src.dir>==7)
var.mov=-1 -1 0
src.emote shoots the ball!
f_shoot
return 1
endif
endif
ON=@TIMER
IF (<VAR.TIME>>>0)
MOVE=<VAR.MOV>
VAR.TIME=<EVAL (<VAR.TIME>-1)>
f_shoot
ENDIF
ON=@CLICK
if <distance>>2
src.sysmessage You're too far.
return 1
IF (<eval (<SRC.STR>+rand(100))><<80)
src.emote can't stop the ball!
else
src.emote stops the ball!
TIMER=-1
endif
[function f_calcio]
if (rand(10)==0)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-1)>
elseif (rand(10)==1)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-2)>
elseif (rand(10)==2)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)-3)>
elseif (rand(10)==3)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+1)>
elseif (rand(10)==4)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+2)>
elseif (rand(10)==5)
var.time=<eval (((<SRC.STAM>+<SRC.STR>)/10)+3)>
else
var.time=<eval ((<SRC.STAM>+<SRC.STR>)/10)>
endif
[typedef t_soccer_ball]
on=@step
IF (<eval (<SRC.DEX>+rand(100))><<110)
TIMER=-1
src.emote loses the ball!
elseif <src.dir>==0
f_step
move=0 -1 0
elseif <src.dir>==1
f_step
move=1 -1 0
elseif <src.dir>==2
f_step
move=1 0 0
elseif <src.dir>==3
f_step
move=1 1 0
elseif <src.dir>==4
f_step
move=0 1 0
elseif <src.dir>==5
f_step
move=-1 1 0
elseif <src.dir>==6
f_step
move=-1 0 0
elseif <src.dir>==7
f_step
move=-1 -1 0
endif
[function f_shoot]
TIMER=1
//STR gain
IF ((<SRC.STR><<60) && (rand(25)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<70) && (rand(30)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<80) && (rand(40)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<90) && (rand(45)==1))
SRC.STR=<SRC.STR>+1
ELSEIF ((<SRC.STR><<100) && (rand(50)==1))
SRC.STR=<SRC.STR>+1
ENDIF
[function f_step] //DEX gain
IF ((<SRC.DEX><<60) && (rand(10)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<70) && (rand(20)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<80) && (rand(30)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<90) && (rand(40)==1))
SRC.DEX=<SRC.DEX>+1
ELSEIF ((<SRC.DEX><<100) && (rand(50)==1))
SRC.DEX=<SRC.DEX>+1
ENDIF