Jump to content
  • 0

Adding more features as they pay more


ToiletMaster

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

HI guys,

 

Having an issue with scripting at the moment.

 

Currently i have an npc that provides agi  & bless lvl 5 upon click the NPC.

 

However, if let's say i'd like to add a feature that allows them to use zeny to upgrade the agi / bless and adding more buffs like kylie elison and the rest, how do i do that?

 

The only method i could think of is putting 2 seperate npc and setting a variable each time they upgrade.

 

like set upgrade,1;  then it'll be agi lvl 6 and bless lvl 5

 

then set upgrade,2; will be agi lvl 6 and bless lvl 6.

 

But if they mix around then it'll be hard to maintain this. Is there anything i'm missing currently?

 

Thanks!

Link to comment
Share on other sites

23 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

but just to confirm this works with multiple npcs right? o_O if i make a

new one it wont be affected and they have to reupgrade it am i right?

If you make a duplicate of the npc (the npc for up the healer or the healer), they wouldn't have to re-up the skill... you wanted the guildmaster have to re-up the skill if you had another duplicate npc in another place ?

 

 

New sql part

alter table guild add column buff varchar(255) NOT NULL default '' after emblem_data, add index (buff);

 

 

 

NPC for up :

-	script	flop	-1,{

	if( !getcharid(2) ) {
		mes "you are not in a guild !";
		close;
	}
	else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) {
		mes "I only talk to your guildmaster, go away !";
		close;
	}
	query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type$;
	if( getstrlen( .@buff_type$ ) )
		explode( .@b$, .@buff_type$, "|" );
	else {
		for( .@i = 0; .@i < .size_buff; .@i++ )
			.@b$[.@i] = "0";
	}
	mes "hello "+ strcharinfo(0) +", what do you want to up the skill in the guild healer today ?";
	next;
	.@s = select( .menu$ ) -1;
	if( atoi(.@b$[.@s]) + .min_Levels  == .max_Levels ) {
		mes "Your current "+ .skills_$[.@s] +" skill's guild healer has already reached the max level.";
		close;
	}
	mes "Your current "+ .skills_$[.@s] +" skill's healer is level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000.";
	mes "It will cost ^0000ff"+ ( .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) +"^000000 zeny to up this skill for your guild.";
	next;
	if( select( "Paid to up "+ .skills_$[.@s], "Leave" ) -1 ) close;
	else if( Zeny < .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) {
		mes "You're kidding me? you don't have enough zeny.";
		close;
	}
	Zeny = Zeny - .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s];
	.@b$[.@s] = atoi( .@b$[.@s] ) +1;
	.@a$ = implode( .@b$, "|" );
	query_sql "update guild set buff = '"+ .@a$ +"' where guild_id = "+ getcharid(2);
	mes "Your "+ .skills_$[.@s] +" skill's healer is now level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000. Congratulation !";
	close;

OnInit:
	deletearray .cost_;
	deletearray .skills_$;
	deletearray .skill_$;
	deletearray .min_Levels;
	deletearray .max_Levels;
	deletearray .rate_buff_zeny;
	
	setarray .skills_$, "agi", "bless", "Kyrie Eleison"; // add more skill here - think to add them also in the healer
	setarray .min_Levels,        5,        5,       0; // min level of the skill boost in the healer
	setarray .max_Levels,        10,        10,       10; // max level of the skill you can up
	setarray .rate_buff_zeny,        1,        1,       1; // rate for zeny - ex: 2 to kyrie -> cost *2 ; 2/5 -> cost *2/5
	setarray .cost_[1], 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000; // cost zeny to up the healer
	
	.size_buff = getarraysize( .skills_$ );
	.menu$ = implode( .skills_$, ":" );
	end;
}

	
prontera,160,185,6	duplicate(flop)	flop#1	909

 

 

 

Healer

-	script	Healer	-1,{
	
	if( getcharid(2) ) {
		query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type$;
		if( getstrlen( .@buff_type$ ) ) explode( .@b$, .@buff_type$, "|" );
	}
	set .@Price,0;	// Zeny required for heal
	set .@Buffs,1;	// Also buff players? (1: yes / 0: no)
	set .@Delay,0;	// Heal delay, in seconds

	callfunc "F_ClearGarbage",0;
	if (@HD > gettimetick(2)) end;
	if (.@Price) {
		message strcharinfo(0),"Healing costs "+.@Price+" Zeny.";
		if (Zeny < .@Price) end;
		if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close;
		set Zeny, Zeny-.@Price;
	}
	specialeffect2 EF_HEAL2; percentheal 100,100;
	if (.@Buffs) {
		for( .@i = 0; .@i < .size_buff; .@i++ ) {
			.@sum = atoi(.@b$[.@i]) + .min_Levels[.@i];
			.@j = .Buffs$[.@i];
			if( .@sum )
				sc_start .@j,240000,.@sum;
		}
	}
	if (.@Delay) set @HD, gettimetick(2)+.@Delay;
	close;
OnInit:
	deletearray .Buffs$;
	deletearray .min_Levels;

	setarray .Buffs$, SC_INCREASEAGI, SC_BLESSING, SC_KYRIE; // in the same order than .skills_$ in guild up healer
	setarray .min_Levels,        5,        5,       0;// min level of the skill boost - default: agi (5), bless (5), kyrie (0)

	.size_buff = getarraysize( .Buffs$ );
	end;	
}

prontera,163,185,6	duplicate(Healer)	Healer#alb	909
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

However, if let's say i'd like to add a feature that allows them to use

zeny to upgrade the agi / bless and adding more buffs like kylie elison

and the rest,

Permanently ? they paid just one time or they have to pay each time to get a superbuff ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

It'd be neatest to separate the buff upgrades as separate variables for each buff; I'd personally go for the string conversion method with the 'explode' command.

	// -- Your script for purchasing upgrades --

// Format: "BuffLv1|BuffLv2|BuffLv3" ...

// set .Upgrade$, "6|5|0";

// -----------------------------------------

// Fill array .@Buffs$ with separate level values.

explode(.@Buffs$,.Upgrade$,"|");

// Loop through all possible buffs.

for(set .@i,0; .@i<getarraysize(.Buffs$); set .@i,.@i+1) {

// Convert string to integer.

set .@Level, atoi(.@Buffs$[.@i]);

// No upgrade level.

if (.@Level == 0) {

// Don't buff by default.

if (.Levels[.@i] == 0) continue;

// Use default level.

else set .@Level, .Levels[.@i];

}

// Cast buff.

npcskill .Buffs$[.@i],.@Level,0,0;

}

end;

OnInit:

// List of possible buffs.

setarray .Buffs$[0],"AL_BLESSING","AL_INCAGI","PR_KYRIE";

// Default level of buffs, if not upgraded.

setarray .Levels[0], 5, 5, 0;

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Sorry if i dint clarify, but yeah, it's actually permanent per upgrade.

 

one more side request if you dont mind, the guild master can only make the change.

 

I can't seem to find that script command anywhere >_>




not sure what explodes means here xD

 

if you dont mind can you explain about it?

 

edit: quote not working :(

Edited by ToiletMaster
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

one more side request if you dont mind,

it's support here haha !

 

 

the guild master can only make the change.

You mean the guildmaster make the exchange and he can get a superbuff or he allows his guildmember to get a superbuff too ?

 

 

I can't seem to find that script command anywhere >_>

	if( !getcharid(2) ) {
		mes "you have to be in a guild !";
		close;
	}
	else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) {
		mes "I only talk to your guildmaster, go away !";
		close;
	}

 

 

 

not sure what explodes means here xD

*explode(<dest_array>,<string>,<delimiter>)

Breaks a string up into substrings based on the specified delimiter. Substrings

will be stored within the specified string array. Only the 1st char of the

delimiter parameter will be used. If an empty string is passed as a delimiter,

the string will be placed in the array in it's original form.

It allows to play with concatenate variables. Useful when you want to store permanents variables

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

it's support here haha !

 

woops haha i meant support question :P cause honestly i couldn't find any commands that relates back to only the guild master can use it lol. i couldn't find this in the wiki. Maybe the script_commands would have more info xD.

 

You mean the guildmaster make the exchange and he can get a superbuff or he allows his guildmember to get a superbuff too ?

 

Meaning the guildmaster can only upgrade the buff and not anyone else. but everyone is allowed to use the buff.

 

*explode(<dest_array>,<string>,<delimiter>)

Breaks a string up into substrings based on the specified delimiter. Substrings

will be stored within the specified string array. Only the 1st char of the

delimiter parameter will be used. If an empty string is passed as a delimiter,

the string will be placed in the array in it's original form.

 

i have no clue at all for this lol, i'm guessing this is high level scripting >_>

i'm still at junior level i guess xD.

 

On a side note, (Honestly i think this is becoming a request lol, perhaps it should be moved? apologize for the inconvenience lol)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Meaning the guildmaster can only upgrade the buff and not anyone else. but everyone is allowed to use the buff.

Sorry to harass you but I try to understand explaining with my word (lol)

It's like a buff for guild member. The guildmaster (only) can up the healer for him and his member isn't it ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

errr, let me put it this way lol no worries on the harrassing part haha the fact that you're helping me is already too kind xD.

 

Example :

 

Currently buff level = 1

 

Agi level 1

Bless level 1

 

When anyone in that particular guild presses it, they'll receive this buff.

 

However, once the guild master and only the guild master upgrades it.

 

Let's say,

Buff level = 2

 

Agi level 2

Bless level 3

 

Then everyone inside that guild will get that buff.

 

This is meant solely to that guild only. Other guilds will not be able to access nor talk to the NPC. (I'll seperate them in a map so it wont conflict out in anyway)

 

if you require more information just let me know xD, sometimes my explaination might be a bit fuzzy and hard to understand lol

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Other guilds will not be able to access nor talk to the NPC. (I'll seperate them in a map so it wont conflict out in anyway)

That means others guild couldn't warp on the map ?

 

I have done something but it's a little weird, feel free to hate it xD

and it's global : all guild have access to the npc, but only the guildmaster can up the healer.

bwt if you want to test it

 

 

sql part

alter table guild add column buff tinyint(3) default 0 after emblem_data, add index (buff);

 

 

 

NPC to UP the healer

-	script	flop	-1,{

	if( !getcharid(2) ) {
		mes "you are not in a guild !";
		close;
	}
	else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) {
		mes "I only talk to your guildmaster, go away !";
		close;
	}
	query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type;
	if( .@buff_type == .max_buff ) {
		mes "sorry you can't no more up the healer";
		close;
	}
	mes "Up your guild's healer to level ^0000ff("+ ( .@buff_type +1 ) +")^000000 ?";
	mes "- It will cost ^0000ff"+ .cost_[.@buff_type +1] +"^000000 zeny to up the healer for your guild.";
	mes "- With this the buffer will add/up ^ff0000"+ .skills_$[.@buff_type +1] +"^000000 skills.";
	next;
	if( select( "Paid", "Leave" ) -1 ) close;
	else if( Zeny < .cost_[.@buff_type +1] ) {
		mes "You're kidding me? you don't have enough zeny.";
		close;
	}
	Zeny = Zeny - .cost_[.@buff_type +1];
	query_sql "update guild set buff = buff +1 where guild_id = "+ getcharid(2);
	mes "It's done. Congratulation !";
	close;

OnInit:
	deletearray .cost_;
	deletearray .skills_$;
	setarray .cost_[1], 10000, 20000, 30000; // cost zeny to up the healer
	setarray .skills_$[1], "Kyrie Eleison (3), agi (8), bless (8)",
					"Kyrie Eleison (5), agi (9), bless (8)",
					"Kyrie Eleison (9), agi (9), bless (9)";
	.max_buff = 3; // can up the healer 3 time
	end;
}

prontera,160,185,6	duplicate(flop)	flop#1	909
// geffen,163,185,6	duplicate(flop)	flop#2	909
// payon,163,185,6	duplicate(flop)	flop#3	909
// yuno,163,185,6	duplicate(flop)	flop#	909
setarray .cost_[1], 10000, 20000, 30000; // cost zeny to up the healer

is the cost (zeny) for each up

 

	setarray .skills_$[1], "Kyrie Eleison (3), agi (8), bless (8)",
					"Kyrie Eleison (5), agi (9), bless (8)",
					"Kyrie Eleison (9), agi (9), bless (9)";

is the additionnal description for each up

 

.max_buff = 3; // can up the healer 3 time

how much the guildmaster can up the healer

 

 

 

Then the npc healer (the script is based on the healer in the svn)

-	script	Healer	-1,{
	
	if( getcharid(2) )
		query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type;
	set .@Price,0;	// Zeny required for heal
	set .@Buffs,1;	// Also buff players? (1: yes / 0: no)
	set .@Delay,0;	// Heal delay, in seconds

	callfunc "F_ClearGarbage",0;
	if (@HD > gettimetick(2)) end;
	if (.@Price) {
		message strcharinfo(0),"Healing costs "+.@Price+" Zeny.";
		if (Zeny < .@Price) end;
		if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close;
		set Zeny, Zeny-.@Price;
	}
	specialeffect2 EF_HEAL2; percentheal 100,100;
	if (.@Buffs) {
		switch( .@buff_type ) {
			case 3:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,9;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,9;
				sc_start SC_KYRIE,240000,9;
				break;
			case 2:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,8;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,9;
				sc_start SC_KYRIE,240000,9;
				break;
			case 1:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,8;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,8;
				sc_start SC_KYRIE,240000,3;
				break;
			default:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,5;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,5;
		}
	}
	if (.@Delay) set @HD, gettimetick(2)+.@Delay;
	close;
}

prontera,163,185,6	duplicate(Healer)	Healer#alb	909

I just add :

	if( getcharid(2) )
		query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type;

to get how much the guildmaster up the healer

 

and the bonus

		switch( .@buff_type ) {
			case 3:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,9;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,9;
				sc_start SC_KYRIE,240000,9;
				break;
			case 2:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,8;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,9;
				sc_start SC_KYRIE,240000,9;
				break;
			case 1:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,8;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,8;
				sc_start SC_KYRIE,240000,3;
				break;
			default:
				specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,5;
				specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,5;
		}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

That means others guild couldn't warp on the map ?

 

Yup! I'll set an npc that warps the specific guilds to their specific places. Cause it's more or less kinda like a gathering point or their own "mini-castle" for them.

 

I have done something but it's a little weird, feel free to hate it xD

and it's global : all guild have access to the npc, but only the guildmaster can up the healer.

bwt if you want to test it

That's all i require hahah as long as only the guild master is able to upgrade the healer then that's all.  I'll be able to change it based on my part here XDDD.

Aside from that... I dont think it's weird hahaha XD the code is pretty easy to understand for me XD (although i can't write like this, at least not in another 2-3 years).

 

 

Thanks Capuche!

 

Currently i'm not with my computer at the moment so i can't really test it out but by the looks of it,

 

i dont think it'll be a problem xD.

 

i managed to understand most of the configurations except the SQL part. (Mainly cause i've yet to venture into SQL. but soon!)

 

Once i get home i'll test it out and let you know immediately! xD

 

Thanks again!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Edit :

 

Hi there Capuche,

 

i've tested it out and let me tell you that it works AMAZINGLY great! it's definitely what i wanted haha, but there's one small issue though, if you don't mind, would it be possible to make the upgrades individual?

 

let's say he pays 10k to upgrade bless only. then agi and others are seperate basis.

 

is it possible? if not then i'm fine with this. It's has been great so far xD

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

let's say he pays 10k to upgrade bless only. then agi and others are seperate basis.

A menu where he can chose what he want to upgrade ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

yeah that's correct xD,but just to confirm this works with multiple npcs right? o_O if i make a new one it wont be affected and they have to reupgrade it am i right? or... (sorry if i cant test cause nowadays i'm spending my time outside instead of home T_T) but i'll definitely test once i get back home

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

errr cause this more like individual guilds have their own property. so... that's why the buff can't be shared.

 

if a new guild comes in and let's say buy's a property, they'll have to purchase the buff from scratch

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

If a guild A can buy multiple property, it would be a problem : if the guildmaster up 1 healer, the others healers from others property would be already up for this guild.

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Guild A can only possess 1 property. No worries on that part.

 

Currently i just need the healers to be seperated on this part based on the upgrading. If possible adding a reset would be good too xD in case let's say that guild becomes inactive or somewhat where we can dispose and cleanse everything xD

 

Hope it's not too much of a request that i'm asking

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

0 2 22:23:00 alter table guild add column buff varchar(255) NOT NULL default '' after emblem_data, add index (buff) Error Code: 1060. Duplicate column name 'buff'

0.000 sec

 

 

I'm getting an error on mysql upon testing this. (i'm not really familiar with MySQL so it'd be great if you could guide me along the way) >_<

 

but seeing it's a duplicate name, i believe it should be done already? O_O

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Edit :

 

Just tested it out! This works AMAZING GREAT! i can't believe it lol thanks alot capuche! You're the best! hahaha thanks!

 

It works amazingly great! I tried breakguild and form guild and it resets normally thanks!!!!

 

This is exactly 100000% what i wanted!

 

There is one problem though

 

i keep getting this error once my agi is maxed level and upgrading the bless / kylie. it stays at lvl 5 also though while eating up the zeny.

 

: DB error - Data truncated for column 'buff' at row 1
[Debug]: at ..\src\map\script.c:14528 - update guild set buff = '1|1' where guild_id = 5
Edited by ToiletMaster
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Edit :

Just tested it out! This works AMAZING GREAT! i can't believe it lol thanks alot capuche! You're the best! hahaha thanks!

It works amazingly great! I tried breakguild and form guild and it resets normally thanks!!!!

This is exactly 100000% what i wanted!

LOL I prefer this part

 

 

 

 

 

i keep getting this error once my agi is maxed level and upgrading

the bless / kylie. it stays at lvl 5 also though while eating up the

zeny.

: DB error - Data truncated for column 'buff' at row 1

[Debug]: at ..\src\map\script.c:14528 - update guild set buff = '1|1' where guild_id = 5

I think you load the wrong sql part

 

 

Load these 2 sql

ALTER TABLE `guild` CHANGE `buff` `buff` varchar(255) NOT NULL default ''

then

UPDATE `guild` set `buff` = '';

And re-test.

 

 

 

 

If possible adding a reset would be good too xD in case let's say that

guild becomes inactive or somewhat where we can dispose and cleanse

everything xD

I just add a gm access menu to clear the buff column

-	script	flop	-1,{

	if( getgmlevel() > 80 ) {
		mes "Hi ^ff0000[GM]^000000 "+ strcharinfo(0) +" !";
		mes "what can I do for you ?";
		next;
		.@m = select( "Player menu", "Reset an upgrade's guild", "Clear all upgrade" );
		if( .@m == 2 ) {
			.@size = query_sql( "SELECT `name` FROM `guild` ORDER BY `guild`.`name` ASC LIMIT 127", .@name_g$ );
			.@tmp$ = "^777777~ next^000000";
			for( .@i = 0; .@i < .@size; .@i += 10 ) {
				deletearray .@tmp$[1], 10;
				copyarray .@tmp$[1], .@name_g$[.@i], 10;
				.@menu_gm$ = implode( .@tmp$, ":" );
				next;
				.@m_g = select( .@menu_gm$ ) -1;
				if( .@m_g == 0 && .@i + 10 >= .@size ) {
					mes "end of the list.";
					close;
				}
				else if( .@m_g != 0 ) break;
			}
			explode( .@a$, .@menu_gm$, ":" );
			query_sql "update guild set buff = '' where name = '"+ .@a$[ .@m_g ] +"'";
			mes "Column buff is now empty for guild "+ .@a$[ .@m_g ] +".";
			close;
		}
		else if( .@m == 3 ) {
			query_sql "UPDATE `guild` set `buff` = ''";
			mes "Column buff is now empty.";
			close;		
		}
	}
	if( !getcharid(2) ) {
		mes "you are not in a guild !";
		close;
	}
	else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) {
		mes "I only talk to your guildmaster, go away !";
		close;
	}
	query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type$;
	if( getstrlen( .@buff_type$ ) )
		explode( .@b$, .@buff_type$, "|" );
	else {
		for( .@i = 0; .@i < .size_buff; .@i++ )
			.@b$[.@i] = "0";
	}
	mes "hello "+ strcharinfo(0) +", what do you want to up the skill in the guild healer today ?";
	next;
	.@s = select( .menu$ ) -1;
	if( atoi(.@b$[.@s]) + .min_Levels  == .max_Levels ) {
		mes "Your current "+ .skills_$[.@s] +" skill's guild healer has already reached the max level.";
		close;
	}
	mes "Your current "+ .skills_$[.@s] +" skill's healer is level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000.";
	mes "It will cost ^0000ff"+ ( .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) +"^000000 zeny to up this skill for your guild.";
	next;
	if( select( "Paid to up "+ .skills_$[.@s], "Leave" ) -1 ) close;
	else if( Zeny < .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) {
		mes "You're kidding me? you don't have enough zeny.";
		close;
	}
	Zeny = Zeny - .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s];
	.@b$[.@s] = atoi( .@b$[.@s] ) +1;
	.@a$ = implode( .@b$, "|" );
	query_sql "update guild set buff = '"+ .@a$ +"' where guild_id = "+ getcharid(2);
	mes "Your "+ .skills_$[.@s] +" skill's healer is now level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000. Congratulation !";
	close;

OnInit:
	deletearray .cost_;
	deletearray .skills_$;
	deletearray .skill_$;
	deletearray .min_Levels;
	deletearray .max_Levels;
	deletearray .rate_buff_zeny;
	
	setarray .skills_$, "agi", "bless", "Kyrie Eleison"; // add more skill here - think to add them also in the healer
	setarray .min_Levels,        5,        5,       0; // min level of the skill boost in the healer
	setarray .max_Levels,        10,        10,       10; // max level of the skill you can up
	setarray .rate_buff_zeny,        1,        1,       1; // rate for zeny - ex: 2 to kyrie -> cost *2 ; 2/5 -> cost *2/5
	setarray .cost_[1], 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000; // cost zeny to up the healer
	
	.size_buff = getarraysize( .skills_$ );
	.menu$ = implode( .skills_$, ":" );
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

LOL I prefer this part

hahahahaha either way it works great as it is XD left only the SQL part i guess xD.

 

Anyway i will get back home and test it out as fast as i can xDD

 

Thanks again! Love the add-on to clear it off! xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

i know i'm going to sound very stupid in this but i've searched quite some time yet i can't find it ._.

 

 

UPDATE `guild` set `buff` = '';

requires me to disable safe mode but i cant ._. i cant find that anywhere lol i've checked administration and everywhere i could think of!

 

 

but it doesn't give me anymore errors xD for now that is hahahahaha

 

thanks alot capuche!

Edited by ToiletMaster
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

but it doesn't give me anymore errors xD for now that is hahahahaha

Well this update cleaned the guild's buff of your guild test. You can clean it with the npc now.

But if it works now forget it xD

 

 

The important part was

ALTER TABLE `guild` CHANGE `buff` `buff` varchar(255) NOT NULL default ''
Edited by Capuche
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

but it doesn't give me anymore errors xD for now that is hahahahaha

Well this update cleaned the guild's buff of your guild test. You can clean it with the npc now.

But if it works now forget it xD

 

 

The important part was

ALTER TABLE `guild` CHANGE `buff` `buff` varchar(255) NOT NULL default ''

Alright thanks! hahaha honestly thanks alot for your help xD dint really had the time to test it out during the weekends but i've managed hahaha.

 

so far it works great and fits the exact description of what i required! Thanks again capuche!

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