-
Notifications
You must be signed in to change notification settings - Fork 772
Add NoAutoloot mapflag #1833
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
Add NoAutoloot mapflag #1833
Conversation
bb31943 to
22e3fe9
Compare
src/map/atcommand.c
Outdated
| if (map->list[m_id].flag.guildlock) | ||
| strcat(atcmd_output, msg_fd(fd,1097)); // GuildLock | | ||
| if (map->list[m_id].flag.noautoloot) | ||
| strcat(atcmd_output, "No Autoloot |"); // NoViewID | |
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.
Change comment appropriately
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.
lol, will change it
src/map/atcommand.c
Outdated
| int i; | ||
| int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset | ||
|
|
||
| // Disable autoloot |
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 tab
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.
removed.
src/map/mob.c
Outdated
|
|
||
| if( sd | ||
| && (drop_rate <= sd->state.autoloot || pc->isautolooting(sd, ditem->item_data.nameid)) | ||
| && ((drop_rate <= sd->state.autoloot || pc->isautolooting(sd, ditem->item_data.nameid)) && !map->list[sd->bl.m].flag.noautoloot) |
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.
Does not need this, instead you can edit
pc_isautolooting to return false if player is on noautoloot
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.
but i think the pc_isautolooting doesnt cover the sd->state.autoloot
src/map/pc.c
Outdated
| pc->setrestartvalue(sd,1); | ||
| } | ||
|
|
||
| if (map->list[m].flag.noautoloot) { // Disable autoloot |
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.
Does not need this, as this would be doing unnecessary setting of variables to 0, even if they are 0.
pc_isautolooting should be enough
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.
Also, this would mean.
Warping from noautoloot map to other maps where autoloot is allowed would make autoloot list empty.
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.
removed this part, auto loot list will be remain upon enter/leave the map with noautoloot mapflag.
1ccde8e to
94f81f8
Compare
|
Should we do the way it is now(not allowing to turn autoloot on/off or add items) or allow autoloot commands but also display message that autoloot is off in current map? |
|
Also just a message when warping to new map would be good. To let player know autoloot is off. |
I think its good to turn it off. Prevent player asking "Why I can use
erm, I think should be fine without any message to notify them.... just like any other mapflags (nosave, nocommand) we doesn't display any message to alert them that these commands are disabled when they enter the map. |
Helianthella
left a comment
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.
tested, works fine
|
The way this is implemented doesn't offer a great user experience in my opinion. Some critical points that I'd like to be addressed before merging this:
I'd personally prefer to have the ability to toggle the setting regardless of whether the map allows autolooting. Since autoloot is a global setting attached to the player (rather than attached to the map), then maps shouldn't disallow any changes to the setting, but just disable its effect. |
94f81f8 to
4aac1d7
Compare
|
Removed the restriction to use the atcommands in the map that has this mapflag. |
MishimaHaruna
left a comment
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.
Ok, just one more thing: db/constants.conf needs a mf_noautoloot entry (and an update to mv_noviewid, since its value changed. I believe it's ready to merge afterwards
- Enable server to disable autoloot settings for certain maps.
4aac1d7 to
2c2839c
Compare
|
Aw, didn't realize that. Thank you and I have updated it. |
|
Thank you, I'm merging it now |
Pull Request Prelude
Changes Proposed
Autoloot are useful and popular among the players.
However, sometimes when we try to restrict the autoloot usage at certain map, we can only rely on
mapflag nocommandto disable the autoloot, or some tricky ways of using the npc script (bindatcmd/OnPCLoadMapEvent..etc).With this mapflag, server has more control over the autoloot usage and prevent player abuse the autoloot feature when the server doesn't want them to use it at certain maps.
Affected Branches:
Issues addressed:
Enable server to disable autoloot settings for certain maps.