Jump to content
  • 0
CyberDevil

Platinum Skills under payment

Question

Hi all,

can you correct this my script to make platinum skills payment? I'm not sure it works 100%... the original script is here: https://github.com/rathena/rathena/blob/master/npc/custom/platinum_skills.txt

prontera,128,200,6	script	Platinum Skill NPC	94,{
	mes "[Platinum Skill NPC]";
	mes "I can give you the special skills available to your job.";
	mes "The total cost is 100.000 zeny,";
	mes "but you can also get them for free by doing the quests!";
	mes "Would you like these skills now, paying?";
	next;
	if (select("Yes Please:No") == 2) {
		mes "[Platinum Skill NPC]";
		mes "Have a nice day... >.>";
		close;
	}
	if( Zeny <100000 ) {
		mes "You need 100.000 zeny.";
		close;
	}
	set Zeny,Zeny -100000;
	callfunc "F_GetPlatinumSkills";
	mes "[Platinum Skill NPC]";
	mes "There you go!";
	close;
}

 

Edited by CyberDevil
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

create a set script commands and add a conditional statement

example:
 

set "addparameter here"plat,0;

if ($plat == 1)  goto "proceedhere"

"proceed here if not";

set $plat,1;

proceedhere:

mes"you already take plat";

close;

 

 

Link to comment
Share on other sites

  • 0

no reason to set a needless variable when you can just determine if they have the skills or not

43 minutes ago, Poring King said:

create a set script commands and add a conditional statement

example:
 

set "addparameter here"plat,0;

if ($plat == 1)  goto "proceedhere"

"proceed here if not";

set $plat,1;

proceedhere:

mes"you already take plat";

close;

 

 

 

Link to comment
Share on other sites

  • 0
10 minutes ago, Z3R0 said:

no reason to set a needless variable when you can just determine if they have the skills or not

 

Yeah i agree. this is another way btw. i wrote a reply and idle for 30 mins so i did not see that there is already reply my bad .

  • Upvote 1
Link to comment
Share on other sites

  • 0

ok tnx... I have tested it with the skill id 145 like this:

	if (getskilllv(145)) {
		mes "[Platinum Skill Pusher]";
		mes "Hey buddy, you already have them, do not waste my time!";
		close;
	}

Sorry for my noob question, but how can I insert a multiple control over the other skills according to the class?

This is my test script in progress if you need:
 

harboro1,128,200,6	script	Platinum Skill Pusher	779,{
	mes "[Platinum Skill Pusher]";
	mes "Pssst, ehy you!";
	mes "Hand me ^0000FF100.000 zeny^000000 and you'll avoid a boring training, none will know!";
	mes "Man, there's no refund... are you sure you want it?";
	next;
	if (select("Yes Please:No") == 2) {
		mes "[Platinum Skill Pusher]";
		mes "Have a nice day... dude!";
		close;
	}
	if (getskilllv(145)) {
		mes "[Platinum Skill Pusher]";
		mes "Hey buddy, you already have them, do not waste my time!";
		close;
	}
	if( Zeny <100000 ) {
		mes "...ehy dude, you need ^0000FF100.000 zeny^000000,";
		mes "ask them to mom!";
		close;
	}
	set Zeny,Zeny -100000;
	callfunc "F_GetPlatinumSkills";
	mes "[Platinum Skill Pusher]";
	mes "Dehee thanks man... People lazy like you makes me rich buahah!";
	close;
}

 

Link to comment
Share on other sites

  • 0
5 hours ago, Z3R0 said:
if (Class = X && getskilllv(145) && getskilllv(#)) { mes "sorry"; close; }

There's probably some better ways to do it, but this is a basic way...

Use a switch(class) then either check in the switch or set skills in the switch and check after it (I would do latter)

  • Like 1
Link to comment
Share on other sites

  • 0
harboro1,128,200,6	script	Platinum Skill Pusher	779,{
        mes "[Platinum Skill Pusher]";
        mes "Pssst, ehy you!";
        mes "Hand me ^0000FF100.000 zeny^000000 and you'll avoid a boring training, none will know!";
        mes "Man, there's no refund... are you sure you want it?";
        next;
        if (select("Yes Please:No") == 2) {
                mes "[Platinum Skill Pusher]";
                mes "Have a nice day... dude!";
                close;
        }

		switch (Class) {		
	  case Job_Swordman:
		if (JobLevel < 35){
                mes "[Platinum Skill Pusher]";
                mes "Hey Dartagnan, your job level is too low, you must to be minimum Job Level 35 do not waste my time!";
                close;
                }
		if (getskilllv(144) && getskilllv(145) && getskilllv(146)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Swordy, you already have them, do not waste my time!";
                close;
				}
		break;
	   case Job_Mage:
		if (getskilllv(157)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Harry Potter, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Archer:
		if (getskilllv(147) && getskilllv(148)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Robin Hood, you already have them, do not waste my time!";
                close;
				}
		break;
		case Job_Acolyte:
		if (getskilllv(156)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey His Holiness, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Merchant:
		if (getskilllv(153) && getskilllv(154)&& getskilllv(155)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Amazon, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Thief:
		if (getskilllv(149) && getskilllv(150) && getskilllv(151) && getskilllv(152)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Lupin, you already have them, do not waste my time!";
                close;
				}
		break;		
	    case Job_Knight:
		if (getskilllv(1001)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Don Quixote, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Wizard:
		if (getskilllv(1006)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Gandalf, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Hunter:
		if (getskilllv(1009)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Legolas, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Priest:
		if (getskilllv(1014)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Messiah, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Blacksmith:
		if (getskilllv(1012) && getskilllv(1013)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Metal Head, you already have them, do not waste my time!";
                close;
				}
		break;		
	    case Job_Assassin:
		if (getskilllv(1003) && getskilllv(1004)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Fake Ninja, you already have them, do not waste my time!";
                close;
				}
		break;		
		case Job_Crusader:
		if (getskilllv(1002)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Holy Tin Can, you already have them, do not waste my time!";
                close;
				}
		break;
	    case Job_Sage:
		if (getskilllv(1007) && getskilllv(1008) && getskilllv(1017) && getskilllv(1018)&& getskilllv(1019)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Bookworm, you already have them, do not waste my time!";
                close;
				}
		break;		
		case Job_Bard:
		if (getskilllv(1010)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Tom Jones, you already have them, do not waste my time!";
                close;
				}
		break;		
		case Job_Dancer:
		if (getskilllv(1011)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Beyonce, you already have them, do not waste my time!";
                close;
				}
		break;	
		case Job_Monk:
		if (getskilllv(1015)&& getskilllv(1016)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Rocky, you already have them, do not waste my time!";
                close;
				}
		break;		
		case Job_Alchemist:
		if (getskilllv(238)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Heisenberg, you already have them, do not waste my time!";
                close;
				}
		break;	
		case Job_Rogue:
		if (getskilllv(1005)) {
                mes "[Platinum Skill Pusher]";
                mes "Hey Hobo, you already have them, do not waste my time!";
                close;
				}
		break;				
		default:
		break;
        }		    
                if( Zeny <100000 ) {
                        mes "...ehy dude, you need ^0000FF100.000 zeny^000000,";
                        mes "ask them to mom!";
                        close;
                }
                set Zeny,Zeny -100000;
                callfunc "F_GetPlatinumSkills";
                mes "[Platinum Skill Pusher]";
                mes "Dehee thanks man...lazy people like you makes me rich buahah!";
                close;
      
}

It looks like it works but I accept tips to improve it ... NPC is also quite "bastard"! XD

Link to comment
Share on other sites

  • 0

Untested, but makes for easy updating without a bunch of repetition...

harboro1,128,200,6	script	Platinum Skill Pusher	779,{

				function SetSkills;
				function SetJobLevel;
				function Validate;

        mes "[Platinum Skill Pusher]";
        mes "Pssst, ehy you!";
        mes "Hand me ^0000FF100.000 zeny^000000 and you'll avoid a boring training, none will know!";
        mes "Man, there's no refund... are you sure you want it?";
        next;
        if (select("Yes Please:No") == 2) {
                mes "[Platinum Skill Pusher]";
                mes "Have a nice day... dude!";
                close;
        }

        if( Zeny < [email protected] ) {
          mes "...ehy dude, you need ^0000FF100.000 zeny^000000,";
          mes "ask them to mom!";
          close;
        }

        Validate();
        
        set Zeny,Zeny -100000;
        callfunc "F_GetPlatinumSkills";
        mes "[Platinum Skill Pusher]";
        mes "Dehee thanks man...lazy people like you makes me rich buahah!";
        close;	      


    OnInit:
    	
    	SetSkills(Job_Swordman, 144, 145, 146);
    	SetJobLevel(Job_Swordman, 35);

    	SetSkills(Job_Mage, 157);
    	SetSkills(Job_Archer, 147, 148);
    	SetSkills(Job_Acolyte, 156);
    	SetSkills(Job_Merchant, 153, 154, 155);
    	SetSkills(Job_Thief, 149, 150, 151, 152);
    	SetSkills(Job_Knight, 1001);
    	SetSkills(Job_Wizard, 1006);
    	SetSkills(Job_Hunter, 1009);
    	SetSkills(Job_Priest, 1014);
    	SetSkills(Job_Blacksmith, 1012, 1013);
    	SetSkills(Job_Assassin, 1003, 1004);
    	SetSkills(Job_Crusader, 1002);
    	SetSkills(Job_Sage, 1007, 1008, 1017, 1018, 1019);
    	SetSkills(Job_Bard, 1010);
    	SetSkills(Job_Dancer, 1011);
    	SetSkills(Job_Monk, 1015, 1016);
    	SetSkills(Job_Alchemist, 238);
    	SetSkills(Job_Rogue, 238);

    	set [email protected], 100000;
    	end;

    // getarg(0) = Class ID
    // getarg(1+) = Skill ID
    function SetSkills {

    	// Skip 0 because that's Class ID, not a Skill ID
    	for([email protected] = 1; [email protected] <= getargcount(); [email protected]++) {
    		setd(".job_" + getarg(0) + "_skills["+([email protected] - 1)+"]", getarg([email protected])); // .job_ClassID[0] = SkillID 1, [1] = SKill ID2 etc...
    	}
    	return;
    }

    // getarg(0) = Class ID
    // getarg(1) = Job Level
    function SetJobLevel {
    	for([email protected] = 1; [email protected] <= getargcount(); [email protected]++) {
    		setd("job_" + getarg(0) + "_level", getarg(1));
    	}
    	return;
    }

    function Validate {

    	if (getd(".job_" + Class + "_level")) {
    		if (JobLevel < getd(".job_" + Class + "_level")) {
    			mes "You do not meet the Job Level Requirements";
    			close;
    		}
    	}

    	for([email protected] = 0; [email protected] < getarraysize(getd(".job_" + Class + "_skills")); [email protected]++) {
    		if (getskilllv(getd(".job_" + Class + "_skills["[email protected]+"]"))) {
    			mes "You have already received your skills";
    			close;
    		}
    	}

    	return;

    }

	      
}

 

Link to comment
Share on other sites

  • 0
1 hour ago, Z3R0 said:

Of course, you could do something much simpler :D

just....

set got_plat_skills, 1; // on a player when they receive them, and simply check it... :D

That's an unnecessary variable since you can just check the skills themselves.

Link to comment
Share on other sites

  • 0
On 18/4/2018 at 3:50 PM, Z3R0 said:
if (Class = X && getskilllv(145) && getskilllv(#)) { mes "sorry"; close; }

There's probably some better ways to do it, but this is a basic way...

 

[Error]: buildin_getarg: Index (idx=4) out of range (nargs=4) and no default value found
 

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.