bool CSkillManager::SkillDeathStab(int aIndex,int bIndex,CSkill* lpSkill,bool combo) // OK
{
LPOBJ lpObj = &gObj[aIndex];
if(OBJECT_RANGE(bIndex) == 0)
{
return 0;
}
LPOBJ lpTarget = &gObj[bIndex];
if(this->CheckSkillRange(lpSkill->m_index,lpObj->X,lpObj->Y,lpTarget->X,lpTarget->Y) == 0)
{
return 0;
}
this->GCSkillAttackSend(lpObj,lpSkill->m_index,bIndex,1);
gAttack.Attack(lpObj,lpTarget,lpSkill,0,0,0,0,combo);
if(combo != 0)
{
this->GCSkillAttackSend(lpObj,SKILL_COMBO,bIndex,1);
}
int physiSpeed = lpObj->PhysiSpeed;
int currentDelay = 120;
if(lpObj->m_OfflineMode == 0)
{
int chance2 = (physiSpeed / 3);
if(chance2 > 100) chance2 = 100;
if((rand() % 100) < chance2)
{
gObjAddAttackProcMsgSendDelay(lpObj, 52, bIndex, currentDelay, lpSkill->m_index, 2);
if(combo != 0)
{
gObjAddAttackProcMsgSendDelay(lpObj, SKILL_COMBO, bIndex, currentDelay + 50, 0, 0);
}
currentDelay += 60;
int chance3 = (physiSpeed / 6);
if(chance3 > 100) chance3 = 100; //
if((rand() % 100) < chance3)
{
gObjAddAttackProcMsgSendDelay(lpObj, 52, bIndex, currentDelay, lpSkill->m_index, 3);
if(combo != 0)
{
gObjAddAttackProcMsgSendDelay(lpObj, SKILL_COMBO, bIndex, currentDelay + 50, 0, 0);
}
currentDelay += 60;
int chance4 = (physiSpeed / 9);
if(chance4 > 100) chance4 = 100;
if((rand() % 100) < chance4)
{
gObjAddAttackProcMsgSendDelay(lpObj, 52, bIndex, currentDelay, lpSkill->m_index, 4);
if(combo != 0)
{
gObjAddAttackProcMsgSendDelay(lpObj, SKILL_COMBO, bIndex, currentDelay + 50, 0, 0);
}
currentDelay += 60;
int chance5 = (physiSpeed / 12);
if(chance5 > 100) chance5 = 100;
if((rand() % 100) < chance5)
{
gObjAddAttackProcMsgSendDelay(lpObj, 52, bIndex, currentDelay, lpSkill->m_index, 4);
if(combo != 0)
{
gObjAddAttackProcMsgSendDelay(lpObj, SKILL_COMBO, bIndex, currentDelay + 50, 0, 0);
}
.........................................................