Changed Link bypass to work on with specific links.

This commit is contained in:
MobiusDevelopment
2019-04-10 15:50:11 +00:00
parent 451e71c14c
commit 167b4557d7
34 changed files with 569 additions and 48 deletions

View File

@@ -6,5 +6,5 @@ Just tell me what you need.<br>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/augmentation_01.htm">"I want to augment an item."</Button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/augmentation_02.htm">"I want to remove an augmentation."</Button>
<Button ALIGN="LEFT" ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/augmentation_exchange.htm">"I want to exchange Life Stones."</Button>
<Button ALIGN="LEFT" ICON="RETURN" action="link blacksmith_morning001.htm">Back</Button>
<Button ALIGN="LEFT" ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@@ -1,7 +1,7 @@
<html><body>
Grand Master Oltran:<br>
You are far from your village, adventurer. How do you feel, now that you see the great castle and the ever-changing streets that are the pride of the Humans? I'm sure you admire them, but do not be enticed by their allure. Beneath the most beautiful bed of flowers, there is often a serpent's lair. If you spend much time in this city, you may come to see what I mean...<br>
<Button ALIGN=LEFT ICON="NORMAL" action="link guard_class_change2001.htm">"Can you tell me about the 2nd Class Transfer?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest ClassTransferTalk">"Can you tell me about the 2nd Class Transfer?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Clan">Clan</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Alliance">Alliance</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest ShadowWeapons">"I want to use my Shadow Item Coupon."</Button>

View File

@@ -6,5 +6,5 @@ When you switch a weapon, the <font color="LEVEL">enchantment, Soul Crystal, aug
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 3421202">"I want to change an R95-grade weapon."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 3421203">"I want to change an R99-grade weapon."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 3421204">"I want to exchange a Tauti and Kelbim weapon."</button>
<Button ALIGN=LEFT ICON="RETURN" action="link ev_libra_black001.htm">Back</button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest RedLibra 34212-1.htm">Back</button>
</body></html>

View File

@@ -16,6 +16,7 @@
*/
package handlers.bypasshandlers;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IBypassHandler;
import com.l2jmobius.gameserver.model.actor.Creature;
@@ -29,6 +30,51 @@ public class Link implements IBypassHandler
"Link"
};
private static final String[] VALID_BYPASSES =
{
"common/attribute_info.htm",
"common/augmentation_01.htm",
"common/augmentation_02.htm",
"common/augmentation_exchange.htm",
"common/crafting_01.htm",
"common/crafting_02.htm",
"common/crafting_03.htm",
"common/cursed_to_unidentified.htm",
"common/duals_01.htm",
"common/duals_02.htm",
"common/duals_03.htm",
"common/g_cube_warehouse001.htm",
"common/skill_enchant_help.htm",
"common/skill_enchant_help_01.htm",
"common/skill_enchant_help_02.htm",
"common/skill_enchant_help_03.htm",
"common/smelting_trade001.htm",
"common/weapon_sa_01.htm",
"common/welcomeback002.htm",
"common/welcomeback003.htm",
"default/BlessingOfProtection.htm",
"default/SupportMagic.htm",
"default/SupportMagicServitor.htm",
"fisherman/exchange_old_items.htm",
"fisherman/fish_appearance_exchange.htm",
"fisherman/fishing_manual001.htm",
"fisherman/fishing_manual002.htm",
"fisherman/fishing_manual003.htm",
"fisherman/fishing_manual004.htm",
"fisherman/fishing_manual008.htm",
"fisherman/fishing_manual009.htm",
"fisherman/fishing_manual010.htm",
"fortress/foreman.htm",
"guard/kamaloka_help.htm",
"guard/kamaloka_level.htm",
"petmanager/evolve.htm",
"petmanager/exchange.htm",
"petmanager/instructions.htm",
"teleporter/separatedsoul.htm",
"warehouse/clanwh.htm",
"warehouse/privatewh.htm",
};
@Override
public boolean useBypass(String command, PlayerInstance player, Creature target)
{
@@ -45,9 +91,12 @@ public class Link implements IBypassHandler
return false;
}
final String content = HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath);
final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null;
final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0);
html.setHtml(content.replace("%objectId%", String.valueOf(target != null ? target.getObjectId() : 0)));
if (content != null)
{
html.setHtml(content.replace("%objectId%", String.valueOf(target != null ? target.getObjectId() : 0)));
}
player.sendPacket(html);
return true;
}