Jump to content
  • 0

Information about the quest_warpra script


Valcars

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  01/03/16
  • Last Seen:  

hi everyone and as usual here I am annoying you with my questions xD .....
I wanted to know some information because I didn't understand very well how he does it ....
In practice the npc quest_warpra saves the unlocked maps in a global account variable .... and so far everything is ok .... what I can't understand how does it know which maps you have unlocked .... that is the variables global have as a value a number that I do not think is the id of the map .... so how does the NPC know which map I have unlocked ???? sorry for the hassle but i'm creating a similar npc warpra and i'm stuck to the unlock system .....

 

I put an image to make you understand better ....
To be premised that I have unlocked morroc, prontera, izlude ... my question is how did it generate that number ???

and from that number how do you know the unlocked maps?

Immagine.png

Edited by Valcars
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

using the left/right shift operators to binary mathematical operations as they have two important qualities: Left-shifting a bitmask once multiplies by two. Right-shifting once divides by two.

assuming the following scenario

1 = map_1
2 = map_2
4 = map_3
8 = map_4
16 = map_5
32 = map_6
64 = map_7

when you sum up the value for 1 + 2 + 4 + 8 = 15 (you have access to map1 , map2, map3, map4)

when you sum up the value for 4 + 16 + 64 = 84 (you have access to map3, map5, map7)

when you sum up all the values , then you have access to all map above.

you could only store up to total value of 2147483647

Link to comment
Share on other sites

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...