Jump to content
  • 0

Guild Salary


itsmeyoe

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

Hi guys i wanna ask a script like this during woe i activate 3 map

Kriem Swan and Fad

I want the salary of GL depends on the castle he own.

Example:

Kriemhild holder 30 Tcg

Swanhild holder 20 Tcg

Fad 10 Tcg

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Here is the final script.
 

prontera,150,150,5	script	Guild Salary Manager	109,{

	if (!getcharid(2) || getguildmasterid(getcharid(2)) != getcharid(0)) {
		mes "[Manager]";
		mes "Only Guild Masters are allowed to use my services.";
		close;
	}

	if (salary_received) {
		mes "[Manager]";
		mes "You already got you reward... Maybe next week...";
		close;
	}

	mes "[Manager]";
	mes "I need to check if you are the owner of any active castle in order to proceed with your payment...";
	next;

	set .@count, getarraysize(.castle_salary$);
	for (set .@i, 0; .@i < .@count; set .@i, .@i + 3) {
		if (getcastledata(.castle_salary$[.@i],1) == getcharid(2)) {
			getitem atoi(.castle_salary$[.@i + 1]), atoi(.castle_salary$[.@i + 2]);
			set salary_received, 1;
		}
	}

	mes "[Manager]";
	mes (salary_received ? "Congratulations, you have a Castle and deserve a reward!" : "Unfortunately you need at least one Castle to earn a reward.");
	close;

// Arg(0): castle_map
// Arg(1): item_id
// Arg(2): amount
S_setCastleSalary:
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(0);
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(1);
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(2);
	return;

OnAgitEnd:
OnAgitEnd2:
OnAgitEnd3:
	query_sql "DELETE FROM `char_reg_num` WHERE `key` = 'salary_received'";
	end;

OnInit:
	callsub(S_setCastleSalary, "prtg_cas01", "501", "10");
	callsub(S_setCastleSalary, "prtg_cas02", "501", "10");
	callsub(S_setCastleSalary, "prtg_cas03", "501", "10");
}

Att,
_Okuz_.

Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Hello buddy, how are you!?

Here is what you want, please test and tell me if it fits your needs.

prontera,150,150,5	script	Guild Salary Manager	109,{

	if (!getcharid(2) || getguildmasterid(getcharid(2)) != getcharid(0)) {
		mes "[Manager]";
		mes "Only Guild Masters are allowed to use my services.";
		close;
	}

	mes "[Manager]";
	mes "I need to check if you are the owner of any active castle in order to proceed with your payment...";
	next;

	set .@count, getarraysize(.castle_salary$);
	for (set .@i, 0; .@i < .@count; set .@i, .@i + 3) {
		if (getcastledata(.castle_salary$[.@i],1) == getcharid(2)) {
			getitem atoi(.castle_salary$[.@i + 1]), atoi(.castle_salary$[.@i + 2]);
			set .@received, 1;
		}
	}

	mes "[Manager]";
	mes (.@received ? "Congratulations, you have a Castle and deserve a reward!" : "Unfortunately you need at least one Castle to earn a reward.");
	close;

// Arg(0): castle_map
// Arg(1): item_id
// Arg(2): amount
S_setCastleSalary:
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(0);
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(1);
	set .castle_salary$[getarraysize(.castle_salary$)], getarg(2);
	return;

OnInit:
	callsub(S_setCastleSalary, "prtg_cas01", "501", "10");
	callsub(S_setCastleSalary, "prtg_cas02", "501", "10");
	callsub(S_setCastleSalary, "prtg_cas03", "501", "10");
}

To put the rewards do this:

callsub(S_setCastleSalary, "<castle_map>", "<item_id>", "<amount>");

PS: You can put more than one reward per castle, it's up to you.

Att,
_Okuz_.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

Going to check this out later on sir thank you.

If i wanna add another castle i neee to put another set ane sub?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

You are always welcome!

Take a look at this point:

 

To put the rewards do this:

callsub(S_setCastleSalary, "<castle_map>", "<item_id>", "<amount>");

 

Let's say we want to put a reward for Skoegul, then the OnInit: will be looking like this:

OnInit:
        // Line format:
        // callsub(S_setCastleSalary, "<castle_map>", "<item_id>", "<amount>");

	callsub(S_setCastleSalary, "prtg_cas01", "501", "10"); // Kriemhild
	callsub(S_setCastleSalary, "prtg_cas02", "501", "10"); // Swanhild
	callsub(S_setCastleSalary, "prtg_cas03", "501", "10"); // Fadhgridh
	callsub(S_setCastleSalary, "prtg_cas04", "501", "10"); // Skoegul (new line)
}

EDIT--
Mmm can you tell me when and how do you wish to reward your GL!?

Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

I think that npc will work sir, i cant try it now because the server is not hosted.

i dont have Beta Files

This script only give item 501,10 pcs to GL right? if he/she is the owner of the castle?


Do i need to put another set .castle_salary$[getarraysize(.castle_salary$)], getarg(2); if i want to add new castle?


What if he got 2 castle? he/she will received 20 501 right?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Hi,

PAY ATTENTION... YOU JUST NEED TO PUT NEW LINES IN THE END OF THE ONINIT... DONT TOUCH ANY OTHER PARTS OR YOU GONNA SCREW UP EVERYTHING.

Take a look at my second post, I gave you an example by enabling rewards for Skoegul... please follow that example if you want to put more rewards for more castles... If they got 2 castles then they will receive the rewards according to your configurations found in the CALLSUBS();

PS: Still missing the point of how many times those GL are able to receive their reward... The way it is now they will get as many rewards as they want just by clicking the NPC... If you want them to receive only one reward per WoE or something like this I have to adjust some things.

Att,
_Okuz_

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

yes that should be only one reward per woe. Example Swan Reward: 20 Tcg Fad reward 10 TCG if the GL Click the npc he will received 30 tcg

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

This NPC won't trigger if i set Woe to Monday GL Can't click it on Tuesday Right?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Nope. Any GL will be able to pick up their guild reward as soon as the WoE ends, but they will be able to take only one reward per WoE.

Let's say you are the GL of your guild and you conquered Kriem on Monday's WoE. Then you'll be able to pick up the reward on Tuesday, but let's say that you have not picked it up yet, and another guild conquered your castle. In this case, unfortunately you have lost your reward.

If you want something more specific you must give us more details on how it should work.

Att,
_Okuz_.

Edited by _Okuz_
Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  80
  • Reputation:   0
  • Joined:  07/03/12
  • Last Seen:  

How about multiple item per GC?

callsub(S_setCastleSalary, "<castle_map>", "<item_id>", "<amount>","<item_id>","<amount>");

/whisp

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