//global vars
atom start_time,elasped_time,tx,ty
start_time=current_time()
tx=0
ty=0
sequence world_data
world_data={}
//end global vars
procedure enter_world(atom t, atom x, atom y)
world_data=append(world_data,{t,x,y})
end procedure
function speed()
atom sp
sp= (0.004 + ( ( (client_list[1][client_stats][stat_speed][2]) / 75) * (0.0096 - 0.004)))
return sp*speed_mut
end function
procedure speed_ground()
integer x,y
x=floor(client_list[1][client_x])
y=floor(client_list[1][client_y])
//map_data[y][x] --tile type from xml data
//ground_speed --tile speed from xml data
if sequence(ground_delta(map_data[y][x],ground_speed)) then
speed_mut = real( ground_delta(map_data[y][x],ground_speed) )
else
speed_mut = 1
end if
end procedure
procedure update(integer client)
atom SPEED
SPEED=speed()
elasped_time = current_time()-start_time
angle=get_angle_to(client_list[1][client_x],client_list[1][client_y],client_list[1][client_tx],client_list[1][client_ty])
if tx!=client_list[1][client_tx] or ty!=client_list[1][client_ty] then
enter_world(current_time(),client_list[1][client_x],client_list[1][client_y])
tx=client_list[1][client_tx]
ty=client_list[1][client_ty]
end if
if point_distance(client_list[1][client_x],client_list[1][client_y],client_list[1][client_tx],client_list[1][client_ty])<0.5 then
client_list[1][client_x]=client_list[1][client_tx]
client_list[1][client_y]=client_list[1][client_ty]
else
client_list[1][client_x]+=(elasped_time * SPEED)*sin(degtorad(angle))
client_list[1][client_y]-=(elasped_time * SPEED)*cos(degtorad(angle))
end if
speed_ground()
start_time=current_time()
end procedure
procedure new_tick()
write=writeint(write,tick_id) --tick id
ttime=current_time()
write=writeint(write,ttime) --time
--position
write=writefloat(write,client_list[client][client_x])
write=writefloat(write,client_list[client][client_y])
--world location
write=writeshort(write,length(world_data))
for i=1 to length(world_data) do
write=writeint(write,world_data[i][1])
write=writefloat(write,world_data[i][2])
write=writefloat(write,world_data[i][3])
end for
world_data={}
temp=reverse(int_to_bytes(length(write)+5)) &move_packet
write=rc4_arcfour_encrypt_block(client_list[client][client_rc4_2],write)
socket_send_data(client,temp&write)
end procedure
//com.company.assembleegameclient.game._-0iW
package com.company.assembleegameclient.game{
import __AS3__.vec.Vector;
import _-1jo._-Sv;
import __AS3__.vec.*;
public class _-0iW {
public var lastClearTime_:int = -1;
public var records_:Vector.<_-Sv>;
public function _-0iW(){
this.records_ = new Vector.<_-Sv>();
super();
}
.//time x y
public function addRecord(_arg1:int, _arg2:Number, _arg3:Number):void{
if (this.lastClearTime_ < 0){
return;
};
var _local4:int = this._-If(_arg1);
if ((((_local4 < 1)) || ((_local4 > 10)))){
return;
};
if (this.records_.length == 0){
this.records_.push(new _-Sv(_arg1, _arg2, _arg3));
return;
};
var _local5:_-Sv = this.records_[(this.records_.length - 1)];
var _local6:int = this._-If(_local5.time_);
if (_local4 != _local6){
this.records_.push(new _-Sv(_arg1, _arg2, _arg3));
return;
};
var _local7:int = this._-0E7(_local4, _arg1);
var _local8:int = this._-0E7(_local4, _local5.time_);
if (_local7 < _local8){
_local5.time_ = _arg1;
_local5.x_ = _arg2;
_local5.y_ = _arg3;
return;
};
}
private function _-If(_arg1:int):int{
return ((((_arg1 - this.lastClearTime_) + 50) / 100));
}
private function _-0E7(_arg1:int, _arg2:int):int{
return (Math.abs(((_arg2 - this.lastClearTime_) - (_arg1 * 100))));
}
public function clear(_arg1:int):void{
this.records_.length = 0;
this.lastClearTime_ = _arg1;
}
}
}//package com.company.assembleegameclient.game
public function move(_arg1:int, _arg2:Player):void{
var _local7:int;
var _local8:int;
var _local3:Number = -1;
var _local4:Number = -1;
if (((_arg2) && (!(_arg2.isPaused())))){
_local3 = _arg2.x_;
_local4 = _arg2.y_;
};
var _local5:_-16J = (this._-wv._-0JM(MOVE) as _-16J);
_local5.tickId_ = _arg1;
_local5.time_ = gs_.lastUpdate_;
_local5.newPosition_.x_ = _local3;
_local5.newPosition_.y_ = _local4;
var _local6:int = gs_.moveRecords_.lastClearTime_;
_local5.records_.length = 0;
if ((((_local6 >= 0)) && (((_local5.time_ - _local6) > 125)))){
_local7 = Math.min(10, gs_.moveRecords_.records_.length);
_local8 = 0;
while (_local8 < _local7) {
if (gs_.moveRecords_.records_[_local8].time_ >= (_local5.time_ - 25)) break;
_local5.records_.push(gs_.moveRecords_.records_[_local8]);
_local8++;
};
};
gs_.moveRecords_.clear(_local5.time_);
_-1YC.sendMessage(_local5);
((_arg2) && (_arg2._-Cp()));
}
Player.xml
<Object type="0x030e" id="Wizard">
<Class>Player</Class>
<SlotTypes>17, 11, 14, 9, 0, 0, 0, 0, 0, 0, 0, 0</SlotTypes>
Equip.xml
<Object type="0xa97" id="Energy Staff">
<SlotType>17</SlotType>
<Tier>0</Tier>

