EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Bot nameand quest (https://www.eqemulator.org/forums/showthread.php?t=33621)

Shamanistik08 05-23-2011 05:13 PM

Bot nameand quest
 
Not really sure where to post that, so I'll try here for now..

Ok, I decided to compile with bots this time, so here's my problem/question

I would like people to have only one bot at a time max, that I know how to do it.

But I would like to give them bots by questing, so I found the plugin that do it.

Code:

sub EVENT_SAY {

  if($text =~ /Hail/i) {   
  quest::createBot(firstname, lastname, int 20, int 7, int 1, int male);
  }}

But apparently, only one name can be given. which mean if I do quest::creatbot (Soandso, int 20, int 7, int 1, int male) the first who will finish the quest will get the bot, others will have "name already exist" error message.
Since NPCs can have same names, why can't the bots?? like Soandso00 Soandso01 etc..

Anyone can point me the right direction to do that?
Also, what is the isbot column in npc_types? I feel I could do something to resolve my problem with that.

Thanks in advance

pfyon 05-23-2011 08:28 PM

I wrote this function, and didn't implement something to handle duplicate quest names. If roleplaying names aren't important to you, you can make the name something like "SoAndSo's cleric" to work around duplicates. Otherwise, you could use a qglobal to flag the char to be able to create a bot and prompt them for a name (eg. /say call my bot AwesomeBot, and use a regular expression to extract 'AwesomeBot'), check if the bot was created successfully, and clear the global if it was.

You could also modify the function to append _00n if a duplicate name is found, but that would take more work than I have time for right now.


All times are GMT -4. The time now is 01:46 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.