diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-08-05 22:40:16 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-08-05 22:40:16 -0300 |
commit | 1f8b3ad8f1f6aee5cdb650c61a03b7a2138ed284 (patch) | |
tree | cff9c4718c1c638c284ab92fb39996d38b7f5d6e /npc | |
parent | 744350854371551e0a88ade41f303ead674e4bae (diff) | |
download | serverdata-1f8b3ad8f1f6aee5cdb650c61a03b7a2138ed284.tar.gz serverdata-1f8b3ad8f1f6aee5cdb650c61a03b7a2138ed284.tar.bz2 serverdata-1f8b3ad8f1f6aee5cdb650c61a03b7a2138ed284.tar.xz serverdata-1f8b3ad8f1f6aee5cdb650c61a03b7a2138ed284.zip |
Maintenance NPCs (useless)
Diffstat (limited to 'npc')
-rwxr-xr-x | npc/maint.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/npc/maint.py b/npc/maint.py new file mode 100755 index 000000000..3fe721aeb --- /dev/null +++ b/npc/maint.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 +import traceback, os, random + +w=open("maintenance.txt", 'w') +w.write("// TMW2 Scripts\n") +folders=sorted(os.listdir()) +folders=folders+["guilds","botcheck","soren","sec_pri"] +for f in folders: + if "-" in f and not "000-0" in f and f not in ["003-2-0"]: + npc = random.choice(['NPC_CONSTR_WORKER', 'NPC_CONSTR_WORKER', 'NPC_FEMALE_WORKER', 'NPC_MAINTENANCE_A', 'NPC_MAINTENANCE_B']) + w.write("%s,20,20,0\tscript\tMaintainer#%s\t%s,{" % (f, f, npc)) + w.write("\n\tmesn;\n\tmesq l(\"Sorry, we're doing an update at the moment, come back later.\");\n\tclose;\nOnInit:\n\t.@mx=getmapinfo(MAPINFO_SIZE_X, \"%s\")-20;\n\t.@my=getmapinfo(MAPINFO_SIZE_Y, \"%s\")-20;\n\tdo {\n\t\tif (.@e >= 20) break;\n\t\t.@x=rand2(20,.@mx);.@y=rand2(20,.@my);.@e+=1;\n\t} while (!checknpccell(\"%s\", .@x, .@y, cell_chkpass));\n\tmovenpc(.name$, .@x, .@y);\n\tend;\n}\n\n" % (f, f, f)) + +w.close() +print("gm use @loadnpc npc/maintenance.txt") |