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

Fixes and new commands #13

Merged
merged 1 commit into from May 22, 2017
Merged

Fixes and new commands #13

merged 1 commit into from May 22, 2017

Conversation

xEasycore
Copy link
Contributor

@xEasycore xEasycore commented May 13, 2017

  • Fixed GD Skills cooldown.
  • Added 3 new commands:

@leader
This command allows to change the team leader. (Include BattleConf parameter)

@bgmode <1 - 10 > (TotalArenas)
Set a bg mode as new queue.
Number 1 = Random Mode.

@bgsize <0 - 9>
Set players requeriments for a specific mode.
Number 0 = All Arenas.

@Leave now allows leave BG.

Updates 05/15

  • Fixed Guild Information:
    If you entering in BG being in a guild, your guild info (name, leader, skill, etc) overrides "BG Guild Info", now It's solved.

  • Fixed charname display:
    When you enter to bg arenas, your name is changed to your team info, eg.

Easycore
Blue Team [Blue Team Leader]

But this change only was showed once in LoadMap. Now it's always is displayed.

  • Added team emblem and removed sword emblem:
    For enable this feature you must set "EnableEmblemForBG" in your exe diff.

You can find this patch in this NEMO tree:
https://github.com/MStr3am/NEMO/tree/fc064112e0704e06c6746e871fbe4df35d18740e
Just download and execute.


if (map->list[m].flag.battleground && (*skill_id >= GD_SKILLBASE && *skill_id <= GD_DEVELOPMENT)){

if( pc_has_permission(*sd, PC_PERM_DISABLE_SKILL_USAGE) ){
Copy link
Owner

Choose a reason for hiding this comment

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

If you could please follow the code-styling here to if () rather than if(. More code-styling guidelines can be found here - https://github.com/HerculesWS/Hercules/wiki/Coding-Style

Also indentation of the inner if statement should be 1 level more than its parent.


if ((*sd)->blockskill[idx]){
Copy link
Owner

Choose a reason for hiding this comment

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

Code-styling here ) {

clif->skill_fail(*sd, *skill_id, USESKILL_FAIL_SKILLINTERVAL, 0);
hookStop();
return 1;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Extra indentation here? Closing braces should be at the same indentation level as its if counterpart.

for(.@i = 0; .@i<.TotalArenas; .@i++)
dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];
end;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Indentation of the braces here. And anywhere else in this file.

.@X = atoi(.@atcmd_parameters$[0]);
.@X2 = atoi(.@atcmd_parameters$[1]);
.@X3 = atoi(.@atcmd_parameters$[2]);
if(.@X2 == 0 || .@X3 == 0){
Copy link
Owner

Choose a reason for hiding this comment

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

Variables starting with a capital letter cause errors to be thrown by the server.

end;
}
if(.@X <= .TotalArenas && .@X > 0){
message strcharinfo(0),"["+.BG_Names$[.@X-1]+"] min players is <"+.@X2+"> and max players is <"+.@X3+">.";
Copy link
Owner

Choose a reason for hiding this comment

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

Too many indentation issues here, it is important to indent at the correct levels for better readability.

return 1;
}
//This is not the correct way, but I could not think of another way to avoid sending the sword emblem.
void clif_sendbgemblem_area_pre(struct map_session_data **sd)
Copy link
Owner

Choose a reason for hiding this comment

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

It is better having the sword emblem, than not having one at all. Does this allow sending of the guild emblem instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clif_sendbgemblem (Sword emblem) is still working but not if you are inside a BG Team.

No, this doesn't allow, for that you must add "EnableEmblemForBG" in your diff exe, from this NEMO version:
https://github.com/MStr3am/NEMO/tree/fc064112e0704e06c6746e871fbe4df35d18740e

This doesn't affect GVG/WoE.

Comparative image:
compare_bg

clif->skill_fail((*sd), *skill_id, USESKILL_FAIL_SKILLINTERVAL, 0);
hookStop();
return 1;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Still an extra indentation before the closing braces }.

dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];
end;
end;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Indentation here again

message strcharinfo(0),"[All Arenas] min players is <"+.@x2+"> and max players is <"+.@x3+">.";
setarray .BG_Players_Min[0],.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2;
setarray .BG_Players_Max[0],.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Closing braces indentation here.

for (.@i = 0; .@i<.TotalArenas; .@i++)
dispbottom "#"+(.@i+1)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];
end;
} else if (.@x2 > .@x3) {
Copy link
Owner

Choose a reason for hiding this comment

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

Extra indentation to this else if clause.

} else if (.@x2 > .@x3) {
message strcharinfo(0), "@bgsize failed: min players is higher than max players. ";
end;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Extra indent here.

@@ -132,6 +180,10 @@ OnDoJoin:
// @leavebg
OnDoLeave:
hBG_queue_leave .BG_Queue;
if(getmapflag(strcharinfo(3),mf_battleground)){
hBG_leave;
Copy link
Owner

Choose a reason for hiding this comment

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

This line and the one below need to be indented.

clif->charnameupdate(pl_sd);
return 0;
}
return -1;
Copy link
Owner

Choose a reason for hiding this comment

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

The return type for an atcommand function is either true or false not an integer. Please change this to false on failure and true on success.

//Prevent update Guild Info if you're in BG
void clif_parse_GuildRequestInfo_pre(int *fd, struct map_session_data **sd)
{
if ((*sd) && (*sd)->bg_id )
Copy link
Owner

Choose a reason for hiding this comment

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

Extra space before the closing bracket here.

void clif_sendbgemblem_single_pre(int *fd, struct map_session_data **sd)
{
nullpo_retv(*sd);
if ((*sd) && (*sd)->bg_id )
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above, not intended, please remove this hook.

if (pc_has_permission(*sd, PC_PERM_DISABLE_SKILL_USAGE) ){
hookStop();
return 1;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Closing bracket of the if statement is indented. Please keep the closing bracket at the same indentation level as its if counterpart.

dispbottom "#1 - Random",0xFFFFFF;
for (.@i = 0; .@i<.TotalArenas; .@i++)
dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];
end;
Copy link
Owner

Choose a reason for hiding this comment

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

Extra indentation to the end; statement here.


vd = status->get_viewdata(bl);
Copy link
Owner

Choose a reason for hiding this comment

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

Why is view_data declared and assign here when not used in the function? Please remove the related lines that aren't being checked or used.

}

if (pc_has_permission(*sd, PC_PERM_SKILL_UNCONDITIONAL))
return 0; // can do any damn thing they want
Copy link
Owner

Choose a reason for hiding this comment

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

Missing hookStop() here.

@xEasycore
Copy link
Contributor Author

Done, thanks for all the feedback.

@sagunkho
Copy link
Owner

sagunkho commented May 18, 2017

@xEasycore Thanks, please squash your commits into a single one before I merge.
git rebase -i HEAD~13 and keep the first commit as pick, change the remaining pick lines to squash.

All GD Skills were ignoring cooldown.

Added @leader command
- This command allows to change the team leader.
- Only leaders are allowed to use this.
- Added BattleConf for enable/disable command.

Update @leader condition
Added @leader battleflag
Added @bgmode, @bgsize

@bgmode <1 - 10 > (TotalArenas)
Set a bg mode as new queue.
Number 1 = Random Mode.

@bgsize <0 - 9> <min players> <max players>
Set players requeriments for a specific mode.
Number 0 = All Arenas.

@Leave now allows leave BG.

Fixes
- Fixed Guild Information:
If you entering in BG being in a guild, your guild info (name, leader, skill, etc) overrides "BG Guild Info", now It's solved.
- Fixed charname display:
- Added team emblem and removed sword emblem:
For enable this feature you must set "EnableEmblemForBG" in your exe diff.
You can find this patch in this NEMO tree:
https://github.com/MStr3am/NEMO/tree/fc064112e0704e06c6746e871fbe4df35d18740e
Just download and execute.

- Invalid return and change code style
- Updated coding style
- Changes requested.
- Updated codying style and minor error
- Updated Coding Style & Custom modifications
@sagunkho
Copy link
Owner

sagunkho commented May 22, 2017

I've rebased your commits. Merged, Thanks.

@sagunkho sagunkho merged commit 9b7be44 into sagunkho:master May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants