Instantly share code, notes, and snippets.
Created
May 5, 2022 12:01
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save MrKirill1232/99795a8f09bbee056c1b69f6c0e4badd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: dist/game/data/scripts/custom/NoblessMaster/1003000.htm | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/1003000.htm b/dist/game/data/scripts/custom/NoblessMaster/1003000.htm | |
--- a/dist/game/data/scripts/custom/NoblessMaster/1003000.htm | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/1003000.htm (date 1651752031097) | |
@@ -1,15 +1,10 @@ | |
<html><body> | |
Noblesse Master:<br> | |
-<br> | |
-If you are at least level 80,<br> | |
-I can promote you to Noblesse.<br> | |
-<br> | |
-<br> | |
-<br> | |
-<br> | |
-<br> | |
-<center> | |
-<a action="bypass -h Quest NoblessMaster noblesse">Noblesse me!</a><br> | |
-<br> | |
-</center> | |
+Hello adventurer,<br1> | |
+ I was sent by the gods to help adventurers to become noble.<br> | |
+ In order to become noble you need first to be<br1> | |
+ level 76,on your first subclass<br1> | |
+ and own in your inventory <font color="LEVEL">Caradine Letter</font>.<br> | |
+ <br> | |
+ <a action="bypass -h Quest NoblessMaster noblesse">I am ready, make me noble.</a> | |
</body></html> | |
\ No newline at end of file | |
Index: dist/game/data/scripts/custom/NoblessMaster/1003000-1.htm | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/1003000-1.htm b/dist/game/data/scripts/custom/NoblessMaster/1003000-1.htm | |
--- a/dist/game/data/scripts/custom/NoblessMaster/1003000-1.htm | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/1003000-1.htm (date 1651752035537) | |
@@ -1,5 +1,8 @@ | |
<html><body> | |
Noblesse Master:<br> | |
-Congratulations!<br1> | |
-You are now a Noblesse.<br> | |
+Congratulations anventurer!<br1> | |
+ You are now a Noble man/woman.<br1> | |
+ You can benefit from Noblesse Blessing and<br1> | |
+ dont forget to visit the gatekeepers,<br1> | |
+ now they can teleport you to more places. | |
</body></html> | |
\ No newline at end of file | |
Index: dist/game/data/scripts/custom/NoblessMaster/1003000-2.htm | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/1003000-2.htm b/dist/game/data/scripts/custom/NoblessMaster/1003000-2.htm | |
--- a/dist/game/data/scripts/custom/NoblessMaster/1003000-2.htm | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/1003000-2.htm (date 1651752039397) | |
@@ -1,4 +1,4 @@ | |
<html><body> | |
Noblesse Master:<br> | |
-You must be at least level 80! | |
+You must be at least level 76 and own Caradine Letter to become noblesse! | |
</body></html> | |
\ No newline at end of file | |
Index: dist/game/data/scripts/custom/NoblessMaster/1003000-3.htm | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/1003000-3.htm b/dist/game/data/scripts/custom/NoblessMaster/1003000-3.htm | |
--- a/dist/game/data/scripts/custom/NoblessMaster/1003000-3.htm | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/1003000-3.htm (date 1651752043544) | |
@@ -1,4 +1,4 @@ | |
<html><body> | |
Noblesse Master:<br> | |
-You already are a noble. | |
+Aventurer, stop annoying me, you are already a noble. | |
</body></html> | |
\ No newline at end of file | |
Index: dist/game/data/scripts/custom/NoblessMaster/1003000-4.htm | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/1003000-4.htm b/dist/game/data/scripts/custom/NoblessMaster/1003000-4.htm | |
new file mode 100644 | |
--- /dev/null (date 1651752068250) | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/1003000-4.htm (date 1651752068250) | |
@@ -0,0 +1,4 @@ | |
+<html><body> | |
+Noblesse Master:<br> | |
+You need to be on your subclass first in order to become noble. | |
+</body></html> | |
\ No newline at end of file | |
Index: dist/game/data/scripts/custom/NoblessMaster/NoblessMaster.java | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/data/scripts/custom/NoblessMaster/NoblessMaster.java b/dist/game/data/scripts/custom/NoblessMaster/NoblessMaster.java | |
--- a/dist/game/data/scripts/custom/NoblessMaster/NoblessMaster.java | |
+++ b/dist/game/data/scripts/custom/NoblessMaster/NoblessMaster.java (date 1651752024074) | |
@@ -1,16 +1,16 @@ | |
/* | |
* This file is part of the L2J Mobius project. | |
- * | |
+ * | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
- * | |
+ * | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
* General Public License for more details. | |
- * | |
+ * | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
@@ -30,14 +30,15 @@ | |
{ | |
// Item | |
private static final int NOBLESS_TIARA = 7694; | |
- | |
+ private static final int CARADINE_LETTER = 7678; | |
+ | |
private NoblessMaster() | |
{ | |
addStartNpc(Config.NOBLESS_MASTER_NPCID); | |
addTalkId(Config.NOBLESS_MASTER_NPCID); | |
addFirstTalkId(Config.NOBLESS_MASTER_NPCID); | |
} | |
- | |
+ | |
@Override | |
public String onAdvEvent(String event, Npc npc, Player player) | |
{ | |
@@ -45,38 +46,52 @@ | |
{ | |
return null; | |
} | |
- | |
+ | |
switch (event) | |
{ | |
case "noblesse": | |
{ | |
+ // A retail-like approach player can't become noblesse, if is not on his subclass. | |
+ if (!player.isSubClassActive()) | |
+ { | |
+ return "1003000-4.htm"; | |
+ } | |
+ } | |
+ { | |
if (player.isNoble()) | |
{ | |
return "1003000-3.htm"; | |
} | |
- if (player.getLevel() >= Config.NOBLESS_MASTER_LEVEL_REQUIREMENT) | |
+ if (player.getLevel() > Config.NOBLESS_MASTER_LEVEL_REQUIREMENT) | |
{ | |
- if (Config.NOBLESS_MASTER_REWARD_TIARA) | |
- { | |
- giveItems(player, NOBLESS_TIARA, 1); | |
- } | |
- player.setNoble(true); | |
- player.sendPacket(QuestSound.ITEMSOUND_QUEST_FINISH.getPacket()); | |
- return "1003000-1.htm"; | |
+ if (getQuestItemsCount(player, CARADINE_LETTER) > 1) | |
+ { | |
+ { | |
+ | |
+ if (Config.NOBLESS_MASTER_REWARD_TIARA) | |
+ { | |
+ takeItems(player, CARADINE_LETTER, 1); | |
+ giveItems(player, NOBLESS_TIARA, 1); | |
+ } | |
+ } | |
+ player.setNoble(true); | |
+ player.sendPacket(QuestSound.ITEMSOUND_QUEST_FINISH.getPacket()); | |
+ return "1003000-1.htm"; | |
+ } | |
} | |
return "1003000-2.htm"; | |
} | |
} | |
- | |
+ | |
return null; | |
} | |
- | |
+ | |
@Override | |
public String onFirstTalk(Npc npc, Player player) | |
{ | |
return "1003000.htm"; | |
} | |
- | |
+ | |
public static void main(String[] args) | |
{ | |
new NoblessMaster(); | |
Index: dist/game/config/Custom/NoblessMaster.ini | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/dist/game/config/Custom/NoblessMaster.ini b/dist/game/config/Custom/NoblessMaster.ini | |
--- a/dist/game/config/Custom/NoblessMaster.ini | |
+++ b/dist/game/config/Custom/NoblessMaster.ini (date 1651751233196) | |
@@ -1,6 +1,10 @@ | |
-# --------------------------------------------------------------------------- | |
+--------------------------------------------------------------------------- | |
# Nobless Master (instant nobless NPC) | |
-# --------------------------------------------------------------------------- | |
+# | |
+# Player needs Caradine Letter Item id 7693 to become noble. | |
+# If item id needs replacement check in | |
+# /data/scripts/custom/NoblessMaster/NoblessMaster.java | |
+--------------------------------------------------------------------------- | |
# Enable Nobless Master NPC. | |
# Default: False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment