Jump to content
  • 0

R> Save Variable Job Name


Mihael

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   71
  • Joined:  09/03/14
  • Last Seen:  

Hey guys,

I need a variable that saves the player's job name and show me that name.

Like that:

Name: Player 1 - Job: Thief
Name: Player 2 - Job: High Wizard
Name: Player 3 - Job: Champion

Someone help me?

 

Edited by Mihael
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   71
  • Joined:  09/03/14
  • Last Seen:  

On 7/19/2019 at 3:52 PM, llchrisll said:

Like Class > jobname(Class) ?

Next time read the doc/ script_commands. txt since stuff like that is stated there.

No, this is not what I need. Jobname(Class) returns me the name of the class you are, not the class that other players are.

And yes I read the script_commands...

I would not have opened a topic if I had found what I asked for.

 

@edit

I found the logic I wanted, thank you for your attention.

~> http://daemosnet.gotdns.com/files/developers/eAthena-SVN-9162-stable-TXT-W32/npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt

 

//===== eAthena Script ======================================= 
//= Global functions
//===== By: ================================================== 
//= Skotlex 
//===== Current Version: ===================================== 
//= 1.5
//===== Compatible With: ===================================== 
//= eAthena SVN R3424+, RO Ep6+
//===== Description: ========================================= 
//= Global Functions
//= 
//===== Additional Comments: ================================= 
//= GF_getJobName= function for getting a job's name
//= GF_getJobName2= gets a jobs name modified by Type (see below)
//= GF_getJobId=  gets a jobs number modified by Type (see below)
//= GF_getJobLevel= identifies novices/1st/2nd among classes
//= GF_getJobType= identifies normal/advanced/babies classes
//= - GF_getJobClass= identifies job class (swordie, mage, etc)
//============================================================ 

function	script	GF_getJobName	{

	switch (getarg(0)) {

	case Job_Novice:
		return "novice";
	case Job_Acolyte:
		return "acolyte";
	case Job_Archer:
		return "archer";
	case Job_Mage:
		return "mage";
	case Job_Merchant:
		return "merchant";
	case Job_Swordman:
		return "swordsman";
	case Job_Thief:
		return "thief";
	case Job_Taekwon:
		return "taekwon kid";
	case Job_SuperNovice:
		return "super novice";
		
	case Job_Hunter:
		return "hunter";
	case Job_Dancer:
		return "dancer";
	case Job_Bard:
		return "bard";
	case Job_Priest:
		return "priest";
	case Job_Monk:
		return "monk";
	case Job_Wizard:
		return "wizard";
	case Job_Sage:
		return "sage";
	case Job_BlackSmith:
		return "blacksmith";
	case Job_Alchem:
		return "alchemist";
	case Job_Knight:
	case Job_Knight2:
		return "knight";
	case Job_Crusader:
	case Job_Crusader2:
		return "crusader";
	case Job_Assassin:
		return "assassin";
	case Job_Rogue:
		return "rogue";
	case Job_Star_Gladiator:
	case Job_Star_Gladiator2:
		return "star gladiator";
	case Job_Soul_Linker:
		return "soul linker";
		
	case Job_Novice_High:
		return "high novice";
	case Job_Acolyte_High:
		return "high acolyte";
	case Job_Archer_High:
		return "high archer";
	case Job_Mage_High:
		return "high mage";
	case Job_Merchant_High:
		return "high merchant";
	case Job_Swordman_High:
		return "high swordsman";
	case Job_Thief_High:
		return "high thief";
		
	case Job_Assassin_Cross:
		return "assassin cross";
	case Job_Champion:
		return "champion";
	case Job_Clown:
		return "minstrel";
	case Job_Creator:
		return "biochemist";
	case Job_Gypsy:
		return "gypsy";
	case Job_High_Priest:
		return "high priest";
	case Job_High_Wizard:
		return "high wizard";
	case Job_Lord_Knight:
	case Job_Lord_Knight2:
		return "lord knight";
	case Job_Paladin:
	case Job_Paladin2:
		return "paladin";
	case Job_Professor:
		return "professor";
	case Job_Sniper:
		return "sniper";
	case Job_Stalker:
		return "stalker";
	case Job_Whitesmith:
		return "whitesmith";

	case Job_Baby:
		return "baby";
	case Job_Baby_Acolyte:
		return "baby acolyte";
	case Job_Baby_Archer:
		return "baby archer";
	case Job_Baby_Mage:
		return "baby mage";
	case Job_Baby_Merchant:
		return "baby merchant";
	case Job_Baby_Swordman:
		return "baby swordsman";
	case Job_Baby_Thief:
		return "baby thief";
	case Job_Super_Baby:
		return "super baby";

	case Job_Baby_Hunter:
		return "baby hunter";
	case Job_Baby_Dancer:
		return "baby dancer";
	case Job_Baby_Bard:
		return "baby bard";
	case Job_Baby_Priest:
		return "baby priest";
	case Job_Baby_Monk:
		return "baby monk";
	case Job_Baby_Wizard:
		return "baby wizard";
	case Job_Baby_Sage:
		return "baby sage";
	case Job_Baby_BlackSmith:
		return "baby blacksmith";
	case Job_Baby_Alchem:
		return "baby alchemist";
	case Job_Baby_Knight:
	case Job_Baby_Knight2:
		return "baby knight";
	case Job_Baby_Crusader:
	case Job_Baby_Crusader2:
		return "baby crusader";
	case Job_Baby_Assassin:
		return "baby assassin";
	case Job_Baby_Rogue:
		return "baby rogue";
	default:
		return "unknown";
	}

}

//Returns job name using two params: JobId and Type
function	script	GF_getJobName2	{
	set @classId, callfunc("GF_getJobId", getarg(0), getarg(1));
	return callfunc("GF_getJobName", @classId);
}

//Returns a Job's ID modified by their Type
function	script	GF_getJobId	{
	set @classId, getarg(0);
	set @type, getarg(1);

	if (@classId == Job_SuperNovice || @classId == Job_Super_Baby) {
		switch (@type) {
		case 0:
			return Job_SuperNovice;
		case 2:
			return Job_Super_Baby;
		default:
			return @classId;
		}
	}
	if (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker) {
		//Currently has no alternates.
		return @classId;	
	}
	if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
		set @classId, @classId -Job_Novice_High;
	else 	
	if (@classId >= Job_Baby && @classId <= Job_Super_Baby)
		set @classId, @classId -Job_Baby;
		
	if (@type == 1)
		set @classId, @classId +Job_Novice_High;
		
	if (@type == 2)
		set @classId, @classId +Job_Baby;

	return @classId;
}

//Returns the type of class:
//0= Novice, 1= First Class, 2= Second Class, 3= Super Novice
//4= Wedding
function	script	GF_getJobLevel	{

	set @classId, getarg(0);
	
	if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
		set @classId, @classId -Job_Novice_High;

	if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2)
		set @classId, @classId -Job_Baby;
	
	if(@classId == Job_Novice) {
		return 0;
	}
	if((@classId >= Job_Swordman && @classId <= Job_Thief)
		|| @classId == Job_Taekwon) {
		return 1;
	}
	if ((@classId >= Job_Knight && @classId <= Job_Crusader2)
	|| (@classId >= Job_Star_Gladiator && @classId <= Job_Soul_Linker)) {
		return 2;
	}
	
	if(@classId == Job_SuperNovice || @classId == Job_Super_Baby) {
		return 3;
	}
	if(@classId == 22) {
		return 4;
	}
	return -1;
}

//Returns the type of class, based on path:
//0= Normal Jobs, 1= Upper Jobs, 2= Baby Jobs
//Works the same as Upper, except you can pass any job id to get it's upper value
function	script	GF_getJobType	{
	set @classId, getarg(0);
	
	if ((@classId >= Job_Novice && @classId <= Job_SuperNovice) 
		|| (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker)) {
		return 0;
	}
	if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) {
		return 1;
	}
	if (@classId >= Job_Baby && @classId <= Job_Super_Baby) {
		return 2;
	}
	return -1;
}
//Returns the base class of the given job, return values are:
//Job_Novice (Novice, Baby Novice, Super Novice
//Job_Acolyte (Aco, Priest, Monk +High/Baby variations)
//Job_Archer (Archer, Sniper, Bard, Dancer +High/Baby variations)
//Job_Mage (Mage, Wizard, Sage +High/Baby variations)
//Job_Swordman (Swordsman, Knight, Crusader +High/Baby variations)
//Job_Thief (Thief, Assassin, Rogue +High/Baby variations)
//-1 : others (when wearing Tux/Wedding dress, for example)
//Works the same as baseClass, except you pass the class which you want
//examined.
function	script	GF_getJobClass	{
	set @classId, getarg(0);
	
	if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
		set @classId, @classId -Job_Novice_High;

	if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2)
		set @classId, @classId -Job_Baby;
	
	switch (@classId) {
	case Job_Novice:
	case Job_SuperNovice:
	case Job_Super_Baby:
		return Job_Novice;
		
	case Job_Acolyte:
	case Job_Priest:
	case Job_Monk:
		return Job_Acolyte;
		
	case Job_Archer:
	case Job_Hunter:
	case Job_Bard:
	case Job_Dancer:
		return Job_Archer;
	
	case Job_Mage:
	case Job_Wizard:
	case Job_Sage:
		return Job_Mage;

	case Job_Merchant:
	case Job_BlackSmith:
	case Job_Alchem:
		return Job_Merchant;
	
	case Job_Swordman:
	case Job_Knight:
	case Job_Knight2:
	case Job_Paladin:
	case Job_Paladin2:
		return Job_Swordman;
		
	case Job_Thief:
	case Job_Assassin:
	case Job_Rogue:
		return Job_Thief;

	case Job_Taekwon:
	case Job_Star_Gladiator:
	case Job_Star_Gladiator2:
	case Job_Soul_Linker:
		return Job_Taekwon;

	default:
		return -1;
	}
}
Edited by Mihael
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   189
  • Joined:  11/19/11
  • Last Seen:  

Like Class > jobname(Class) ?

Next time read the doc/ script_commands. txt since stuff like that is stated there.

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