Not sure why mob isn't purging.

Login to reply  Page: « < 1 of 1 > »
28 Feb 2010 - 00:312394
Not sure why mob isn't purging.
I have 2 triggers in a zone that are used to load mobs that clean up a zone. On reset, the mobs are loaded to a room, then their script takes them to the room(s) and purges the mob(s). The script in particular I am having trouble with is:
Name: 'Purge Dragolos if Zone Incomplete',  VNum: [10012], RNum: [  180]
Trigger Intended Assignment: Mobiles
Trigger Type: Load , Numeric Arg: 100, Arg list: None
Commands:
* 10012
wait 1 sec
%teleport% %self% 10041
eval dcnt %findmob.10041(10006)%
if %dcnt% > 0
  while %dcnt% > 0
    wait 1 sec
    %zoneecho% 10000 There are %dcnt% in the room.
    %purge% dragolos
    eval dcnt %dcnt% - 1
  done
end
unset dcnt
%purge% %self%
The error is:
[ Mob (a green imp, VNum 10011):: mpurge: bad argument ]

What I don't understand, is this works perfectly:
Name: 'Purge Gargoyles on Reset',  VNum: [10007], RNum: [  175]
Trigger Intended Assignment: Mobiles
Trigger Type: Load , Numeric Arg: 100, Arg list: None
Commands:
* 10007
wait 1 sec
%echo% An imp poofs into the room in a puff of smoke!
set botvnum 10044
set topvnum 10064
while %botvnum% <= %topvnum%
  %teleport% %self% %botvnum%
  eval gargcount %%findmob.%botvnum%(10005)%%
  if %gargcount% > 0
    while %gargcount% > 0
      wait 1 sec
      %purge% gargoyle
      eval gargcount %gargcount% - 1
    done
  end
  unset %gargcount%
  eval botvnum %botvnum% + 1 
done
mgoto 10000
%echo% An imp poofs into the room in a puff of smoke!
wait 1 sec
%echo% The imp kneels before you and thanks you for his existence.
wait 1 sec
%echo% The imp leaves as quick as he came.
%purge% %self%

Both triggers are almost the same as to how the mob gets purged, yet I don't understand why it's not working.



Last edited by Axanon (28 Feb 2010 - 00:33)
28 Feb 2010 - 08:122395
That is a terrible log statement.

Go to dg_mobcmd.c, the mpurge function, and change it to

 mob_log(ch, "mpurge: bad argument : %s", arg);


__________________
You know who I am.
28 Feb 2010 - 13:232396

 Name: 'Purge Dragolos if Zone Incomplete',  VNum: [10012], RNum: [  180]
Trigger Intended Assignment: Mobiles
Trigger Type: Load , Numeric Arg: 100, Arg list: None
Commands:
* 10012
wait 1 sec
%teleport% %self% 10041
eval dcnt %findmob.10041(10006)%
if %dcnt% > 0
  while %dcnt% > 0
    wait 1 sec
    %zoneecho% 10000 There are %dcnt% in the room.
    %purge% dragolos
    eval dcnt %dcnt% - 1
  done
end
unset dcnt
%purge% %self%





try removing this line

if %dcnt% > 0


28 Feb 2010 - 16:222397
Removing the if/end statement didn't change much, it's still misbehaving. I also don't have access to the code to change the log message, but I will ask about it.

I did however try to recreate the bug on a local copy of tba, the script actually works fine for me. It must be something with the other game.



Last edited by Axanon (28 Feb 2010 - 16:23)
Login to reply  Page: « < 1 of 1 > »