can someone tell me whats wrong with this npc,when I put 5 tortoise gems in the boxes it says i need 5 tortoise gems to make my item -3,but when I click Upgrade the tortoise gems wont remove / dissapear,and my - damage can be upgraded to infinity and I can get -99999.
note: i want it to remove the tortoise gems when I click Upgrade and the max - damage I want it to -7 max,i don't want it to go past -7. thanks
here is the npc: tell me what to remove / add
Code:
#region Ethereal
case 35015:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Heya! I'm the master of blessing gears, I can bless any of your ");
dialog.Text("gears, except talismans and garments, and for that i'll charge ");
dialog.Text("only some super TortoiseGems.");
dialog.Link("Let's begin!", 1);
dialog.Link("Let me think.", 255);
dialog.Avatar(104);
dialog.Send();
break;
}
case 1:
{
GeneralData oven = new GeneralData(true);
oven.UID = client.Entity.UID;
oven.ID = 126;
oven.dwParam = 426;
oven.wParam1 = client.Entity.X;
oven.wParam2 = client.Entity.Y;
oven.Send(client);
break;
}
default:
{
IConquerItem Item = client.Equipment.TryGetItem(npcRequest.OptionID);
if (Item != null)
{
if (Item.ID > 0)
{
byte nUmber = 0;
switch (Item.Bless)
{
case 0: nUmber = 5; break;
case 1: nUmber = 1; break;
case 3: nUmber = 3; break;
case 5: nUmber = 5; break;
default: nUmber = 0; break;
}
if (nUmber == 0)
{
dialog.Text("I can't upgrade this gear bless, sorry.");
dialog.Link("I see, thanks.", 255);
dialog.Avatar(104);
dialog.Send();
return;
}
if (!client.Agreed)
{
dialog.Text("Your item will need some super tortoises to get better, ");
dialog.Text("I'll charge some " + nUmber + " super tortoises. Are you ready?");
dialog.Link("Wow, good deal!", npcRequest.OptionID);
dialog.Link("Let me think.", 255);
dialog.Avatar(104);
dialog.Send();
client.Agreed = true;
return;
}
if (client.Inventory.Contains(700073, nUmber))
{
client.Entity.ClientStats.AppendRemove(Item);
client.Inventory.Remove(700073, nUmber);
Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
//if (Item.Bless < 7)
if (Item.Bless == 0) Item.Bless = 1;
else Item.Bless += 2;
Item.Send(client);
Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
ConquerItemTable.UpdateItem(Item, client);
client.Entity.ClientStats.AppendAddition(Item);
client.Agreed = false;
}
else
{
dialog.Text("You don't have " + nUmber + " super tortoise gems!");
dialog.Link("I'll be right back!", 255);
dialog.Avatar(104);
dialog.Send();
}
}
else
{
dialog.Text("Please wear your gear first!");
dialog.Link("I'll be right back!", 255);
dialog.Avatar(104);
dialog.Send();
}
}
else
{
dialog.Text("Please wear your gear first!");
dialog.Link("I'll be right back!", 255);
dialog.Avatar(104);
dialog.Send();
}
break;
}
}
break;
}
#endregion
it's commented out and not doing anything extra so I'd just do
if(Item.Bless > 6)
return;
Personally the whole thing isn't that well coded (IE: why are you switching based on bless to pull a number... and then switching based on the number pulled lol)
IE...
switch(item.Bless)
{
case 0:
if(client.Inventory.Contains(700073, 5))
item.Bless = 1;
break;
case 1:
if(client.Inventory.Contains(700073,1))
item.Bless = 3;
break;
case 3:
if(client.Inventory.Contains(700073, 3))
item.bless = 5;
break;
case 5:
if(Client.Inventory.Contains(700073, 5))
item.bless = 7;
break;
}
That's all you'd need to do for the entire cost/modification stuff... add in the actual removal code and perhaps some nice output so the client knows what has happened but yah...
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Heya! I'm the master of blessing gears, I can bless any of your ");
dialog.Text("gears, except talismans and garments, and for that i'll charge ");
dialog.Text("only some super TortoiseGems.");
dialog.Link("Let's begin!", 1);
dialog.Link("Let me think.", 255);
dialog.Avatar(104);
dialog.Send();
break;
}
case 1:
{
GeneralData oven = new GeneralData(true);
oven.UID = client.Entity.UID;
oven.ID = 126;
oven.dwParam = 426;
oven.wParam1 = client.Entity.X;
oven.wParam2 = client.Entity.Y;
oven.Send(client);
break;
}
i guess the linkback is sending it to a gui .... why are you trying to use the default??
yes the link back sending to a gui.... thats why I tell him to check packethandler... because I that problem tooo I just put the condition if (Item.Bless < 7 ) but I know there is a good correction for that... because to take dmg -7 we should take 14 tortois but it only take 5 in mine.... 12tails/leo do you have fix for that please....
i need ethereal fix npc (who make -damag) 01/01/2010 - CO2 Private Server - 5 Replies i need ethereal fix npc (who make -damag)
my npc can only make damag -2 :7
i need fix npc to make -1
and i need MoonGoddess
given weps and item without ninja gear +12 -7
and npc given moonbox and pro item
help my Ethereal NPC 08/24/2009 - CO2 Private Server - 2 Replies hi plz help my give my translate Ethereal NPC.
Sorry for my English
[Request] ethereal task 05/10/2009 - CO2 Private Server - 4 Replies Need task for ethereal because mine not work
tnx