Jump to content
  • 0

Need help with custom script.


Question

Posted

Hi.

I'm trying to create a custom server, and had one idea... But not enough skills to make it work.

 

I need a script:

1. You get a weapon from NPC.

2. You hit another NPC with that weapon equipped.

3. You get an item reward for every hit you make.

 

I've tried to cut parts off from "Fates Whisper" quest, since that is the only quest  I know that checks equipped weapon, but messed up badly.  :-[

If anyone could write me this script, I would be really happy.

 

P.S.

If it is possible, and not to hard to do, some advanced features would be awesome. Like level limitation, not a 100% reward on every hit, maybe a potion or a buff skill that increases chance of getting reward...

4 answers to this question

Recommended Posts

  • 0
Posted

1. Just create custom npc which will give weapon for something, there are a lot of custom gm shops so just change it a little bit.

for rest just look at fall harvest event

  • 0
Posted

using fall of harvest would make NPC kill able with 1 hit. And I want it to withstand about 50-100 hits, and give a reward item for every hit.

The reason for this is that I will reduce attack speed drastically on the weapon used for that, and NPC's will be usually used by mass of players.

  • 0
Posted

You can create new AI data for your NPC (extends L2AttackableAIScript)

 

I don't remember if this gona work exactly as you wanted but try to use this:

 

        private int timesAttacked;

 

@Override

public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)

        {

              if (npc.getNpcId() == YourNpcId)

{

                      timesAttacked++;

                }

        }

 

 

To receive this (count of hits)

 

2. You hit another NPC with that weapon equipped.

3. You get an item reward for every hit you make.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..