Paylaşmamda ki asıl amaç merak edip geliştirmek isteyen kendine göre ayarlamak isteyen arkadaşlar varsa diye Random Spawn, Random Chest, Random Item gibi scriptlerde ufak ayarlarla kullanabileceğiz uzun uzun satırlardan sizi kurtarabilecek bir function olmasıdır.
Kod:
[Function Random_Kordinat]
FOR 1000
Local.X=<R5000>
Local.Y=<R4000>
Local.M=<M>
Local.Z=<Serv.Map(<dLocal.X>,<dLocal.Y>,0,<dLocal.M>
Args=<dLocal.X>,<dLocal.Y>,<dLocal.Z>,<dLocal.M>
IF !((<UID.<Serv.Map(<Args>).Region.UID>.Type> == T_Multi) || (<UID.<Serv.Map(<Args>).Region.UID>.Type> == T_Ship) || (<UID.<Serv.Map(<Args>).Region.UID>.Type> == T_Multi_Custom))
IF ((<Serv.Map(<Args>).Type> == T_Dirt) || (<Serv.Map(<Args>).Type> == T_Forest) || (<Serv.Map(<Args>).Type> == T_Grass) || (<Serv.Map(<Args>).Type> == T_Jungle) || (<Serv.Map(<Args>).Type> == T_Snow) || (<Serv.Map(<Args>).Type> == T_Sand))
IF !(<Serv.Map(<Args>).Region.Flags>&Region_Flag_Guarded|Region_Flag_Safe|Region_Flag_UnderGround)
IF !((<Serv.Map(<Args>).IsNearType T_Tree 2 0 1>) || (<Serv.Map(<Args>).IsNearType T_Rock 2 0 1>) || (<Serv.Map(<Args>).IsNearType T_Wall 5 0>) || (<Serv.Map(<Args>).IsNearType T_Water 10 0 1>))
Serv.Newitem i_memory
New.P <Args>
New.Fix
Args <New.P>
New.Remove
Return <Args>
Endif
Endif
Endif
Endif
ENDFOR
Kullanımı çok basit bir yere random birşey göndermek istiyorsanız;
Go <Random_Kordinat> yazmanız yeterlidir
Diğer bir örnek
Serv.Newitem i_katana
New.Go <Random_Kordinat>