EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   0.3.0 Bugs (https://www.eqemulator.org/forums/showthread.php?t=1029)

Lurker_005 04-16-2002 07:12 AM

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.

strychn 04-16-2002 12:31 PM

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.
:)


All times are GMT -4. The time now is 11:12 PM.

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