if not no big deal just thought looping it would save lines in the include file of my in progress upgrade of my item leveling system http://nwvault.ign.c...=198690&id=3807 .
since the way it is now i have it do whats in in that do loop at the section refering to those slots not in a loop and it works how i want it to but was wondering if i could reduce the number of lines total by looping this section since its used 7 times to do the same exact thing for a different item slot each time.
this is what i mean by item slot
object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, GetLastKiller());
do
{
//setting the item's orginal name
if (GetLocalInt(oItem, "Killed")== 0)
{
SetLocalInt(oItem, "Killed", 1);
SetLocalString(oItem, OriginalName, GetName(oItem));
}
//rename the items based on their levels
sNewName = GetName(oItem,TRUE);
if (GetLocalInt(oItem, "itemlevel")> 1) SetName(oItem, (sNewName + " Level " + IntToString(GetLocalInt(oItem, "nItemLevel"))));
} while (GetIsObjectValid(oItem));
Modifié par Ryuhi2000, 16 avril 2011 - 02:03 .





Retour en haut






