Jump to content

Question

Posted (edited)

I have code, tips that why not working?

 

i click tiara and nothing...

 

 

Trailer.java

package l2ro.gameserver.model.instances;

import l2ro.gameserver.model.Player;
import l2ro.gameserver.templates.npc.NpcTemplate;

public final class CustomTrainer extends NpcInstance
{
	private static final long serialVersionUID = 5938813598479742068L;
	
	public CustomTrainer(int objectId, NpcTemplate template)
	{
		super(objectId, template);
	}
	
	@Override
	public void onBypassFeedback(Player player, String command)
	{
		if (!canBypassCheck(player, this))
		{
			return;
		}
		if (command.equalsIgnoreCase("learn"))
		{
			player.sendMessage("Your gender has been changed !!");
		}
		else
		{
			super.onBypassFeedback(player, command);
		}
	}
	
	@Override
	public boolean isNpc()
	{
		return true;
	}
	
}

NPC xml

<npc id="53000" template_id="37006" name="Skill Trainer" title="Skill Trainer">
		<set name="aggroRange" value="0" />
		<set name="ai_type" value="CharacterAI" />
		<set name="baseAtkRange" value="40" />
		<set name="baseCON" value="43" />
		<set name="baseCritRate" value="40" />
		<set name="baseDEX" value="30" />
		<set name="baseHpMax" value="2444.468" />
		<set name="baseHpRate" value="1" />
		<set name="baseHpReg" value="7.5" />
		<set name="baseINT" value="21" />
		<set name="baseMAtk" value="780" />
		<set name="baseMAtkSpd" value="500" />
		<set name="baseMDef" value="382" />
		<set name="baseMEN" value="20" />
		<set name="baseMpMax" value="1345.8" />
		<set name="baseMpReg" value="2.7" />
		<set name="basePAtk" value="1303" />
		<set name="basePAtkSpd" value="253" />
		<set name="basePDef" value="471" />
		<set name="baseRunSpd" value="120" />
		<set name="baseSTR" value="40" />
		<set name="baseShldDef" value="0" />
		<set name="baseShldRate" value="0" />
		<set name="baseWIT" value="20" />
		<set name="baseWalkSpd" value="80" />
		<set name="collision_height" value="60.00" />
		<set name="collision_radius" value="20.0" />
		<set name="level" value="70" />
		<set name="rewardExp" value="0" />
		<set name="rewardRp" value="0" />
		<set name="rewardSp" value="0" />
		<set name="shots" value="NONE" />
		<set name="texture" value="" />
		<set name="type" value="CustomTrainer" />
		<!-- <set name="type" value="Npc" /> -->
		<attributes>
			<defence attribute="fire" value="150" />
			<defence attribute="water" value="150" />
			<defence attribute="wind" value="150" />
			<defence attribute="earth" value="150" />
			<defence attribute="holy" value="150" />
			<defence attribute="unholy" value="150" />
		</attributes>
	</npc>

53000.htm

<html noscrollbar>
<body>
<title>Open Beta Store</title>
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="l2ui_ct1.Windows_DF_TooltipBG">
	<tr>
		<td align=center>
			<br>
			<table cellpadding=0 cellspacing=0>
				<tr>
					<td align=center width=290 height=12>
						<font color="AAAAAA">Hello %nick%</font>
						<br>
					</td> 
				</tr>
				<tr>
					<td align=center>
						<font color="AAAAAA">This is a free shop for just for Beta Test.</font>
					</td> 
				</tr>
				<tr>
					<td align=center>
					<br>
						<img src="L2UI.SquareGray" width=290 height=1>
					</td> 
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td align=center>
			<table cellspacing=0 cellpadding=0>
				<tr>
					<td align=center>
						<table cellspacing=0 cellpadding=0 border=0 width=128 height=128 valign=top background="L2UI_CH3.Icon.refinegrade2_00">
							<tr>
								<td height=33></td><td></td>
							</tr>
							<tr>
								<td width=3></td>
								<td width=32 height=32 align=center >
									<table border=0 cellspacing=0 cellpadding=0 width=32 height=32 background="icon.accessory_noblesse_tiara_i00">
										<tr>
											<td width=32 height=32 align=center valign=top>
												<button action="bypass -h CustomTrainer learn" width=34 height=34 back="L2UI_CT1.ItemWindow_DF_Frame_Down" fore="L2UI_CT1.ItemWindow_DF_Frame"/>
											</td>
										</tr>
									</table>
									<font name=CREDITTEXTNORMAL>Addd RandomSkill</font>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</center>
</body>
</html>
Edited by Heroic9614

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Bypass seems wrong, such style normally is used for quests / scripts. Instance npc use bypass -h %getObjectId%_learn or so, typing from memory :P

 

And you miss showChatWindow / getHtmlPatch? Check other instances, the structure.

Edited by SweeTs
  • 0
Posted (edited)

Instance - https://pastebin.com/2mqfFCPA put your htm into custom folder. The inNpc() method is not necessary, I guess.

 

Bypass - checked L2Ro htm and seems like the npc bypass looks like, but it's not as a button

[npc_%objectId%_learn|Press me]

Button

<button value="Press me" action="bypass npc_%objectId%_learn" width=34 height=34 back="L2UI_CT1.ItemWindow_DF_Frame_Down" fore="L2UI_CT1.ItemWindow_DF_Frame">
Edited by SweeTs
  • 0
Posted (edited)

http://imgur.com/a/VqSwG

 

 

this is problem... :/

[21.07.17 14:11:43:018]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:43:550]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:43:730]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:43:895]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:44:081]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:44:248]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:44:433]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
[21.07.17 14:11:44:574]  WARN model.Player: Direct access to bypass: npc_268436770_learn / Player: Test
Edited by Heroic9614

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