Page 1 of 1
NPC Shop
Posted: Wed Feb 03, 2016 2:23 am
by OrcBubba
Hi guys. I am trying to make an NPC shop just for fun. I am have some trouble though. I have searched for help before posting this because I didn't want to waste anyone's time but could only find the old SQL way of doing it. So here goes... I made my NPC for the shop, that is working. I made a mutisell file for the items. I made a htm file for the shop dialogue and that is working. But when I click on the shop link, nothing happens and the dialogue box goes away. I know I have something not linked correctly but cant figure it out. Here's what I got.
The custom NPC id is 99
The multisell is 99.xml in the game\data\multisell directory
The htm file is in the game\data\html\merchant directory
The only thing I can figure is wrong may be this
<a action="bypass -h npc_%objectid%_multisell 99"><font> Text Here </font></a><br>
Thanks for the help!
Re: NPC Shop
Posted: Wed Feb 03, 2016 11:21 am
by TPK
game\data\scripts.cfg
# Custom
custom/EchoCrystals/EchoCrystals.java
custom/ShadowWeapons/ShadowWeapons.java
custom/NewbieCoupons/NewbieCoupons.java
custom/RaidbossInfo/RaidbossInfo.java
custom/NpcLocationInfo/NpcLocationInfo.java
custom/Validators/SubClassSkills.java
add
custom/your npc shop/__init__.py
or
custom/your npc shop/yournpcshop.java
game\data\stats\npcs\custom\custom.xml
<npc id="99" displayId="what you want" name="what you want" usingServerSideName="true" title="what you want" usingServerSideTitle="true" type="L2Npc">
<collision>
<radius normal="24" />
<height normal="32" />
</collision>
</npc>
Re: NPC Shop
Posted: Wed Feb 03, 2016 4:32 pm
by Avanael92
Shops usually aren't scripted in java, you only need HTML and XML for it.
Zoey already made a guide for creating a NPC here:
https://github.com/L2J/L2J_Server/wiki/Add-a-custom-NPC
Since your html is in merchant folder, it's important that the type should be L2Merchant and also radius/height should be exactly the same from the NPC ID that you take for display/appearance. Should look like this for you:
Code: Select all
<npc id="99" displayId="4307" level="80" type="L2Merchant" name="Evil Santa Claus"
usingServerSideName="true" title="My First Custom NPC" usingServerSideTitle="true">
<sex>MALE</sex>
<collision>
<radius normal="25" />
<height normal="35" />
</collision>
</npc>
Multisells also should be in the custom folder in multisell directory too, just as a note.
Re: NPC Shop
Posted: Thu Mar 03, 2016 11:35 pm
by OrcBubba
I've tried everything I can think of to get it to work but when I click on the NPC's dialogue box to shop, nothing happens. This is the part I think I have wrong. I found it on another site when I was searching for a solution. But could be outdated or something.
<a action="bypass -h npc_%objectid%_multisell 99"><font> Text Here </font></a><br>
I put the mutisell in the custom folder also.
Does this look correct?
Thanks
Re: NPC Shop
Posted: Fri Mar 04, 2016 3:10 pm
by Avanael92
Tried to reproduce your problem, on a closer look I found a typo in your bypass.
<a action="bypass -h npc_%objectId%_multisell 99"><font> Text Here </font></a><br>
The red marked letter should be in uppercase.
Re: NPC Shop
Posted: Sat Mar 05, 2016 12:51 am
by OrcBubba
You are the MAN! Thanks very much. That was the problem.
Re: NPC Shop
Posted: Sat Mar 05, 2016 2:33 am
by Avanael92
You're welcome
