From 48d7b09bdd8522c6872365d2745ef7b9e0b575c6 Mon Sep 17 00:00:00 2001 From: Olivier <75835176+JohnsonMichaels123@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:51:04 -0700 Subject: [PATCH] Easter Event + Ectotokens (#492) * New NPC Spawns for Port Phasmatys Added most NPCs in Port Phasmatys including the ghost villagers, sailors, guards, Robin, Ak-Haranu, and more. * ObjectActions for Ectofuntus and Energy Barrier The Ectofuntus is now fully accessible and Port Phasmatys can be accessed through the energy barrier. * Added Ak-Haranu's Exotic Shop Ak-Haranu now sells Bolt Racks. * Fixed Ectofuntus Worship Fixed minor issue with Ectofuntus Worship * Gravingas Exclamations Gravingas exclaims different messages while protesting Necrovarus in Port Phasmatys. * Easter Event Updates - Added Easter Bunny - Added temporary Easter Quest - Added Dialogues between player and Easter Bunny - Added player save data for Ecto-tokens (Port Phasmatys) and data for the easter event (easterEvent) * Delete .DS_Store * Delete .DS_Store * Delete .DS_Store * Adding DS_Store to .gitignore --- .gitignore | 1 + 2006Scape Server/data/cfg/spawns.json | 60 ++++++++++++ .../rs2/game/dialogues/DialogueHandler.java | 98 ++++++++++++++++++- .../java/com/rs2/game/npcs/NpcActions.java | 21 ++++ .../java/com/rs2/game/players/Player.java | 2 +- .../java/com/rs2/game/players/PlayerSave.java | 10 ++ 6 files changed, 189 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7b71be68..a969d2f1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ **/.idea/* */*.jar *.iml +.DS_Store diff --git a/2006Scape Server/data/cfg/spawns.json b/2006Scape Server/data/cfg/spawns.json index 7faa21f8..959c8b59 100644 --- a/2006Scape Server/data/cfg/spawns.json +++ b/2006Scape Server/data/cfg/spawns.json @@ -24022,5 +24022,65 @@ "id": 1706, "walk": 0, "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2981, + "y": 3286, + "id": 1835, + "walk": 1, + "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2978, + "y": 3282, + "id": 1320, + "walk": 1, + "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2982, + "y": 3282, + "id": 1320, + "walk": 1, + "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2978, + "y": 3277, + "id": 1320, + "walk": 1, + "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2987, + "y": 3280, + "id": 1320, + "walk": 1, + "height": 0 + }, + { + "maxHit": 0, + "strength": 0, + "attack": 0, + "x": 2984, + "y": 3277, + "id": 1320, + "walk": 1, + "height": 0 } ] diff --git a/2006Scape Server/src/main/java/com/rs2/game/dialogues/DialogueHandler.java b/2006Scape Server/src/main/java/com/rs2/game/dialogues/DialogueHandler.java index b7ce5c62..ea1de0d6 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/dialogues/DialogueHandler.java +++ b/2006Scape Server/src/main/java/com/rs2/game/dialogues/DialogueHandler.java @@ -7420,8 +7420,102 @@ public class DialogueHandler { player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Hello there! Nice weather we've been having."); player.getDialogueHandler().endDialogue(); break; - - + //holiday events (easter) + case 6000: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.DISTRESSED, "Oh dear... What am I going to do?"); + player.nextChat = 6001; + break; + case 6001: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "What's wrong?"); + player.nextChat = 6002; + break; + case 6002: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.ALMOST_CRYING, "It's terrible! What a disaster..."); + player.nextChat = 6003; + break; + case 6003: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "Is there any way I can help?"); + player.nextChat = 6004; + break; + case 6004: + player.getDialogueHandler().sendStatement("The Easter Bunny is completely ignoring you."); + player.nextChat = 6005; + break; + case 6005: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.DISTRESSED, "Well maybe if I... No, that wouldn't work."); + player.nextChat = 6006; + break; + case 6006: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.ANNOYED, "Hey! Just tell me what's wrong."); + player.nextChat = 6007; + break; + case 6007: + player.getDialogueHandler().sendNpcChat3("Oh, hi there. You see, I was counting my eggs when", "suddenly,I dropped one! Then as I reached down to get it", "I dropped another one!", player.talkingNpc, "Eater Bunny"); + player.nextChat = 6008; + break; + case 6008: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.NEARLY_CRYING, "At this point I've dropped nearly all my easter eggs!"); + player.nextChat = 6009; + break; + case 6009: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "I'll help you find your eggs."); + player.nextChat = 6010; + break; + case 6010: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "You would do that? Oh, thank you!"); + player.nextChat = 6011; + break; + case 6011: + player.getDialogueHandler().sendNpcChat2("Some of them have fallen in holes and in small areas.","I would suggest you use something to scoop them up.", player.talkingNpc, "Easter Bunny"); + player.nextChat = 6012; + break; + case 6012: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "You mean... Like a spade?"); + player.nextChat = 6013; + break; + case 6013: + player.getDialogueHandler().sendNpcChat2("Yes! That should do the job! Come back when you find", "at least 3 easter eggs.", player.talkingNpc, "Easter Bunny"); + player.easterEvent++; + player.getDialogueHandler().endDialogue(); + break; + case 6014: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Have you found the easter eggs yet?"); + player.nextChat = 6015; + break; + case 6015: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.DEFAULT, "No, not yet."); + player.nextChat = 6016; + break; + case 6016: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Hurry! We need to deliver those eggs!"); + player.getDialogueHandler().endDialogue(); + break; + case 6017: + player.getDialogueHandler().sendPlayerChat(ChatEmotes.HAPPY_JOYFUL, "I have your easter eggs!"); + player.nextChat = 6018; + break; + case 6018: + player.getDialogueHandler().sendStatement("You hand the Easter Bunny the easter eggs."); + player.nextChat = 6019; + break; + case 6019: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Oh, thank you!! Thank you!!"); + player.nextChat = 6020; + break; + case 6020: + player.getDialogueHandler().sendStatement("The Easter Bunny hands you an Easter Ring."); + player.nextChat = 6021; + break; + case 6021: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "You've saved the spirit of easter!"); + player.getInventory().add(7927); + player.easterEvent++; + player.getDialogueHandler().endDialogue(); + break; + case 6022: + player.getDialogueHandler().sendNpcChat(player.talkingNpc, ChatEmotes.HAPPY_JOYFUL, "Thank you again traveller. Happy Easter!"); + player.getDialogueHandler().endDialogue(); + break; } } public void chatboxText(String text, String text1, String text2, diff --git a/2006Scape Server/src/main/java/com/rs2/game/npcs/NpcActions.java b/2006Scape Server/src/main/java/com/rs2/game/npcs/NpcActions.java index 0ee690c2..475fab0c 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/npcs/NpcActions.java +++ b/2006Scape Server/src/main/java/com/rs2/game/npcs/NpcActions.java @@ -139,6 +139,27 @@ public class NpcActions { player.getDialogueHandler().sendDialogues(1378, npcType); break; + case 1835: + if (player.easterEvent == 0) + player.getDialogueHandler().sendDialogues(6000, npcType); + else if (player.easterEvent == 1) + { + int easter1 = player.getInventory().getItemAmount(7928); + int easter2 = player.getInventory().getItemAmount(7929); + int easter3 = player.getInventory().getItemAmount(7930); + int easter4 = (easter1 + easter2 + easter3); + if (easter4 >= 3) + player.getDialogueHandler().sendDialogues(6017, npcType); + else { + player.getDialogueHandler().sendDialogues(6014, npcType); + } + } + else + { + player.getDialogueHandler().sendDialogues(6022, npcType); + } + break; + case 537: case 536: int requiredQP = Math.min(32, QuestAssistant.MAXIMUM_QUESTPOINTS); diff --git a/2006Scape Server/src/main/java/com/rs2/game/players/Player.java b/2006Scape Server/src/main/java/com/rs2/game/players/Player.java index ff5d2943..19442f16 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/players/Player.java +++ b/2006Scape Server/src/main/java/com/rs2/game/players/Player.java @@ -1389,7 +1389,7 @@ public abstract class Player { deletePinDate = -1, firstPin, secondPin, thirdPin, fourthPin, bankPin1, bankPin2, bankPin3, bankPin4, pinDeleteDateRequested, rememberNpcIndex, ratsCaught, lastLoginDate, selectedSkill, newHerb, - newItem, newXp, doingHerb, herbAmount, treeX, treeY, lastH, + newItem, newXp, doingHerb, herbAmount, treeX, treeY, lastH, easterEvent, ectoTokens, cookingItem, smeltingItem, cookingObject, summonId, npcId2 = 0, leatherType = -1, weightCarried, teleotherType, rockX, rockY, itemUsing, tzKekTimer, bananas, flourAmount, grain, questPoints, questStages, diff --git a/2006Scape Server/src/main/java/com/rs2/game/players/PlayerSave.java b/2006Scape Server/src/main/java/com/rs2/game/players/PlayerSave.java index a6c3973b..0d513b73 100644 --- a/2006Scape Server/src/main/java/com/rs2/game/players/PlayerSave.java +++ b/2006Scape Server/src/main/java/com/rs2/game/players/PlayerSave.java @@ -287,6 +287,12 @@ public class PlayerSave { case "lostCity": player.lostCity = Integer.parseInt(token2); break; + case "ectoTokens": + player.ectoTokens = Integer.parseInt(token2); + break; + case "easterEvent": + player.easterEvent = Integer.parseInt(token2); + break; case "restGhost": player.restGhost = Integer.parseInt(token2); break; @@ -725,6 +731,10 @@ public class PlayerSave { characterfile.newLine(); characterfile.write("lostCity = " + player.lostCity); characterfile.newLine(); + characterfile.write("ectoTokens = " + player.ectoTokens); + characterfile.newLine(); + characterfile.write("easterEvent = " + player.easterEvent); + characterfile.newLine(); characterfile.write("cw-games = " + player.cwGames); characterfile.newLine(); characterfile.write("witchspot = " + player.witchspot);