this is for both lotf and coemu
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 XpSkill [CoEmu v2]

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin


Posts : 56
Join date : 2009-08-20

PostSubject: XpSkill [CoEmu v2]   Thu Aug 20, 2009 11:40 pm

CREDITS TO 12tail

Hello....

before all... thanks to all helped me whith it... speacialy samehven.... many private mensages to him.... but here we go....

at Nano.cs find : public static OpenSSL.DH ServerKey;

bellow it add:

Code:
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();

then go to the public static void StartServer().... is at nano.cs too
you will see something like this:

Code:
public static void StartServer()
      {
         GenerateKey();
         Struct.LoadItems("items.txt");
         Struct.LoadItemPluses("itemadd.ini");
         Struct.LoadMaps();
         Struct.LoadMonsters();
         Struct.LoadNpcs();
         Struct.LoadPortals();
         Struct.LoadServerskills();
         Struct.LoadTNpcs();

bellow Struct.LoadTNpcs();... add this:

Code:
GlobalTimer.Interval = 1000;
            GlobalTimer.Elapsed += delegate
            {
                foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
                {
                    ClientSocket CSocket = Clients.Value;
                    CSocket.Client.XpSkillCounter += 1000;
                    if (CSocket.Client.XpSkillCounter == 340000)
                    {
                        CSocket.Client.XpSkillCounter = 0;
                        CSocket.Client.XpTime = true;
                        CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
                    }
                }
            };
            GlobalTimer.Start();

now go to the Packets/Status.cs

you will see something like this:

Code:
if(CSocket.Client.Flashing)
                     Status += 0x1;
                  if(CSocket.Client.Stigged)
                     Status += 0x200;
                  if(CSocket.Client.SuperMan)
                            Status += 0x262144;
                  if(CSocket.Client.Cyclone)
                            Status += 0x8388608;
                        if (CSocket.Client.Poisoned)
                            Status += 0x2;

then... add this bellow the posioned:

Code:
if (CSocket.Client.XpTime)
                            Status += 0x10;

Edit:
like you asked samehven

in Character.cs put the definitions:

Code:
public int XpSkillCounter = 0;
public bool XpTime = false;

them go to Handlers/Attack.cs
you will find a region called #region Checks add before or after it

Code:
if (MagicID == 1110 || MagicID == 1025 || MagicID == 6010)
            {
                XpSkill(CSocket, MagicID);
            }

At the very bottom of that class add this void

Code:
public static void XpSkill(ClientSocket CSocket, int SkillId)
        {
            CSocket.Client.XpTime = false; CSocket.Client.XpSkillCounter = 0;
            CSocket.Send(ConquerPacket.Status(CSocket, 2, 0, Struct.StatusTypes.StatusEffect));
            switch (SkillId)
            {
                case 1025://SuperMan
                    {
                        CSocket.Client.SuperMan = true;
                        CSocket.Send(ConquerPacket.Status(CSocket, 2, 262144, Struct.StatusTypes.StatusEffect));
                        break;
                    }
                case 1110://Cyclone
                    {
                        CSocket.Client.Cyclone = true;
                        CSocket.Send(ConquerPacket.Status(CSocket, 2, 8388608, Struct.StatusTypes.StatusEffect));
                        break;
                    }
                case 6010://Vortex Ninja
                    {
                     
                        break;
                    }
            }
        }

Save/debug ur project (F5)...

and if you wan't a code to start the xpskill whith the PM/GM here is....

at Chat.cs seach for case "cyclone"... and below it add:


Code:
case "superman":
                            {
                                if (CSocket.Client.isGM || CSocket.Client.isPM)
                                {
                                    CSocket.Client.SuperMan = true;
                                    CSocket.Send(ConquerPacket.Status(CSocket, 2, 262144, Struct.StatusTypes.StatusEffect));
                                }
                                break;
                            }
                        case "xp":
                            {
                                if (CSocket.Client.isGM || CSocket.Client.isPM)
                                {
                                    CSocket.Client.XpTime = true;
                                    CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
                                }
                                break;
                            }

Edit 2 (By: samehven):

A- add 2 variables at Character.cs named for example

Code:
public short XpToEnd=0;
public short XpStarted=0;

B- when the xpskill starts add the max time for it, if it will last for 40 seconds then

Code:
CSocket.Client.XpToEnd=40;
CSocket.Client.XpStarted=1;

C- At Nano.cs /the globaltimer elapsed add this

Code:
if (CSocket.Client.XpStarted>0)
{
CSocket.Client.XpStarted+=1;
if (CSocket.Client.XpStarted>=CSocket.Client.XpToEnd)
{
CSocket.Client.XpStarted=0;CSocket.Client.XpTime = false;
CSocket.Client.Cyclone = false;
//Add here all other XpSkills u have and need to be ended
}
}

tkx again ^^

CYA!
Back to top Go down
View user profile http://openprojects.forumotions.net
 
XpSkill [CoEmu v2]
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
lotf/coemu project :: Codes-
Jump to: