- Joined
- Aug 19, 2008
- Messages
- 611
- Reaction score
- 145
Това е Source Code на PK Clear Guard
Part of Protocol Core hook:
Credits:
UnicorN
eRRoR
Code:
void PKClearGuard(int aIndex)
{
if (!PKClear_Active) return;
if (!gObjIsConnected(aIndex)) return;
lpObj->Init(aIndex);
int Price = PKClear_Price * (lpObj->PKLevel - 3);
if (lpObj->PKLevel < 4)
{
Send->PM(aIndex, "[PK Clear] You are already a commoner!");
return;
}
if (lpObj->Money < Price)
{
Send->PM(aIndex, "[PK Clear] You don't have enough money! Lacking %d.", Price - lpObj->Money);
return;
}
int Amount = lpObj->Money - Price;
lpObj->SetInt(0xB4, Amount);
GCMoneySend(aIndex, Amount);
lpObj->SetInt(0x101, 3);
GCPKLevelSend(aIndex, 3);
Send->PM(aIndex, "[PK Clear] You are a commoner again! %d Zen left.", Amount);
GCFireWorkSend(aIndex, lpObj->PosX, lpObj->PosY, 1);
Log(Black, "[PK Clear] [%s][%s] Used PK Clear Guard.", lpObj->Login, lpObj->Nick);
}
Part of Protocol Core hook:
Code:
switch (mobObj->Class)
{
case 249:
PKClearGuard(aIndex);
break;
UnicorN
eRRoR