📄 uuser.pas
字号:
// 版摹 歹窍扁
n := AttribClass.MaxLife div decbody;
if n > 15 then exp := DEFAULTEXP // 15 措捞惑 嘎阑父 窍促搁 1000
else exp := DEFAULTEXP * n * n div (15 * 15); // 15措 嘎栏搁 磷备档 巢栏搁 10 => 500 n 15 => 750 5=>250
SubData.ExpData.Exp := exp;
SubData.ExpData.ExpType := 0;
if apercent = 100 then begin
// if not isUserID (aAttacker) then begin // 内膏飘啊 酒聪搁 个户 倾侩
SendLocalMessage (aattacker, FM_ADDATTACKEXP, BasicData, SubData);
// end;
end;
// 碍脚 歹窍扁
// if not isUserID (aAttacker) then begin // 内膏飘啊 酒聪搁 个户 倾侩
SubData.ExpData.Exp := DEFAULTEXP - SubData.ExpData.Exp;
SendLocalMessage (BasicData.Id, FM_ADDPROTECTEXP, BasicData, SubData);
// end;
snd := Random (100);
if snd < 40 then begin
case AttribClass.AttribData.cAge of
0..5999 : snd := 2002;
6000..11900 : snd := 2004;
else snd := 2000;
end;
if not BasicData.Feature.rboman then snd := snd + 200;
SetWordString (SubData.SayString, IntToStr (snd) + '.wav');
SendLocalMessage (NOTARGETPHONE, FM_SOUND, BasicData, SubData);
end;
BoSysopMessage (IntToStr(decBody) + ' : ' + IntToStr(exp), 10);
Result := n;
end;
procedure TUserObject.CommandBowing (CurTick: integer; atid: integer; atx, aty: word; boSend: Boolean);
var
snd, pos : integer;
boHitAllow: Boolean;
SubData : TSubData;
tmpItemData : TItemData;
begin
if not AllowCommand (CurTick) then exit;
if HitedTick + LifeData.AttackSpeed > CurTick then exit;
if HaveMagicClass.pCurAttackMagic = nil then exit;
if ShootBowCount > (HaveMagicClass.pCurAttackMagic^.rcSkillLevel div 2000) + 1 then begin
SetTargetId (0);
ShootBowCount := 0;
exit;
end;
inc (ShootBowCount);
boHitAllow := FALSE;
case HaveMagicClass.pCurAttackMagic^.rMagicType of
5 : // 泵贱
begin
pos := HaveItemClass.FindKindItem (7);
if pos <> -1 then begin
HaveItemClass.ViewItem (pos, @tmpItemData);
tmpItemData.rOwnerName[0] := 0;
if HaveItemClass.DeleteKeyItem (pos, 1, @tmpItemData) then boHitAllow := TRUE;
end;
end;
6 : // 捧过
begin
pos := HaveItemClass.FindKindItem (8);
if pos <> -1 then begin
HaveItemClass.ViewItem (pos, @tmpItemData);
tmpItemData.rOwnerName[0] := 0;
if HaveItemClass.DeleteKeyItem (pos, 1, @tmpItemData) then boHitAllow := TRUE;
end;
end;
else
boHitAllow := TRUE;
end;
if boHitAllow = FALSE then exit;
HitedTick := CurTick;
if HaveMagicClass.DecEventMagic (HaveMagicClass.pCurAttackMagic) = FALSE then begin
SendClass.SendChatMessage ('傍拜窍瘤 给沁嚼聪促', SAY_COLOR_SYSTEM);
exit;
end;
if GetViewDirection (BasicData.x, BasicData.y, atx, aty) <> basicData.dir then
CommandTurn ( GetViewDirection (BasicData.x, BasicData.y, atx, aty), TRUE);
SubData.motion := BasicData.Feature.rhitmotion;
SendLocalMessage ( NOTARGETPHONE, FM_MOTION, BasicData, SubData);
SubData.HitData.damageBody := LifeData.damageBody;
SubData.HitData.damageHead := LifeData.damageHead;
SubData.HitData.damageArm := LifeData.damageArm;
SubData.HitData.damageLeg := LifeData.damageLeg;
// SubData.HitData.ToHit := 100 - LifeData.avoid;
SubData.HitData.ToHit := 75;
SubData.HitData.HitType := 1;
SubData.HitData.HitLevel := 0;
if HaveMagicClass.pCurAttackMagic <> nil then
SubData.HitData.HitLevel := HaveMagicClass.pCurAttackMagic^.rcSkillLevel;
AttribClass.CurLife := AttribClass.CurLife - HaveMagicClass.pCurattackmagic^.rEventDecLife;
SubData.TargetId := atid;
SubData.tx := atx;
SubData.ty := aty;
// SubData.BowImage := HaveMagicClass.pCurAttackMagic^.rBowImage;
SubData.BowImage := tmpItemData.rActionImage;
SubData.BowSpeed := HaveMagicClass.pCurAttackMagic^.rBowSpeed;
SubData.BowType := HaveMagicClass.pCurAttackMagic^.rBowType;
SendLocalMessage (NOTARGETPHONE, FM_BOW, BasicData, SubData);
snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber;
if snd <> 0 then begin
case HaveMagicClass.pCurAttackMagic^.rcSkillLevel of
0..4999: snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber;
5000..8999: snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber+1;
else snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber+2;
end;
SetWordString (SubData.SayString, InttoStr(snd) + '.wav');
SendLocalMessage (NOTARGETPHONE, FM_SOUND, BasicData, SubData);
end;
if boSend then SendClass.SendMotion (BasicData.id, SubData.motion);
end;
function TUserObject.CommandHit (CurTick: integer; boSend: Boolean): Boolean;
var
snd, allowAttackTick : integer;
per, nskill :integer;
SubData : TSubData;
begin
Result := FALSE;
if not AllowCommand (CurTick) then exit;
if HaveMagicClass.pCurAttackMagic = nil then exit;
per := (AttribClass.CurLegLife * 100 div AttribClass.MaxLife);
if per > 50 then AllowAttackTick := LifeData.AttackSpeed
else AllowAttackTick := LifeData.AttackSpeed + LifeData.AttackSpeed * (50 - per) div 50; // 100% 沥档 词霸 锭妨柳促.
if HitedTick + AllowAttackTick > CurTick then exit;
HitedTick := CurTick;
if HaveMagicClass.DecEventMagic (HaveMagicClass.pCurAttackMagic) = FALSE then begin
SendClass.SendChatMessage ('傍拜窍瘤 给沁嚼聪促', SAY_COLOR_SYSTEM);
exit;
end;
per := (AttribClass.CurArmLife * 100 div AttribClass.MaxLife);
if per > 50 then begin
SubData.HitData.damageBody := LifeData.damageBody;
SubData.HitData.damageHead := LifeData.damageHead;
SubData.HitData.damageArm := LifeData.damageArm;
SubData.HitData.damageLeg := LifeData.damageLeg;
end else begin
SubData.HitData.damageBody := LifeData.damageBody - LifeData.damageBody * (50 - per) div 50;
SubData.HitData.damageHead := LifeData.damageHead - LifeData.damageHead * (50 - per) div 50;
SubData.HitData.damageArm := LifeData.damageArm - LifeData.damageArm * (50 - per) div 50;
SubData.HitData.damageLeg := LifeData.damageLeg - LifeData.damageLeg * (50 - per) div 50;
end;
// SubData.HitData.ToHit := 100 - tempData.avoid;
SubData.HitData.ToHit := 75;
SubData.HitData.HitType := 0;
SubData.HitData.HitLevel := 0;
SubData.HitData.boHited := FALSE;
SubData.HitData.HitFunction := 0;
SubData.HitData.HitFunctionSkill := 0;
SubData.HitData.HitedCount := 0;
if HaveMagicClass.pCurAttackMagic <> nil then SubData.HitData.HitLevel := HaveMagicClass.pCurAttackMagic^.rcSkillLevel;
if HaveMagicClass.pCurEctMagic <> nil then begin
case HaveMagicClass.pCurEctMagic^.rFunction of
MAGICFUNC_5HIT, MAGICFUNC_8HIT :
begin
SubData.HitData.HitFunction := HaveMagicClass.pCurEctMagic^.rFunction;
SubData.HitData.HitFunctionSkill := HaveMagicClass.pCurEctMagic^.rcSkillLevel;
end;
end;
end;
LastGainExp := 0;
SendLocalMessage (NOTARGETPHONE, FM_HIT, BasicData, SubData);
if (HaveMagicClass.pCurEctMagic <> nil) and (SubData.HitData.HitedCount > 1) then begin
HaveMagicClass.AddEctExp (10, LastGainExp);
end;
if SubData.HitData.boHited then begin
snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber;
if snd <> 0 then begin
case HaveMagicClass.pCurAttackMagic^.rcSkillLevel of
0..4999: snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber;
5000..8999: snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber+2;
else snd := HaveMagicClass.pCurAttackMagic^.rSoundStrike.rWavNumber+4;
end;
SetWordString (SubData.SayString, InttoStr(snd) + '.wav');
SendLocalMessage (NOTARGETPHONE, FM_SOUND, BasicData, SubData);
end;
end else begin
snd := HaveMagicClass.pCurAttackMagic^.rSoundSwing.rWavNumber;
if snd <> 0 then begin
case HaveMagicClass.pCurAttackMagic^.rcSkillLevel of
0..4999: snd := HaveMagicClass.pCurAttackMagic^.rSoundSwing.rWavNumber;
5000..8999: snd := HaveMagicClass.pCurAttackMagic^.rSoundSwing.rWavNumber+2;
else snd := HaveMagicClass.pCurAttackMagic^.rSoundSwing.rWavNumber+4;
end;
SetWordString (SubData.SayString, InttoStr(snd) + '.wav');
SendLocalMessage (NOTARGETPHONE, FM_SOUND, BasicData, SubData);
end;
end;
// 鼻过阑 荤侩窍绰 荤恩篮 荐访摹啊 臭酒瘤搁(50) 30锅捞唱 31锅 葛拣栏肺 傍拜茄促.
SubData.motion := BasicData.Feature.rhitmotion;
// 父距 荤侩磊啊 荤侩窍绰 公傍捞 八过捞唱 档过老版快俊绰
// 荐访摹啊 50.00焊促 臭酒瘤搁 subdata.motion 篮 32锅捞芭唱 37锅栏肺 焊咯霖促.
case HaveMagicClass.pCurAttackMagic.rMagicType of
MAGICTYPE_WRESTLING :
begin
if (HaveMagicClass.pCurAttackMagic^.rcSkillLevel > 5000) then
SubData.motion := 30+Random (2);
end;
MAGICTYPE_FENCING :
begin
nskill := HaveMagicClass.pCurAttackMagic^.rcSkillLevel;
if (nskill > 5000) then begin
if Random (2) = 1 then SubData.motion := 38;
end
end;
MAGICTYPE_SWORDSHIP :
begin
nskill := HaveMagicClass.pCurAttackMagic^.rcSkillLevel;
if (nskill > 5000) then begin
if Random (2) = 1 then SubData.motion := 37;
end
end;
end;
SendLocalMessage ( NOTARGETPHONE, FM_MOTION, BasicData, SubData);
if boSend then SendClass.SendMotion (BasicData.id, SubData.motion);
Result := TRUE;
end;
procedure TUserObject.CommandTurn (adir: word; boSend: Boolean);
var SubData : TSubData;
begin
if not AllowCommand (mmAnsTick) then exit;
if BasicData.Feature.rFeatureState = wfs_die then exit;
BasicData.dir := adir;
SendLocalMessage (NOTARGETPHONE, FM_TURN, BasicData, SubData);
if boSend then SendClass.SendTurn (BasicData);
end;
procedure TUserObject.CommandChangeCharState (aFeatureState: TFeatureState; boSend: Boolean);
var
snd : integer;
SubData : TSubData;
begin
Case aFeatureState of
wfs_die : LifeObjectState := los_die;
Else LifeObjectState := los_none;
end;
if aFeatureState = wfs_die then begin
if Manager.boPosDie = false then begin
Maper.MapProc (BasicData.Id, MM_HIDE, BasicData.x, BasicData.y, BasicData.x, BasicData.y, BasicData);
end;
SetTargetId (0);
DiedTick := mmAnsTick;
case AttribClass.AttribData.cAge of
0..5999 : snd := 2003;
6000..11900 : snd := 2005;
else snd := 2001;
end;
if not BasicData.Feature.rboman then snd := snd + 200;
SetWordString (SubData.SayString, IntToStr (snd) + '.wav');
SendLocalMessage (NOTARGETPHONE, FM_SOUND, BasicData, SubData);
end;
if aFeatureState = wfs_running then begin
if HaveMagicClass.pCurRunningMagic <> nil then begin
if HaveMagicClass.pCurRunningMagic^.rcSkillLevel > 8500 then aFeatureState := wfs_running2;
end;
end;
WearItemClass.SetFeatureState (aFeatureState);
BasicData.Feature := WearItemClass.GetFeature;
BasicData.Feature.rTeamColor := 0;
case aFeatureState of
wfs_running,
wfs_running2:
begin
if HaveMagicClass.pCurRunningMagic <> nil then begin
if HaveMagicClass.pCurRunningMagic^.rcSkillLevel > 5000 then
BasicData.Feature.rTeamColor := 4;
end;
end;
wfs_sitdown:
begin
if HaveMagicClass.pCurBreathngMagic <> nil then
BasicData.Feature.rTeamColor := HaveMagicClass.pCurBreathngMagic^.rcSkillLevel div 1000; //aaa
end;
end;
SendLocalMessage (NOTARGETPHONE, FM_CHANGEFEATURE, BasicData, SubData);
AttribClass.FeatureState := BasicData.Feature.rfeaturestate;
end;
function TUserObject.FieldProc (hfu: Longint; Msg: word; var SenderInfo: TBasicData; var aSubData: TSubData): Integer;
var
str : string;
ret, percent : integer;
// xx, yy: word;
begin
Result := PROC_FALSE;
if isRangeMessage ( hfu, Msg, SenderInfo) = FALSE then exit;
Result := inherited FieldProc (hfu, Msg, Senderinfo, aSubData);
if Result = PROC_TRUE then exit;
case Msg of
FM_CLICK :
begin
if hfu = BasicData.id then begin
str := '';
str := str + '捞抚: ' + Name + #13;
if GuildName <> '' then str := str + '巩颇捞抚: ' +GuildName + ' ' + '巩颇流困: ' + GuildGrade + #13;
str := str + '荤侩公傍: ' + HaveMagicClass.GetUsedMagicList;
SetWordString (aSubData.SayString, str);
end;
end;
FM_DEADHIT :
begin
if SenderInfo.id = BasicData.id then exit;
if BasicData.Feature.rfeaturestate = wfs_die then begin Result := PROC_TRUE; exit; end;
if aSubData.TargetId <> 0 then begin Result := PROC_TRUE; exit; end;
AttribClass.CurLife := 0;
CommandChangeCharState (wfs_die, FALSE);
end;
FM_HIT :
begin
if BasicData.Feature.rfeaturestate = wfs_die then begin Result := PROC_TRUE; exit; end;
if isHitedArea (SenderInfo.dir, SenderInfo.x, SenderInfo.y, aSubData.HitData.HitFunction, percent) then begin
if (TUser (Self).SysopScope = 101) or (BasicData.Feature.rHideState = hs_0) then begin
end else begin
ret := CommandHited (SenderInfo.id, aSubData.HitData, percent);
if (ret <> 0) and (AttribClass.CurLife = 0) then CommandChangeCharState (wfs_die, FALSE);
if ret <> 0 then begin
aSubData.HitData.boHited := TRUE;
aSubData.HitData.HitedCount := aSubData.HitData.HitedCount +1;
end;
end;
end;
{
xx := SenderInfo.x; yy := SenderInfo.y;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -