Jump to content
  • 0

Interlude Ai.obj Function - Ownitemcount (Id>= Xxxx)


khul

Question

Hello all,

 

I wonder if there is a way for an npc to check if a character has an item with ID is between XXX and ZZZ, save such item ID on  variable and then delete such item. Im new to AI and this is the main idea im trying to achieve.... please pardon how crude this looks...i will use @nobless_tiara just for example
 

Example: 

EventHandler TALKED( talker, i0 )
{
  If  (Talker.(OwnitemCount (ID>= XXX && ID <=ZZZ) >=1) >=1) 
  {
    i0 = Talker.(OwnitemCount (ID>= XXX && ID <=ZZZ) >=1)
    myself::DeleteItem1( talker, i0, 1 );
    myself::GiveItem1( talker, @nobless_tiara, 1 );
  }
}

I'd also take on alternative ideas :)

Edited by khul
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

AFAICT you have to specify all the ids and check them separately, something like this:

 

In CREATED handler of the NPC:

myself.int_list.Add( ID1 );
myself.int_list.Add( ID2 );
myself.int_list.Add( ID3 );
myself.int_list.Add( ID3 );
... 

And then in TALKED handler loop trough the int_list and remove all the items:

for( i0 = 0; i0 <= myself.int_list.GetSize(); ++i0 ) {
  i1 = myself.int_list.Get( i0 );
  if( OwnItemCount( talker, i1 ) > 0 ) {
    DeleteItem1( talker, i1 );
    ... // do other stuff
  }
} 

Hope this helps.

Edited by jornik
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • 🎃 Spook up your server with exclusive Halloween mods for Lineage 2! Are you ready to give your players the ultimate Halloween experience? We’ve got everything you need to transform your world into a Halloween wonderland! 👇   🧙‍♀️ What’s here: Haunted costumes and spooky skins 👗🕸️ Terrifying weapons and accessories ⚔️🎃 Enchanted mounts 🐴🧛 Pumpkin decor, eerie environments, and more!   Whether it's special Halloween events, contests, or just a seasonal makeover, your server will stand out in the crowd! 🎉   🔥 Why choose? High-quality assets for the best visual experience. Easy integration for both old and new server protocols.   Don’t miss this chance to treat your players to something unforgettable. Pricing varies depending on the mod you choose! 🎃 Some start from as low as 5 or 10, while others are priced at 25 and up. What caught your attention? Let us know and we’ll provide more details!   Skype: Support_La2-Pro ( Add now ) Discord: NevesOma#3182 Discord: nevesoma                                      
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • For interlude impossible without edits .dll files...
    • Hi man,    LF skilled interface dev with time... need add debuffs features on target wnd for mobs/players   PM here or write me to discord thx.
    • Hello i want buy autofarm like scrreen for h5 server thank you        
  • Topics

×
×
  • Create New...