Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release of the clan system #1511

Closed
wants to merge 22 commits into from
Closed

Initial release of the clan system #1511

wants to merge 22 commits into from

Conversation

Lemongrass3110
Copy link
Member

@Lemongrass3110 Lemongrass3110 commented Aug 23, 2016

Thanks to @RagnarokNova for his help.

We have a few things that are not yet in there. I will open up some issues for it and try to solve them as soon as possible.

Fixes #1317

Fixed run-once mode
Fixed packet version
Renamed the initialize function to match the others
INSERT INTO `clan` VALUES ('1', 'Swordman Clan', 'Raffam Oranpere', 'prontera', '500');
INSERT INTO `clan` VALUES ('2', 'Arcwand Clan', 'Devon Aire', 'geffen', '500');
INSERT INTO `clan` VALUES ('3', 'Golden Mace Clan', 'Berman Aire', 'prontera', '500');
INSERT INTO `clan` VALUES ('4', 'Crossbow Clan', 'Shaam Rumi', 'payon', '500');
Copy link
Contributor

@cydh cydh Aug 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the clan_ids, not using the constants?
and I don't see u alter the char table for clan_id in upgrade file and add new column in main.sql

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks seems like I forgot to add that update... >.<

I did not use constants because because the char server does not have a constant resolving feature in it yet. Any suggestions?

Copy link
Contributor

@cydh cydh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot, well. just leave it be.

@anacondaq
Copy link

@anacondaq anacondaq commented Aug 24, 2016

Dear @Lemongrass3110 what minimal exe date and exe we should use to try the feature?
2015-11-04a-Ragexe is ok for it?

@@ -2330,6 +2330,9 @@ packet_keys: 0x631C511C,0x111C111C,0x111C111C // [Shakto]
0x09D6,-1,npcmarketpurchase,2:4:6
0x09D7,-1
0x09D8,2,npcmarketclosed,0
0x098D,-1,clanchat,2:4
Copy link

@andoys andoys Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the packets work with 2015-11-04aRagexe ?

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.
@Anacondaqq everything from 2013-12-23 will work.

Forgot to add the new character table column and updated the sql scripts
Added missing integrity check to character server
Trimmed trailing whitespaces
Added newlines to the end of the files where missing
Added PACKETVER checks to the clif functions
Dropped default charset for the new table
}else{
return SCRIPT_CMD_FAILURE;
}
}
Copy link
Contributor

@cydh cydh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the else part, just let it be end of function control?
(and for script above)

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that it might be safer to terminate the script at this point, that is why I set it up like this.

Copy link
Contributor

@cydh cydh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ic

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also be an option to make it return true/false to the caller so that they can check it.
What would you prefer/suggest?

Copy link
Contributor

@aleos89 aleos89 Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a return value can be beneficial for clan_join and clan_leave to let the script know if the player was properly entered/removed from the clan.

INSERT INTO `clan` VALUES ('4', 'Crossbow Clan', 'Shaam Rumi', 'payon', '500');

ALTER TABLE `char`
ADD COLUMN `clan_id` INT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `hotkey_rowshift`;
Copy link
Contributor

@cydh cydh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be INT(11)

@cydh
Copy link
Contributor

@cydh cydh commented Aug 24, 2016

Need the doc updates for packet_interserv.txt

Fixed a typo in field size of clan_id
Thanks to @cydh
int fd = sd->fd, offset, length;
struct clan* clan = sd->clan;
char mapname[MAP_NAME_LENGTH_EXT];

Copy link
Contributor

@cydh cydh Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure doesn't want to check the sd first?
and also the fd (clif_session_isValid() wow, forgot about this actually)
just incase if player is autorade, they has no fd set.

Lemongrass3110 and others added 5 commits Aug 24, 2016
Added some missing packet sizes into the packet_db and added the packet sizes to the hardcoded packet db
Also added some sanity checks for valid sessions
Exported the send type clan into the script engine

Thanks again to @cydh.
* Fixed text that didn't make sense.
* Reverted a change from the previous dialogue change.
* Added changelog line.
* Added return values for clan script commands.
* Adjusted clan script to account for return values.
* Updated the script command documentation.
struct clan* clan;
int length;

length = 4 + db_size(clan_db) * sizeof( struct clan );
Copy link
Contributor

@cydh cydh Sep 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it
int clan_len = sizeof(struct clan);

@cydh
Copy link
Contributor

@cydh cydh commented Sep 12, 2016

  1. Need alliance & enemies table
  2. Prevent player create guild while in clan by using @guild
  3. Why? // Should display a clientside message "You are currently joined in Clan !!" so we ignore it
  4. Because you need guildleaders to WoE, clansmen cannot participate in WoE. Maybe add a fun point, add config to dual mode (can join both Guild and Clan).
  5. There's enemies, why don't add custom cvc (Clan vs Clan) mapflag?

@Lemongrass3110
Copy link
Member Author

@Lemongrass3110 Lemongrass3110 commented Sep 12, 2016

  1. This is why it is called initial release. Since we do not have enough information about what influence alliances and enemies have I just left them out for now.
  2. Will be added shortly. Thanks for bringing that up. I thought I did that already.
  3. Because this is clientside functionality. Ask Gravity why they did it like that.
  4. This will create really troublesome problems, but if you want to try it you can do that. The serverside logic is easy, but having it displayed correctly on clientside will be a funny thing to do.
  5. I wanted to add that when we add alliances and enemies.

`@guild` will now block creation if you are in a clan.
Thanks to @cydh for bringing this to my attention.
# Conflicts:
#	npc/re/scripts_athena.conf
#	src/map/script_constants.h
#	src/map/status.c
By the skills RL_BANISHING_BUSTER and AB_CLEARANCE
# Conflicts:
#	npc/re/scripts_athena.conf
@admkakaroto
Copy link
Contributor

@admkakaroto admkakaroto commented Oct 5, 2016

@Lemongrass3110

In the topic NPCs show the emblem of the clan under each one, I may have applied the wrong patch, everything is working, less clan emblem that does not appear below the npc, see:

Topic: https://rathena.org/board/topic/105463-clan-system/

Server: http://imgur.com/tZZFEzq

@secretdataz
Copy link
Member

@secretdataz secretdataz commented Oct 6, 2016

@admkakaroto What is the date of the client you are using?

@Lemongrass3110
Copy link
Member Author

@Lemongrass3110 Lemongrass3110 commented Oct 6, 2016

@admkakaroto this is a known issue at the moment. I know how to get it working, but we did not implement it properly yet.

@admkakaroto
Copy link
Contributor

@admkakaroto admkakaroto commented Oct 6, 2016

@secretdataz 2015-11-04

@Lemongrass3110 i understand, but the system is working perfectly, congratulations.

@@ -54,6 +55,7 @@ int inter_recv_packet_length[] = {
-1,10, 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, -1,10, 6,-1, // 3070- Mercenary packets [Zephyrus], Elemental packets [pakpil]
48,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
-1,10,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator]
2,-1, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30A0- Clan packets
Copy link
Contributor

@cydh cydh Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, maybe can we move the clan packets to empty packets there. We have lot unused packets

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah would not be a problem. I just though i'll create a new range because it seemed like that for all other things too.

@Grantea
Copy link

@Grantea Grantea commented Oct 14, 2016

My character's clan emblem disappears when I use @refresh, but I'm still able to see other's emblem and when I change maps it comes back. it's not a big issue.

Client: 2015-11-04.

Also, I don't know how the official behavior is, but would be great if we have a conf like "display_party_name" to show the clan name.

@Lemongrass3110
Copy link
Member Author

@Lemongrass3110 Lemongrass3110 commented Oct 14, 2016

From looking into the code I think there are more things missing when you use refresh at the moment. All kind of visual status changes and hat effects. I will test it later today.

About the display_party_name feature:
So you would want it to only display the party name, if a player is a guild OR in a clan, correct?
In officials you cannot be in a clan and a guild at the same time and we mimiced that behaviour for now. It's unsure if we will support being in both anytime soon.
Also the clan name is not being displayed, you only see the clan emblem beside the member characters.

@Grantea
Copy link

@Grantea Grantea commented Oct 14, 2016

@Lemongrass3110 Exactly. Thank you for your quick response and amazing work!

@admkakaroto
Copy link
Contributor

@admkakaroto admkakaroto commented Oct 17, 2016

@Lemongrass3110

When an apprentice enters a Clan after logout and login again, the HP of the character is reduced, is that correct?

Before: http://imgur.com/XVHqI07
After: http://imgur.com/yamQOD3

not yet applied the changes you made on the 10th, I will do it tomorrow and test.

@Lemongrass3110
Copy link
Member Author

@Lemongrass3110 Lemongrass3110 commented Oct 17, 2016

@admkakaroto just confirmed this and looking into it. Thanks for reporting.

# Conflicts:
#	db/const.txt

Closes #1709
# Conflicts:
#	src/common/mmo.h
#	src/map/intif.c
Refactored the new clif functions to use the new char pointer fifo macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Official Episode Content
Episode 14.3: Decisive Battle
Development

Successfully merging this pull request may close these issues.

None yet

8 participants