P Server "NPC base code/shops/drop items" for who asked me 2 do it

07/09/2008 22:17 stephanyd#1636
Quote:
Originally Posted by Light200 View Post
i'd like to ask if theres a way to make a GM item like..weapon ^^
and galdik, i meant lolmaster ^^

lol, lemme test it on my server, i wanna see if it works, if you wanna try, heres my server dat and hamachi

make sure to back up your server dat, and my hamachi is

maverickonline
147896325

[Header]
GroupAmount=1
Group1=GroupPic9

[Group1]
ServerAmount=4
Server1=Qonquer
Ip1=69.41.179.99
Port1=9958
ServerName1=Qonquer
HintWord1=
Pic1=servericon33

Server2=Dragon
Ip2=5.11.4.76
Port2=9958
ServerName2=Maverick
HintWord2= Welcome to MaverickOnline
Pic2=servericon78

Server3=Chris
Ip3=208.104.139.200
Port3=9958
ServerName3=Test
HintWord3=
Pic3=servericon78

Server4=Dragon
Ip4=5.215.184.255
Port4=9958
ServerName4=Dragon
HintWord4=Test Server
Pic1=servericon33
How much puters u use?
07/09/2008 22:23 Light200#1637
why?
07/09/2008 22:27 stephanyd#1638
Quote:
Originally Posted by Light200 View Post
why?
just to know.. if u use only 1 puter ,how can u use a few ip... just curious. I'm trying to put 2 server but 2nd won't connect:confused:
07/09/2008 22:29 Light200#1639
uhh i use 1
and how do you use the /gm command? 0.o

btw adz, i tested your drop items, it works like a charm

except 1 prob
it all lands in 1 spot instead of dif areas

last probelm, can you explain the drops please? me and lolmaster intend on finishing it
1002-111329-0-0-0-0-0-30

like the numbers ?-?-?-?-?-?-?-?
07/09/2008 22:36 galdik#1640
lolz its funny when u pervade birds (template chars from svn) and they die one after another not like in CO all as they r killed and their souls come to ppl who killed them together instead one after another .... be4 50 mobs dies lol
I gonna run server next times with >> log.txt so I can pass error msg + I will add description :-D
the other part is if it will be usefull

another funny part u can attack guards with Inferno and pervade in Capture PK mode

will post on urs site
07/09/2008 22:42 tao4229#1641
Quote:
Originally Posted by Light200 View Post
adz, quoting from my last reply "is there a way to make gm items?"
if yes, do i make it in the additems ini?
LOL, first of all, for a scripter, you know nothing about INI files. If you mean ItemAdd.ini, that is the + info for the server, you would have to make a file in there if you wanted + to show on your new item, you would need to add the client side stuff(In Weapon.ini/itemtype.dat and all of the effects if you want it to glow, .dds files for textures and glow,(also ini files controlling glow(forgot)))It's pretty hard to add new items into the server. But knock yourself out.

Adz, great job on the drops =o
07/09/2008 22:53 InfamousNoone#1642
Quote:
Originally Posted by tao4229 View Post
Yeah, but we're not all as pro as you, so using INI NPCs is an easy way for n00bs like us to get something done.
Actually doing complex NPCs are MUCH easier to use a scripting interface instead of an INI interface. The INI interface is much harder to manage (both for a user to code, and for the server to process) verses normally coding it in C# :p

Quote:
Nice but I (as nooob) Can handle with MySLQ so i cant understand why not using my MySQL source and make it better .About Java server in java ?!?
Isnt c# better? Or cant i say "Better"?
As im a noob i wanna learn much but (noobs are silly and have Noob questinos) i have everytime problems lolz....
//////////////////////////////////////////////////////////////////////////////////////

SOMEONE CAN GIVE ME A WORKING SATAN CODE???
C# and Java are about in the same range, for instance;
Java is multi-platform, C# Isn't (well not fully)
C# has pointers, Java doesn't support them

So they all have their strong points but C++ > all.
INIs can be faster than MySQL, not the way hadeset did it; I'm being honest when I say as far as I know only I'm the only coder in the Conquer community who knows how to optimize INI's enough to beable to make them run faster than a MySQL connection would.
07/09/2008 22:55 adz06676#1643
Quote:
Originally Posted by tao4229 View Post
LOL, first of all, for a scripter, you know nothing about INI files. If you mean ItemAdd.ini, that is the + info for the server, you would have to make a file in there if you wanted + to show on your new item, you would need to add the client side stuff(In Weapon.ini/itemtype.dat and all of the effects if you want it to glow, .dds files for textures and glow,(also ini files controlling glow(forgot)))It's pretty hard to add new items into the server. But knock yourself out.

Adz, great job on the drops =o
Thanks but i'm stuck now when you spawntogold (money instead of an item) The client crashes i swear to god i cant figure out the prob here is the coding:
Quote:
public static void SurroundDroppedItems(Client MyClient, bool Check)
{
try
{
IDictionaryEnumerator en = ItemHandler.ItemDrops.GetEnumerator();

if (Check == true)
{

while (en.MoveNext())
{
ItemHandler.DroppedItem TheItem = (ItemHandler.DroppedItem)en.Value;


if (MyClient.Online)
if (MyMath.PointDistance(MyClient.MyChar.PrevX, MyClient.MyChar.PrevY, TheItem.PosX, TheItem.PosY) > 14)
if (MyMath.PointDistance(MyClient.MyChar.PosX, MyClient.MyChar.PosY, TheItem.PosX, TheItem.PosY) < 14)
if (TheItem.Map == MyClient.MyChar.PosMap)
{
byte[] Pack = ThePackets.DropAnItem(TheItem.UID, TheItem.IID, TheItem.PosX, TheItem.PosY);

MyClient.SendPacket(Pack);
}
}
}
else
{
while (en.MoveNext())
{
ItemHandler.DroppedItem TheItem = (ItemHandler.DroppedItem)en.Value;
if (MyClient.Online)
if (TheItem.Map == MyClient.MyChar.PosMap)
{
byte[] Pack = ThePackets.DropMoney(TheItem.PosX, TheItem.PosY, TheItem.UID, TheItem.IID);
MyClient.SendPacket(Pack);
}
}
}
}
catch (Exception j) { Console.WriteLine(j); }
}
as you can see where the drop money part is, where it says TheItem.IID i have also tried TheItem.Silvers i cant figure it out. Should if be else if i dont get this at all x.x
07/09/2008 22:59 InfamousNoone#1644
>___> Item's are intresting, they require a field in your dropped item structure with the value of the gold. You decide on the ItemID based by the quantity, take guesses or check a coemu source, I don't have them anymore
07/09/2008 23:07 adz06676#1645
Quote:
Originally Posted by InfamousNoone View Post
>___> Item's are intresting, they require a field in your dropped item structure with the value of the gold. You decide on the ItemID based by the quantity, take guesses or check a coemu source, I don't have them anymore
Quote:
case 2:
{
int icon;
if (silver <= 10) { icon = 1090000; }
else if (silver <= 150) { icon = 1090010; }
else if (silver <= 1000) { icon = 1090020; }
else if (silver <= 3500) { icon = 1091010; }
else { icon = 1091020; }

DroppedItem TheDrop = new DroppedItem(x, y, map, item, silver, 0, plus, bless, enchanct, firstsoc, secsoc, uid);
ItemDrops.Add(uid, TheDrop);
//DropClient.SendPacket(ThePackets.DropMoney(x, y, uid, icon));
IDictionaryEnumerator en = WorldHandler.AllClients.GetEnumerator();
while (en.MoveNext())
{
Client CClient = (Client)en.Value;
if (CClient.Online)
if (MyMath.PointDistance(x, y, CClient.MyChar.PosX, CClient.MyChar.PosY) + 0.01 < 14)
{
byte[] Pack = CClient.ThePackets.DropMoney(x, y, uid, icon);
CClient.SendPacket(Pack);
}
}
DropClient.MyChar.CurHP += 0;
DropClient.SendPacket(ThePackets.Vital2((long)Drop Client.MyChar.UID, DropClient.MyChar.CurHP));
DropClient.MyChar.Silvers -= silver;
DropClient.SendPacket(ThePackets.Vital((long)DropC lient.MyChar.UID, 4, DropClient.MyChar.Silvers));
break;
}

}
}
Has that but im still not sure.
07/09/2008 23:15 imunknown#1646
Adz it doesn't save the ItemID of the Gold in the ItemDrops hashtable, it figures it out as its dropping via
Code:
int icon;
if (silver <= 10) { icon = 1090000; }
else if (silver <= 150) { icon = 1090010; }
else if (silver <= 1000) { icon = 1090020; }
else if (silver <= 3500) { icon = 1091010; }
else { icon = 1091020; }
What noob did that? oh wait, that was me, crap :mad:

my guess is if you put 1090000 in your gold drop as the IID, it would work, showing silver on the ground.
07/09/2008 23:20 tao4229#1647
Quote:
Originally Posted by InfamousNoone View Post
Actually doing complex NPCs are MUCH easier to use a scripting interface instead of an INI interface. The INI interface is much harder to manage (both for a user to code, and for the server to process) verses normally coding it in C# :p



C# and Java are about in the same range, for instance;
Java is multi-platform, C# Isn't (well not fully)
C# has pointers, Java doesn't support them

So they all have their strong points but C++ > all.
INIs can be faster than MySQL, not the way hadeset did it; I'm being honest when I say as far as I know only I'm the only coder in the Conquer community who knows how to optimize INI's enough to beable to make them run faster than a MySQL connection would.
I believe you are over-estimating the noob population, half of these people don't even know how to recompile a server.(No offense D=) But If I knew how to set up an NPC and just code it in C#, then i probably would. But right now i don't have the correct knowledge to do so. I know what you mean when you say it's easier on complex NPC's, for example: The Guy who creates guilds.
With the Dialog.ini there's no way you can create the text box to make your guild. But, I'm still watching your video tutorials(Hopefully i'll be able to follow them on more complex things)so... If you are going to show how to make a 5016-- Server, My eyes will be open.
07/09/2008 23:35 Light200#1648
Quote:
Originally Posted by adz06676 View Post
Has that but im still not sure.
so uhh....about the drops...can you explain what orders they are in so me and lolmaster can make more?
07/09/2008 23:42 InfamousNoone#1649
I fixed it, I win :p

@My lessons things:

I'm getting into pointers next, and will explain why hadeset's next source will fail (LOL, Yes it relates to pointers). Then I'm going to introduce socket programming.
07/09/2008 23:54 adz06676#1650
Quote:
Originally Posted by InfamousNoone View Post
I fixed it, I win :p

@My lessons things:

I'm getting into pointers next, and will explain why hadeset's next source will fail (LOL, Yes it relates to pointers). Then I'm going to introduce socket programming.
Yep ^ he fixed it i just noticed 1 small problem, every item that drops on the floor now looks like gold i think i can fix.