/
namespace Terros.WorldApi.NpcServer.NpcHandler.Market
{
using Network.GamePackets;
unsafe class RebirthMaster
{
[Npc(npcID = 59558)]
public unsafe static void rebirthMaster(Network.GamePackets.NpcRequest npcRequest, Client.GameState client)
{
Dialog dialog = npcRequest.Dialog;
dialog.Avatar(67);
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("I devote all my life to the research of eternity. And finally I Know the secret of");
dialog.Text(" rebirth! Well, anything I can help you with?");
dialog.Option("1st Rebirth.", 1);
dialog.Option("2nd Rebirth.", 2);
dialog.Option("Reincarnation.", 3);
dialog.Option("Reallot my Attribute Points.", 4);
dialog.Option("Just Passing By.", 255);
dialog.Send();
break;
}
case 1:
{
dialog.Text("Hello conqueror. You know, there are ancient stories about a second life and many people chose not to believe it. Even so, there are some people that believe in it, and that inspired me to learn about it. In my study, I found out how to reborn someone. But, in this quest, a CelestialStone may be needed. To get one, talk with Celestine(TwinCity 365, 92).");
dialog.Option("Tell me more about it.", 10);
dialog.Option("Reborm me.", 12);
dialog.Option("Nothing thank you.", 255);
dialog.Send();
break;
}
case 10:
{
dialog.Text("So you want to know more? When you reborn, you can chose what class you want to be the second life. Once you reborn you will start again the journey to conquer this world from level 15. Beware that you may gain some special skills depending on the class you chose to reborn, and you'll be able to get an own pet, that will follow and help you level or fight. The cost is a CelestialStone.");
dialog.Option("Reborm me.", 2);
dialog.Option("Nothing thank you.", 255);
dialog.Send();
break;
}
case 12:
{
if (client.Entity.Reborn == 0)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
dialog.Text("There are two kinds of reborns. One is the normal one and the second one is blessed. The normal reborn will give you the chance to get a Super Gem and the blessed reborn will set a -1 into one of your equipment that you wear during the reborn. What do you chose?");
dialog.Option("Normal reborn.", 15);
dialog.Option("Blessed reborn.", 13);
dialog.Option("Nothing thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
dialog.Option("Ahh.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
case 15:
{
if (client.Entity.Reborn == 0)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
dialog.Text("Select the super gem you desire.");
dialog.Option("SuperPhoenixGem.", 203);
dialog.Option("SuperDragonGem.", 213);
dialog.Option("SuperFuryGem.", 223);
dialog.Option("SuperRainbowGem.", 233);
dialog.Option("SuperVioletGem.", 253);
dialog.Option("SuperMoonGem.", 254);
dialog.Option("SuperKylinGem.", 243);
dialog.Option("Nothing thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
dialog.Option("Ahh.", 255);
dialog.Send();
}
break;
}
else
{
dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
case 13:
{
if (client.Entity.Reborn == 0)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
dialog.Text("Select the class you want to reborn in.");
dialog.Option("Trojan.", (byte)(10 + npcRequest.OptionID));
dialog.Option("Warrior.", (byte)(20 + npcRequest.OptionID));
dialog.Option("Archer.", (byte)(40 + npcRequest.OptionID));
dialog.Option("WaterTaoist.", (byte)(132 + npcRequest.OptionID));
dialog.Option("FireTaoist.", (byte)(142 + npcRequest.OptionID));
dialog.Option("Ninja.", (byte)(50 + npcRequest.OptionID));
dialog.Option("Monk.", (byte)(60 + npcRequest.OptionID));
dialog.Option("Pirate.", (byte)(70 + npcRequest.OptionID));
dialog.Option("Dragon-Warrior.", (byte)(80 + npcRequest.OptionID));
dialog.Option("Windwalker.", (byte)(160 + npcRequest.OptionID));
dialog.Send();
}
else
{
dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
dialog.Option("Ahh.", 255);
dialog.Send();
}
break;
}
else
{
dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
default:
{
if (client.Entity.Reborn == 0)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
if (npcRequest.OptionID == 255)
return;
if (npcRequest.OptionID >= 200 && npcRequest.OptionID <= 254)
{
client.SelectedGem = (byte)(npcRequest.OptionID % 100);
if (client.SelectedGem == 54)
client.SelectedGem = 63;
if (client.Entity.Reborn == 0)
{
byte id = 4;
dialog.Text("Select the class you want to reborn in.");
dialog.Option("Trojan.", (byte)(10 + id));
dialog.Option("Warrior.", (byte)(20 + id));
dialog.Option("Archer.", (byte)(40 + id));
dialog.Option("WaterTaoist.", (byte)(132 + id));
dialog.Option("FireTaoist.", (byte)(142 + id));
dialog.Option("Ninja.", (byte)(50 + id));
dialog.Option("Monk.", (byte)(60 + id));
dialog.Option("Pirate.", (byte)(70 + id));
dialog.Option("Dragon-Warrior.", (byte)(80 + id));
dialog.Option("Windwalker.", (byte)(160 + id));
dialog.Send();
break;
}
else
{
dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
}
else
{
if (client.Inventory.Contains(721259, 1))
{
byte _class = (byte)(npcRequest.OptionID - npcRequest.OptionID % 10);
if (_class > 100)
_class += 2;
byte type = (byte)(npcRequest.OptionID - _class);
if (_class < 100)
_class++;
if (type != 4)
{
_class -= 10;
}
if (client.Reborn(_class))
{
client.Inventory.Remove(721259, 1);
if (type == 4)
{
if (client.SelectedGem != 0)
{
uint gemid = (uint)(client.SelectedGem + 700000);
client.Inventory.Add(gemid, 0, 1);
}
}
else
{
int availableshots = 0;
for (byte count = 0; count < 12; count++)
if (!client.Equipment.Free(count))
if (client.Equipment.TryGetItem(count).Bless == 0)
availableshots++;
if (availableshots != 0)
{
byte ex = (byte)Kernel.Random.Next(12);
if (!client.Equipment.Free(ex))
if (client.Equipment.TryGetItem(ex).Bless == 0)
{
var item = client.Equipment.TryGetItem(ex);
item.Bless = 1;
item.Mode = Terros.WorldApi.Game.Enums.ItemMode.Update;
item.Send(client);
Terros.WorldApi.Database.ConquerItemTable.UpdateBless(item);
}
}
}
}
else
{
dialog.Text("Sorry, but you need atleast 2 free spaces in your inventory.");
dialog.Option("Ohh.", 255);
dialog.Send();
}
}
}
}
else
{
dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
dialog.Option("Ahh.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
#region Riencration to 7
case 3:
{
if (client.Entity.Reborn == 2 && client.Entity.Level >= 120)
{
dialog.Text("I am the ReincarnationSeer i can help you to change your second reborn Class you need OblivionDew");
dialog.Text(" and 500k cps in your inventory deal?");
dialog.Option("i want to Change my Class.", 5);
dialog.Option("i want to Buy OblivionDew.", 6);
dialog.Option("Wait a minute.", 255);
dialog.Send();
}
else
{
dialog.Text("Sorry you need to be Seconed Reborn and Lv + 120.");
dialog.Option("Alright.", 255);
dialog.Send();
}
break;
}
case 5:
{
client.Send(new Data(true)
{
UID = client.Entity.UID,
ID = Data.Mode.OpenWindow,
dwParam = Data.WindowCommands.Reincarnation,
wParam1 = client.Entity.X,
wParam2 = client.Entity.Y
});
break;
}
case 6:
{
if (client.Entity.ConquerPoints >= 2000)
{
dialog.Text("Do you Really want to Buy OblivionDew it cost 2,000 cps");
dialog.Option("Yes.", 7);
dialog.Option("Wait a minute.", 255);
dialog.Send();
}
else
{
dialog.Text("Sorry you dont Have 2,000 cps.");
dialog.Option("Alright.", 255);
dialog.Send();
}
break;
}
case 7:
{
if (client.Entity.ConquerPoints >= 2000)
{
client.Entity.ConquerPoints -= 2000;
client.Inventory.Add(711083, 0, 1);
}
else
{
dialog.Text("Sorry you dont Have 2.000 cps in your bag.");
dialog.Option("Why!?", 255);
dialog.Send();
}
break;
}
#endregion
#region attribute 8
case 4:
{
dialog.Text("Hello there brave conqueror, if you have reborn, and you misplaced your atribute points or you want to set them another way, I'll reset your atribute points for one DragonBall. Do you accept?");
dialog.Option("Here is the DragonBall.", 8);
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
case 8:
{
if (client.Entity.Reborn > 0)
{
if (client.Inventory.Contains(1088000, 1))
{
client.Inventory.Remove(1088000, 1);
if (client.Entity.Reborn != 0)
{
client.Entity.Agility = 0;
client.Entity.Strength = 0;
client.Entity.Vitality = 1;
client.Entity.Spirit = 0;
if (client.Entity.Reborn == 1)
{
client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
+ 52 + 3 * (client.Entity.Level - 15));
}
else
{
client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
}
}
}
else
{
dialog.Text("You need a DragonBall.");
dialog.Option("I'll just leave", 255);
dialog.Send();
}
}
else
{
dialog.Text("You have to have atleast one rebirth atleast.");
dialog.Option("I'll just leave", 255);
dialog.Send();
}
break;
}
#endregion
#region 2nd reborn
case 2:
{
dialog.Text("You don't worry, it's not gonna hurt you a bit when getting the third life. You just need an exemption token and it's all going to be fine.");
dialog.Option("Here is the ExemptionToken.", 9);
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
case 9:
{
if (client.Entity.Reborn == 1)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
dialog.Text("Select the class you want to reborn in.");
dialog.Option("Trojan.", 11);
dialog.Option("Warrior.", 21);
dialog.Option("Archer.", 41);
dialog.Option("WaterTaoist.", 132);
dialog.Option("FireTaoist.", 142);
dialog.Option("Ninja.", 51);
dialog.Option("Monk.", 61);
dialog.Option("Pirate.", 71);
dialog.Option("Dragon-Warrior", 81);
dialog.Option("Windwalker", 161);
dialog.Send();
}
else
{
dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
}
else
{
dialog.Text("You need to be in the second life to be able to get the third life.");
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
break;
}
case 11:
case 21:
case 41:
case 51:
case 61:
case 71:
case 81:
case 132:
case 142:
case 161:
{
if (npcRequest.OptionID == 255) return;
if (client.Entity.Reborn == 1)
{
if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
{
if (client.Inventory.Contains(723701, 1))
{
if (client.Reborn(npcRequest.OptionID))
{
client.Inventory.Remove(723701, 1);
}
else
{
dialog.Text("You need two free slots in your inventory.");
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
}
}
else
{
dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
}
else
{
dialog.Text("You need to be in the second life to be able to get the third life.");
dialog.Option("I'll just leave", 255);
dialog.Send();
break;
}
break;
}
#endregion
}
}
}
}