📄 magic.pas
字号:
end;
procedure sub_4934B4(PlayObject:TPlayObject);
begin
if PlayObject.m_UseItems[U_ARMRINGL].Dura < 100 then begin
PlayObject.m_UseItems[U_ARMRINGL].Dura:=0;
PlayObject.SendMsg(PlayObject,RM_DURACHANGE,U_ARMRINGL,PlayObject.m_UseItems[U_ARMRINGL].Dura,PlayObject.m_UseItems[U_ARMRINGL].DuraMax,0,'');
{ //Nicky no Breaking
PlayObject.SendDelItems(@PlayObject.m_UseItems[U_ARMRINGL]);
PlayObject.m_UseItems[U_ARMRINGL].wIndex:=0;
}
end;
end;
begin //0049350C
Result:=False;
if PlayObject.m_boTDBeffect then exit; //tdb stops you from using spells
if IsWarrSkill(UserMagic.wMagIdx) then exit;
if (abs(PlayObject.m_nCurrX - nTargetX) > g_Config.nMagicAttackRage) or (abs(PlayObject.m_nCurrY - nTargetY) > g_Config.nMagicAttackRage) then begin
exit;
end;
PlayObject.SendRefMsg(RM_SPELL,UserMagic.MagicInfo.btEffect,nTargetX,nTargetY,UserMagic.MagicInfo.wMagicId,'');
boTrain:=False;
boSpellFail:=False;
boSpellFire:=True;
nPower:=0;
if (PlayObject.m_nSoftVersionDateEx = 0) and (PlayObject.m_dwClientTick = 0) and (UserMagic.MagicInfo.wMagicId > 40) then exit;
if UserMagic.MagicInfo.wMimicID = SKILL_RESURRECTION then begin {Reincarnation - Taoist}
boSpellFail:=True;
if (TargeTBaseObject.m_btRaceServer = RC_PLAYOBJECT) and TargeTBaseObject.m_boDeath then begin
if CheckAmulet(PlayObject,1,3,nAmuletIdx) then begin
//1 you hit button
//2 aura effect plays under feet / 10 seconds delay (other ppl can see aura)
//3 use spell is sent from client to server
//4 server calculates if it worked or not
//5 server aks the player if they want to revive
//6 if they click yes they are spawned with hp/mp based on level of reincartnation
UseAmulet(PlayObject,1,3,nAmuletIdx); //amulets are 5/5
TargeTBaseObject.ReAlive;
TargeTBaseObject.m_WAbil.HP:=TargeTBaseObject.m_WAbil.MaxHP;
TargeTBaseObject.SendMsg(TargeTBaseObject,RM_ABILITY,0,0,0,0,'');
boTrain:=True;
boSpellFail:=False;
end;
end;
end;
if (TargeTBaseObject <> nil) and (TargeTBaseObject.m_boDeath) then TargeTBaseObject:=nil;
case UserMagic.MagicInfo.wMimicID of
SKILL_FIREBALL{1},
SKILL_FIREBALL2{5}: begin
if PlayObject.MagCanHitTarget(PlayObject.m_nCurrX, PlayObject.m_nCurrY, TargeTBaseObject) then begin
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if (TargeTBaseObject.m_nAntiMagic <= Random(50)) and (abs(TargeTBaseObject.m_nCurrX-nTargetX) <= 1) and (abs(TargeTBaseObject.m_nCurrY-nTargetY) <= 1) then begin
with PlayObject do begin
nPower:= GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(m_WAbil.MC),
SmallInt(HiWord(m_WAbil.MC)-LoWord(m_WAbil.MC)) + 1);
end;
PlayObject.SendDelayMsg (PlayObject, RM_DELAYMAGIC, nPower, MakeLong(nTargetX, nTargetY), 2, integer(TargeTBaseObject), '', 600);
if (TargeTBaseObject.m_btRaceServer >= RC_ANIMAL) then boTrain:=True;
end else
TargeTBaseObject := nil;
end else
TargeTBaseObject := nil;
end else
TargeTBaseObject := nil;
end;
SKILL_HEALLING{2}: begin
if TargeTBaseObject = nil then begin
TargeTBaseObject:=PlayObject;
nTargetX:=PlayObject.m_nCurrX;
nTargetY:=PlayObject.m_nCurrY;
end;
if PlayObject.IsProperFriend(TargeTBaseObject) then begin
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.SC) * 2,
SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC)) * 2 + 1);
if TargeTBaseObject.m_WAbil.HP < TargeTBaseObject.m_WAbil.MaxHP then begin
TargeTBaseObject.SendDelayMsg(PlayObject,RM_MAGHEALING,0,nPower,0,0,'',800);
boTrain:=True;
end;
if PlayObject.m_boAbilSeeHealGauge then
PlayObject.SendMsg(TargeTBaseObject,RM_10414,0,0,0,0,'');
end;
end;
SKILL_AMYOUNSUL{6}: begin {Poison - Taoist}
boSpellFail:=True;
if PlayObject.IsProperTarget(TargeTBaseObject) then begin
if CheckAmulet(PlayObject,1,2,nAmuletIdx) then begin
StdItem:=UserEngine.GetStdItem(PlayObject.m_UseItems[nAmuletIdx].wIndex);
if StdItem <> nil then begin
UseAmulet(PlayObject,1,2,nAmuletIdx);
if Random(TargeTBaseObject.m_btAntiPoison + 7) <= 6 then begin
case StdItem.Shape of
1: begin
nPower:=GetPower13(40) + GetRPow(PlayObject.m_WAbil.SC) * 2;
TargeTBaseObject.SendDelayMsg(PlayObject,RM_POISON,POISON_DECHEALTH,nPower + PlayObject.m_nPoisonIncrease,Integer(PlayObject),ROUND(UserMagic.btLevel / 3 * (nPower / g_Config.nAmyOunsulPoint)){UserMagic.btLevel},'',1000);
end;
2: begin
nPower:=GetPower13(30) + GetRPow(PlayObject.m_WAbil.SC) * 2;
TargeTBaseObject.SendDelayMsg(PlayObject,RM_POISON,POISON_DAMAGEARMOR,nPower + PlayObject.m_nPoisonIncrease,Integer(PlayObject),ROUND(UserMagic.btLevel / 3 * (nPower / g_Config.nAmyOunsulPoint)){UserMagic.btLevel},'',1000);
end;
end;
if (TargeTBaseObject.m_btRaceServer = RC_PLAYOBJECT) or (TargeTBaseObject.m_btRaceServer >= RC_ANIMAL) then
boTrain:=True;
end;
PlayObject.SetTargetCreat(TargeTBaseObject);
boSpellFail:=False;
end;
end;
end;
end;
SKILL_FIREWIND{8}: begin
if MagPushArround(PlayObject,UserMagic.btLevel) > 0 then boTrain:=True;
end;
SKILL_FIRE{9}: begin
n1C:=GetNextDirection(PlayObject.m_nCurrX,PlayObject.m_nCurrY,nTargetX,nTargetY);
if PlayObject.m_PEnvir.GetNextPosition(PlayObject.m_nCurrX,PlayObject.m_nCurrY,n1C,1,n14,n18) then begin
PlayObject.m_PEnvir.GetNextPosition(PlayObject.m_nCurrX,PlayObject.m_nCurrY,n1C,5,nTargetX,nTargetY);
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),
SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1);
if PlayObject.MagPassThroughMagic(n14,n18,nTargetX,nTargetY,n1C,nPower,False) > 0 then
boTrain:=True;
end;
end;
SKILL_SHOOTLIGHTEN{10}: begin
n1C:=GetNextDirection(PlayObject.m_nCurrX,PlayObject.m_nCurrY,nTargetX,nTargetY);
if PlayObject.m_PEnvir.GetNextPosition(PlayObject.m_nCurrX,PlayObject.m_nCurrY,n1C,1,n14,n18) then begin
PlayObject.m_PEnvir.GetNextPosition(PlayObject.m_nCurrX,PlayObject.m_nCurrY,n1C,8,nTargetX,nTargetY);
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),
SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1);
if PlayObject.MagPassThroughMagic(n14,n18,nTargetX,nTargetY,n1C,nPower,True) > 0 then
boTrain:=True;
end;
end;
SKILL_LIGHTENING{11}: begin
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if (Random(50) >= TargeTBaseObject.m_nAntiMagic) then begin
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),
SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1);
if TargeTBaseObject.m_btLifeAttrib = LA_UNDEAD then
nPower:=ROUND(nPower * 1.5);
PlayObject.SendDelayMsg(PlayObject,RM_DELAYMAGIC,nPower,MakeLong(nTargetX,nTargetY),2,Integer(TargeTBaseObject),'',600);
if TargeTBaseObject.m_btRaceServer >= RC_ANIMAL then
boTrain:=True;
end else TargeTBaseObject:=nil
end else TargeTBaseObject:=nil;
end;
SKILL_FIRECHARM{13},
SKILL_HANGMAJINBUB{14},
SKILL_DEJIWONHO{15},
SKILL_HOLYSHIELD{16},
SKILL_SKELLETON{17},
SKILL_CLOAK{18},
SKILL_BIGCLOAK{19},
SKILL_CURSE{46}: begin
boSpellFail:=True;
if CheckAmulet(PlayObject,1,1,nAmuletIdx) then begin
UseAmulet(PlayObject,1,1,nAmuletIdx);
case UserMagic.MagicInfo.wMagicId of
SKILL_FIRECHARM{13}: begin
if PlayObject.MagCanHitTarget(PlayObject.m_nCurrX,PlayObject.m_nCurrY,TargeTBaseObject) then begin
if PlayObject.IsProperTarget(TargeTBaseObject) then begin
if Random(50) >= TargeTBaseObject.m_nAntiMagic then begin
if (abs(TargeTBaseObject.m_nCurrX - nTargetX) <= 1) and (abs(TargeTBaseObject.m_nCurrY - nTargetY) <= 1) then begin
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.SC),
SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC))+ 1);
PlayObject.SendDelayMsg(PlayObject,RM_DELAYMAGIC,nPower,MakeLong(nTargetX,nTargetY),2,Integer(TargeTBaseObject),'',1200);
if TargeTBaseObject.m_btRaceServer >= RC_ANIMAL then
boTrain:=True;
end;
end;
end;
end else TargeTBaseObject:=nil;
end;
SKILL_HANGMAJINBUB{14}: begin
nPower:= PlayObject.GetAttackPower(GetPower13(60) + LoWord(PlayObject.m_WAbil.SC) * 10,SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC))+ 1);
if PlayObject.MagMakeDefenceArea(nTargetX,nTargetY,3,nPower,1) > 0 then
boTrain:=True;
end;
SKILL_DEJIWONHO{15}: begin
nPower:= PlayObject.GetAttackPower(GetPower13(60) + LoWord(PlayObject.m_WAbil.SC) * 10,SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC))+ 1);
if PlayObject.MagMakeDefenceArea(nTargetX,nTargetY,3,nPower,0) > 0 then
boTrain:=True;
end;
SKILL_HOLYSHIELD{16}: begin
if MagMakeHolyCurtain(PlayObject,GetPower13(40) + GetRPow(PlayObject.m_WAbil.SC) * 3,nTargetX,nTargetY) > 0 then
boTrain:=True;
end;
SKILL_SKELLETON{17}: begin
if MagMakeSlave(PlayObject,UserMagic) then begin
boTrain:=True;
end;
end;
SKILL_CLOAK{18}: begin
if MagMakePrivateTransparent(PlayObject,GetPower13(30) + GetRPow(PlayObject.m_WAbil.SC) * 3) then
boTrain:=True;
end;
SKILL_BIGCLOAK{19}: begin
if MagMakeGroupTransparent(PlayObject,nTargetX,nTargetY,GetPower13(30) + GetRPow(PlayObject.m_WAbil.SC) * 3) then
boTrain:=True;
end;
SKILL_CURSE{46}: begin
if Random(10) <= UserMagic.btLevel then begin
nPower:= ROUND((PlayObject.GetAttackPower(GetPower13(60) + LoWord(PlayObject.m_WAbil.SC) * 10,SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC))+ 1)) div 20);
if nPower > 0 then begin //simple negitive check.
if PlayObject.MagMakeCurseArea(nTargetX,nTargetY,3,nPower, ((UserMagic.btLevel + 1) * 3)) > 0 then begin
boTrain:=True;
end;
end;
end;
end;
end;
boSpellFail:=False;
end;
end;
SKILL_TAMMING{20}: begin
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if MagTamming(PlayObject,TargeTBaseObject,nTargetX,nTargetY,UserMagic.btLevel) then
boTrain:=True;
end;
end;
SKILL_SPACEMOVE{21}: begin
PlayObject.SendRefMsg(RM_MAGICFIRE,0,MakeWord(UserMagic.MagicInfo.btEffectType,UserMagic.MagicInfo.btEffect),MakeLong(nTargetX,nTargetY),Integer(TargeTBaseObject),'');
boSpellFire:=False;
if MagSaceMove(PlayObject,UserMagic.btLevel) then
boTrain:=True;
end;
SKILL_EARTHFIRE{22}: begin
if MagMakeFireCross(PlayObject,
PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),
SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1),
GetPower(10) + (Word(GetRPow(PlayObject.m_WAbil.MC)) shr 1),
nTargetX,
nTargetY) > 0 then
boTrain:=True;
end;
SKILL_FIREBOOM{23}: begin
if MagBigExplosion(PlayObject,
PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1),
nTargetX,
nTargetY,
g_Config.nFireBoomRage{1}) then
boTrain:=True;
end;
SKILL_LIGHTFLOWER{24}: begin
if MagElecBlizzard(PlayObject,PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1)) then
boTrain:=True;
end;
SKILL_SHOWHP{28}: begin
if (TargeTBaseObject <> nil) and not TargeTBaseObject.m_boShowHP then begin
if Random(6) <= (UserMagic.btLevel + 3) then begin
TargeTBaseObject.m_dwShowHPTick:=GetTickCount();
TargeTBaseObject.m_dwShowHPInterval:=GetPower13(GetRPow(PlayObject.m_WAbil.SC) * 2 + 30) * 1000;
TargeTBaseObject.SendDelayMsg(TargeTBaseObject,RM_DOOPENHEALTH,0,0,0,0,'',1500);
boTrain:=True;
end;
end;
end;
SKILL_BIGHEALLING{29}: begin
nPower:= PlayObject.GetAttackPower (GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.SC) * 2,
SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC)) * 2 + 1);
if MagBigHealing(PlayObject,nPower,nTargetX,nTargetY) then boTrain:=True;
end;
SKILL_SINSU{30}: begin
boSpellFail:=True;
if CheckAmulet(PlayObject,5,1,nAmuletIdx) then begin
UseAmulet(PlayObject,5,1,nAmuletIdx);
if MagMakeSinSuSlave(PlayObject,UserMagic) then begin
boTrain:=True;
end;
boSpellFail:=False;
end;
end;
SKILL_SHIELD{31}: begin
if PlayObject.MagBubbleDefenceUp(UserMagic.btLevel,GetPower(GetRPow(PlayObject.m_WAbil.MC) + 15)) then
boTrain:=True;
end;
SKILL_KILLUNDEAD{32}:begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -