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.

 

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...