Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 09-18-2015, 12:09 AM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default Number of bots spawnable by level?

First off Sorry I initially posted this in the features section.
I misunderstood it as a feature I would like :( not sure how to delete the thread now.

My request was this.

Could someone point me in the right direction for making something like this work.

Level 1 can spawn 1 bot.
level 10 can spawn 2 bots
level 20 can spawn 3 bots
level 30 can spawn 4 bots
level 40 can spawn 5 bots.
level 65 can spawn a full raid worth of bots.


If jumping to a raid isnt possible thats not an issue 5 is fine.

I am just unsure how to go about making this work. I am assuming it has something to do with quest globals but am at a loss.

Thanks in advance.

Last edited by Trackye; 09-18-2015 at 12:13 AM.. Reason: Clarity
Reply With Quote
  #2  
Old 09-18-2015, 12:48 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You can do this based on a custom method. Add this at the bottom of bot.cpp:
Code:
uint8 Bot::GetMaxBots(uint8 level) {
    if (level >= 1 && level <= 9)
        return 1;
    else if (level >= 10 && level <= 19)
        return 2;
    else if (level >= 20 && level <= 29)
        return 3;
    else if (level >= 30 && level <= 39)
        return 4;
    else if (level >= 40 && level <= 64)
        return 5;
    else if (level >= 65)
        return 71;
}
Add this in bot.h:
Code:
uint8 GetMaxBots(uint8 level);
And change this line:
Code:
if(spawnedBotCount >= RuleI(Bots, SpawnBotCount) && !c->GetGM())
To this:
Code:
if(spawnedBotCount >= GetMaxBots(c->GetLevel()) && !c->GetGM())
Reply With Quote
  #3  
Old 09-18-2015, 01:31 AM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Thank you for the expedited reply!

Adding those to the files gave me this on compile?

Error 481 error C2352: 'Bot::GetMaxBots' : illegal call of non-static member function C:\PATH\zone\bot.cpp 9157 1 zone

I added it at the end of Bot.cpp so it shows like this.

auto say_link = linker.GenerateLink();
return say_link;
}
uint8 Bot::GetMaxBots(uint8 level) {
if (level >= 1 && level <= 9)
return 1;
else if (level >= 10 && level <= 19)
return 2;
else if (level >= 20 && level <= 29)
return 3;
else if (level >= 30 && level <= 39)
return 4;
else if (level >= 40 && level <= 64)
return 5;
else if (level >= 65)
return 71;
}
#endif

Last edited by Trackye; 09-18-2015 at 01:39 AM.. Reason: Edited
Reply With Quote
  #4  
Old 09-18-2015, 02:11 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Try changing it to this in the bot.h:
Code:
static uint8 GetMaxBots(uint8 level);
Edit: Just so you're aware, the code I'm giving you is untested, meaning I haven't tried it myself, just wrote it from my head as you requested.
Reply With Quote
  #5  
Old 09-18-2015, 08:16 AM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

So after making that second change.


It seems to be working!

Ill repost here after some more testing. leveling and such.

Thank you very much for the assistance Kingly.
Reply With Quote
  #6  
Old 09-18-2015, 11:52 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You're welcome.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:33 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3