View Single Post
  #4  
Old 02-27-2012, 03:50 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Well, if you want to do it where the #bot spawn command is processed in bot.cpp, you could add this around line 12424:
Code:
                if(!c->HasMoney(c->GetLevel() * 1000))
                {
                        c->Message(13, "You don't have enough money to spawn a bot.");
                        return;
                }
                c->TakeMoneyFromPP(c->GetLevel() * 1000, true);
That would go just before the existing line:
Code:
Bot* TempBot = LoadBot(botId, &TempErrorMessage);
At that point, the variable 'c' is a pointer to the client that is trying to spawn the bot.

Note that the HasMoney/TakeMoneyFromPP methods take copper as an argument, so 1000 is 1 platinum.

Last edited by Derision; 02-27-2012 at 03:55 PM.. Reason: Updated to scale cost with player level. Set updateclient=true
Reply With Quote