Jump to content

zanjetopakin

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by zanjetopakin

  1. I am aware of EquipScript and UnEquipScript. However, since the equip will be general (like wearing a mink coat or chainmail), it will trigger the script as long as it has the same refine level. Using EquipScript and UnEquipScript, I need to include them in all items in item_db.yml. I've read about OnPutOnEquip and OnPutOffEquip, special labels created by cydh, but after trying them, they seem outdated and no longer functional. So far, my only solution is to trigger the script every 10 or 30 seconds to check the condition. However, I'm concerned that this might impact server performance, as it will constantly check all players and could potentially cause lag.
  2. Hello, is there a trigger for 'OnEquip' or 'UnEquip' in scripting? I'm creating a script that will be triggered when an item is equipped. The script should check if the weapon, armor, shoes, and garment have the same refine level. If the condition is met, a bonus will be applied. Can you suggest any possible methods for this scenario? the code above is sample (AI Generated, just to show the algorithm)" - script CheckRefineLevel -1,{ OnEquip: // Variables to store refine levels set .@refine_weapon, getequiprefinerycnt(EQI_HAND_R); // Main hand weapon set .@refine_armor, getequiprefinerycnt(EQI_ARMOR); // Armor set .@refine_shoes, getequiprefinerycnt(EQI_SHOES); // Shoes set .@refine_garment, getequiprefinerycnt(EQI_GARMENT); // Garment // Check if all items have the same refine level and meet the desired level (e.g. +10) if (.@refine_weapon == 10 && .@refine_armor == 10 && .@refine_shoes == 10 && .@refine_garment == 10) { // Apply bonus if all conditions are met bonus bAtkRate,10; // Increase attack by 10% bonus bMaxHP,5; // Increase MaxHP by 5% dispbottom "All your equipment is refined to +10! Bonus applied."; } else { // Remove bonus if not all equipment are at +10 bonus bAtkRate,0; // Remove attack bonus bonus bMaxHP,0; // Remove MaxHP bonus dispbottom "Not all your equipment is refined to +10. No bonus applied."; } OnUnequip: // Remove bonus when equipment is unequipped bonus bAtkRate,0; // Remove attack bonus bonus bMaxHP,0; // Remove MaxHP bonus dispbottom "Equipment unequipped, bonus removed."; end; }
×
×
  • Create New...