help with +13 to +15 talis npc.

01/21/2010 18:47 Zack666#1
well, i tryed to edit Hepatitis C npc for the above +12 item upgrade. but im not so great...i tryed this, and it doesnt work :D
Quote:
#region +13-15Talis
case 6666:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("I can make your Talis past +12. Would yo like my help?"));
GC.AddSend(Packets.NPCLink("Yeah", 250));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.Agreed = false;

}
else if (Control == 250)
{
GC.AddSend(Packets.NPCSay("Choose the equipment you want to plus."));
GC.AddSend(Packets.NPCLink("Fan", 1));
GC.AddSend(Packets.NPCLink("Tower", 2));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control >= 1 && Control <= 2)
{
Game.Item I = GC.MyChar.Equips.Get((byte)(Control));
if (I.Plus != 15)
{
byte YearBadgeNeed = 2;
if (I.Plus == 12)
YearBadgeNeed = 2;
else if (I.Plus == 13)
YearBadgeNeed = 3;
else if (I.Plus == 14)
YearBadgeNeed = 4;

if (!GC.Agreed)
{
GC.AddSend(Packets.NPCSay("You need " + YearBadgeNeed + " YearBadge to upgrade. Do you want it?"));
GC.AddSend(Packets.NPCLink("Yes.", Control));
GC.AddSend(Packets.NPCLink("Nevermind.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.Agreed = true;
}
else
{
GC.Agreed = false;
if (GC.MyChar.InventoryContains(710680, YearBadgeNeed))
{
GC.MyChar.EquipStats((byte)(Control), false);
for (byte i = 2; i < YearBadgeNeed; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(710680));
if (I.Plus == 12)
I.Plus = 13;
else
I.Plus += 0;
GC.MyChar.Equips.Replace((byte)(Control), I, GC.MyChar);
GC.MyChar.EquipStats((byte)(Control), true);

GC.AddSend(Packets.NPCSay("Here you are. It's done."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("You don't have enough YearBadge."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
}
}

break;
}
#endregion
01/22/2010 06:44 Arcо#2
Code:
#region +13-15Talis
case 6666:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("I can make your Talis past +12. Would yo like my help?"));
GC.AddSend(Packets.NPCLink("Yeah", 250));
GC.AddSend(Packets.NPCLink("Just passing by.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.Agreed = false;

}
else if (Control == 250)
{
GC.AddSend(Packets.NPCSay("Choose the equipment you want to plus."));
GC.AddSend(Packets.NPCLink("Fan", 10));
GC.AddSend(Packets.NPCLink("Tower", 11));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control >= 10 && Control <= 11)
{
Game.Item I = GC.MyChar.Equips.Get((byte)(Control));
if (I.Plus != 15)
{
byte YearBadgeNeed = 2;
if (I.Plus == 12)
YearBadgeNeed = 2;
else if (I.Plus == 13)
YearBadgeNeed = 3;
else if (I.Plus == 14)
YearBadgeNeed = 4;

if (!GC.Agreed)
{
GC.AddSend(Packets.NPCSay("You need " + YearBadgeNeed + " YearBadge to upgrade. Do you want it?"));
GC.AddSend(Packets.NPCLink("Yes.", Control));
GC.AddSend(Packets.NPCLink("Nevermind.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
GC.Agreed = true;
}
else
{
GC.Agreed = false;
if (GC.MyChar.InventoryContains(710680, YearBadgeNeed))
{
GC.MyChar.EquipStats((byte)(Control), false);
for (byte i = 2; i < YearBadgeNeed; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(710680));
if (I.Plus == 12)
I.Plus = 13;
else
I.Plus += 0;
GC.MyChar.Equips.Replace((byte)(Control), I, GC.MyChar);
GC.MyChar.EquipStats((byte)(Control), true);

GC.AddSend(Packets.NPCSay("Here you are. It's done."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("You don't have enough YearBadge."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
}
}

break;
}
#endregion
That should work.
What was happening is the controls are acting as the item's position.
The HeavenFan's position according to the source is 10 and the StarTower's position is 11. So in order for this to work you need the controls to correspond to the positions.
02/09/2010 01:34 salem rey#3
Thanks but i dont have +13 - +15 in my source...
02/09/2010 02:52 Arcо#4
Quote:
Originally Posted by salem rey View Post
Thanks but i dont have +13 - +15 in my source...
This isn't a release, he was asking for help on his code.
02/10/2010 04:24 salem rey#5
hmm can you make me an npc that make +15 from my items to my horse?