Index: src/map/utils/battleutils.cpp =================================================================== --- src/map/utils/battleutils.cpp (revision 3801) +++ src/map/utils/battleutils.cpp (working copy) @@ -2435,6 +2435,47 @@ doubleAttack = dsp_cap(doubleAttack,0,100); tripleAttack = dsp_cap(tripleAttack,0,100); + if (PEntity->objtype == TYPE_PC) + { + CCharEntity* PChar = (CCharEntity*)PEntity; + CItemWeapon* PAmmo = (CItemWeapon*)PChar->getStorage(LOC_INVENTORY)->GetItem(PChar->equip[SLOT_AMMO]); + switch (PWeapon->getID()) + { + // Virtue Stone Weapons + + case 18360: // Faith Baghnakhs, h2h + case 17710: // Justice Sword, sword + case 18222: // Fortitude Axe, great axe + case 18282: // Hope Staff, staff + case 17948: // Temperance Axe, axe + case 18100: // Love Halberd, polearm + case 18379: // Prudence Rod, club + case 17595: // Hope Staff, staff + if(PAmmo->getID() == 18244) + { + if (rand()%100 > 50) + { + // ShowDebug(CL_CYAN"Virtue Weapon Proc \n"); + num +=1; + if ( (PAmmo->getQuantity()-1) < 1) // ammo will run out after this attack, make sure we remove it from equip + { + uint8 slot = PChar->equip[SLOT_AMMO]; + charutils::UnequipItem(PChar,SLOT_AMMO); + charutils::UpdateItem(PChar, LOC_INVENTORY, slot, -1); + } + else + { + charutils::UpdateItem(PChar, LOC_INVENTORY, PChar->equip[SLOT_AMMO], -1); + } + PChar->pushPacket(new CInventoryFinishPacket()); + } + } + break; + + default: + break; + } + } if (rand()%100 < tripleAttack) { num +=2;