betayi / core-by

基于 Vmangos分支【特性】:非命令方式的NPC招募机器人
GNU General Public License v2.0
2 stars 0 forks source link

💬 [Discussion]Improvement for BattleBot logic of queue #2

Closed den13501 closed 2 years ago

den13501 commented 2 years ago

💬 Discussion

Hi Betayi, your custom code for vmango bot brought me inspiration, I am very appreciate it. I think it still can be better, for now when a player talk to NPC can only summon one bot to queue, if I want to open a battle filed likes Warsong, I need to talk and press gossip option many times, so if we can let system summon enougn battlebots one time, that would reduce players time for repeat talking to NPC.

But how to accomplish this feature, maybe add a loop to repeat input command of "battlebot add"?

P.S. I am tuning logic of bot to make them be more helpful for players in dungeon, if you are interested, check branch my-bot of my repository.

betayi commented 2 years ago

the count of bot to summon is a rule that should be define in game at first, just like the item stack , one trade deals with one stack. the game rule has not method to input a number as you want. that's why the count is fixed , and must be the smallest number to fit all kinds of number request. otherwise we should add the gossipmenu with a lot of diffrent botcount menuitem , or some other method you suggest? P.S. I can not find the branch my-bot , in which repo? P.S. i make the battle bot level no longer fixed with max_level, just the same as partybot, similar with player level who talked with battle master.

betayi commented 2 years ago

i have found your branch in "core" repo, the helpful bot commit is WIP-Improvement logic mage and hunter bot in dungeon,right ? nice job, it's good to see more logic AI of bot!

den13501 commented 2 years ago

i have found your branch in "core" repo, the helpful bot commit is WIP-Improvement logic mage and hunter bot in dungeon,right ? nice job, it's good to see more logic AI of bot!

Yes, I have made some changes to partybot related code for my purpose. I am glad for your appreciate. My coding knowledge is very limited, I am learning and trying to make it better, if you find somewhere is wrong , please do not hesitate to correct me, thanks!

den13501 commented 2 years ago

And I found even if I limit max numbers of partybot that player can summon, player still can summon over limits bots by input command rapidly(like using macro), do you have any idea to fix it?

den13501 commented 2 years ago

the count of bot to summon is a rule that should be define in game at first, just like the item stack , one trade deals with one stack. the game rule has not method to input a number as you want. that's why the count is fixed , and must be the smallest number to fit all kinds of number request. otherwise we should add the gossipmenu with a lot of diffrent botcount menuitem , or some other method you suggest? P.S. I can not find the branch my-bot , in which repo? P.S. i make the battle bot level no longer fixed with max_level, just the same as partybot, similar with player level who talked with battle master.

What I thought is put the function of "adding battlebot command" into a loop(for while), set a max counts for each battle ground, for example, Warsong is 5(bots)-1(payer)/5(all bots) on each side, Arathi is 15-1/15. When player enter battlegrounds by talking to BG-NPC or entering gate of battleground, this function would be called.

betayi commented 2 years ago

And I found even if I limit max numbers of partybot that player can summon, player still can summon over limits bots by input command rapidly(like using macro), do you have any idea to fix it?

how this could be ? the function partybotaddcommnad that gossipmenu called have check this limit at first:

bool ChatHandler::HandlePartyBotAddCommand(char args) { Player pPlayer = m_session->GetPlayer(); if (!pPlayer) return false;

if (!PartyBotAddRequirementCheck(pPlayer, nullptr))
{
    SetSentErrorMessage(true);
    return false;
}

so player never summon partybot out of limit , if use partybotaddcommand api normally

and if you wanna player enjoy without typing command to summon bot ; just disable the partybot add command from the table of command security level

betayi commented 2 years ago

What I thought is put the function of "adding battlebot command" into a loop(for while), set a max counts for each battle ground, for example, Warsong is 5(bots)-1(payer)/5(all bots) on each side, Arathi is 15-1/15. When player enter battlegrounds by talking to BG-NPC or entering gate of battleground, this function would be called.

i am not sure at time player join a queue, how many blank availble for bot should be add is suitable. what is the logic should be ?

den13501 commented 2 years ago

I have same question, this is what I am look in, There is a excellent p-server Nyctermoonwow based on vmangos, I saw there changelogs, very interesting. I am shame on my limited knowledge, so I cannot answer your question, sorry :( image

This is my concept, need to add more check logic to work better. https://github.com/den13501/core/commit/2ecedca3712716061acd81a2e682ab6376829cfb

betayi commented 2 years ago

yes, complex logic to make room for players,we can not just loop this basic function without logic rules.