[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source!
Discussion on [Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source!
Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY!
NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE!
1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...)
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("As you see, i'm a master at weaponry and skillful when it comes to big 2 handed weapons! as you enter twin-city through the last NPC you will be rewarded with such a weapon and the basic things to help you on your journeys!"));
GC.AddSend(Packets.NPCLink("That's so cool!", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthIdiot
case 10009:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("I'm the birth village idiot in Birth Village and i'm here to make sure everything is going good with you and your knowledge okay?"));
GC.AddSend(Packets.NPCLink("Alright thanks!", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthTaoistStar
case 10003:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello there, I'm TaoistStar! I'm very handy when it comes to taoists and spells! if you're a taoist i can teach you thunder and cure,But unfortunately im running out of mana...ill refill soon!!"));
GC.AddSend(Packets.NPCLink("Awesome!", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthWiseGuy
case 10004:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Have you learned alot from each NPC? I hope you have, because you will need those guides later on in the future to become a better fighter!"));
GC.AddSend(Packets.NPCLink("WOW nice!", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthBlacksmith
case 10005:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello there, I'm the Blacksmith! you can find me in each city and buy nice weapons for each class from me!"));
GC.AddSend(Packets.NPCLink("Nice to hear.", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthWarehouseMan
case 10006:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello there, I'm the WarehouseMan! you can find me in each city to store/withdraw items from me!"));
GC.AddSend(Packets.NPCLink("Nice to hear.", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthArmorer
case 10007:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello there, I'm the Armorer! you can find me in each city and buy armors/head gear for each class from me!"));
GC.AddSend(Packets.NPCLink("Nice to hear.", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region BirthPharmacist
case 10008:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello there, I'm the pharmacist! you can find me in each city, and buy potions to restore your health/mana!"));
GC.AddSend(Packets.NPCLink("Nice to hear.", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
#region GiftGear NPC
case 300006:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome! I'm the Gift Gear Goddess, I gift you gear of level 70! You must first achieve level 70 before entering my gift shop!"));
GC.AddSend(Packets.NPCLink("I'm Ready!", 1));
GC.AddSend(Packets.NPCLink("I'll be back!", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("I can gift you with some gear of each specified profession!"));
GC.AddSend(Packets.NPCLink("Super FireTao L70 pack", 2));
GC.AddSend(Packets.NPCLink("Super WaterTao L70 pack", 3));
GC.AddSend(Packets.NPCLink("Super Warrior L70 pack", 4));
GC.AddSend(Packets.NPCLink("Super Trojan L70 pack", 5));
GC.AddSend(Packets.NPCLink("Super Archer L70 pack", 6));
GC.AddSend(Packets.NPCLink("Super Ninja L70 pack", 7));
GC.AddSend(Packets.NPCLink("Weps pack L70", 8));
GC.AddSend(Packets.NPCLink("No, thanks.", 255));
GC.AddSend(Packets.NPCSetFace(15));
GC.AddSend(Packets.NPCFinish());
}
else if (GC.MyChar.Level <= 69)
{
GC.AddSend(Packets.NPCSay("Your not yet level 70 or above! please train harder!"));
GC.AddSend(Packets.NPCLink("okay...bye!", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
#region Escort Chief
case 32165:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you want to clear your inventory? It will cost you 1,000 silvers."));
GC.AddSend(Packets.NPCLink("Yes, actually I do.", 1));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("Are you sure?"));
GC.AddSend(Packets.NPCLink("Yes, i am.", 2));
GC.AddSend(Packets.NPCLink("No, i don't know what i was thinking.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 2)
if (GC.MyChar.Silvers >= 1000)
{
GC.MyChar.Silvers -= 1000;
foreach (Game.Item I in GC.MyChar.Inventory)
GC.AddSend(Packets.ItemPacket(I.UID, 0, 3));
GC.MyChar.Inventory = new ArrayList(40);
GC.AddSend(Packets.NPCSay("Well it's done."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region Lost-Quest(Part 1)
case 888765:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("I lost my little son, his name is AprenTiceLuo, I searched Everywhere and can't seem to find him.Find him and i will give you a reward young conqueror."));
GC.AddSend(Packets.NPCLink("I will.", 1));
GC.AddSend(Packets.NPCLink("Done.", 2));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.Teleport(1201, 154, 154);
}
if (Control == 2)
{
if (GC.MyChar.InventoryContains(722314, 1))
{
GC.AddSend(Packets.NPCSay("Thank you very much, here is your reward"));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.MyChar.CPs += 20000;
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722314));
}
else
{
GC.AddSend(Packets.NPCSay("Sorry, you don't have the required item."));
GC.AddSend(Packets.NPCLink("OK", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
#region Lost-Quest(Part 2)
case 888764:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hey Do I know you? I bet my mother is scared that im gone for so long, well I have been searching for valuable items and just need 1 more so I can't go now. Please take this letter to her that I'll be home soon. And thanks in advance!"));
GC.AddSend(Packets.NPCLink("No Problem...", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.AddItem(722314, 0);
GC.MyChar.Teleport(1002, 440, 440);
}
break;
}
#endregion
#region FortuneTeller
case 600050:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello! Do you want to take part on the most exciting and dangerous quest I have here? Would you like to help me retain my moonbox young conqueror?"));
GC.AddSend(Packets.NPCLink("Yes I will!, 1"));
GC.AddSend(Packets.NPCLink("I'll take a look around here.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.Teleport(1042, 36, 51);
GC.AddSend(Packets.NPCSay("Be careful. You don't know how dangerous are the monsters inside of DeathTactic."));
GC.AddSend(Packets.NPCFinish());
}
#region MineAsistant
case 1175:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, I can send you in mine. Would you like to go?"));
GC.AddSend(Packets.NPCLink("Yes, please send me there.", 1));
GC.AddSend(Packets.NPCLink("I'll take a look around here.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
GC.MyChar.Teleport(1028, 158, 95, 0);
}
break;
}
#endregion
#region Gouda
case 15140:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay(" Have you heard of the holy Kylin? A marvelous and magnificent creature that lives in Jokul,"));
GC.AddSend(Packets.NPCSay(" rumored to have a body covered in sparkling squamas! People say it flies overhead every night, and some of its glowing squamas fall to earth."));
GC.AddSend(Packets.NPCSay(" I've seen them, but never found them myself"));
GC.AddSend(Packets.NPCLink("What else do you know?", 1));
GC.AddSend(Packets.NPCLink("I've business elsewhere. Goodbye.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
GC.AddSend(Packets.NPCSay(" Every night, after 8 o'clock, the beast flies overhead, dropping twinkling spots to the ground."));
GC.AddSend(Packets.NPCSay(" They are squamas! Those who can collect the squamas can find secrey treasures... meteors, gold and maybe even more!"));
GC.AddSend(Packets.NPCLink("Interesting... Thank you.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region Bandit Head
case 30086:// Bandit Head
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("It is our domain. If you do not want to die, you had better get out of here right now."));
GC.AddSend(Packets.NPCLink("Did you rob food carrier?", 1));
GC.AddSend(Packets.NPCLink("I got to go at once.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
GC.AddSend(Packets.NPCSay("We dare not rob the army. Only the unarmed Trade Caravans are our target."));
GC.AddSend(Packets.NPCLink("Who might do it?", 2));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 2)
{
GC.AddSend(Packets.NPCSay("There is another group of bandits here who are stronger and bigger than us."));
GC.AddSend(Packets.NPCSay(" I am afraid it was them who did it."));
GC.AddSend(Packets.NPCLink("I trust you.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
#region Furniture-Store
case 30161:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome to Twin City Furniture Store. Currently, you have limited selection, but more furniture will come in soon"));
GC.AddSend(Packets.NPCLink("I~wanna~have~a~look", 1));
GC.AddSend(Packets.NPCLink("I~am~not~interested", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
GC.MyChar.Teleport(1511, 52, 70, 0);
}
break;
}
#endregion
#region MoonPlatform-Send-In
case 9511:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("You may enjoy the bright moon and twinkling stars on the Moon Platform. I can teleport you there for a fee of 300 silver."));
GC.AddSend(Packets.NPCLink("Teleport me there.", 1));
GC.AddSend(Packets.NPCLink("No thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.Silvers >= 300)
{
GC.MyChar.Silvers -= 300;
GC.MyChar.Teleport(1105, 184, 164);
GC.AddSend(Packets.NPCSay("Ejoy your stay at the MoonPlatform!"));
GC.AddSend(Packets.NPCLink("Thank you.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("You don't have enough Silvers."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
#region MoonPlatform Send-Back
case 9512:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Wan't me to teleport you back to Twin City young one?"));
GC.AddSend(Packets.NPCLink("Yes, Please.", 1));
GC.AddSend(Packets.NPCLink("I'd rather stay.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.Teleport(1002, 453, 398);
GC.AddSend(Packets.NPCSay("I hope you comeback soon!"));
GC.AddSend(Packets.NPCLink("Will do.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
PRESS THANKS IF I HELPED IN ANY WAY AND EVEN IF I GAVE YOU AN IDEA!
Creditsriginal owner of 5165 source,original owners of all the NPC's listed here( well most of them anyways)...SORRY IF I DON'T KNOW THE NAMES OF THE MAKERS!
Special Credits: TO pro4never and .Ryu for helping me all this time and for giving me this wonderful idea!
+THANKS IF I HELPED!
#UPDATED+FIXED THE GIFT-GEAR NPC CODE! THANKS TO pro4never!
you still have your free item npc incorrect. Structure your if statements properly.
else if (GC.MyChar.Level <= 69)
{
GC.AddSend(Packets.NPCSay("Your not yet level 70 or above! please train harder!"));
GC.AddSend(Packets.NPCLink("okay...bye!", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
should be
Code:
if (Control == 2)
{
if (GC.MyChar.Level >= 70)
{
GC.MyChar.AddItem(134069); //Robe
GC.MyChar.AddItem(117069); //Earring
GC.MyChar.AddItem(152129); //brac
GC.MyChar.AddItem(121129); //Bag
GC.MyChar.AddItem(160139); //boots
GC.MyChar.AddItem(202009); //Star
GC.MyChar.AddItem(201009); //Fan
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("Your not yet level 70 or above! please train harder!"));
GC.AddSend(Packets.NPCLink("okay...bye!", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
Your level checks are not functioning correctly as they are now. You need them INSIDE the control block.
basically you want
control statement
{//Opens original control statement, keeps everything grouped together.
if statement
{
code
}
any else if statements
{
any else if code
}
else
{
else code
}
}//closes the ORIGINAL CONTROL STATEMENT!
You can nest more if statements in side but remember, the indentation indicates how far something is (if something is indented further than where you are writing your else statement, you probably have something messed up along the way.
Don't feel like correcting any of the other scripts atm but that should give you something to work on.
killersub lol :| what is that? omfg you just copy LostQuest & Buy Atribute npcc !! HAHA you are not codder !! stand DOWN !
Lol ur a funny kid...know y? cuz da joke's on you...I already said at the top+bottom for the "SLOW" people "MOST OF THE F'ING NPC'S WERE NOT MADE BY ME... AND THAT I JUST EDITED THEM FOR THE LAZY NEWBS!" so think before you speak alright dumbass?...
Quote:
Why the fawk do u post all npcs which are in the source already its completely useless.
loolll noob I'm Tweety.4girls noob stop copy from 4bott or re-release here ! nobish look on you release..you know to code just NPcSay !! nothing much please leave epvp here is full with noobs we don't need more noobs Thanks
birth taoist star id is, 10055 i think.. the one you wrote is for guild director..well ain't sure though..newei., good job man..you're doin good!! keep it up!
Um okay guys this may be a noob question but im kinda having some trouble implementing NPCs.
Before anyone flames or whatever, i dont know how to code but im trying to learn both through the internet and a C# book, but as a side quest im trying to add the stuff im learning into a CO server because it makes learning easier to stick with if you have a goal and something to work with.
Anyways so back to my question, im trying just to add a test NPC , just to simply change CP's to silvers, ok so i added a new line into the NPC list in the database, and he appears in game, but he doesnt say what i coded into the source!
This is the code i used (i put this into NPCDialog.cs btw)
Code:
#region TestNPC
case 300007:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hi Would You Like To Turn Your CPs To Silvers?"));
GC.AddSend(Packets.NPCLink("Yes Please!", 1));
GC.AddSend(Packets.NPCLink("No Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.CPs >= 1)
{
GC.MyChar.CPs -= 1;
GC.MyChar.Silvers += 1000000;
GC.AddSend(Packets.NPCSay("There Hapy Now?"));
GC.AddSend(Packets.NPCLink("Yes, Very.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("Ok Maybe Next Time!"));
GC.AddSend(Packets.NPCLink("Alright alright.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
so thats all i did but like i said he doesnt say all that in game, the npc just stands there and does nothing :P so like am i not doing something right or is my code wrong or what? Thanks in advance for whoever helps me! much appreciated
Um okay guys this may be a noob question but im kinda having some trouble implementing NPCs.
Before anyone flames or whatever, i dont know how to code but im trying to learn both through the internet and a C# book, but as a side quest im trying to add the stuff im learning into a CO server because it makes learning easier to stick with if you have a goal and something to work with.
Anyways so back to my question, im trying just to add a test NPC , just to simply change CP's to silvers, ok so i added a new line into the NPC list in the database, and he appears in game, but he doesnt say what i coded into the source!
This is the code i used (i put this into NPCDialog.cs btw)
Code:
#region TestNPC
case 300007:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hi Would You Like To Turn Your CPs To Silvers?"));
GC.AddSend(Packets.NPCLink("Yes Please!", 1));
GC.AddSend(Packets.NPCLink("No Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.CPs >= 1)
{
GC.MyChar.CPs -= 1;
GC.MyChar.Silvers += 1000000;
GC.AddSend(Packets.NPCSay("There Hapy Now?"));
GC.AddSend(Packets.NPCLink("Yes, Very.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("Ok Maybe Next Time!"));
GC.AddSend(Packets.NPCLink("Alright alright.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
so thats all i did but like i said he doesnt say all that in game, the npc just stands there and does nothing :P so like am i not doing something right or is my code wrong or what? Thanks in advance for whoever helps me! much appreciated
I see nothing wrong with that npc at all maybe your not putting something in right in NPC.txt
[Release] Extremely basic (but working/bugless) C# Source 11/30/2012 - CO2 PServer Guides & Releases - 348 Replies This pretty much has a very finite amount of stuff done in it. Specifically this is pretty much all thats in it.
If your serious about trying to develop a server in C#, I suggest looking at this. There's a DLL also included (check the "bin" folder) which will need to be added as a reference. SocketNetwork.dll pretty much handles the socket-system and encryptions for you it is not packed or obfuscated if you would like to decompile it and take a look at it, be my guest.
I included a folder...
[Release]5165 Source 06/13/2010 - CO2 PServer Guides & Releases - 0 Replies This is an old 5165 Source I was adding stuff to when I was helping with EmperionCO, now its ForsakendCO. Nothing really special about it..lots of copy/paste stuff and a few small stuff I added in myself. Kept all the really cool stuff I made for myself, adding to pringles release, if anyone remembers it, which I won't release because I dont have a good enough computer to host it myself and will not have someone else host it and run off and call it thiers the same as this source im posting...
[RELEASE] Basic LOTF Source 09/03/2009 - CO2 PServer Guides & Releases - 17 Replies hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame
What it has...
- LuckyTime
- Guard
- 24/7 GW