View Single Post
  #19  
Old 10-11-2001, 09:21 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
The thing that takes up so much space in my Custom Inventory npc is that I have to have keydown code for like, 3 or 4 different modes. This is what one looks like. This is the 'D' key code for the modes that require the default item select window to open.
NPC Code:

if (this.keys[4]==1 && !this.4kd) {
x=playerx+1.5;
y=playery+2;
play rha_system_cursorselect.wav;
if (this.inventory_mode==1) {
setstring this.inventory_itemsift,-Item;
} else if (this.inventory_mode==7) {
setstring this.inventory_itemsift,#s(this.inventory_EW_Sift) ;
} else if (this.inventory_mode==4) {
setstring this.inventory_itemsift,-Magic;
} else if (this.inventory_mode==3) {
setstring this.inventory_itemsift,-Skill;
}
set this.inventory_ItemChoose;
InventoryDrawItems();
for (this.i=0;this.i<100;this.i++) {
hideimg 1000+this.i;
}
hideimg 996;
hideimg 997;
if (!this.inventory_mode==7) {
set this.inventory_noclosesound;
this.inventory_selectedItem=0;
this.inventory_selectedItem_line=1;
this.inventory_mode=0;
for (this.i=0;this.i<100;this.i++) {
hideimg 1400+this.i;
}
InventoryClose();
callweapon this.inventory_getItem,used;
} else {
this.inventory_selectedItem=0;
this.inventory_selectedItem_line=1;
this.inventory_EW_equipitem=this.inventory_getItem ;
this.inventory_mode=2;
}
unset this.infogot;
setstring client.ItemInfo,;
set this.4kd;
}
if (this.keys[4]==0 && this.4kd) { unset this.4kd; }

__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote