Jump to content
  • 0

[Request]Some things


Napster321

Question

I have some requests for freya if someone can help then thanks

(core modifications)

 

1)When player put the armor-weap-jewel into scroll a message with the rate will appears

2)pvp increase item

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

1)RequestEnchant.java Find the method which enchant the weapon and add a sendMessage

2)Make a new itemhandler and find the method which increate the pvp's(look at admin handlers i remember they add it on freya on the panel).

Link to comment
Share on other sites

  • 0

 

 

Kяaσh told you what to do, i will just explain.

 

Anyway, for the 1 go in RequestEnchant.java file ( located in clientpackets package ). There you can handle the actions happen when a players accepts to enchant an item. So you want a message to be sented to the player , then you add something like

player.sendMessage("Rate:70%");

 

For the 2 you will go at package itemhandlers and you will create a new .java file. See how other itemhandlers work (ex: potions) and you will just change the method

useItem(L2PlayableInstance playable, L2ItemInstance item) there you will add the code.

increasePvpKills() is the method you need to increase player's pvp.

Link to comment
Share on other sites

  • 0

if (!scrollTemplate.isValid(item) || !isEnchantable(item))
{
                                                                                                                     activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DOES_NOT_FIT_SCROLL_CONDITIONS));
   activeChar.setActiveEnchantItem(null);
   activeChar.sendPacket(new ExPutEnchantTargetItemResult(0));
   return;
}
else
{
    int itemType = item.getItem().getType2();
               
     if(scrollTemplate.isBlessed())
       {
            switch(itemType)
             {
                  case L2Item.TYPE2_WEAPON:
                  activeChar.sendMessage("Success rate: " + Config.BLESSED_ENCHANT_CHANCE_WEAPON + "%");
                  break;
                  case L2Item.TYPE2_SHIELD_ARMOR:
                  activeChar.sendMessage("Success rate: " + Config.BLESSED_ENCHANT_CHANCE_ARMOR + "%");
                  break;
                  case L2Item.TYPE2_ACCESSORY:
                  activeChar.sendMessage("Success rate: " + Config.BLESSED_ENCHANT_CHANCE_JEWELRY + "%");
                  break;
               }
         }
         else
         {
             switch(itemType)
              {
                  case L2Item.TYPE2_WEAPON:
                  activeChar.sendMessage("Success rate: " + Config.ENCHANT_CHANCE_WEAPON + "%");
                   break;
                   case L2Item.TYPE2_SHIELD_ARMOR:
                   activeChar.sendMessage("Success rate: " + Config.ENCHANT_CHANCE_ARMOR + "%");
                   break;
                   case L2Item.TYPE2_ACCESSORY:
                   activeChar.sendMessage("Success rate: " + Config.ENCHANT_CHANCE_JEWELRY + "%");
                   break;
               }
           }
}

from http://www.l2jserver.com/forum/viewtopic.php?f=73&t=21328 but i dont know in which lines to enter that...

Link to comment
Share on other sites

  • 0

 

Kяaσh told you what to do, i will just explain.

 

Anyway, for the 1 go in RequestEnchant.java file ( located in clientpackets package ). There you can handle the actions happen when a players accepts to enchant an item. So you want a message to be sented to the player , then you add something like

player.sendMessage("Rate:70%");

 

For the 2 you will go at package itemhandlers and you will create a new .java file. See how other itemhandlers work (ex: potions) and you will just change the method

useItem(L2PlayableInstance playable, L2ItemInstance item) there you will add the code.

increasePvpKills() is the method you need to increase player's pvp.

for the 1st it can be more cool if the msg comes directly from configs so if you change the rate you wont have to re-compile again.

 

do what krash told you.

Link to comment
Share on other sites

  • 0

the prolem is that i dont know in which lines to add the message

for the first one,krash told you,find the method which enchant the weapon and add a msg.

 

I cant actually understand what you cant understand.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...