E:\gry\pol\pvp097\pkg\systems\spawnregion\datafile.inc, Line 57 var DF_DEBUG_MODE := 1; 0: decl global #0 1: 1L 2: := 3: # E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 16 var npccfg := ReadConfigFile(":*:npcdesc"); 4: decl global #1 5: ":*:npcdesc" 6: Func(4,0): ReadConfigFile 7: := 8: # var regcfg := dictionary; // Regions config. 9: decl global #2 10: dictionary 11: := 12: # var grpcfg := dictionary; // Groups config. 13: decl global #3 14: dictionary 15: := 16: # var regidx := 0; // Region index for SpawnAllRegions. 17: decl global #4 18: 0L 19: := 20: # var regionscfg, groupscfg, counter; 21: decl global #5 22: # 23: decl global #6 24: # 25: decl global #7 26: # UnloadConfigFile(":spawnregion:spawnregions"); 27: ":spawnregion:spawnregions" 28: Func(4,3): UnloadConfigFile 29: # UnloadConfigFile(":spawnregion:spawngroups"); 30: ":spawnregion:spawngroups" 31: Func(4,3): UnloadConfigFile 32: # E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnRegionManager.src, Line 3 var SpawnRegionData := DFOpenDataFile("SpawnRegionData", 1); 33: decl global #8 34: "SpawnRegionData" 35: 1L 36: 0L 37: makelocal 38: jmp userfunc @122 39: := 40: # var SpawnRegionFreq := DFOpenDataFile("SpawnRegionFreq", 1); 41: decl global #9 42: "SpawnRegionFreq" 43: 1L 44: 0L 45: makelocal 46: jmp userfunc @122 47: := 48: # E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnRegionManager.src, Line 6 program SpawnRegionManager(param) 49: get arg 'param' var pid := getpid(); 50: decl local #1 51: Func(2,3): GetPid 52: := 53: # SetGlobalProperty("#SpawnRegionManagerPID", pid); 54: "#SpawnRegionManagerPID" 55: local #1 56: Func(3,10): SetGlobalProperty 57: # groupscfg := GlobalSpawnGroups(); 58: makelocal 59: jmp userfunc @181 60: global6 := regionscfg := GlobalSpawnRegions(); 61: makelocal 62: jmp userfunc @278 63: global5 := ReadRegions(); 64: makelocal 65: jmp userfunc @422 66: # ReadGroups(); 67: makelocal 68: jmp userfunc @400 69: # ValidateSpawnRegions(); 70: makelocal 71: jmp userfunc @541 72: # var ev; 73: decl local #2 74: # while(1) 75: 1L 76: if false goto 120 var NextLoop := ReadGameClock() + 60; 77: decl local #0 78: Func(3,3): ReadGameClock 79: 60L 80: + 81: := 82: # ev := os::wait_for_event(60); 83: 60L 84: Func(2,4): Wait_For_Event 85: local2 := if(ReadGameClock() >= NextLoop) 86: Func(3,3): ReadGameClock 87: local #3 88: >= 89: if false goto 118 counter := 0; 90: 0L 91: global7 := SpawnRegionData := DFOpenDataFile("SpawnRegionData", 1); 92: "SpawnRegionData" 93: 1L 94: 0L 95: makelocal 96: jmp userfunc @122 97: global8 := SpawnRegionFreq := DFOpenDataFile("SpawnRegionFreq", 1); 98: "SpawnRegionFreq" 99: 1L 100: 0L 101: makelocal 102: jmp userfunc @122 103: global9 := SpawnAllRegions(); 104: makelocal 105: jmp userfunc @444 106: # If( counter != 0 ) 107: global #7 108: 0L 109: <> 110: if false goto 118 print("Ending Spawn Region Sweep, " + counter + " NPCs spawned this cycle"); 111: "Ending Spawn Region Sweep, " 112: global #7 113: + 114: " NPCs spawned this cycle" 115: + 116: Func(1,0): Print 117: # 118: leave block(1) 119: goto75 120: leave block(3) 121: progend E:\gry\pol\pvp097\pkg\systems\spawnregion\datafile.inc, Line 59 function DFOpenDataFile(filename, create:=DF_NO_CREATE, flags:=DF_KEYTYPE_STRIN 122: pop param 'flags' 123: pop param 'create' 124: pop param 'filename' var temp := OpenDataFile(filename); 125: decl local #3 126: local #2 127: Func(6,0): OpenDataFile 128: := 129: # if ( (!temp) && (create) ) 130: local #3 131: ! 132: local #1 133: && 134: if false goto 148 DF_OutPut("Creating data file: " + filename); 135: "Creating data file: " 136: local #2 137: + 138: makelocal 139: jmp userfunc @756 140: # CreateDataFile(filename, flags); 141: local #2 142: local #0 143: Func(6,1): CreateDataFile 144: # temp := OpenDataFile(filename); 145: local #2 146: Func(6,0): OpenDataFile 147: local3 := if ( temp ) 148: local #3 149: if false goto 153 return temp; 150: local #3 151: return 152: goto179 elseif ( create ) 153: local #1 154: if false goto 179 var errmsg := error; 155: decl local #0 156: error 157: := 158: # errmsg.+errortext := "Could not open " + filename + ":" + temp.errortext; 159: local #4 160: "errortext" 161: .+ 162: "Could not open " 163: local #2 164: + 165: ":" 166: + 167: local #3 168: get member 'errortext' 169: + 170: := # DF_OutPut(errmsg.errortext); 171: local #4 172: get member 'errortext' 173: makelocal 174: jmp userfunc @756 175: # return errmsg; 176: local #4 177: return 178: leave block(1) 179: 0L 180: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnRegionManager.src, Line 32 function GlobalSpawnGroups() var dfile := OpenDataFile("SpawnGroups"); 181: decl local #0 182: "SpawnGroups" 183: Func(6,0): OpenDataFile 184: := 185: # if(!dfile) 186: local #0 187: if true goto 276 dfile := CreateDataFile("SpawnGroups"); 188: "SpawnGroups" 189: 0L 190: Func(6,1): CreateDataFile 191: local0 := var cfg := ReadConfigFile(":spawnregion:spawngroups"); 192: decl local #0 193: ":spawnregion:spawngroups" 194: Func(4,0): ReadConfigFile 195: := 196: # var grouparray := {}; 197: decl local #1 198: array 199: := 200: # var holder := {}; 201: decl local #2 202: array 203: := 204: # var ary, plc; 205: decl local #3 206: # 207: decl local #4 208: # foreach group in GetConfigStringKeys(cfg) 209: local #1 210: Func(4,4): GetConfigStringKeys 211: initforeach @238 holder.append(group); 212: local #3 213: local #6 214: Call Method id append (#52, 1 params) 215: # plc := FindConfigElem(cfg, group); 216: local #1 217: local #6 218: Func(4,1): FindConfigElem 219: local5 := ary := GetConfigStringArray(plc, "npc"); 220: local #5 221: "npc" 222: Func(4,5): GetConfigStringArray 223: local4 := foreach entry in ary 224: local #4 225: initforeach @230 holder.append(entry); 226: local #3 227: local #9 228: Call Method id append (#52, 1 params) 229: # 230: stepforeach @226 231: leave block(3) grouparray.append(holder); 232: local #2 233: local #3 234: Call Method id append (#52, 1 params) 235: # holder := {}; 236: array 237: local3 := 238: stepforeach @212 239: leave block(3) var group, groupholder := {}; 240: decl local #5 241: # 242: decl local #6 243: array 244: := 245: # foreach thing in grouparray 246: local #2 247: initforeach @273 group := dfile.CreateElement(thing[1]); 248: local #0 249: local #8 250: 1L 251: [] 1 252: Call Method id createelement (#71, 1 params) 253: local6 := thing.erase(1); 254: local #8 255: 1L 256: Call Method id erase (#49, 1 params) 257: # foreach subthing in thing 258: local #8 259: initforeach @264 groupholder.append(subthing); 260: local #7 261: local #11 262: Call Method id append (#52, 1 params) 263: # 264: stepforeach @260 265: leave block(3) group.SetProp("npc", groupholder); 266: local #6 267: "npc" 268: local #7 269: Call Method id setprop (#36, 2 params) 270: # groupholder := {}; 271: array 272: local7 := 273: stepforeach @248 274: leave block(3) 275: leave block(7) return dfile; 276: local #0 277: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnRegionManager.src, Line 64 function GlobalSpawnRegions() var dfile := OpenDataFile("SpawnRegions"); 278: decl local #0 279: "SpawnRegions" 280: Func(6,0): OpenDataFile 281: := 282: # if(!dfile) 283: local #0 284: if true goto 398 dfile := CreateDataFile("SpawnRegions"); 285: "SpawnRegions" 286: 0L 287: Func(6,1): CreateDataFile 288: local0 := var cfg := ReadConfigFile(":spawnregion:spawnregions"); 289: decl local #0 290: ":spawnregion:spawnregions" 291: Func(4,0): ReadConfigFile 292: := 293: # var grouparray := {}; 294: decl local #1 295: array 296: := 297: # var holder := {}; 298: decl local #2 299: array 300: := 301: # var ary, plc; 302: decl local #3 303: # 304: decl local #4 305: # foreach group in GetConfigStringKeys(cfg) 306: local #1 307: Func(4,4): GetConfigStringKeys 308: initforeach @342 holder.append(group); 309: local #3 310: local #6 311: Call Method id append (#52, 1 params) 312: # holder.append(cfg[group]."rect"); 313: local #3 314: local #1 315: local #6 316: [] 1 317: get member 'rect' 318: Call Method id append (#52, 1 params) 319: # plc := FindConfigElem(cfg, group); 320: local #1 321: local #6 322: Func(4,1): FindConfigElem 323: local5 := ary := GetConfigStringArray(plc, "group"); 324: local #5 325: "group" 326: Func(4,5): GetConfigStringArray 327: local4 := foreach entry in ary 328: local #4 329: initforeach @334 holder.append(entry); 330: local #3 331: local #9 332: Call Method id append (#52, 1 params) 333: # 334: stepforeach @330 335: leave block(3) grouparray.append(holder); 336: local #2 337: local #3 338: Call Method id append (#52, 1 params) 339: # holder := {}; 340: array 341: local3 := 342: stepforeach @309 343: leave block(3) var group, split; 344: decl local #5 345: # 346: decl local #6 347: # foreach thing in grouparray 348: local #2 349: initforeach @395 group := dfile.CreateElement(thing[1]); 350: local #0 351: local #8 352: 1L 353: [] 1 354: Call Method id createelement (#71, 1 params) 355: local6 := group.SetProp("rect", thing[2]); 356: local #6 357: "rect" 358: local #8 359: 2L 360: [] 1 361: Call Method id setprop (#36, 2 params) 362: # var num := 1; 363: decl local #0 364: 1L 365: := 366: # foreach subthing in thing 367: local #8 368: initforeach @392 if((subthing != thing[1]) && (subthing != thing[2])) 369: local #12 370: local #8 371: 1L 372: [] 1 373: <> 374: local #12 375: local #8 376: 2L 377: [] 1 378: <> 379: && 380: if false goto 392 group.SetProp("group"+num, subthing); 381: local #6 382: "group" 383: local #11 384: + 385: local #12 386: Call Method id setprop (#36, 2 params) 387: # num := num + 1; 388: local #11 389: 1L 390: + 391: local11 := 392: stepforeach @369 393: leave block(3) 394: leave block(1) 395: stepforeach @350 396: leave block(3) 397: leave block(7) return dfile; 398: local #0 399: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 37 function ReadGroups() foreach grpname in(groupscfg.Keys()) 400: global #6 401: Call Method id keys (#56, 0 params) 402: initforeach @418 var grpelem := groupscfg.FindElement(grpname); 403: decl local #0 404: global #6 405: local #0 406: Call Method id findelement (#72, 1 params) 407: := 408: # if(!grpelem) 409: local #3 410: if true goto 413 continue; 411: leave block(1) 412: goto418 grpcfg[grpname] := grpelem; 413: global #3 414: local #0 415: local #3 416: [] := (1) # 417: leave block(1) 418: stepforeach @403 419: leave block(3) 420: 0L 421: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 27 function ReadRegions() foreach regname in(regionscfg.Keys()) 422: global #5 423: Call Method id keys (#56, 0 params) 424: initforeach @440 var regelem := regionscfg.FindElement(regname); 425: decl local #0 426: global #5 427: local #0 428: Call Method id findelement (#72, 1 params) 429: := 430: # if(!regelem) 431: local #3 432: if true goto 435 continue; 433: leave block(1) 434: goto440 regcfg[regname] := regelem; 435: global #2 436: local #0 437: local #3 438: [] := (1) # 439: leave block(1) 440: stepforeach @425 441: leave block(3) 442: 0L 443: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 303 function SpawnAllRegions() if(GetGlobalProperty("SpawnRegionOff")) 444: "SpawnRegionOff" 445: Func(3,4): GetGlobalProperty 446: if false goto 449 return 0; 447: 0L 448: return var regions := regionscfg.Keys(); 449: decl local #0 450: global #5 451: Call Method id keys (#56, 0 params) 452: := 453: # foreach reg in regions 454: local #0 455: initforeach @474 SetGlobalProperty("#" + reg, 1); 456: "#" 457: local #1 458: + 459: 1L 460: Func(3,10): SetGlobalProperty 461: # SpawnRegion(reg); 462: local #1 463: makelocal 464: jmp userfunc @478 465: # EraseGlobalProperty("#" + reg); 466: "#" 467: local #1 468: + 469: Func(3,11): EraseGlobalProperty 470: # sleepms(1); 471: 1L 472: Func(2,2): Sleepms 473: # 474: stepforeach @456 475: leave block(3) 476: 0L 477: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 46 function SpawnRegion(region) 478: pop param 'region' var ct1 := counter; 479: decl local #1 480: global #7 481: := 482: # if(GetGlobalProperty("SpawnRegionOff")) 483: "SpawnRegionOff" 484: Func(3,4): GetGlobalProperty 485: if false goto 488 return 0; 486: 0L 487: return foreach thing in(regcfg[region].propnames()) 488: global #2 489: local #0 490: [] 1 491: Call Method id propnames (#38, 0 params) 492: initforeach @534 if(thing != "rect") 493: local #2 494: "rect" 495: <> 496: if false goto 534 var grpdata := SplitWords(regcfg[region].GetProp(thing)); 497: decl local #0 498: global #2 499: local #0 500: [] 1 501: local #2 502: Call Method id getprop (#35, 1 params) 503: " " 504: Func(0,6): SplitWords 505: := 506: # SpawnGroup(region, grpdata[1], CInt(grpdata[2]), CInt(grpdata[3]), CInt(grpdata 507: local #0 508: local #5 509: 1L 510: [] 1 511: local #5 512: 2L 513: [] 1 514: Func(0,3): CInt 515: local #5 516: 3L 517: [] 1 518: Func(0,3): CInt 519: local #5 520: 4L 521: [] 1 522: Func(0,3): CInt 523: local #5 524: 5L 525: [] 1 526: Func(0,3): CInt 527: makelocal 528: jmp userfunc @921 529: # sleepms(1); 530: 1L 531: Func(2,2): Sleepms 532: # 533: leave block(1) 534: stepforeach @493 535: leave block(3) sleepms(1); 536: 1L 537: Func(2,2): Sleepms 538: # 539: 0L 540: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 355 function ValidateSpawnRegions() print("Validating Spawn Regions"); 541: "Validating Spawn Regions" 542: Func(1,0): Print 543: # var count := 0; 544: decl local #0 545: 0L 546: := 547: # var cfggroups, ingrpcfg, spawns, obj, num; 548: decl local #1 549: # 550: decl local #2 551: # 552: decl local #3 553: # 554: decl local #4 555: # 556: decl local #5 557: # var keys := SpawnRegionData.keys(); 558: decl local #6 559: global #8 560: Call Method id keys (#56, 0 params) 561: := 562: # foreach regname in keys 563: local #6 564: initforeach @693 if(!regcfg.exists(regname)) 565: global #2 566: local #7 567: Call Method id exists (#55, 1 params) 568: if true goto 582 DespawnRegion(regname); 569: local #7 570: makelocal 571: jmp userfunc @732 572: # SpawnRegionData.DeleteElement(regname); 573: global #8 574: local #7 575: Call Method id deleteelement (#73, 1 params) 576: # SpawnRegionFreq.DeleteElement(regname); 577: global #9 578: local #7 579: Call Method id deleteelement (#73, 1 params) 580: # continue; 581: goto693 var delem := DFFindElement(SpawnRegionData, regname); 582: decl local #0 583: global #8 584: local #7 585: 0L 586: makelocal 587: jmp userfunc @764 588: := 589: # var felem := DFFindElement(SpawnRegionFreq, regname); 590: decl local #1 591: global #9 592: local #7 593: 0L 594: makelocal 595: jmp userfunc @764 596: := 597: # foreach grpname in (delem.PropNames()) 598: local #10 599: Call Method id propnames (#38, 0 params) 600: initforeach @687 ingrpcfg := 0; 601: 0L 602: local2 := var elm := regcfg[regname]; 603: decl local #0 604: global #2 605: local #7 606: [] 1 607: := 608: # foreach cgrp in(elm.PropNames()) 609: local #15 610: Call Method id propnames (#38, 0 params) 611: initforeach @629 cgrp := elm.GetProp(cgrp); 612: local #15 613: local #16 614: Call Method id getprop (#35, 1 params) 615: local16 := cgrp := SplitWords(cgrp); 616: local #16 617: " " 618: Func(0,6): SplitWords 619: local16 := if(cgrp[1] == grpname) 620: local #16 621: 1L 622: [] 1 623: local #12 624: == 625: if false goto 629 ingrpcfg := 1; 626: 1L 627: local2 := break; 628: goto630 629: stepforeach @612 630: leave block(3) if(!ingrpcfg) 631: local #2 632: if true goto 648 DespawnGroup(regname, grpname); 633: local #7 634: local #12 635: makelocal 636: jmp userfunc @713 637: # delem.EraseProp(grpname); 638: local #10 639: local #12 640: Call Method id eraseprop (#37, 1 params) 641: # felem.EraseProp(grpname); 642: local #11 643: local #12 644: Call Method id eraseprop (#37, 1 params) 645: # continue; 646: leave block(1) 647: goto687 var holder := array; 648: decl local #1 649: array 650: := 651: # foreach thing in DFGetPRop(delem, grpname) 652: local #10 653: local #12 654: 0L 655: 0L 656: makelocal 657: jmp userfunc @829 658: initforeach @674 obj := SystemFindObjectBySerial(thing); 659: local #17 660: 0L 661: Func(3,8): SystemFindObjectBySerial 662: local4 := if(obj) 663: local #4 664: if false goto 670 holder.append(thing); 665: local #16 666: local #17 667: Call Method id append (#52, 1 params) 668: # 669: goto674 count := count + 1; 670: local #0 671: 1L 672: + 673: local0 := 674: stepforeach @659 675: leave block(3) delem.SetProp(grpname, holder); 676: local #10 677: local #12 678: local #16 679: Call Method id setprop (#36, 2 params) 680: # holder := {}; 681: array 682: local16 := sleepms(1); 683: 1L 684: Func(2,2): Sleepms 685: # 686: leave block(2) 687: stepforeach @601 688: leave block(3) sleepms(1); 689: 1L 690: Func(2,2): Sleepms 691: # 692: leave block(2) 693: stepforeach @565 694: leave block(3) EraseGlobalProperty("SpawnRegions"); 695: "SpawnRegions" 696: Func(3,11): EraseGlobalProperty 697: # EraseGlobalProperty("SpawnRegionsFreq"); 698: "SpawnRegionsFreq" 699: Func(3,11): EraseGlobalProperty 700: # print("Done validating Spawn Region"); 701: "Done validating Spawn Region" 702: Func(1,0): Print 703: # print("Removed " + count + " invalid entries"); 704: "Removed " 705: local #0 706: + 707: " invalid entries" 708: + 709: Func(1,0): Print 710: # 711: 0L 712: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 238 function DespawnGroup(region, group) 713: pop param 'group' 714: pop param 'region' var spawns := GetGroupSpawns(region, group); 715: decl local #2 716: local #1 717: local #0 718: makelocal 719: jmp userfunc @891 720: := 721: # foreach spawn in spawns 722: local #2 723: initforeach @728 Despawn(spawn); 724: local #3 725: makelocal 726: jmp userfunc @1257 727: # 728: stepforeach @724 729: leave block(3) 730: 0L 731: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 221 function DespawnRegion(region) 732: pop param 'region' var rgroups := DFFindElement(SpawnRegionData, region, 1); 733: decl local #1 734: global #8 735: local #0 736: 1L 737: makelocal 738: jmp userfunc @764 739: := 740: # if(Len(rgroups)) 741: local #1 742: Func(0,1): Len 743: if false goto 754 foreach grp in(rgroups.PropNames()) 744: local #1 745: Call Method id propnames (#38, 0 params) 746: initforeach @752 DespawnGroup(region, grp); 747: local #0 748: local #2 749: makelocal 750: jmp userfunc @713 751: # 752: stepforeach @747 753: leave block(3) 754: 0L 755: return E:\gry\pol\pvp097\pkg\systems\spawnregion\datafile.inc, Line 140 function DF_OutPut(text) 756: pop param 'text' if ( DF_DEBUG_MODE ) 757: global #0 758: if false goto 762 SysLog(text); 759: local #0 760: Func(2,0): SysLog 761: # 762: 0L 763: return E:\gry\pol\pvp097\pkg\systems\spawnregion\datafile.inc, Line 89 function DFFindElement(byref file_ref, elem_name, create:=DF_NO_CREATE) 764: pop param 'create' 765: pop param 'elem_name' 766: pop param byref 'file_ref' var temp := file_ref.FindElement( cstr(elem_name) ); 767: decl local #3 768: local #2 769: local #1 770: Func(0,2): CStr 771: Call Method id findelement (#72, 1 params) 772: := 773: # if (!temp && create) 774: local #3 775: ! 776: local #0 777: && 778: if false goto 796 DF_OutPut("Creating elem: " + cstr(elem_name) ); 779: "Creating elem: " 780: local #1 781: Func(0,2): CStr 782: + 783: makelocal 784: jmp userfunc @756 785: # file_ref.CreateElement( cstr(elem_name) ); 786: local #2 787: local #1 788: Func(0,2): CStr 789: Call Method id createelement (#71, 1 params) 790: # temp := file_ref.FindElement( cstr(elem_name) ); 791: local #2 792: local #1 793: Func(0,2): CStr 794: Call Method id findelement (#72, 1 params) 795: local3 := if ( temp ) 796: local #3 797: if false goto 801 return temp; 798: local #3 799: return 800: goto827 elseif (create) 801: local #0 802: if false goto 827 var errmsg := error; 803: decl local #0 804: error 805: := 806: # errmsg.+errortext := "Could not open data elem " + elem_name + ":" + temp.error 807: local #4 808: "errortext" 809: .+ 810: "Could not open data elem " 811: local #1 812: + 813: ":" 814: + 815: local #3 816: get member 'errortext' 817: + 818: := # DF_OutPut(errmsg.errortext); 819: local #4 820: get member 'errortext' 821: makelocal 822: jmp userfunc @756 823: # return errmsg; 824: local #4 825: return 826: leave block(1) 827: 0L 828: return E:\gry\pol\pvp097\pkg\systems\spawnregion\datafile.inc, Line 119 function DFGetProp(byref elem_ref, prop_name, create:=DF_NO_CREATE, assignval:= 829: pop param 'assignval' 830: pop param 'create' 831: pop param 'prop_name' 832: pop param byref 'elem_ref' var temp := elem_ref.GetProp(prop_name); 833: decl local #4 834: local #3 835: local #2 836: Call Method id getprop (#35, 1 params) 837: := 838: # if ( (!temp) && (create) ) 839: local #4 840: ! 841: local #1 842: && 843: if false goto 853 elem_ref.SetProp(prop_name, assignval); 844: local #3 845: local #2 846: local #0 847: Call Method id setprop (#36, 2 params) 848: # temp := elem_ref.GetProp(prop_name); 849: local #3 850: local #2 851: Call Method id getprop (#35, 1 params) 852: local4 := if ( temp || (create) && (!assignval) ) 853: local #4 854: local #1 855: local #0 856: ! 857: && 858: || 859: if false goto 863 return temp; 860: local #4 861: return 862: goto889 elseif (create) 863: local #1 864: if false goto 889 var errmsg := error; 865: decl local #0 866: error 867: := 868: # errmsg.+errortext := "Could not read data file property " + prop_name + ":" + t 869: local #5 870: "errortext" 871: .+ 872: "Could not read data file property " 873: local #2 874: + 875: ":" 876: + 877: local #4 878: get member 'errortext' 879: + 880: := # DF_OutPut(errmsg.errortext); 881: local #5 882: get member 'errortext' 883: makelocal 884: jmp userfunc @756 885: # return errmsg; 886: local #5 887: return 888: leave block(1) 889: 0L 890: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 267 function GetGroupSpawns(region, group) 891: pop param 'group' 892: pop param 'region' var rgroups := DFFindElement(SpawnRegionData, region, 1); 893: decl local #2 894: global #8 895: local #1 896: 1L 897: makelocal 898: jmp userfunc @764 899: := 900: # var sp := rgroups.GetProp(group); 901: decl local #3 902: local #2 903: local #0 904: Call Method id getprop (#35, 1 params) 905: := 906: # if (sp) 907: local #3 908: if false goto 912 return sp; 909: local #3 910: return 911: goto919 rgroups.SetProp(group, array); 912: local #2 913: local #0 914: array 915: Call Method id setprop (#36, 2 params) 916: # return array; 917: array 918: return 919: 0L 920: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 107 function SpawnGroup(region, group, max, freq, hrstart, hrend) 921: pop param 'hrend' 922: pop param 'hrstart' 923: pop param 'freq' 924: pop param 'max' 925: pop param 'group' 926: pop param 'region' var nextspawn := GetGroupFreq(region, group); 927: decl local #6 928: local #5 929: local #4 930: makelocal 931: jmp userfunc @1300 932: := 933: # if(nextspawn == -1) 934: local #6 935: -1L 936: == 937: if false goto 941 return 0; 938: 0L 939: return 940: goto964 elseif(hrstart and hrend) 941: local #1 942: local #0 943: && 944: if false goto 964 var hrnow := GetHourOfDay(); 945: decl local #0 946: makelocal 947: jmp userfunc @1321 948: := 949: # if(!HourWithinRange(hrnow, hrstart, hrend)) 950: local #7 951: local #1 952: local #0 953: makelocal 954: jmp userfunc @1383 955: if true goto 963 DespawnGroup(region, group); 956: local #5 957: local #4 958: makelocal 959: jmp userfunc @713 960: # return 0; 961: 0L 962: return 963: leave block(1) var spawns := GetGroupSpawns(region, group); 964: decl local #7 965: local #5 966: local #4 967: makelocal 968: jmp userfunc @891 969: := 970: # if(spawns.size() >= CInt(max)) 971: local #7 972: Call Method id size (#48, 0 params) 973: local #3 974: Func(0,3): CInt 975: >= 976: if false goto 979 return 0; 977: 0L 978: return if(!freq) 979: local #2 980: if true goto 983 freq := DEFAULT_GRP_FREQUENCY; 981: 10L 982: local2 := var clock := ReadGameClock(); 983: decl local #8 984: Func(3,3): ReadGameClock 985: := 986: # if(nextspawn > clock) 987: local #6 988: local #8 989: > 990: if false goto 993 return 0; 991: 0L 992: return nextspawn := clock +(freq * 60); 993: local #8 994: local #2 995: 60L 996: * 997: + 998: local6 := SetGroupFreq(region, group, nextspawn); 999: local #5 1000: local #4 1001: local #6 1002: makelocal 1003: jmp userfunc @1441 1004: # if(spawns.size() >= max) 1005: local #7 1006: Call Method id size (#48, 0 params) 1007: local #3 1008: >= 1009: if false goto 1012 return 0; 1010: 0L 1011: return var npcs := grpcfg[group].GetProp("npc"); 1012: decl local #9 1013: global #3 1014: local #4 1015: [] 1 1016: "npc" 1017: Call Method id getprop (#35, 1 params) 1018: := 1019: # if(!npcs) 1020: local #9 1021: if true goto 1029 print("Unable to find SpawnGroup: " + group); 1022: "Unable to find SpawnGroup: " 1023: local #4 1024: + 1025: Func(1,0): Print 1026: # return 0; 1027: 0L 1028: return var tospawn := max - spawns.size(); 1029: decl local #10 1030: local #3 1031: local #7 1032: Call Method id size (#48, 0 params) 1033: - 1034: := 1035: # var sp, template, npc; 1036: decl local #11 1037: # 1038: decl local #12 1039: # 1040: decl local #13 1041: # for(sp := 1; sp <= tospawn; sp := sp + 1) 1042: local #11 1043: 1L 1044: := 1045: # 1046: local #11 1047: local #10 1048: <= 1049: if false goto 1078 template := PickRandomNpc(npcs); 1050: local #9 1051: makelocal 1052: jmp userfunc @1428 1053: local12 := npc := SpawnNpc(region, group, template); 1054: local #5 1055: local #4 1056: local #12 1057: makelocal 1058: jmp userfunc @1086 1059: local13 := if(!npc) 1060: local #13 1061: if true goto 1063 continue; 1062: goto1071 spawns.append(npc.serial); 1063: local #7 1064: local #13 1065: get member id 'serial' (6) 1066: Call Method id append (#52, 1 params) 1067: # sleepms(1); 1068: 1L 1069: Func(2,2): Sleepms 1070: # 1071: local #11 1072: local #11 1073: 1L 1074: + 1075: := 1076: # 1077: goto1046 SetGroupSpawns(region, group, spawns); 1078: local #5 1079: local #4 1080: local #7 1081: makelocal 1082: jmp userfunc @1465 1083: # 1084: 0L 1085: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 159 function SpawnNpc(region, group, template) 1086: pop param 'template' 1087: pop param 'group' 1088: pop param 'region' var coords := SplitWords(regcfg[region].GetProp("rect")); 1089: decl local #3 1090: global #2 1091: local #2 1092: [] 1 1093: "rect" 1094: Call Method id getprop (#35, 1 params) 1095: " " 1096: Func(0,6): SplitWords 1097: := 1098: # var x1 := CInt(coords[1]); 1099: decl local #4 1100: local #3 1101: 1L 1102: [] 1 1103: Func(0,3): CInt 1104: := 1105: # var y1 := CInt(coords[2]); 1106: decl local #5 1107: local #3 1108: 2L 1109: [] 1 1110: Func(0,3): CInt 1111: := 1112: # var x2 := CInt(coords[3]); 1113: decl local #6 1114: local #3 1115: 3L 1116: [] 1 1117: Func(0,3): CInt 1118: := 1119: # var y2 := CInt(coords[4]); 1120: decl local #7 1121: local #3 1122: 4L 1123: [] 1 1124: Func(0,3): CInt 1125: := 1126: # var x, y, z; 1127: decl local #8 1128: # 1129: decl local #9 1130: # 1131: decl local #10 1132: # var tries := 0; 1133: decl local #11 1134: 0L 1135: := 1136: # var sh, info, npc, prop; 1137: decl local #12 1138: # 1139: decl local #13 1140: # 1141: decl local #14 1142: # 1143: decl local #15 1144: # x := RandomInt(x2-x1)+x1; 1145: local #6 1146: local #4 1147: - 1148: Func(5,0): RandomInt 1149: local #4 1150: + 1151: local8 := y := RandomInt(y2-y1)+y1; 1152: local #7 1153: local #5 1154: - 1155: Func(5,0): RandomInt 1156: local #5 1157: + 1158: local9 := z := GetMapInfo(x, y).z; 1159: local #8 1160: local #9 1161: "britannia" 1162: Func(3,5): GetMapInfo 1163: get member id 'z' (2) 1164: local10 := tries := tries + 1; 1165: local #11 1166: 1L 1167: + 1168: local11 := sh := GetStandingHeight(x, y, z); 1169: local #8 1170: local #9 1171: local #10 1172: "britannia" 1173: Func(3,6): GetStandingHeight 1174: local12 := if(sh.multi || sh.multi.serial) 1175: local #12 1176: get member id 'multi' (12) 1177: local #12 1178: get member id 'multi' (12) 1179: get member id 'serial' (6) 1180: || 1181: if false goto 1185 npc := 0; 1182: 0L 1183: local14 := 1184: goto1231 info := Hex(GetMapInfo(x, y).landtile); 1185: local #8 1186: local #9 1187: "britannia" 1188: Func(3,5): GetMapInfo 1189: get member 'landtile' 1190: Func(0,7): Hex 1191: local13 := if((info < 0x406) ||(info > 0x455)) 1192: local #13 1193: 1030L 1194: < 1195: local #13 1196: 1109L 1197: > 1198: || 1199: if false goto 1231 npc := CreateNpc(template, x, y, z); 1200: local #0 1201: local #8 1202: local #9 1203: local #10 1204: 0L 1205: makelocal 1206: jmp userfunc @1240 1207: local14 := if(npc) 1208: local #14 1209: if false goto 1231 counter := counter + 1; 1210: global #7 1211: 1L 1212: + 1213: global7 := prop := array; 1214: array 1215: local15 := prop.append(region); 1216: local #15 1217: local #2 1218: Call Method id append (#52, 1 params) 1219: # prop.append(group); 1220: local #15 1221: local #1 1222: Call Method id append (#52, 1 params) 1223: # SetObjProperty(npc, "SpawnRegion", prop); 1224: local #14 1225: "SpawnRegion" 1226: local #15 1227: Func(3,2): SetObjProperty 1228: # return npc; 1229: local #14 1230: return sleepms(1); 1231: 1L 1232: Func(2,2): Sleepms 1233: # 1234: local #11 1235: 25L 1236: > 1237: if false goto 1145 return 0; 1238: 0L 1239: return e:/gry/pol/pvp097/scripts/include/createNPC.inc, Line 24 function CreateNpc(template, x, y, z, props := 0) 1240: pop param 'props' 1241: pop param 'z' 1242: pop param 'y' 1243: pop param 'x' 1244: pop param 'template' var npc := CreateNpcFromTemplate(template, x, y, z, props); 1245: decl local #5 1246: local #4 1247: local #3 1248: local #2 1249: local #1 1250: local #0 1251: "britannia" 1252: Func(3,0): CreateNpcFromTemplate 1253: := 1254: # return npc; 1255: local #5 1256: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 253 function Despawn(serial) 1257: pop param 'serial' var npc := SystemFindObjectBySerial(serial); 1258: decl local #1 1259: local #0 1260: 0L 1261: Func(3,8): SystemFindObjectBySerial 1262: := 1263: # if(!npc) 1264: local #1 1265: if true goto 1269 return 0; 1266: 0L 1267: return 1268: goto1298 RevokePrivilege( npc, "invul" ); 1269: local #1 1270: "invul" 1271: Func(3,9): RevokePrivilege 1272: # SetObjProperty(npc, "guardkill", 1); 1273: local #1 1274: "guardkill" 1275: 1L 1276: Func(3,2): SetObjProperty 1277: # SetObjProperty(npc, "NoSound", 1); 1278: local #1 1279: "NoSound" 1280: 1L 1281: Func(3,2): SetObjProperty 1282: # ApplyRawDamage(npc, GetMaxHp( npc ) * 5 ); 1283: local #1 1284: local #1 1285: makelocal 1286: jmp userfunc @1339 1287: 5L 1288: * 1289: Func(8,5): ApplyRawDamage 1290: # sleepms(1); 1291: 1L 1292: Func(2,2): Sleepms 1293: # counter := counter +1; 1294: global #7 1295: 1L 1296: + 1297: global7 := 1298: 0L 1299: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 341 function GetGroupFreq(region, group) 1300: pop param 'group' 1301: pop param 'region' var srfreq := DFFindElement(SpawnRegionFreq, region, 1); 1302: decl local #2 1303: global #9 1304: local #1 1305: 1L 1306: makelocal 1307: jmp userfunc @764 1308: := 1309: # var freq := DFGetProp(srfreq, group, 1, 0); 1310: decl local #3 1311: local #2 1312: local #0 1313: 1L 1314: 0L 1315: makelocal 1316: jmp userfunc @829 1317: := 1318: # return freq; 1319: local #3 1320: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 74 function GetHourOfDay() var time := GetTimeofDay(); 1321: decl local #0 1322: makelocal 1323: jmp userfunc @1347 1324: := 1325: # var colon := find(time, ":", 1); 1326: decl local #1 1327: local #0 1328: ":" 1329: 1L 1330: Func(0,0): Find 1331: := 1332: # return CInt(time[1, colon]); 1333: local #0 1334: 1L 1335: local #1 1336: [,] 1337: Func(0,3): CInt 1338: return e:/gry/pol/pvp097/scripts/include/attributes.inc, Line 340 function GetMaxHp(who) 1339: pop param 'who' return Cint(GetVitalMaximumValue(who, VITALID_LIFE)/ 100); 1340: local #0 1341: "Life" 1342: Func(8,2): GetVitalMaximumValue 1343: 100L 1344: / 1345: Func(0,3): CInt 1346: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 22 function GetTimeofDay() var hours := CSTR (GetHour()); 1347: decl local #0 1348: makelocal 1349: jmp userfunc @1489 1350: Func(0,2): CStr 1351: := 1352: # if (len(hours) == 1) 1353: local #0 1354: Func(0,1): Len 1355: 1L 1356: == 1357: if false goto 1362 hours := "0" + hours; 1358: "0" 1359: local #0 1360: + 1361: local0 := var minutes := CSTR (GetMinute()); 1362: decl local #1 1363: makelocal 1364: jmp userfunc @1512 1365: Func(0,2): CStr 1366: := 1367: # if (len(minutes) == 1) 1368: local #1 1369: Func(0,1): Len 1370: 1L 1371: == 1372: if false goto 1377 minutes := "0" + minutes; 1373: "0" 1374: local #1 1375: + 1376: local1 := return (hours+":"+minutes); 1377: local #0 1378: ":" 1379: + 1380: local #1 1381: + 1382: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 34 function HourWithinRange(hr, hrstart, hrend) 1383: pop param 'hrend' 1384: pop param 'hrstart' 1385: pop param 'hr' hr := CInt(hr) + 24; 1386: local #2 1387: Func(0,3): CInt 1388: 24L 1389: + 1390: local2 := hrstart := CInt(hrstart) + 24; 1391: local #1 1392: Func(0,3): CInt 1393: 24L 1394: + 1395: local1 := hrend := CInt(hrend) + 24; 1396: local #0 1397: Func(0,3): CInt 1398: 24L 1399: + 1400: local0 := if (hrstart > hrend) 1401: local #1 1402: local #0 1403: > 1404: if false goto 1416 if (hr >= hrstart || hr < hrend) 1405: local #2 1406: local #1 1407: >= 1408: local #2 1409: local #0 1410: < 1411: || 1412: if false goto 1415 return 1; 1413: 1L 1414: return 1415: goto1426 if (hr >= hrstart && hr <= hrend) 1416: local #2 1417: local #1 1418: >= 1419: local #2 1420: local #0 1421: <= 1422: && 1423: if false goto 1426 return 1; 1424: 1L 1425: return return 0; 1426: 0L 1427: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 154 function PickRandomNpc(byref npcs) 1428: pop param byref 'npcs' var idx := RandomInt(npcs.size()) + 1; 1429: decl local #1 1430: local #0 1431: Call Method id size (#48, 0 params) 1432: Func(5,0): RandomInt 1433: 1L 1434: + 1435: := 1436: # return npcs[idx]; 1437: local #0 1438: local #1 1439: [] 1 1440: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 347 function SetGroupFreq(region, group, freq) 1441: pop param 'freq' 1442: pop param 'group' 1443: pop param 'region' set_critical(1); 1444: 1L 1445: Func(2,1): Set_Critical 1446: # var srfreq := DFFindElement(SpawnRegionFreq, region, 1); 1447: decl local #3 1448: global #9 1449: local #2 1450: 1L 1451: makelocal 1452: jmp userfunc @764 1453: := 1454: # srfreq.SetProp(group, freq); 1455: local #3 1456: local #1 1457: local #0 1458: Call Method id setprop (#36, 2 params) 1459: # set_critical(0); 1460: 0L 1461: Func(2,1): Set_Critical 1462: # 1463: 0L 1464: return E:\gry\pol\pvp097\pkg\systems\spawnregion\spawnregion.inc, Line 295 function SetGroupSpawns(region, group, byref spawns) 1465: pop param byref 'spawns' 1466: pop param 'group' 1467: pop param 'region' set_critical(1); 1468: 1L 1469: Func(2,1): Set_Critical 1470: # var rgroups := DFFindElement(SpawnRegionData, region, 1); 1471: decl local #3 1472: global #8 1473: local #2 1474: 1L 1475: makelocal 1476: jmp userfunc @764 1477: := 1478: # rgroups.SetProp(group, spawns); 1479: local #3 1480: local #1 1481: local #0 1482: Call Method id setprop (#36, 2 params) 1483: # set_critical(0); 1484: 0L 1485: Func(2,1): Set_Critical 1486: # 1487: 0L 1488: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 88 function GetHour() var time_sec := GetTime() * 24; 1489: decl local #0 1490: makelocal 1491: jmp userfunc @1558 1492: 24L 1493: * 1494: := 1495: # var length := GetDayLength() * 60; 1496: decl local #1 1497: makelocal 1498: jmp userfunc @1597 1499: 60L 1500: * 1501: := 1502: # var hours := CINT (time_sec / length); 1503: decl local #2 1504: local #0 1505: local #1 1506: / 1507: Func(0,3): CInt 1508: := 1509: # return hours; 1510: local #2 1511: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 95 function GetMinute() var time_sec := GetTime(); 1512: decl local #0 1513: makelocal 1514: jmp userfunc @1558 1515: := 1516: # var length := (GetDayLength() * 60) * 1.0 ; 1517: decl local #1 1518: makelocal 1519: jmp userfunc @1597 1520: 60L 1521: * 1522: 1LF 1523: * 1524: := 1525: # var temp := length / time_sec; 1526: decl local #2 1527: local #1 1528: local #0 1529: / 1530: := 1531: # var raw_time := 24.0 / temp; 1532: decl local #3 1533: 24LF 1534: local #2 1535: / 1536: := 1537: # var hours := cint(raw_time); 1538: decl local #4 1539: local #3 1540: Func(0,3): CInt 1541: := 1542: # var remainder := raw_time - hours; 1543: decl local #5 1544: local #3 1545: local #4 1546: - 1547: := 1548: # var minutes := CINT ( remainder * 60 ); 1549: decl local #6 1550: local #5 1551: 60L 1552: * 1553: Func(0,3): CInt 1554: := 1555: # return minutes; 1556: local #6 1557: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 51 function GetTime () var dayscfg := ReadConfigFile ("::days"); 1558: decl local #0 1559: "::days" 1560: Func(4,0): ReadConfigFile 1561: := 1562: # if (!dayscfg) 1563: local #0 1564: if true goto 1570 Syslog ("Unable to read days.cfg!"); 1565: "Unable to read days.cfg!" 1566: Func(2,0): SysLog 1567: # return 0; 1568: 0L 1569: return var elem := FindConfigElem (dayscfg, "WholeDay"); 1570: decl local #1 1571: local #0 1572: "WholeDay" 1573: Func(4,1): FindConfigElem 1574: := 1575: # var length := GetConfigInt (elem, "Length"); 1576: decl local #2 1577: local #1 1578: "Length" 1579: Func(4,2): GetConfigInt 1580: := 1581: # var day_length := (60 * length); 1582: decl local #3 1583: 60L 1584: local #2 1585: * 1586: := 1587: # var x := readgameclock(); 1588: decl local #4 1589: Func(3,3): ReadGameClock 1590: := 1591: # return (CINT (x%day_length)); 1592: local #4 1593: local #3 1594: % 1595: Func(0,3): CInt 1596: return e:/gry/pol/pvp097/scripts/include/clock.inc, Line 81 function GetDayLength() var cfg := ReadConfigFile( "::days" ); 1597: decl local #0 1598: "::days" 1599: Func(4,0): ReadConfigFile 1600: := 1601: # var elem := FindConfigElem( cfg , "WholeDay" ); 1602: decl local #1 1603: local #0 1604: "WholeDay" 1605: Func(4,1): FindConfigElem 1606: := 1607: # var length := GetConfigInt( elem , "Length" ); 1608: decl local #2 1609: local #1 1610: "Length" 1611: Func(4,2): GetConfigInt 1612: := 1613: # return length; 1614: local #2 1615: return