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

06/07/2008 13:32 L1nk1n*P4rK#121
Isnt work, my Login.txt look:

Code:
[color=green]using System;
using System.Collections.Generic;
using System.Text;

namespace TheCOServer.ClientRequests
{
    public class Login : Base
    {
        byte[] Data;
        Client TheClient;
        Packets ThePackets = new Packets();

        public Login(byte[] Dat, Client TehClient)
        {
            Data = Dat;
            TheClient = TehClient;
            DoIt();
        }

        void DoIt()
        {
            if (!TheClient.InWorld)
            {
                byte[] Pack;
                Pack = ThePackets.The89(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheA4(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.The5604(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheStamina(true);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheMinimap(true);
                TheClient.SendPacket(Pack);

                TheClient.MyChar.SendEquips();
                TheClient.MyChar.SendInventory();

                TheClient.SendPacket(ThePackets.SendMsg(TheClient.MessageId,"Server";
                TheClient.MyChar.CharName, "Welcome to ShadowCo enjoy your stay.", 200));

                byte[] pack = ThePackets.Vital((long)TheClient.MyChar.UID, 9, 100);
                TheClient.SendPacket(pack);

                WorldHandler.SpawnMeToOthers(TheClient, false);
                WorldHandler.SpawnOthersToMe(TheClient, false);
                WorldHandler.SurroundMobs(TheClient, false);
                WorldHandler.SurroundNPCs(TheClient, false);

                pack = ThePackets.GeneralData((long)(TheClient.MyChar.UID), 3, 0, 0, 96);
                TheClient.SendPacket(pack);

                TheClient.MyChar.SkillAdd(7020, 9);
                TheClient.MyChar.SkillAdd(5030, 4);
                TheClient.MyChar.SkillAdd(1025, 1);
                TheClient.MyChar.SkillAdd(1045, 4);
                TheClient.MyChar.SkillAdd(1046, 4);
                //TheClient.MyChar.SkillAdd(1115, 4);
                TheClient.MyChar.SkillAdd(8001, 5);
                TheClient.MyChar.SkillAdd(5010, 9);
             
                pack = ThePackets.Vital2((long)TheClient.MyChar.UID, TheClient.MyChar.CurHP);
                TheClient.SendPacket(pack);
                TheClient.InWorld = true;

                Console.WriteLine("Def: "+TheClient.MyChar.Defense);
            }            
        }
    }
}[/color]

What is rongh? Sry i just start to learn to code.

Thnx for your help.
06/07/2008 13:56 adz06676#122
Quote:
Originally Posted by L1nk1n*P4rK View Post
Isnt work, my Login.txt look:

Code:
[color=green]using System;
using System.Collections.Generic;
using System.Text;

namespace TheCOServer.ClientRequests
{
    public class Login : Base
    {
        byte[] Data;
        Client TheClient;
        Packets ThePackets = new Packets();

        public Login(byte[] Dat, Client TehClient)
        {
            Data = Dat;
            TheClient = TehClient;
            DoIt();
        }

        void DoIt()
        {
            if (!TheClient.InWorld)
            {
                byte[] Pack;
                Pack = ThePackets.The89(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheA4(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.The5604(TheClient.MyChar);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheStamina(true);
                TheClient.SendPacket(Pack);

                Pack = ThePackets.TheMinimap(true);
                TheClient.SendPacket(Pack);

                TheClient.MyChar.SendEquips();
                TheClient.MyChar.SendInventory();

                TheClient.SendPacket(ThePackets.SendMsg(TheClient.MessageId,"Server";
                TheClient.MyChar.CharName, "Welcome to ShadowCo enjoy your stay.", 200));

                byte[] pack = ThePackets.Vital((long)TheClient.MyChar.UID, 9, 100);
                TheClient.SendPacket(pack);

                WorldHandler.SpawnMeToOthers(TheClient, false);
                WorldHandler.SpawnOthersToMe(TheClient, false);
                WorldHandler.SurroundMobs(TheClient, false);
                WorldHandler.SurroundNPCs(TheClient, false);

                pack = ThePackets.GeneralData((long)(TheClient.MyChar.UID), 3, 0, 0, 96);
                TheClient.SendPacket(pack);

                TheClient.MyChar.SkillAdd(7020, 9);
                TheClient.MyChar.SkillAdd(5030, 4);
                TheClient.MyChar.SkillAdd(1025, 1);
                TheClient.MyChar.SkillAdd(1045, 4);
                TheClient.MyChar.SkillAdd(1046, 4);
                //TheClient.MyChar.SkillAdd(1115, 4);
                TheClient.MyChar.SkillAdd(8001, 5);
                TheClient.MyChar.SkillAdd(5010, 9);
             
                pack = ThePackets.Vital2((long)TheClient.MyChar.UID, TheClient.MyChar.CurHP);
                TheClient.SendPacket(pack);
                TheClient.InWorld = true;

                Console.WriteLine("Def: "+TheClient.MyChar.Defense);
            }            
        }
    }
}[/color]

What is rongh? Sry i just start to learn to code.

Thnx for your help.
You see where you wrote "200" its "2000" like so:

Quote:
TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId,"Server";
TheClient.MyChar.CharName, "Welcome to ShadowCo enjoy your stay.", 2000));
06/07/2008 14:03 samehvan#123
[quote]
Quote:
Originally Posted by adz06676 View Post
I remember you helping me with the Item one here it is if you didn't save it.
i dd save it , i just wanted all to know how to do it , so it will be more useful also i wanted them to know that u are doin good efforts :P

Quote:
Not quite sure how too add the number of items needed but i'll give it a shot in a sec.
just do a loop for the add item code with the number.length

Quote:
Edit: Hmm what skills are you going too implement?
i need a text file with all magic skills or Ini one
sure we can code it on the source itself , but i prefer include them on a txt/ini file so everyone can edit/add what he wants even if he is not good C# user

Quote:
Edit2:If people are getting annoyed by the inventory bug i found a temporary solution remove this line from Login.cs then build it:
clear the inv line at his Charactername.chr is much easier i think

Quote:
Originally Posted by L1nk1n*P4rK View Post
Isnt work, my Login.txt look:

TheClient.SendPacket(ThePackets.SendMsg(TheClient. MessageId,"Server";
TheClient.MyChar.CharName, "Welcome to ShadowCo enjoy your stay.", 200));

What is rongh? Sry i just start to learn to code.

Thnx for your help.
it should work , but notice that it will appear on the top left screen with white color if , the number is 2000 will be at the bottom with yellow color i am sure u need it at center r8? :D
06/07/2008 14:18 adz06676#124
[quote=samehvan;1167769]
Quote:

i dd save it , i just wanted all to know how to do it , so it will be more useful also i wanted them to know that u are doin good efforts :P



just do a loop for the add item code with the number.length



i need a text file with all magic skills or Ini one
sure we can code it on the source itself , but i prefer include them on a txt/ini file so everyone can edit/add what he wants even if he is not good C# user



clear the inv line at his Charactername.chr is much easier i think



it should work , but notice that it will appear on the top left screen with white color if , the number is 2000 will be at the bottom with yellow color i am sure u need it at center r8? :D
Oh thanks =p

And about the clear inv at the character if we did that we wouldn't be able too use the inventory at all:p

So i think my way is just a temporary fix till we know what exactly is causing the peoblem. =p

Quote:
just do a loop for the add item code with the number.length
I'm not quite sure how to do that lol , sorry for the noobishness XD

I'll try but i doubt i can do it lol.


Oh btw do you have a release date in mind for your next update?
06/07/2008 14:20 L1nk1n*P4rK#125
Quote:
Originally Posted by samehvan View Post

it should work , but notice that it will appear on the top left screen with white color if , the number is 2000 will be at the bottom with yellow color i am sure u need it at center r8? :D
No down at Whisper,Team and etc :)
06/07/2008 14:22 adz06676#126
Quote:
Originally Posted by L1nk1n*P4rK View Post
No down at Whisper,Team and etc :)
yeah if ya want it at bottom left its 2000 if you want it in the center its 2011
06/07/2008 14:46 samehvan#127
Quote:
Originally Posted by adz06676 View Post
yeah if ya want it at bottom left its 2000 if you want it in the center its 2011
yea r8 ,
and BTW u may code a timer for tips and hints by that
06/07/2008 14:53 adz06676#128
Quote:
Originally Posted by samehvan View Post
yea r8 ,
and BTW u may code a timer for tips and hints by that
Yeah could you give me an example i have actually tried but it don't work when i do it i need ur pro skillz plx? :p
06/07/2008 16:47 zane203#129
sorry to kinda bring this back up lol, does anyone know how to edit the 1st picture when starting the client?
06/07/2008 17:43 L1nk1n*P4rK#130
why the players can login???they have the same Server.dat like me the only i can connect. why??
what posrt i need to use b cuz on 9958 they cant connect
06/07/2008 18:09 ~*NewDuuDe*~#131
@samehvan
hows it goin on the mana ? :P
Though as its still a pk server i would suggest guilds first
06/07/2008 20:18 Bottingpunk#132
heyy where can i make a website and how do i make my server account creater thingy create accounts without me doing it
06/07/2008 20:23 ~Yuki~#133
W8 till SAMEHAVANS post he add it then ^^
06/07/2008 20:33 ~*NewDuuDe*~#134
me n lolmaster are going to add +12
I tried to copy the additem.ini from the co2 folder(im usn the newest patch)
and paste it into the source
but this didnt rlly work
we can get +12 but it isnt adding any attack when u do it
so what to do?
06/07/2008 20:52 ~Yuki~#135
So!
Lemme tell ya all something!
SAMEHVAN is working hard dont ask him at every post :is this done or that ready,...
He is busy and he works ard for us!
SO LEAVE EM ALONE COZ he will release all if he is done with!

Btw SAMHVAN add moving,attacking,dropping Mobs first then ->exp->lvlup->mana->skillz