Jump to content
  • 0

How does getitem2 works?


drifterxxxx2

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  83
  • Reputation:   3
  • Joined:  10/22/17
  • Last Seen:  

Hi

I'm trying to make Woe potion boxes so I set battleflag 'woe_reserved_char_id' and added to a NPC script 

i.e. the NPC gives me Woe's White Potion, this item will only work in Woe time

Until now i'm perfectly fine and everything works

So now I'm trying to make a box of Woe's White Potion and found this old script in eAmod

{ getitem2 504,50,1,0,0,254,0,getbattleflag("woe_reserved_char_id")&0xffff,(getbattleflag("woe_reserved_char_id")>>16)&0xffff; }

 

Following script_commands.txt I understand almost everything in 'getitem2', except from this

	// First, let's get an ID of a character who's name will be on the item.
	// Only an existing character's name may be there.
	// Let's assume our character is 'Adam' and find his ID.
	@charid = getcharid(0,"Adam");

	// Now we split the character ID number into two portions with a binary
	// shift operation. If you don't understand what this does, just copy it.
	@card3 = @charid & 65535;
	@card4 = @charid >> 16;

 

My problem is the box is not opening in Woe times (the item alone works perfectly fine) 

What am I getting wrong here? how does this binary shift works? what is &0xffff?

/thx 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...