I Don't Wanna Be Leecher and ask gimme this gimme this but I Have One Question, and I Hope you will help me.. Its about my Pserver... I Would Like To Add Some NPC Which will give super +12 items 2sct with super gems.. But as i can see, on my Character.cs , only its declared additem as (ITEMID,Plus) CODE:
Code:
public void[B] AddItem[/B]([I]uint ID, byte Plus[/I])
this is what i got into characters.cs :
Quote:
public void AddItem(uint ID, byte Plus)
{
Item I = new Item();
I.Plus = Plus;
I.ID = ID;
I.UID = (uint)Rnd.Next(10000000);
I.MaxDur = I.DBInfo.Durability;
I.CurDur = I.MaxDur;
if (I.UID == 0)
{
I.UID = (uint)Rnd.Next(10000000);
}
So I Know How To Make a NPC Which Gives Super Items +12 but no clue how should I Public AddItem(uint ID,byte Plus,byte soc1,byte soc2) cause I'm not that good "Coder" !
Here is the NPC Code For +12 Items
Code:
Code:
#region MyNpc7
case 412345:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, Welcome To Your God ! I Will Give You Free Items If You Are 70lvl +"));
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());
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("I can gift you with some gear of specified profesion"));
GC.AddSend(Packets.NPCLink("FireTao L70 pack", 2));
GC.AddSend(Packets.NPCLink("WaterTao L70 pack", 3));
GC.AddSend(Packets.NPCLink("Warrior L70 pack", 4));
GC.AddSend(Packets.NPCLink("Trojan L70 pack", 5));
GC.AddSend(Packets.NPCLink("Archer L70 pack", 6));
GC.AddSend(Packets.NPCLink("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 <= 0)
{
GC.AddSend(Packets.NPCSay("Welcome To My Seller But ur not lvl 70 yet!"));
GC.AddSend(Packets.NPCLink("Damn.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 2)
{
GC.MyChar.AddItem(134069, 12); //Robe
GC.MyChar.AddItem(117069, 12); //Earring
GC.MyChar.AddItem(152129, 12); //brac
GC.MyChar.AddItem(121129, 12); //Bag
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //Fan
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 3)
{
GC.MyChar.AddItem(134069, 12); //Robe
GC.MyChar.AddItem(117069, 12); //Earring
GC.MyChar.AddItem(152129, 12); //brac
GC.MyChar.AddItem(121129, 12); //Bag
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //Fan
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 4)
{
GC.MyChar.AddItem(131069, 12); //Robe
GC.MyChar.AddItem(117069, 12); //Earring
GC.MyChar.AddItem(120129, 12); //Neck
GC.MyChar.AddItem(150139, 12); //Ring
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //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 if (Control == 5)
{
GC.MyChar.AddItem(130069, 12); //Robe
GC.MyChar.AddItem(117069, 12); //Earring
GC.MyChar.AddItem(120129, 12); //Neck
GC.MyChar.AddItem(150139, 12); //Ring
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //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 if (Control == 6)
{
GC.MyChar.AddItem(133049, 12); //Robe
GC.MyChar.AddItem(117069, 12); //Earring
GC.MyChar.AddItem(120129, 12); //Neck
GC.MyChar.AddItem(150139, 12); //Ring
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //Fan
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 7)
{
GC.MyChar.AddItem(135069, 12); //Robe
GC.MyChar.AddItem(112069, 12); //Earring
GC.MyChar.AddItem(120129, 12); //Neck
GC.MyChar.AddItem(150139, 12); //Ring
GC.MyChar.AddItem(160139, 12); //boots
GC.MyChar.AddItem(202009, 12); //Star
GC.MyChar.AddItem(201009, 12); //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 if (Control == 8)
{
GC.MyChar.AddItem(421139, 12); //BS
GC.MyChar.AddItem(420139, 12); //S
GC.MyChar.AddItem(410139, 12); //B
GC.MyChar.AddItem(480139, 12); //C
GC.MyChar.AddItem(561139, 12); //W
GC.MyChar.AddItem(560139, 12); //SP
GC.MyChar.AddItem(601139, 12); //k
GC.MyChar.AddItem(500129, 12); //Bo
GC.AddSend(Packets.NPCSay("Here you are."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
Make a new function that does what you want, or modify existing function to support your params.
Yea,Thats what im talkin' in my thread.. I Could'nt do that,could you give me some example how should new function look? Cause i guess im not that good at C# , must to read some more tuts...
My Source is kinda different.. Cant Make it like it needs.... Im gooonna attach it here,writing from my notebook so sorry if i make some grammar mistakes !
Oh Thanks Alot.. Btw, someone have ID's from AllGems?
EDIT:
Can someone help me about something? I wanna make, on each killed birdman player who killed the birdman get 50cp's , and for Turtledoves 25cps.. Can someone tell me how ?
For cps from monster just go to where final monster death is (should be something like kill( or w/e) and run your calculation on how you want to award cp. Personally I prefer random chance + difference in player/mob levels but if you want just standard rate across a certain mob you could do something like..
For cps from monster just go to where final monster death is (should be something like kill( or w/e) and run your calculation on how you want to award cp. Personally I prefer random chance + difference in player/mob levels but if you want just standard rate across a certain mob you could do something like..
For cps from monster just go to where final monster death is (should be something like kill( or w/e) and run your calculation on how you want to award cp. Personally I prefer random chance + difference in player/mob levels but if you want just standard rate across a certain mob you could do something like..
BAD. Do it by id, not by strings. Little things like that is why most servers nowadays can't handle more than 10 people. Each action someone takes invokes like 100000 memory operations and 500 functions.
BAD. Do it by id, not by strings. Little things like that is why most servers nowadays can't handle more than 10 people. Each action someone takes invokes like 100000 memory operations and 500 functions.
I remember reading a long time ago about this topic just to clarify it all, strings are nearly ten times slower than indexes. So yeah, use them as little as possible =p
Let Me Upload you the MOB.CS ,and someone who will have time, would change something in it! If you need something else exsept mob.cs , just REPLY! I Can't make it work :S
Uploaded Mob.cs and Character.cs ! Please modify them if you have some time
Edit: Bone-You, and Emme Coder, You're right, reading indexes is faster than reading strings