Cool release for npc's thanks a lot xD
case 10064://tinter NPC
{
if (LinkBack == 0)
{
Text("Do you want to dye your armor, headgear or shield?", CSocket);
Link("Armor", 255, CSocket);
Link("Headgear", 255, CSocket);
Link("Shield", 255, CSocket);
Link("Teleport me out please", 4, CSocket);
Link("I see, Goodbye.", 255, CSocket);
Face(30, CSocket);End(CSocket);
}
else if (LinkBack == 4)
{
{
Teleport(1002, 439, 390, 0, CSocket);
}
}
break;
}
case 3825://Unknown Man NPC
{
if (LinkBack == 0)
{
Text("Hey, there! Please take pity on a homeless old man! I am so hungry but can't even afford a bowl of noodles. Could you help me out there? The gods always smile on kindness, you know!", CSocket);
Link("Here are 100 silvers. Take Care.", 1, CSocket);
Link("No way. I don't do charity.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if(CSocket.Client.Money >= 100)
{
Money(-100, CSocket);
Text("Thank you young one. so where was I ?", CSocket);
Link("You wanted to tell me something...", 2, CSocket);
Face(30, CSocket);
End(CSocket);
}
else
{
Text("It seems your poorer then me...", CSocket);
Link("Sorry Sir, I will get the money.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
if (LinkBack == 2)
{
Text("Oh yeah... The Dragonball is such a supernatural item which can not only upgrade the level and the quality of your gears, but also help you level up quickly.", CSocket);
Text(" I can draw the infinite energy contained in the Dragonball and utilize it to increase your experience. In a single secound, you could gain experience of hours of work!", CSocket);
Link("Wow! I can't wait to start.", 3, CSocket);
Link("It's truly amazing! NOT!", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
if (LinkBack == 3)
{
Text("You can only draw energy from dragonballs once a day. Bring Dragonball to me, and then I will help you to transfer the energy containing in DB to your body.", CSocket);
Text(" So you can make use of the energy to level up instantly from Level (YOUR LEVEL) to Level(NextLeveL) (00%)", CSocket);
Link("Let's get started!", 4, CSocket);
Link("Thanks. I see.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
if (LinkBack == 4)
{
Text("Give me a Dragonball and let's get started!", CSocket);
Link("Here you are!", 5, CSocket);
Link("sorry I dont have one!", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
if (LinkBack == 5)
{
if(CSocket.Client.Inventory.ContainsKey(10880008)) //Dragonball
{
{
CSocket.Client.Inventory.Remove(10880008);
Text("OWNED ! I dont work yet ^_^", CSocket);
Link("you son of a bith!.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
else
{
Text("Dare you try to rip me off?! Be gone, fool!", CSocket);
Link("Sorry sir.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
break;
}
int uid = ReturnUID(1088000, CSocket);
CSocket.Client.Inventory.Remove(uid);
CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(uid);
Do you mean this?Quote:
dude great job ! very good job :D now find a way for upgrade weapons like +1... quality, level, unknown dude
heres the codes :D I'm good with dialogs and simple stuff but doing hard stuff is my weekness :(
btw dude whats the code for add item ?Code:case 10064://tinter NPC { if (LinkBack == 0) { Text("Do you want to dye your armor, headgear or shield?", CSocket); Link("Armor", 255, CSocket); Link("Headgear", 255, CSocket); Link("Shield", 255, CSocket); Link("Teleport me out please", 4, CSocket); Link("I see, Goodbye.", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 4) { { Teleport(1002, 439, 390, 0, CSocket); } } break; } case 3825://Unknown Man NPC { if (LinkBack == 0) { Text("Hey, there! Please take pity on a homeless old man! I am so hungry but can't even afford a bowl of noodles. Could you help me out there? The gods always smile on kindness, you know!", CSocket); Link("Here are 100 silvers. Take Care.", 1, CSocket); Link("No way. I don't do charity.", 255, CSocket); Face(30, CSocket); End(CSocket); } else if (LinkBack == 1) { if(CSocket.Client.Money >= 100) { Money(-100, CSocket); Text("Thank you young one. so where was I ?", CSocket); Link("You wanted to tell me something...", 2, CSocket); Face(30, CSocket); End(CSocket); } else { Text("It seems your poorer then me...", CSocket); Link("Sorry Sir, I will get the money.", 255, CSocket); Face(30, CSocket); End(CSocket); } } if (LinkBack == 2) { Text("Oh yeah... The Dragonball is such a supernatural item which can not only upgrade the level and the quality of your gears, but also help you level up quickly.", CSocket); Text(" I can draw the infinite energy contained in the Dragonball and utilize it to increase your experience. In a single secound, you could gain experience of hours of work!", CSocket); Link("Wow! I can't wait to start.", 3, CSocket); Link("It's truly amazing! NOT!", 255, CSocket); Face(30, CSocket); End(CSocket); } if (LinkBack == 3) { Text("You can only draw energy from dragonballs once a day. Bring Dragonball to me, and then I will help you to transfer the energy containing in DB to your body.", CSocket); Text(" So you can make use of the energy to level up instantly from Level (YOUR LEVEL) to Level(NextLeveL) (00%)", CSocket); Link("Let's get started!", 4, CSocket); Link("Thanks. I see.", 255, CSocket); Face(30, CSocket); End(CSocket); } if (LinkBack == 4) { Text("Give me a Dragonball and let's get started!", CSocket); Link("Here you are!", 5, CSocket); Link("sorry I dont have one!", 255, CSocket); Face(30, CSocket); End(CSocket); } if (LinkBack == 5) { if(CSocket.Client.Inventory.ContainsKey(10880008)) //Dragonball { { CSocket.Client.Inventory.Remove(10880008); Text("OWNED ! I dont work yet ^_^", CSocket); Link("you son of a bith!.", 255, CSocket); Face(30, CSocket); End(CSocket); } } else { Text("Dare you try to rip me off?! Be gone, fool!", CSocket); Link("Sorry sir.", 255, CSocket); Face(30, CSocket); End(CSocket); } } break; }
whats the code for add item with normal ID like 1088000 ? :DCode:int uid = ReturnUID(1088000, CSocket); CSocket.Client.Inventory.Remove(uid); CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem)); Database.Database.DeleteItem(uid);
public static void AddItem(int itemid, int bless, int dura, int enchant, int plus, int position, int soc1, int soc2, int color, ClientSocket CSocket)
{
Struct.ItemInfo Item = new Struct.ItemInfo();
if (dura == 255)
{
Item.Dura = Item.MaxDura;
}
else
{
Item.Dura = dura;
}
Item.Bless = bless;
Item.Enchant = enchant;
Item.ItemID = itemid;
Item.Plus = plus;
Item.Position = position;
Item.Soc1 = soc1;
Item.Soc2 = soc2;
Item.Color = color;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}
CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
}
case 47:
{
if (linkback == 0)
{
Text("Here a normal blade");
Link("THanks", 1, Csocket);
Link("**** you", 255, csocket);
Face(30, csocket);
End(Csocket);
}
}
else if (linkback == 1)
{
AddItem(410333, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
}
break;
}
case 47: //PrizeNPC
{
if (LinkBack == 0)
{
if (!Nano.NpcActive)
{
Text("Sorry, you can't claim a DragonBall.", CSocket);
Link("Damnt, WHY NOT!", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
else
{
Text("Do you want to claim a DragonBall?", CSocket);
Link("Yes", 1, CSocket);
Link("No, thank you.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
else if (LinkBack == 1)
{
AddItem(1088000, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
}
break;
}
public static bool NpcActive = false;
case "prize":
{
if (CSocket.Client.isGM)
{
if (Command.Length == 2)
{
switch (Command[1].ToLower())
{
case "on":
{
Nano.NpcActive = true;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PrizeNPC is activated.", Struct.ChatType.Talk));
break;
}
case "off":
{
Nano.NpcActive = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PrizeNPC is de-activated.", Struct.ChatType.Talk));
break;
}
}
}
}
break;
}
Kiyono thanks for npcs but i dont know,how i can put Nano.cs code and Chat.cs code.Can u help me ?Quote:
So out of boredom (and cause I wanted to test something) I made the PrizeNPC give a DB and he can be activated/de-activated on command.
In NpcTalk.cs:
In Nano.cs:Code:case 47: //PrizeNPC { if (LinkBack == 0) { if (!Nano.NpcActive) { Text("Sorry, you can't claim a DragonBall.", CSocket); Link("Damnt, WHY NOT!", 255, CSocket); Face(30, CSocket); End(CSocket); } else { Text("Do you want to claim a DragonBall?", CSocket); Link("Yes", 1, CSocket); Link("No, thank you.", 255, CSocket); Face(30, CSocket); End(CSocket); } } else if (LinkBack == 1) { AddItem(1088000, 0, 0, 0, 0, 0, 0, 0, 0, CSocket); } break; }
In Chat.cs:Code:public static bool NpcActive = false;
How to use:Code:case "prize": { if (CSocket.Client.isGM) { if (Command.Length == 2) { switch (Command[1].ToLower()) { case "on": { Nano.NpcActive = true; CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PrizeNPC is activated.", Struct.ChatType.Talk)); break; } case "off": { Nano.NpcActive = false; CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PrizeNPC is de-activated.", Struct.ChatType.Talk)); break; } } } } break; }
Type /prize on to let him give DBs and type /prize off to stop him and the the default status is off.
case 30112://GeneralChen
{
if (LinkBack == 0)
{
Text("Quarrels and disputes come up from time to time. It seems that troubled time return", CSocket);
Link("That is what I am coming for.", 225, CSocket);
Face(30, CSocket);
End(CSocket);
}
break;
}
case 30100://MountainKing
{
if (LinkBack == 0)
{
Text("The area is dangerous. You'd better leave here right now if you have nothing special to do.", CSocket);
Link("I am not a coward.", 225, CSocket);
Face(30, CSocket);
End(CSocket);
}
break;
}
Can Help me?Quote:
all codded totaly by me they only need finishing part where you guys come in :D with the packets and stuff !
Btw if someone can explain to me how to check if he has it ,remove and add item to the char ! what are the codes ?
Code:case 10003://Guild dude { if (LinkBack == 0) { Text("Greetings! I am the guild director, in charge of administrating and managing guilds. What business do you have with me?", CSocket); Link("Create a guild", 255, CSocket); Link("Disband my guild", 255, CSocket); Link("Donate money", 255, CSocket); Link("Pass my leadership", 255, CSocket); Link("Assign Deputy Guild Leader", 255, CSocket); Link("Remove sb. from office", 255, CSocket); Link("Inquire about guild", 255, CSocket); Link("Others", 1, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { { Text("I am in charge of all guilds in Twim City. You may consult me for anything related to the guilds.", CSocket); Link("Create Branch", 255, CSocket); Link("Assign Branch Manager", 255, CSocket); Link("Transfer fund.", 255, CSocket); Link("Others", 0, CSocket); Face(30, CSocket);End(CSocket); } } break; } case 10002://Barber Bitch { if (LinkBack == 0) { Text("I'm capable of doing more hairstyles now! A New Dynasty Hairstyles is worth 10000 Silvers. Previous hairstyles cost 500 silvers.", CSocket); Link("New Dynasty Hairstyles.", 1, CSocket); Link("New Styles.", 2, CSocket); Link("Nostalgic styles.", 3, CSocket); Link("Keep my current style.", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { { Text("Which style would you like to select from?.", CSocket); Link("1", 255, CSocket); Link("2", 255, CSocket); Link("2.", 255, CSocket); Link("I changed my mind.", 255, CSocket); Face(30, CSocket);End(CSocket); } } else if (LinkBack == 2) { { Text("Which style would you like to select from?.", CSocket); Link("1", 255, CSocket); Link("2", 255, CSocket); Link("2.", 255, CSocket); Link("I changed my mind.", 255, CSocket); Face(30, CSocket);End(CSocket); } } else if (LinkBack == 3) { { Text("Which style would you like to select from?.", CSocket); Link("1", 255, CSocket); Link("2", 255, CSocket); Link("2.", 255, CSocket); Link("I changed my mind.", 255, CSocket); Face(30, CSocket);End(CSocket); } } else { Text("Dare you try to rip me off?! Be gone, fool!", CSocket); Link("Sorry sir.", 255, CSocket); Face(30, CSocket);End(CSocket); } break; } case 10063://shopboy dude { if (LinkBack == 0) { Text("Our shop is famous for dyeing. If you want to have your equipment dyed please wear the item before you enter. You have a wide choice of colors. One meteor will be charged before you try the colors. Do you want a try?", CSocket); Link("Yes, here is a meteor.", 1, CSocket); Link("Can you dye my armor black?", 2, CSocket); Link("Just passing by.", 255, CSocket); Face(30, CSocket); End(CSocket); } else if (LinkBack == 1) { { Teleport(1008, 22, 26, 0, CSocket); } } else if (LinkBack == 2) { { Text("Sure. Once your armor is dyed black, it will never fade no matter how it is updated, unless i dye it to other colors, i wil charge 1 dragon ball to do it.", CSocket); Link("Yes, here is a Dragonball.", 3, CSocket); Link("Let me think it over.", 255, CSocket); Face(30, CSocket);Face(30, CSocket);End(CSocket); } } else if (LinkBack == 3) { { Teleport(1008, 22, 26, 0, CSocket); } } else { Text("Dare you try to rip me off?! Be gone, fool!", CSocket); Link("Sorry sir.", 255, CSocket); Face(30, CSocket);End(CSocket); } break; } case 1061://Wh Pass Bitch { if (LinkBack == 0) { Text("Thieves are only one step behind security. Even those who hoard their treasures", CSocket); Text(" in their warehouse are at risk. So, I offer you the opportunity to set a special", CSocket); Text(" password for your warehouse. What do you say?", CSocket); Text("Thieves are only one step behind security. Even those who hoard their treasures", CSocket); Link("I want to set a password.", 1, CSocket); Link("Let me see.", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { { Text("Passwords can be up to nine digits long, the first of which cannot be zero.", CSocket); Text(" Enter numbers only. If you make a mistake your warehouse will be locked.", CSocket); Text(" Please check carefully before you enter the password.", CSocket); Link("Let me think.", 2, CSocket); Link("Let me think.", 255, CSocket); Face(30, CSocket);End(CSocket); } } else if(LinkBack == 2) { Text("Sorry not owrking yet.", CSocket); Link("I see.", 255, CSocket); Face(30, CSocket);End(CSocket); } break; } case 923:// Lady Luck { if (LinkBack == 0) { Text("Welcome to the Lottery Center! There are meny LuckyBoxes which have innumerable treasure such as super gems,two-socket gears, up to 500,000,000 silvers etc. in them. If you are level 70 or above, you are allowed to enter the Lottery Center and try your luck at most ten times a day.", CSocket); Text("And I charge you only 27 CPs for each admission.Come on, Try your luck right now!", CSocket); Link("Wow, good deal!", 1, CSocket); Link("May I know the rules first?", 2, CSocket); Link("No Thanks!", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { if(CSocket.Client.Level >= 70) { if (CSocket.Client.CPs >= 27) { Teleport(700, 50, 50, 0, CSocket); CPs(-27, CSocket); } else { Text("I'm sorry you do not have the required CPs.", CSocket); Link("Okay, I will be back when I have 27 CPs.", 255, CSocket); Face(30, CSocket);End(CSocket); } } else { Text("I'm sorry you do not have the required Level 70.", CSocket); Link("Okay, I will be back when I have level 70.", 255, CSocket); Face(30, CSocket);End(CSocket); } } if (LinkBack == 2) { Text("you will be teleported to Lottery Center where there are menny LuckyBoxes after you pay me 27 CPs. You may choose one box to try your luck at your will. Remeber you have only one chance to open a LuckyBox every time. If you want to open another box, you have to leave the room to re-enrol in Market.", CSocket); Link("OK I see.", 255, CSocket); Face(30, CSocket);End(CSocket); } break; } case 925: // LuckyBox case 926: // LuckyBox case 927: // LuckyBox case 928: // LuckyBox case 929: // LuckyBox case 930: // LuckyBox case 931: // LuckyBox case 932: // LuckyBox case 933: // LuckyBox case 934: // LuckyBox case 935: // LuckyBox case 936: // LuckyBox case 937: // LuckyBox case 938: // LuckyBox case 939: // LuckyBox case 940: // LuckyBox case 941: // LuckyBox case 942: // LuckyBox case 943: // LuckyBox case 944: // LuckyBox { if (LinkBack == 0) { Text("Do you want to Chose this box ?.", CSocket); Link("Yes ,", 1, CSocket); Link("No I need to think more...", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { { Teleport(1036, 217, 190, 0, CSocket); } } break; } case 924: // Lady Luck { if (LinkBack == 0) { Text("Do you want to leave Lottery Center and go back to the Market?.", CSocket); Link("Yes Please,", 1, CSocket); Link("No Thank you I want to stay.", 255, CSocket); Face(30, CSocket);End(CSocket); } else if (LinkBack == 1) { { Teleport(1036, 217, 190, 0, CSocket); } } break; }