|
Originally Posted by gad-legion
yes i can code, mostly of npc from coemu i done it and i was the first ho released npc for it, im the one ho found how to use more npc for same dialogue and im gone send u some weel made npc by my pro edition:
Quote:
case 380://Guild Controller
case 108901:
case 108900:
case 108343:
case 108709:
{
if (LinkBack == 0)
{
Text("Hello, I can send you to the guild area for free. Would you like to go?", CSocket);
Link("Yes, please send me there.", 1, CSocket);
Link("I'll take a look around here.", 255, CSocket);
Face(20, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Teleport(1038, 349, 340, 0, CSocket);
}
break;
}
|
ok now u need to change npc type like this:
Quote:
3801 108343 1487 1015 709 571 2 1
4001 108709 1467 1001 270 179 2 1
|
tg npcs
Quote:
case 104839: // BoxerLi TG teleporter
case 104851:
case 104845:
case 104833:
case 11111:
{
if (CSocket.Client.Level >= 20)
{
if (LinkBack == 0)
{
Text("Hello I can help you train after you reach level 20,\n But I will charge you 1,000 gold.\n Would you like to go to the Training Grounds?", CSocket);
Link("Yes Please, Here is the money", 1, CSocket);
Link("No Thank you I cannot afford it.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Money >= 1000)
{
Teleport(1039, 219, 215, 0, CSocket);
Money(-1000, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
}
break;
}
|
Quote:
case 600075: // TG out
{
if (LinkBack == 0)
{
Text("Hello I can teleport You outside of the Training Grounds for free! Do you want to leave?", CSocket);
Link("Yes, please!", 1, CSocket);
Link("No, Thank you anyway.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.RecordMap == 1002) //Twin City
{
Teleport(1002, 430, 380, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1011) //phoniex
{
Teleport(1011, 232, 260, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1020) //apecity
{
Teleport(1020, 565, 565, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1000) //desertcity
{
Teleport(1000, 496, 649, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1015) //birdisland
{
Teleport(1015, 723, 573, 0, CSocket);
}
else //For Other Map
Teleport(1002, 430, 380, 0, CSocket);
}
break;
}
|
Quote:
case 45: // Mark. Controller
{
if (LinkBack == 0)
{
Text("Hello I can teleport You outside of the market for free! Do you want to leave?", CSocket);
Link("Why would you be so kind to do so?", 1, CSocket);
Link("No, Thank you anyway.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.RecordMap == 1002) //Twin City
{
Teleport(1002, 430, 380, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1011) //phoniex
{
Teleport(1011, 232, 260, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1020) //apecity
{
Teleport(1020, 565, 565, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1000) //desertcity
{
Teleport(1000, 496, 649, 0, CSocket);
}
else if (CSocket.Client.RecordMap == 1015) //birdisland
{
Teleport(1015, 723, 573, 0, CSocket);
}
else //For Other Map
Teleport(1002, 430, 380, 0, CSocket);
}
break;
}
|
for the last 2 npc u need to add record map on ur server cs like this
replace all in teleport .cs whit:
Quote:
/*
* Created by SharpDevelop.
* User: sams
* Date: 3/14/2009
* Time: 1:56 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using CoEmu_v2_GameServer.Calculations;
namespace CoEmu_v2_GameServer.Handlers
{
/// <summary>
/// Handles teleportations in the Conquer worls
/// </summary>
public partial class Handler
{
public static void Teleport(int Map, int X, int Y, int Instance, ClientSocket CSocket)
{
if (Map > 0 && X > 0 && Y > 0 && CSocket != null)
{
ConquerPacket.ToLocal(ConquerPacket.General(CSocke t.Client.ID, CSocket.Client.X, CSocket.Client.Y, 0, 0, 0, Struct.DataType.EntityRemove), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, CSocket.Client.ID);
CSocket.Client.RecordMap = (int)CSocket.Client.Map;
CSocket.Client.RecordX = CSocket.Client.X;
CSocket.Client.RecordY = CSocket.Client.Y;
CSocket.Client.Map = (Struct.Maps)Map;
CSocket.Client.X = X;
CSocket.Client.Y = Y;
//TODO: Instance pairing.
CSocket.Send(ConquerPacket.General(CSocket.Client. ID, (int)CSocket.Client.Map, 0, CSocket.Client.X, CSocket.Client.Y, 0, Struct.DataType.ChangeMap));
CSocket.Send(ConquerPacket.General(CSocket.Client. ID, Nano.TintR, Nano.TintG, 0, 0, 0, Struct.DataType.CompleteMapChange));
CSocket.Send(ConquerPacket.NewMap((int)CSocket.Cli ent.Map));
CSocket.Send(ConquerPacket.General(CSocket.Client. ID, 2, 0, CSocket.Client.X, CSocket.Client.Y, 0, Struct.DataType.MapShow3));
ConquerPacket.ToLocal(ConquerPacket.SpawnCharacter (CSocket), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, CSocket.Client.ID);
CSocket.Client.PrevX = 0;
CSocket.Client.PrevY = 0;
Spawn.All(CSocket);
}
}
}
}
|
Replace in Database.cs:
Quote:
public static void SaveCharacter(Character Client)
{
MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `Level` = " + Client.Level + ", `WHMoney` = " + Client.WHMoney + ", `PkPoints` = " + Client.PkPoints + ", `xCord` = " + Client.X + ", `yCord` = " + Client.Y + ", `Map` = " + (int)Client.Map + ", `HairStyle` = " + Client.Hair + ", `Class` = " + (int)Client.Class + ", `Exp` = " + Client.Exp + ", `Money` = " + Client.Money + ", `CPoints` = " + Client.CPs + ", `Str` = " + Client.Strength + ",`Vit` = " + Client.Vitality + ", `Spi` = " + Client.Spirit + ", `Dex` = " + Client.Dexterity + ", `StatPoints` = " + Client.StatPoints + ", `FirstLog` = " + 1 + ", `Reborn` = " + Client.Reborn + ", `HP` = " + Client.CurrentHP + ", `MP` = " + Client.CurrentMP + ", `RecordMap` = " + Client.RecordMap + ", `RecordX` = " + Client.RecordX + ", `RecordY` = " + Client.RecordY + " WHERE `CharID` = " + Client.ID, DatabaseConnection.NewConnection());
Cmd.ExecuteNonQuery();
Cmd.Connection.Close();
Cmd.Connection.Dispose();
Cmd.Dispose();
}
|
now under line 235 Client.CurrentMP = Convert.ToInt32(DR["MP"]); add this:
Quote:
Client.RecordMap = Convert.ToInt32(DR["RecordMap"]);
Client.RecordX = Convert.ToInt32(DR["RecordX"]);
Client.RecordY = Convert.ToInt32(DR["RecordY"]);
|
and to close this put in Character.cs:
Quote:
public int RecordMap = 0;
public int RecordX = 0;
public int RecordY = 0;
|
i hope this npc come in handy cuz as i told u they are pro edition :)))
|