[Help] ArtisanWind

06/24/2011 05:00 Jay10291#1
The NPC checks the players level to see weather or not the items level will be too high after upgrading. If the items level exceeds yours after an upgrade the NPC wont allow you p upgrade and will tell you to go level up. However, the NPC does this check and treats the player as if their level is too low even when it isnt. Ive tried a combination if different things but nothing works so here's the orig code. Hopefully someone can point me in the right direction.
Code:
if (infos.BaseInformation.Level [COLOR="Red"]-[/COLOR] infos.CalculateUplevel() > client.Entity.Level)
                                {
                                    dialog.Text("The level after upgrading will be too high. Go level up more!");
                                    dialog.Link("Alright", 255);
                                    dialog.Avatar(50);
                                    dialog.Send();
                                    return;
                                }[CODE]
[/CODE]
Edit* The little - was a + before which made it neglect to do check at all. Changing it to - made it check and give the wrong answer everytime.
06/24/2011 15:11 { Angelius }#2
this (infos.BaseInformation.Level - infos.CalculateUplevel())

what does it have to return exactly and why is it 2 values not only one ?

in your calculation void all you need to do is to check for the next levelreq for that item that is being upgraded and return a bool or a value . so

IE.
Quote:
public static bool CanUpgrade(uint ItemID, uint ClientLevel)
{
uint Nextlevel = look up your baseItems dictionary for the next level using the ItemID(you need to figure out how to code this one);
do all your checks .
if (the new level was found and its not the highest level for the item)
return true;
else return false;
}
the npc should check for something like .

Quote:
if (!CanUpgrade(ItemID, client.Entity.Level))
{
do the thing /
}
and to make it easier you can mix the (find the new level for the item and the can upgrade void together and thats gonna be less time/work)