|
You last visited: Today at 07:02
Advertisement
[ADVISE]Is this a correct start for NPC code?
Discussion on [ADVISE]Is this a correct start for NPC code? within the CO2 Private Server forum part of the Conquer Online 2 category.
12/05/2009, 07:56
|
#1
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
[ADVISE]Is this a correct start for NPC code?
The point of the NPC: If you have 40 Bronze Prizes, it takes them away, and then gives you Silver Prize. Is this a good start? I know it may not be and yes I know some stuffs missing, but can anyone finish it or tell me what do to next? I'm so tired 2 am I will check tomorrow sorry if this didn't make sense.
Code:
#region
case 300009:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you give me 40 Bronze Prizes, I can give you 1 Silver prize, deal?"));
GC.AddSend(Packets.NPCLink("Sure", 1));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.InventoryContains(2100055, 40)) // Checks if you have 40 Bronze Prizes
{
GC.MyChar.AddItem(2100065, 0); //Adds Silver Prize
GC.MyChar.RemoveItem(GC.MyChar.NextItem(2100055)); // Removes the 40 Bronze Prizes from inventory
}
break;
}
#endregion
|
|
|
12/05/2009, 11:30
|
#2
|
elite*gold: 111
Join Date: Feb 2008
Posts: 2,161
Received Thanks: 646
|
Well, it would work.
What would you want done next? All you gotta do is add for example:
Code:
GC.AddSend(Packets.NPCSay("Congratulations! You have successfully purchased a SilverPrize"));
GC.AddSend(Packets.NPCLink("Thank you!", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish())
I suppose you could do a little quest about it, but if you are panning on having them get 40 BronzePrices, that might be a lot of trouble, lol.
But if you are planning to do so you may do something like add a random item to the inventory as a quest item then make another NPC which has the inventorycontains check and then do another dialoge, add a new item and go back to the first guy.
|
|
|
12/05/2009, 12:03
|
#3
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Code:
case 300009:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you give me 40 Bronze Prizes, I can give you 1 Silver prize, deal?"));
GC.AddSend(Packets.NPCLink("Sure", 1));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.InventoryContains(2100055, 40)) // Checks if you have 40 Bronze Prizes
{
GC.MyChar.AddItem(2100065, 0); //Adds Silver Prize
GC.MyChar.RemoveItem(GC.MyChar.NextItem(2100055)); // Removes the 40 Bronze Prizes from inventory
[COLOR="Red"][B]}[/B][/COLOR]
}
break;
}
You missed a bracket. (The one marked in red)
|
|
|
12/05/2009, 13:31
|
#4
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
|
Quote:
Originally Posted by Korvacs
Code:
case 300009:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you give me 40 Bronze Prizes, I can give you 1 Silver prize, deal?"));
GC.AddSend(Packets.NPCLink("Sure", 1));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.InventoryContains(2100055, 40)) // Checks if you have 40 Bronze Prizes
{
GC.MyChar.AddItem(2100065, 0); //Adds Silver Prize
GC.MyChar.RemoveItem(GC.MyChar.NextItem(2100055)); // Removes the 40 Bronze Prizes from inventory
[COLOR="Red"][B]}[/B][/COLOR]
}
break;
}
You missed a bracket. (The one marked in red)
|
First thing I noticed as well.
|
|
|
12/05/2009, 15:31
|
#5
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
Quote:
Originally Posted by BERGHUIS1
Well, it would work.
What would you want done next? All you gotta do is add for example:
Code:
GC.AddSend(Packets.NPCSay("Congratulations! You have successfully purchased a SilverPrize"));
GC.AddSend(Packets.NPCLink("Thank you!", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish())
I suppose you could do a little quest about it, but if you are panning on having them get 40 BronzePrices, that might be a lot of trouble, lol.
But if you are planning to do so you may do something like add a random item to the inventory as a quest item then make another NPC which has the inventorycontains check and then do another dialoge, add a new item and go back to the first guy.
|
Yeah it is, a quest.
Anyway lmao, I tested the quest for the first time and when I talk to it with 40 Bronze Prizes it leaves a blank space in my inventory and when I relog, then it shows it's a Silver Prize.
|
|
|
 |
Similar Threads
|
Some advise please
08/21/2009 - SRO Private Server - 5 Replies
could somebody help me with picking a server and stuff ?
I've been searching for SRO Pservers for about 2 days.
I found a few but got none of them completely working.
like registration offline or a dead downloadlink or something like that.
Could somebody post a SRO server That I can can play without to much hassle?
Thanks ^^
|
gonna start learning how to code, help?
07/25/2009 - CO2 Programming - 12 Replies
i wanna stop being a leecher, any idea where i can start?
was wanting to figure out how to decrypt server.dat files but cant seem to figure it out :(
|
Porting from the North Dock to Roc Mountain. I TYPED THE CORRECT CODE!
03/09/2009 - Silkroad Online - 1 Replies
Hey guys,
This is the code i pasted in the script.
It´s only the "portpart":
"-2625","379","1"
"cmd","",""
"Inject","745A","6802000 0"
"Inject","7495","6802000 00216000000"
|
autoit code für correct facing
02/20/2009 - World of Warcraft - 3 Replies
ich suche ein autoit source code beispiel für
"ausrichtung des spielers zum gegner (drehen)"
danke
|
Advise
11/02/2007 - CO2 Weapon, Armor, Effects & Interface edits - 2 Replies
Anyone know how to change around the effect for Scent Sword to Fast Blade or the other way round please? Thanks
|
All times are GMT +1. The time now is 07:03.
|
|