[Release]2 NPCS

05/24/2009 16:10 ih8you#16
Lol im new too, You add these to Client.cs where the npcs are...

The dialog goes where the NPC dialog is in Client.cs, and the controls goes where the controld are in dialog, To find them search for a NPC ID that is already in your server, thats where the dialog goes.

Then search the same ID again and thats where Controls go
05/26/2009 19:44 sec0nd2n0ne#17
I'm still have a small issue. Im using TheCOServer and I have attached both my Client.cs and my NPCStuff/Dialog.ini In the npc dialogs the coding is different. So not exactly sure where to add the Dialog or the Controls for this script. Sorry for the long post!

My Client.cs
Quote:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Net;
using System.Net.Sockets;
using TheCOServer.PacketHandler;
using TheCOServer;
using System.Timers;

namespace TheCOServer
{
public class Client : object
{
public Cryptographer Crypto;
public Character MyChar;
public Socket ListenSock;
public Hashtable ServerClients;
public string Account = "";
public byte Status = 0;
public uint MessageId = 0;
public int MyClientId;
public string Address;
public int Port;
public Packets ThePackets = new Packets();
public bool Online = true;
public Timer CheckIfOnline = new Timer();
public bool InWorld = false;

public Client()
{
Crypto = new Cryptographer();
CheckIfOnline.Interval = 1000;
CheckIfOnline.Elapsed += new ElapsedEventHandler(Check);
CheckIfOnline.Start();
}

void Check(object source, ElapsedEventArgs e)
{
SendPacket(new byte[0]);
if (ListenSock != null)
if (!ListenSock.Connected)
{
if (MyChar != null)
MyChar.SaveChar();
Online = false;

CheckIfOnline.Stop();

if (TheMain.GameClients.Contains(Address + ":" + Port))
TheMain.GameClients.Remove(Address + ":" + Port);

if (WorldHandler.AllClients.Contains(MyClientId))
WorldHandler.AllClients.Remove(MyClientId);

if (MyChar != null)
if (InWorld)
WorldHandler.RemovePlayer(this);
}
}


public void SendPacket(byte[] Dat)
{
try
{
if (ListenSock.Connected)
if (Online)
{

byte[] TheData = new byte[Dat.Length];
Dat.CopyTo(TheData, 0);
Crypto.Encrypt(ref TheData);
ListenSock.Send(TheData);
}
}
catch (Exception) {}
}

public void ReceivePacket(byte[] Dat)
{
if (ListenSock.Connected)
if (Online)
{
byte[] Data = Dat;
Crypto.Decrypt(ref Data);
PacketHandlerData Handle = new PacketHandlerData();
Handle.HandlePacket(Data, this);
}
}

public void Drop()
{
TheMain.GameServer.DropClient(Address,Port);
}
}
}
My NPCStuff/Dialog.ini

Quote:
[200]
face=3
txt0=I'll be the soreing things for you hopefully
opt0=ok

[65224]
face=3
txt0=I'll be the one giveing you hp and mp pots.
opt0=ok

[65223]
face=3
txt0=Hello want me to bring you to Twin City
txt1=cya
opt0=Yes Please-No thanks!
opt1=thank you
req=0
rew=teleport, 1002,439,389

[1060]
face=3
txt0=Welcome to Vanquish Online Would you like me to sent you acroose the bridge
txt1=well done u got it
opt0=Yes Please-No thanks i'd like to jump!
opt1=thank you
req=0
rew=teleport, 1010,093,065

[10053]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Bird Island-Phoenix Castle-Desert City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1015,723,573-teleport,1011,190,271-teleport,1000,500,650-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[10063]
face=3
txt0=I have great armor items for starters! Elite+2 cost 215 cps
txt1=enjoy compliments of ghett0
opt0=Elite war armor-Elite tro armor-Elite tao armor-Elite Archer armor-I'm Broke!
opt1=Ok thank you
req=cps,215-cps,215-cps,215-cps,215-cps,cps,645-cps,645-cps,645-cps,645-
rew=item,131208,2,1,1,1,1-item,130908,2,0,0,1,1-item,134208,2,0,0,1,1-item,133908,2,0,0,1,1

[99999]
face=2
txt0=Would you Like to Go Fight(PK)
opt0=No Thanks-O.K.
rew=teleport,1005

[10050]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Ape Mountain-Bird Island-Phoenix Castle-Desert City-Mine Cave-Market-Lottory-Just passing by.
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1000,500,650-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47
[923]
face=4
txt0=Hey , u feel lucky today :P ,ok i will let you try your luck if you give me 27CPs
opt0=Ok here you are the 27 CPs-No thanks
req=cps,27
rew=teleport,700,40,47

[924]
face=4
txt0=So had a good luck ?, hope u a better one next time
opt0=Yes i wanna leave-No i will try it again-
req=0-cps,1
rew=teleport,1036,220,190

[300010]
face=6
txt0=I'm not a working Exorcist yet!
opt0=-ok

[1061]
face=7
txt0=I'm not a WhsGuardian yet!
opt0=-ok

[10003]
face=7
txt0=I'm not a GuildDirector yet!
opt0=-ok

[30161]
face=7
txt0=I'm not a FurnitureNPC yet!
opt0=-ok

[10060]
face=7
txt0=I'm not a Sunfer yet!
opt0=-ok

[104851]
face=6
txt0=I'm not a Bird Island Boxerhao yet!
opt0=-ok

[65221]
face=6
txt0=Would you Like to go somewhere cool?
opt0=somewhere cool-No I will stay
req=gold,100
rew=teleport,1037, 228, 232

[380]
face=6
txt0=Would you like to go to the guild area?
opt0=Yes-No Thanks
req=
rew=teleport,1038, 228, 232

[7000]
face=6
txt0=Would you like to exit the guild area?
opt0=Yes-No Thanks
req=
rew=teleport,1002, 438,377

[300000]
face=7
txt0=I'm not a Shelby yet!
opt0=-ok

[435]
face=6
txt0=Would You Like a free 500k? Well you'll have to lvl to 15
opt0=Cool-No thanks
req=lvl,15
rew=gold,500000

[3381]
face=7
txt0=I'm not a SurgeonMiracle yet!
opt0=-ok

[5004]
face=7
txt0=I'm not a Millionairelee yet!
opt0=-ok

[7050]
face=5
txt0=I'm not a WeaponMaster yet!
opt0=-ok

[2071]
face=5
txt0=Hi I'm CPAdmin I'll sell you some cps
opt0=I'll buy 27 cps for 1kk-I'll buy 270 for 10kk-No thanks
req=gold,1000000-gold,10000000
rew=cps,50-cps,600

[3825]
face=6
txt0=I'm not a UnknownMan yet!
opt0=-ok

[10065]
face=7
txt0=I'm not a GodlyArtisan yet!
opt0=-ok


[35502]
face=7
txt0=I'm not a ProficiencyGod yet!
opt0=-ok

[35501]
face=5
txt0=I'm not a ArtisanRow yet!
opt0=-ok

[2070]
face=5
txt0=I'm not a CollectorZhao yet!
opt0=-ok

[10151]
face=2
txt0=Would you Like to Go Fight(PK)
opt0=No Thanks-O.K.
rew=teleport,1005

[390]
face=4
txt0=Do You Wish to get married?
opt0=Yes-No
req= level 20
rew=

[7]
face=2
txt0=Where do u want to go out Training Ground ?
opt0=Arena-No I will stay
req=gold,100
rew=teleport,1005,052,057

[104798]
face=2
txt0=Where do u want to go out Training Ground ?
opt0=Ape Mountain-Bird Island-Phoenix Castle-Twin City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1002,438,377-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[45]
face=2
txt0=Where do u want to go out market ?
opt0=Ape Mountain-Bird Island-Phoenix Castle-Twin City-Mine Cave-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1002,438,377-teleport,1003,70,50

[47]
face=3
txt0=I will get u to level 30
txt1=well done u got it
opt0=sure-no I'd Rather do it my self.
opt1=thank you
req=lvl,>29
rew=lvl,30

[10161]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Ape Mountain-Bird Island-Phoenix Castle-Desert City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1000,500,650-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[10051]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Ape Mountain-Bird Island-Phoenix Castle-Twin City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1002,438,377-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[10056]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Ape Mountain-Twin City-Phoenix Castle-Desert City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1002,438,377-teleport,1011,190,271-teleport,1000,500,650-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[10052]
face=2
txt0=Hello there how are you i am the teleporter magician where do u want to go
opt0=Ape Mountain-Bird Island-Phoenix Castle-Desert City-Mine Cave-Market-Lottory-No I will stay
req=gold,100-gold,100-gold,100-gold,100-gold,100-gold,100-cps,27
rew=teleport,1020,567,576-teleport,1015,723,573-teleport,1011,190,271-teleport,1000,500,650-teleport,1003,70,50-teleport,1036,210,195-teleport,700,40,47

[10002]
face=3
txt0=Would you like to change your hair?
opt0=Hair1-Hair2-Hair3-Hair4-Hair5-Hair6-Nah I'm good.
opt1=Ok
req=0-0-0-0-0-0
rew=hair,421-hair,411-hair,430-hair,435-hair,436-hair,437
Any help will be greatly appreciated this is the only part of scripting i am getting stuck in at the present time. :(
05/26/2009 20:19 ih8you#18
You using A ini source. I did this in a Non-Ini source
05/26/2009 21:24 PeTe Ninja#19
no hes using the 4351 source...this is for LOTF client version 5017 not the 4351 TheCoServer source :D