Çözüldü Pvm Efsun Kısıtlama istiyorum.

  • Konuyu açan Konuyu açan onur2898
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 6
  • Gösterim Gösterim 49
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

onur2898

Üye
Üye
Mesaj
21
Beğeni
3
Puan
430
Ticaret Puanı
0
Herkese iyi forumlar. iyi günler.

1728463773241.webp


Bu sistemi kullanıyorum ve bu sistemi 5 e böldüm 5 item ekledim 1. itemde 1ila 10 arasında 2. itemde 10 ila 20 arasında gibi.
ama 2 itemi direk kullanabiliyorum bunun yerine sadece 10 pvm efsun gelmiş iteme 2. item atılsın istiyorum.

bide atıyorum 1 itemde sınırlandırma getiremiyorum 10 a durmasını istiyorum 10 pvm efsun gelince geçmemesi için ne yapmam gerekiyor

şimdiden yardımlarınız için teşekkürler.
 
Çözüm
item.h da bi eklentisi yok göremedim hocam.
char_item.cpp:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)...
Herkese iyi forumlar. iyi günler.

19324 eklentisini görüntüle

Bu sistemi kullanıyorum ve bu sistemi 5 e böldüm 5 item ekledim 1. itemde 1ila 10 arasında 2. itemde 10 ila 20 arasında gibi.
ama 2 itemi direk kullanabiliyorum bunun yerine sadece 10 pvm efsun gelmiş iteme 2. item atılsın istiyorum.

bide atıyorum 1 itemde sınırlandırma getiremiyorum 10 a durmasını istiyorum 10 pvm efsun gelince geçmemesi için ne yapmam gerekiyor

şimdiden yardımlarınız için teşekkürler.
Kodları buradan veya özelden gonderirsen yardımcı olabilirim item.h ve char_item.cpp ve nesne kodları yeterli olacaktır
 
Kodları buradan veya özelden gonderirsen yardımcı olabilirim item.h ve char_item.cpp ve nesne kodları yeterli olacaktır
item.h da bi eklentisi yok göremedim hocam.
char_item.cpp:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (9, 10);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (6, 8);
                            }
                            else
                            {
                                sValue = number (1, 5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (19, 20);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (15, 18);
                            }
                            else
                            {
                                sValue = number (11, 14);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (28, 30);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (25, 28);
                            }
                            else
                            {
                                sValue = number (21, 25);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (38, 40);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (35, 38);
                            }
                            else
                            {
                                sValue = number (31, 35);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif
 
item.h da bi eklentisi yok göremedim hocam.
char_item.cpp:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (9, 10);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (6, 8);
                            }
                            else
                            {
                                sValue = number (1, 5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (19, 20);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (15, 18);
                            }
                            else
                            {
                                sValue = number (11, 14);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (28, 30);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (25, 28);
                            }
                            else
                            {
                                sValue = number (21, 25);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            short sValue = 10;

                            BYTE p = number (1, 100);
                            if (p >= 98)
                            {
                                sValue = number (38, 40);
                            }
                            else if (p >= 90 && p < 98)
                            {
                                sValue = number (35, 38);
                            }
                            else
                            {
                                sValue = number (31, 35);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif
Kod:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) >= 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 10 bonus getirebilirsin !");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (1, 10);

                            sValue = p;
                            
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) >= 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 20 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 10 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (10, 20);

                            sValue = p;
                            
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 30 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 20 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (20, 30);

                            sValue = p;
                            
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 40)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 40 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 30 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (30, 40);

                            sValue = p;
                            
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif

Mevcut bonustan daha dusuk bir bonus gelirse bonus koruması sağladım bonus degismeyecek. istersen iptal edebilirsin
 
Çözüm
Kod:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                          
                            if (item2->GetAttributeValue(5) >= 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 10 bonus getirebilirsin !");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (1, 10);

                            sValue = p;
                          
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                      
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                          
                            if (item2->GetAttributeValue(5) >= 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 20 bonus getirebilirsin !");
                                return false;
                            }
                          
                            if (item2->GetAttributeValue(5) < 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 10 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (10, 20);

                            sValue = p;
                          
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                      
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 30 bonus getirebilirsin !");
                                return false;
                            }
                          
                            if (item2->GetAttributeValue(5) < 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 20 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (20, 30);

                            sValue = p;
                          
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                      
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 40)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 40 bonus getirebilirsin !");
                                return false;
                            }
                          
                            if (item2->GetAttributeValue(5) < 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 30 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (30, 40);

                            sValue = p;
                          
                            if (item2->GetAttributeValue(5) > sValue)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Gelen Efsun %d esyandan daha dusuk oldugu icin degistirilmedi !");
                                sValue = item2->GetAttributeValue(5);
                            }

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif

Mevcut bonustan daha dusuk bir bonus gelirse bonus koruması sağladım bonus degismeyecek. istersen iptal edebilirsin
Çok teşekkür ederim yardımlarının için Süper oldu sadece ilk paylaştığımdaki zorluk derecesini eklerseniz ve mevcut bonusdan düşük geldiğinde değişmesin eklenmiş onu kaldırabilirmisiniz rica etsem teşekkürler tekrardan.
 
Çok teşekkür ederim yardımlarının için Süper oldu sadece ilk paylaştığımdaki zorluk derecesini eklerseniz ve mevcut bonusdan düşük geldiğinde değişmesin eklenmiş onu kaldırabilirmisiniz rica etsem teşekkürler tekrardan.
Kod:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) >= 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 10 bonus getirebilirsin !");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (1, 10);

                            sValue = p;
                            


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) >= 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 20 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 10 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (10, 20);

                            sValue = p;
                            



                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 30 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 20 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (20, 30);

                            sValue = p;
                            


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 40)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 40 bonus getirebilirsin !");
                                return false;
                            }
                            
                            if (item2->GetAttributeValue(5) < 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 30 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (30, 40);

                            sValue = p;
                            

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif
 
Kod:
Genişlet Daralt Kopyala
                        #ifdef NEW_PVM_ATTRIBUTE
                        case 78210 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                           
                            if (item2->GetAttributeValue(5) >= 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 10 bonus getirebilirsin !");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (1, 10);

                            sValue = p;
                           


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78211 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }
                           
                            if (item2->GetAttributeValue(5) >= 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 20 bonus getirebilirsin !");
                                return false;
                            }
                           
                            if (item2->GetAttributeValue(5) < 10)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 10 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (10, 20);

                            sValue = p;
                           



                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78212 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 30 bonus getirebilirsin !");
                                return false;
                            }
                           
                            if (item2->GetAttributeValue(5) < 20)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 20 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (20, 30);

                            sValue = p;
                           


                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                       
                        case 78213 : // ???
                        {
                            LPITEM item2;

                            BYTE bApply = APPLY_PVM_NORM_HIT_BONUS;

                            if (!IsValidItemPosition (DestCell) || ! (item2 = GetInventoryItem (wDestCell)))
                            {
                                return false;
                            }

                            if (item2->IsExchanging() == true)
                            {
                                return false;
                            }

                            if (item2->GetAttributeSetIndex() == -1)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("??? ??? ? ?? ??????."));
                                return false;
                            }


                            if (item2->GetAttributeCount() < 5)
                            {
                                ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("en_az_5_efsun"));
                                return false;
                            }

                            if (item2->GetAttributeValue(5) >= 40)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Bu nesneyle en fazla 40 bonus getirebilirsin !");
                                return false;
                            }
                           
                            if (item2->GetAttributeValue(5) < 30)
                            {
                                ChatPacket(CHAT_TYPE_INFO, "Esyandaki bonus 30 olmadan bu esyayi kullanamazsin!");
                                return false;
                            }

                            short sValue = 0;

                            BYTE p = number (30, 40);

                            sValue = p;
                           

                            if (item2->GetType() == ITEM_WEAPON || item2->GetType() == ITEM_ARMOR)
                            {
                                if (item2->GetAttributeType (5) == bApply)
                                {
                                    item2->RemoveAttributeAt (5);
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                                else
                                {
                                    item2->SetForceAttribute (5, bApply, sValue);
                                }
                            }

                            item->SetCount (item->GetCount() - 1);
                        }
                        break;
                        #endif
Teşekkürler oldu hocam.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Üst