1. //Arat
  2. case USE_CHANGE_ATTRIBUTE :
  3. //İçinde bul
  4. else if (item->GetVnum() == 76014)
  5. {
  6. int aiChangeProb[ITEM_ATTRIBUTE_MAX_LEVEL] =
  7. {
  8. 0, 10, 50, 39, 1
  9. };
  10. item2->ChangeAttribute(aiChangeProb);
  11. }
  12. //Altına ekle
  13. else if (item->GetVnum() == 71091)
  14. {
  15. if (item2->GetType() != ITEM_WEAPON)
  16. {
  17. ChatPacket(CHAT_TYPE_INFO, "Sadece silahlara efsun ekleyebilirsin.");
  18. return false;
  19. }
  20. if (item2->GetAttributeType(0) != 72)
  21. {
  22. ChatPacket(CHAT_TYPE_INFO, "Sadece ortalama zararı efsunu olan silahlara efsun ekleyebilirsin.");
  23. return false;
  24. }
  25. item2->ChangeAttribute();
  26. while (item2->GetAttributeType(0) != 72)
  27. item2->ChangeAttribute();
  28. int iNormalHitBonus = number(45,60);
  29. item2->SetForceAttribute(0, 72, iNormalHitBonus);
  30. int iSkillBonus = 0;
  31. if (iNormalHitBonus >= 45 && iNormalHitBonus <= 50)
  32. iSkillBonus = number(-15,-20);
  33. else
  34. iSkillBonus = iNormalHitBonus / -2 - 0.5f - number(-2,0);
  35. if (item2->GetAttributeType(1) == 71)
  36. item2->SetForceAttribute(1, 71, iSkillBonus);
  37. item->SetCount(item->GetCount() - 1);
  38. }
  39. else if (item->GetVnum() == 71092)
  40. {
  41. if (item2->GetType() != ITEM_WEAPON)
  42. {
  43. ChatPacket(CHAT_TYPE_INFO, "Sadece silahlara efsun ekleyebilirsin.");
  44. return false;
  45. }
  46. if (item2->GetAttributeType(0) != 71 && item2->GetAttributeType(1) != 71)
  47. {
  48. ChatPacket(CHAT_TYPE_INFO, "Sadece beceri hasar efsunu olan silahlara efsun ekleyebilirsin.");
  49. return false;
  50. }
  51. item2->ChangeAttribute();
  52. while (item2->GetAttributeType(0) != 71 && item2->GetAttributeType(1) != 71)
  53. item2->ChangeAttribute();
  54. int iSkillBonus = number(18,28);
  55. for (int x = 0; x < ITEM_ATTRIBUTE_MAX_NUM; x++)
  56. {
  57. if (item2->GetAttributeType(x) == 71)
  58. item2->SetForceAttribute(x, 71, iSkillBonus);
  59. }
  60. int iNormalHitBonus = 0;
  61. if (iSkillBonus <= 20)
  62. iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4);
  63. else
  64. iNormalHitBonus = -2 * iSkillBonus + number(1, 5);
  65. if (item2->GetAttributeType(0) == 72)
  66. item2->SetForceAttribute(0, 72, iNormalHitBonus);
  67. item->SetCount(item->GetCount() - 1);
  68. }