|
You last visited: Today at 21:17
Advertisement
Npc need help
Discussion on Npc need help within the Nostale forum part of the MMORPGs category.
02/16/2020, 13:42
|
#1
|
elite*gold: 297
Join Date: Mar 2018
Posts: 54
Received Thanks: 2
|
Npc need help
I'm looking for a person who will help me add Npc fast up sp,perfection
|
|
|
02/16/2020, 13:50
|
#2
|
elite*gold: 0
Join Date: Feb 2020
Posts: 51
Received Thanks: 69
|
Use the loop
for (int i = 0; i < 10; i++)
{
Your functions
}
in this example that loop will be repeated 10 times
|
|
|
02/16/2020, 15:34
|
#3
|
elite*gold: 100
Join Date: Dec 2016
Posts: 342
Received Thanks: 82
|
or just use
do
{
the funktion
}
while(true);
to understand for you @
the Method from Shitoshi will repeat it 10 times and stop ... in my Method it repeats till he have no more items or something which isent enough to do
basically you can use both methods
Shitoshi's method just repeat it 10 times
mine method just repeat until the character have no more items to up or perfect.
|
|
|
02/16/2020, 15:50
|
#4
|
elite*gold: 30
Join Date: Sep 2014
Posts: 593
Received Thanks: 316
|
Quote:
Originally Posted by Shitoshi
Use the loop
for (int i = 0; i < 10; i++)
{
Your functions
}
in this example that loop will be repeated 10 times
|
Quote:
Originally Posted by InnoTx
or just use
do
{
the funktion
}
while(true);
to understand for you @
the Method from Shitoshi will repeat it 10 times and stop ... in my Method it repeats till he have no more items or something which isent enough to do
basically you can use both methods
Shitoshi's method just repeat it 10 times
mine method just repeat until the character have no more items to up or perfect.
|
You both don't realy expect him to implement it himself right? By looking at his previous questions you can easily tell that he's actually looking for someone who tells him what to do and that step by step. I mean don't get me wrong, it's nice that you try to tell him to make a use of basic c#(Actually basic programming), but I don't think he's here to learn c# nor the logic of programming itself.
|
|
|
02/16/2020, 15:56
|
#5
|
elite*gold: 100
Join Date: Dec 2016
Posts: 342
Received Thanks: 82
|
tbh i help how much i can but if he is lazy idc about it, it is his thing ..
and i dont think that someone will do it for him.
|
|
|
02/16/2020, 16:44
|
#6
|
elite*gold: 30
Join Date: Sep 2014
Posts: 593
Received Thanks: 316
|
Quote:
Originally Posted by InnoTx
and i dont think that someone will do it for him.

|
So do I, just wanted to mention it.
|
|
|
02/16/2020, 19:23
|
#7
|
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
|
very crappy but functional hardcode.
put the code in Run Handler and change the cas
Code:
case 19414:
//up sp
ItemInstance specialistInstance = Session.Character.Inventory.LoadBySlotAndType((byte)EquipmentType.Sp, InventoryType.Wear);
if (specialistInstance != null)
{
if (specialistInstance.Upgrade >= 15)
{
return;
}
byte[] upfail = { 20, 25, 30, 40, 50, 60, 65, 70, 75, 80, 90, 93, 95, 97, 99 };
byte[] destroy = { 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70 };
int[] goldprice = { 200000, 200000, 200000, 200000, 200000, 500000, 500000, 500000, 500000, 500000, 1000000, 1000000, 1000000, 1000000, 1000000 };
byte[] feather = { 3, 5, 8, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70 };
byte[] fullmoon = { 1, 3, 5, 7, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
byte[] soul = { 2, 4, 6, 8, 10, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 };
const short featherVnum = 2282;
const short fullmoonVnum = 1030;
const short greenSoulVnum = 2283;
const short redSoulVnum = 2284;
const short blueSoulVnum = 2285;
const short dragonSkinVnum = 2511;
const short dragonBloodVnum = 2512;
const short dragonHeartVnum = 2513;
const short blueScrollVnum = 1363;
const short redScrollVnum = 1364;
int fallimento = 0;
short itemToRemove = 2283;
if (!Session.HasCurrentMapInstance)
{
return;
}
while (specialistInstance.Upgrade < 15)
{
if (Session.Character.Gold < goldprice[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("NOT_ENOUGH_MONEY"), 10));
break;
}
if (Session.Character.Inventory.CountItem(featherVnum) < feather[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(featherVnum).Name, feather[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(fullmoonVnum) < fullmoon[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(featherVnum).Name, fullmoon[specialistInstance.Upgrade])), 10));
break;
}
if (specialistInstance.Item.Morph <= 16)
{
if (specialistInstance.Upgrade < 5)
{
if (Session.Character.Inventory.CountItem(greenSoulVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(greenSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
break;
}
itemToRemove = greenSoulVnum;
Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
}
else if (specialistInstance.Upgrade < 10)
{
if (Session.Character.Inventory.CountItem(redSoulVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
break;
}
itemToRemove = redSoulVnum;
Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
}
else
{
if (Session.Character.Inventory.CountItem(blueSoulVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(redScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redScrollVnum).Name, 1)), 10));
break;
}
itemToRemove = blueSoulVnum;
Session.Character.Inventory.RemoveItemAmount(redScrollVnum);
}
}
else
{
if (specialistInstance.Upgrade < 5)
{
if (Session.Character.Inventory.CountItem(dragonSkinVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonSkinVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
break;
}
Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
itemToRemove = dragonSkinVnum;
}
else if (specialistInstance.Upgrade < 10)
{
if (Session.Character.Inventory.CountItem(dragonBloodVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonBloodVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
break;
}
Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
itemToRemove = dragonBloodVnum;
}
else
{
if (Session.Character.Inventory.CountItem(dragonHeartVnum) < soul[specialistInstance.Upgrade])
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonHeartVnum).Name, soul[specialistInstance.Upgrade])), 10));
break;
}
if (Session.Character.Inventory.CountItem(redScrollVnum) == 0)
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redScrollVnum).Name, 1)), 10));
break;
}
Session.Character.Inventory.RemoveItemAmount(redScrollVnum);
itemToRemove = dragonHeartVnum;
}
}
Session.Character.Gold -= goldprice[specialistInstance.Upgrade];
Session.Character.Inventory.RemoveItemAmount(featherVnum, feather[specialistInstance.Upgrade]);
int rnd1 = ServerManager.RandomNumber();
if (rnd1 < upfail[specialistInstance.Upgrade])
{
int maxfail = 0;
switch (specialistInstance.Upgrade)
{
case 0:
case 1:
case 2:
case 3:
case 4:
maxfail = 5;
break;
case 5:
case 6:
case 7:
case 8:
case 9:
maxfail = 10;
break;
case 10:
maxfail = 15;
break;
case 11:
maxfail = 20;
break;
case 12:
maxfail = 40;
break;
case 13:
maxfail = 80;
break;
case 14:
maxfail = 150;
break;
}
if (specialistInstance.UpgradeFail > maxfail)
{
Session.Character.Inventory.RemoveItemAmount(itemToRemove, soul[specialistInstance.Upgrade]);
Session.Character.Inventory.RemoveItemAmount(fullmoonVnum, fullmoon[specialistInstance.Upgrade]);
Session.Character.Inventory.RemoveItemAmount(featherVnum, feather[specialistInstance.Upgrade]);
specialistInstance.Upgrade++;
if (specialistInstance.Upgrade > 8)
{
Session.Character.Family?.InsertFamilyLog(FamilyLogType.ItemUpgraded, Session.Character.Name, itemVNum: specialistInstance.ItemVNum, upgrade: specialistInstance.Upgrade);
}
Session.SendPacket(specialistInstance.GenerateInventoryAdd());
}
else
{
Session.Character.Inventory.RemoveItemAmount(itemToRemove, soul[specialistInstance.Upgrade]);
Session.Character.Inventory.RemoveItemAmount(featherVnum, fullmoon[specialistInstance.Upgrade]);
Session.Character.Inventory.RemoveItemAmount(featherVnum, feather[specialistInstance.Upgrade]);
fallimento++;
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("UPGRADESP_FAILED"), 11));
Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("UPGRADESP_FAILED"), 0));
}
}
else
{
Session.Character.Inventory.RemoveItemAmount(itemToRemove, soul[specialistInstance.Upgrade]);
Session.Character.Inventory.RemoveItemAmount(fullmoonVnum, fullmoon[specialistInstance.Upgrade]);
specialistInstance.Upgrade++;
Session.SendPacket(specialistInstance.GenerateInventoryAdd());
}
Session.SendPacket(Session.Character.GenerateGold());
Session.SendPacket(Session.Character.GenerateEq());
}
Session.CurrentMapInstance.Broadcast(StaticPacketHelper.GenerateEff(UserType.Player, Session.Character.CharacterId, 3005), Session.Character.MapX, Session.Character.MapY);
Session.SendPacket(Session.Character.GenerateSay("-------------Upgrade stats-------------", 11));
Session.SendPacket(Session.Character.GenerateSay("Upgrade Sp: " + specialistInstance.Upgrade, 11));
Session.SendPacket(Session.Character.GenerateSay("Fails: " + fallimento, 11));
Session.SendPacket(Session.Character.GenerateSay("---------------------------------------", 11));
}
break;
Code:
case 19415:
{
try
{
ItemInstance specialistInstance1 = Session.Character.Inventory.LoadBySlotAndType((byte)EquipmentType.Sp, InventoryType.Wear);
if (specialistInstance1 != null)
{
short[] upsuccess = { 50, 40, 30, 20, 10 };
int[] goldprice = { 5000, 10000, 20000, 50000, 100000 };
byte[] stoneprice = { 1, 2, 3, 4, 5 };
short stonevnum;
byte upmode = 1;
short SpDamage = 0;
short SpDefence = 0;
short SpElement = 0;
short SpHP = 0;
short SpFire = 0;
short SpWater = 0;
short SpLight = 0;
short SpDark = 0;
short Fallimenti = 0;
short Successi = 0;
switch (specialistInstance1.Item.Morph)
{
case 2:
case 6:
case 9:
case 12:
stonevnum = 2514;
break;
case 3:
case 4:
case 14:
stonevnum = 2515;
break;
case 5:
case 11:
case 15:
stonevnum = 2516;
break;
case 10:
case 13:
case 7:
stonevnum = 2517;
break;
case 17:
case 18:
case 19:
stonevnum = 2518;
break;
case 20:
case 21:
case 22:
stonevnum = 2519;
break;
case 23:
case 24:
case 25:
stonevnum = 2520;
break;
case 26:
case 27:
case 28:
stonevnum = 2521;
break;
default:
return;
}
while (Session.Character.Inventory.CountItem(stonevnum) > 0)
{
if (specialistInstance1.SpStoneUpgrade > 99)
{
break;
}
if (specialistInstance1.SpStoneUpgrade > 80)
{
upmode = 5;
}
else if (specialistInstance1.SpStoneUpgrade > 60)
{
upmode = 4;
}
else if (specialistInstance1.SpStoneUpgrade > 40)
{
upmode = 3;
}
else if (specialistInstance1.SpStoneUpgrade > 20)
{
upmode = 2;
}
if (Session.Character.Gold < goldprice[upmode - 1])
{
break;
}
if (Session.Character.Inventory.CountItem(stonevnum) < stoneprice[upmode - 1])
{
break;
}
int rnd1 = ServerManager.RandomNumber();
if (rnd1 < upsuccess[upmode - 1])
{
byte type = (byte)ServerManager.RandomNumber(0, 16), count = 1;
if (upmode == 4)
{
count = 2;
}
if (upmode == 5)
{
count = (byte)ServerManager.RandomNumber(3, 6);
}
if (type < 3)
{
specialistInstance1.SpDamage += count;
SpDamage += count;
}
else if (type < 6)
{
specialistInstance1.SpDefence += count;
SpDefence += count;
}
else if (type < 9)
{
specialistInstance1.SpElement += count;
SpElement += count;
}
else if (type < 12)
{
specialistInstance1.SpHP += count;
SpHP += count;
}
else if (type == 12)
{
specialistInstance1.SpFire += count;
SpFire += count;
}
else if (type == 13)
{
specialistInstance1.SpWater += count;
SpWater += count;
}
else if (type == 14)
{
specialistInstance1.SpLight += count;
SpLight += count;
}
else if (type == 15)
{
specialistInstance1.SpDark += count;
SpDark += count;
}
specialistInstance1.SpStoneUpgrade++;
Successi++;
}
else
{
Fallimenti++;
}
Session.SendPacket(specialistInstance1.GenerateInventoryAdd());
Session.Character.Gold -= goldprice[upmode - 1];
Session.SendPacket(Session.Character.GenerateGold());
Session.Character.Inventory.RemoveItemAmount(stonevnum, stoneprice[upmode - 1]);
}
if (Successi > 0 || Fallimenti > 0)
{
Session.CurrentMapInstance.Broadcast(StaticPacketHelper.GenerateEff(UserType.Player, Session.Character.CharacterId, 3005), Session.Character.MapX, Session.Character.MapY);
Session.SendPacket(Session.Character.GenerateSay("---------------Perfection Status---------------", 11));
Session.SendPacket(Session.Character.GenerateSay("Succès: " + Successi, 11));
Session.SendPacket(Session.Character.GenerateSay("Fails: " + Fallimenti, 11));
Session.SendPacket(Session.Character.GenerateSay("Attaque: " + SpDamage, 11));
Session.SendPacket(Session.Character.GenerateSay("Défense: " + SpDefence, 11));
Session.SendPacket(Session.Character.GenerateSay("HP: " + SpHP, 11));
Session.SendPacket(Session.Character.GenerateSay("Element " + SpElement, 11));
Session.SendPacket(Session.Character.GenerateSay("Feu: " + SpFire, 11));
Session.SendPacket(Session.Character.GenerateSay("Eau: " + SpWater, 11));
Session.SendPacket(Session.Character.GenerateSay("Lumière: " + SpLight, 11));
Session.SendPacket(Session.Character.GenerateSay("Obscure: " + SpDark, 11));
Session.SendPacket(Session.Character.GenerateSay("-----------------------------------------------", 11));
}
else
{
Session.SendPacket(Session.Character.GenerateSay("NOT_ENOUGH_ITEM", 10));
}
}
else
{
Session.SendPacket(Session.Character.GenerateSay("WEAR_SP", 10));
}
}
catch (Exception ex)
{
Logger.Error(ex);
}
}
break;
or for specialist upgrades, you go to the InventoryPacketHandler and you change box 25 and 26 by:
Code:
case 25:
specialist = Session.Character.Inventory.LoadBySlotAndType(slot, inventoryType);
if (specialist != null)
{
if (specialist.Rare != -2)
{
if (specialist.Upgrade > 9)
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg(
string.Format(Language.Instance.GetMessageFromKey("MUST_USE_ITEM"), ServerManager.GetItem(1364).Name), 0));
return;
}
if (specialist.Item.EquipmentSlot == EquipmentType.Sp)
{
var start = DateTime.Now;
while (DateTime.Now - start < TimeSpan.FromSeconds(2))
{
specialist.UpgradeSp(Session, UpgradeProtection.Protected);
}
}
}
else
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg(
Language.Instance.GetMessageFromKey("CANT_UPGRADE_DESTROYED_SP"), 0));
}
}
break;
case 26:
specialist = Session.Character.Inventory.LoadBySlotAndType(slot, inventoryType);
if (specialist != null)
{
if (specialist.Rare != -2)
{
if (specialist.Upgrade <= 9)
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg(
string.Format(Language.Instance.GetMessageFromKey("MUST_USE_ITEM"), ServerManager.GetItem(1363).Name), 0));
return;
}
if (specialist.Item.EquipmentSlot == EquipmentType.Sp)
{
var start = DateTime.Now;
while (DateTime.Now - start < TimeSpan.FromSeconds(2))
{
specialist.UpgradeSp(Session, UpgradeProtection.Protected);
}
}
}
else
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg(
Language.Instance.GetMessageFromKey("CANT_UPGRADE_DESTROYED_SP"), 0));
}
}
break;
It will do like innotx say above it will increase your sp infinitely until you have no more material or gold
|
|
|
02/17/2020, 16:31
|
#8
|
elite*gold: 297
Join Date: Mar 2018
Posts: 54
Received Thanks: 2
|
close
|
|
|
02/17/2020, 18:03
|
#9
|
elite*gold: 0
Join Date: Jan 2019
Posts: 37
Received Thanks: 3
|
Quote:
Originally Posted by polk99
I'm looking for a person who will help me add Npc fast up sp,perfection
|
Me, but is very simple
|
|
|
 |
Similar Threads
|
Request help! Deleting NPC & deleting items from NPC
07/28/2016 - SRO Private Server - 4 Replies
Hello Epvpers,
I've got a question,,
I'd like to know how to delete NPC & deleting items from NPC.
I've already tried to search the files i should needed with how to add npc tutorials, but i still got an error when i launch my client.
Can somebody explain me which files i must edit for deleting a NPC & NPC item properly?
Thanks in advance!
|
[Help] Explaining npc code in oldcodb (npc.txt) + how to delete npcs
02/05/2012 - CO2 Private Server - 5 Replies
Can anyone help explain to me the code in npc.txt in OLDCODB
These are how some of the codes appear:
4 40 1 0 1002 412 366
423 2706 1 0 1002 412 361
44 87 3 0 1036 182 180
185 1086 16 0 1036 230 173
184 1086 16 0 1036 230 177
|
[HELP]Calling an NPC dialog from inside a current NPC [5375]
10/10/2011 - CO2 Private Server - 5 Replies
I have been trying to call another NPCs dialog from within the current NPC. i.e
NPC1
case 001:
{
switch (npcRequest.OptionID)
{
case 0:
{
|
[Help]Problem with NPC (don't see new NPC) and privateshop...
08/28/2010 - Metin2 Private Server - 0 Replies
Hello everybody ! First, excuse me for not talking german. So i have a huge problem on my server with the NPCs...
First of all, i can't see the private shop (ID 30 000) and i wanted to do a quest which will change the appearance of the player when he'll make a shop In Game. So where's is the problem ? Because i can see the files privateshop in the NPC2.eix and NPC2.epk...
Then, it's the same kind of problem when i try to add the new NPCs that we can find on this forum (NPCs like...
|
All times are GMT +1. The time now is 21:18.
|
|