Jump to content

Question

Posted

Hello, i need l2jfrozen script, for life stones
I wanna just with 2nd click on lifestone opened window what weapon augment wihout gemstones.

will be great if it's works like enchant just click and augmenting -> next augment on weapon will delete previous augment.

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

Add a handler on Lifestone like Potion (check ex. Mana potions). 

And then create a new ItemHandler with name LifeStone.java

and inside you must write the proper code. Do the checks

1. If player's weapon (Base on PaperItemDoll - RHAND) is null

L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);

if (item == null)
{

}

2. If player's weapon is augmented or can be augment

if (item.isAugmented() || item.isHeroItem() || item.getItem().getCrystalType() == 0 || item.getItem().getCrystalType() == 1 || item.getItem().getCrystalType() == 2)
{
   return;
}
		

3. Remove the augment stats.

4. Generate new augment stats and apply them. 

L2Augmentation augmentation = new L2Augmentation(attributes, idaugment, levelaugment);
augmentation.applyBonus(player);
item.setAugmentation(augmentation);
L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(item.getItem().getBodyPart());
InventoryUpdate iu = new InventoryUpdate();
for (L2ItemInstance itm : unequipped)
{
iu.addModifiedItem(itm);
}
player.sendPacket(iu);

5. Destroy the lifestone (Item that pressed)

player.getInventory().destroyItemById("Destroy", item.getItemId(), 1, player, true);

Also don't forget to run this

SQL REPLACE INTO item_attributes VALUES(?,?,?,?)

so it can be saved in Database also. 

Edited by Evie Frye

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...