EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   Trouble with mutliple spawn commands (https://www.eqemulator.org/forums/showthread.php?t=12825)

m0oni9 04-03-2004 07:57 PM

Trouble with mutliple spawn commands
 
edit: Erased this post so someone didn't confuse changes.. see latest post in thread.

smogo 04-04-2004 07:00 AM

Doesn't this override or break the fix described in this post ?
http://www.eqemulator.net/forums/vie...asc&highlight=

m0oni9 04-05-2004 09:24 AM

Well, I found that the above change helped with spawning multiple mobs, but the message to those newly spawned mobs wasn't getting through. I thought that I had posted this last night (hope I included everything), but I guess not. Disregard the above change. This is what needs to be done:

changes to zone/embparser.cpp

about line 312, replace:

Code:

std::string cmd = "@quest::cmd_queue = (); package " + (std::string)(pkgprefix) + (std::string)(";");
with:
Code:

std::string cmd = "package " + (std::string)(pkgprefix) + (std::string)(";");
about line 325, replace this block of code
Code:

int numcoms = perl->geti("quest::qsize()");
for(int c = 0; c < numcoms; ++c)
{
  char var[1024] = {0};
  sprintf(var,"$quest::cmd_queue[%d]{func}",c);
  std::string cmd = perl->getstr(var);
  sprintf(var,"$quest::cmd_queue[%d]{args}",c);
  std::string args = perl->getstr(var);
  size_t num_args = std::count(args.begin(), args.end(), ',') + 1;
  ExCommands(cmd, args, num_args, npcid, other, mob);
}

with:
Code:

static int c = 0;
while (c < perl->geti("quest::qsize()"))
{
  char var[1024];
  sprintf(var,"$quest::cmd_queue[%d]{func}",c);
  std::string cmd = perl->getstr(var);
  sprintf(var,"$quest::cmd_queue[%d]{args}",c);
  std::string args = perl->getstr(var);
  size_t num_args = 1;
  if (!(!strcmp(cmd.c_str(), "say") ||
        !strcmp(cmd.c_str(), "echo") ))
      for (const char *c = args.c_str(); *c; c++)
        if (*c == ',')
          num_args++;

  c++;
  ExCommands(cmd, args, num_args, npcid, other, mob);
}

if (c)
  perl->eval("@quest::cmd_queue = ();");
c = 0;

changes to zone/entity.cpp

about line 342, replace (first occurance):
Code:

parse->Event(EVENT_SPAWN, npc->GetNPCTypeID(), 0, npc->CastToMob(), 0);
with:
Code:

parse->Event(EVENT_SPAWN, npc->GetNPCTypeID(), 0, npc->CastToMob(), npc);
As far as the other change goes, the "CastToClient" error was because the of the last arg (0). Having it as-is, with npc should work.

smogo 04-18-2004 01:34 PM

merged in, together with 0.5.6dr1 code, to CVS repository :
http://quests.eqemulator.net

Go to : Menu-> CVS web

eqemu files are in the eqemu module


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

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