Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2002, 07:12 AM
Lurker_005
Demi-God
 
Join Date: Jan 2002
Location: Tourist town USA
Posts: 1,671
Default

Hogie, Yea more options!!!

Since this is turning into a feature request, I'll cut and paste it into the bugs/requests forum also.

Actually being able to spawn a npc from the db at the current zone loc would be nice, with and without saving it. Perhaps a command to repop a db spawn before the timer is up.

#repop NPC_number

Also for the future how about the ability to run a batch of commands from inside the emu? The batch file might have to be server side I quess.

#batch batch_file_name

The batch commands would use all in game commands, plus at least a pause [time, or triger to continue] Perhaps have this as a GM event type of feature. That way the dialog and spawns ect. can be scripted ahead of time.
Reply With Quote
  #2  
Old 04-16-2002, 12:31 PM
strychn
Hill Giant
 
Join Date: Feb 2002
Posts: 129
Default

here's code to find an npc by name from the database, and to summon that npc using it's npc id...

void Client::FindNPC(char* search_criteria)
{
int count=0;
int iSearchLen = strlen(search_criteria)+1;
char sName[36];
char sCriteria[255];

strcpy(sCriteria, search_criteria);
strupr(sCriteria);
NPCType* npc = 0;
char* pdest;
for (int i=0; i < database.max_npc_type; i++)
{
if (database.npc_type_array[i] != 0)
{
npc = (NPCType*)database.npc_type_array[i];
strcpy(sName, npc->name);
strupr(sName);
pdest = strstr(sName, sCriteria);
if (pdest != NULL)
{
Message(0, " %i: %s", (int) npc->npc_id, npc->name);
count++;
}
if (count == 20)
{
break;
}
}
}
if (count == 20)
Message(0, "20 npcs shown...too many results.");
else
Message(0, "%i npcs found", count);
}

//summonnpc from database by ID
void Client::SummonNPC(int16 npc_id) {
NPCType* npc_type = database.GetNPCType(npc_id);
if (npc_type == 0)
{
Message(0, "No such npc: %i", npc_id);
}
NPC* npc = new NPC(npc_type, 0, this->GetX(), this->GetY(), this->GetZ(), this->GetHeading());
entity_list.AddNPC(npc);
}


i just copied and modified #finditem and #summonitem.
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 07:47 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3