Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

SoulDestruction lil bug

Elite Diviner
Joined
Sep 17, 2013
Messages
433
Reaction score
120
Hello , I've written a little source for SD to be AOE and its works well but there is a problem.
When A cjb attack a mob also it can hit the nearly chars even if there is no mask up.
In the war I can hit my guild mates when i use SD on the enemy .
Here is the source maybe someone correct it for me? if you got my point of the problem.

ahh ye , Special thaks to @Darn @Bloodx for helping me with my questions.

Here is the sources.
void __fastcall SoulDestruction(void *pSkill, void *pPlayer, int pPacket, int pPos){ ISkill ISkill(pSkill); int nSkillGrade = ISkill.GetGrade(); if (!nSkillGrade) return; IChar IPlayer(pPlayer); int nTargetID = 0; char bType = 0; void *pTarget = 0; CPacket::Read((char*)pPacket, (char*)pPos, "bd", &bType, &nTargetID); int nMana = ISkill.DecreaseMana(); if (bType == 0 && nTargetID) pTarget = CPlayer::FindPlayer(nTargetID); if (bType == 1 && nTargetID) pTarget = CMonster::FindMonster(nTargetID); if (bType >= 2) return; IChar ITarget(pTarget); if (pTarget && ITarget.IsValid() && IPlayer.IsValid() && nTargetID != IPlayer.GetID()) { if (IPlayer.GetCurMp() < nMana) return; if (!IPlayer.IsInRange(ITarget,300)) return; IPlayer.SetDirection(ITarget); (*(void (__thiscall **)(int, int))(*(DWORD*)ITarget.GetOffset() + 80))((int)ITarget.GetOffset(), (int)IPlayer.GetOffset()); int GetWisdom = CChar::GetWis((int)IPlayer.GetOffset()); int nDmg = ((GetWisdom * ISkill.GetGrade() + CTools::Rate(MSDMin,MSDMax)) * IPlayer.GetMagic() / 500) * MSDMul; if (ITarget.GetType() == 0) nDmg = (nDmg * MSDReduce) / 100; IPlayer.OktayDamageSingle(ITarget,nDmg,40); IPlayer.DecreaseMana(nMana); }}
 
Last edited:
Skilled Illusionist
Joined
Mar 20, 2009
Messages
374
Reaction score
378
Code:
static BOOL(__thiscall *CanAttack)(int Player, int Target, int Value) = (BOOL(__thiscall*)(int, int, int))0x0046AE50;
if (CanAttack(pOwner, pOther, 0)) 
{ 
	//Only damage if can attack.
}
 
Upvote 0
Back
Top