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

07/11/2008 04:01 Some-Guy#1786
Quote:
Originally Posted by scottdavey View Post
Anyway try this i don't think you seen it because i edited it after you replyed
Code:
                if (Splitter[0] == "/rev")
                {
                    [b]if (TheClient.MyChar.Alive == false)
                    {[/b]
                        TheClient.SendPacket(ThePackets.RemoveEntity((uint)TheClient.MyChar.UID));
                        TheClient.SendPacket(ThePackets.SomePacket((long)TheClient.MyChar.UID, 0));
                        TheClient.SendPacket(ThePackets.SomePacket3((long)TheClient.MyChar.UID));
                        TheClient.SendPacket(ThePackets.Status(TheClient.MyChar, 1, 0, 26));
                        TheClient.MyChar.CurHP = TheClient.MyChar.MaxHP;

                        TheClient.MyChar.Alive = true;
                        WorldHandler.SpawnMeToOthers(TheClient,false);

                        TheClient.SendPacket(ThePackets.CharacterInfo(TheClient.MyChar));
                        TheClient.MyChar.SendEquips2();

                        TheClient.SendPacket(ThePackets.Vital((long)TheClient.MyChar.UID, 9, 100));
             
                        TheClient.SendPacket(ThePackets.Vital2((long)TheClient.MyChar.UID,TheClient.MyChar.CurHP));
                    [b]}[/b]
                }
A little validation never hurts :D Prevents abusing this in order to get full hp and mp, useful if you have other people playing.
07/11/2008 04:50 §hadow§age#1787
Quote:
Originally Posted by imunknown View Post
you want something like a
Code:
/seen username
command that shows if there online, or last time on kinda deal? or are you looking for a full list of current users online? Sorry if you've already answered this, its late and Im lazy :p
no i have that already.... but im missing a very small part of the puzzle =(
07/11/2008 04:59 inburst#1788
Quote:
Originally Posted by ammunation View Post
k ive looked at a lot of pages and cant seem to find this although i know the information is here this is kind of a last resort
[1611]
face=9
txt0=Which items would you like to trade for a reward?
opt0=10 SunDiamonds for 5 mets-10 MoonDiamonds for 10 mets-15 StarDiamonds for 1 Dragonball-15 CloudDiamonds for 1 Dragonball and 1 AncestorBox
req=item,721533,0,0,0,0,0,10-item,721534,0,0,0,0,0,10-item,721535,0,0,0,0,0,15-item,721536,0,0,0,0,0,15
rew=item,1088001,0,0,0,0,0,5-item,1088001,0,0,0,0,0,10-item,1088000,0,0,0,0,0,1-item,1088000,0,0,0,0,0,1

where am i going wrong

i also noticed when i tried to spawn items using my compiled version i have to use the next item in the list to spawn the previous for example clouddiamond spawns me a stardiamond and star spawns a moon and so on think i need a fixed one


Ill release my full npc diag file when im done so far ive done birth village some of tc and some of market
this isnt working because you got to end it with a nothing opt, one to leave thats why you arent getting any rew with it, try it should work then
07/11/2008 06:12 Tangaroa#1789
This code is for working met/db scrolls. Put it in your Equip.cs

Quote:
#region DBMetScrolls
case 720027:
{

Random Xx = new Random();
int ItemInInv = 0;
for (int coun = 0; coun < TheClient.MyChar.Inventory.Length; coun++)
{
if (TheClient.MyChar.Inventory[coun] != null)
ItemInInv++;
}
Console.WriteLine("inv lenght {0}", ItemInInv);
if (ItemInInv <= 30)
{
for (int db = 0; db < 10; db++)
{
long idd = (long)(1000 + Xx.Next(16777215));
TheClient.MyChar.AddAnItem("1088001-0-0-0-0-0", 0, true, idd, false);
}
}
else
{
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, "Please free 10 slots!", 2014));
goto NotFree;
}
break;
}
case 720028:
{

Random Xx = new Random();
int ItemInInv = 0;
for (int coun = 0; coun < TheClient.MyChar.Inventory.Length; coun++)
{
if (TheClient.MyChar.Inventory[coun] != null)
ItemInInv ++;
}
Console.WriteLine("inv lenght {0}", ItemInInv);
if (ItemInInv <= 30)
{
for (int db = 0; db < 10; db++)
{
long idd = (long)(1000 + Xx.Next(16777215));
TheClient.MyChar.AddAnItem("1088000-0-0-0-0-0", 0, true, idd, false);
}
}
else
{
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, "Please free 10 slots!", 2014));
goto NotFree;
}
break;
}
#endregion
07/11/2008 06:25 Tangaroa#1790
Adding a Auto-Restarter.
Open TheMain.cs then follow the steps
First search for:
Quote:
Timer SaveTimer = new Timer();
Below that add:
Quote:
Timer RestartTimer = new Timer();
Go down about 17 lines down to you see this:
Quote:
ItemHandler.LoadAllDrops();
Below that add:
Quote:
RestartTimer.Interval = 15000000;
RestartTimer.Tick += new EventHandler(RestartTimer_Tick);
RestartTimer.Start();
You can change the interval depending on how long you want it to restart. Atm its set to 5 hours.
Now last thing scroll down to you see:
Quote:
void SaveTimer_Tick(object sender, EventArgs e)
Above that add this:
Quote:
void RestartTimer_Tick(object sender, EventArgs e)
{
RestartTimer.Stop();
WorldHandler.SaveAllChars();
Console.WriteLine("Server is now restarting!");

System.Diagnostics.Process.Start("restart.exe");
Environment.Exit(0);
RestartTimer.Start();
}
Save recompile it. then run. your restarter is now activated ;)
07/11/2008 06:33 Tangaroa#1791
Adding login server messages.
Open Login.cs
Search for this:
Quote:
Console.WriteLine("YourGuild {0}", CG);
A few lines above that you will see the login server message.
Bellow that add these:

Quote:
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, ("MESSAGE HERE!"), 2000));
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, ("MESSAGE HERE!"), 2000));
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, ("MESSAGE HERE!"), 2000));
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId, "System", TheClient.MyChar.CharName, ("MESSAGE HERE!"), 2000));
You can put your server updates on here so people can read them when they log in.

Cheers
07/11/2008 06:56 zane203#1792
Quote:
Originally Posted by samehvan View Post
fixed


yea i got ur point and u are r8 it became little confusing ,seems we are goin en a very different ways here so i think i should stop releasing ,that will help u to concentrate on one edits (the Revs one)



i dunno tell now what is the different in there ,ADZ knows coz he is the updater so he is the only one who can add them ,or it will be a miss there



no , the vista system cant deal with the server packets ATM .
Oi dont stop releasing O_o you cant take out the person who started the whole thing! I personally think you should just join up with Adz, and Gfun. You're on the team anyway O_o i say just try to compile your source with the Rev sources. No reason to let someone fall off right? =) a member of the team is a member regardless.

Dont stop man, but dont go it alone either.
07/11/2008 07:53 12it123#1793
Alright I'm Using Rev4B and I can't seem to get the exp to work in the server.ini file leveling is set to 1.What I do it go back to level 1 and try killing pheasents but that doesn't give me exp.The EXP balls do give me exp tho.Also I don't know why but every time I try to add more drops (Dragonball,Expball) it crashes the server.Can Anybody help? I know a bit of C# :D Btw Thanks For the Source.
07/11/2008 08:15 stephanyd#1794
How to learn skills from skillbooks from market or NightDevil skillbookfound from a mob for normal player?:confused:
07/11/2008 08:24 12it123#1795
Quote:
Originally Posted by stephanyd View Post
How to learn skills from skillbooks from market or NightDevil skillbookfound from a mob for normal player?:confused:
I belive that would be coded in the equip.cs altho I see no point as in most skills don't work but i'm not so good at C# I just started learning but I belive it would be coded just like the moneybags and exp balls just that it would give a skill instead of money/exp.BTW does rev4B have exp working? I'm going to try out the source.rar samhav posted see if that works.If anyone's interested i'll try to code it ^^.
07/11/2008 08:47 lawlxx#1796
Eh, tangaroa's codes screwed up my source...now i gotta start all over >_>

@adz, the rev doesnt fix my mana...i added everything but it still doesnt work...something im doing wrong? =/
07/11/2008 09:44 adz06676#1797
Quote:
Originally Posted by zane203 View Post
Oi dont stop releasing O_o you cant take out the person who started the whole thing! I personally think you should just join up with Adz, and Gfun. You're on the team anyway O_o i say just try to compile your source with the Rev sources. No reason to let someone fall off right? =) a member of the team is a member regardless.

Dont stop man, but dont go it alone either.
I think all he ment was for me to add his updates to the source, he won't quit don't worry about that.

Quote:
Originally Posted by lawlxx View Post
Eh, tangaroa's codes screwed up my source...now i gotta start all over >_>

@adz, the rev doesnt fix my mana...i added everything but it still doesnt work...something im doing wrong? =/
Yes
07/11/2008 09:50 lawlxx#1798
Gahh, tellzzzzz lol.

>.o
07/11/2008 09:56 samehvan#1799
Quote:
Originally Posted by zane203 View Post
Oi dont stop releasing O_o you cant take out the person who started the whole thing! I personally think you should just join up with Adz, and Gfun. You're on the team anyway O_o i say just try to compile your source with the Rev sources. No reason to let someone fall off right? =) a member of the team is a member regardless.

Dont stop man, but dont go it alone either.
i am not quitting but , i asked to arrange a meeting so we can know how we will go on (as a team that should be) tell now that ddnt happen ,then i said i dd the drop rate but i figure out that the REV has another one ,the point is that will make 2 functions and tooooo many unuseful Vars ,i cant follow the new files and they surely will had a very hard time when i just release anynew adds coz they will have to check every line to c which are the new lines or edits that will be awful ,the disaster will be if we both create a Func or Var with the same name ,

they are doin a great work we all should appreciate that ,and i am the one u can blame coz my short free time ,
when i started this thread i though about helping ppl not confusing them but now i just feel i do confuse them , the edits they do are very helpful and fine so i think it is the time to be a normal user after all :D
07/11/2008 10:04 samehvan#1800
Quote:
Originally Posted by 12it123 View Post
I belive that would be coded in the equip.cs altho I see no point as in most skills don't work but i'm not so good at C# I just started learning but I belive it would be coded just like the moneybags and exp balls just that it would give a skill instead of money/exp.BTW does rev4B have exp working? I'm going to try out the source.rar samhav posted see if that works.If anyone's interested i'll try to code it ^^.
yes it is there , at Equip.cs u will find that Func

private void UseItem_(long ItemUID)


under it u will find lines in cases order by the item ID, so u will only need to add somethings like that

Code:
case <put ur skill book itemID here>:
{
TheClient.MyChar.SkillAdd(skill id,skill lvl);
break;
}