|
You last visited: Today at 01:40
Advertisement
[RELEASE] SandRaider NPC
Discussion on [RELEASE] SandRaider NPC within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
02/11/2010, 09:55
|
#16
|
elite*gold: 0
Join Date: Jan 2010
Posts: 134
Received Thanks: 64
|
Quote:
Originally Posted by Korvacs
Code:
#region SandRaider
case 123321:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome, Here I sell SandRaider Garment!"));
GC.AddSend(Packets.NPCLink("Cool let me in.", 1));
GC.AddSend(Packets.NPCLink("Haa Ok Then", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
GC.AddSend(Packets.NPCSay("Are you interested?"));
GC.AddSend(Packets.NPCLink("SandRaider", 2));
GC.AddSend(Packets.NPCLink("No, thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 2)
{
GC.MyChar.AddItem(183305, 7);
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
return;
}
#endregion
That would be even better, because it would atually work....and is more efficient.
|
how would that be better and efficient? Hes trying to make a NPC to sell it, that what you did is giving it out for free?
|
|
|
02/11/2010, 12:13
|
#17
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Quote:
Originally Posted by .Arco
Why return instead of break?
|
If you break then you end that case, and the thread will continue to do whatever is after the switch, if anything, which is pointless really, if you use return then the thread returns from the method completely, instead of spending cpu time checking to see if it needs to do more work.
@DontLookDown:
I was fixing .Arco's completely broken npc which he posted.
|
|
|
02/11/2010, 14:51
|
#18
|
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
|
Thanks everyone, this is my first NPC so I hope you like it!
|
|
|
02/11/2010, 15:42
|
#19
|
elite*gold: 0
Join Date: Oct 2006
Posts: 52
Received Thanks: 8
|
Nice,
but not much of a helpfull release since u need more than an npc with the item that is not implemented yet for people that do not have it u need more than that u need dds files like ItemMinIcon,MapItemIcon,texture & console scripts for items in ini and the txt files.
ex:
Code:
183305 SandRaider 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 00 00 2 2 1 675 0 Garment Fixed. 8
my problem is that i do not have the dds files because i havent been on real co since the release of 1.0
this is the npc i would use if it worked but then this item might not work 4 ervery1
Code:
#region SandRaider Garment 2soc -1 Seller SDG & SPG
case 666113:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Are you interested in this 2soc -1 SDG or SPG SandRaider Garment for 5kkCps?"));
GC.AddSend(Packets.NPCLink("SDG SandRaider", 1));
GC.AddSend(Packets.NPCLink("SPG SandRaider", 2));
GC.AddSend(Packets.NPCLink("No, thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (GC.MyChar.Inventory.Count < 40)
{
if (Control == 1)
{
if (GC.MyChar.CPs >= 5000000)
{
GC.MyChar.CPs -= 5000000;
GC.MyChar.AddItem(183305, 0, 0, 1, Game.Item.Gem.SuperDragonGem, Game.Item.Gem.SuperDragonGem);// NormalGoodLuck1
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("You don't have enough CPs, they cost 5kk each now come on!."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
if (Control == 2)
{
if (GC.MyChar.CPs >= 5000000)
{
GC.MyChar.CPs -= 5000000;
GC.MyChar.AddItem(183305, 0, 0, 1, Game.Item.Gem.SuperPhoenixGem, Game.Item.Gem.SuperPhoenixGem);// NormalGoodLuck1
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("You don't have enough CPs, they cost 5kk each now come on!."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
}
else
{
GC.AddSend(Packets.NPCSay("Your inventory is full."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
|
|
|
02/11/2010, 18:51
|
#20
|
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
|
Well them files have already been released so I don't need to put them on my thread.
If people got them files, then they can use my NPC.
If they don't, well, that's there fault.
|
|
|
02/12/2010, 06:20
|
#21
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Korvacs
If you break then you end that case, and the thread will continue to do whatever is after the switch, if anything, which is pointless really, if you use return then the thread returns from the method completely, instead of spending cpu time checking to see if it needs to do more work.
@DontLookDown:
I was fixing .Arco's completely broken npc which he posted.
|
Ah so in all retrospect, I should go through all the cases in the source and end them with return rather than break?
|
|
|
02/12/2010, 10:10
|
#22
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Correct.
|
|
|
02/13/2010, 00:07
|
#24
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Quote:
Originally Posted by .Arco
Ah so in all retrospect, I should go through all the cases in the source and end them with return rather than break?
|
If your worried about performance at all though you should also apply this to your chat commands, because atleast the npc dialogs are a switch, where as commands are not, however you can change commands over to be a switch aswell, its very simple to do.
|
|
|
02/13/2010, 00:10
|
#25
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Korvacs
If your worried about performance at all though you should also apply this to your chat commands, because atleast the npc dialogs are a switch, where as commands are not, however you can change commands over to be a switch aswell, its very simple to do.
|
Well item uses are a switch so should I not use the return?
|
|
|
02/13/2010, 00:24
|
#26
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Depends if theres processing to be done after the switch.
|
|
|
Similar Threads
|
ItemAdd.Ini with +15 items, 130 talis,+15 horses and SandRaider
06/14/2012 - CO2 PServer Guides & Releases - 12 Replies
The itemadd has all of te above. tell me if there are any files that u miss, ill upload'em.
|
How to add SandRaider Client 5165 (:
09/04/2010 - CO2 PServer Guides & Releases - 30 Replies
Well simply download this patch and put it in
your client folder and in OldCODB..
And just add a npc that gives u that item cuz i coudnt get it by command for some reason.
Well enjoy (:
MEGAUPLOAD - The leading online storage and file delivery service
|
SandRaider Item ID?
02/09/2010 - CO2 Private Server - 1 Replies
What is the SandRaider Item ID?
|
All times are GMT +2. The time now is 01:40.
|
|