Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/06/16 in all areas

  1. Hello. I'm trying to modify the source to enable a little announcement to the whole server each time a new party is added to the party booking system. However, I've found an issue I don't know how to solve. First, this is my modification, in party.c, at the end of void party_booking_register() char message[128]; sprintf(message,"%s is looking for %hu at level %hu-%hu to go to %s.", pb_ad->charname, job[0], level,level+10,map_mapid2mapname(mapid)); intif_broadcast(message,strlen(message)+1,0); There is a problem with this: The party booking system uses its own ID numeration to define jobs and maps. These ID values are read from the lua files, they are not server-side. So, if I try to convert these IDs to text (job name or map name) in the source code, the resulting value doesn't exist or it doesn't correspond to the map or job in the booking system. Can anyone help me with an idea to solve this? I know I could just create two arrays in the source that contain the job names and map names in the same order as in the party booking system... but I'd prefer to avoid doing that if there is a better solution. Thank you very much
    1 point
  2. For me this worked, but I only tested a few cases: clif_displaymessage(sd->fd,job_name(job-4)); Edit: Since this is stored as it is sent from the client and the requests are also processed like that, there currently is no translation table on serverside. Therefore you might need an array like this for jobs and another one for the maps: int jobs[] = { // Roles JOB_NOVICE, // think of something here JOB_NOVICE, JOB_NOVICE, JOB_NOVICE, // 1st JOB_SWORDMAN, JOB_MAGE, JOB_ARCHER, JOB_ACOLYTE, JOB_MERCHANT, JOB_THIEF, // 2nd JOB_KNIGHT, JOB_PRIEST, JOB_WIZARD, JOB_BLACKSMITH, JOB_HUNTER, JOB_ASSASSIN, JOB_CRUSADER, JOB_MONK, JOB_SAGE, JOB_ROGUE, JOB_ALCHEMIST, JOB_BARD, JOB_DANCER, // 3-1 JOB_RUNE_KNIGHT, JOB_WARLOCK, JOB_RANGER, JOB_ARCH_BISHOP, JOB_MECHANIC, JOB_GUILLOTINE_CROSS, // 3-2 JOB_ROYAL_GUARD, JOB_SORCERER, JOB_MINSTREL, JOB_WANDERER, JOB_SURA, JOB_GENETIC, JOB_SHADOW_CHASER, // 1st High JOB_SWORDMAN_HIGH, JOB_MAGE_HIGH, JOB_ARCHER_HIGH, JOB_ACOLYTE_HIGH, JOB_MERCHANT_HIGH, JOB_THIEF_HIGH, // 2nd High JOB_LORD_KNIGHT, JOB_HIGH_PRIEST, JOB_HIGH_WIZARD, JOB_WHITESMITH, JOB_SNIPER, JOB_ASSASSIN_CROSS, JOB_PALADIN, JOB_CHAMPION, JOB_PROFESSOR, JOB_STALKER, JOB_CREATOR, JOB_CLOWN, JOB_GYPSY, // Other JOB_WEDDING, JOB_NOVICE_HIGH, JOB_SUPER_NOVICE, JOB_GUNSLINGER, JOB_NINJA, JOB_TAEKWON, JOB_STAR_GLADIATOR, JOB_SOUL_LINKER, }; Then you can show the jobname with: clif_displaymessage(sd->fd,job_name(jobs[job[i]-1])); But you need to define the roles with hardcoded strings... I know that this is not the answer you wanted to hear, but it is like that at the moment and that might also be the reason why there is no custom option for such a feature in rAthena.
    1 point
×
×
  • Create New...