Jump to content
  • 0

Outdated jobs list?


Doch

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

http://rathena.org/wiki/Custom_Items

I have been looking the wiki, but the list of jobs doesn't have some like sniper, clown etc,

 

there's is another page with the list updated or something or what? or maybe im not understanding the function of the list and I can achieve these jobs making combinations of others or something? 0o

 

thanks in advance.

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

well you could do it like that to but you're algo is like 2^joblen then mine... because you will check lot of empty space.

Which job are not listed?

If you want for instance see if HighPriest can wear item i:

if(i.job & 0x00000100 && i.class & 2)

(if the job is priest and the base is trans then it's an high priest).

 

But yeah you need to parse the 2 column for high something, altought if you're goal is to see who could wear what you could probably do the 1st parse on i.class, then i.job for the remaining list.

On sql (assuming mysql) it will be a :

select * from item_db where equip_jobs&0x00000100 and equip_upper&2;

 

(untested but something very close to this)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

http://rathena.org/wiki/Custom_Items

I have been looking the wiki, but the list of jobs doesn't have some like sniper, clown etc,

 

there's is another page with the list updated or something or what? or maybe im not understanding the function of the list and I can achieve these jobs making combinations of others or something? 0o

 

thanks in advance.

(S.) Novice         (2^00): 0x00000001
Swordman            (2^01): 0x00000002
Mage                (2^02): 0x00000004
Archer              (2^03): 0x00000008
Acolyte             (2^04): 0x00000010
Merchant            (2^05): 0x00000020
Thief               (2^06): 0x00000040
Knight              (2^07): 0x00000080
Priest              (2^08): 0x00000100
Wizard              (2^09): 0x00000200
Blacksmith          (2^10): 0x00000400
Hunter              (2^11): 0x00000800
Assassin            (2^12): 0x00001000
Unused              (2^13): 0x00002000
Crusader            (2^14): 0x00004000
Monk                (2^15): 0x00008000
Sage                (2^16): 0x00010000
Rogue               (2^17): 0x00020000
Alchemist           (2^18): 0x00040000
Bard/Dancer         (2^19): 0x00080000
Unused              (2^20): 0x00100000
Taekwon             (2^21): 0x00200000
StarGladiator       (2^22): 0x00400000
Soul Linker         (2^23): 0x00800000
Gunslinger          (2^24): 0x01000000
Ninja               (2^25): 0x02000000
Gangsi              (2^26): 0x04000000
Death Knight        (2^27): 0x08000000
Dark Collector      (2^28): 0x10000000
Kagerou/Oboro       (2^29): 0x20000000
Rebellion           (2^30): 0x40000000
All Classes               : 0xFFFFFFFF
Every Job Except Novice   : 0xFFFFFFFE

This is the list of job values.

 

The entry that goes NEXT to it:

1  = Normal
2  = Reborn/Trans. Classes (High Wizards, Champions etc.) (excl. Trans-3rd classes)
4  = Baby Classes (excl. 3rd Baby Classes)
8  = 3rd Classes (excl. Trans-3rd classes and 3rd Baby classes)
16 = Trans-3rd Classes
32 = Baby 3rd Classes

Defines if its Non-Trans,baby , Trans, 3rd, Trans-3rd, or baby 3rd

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

uuhmm i see.., but the item_db structure doesn't have the class column like custom item has :

 

item_db:

 

ID,AegisName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,
Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }

 

custom item:

 

ID,DBName,ScreenName,Type,Price,Sell,Weight,ATK,DEF,Range,Slot,Job,Class,Gender,Loc,wLV,eLV,
Refineable,View,{Script},{OnEquip_Script},{OnUnequip_Script}

 

so, how I calculate the number to allow some object just to be used by a job? or how I decompose the number to know which jobs are in the number?

EX. 263168 -> Alchemist + Blacksmith

 

btw: thanks for the fast response

Edited by Doch
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

uuhmm i see.., but the item_db structure doesn't have the class column like custom item has :

 

item_db:

 

ID,AegisName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,

Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }

 

custom item:

 

ID,DBName,ScreenName,Type,Price,Sell,Weight,ATK,DEF,Range,Slot,Job,Class,Gender,Loc,wLV,eLV,

Refineable,View,{Script},{OnEquip_Script},{OnUnequip_Script}

 

so, how I calculate the number to allow some object just to be used by a job? or how I decompose the number to know which jobs are in the number?

EX. 263168 -> Alchemist + Blacksmith

 

btw: thanks for the fast response

0x00000400 + 0x00040000 = 0x00040400

 

As for sql entries I have no clue. I usually combine the values and paste it in and it autoconverts

501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,63,2,,,,,,{ itemheal rand(45,65),0; },{},{}

The class column is the 0xFFFFFFF

^item_db.txt

As for mysql

# id,name_english,name_japanese,type,price_buy,price_sell,weight,atk:matk,defence,range,slots,equip_jobs,equip_upper,equip_genders,equip_locations,weapon_level,equip_level,refineable,view,script,equip_script,unequip_script
501,Red_Potion,Red Potion,0,50,,70,,,,,4294967295,63,2,,,,,,itemheal rand(45,65),0;,, 

equip_jobs is the same thing as the class column

Edited by Pneuma
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

but as there no is job and class column i guess that equip_jobs has to have some kind of combination of both, the question is how, let's see if somebody knows  /yawn

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

but as there no is job and class column i guess that equip_jobs has to have some kind of combination of both, the question is how, let's see if somebody knows  /yawn

equip_jobs IS the class/job column though .-.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

but how I combine both numbers, class and job into equip_jobs? or how is supposed that equip_jobs work? i understand that every job has its number but i want to know how to make that classes that doesn't appear in the list, and how to descompose the number to know which jobs are in.

I know that per example in binary the thief class is 1000000 = 64 in decimal and mage is 100 = 4 in decimal so it will be 1000100, and both are combined, but also i want to know a way to descompose that number, i could check the position where is every 1 and know which numbers have, but in hexadecimal im not sure at all how to do it, or if there is the correct/easier way to do it (im coding in php btw)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

If I understand you correctly you trying to compare custom_item struct to item_db struct and feel a bit lost ? well actually the wiki may be confusing but the 2 file have the exact structure.

Job,Upper == Job,Class

job = restriction by player job attribute.

upper or class = restriction by group class, (like trans, baby etc)

 

Now you could very well put all the trans job combined into the job column and that will perform the same way as if you had put the restriction into upper. (although I may not sure about processing speed for this, but it will probably be at best equal or lower then the upper check)

 

The hexadecimal  and binary representation is quite the same. we just use hexa for easier representation.

Novice (2^00): hexa=0x1 bin=1 decimal=1

Swordman : hexa 0x2 bin=10 decimal=2

....

ok maybe my exemple suck but just look deeper into hexadecimal representation you'll see that we shift 1 bit up each time.

 

If you looking for a pseudo-code to deflat that number :

i=0; while(i < job_len) { if(field & 1<<i) job[i].authorised; i++ }

Basically we loop trough all the job we have and since each job is like job1=01, job2=10.. we just move our mask 1 bit up each time.

 

Hope I answered your question, but idk really what u looking for really =(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

Well,  what im trying to learn is how to descompose the job number to know which jobs combinations are in it, and also know how to make them, because some jobs are listed but some other not.

 

so the algorithm i thought to know the jobs in the number ( jobs that are listed ) is to represent the number in binary, and then from right to left, a counter that counts the positions ( zeros ) and when founds a 1 we get the first job, then the number is subtracted (?) from the job number and keeps counting till the end.

more or less:

for ( i = jobNumber.lenght(); i > 0; i--){
   if(job[i] == 0){
      continue;
   }else{
      // we get the number till now, and then substract to the job number
   }  
}

probably the algorithm is bullshit but right know i what i got. For know the jobs that are combinations of job and upper still don't have the clue because i don't undestand it at all.

Everything im making, at the end, is for make a SQL query to get the item that just some job can wear
 

Edited by Doch
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  79
  • Reputation:   6
  • Joined:  12/10/13
  • Last Seen:  

The problem ,per example, is if i want to list all the items that swordmans can wear, i have to have some way to know which items have the swordman mask/number/w.e in the column equip_jobs, because if i use its mask (swordman -> 0x00000002) we will list items that ONLY are for swordman.

 

but there are a lot of items that can be wore also by other jobs that are also for swordman, and won't be listed because are combination with others. And get first the equip_jobs number, use the algo and then check, is a mess.. so this is the main problem that i have: list items by the job that i want

 

EDIT: didn't know about the existence of bitwise operators in mysql, i guess that are the solution for this case

 

thanks @Lighta and @Pneuma for all :)

Edited by Doch
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...