Sosyal açıldı! Bir göz at → Hemen gir →

ÇÖZÜLDÜ selamün aleyküm itemler cok cabuk yanıyor bunları nasıl düzeltebiliriz

dogandeniz12

KY Saygın Üye
KAYIT
19 Tem 2023
Mesajlar
976
Çözümler
47
Tepki puanı
321
Versiyon
2369
Çözüm
Eeee bize yok mu çözümü :(
@CMDK hocamın dediklerini yerine getirince çözümü gerçekleşti Ellerine sağlık Tekrardan Teşekkür ediyorum <3

void CUser::ItemWoreOut(int type, int damage)
{
static uint8 weaponsTypes[] = { RIGHTHAND, LEFTHAND };
static uint8 armourTypes[] = { HEAD, BREAST, LEG, GLOVE, FOOT };
static uint8 repairTypes[] = { RIGHTHAND, LEFTHAND, HEAD, BREAST, LEG, GLOVE, FOOT };
int8 totalSlots = -1;
int worerate;

if (type == ACID_ALL
|| type == UTC_ATTACK
|| type == UTC_DEFENCE)
worerate = damage;
else
worerate = myrand(2, 5);

if (worerate == 0) return;

if (type != ATTACK
&&...

LupaLanD

Developer
S.Moderatör
Coder
Yardımsever
KAYIT
30 Ağu 2022
Mesajlar
417
Çözümler
67
Tepki puanı
906

Lazoqlu

LazAHS Mobil & Local DB Editör
S.Moderatör
KY Saygın Üye
Kurumsal Üye
Coder
Yardımsever
KAYIT
22 Ocak 2022
Mesajlar
1,550
Çözümler
40
Tepki puanı
1,003
Konum
İstanbul
Web
lazahs.com.tr

dogandeniz12

KY Saygın Üye
KAYIT
19 Tem 2023
Mesajlar
976
Çözümler
47
Tepki puanı
321
Eeee bize yok mu çözümü :(
@CMDK hocamın dediklerini yerine getirince çözümü gerçekleşti Ellerine sağlık Tekrardan Teşekkür ediyorum <3

void CUser::ItemWoreOut(int type, int damage)
{
static uint8 weaponsTypes[] = { RIGHTHAND, LEFTHAND };
static uint8 armourTypes[] = { HEAD, BREAST, LEG, GLOVE, FOOT };
static uint8 repairTypes[] = { RIGHTHAND, LEFTHAND, HEAD, BREAST, LEG, GLOVE, FOOT };
int8 totalSlots = -1;
int worerate;

if (type == ACID_ALL
|| type == UTC_ATTACK
|| type == UTC_DEFENCE)
worerate = damage;
else
worerate = myrand(2, 5);

if (worerate == 0) return;

if (type != ATTACK
&& type != DEFENCE
&& type != REPAIR_ALL
&& type != ACID_ALL
&& type != UTC_ATTACK
&& type != UTC_DEFENCE)
return;

if (type == ATTACK)
totalSlots = sizeof(weaponsTypes) / sizeof(*weaponsTypes);
else if (type == DEFENCE)
totalSlots = sizeof(armourTypes) / sizeof(*armourTypes);
else if (type == REPAIR_ALL)
totalSlots = sizeof(repairTypes) / sizeof(*repairTypes);
else if (type == ACID_ALL)
totalSlots = sizeof(armourTypes) / sizeof(*armourTypes);
else if (type == UTC_ATTACK)
totalSlots = sizeof(weaponsTypes) / sizeof(*weaponsTypes);
else if (type == UTC_DEFENCE)
totalSlots = sizeof(armourTypes) / sizeof(*armourTypes);

if (totalSlots == -1)
return;

for (uint8 i = 0; i < totalSlots; i++)
{
uint8 slot;
if (type == ATTACK)
slot = weaponsTypes;
else if (type == DEFENCE)
slot = armourTypes;
else if (type == REPAIR_ALL)
slot = repairTypes;
else if (type == UTC_ATTACK)
slot = weaponsTypes;
else if (type == UTC_DEFENCE)
slot = armourTypes;
else
slot = armourTypes;

_ITEM_DATA* pItem = GetItem(slot);
if (!pItem || pItem->nNum == 0)
continue;

_ITEM_TABLE pTable = g_pMain->GetItemPtr(pItem->nNum);
if (pTable.isnull())
continue;

// Is a non-broken item equipped?
if (pItem == nullptr
|| (pItem->sDuration <= 0 && type != REPAIR_ALL)
// Does the item exist?
// If it's in the left or righthand slot, is it a shield? (this doesn't apply to weapons)
|| ((type == ATTACK
|| type == UTC_ATTACK)
&& ((slot == LEFTHAND
|| slot == RIGHTHAND)
&& pTable.m_bSlot == ItemSlot1HLeftHand)))
continue;

if (type == REPAIR_ALL)
{
pItem->sDuration = pTable.m_sDuration;
SendDurability(slot, pItem->sDuration);
UserLookChange(slot, pItem->nNum, pItem->sDuration);
SetUserAbility(true);
continue;
}

int beforepercent = (int)((pItem->sDuration / (double)pTable.m_sDuration) * 100);
int curpercent;

if (worerate > pItem->sDuration)
pItem->sDuration = 0;
else
pItem->sDuration -= worerate;

if (m_sItemArray[slot].sDuration <= 0)
m_sItemArray[slot].sDuration = 0;

if (m_sItemArray[slot].sDuration == 0)
{
SendDurability(slot, 0);
SetUserAbility(false);
SendItemMove(1, 1);
continue;
}

SendDurability(slot, pItem->sDuration);

curpercent = (int)((pItem->sDuration / (double)pTable.m_sDuration) * 100);

if ((curpercent / 5) != (beforepercent / 5))
{
if (curpercent >= 65 && curpercent < 70
|| curpercent >= 25 && curpercent < 30)
UserLookChange(slot, pItem->nNum, pItem->sDuration);
}
}
}
 
Çözüm
Anasayfa Kayıt ol Giriş yap
Üst Alt