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
Conversation
src/plugins/hBG.c
Outdated
|
||
if (map->list[m].flag.battleground && (*skill_id >= GD_SKILLBASE && *skill_id <= GD_DEVELOPMENT)){ | ||
|
||
if( pc_has_permission(*sd, PC_PERM_DISABLE_SKILL_USAGE) ){ |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
|
||
if ((*sd)->blockskill[idx]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-styling here ) {
src/plugins/hBG.c
Outdated
clif->skill_fail(*sd, *skill_id, USESKILL_FAIL_SKILLINTERVAL, 0); | ||
hookStop(); | ||
return 1; | ||
} |
There was a problem hiding this comment.
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.
npc/custom/hBG/bg_common.txt
Outdated
for(.@i = 0; .@i<.TotalArenas; .@i++) | ||
dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i]; | ||
end; | ||
} |
There was a problem hiding this comment.
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.
npc/custom/hBG/bg_common.txt
Outdated
.@X = atoi(.@atcmd_parameters$[0]); | ||
.@X2 = atoi(.@atcmd_parameters$[1]); | ||
.@X3 = atoi(.@atcmd_parameters$[2]); | ||
if(.@X2 == 0 || .@X3 == 0){ |
There was a problem hiding this comment.
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.
npc/custom/hBG/bg_common.txt
Outdated
end; | ||
} | ||
if(.@X <= .TotalArenas && .@X > 0){ | ||
message strcharinfo(0),"["+.BG_Names$[.@X-1]+"] min players is <"+.@X2+"> and max players is <"+.@X3+">."; |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
clif->skill_fail((*sd), *skill_id, USESKILL_FAIL_SKILLINTERVAL, 0); | ||
hookStop(); | ||
return 1; | ||
} |
There was a problem hiding this comment.
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 }
.
npc/custom/hBG/bg_common.txt
Outdated
dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i]; | ||
end; | ||
end; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation here again
npc/custom/hBG/bg_common.txt
Outdated
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing braces indentation here.
npc/custom/hBG/bg_common.txt
Outdated
for (.@i = 0; .@i<.TotalArenas; .@i++) | ||
dispbottom "#"+(.@i+1)+" - "+.BG_Names$[.@i],.BG_Color2[.@i]; | ||
end; | ||
} else if (.@x2 > .@x3) { |
There was a problem hiding this comment.
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.
npc/custom/hBG/bg_common.txt
Outdated
} else if (.@x2 > .@x3) { | ||
message strcharinfo(0), "@bgsize failed: min players is higher than max players. "; | ||
end; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra indent here.
npc/custom/hBG/bg_common.txt
Outdated
@@ -132,6 +180,10 @@ OnDoJoin: | |||
// @leavebg | |||
OnDoLeave: | |||
hBG_queue_leave .BG_Queue; | |||
if(getmapflag(strcharinfo(3),mf_battleground)){ | |||
hBG_leave; |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
clif->charnameupdate(pl_sd); | ||
return 0; | ||
} | ||
return -1; |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
//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 ) |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
void clif_sendbgemblem_single_pre(int *fd, struct map_session_data **sd) | ||
{ | ||
nullpo_retv(*sd); | ||
if ((*sd) && (*sd)->bg_id ) |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
if (pc_has_permission(*sd, PC_PERM_DISABLE_SKILL_USAGE) ){ | ||
hookStop(); | ||
return 1; | ||
} |
There was a problem hiding this comment.
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.
npc/custom/hBG/bg_common.txt
Outdated
dispbottom "#1 - Random",0xFFFFFF; | ||
for (.@i = 0; .@i<.TotalArenas; .@i++) | ||
dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i]; | ||
end; |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
|
||
vd = status->get_viewdata(bl); |
There was a problem hiding this comment.
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.
src/plugins/hBG.c
Outdated
} | ||
|
||
if (pc_has_permission(*sd, PC_PERM_SKILL_UNCONDITIONAL)) | ||
return 0; // can do any damn thing they want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing hookStop() here.
Done, thanks for all the feedback. |
@xEasycore Thanks, please squash your commits into a single one before I merge. |
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
I've rebased your commits. Merged, Thanks. |
@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.
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.