📄 magic.pas
字号:
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
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if MagTurnUndead(PlayObject,TargeTBaseObject,nTargetX,nTargetY,UserMagic.btLevel) then
boTrain:=True;
end;
end;
SKILL_SNOWWIND{33}: 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.nSnowWindRange{1}) then
boTrain:=True;
end;
{###########NEW SPELLS START HERE #############}
{ {34} {Crosshalfmoon}
SKILL_FLAMEDIS{35}: {FlameDisruptor - Wizard}
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if (Random(50) >= TargeTBaseObject.m_nAntiMagic) then begin
nFlamePower:=0;
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
nFlamePower:=ROUND(nPower * 0.15);
nPower:=nPower + nFlamePower;
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;
SKILL_ENHANCER{36}: begin {UltimateEnhancer - Taoist}
boSpellFail:=True;
if TargeTBaseObject = nil then begin
TargeTBaseObject:=PlayObject;
nTargetX:=PlayObject.m_nCurrX;
nTargetY:=PlayObject.m_nCurrY;
end;
if PlayObject.IsProperFriend(TargeTBaseObject) then begin
if CheckAmulet(PlayObject,1,1,nAmuletIdx) then begin
UseAmulet(PlayObject,1,1,nAmuletIdx);
nPower := (UserMagic.btLevel + 1) {* 2} + Random(UserMagic.btLevel);
n14 := PlayObject.GetAttackPower(GetPower13(60) + LoWord(PlayObject.m_WAbil.SC) * 10,SmallInt(HiWord(PlayObject.m_WAbil.SC)-LoWord(PlayObject.m_WAbil.SC))+ 1);
// Only send the animation if it's on somebody else
if PlayObject <> TargeTBaseObject then
TargeTBaseObject.SendRefMsg(RM_10205,0,0,0,15,'');
if TargeTBaseObject.AttPowerUp(nPower, n14) then boTrain:=True;
boSpellFail:=False;
end;
end;
end;
SKILL_ENERGYREPULSOR{37}: begin {EnergyRepulsor - Taoist}
if MagPushArround(PlayObject,UserMagic.btLevel) > 0 then boTrain:=True;
end;
{ {38} {TwinDragonBlade - Warrior}
SKILL_FROST{39}: begin {FrostCrunch - Wizard}
if MagHbFireBall(PlayObject,UserMagic,nTargetX, nTargetY,TargeTBaseObject) then boTrain:=True;
end;
SKILL_PURI{40}: begin {Purification - Taoist}
nPower := ((UserMagic.btLevel shl 4) - UserMagic.btLevel + 45);
if MagMakeGroupUnPoison(PlayObject, nTargetX, nTargetY, nPower) then
boTrain := True;
end;
SKILL_ANGEL{41}: begin {SummonHolyDeva - Taoist}
boSpellFail:=True;
if CheckAmulet(PlayObject,2,1,nAmuletIdx) then begin
UseAmulet(PlayObject,2,1,nAmuletIdx);
if MagMakeAngelSlave(PlayObject,UserMagic) then
boTrain:=True;
boSpellFail:=False;
end;
end;
SKILL_MIRROR{42}: begin {Mirroring - Wizard}
if MagMakeClone(PlayObject,UserMagic) then
boTrain:=True;
end;
SKILL_LION{43}: begin {LionRoar - Warrior}
if MagGroupMb(PlayObject,UserMagic,TargeTBaseObject) then boTrain:=True;
end;
SKILL_BLADEAV{44}: begin {BladeAvalanche - Warrior}
if BladeAvalanche(Playobject,UserMagic,TargeTBaseObject) then boTrain:=True;
end;
SKILL_FLAMEFIELD{45}: begin {FlameField - Wizard}
if MagFireField(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_ENTRAP{47}: begin {Entrapment - Warrior}
If PlayObject.IsProperTarget(TargeTBaseObject) then begin
if (TargeTBaseObject.m_btRaceServer < RC_ANIMAL) then exit;
if TargeTBaseObject.m_wStatusTimeArr[POISON_STONE] <> 0 then exit;
if TargeTBaseObject.m_Abil.Level <= PlayObject.m_abil.Level+8 then begin
n14 := Random(5) - (UserMagic.btLevel + 1);
EntrapDir:=GetNextDirection(TargeTBaseObject.m_nCurrX,TargeTBaseObject.m_nCurrY,PlayObject.m_nCurrX,PlayObject.m_nCurrY);
EntrapDist:=Max(ABS(TargeTBaseObject.m_nCurrX-PlayObject.m_nCurrX),ABS(TargeTBaseObject.m_nCurrY-PlayObject.m_nCurrY))-1;
if n14 <= 0 then begin
TargeTBaseObject.CharPushed(EntrapDir,EntrapDist);
TargeTBaseObject.MakePosion(POISON_STONE,UserMagic.btLevel + 3,0);
end;
if TargetBaseObject.m_btRaceServer = RC_PLAYOBJECT then begin
TargetBaseObject.SetPKFlag(PlayObject);
TargetBaseObject.SetLastHiter(PlayObject);
end;
if TargeTBaseObject.m_btRaceServer >= RC_ANIMAL then boTrain:=True; //silly person it could never get to this line if it wasnt animal or above :p
end;
end;
end;
SKILL_VAMP{48}: begin {Vampirism - Wizard}
if PlayObject.IsProperTarget (TargeTBaseObject) then begin
if (Random(50) >= TargeTBaseObject.m_nAntiMagic) 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;
VampPower := round(npower div 5);
if VampPower < 0 then begin
// Dont want to drain our own HP, so skill failed.
PlayObject.SysMsg('Attack Failed',c_Red,t_Hint);
exit;
end;
PlayObject.SendDelayMsg(PlayObject,RM_DELAYMAGIC,nPower,MakeLong(nTargetX,nTargetY),2,Integer(TargeTBaseObject),'',1000);
if PlayObject.m_WAbil.HP + VampPower > PlayObject.m_WAbil.MaxHP then begin
PlayObject.m_WAbil.HP := PlayObject.m_WAbil.MaxHP;
end else
PlayObject.m_WAbil.HP := PlayObject.m_WAbil.HP + VampPower;
PlayObject.SendDelayMsg(PlayObject,RM_10205,0,PlayObject.m_nCurrX,PlayObject.m_nCurrY,13{type},'',1000);
playobject.RecalcAbilitys();
playobject.SendMsg(playobject,RM_ABILITY,0,0,0,0,'');
if TargeTBaseObject.m_btRaceServer >= RC_ANIMAL then
boTrain:=True;
end else TargeTBaseObject:=nil
end else TargeTBaseObject:=nil;
end;
SKILL_HALLUC{49}: begin {Hallucination - Taoist}
//Hallucination
boSpellFail:=True;
n14 := Random(5) - (UserMagic.btLevel + 1);
if CheckAmulet(PlayObject,1,1,nAmuletIdx) and (TargeTBaseObject <> nil) and (n14 <= 0) then begin
if (TargeTBaseObject.m_btRaceServer <> RC_NPC) and (TargeTBaseObject.m_btRaceServer <> RC_PLAYOBJECT) then begin
UseAmulet(PlayObject,1,1,nAmuletIdx);
If TargeTBaseObject.m_Abil.Level < PlayObject.m_abil.Level 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);
TargeTBaseObject.OpenHallucMode(Random(n14) + nPower - 20);
boTrain:=True;
boSpellFail:=False;
end;
end;
end;
end;
SKILL_RAGE{50}: begin {Rage - Warrior}
boSpellFail:=True;
nPower := Round(HiWord(PlayObject.m_WAbil.DC) * (0.12 + (0.03*UserMagic.btLevel)))-2;
n14 := 18+(6*UserMagic.btLevel);
if PlayObject.AttPowerUp(nPower, n14) then boTrain:=True;
boSpellFail:=False;
end;
SKILL_PROTECTIONFIELD{51}: begin {ProtectionField - Warrior}
boSpellFail:=True;
n14 := 2+(UserMagic.btLevel + 1) + Round(HiWord(PlayObject.m_WAbil.AC));
if PlayObject.DefenceUp(n14) then boTrain:=True;
boSpellFail:=False;
end;
SKILL_ICESHOWER{52}: begin {Blizzard - Wizard}
if MagBigExplosion2(PlayObject,
UserMagic,
PlayObject.GetAttackPower(GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))+ 1),
nTargetX,
nTargetY,
2) then
//g_Config.nIceShowerRange{1}) then
boTrain:=True;
end;
SKILL_FIRESHOWER{53}: begin {MeteorShower - Wizard}
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,
2) then
//g_Config.nFireShowerRange{1}) then
boTrain:=True;
end;
//SKILL_RESURRECTION{54}: begin {Reincarnation - Taoist}
// if MagMakeLivePlayObject(PlayObject, UserMagic, TargeTBaseObject) then boTrain := True;
//end;
SKILL_MASSPOISON{55}: begin {PoisonCloud - Taoist}
if CheckAmulet(PlayObject,4,1,nAmuletIdx) and CheckAmulet(PlayObject,4,2,nAmuletIdx) then begin
if MagBigExplosion3(PlayObject,
UserMagic,
PlayObject.GetAttackPower(GetPower(MPow(UserMagic)) + LoWord(PlayObject.m_WAbil.MC),SmallInt(HiWord(PlayObject.m_WAbil.MC)-LoWord(PlayObject.m_WAbil.MC))- 10),
20,
nTargetX,
nTargetY) then
UseAmulet(PlayObject,4,1,nAmuletIdx);
UseAmulet(PlayObject,4,2,nAmuletIdx);
boTrain:=True;
end else
PlayObject.SysMsg('缺少护身符或毒药.',c_Red,t_Hint);
end;
SKILL_REDBANWOL{56}: begin
if RedBlade(Playobject,UserMagic,TargeTBaseObject) then boTrain:=True;
end;
SKILL_WINDSTAINED{57}: 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_SUNCHEN{58}: begin
// if CheckAmulet(PlayObject,4,1,nAmuletIdx) then begin
// UseAmulet(PlayObject,4,1,nAmuletIdx);
if PlayObject.CelestialDefenceUp(UserMagic.btLevel,GetPower(GetRPow(PlayObject.m_WAbil.SC) + 15)) then
boTrain:=True;
end;
end;
if boSpellFail then exit;
if boSpellFire then begin
PlayObject.SendRefMsg(RM_MAGICFIRE,0,
MakeWord(UserMagic.MagicInfo.btEffectType,UserMagic.MagicInfo.btEffect),
MakeLong(nTargetX,nTargetY),
Integer(TargeTBaseObject),
'');
end;
if (UserMagic.btLevel < 3) and (boTrain) then begin
if UserMagic.MagicInfo.TrainLevel[UserMagic.btLevel] <= PlayObject.m_Abil.Level then begin
PlayObject.TrainSkill(UserMagic,Random(3) + 1);
if not PlayObject.CheckMagicLevelup(UserMagic) then begin
PlayObject.SendDelayMsg(PlayObject,RM_MAGIC_LVEXP,0,UserMagic.MagicInfo.wMagicId,UserMagic.btLevel,UserMagic.nTranPoint,'',1000);
end;
end;
end;
Result:=True;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -