Here is my attempt to create an npc that reborns you
Code:
case 211091:// Rb Adder
{
if (LinkBack == 0)
{
Text("Would you like to be reborn? You need to be level 120 or higher to reborn.", CSocket);
Link("1st rb", 1, CSocket);
Link("2nd rb", 2, CSocket);
Link("No thanks", 225, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Reborn == 0)
if (CSocket.Client.Level >= 120)
{
Reborn(+1, CSocket);
Level(15, CSocket);
}
else
{
Text("You are not high enough level", CSocket);
Link("****!", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.Level >= 120)
if (CSocket.Client.Reborn == 1)
Reborn(+1, CSocket);
Level (15, CSocket);
}
else
{
Text("You are not high enough level", CSocket);
Link("****!", 255, CSocket);
End(CSocket);
}
break;
}
Apparently, when i click on the npc and choose the "1st rb" link, it does not make me 1st rb. anyone know what im doing wrong?
I don't know if this would work but instead of Reborn(+1, CSocket); use CSocket.Client.Reborn = 1; for 1st rb and CSocket.Client.Reborn = 2; for 2nd rb.
case 211091:// Rb Adder
{
if (LinkBack == 0)
{
Text("Would you like to be reborn? You need to be level 120 or higher to reborn.", CSocket);
Link("1st rb", 1, CSocket);
Link("2nd rb", 2, CSocket);
Link("No thanks", 225, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Reborn == 0)
if (CSocket.Client.Level >= 120)
{
CSocket.Client.Reborn = 1;
CSocket.Client.Level = 15; ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has just been reborn! Good job!", Struct.ChatType.Center), 0);
}
else
{
Text("You are not high enough level", CSocket);
Link("Damn!", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.Level >= 120)
if (CSocket.Client.Reborn == 1)
Reborn(+1, CSocket);
Level (15, CSocket);
}
else
{
Text("You are not high enough level", CSocket);
Link("Damn!", 255, CSocket);
End(CSocket);
}
break;
}
i dunno how to make the items lower the level. Im still trying to understand the code. Any Idea would be appreciated
#region change gear lvl
int i;
for (i = 1; i < 9; i++)
{
if (i != 7)
{
CSocket.Client.Equipment[i].ItemID =
Calculation.DownLevel(Convert.ToString(CSocket.Client.Equipment[i].ItemID));
Database.Database.UpdateItem(CSocket.Client.Equipment[i]);
CSocket.Send(ConquerPacket.ItemInfo(
CSocket.Client.Equipment[i].UID,
CSocket.Client.Equipment[i].ItemID,
CSocket.Client.Equipment[i].Plus,
CSocket.Client.Equipment[i].Progress,
CSocket.Client.Equipment[i].Bless,
CSocket.Client.Equipment[i].Enchant,
CSocket.Client.Equipment[i].Soc1,
CSocket.Client.Equipment[i].Soc2,
CSocket.Client.Equipment[i].Dura,
CSocket.Client.Equipment[i].MaxDura,
i,
CSocket.Client.Equipment[i].Color));
}
}
Handler.ItemUnequip(5, CSocket.Client.Equipment[5].UID, CSocket);
#endregion
in calculations add a new class
Code:
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;
using CoEmu_v2_GameServer.Database;
namespace CoEmu_v2_GameServer.Calculations
{
public partial class Calculation
{
public static int DownLevel(string ItemID)
{
string newID = ItemID;
newID = newID.Remove(3, 2);
newID = newID.Insert(3, getNum(Convert.ToInt32(ItemID)));
return (Convert.ToInt32(newID));
}
private static string getNum(int ItemID)
{
string num;
if (ItemID >= 150003 && ItemID <= 159999) //ring 1-126
{
if (ItemID == 150310) num = "31";
else if (ItemID == 150320) num = "32";
else num = "01";
}
else if (ItemID >= 160013 && ItemID <= 169999) //boot 10-126
{
num = "01";
}
else num = "00";
return num;
}
}
}
#region change gear lvl
int i;
for (i = 1; i < 9; i++)
{
if (i != 7)
{
CSocket.Client.Equipment[i].ItemID =
Calculation.DownLevel(Convert.ToString(CSocket.Client.Equipment[i].ItemID));
Database.Database.UpdateItem(CSocket.Client.Equipment[i]);
CSocket.Send(ConquerPacket.ItemInfo(
CSocket.Client.Equipment[i].UID,
CSocket.Client.Equipment[i].ItemID,
CSocket.Client.Equipment[i].Plus,
CSocket.Client.Equipment[i].Progress,
CSocket.Client.Equipment[i].Bless,
CSocket.Client.Equipment[i].Enchant,
CSocket.Client.Equipment[i].Soc1,
CSocket.Client.Equipment[i].Soc2,
CSocket.Client.Equipment[i].Dura,
CSocket.Client.Equipment[i].MaxDura,
i,
CSocket.Client.Equipment[i].Color));
}
}
Handler.ItemUnequip(5, CSocket.Client.Equipment[5].UID, CSocket);
#endregion
in calculations add a new class
Code:
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;
using CoEmu_v2_GameServer.Database;
namespace CoEmu_v2_GameServer.Calculations
{
public partial class Calculation
{
public static int DownLevel(string ItemID)
{
string newID = ItemID;
newID = newID.Remove(3, 2);
newID = newID.Insert(3, getNum(Convert.ToInt32(ItemID)));
return (Convert.ToInt32(newID));
}
private static string getNum(int ItemID)
{
string num;
if (ItemID >= 150003 && ItemID <= 159999) //ring 1-126
{
if (ItemID == 150310) num = "31";
else if (ItemID == 150320) num = "32";
else num = "01";
}
else if (ItemID >= 160013 && ItemID <= 169999) //boot 10-126
{
num = "01";
}
else num = "00";
return num;
}
}
}
Error 1 The call is ambiguous between the following methods or properties: 'CoEmu_v2_GameServer.Calculations.Calculation.Down Level(string)' and 'CoEmu_v2_GameServer.Calculations.Calculation.Down Level(string)' C:\Users\joe is king\Desktop\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 5114 97 CoEmu v2 GameServer
[B]THIS IS JUST SAMPLE CODE AND STILL NEED A LOT OF WORK AND CODING TO BE DONE [/B]
HTML Code:
case 211091: /* Rb Adder [B]Corrections would be appreciated since i am still learning how to code C Sharp [/B] */
{
if (LinkBack == 0)
{
Text("Would you like to be reborn? You need to be level 120 or higher to reborn.", CSocket);
Link("1st rb", 1, CSocket);
Link("2nd rb", 2, CSocket);
Link("No thanks", 225, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Reborn == 0) && (CSocket.Client.Level >= 110)
/* if (CSocket.Client.Class = ) dunno what to put here this is supposed to be for water taoist which can reborn at lvl 110 , any idea would be appreciated*/
if (InventoryContains(721258, 1, CSocket)) // 721258 <---Cleanwater ID
{
CSocket.Client.Reborn = 1;
CSocket.Client.Level = 15;
ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has just been reborn! Good job!", Struct.ChatType.Center), 0);
#region change gear lvl
int i;
for (i = 1; i < 9; i++)
{
if (i != 7)
{
CSocket.Client.Equipment[i].ItemID =
Calculation.DownLevel(Convert.ToString(CSocket.Client.Equipment[i].ItemID));
Database.Database.UpdateItem(CSocket.Client.Equipment[i]);
CSocket.Send(ConquerPacket.ItemInfo(
CSocket.Client.Equipment[i].UID,
CSocket.Client.Equipment[i].ItemID,
CSocket.Client.Equipment[i].Plus,
CSocket.Client.Equipment[i].Progress,
CSocket.Client.Equipment[i].Bless,
CSocket.Client.Equipment[i].Enchant,
CSocket.Client.Equipment[i].Soc1,
CSocket.Client.Equipment[i].Soc2,
CSocket.Client.Equipment[i].Dura,
CSocket.Client.Equipment[i].MaxDura,
i,
CSocket.Client.Equipment[i].Color));
}
}
Handler.ItemUnequip(5, CSocket.Client.Equipment[5].UID, CSocket);
#endregion
}
else
{
Text("You are not high enough level", CSocket);
Link("Damn!", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.Level >= 120)
if (CSocket.Client.Reborn == 1)
Reborn(+1, CSocket);
Level (15, CSocket);
}
else
{
Text("You are not high enough level", CSocket);
Link("Damn!", 255, CSocket);
End(CSocket);
}
break;
}
In the Calculation/Calculation.cs
replace the code with this one.
Credit goes to iamanob
HTML Code:
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;
using CoEmu_v2_GameServer.Database;
namespace CoEmu_v2_GameServer.Calculations
{
public partial class Calculation
{
public static int DownLevel(string ItemID)
{
string newID = ItemID;
newID = newID.Remove(3, 2);
newID = newID.Insert(3, getNum(Convert.ToInt32(ItemID)));
return (Convert.ToInt32(newID));
}
private static string getNum(int ItemID)
{
string num;
if (ItemID >= 150003 && ItemID <= 159999) //ring 1-126
{
if (ItemID == 150310) num = "31";
else if (ItemID == 150320) num = "32";
else num = "01";
}
else if (ItemID >= 160013 && ItemID <= 169999) //boot 10-126
{
num = "01";
}
else num = "00";
return num;
}
}
}
I am willing to learn, so correct me if i am wrong.
Error 2 The call is ambiguous between the following methods or properties: 'CoEmu_v2_GameServer.Calculations.Calculation.Down Level(string)' and 'CoEmu_v2_GameServer.Calculations.Calculation.Down Level(string)' C:\Users\joe is king\Desktop\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 5282 45 CoEmu v2 GameServer
I get 6 errors with npctalk >.<
Error 1 Only assignment, call, increment, decrement, and new object expressions can be used as a statement C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3145 37 CoEmu v2 GameServer
Error 2 Pointers and fixed size buffers may only be used in an unsafe context C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3145 37 CoEmu v2 GameServer
Error 3 Cannot take the address of the given expression C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3145 37 CoEmu v2 GameServer
Error 4 The name 'InventoryContains' does not exist in the current context C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3147 8 CoEmu v2 GameServer
Error 5 The name 'Reborn' does not exist in the current context C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3194 1 CoEmu v2 GameServer
Error 6 The name 'Level' does not exist in the current context C:\Documents and Settings\alan\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3195 1 CoEmu v2 GameServer
Now just the one error >.<
Error 1 Invalid expression term '&&' C:\Documents and Settings\alan knight\My Documents\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 3145 37 CoEmu v2 GameServer
if (CSocket.Client.Reborn == 0) && (CSocket.Client.Level >= 110)
/* if (CSocket.Client.Class = ) dunno what to put here this is supposed to be for water taoist which can reborn at lvl 110 , any idea would be appreciated*/
if (InventoryContains(721258, 1, CSocket)) // 721258 <---Cleanwater ID
replace with
HTML Code:
if (CSocket.Client.Reborn == 0)
if (CSocket.Client.Level >= 110)
/* if (CSocket.Client.Class = ) dunno what to put here this is supposed to be for water taoist which can reborn at lvl 110 , any idea would be appreciated*/
if (InventoryContains(721258, 1, CSocket)) // 721258 <---Cleanwater ID
my 1st attempt at a mod 07/03/2009 - CO2 Weapon, Armor, Effects & Interface edits - 5 Replies http://img188.imageshack.us/img188/1749/curvebalde 125.th.jpg
VERSION 2
http://img261.imageshack.us/img261/1749/curvebald e125.th.jpg
VERSION 3
http://img191.imageshack.us/img191/1144/curvebald e125ver3.th.jpg
FINAL VERSION
http://img196.imageshack.us/img196/6381/curveblad e125final.th.jpg
attempt of scam? 10/05/2008 - Silkroad Online - 2 Replies I was at town today when suddenly someone started talking to me... was this an attempt of scam? do people fall for that :confused:
http://img222.imageshack.us/img222/4941/nanizm4.j pg
I remember the same guy said the same thing to me not too long ago when I was on my other character... that time he logged out immediately before I had the chance to reply.
I guess the next step would have been "duplicating" a common item and after gaining my trust, make me give him my sos glaive :p
my attempt to get SV 01/07/2007 - Conquer Online 2 - 13 Replies my frist file edit, hope you like it. sorry if its in the wrong section
phishing attempt on e*pvp? 07/23/2006 - Technical Support - 5 Replies hiho,
ich bekomm seit heute andauernd eine nachricht von kaspersky internet security 6.0
(und immer mit diesem schrecklichen sound >.<)....immer wenn ich auf die startseite
vom epvpforum zugreifen will. sprich... -> http://www.elitepvpers.com/forum/
hier mal ein pic. ansonsten ist alles recht normal aufn forum.
http://free.pages.at/ussj/phishing.JPG
spackt das teil jetzt einfach ab..bzw überempfindlich...oder sollte ich mir gedanken drum machen?