Jump to content
  • 0

Guild Pack Information Giver


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

Hello guyz.... i would like to request for a guild pack giver script that records a guild information....

It's an npc that gives a guild box package to the guild leader by exchanging a GM's Approval Card (21001)..

then if the guild leader receives the box, the npc would record all the information of the guild, where the leader is in....

then there will be a menu on the npc where it say's "Guild List"

then after selecting that menu.... it would give a list of guild who has avail the guild package

"demi-gods"

"burritos breaker"

"judas disciples"

"and etc...."

then if the players click the demi-gods

it would give them an information like this

Guild Information:

Guild : Demi-Godz

Status : Active / Disbanded <<----- if the guild is disbanded

Guild Leader : Juanito ( IP.127.0.0.0 )

Guild Member : Member 1 ( IP.127.0.0)

Member 2 ( IP.127.0.0)

Member 3 ( IP.127.0.0)

Member 4 ( IP.127.0.0)

Then even if "member 4" has already quit on the guild or the character has been deleted already.

He would still be on the guild list......

I mean nothing would change on the guild list except the status of the guild, if the guild is still active or the guild has already been disbanded.............

I hope someone could help me......

Edited by caspa
Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Done, now the script will only allow a Guild Package once-per-account.

Make sure you delete the 2 SQL table and re-run the SQL queries lines 4-21, because I added a SQL column.

guild_pack_info.txt

NOTE: this script reads guild info from SQL (since there are no script commands to get guild member info). Guild info is only saved to SQL every 60 seconds (autosave_time in trunk/conf/char_athena.conf). This means if a member was just added to guild, the guild master will have to wait 60 seconds before it's saved to SQL and the NPC can see that information.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

follow this topic :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

i'm following this topic too!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

i saw same as you requested but i cant find the link..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

@bump

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

In order to exchange a GM's Approval Card (21001), is this correct?

1) they have to be in a guild

2) they have to be the guild master

... that gives a guild box package to the guild leader by exchanging a GM's Approval Card (21001)

What is the item_id of the "guild box package" that the NPC will give them?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

yes....... sir bry... the max guild member in my server is 10 only and i disabled the guild extension skill........... so the guild package npc will not trigger if you don't have 10 guild members..... also the npc will only trigger if the guild leader is talking to it.... if a member talks to it it would say "please tell you guild leader to come and see me personally." then all the members should be online............. then if all 10 user is online it would give the package "21010" for the gpack box leader and 21011 for the gpack box members.... so basically when the requirement has been met.......... like all 10 members are online.... the npc will announce the guild "blah" has obtain the guild package.... the 21010 will be getitem by the leader and the 21011 will be getitem by all 9 members....... then after that the guild info would be display on the guild list......

In order to exchange a GM's Approval Card (21001), is this correct?

1) they have to be in a guild

2) they have to be the guild master

... that gives a guild box package to the guild leader by exchanging a GM's Approval Card (21001)

What is the item_id of the "guild box package" that the NPC will give them?

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  45
  • Reputation:   1
  • Joined:  03/24/12
  • Last Seen:  

Following this topic also! :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

A few more questions:

- is @changegm allowed?

- are players able to leave a guild?

- if so, are they able to join another guild after that? (in this case, what should the info say?)

- are character renames allowed?

- are guild renames allowed?

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

if the user on the info list is deleted or is not a member of the guild member anymore? can they be red? while the members on the info list who is still a member of the guild is green?

Yea sure.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

A few more questions:

- are players able to leave a guild?

- if so, are they able to join another guild after that? (in this case, what should the info say?)

- are character renames allowed?

- are guild renames allowed?

Q> are players able to leave a guild?

A> Yes.......

Q>if so, are they able to join another guild after that? (in this case, what should the info say?)

A> they would not be deleted on the info list if the char was deleted and they remain on the guild list to where they receive their reward..... even if the char has already joined another guild...

Q>are character renames allowed?

A> there are no renamer in my server.....

Q>are guild renames allowed?

A> there are no renamer of guild in my server....... There is no changeGM and if the guild is disbanded the status would change to Disbanded if the guild is still reporting to woe or still joining the woe session then the status is active but if the guild has been abandoned already like the GL is the only remaining member it would still display "ACTIVE" and the info on the member who receive the package remains intact ....

==================================================================================

ohhhhhh......... can i add sir bry? like if the user on the info list is deleted or is not a member of the guild member anymore? can they be red? while the members on the info list who is still a member of the guild is green?

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

You can use Account-Bound Items mod...just little modify it.

Also, i could make source mod for Guild pack based on Account-Bound Items mod + guild's house rental, for ex. :huh:

Items from Guild Pack would be transfered to Guild storage if character leaves the guild, etc...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Here you go: guild_pack_info.txt

  1. execute the SQL queries (lines 4-20) to create 2 SQL tables
  2. load the script (Adding_a_Script)

I tested the SQL queries as I wrote them, but I did not test the script with a map-server. Let me know if something doesn't work.

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

sir bry.... i already tested it and i found the first prob..... the npc has given the guild leader both guild leader box pack and guild member box pack......

i need the leader to receive the guild leader box pack only which is 21010

and also i can get package as many times as i want.... its not limited to 1 time only...... i want it to be limited to 1 time only per account.....

Here you go: guild_pack_info.txt

  • execute the SQL queries (lines 4-20) to create 2 SQL tables
  • load the script (Adding_a_Script)

I tested the SQL queries as I wrote them, but I did not test the script with a map-server. Let me know if something doesn't work.



i also have sql error........... ( see attached thumbnail )

Here you go: guild_pack_info.txt

  • execute the SQL queries (lines 4-20) to create 2 SQL tables
  • load the script (Adding_a_Script)

I tested the SQL queries as I wrote them, but I did not test the script with a map-server. Let me know if something doesn't work.

post-3034-0-54946400-1360726112_thumb.jpg

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  311
  • Reputation:   46
  • Joined:  11/06/11
  • Last Seen:  

I'm watching this :) hello baby Brian <3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

@bump

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  250
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

also is it possible to check by mac address <3 ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

the npc has given the guild leader both guild leader box pack and guild member box pack......

Fixed.

i want it to be limited to 1 time only per account.

Did you mean once per character? https://code.google.com/p/athena-scripts/source/detail?r=30

Or do you really want once per account?

Here's the updated version: guild_pack_info.txt

  • drop the 2 SQL tables
    DROP TABLE IF EXISTS guildpack_guilds;
    DROP TABLE IF EXISTS guildpack_members;
  • execute the SQL queries (lines 4-20)
  • load the script
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

well what i mean is........ for example if "Player A" who's a part of dominoes guild already acquired the guild package... and he creates another character.... and he's joining the metallica guild.... and metallica guild is getting a package..... i wan't the npc to say "i'm sorry but "Character #2" has already acquired the package..... he cannot get another package.......... that means he have to create another account...... and and create a character on that 2nd account so he could get the package...........


 



the npc has given the guild leader both guild leader box pack and guild member box pack......

Fixed.

>>i want it to be limited to 1 time only per account.

Did you mean once per character? https://code.google.com/p/athena-scripts/source/detail?r=30
Or do you really want once per account?

Here's the updated version: guild_pack_info.txt
  • drop the 2 SQL tables
    DROP TABLE IF EXISTS guildpack_guilds;
    DROP TABLE IF EXISTS guildpack_members;
  • execute the SQL queries (lines 4-20)
  • load the script

 

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

ah I see what you mean. I'll edit the script so it's once-per-account (I'll have to add account_id to the `guildpack_members` table.)

Done, now the script will only allow a Guild Package once-per-account.

Make sure you delete the 2 SQL table and re-run the SQL queries lines 4-21, because I added a SQL column. guild_pack_info.txt

Alright..... i'm going to try this now............ 

Yep........ It's All Woking Fine Now..................... [ PROBLEM SOLVED ]

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  250
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

brian how about adding support for mac address? :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Does Harmony add a `last_mac` column to the `login` SQL table?

(Assuming it does), adjust the script like this:

Index: guild_pack_info.txt
===================================================================
--- guild_pack_info.txt	(revision 31)
+++ guild_pack_info.txt	(working copy)
@@ -16,6 +16,7 @@
   `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
   `name` VARCHAR(30) NOT NULL DEFAULT '',
   `ip` VARCHAR(15) NOT NULL DEFAULT '',
+  `mac` VARCHAR(17) NOT NULL DEFAULT '',
   PRIMARY KEY  (`guild_id`,`char_id`),
   KEY `guild_id` (`guild_id`)
 ) ENGINE=MYISAM;
@@ -59,6 +60,14 @@
 			mes "Each account can only receive a guild pack once.";
 			close;
 		}
+		// check if any players have already obtained a guild package (from that MAC address)
+		if (query_sql("SELECT `name`,guild_name FROM guildpack_members " + 
+		      "LEFT JOIN guildpack_guilds ON guildpack_members.guild_id=guildpack_guilds.guild_id " + 
+		      "WHERE mac IN (SELECT last_mac FROM guild_member LEFT JOIN login ON guild_member.account_id=login.account_id WHERE guild_id="+getcharid(2)+") LIMIT 1", .@name$,.@guild$) > 0) {
+			mes "^0000FF"+.@name$+"^FF0000 already received a guild pack while in ^0000FF"+.@guild$+"^000000.";
+			mes "Each person can only receive a guild pack once per MAC address.";
+			close;
+		}
 		mes "Exchange GM's Approval Card for Guild Pack?";
 		if (select("No:Yes, continue") == 1) close;
 		
@@ -77,8 +86,8 @@
 		query_sql "INSERT INTO guildpack_guilds (guild_id,guild_name,master_char_id,master_name,redeem_time) VALUES " + 
 		          "("+getcharid(2)+",'"+escape_sql(strcharinfo(2))+"', "+getcharid(0)+",'"+escape_sql(strcharinfo(0))+"', NOW())";
 		// record all guild members
-		query_sql "INSERT INTO guildpack_members(guild_id,account_id,char_id,`name`,ip) " + 
-		          "SELECT guild_id,guild_member.account_id,char_id,`name`,last_ip FROM guild_member " + 
+		query_sql "INSERT INTO guildpack_members(guild_id,account_id,char_id,`name`,ip,mac) " + 
+		          "SELECT guild_id,guild_member.account_id,char_id,`name`,last_ip,last_mac FROM guild_member " + 
 		          "LEFT JOIN login ON guild_member.account_id=login.account_id " + 
 		          "WHERE guild_id="+getcharid(2);
 		break;

http://kpaste.net/0bbff5?raw

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  250
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

Thanks. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

Does Harmony add a `last_mac` column to the `login` SQL table?

(Assuming it does), adjust the script like this:

Index: guild_pack_info.txt
===================================================================
--- guild_pack_info.txt	(revision 31)
+++ guild_pack_info.txt	(working copy)
@@ -16,6 +16,7 @@
   `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
   `name` VARCHAR(30) NOT NULL DEFAULT '',
   `ip` VARCHAR(15) NOT NULL DEFAULT '',
+  `mac` VARCHAR(17) NOT NULL DEFAULT '',
   PRIMARY KEY  (`guild_id`,`char_id`),
   KEY `guild_id` (`guild_id`)
 ) ENGINE=MYISAM;
@@ -59,6 +60,14 @@
 			mes "Each account can only receive a guild pack once.";
 			close;
 		}
+		// check if any players have already obtained a guild package (from that MAC address)
+		if (query_sql("SELECT `name`,guild_name FROM guildpack_members " + 
+		      "LEFT JOIN guildpack_guilds ON guildpack_members.guild_id=guildpack_guilds.guild_id " + 
+		      "WHERE mac IN (SELECT last_mac FROM guild_member LEFT JOIN login ON guild_member.account_id=login.account_id WHERE guild_id="+getcharid(2)+") LIMIT 1", .@name$,.@guild$) > 0) {
+			mes "^0000FF"+.@name$+"^FF0000 already received a guild pack while in ^0000FF"+.@guild$+"^000000.";
+			mes "Each person can only receive a guild pack once per MAC address.";
+			close;
+		}
 		mes "Exchange GM's Approval Card for Guild Pack?";
 		if (select("No:Yes, continue") == 1) close;
 		
@@ -77,8 +86,8 @@
 		query_sql "INSERT INTO guildpack_guilds (guild_id,guild_name,master_char_id,master_name,redeem_time) VALUES " + 
 		          "("+getcharid(2)+",'"+escape_sql(strcharinfo(2))+"', "+getcharid(0)+",'"+escape_sql(strcharinfo(0))+"', NOW())";
 		// record all guild members
-		query_sql "INSERT INTO guildpack_members(guild_id,account_id,char_id,`name`,ip) " + 
-		          "SELECT guild_id,guild_member.account_id,char_id,`name`,last_ip FROM guild_member " + 
+		query_sql "INSERT INTO guildpack_members(guild_id,account_id,char_id,`name`,ip,mac) " + 
+		          "SELECT guild_id,guild_member.account_id,char_id,`name`,last_ip,last_mac FROM guild_member " + 
 		          "LEFT JOIN login ON guild_member.account_id=login.account_id " + 
 		          "WHERE guild_id="+getcharid(2);
 		break;

http://kpaste.net/0bbff5?raw

 

brian can i ask question?

if the player have already a guild pack then he register new account using and hotspotshield . does the new account can get guildpack?

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