Compare commits
958 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7c3662463 | |||
| 909e04b8d1 | |||
| a7d1dc5fd0 | |||
| 2f87fd9812 | |||
| c696bd368e | |||
| 7716d82adb | |||
| 66804d5704 | |||
| 02aafc9274 | |||
| 2ef0d4305c | |||
| 972c99a146 | |||
| ad9d27c6ee | |||
| e1d11d5d94 | |||
| ca78a3b581 | |||
| bcaa5d42ff | |||
| 6dad14ae57 | |||
| 6e465248b1 | |||
| 7c106d5d34 | |||
| 8135ef8e9c | |||
| db2d6a4bf3 | |||
| bb0a3b8b5b | |||
| 0145a7264d | |||
| 6eec56adb4 | |||
| 01662aae07 | |||
| 72d73883a4 | |||
| 9c64dbb70c | |||
| 9408602c9c | |||
| 58cf778ce4 | |||
| 885b612bd6 | |||
| bf69045b0b | |||
| 8b03fbc15b | |||
| 3c23a070df | |||
| c14cc98ca2 | |||
| c326008112 | |||
| 90facabc7b | |||
| 6e26a8cfcf | |||
| 4b1ab35a36 | |||
| d733afef58 | |||
| f30a02a6d5 | |||
| b255b1c9f4 | |||
| 6151a9e650 | |||
| 0f7ef9f56b | |||
| 6d68d048b0 | |||
| 8ccdbf8cc9 | |||
| 1798a8f170 | |||
| 737da1bf14 | |||
| 45eb0776d6 | |||
| f4346b97f7 | |||
| cf6f684f5e | |||
| a8e3cfa8f7 | |||
| 0028b7be69 | |||
| 3f11996b40 | |||
| 779f5bbb5b | |||
| 37c89e6073 | |||
| 83499816eb | |||
| 0eb8da855d | |||
| 36fb3f12b1 | |||
| ba642e049e | |||
| 98835cad90 | |||
| 4d9600a8bf | |||
| 4089f72d8f | |||
| ead86efcf6 | |||
| ae01a421de | |||
| 469662f732 | |||
| 8b9bc474b4 | |||
| 3815f9df8e | |||
| 6313182c4f | |||
| 40bff54838 | |||
| 2b1299ec4a | |||
| 0955dff7aa | |||
| 2b18765781 | |||
| c55f67a977 | |||
| 730467828c | |||
| ad05f0d7bc | |||
| c922d9c532 | |||
| ed4d186b10 | |||
| de1bc375ca | |||
| 1c48b28d4e | |||
| 0318459ff1 | |||
| 4bdc207c37 | |||
| ba537d7b00 | |||
| a0164d5abb | |||
| eec5861944 | |||
| 094a7a9498 | |||
| d93892df6c | |||
| 81150642f0 | |||
| 7fb5ccf4f1 | |||
| ab1e69a6ef | |||
| 2d2832caf9 | |||
| 5dee08d3ce | |||
| 75b68c0a8c | |||
| a9f006936b | |||
| 917fddceeb | |||
| a2da8f3861 | |||
| b1b2912092 | |||
| 3bcda38bb7 | |||
| 918a797f34 | |||
| ba9238a49a | |||
| bd5061a7e8 | |||
| 270301c35b | |||
| ffcaf0e063 | |||
| 6e7633828f | |||
| 3aac2410b0 | |||
| c90378e3f0 | |||
| 4734f23805 | |||
| 47503de748 | |||
| 8ab2805e39 | |||
| 1d703b08a2 | |||
| a660457883 | |||
| 4ca81b019b | |||
| 5f16b40092 | |||
| 0d7beb5a5a | |||
| b66e1c1f93 | |||
| f1e8384af0 | |||
| c9dcb82c45 | |||
| c2c946165c | |||
| ffd65b3641 | |||
| ba2084ceb0 | |||
| 34ec123702 | |||
| 7c36325905 | |||
| 915f182d79 | |||
| fb1d6a3248 | |||
| 6d16eccc24 | |||
| fa5cdae17e | |||
| b46eb8639d | |||
| 58916c35c7 | |||
| f80d50f95e | |||
| 77f2e413c9 | |||
| 5e84ee8b11 | |||
| b6a9a0c813 | |||
| f7e6307d66 | |||
| 1359417b40 | |||
| 85077a5e56 | |||
| 366815f1f9 | |||
| 2ca51d6a83 | |||
| b7ebb728e2 | |||
| 023057668a | |||
| a11b590573 | |||
| 353d211a04 | |||
| c792e49fdc | |||
| f8e99a84b1 | |||
| b28c157a5c | |||
| 85717a1880 | |||
| 0ac7a1a7fa | |||
| 7745ef6949 | |||
| 40078df067 | |||
| bb28d38735 | |||
| 7bd6e3a149 | |||
| 72faafedfe | |||
| e560c07aba | |||
| 742232166e | |||
| 910a5d9e3c | |||
| a943a5a51d | |||
| e3a278e090 | |||
| 5959209081 | |||
| e222cb3543 | |||
| a4efe199c6 | |||
| fa5ac4fea3 | |||
| f28c887b92 | |||
| c1331efe38 | |||
| b113b55703 | |||
| 560466e3ef | |||
| 0457287905 | |||
| db7e9276b1 | |||
| a14057b9df | |||
| 0a3624e503 | |||
| 45048b2b4e | |||
| 27550293d6 | |||
| 422cf10eea | |||
| c412336257 | |||
| c8bea0d1ce | |||
| e66a8459c0 | |||
| 817067d242 | |||
| 942288cee2 | |||
| 8d633adbb3 | |||
| a821f7f7e4 | |||
| 0581cab5cb | |||
| 6ee1c02e08 | |||
| 8379b48332 | |||
| e2ae758e36 | |||
| 8f1855fb3f | |||
| e15164bcb2 | |||
| 836fa4f8dc | |||
| fe7f4dc3ca | |||
| 19402bf06f | |||
| bed49c0230 | |||
| 9c79dca2c5 | |||
| 3820d179c6 | |||
| 6e1db9489a | |||
| 8227db92c8 | |||
| 06309daae6 | |||
| 49e5be959f | |||
| 74a22d4cf5 | |||
| 3f827cebd8 | |||
| ae734cbb0a | |||
| bde3e54fd4 | |||
| fa5144c932 | |||
| de08d0d210 | |||
| 79a9bfd606 | |||
| 491519216c | |||
| 048c4dfb1b | |||
| d14144cdf3 | |||
| d610bccdee | |||
| 39f7be99b0 | |||
| 01aa226c62 | |||
| 87bd67b0f5 | |||
| 70edd4c19c | |||
| 6c86da0719 | |||
| 84cc435a2b | |||
| 5e61ef26e1 | |||
| 9e85c1e361 | |||
| 3d80a03e1e | |||
| 15136518a3 | |||
| b8abe94a8c | |||
| f2e4e8062e | |||
| feaa38ee98 | |||
| 6f453ab5c4 | |||
| af839c108c | |||
| 8bac27f0fc | |||
| bfb257c410 | |||
| 3be694275d | |||
| f885560e52 | |||
| a8a9cdb0f1 | |||
| 210cc94dac | |||
| bf503c0be0 | |||
| 24c16e6cf1 | |||
| a6fb7ec0a0 | |||
| cb9197013e | |||
| e1584161c9 | |||
| 0c85c1d289 | |||
| ead9683b98 | |||
| c29d6f548e | |||
| 5822cb1ab4 | |||
| 371d077320 | |||
| 984c4d205a | |||
| 8cc92e9792 | |||
| c1ea68aa41 | |||
| 324851a8ab | |||
| cd512100a2 | |||
| a0e78d8add | |||
| f02d79c65e | |||
| cfffb0c16a | |||
| 8804a3ecd4 | |||
| 16c84f2b30 | |||
| 5858aabc83 | |||
| 4b81a5c435 | |||
| c1107ae98d | |||
| c5f2464d55 | |||
| e0beab2dc5 | |||
| bcbeacd60e | |||
| e39c7bebb5 | |||
| 4e6e56350c | |||
| a33d650738 | |||
| 12b44e216c | |||
| a202a0544e | |||
| 8156f261fc | |||
| 283ae37919 | |||
| 3e30c7a01e | |||
| a5570e4bb5 | |||
| 290aec79ba | |||
| 1378bc8030 | |||
| bd536961e2 | |||
| 17aee68575 | |||
| a97f4e6da6 | |||
| 2274a9e16e | |||
| 1caa704b6a | |||
| 1bb4e17ead | |||
| d84b214fd3 | |||
| 4440ed1f0d | |||
| f0ad1b730c | |||
| d968c4eca4 | |||
| 38816f25bb | |||
| 58f5bf05e0 | |||
| 78d9e3d6fc | |||
| d1c07e88fc | |||
| dcd108e3ac | |||
| 2c2a2464ee | |||
| ee5c254de4 | |||
| efa4ce91fa | |||
| cd45f49b07 | |||
| 116c9bfdfb | |||
| 4ec7c3c4bd | |||
| 281dde533a | |||
| 55b6f95696 | |||
| e120ae6e18 | |||
| 9e44c9475a | |||
| 4d8cb339c3 | |||
| b1dfd9a40d | |||
| cff6714160 | |||
| 16a9d4e5c9 | |||
| 3189d64031 | |||
| 5cd94234e9 | |||
| b45b325cad | |||
| b731291e6c | |||
| c207bd14b6 | |||
| 4924133416 | |||
| 6769286c4a | |||
| d21bf0185b | |||
| 3312ea292f | |||
| c7604d0f2c | |||
| 1206441ab3 | |||
| 679346383a | |||
| e8df9ef0ea | |||
| 3d683fc9a3 | |||
| fbeda13a48 | |||
| d598887f61 | |||
| 40372e1b35 | |||
| 4476c3863d | |||
| 08f94226ba | |||
| 7eb9eca7d0 | |||
| c43c3de18a | |||
| 9e0fa541a2 | |||
| 58035d0f93 | |||
| 92460d455b | |||
| 3c5f510969 | |||
| e3c8be6102 | |||
| 5f0eb266c2 | |||
| c721d6d4a8 | |||
| d0b716eb41 | |||
| a4a375e13b | |||
| c56702bd75 | |||
| 5c023b4c4d | |||
| 4b67cbef38 | |||
| 6cf2705013 | |||
| 66bc73a2b6 | |||
| 77cfa02bea | |||
| 93773a7784 | |||
| 42dd2b4e68 | |||
| 2aed3ef922 | |||
| fb6a3706cd | |||
| 48e126823f | |||
| b3de192f0b | |||
| 58d5c1969c | |||
| 950108be87 | |||
| a9746b9a2b | |||
| eaa287e176 | |||
| 67cdf0e98a | |||
| 83e2b29635 | |||
| c99a361ca7 | |||
| f53c2c5cb0 | |||
| 6680651801 | |||
| 66fbbada48 | |||
| ba1cb22662 | |||
| bf9be1f7f9 | |||
| bb4c1d48a4 | |||
| b33f451285 | |||
| f865f94806 | |||
| baf28519c2 | |||
| 4a2ef92d33 | |||
| c16ea8f3dd | |||
| 882ed17b3a | |||
| d06c298b09 | |||
| e4bad5f418 | |||
| 54c0b3d7ce | |||
| 9d59bde22e | |||
| 47243dd48d | |||
| bb6828ec8e | |||
| 5d0973c2bc | |||
| 4f216364a9 | |||
| c1d193ee45 | |||
| 9879c1b18f | |||
| 928845a220 | |||
| 3378272a19 | |||
| e4c4643678 | |||
| 3c1a217ac6 | |||
| 1567b22fe4 | |||
| 2067bbc6e1 | |||
| 9790423139 | |||
| d8a8c1a9a0 | |||
| 60ab4a846e | |||
| 58f250fa64 | |||
| a160df02c4 | |||
| 1fa7cbed12 | |||
| d16a56a582 | |||
| 69aca2c728 | |||
| 159960d521 | |||
| b9871a2729 | |||
| 18f6822cb4 | |||
| 18731839f7 | |||
| 1d2e4d5608 | |||
| ef49d0cbe0 | |||
| 9604ee4399 | |||
| e708bb02f5 | |||
| 73c1f97051 | |||
| 7a445db673 | |||
| b3d65ef700 | |||
| 7a7559dee5 | |||
| a902ff720a | |||
| 98cb307e09 | |||
| 0dca6c4662 | |||
| c8310ec5ba | |||
| 961258f67a | |||
| 2854472ae0 | |||
| b81f088a3a | |||
| be4cbd3f6f | |||
| 7eb6deb1e9 | |||
| d04cad0484 | |||
| a8a21e9e40 | |||
| 0d5ff59cb7 | |||
| cdeebda6f8 | |||
| 3065f9f7eb | |||
| e2cca6201f | |||
| 1f7ea89d66 | |||
| ce3eacda48 | |||
| 8a3a4645af | |||
| f074fe1825 | |||
| e47430e61b | |||
| b2718779f8 | |||
| 189d0624e7 | |||
| a6cfe2fb76 | |||
| fa37e1bcca | |||
| 7497526bd9 | |||
| b9c38d9d2b | |||
| c8ec0fe191 | |||
| 1378ddcaef | |||
| 78f8331582 | |||
| c197a385c5 | |||
| 2c0899982c | |||
| 72bc753724 | |||
| c43f70128a | |||
| 95b23a35fc | |||
| 86d0254c2f | |||
| d09240d11a | |||
| 5da4b66f81 | |||
| 5247bf77fe | |||
| f8a584d000 | |||
| 7c2915928d | |||
| 8308ac97e3 | |||
| 75ea9092e2 | |||
| d60532c23f | |||
| d8f1cf2087 | |||
| 379dbe668c | |||
| 52a0c95002 | |||
| 360a393a0f | |||
| 345f4e799b | |||
| ef70d7b8ed | |||
| f98f54139a | |||
| 7e3e337de0 | |||
| 74f8f0640f | |||
| 13babb630d | |||
| cd87927241 | |||
| e3377d26b1 | |||
| e02dbd3632 | |||
| 0d7c2cd288 | |||
| 60ba6d5b28 | |||
| 52c3f563a2 | |||
| 5655aef57a | |||
| 487e557ef9 | |||
| f95dd7f6f2 | |||
| 4f56cacaea | |||
| 36f42770c8 | |||
| 1dfac59b8c | |||
| d22b10e9ef | |||
| 5cdab459bc | |||
| f62d44d631 | |||
| 5ee3438e42 | |||
| 6b07058dd4 | |||
| 1f700cda4c | |||
| c5f5c33329 | |||
| f3b00a6249 | |||
| 9da4b85dd1 | |||
| 76da1d0cbf | |||
| dc5b05e5b5 | |||
| 8414fb0039 | |||
| 8cdd4910ca | |||
| ed7e7be3e8 | |||
| 642103b5a2 | |||
| 1f95abf0b2 | |||
| 434e64d7ba | |||
| 665bc25126 | |||
| 8b01f80231 | |||
| 7fee52c861 | |||
| f8cf531136 | |||
| 936f151a72 | |||
| 4707bb11f0 | |||
| 4de40d054b | |||
| af3eb1d85f | |||
| 2990396778 | |||
| 7f8652b477 | |||
| afae0e63ba | |||
| 850d2dfea0 | |||
| dcc92fd89d | |||
| 1346f490c9 | |||
| 0c1b3d1460 | |||
| d96f10b41e | |||
| 595d0ba9ba | |||
| 505f8fdd90 | |||
| bd098fcb24 | |||
| dae20d5591 | |||
| d33de60869 | |||
| 38c9612eb6 | |||
| 4035f45c4f | |||
| 39b235963a | |||
| b142cded72 | |||
| 0e7281fe6a | |||
| fe39454113 | |||
| 74cf9d16c5 | |||
| 4b2563e4a1 | |||
| 1e19e10755 | |||
| 0c3e072e0e | |||
| aa10a4c9ac | |||
| 75947db6e5 | |||
| 9d28601761 | |||
| e8ca4863d5 | |||
| a8bfcd08cc | |||
| 8ae4ded83b | |||
| 5023d6bb73 | |||
| ca47022d88 | |||
| c304a59d95 | |||
| 7dfc1dea0f | |||
| 77fda6a18c | |||
| b343f4d6d7 | |||
| 77e9a4d9bf | |||
| 512aba5cd9 | |||
| 2d93e408c3 | |||
| edd7be8734 | |||
| 8c6637663d | |||
| 4cb0f28e57 | |||
| 4d21fc0353 | |||
| 4d28cd2b25 | |||
| 1be6884ab0 | |||
| 74eff825b0 | |||
| 1ae1deabdc | |||
| 54b7bcf907 | |||
| a8c768931e | |||
| 71687e39c8 | |||
| 678e45ce6b | |||
| 5bfeafe8bf | |||
| a492e833e8 | |||
| 92436be3f9 | |||
| 8890e02981 | |||
| 6fe8b80c87 | |||
| c2e0979dc3 | |||
| 6023022077 | |||
| 9a570de54c | |||
| d58d8ee67c | |||
| 132addc0a9 | |||
| 8bfba1b3a5 | |||
| 0d45bb5bc1 | |||
| 6ea4717263 | |||
| 7153216f09 | |||
| 114ccfee9d | |||
| 23e0a0dcc7 | |||
| b2a3eb3e6e | |||
| 13a4ba6e0e | |||
| eaa8828a24 | |||
| 6bbe9317ac | |||
| 0c56631b92 | |||
| a81810d751 | |||
| 9c75e7defe | |||
| 6aba5be67a | |||
| 9c867ee281 | |||
| afc91e22e5 | |||
| 6dac5c7ec8 | |||
| c6c4a128a2 | |||
| 28fa81962d | |||
| 0759c56b14 | |||
| 64e6e035c1 | |||
| 31bf62a678 | |||
| a924e4c876 | |||
| 38e6bdf92d | |||
| 69dd7bcc37 | |||
| f26e8e4559 | |||
| 16e8df3daf | |||
| c98c64262b | |||
| a6cf68ef07 | |||
| 3b179a5703 | |||
| 0638028a59 | |||
| 912ebd4742 | |||
| c1440f8f9e | |||
| 8d32927241 | |||
| d058e7506a | |||
| dd548acfe1 | |||
| acc0c1dc46 | |||
| d0c74e0641 | |||
| 095a26e1d9 | |||
| 1cb0848690 | |||
| 60a7b395e5 | |||
| 09e57852f4 | |||
| c2fe156680 | |||
| b9545dbf76 | |||
| 8ce7c09000 | |||
| 9107540212 | |||
| 24bc0097be | |||
| 7175f79bfe | |||
| 230a7460cd | |||
| e172d3f2d0 | |||
| 2e78f44640 | |||
| 5c46af3c52 | |||
| b9ec8fd540 | |||
| d3bf19426c | |||
| 734b46d816 | |||
| 11310a5b64 | |||
| 067f8f8d89 | |||
| afa9ddf89e | |||
| a6cee850a6 | |||
| 5f5616fd2d | |||
| dcd37bce13 | |||
| d438440556 | |||
| 9f58e211a8 | |||
| f52e67e80c | |||
| c520263179 | |||
| c9f246afec | |||
| cdf7fcc54d | |||
| 3553291d1d | |||
| 67ce60124f | |||
| 0e6ee13926 | |||
| 5b0ba790b3 | |||
| b53f2c2824 | |||
| b9a87ba407 | |||
| e3ed34a04b | |||
| 6915e30eb2 | |||
| e9c7cc8e04 | |||
| 90feaea89e | |||
| 174bceb49e | |||
| e3ec8d7737 | |||
| c44a7eafab | |||
| 879b52c7c7 | |||
| 1fe3f7dfb1 | |||
| 2c8517a1e4 | |||
| 4eff71f288 | |||
| 349b88f142 | |||
| 6b8d1e6f71 | |||
| 79022f0e3e | |||
| 523eb8529f | |||
| 5684fb6ce1 | |||
| feb23e63fe | |||
| ab5943e4b2 | |||
| 02d22f0881 | |||
| 9b555c0259 | |||
| 6a4e0e32cc | |||
| 5713dab8cf | |||
| 71b7fd5c1b | |||
| 39e6917ae8 | |||
| 86c33c195c | |||
| ad6fca61ed | |||
| f2b91f875f | |||
| ab2b7092fd | |||
| d39137d900 | |||
| d906d49e51 | |||
| 54c48d398b | |||
| 98fe77b148 | |||
| 9ee3b9d7bb | |||
| d6dd61e9c5 | |||
| d92e5d4a45 | |||
| d065e9ffc8 | |||
| 2b63ed08b8 | |||
| 50fb0d39c5 | |||
| bb91502cb4 | |||
| 8f6e13102d | |||
| 0679ffcaec | |||
| 9ab286166e | |||
| 0d4e8f3c9a | |||
| 02a78d538c | |||
| 9e74954422 | |||
| a267382481 | |||
| 0910b7184c | |||
| 297fe8c7a2 | |||
| 76405cb968 | |||
| a38e5b478a | |||
| 4540e5c770 | |||
| aef12b2bb4 | |||
| a562af57e9 | |||
| 03470c699d | |||
| f777f480ad | |||
| ce542ce319 | |||
| 7ff879ea64 | |||
| e4274994ff | |||
| 547d222a2d | |||
| 5159afc704 | |||
| 3a771ac585 | |||
| 97fcbd8608 | |||
| 39aec46220 | |||
| 1db30e3c6b | |||
| 34cb943595 | |||
| bef49fc720 | |||
| 2bbdeb89ff | |||
| 2f4287783e | |||
| 802d46d66e | |||
| de3f1cf004 | |||
| 90e85d3e46 | |||
| 2e104741ba | |||
| 6461efa1a2 | |||
| 320ea7e81c | |||
| 05eb8cd961 | |||
| 9909216e27 | |||
| 33a369821a | |||
| 6e93e40454 | |||
| c14fd84d96 | |||
| 56c16fc06e | |||
| 71274d25d0 | |||
| 9d75116790 | |||
| 629fce8cff | |||
| 7fefd53be2 | |||
| 8aab20caf4 | |||
| 14ad0b7599 | |||
| 267549ce15 | |||
| 6e14f723da | |||
| 46a9dad407 | |||
| e89e2f51b7 | |||
| 40290bdf97 | |||
| a37e30c550 | |||
| 0440aabd1e | |||
| fbc408f617 | |||
| 0f7410f55f | |||
| f82a19f243 | |||
| c9428d2b56 | |||
| c4bd766156 | |||
| 44cd8d0013 | |||
| 84a75f6b83 | |||
| be902cf09c | |||
| 0289b5087d | |||
| b5f36b60f7 | |||
| 43409d2e4b | |||
| 547de5033b | |||
| 2c7baaf2ac | |||
| 351437b46b | |||
| 1e9f1685da | |||
| d9a03ebf93 | |||
| 666e3d5479 | |||
| 7efd276d52 | |||
| 46826163be | |||
| e70b52d88c | |||
| 106dd87216 | |||
| c964115c1e | |||
| 8c022596a7 | |||
| 2de240dd60 | |||
| 8e8876587c | |||
| 8f0e19a10c | |||
| 2222a335a1 | |||
| a7bc1d5a6a | |||
| 0e61f0e7b8 | |||
| 0d256c17b5 | |||
| 571ad4b466 | |||
| 9e7a8bef4a | |||
| 669db7f021 | |||
| 13513bcf2a | |||
| 149630ef5a | |||
| 257d864132 | |||
| 6247332f83 | |||
| e5d606fe8a | |||
| dc1720b38b | |||
| 7b5de5f3f5 | |||
| 7de9bdbbe4 | |||
| 88123ad99a | |||
| 0437f10bf9 | |||
| e93f09c184 | |||
| ee60f88e62 | |||
| 2d4d0f79f8 | |||
| 664eb04658 | |||
| 1fc9e6251e | |||
| 7eba9501a6 | |||
| 0eb67c83a3 | |||
| 6668c01185 | |||
| 76b89d898a | |||
| 6a28574471 | |||
| 11faa98503 | |||
| a32ba5e262 | |||
| 558b645274 | |||
| a1115e728c | |||
| 409f8aa847 | |||
| 78cf95d290 | |||
| 2c78e0728a | |||
| 31e56b4da6 | |||
| ba3fd7215b | |||
| c08a93e85d | |||
| b63a5fa1c1 | |||
| c7494e8a9d | |||
| f69fde8a3a | |||
| 05dace9194 | |||
| ae975b7591 | |||
| 02f376f418 | |||
| 3c2d3782c2 | |||
| daaa1d9ece | |||
| 747056bc8c | |||
| b6760d0775 | |||
| ba4ab458a0 | |||
| c04fd62e71 | |||
| 97c063661a | |||
| 62205150a7 | |||
| 9f5bdce571 | |||
| 22a0cb2474 | |||
| 96c1e34a08 | |||
| 3dc7f7c9ed | |||
| cd1b15834a | |||
| 8a0303e0f5 | |||
| aa0e993038 | |||
| 3ef3a0c37c | |||
| a6a2629fd5 | |||
| e414304e94 | |||
| f5b08c1868 | |||
| 0bdcfe7b51 | |||
| c640caeb54 | |||
| 3d33a16d06 | |||
| f4778d4f48 | |||
| c8246ff317 | |||
| 7a3a9c6254 | |||
| 545796e297 | |||
| 6b4eff4d4c | |||
| 457ed4f4e6 | |||
| 8f2847a527 | |||
| 7f5df22a14 | |||
| 4fd737e3ec | |||
| e891d353ba | |||
| c5376d24a5 | |||
| 85bf30cbdd | |||
| 775410b00a | |||
| a8275c7cc7 | |||
| 03025e7f00 | |||
| 1b7be0365a | |||
| de772237c9 | |||
| e60c635c39 | |||
| 6db9f115b1 | |||
| 3f303e1c9e | |||
| c0ec747e43 | |||
| b583034b4e | |||
| 3360a034b2 | |||
| 668df83e33 | |||
| fa3234d0f5 | |||
| e8973ecb6d | |||
| 134aecf4d7 | |||
| 08cb49f641 | |||
| 2a06015a0e | |||
| 4559519512 | |||
| 42b2f886d5 | |||
| 0ce7f64d94 | |||
| 5fbd5ebb5c | |||
| 8fed2d3506 | |||
| e119f62049 | |||
| 228b0c74a9 | |||
| c73688de4d | |||
| 71288d0203 | |||
| db229dcf74 | |||
| 2e4bf0823c | |||
| d70f9f6dc3 | |||
| a9ecf76585 | |||
| ea3c571485 | |||
| 5840de216d | |||
| c7d26f9dcc | |||
| 5287b993fa | |||
| 33bd1a0906 | |||
| 5cd86bc033 | |||
| 6641651f3c | |||
| dbf164bfb2 | |||
| 8a617c3008 | |||
| a50a2430ba | |||
| 5c3c552288 | |||
| 69fdddfc71 | |||
| db5b988275 | |||
| 4284757035 | |||
| b93a47acc0 | |||
| d59f9857ce | |||
| 8ce212b74b | |||
| e78aea5735 | |||
| 9a3c5c3f40 | |||
| 60ca3f9c34 | |||
| e7e740dff1 | |||
| 8343a98d77 | |||
| 5862039a00 | |||
| 8af989b75f | |||
| 08d0e5ff75 | |||
| 5196d10e5c | |||
| 3392ec463d | |||
| 33529404cf | |||
| 00e7a36013 | |||
| 3060b394ab | |||
| a43d9022fe | |||
| 6abdc68ca5 | |||
| 61c66b0e96 | |||
| 36cc23457a | |||
| d573b238de | |||
| 8afe25fe85 | |||
| f80647ff0d | |||
| 7e64cbabf8 | |||
| 14a06410ae | |||
| 85c2a4f4f0 | |||
| da9e211ec7 | |||
| a81070c471 | |||
| e3ad7efa4f | |||
| a4dafd7155 | |||
| 645aec853e | |||
| d8d5e4a3c4 | |||
| 7a48c04057 | |||
| 64aaaa707e | |||
| 445d40dc5f | |||
| ebdcb531f2 | |||
| c9cdb891d6 | |||
| f5c6c002a8 | |||
| d171c6bb9a | |||
| 1c81a4faed | |||
| e7d1d5cb71 | |||
| 060d831d50 | |||
| 316bd6dd01 | |||
| 34081e5903 | |||
| e2d843b65e | |||
| a796f5fe4b | |||
| 51ee41c773 | |||
| 7e5ed3efe5 | |||
| 8dd25ac315 | |||
| 1cdaa58e7a | |||
| fa3aa24a3d | |||
| 091431d95b | |||
| 1ecf0122ab | |||
| 79980a1725 | |||
| 8badcc3f6e | |||
| 4d6e57257c | |||
| a7a93b8500 | |||
| 85cc34fb4c | |||
| 772a996b6e | |||
| e67eff822d | |||
| c39ed6120f | |||
| c38f4e6543 | |||
| 098433b697 | |||
| c8e20c905b | |||
| bd2446ba0a | |||
| c179e4aaf3 | |||
| 2f8de2a919 | |||
| 338110973d | |||
| 3c9c4495bc | |||
| 93476f782c | |||
| 3aec6ee578 | |||
| 3bca76d4c8 | |||
| b9d6f35aac | |||
| 9b6959414a | |||
| 400dd6aa5e | |||
| 14af2f6efd | |||
| 0a2de9e0d5 | |||
| 89bfad78a6 | |||
| 52486fa278 | |||
| dc0e14eb21 | |||
| 70278374e7 | |||
| ac3588c76a | |||
| ab335aef2a | |||
| 719c855bdb | |||
| f283e50018 | |||
| 99b952ee28 | |||
| 24639b62c0 | |||
| 573cc531bf | |||
| 29e24bae93 | |||
| 22e4cc07c0 | |||
| 9264347698 | |||
| 579c26ac59 | |||
| ef577dd313 | |||
| 62c7e52487 | |||
| 3534ac6477 | |||
| 1738f7b311 | |||
| eb25caec81 | |||
| a6c60e2c04 | |||
| adafbdf6d3 | |||
| 7eab14938d | |||
| 039e55673b | |||
| ec3a9b6cb4 | |||
| 17a6494b2b | |||
| 0b05c7074f | |||
| 876ccc7cbf | |||
| bdf14b8f24 | |||
| 43375a6f5b | |||
| e00328ae13 | |||
| 07c553294b |
+44
-38
@@ -152,7 +152,9 @@ public class Enum {
|
||||
NEPHFEMALE(2026, MonsterType.Nephilim, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.1f),
|
||||
HALFGIANTFEMALE(2027, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.15f),
|
||||
VAMPMALE(2028, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.MALE, 1),
|
||||
VAMPFEMALE(2029, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.FEMALE, 1);
|
||||
VAMPFEMALE(2029, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.FEMALE, 1),
|
||||
SAETOR(1999, MonsterType.Minotaur, RunSpeed.MINOTAUR, CharacterSex.MALE, 0.80000001f),
|
||||
LIZARDMAN(1998, MonsterType.Reptile, RunSpeed.STANDARD, CharacterSex.MALE, 1.05f);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static HashMap<Integer, RaceType> _raceTypeByID = new HashMap<>();
|
||||
@@ -172,8 +174,6 @@ public class Enum {
|
||||
}
|
||||
|
||||
public static RaceType getRaceTypebyRuneID(int runeID) {
|
||||
if(runeID == 1999)
|
||||
return _raceTypeByID.get(2017);
|
||||
return _raceTypeByID.get(runeID);
|
||||
}
|
||||
|
||||
@@ -210,8 +210,9 @@ public class Enum {
|
||||
SENTINEL(0, 0, 0, 0, 0, 0, 0),
|
||||
STANDARD(6.1900001f, 13.97f, 4.2199998f, 13.97f, 6.3299999f, 18.379999f, 6.5f),
|
||||
CENTAUR(6.1900001f, 16.940001f, 5.5500002f, 16.940001f, 6.3299999f, 18.379999f, 6.5f),
|
||||
MINOTAUR(6.6300001f, 15.95f, 4.2199998f, 15.95f, 6.3299999f, 18.379999f, 6.5f),
|
||||
IREKEI(6.499500105f, 14.6685f, 4.2199998f, 14.6685f, 6.3299999f, 18.379999f, 6.5f);
|
||||
IREKEI(6.35f, 15.25f, 4.2199998f, 14.5f, 6.3299999f, 18.379999f, 6.5f),
|
||||
MINOTAUR(6.6300001f, 15.95f, 4.2199998f, 15.95f, 6.3299999f, 18.379999f, 6.5f);
|
||||
|
||||
private float walkStandard;
|
||||
private float walkCombat;
|
||||
private float runStandard;
|
||||
@@ -778,7 +779,6 @@ public class Enum {
|
||||
Combat,
|
||||
Spires,
|
||||
Snare,
|
||||
Snared,
|
||||
Stun,
|
||||
Blind,
|
||||
Root,
|
||||
@@ -881,7 +881,6 @@ public class Enum {
|
||||
Siege,
|
||||
Slash,
|
||||
Snare,
|
||||
Snared,
|
||||
Sorcery,
|
||||
Spear,
|
||||
SpearMastery,
|
||||
@@ -961,21 +960,20 @@ public class Enum {
|
||||
Wizardry;
|
||||
|
||||
public static SourceType GetSourceType(String modName) {
|
||||
switch(modName){
|
||||
case "Slashing":
|
||||
modName = "Slash";
|
||||
SourceType returnMod;
|
||||
if (modName.isEmpty())
|
||||
return SourceType.None;
|
||||
switch(modName) {
|
||||
case "Piercing":
|
||||
modName = "Pierce";
|
||||
break;
|
||||
case "Crushing":
|
||||
modName = "Crush";
|
||||
break;
|
||||
case "Piercing":
|
||||
modName = "Pierce";
|
||||
case "Slashing":
|
||||
modName = "Slash";
|
||||
break;
|
||||
}
|
||||
SourceType returnMod;
|
||||
if (modName.isEmpty())
|
||||
return SourceType.None;
|
||||
|
||||
try {
|
||||
returnMod = SourceType.valueOf(modName.replace(",", ""));
|
||||
} catch (Exception e) {
|
||||
@@ -1031,7 +1029,6 @@ public class Enum {
|
||||
Silence,
|
||||
Slash,
|
||||
Snare,
|
||||
Snared,
|
||||
Stance,
|
||||
Stun,
|
||||
Summon,
|
||||
@@ -1090,15 +1087,6 @@ public class Enum {
|
||||
DamageShield,
|
||||
DeathShroud,
|
||||
DefenseBuff,
|
||||
DefenseBuffAss,
|
||||
DefenseBuffChn,
|
||||
DefenseBuffDsr,
|
||||
DefenseBuffFur,
|
||||
DefenseBuffNec,
|
||||
DefenseBuffNsr,
|
||||
DefenseBuffPrl,
|
||||
DefenseBuffRng,
|
||||
DefenseBuffWiz,
|
||||
DefenseBuffGroup,
|
||||
DefenseDebuff,
|
||||
DetectInvis,
|
||||
@@ -1165,7 +1153,6 @@ public class Enum {
|
||||
SkillDebuff,
|
||||
SlashResistanceDebuff,
|
||||
Snare,
|
||||
Snared,
|
||||
StackableAttrCONBuff,
|
||||
StackableAttrDEXBuff,
|
||||
StackableAttrSTRBuff,
|
||||
@@ -1678,6 +1665,24 @@ public class Enum {
|
||||
return extents;
|
||||
}
|
||||
|
||||
public boolean isTrainerBuilding(){
|
||||
switch(this){
|
||||
case AMAZONHALL:
|
||||
case CATHEDRAL:
|
||||
case GREATHALL:
|
||||
case KEEP:
|
||||
case THIEFHALL:
|
||||
case TEMPLEHALL:
|
||||
case WIZARDHALL:
|
||||
case ELVENHALL:
|
||||
case ELVENSANCTUM:
|
||||
case IREKEIHALL:
|
||||
case FORESTHALL:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum UpdateType {
|
||||
@@ -2332,9 +2337,9 @@ public class Enum {
|
||||
|
||||
public enum CityBoundsType {
|
||||
|
||||
GRID(544),
|
||||
ZONE(672),
|
||||
PLACEMENT(673);
|
||||
GRID(640),
|
||||
ZONE(680),
|
||||
PLACEMENT(681);
|
||||
|
||||
public final float extents;
|
||||
|
||||
@@ -2848,7 +2853,6 @@ public class Enum {
|
||||
|
||||
public enum MobBehaviourType {
|
||||
None(null, false, false, false, false, false),
|
||||
//Power
|
||||
Power(null, false, true, true, true, false),
|
||||
PowerHelpee(Power, false, true, true, false, true),
|
||||
PowerHelpeeWimpy(Power, true, false, true, false, false),
|
||||
@@ -2873,6 +2877,7 @@ public class Enum {
|
||||
//Independent Types
|
||||
SimpleStandingGuard(null, false, false, false, false, false),
|
||||
Pet1(null, false, false, true, false, false),
|
||||
SiegeEngine(null, false, false, false, false, false),
|
||||
Simple(null, false, false, true, false, false),
|
||||
Helpee(null, false, true, true, false, true),
|
||||
HelpeeWimpy(null, true, false, true, false, false),
|
||||
@@ -2883,13 +2888,12 @@ public class Enum {
|
||||
HamletGuard(null, false, true, false, false, false),
|
||||
AggroWanderer(null, false, false, true, false, false);
|
||||
|
||||
private static HashMap<Integer, MobBehaviourType> _behaviourTypes = new HashMap<>();
|
||||
public MobBehaviourType BehaviourHelperType;
|
||||
public boolean isWimpy;
|
||||
public boolean isAgressive;
|
||||
public boolean canRoam;
|
||||
public boolean callsForHelp;
|
||||
public boolean respondsToCallForHelp;
|
||||
public final MobBehaviourType BehaviourHelperType;
|
||||
public final boolean isWimpy;
|
||||
public final boolean isAgressive;
|
||||
public final boolean canRoam;
|
||||
public final boolean callsForHelp;
|
||||
public final boolean respondsToCallForHelp;
|
||||
|
||||
MobBehaviourType(MobBehaviourType helpeebehaviourType, boolean wimpy, boolean agressive, boolean canroam, boolean callsforhelp, boolean respondstocallforhelp) {
|
||||
this.BehaviourHelperType = helpeebehaviourType;
|
||||
@@ -2906,6 +2910,8 @@ public class Enum {
|
||||
MOBILE,
|
||||
PET,
|
||||
CHARMED,
|
||||
|
||||
SIEGEENGINE,
|
||||
GUARD;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,13 @@ import engine.net.AbstractNetMsg;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.*;
|
||||
import engine.net.client.msg.LoadCharacterMsg;
|
||||
import engine.net.client.msg.LoadStructureMsg;
|
||||
import engine.net.client.msg.MoveToPointMsg;
|
||||
import engine.net.client.msg.UnloadObjectsMsg;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.util.BoxTracker;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -106,7 +110,7 @@ public enum InterestManager implements Runnable {
|
||||
origin.sendMsg(moveMsg);
|
||||
}
|
||||
|
||||
public static void reloadCharacter(AbstractCharacter absChar) {
|
||||
public static void reloadCharacter(AbstractCharacter absChar, boolean sendToSelf) {
|
||||
|
||||
UnloadObjectsMsg uom = new UnloadObjectsMsg();
|
||||
uom.addObject(absChar);
|
||||
@@ -207,7 +211,7 @@ public enum InterestManager implements Runnable {
|
||||
if (origin == null)
|
||||
continue;
|
||||
|
||||
if (!playerCharacter.isEnteredWorld())
|
||||
if (!playerCharacter.enteredWorld)
|
||||
continue;
|
||||
|
||||
if (playerCharacter.getTeleportLock().readLock().tryLock()) {
|
||||
@@ -464,7 +468,7 @@ public enum InterestManager implements Runnable {
|
||||
if (awonpc.despawned == true)
|
||||
continue;
|
||||
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), false);
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
|
||||
((Mob) awonpc).setCombatTarget(null);
|
||||
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
|
||||
|
||||
@@ -477,7 +481,7 @@ public enum InterestManager implements Runnable {
|
||||
if (!awonpc.isAlive())
|
||||
continue;
|
||||
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), false);
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
|
||||
|
||||
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE)))
|
||||
((Mob) awonpc).setCombatTarget(null);
|
||||
@@ -518,10 +522,11 @@ public enum InterestManager implements Runnable {
|
||||
|
||||
// Update loaded upbjects lists
|
||||
|
||||
player.isBoxed = PlayerCharacter.checkIfBoxed(player);
|
||||
player.setDirtyLoad(true);
|
||||
updateStaticList(player, origin);
|
||||
updateMobileList(player, origin);
|
||||
BoxTracker.addPlayer(origin.machineID,player);
|
||||
|
||||
}
|
||||
|
||||
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) {
|
||||
|
||||
@@ -10,13 +10,17 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.*;
|
||||
import engine.objects.Bane;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.City;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class dbBaneHandler extends dbHandlerBase {
|
||||
|
||||
@@ -85,139 +89,6 @@ public class dbBaneHandler extends dbHandlerBase {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean SET_BANE_TIME_NEW(int hour, int cityUUID) {
|
||||
hour += 12; // Adjust hour
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement getStatement = connection.prepareStatement("SELECT `placementDate`, `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?");
|
||||
PreparedStatement updateStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=?, `time_set`=? WHERE `cityUUID`=?")) {
|
||||
|
||||
// Retrieve placementDate and liveDate
|
||||
getStatement.setInt(1, cityUUID);
|
||||
try (ResultSet rs = getStatement.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
DateTime placementDate = new DateTime(rs.getTimestamp("placementDate").getTime());
|
||||
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
|
||||
|
||||
// Explicitly check if liveDate is null
|
||||
DateTime toSet;
|
||||
if (liveDateTimestamp == null) {
|
||||
// If liveDate is null, default to placementDate
|
||||
toSet = placementDate;
|
||||
} else {
|
||||
// If liveDate is not null, use it
|
||||
DateTime liveDate = new DateTime(liveDateTimestamp.getTime());
|
||||
toSet = liveDate;
|
||||
}
|
||||
|
||||
// Adjust the time
|
||||
toSet = toSet.withHourOfDay(hour).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
|
||||
|
||||
// Update liveDate and time_set flag
|
||||
updateStatement.setTimestamp(1, new java.sql.Timestamp(toSet.getMillis()));
|
||||
updateStatement.setInt(2, 1); // time_set flag
|
||||
updateStatement.setInt(3, cityUUID);
|
||||
|
||||
updateStatement.execute();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean SET_BANE_DAY_NEW(int dayOffset, int cityUUID) {
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement getStatement = connection.prepareStatement("SELECT `placementDate`, `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?");
|
||||
PreparedStatement updateStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=?, `day_set`=? WHERE `cityUUID`=?")) {
|
||||
|
||||
// Retrieve placementDate and liveDate
|
||||
getStatement.setInt(1, cityUUID);
|
||||
try (ResultSet rs = getStatement.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
DateTime placementDate = new DateTime(rs.getTimestamp("placementDate").getTime());
|
||||
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
|
||||
|
||||
// Explicitly check if liveDate is null
|
||||
DateTime liveDate;
|
||||
if (liveDateTimestamp == null) {
|
||||
// If liveDate is null, default to placementDate
|
||||
liveDate = placementDate;
|
||||
} else {
|
||||
// If liveDate is not null, use it
|
||||
liveDate = new DateTime(liveDateTimestamp.getTime());
|
||||
}
|
||||
|
||||
// Calculate the new liveDate while preserving the time component
|
||||
DateTime updatedDate = placementDate.plusDays(dayOffset)
|
||||
.withHourOfDay(liveDate.getHourOfDay())
|
||||
.withMinuteOfHour(liveDate.getMinuteOfHour())
|
||||
.withSecondOfMinute(liveDate.getSecondOfMinute())
|
||||
.withMillisOfSecond(liveDate.getMillisOfSecond());
|
||||
|
||||
// Update liveDate and day_set flag
|
||||
updateStatement.setTimestamp(1, new java.sql.Timestamp(updatedDate.getMillis()));
|
||||
updateStatement.setInt(2, 1); // day_set flag
|
||||
updateStatement.setInt(3, cityUUID);
|
||||
|
||||
updateStatement.execute();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean SET_BANE_CAP_NEW(int count, int cityUUID) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_size`=? WHERE `cityUUID`=?")) {
|
||||
|
||||
preparedStatement.setInt(1, count);
|
||||
preparedStatement.setLong(2, cityUUID);
|
||||
|
||||
preparedStatement.execute();
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
return false;
|
||||
}
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_set`=? WHERE `cityUUID`=?")) {
|
||||
|
||||
preparedStatement.setInt(1, 1);
|
||||
preparedStatement.setLong(2, cityUUID);
|
||||
|
||||
preparedStatement.execute();
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_size`=? WHERE `cityUUID`=?")) {
|
||||
|
||||
preparedStatement.setInt(1, count);
|
||||
preparedStatement.setLong(2, cityUUID);
|
||||
|
||||
preparedStatement.execute();
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean REMOVE_BANE(Bane bane) {
|
||||
|
||||
if (bane == null)
|
||||
@@ -236,25 +107,4 @@ public class dbBaneHandler extends dbHandlerBase {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public DateTime getLiveDate(int cityUUID) {
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement statement = connection.prepareStatement("SELECT `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?")) {
|
||||
|
||||
statement.setInt(1, cityUUID);
|
||||
|
||||
try (ResultSet rs = statement.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
|
||||
if (liveDateTimestamp != null) {
|
||||
return new DateTime(liveDateTimestamp.getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
return null; // Return null if liveDate is not found or an error occurs
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,14 @@ public class dbBlueprintHandler extends dbHandlerBase {
|
||||
Blueprint._meshLookup.putIfAbsent(thisBlueprint.getMeshForRank(3), thisBlueprint);
|
||||
Blueprint._meshLookup.putIfAbsent(thisBlueprint.getMeshForRank(7), thisBlueprint);
|
||||
|
||||
if(thisBlueprint.getName().contains("Vampire Shrine")){
|
||||
Blueprint saetorShrine = new Blueprint(rs);
|
||||
saetorShrine.setBlueprintUUID(1720000);
|
||||
saetorShrine.rank1UUID = 1720000;
|
||||
saetorShrine.rank3UUID = 1720000;
|
||||
saetorShrine.rank7UUID = 1720000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import engine.gameManager.DbManager;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.CharacterSkill;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.objects.SkillsBase;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
|
||||
@@ -11,7 +11,10 @@ package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.*;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.City;
|
||||
import engine.objects.Zone;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.*;
|
||||
@@ -92,16 +95,7 @@ public class dbCityHandler extends dbHandlerBase {
|
||||
|
||||
return objectList;
|
||||
}
|
||||
public Integer GET_CAPITAL_CITY_COUNT() {
|
||||
|
||||
int cityCount = 0;
|
||||
for(Realm realm : Realm._realms.values()){
|
||||
if(realm.isRuled())
|
||||
cityCount ++;
|
||||
}
|
||||
|
||||
return cityCount;
|
||||
}
|
||||
public ArrayList<City> GET_CITIES_BY_ZONE(final int objectUUID) {
|
||||
|
||||
ArrayList<City> cityList = new ArrayList<>();
|
||||
|
||||
@@ -98,54 +98,32 @@ public class dbContractHandler extends dbHandlerBase {
|
||||
|
||||
public void LOAD_SELL_LIST_FOR_CONTRACT(final Contract contract) {
|
||||
|
||||
if(!contract.getName().contains("Sage")) {
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype` WHERE `contractID` = ?;")) {
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype` WHERE `contractID` = ?;")) {
|
||||
|
||||
preparedStatement.setInt(1, contract.getObjectUUID());
|
||||
preparedStatement.setInt(1, contract.getObjectUUID());
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
while (rs.next()) {
|
||||
|
||||
int type = rs.getInt("type");
|
||||
int value = rs.getInt("value");
|
||||
int type = rs.getInt("type");
|
||||
int value = rs.getInt("value");
|
||||
|
||||
switch (type) {
|
||||
case 1:
|
||||
contract.getBuyItemType().add(value);
|
||||
break;
|
||||
case 2:
|
||||
contract.getBuySkillToken().add(value);
|
||||
break;
|
||||
case 3:
|
||||
contract.getBuyUnknownToken().add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}else{
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype`;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int value = rs.getInt("value");
|
||||
if(!contract.getBuySkillToken().contains(value))
|
||||
contract.getBuySkillToken().add(value);
|
||||
|
||||
if(!contract.getBuyItemType().contains(value))
|
||||
switch (type) {
|
||||
case 1:
|
||||
contract.getBuyItemType().add(value);
|
||||
|
||||
if(!contract.getBuyUnknownToken().contains(value))
|
||||
break;
|
||||
case 2:
|
||||
contract.getBuySkillToken().add(value);
|
||||
break;
|
||||
case 3:
|
||||
contract.getBuyUnknownToken().add(value);
|
||||
break;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public abstract class dbHandlerBase {
|
||||
try {
|
||||
if (rs.next()) {
|
||||
abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs);
|
||||
|
||||
DbManager.addToCache(abstractGameObject);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -56,23 +57,10 @@ public abstract class dbHandlerBase {
|
||||
while (rs.next()) {
|
||||
|
||||
int id = rs.getInt(1);
|
||||
try {
|
||||
if (rs.getInt("capSize") == 0) {
|
||||
continue;
|
||||
}
|
||||
}catch(Exception e){
|
||||
//not a mine
|
||||
}
|
||||
|
||||
if (DbManager.inCache(localObjectType, id)) {
|
||||
objectList.add((T) DbManager.getFromCache(localObjectType, id));
|
||||
} else {
|
||||
try{
|
||||
if(rs.getInt("mineLiveHour") == 1)
|
||||
continue;
|
||||
}catch(Exception e){
|
||||
//not a mine
|
||||
}
|
||||
AbstractGameObject toAdd = localClass.getConstructor(ResultSet.class).newInstance(rs);
|
||||
DbManager.addToCache(toAdd);
|
||||
if(toAdd.getObjectType().equals(GameObjectType.Zone) && rs.getInt("canLoad") == 0){
|
||||
|
||||
@@ -28,10 +28,67 @@ public class dbItemBaseHandler extends dbHandlerBase {
|
||||
|
||||
public void LOAD_BAKEDINSTATS(ItemBase itemBase) {
|
||||
|
||||
int itemBaseID = itemBase.getUUID();
|
||||
switch(itemBaseID){
|
||||
case 27550://bow
|
||||
case 27560://dagger
|
||||
case 27570://hammer
|
||||
case 27580://axe
|
||||
case 27590://sword
|
||||
//return new String[]{"PRE-010","SUF-260"};
|
||||
itemBaseID = 8000000;
|
||||
break;
|
||||
case 27600://staff
|
||||
//return new String[]{"PRE-334","PRE-315"};
|
||||
itemBaseID = 8000010;
|
||||
break;
|
||||
|
||||
case 188500://HA chest
|
||||
case 188510://HA arms
|
||||
case 188520://HA legs
|
||||
case 188530://HA gloves
|
||||
case 188550://HA helm
|
||||
case 188720://CC hood
|
||||
case 188900://MA chest
|
||||
case 188910://MA Sleeves
|
||||
case 188920://MA Legs
|
||||
case 188930://MA gloves
|
||||
case 188950://MA helm
|
||||
case 189100://la chest
|
||||
case 189110://la arms
|
||||
case 189120://la legs
|
||||
case 189130://la gloves
|
||||
case 189150://la helm
|
||||
case 189550://CC gloves
|
||||
//return new String[]{"PRE-130", "PRE-232", "PRE-212", "PRE-222", "SUF-007"};
|
||||
itemBaseID = 8000020;
|
||||
break;
|
||||
|
||||
case 188540://HA boots
|
||||
case 188940://MA boots
|
||||
case 189140://LA boots
|
||||
case 189560://CC boots
|
||||
//return new String[]{"PRE-133", "PRE-230", "PRE-210", "PRE-220", "SUF-003","SUF-150"};
|
||||
itemBaseID = 8000030;
|
||||
break;
|
||||
|
||||
case 188700://CC robe
|
||||
//return new String[]{"PRE-130", "PRE-232", "PRE-212", "PRE-222","SUF-317","SUF-317","SUF-317"};
|
||||
itemBaseID = 8000040;
|
||||
break;
|
||||
|
||||
case 189500://MA shield
|
||||
case 189510://HA shield
|
||||
//return new String[]{"PRE-125","PRE-125","PRE-125", "PRE-230", "PRE-210", "PRE-220"};
|
||||
itemBaseID = 8000050;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_bakedinstat` WHERE `itemID` = ?")) {
|
||||
|
||||
preparedStatement.setInt(1, itemBase.getUUID());
|
||||
preparedStatement.setInt(1, itemBaseID);
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
@@ -87,12 +144,19 @@ public class dbItemBaseHandler extends dbHandlerBase {
|
||||
recordsRead++;
|
||||
itemBase = new ItemBase(rs);
|
||||
ItemBase.addToCache(itemBase);
|
||||
|
||||
//copy the vampire shrine for saetor and change uuid and name
|
||||
if(itemBase.getName().contains("Vampire Shrine")){
|
||||
ItemBase saetorShrine = new ItemBase(rs);
|
||||
saetorShrine.setUUID(1035);
|
||||
saetorShrine.setName(saetorShrine.getName().replace("Vampire","Saetor"));
|
||||
ItemBase.addToCache(saetorShrine);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
Logger.info("read: " + recordsRead + " cached: " + ItemBase.getUUIDCache().size());
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,11 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
if (rs.next())
|
||||
worked = rs.getBoolean("result");
|
||||
try {
|
||||
worked = rs.getBoolean("result");
|
||||
}catch(Exception e){
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
@@ -350,7 +354,11 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
if (rs.next())
|
||||
worked = rs.getBoolean("result");
|
||||
try {
|
||||
worked = rs.getBoolean("result");
|
||||
} catch(Exception e){
|
||||
worked = true;
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.MineProduction;
|
||||
import engine.objects.Resource;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
@@ -32,8 +34,24 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
|
||||
if (id == 0)
|
||||
return null;
|
||||
|
||||
Mine mine = (Mine) DbManager.getFromCache(Enum.GameObjectType.Mine, id);
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM obj_mine;")) {
|
||||
|
||||
//preparedStatement.setInt(1, id);
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
while(rs.next()){
|
||||
if(rs.getInt("UID") == id){
|
||||
int towerUID = rs.getInt("mine_buildingUID");
|
||||
mine = Mine.getMineFromTower(towerUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
if (mine != null)
|
||||
return mine;
|
||||
@@ -56,13 +74,27 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
|
||||
ArrayList<Mine> mines = new ArrayList<>();
|
||||
|
||||
//try (Connection connection = DbManager.getConnection();
|
||||
// PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_mine`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mine` ON `obj_mine`.`UID` = `object`.`UID`")) {
|
||||
|
||||
// ResultSet rs = preparedStatement.executeQuery();
|
||||
// mines = getObjectsFromRs(rs, 1000);
|
||||
|
||||
// } catch (SQLException e) {
|
||||
// Logger.error(e);
|
||||
//}
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_mine`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mine` ON `obj_mine`.`UID` = `object`.`UID`")) {
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM obj_mine;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
mines = getObjectsFromRs(rs, 1000);
|
||||
while(rs.next()){
|
||||
if(BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID")) == null)
|
||||
continue;
|
||||
|
||||
} catch (SQLException e) {
|
||||
mines.add(new Mine(rs));
|
||||
}
|
||||
|
||||
} catch (SQLException | UnknownHostException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
return mines;
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class dbMobBaseHandler extends dbHandlerBase {
|
||||
|
||||
@@ -112,6 +113,25 @@ public class dbMobBaseHandler extends dbHandlerBase {
|
||||
return mobBaseStats;
|
||||
}
|
||||
|
||||
public void LOAD_ALL_MOBBASE_RACES() {
|
||||
MobBase.mobbase_race_types = new HashMap<>();
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mobbase`;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int id = rs.getInt("loadID");
|
||||
if(MobBase.mobbase_race_types.containsKey(id) == false){
|
||||
MobBase.mobbase_race_types.put(id,rs.getString("raceType"));
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void LOAD_ALL_MOBBASE_SPEEDS(MobBase mobBase) {
|
||||
|
||||
if (mobBase.getLoadID() == 0)
|
||||
|
||||
@@ -28,31 +28,26 @@ public class dbMobHandler extends dbHandlerBase {
|
||||
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName());
|
||||
}
|
||||
|
||||
public Mob ADD_MOB(Mob toAdd) {
|
||||
public Mob PERSIST(Mob toAdd) {
|
||||
|
||||
Mob mobile = null;
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);")) {
|
||||
|
||||
preparedStatement.setLong(1, toAdd.getParentZoneID());
|
||||
preparedStatement.setInt(2, toAdd.getMobBaseID());
|
||||
preparedStatement.setInt(3, toAdd.getGuildUUID());
|
||||
preparedStatement.setFloat(4, toAdd.getSpawnX());
|
||||
preparedStatement.setFloat(5, toAdd.getSpawnY());
|
||||
preparedStatement.setFloat(6, toAdd.getSpawnZ());
|
||||
preparedStatement.setLong(1, toAdd.parentZoneUUID);
|
||||
preparedStatement.setInt(2, toAdd.loadID);
|
||||
preparedStatement.setInt(3, toAdd.guildUUID);
|
||||
preparedStatement.setFloat(4, toAdd.bindLoc.x);
|
||||
preparedStatement.setFloat(5, toAdd.bindLoc.y);
|
||||
preparedStatement.setFloat(6, toAdd.bindLoc.z);
|
||||
preparedStatement.setInt(7, 0);
|
||||
preparedStatement.setFloat(8, toAdd.getSpawnRadius());
|
||||
preparedStatement.setInt(9, toAdd.getTrueSpawnTime());
|
||||
|
||||
if (toAdd.getContract() != null)
|
||||
preparedStatement.setInt(10, toAdd.getContract().getContractID());
|
||||
else
|
||||
preparedStatement.setInt(10, 0);
|
||||
|
||||
preparedStatement.setInt(11, toAdd.getBuildingID());
|
||||
preparedStatement.setInt(12, toAdd.getLevel());
|
||||
preparedStatement.setString(13, toAdd.getFirstName());
|
||||
preparedStatement.setFloat(8, toAdd.spawnRadius);
|
||||
preparedStatement.setInt(9, toAdd.spawnTime);
|
||||
preparedStatement.setInt(10, toAdd.contractUUID);
|
||||
preparedStatement.setInt(11, toAdd.buildingUUID);
|
||||
preparedStatement.setInt(12, toAdd.level);
|
||||
preparedStatement.setString(13, toAdd.firstName);
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
@@ -106,17 +101,17 @@ public class dbMobHandler extends dbHandlerBase {
|
||||
return row_count;
|
||||
}
|
||||
|
||||
public void LOAD_PATROL_POINTS(Mob captain) {
|
||||
public void LOAD_GUARD_MINIONS(Mob guardCaptain) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_guards` WHERE `captainUID` = ?")) {
|
||||
|
||||
preparedStatement.setInt(1, captain.getObjectUUID());
|
||||
preparedStatement.setInt(1, guardCaptain.getObjectUUID());
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("name");
|
||||
Mob toCreate = Mob.createGuardMob(captain, captain.getGuild(), captain.getParentZone(), captain.building.getLoc(), captain.getLevel(), name);
|
||||
String minionName = rs.getString("name");
|
||||
Mob toCreate = Mob.createGuardMinion(guardCaptain, guardCaptain.getLevel(), minionName);
|
||||
|
||||
if (toCreate == null)
|
||||
return;
|
||||
|
||||
@@ -131,32 +131,6 @@ public class dbNPCHandler extends dbHandlerBase {
|
||||
return npc;
|
||||
}
|
||||
|
||||
public int BANE_COMMANDER_EXISTS(final int objectUUID) {
|
||||
|
||||
int uid = 0;
|
||||
|
||||
String query = "SELECT `UID` FROM `obj_npc` WHERE `npc_buildingID` = ? LIMIT 1;";
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement(query)) {
|
||||
|
||||
preparedStatement.setInt(1, objectUUID);
|
||||
|
||||
try (ResultSet rs = preparedStatement.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
// Retrieve the UID column value
|
||||
uid = rs.getInt("UID");
|
||||
}
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
public int MOVE_NPC(long npcID, long parentID, float locX, float locY, float locZ) {
|
||||
|
||||
int rowCount;
|
||||
@@ -202,18 +176,6 @@ public class dbNPCHandler extends dbHandlerBase {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void updateSpecialPricing(final NPC npc){
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_npc SET specialPrice=? WHERE UID = ?")) {
|
||||
preparedStatement.setInt(1, npc.getSpecialPrice());
|
||||
preparedStatement.setInt(2, npc.getDBID());
|
||||
|
||||
preparedStatement.executeUpdate();
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
public void updateDatabase(final NPC npc) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
|
||||
@@ -23,7 +23,25 @@ public class dbResistHandler extends dbHandlerBase {
|
||||
public dbResistHandler() {
|
||||
|
||||
}
|
||||
public void LOAD_RESISTS_FOR_MOBS() {
|
||||
|
||||
Resists resists = null;
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mob_resists`;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while(rs.next()){
|
||||
resists = new Resists(rs);
|
||||
if(!Resists.mobResists.containsKey(rs.getInt("ID")))
|
||||
Resists.mobResists.put(rs.getInt("ID"),resists);
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
public Resists GET_RESISTS_FOR_MOB(int resistID) {
|
||||
|
||||
Resists resists = null;
|
||||
|
||||
@@ -59,6 +59,43 @@ public class dbRuneBaseHandler extends dbHandlerBase {
|
||||
rb.setLevelRequired(rs.getInt("requiredRuneID"));
|
||||
break;
|
||||
}
|
||||
int id = rs.getInt("runeID");
|
||||
switch(id) {
|
||||
case 3001:
|
||||
case 3002:
|
||||
case 3003:
|
||||
case 3004:
|
||||
case 3007:
|
||||
case 3008:
|
||||
case 3009:
|
||||
case 3013:
|
||||
case 3014:
|
||||
case 3016:
|
||||
case 3017:
|
||||
case 3018:
|
||||
case 3019:
|
||||
case 3020:
|
||||
case 3021:
|
||||
case 3026:
|
||||
case 3030:
|
||||
case 3031:
|
||||
case 3033:
|
||||
case 3037:
|
||||
case 3040:
|
||||
case 3045:
|
||||
case 3046:
|
||||
case 3047:
|
||||
case 3048:
|
||||
case 2514:
|
||||
rb.getRace().put(1999, true);
|
||||
break;
|
||||
case 3035:
|
||||
rb.getBaseClass().put(2501,true);
|
||||
break;
|
||||
case 3049:
|
||||
rb.getRace().clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
|
||||
@@ -143,6 +143,13 @@ public class dbSkillBaseHandler extends dbHandlerBase {
|
||||
|
||||
SkillsBase.runeSkillsCache.get(runeID).put(token, amount);
|
||||
}
|
||||
//add saetor skills
|
||||
HashMap<Integer, Integer> skills = new HashMap<>();
|
||||
skills.put(71438003,15); // staff
|
||||
skills.put(-61022283,10); // staff mastery
|
||||
skills.put(95961104,10); // parry
|
||||
SkillsBase.runeSkillsCache.put(1999,skills);
|
||||
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AddMobCmd extends AbstractDevCmd {
|
||||
MobBase mb = (MobBase) mobbaseAGO;
|
||||
int loadID = mb.getObjectUUID();
|
||||
Mob mob = Mob.createMob(loadID, Vector3fImmutable.getRandomPointInCircle(pc.getLoc(), 100),
|
||||
null, true, zone, null, 0, "", 1);
|
||||
null, zone, null, null, "", 1);
|
||||
if (mob != null) {
|
||||
mob.updateDatabase();
|
||||
this.setResult(String.valueOf(mob.getDBID()));
|
||||
@@ -84,7 +84,7 @@ public class AddMobCmd extends AbstractDevCmd {
|
||||
|
||||
|
||||
Mob mob = Mob.createMob(loadID, pc.getLoc(),
|
||||
null, true, zone, null, 0, "", 1);
|
||||
null, zone, null, null, "", 1);
|
||||
if (mob != null) {
|
||||
mob.updateDatabase();
|
||||
ChatManager.chatSayInfo(pc,
|
||||
|
||||
@@ -32,6 +32,7 @@ public class AddNPCCmd extends AbstractDevCmd {
|
||||
int contractID;
|
||||
String name = "";
|
||||
int level = 0;
|
||||
|
||||
if (words.length < 2) {
|
||||
this.sendUsage(pc);
|
||||
return;
|
||||
@@ -39,26 +40,33 @@ public class AddNPCCmd extends AbstractDevCmd {
|
||||
try {
|
||||
contractID = Integer.parseInt(words[0]);
|
||||
level = Integer.parseInt(words[1]);
|
||||
|
||||
for (int i = 2; i < words.length; i++) {
|
||||
name += words[i];
|
||||
if (i + 1 < words.length)
|
||||
name += "";
|
||||
}
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
throwbackError(pc,
|
||||
"Failed to parse supplied contractID or level to an Integer.");
|
||||
return; // NaN
|
||||
}
|
||||
|
||||
Contract contract = DbManager.ContractQueries.GET_CONTRACT(contractID);
|
||||
|
||||
if (contract == null || level < 1 || level > 75) {
|
||||
throwbackError(pc,
|
||||
"Invalid addNPC Command. Need contract ID, and level");
|
||||
return; // NaN
|
||||
}
|
||||
|
||||
// Pick a random name
|
||||
if (name.isEmpty())
|
||||
name = NPCManager.getPirateName(contract.getMobbaseID());
|
||||
|
||||
Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
|
||||
|
||||
if (zone == null) {
|
||||
throwbackError(pc, "Failed to find zone to place npc in.");
|
||||
return;
|
||||
|
||||
@@ -11,6 +11,7 @@ package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.objects.*;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
public class EnchantCmd extends AbstractDevCmd {
|
||||
|
||||
@@ -55,21 +56,9 @@ public class EnchantCmd extends AbstractDevCmd {
|
||||
this.setResult(String.valueOf(item.getObjectUUID()));
|
||||
} else {
|
||||
int cnt = words.length;
|
||||
for (int i = 1; i < cnt; i++) {
|
||||
String enchant = words[i];
|
||||
boolean valid = true;
|
||||
for (Effect eff : item.getEffects().values()) {
|
||||
if (eff.getEffectsBase().getIDString().equals(enchant)) {
|
||||
throwbackError(pc, "This item already has that enchantment");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (valid) {
|
||||
item.addPermanentEnchantmentForDev(enchant, rank);
|
||||
this.setResult(String.valueOf(item.getObjectUUID()));
|
||||
} else
|
||||
throwbackError(pc, "Invalid Enchantment. Enchantment must consist of SUF-001 to SUF-328 or PRE-001 to PRE-334. Sent " + enchant + '.');
|
||||
}
|
||||
String enchant = words[1];
|
||||
enchant = EffectsBase.getItemEffectsByName(enchant.toLowerCase());
|
||||
item.addPermanentEnchantmentForDev(enchant, 0);
|
||||
cim.updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class FlashMsgCmd extends AbstractDevCmd {
|
||||
this.sendUsage(pcSender);
|
||||
return;
|
||||
}
|
||||
ChatManager.chatSystemFlash(args[0]);
|
||||
ChatManager.chatSystemFlash(String.join(" ", args));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
/**
|
||||
* ./hotzone <- display the current hotzone & time remaining
|
||||
* ./hotzone random <- change hotzone to random new zone
|
||||
*/
|
||||
|
||||
public class HotzoneCmd extends AbstractDevCmd {
|
||||
|
||||
public HotzoneCmd() {
|
||||
super("hotzone");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _doCmd(PlayerCharacter playerCharacter, String[] words,
|
||||
AbstractGameObject target) {
|
||||
|
||||
StringBuilder data = new StringBuilder();
|
||||
String outString;
|
||||
|
||||
for (String s : words) {
|
||||
data.append(s);
|
||||
data.append(' ');
|
||||
}
|
||||
|
||||
String input = data.toString().trim();
|
||||
|
||||
if (input.length() == 0) {
|
||||
outString = "Current hotZone: " + ZoneManager.hotZone.getName() + "\r\n";
|
||||
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
||||
throwbackInfo(playerCharacter, outString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.equalsIgnoreCase("random")) {
|
||||
ZoneManager.generateAndSetRandomHotzone();
|
||||
outString = "New hotZone: " + ZoneManager.hotZone.getName() + "\r\n";
|
||||
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
||||
throwbackInfo(playerCharacter, outString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.equalsIgnoreCase("reset")) {
|
||||
ZoneManager.resetHotZones();
|
||||
throwbackInfo(playerCharacter, "Available hotZones: " + ZoneManager.availableHotZones());
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getHelpString() {
|
||||
return "Use no arguments to see the current hotzone or \"random\" to change it randomly.";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getUsageString() {
|
||||
return "'./hotzone [random]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -280,7 +280,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += newline;
|
||||
output += "Inventory Weight:" + (targetPC.getCharItemManager().getInventoryWeight() + targetPC.getCharItemManager().getEquipWeight());
|
||||
output += newline;
|
||||
output += "Max Inventory Weight:" + ((int) targetPC.statStrBase * 3);
|
||||
output += "Max Inventory Weight:" + targetPC.getInventoryCapacity();
|
||||
output += newline;
|
||||
output += "ALTITUDE :" + targetPC.getAltitude();
|
||||
output += newline;
|
||||
@@ -336,9 +336,9 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
|
||||
output += "Swimming : " + targetPC.isSwimming();
|
||||
output += newline;
|
||||
output += "isMoving : " + targetPC.isMoving();
|
||||
output += newline;
|
||||
output += "Zerg Multiplier : " + targetPC.ZergMultiplier;
|
||||
output += "isMoving : " + targetPC.isMoving() + newline;
|
||||
output += "Zerg Multiplier: " + targetPC.ZergMultiplier + newline;
|
||||
output += "isBoxed: " + targetPC.isBoxed + newline;
|
||||
break;
|
||||
|
||||
case NPC:
|
||||
@@ -441,7 +441,9 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += "isSummonedPet: true";
|
||||
else
|
||||
output += "isSummonedPet: false";
|
||||
PlayerCharacter owner = targetMob.getOwner();
|
||||
|
||||
|
||||
PlayerCharacter owner = (PlayerCharacter) targetMob.guardCaptain;
|
||||
if (owner != null)
|
||||
output += " owner: " + owner.getObjectUUID();
|
||||
output += newline;
|
||||
@@ -524,7 +526,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
ConcurrentHashMap<String, Effect> effects = item.getEffects();
|
||||
for (String name : effects.keySet()) {
|
||||
Effect eff = effects.get(name);
|
||||
output += eff.getEffectsBase().getIDString();
|
||||
output += eff.getEffectsBase().getIDString() + " Static:" + eff.isStatic();
|
||||
output += newline;
|
||||
// output += eff.getEffectToken() + (eff.bakedInStat() ? " (baked in)" : "") + newline;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
|
||||
if (item == null || !worked) {
|
||||
throwbackError(pc, "DB error 2: Unable to create item.");
|
||||
if(item == null)
|
||||
throwbackError(pc, "Item Null");
|
||||
else
|
||||
throwbackError(pc, "Worked = false");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -222,6 +226,10 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
|
||||
if (item == null || !worked) {
|
||||
throwbackError(pc, "DB error 2: Unable to create item.");
|
||||
if(item == null)
|
||||
throwbackError(pc, "Item Null");
|
||||
else
|
||||
throwbackError(pc, "Worked = false");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.workthreads.HalfHourlyJobThread;
|
||||
import engine.workthreads.HourlyJobThread;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -42,10 +40,10 @@ public class MineActiveCmd extends AbstractDevCmd {
|
||||
String trigger = args[0];
|
||||
switch (trigger) {
|
||||
case "true":
|
||||
HalfHourlyJobThread.mineWindowOpen(mine);
|
||||
Mine.mineWindowOpen(mine);
|
||||
break;
|
||||
case "false":
|
||||
HalfHourlyJobThread.mineWindowClose(mine);
|
||||
Mine.mineWindowClose(mine);
|
||||
break;
|
||||
default:
|
||||
this.sendUsage(pcSender);
|
||||
|
||||
@@ -39,6 +39,9 @@ public class PrintResistsCmd extends AbstractDevCmd {
|
||||
if (mb != null)
|
||||
name = mb.getFirstName();
|
||||
type = "Mob";
|
||||
throwbackInfo(pc, "Server resists for " + type + ' ' + name);
|
||||
tar.getResists().printResistsToClient(pc);
|
||||
return;
|
||||
} else if (tar instanceof NPC) {
|
||||
NPC npc = (NPC) tar;
|
||||
Contract contract = npc.getContract();
|
||||
|
||||
@@ -56,6 +56,7 @@ public class PrintStatsCmd extends AbstractDevCmd {
|
||||
}
|
||||
|
||||
public void printStatsPlayer(PlayerCharacter pc, PlayerCharacter tar) {
|
||||
tar.calculateMaxHealthManaStamina();
|
||||
String newline = "\r\n ";
|
||||
String out = "Server stats for Player " + tar.getFirstName() + newline;
|
||||
out += "Unused Stats: " + tar.getUnusedStatPoints() + newline;
|
||||
@@ -73,10 +74,11 @@ public class PrintStatsCmd extends AbstractDevCmd {
|
||||
out += "Main Hand: atr: " + tar.getAtrHandOne() + ", damage: " + tar.getMinDamageHandOne() + " to " + tar.getMaxDamageHandOne() + ", speed: " + tar.getSpeedHandOne() + newline;
|
||||
out += "Off Hand: atr: " + tar.getAtrHandTwo() + ", damage: " + tar.getMinDamageHandTwo() + " to " + tar.getMaxDamageHandTwo() + ", speed: " + tar.getSpeedHandTwo() + newline;
|
||||
out += "isAlive: " + tar.isAlive() + ", Combat: " + tar.isCombat() + newline;
|
||||
out += "Move Speed: " + tar.getSpeed() + newline;
|
||||
out += "Health Regen: " + tar.getRegenModifier(Enum.ModType.HealthRecoverRate) + newline;
|
||||
out += "Mana Regen: " + tar.getRegenModifier(Enum.ModType.ManaRecoverRate) + newline;
|
||||
out += "Stamina Regen: " + tar.getRegenModifier(Enum.ModType.StaminaRecoverRate) + newline;
|
||||
out += "Mana Regen: " + tar.getRegenModifier(Enum.ModType.ManaRecoverRate) + newline;
|
||||
out += "Zerg Multiplier: " + tar.ZergMultiplier + newline;
|
||||
|
||||
throwbackInfo(pc, out);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
|
||||
|
||||
|
||||
if (npc != null) {
|
||||
for (Mob mob : npc.getSiegeMinionMap().keySet()) {
|
||||
for (Mob mob : npc.siegeMinionMap.keySet()) {
|
||||
WorldGrid.RemoveWorldObject(mob);
|
||||
WorldGrid.removeObject(mob, pc);
|
||||
//Mob.getRespawnMap().remove(mob);
|
||||
@@ -151,7 +151,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
|
||||
|
||||
|
||||
if (npc != null) {
|
||||
for (Mob mob : npc.getSiegeMinionMap().keySet()) {
|
||||
for (Mob mob : npc.siegeMinionMap.keySet()) {
|
||||
WorldGrid.RemoveWorldObject(mob);
|
||||
WorldGrid.removeObject(mob, pc);
|
||||
//Mob.getRespawnMap().remove(mob);
|
||||
|
||||
@@ -154,7 +154,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
|
||||
mobA = (Mob) ac;
|
||||
|
||||
if (npc != null) {
|
||||
for (Mob mob : npc.getSiegeMinionMap().keySet()) {
|
||||
for (Mob mob : npc.siegeMinionMap.keySet()) {
|
||||
WorldGrid.RemoveWorldObject(mob);
|
||||
WorldGrid.removeObject(mob, pc);
|
||||
//Mob.getRespawnMap().remove(mob);
|
||||
@@ -209,7 +209,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
|
||||
if (npc.building != null)
|
||||
npc.building.getHirelings().remove(npc);
|
||||
|
||||
for (Mob mob : npc.getSiegeMinionMap().keySet()) {
|
||||
for (Mob mob : npc.siegeMinionMap.keySet()) {
|
||||
WorldGrid.RemoveWorldObject(mob);
|
||||
WorldGrid.removeObject(mob, pc);
|
||||
if (mob.getParentZone() != null)
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SetAdminRuneCmd extends AbstractDevCmd {
|
||||
if (worked) {
|
||||
ChatManager.chatSayInfo(pcSender,
|
||||
"rune of ID " + runeID + " removed");
|
||||
InterestManager.reloadCharacter(pcSender);
|
||||
InterestManager.reloadCharacter(pcSender,false);
|
||||
} else
|
||||
throwbackError(pcSender, "Failed to remove the rune of type "
|
||||
+ runeID);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SetBaseClassCmd extends AbstractDevCmd {
|
||||
this.setTarget(pc); //for logging
|
||||
ChatManager.chatSayInfo(pc,
|
||||
"BaseClass changed to " + classID);
|
||||
InterestManager.reloadCharacter(pc);
|
||||
InterestManager.reloadCharacter(pc,false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class SetLevelCmd extends AbstractDevCmd {
|
||||
|
||||
@@ -46,7 +47,7 @@ public class SetLevelCmd extends AbstractDevCmd {
|
||||
this.sendUsage(pc);
|
||||
return;
|
||||
}
|
||||
if (level < 1 || level > 80) {
|
||||
if (level < 1 || level > MBServerStatics.LEVELCAP) {
|
||||
this.sendHelp(pc);
|
||||
return;
|
||||
}
|
||||
@@ -57,12 +58,12 @@ public class SetLevelCmd extends AbstractDevCmd {
|
||||
tar.setLevel((short) level);
|
||||
this.setTarget(tar); //for logging
|
||||
ChatManager.chatSayInfo(pc, tar.getFirstName() + " level changed to " + level);
|
||||
InterestManager.reloadCharacter(tar);
|
||||
InterestManager.reloadCharacter(tar,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getHelpString() {
|
||||
return "Sets your character's level to 'amount'. 'amount' must be between 1-80";
|
||||
return "Sets your character's level to 'amount'. 'amount' must be between 1-" + MBServerStatics.LEVELCAP;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SetPromotionClassCmd extends AbstractDevCmd {
|
||||
pc.setPromotionClass(classID);
|
||||
ChatManager.chatSayInfo(pc,
|
||||
"PromotionClass changed to " + classID);
|
||||
InterestManager.reloadCharacter(pc);
|
||||
InterestManager.reloadCharacter(pc,false);
|
||||
this.setTarget(pc); //for logging
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SetRuneCmd extends AbstractDevCmd {
|
||||
if (worked) {
|
||||
ChatManager.chatSayInfo(pcSender,
|
||||
"rune of ID " + runeID + " removed");
|
||||
InterestManager.reloadCharacter(pcSender);
|
||||
InterestManager.reloadCharacter(pcSender,false);
|
||||
} else
|
||||
throwbackError(pcSender, "Failed to remove the rune of type "
|
||||
+ runeID);
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.LootManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.loot.BootySetEntry;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
|
||||
public int simCount = 250;
|
||||
public SimulateBootyCmd() {
|
||||
super("bootysim");
|
||||
}
|
||||
@@ -27,16 +27,10 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
|
||||
String output;
|
||||
|
||||
try
|
||||
{
|
||||
simCount = Integer.parseInt(words[0]);
|
||||
}catch(Exception e)
|
||||
{
|
||||
|
||||
output = "Booty Simulation:" + newline;
|
||||
if(target.getObjectType().equals(Enum.GameObjectType.Mob) == false){
|
||||
return;//ugh what?
|
||||
}
|
||||
|
||||
output = "Booty Simulation: Rolls:" + simCount + newline;
|
||||
|
||||
Mob mob = (Mob) target;
|
||||
output += "Name: " + mob.getName() + newline;
|
||||
output += "Special Loot:" + newline;
|
||||
@@ -54,7 +48,6 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
ArrayList<Item> Resources = new ArrayList<Item>();
|
||||
ArrayList<Item> Runes = new ArrayList<Item>();
|
||||
ArrayList<Item> Contracts = new ArrayList<Item>();
|
||||
ArrayList<Item> GuardContracts = new ArrayList<Item>();
|
||||
ArrayList<Item> Offerings = new ArrayList<Item>();
|
||||
ArrayList<Item> OtherDrops = new ArrayList<Item>();
|
||||
ArrayList<Item> EquipmentDrops = new ArrayList<Item>();
|
||||
@@ -62,17 +55,14 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
int failures = 0;
|
||||
int goldAmount = 0;
|
||||
|
||||
for (int i = 0; i < simCount; ++i) {
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
|
||||
try {
|
||||
mob.loadInventory();
|
||||
for (Item lootItem : mob.getCharItemManager().getInventory()) {
|
||||
switch (lootItem.getItemBase().getType()) {
|
||||
case CONTRACT: //CONTRACT
|
||||
if(lootItem.getName().contains("Captain"))
|
||||
GuardContracts.add(lootItem);
|
||||
else
|
||||
Contracts.add(lootItem);
|
||||
Contracts.add(lootItem);
|
||||
break;
|
||||
case OFFERING: //OFFERING
|
||||
Offerings.add(lootItem);
|
||||
@@ -93,12 +83,19 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
goldAmount += lootItem.getNumOfItems();
|
||||
break;
|
||||
default:
|
||||
OtherDrops.add(lootItem);
|
||||
if(Warehouse.maxResources.containsKey(lootItem.getItemBaseID())){
|
||||
Resources.add(lootItem);
|
||||
} else {
|
||||
OtherDrops.add(lootItem);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
failures++;
|
||||
//throwbackError(playerCharacter,ex.getLocalizedMessage());
|
||||
//Logger.error(ex.fillInStackTrace());
|
||||
//return;
|
||||
}
|
||||
if (mob.getEquip() != null) {
|
||||
for (MobEquipment me : mob.getEquip().values()) {
|
||||
@@ -144,17 +141,18 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
}
|
||||
}
|
||||
|
||||
int baseBound = 100000;
|
||||
int levelPenalty = (int) (Math.max(0, Math.abs(50 - mob.level)) * 0.01 * 100000);
|
||||
int totalRange = baseBound + levelPenalty;
|
||||
if(mob.level >= 50){
|
||||
totalRange = baseBound;
|
||||
}
|
||||
output += "TOTAL ROLL POTENTIAL: " + totalRange + newline;
|
||||
output += "GLASS DROPS: " + GlassItems.size() + newline;
|
||||
for(Item glass : GlassItems){
|
||||
output += " " + glass.getName() + newline;
|
||||
}
|
||||
output += "RUNE DROPS: " + Runes.size() + newline;
|
||||
for(Item rune : Runes){
|
||||
output += " " + rune.getName() + newline;
|
||||
}
|
||||
output += "CONTRACTS DROPS: " + Contracts.size() + newline;
|
||||
output += "GUARD CONTRACTS DROPS: " + GuardContracts.size() + newline;
|
||||
for(Item contract : Contracts){
|
||||
output += " " + contract.getName() + newline;
|
||||
}
|
||||
output += "RESOURCE DROPS: " + Resources.size() + newline;
|
||||
output += "OFFERINGS DROPPED: " + Offerings.size() + newline;
|
||||
output += "ENCHANTED ITEMS DROPPED: " + OtherDrops.size() + newline;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class SlotTestCmd extends AbstractDevCmd {
|
||||
outString += "Hirelings List:";
|
||||
|
||||
for (AbstractCharacter hireling : building.getHirelings().keySet())
|
||||
outString += "\r\n" + hireling.getName() + " slot : " + building.getHirelings().get(hireling);
|
||||
outString += "\r\n" + hireling.getName() + "(" + hireling.getObjectUUID() + ") slot : " + building.getHirelings().get(hireling);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class SplatMobCmd extends AbstractDevCmd {
|
||||
|
||||
mobile = Mob.createMob(_mobileUUID,
|
||||
Vector3fImmutable.getRandomPointInCircle(_currentLocation, _targetRange),
|
||||
null, true, serverZone, null, 0, "", 1);
|
||||
null, serverZone, null, null, "", 1);
|
||||
|
||||
if (mobile != null) {
|
||||
mobile.updateDatabase();
|
||||
|
||||
@@ -11,8 +11,10 @@ package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.MobBase;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -56,38 +58,47 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
Mob mob = (Mob) target;
|
||||
output = "Mob AI Information:" + newline;
|
||||
output += mob.getName() + newline;
|
||||
if (mob.BehaviourType != null) {
|
||||
output += "BehaviourType: " + mob.BehaviourType.toString() + newline;
|
||||
if (mob.BehaviourType.BehaviourHelperType != null) {
|
||||
output += "Behaviour Helper Type: " + mob.BehaviourType.BehaviourHelperType.toString() + newline;
|
||||
if (mob.behaviourType != null) {
|
||||
output += "BehaviourType: " + mob.behaviourType.toString() + newline;
|
||||
if (mob.behaviourType.BehaviourHelperType != null) {
|
||||
output += "Behaviour Helper Type: " + mob.behaviourType.BehaviourHelperType.toString() + newline;
|
||||
} else {
|
||||
output += "Behaviour Helper Type: NULL" + newline;
|
||||
}
|
||||
output += "Wimpy: " + mob.BehaviourType.isWimpy + newline;
|
||||
output += "Agressive: " + mob.BehaviourType.isAgressive + newline;
|
||||
output += "Can Roam: " + mob.BehaviourType.canRoam + newline;
|
||||
output += "Calls For Help: " + mob.BehaviourType.callsForHelp + newline;
|
||||
output += "Responds To Call For Help: " + mob.BehaviourType.respondsToCallForHelp + newline;
|
||||
} else {
|
||||
output += "BehaviourType: NULL" + newline;
|
||||
}
|
||||
output += "Wimpy: " + mob.behaviourType.isWimpy + newline;
|
||||
output += "Agressive: " + mob.behaviourType.isAgressive + newline;
|
||||
output += "Can Roam: " + mob.behaviourType.canRoam + newline;
|
||||
output += "Calls For Help: " + mob.behaviourType.callsForHelp + newline;
|
||||
output += "Responds To Call For Help: " + mob.behaviourType.respondsToCallForHelp + newline;
|
||||
} else {
|
||||
output += "BehaviourType: NULL" + newline;
|
||||
}
|
||||
output += "Aggro Range: " + mob.getAggroRange() + newline;
|
||||
output += "Player Aggro Map Size: " + mob.playerAgroMap.size() + newline;
|
||||
if (mob.playerAgroMap.size() > 0) {
|
||||
output += "Players Loaded:" + newline;
|
||||
}
|
||||
for (Map.Entry<Integer, Boolean> entry : mob.playerAgroMap.entrySet()) {
|
||||
output += "Player ID: " + entry.getKey() + " Hate Value: " + (PlayerCharacter.getPlayerCharacter(entry.getKey())).getHateValue() + newline;
|
||||
for (Map.Entry<Integer, Float> entry : mob.playerAgroMap.entrySet()) {
|
||||
output += "Player ID: " + entry.getKey() + " Hate Value: " + entry.getValue() + newline;
|
||||
}
|
||||
if (mob.getCombatTarget() != null)
|
||||
output += "Current Target: " + mob.getCombatTarget().getName() + newline;
|
||||
else
|
||||
output += "Current Target: NULL" + newline;
|
||||
|
||||
for (int token : mob.mobPowers.keySet())
|
||||
output += token + newline;
|
||||
if (mob.guardedCity != null)
|
||||
output += "Patrolling: " + mob.guardedCity.getCityName() + newline;
|
||||
|
||||
output += "Powers:" + newline;
|
||||
|
||||
for (int token : mob.mobPowers.keySet())
|
||||
output += PowersManager.getPowerByToken(token).getName() + newline;
|
||||
|
||||
output += "Race type: " + MobBase.mobbase_race_types.get(mob.getMobBaseID());
|
||||
throwbackInfo(playerCharacter, output);
|
||||
|
||||
throwbackInfo(playerCharacter, "Race Types: " + MobBase.mobbase_race_types.size());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,55 +9,64 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.*;
|
||||
import engine.objects.*;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
/**
|
||||
* @author Eighty
|
||||
*/
|
||||
public class GimmeCmd extends AbstractDevCmd {
|
||||
public class setProfit extends AbstractDevCmd {
|
||||
|
||||
public GimmeCmd() {
|
||||
super("gimme");
|
||||
public setProfit() {
|
||||
super("setprofit");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _doCmd(PlayerCharacter pc, String[] words,
|
||||
AbstractGameObject target) {
|
||||
int amt = 0;
|
||||
int currentGold = pc.getCharItemManager().getGoldInventory().getNumOfItems();
|
||||
amt = 10000000 - currentGold;
|
||||
if (!pc.getCharItemManager().addGoldToInventory(amt, true)) {
|
||||
throwbackError(pc, "Failed to add gold to inventory");
|
||||
|
||||
if (words.length < 2) {
|
||||
this.sendUsage(pc);
|
||||
return;
|
||||
}
|
||||
float updateValue;
|
||||
try {
|
||||
updateValue = Float.parseFloat(words[1]);
|
||||
|
||||
ChatManager.chatSayInfo(pc, amt + " gold added to inventory");
|
||||
|
||||
if(pc.level < 75) {
|
||||
pc.setLevel((short) 75);
|
||||
ChatManager.chatSayInfo(pc, "Level set to 75");
|
||||
} catch (NumberFormatException e) {
|
||||
throwbackError(pc,
|
||||
"Failed to parse supplied contractID or level to an Integer.");
|
||||
return; // NaN
|
||||
}
|
||||
pc.getCharItemManager().updateInventory();
|
||||
if(target.getObjectType().equals(GameObjectType.NPC) == false){
|
||||
|
||||
return;
|
||||
}
|
||||
NPC npc = (NPC)target;
|
||||
if(words[0].toLowerCase().equals("buy")){
|
||||
npc.buyPercent = updateValue;
|
||||
npc.updateDatabase();
|
||||
return;
|
||||
}
|
||||
if(words[0].toLowerCase().equals("sell")){
|
||||
npc.sellPercent = updateValue;
|
||||
npc.updateDatabase();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getHelpString() {
|
||||
return "Round up current gold in inventory to 10,000,000";
|
||||
return "Sets profit margin of targeted NPC";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getUsageString() {
|
||||
return "'./gimme";
|
||||
return "' /setprofit buy/sell VALUE(1.0)'";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class ArenaManager {
|
||||
private static final List<Arena> activeArenas = new ArrayList<>();
|
||||
public static final List<PlayerCharacter> playerQueue = new ArrayList<>();
|
||||
public static Long pulseDelay = 180000L;
|
||||
public static Long lastExecution = 0L;
|
||||
|
||||
public static void pulseArenas() {
|
||||
if(lastExecution == 0L){
|
||||
lastExecution = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
if(activeArenas.isEmpty() && playerQueue.isEmpty())
|
||||
return;
|
||||
|
||||
Iterator<Arena> iterator = activeArenas.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Arena arena = iterator.next();
|
||||
if (arena.checkToComplete()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if(lastExecution + pulseDelay > System.currentTimeMillis())
|
||||
return;
|
||||
|
||||
lastExecution = System.currentTimeMillis();
|
||||
|
||||
while (playerQueue.size() > 1) {
|
||||
createArena();
|
||||
}
|
||||
}
|
||||
|
||||
public static void joinQueue(PlayerCharacter player) {
|
||||
if (!playerQueue.contains(player)) {
|
||||
playerQueue.add(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void leaveQueue(PlayerCharacter player) {
|
||||
playerQueue.remove(player);
|
||||
}
|
||||
|
||||
private static void createArena() {
|
||||
if (playerQueue.size() > 1) {
|
||||
|
||||
Collections.shuffle(playerQueue);
|
||||
Arena newArena = new Arena();
|
||||
|
||||
//set starting time
|
||||
newArena.startTime = System.currentTimeMillis();
|
||||
|
||||
//decide an arena location
|
||||
newArena.loc = selectRandomArenaLocation();
|
||||
|
||||
// Assign players to the arena
|
||||
newArena.player1 = playerQueue.remove(0);
|
||||
newArena.player2 = playerQueue.remove(0);
|
||||
|
||||
// Teleport players to the arena location
|
||||
Zone sdr = ZoneManager.getZoneByUUID(656);
|
||||
MovementManager.translocate(newArena.player1, Vector3fImmutable.getRandomPointOnCircle(newArena.loc,75f), null);
|
||||
MovementManager.translocate(newArena.player2, Vector3fImmutable.getRandomPointOnCircle(newArena.loc,75f), null);
|
||||
|
||||
// Add the new arena to the active arenas list
|
||||
activeArenas.add(newArena);
|
||||
}
|
||||
}
|
||||
|
||||
public static void endArena(Arena arena, PlayerCharacter winner, PlayerCharacter loser, String condition){
|
||||
if (winner != null && loser != null) {
|
||||
Logger.info("[ARENA] The fight between {} and {} is concluded. Victor: {}",
|
||||
arena.player1.getName(), arena.player2.getName(), winner.getName());
|
||||
} else {
|
||||
Logger.info("[ARENA] The fight between {} and {} is concluded. No Winner Declared.",
|
||||
arena.player1.getName(), arena.player2.getName());
|
||||
}
|
||||
// Teleport players to the arena location
|
||||
Zone sdr = ZoneManager.getZoneByUUID(656);
|
||||
MovementManager.translocate(arena.player1, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null);
|
||||
MovementManager.translocate(arena.player2, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null);
|
||||
|
||||
|
||||
|
||||
activeArenas.remove(arena);
|
||||
|
||||
if(winner != null){
|
||||
ChatManager.chatPVP("[ARENA] " + winner.getName() + " has slain " + loser.getName() + " in the arena!");
|
||||
//handle prize distribution
|
||||
//ItemBase specialLoot = ItemBase.getItemBase(866);
|
||||
//Item promoted = new MobLoot(winner, specialLoot, 1, false).promoteToItem(winner);
|
||||
//promoted.setNumOfItems(21235);
|
||||
//promoted.setName("Special Banker(21235)");
|
||||
//DbManager.ItemQueries.UPDATE_NUM_ITEMS(promoted,21235);
|
||||
//winner.getCharItemManager().addItemToInventory(promoted);
|
||||
//winner.getCharItemManager().updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3fImmutable selectRandomArenaLocation() {
|
||||
boolean locSet = false;
|
||||
Vector3fImmutable loc = Vector3fImmutable.ZERO;
|
||||
|
||||
while (!locSet) {
|
||||
try {
|
||||
float x = ThreadLocalRandom.current().nextInt(114300, 123600);
|
||||
float z = ThreadLocalRandom.current().nextInt(82675, 91700);
|
||||
float y = 0; // Y coordinate is always 0
|
||||
|
||||
loc = new Vector3fImmutable(x, y, z * -1);
|
||||
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(loc,500f, MBServerStatics.MASK_PLAYER);
|
||||
if(inRange.isEmpty() && !isUnderWater(loc))
|
||||
locSet = true;
|
||||
//}
|
||||
}catch(Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return loc;
|
||||
}
|
||||
|
||||
public static boolean isUnderWater(Vector3fImmutable loc) {
|
||||
|
||||
try {
|
||||
|
||||
Zone zone = ZoneManager.findSmallestZone(loc);
|
||||
|
||||
if (zone.getSeaLevel() != 0) {
|
||||
|
||||
float localAltitude = loc.y;
|
||||
if (localAltitude < zone.getSeaLevel())
|
||||
return true;
|
||||
} else {
|
||||
if (loc.y < 0)
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -438,18 +438,6 @@ public enum BuildingManager {
|
||||
|
||||
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
||||
|
||||
if(building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BANESTONE))
|
||||
{
|
||||
Guild playerNation = player.guild.getNation();
|
||||
City banedCity = ZoneManager.getCityAtLocation(building.loc);
|
||||
if(banedCity != null){
|
||||
if(banedCity.getGuild().getNation().equals(playerNation)){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Nation Members and Guild members are not hostile.
|
||||
// if (building.getGuild() != null){
|
||||
// if (pc.getGuild() != null)
|
||||
@@ -532,32 +520,10 @@ public enum BuildingManager {
|
||||
if (building.getBlueprintUUID() == 0)
|
||||
return false;
|
||||
|
||||
if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL)){
|
||||
if(contract.getContractID() == 850) {
|
||||
boolean hasRunemaster = false;
|
||||
for (AbstractCharacter npc : building.getHirelings().keySet()) {
|
||||
|
||||
if (npc.getObjectType() != GameObjectType.NPC)
|
||||
continue;
|
||||
|
||||
if(npc.contractUUID == 850)
|
||||
hasRunemaster = true;
|
||||
}
|
||||
|
||||
if(hasRunemaster)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int maxSlots = building.getBlueprint().getMaxSlots();
|
||||
if(building.getBlueprint().getBuildingGroup() != null) {
|
||||
maxSlots = building.getBlueprint().getSlotsForRank(building.getRank());
|
||||
}
|
||||
|
||||
if (maxSlots == building.getHirelings().size())
|
||||
if (building.getBlueprint().getSlotsForRank(building.getRank()) == building.getHirelings().size()) {
|
||||
Logger.error("failed at addHireling with contract: " + contract.getContractID());
|
||||
return false;
|
||||
|
||||
}
|
||||
String pirateName = NPCManager.getPirateName(contract.getMobbaseID());
|
||||
|
||||
if (item.getChargesRemaining() > 0)
|
||||
@@ -570,7 +536,7 @@ public enum BuildingManager {
|
||||
|
||||
if (NPC.ISWallArcher(contract)) {
|
||||
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank);
|
||||
|
||||
if (mob == null)
|
||||
return false;
|
||||
@@ -582,7 +548,7 @@ public enum BuildingManager {
|
||||
|
||||
if (NPC.ISGuardCaptain(contract.getContractID())) {
|
||||
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank);
|
||||
|
||||
if (mob == null)
|
||||
return false;
|
||||
@@ -594,7 +560,7 @@ public enum BuildingManager {
|
||||
if (contract.getContractID() == 910) {
|
||||
|
||||
//guard dog
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
|
||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank);
|
||||
|
||||
if (mob == null)
|
||||
return false;
|
||||
|
||||
@@ -528,7 +528,7 @@ public enum CombatManager {
|
||||
float atr;
|
||||
int minDamage, maxDamage;
|
||||
int errorTrack = 0;
|
||||
|
||||
int subTrack = 0;
|
||||
try {
|
||||
|
||||
if (ac == null)
|
||||
@@ -645,26 +645,27 @@ public enum CombatManager {
|
||||
errorTrack = 4;
|
||||
|
||||
//Get hit chance
|
||||
|
||||
//int chance;
|
||||
float dif = atr - defense;
|
||||
|
||||
//if (dif > 100)
|
||||
// chance = 94;
|
||||
//else if (dif < -100)
|
||||
// chance = 4;
|
||||
//else
|
||||
// chance = (int) ((0.45 * dif) + 49);
|
||||
float constant = (atr+defense)*0.315f;
|
||||
float atrChance = atr - constant;
|
||||
float defChance = defense - constant + atrChance;
|
||||
float smallChance = atrChance/defChance;
|
||||
int chance = (int)(smallChance * 100);
|
||||
|
||||
errorTrack = 5;
|
||||
|
||||
if(chance < 5){
|
||||
chance = 5;
|
||||
}
|
||||
if(chance > 95){
|
||||
chance = 95;
|
||||
}
|
||||
|
||||
//calculate hit/miss
|
||||
|
||||
int roll = ThreadLocalRandom.current().nextInt(1,101);
|
||||
DeferredPowerJob dpj = null;
|
||||
|
||||
|
||||
|
||||
if (LandHit((int)atr,(int)defense)) {
|
||||
if (roll < chance) {
|
||||
|
||||
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
updateAttackTimers((PlayerCharacter) ac, target, true);
|
||||
@@ -810,11 +811,7 @@ public enum CombatManager {
|
||||
|
||||
float damage;
|
||||
|
||||
if (wb != null)
|
||||
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
|
||||
else
|
||||
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
|
||||
|
||||
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
|
||||
float d = 0f;
|
||||
|
||||
errorTrack = 12;
|
||||
@@ -822,27 +819,41 @@ public enum CombatManager {
|
||||
//Subtract Damage from target's health
|
||||
|
||||
if (tarAc != null) {
|
||||
if (tarAc.isSit())
|
||||
damage *= 2.5f; //increase damage if sitting
|
||||
|
||||
if (tarAc.isSit())
|
||||
damage *= 2.5f; //increase damage if sitting
|
||||
|
||||
if (tarAc.getObjectType() == GameObjectType.Mob) {
|
||||
ac.setHateValue(damage * MBServerStatics.PLAYER_COMBAT_HATE_MODIFIER);
|
||||
((Mob) tarAc).handleDirectAggro(ac);
|
||||
}
|
||||
|
||||
if (tarAc.getHealth() > 0)
|
||||
d = tarAc.modifyHealth(-damage, ac, false);
|
||||
subTrack = 1;
|
||||
|
||||
if (tarAc.getObjectType() == GameObjectType.Mob) {
|
||||
Mob mobTarget = (Mob) tarAc;
|
||||
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
subTrack = 2;
|
||||
if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) {
|
||||
subTrack = 3;
|
||||
float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID());
|
||||
mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue);
|
||||
} else {
|
||||
mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage);
|
||||
}
|
||||
subTrack = 4;
|
||||
}
|
||||
mobTarget.handleDirectAggro(ac);
|
||||
}
|
||||
if (tarAc.getHealth() > 0)
|
||||
d = tarAc.modifyHealth(-damage, ac, false);
|
||||
subTrack = 5;
|
||||
} else if (target.getObjectType().equals(GameObjectType.Building)) {
|
||||
|
||||
subTrack = 6;
|
||||
if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) {
|
||||
ac.setCombatTarget(null);
|
||||
subTrack = 7;
|
||||
return;
|
||||
}
|
||||
|
||||
subTrack = 8;
|
||||
if (target.getHealth() > 0)
|
||||
d = ((Building) target).modifyHealth(-damage, ac);
|
||||
subTrack = 9;
|
||||
}
|
||||
|
||||
errorTrack = 13;
|
||||
@@ -943,7 +954,8 @@ public enum CombatManager {
|
||||
ac.cancelOnAttack();
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e);
|
||||
Logger.error(ac.getName() + ' ' + "ErrorTrack: " + errorTrack + " ErrorSubTrack = " + subTrack + e);
|
||||
Logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1022,7 +1034,9 @@ public enum CombatManager {
|
||||
damage += minDamage;
|
||||
|
||||
//calculate resists in if any
|
||||
|
||||
if(source.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
damage *= ((PlayerCharacter)source).ZergMultiplier;
|
||||
}
|
||||
if (resists != null)
|
||||
return resists.getResistedDamage(source, target, damageType, damage, 0);
|
||||
else
|
||||
@@ -1055,10 +1069,6 @@ public enum CombatManager {
|
||||
if (eff.getPower() != null && (eff.getPower().getToken() == 429506943 || eff.getPower().getToken() == 429408639 || eff.getPower().getToken() == 429513599 || eff.getPower().getToken() == 429415295))
|
||||
swingAnimation = 0;
|
||||
|
||||
if(source != null && source.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
damage *= ((PlayerCharacter)source).ZergMultiplier;
|
||||
} // Health modifications are modified by the ZergMechanic
|
||||
|
||||
TargetedActionMsg cmm = new TargetedActionMsg(source, target, damage, swingAnimation);
|
||||
DispatchMessage.sendToAllInRange(target, cmm);
|
||||
}
|
||||
@@ -1242,17 +1252,14 @@ public enum CombatManager {
|
||||
DispatchMessage.dispatchMsgToInterestArea(pc, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
||||
}
|
||||
|
||||
public static void toggleSit(boolean toggle, ClientConnection origin) {
|
||||
private static void toggleSit(boolean toggle, ClientConnection origin) {
|
||||
|
||||
PlayerCharacter pc = SessionManager.getPlayerCharacter(origin);
|
||||
|
||||
if (pc == null)
|
||||
return;
|
||||
|
||||
if(pc.isFlying())
|
||||
pc.setSit(false);
|
||||
else
|
||||
pc.setSit(toggle);
|
||||
pc.setSit(toggle);
|
||||
|
||||
UpdateStateMsg rwss = new UpdateStateMsg();
|
||||
rwss.setPlayer(pc);
|
||||
@@ -1268,6 +1275,13 @@ public enum CombatManager {
|
||||
|
||||
range += (calcHitBox(ac) + calcHitBox(target));
|
||||
|
||||
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
range += ((PlayerCharacter)ac).getCharacterHeight() * 0.5f;
|
||||
if(ac.isMoving()){
|
||||
range += ((PlayerCharacter) ac).getCharacterHeight();
|
||||
}
|
||||
}
|
||||
|
||||
float magnitudeSquared = tl.distanceSquared(sl);
|
||||
|
||||
return magnitudeSquared > range * range;
|
||||
@@ -1330,13 +1344,6 @@ public enum CombatManager {
|
||||
return;
|
||||
|
||||
retaliater.setCombatTarget(ac);
|
||||
if(retaliater.isPlayerGuard && (retaliater.BehaviourType.equals(MobBehaviourType.GuardMinion) || retaliater.BehaviourType.equals(MobBehaviourType.GuardCaptain))){
|
||||
for(Mob guard : retaliater.guardedCity.getParent().zoneMobSet){
|
||||
if(guard.isPlayerGuard && guard.combatTarget == null){
|
||||
guard.setCombatTarget(ac);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1453,19 +1460,4 @@ public enum CombatManager {
|
||||
((AbstractCharacter) awo).getCharItemManager().damageRandomArmor(1);
|
||||
}
|
||||
|
||||
public static boolean LandHit(int atr, int defense){
|
||||
|
||||
int roll = ThreadLocalRandom.current().nextInt(101);
|
||||
float chance = (float)((atr-((atr+defense)*0.315))/((defense-((atr+defense)*0.315))+(atr-((atr+defense)*0.315))));
|
||||
|
||||
int connvertedChance = (int)(chance * 100);
|
||||
|
||||
if(connvertedChance < 5)
|
||||
connvertedChance = 5;
|
||||
|
||||
if(connvertedChance > 95)
|
||||
connvertedChance = 95;
|
||||
|
||||
return connvertedChance > roll;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public enum ConfigManager {
|
||||
MB_WORLD_MAINTENANCE,
|
||||
MB_WORLD_GREETING,
|
||||
MB_WORLD_KEYCLONE_MAX,
|
||||
MB_WORLD_TESTMODE,
|
||||
MB_USE_RUINS,
|
||||
|
||||
// Mobile AI modifiers
|
||||
|
||||
@@ -11,6 +11,8 @@ package engine.gameManager;
|
||||
import engine.Enum;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.devcmd.cmds.*;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Account;
|
||||
import engine.objects.PlayerCharacter;
|
||||
@@ -79,6 +81,7 @@ public enum DevCmdManager {
|
||||
DevCmdManager.registerDevCmd(new AddGoldCmd());
|
||||
DevCmdManager.registerDevCmd(new ZoneInfoCmd());
|
||||
DevCmdManager.registerDevCmd(new DebugMeleeSyncCmd());
|
||||
DevCmdManager.registerDevCmd(new HotzoneCmd());
|
||||
DevCmdManager.registerDevCmd(new MineActiveCmd());
|
||||
// Dev
|
||||
DevCmdManager.registerDevCmd(new ApplyStatModCmd());
|
||||
@@ -102,7 +105,6 @@ public enum DevCmdManager {
|
||||
DevCmdManager.registerDevCmd(new SetAdminRuneCmd());
|
||||
DevCmdManager.registerDevCmd(new SetInvulCmd());
|
||||
DevCmdManager.registerDevCmd(new MakeItemCmd());
|
||||
DevCmdManager.registerDevCmd(new GimmeCmd());
|
||||
DevCmdManager.registerDevCmd(new EnchantCmd());
|
||||
DevCmdManager.registerDevCmd(new SetSubRaceCmd());
|
||||
// Admin
|
||||
@@ -119,6 +121,7 @@ public enum DevCmdManager {
|
||||
DevCmdManager.registerDevCmd(new PurgeObjectsCmd());
|
||||
DevCmdManager.registerDevCmd(new SplatMobCmd());
|
||||
DevCmdManager.registerDevCmd(new SlotNpcCmd());
|
||||
DevCmdManager.registerDevCmd(new setProfit());
|
||||
DevCmdManager.registerDevCmd(new GateInfoCmd());
|
||||
DevCmdManager.registerDevCmd(new ShowOffsetCmd());
|
||||
DevCmdManager.registerDevCmd(new RealmInfoCmd());
|
||||
@@ -179,23 +182,17 @@ public enum DevCmdManager {
|
||||
|
||||
//kill any commands not available to everyone on production server
|
||||
//only admin level can run dev commands on production
|
||||
boolean playerAllowed = false;
|
||||
if(ConfigManager.MB_WORLD_TESTMODE.getValue().equals("true")) {
|
||||
switch (adc.getMainCmdString()) {
|
||||
case "printresists":
|
||||
case "printstats":
|
||||
case "printskills":
|
||||
case "printpowers":
|
||||
case "gimme":
|
||||
case "goto":
|
||||
case "teleportmode":
|
||||
playerAllowed = true;
|
||||
if (!a.status.equals(Enum.AccountStatus.ADMIN))
|
||||
target = pcSender;
|
||||
break;
|
||||
if((cmd.toLowerCase().equals("printstats") || cmd.toLowerCase().equals("printresists")) && target.equals(pcSender)){
|
||||
// execute command;
|
||||
try {
|
||||
adc.doCmd(pcSender, argString, target);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
if (!playerAllowed && !a.status.equals(Enum.AccountStatus.ADMIN)) {
|
||||
|
||||
if (a.status.equals(Enum.AccountStatus.ADMIN) == false && a.getUname().toLowerCase().equals("fatboy") == false) {
|
||||
Logger.info("Account " + a.getUname() + "attempted to use dev command " + cmd);
|
||||
return false;
|
||||
}
|
||||
@@ -219,6 +216,11 @@ public enum DevCmdManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, pcName + " from account: " + accName + " has used Dev Command: " + cmd);
|
||||
chatMsg.setMessageType(10);
|
||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,227 +5,206 @@
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
// Defines static methods which comprise the magicbane
|
||||
// building maintenance system.
|
||||
|
||||
import engine.Enum;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
public enum MaintenanceManager {
|
||||
|
||||
MAINTENANCEMANAGER;
|
||||
|
||||
public static void setMaintDateTime(Building building, LocalDateTime maintDate) {
|
||||
|
||||
building.maintDateTime = maintDate.withHour(1).withMinute(0).withSecond(0);
|
||||
building.maintDateTime = maintDate;
|
||||
DbManager.BuildingQueries.updateMaintDate(building);
|
||||
|
||||
}
|
||||
|
||||
public static void processBuildingMaintenance() {
|
||||
|
||||
ArrayList<AbstractGameObject> buildingList;
|
||||
ArrayList<Building> maintList;
|
||||
ArrayList<Building> derankList = new ArrayList<>();
|
||||
|
||||
Logger.info("Starting Maintenance on Player Buildings");
|
||||
|
||||
// Build list of buildings to apply maintenance on.
|
||||
|
||||
buildingList = new ArrayList(DbManager.getList(Enum.GameObjectType.Building));
|
||||
maintList = buildMaintList(buildingList);
|
||||
|
||||
// Deduct upkeep and build list of buildings
|
||||
// which did not have funds available
|
||||
|
||||
for (Building building : maintList) {
|
||||
|
||||
if (chargeUpkeep(building) == false)
|
||||
derankList.add(building);
|
||||
else
|
||||
setMaintDateTime(building, LocalDateTime.now().plusDays(7));
|
||||
}
|
||||
|
||||
for (Building building : derankList) {
|
||||
building.destroyOrDerank(null);
|
||||
if(building.getRank() > 0)
|
||||
setMaintDateTime(building, LocalDateTime.now().plusDays(1));
|
||||
}
|
||||
Logger.info("Structures: " + buildingList.size() + " Maint: " + maintList.size() + " Derank: " + derankList.size());
|
||||
}
|
||||
|
||||
// Iterate over all buildings in game and apply exclusion rules
|
||||
// returning a list of building for which maintenance is due.
|
||||
|
||||
private static ArrayList<Building> buildMaintList(ArrayList<AbstractGameObject> buildingList) {
|
||||
|
||||
ArrayList<Building> maintList = new ArrayList<>();
|
||||
|
||||
for (AbstractGameObject gameObject : buildingList) {
|
||||
|
||||
Building building = (Building) gameObject;
|
||||
|
||||
// No maintenance on NPC owned buildings (Cache loaded)
|
||||
|
||||
if (building.getProtectionState() == Enum.ProtectionState.NPC)
|
||||
continue;
|
||||
|
||||
// No maintenance on constructing meshes
|
||||
|
||||
if (building.getRank() < 1)
|
||||
continue;
|
||||
|
||||
// No Maintenance on furniture
|
||||
|
||||
if (building.parentBuildingID != 0)
|
||||
continue;
|
||||
|
||||
// No Blueprint?
|
||||
|
||||
if (building.getBlueprint() == null) {
|
||||
Logger.error("Blueprint missing for uuid: " + building.getObjectUUID());
|
||||
continue;
|
||||
}
|
||||
|
||||
//only ToL pays maintenance
|
||||
if(building.getBlueprint().getBuildingGroup() != null && !building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))
|
||||
continue;
|
||||
|
||||
// No maintenance on banestones omfg
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.BANESTONE))
|
||||
continue;
|
||||
|
||||
// no maintenance on Mines omfg
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.MINE))
|
||||
continue;
|
||||
|
||||
// Null Maintenance date?
|
||||
|
||||
if (building.maintDateTime == null) {
|
||||
Logger.error("Null maint date for building UUID: " + building.getObjectUUID());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Maintenance date is in the future
|
||||
|
||||
if (building.maintDateTime.isAfter(LocalDateTime.now()))
|
||||
continue;
|
||||
|
||||
|
||||
//no maintenance if day of week doesnt match
|
||||
//if (LocalDateTime.now().getDayOfWeek().ordinal() != building.maintDateTime.getDayOfWeek().ordinal()) {
|
||||
// continue;
|
||||
//}
|
||||
// Add building to maintenance queue
|
||||
|
||||
maintList.add(building);
|
||||
}
|
||||
|
||||
return maintList;
|
||||
}
|
||||
|
||||
// Method removes the appropriate amount of gold/resources from
|
||||
// a building according to it's maintenance schedule. True/False
|
||||
// is returned indicating if the building had enough funds to cover.
|
||||
|
||||
public static boolean chargeUpkeep(Building building) {
|
||||
|
||||
City city = null;
|
||||
Warehouse warehouse = null;
|
||||
int maintCost = 0;
|
||||
int overDraft = 0;
|
||||
boolean hasFunds = false;
|
||||
boolean hasResources = false;
|
||||
int resourceValue = 0;
|
||||
|
||||
city = building.getCity();
|
||||
|
||||
if (city != null)
|
||||
warehouse = city.getWarehouse();
|
||||
|
||||
// Cache maintenance cost value
|
||||
|
||||
maintCost = building.getMaintCost();
|
||||
|
||||
// Something went wrong. Missing buildinggroup from switch?
|
||||
|
||||
if (maintCost == 0) {
|
||||
Logger.error("chargeUpkeep", "Error retrieving rankcost for " + building.getName() + " uuid:" + building.getObjectUUID() + "buildinggroup:" + building.getBlueprint().getBuildingGroup().name());
|
||||
// check if there is enough gold on the building
|
||||
return true;
|
||||
}
|
||||
|
||||
if (building.getStrongboxValue() >= maintCost)
|
||||
hasFunds = true;
|
||||
|
||||
// If we cannot cover with just the strongbox
|
||||
// see if there is a warehouse that will cover
|
||||
// the overdraft for us.
|
||||
|
||||
|
||||
if (hasFunds == false && (building.assetIsProtected() || building.getBlueprint().getBuildingGroup() == Enum.BuildingGroup.WAREHOUSE)) {
|
||||
overDraft = maintCost - building.getStrongboxValue();
|
||||
}
|
||||
|
||||
if ((overDraft > 0))
|
||||
if ((building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SHRINE) == false) &&
|
||||
(warehouse != null) && building.assetIsProtected() == true &&
|
||||
(warehouse.getResources().get(ItemBase.GOLD_ITEM_BASE)) >= overDraft) {
|
||||
hasFunds = true;
|
||||
}
|
||||
|
||||
// If this is an R8 tree, validate that we can
|
||||
// cover the resources required
|
||||
|
||||
|
||||
if (hasFunds == false) {
|
||||
return false; // Early exit for having failed to meet maintenance
|
||||
}
|
||||
|
||||
// Remove cash and resources
|
||||
|
||||
// withdraw what we can from the building
|
||||
|
||||
building.setStrongboxValue(building.getStrongboxValue() - (maintCost - overDraft));
|
||||
|
||||
// withdraw overdraft from the whorehouse
|
||||
|
||||
if (overDraft > 0) {
|
||||
|
||||
resourceValue = warehouse.getResources().get(Warehouse.goldIB);
|
||||
|
||||
if (DbManager.WarehouseQueries.updateGold(warehouse, resourceValue - overDraft) == true) {
|
||||
warehouse.getResources().put(Warehouse.goldIB, resourceValue - overDraft);
|
||||
warehouse.AddTransactionToWarehouse(Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Resource.GOLD, overDraft);
|
||||
} else {
|
||||
Logger.error("gold update failed for warehouse of UUID:" + warehouse.getObjectUUID());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void dailyMaintenance() {
|
||||
|
||||
Logger.info("Maintenance has started");
|
||||
|
||||
// Run maintenance on player buildings
|
||||
|
||||
if (ConfigManager.MB_WORLD_MAINTENANCE.getValue().equalsIgnoreCase("true"))
|
||||
processBuildingMaintenance();
|
||||
processMaintenance();
|
||||
else
|
||||
Logger.info("Maintenance Costings: DISABLED");
|
||||
|
||||
Logger.info("Maintenance has completed!");
|
||||
}
|
||||
}
|
||||
public static void processMaintenance() {
|
||||
//create list of all cities
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(Enum.GameObjectType.City);
|
||||
//loop all cities
|
||||
for (AbstractGameObject ago : worldCities.values()) {
|
||||
if (ago.getObjectType().equals(Enum.GameObjectType.City)) {
|
||||
City city = (City) ago;
|
||||
if(city == null || !city.getParent().isPlayerCity())
|
||||
continue;
|
||||
Building tol = city.getTOL();
|
||||
if(tol == null)
|
||||
continue;
|
||||
LocalDateTime maintenanceDueDate = tol.maintDateTime.withHour(1).withMinute(0).withSecond(0);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if(now.isAfter(maintenanceDueDate))
|
||||
processTolMaintenance(tol, city.getWarehouse());
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void processTolMaintenance(Building tol, Warehouse warehouse){
|
||||
if(tol == null)
|
||||
return;
|
||||
if(tol.getRank() == 8)
|
||||
handleR8(tol,warehouse);
|
||||
else
|
||||
handleNormal(tol,warehouse);
|
||||
}
|
||||
public static void handleNormal(Building tol, Warehouse warehouse){
|
||||
//handle r7 and lower ToL maintenance
|
||||
int goldDue = 3000000;
|
||||
//enough on strongbox alone to pay
|
||||
if (tol.getStrongboxValue() >= goldDue) {
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(7);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.setStrongboxValue(tol.getStrongboxValue() - goldDue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
int newStrongboxValue = tol.getStrongboxValue();
|
||||
int newWarehouseGold = 0;
|
||||
if(warehouse != null && warehouse.getResources().get(ItemBase.getItemBase(7)) != null) {
|
||||
newWarehouseGold = warehouse.getResources().get(ItemBase.getItemBase(7));
|
||||
} else{
|
||||
//wasnt enough on strongbox and gold in warehouse is empty
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//some on strongbox to pay
|
||||
if (tol.getStrongboxValue() > 0) {
|
||||
newStrongboxValue = 0;
|
||||
goldDue -= tol.getStrongboxValue();
|
||||
}
|
||||
if(newWarehouseGold < goldDue){
|
||||
//not enough gold to pay, you miss maintenance
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
newWarehouseGold -= goldDue;
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(7);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol) && DbManager.WarehouseQueries.updateGold(warehouse,newWarehouseGold)) {
|
||||
warehouse.getResources().put(ItemBase.getItemBase(7), newWarehouseGold);
|
||||
tol.setStrongboxValue(newStrongboxValue);
|
||||
}
|
||||
}
|
||||
public static void handleR8(Building tol, Warehouse warehouse){
|
||||
//handle r8 ToL maintenance
|
||||
//cannot pay r8 maintenance without a warehouse
|
||||
if(warehouse == null && DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
return;
|
||||
}
|
||||
//handle resource processing
|
||||
int goldDue = 3000000;
|
||||
int galvorDue = 5;
|
||||
int wormwoodDue = 5;
|
||||
int stoneDue = 5000;
|
||||
int lumberDue = 5000;
|
||||
int goldStrongBox = tol.getStrongboxValue();
|
||||
int goldWarehouse = 0;
|
||||
int galvorWarehouse;
|
||||
int wormwoodWarehouse;
|
||||
int stoneWarehouse;
|
||||
int lumberWarehouse;
|
||||
if(warehouse.getResources().get(Warehouse.galvorIB) != null) {
|
||||
galvorWarehouse = warehouse.getResources().get(Warehouse.galvorIB);
|
||||
}else {
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(warehouse.getResources().get(Warehouse.stoneIB) != null) {
|
||||
stoneWarehouse = warehouse.getResources().get(Warehouse.stoneIB);
|
||||
}else {
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(warehouse.getResources().get(Warehouse.wormwoodIB) != null) {
|
||||
wormwoodWarehouse = warehouse.getResources().get(Warehouse.wormwoodIB);
|
||||
}else {
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(warehouse.getResources().get(Warehouse.lumberIB) != null) {
|
||||
lumberWarehouse = warehouse.getResources().get(Warehouse.lumberIB);
|
||||
}else {
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
boolean canPay = true;
|
||||
if(goldStrongBox >= goldDue){
|
||||
goldStrongBox -= goldDue;
|
||||
goldDue = 0;
|
||||
}
|
||||
if (tol.getStrongboxValue() > 0) {
|
||||
goldStrongBox = 0;
|
||||
goldDue -= tol.getStrongboxValue();
|
||||
}
|
||||
if(warehouse.getResources().get(Warehouse.goldIB) != null) {
|
||||
goldWarehouse = warehouse.getResources().get(Warehouse.goldIB);
|
||||
}else if(goldDue > 0){
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(wormwoodDue > wormwoodWarehouse)
|
||||
canPay = false;
|
||||
if(galvorDue > galvorWarehouse)
|
||||
canPay = false;
|
||||
if(lumberDue > lumberWarehouse)
|
||||
canPay = false;
|
||||
if(stoneDue > stoneWarehouse)
|
||||
canPay = false;
|
||||
if(goldDue > goldWarehouse)
|
||||
canPay = false;
|
||||
if(!canPay){
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
tol.destroyOrDerank(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
tol.setStrongboxValue(goldStrongBox);
|
||||
if(DbManager.WarehouseQueries.updateGold(warehouse,goldWarehouse - goldDue)){
|
||||
if(DbManager.WarehouseQueries.updateStone(warehouse,stoneWarehouse - stoneDue)){
|
||||
if(DbManager.WarehouseQueries.updateLumber(warehouse,lumberWarehouse - lumberDue)){
|
||||
if(DbManager.WarehouseQueries.updateGalvor(warehouse,galvorWarehouse - galvorDue)){
|
||||
if(DbManager.WarehouseQueries.updateWormwood(warehouse,wormwoodWarehouse - wormwoodDue)){
|
||||
tol.maintDateTime = LocalDateTime.now().plusDays(1);
|
||||
if(DbManager.BuildingQueries.updateMaintDate(tol)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,10 +68,11 @@ public enum MovementManager {
|
||||
|
||||
if (toMove.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
if (((PlayerCharacter) toMove).isCasting())
|
||||
((PlayerCharacter) toMove).update(false);
|
||||
((PlayerCharacter) toMove).update();
|
||||
if(((PlayerCharacter) toMove).isFlying() && toMove.getEffects().containsKey("MoveBuff"))
|
||||
PlayerCharacter.GroundPlayer(((PlayerCharacter) toMove));
|
||||
}
|
||||
|
||||
|
||||
toMove.setIsCasting(false);
|
||||
toMove.setItemCasting(false);
|
||||
|
||||
@@ -96,7 +97,7 @@ public enum MovementManager {
|
||||
if (!toMove.isMoving())
|
||||
toMove.resetLastSetLocUpdate();
|
||||
else
|
||||
toMove.update(false);
|
||||
toMove.update();
|
||||
|
||||
// Update movement for the player
|
||||
|
||||
@@ -351,7 +352,7 @@ public enum MovementManager {
|
||||
ChatManager.chatSystemInfo((PlayerCharacter) ac, "Finished Alt change, setting the end location to " + ac.getEndLoc().getX() + ' ' + ac.getEndLoc().getZ() + " moving=" + ac.isMoving() + " and current location is " + curLoc.getX() + ' ' + curLoc.getZ());
|
||||
|
||||
//Send run/walk/sit/stand to tell the client we are flying / landing etc
|
||||
ac.update(false);
|
||||
ac.update();
|
||||
ac.stopMovement(ac.getLoc());
|
||||
if (ac.isAlive())
|
||||
MovementManager.sendRWSSMsg(ac);
|
||||
@@ -408,7 +409,7 @@ public enum MovementManager {
|
||||
if (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
||||
continue;
|
||||
|
||||
member.update(false);
|
||||
member.update();
|
||||
|
||||
|
||||
// All checks passed, let's move the player
|
||||
|
||||
@@ -23,14 +23,6 @@ public enum NPCManager {
|
||||
NPC_MANAGER;
|
||||
public static HashMap<Integer, ArrayList<Integer>> _runeSetMap = new HashMap<>();
|
||||
|
||||
public static void LoadAllRuneSets() {
|
||||
_runeSetMap = DbManager.ItemBaseQueries.LOAD_RUNES_FOR_NPC_AND_MOBS();
|
||||
}
|
||||
|
||||
public static void LoadAllBootySets() {
|
||||
LootManager._bootySetMap = DbManager.LootQueries.LOAD_BOOTY_TABLES();
|
||||
}
|
||||
|
||||
public static void applyRuneSetEffects(Mob mob) {
|
||||
|
||||
// Early exit
|
||||
@@ -127,10 +119,12 @@ public enum NPCManager {
|
||||
|
||||
DbManager.removeFromCache(necroPet);
|
||||
|
||||
PlayerCharacter petOwner = necroPet.getOwner();
|
||||
|
||||
PlayerCharacter petOwner = (PlayerCharacter) necroPet.guardCaptain;
|
||||
|
||||
if (petOwner != null) {
|
||||
necroPet.setOwner(null);
|
||||
|
||||
necroPet.guardCaptain = null;
|
||||
petOwner.setPet(null);
|
||||
|
||||
if (updateOwner == false)
|
||||
@@ -228,12 +222,14 @@ public enum NPCManager {
|
||||
WorldGrid.removeObject(toRemove);
|
||||
DbManager.removeFromCache(toRemove);
|
||||
|
||||
PlayerCharacter petOwner = toRemove.getOwner();
|
||||
|
||||
PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain;
|
||||
|
||||
if (petOwner != null) {
|
||||
|
||||
petOwner.setPet(null);
|
||||
toRemove.setOwner(null);
|
||||
|
||||
toRemove.guardCaptain = null;
|
||||
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
@@ -340,10 +336,19 @@ public enum NPCManager {
|
||||
else
|
||||
buildingSlot = BuildingManager.getAvailableSlot(abstractCharacter.building);
|
||||
|
||||
//if (buildingSlot == -1)
|
||||
//Logger.error("No available slot for NPC: " + abstractCharacter.getObjectUUID());
|
||||
// Override slot for siege engines
|
||||
|
||||
abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot);
|
||||
if (abstractCharacter.getObjectType().equals(Enum.GameObjectType.Mob) && ((Mob) abstractCharacter).behaviourType.equals(Enum.MobBehaviourType.SiegeEngine)) {
|
||||
Mob siegeMobile = (Mob) abstractCharacter;
|
||||
buildingSlot = siegeMobile.guardCaptain.siegeMinionMap.size() + 2;
|
||||
}
|
||||
|
||||
if (buildingSlot == -1)
|
||||
Logger.error("No available slot for NPC: " + abstractCharacter.getObjectUUID());
|
||||
|
||||
// Pets are regular mobiles not hirelings (Siege engines)
|
||||
if (abstractCharacter.contract != null)
|
||||
abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot);
|
||||
|
||||
// Override bind and location for this npc derived
|
||||
// from BuildingManager slot location data.
|
||||
@@ -370,4 +375,53 @@ public enum NPCManager {
|
||||
|
||||
return buildingSlot;
|
||||
}
|
||||
|
||||
public static int getMaxMinions(Mob guardCaptain) {
|
||||
|
||||
int maxSlots;
|
||||
|
||||
switch (guardCaptain.getRank()) {
|
||||
case 3:
|
||||
maxSlots = 2;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
maxSlots = 3;
|
||||
break;
|
||||
case 6:
|
||||
maxSlots = 4;
|
||||
break;
|
||||
case 7:
|
||||
maxSlots = 5;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
default:
|
||||
maxSlots = 1;
|
||||
|
||||
}
|
||||
return maxSlots;
|
||||
}
|
||||
|
||||
public static void AssignPatrolPoints(Mob mob) {
|
||||
mob.patrolPoints = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
float patrolRadius = mob.getSpawnRadius();
|
||||
|
||||
if (patrolRadius > 256)
|
||||
patrolRadius = 256;
|
||||
|
||||
if (patrolRadius < 60)
|
||||
patrolRadius = 60;
|
||||
|
||||
Vector3fImmutable newPatrolPoint = Vector3fImmutable.getRandomPointInCircle(mob.getBindLoc(), patrolRadius);
|
||||
mob.patrolPoints.add(newPatrolPoint);
|
||||
|
||||
if (i == 1) {
|
||||
mob.loc = newPatrolPoint;
|
||||
mob.endLoc = newPatrolPoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.*;
|
||||
import engine.objects.*;
|
||||
import engine.powers.*;
|
||||
import engine.powers.effectmodifiers.SeeInvisibleEffectModifier;
|
||||
import engine.powers.poweractions.AbstractPowerAction;
|
||||
import engine.powers.poweractions.TrackPowerAction;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -56,6 +57,22 @@ public enum PowersManager {
|
||||
public static HashMap<Integer, ArrayList<MobPowerEntry>> AllMobPowers;
|
||||
private static JobScheduler js;
|
||||
|
||||
public static String[] siegeBuffs = new String[]{"ART-004A","ARM-112A"};
|
||||
public static String[] siegeDeBuffs = new String[]{"ACM-003A","WRT-003A"};
|
||||
|
||||
public static ArrayList<PowerQueObject> static_power_que = new ArrayList<>();
|
||||
|
||||
public static class PowerQueObject{
|
||||
public PowerQueObject(PerformActionMsg inmsg,ClientConnection inorigin,boolean insendCastToSelf){
|
||||
this.msg = inmsg;
|
||||
this.origin = inorigin;
|
||||
this.sendCastToSelf = insendCastToSelf;
|
||||
}
|
||||
public PerformActionMsg msg;
|
||||
public ClientConnection origin;
|
||||
public boolean sendCastToSelf;
|
||||
}
|
||||
|
||||
private PowersManager() {
|
||||
|
||||
}
|
||||
@@ -163,26 +180,19 @@ public enum PowersManager {
|
||||
public static void usePower(final PerformActionMsg msg, ClientConnection origin,
|
||||
boolean sendCastToSelf) {
|
||||
|
||||
PlayerCharacter pc = SessionManager.getPlayerCharacter(origin);
|
||||
|
||||
if(!pc.isFlying()) //cant be sitting if flying
|
||||
CombatManager.toggleSit(false,origin);
|
||||
|
||||
if(pc.isMoving())
|
||||
pc.stopMovement(pc.getMovementLoc());
|
||||
|
||||
if (usePowerA(msg, origin, sendCastToSelf)) {
|
||||
// Cast failed for some reason, reset timer
|
||||
|
||||
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
|
||||
// Send Fail to cast message
|
||||
PlayerCharacter pc = SessionManager
|
||||
.getPlayerCharacter(origin);
|
||||
|
||||
if (pc != null) {
|
||||
sendPowerMsg(pc, 2, msg);
|
||||
if (pc.isCasting()) {
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
}
|
||||
|
||||
pc.setIsCasting(false);
|
||||
@@ -208,43 +218,10 @@ public enum PowersManager {
|
||||
if (playerCharacter == null)
|
||||
return false;
|
||||
|
||||
boolean skipCheck = false;
|
||||
|
||||
boolean CSRCast = false;
|
||||
|
||||
if(msg.getPowerUsedID() == 430628895) {
|
||||
|
||||
boolean failed = false;// group teleport
|
||||
City city = ZoneManager.getCityAtLocation(playerCharacter.loc);
|
||||
if (city == null) {
|
||||
failed = true;
|
||||
}else{
|
||||
Bane bane = city.getBane();
|
||||
if (bane == null) {
|
||||
failed = true;
|
||||
}else{
|
||||
if(!bane.getSiegePhase().equals(SiegePhase.WAR)){
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(failed){
|
||||
//check to see if we are at an active mine
|
||||
Zone zone = ZoneManager.findSmallestZone(playerCharacter.loc);
|
||||
if(zone != null){
|
||||
Mine mine = null;
|
||||
for(Building building : zone.zoneBuildingSet){
|
||||
if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.MINE)){
|
||||
mine = Mine.getMineFromTower(building.getObjectUUID());
|
||||
}
|
||||
}
|
||||
if(mine != null){
|
||||
failed = !mine.isActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(failed)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (MBServerStatics.POWERS_DEBUG) {
|
||||
ChatManager.chatSayInfo(
|
||||
@@ -255,10 +232,67 @@ public enum PowersManager {
|
||||
+ Integer.toHexString(msg.getPowerUsedID()) + " ("
|
||||
+ msg.getPowerUsedID() + ')');
|
||||
}
|
||||
|
||||
Boolean earlyExit = false;
|
||||
//Sending recycle message to player if died while casting.
|
||||
if (!playerCharacter.isAlive() && msg.getPowerUsedID() != 428589216) { //succor
|
||||
|
||||
earlyExit = true;
|
||||
}
|
||||
|
||||
if(msg.getPowerUsedID() == 430628895){ // group teleport
|
||||
|
||||
Boolean activeBane = false;
|
||||
|
||||
if(ZoneManager.getCityAtLocation(playerCharacter.loc) != null && ZoneManager.getCityAtLocation(playerCharacter.loc).getBane() != null)
|
||||
activeBane = ZoneManager.getCityAtLocation(playerCharacter.loc).getBane().getSiegePhase().equals(SiegePhase.WAR);
|
||||
|
||||
Zone currentZone = ZoneManager.findSmallestZone(playerCharacter.loc);
|
||||
if(currentZone == null)
|
||||
earlyExit = true;
|
||||
|
||||
if(currentZone.isPlayerCity() && !activeBane)
|
||||
earlyExit = true;
|
||||
|
||||
if(currentZone.getName().contains("Mine") == true && currentZone.isPlayerCity() == false) {
|
||||
for (Building building : currentZone.zoneBuildingSet) {
|
||||
if (Mine.getMineFromTower(building.getObjectUUID()) != null) {
|
||||
Mine currentMine = Mine.getMineFromTower(building.getObjectUUID());
|
||||
if (currentMine.isActive == false) {
|
||||
earlyExit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3fImmutable endLoc = new Vector3fImmutable(msg.getTargetX(),msg.getTargetY(),msg.getTargetZ());
|
||||
currentZone = ZoneManager.findSmallestZone(endLoc);
|
||||
|
||||
if(currentZone == null)
|
||||
earlyExit = true;
|
||||
|
||||
if(currentZone.isPlayerCity() && !activeBane)
|
||||
earlyExit = true;
|
||||
|
||||
if(currentZone.getName().contains("Mine") == true && currentZone.isPlayerCity() == false) {
|
||||
for (Building building : currentZone.zoneBuildingSet) {
|
||||
if (Mine.getMineFromTower(building.getObjectUUID()) != null) {
|
||||
Mine currentMine = Mine.getMineFromTower(building.getObjectUUID());
|
||||
if (currentMine.isActive == false) {
|
||||
earlyExit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// get power
|
||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||
|
||||
if(pb.description.equals("Personal Movement Buff") && playerCharacter.isFlying()) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You cannot use movement speed buffs while flying");
|
||||
earlyExit = true;
|
||||
}
|
||||
|
||||
if (earlyExit) {
|
||||
|
||||
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||
Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
@@ -266,7 +300,6 @@ public enum PowersManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// if (!pc.getPowers().contains(msg.getPowerUsedID())) {
|
||||
// sendPowerMsg(pc, 10, msg);
|
||||
// return false;
|
||||
@@ -279,9 +312,6 @@ public enum PowersManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get power
|
||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||
|
||||
if (pb == null) {
|
||||
ChatManager.chatSayInfo(playerCharacter,
|
||||
"This power is not implemented yet.");
|
||||
@@ -292,44 +322,18 @@ public enum PowersManager {
|
||||
return true;
|
||||
// return false;
|
||||
}
|
||||
|
||||
//check for movement buffs while flying
|
||||
if(playerCharacter.isFlying()) {
|
||||
switch(pb.token){
|
||||
case 429005674:
|
||||
case 429505739:
|
||||
case 431054700:
|
||||
case 428005600:
|
||||
case 431610080:
|
||||
case 427935608:
|
||||
case 427857146:
|
||||
case 427988218:
|
||||
case 431854842:
|
||||
case 421074170:
|
||||
case 429611355:
|
||||
case 428955899:
|
||||
case 1794395699:
|
||||
case 429428796:
|
||||
case 1514898036:
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You Cannot Fly While Having A MovementBuff");
|
||||
//resync stamina
|
||||
playerCharacter.setStamina(playerCharacter.getStamina(), playerCharacter);
|
||||
|
||||
// Update all surrounding clients.
|
||||
TargetedActionMsg cmm = new TargetedActionMsg(playerCharacter);
|
||||
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, cmm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (playerCharacter.getLastPower() != null)
|
||||
return true;
|
||||
|
||||
//Check if Power Target is allowed to cast.
|
||||
|
||||
|
||||
// Check powers for normal users
|
||||
if (playerCharacter.getPowers() == null || !playerCharacter.getPowers().containsKey(msg.getPowerUsedID()))
|
||||
|
||||
if(msg.getPowerUsedID() == 429399948)
|
||||
for(CharacterRune cr : playerCharacter.getRunes())
|
||||
if(cr.getRuneBaseID() == 3029)
|
||||
skipCheck = true;
|
||||
if (!skipCheck && (playerCharacter.getPowers() == null || !playerCharacter.getPowers().containsKey(msg.getPowerUsedID())))
|
||||
if (!playerCharacter.isCSR()) {
|
||||
if (!MBServerStatics.POWERS_DEBUG) {
|
||||
// ChatManager.chatSayInfo(pc, "You may not cast that spell!");
|
||||
@@ -342,24 +346,31 @@ public enum PowersManager {
|
||||
|
||||
// get numTrains for power
|
||||
int trains = msg.getNumTrains();
|
||||
|
||||
int token = pb.token;
|
||||
int overrideTrains = 0;
|
||||
int overrideRecycle = 0;
|
||||
if(token == 429420458){
|
||||
overrideTrains = 40;
|
||||
overrideRecycle = 300000;
|
||||
}
|
||||
// can't go over the max trains for the power, unless CSR
|
||||
if (trains > pb.getMaxTrains() && !playerCharacter.isCSR()) {
|
||||
trains = pb.getMaxTrains();
|
||||
msg.setNumTrains(trains);
|
||||
}
|
||||
|
||||
switch(pb.token){
|
||||
case 429420458: // BH eyes
|
||||
msg.setNumTrains(msg.getNumTrains() * 2);
|
||||
break;
|
||||
}
|
||||
|
||||
// can't go over total trains by player
|
||||
if (playerCharacter.getPowers() != null && playerCharacter.getPowers().containsKey(msg.getPowerUsedID())) {
|
||||
CharacterPower cp = playerCharacter.getPowers().get(msg.getPowerUsedID());
|
||||
if (cp != null) {
|
||||
int tot = cp.getTotalTrains();
|
||||
switch(token){
|
||||
case 430596127:
|
||||
if(playerCharacter.getPromotionClass().getName().equals("Wizard"))
|
||||
tot = 40; //single teleport granted at 40 for wizard
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (tot == 0 && !playerCharacter.isCSR())
|
||||
return false;
|
||||
if (trains != tot && !playerCharacter.isCSR()) {
|
||||
@@ -368,27 +379,19 @@ public enum PowersManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(overrideTrains > 0)
|
||||
msg.setNumTrains(overrideTrains);
|
||||
// get recycle time in ms
|
||||
int time = pb.getRecycleTime(trains);
|
||||
|
||||
// verify player is in correct mode (combat/nonCombat)
|
||||
if (playerCharacter.isCombat()) {
|
||||
if (!pb.allowedInCombat())
|
||||
// ChatManager.chatPowerError(pc,
|
||||
// "This power is not allowed in combat mode.");
|
||||
return true;
|
||||
} else if (!pb.allowedOutOfCombat())
|
||||
// ChatManager.chatPowerError(pc,
|
||||
// "You must be in combat mode to use this power.");
|
||||
return true;
|
||||
if(overrideRecycle > 0)
|
||||
time = overrideRecycle;
|
||||
|
||||
// verify player is not stunned or prohibited from casting
|
||||
PlayerBonuses bonus = playerCharacter.getBonuses();
|
||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
||||
return true;
|
||||
|
||||
// if moving make sure spell valid for movement
|
||||
Vector3fImmutable endLoc = playerCharacter.getEndLoc();
|
||||
|
||||
@@ -414,58 +417,58 @@ public enum PowersManager {
|
||||
if (pb.targetFromLastTarget() || pb.targetPet()) // use msg's target
|
||||
if (pb.isAOE()) {
|
||||
if (!pb.usePointBlank()) {
|
||||
AbstractWorldObject target = getTarget(msg);
|
||||
|
||||
AbstractWorldObject target;
|
||||
if(msg.getTargetType() == 37 && Mob.dynamic_pets.get(msg.getTargetID()) != null){
|
||||
Mob pet = Mob.dynamic_pets.get(msg.getTargetID());
|
||||
target = pet;
|
||||
}else{
|
||||
target = getTarget(msg);
|
||||
}
|
||||
|
||||
if (target != null && target.getObjectType() == GameObjectType.Building && !pb.targetBuilding()) {
|
||||
PowersManager.sendPowerMsg(playerCharacter, 9, new PerformActionMsg(msg));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (target == null) {
|
||||
if (playerCharacter.getLoc().distanceSquared2D(msg.getTargetLoc()) > sqr(pb
|
||||
.getRange()))
|
||||
return true;
|
||||
} else if (verifyInvalidRange(playerCharacter, target, pb.getRange()))
|
||||
} else if (verifyInvalidRange(playerCharacter, target, pb.getRange())) {
|
||||
// pc.getLoc().distance(target.getLoc()) >
|
||||
// pb.getRange())
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// get target
|
||||
AbstractWorldObject target = getTarget(msg);
|
||||
|
||||
if (target == null)
|
||||
AbstractWorldObject target;
|
||||
if(msg.getTargetType() == 37 && Mob.dynamic_pets.get(msg.getTargetID()) != null){
|
||||
Mob pet = Mob.dynamic_pets.get(msg.getTargetID());
|
||||
target = pet;
|
||||
}else{
|
||||
target = getTarget(msg);
|
||||
}
|
||||
if (target == null) {
|
||||
return true;
|
||||
|
||||
}
|
||||
if (!target.isAlive() && target.getObjectType().equals(GameObjectType.Building) == false && msg.getPowerUsedID() != 428589216)
|
||||
return true;
|
||||
|
||||
float range = pb.getRange();
|
||||
// verify target is in range
|
||||
|
||||
if(pb.token != 429396028) {
|
||||
|
||||
if (verifyInvalidRange(playerCharacter, target, range))
|
||||
// (pc.getLoc().distance(target.getLoc()) > pb.getRange()) {
|
||||
// TODO send message that target is out of range
|
||||
return true;
|
||||
// verify target is valid type
|
||||
if (!validateTarget(target, playerCharacter, pb))
|
||||
return true;
|
||||
}else{
|
||||
pb.isSpell = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (verifyInvalidRange(playerCharacter, target, range))
|
||||
// (pc.getLoc().distance(target.getLoc()) > pb.getRange()) {
|
||||
// TODO send message that target is out of range
|
||||
return true;
|
||||
// verify target is valid type
|
||||
if (!validateTarget(target, playerCharacter, pb))
|
||||
return true;
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(target))
|
||||
targetLiveCounter = ((AbstractCharacter) target).getLiveCounter();
|
||||
}
|
||||
|
||||
// verify regular player can cast spell, otherwise authenticate
|
||||
if (!pb.regularPlayerCanCast()) {
|
||||
Account a = SessionManager.getAccount(playerCharacter);
|
||||
@@ -475,7 +478,6 @@ public enum PowersManager {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// verify player has proper effects applied to use power
|
||||
if (pb.getEffectPrereqs().size() > 0 && playerCharacter.getEffects() != null) {
|
||||
|
||||
@@ -489,11 +491,9 @@ public enum PowersManager {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
return true;
|
||||
}
|
||||
|
||||
//verify player has proper equipment to use power
|
||||
if (pb.getEquipPrereqs().size() > 0) {
|
||||
|
||||
@@ -568,6 +568,7 @@ public enum PowersManager {
|
||||
// Validity checks passed, move on to casting spell
|
||||
//get caster's live counter
|
||||
int casterLiveCounter = playerCharacter.getLiveCounter();
|
||||
|
||||
// run recycle job for when cast is available again, don't bother adding the timer for CSRs
|
||||
if (time > 0) {
|
||||
FinishRecycleTimeJob frtj = new FinishRecycleTimeJob(playerCharacter, msg);
|
||||
@@ -594,7 +595,7 @@ public enum PowersManager {
|
||||
|
||||
// make person casting stand up if spell (unless they're casting a chant which does not make them stand up)
|
||||
if (pb.isSpell() && !pb.isChant() && playerCharacter.isSit()) {
|
||||
playerCharacter.update(false);
|
||||
playerCharacter.update();
|
||||
playerCharacter.setSit(false);
|
||||
UpdateStateMsg updateStateMsg = new UpdateStateMsg(playerCharacter);
|
||||
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
@@ -602,9 +603,7 @@ public enum PowersManager {
|
||||
}
|
||||
|
||||
// update cast (use skill) fail condition
|
||||
if(pb.token != 429396028) {
|
||||
playerCharacter.cancelOnCast();
|
||||
}
|
||||
playerCharacter.cancelOnCast();
|
||||
|
||||
// update castSpell (use spell) fail condition if spell
|
||||
if (pb.isSpell())
|
||||
@@ -613,16 +612,28 @@ public enum PowersManager {
|
||||
// get cast time in ms.
|
||||
time = pb.getCastTime(trains);
|
||||
|
||||
|
||||
if(pb.token == 430596127)
|
||||
time = 5000;
|
||||
|
||||
if(pb.name.equals("Summon") && playerCharacter.getRace().getName().contains("Vampire"))
|
||||
time = 60000;
|
||||
|
||||
// set player is casting for regens
|
||||
|
||||
|
||||
if (time > 100) {
|
||||
playerCharacter.update(false);
|
||||
playerCharacter.update();
|
||||
playerCharacter.setIsCasting(true);
|
||||
}
|
||||
|
||||
|
||||
playerCharacter.setLastMovementState(playerCharacter.getMovementState());
|
||||
|
||||
if(msg.getPowerUsedID() == 429495514 && playerCharacter.getRace().getName().contains("Shade")){
|
||||
copyMsg.setPowerUsedID(429397210);//intercept shade using hide and cast sneak instead
|
||||
}
|
||||
|
||||
// run timer job to end cast
|
||||
if (time < 1) // run immediately
|
||||
finishUsePower(copyMsg, playerCharacter, casterLiveCounter, targetLiveCounter);
|
||||
@@ -688,7 +699,13 @@ public enum PowersManager {
|
||||
if (pb.targetFromLastTarget() || pb.targetPet()) // use msg's target
|
||||
if (pb.isAOE()) {
|
||||
if (!pb.usePointBlank()) {
|
||||
AbstractWorldObject target = getTarget(msg);
|
||||
AbstractWorldObject target;
|
||||
if(msg.getTargetType() == 37 && Mob.dynamic_pets.get(msg.getTargetID()) != null){
|
||||
Mob pet = Mob.dynamic_pets.get(msg.getTargetID());
|
||||
target = pet;
|
||||
}else{
|
||||
target = getTarget(msg);
|
||||
}
|
||||
|
||||
|
||||
if (target == null) {
|
||||
@@ -703,7 +720,13 @@ public enum PowersManager {
|
||||
}
|
||||
} else {
|
||||
// get target
|
||||
AbstractWorldObject target = getTarget(msg);
|
||||
AbstractWorldObject target;
|
||||
if(msg.getTargetType() == 37 && Mob.dynamic_pets.get(msg.getTargetID()) != null){
|
||||
Mob pet = Mob.dynamic_pets.get(msg.getTargetID());
|
||||
target = pet;
|
||||
}else{
|
||||
target = getTarget(msg);
|
||||
}
|
||||
|
||||
if (target == null)
|
||||
return true;
|
||||
@@ -787,16 +810,8 @@ public enum PowersManager {
|
||||
if (playerCharacter == null || msg == null)
|
||||
return;
|
||||
|
||||
if((msg.getPowerUsedID() == 429495514 || msg.getPowerUsedID() == 429407306) && playerCharacter.getRace().getName().toLowerCase().contains("shade")){
|
||||
//msg.setPowerUsedID(407015607);
|
||||
applyPower(playerCharacter,playerCharacter,playerCharacter.loc,429397210,msg.getNumTrains(),false);
|
||||
}
|
||||
if(msg.getPowerUsedID() == 429494441) {//wildkins chase
|
||||
playerCharacter.removeEffectBySource(EffectSourceType.Root,40,true);
|
||||
playerCharacter.removeEffectBySource(EffectSourceType.Snare,40,true);
|
||||
}
|
||||
if (playerCharacter.isCasting()) {
|
||||
playerCharacter.update(false);
|
||||
playerCharacter.update();
|
||||
playerCharacter.updateStamRegen(-100);
|
||||
}
|
||||
|
||||
@@ -898,16 +913,15 @@ public enum PowersManager {
|
||||
}
|
||||
float range = pb.getRange() + speedRange;
|
||||
|
||||
if(pb.token != 429396028) {
|
||||
|
||||
if (verifyInvalidRange(playerCharacter, mainTarget, range)) {
|
||||
if (verifyInvalidRange(playerCharacter, mainTarget, range)) {
|
||||
|
||||
sendPowerMsg(playerCharacter, 8, msg);
|
||||
return;
|
||||
}
|
||||
// (pc.getLoc().distance(target.getLoc()) > pb.getRange()) {
|
||||
// TODO send message that target is out of range
|
||||
sendPowerMsg(playerCharacter, 8, msg);
|
||||
return;
|
||||
}
|
||||
// (pc.getLoc().distance(target.getLoc()) > pb.getRange()) {
|
||||
// TODO send message that target is out of range
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -929,8 +943,6 @@ public enum PowersManager {
|
||||
return;
|
||||
}
|
||||
|
||||
playerCharacter.setHateValue(pb.getHateValue(trains));
|
||||
|
||||
//Send Cast Message.
|
||||
// PerformActionMsg castMsg = new PerformActionMsg(msg);
|
||||
// castMsg.setNumTrains(9999);
|
||||
@@ -981,8 +993,6 @@ public enum PowersManager {
|
||||
//Power is aiding a target, handle aggro if combat target is a Mob.
|
||||
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.PlayerCharacter) {
|
||||
PlayerCharacter pcTarget = (PlayerCharacter) target;
|
||||
if (!pb.isHarmful())
|
||||
Mob.HandleAssistedAggro(playerCharacter, pcTarget);
|
||||
}
|
||||
|
||||
// update target of used power timer
|
||||
@@ -1321,9 +1331,8 @@ public enum PowersManager {
|
||||
if (pc == null)
|
||||
return;
|
||||
|
||||
PlayerCharacter target = SessionManager
|
||||
.getPlayerCharacterByLowerCaseName(msg.getTargetName());
|
||||
if (target == null || target.equals(pc)) {
|
||||
PlayerCharacter target = SessionManager.getPlayerCharacterByLowerCaseName(msg.getTargetName());
|
||||
if (target == null || target.equals(pc) || target.isCombat() || target.getGuild().getNation().equals(pc.getGuild().getNation()) == false) {
|
||||
|
||||
if (target == null) // Player not found. Send not found message
|
||||
ChatManager.chatInfoError(pc,
|
||||
@@ -1332,7 +1341,10 @@ public enum PowersManager {
|
||||
ChatManager.chatInfoError(pc,
|
||||
"Cannot summon player in combat.");
|
||||
// else trying to summon self, just fail
|
||||
|
||||
if(target != null && target.getGuild().getNation().equals(pc.getGuild().getNation()) == false){
|
||||
ChatManager.chatInfoError(pc,
|
||||
"Cannot summon outside of nation.");
|
||||
}
|
||||
// recycle summon
|
||||
sendRecyclePower(msg.getPowerToken(), origin);
|
||||
|
||||
@@ -1364,7 +1376,7 @@ public enum PowersManager {
|
||||
if (source == null)
|
||||
return;
|
||||
|
||||
long tooLate = pc.getSummoner(source.getObjectUUID());
|
||||
long tooLate = pc.getSummoner(source.getObjectUUID()) + 45000;
|
||||
if (tooLate < System.currentTimeMillis()) {
|
||||
ChatManager.chatInfoError(pc, "You waited too long to " + (msg.accepted() ? "accept" : "decline") + " the summons.");
|
||||
pc.removeSummoner(source.getObjectUUID());
|
||||
@@ -1426,18 +1438,16 @@ public enum PowersManager {
|
||||
duration = 15000; // Healer Summons, 15 seconds
|
||||
else
|
||||
duration = 45000; // Belgosh Summons, 45 seconds
|
||||
|
||||
boolean enemiesNear = false;
|
||||
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(pc.loc,MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)){
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter)awo;
|
||||
if(!playerCharacter.guild.getNation().equals(pc.guild.getNation())){
|
||||
enemiesNear = true;
|
||||
if(pc.inSafeZone() == false) {
|
||||
for (AbstractWorldObject absChar : WorldGrid.getObjectsInRangePartial(pc.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)) {
|
||||
PlayerCharacter player = (PlayerCharacter) absChar;
|
||||
if (player.guild.getNation().equals(pc.guild.getNation()) == false) {
|
||||
duration += 60000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(enemiesNear && !pc.isInSafeZone())
|
||||
duration += 60000;
|
||||
|
||||
// Teleport to summoners location
|
||||
FinishSummonsJob fsj = new FinishSummonsJob(source, pc);
|
||||
JobContainer jc = JobScheduler.getInstance().scheduleJob(fsj,
|
||||
@@ -1562,18 +1572,44 @@ public enum PowersManager {
|
||||
}
|
||||
|
||||
// create list of characters
|
||||
HashSet<AbstractCharacter> trackChars;
|
||||
switch(msg.getPowerToken()){
|
||||
case 431511776:
|
||||
case 429578587:
|
||||
case 429503360:
|
||||
trackChars = getTrackList(playerCharacter);
|
||||
break;
|
||||
default:
|
||||
trackChars = RangeBasedAwo.getTrackList(allTargets, playerCharacter, maxTargets);
|
||||
break;
|
||||
HashSet<AbstractCharacter> trackChars = RangeBasedAwo.getTrackList(
|
||||
allTargets, playerCharacter, maxTargets);
|
||||
|
||||
trackChars = new HashSet<>();
|
||||
HashSet<AbstractWorldObject> allInRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER);
|
||||
//ArrayList<Guild> nationsInRange = new ArrayList<>();
|
||||
ArrayList<AbstractWorldObject> purgeList = new ArrayList<>();
|
||||
for(AbstractWorldObject trackChar : allInRange) {
|
||||
if(trackChar.equals(playerCharacter) || !trackChar.isAlive() || !((PlayerCharacter)trackChar).isActive())
|
||||
purgeList.add(trackChar);
|
||||
}
|
||||
|
||||
allInRange.removeAll(purgeList);
|
||||
|
||||
//first round to add players in range
|
||||
for(AbstractWorldObject trackChar : allInRange){
|
||||
if(trackChar.equals(playerCharacter) || !trackChar.isAlive() || !((PlayerCharacter)trackChar).isActive())
|
||||
continue;
|
||||
if(allInRange.contains(trackChar)) {
|
||||
trackChars.add((AbstractCharacter)trackChar);
|
||||
}
|
||||
}
|
||||
|
||||
//track full range for chaining nation members
|
||||
ArrayList<Guild> nationsInRange = new ArrayList<>();
|
||||
for(AbstractCharacter pc : trackChars){
|
||||
if(nationsInRange.contains(pc.guild.getNation()) == false)
|
||||
nationsInRange.add(pc.guild.getNation());
|
||||
}
|
||||
HashSet<AbstractWorldObject> fullRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,1024,MBServerStatics.MASK_PLAYER);
|
||||
for(AbstractWorldObject trackChar : fullRange) {
|
||||
if(trackChar.equals(playerCharacter) || !trackChar.isAlive() || !((PlayerCharacter)trackChar).isActive())
|
||||
continue;
|
||||
if(nationsInRange.contains(((PlayerCharacter) trackChar).guild.getNation()) && trackChars.contains(trackChar) == false)
|
||||
trackChars.add((AbstractCharacter)trackChar);
|
||||
}
|
||||
|
||||
|
||||
TrackWindowMsg trackWindowMsg = new TrackWindowMsg(msg);
|
||||
|
||||
// send track window
|
||||
@@ -1585,30 +1621,6 @@ public enum PowersManager {
|
||||
|
||||
}
|
||||
|
||||
public static HashSet<AbstractCharacter> getTrackList(PlayerCharacter tracker){
|
||||
HashSet<AbstractCharacter> list = new HashSet<AbstractCharacter>();
|
||||
HashSet<AbstractWorldObject> shortList = WorldGrid.getObjectsInRangePartial(tracker.loc,MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER);
|
||||
HashSet<AbstractWorldObject> fullList = WorldGrid.getObjectsInRangePartial(tracker.loc,1408, MBServerStatics.MASK_PLAYER);
|
||||
ArrayList<Guild> guildsPresent = new ArrayList<>();
|
||||
for(AbstractWorldObject awo : shortList){
|
||||
PlayerCharacter pc = (PlayerCharacter)awo;
|
||||
if(!guildsPresent.contains(pc.guild.getNation())){
|
||||
guildsPresent.add(pc.guild.getNation());
|
||||
}
|
||||
}
|
||||
for(AbstractWorldObject awo : fullList){
|
||||
if(awo.equals(tracker))
|
||||
continue;
|
||||
PlayerCharacter pc = (PlayerCharacter)awo;
|
||||
if(!pc.isAlive())
|
||||
continue;
|
||||
if(guildsPresent.contains(pc.guild.getNation()))
|
||||
list.add(pc);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static void sendRecyclePower(int token, ClientConnection origin) {
|
||||
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token);
|
||||
|
||||
@@ -1773,7 +1785,8 @@ public enum PowersManager {
|
||||
ac.setItemCasting(false);
|
||||
if (ac == null || target == null || pb == null)
|
||||
return;
|
||||
|
||||
if(pb.targetSelf)
|
||||
target = ac;
|
||||
ac.clearTimer(Integer.toString(pb.getToken()));
|
||||
if (liveCounter == ac.getLiveCounter())
|
||||
finishApplyPowerA(ac, target, targetLoc, pb, trains, false);
|
||||
@@ -2322,7 +2335,7 @@ public enum PowersManager {
|
||||
|
||||
// set player is not casting for regens
|
||||
if (pc.isCasting()) {
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
}
|
||||
pc.setIsCasting(false);
|
||||
|
||||
@@ -2354,9 +2367,9 @@ public enum PowersManager {
|
||||
|
||||
int type = msg.getTargetType();
|
||||
int UUID = msg.getTargetID();
|
||||
|
||||
if (type == -1 || type == 0 || UUID == -1 || UUID == 0)
|
||||
if (type == -1 || type == 0 || UUID == -1 || UUID == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (AbstractWorldObject) DbManager.getObject(GameObjectType.values()[type], UUID);
|
||||
}
|
||||
@@ -2374,26 +2387,22 @@ public enum PowersManager {
|
||||
defense = 0f;
|
||||
// Get hit chance
|
||||
|
||||
//if (pc.getDebug(16)) {
|
||||
// String smsg = "ATR: " + atr + ", Defense: " + defense;
|
||||
// ChatManager.chatSystemInfo(pc, smsg);
|
||||
//}
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "ATR: " + atr + ", Defense: " + defense;
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
|
||||
//int chance;
|
||||
|
||||
//if (atr > defense || defense == 0)
|
||||
// chance = 94;
|
||||
//else {
|
||||
// float dif = atr / defense;
|
||||
// if (dif <= 0.8f)
|
||||
// chance = 4;
|
||||
// else
|
||||
// chance = ((int) (450 * (dif - 0.8f)) + 4);
|
||||
//}
|
||||
float constant = (atr+defense)*0.315f;
|
||||
float atrChance = atr - constant;
|
||||
float defChance = defense - constant + atrChance;
|
||||
float smallChance = atrChance/defChance;
|
||||
int chance = (int)(smallChance * 100);
|
||||
|
||||
// calculate hit/miss
|
||||
int roll = ThreadLocalRandom.current().nextInt(100);
|
||||
|
||||
if (CombatManager.LandHit((int)atr,(int)defense)) {
|
||||
boolean disable = true;
|
||||
if (roll < chance) {
|
||||
// Hit, check if dodge kicked in
|
||||
if (awo instanceof AbstractCharacter) {
|
||||
AbstractCharacter tarAc = (AbstractCharacter) awo;
|
||||
@@ -2595,11 +2604,11 @@ public enum PowersManager {
|
||||
ChatManager.chatSystemInfo(pc, outmsg);
|
||||
return false; // can't target player, stop here
|
||||
} // target is mob
|
||||
else if ((target.getObjectTypeMask() & MBServerStatics.MASK_MOB) != 0)
|
||||
else if ((target.getObjectTypeMask() & MBServerStatics.MASK_MOB) != 0 && ((Mob)target).isPet() == false)
|
||||
return pb.targetMob();
|
||||
|
||||
// target is pet
|
||||
else if ((target.getObjectTypeMask() & MBServerStatics.MASK_PET) != 0)
|
||||
else if ((target.getObjectTypeMask() & MBServerStatics.MASK_MOB) != 0 && ((Mob)target).isPet() == true)
|
||||
return pb.targetPet();
|
||||
|
||||
// target is Building
|
||||
@@ -2678,7 +2687,7 @@ public enum PowersManager {
|
||||
|
||||
PowersBase power = getLastPower(ac);
|
||||
|
||||
if (power != null && power.cancelOnTakeDamage())
|
||||
if (power != null && power.cancelOnTakeDamage() && power.getName().equals("Translocate") == false)
|
||||
cancelPower(ac, true);
|
||||
cancelItems(ac, false, true);
|
||||
ac.cancelTimer("Stuck");
|
||||
@@ -2693,9 +2702,7 @@ public enum PowersManager {
|
||||
}
|
||||
|
||||
public static void cancelOnStun(AbstractCharacter ac) {
|
||||
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
//PlayerCharacter.GroundPlayer((PlayerCharacter)ac);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static PowersBase getLastPower(AbstractCharacter ac) {
|
||||
@@ -2840,7 +2847,12 @@ public enum PowersManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void applyZergBuff(AbstractGameObject obj){
|
||||
|
||||
}
|
||||
public static void removeZergBuff(HashSet<Integer> playersIDs){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
import engine.db.archive.MineRecord;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -19,6 +24,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
|
||||
/*
|
||||
@@ -30,13 +36,14 @@ public enum SimulationManager {
|
||||
SERVERHEARTBEAT;
|
||||
|
||||
private static final long CITY_PULSE = 2000;
|
||||
private static final long RUNEGATE_PULSE = 1000;
|
||||
private static final long RUNEGATE_PULSE = 500;
|
||||
private static final long UPDATE_PULSE = 1000;
|
||||
private static final long FlIGHT_PULSE = 100;
|
||||
public static Duration executionTime = Duration.ofNanos(1);
|
||||
public static Duration executionMax = Duration.ofNanos(1);
|
||||
private static SimulationManager instance = null;
|
||||
private long _cityPulseTime = System.currentTimeMillis() + CITY_PULSE;
|
||||
private long _minePulseTime = System.currentTimeMillis() + CITY_PULSE;
|
||||
private long _runegatePulseTime = System.currentTimeMillis()
|
||||
+ RUNEGATE_PULSE;
|
||||
private long _updatePulseTime = System.currentTimeMillis() + UPDATE_PULSE;
|
||||
@@ -66,6 +73,8 @@ public enum SimulationManager {
|
||||
return popString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Update the simulation. *** Important: Whatever you do in here, do it damn
|
||||
* quick!
|
||||
@@ -113,18 +122,9 @@ public enum SimulationManager {
|
||||
}
|
||||
|
||||
try {
|
||||
if ((_cityPulseTime != 0) && (System.currentTimeMillis() > _cityPulseTime)) {
|
||||
try {
|
||||
pulseCities();
|
||||
}catch(Exception e){
|
||||
|
||||
}
|
||||
try {
|
||||
ArenaManager.pulseArenas();
|
||||
}catch(Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
if ((_cityPulseTime != 0)
|
||||
&& (System.currentTimeMillis() > _cityPulseTime))
|
||||
pulseCities();
|
||||
} catch (Exception e) {
|
||||
Logger.error(
|
||||
"Fatal error in City Pulse: DISABLED. Error Message : "
|
||||
@@ -132,7 +132,17 @@ public enum SimulationManager {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
//try {
|
||||
// if ((_minePulseTime != 0)
|
||||
// && (System.currentTimeMillis() > _minePulseTime))
|
||||
// pulseMines();
|
||||
//} catch (Exception e) {
|
||||
// Logger.error(
|
||||
// "Fatal error in Mine Pulse: DISABLED. Error Message : "
|
||||
// + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
|
||||
//}
|
||||
SimulationManager.executionTime = Duration.between(startTime, Instant.now());
|
||||
|
||||
if (executionTime.compareTo(executionMax) > 0)
|
||||
@@ -160,7 +170,7 @@ public enum SimulationManager {
|
||||
|
||||
if (player == null)
|
||||
continue;
|
||||
player.update(false);
|
||||
player.update();
|
||||
}
|
||||
|
||||
_updatePulseTime = System.currentTimeMillis() + 500;
|
||||
@@ -209,12 +219,7 @@ public enum SimulationManager {
|
||||
city = (City) cityObject;
|
||||
city.onEnter();
|
||||
}
|
||||
for(Mine mine : Mine.getMines()){
|
||||
if(mine != null && mine.isActive)
|
||||
mine.onEnter();
|
||||
}
|
||||
_cityPulseTime = System.currentTimeMillis() + CITY_PULSE;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -224,10 +229,6 @@ public enum SimulationManager {
|
||||
private void pulseRunegates() {
|
||||
|
||||
for (Runegate runegate : Runegate._runegates.values()) {
|
||||
for(Portal portal : runegate._portals)
|
||||
if(!portal.isActive())
|
||||
portal.activate(false);
|
||||
|
||||
runegate.collidePortals();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,383 +0,0 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.math.Vector2f;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class StrongholdManager {
|
||||
|
||||
public static void processStrongholds() {
|
||||
ArrayList<Mine> mines = Mine.getMines();
|
||||
|
||||
|
||||
//process strongholds selecting 3 randomly to become active
|
||||
int count = 0;
|
||||
while (count < 3) {
|
||||
int random = ThreadLocalRandom.current().nextInt(1, mines.size()) - 1;
|
||||
Mine mine = mines.get(random);
|
||||
if (mine != null) {
|
||||
if (!mine.isActive && !mine.isStronghold) {
|
||||
StartStronghold(mine);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void StartStronghold(Mine mine){
|
||||
|
||||
//remove buildings
|
||||
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
||||
if(tower == null)
|
||||
return;
|
||||
|
||||
mine.isStronghold = true;
|
||||
mine.strongholdMobs = new ArrayList<>();
|
||||
mine.oldBuildings = new HashMap<>();
|
||||
|
||||
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
|
||||
for(Building building : mineZone.zoneBuildingSet){
|
||||
mine.oldBuildings.put(building.getObjectUUID(),building.meshUUID);
|
||||
building.setMeshUUID(407650);
|
||||
building.setMeshScale(new Vector3f(0,0,0));
|
||||
InterestManager.setObjectDirty(building);
|
||||
WorldGrid.updateObject(building);
|
||||
}
|
||||
|
||||
//update tower to become stronghold mesh
|
||||
tower.setMeshUUID(getStrongholdMeshID(mine.getParentZone()));
|
||||
tower.setMeshScale(new Vector3f(1,1,1));
|
||||
InterestManager.setObjectDirty(tower);
|
||||
WorldGrid.updateObject(tower);
|
||||
|
||||
//create elite mobs
|
||||
for(int i = 0; i < mine.capSize * 2; i++){
|
||||
Vector3fImmutable loc = Vector3fImmutable.getRandomPointOnCircle(tower.loc,30);
|
||||
MobBase guardBase = MobBase.getMobBase(getStrongholdGuardianID(tower.meshUUID));
|
||||
Mob guard = Mob.createStrongholdMob(guardBase.getLoadID(), loc, Guild.getErrantGuild(),true,mineZone,null,0, guardBase.getFirstName(),65);
|
||||
if(guard != null){
|
||||
guard.parentZone = mine.getParentZone();
|
||||
guard.bindLoc = loc;
|
||||
guard.setLoc(loc);
|
||||
guard.StrongholdGuardian = true;
|
||||
guard.equipmentSetID = getStrongholdMobEquipSetID(guard);
|
||||
guard.runAfterLoad();
|
||||
guard.setLevel((short)65);
|
||||
guard.setResists(new Resists("Elite"));
|
||||
guard.spawnTime = 1000000000;
|
||||
guard.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||
mine.strongholdMobs.add(guard);
|
||||
LootManager.GenerateStrongholdLoot(guard,false,false);
|
||||
guard.healthMax = 12500;
|
||||
guard.setHealth(guard.healthMax);
|
||||
guard.maxDamageHandOne = 1550;
|
||||
guard.minDamageHandOne = 750;
|
||||
guard.atrHandOne = 1800;
|
||||
guard.defenseRating = 2200;
|
||||
guard.setFirstName("Elite Guardian");
|
||||
InterestManager.setObjectDirty(guard);
|
||||
WorldGrid.addObject(guard,loc.x,loc.z);
|
||||
WorldGrid.updateObject(guard);
|
||||
guard.stronghold = mine;
|
||||
guard.mobPowers.clear();
|
||||
guard.mobPowers.put(429399948,20); // find weakness
|
||||
}
|
||||
}
|
||||
//create stronghold commander
|
||||
Vector3fImmutable loc = tower.loc;
|
||||
MobBase commanderBase = MobBase.getMobBase(getStrongholdCommanderID(tower.meshUUID));
|
||||
Mob commander = Mob.createStrongholdMob(commanderBase.getLoadID(), loc,Guild.getErrantGuild(),true,mineZone,null,0, commanderBase.getFirstName(),75);
|
||||
if(commander != null){
|
||||
commander.parentZone = mine.getParentZone();
|
||||
commander.bindLoc = loc;
|
||||
commander.setLoc(loc);
|
||||
commander.StrongholdCommander = true;
|
||||
commander.equipmentSetID = getStrongholdMobEquipSetID(commander);
|
||||
commander.runAfterLoad();
|
||||
commander.setLevel((short)75);
|
||||
commander.setResists(new Resists("Elite"));
|
||||
commander.spawnTime = 1000000000;
|
||||
commander.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||
commander.mobPowers.clear();
|
||||
commander.mobPowers.put(429032838, 40); // gravechill
|
||||
commander.mobPowers.put(429757701,20); // magebolt
|
||||
commander.mobPowers.put(429121388,20); // blight
|
||||
commander.mobPowers.put(431566891,20); // lightning bolt
|
||||
commander.mobPowers.put(428716075,20); // fire bolt
|
||||
commander.mobPowers.put(429010987,20); // ice bolt
|
||||
mine.strongholdMobs.add(commander);
|
||||
LootManager.GenerateStrongholdLoot(commander,true, false);
|
||||
commander.healthMax = 50000;
|
||||
commander.setHealth(commander.healthMax);
|
||||
commander.maxDamageHandOne = 3500;
|
||||
commander.minDamageHandOne = 1500;
|
||||
commander.atrHandOne = 3500;
|
||||
commander.defenseRating = 3500;
|
||||
commander.setFirstName("Guardian Commander");
|
||||
InterestManager.setObjectDirty(commander);
|
||||
WorldGrid.addObject(commander,loc.x,loc.z);
|
||||
WorldGrid.updateObject(commander);
|
||||
commander.stronghold = mine;
|
||||
}
|
||||
|
||||
mine.isActive = true;
|
||||
tower.setProtectionState(Enum.ProtectionState.PROTECTED);
|
||||
tower.getBounds().setRegions(tower);
|
||||
InterestManager.setObjectDirty(tower);
|
||||
WorldGrid.updateObject(tower);
|
||||
ChatManager.chatSystemChannel(mine.getZoneName() + "'s Stronghold Has Begun!");
|
||||
Logger.info(mine.getZoneName() + "'s Stronghold Has Begun!");
|
||||
}
|
||||
|
||||
public static void EndStronghold(Mine mine){
|
||||
|
||||
//restore the buildings
|
||||
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
||||
if(tower == null)
|
||||
return;
|
||||
|
||||
mine.isStronghold = false;
|
||||
|
||||
//get rid of the mobs
|
||||
for(Mob mob : mine.strongholdMobs) {
|
||||
mob.despawn();
|
||||
mob.removeFromCache();
|
||||
DbManager.MobQueries.DELETE_MOB(mob);
|
||||
}
|
||||
|
||||
//restore the buildings
|
||||
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
|
||||
for(Building building : mineZone.zoneBuildingSet){
|
||||
if(mine.oldBuildings.containsKey(building.getObjectUUID())) {
|
||||
building.setMeshUUID(mine.oldBuildings.get(building.getObjectUUID()));
|
||||
building.setMeshScale(new Vector3f(1, 1, 1));
|
||||
InterestManager.setObjectDirty(building);
|
||||
WorldGrid.updateObject(building);
|
||||
}
|
||||
}
|
||||
|
||||
//update tower to become Mine Tower again
|
||||
tower.setMeshUUID(1500100);
|
||||
|
||||
mine.isActive = false;
|
||||
tower.setProtectionState(Enum.ProtectionState.NPC);
|
||||
tower.getBounds().setRegions(tower);
|
||||
InterestManager.setObjectDirty(tower);
|
||||
WorldGrid.updateObject(tower);
|
||||
ChatManager.chatSystemChannel(mine.getZoneName() + "'s Stronghold Has Concluded!");
|
||||
Logger.info(mine.getZoneName() + "'s Stronghold Has Concluded!");
|
||||
}
|
||||
|
||||
public static int getStrongholdMeshID(Zone parent){
|
||||
while(!parent.isMacroZone()){
|
||||
parent = parent.getParent();
|
||||
if(parent.getName().equalsIgnoreCase("seafloor")){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
switch(parent.getObjectUUID()){
|
||||
case 197:
|
||||
case 234:
|
||||
case 178:
|
||||
case 122:
|
||||
return 814000; //Frost Giant Hall (ICE)
|
||||
case 968:
|
||||
case 951:
|
||||
case 313:
|
||||
case 331:
|
||||
return 5001500; // Lich Queens Keep (UNDEAD)
|
||||
case 785:
|
||||
case 761:
|
||||
case 717:
|
||||
case 737:
|
||||
return 1306600; // Temple of the Dragon (DESERT)
|
||||
case 353:
|
||||
case 371:
|
||||
case 388:
|
||||
case 532:
|
||||
return 564600; // Undead Lord's Keep (SWAMP)
|
||||
case 550:
|
||||
case 508:
|
||||
case 475:
|
||||
case 418:
|
||||
return 1326600; // elven hall
|
||||
case 437:
|
||||
case 491:
|
||||
case 590:
|
||||
case 569:
|
||||
return 602400;
|
||||
case 824:
|
||||
case 842:
|
||||
case 632:
|
||||
return 1600000; // chaos temple
|
||||
}
|
||||
return 456100; // small stockade
|
||||
}
|
||||
|
||||
public static int getStrongholdGuardianID(int ID){
|
||||
switch(ID){
|
||||
case 814000:
|
||||
return 253004; // Mountain Giant Raider Axe
|
||||
case 5001500:
|
||||
return 253008; // Vampire Spear Warrior
|
||||
case 1306600:
|
||||
return 253007; // Desert Orc Warrior
|
||||
case 564600:
|
||||
return 253010; // Kolthoss Warrior
|
||||
case 1326600:
|
||||
return 253005; //elven warrior
|
||||
case 602400:
|
||||
return 253009; // templar missionary
|
||||
case 1600000:
|
||||
return 253006; // scourger
|
||||
}
|
||||
return 13434; // human sword and board warrior
|
||||
}
|
||||
|
||||
public static int getStrongholdEpicID(int ID){
|
||||
switch(ID){
|
||||
case 814000:
|
||||
return 253023; // Mountain Giant Raider Axe
|
||||
case 5001500:
|
||||
return 253022; // Vampire Spear Warrior
|
||||
case 1306600:
|
||||
return 253021; // Desert Orc Warrior
|
||||
case 564600:
|
||||
return 253018; // Kolthoss Warrior
|
||||
case 1326600:
|
||||
return 253019; //elven warrior
|
||||
case 602400:
|
||||
return 253024; // templar missionary
|
||||
case 1600000:
|
||||
return 253020; // scourger
|
||||
}
|
||||
return 13434; // human sword and board warrior
|
||||
}
|
||||
|
||||
public static int getStrongholdCommanderID(int ID){
|
||||
switch(ID){
|
||||
case 814000:
|
||||
return 253017;
|
||||
case 5001500:
|
||||
return 253012;
|
||||
case 1306600:
|
||||
return 253016; // Desert Orc Xbow
|
||||
case 564600:
|
||||
return 253011; // xbow kolthoss
|
||||
case 1326600:
|
||||
return 253013; //elven bow warrior
|
||||
case 602400:
|
||||
return 253015; // dune giant with xbow
|
||||
case 1600000:
|
||||
return 253014; // barbator
|
||||
}
|
||||
return 13433;
|
||||
}
|
||||
|
||||
public static int getStrongholdMobEquipSetID(Mob mob) {
|
||||
if(mob.StrongholdGuardian){
|
||||
return 6327;
|
||||
}else{
|
||||
return 10790;
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckToEndStronghold(Mine mine) {
|
||||
|
||||
boolean stillAlive = false;
|
||||
for (Mob mob : mine.strongholdMobs)
|
||||
if (mob.isAlive())
|
||||
stillAlive = true;
|
||||
|
||||
if (!stillAlive) {
|
||||
// Epic encounter
|
||||
|
||||
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
||||
if (tower == null)
|
||||
return;
|
||||
|
||||
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
|
||||
|
||||
Vector3fImmutable loc = tower.loc;
|
||||
MobBase commanderBase = MobBase.getMobBase(getStrongholdEpicID(tower.meshUUID));
|
||||
Mob commander = Mob.createStrongholdMob(commanderBase.getLoadID(), loc, Guild.getErrantGuild(), true, mineZone, null, 0, commanderBase.getFirstName(), 75);
|
||||
if (commander != null) {
|
||||
commander.parentZone = mine.getParentZone();
|
||||
commander.bindLoc = loc;
|
||||
commander.setLoc(loc);
|
||||
commander.StrongholdEpic = true;
|
||||
commander.equipmentSetID = getStrongholdMobEquipSetID(commander);
|
||||
commander.runAfterLoad();
|
||||
commander.setLevel((short) 85);
|
||||
commander.setResists(new Resists("Elite"));
|
||||
commander.spawnTime = 1000000000;
|
||||
commander.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||
commander.mobPowers.clear();
|
||||
commander.mobPowers.put(429032838, 40); // gravechill
|
||||
commander.mobPowers.put(429757701,40); // magebolt
|
||||
commander.mobPowers.put(429121388,40); // blight
|
||||
commander.mobPowers.put(431566891,40); // lightning bolt
|
||||
commander.mobPowers.put(428716075,40); // fire bolt
|
||||
commander.mobPowers.put(429010987,40); // ice bolt
|
||||
mine.strongholdMobs.add(commander);
|
||||
LootManager.GenerateStrongholdLoot(commander, true, true);
|
||||
commander.healthMax = 250000;
|
||||
commander.setHealth(commander.healthMax);
|
||||
commander.maxDamageHandOne = 5000;
|
||||
commander.minDamageHandOne = 2500;
|
||||
commander.atrHandOne = 5000;
|
||||
commander.defenseRating = 3500;
|
||||
commander.setFirstName("Defender of " + mine.getParentZone().getParent().getName());
|
||||
InterestManager.setObjectDirty(commander);
|
||||
WorldGrid.addObject(commander,loc.x,loc.z);
|
||||
WorldGrid.updateObject(commander);
|
||||
commander.stronghold = mine;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=====================================NEW STUFF
|
||||
|
||||
public static void generateMaze(){
|
||||
Zone stronghold = ZoneManager.getZoneByUUID(995);
|
||||
ArrayList<Vector3fImmutable> gridLocs = new ArrayList<>();
|
||||
for(int x = -7; x < 8; x++){
|
||||
for(int z = -7; z < 8; z++) {
|
||||
if((x >= -1 || x <= 1) && (z >= -1 || z <= 1))
|
||||
continue;
|
||||
float offsetX = x * 128;
|
||||
float offsetZ = z * 128;
|
||||
Vector3fImmutable sLoc = stronghold.getLoc();
|
||||
Vector3fImmutable loc = new Vector3fImmutable(offsetX,sLoc.y,offsetZ);
|
||||
gridLocs.add(loc);
|
||||
}
|
||||
}
|
||||
for(Vector3fImmutable loc : gridLocs){
|
||||
createBuilding(stronghold,405600,loc);
|
||||
}
|
||||
}
|
||||
|
||||
public static void createBuilding(Zone zone, int blueprint, Vector3fImmutable offset){
|
||||
|
||||
Vector3fImmutable localLoc = ZoneManager.worldToLocal(offset, zone);
|
||||
|
||||
Building building = DbManager.BuildingQueries.
|
||||
CREATE_BUILDING(
|
||||
zone.getObjectUUID(), 0, "", 1,
|
||||
localLoc, 1.0f, 0, Enum.ProtectionState.PROTECTED, 0, 1,
|
||||
null, blueprint, 0, 0);
|
||||
building.setObjectTypeMask(MBServerStatics.MASK_BUILDING);
|
||||
WorldGrid.addObject(building,zone.getLoc().x + offset.x,zone.getLoc().z + offset.z);
|
||||
}
|
||||
}
|
||||
@@ -1,195 +1,58 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.objects.Guild;
|
||||
|
||||
public class ZergManager {
|
||||
|
||||
public static int getBaneCap(Guild guild) {
|
||||
|
||||
if(guild.getOwnedCity() == null || guild.getOwnedCity().getTOL() == null)
|
||||
return 0;
|
||||
|
||||
int cityRank = guild.getOwnedCity().getTOL().getRank();
|
||||
return (cityRank == 8) ? 20 : ((guild.getNation().getSubGuildList().size() + 1 <= 4) ? 10 : 20);
|
||||
}
|
||||
|
||||
public static float getCurrentMultiplier(int count, int maxCount){
|
||||
switch(maxCount) {
|
||||
case 3: return getMultiplier3Man(count);
|
||||
case 5: return getMultiplier5Man(count);
|
||||
case 10: return getMultiplier10Man(count);
|
||||
case 20: return getMultiplier20Man(count);
|
||||
case 30: return getMultiplier30Man(count);
|
||||
case 40: return getMultiplier40Man(count);
|
||||
default: return 1.0f; //unlimited
|
||||
case 3:
|
||||
return getMultiplier3Man(count);
|
||||
case 5:
|
||||
return getMultiplier5Man(count);
|
||||
case 10:
|
||||
return getMultiplier10Man(count);
|
||||
case 20:
|
||||
return getMultiplier20Man(count);
|
||||
default:
|
||||
return getMultiplier40Man(count);
|
||||
}
|
||||
}
|
||||
public static float getMultiplier(int count, int maxCount, float[] thresholds) {
|
||||
if (count <= maxCount) return 1.0f;
|
||||
if (count > thresholds.length) return 0.0f;
|
||||
return 1.0f - thresholds[count - maxCount - 1];
|
||||
}
|
||||
|
||||
public static float getMultiplier3Man(int count) {
|
||||
if(count < 4)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 6)
|
||||
return 0.0f;
|
||||
|
||||
switch(count){
|
||||
case 4: return 0.63f;
|
||||
case 5: return 0.40f;
|
||||
case 6: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
float[] thresholds = {0.37f, 0.60f, 0.75f};
|
||||
return getMultiplier(count, 3, thresholds);
|
||||
}
|
||||
|
||||
public static float getMultiplier5Man(int count) {
|
||||
if(count < 6)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 10)
|
||||
return 0.0f;
|
||||
|
||||
switch(count){
|
||||
case 6: return 0.75f;
|
||||
case 7: return 0.57f;
|
||||
case 8: return 0.44f;
|
||||
case 9: return 0.33f;
|
||||
case 10: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
float[] thresholds = {0.25f, 0.43f, 0.56f, 0.67f, 0.75f};
|
||||
return getMultiplier(count, 5, thresholds);
|
||||
}
|
||||
|
||||
public static float getMultiplier10Man(int count) {
|
||||
if(count < 11)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 20)
|
||||
return 0.0f;
|
||||
|
||||
switch(count){
|
||||
case 11: return 0.86f;
|
||||
case 12: return 0.75f;
|
||||
case 13: return 0.65f;
|
||||
case 14: return 0.57f;
|
||||
case 15: return 0.50f;
|
||||
case 16: return 0.44f;
|
||||
case 17: return 0.38f;
|
||||
case 18: return 0.33f;
|
||||
case 19: return 0.29f;
|
||||
case 20: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
float[] thresholds = {0.14f, 0.25f, 0.35f, 0.43f, 0.50f, 0.56f, 0.62f, 0.67f, 0.71f, 0.75f};
|
||||
return getMultiplier(count, 10, thresholds);
|
||||
}
|
||||
|
||||
public static float getMultiplier20Man(int count) {
|
||||
if(count < 21)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 40)
|
||||
return 0.0f;
|
||||
|
||||
switch (count)
|
||||
{
|
||||
case 21: return 0.93f;
|
||||
case 22: return 0.86f;
|
||||
case 23: return 0.80f;
|
||||
case 24: return 0.75f;
|
||||
case 25: return 0.70f;
|
||||
case 26: return 0.65f;
|
||||
case 27: return 0.61f;
|
||||
case 28: return 0.57f;
|
||||
case 29: return 0.53f;
|
||||
case 30: return 0.50f;
|
||||
case 31: return 0.47f;
|
||||
case 32: return 0.44f;
|
||||
case 33: return 0.41f;
|
||||
case 34: return 0.38f;
|
||||
case 35: return 0.36f;
|
||||
case 36: return 0.33f;
|
||||
case 37: return 0.31f;
|
||||
case 38: return 0.29f;
|
||||
case 39: return 0.27f;
|
||||
case 40: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
|
||||
return getMultiplier10Man(count * 2);
|
||||
}
|
||||
public static float getMultiplier30Man(int count) {
|
||||
if(count < 31)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 60)
|
||||
return 0.0f;
|
||||
|
||||
switch (count)
|
||||
{
|
||||
case 31: return 0.95f;
|
||||
case 32: return 0.91f;
|
||||
case 33: return 0.86f;
|
||||
case 34: return 0.82f;
|
||||
case 35: return 0.79f;
|
||||
case 36: return 0.75f;
|
||||
case 37: return 0.72f;
|
||||
case 38: return 0.68f;
|
||||
case 39: return 0.65f;
|
||||
case 40: return 0.63f;
|
||||
case 41: return 0.60f;
|
||||
case 42: return 0.57f;
|
||||
case 43: return 0.55f;
|
||||
case 44: return 0.52f;
|
||||
case 45: return 0.50f;
|
||||
case 46: return 0.48f;
|
||||
case 47: return 0.46f;
|
||||
case 48: return 0.44f;
|
||||
case 49: return 0.42f;
|
||||
case 50: return 0.40f;
|
||||
case 51: return 0.38f;
|
||||
case 52: return 0.37f;
|
||||
case 53: return 0.35f;
|
||||
case 54: return 0.33f;
|
||||
case 55: return 0.32f;
|
||||
case 56: return 0.30f;
|
||||
case 57: return 0.29f;
|
||||
case 58: return 0.28f;
|
||||
case 59: return 0.26f;
|
||||
case 60: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
public static float getMultiplier40Man(int count) {
|
||||
if(count < 41)
|
||||
return 1.0f;
|
||||
|
||||
if(count > 80)
|
||||
return 0.0f;
|
||||
|
||||
switch (count)
|
||||
{
|
||||
case 41: return 0.96f;
|
||||
case 42: return 0.93f;
|
||||
case 43: return 0.90f;
|
||||
case 44: return 0.86f;
|
||||
case 45: return 0.83f;
|
||||
case 46: return 0.80f;
|
||||
case 47: return 0.78f;
|
||||
case 48: return 0.75f;
|
||||
case 49: return 0.72f;
|
||||
case 50: return 0.70f;
|
||||
case 51: return 0.68f;
|
||||
case 52: return 0.65f;
|
||||
case 53: return 0.63f;
|
||||
case 54: return 0.61f;
|
||||
case 55: return 0.59f;
|
||||
case 56: return 0.57f;
|
||||
case 57: return 0.55f;
|
||||
case 58: return 0.53f;
|
||||
case 59: return 0.52f;
|
||||
case 60: return 0.50f;
|
||||
case 61: return 0.48f;
|
||||
case 62: return 0.47f;
|
||||
case 63: return 0.45f;
|
||||
case 64: return 0.44f;
|
||||
case 65: return 0.42f;
|
||||
case 66: return 0.41f;
|
||||
case 67: return 0.40f;
|
||||
case 68: return 0.38f;
|
||||
case 69: return 0.37f;
|
||||
case 70: return 0.36f;
|
||||
case 71: return 0.35f;
|
||||
case 72: return 0.33f;
|
||||
case 73: return 0.32f;
|
||||
case 74: return 0.31f;
|
||||
case 75: return 0.30f;
|
||||
case 76: return 0.29f;
|
||||
case 77: return 0.28f;
|
||||
case 78: return 0.27f;
|
||||
case 79: return 0.26f;
|
||||
case 80: return 0.25f;
|
||||
default: return 1.0f;
|
||||
}
|
||||
return getMultiplier10Man(count * 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,12 +19,14 @@ import engine.objects.Building;
|
||||
import engine.objects.City;
|
||||
import engine.objects.Zone;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/*
|
||||
* Class contains methods and structures which
|
||||
@@ -107,6 +109,20 @@ public enum ZoneManager {
|
||||
|
||||
}
|
||||
|
||||
// Returns the number of available hotZones
|
||||
// remaining in this cycle (1am)
|
||||
|
||||
public static int availableHotZones() {
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (Zone zone : ZoneManager.macroZones)
|
||||
if (ZoneManager.validHotZone(zone))
|
||||
count = count + 1;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// Resets the availability of hotZones
|
||||
// for this cycle
|
||||
|
||||
@@ -201,6 +217,63 @@ public enum ZoneManager {
|
||||
ZoneManager.playerCityZones.add(zone);
|
||||
}
|
||||
|
||||
public static final void generateAndSetRandomHotzone() {
|
||||
|
||||
Zone hotZone;
|
||||
ArrayList<Integer> zoneArray = new ArrayList<>();
|
||||
|
||||
if (ZoneManager.macroZones.isEmpty())
|
||||
return;
|
||||
|
||||
// Reset hotZone availability if none are left.
|
||||
|
||||
if (ZoneManager.availableHotZones() == 0)
|
||||
ZoneManager.resetHotZones();
|
||||
|
||||
for (Zone zone : ZoneManager.macroZones)
|
||||
if (validHotZone(zone))
|
||||
zoneArray.add(zone.getObjectUUID());
|
||||
|
||||
int entryIndex = ThreadLocalRandom.current().nextInt(zoneArray.size());
|
||||
|
||||
hotZone = ZoneManager.getZoneByUUID(zoneArray.get(entryIndex));
|
||||
|
||||
if (hotZone == null) {
|
||||
Logger.error("Hotzone is null");
|
||||
return;
|
||||
}
|
||||
|
||||
ZoneManager.setHotZone(hotZone);
|
||||
|
||||
}
|
||||
|
||||
public static final boolean validHotZone(Zone zone) {
|
||||
|
||||
if (zone.getSafeZone() == (byte) 1)
|
||||
return false; // no safe zone hotzones// if (this.hotzone == null)
|
||||
|
||||
if (zone.getNodes().isEmpty())
|
||||
return false;
|
||||
|
||||
if (zone.equals(ZoneManager.seaFloor))
|
||||
return false;
|
||||
|
||||
//no duplicate hotZones
|
||||
|
||||
if (zone.hasBeenHotzone == true)
|
||||
return false;
|
||||
|
||||
// Enforce min level
|
||||
|
||||
if (zone.minLvl < Integer.parseInt(ConfigManager.MB_HOTZONE_MIN_LEVEL.getValue()))
|
||||
return false;
|
||||
|
||||
if (ZoneManager.hotZone != null)
|
||||
return ZoneManager.hotZone.getObjectUUID() != zone.getObjectUUID();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Converts world coordinates to coordinates local to a given zone.
|
||||
|
||||
public static Vector3fImmutable worldToLocal(Vector3fImmutable worldVector,
|
||||
|
||||
@@ -15,9 +15,13 @@ import engine.gameManager.DbManager;
|
||||
import engine.job.AbstractScheduleJob;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||
import engine.objects.Bane;
|
||||
import engine.objects.City;
|
||||
import engine.workthreads.ZergMechanicThread;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import static engine.workthreads.ZergMechanicThread.startZergThreadBane;
|
||||
|
||||
public class ActivateBaneJob extends AbstractScheduleJob {
|
||||
|
||||
private final int cityUUID;
|
||||
@@ -67,6 +71,10 @@ public class ActivateBaneJob extends AbstractScheduleJob {
|
||||
msg.setChannel(ChatChannelType.SYSTEM.getChannelID());
|
||||
|
||||
DispatchMessage.dispatchMsgToAll(msg);
|
||||
|
||||
if(city.getBane() != null) {
|
||||
startZergThreadBane(city.getBane());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
|
||||
package engine.jobs;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.CombatManager;
|
||||
import engine.job.AbstractJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
public class AttackJob extends AbstractJob {
|
||||
|
||||
@@ -29,6 +31,9 @@ public class AttackJob extends AbstractJob {
|
||||
@Override
|
||||
protected void doJob() {
|
||||
CombatManager.doCombat(this.source, slot);
|
||||
if(this.source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
if(((PlayerCharacter)this.source).getHidden() > 0)
|
||||
this.source.removeEffectBySource(Enum.EffectSourceType.Invisibility,41,true);
|
||||
}
|
||||
|
||||
public boolean success() {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class EndFearJob extends AbstractEffectJob {
|
||||
if (this.target == null || (!(this.target instanceof Mob)))
|
||||
return;
|
||||
|
||||
((Mob) this.target).setFearedObject(null);
|
||||
((Mob) this.target).fearedObject = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,6 +40,6 @@ public class EndFearJob extends AbstractEffectJob {
|
||||
if (this.target == null || (!(this.target instanceof Mob)))
|
||||
return;
|
||||
|
||||
((Mob) this.target).setFearedObject(null);
|
||||
((Mob) this.target).fearedObject = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ public class FinishSummonsJob extends AbstractScheduleJob {
|
||||
return;
|
||||
|
||||
// cannot summon a player in combat
|
||||
//if (this.target.isCombat()) {
|
||||
if (this.target.isCombat()) {
|
||||
|
||||
// ErrorPopupMsg.sendErrorMsg(this.source, "Cannot summon player in combat.");
|
||||
ErrorPopupMsg.sendErrorMsg(this.source, "Cannot summon player in combat.");
|
||||
|
||||
// PowersManager.finishRecycleTime(428523680, this.source, false);
|
||||
// return;
|
||||
//}
|
||||
PowersManager.finishRecycleTime(428523680, this.source, false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, SourceType.SUMMON)) {
|
||||
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
|
||||
|
||||
@@ -9,12 +9,10 @@
|
||||
package engine.loot;
|
||||
|
||||
import engine.gameManager.LootManager;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class ItemTableEntry {
|
||||
public int minRoll;
|
||||
@@ -37,23 +35,11 @@ public class ItemTableEntry {
|
||||
List<ItemTableEntry> itemTableEntryList;
|
||||
|
||||
itemTableEntryList = LootManager._itemTables.get(itemTable);
|
||||
if(itemTableEntryList != null) {
|
||||
for (ItemTableEntry iteration : itemTableEntryList)
|
||||
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
|
||||
itemTableEntry = iteration;
|
||||
}
|
||||
|
||||
for (ItemTableEntry iteration : itemTableEntryList)
|
||||
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
|
||||
itemTableEntry = iteration;
|
||||
|
||||
return itemTableEntry;
|
||||
}
|
||||
|
||||
public static Integer getRandomItem(int itemTable) {
|
||||
int id = 0;
|
||||
List<ItemTableEntry> itemTableEntryList;
|
||||
|
||||
itemTableEntryList = LootManager._itemTables.get(itemTable);
|
||||
|
||||
if(itemTableEntryList != null && itemTableEntryList.size() > 1){
|
||||
id = itemTableEntryList.get(ThreadLocalRandom.current().nextInt(0, itemTableEntryList.size())).cacheID;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +33,15 @@ public class ModTableEntry {
|
||||
List<ModTableEntry> itemTableEntryList;
|
||||
|
||||
itemTableEntryList = LootManager._modTables.get(modTablwe);
|
||||
if(itemTableEntryList != null) {
|
||||
for (ModTableEntry iteration : itemTableEntryList)
|
||||
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
|
||||
modTableEntry = iteration;
|
||||
|
||||
if(itemTableEntryList == null)
|
||||
return null;
|
||||
|
||||
for (ModTableEntry iteration : itemTableEntryList) {
|
||||
if (iteration == null)
|
||||
continue;
|
||||
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
|
||||
modTableEntry = iteration;
|
||||
}
|
||||
return modTableEntry;
|
||||
}
|
||||
|
||||
+217
-531
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ public class MobAIThread implements Runnable{
|
||||
public static int AI_DROP_AGGRO_RANGE = 60;
|
||||
public static int AI_PULSE_MOB_THRESHOLD = 200;
|
||||
public static int AI_PATROL_DIVISOR = 15;
|
||||
public static float AI_CAST_FREQUENCY;
|
||||
public static float AI_CAST_FREQUENCY = 1.0f;
|
||||
// Thread constructor
|
||||
|
||||
public MobAIThread() {
|
||||
|
||||
@@ -12,13 +12,20 @@ package engine.mobileAI.utilities;
|
||||
import engine.Enum.*;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.CombatManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mobileAI.MobAI;
|
||||
import engine.mobileAI.Threads.MobAIThread;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.PerformActionMsg;
|
||||
import engine.net.client.msg.TargetedActionMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static engine.math.FastMath.sqr;
|
||||
@@ -48,7 +55,7 @@ public class CombatUtilities {
|
||||
}
|
||||
|
||||
public static boolean inRange2D(AbstractWorldObject entity1, AbstractWorldObject entity2, double range) {
|
||||
return entity1.getLoc().distance2D(entity2.getLoc()) < range;
|
||||
return entity1.getLoc().distanceSquared2D(entity2.getLoc()) < range * range;
|
||||
}
|
||||
|
||||
public static void swingIsBlock(Mob agent, AbstractWorldObject target, int animation) {
|
||||
@@ -139,22 +146,37 @@ public class CombatUtilities {
|
||||
}
|
||||
|
||||
public static boolean triggerDefense(Mob agent, AbstractWorldObject target) {
|
||||
int defense = 0;
|
||||
int atr = agent.getAtrHandOne();
|
||||
int defenseScore = 0;
|
||||
int attackScore = agent.getAtrHandOne();
|
||||
switch (target.getObjectType()) {
|
||||
case PlayerCharacter:
|
||||
defense = ((AbstractCharacter) target).getDefenseRating();
|
||||
defenseScore = ((AbstractCharacter) target).getDefenseRating();
|
||||
break;
|
||||
case Mob:
|
||||
|
||||
Mob mob = (Mob) target;
|
||||
if (mob.isSiege())
|
||||
defense = atr;
|
||||
defenseScore = attackScore;
|
||||
break;
|
||||
case Building:
|
||||
return false;
|
||||
}
|
||||
return CombatManager.LandHit(atr,defense);
|
||||
|
||||
int hitChance;
|
||||
if (attackScore > defenseScore || defenseScore == 0)
|
||||
hitChance = 94;
|
||||
else if (attackScore == defenseScore && target.getObjectType() == GameObjectType.Mob)
|
||||
hitChance = 10;
|
||||
else {
|
||||
float dif = attackScore / defenseScore;
|
||||
if (dif <= 0.8f)
|
||||
hitChance = 4;
|
||||
else
|
||||
hitChance = ((int) (450 * (dif - 0.8f)) + 4);
|
||||
if (target.getObjectType() == GameObjectType.Building)
|
||||
hitChance = 100;
|
||||
}
|
||||
return ThreadLocalRandom.current().nextInt(100) > hitChance;
|
||||
}
|
||||
|
||||
public static boolean triggerBlock(Mob agent, AbstractWorldObject ac) {
|
||||
@@ -289,7 +311,6 @@ public class CombatUtilities {
|
||||
if (targetMob.isSiege())
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static float determineDamage(Mob agent) {
|
||||
@@ -465,8 +486,9 @@ public class CombatUtilities {
|
||||
masteryLevel = (int) agent.getSkills().get(weapon.getMastery()).getModifiedAmount();
|
||||
}
|
||||
}
|
||||
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
||||
}
|
||||
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
||||
return agent.getMinDamageHandOne();
|
||||
}
|
||||
|
||||
public static double getMaxDmg(double max, Mob agent, ItemBase weapon) {
|
||||
@@ -492,8 +514,214 @@ public class CombatUtilities {
|
||||
if (agent.getSkills().containsKey(weapon.getSkillRequired()))
|
||||
masteryLevel = (int) agent.getSkills().get(weapon.getMastery()).getModifiedAmount();
|
||||
|
||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||
}
|
||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||
return agent.getMaxDamageHandOne();
|
||||
}
|
||||
|
||||
public static boolean MobCast(Mob mob) {
|
||||
|
||||
try {
|
||||
// Method picks a random spell from a mobile's list of powers
|
||||
// and casts it on the current target (or itself). Validation
|
||||
// (including empty lists) is done previously within canCast();
|
||||
|
||||
ArrayList<Integer> powerTokens;
|
||||
ArrayList<Integer> purgeTokens;
|
||||
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget();
|
||||
|
||||
if (mob.behaviourType.callsForHelp)
|
||||
MobAI.MobCallForHelp(mob);
|
||||
|
||||
// Generate a list of tokens from the mob powers for this mobile.
|
||||
|
||||
powerTokens = new ArrayList<>(mob.mobPowers.keySet());
|
||||
purgeTokens = new ArrayList<>();
|
||||
|
||||
// If player has this effect on them currently then remove
|
||||
// this token from our list.
|
||||
|
||||
for (int powerToken : powerTokens) {
|
||||
|
||||
PowersBase powerBase = PowersManager.getPowerByToken(powerToken);
|
||||
|
||||
for (ActionsBase actionBase : powerBase.getActions()) {
|
||||
|
||||
String stackType = actionBase.stackType;
|
||||
|
||||
if (target.getEffects() != null && target.getEffects().containsKey(stackType))
|
||||
purgeTokens.add(powerToken);
|
||||
}
|
||||
}
|
||||
|
||||
powerTokens.removeAll(purgeTokens);
|
||||
|
||||
// Sanity check
|
||||
|
||||
if (powerTokens.isEmpty())
|
||||
return false;
|
||||
|
||||
// Pick random spell from our list of powers
|
||||
|
||||
int powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size()));
|
||||
int powerRank = mob.mobPowers.get(powerToken);
|
||||
|
||||
PowersBase mobPower = PowersManager.getPowerByToken(powerToken);
|
||||
|
||||
//check for hit-roll
|
||||
|
||||
if (mobPower.requiresHitRoll)
|
||||
if (triggerDefense(mob, mob.getCombatTarget()))
|
||||
return false;
|
||||
|
||||
// Cast the spell
|
||||
|
||||
if (inRange2D(mob, mob.getCombatTarget(), mobPower.getRange())) {
|
||||
|
||||
PerformActionMsg msg;
|
||||
|
||||
if (!mobPower.isHarmful() || mobPower.targetSelf) {
|
||||
PowersManager.useMobPower(mob, mob, mobPower, powerRank);
|
||||
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob);
|
||||
} else {
|
||||
PowersManager.useMobPower(mob, target, mobPower, powerRank);
|
||||
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target);
|
||||
}
|
||||
|
||||
msg.setUnknown04(2);
|
||||
|
||||
PowersManager.finishUseMobPower(msg, mob, 0, 0);
|
||||
long randomCooldown = (long)((ThreadLocalRandom.current().nextInt(10,15) * 1000L) * MobAIThread.AI_CAST_FREQUENCY);
|
||||
|
||||
mob.nextCastTime = System.currentTimeMillis() + randomCooldown;
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: MobCast" + " " + e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean GuardCast(Mob mob) {
|
||||
|
||||
try {
|
||||
// Method picks a random spell from a mobile's list of powers
|
||||
// and casts it on the current target (or itself). Validation
|
||||
// (including empty lists) is done previously within canCast();
|
||||
|
||||
ArrayList<Integer> powerTokens;
|
||||
ArrayList<Integer> purgeTokens;
|
||||
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget();
|
||||
|
||||
if (mob.behaviourType.callsForHelp)
|
||||
MobAI.MobCallForHelp(mob);
|
||||
|
||||
// Generate a list of tokens from the mob powers for this mobile.
|
||||
|
||||
powerTokens = new ArrayList<>(mob.mobPowers.keySet());
|
||||
purgeTokens = new ArrayList<>();
|
||||
|
||||
// If player has this effect on them currently then remove
|
||||
// this token from our list.
|
||||
|
||||
for (int powerToken : powerTokens) {
|
||||
|
||||
PowersBase powerBase = PowersManager.getPowerByToken(powerToken);
|
||||
|
||||
for (ActionsBase actionBase : powerBase.getActions()) {
|
||||
|
||||
String stackType = actionBase.stackType;
|
||||
|
||||
if (target.getEffects() != null && target.getEffects().containsKey(stackType))
|
||||
purgeTokens.add(powerToken);
|
||||
}
|
||||
}
|
||||
|
||||
powerTokens.removeAll(purgeTokens);
|
||||
|
||||
// Sanity check
|
||||
|
||||
if (powerTokens.isEmpty())
|
||||
return false;
|
||||
|
||||
int powerToken;
|
||||
int nukeRoll = ThreadLocalRandom.current().nextInt(1,100);
|
||||
|
||||
if (nukeRoll < 55) {
|
||||
|
||||
//use direct damage spell
|
||||
powerToken = powerTokens.get(powerTokens.size() - 1);
|
||||
|
||||
} else {
|
||||
//use random spell
|
||||
powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size()));
|
||||
}
|
||||
|
||||
int powerRank = 1;
|
||||
|
||||
switch(mob.getRank()){
|
||||
case 1:
|
||||
powerRank = 10;
|
||||
break;
|
||||
case 2:
|
||||
powerRank = 15;
|
||||
break;
|
||||
case 3:
|
||||
powerRank = 20;
|
||||
break;
|
||||
case 4:
|
||||
powerRank = 25;
|
||||
break;
|
||||
case 5:
|
||||
powerRank = 30;
|
||||
break;
|
||||
case 6:
|
||||
powerRank = 35;
|
||||
break;
|
||||
case 7:
|
||||
powerRank = 40;
|
||||
break;
|
||||
}
|
||||
|
||||
PowersBase mobPower = PowersManager.getPowerByToken(powerToken);
|
||||
|
||||
//check for hit-roll
|
||||
|
||||
if (mobPower.requiresHitRoll)
|
||||
if (triggerDefense(mob, mob.getCombatTarget()))
|
||||
return false;
|
||||
|
||||
// Cast the spell
|
||||
|
||||
if (inRange2D(mob, mob.getCombatTarget(), mobPower.getRange())) {
|
||||
|
||||
PerformActionMsg msg;
|
||||
|
||||
if (!mobPower.isHarmful() || mobPower.targetSelf) {
|
||||
|
||||
if (mobPower.category.equals("DISPEL")) {
|
||||
PowersManager.useMobPower(mob, target, mobPower, powerRank);
|
||||
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target);
|
||||
} else {
|
||||
PowersManager.useMobPower(mob, mob, mobPower, powerRank);
|
||||
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob);
|
||||
}
|
||||
} else {
|
||||
PowersManager.useMobPower(mob, target, mobPower, powerRank);
|
||||
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target);
|
||||
}
|
||||
|
||||
msg.setUnknown04(2);
|
||||
|
||||
PowersManager.finishUseMobPower(msg, mob, 0, 0);
|
||||
|
||||
long randomCooldown = (long)((ThreadLocalRandom.current().nextInt(10,15) * 1000L) * MobAIThread.AI_CAST_FREQUENCY);
|
||||
mob.nextCastTime = System.currentTimeMillis() + randomCooldown;
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: MobCast" + " " + e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.mobileAI.Threads.MobAIThread;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.MovementManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mobileAI.Threads.MobAIThread;
|
||||
import engine.net.client.msg.MoveToPointMsg;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -38,7 +38,7 @@ public class MovementUtilities {
|
||||
if (agent.getContract() != null)
|
||||
guardCaptain = agent;
|
||||
else
|
||||
guardCaptain = (Mob) agent.npcOwner;
|
||||
guardCaptain = (Mob) agent.guardCaptain;
|
||||
|
||||
if (guardCaptain != null) {
|
||||
Building barracks = guardCaptain.building;
|
||||
@@ -115,39 +115,8 @@ public class MovementUtilities {
|
||||
|
||||
}
|
||||
|
||||
public static Vector3fImmutable GetMoveLocation(Mob aiAgent, AbstractCharacter aggroTarget) {
|
||||
|
||||
// Player isnt moving and neither is mob. Just return
|
||||
// the mobile's current location. Ain't goin nowhere!
|
||||
// *** Refactor: Check to ensure methods calling us
|
||||
// all don't sent move messages when not moving.
|
||||
|
||||
if ((aggroTarget.isMoving() == false))
|
||||
return aggroTarget.getLoc();
|
||||
|
||||
if (aggroTarget.getEndLoc().x != 0) {
|
||||
|
||||
float aggroTargetDistanceSquared = aggroTarget.getLoc().distanceSquared2D(aggroTarget.getEndLoc());
|
||||
float aiAgentDistanceSquared = aiAgent.getLoc().distanceSquared2D(aggroTarget.getEndLoc());
|
||||
|
||||
if (aiAgentDistanceSquared >= aggroTargetDistanceSquared)
|
||||
return aggroTarget.getEndLoc();
|
||||
else {
|
||||
float distanceToMove = sqrt(aggroTargetDistanceSquared + aiAgentDistanceSquared) * .5f;
|
||||
|
||||
return aggroTarget.getFaceDir().scaleAdd(distanceToMove, aggroTarget.getLoc());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// One of us is moving so let's calculate our destination loc for this
|
||||
// simulation frame. We will simply project our position onto the
|
||||
// character's movement vector and return the closest point.
|
||||
|
||||
return aiAgent.getLoc().ClosestPointOnLine(aggroTarget.getLoc(), aggroTarget.getEndLoc());
|
||||
}
|
||||
|
||||
public static void moveToLocation(Mob agent, Vector3fImmutable newLocation, float offset) {
|
||||
agent.resetLastSetLocUpdate();
|
||||
try {
|
||||
|
||||
//don't move farther than 30 units from player.
|
||||
@@ -172,32 +141,8 @@ public class MovementUtilities {
|
||||
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));
|
||||
}
|
||||
|
||||
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
||||
|
||||
//Determing where I want to move.
|
||||
return new Vector3fImmutable((center.x - radius) + ((ThreadLocalRandom.current().nextFloat() + .1f * 2) * radius),
|
||||
center.y,
|
||||
(center.z - radius) + ((ThreadLocalRandom.current().nextFloat() + .1f * 2) * radius));
|
||||
}
|
||||
|
||||
public static Long estimateMovementTime(Mob agent) {
|
||||
if (agent.getEndLoc().x == 0 && agent.getEndLoc().y == 0)
|
||||
return 0L;
|
||||
|
||||
return (long) ((agent.getLoc().distance2D(agent.getEndLoc()) * 1000) / agent.getSpeed());
|
||||
}
|
||||
|
||||
public static void aiMove(Mob agent, Vector3fImmutable vect, boolean isWalking) {
|
||||
|
||||
//update our walk/run state.
|
||||
if (isWalking && !agent.isWalk()) {
|
||||
agent.setWalkMode(true);
|
||||
MovementManager.sendRWSSMsg(agent);
|
||||
} else if (!isWalking && agent.isWalk()) {
|
||||
agent.setWalkMode(false);
|
||||
MovementManager.sendRWSSMsg(agent);
|
||||
}
|
||||
|
||||
MoveToPointMsg msg = new MoveToPointMsg();
|
||||
|
||||
|
||||
@@ -273,23 +218,4 @@ public class MovementUtilities {
|
||||
return character.getLoc();
|
||||
}
|
||||
|
||||
public static boolean updateMovementToCharacter(Mob aiAgent, AbstractCharacter aggroTarget) {
|
||||
|
||||
if (aiAgent.destination.equals(Vector3fImmutable.ZERO))
|
||||
return true;
|
||||
|
||||
if (!aiAgent.isMoving())
|
||||
return true;
|
||||
|
||||
|
||||
if (aggroTarget.isMoving()) {
|
||||
return !aiAgent.destination.equals(aggroTarget.getEndLoc()) && !aiAgent.destination.equals(aggroTarget.getLoc());
|
||||
} else {
|
||||
if (aiAgent.destination.equals(aggroTarget.getLoc()))
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ import engine.exception.FactoryBuildException;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.net.client.msg.PlaceAssetMsg;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -96,9 +94,11 @@ public class NetMsgFactory {
|
||||
if (origin instanceof ClientConnection) {
|
||||
PlayerCharacter player = ((ClientConnection) origin).getPlayerCharacter();
|
||||
if (player != null) {
|
||||
// if (MBServerStatics.worldServerName.equals("Grief"))
|
||||
Logger.error("Invalid protocol msg for player " + player.getFirstName() + " : " + opcode + " lastopcode: " + origin.lastProtocol.name() + " Error Code : " + errorCode);
|
||||
PlaceAssetMsg.sendPlaceAssetError(player.getClientConnection(), 1, "Please Report What You Just Did. Ref Code: " + opcode);
|
||||
}
|
||||
} else
|
||||
Logger.error("PROTOCOL ERROR: Player: " + ((ClientConnection) origin).getPlayerCharacter().getName() + " Account: " + ((ClientConnection) origin).getPlayerCharacter().getAccount().getUname() + "Invalid protocol msg : " + opcode + " lastopcode: " + origin.lastProtocol.name() + " Error Code : " + errorCode);
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package engine.net.client;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.exception.MsgSendException;
|
||||
@@ -85,7 +86,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (pc == null)
|
||||
return;
|
||||
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
if (msg.getSpeed() == 2)
|
||||
pc.setWalkMode(false);
|
||||
else
|
||||
@@ -114,7 +115,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (pc == null)
|
||||
return;
|
||||
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
|
||||
pc.setSit(msg.toggleSitStand());
|
||||
|
||||
@@ -122,6 +123,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (pc.isSit()) {
|
||||
pc.setCombat(false);
|
||||
pc.cancelOnSit();
|
||||
pc.stopMovement(pc.loc);
|
||||
}
|
||||
|
||||
UpdateStateMsg rwss = new UpdateStateMsg();
|
||||
@@ -222,6 +224,11 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if(msg.getSlotNumber() == 11 && pc.getRaceID() == 1999){
|
||||
forceTransferFromEquipToInventory(msg, origin, "Saetor cannot wear shoes.");
|
||||
return;
|
||||
}
|
||||
|
||||
int uuid = msg.getUUID();
|
||||
int slot = msg.getSlotNumber();
|
||||
//System.out.println("loading to slot: " + slot);
|
||||
@@ -554,32 +561,28 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (i == null)
|
||||
return;
|
||||
|
||||
if(i.getItemBaseID() == 7)
|
||||
return; //cant delete gold
|
||||
|
||||
if (!itemManager.doesCharOwnThisItem(i.getObjectUUID()))
|
||||
return;
|
||||
|
||||
if (!itemManager.inventoryContains(i))
|
||||
return;
|
||||
|
||||
//cannot delete gold
|
||||
if(i.getItemBaseID() == 7)
|
||||
if(i.getItemBaseID() == 980066)
|
||||
return;
|
||||
|
||||
if (i.isCanDestroy()) {
|
||||
int goldValue = i.getBaseValue();
|
||||
if (i.getItemBase().isRune())
|
||||
goldValue = 500000;
|
||||
|
||||
if (i.getItemBaseID() == 980066)
|
||||
goldValue = 0;
|
||||
|
||||
if(itemManager.getGoldInventory().getNumOfItems() + goldValue > 10000000)
|
||||
if (i.canDestroy) {
|
||||
int value = i.getItemBase().value;
|
||||
if(i.getItemBase().isRune())
|
||||
value = 500000;
|
||||
if(sourcePlayer.getCharItemManager().getGoldInventory().getNumOfItems() + value > 10000000){
|
||||
return;
|
||||
|
||||
if (itemManager.delete(i)) {
|
||||
if (goldValue > 0)
|
||||
itemManager.addGoldToInventory(goldValue, false);
|
||||
|
||||
itemManager.updateInventory();
|
||||
}
|
||||
if (itemManager.delete(i) == true) {
|
||||
sourcePlayer.getCharItemManager().addGoldToInventory(value,false);
|
||||
sourcePlayer.getCharItemManager().updateInventory();
|
||||
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
}
|
||||
@@ -672,8 +675,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
JobScheduler.getInstance().scheduleJob(new RefreshGroupJob(sourcePlayer), MBServerStatics.LOAD_OBJECT_DELAY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void lootWindowRequest(LootWindowRequestMsg msg, ClientConnection origin) throws MsgSendException {
|
||||
|
||||
PlayerCharacter pc = SessionManager.getPlayerCharacter(origin);
|
||||
@@ -1263,8 +1264,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
|
||||
cost = sell.getBaseValue();
|
||||
if(sell.getItemBaseID() == 980066)
|
||||
cost = 0;
|
||||
|
||||
//apply damaged value reduction
|
||||
float durabilityCurrent = sell.getDurabilityCurrent();
|
||||
@@ -1369,8 +1368,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
return;
|
||||
|
||||
// test within talking range
|
||||
if(npc.isInSafeZone())
|
||||
npc.sellPercent = 0;
|
||||
|
||||
if (sourcePlayer.getLoc().distanceSquared2D(npc.getLoc()) > MBServerStatics.NPC_TALK_RANGE * MBServerStatics.NPC_TALK_RANGE) {
|
||||
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 14);
|
||||
@@ -1402,12 +1399,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
Item buy = null;
|
||||
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) {
|
||||
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory();
|
||||
//if(npc.contract.getObjectUUID() == 890){ // default steward
|
||||
// sellInventory = npc.getSellInventorySteward();
|
||||
//}
|
||||
//if(npc.contract.getObjectUUID() == 889){ // default builder
|
||||
// sellInventory = npc.getSellInventoryBuilder();
|
||||
//}
|
||||
if (sellInventory == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1421,33 +1412,19 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (!itemMan.hasRoomInventory(ib.getWeight())) {
|
||||
return;
|
||||
}
|
||||
int cost = me.getMagicValue();
|
||||
int cost = me.magicValue;
|
||||
if(npc.getContractID() == 1201 && me.getItemBase().getName().equals("Prospector"))
|
||||
cost = 50;
|
||||
float bargain = sourcePlayer.getBargain();
|
||||
switch(npc.getContractID()){
|
||||
case 1201:
|
||||
cost = ItemBase.getDiscPrice(ib.getUUID());
|
||||
bargain = 0;
|
||||
break;
|
||||
case 1202:
|
||||
cost = ItemBase.getStatPrice(ib.getUUID());
|
||||
bargain = 0;
|
||||
break;
|
||||
case 900:
|
||||
cost = Warehouse.getCostForResource(ib.getUUID()) * Warehouse.getSellStackSize(ib.getUUID());
|
||||
bargain = 0;
|
||||
break;
|
||||
float profit = npc.getSellPercent(sourcePlayer) - bargain;
|
||||
if(me.getItemBase().getType().equals(ItemType.POTION))
|
||||
profit -= 1.0f;
|
||||
if (profit < 1)
|
||||
profit = 1;
|
||||
if(npc.getContractID() == 900){
|
||||
cost = Warehouse.getCostForResource(ib.getUUID()) * Warehouse.getSellStackSize(ib.getUUID());
|
||||
}
|
||||
float profit;
|
||||
|
||||
if(npc.isInSafeZone())
|
||||
profit = 0;
|
||||
else
|
||||
profit = npc.getSellPercent(sourcePlayer) - bargain;
|
||||
|
||||
|
||||
if(profit > 0)
|
||||
cost *= profit;
|
||||
|
||||
cost *= profit;
|
||||
if (gold.getNumOfItems() - cost < 0) {
|
||||
//dont' have enough goldItem exit!
|
||||
// chatMan.chatSystemInfo(pc, "" + "You dont have enough gold.");
|
||||
@@ -1460,17 +1437,16 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (b != null && (b.getStrongboxValue() + buildingDeposit) > b.getMaxGold() && !b.isOwnerIsNPC()) {
|
||||
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 206);
|
||||
return;
|
||||
}if(npc.getContractID() == 1502041){
|
||||
me.fromNoob = true;
|
||||
} else if (!itemMan.buyFromNPC(b, cost, buildingDeposit)) {
|
||||
}
|
||||
if (!itemMan.buyFromNPC(b, cost, buildingDeposit)) {
|
||||
// chatMan.chatSystemInfo(pc, "" + "You Failed to buy the item.");
|
||||
ChatManager.chatSystemError(sourcePlayer, "Failed To Buy Item");
|
||||
return;
|
||||
}
|
||||
if(me.getItemBase().getType().equals(ItemType.RESOURCE) && npc.getContractID() == 900){
|
||||
handleResourcePurchase(me,itemMan,sourcePlayer,ib);
|
||||
handleResourcePurchase(me,itemMan,npc,buy,sourcePlayer,ib);
|
||||
}else {
|
||||
buy = Item.createItemForPlayer(sourcePlayer, ib, me.fromNoob);
|
||||
buy = Item.createItemForPlayer(sourcePlayer, ib);
|
||||
if (buy != null) {
|
||||
me.transferEnchants(buy);
|
||||
itemMan.addItemToInventory(buy);
|
||||
@@ -1584,7 +1560,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void handleResourcePurchase(MobEquipment me, CharacterItemManager itemMan, PlayerCharacter sourcePlayer, ItemBase ib){
|
||||
public static void handleResourcePurchase(MobEquipment me, CharacterItemManager itemMan, NPC npc, Item buy, PlayerCharacter sourcePlayer, ItemBase ib){
|
||||
boolean stacked = false;
|
||||
int buystack = Warehouse.getSellStackSize(me.getItemBase().getUUID());
|
||||
for(Item item : itemMan.getInventory()){
|
||||
@@ -1604,7 +1580,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
}
|
||||
}
|
||||
if(!stacked){
|
||||
Item buy = Item.createItemForPlayer(sourcePlayer, ib, false);
|
||||
buy = Item.createItemForPlayer(sourcePlayer, ib);
|
||||
if (buy != null) {
|
||||
me.transferEnchants(buy);
|
||||
itemMan.addItemToInventory(buy);
|
||||
@@ -1614,7 +1590,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
}
|
||||
itemMan.updateInventory();
|
||||
}
|
||||
|
||||
private static void Repair(RepairMsg msg, ClientConnection origin) {
|
||||
|
||||
PlayerCharacter player = SessionManager.getPlayerCharacter(origin);
|
||||
@@ -1657,8 +1632,8 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (toRepair == null)
|
||||
return;
|
||||
|
||||
if (toRepair.getItemBase().isGlass())
|
||||
return;
|
||||
//if (toRepair.getItemBase().isGlass())
|
||||
// return;
|
||||
|
||||
//make sure item is in player's inventory or equipment
|
||||
if (!itemMan.inventoryContains(toRepair) && !itemMan.equippedContains(toRepair))
|
||||
@@ -1672,24 +1647,20 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
max *= (1 + (durMod * 0.01f));
|
||||
if (dur >= max || dur < 1) {
|
||||
//redundancy message to clear item from window in client
|
||||
if (!DbManager.ItemQueries.SET_DURABILITY(toRepair, dur))
|
||||
return;
|
||||
toRepair.setDurabilityCurrent(max);
|
||||
msg.setupRepairAck(max - dur);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
return;
|
||||
}
|
||||
//TODO get cost to repair
|
||||
int cost = (int) ((max - dur) * 80.1);
|
||||
|
||||
int cost = ((int)((toRepair.getMagicValue()/max*(max - dur)) + (npc.getSpecialPrice() * npc.buyPercent))) + (int)(npc.getSpecialPrice() * (max - dur));
|
||||
//glass costs 3x as much to repair
|
||||
if (toRepair.getItemBase().isGlass()){
|
||||
cost *= 3;
|
||||
}
|
||||
|
||||
//int pointsToRepair = max - dur;
|
||||
//int magicValue = toRepair.getMagicValue();
|
||||
//if(magicValue == 0)
|
||||
// magicValue = 1;
|
||||
//int calculatedValue = toRepair.getDurabilityMax() * magicValue;
|
||||
//float costPerPoint = (magicValue / max) * ( 1 + npc.buyPercent);
|
||||
//cost = (int)(pointsToRepair * costPerPoint) + npc.getSpecialPrice();
|
||||
Building b = (!npc.isStatic()) ? npc.getBuilding() : null;
|
||||
|
||||
if (b != null)
|
||||
@@ -1924,9 +1895,22 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
break;
|
||||
case LEAVEREQUEST:
|
||||
origin.disconnect();
|
||||
ArrayList<PlayerCharacter> sameMachine = new ArrayList<>();
|
||||
for (PlayerCharacter pc : SessionManager.getAllActivePlayers()) {
|
||||
if(origin.machineID.equals(pc.getClientConnection().machineID))
|
||||
sameMachine.add(pc);
|
||||
}
|
||||
if(sameMachine.isEmpty() == false){
|
||||
if(sameMachine.get(0) != null) {
|
||||
sameMachine.get(0).isBoxed = false;
|
||||
sameMachine.get(0).removeEffectBySource(EffectSourceType.DeathShroud,41,true);
|
||||
ChatManager.chatSystemInfo(sameMachine.get(0), "You Are No Longer Flagged 'Boxed'");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case POWER:
|
||||
PowersManager.usePower((PerformActionMsg) msg, origin, false);
|
||||
//PowersManager.static_power_que.add(new PowersManager.PowerQueObject((PerformActionMsg) msg, origin, false));
|
||||
break;
|
||||
case REQUESTMELEEATTACK:
|
||||
CombatManager.setAttackTarget((AttackCmdMsg) msg, origin);
|
||||
|
||||
@@ -57,6 +57,21 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
if (contract.canSlotinBuilding(building))
|
||||
ItemLists.add(hirelings);
|
||||
|
||||
if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)){
|
||||
if(contract.getContractID() == 899)//alchemist
|
||||
ItemLists.add(hirelings);
|
||||
|
||||
if(contract.getContractID() == 866)//banker
|
||||
ItemLists.add(hirelings);
|
||||
|
||||
if(contract.getContractID() == 865)//siege engineer
|
||||
ItemLists.add(hirelings);
|
||||
}
|
||||
if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SIEGETENT)){
|
||||
if(contract.getContractID() == 865)//siege engineer
|
||||
ItemLists.add(hirelings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,13 +93,20 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (building.getBlueprint().getMaxSlots() == building.getHirelings().size())
|
||||
if (building.getBlueprint().getSlotsForRank(building.getRank()) == building.getHirelings().size())
|
||||
return false;
|
||||
|
||||
Item contractItem = Item.getFromCache(msg.getContractItem());
|
||||
|
||||
if (contractItem == null)
|
||||
return false;
|
||||
if (msg.getContractItem() == 850) {//runemaster
|
||||
for (AbstractCharacter abs : building.getHirelings().keySet()) {
|
||||
NPC npc = (NPC) abs;
|
||||
if (npc.contract.getContractID() == 850)
|
||||
return false; //can only have 1 runemaster
|
||||
}
|
||||
}
|
||||
|
||||
if (!player.getCharItemManager().doesCharOwnThisItem(contractItem.getObjectUUID())) {
|
||||
Logger.error(player.getName() + "has attempted to place Hireling : " + contractItem.getName() + "without a valid contract!");
|
||||
@@ -104,10 +126,33 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
|
||||
// Check if contract can be slotted in this building
|
||||
//Logger.error("inserting contract: " + contract.getContractID());
|
||||
if (contract.canSlotinBuilding(building) == false) {
|
||||
boolean override = false;
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) {
|
||||
if (contract.getContractID() == 899)//alchemist
|
||||
override = true;
|
||||
|
||||
if (contract.canSlotinBuilding(building) == false)
|
||||
return false;
|
||||
if (contract.getContractID() == 866)//banker
|
||||
override = true;
|
||||
|
||||
if (contract.getContractID() == 865)//siege engineer
|
||||
override = true;
|
||||
}
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SIEGETENT)) {
|
||||
if (contract.getContractID() == 865)//siege engineer
|
||||
override = true;
|
||||
}
|
||||
if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SIEGETENT)){
|
||||
if(contract.getContractID() == 865)//siege engineer
|
||||
override = true;
|
||||
}
|
||||
if(override == false) {
|
||||
Logger.error("failed at override with contract: " + contract.getContractID());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Logger.error("override successful: " + contract.getContractID());
|
||||
if (!BuildingManager.addHireling(building, player, zone, contract, contractItem))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
|
||||
GroupManager.RefreshOthersGroupList(player);
|
||||
}
|
||||
|
||||
player.setEnteredWorld(true);
|
||||
player.enteredWorld = true;
|
||||
// Set player active
|
||||
player.resetRegenUpdateTime();
|
||||
player.setActive(true);
|
||||
@@ -66,6 +66,9 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
|
||||
// Send Guild, Nation and IC MOTD
|
||||
GuildManager.enterWorldMOTD(player);
|
||||
ChatManager.sendSystemMessage(player, ConfigManager.MB_WORLD_GREETING.getValue());
|
||||
ChatManager.sendSystemMessage(player, "Gold Drop Rate: " + ConfigManager.MB_NORMAL_GOLD_RATE.getValue());
|
||||
ChatManager.sendSystemMessage(player, "Loot Drop Rate: " + ConfigManager.MB_NORMAL_DROP_RATE.getValue());
|
||||
ChatManager.sendSystemMessage(player, "Experience Rate: " + ConfigManager.MB_NORMAL_EXP_RATE.getValue());
|
||||
|
||||
// Send branch string if available from ConfigManager.
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import engine.objects.GuildStatusController;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.objects.Resource;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
/*
|
||||
* @Author:
|
||||
@@ -36,28 +35,26 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
|
||||
|
||||
//TODO verify this against the warehouse?
|
||||
|
||||
if (!GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus())) // is this only GL?
|
||||
if (GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus()) == false) // is this only GL?
|
||||
return true;
|
||||
|
||||
Mine mine = Mine.getMine(changeProductionMsg.getMineID());
|
||||
|
||||
if (mine == null) {
|
||||
Logger.error("Player Character: " + playerCharacter.getName() + " Tried To Change Mine: " + changeProductionMsg.getMineID() + " and Mine was Null");
|
||||
if (mine == null)
|
||||
return true;
|
||||
}
|
||||
|
||||
//make sure mine belongs to guild
|
||||
|
||||
if (mine.getOwningGuild().isEmptyGuild() || mine.getOwningGuild().getObjectUUID() != playerCharacter.getGuild().getObjectUUID())
|
||||
if (mine.getOwningGuild().isEmptyGuild() ||
|
||||
mine.getOwningGuild().getObjectUUID() != playerCharacter.getGuild().getObjectUUID())
|
||||
return true;
|
||||
|
||||
//make sure valid resource
|
||||
|
||||
Resource resource = Resource.resourceByHash.get(changeProductionMsg.getResourceHash());
|
||||
|
||||
if (resource == null) {
|
||||
Logger.error("Player Character: " + playerCharacter.getName() + " Tried To Change Mine: " + changeProductionMsg.getMineID() + " and Resource was Null");
|
||||
if (resource == null)
|
||||
return true;
|
||||
}
|
||||
|
||||
//update resource
|
||||
|
||||
|
||||
@@ -14,18 +14,17 @@ import engine.Enum.GuildHistoryType;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.net.client.msg.group.GroupUpdateMsg;
|
||||
import engine.net.client.msg.guild.BanishUnbanishMsg;
|
||||
import engine.net.client.msg.guild.GuildListMsg;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.GuildHistory;
|
||||
import engine.objects.GuildStatusController;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.objects.*;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
public class BanishUnbanishHandler extends AbstractClientMsgHandler {
|
||||
@@ -116,6 +115,20 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
|
||||
GuildListMsg guildListMsg = new GuildListMsg(guild);
|
||||
dispatch = Dispatch.borrow(source, guildListMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
if(GroupManager.getGroup(target) != null) {
|
||||
Group group = GroupManager.getGroup(target);
|
||||
group.removeGroupMember(PlayerCharacter.getPlayerCharacter(target));
|
||||
GroupManager.removeFromGroups(PlayerCharacter.getPlayerCharacter(target));
|
||||
GroupUpdateMsg gim;
|
||||
gim = new GroupUpdateMsg();
|
||||
gim.setGroup(group);
|
||||
gim.setMessageType(3);
|
||||
gim.setPlayer(PlayerCharacter.getPlayerCharacter(target));
|
||||
group.sendUpdate(gim);
|
||||
|
||||
String text = PlayerCharacter.getPlayerCharacter(target).getFirstName() + " has left your group.";
|
||||
ChatManager.chatGroupInfo(source, text);
|
||||
}
|
||||
} else {
|
||||
ErrorPopupMsg.sendErrorPopup(source, 103); // You may not banish this char
|
||||
}
|
||||
|
||||
@@ -47,16 +47,13 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
||||
if (pc.region != null && !pc.region.isOutside())
|
||||
return false;
|
||||
|
||||
|
||||
// Find out if we already have an altitude timer running and if so
|
||||
// do not process more alt change requests
|
||||
|
||||
pc.updateFlight();
|
||||
|
||||
if (pc.getTakeOffTime() != 0)
|
||||
return false;
|
||||
|
||||
pc.setTakeOffTime(System.currentTimeMillis());
|
||||
|
||||
|
||||
// remove all movement timers and jobs
|
||||
//TODO: test if they can fly
|
||||
@@ -70,7 +67,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
||||
if (pc.getAltitude() == 0 && !msg.up())
|
||||
return true;
|
||||
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
pc.stopMovement(pc.getLoc());
|
||||
msg.setStartAlt(pc.getAltitude());
|
||||
if (msg.up()) {
|
||||
@@ -135,7 +132,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
if (msg.up()) {
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
pc.setDesiredAltitude(targetAlt);
|
||||
pc.setTakeOffTime(System.currentTimeMillis());
|
||||
} else {
|
||||
@@ -161,7 +158,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
||||
} else
|
||||
pc.setDesiredAltitude(targetAlt);
|
||||
|
||||
pc.update(false);
|
||||
pc.update();
|
||||
|
||||
|
||||
pc.setTakeOffTime(System.currentTimeMillis());
|
||||
|
||||
@@ -61,15 +61,6 @@ public class CityDataHandler extends AbstractClientMsgHandler {
|
||||
dispatch = Dispatch.borrow(playerCharacter, cityDataMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
|
||||
// If the hotZone has changed then update the client's map accordingly.
|
||||
|
||||
if (playerCharacter.getTimestamps().containsKey("hotzoneupdate") && playerCharacter.getTimeStamp("hotzoneupdate") <= ZoneManager.hotZoneLastUpdate.toEpochMilli() && ZoneManager.hotZone != null) {
|
||||
HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID());
|
||||
dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100);
|
||||
}
|
||||
|
||||
// Serialize the realms for this map
|
||||
|
||||
WorldRealmMsg worldRealmMsg = new WorldRealmMsg();
|
||||
|
||||
@@ -62,7 +62,7 @@ public class DestroyBuildingHandler extends AbstractClientMsgHandler {
|
||||
if (city != null)
|
||||
bane = city.getBane();
|
||||
|
||||
if (bane != null){// && bane.getSiegePhase() == Enum.SiegePhase.WAR) {
|
||||
if (bane != null) {
|
||||
ErrorPopupMsg.sendErrorPopup(pc, 171);
|
||||
return true;
|
||||
}
|
||||
@@ -71,9 +71,12 @@ public class DestroyBuildingHandler extends AbstractClientMsgHandler {
|
||||
if (blueprint.getBuildingGroup() == BuildingGroup.TOL)
|
||||
return true;
|
||||
|
||||
// Can't destroy a shrine
|
||||
if (blueprint.getBuildingGroup() == BuildingGroup.SHRINE)
|
||||
// destorying a shrine will yield a rubble pile for looting
|
||||
if (blueprint.getBuildingGroup() == BuildingGroup.SHRINE) {
|
||||
building.modifyHealth(-building.getHealth(), origin.getPlayerCharacter());
|
||||
building.destroyOrDerank(origin.getPlayerCharacter());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Cannot destroy mines outside of normal mine mechanics
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.net.client.msg.group.GroupInviteMsg;
|
||||
import engine.net.client.msg.group.GroupUpdateMsg;
|
||||
import engine.objects.Group;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
public class GroupInviteHandler extends AbstractClientMsgHandler {
|
||||
@@ -103,6 +104,12 @@ public class GroupInviteHandler extends AbstractClientMsgHandler {
|
||||
if (target.isIgnoringPlayer(source))
|
||||
return false;
|
||||
|
||||
if(source.getGuild().getNation().equals(target.getGuild().getNation()) == false)
|
||||
return false; // cannot group outside of nation
|
||||
|
||||
if(source.getGuild().getNation().equals(target.getGuild().getNation()) && source.getGuild().getNation().equals(Guild.getErrantGuild()))
|
||||
if(source.getGuild().equals(target.getGuild()) == false)
|
||||
return false; // cannot group as an errant guild with other errant guilds
|
||||
|
||||
// dont block invites to people already in a group and
|
||||
// dont check for pending invites, the client does it
|
||||
|
||||
@@ -102,7 +102,7 @@ public class GroupInviteResponseHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Run Keyclone Audit
|
||||
|
||||
//KEYCLONEAUDIT.audit(player, group);
|
||||
KEYCLONEAUDIT.audit(player, group);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class HirelingServiceMsgHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
|
||||
|
||||
npc.setSpecialPrice(msg.repairCost);
|
||||
npc.setRepairCost(msg.repairCost);
|
||||
ManageNPCMsg outMsg = new ManageNPCMsg(npc);
|
||||
Dispatch dispatch = Dispatch.borrow(player, msg);
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ import engine.objects.Guild;
|
||||
import engine.objects.GuildStatusController;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
import static engine.objects.Bane.getBaneByAttackerGuild;
|
||||
|
||||
public class InviteToSubHandler extends AbstractClientMsgHandler {
|
||||
|
||||
public InviteToSubHandler() {
|
||||
@@ -95,6 +97,25 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
||||
if (sourceGuild.equals(targetGuild))
|
||||
return true;
|
||||
|
||||
if(sourceGuild.getNation().getOwnedCity().getBane() != null)
|
||||
return true; // cannot invite guilds to sub if you are baned
|
||||
|
||||
if(sourceGuild.getNation().getSubGuildList() != null){
|
||||
for(Guild subGuild : sourceGuild.getNation().getSubGuildList()){
|
||||
if(subGuild.getOwnedCity() != null)
|
||||
if(subGuild.getOwnedCity().getBane() != null)
|
||||
return true;//cannot invite guilds to sub if any tree in your nation has a bane on it
|
||||
}
|
||||
}
|
||||
|
||||
if(targetGuild.getOwnedCity() != null)
|
||||
if(targetGuild.getOwnedCity().getBane() != null)
|
||||
return true; // cannot be subbed if you have a bane placed on you
|
||||
|
||||
|
||||
if(getBaneByAttackerGuild(targetGuild) != null)
|
||||
return true; // cannot sub to a nation if they have a bane placed
|
||||
|
||||
//target must be GL or IC
|
||||
|
||||
if (GuildStatusController.isInnerCouncil(target.getGuildStatus()) == false && GuildStatusController.isGuildLeader(target.getGuildStatus()) == false) {
|
||||
|
||||
@@ -360,11 +360,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
targetItem.recycle(vendor);
|
||||
vendor.removeItemFromForge(targetItem);
|
||||
|
||||
//refund the gold for cancelled item
|
||||
if(vendor.building.getStrongboxValue() + targetItem.getItemBase().getBaseValue() < 15000000){
|
||||
vendor.building.setStrongboxValue(vendor.building.getStrongboxValue() + targetItem.getItemBase().getBaseValue());
|
||||
}
|
||||
|
||||
// Refresh vendor's inventory to client
|
||||
|
||||
outMsg = new ManageNPCMsg(vendor);
|
||||
|
||||
@@ -12,16 +12,15 @@ package engine.net.client.handlers;
|
||||
import engine.Enum.GuildHistoryType;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.net.client.msg.group.GroupUpdateMsg;
|
||||
import engine.net.client.msg.guild.LeaveGuildMsg;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.GuildStatusController;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.objects.*;
|
||||
|
||||
public class LeaveGuildHandler extends AbstractClientMsgHandler {
|
||||
|
||||
@@ -61,6 +60,21 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(GroupManager.getGroup(playerCharacter) != null) {
|
||||
Group group = GroupManager.getGroup(playerCharacter);
|
||||
group.removeGroupMember(playerCharacter);
|
||||
GroupManager.removeFromGroups(playerCharacter);
|
||||
GroupUpdateMsg gim;
|
||||
gim = new GroupUpdateMsg();
|
||||
gim.setGroup(group);
|
||||
gim.setMessageType(3);
|
||||
gim.setPlayer(playerCharacter);
|
||||
group.sendUpdate(gim);
|
||||
|
||||
String text = playerCharacter.getFirstName() + " has left your group.";
|
||||
ChatManager.chatGroupInfo(playerCharacter, text);
|
||||
}
|
||||
|
||||
// Send left guild message to rest of guild
|
||||
ChatManager.chatGuildInfo(oldGuild, playerCharacter.getFirstName() + " has left the guild.");
|
||||
|
||||
|
||||
@@ -62,23 +62,16 @@ public class MOTDEditHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == 1) { // Guild MOTD
|
||||
if (type == 1) // Guild MOTD
|
||||
msg.setMessage(guild.getMOTD());
|
||||
guild.updateDatabase();
|
||||
}else if (type == 3) { // IC MOTD
|
||||
else if (type == 3) // IC MOTD
|
||||
msg.setMessage(guild.getICMOTD());
|
||||
guild.updateDatabase();
|
||||
}else if (type == 0) { // Nation MOTD
|
||||
else if (type == 0) { // Nation MOTD
|
||||
Guild nation = guild.getNation();
|
||||
if (nation == null || !nation.isNation()) {
|
||||
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You do not have such authority!");
|
||||
return true;
|
||||
}
|
||||
nation.setNMOTD(msg.getMessage());
|
||||
nation.updateDatabase();
|
||||
for(Guild sub : nation.getSubGuildList()){
|
||||
sub.setNMOTD(nation.getNMOTD());
|
||||
}
|
||||
msg.setMessage(nation.getMOTD());
|
||||
}
|
||||
dispatch = Dispatch.borrow(playerCharacter, msg);
|
||||
|
||||
@@ -5,6 +5,7 @@ import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Bounds;
|
||||
@@ -62,7 +63,6 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
Building building;
|
||||
|
||||
msg = (ManageCityAssetsMsg) baseMsg;
|
||||
|
||||
player = SessionManager.getPlayerCharacter(origin);
|
||||
|
||||
if (player == null)
|
||||
@@ -72,34 +72,21 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
if (building == null) {
|
||||
if (msg.actionType == 14) {
|
||||
|
||||
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
|
||||
|
||||
if (!zone.isPlayerCity()) {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
||||
return true;
|
||||
}
|
||||
|
||||
City city = City.GetCityFromCache(zone.getPlayerCityUUID());
|
||||
|
||||
if (city == null) {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!city.getGuild().equals(player.getGuild())) {
|
||||
if (city == null || !city.getGuild().equals(player.getGuild()) ||
|
||||
(!GuildStatusController.isInnerCouncil(player.getGuildStatus()) &&
|
||||
!GuildStatusController.isGuildLeader(player.getGuildStatus()))) {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "You are not in the correct guild to command this city.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!GuildStatusController.isInnerCouncil(player.getGuildStatus()) && !GuildStatusController.isGuildLeader(player.getGuildStatus())) {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "You must be an Inner Council or Guild leader to access city commands.");
|
||||
return true;
|
||||
}
|
||||
ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building);
|
||||
mca.actionType = 15;
|
||||
Dispatch dispatch = Dispatch.borrow(player, mca);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, mca), DispatchChannel.SECONDARY);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -111,181 +98,126 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setAssetName(building.getName());
|
||||
Dispatch dispatch = Dispatch.borrow(player, outMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, outMsg), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (msg.actionType == 2 || msg.actionType == 22) {
|
||||
|
||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() == engine.Enum.BuildingGroup.BANESTONE) {
|
||||
|
||||
outMsg.actionType = 18;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
|
||||
} else if (BuildingManager.playerCanManage(player, building)) { //TODO allow Friends list.
|
||||
switch (msg.actionType) {
|
||||
case 2:
|
||||
case 22:
|
||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() == engine.Enum.BuildingGroup.BANESTONE) {
|
||||
outMsg.actionType = 18;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
} else if (BuildingManager.playerCanManage(player, building)) {
|
||||
configWindowState(player, building, outMsg);
|
||||
outMsg.actionType = 3;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setTargetType3(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID3(building.getObjectUUID());
|
||||
outMsg.setUnknown54(1);
|
||||
} else {
|
||||
// Handle other cases
|
||||
if (building.getRank() == -1) {
|
||||
if (!Bounds.collide(player.getLoc(), building)) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 64);
|
||||
return true;
|
||||
}
|
||||
switch (building.getBlueprint().getBuildingGroup()) {
|
||||
case SHRINE:
|
||||
Shrine shrine = Shrine.shrinesByBuildingUUID.get(building.getObjectUUID());
|
||||
if (shrine == null || shrine.getFavors() == 0) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 166); // There is no more favor in this shrine to loot
|
||||
return true;
|
||||
}
|
||||
//loot elan stones
|
||||
MobLoot elanStones = new MobLoot(player,ItemBase.getItemBase(1705032),1,false);
|
||||
Item promotedItem = elanStones.promoteToItem(player);
|
||||
promotedItem.setNumOfItems(shrine.getFavors());
|
||||
player.getCharItemManager().addItemToInventory(promotedItem);
|
||||
DbManager.ItemQueries.UPDATE_NUM_ITEMS(promotedItem,promotedItem.getNumOfItems());
|
||||
player.getCharItemManager().updateInventory();
|
||||
shrine.setFavors(0);
|
||||
break;
|
||||
case WAREHOUSE:
|
||||
Warehouse warehouse = Warehouse.warehouseByBuildingUUID.get(building.getObjectUUID());
|
||||
if (warehouse == null || warehouse.isEmpty()) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 167); // no more resources.
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
AbstractCharacter owner = building.getOwner();
|
||||
if (owner == null) {
|
||||
msg.actionType = 4;
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, msg), DispatchChannel.SECONDARY);
|
||||
} else {
|
||||
outMsg.actionType = 4;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setAssetName(building.getName());
|
||||
}
|
||||
}
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, outMsg), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
case 13:
|
||||
outMsg.actionType = 13;
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, outMsg), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
case 5:
|
||||
building.setName(msg.getAssetName());
|
||||
configWindowState(player, building, outMsg);
|
||||
outMsg.actionType = 3;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setTargetType3(building.getObjectType().ordinal());
|
||||
outMsg.setTargetType3(GameObjectType.Building.ordinal());
|
||||
outMsg.setTargetID3(building.getObjectUUID());
|
||||
outMsg.setAssetName1(building.getName());
|
||||
outMsg.setUnknown54(1);
|
||||
|
||||
} else {
|
||||
|
||||
if (building.getBlueprintUUID() != 0)
|
||||
switch (building.getBlueprint().getBuildingGroup()) {
|
||||
case SHRINE:
|
||||
if (building.getRank() == -1) {
|
||||
if (!Bounds.collide(player.getLoc(), building)) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 64);
|
||||
return true;
|
||||
}
|
||||
|
||||
Shrine shrine = Shrine.shrinesByBuildingUUID.get(building.getObjectUUID());
|
||||
|
||||
if (shrine == null)
|
||||
return true;
|
||||
|
||||
if (shrine.getFavors() == 0) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 166); // There is no more favor in this shrine to loot
|
||||
return true;
|
||||
}
|
||||
|
||||
BuildingManager.lootBuilding(player, building);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WAREHOUSE:
|
||||
//TODO check
|
||||
if (building.getRank() == -1) {
|
||||
if (!Bounds.collide(player.getLoc(), building)) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 64);
|
||||
return true;
|
||||
}
|
||||
|
||||
Warehouse warehouse = Warehouse.warehouseByBuildingUUID.get(building.getObjectUUID());
|
||||
|
||||
if (warehouse == null)
|
||||
return true;
|
||||
|
||||
if (warehouse.isEmpty()) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 167); // no more resources.
|
||||
return true;
|
||||
}
|
||||
|
||||
BuildingManager.lootBuilding(player, building);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (building.getRank() == -1)
|
||||
return true;
|
||||
|
||||
AbstractCharacter owner = building.getOwner();
|
||||
|
||||
//no owner, send building info
|
||||
if (owner == null) {
|
||||
msg.actionType = 4;
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
outMsg.actionType = 4;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setAssetName(building.getName());
|
||||
|
||||
}
|
||||
Dispatch dispatch = Dispatch.borrow(player, outMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (msg.actionType == 13) {
|
||||
outMsg.actionType = 13;
|
||||
Dispatch dispatch = Dispatch.borrow(player, outMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//Rename Building.
|
||||
|
||||
if (msg.actionType == 5) {
|
||||
|
||||
//TODO we need to check names before allowing
|
||||
building.setName(msg.getAssetName());
|
||||
configWindowState(player, building, outMsg);
|
||||
|
||||
outMsg.actionType = 3;
|
||||
outMsg.setTargetType(building.getObjectType().ordinal());
|
||||
outMsg.setTargetID(building.getObjectUUID());
|
||||
outMsg.setTargetType3(GameObjectType.Building.ordinal());
|
||||
outMsg.setTargetID3(building.getObjectUUID());
|
||||
outMsg.setAssetName1(building.getName());
|
||||
outMsg.setUnknown54(1);
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(player, outMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
|
||||
return true;
|
||||
|
||||
//TOL, update city name also
|
||||
//TODO update city and zone in database
|
||||
//TODO update city map data in game server
|
||||
}
|
||||
|
||||
if (msg.actionType == 14) {
|
||||
ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building);
|
||||
mca.actionType = 15;
|
||||
Dispatch dispatch = Dispatch.borrow(player, mca);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (msg.actionType == 20) {
|
||||
|
||||
Zone baneZone = building.getParentZone();
|
||||
|
||||
if (baneZone == null)
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, outMsg), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
|
||||
City banedCity = City.getCity(baneZone.getPlayerCityUUID());
|
||||
|
||||
if (banedCity == null)
|
||||
case 14:
|
||||
ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building);
|
||||
mca.actionType = 15;
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, mca), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
|
||||
Bane bane = banedCity.getBane();
|
||||
|
||||
if (bane == null || bane.getLiveDate() != null || player.getGuild() != banedCity.getGuild() || GuildStatusController.isInnerCouncil(player.getGuildStatus()) == false)
|
||||
case 20:
|
||||
// Handle case 20
|
||||
return handleCase20(player, outMsg, building, msg, origin);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int baneHour = msg.getBaneHour();
|
||||
|
||||
if (baneHour < 16 || baneHour > 24) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "A Serious error has occurred. Please post details for to ensure transaction integrity");
|
||||
return true;
|
||||
}
|
||||
|
||||
DateTime baneLive = new DateTime(bane.getPlacementDate());
|
||||
baneLive = baneHour == 24 ? baneLive.plusDays(3) : baneLive.plusDays(2);
|
||||
baneLive = baneHour == 24 ? baneLive.hourOfDay().setCopy(0) : baneLive.hourOfDay().setCopy(baneHour);
|
||||
baneLive = baneLive.minuteOfHour().setCopy(0);
|
||||
baneLive = baneLive.secondOfMinute().setCopy(1);
|
||||
bane.setLiveDate(baneLive);
|
||||
outMsg.actionType = 18;
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(player, outMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
private boolean handleCase20(PlayerCharacter player, ManageCityAssetsMsg outMsg, Building building, ManageCityAssetsMsg msg, ClientConnection origin) throws MsgSendException {
|
||||
Zone baneZone = building.getParentZone();
|
||||
if (baneZone == null)
|
||||
return true;
|
||||
City banedCity = City.getCity(baneZone.getPlayerCityUUID());
|
||||
if (banedCity == null)
|
||||
return true;
|
||||
Bane bane = banedCity.getBane();
|
||||
if (bane == null || bane.getLiveDate() != null || player.getGuild() != banedCity.getGuild() || !GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||
return true;
|
||||
int baneHour = msg.getBaneHour();
|
||||
if (baneHour < 16 || baneHour > 24) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "A Serious error has occurred. Please post details for to ensure transaction integrity");
|
||||
return true;
|
||||
}
|
||||
DateTime baneLive = new DateTime(bane.getPlacementDate());
|
||||
baneLive = baneHour == 24 ? baneLive.plusDays(3) : baneLive.plusDays(2);
|
||||
baneLive = baneHour == 24 ? baneLive.hourOfDay().setCopy(0) : baneLive.hourOfDay().setCopy(baneHour);
|
||||
baneLive = baneLive.minuteOfHour().setCopy(0);
|
||||
baneLive = baneLive.secondOfMinute().setCopy(1);
|
||||
bane.setLiveDate(baneLive);
|
||||
outMsg.actionType = 18;
|
||||
DispatchMessage.dispatchMsgDispatch(Dispatch.borrow(player, outMsg), DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void configWindowState(PlayerCharacter player, Building building, ManageCityAssetsMsg manageCityAssetsMsg) {
|
||||
|
||||
// Tests to turn on upgrade button if a building is not
|
||||
@@ -294,7 +226,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Owner is obviously allowed to upgrade his own buildings
|
||||
|
||||
if (building.getOwner().equals(player)) {
|
||||
if (building.getOwner() != null && building.getOwner().equals(player)) {
|
||||
|
||||
// Players cannot destroy or transfer a TOL.
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import engine.powers.PowersBase;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
/*
|
||||
* @Author:
|
||||
@@ -106,7 +105,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Validate player can obtain blessing
|
||||
|
||||
if (!GuildStatusController.isGuildLeader(player.getGuildStatus())) {
|
||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 173); // You must be the leader of a guild to receive a blessing
|
||||
return;
|
||||
}
|
||||
@@ -127,12 +126,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
realm = RealmMap.getRealmForCity(city);
|
||||
|
||||
if (!realm.getCanBeClaimed()) {
|
||||
if (realm.getCanBeClaimed() == false) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 180); // This territory cannot be ruled by anyone
|
||||
return;
|
||||
}
|
||||
|
||||
if (realm.isRuled()) {
|
||||
if (realm.isRuled() == true) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, 178); // This territory is already claimed
|
||||
return;
|
||||
}
|
||||
@@ -143,12 +142,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
}
|
||||
|
||||
private static void requestBoon(PlayerCharacter player, NPC npc) {
|
||||
private static void requestBoon(MerchantMsg msg, ClientConnection origin, PlayerCharacter player, NPC npc) {
|
||||
|
||||
Building shrineBuilding;
|
||||
Shrine shrine;
|
||||
|
||||
if (!npc.getGuild().getNation().equals(player.getGuild().getNation()))
|
||||
if (npc.getGuild().getNation() != player.getGuild().getNation())
|
||||
return;
|
||||
|
||||
shrineBuilding = npc.getBuilding();
|
||||
@@ -156,7 +155,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
if (shrineBuilding == null)
|
||||
return;
|
||||
|
||||
if (shrineBuilding.getBlueprint() != null && !shrineBuilding.getBlueprint().getBuildingGroup().equals(engine.Enum.BuildingGroup.SHRINE))
|
||||
if (shrineBuilding.getBlueprint() != null && shrineBuilding.getBlueprint().getBuildingGroup() != engine.Enum.BuildingGroup.SHRINE)
|
||||
return;
|
||||
|
||||
if (shrineBuilding.getRank() == -1)
|
||||
@@ -172,10 +171,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.containsEffect(shrine.getShrineType().getPowerToken())) {
|
||||
//remove old boon to apply new one, allows boon refreshing
|
||||
player.effects.remove(PowersManager.getPowerByToken(shrine.getShrineType().getPowerToken()).name);
|
||||
}
|
||||
//already haz boon.
|
||||
|
||||
//if (player.containsEffect(shrine.getShrineType().getPowerToken())) {
|
||||
// ErrorPopupMsg.sendErrorPopup(player, 199);
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (!Shrine.canTakeFavor(player, shrine))
|
||||
return;
|
||||
@@ -190,31 +191,14 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
int trains = 0;
|
||||
switch(npc.getRank()){
|
||||
case 1:
|
||||
trains = 10;
|
||||
break;
|
||||
case 2:
|
||||
trains = 15;
|
||||
break;
|
||||
case 3:
|
||||
trains = 20;
|
||||
break;
|
||||
case 4:
|
||||
trains = 25;
|
||||
break;
|
||||
case 5:
|
||||
trains = 30;
|
||||
break;
|
||||
case 6:
|
||||
trains = 35;
|
||||
break;
|
||||
case 7:
|
||||
trains = 40;
|
||||
break;
|
||||
}
|
||||
if(shrinePower.getName().equals("Boon: Nephilim"))
|
||||
shrinePower.name = "Boon: Chaos";
|
||||
|
||||
int trains = 5 * npc.getRank() + 5;//40 - (rank * 10);
|
||||
if (trains < 0)
|
||||
trains = 0;
|
||||
|
||||
//System.out.println(trains);
|
||||
PowersManager.applyPower(player, player, player.getLoc(), shrinePower.getToken(), trains, false);
|
||||
ChatManager.chatGuildInfo(player.getGuild(), player.getName() + " has recieved a boon costing " + 1 + " point of favor.");
|
||||
shrineBuilding.addEffectBit(1000000 << 2);
|
||||
@@ -274,85 +258,60 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (targetCity == null){
|
||||
Mine mineTele = null;
|
||||
for(Mine mine : Mine.getMinesToTeleportTo(player)){
|
||||
if(mine.getObjectUUID() == msg.getCityID()){
|
||||
mineTele = mine;
|
||||
}
|
||||
}
|
||||
if(mineTele == null){
|
||||
if (targetCity == null)
|
||||
return;
|
||||
|
||||
//verify level required to teleport or repledge
|
||||
|
||||
Guild toGuild = targetCity.getGuild();
|
||||
|
||||
if (toGuild != null)
|
||||
if (isTeleport) {
|
||||
if (player.getLevel() < toGuild.getTeleportMin() || player.getLevel() > toGuild.getTeleportMax())
|
||||
return;
|
||||
} else if (player.getLevel() < toGuild.getRepledgeMin() || player.getLevel() > toGuild.getRepledgeMax())
|
||||
return;
|
||||
}else {
|
||||
int time = MBServerStatics.TELEPORT_TIME_IN_SECONDS;
|
||||
msg.setTeleportTime(time);
|
||||
Building tower = Mine.getTower(mineTele);
|
||||
if (tower == null)
|
||||
return;
|
||||
Vector3fImmutable teleportLoc = Vector3fImmutable.getRandomPointOnCircle(tower.getLoc(), 10);
|
||||
ChatManager.chatSystemInfo(player, "You Will Teleport To " + mineTele.getParentZone().getParent().getName() + "'s Mine In " + time + " Seconds.");
|
||||
if (time > 0) {
|
||||
//TODO add timer to teleport
|
||||
TeleportJob tj = new TeleportJob(player, npc, teleportLoc, origin, true);
|
||||
JobScheduler.getInstance().scheduleJob(tj, time * 1000);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//finish porting to a city
|
||||
//verify level required to teleport or repledge
|
||||
|
||||
Guild toGuild = targetCity.getGuild();
|
||||
boolean joinedGuild = false;
|
||||
|
||||
if (toGuild != null)
|
||||
if (isTeleport) {
|
||||
if (player.getLevel() < toGuild.getTeleportMin() || player.getLevel() > toGuild.getTeleportMax())
|
||||
return;
|
||||
} else if (player.getLevel() < toGuild.getRepledgeMin() || player.getLevel() > toGuild.getRepledgeMax())
|
||||
return;
|
||||
//if repledge, reguild the player
|
||||
|
||||
boolean joinedGuild = false;
|
||||
if (!isTeleport)
|
||||
joinedGuild = GuildManager.joinGuild(player, targetCity.getGuild(), targetCity.getObjectUUID(), GuildHistoryType.JOIN);
|
||||
|
||||
//if repledge, reguild the player
|
||||
int time;
|
||||
|
||||
if (!isTeleport)
|
||||
joinedGuild = GuildManager.joinGuild(player, targetCity.getGuild(), targetCity.getObjectUUID(), GuildHistoryType.JOIN);
|
||||
if (!isTeleport) //repledge
|
||||
time = MBServerStatics.REPLEDGE_TIME_IN_SECONDS;
|
||||
else
|
||||
time = MBServerStatics.TELEPORT_TIME_IN_SECONDS;
|
||||
|
||||
int time;
|
||||
//resend message
|
||||
msg.setTeleportTime(time);
|
||||
|
||||
if (!isTeleport) //repledge
|
||||
time = MBServerStatics.REPLEDGE_TIME_IN_SECONDS;
|
||||
else
|
||||
time = MBServerStatics.TELEPORT_TIME_IN_SECONDS;
|
||||
if ((!isTeleport && joinedGuild) || (isTeleport)) {
|
||||
|
||||
//resend message
|
||||
msg.setTeleportTime(time);
|
||||
|
||||
if ((!isTeleport && joinedGuild) || (isTeleport)) {
|
||||
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
//teleport player to city
|
||||
|
||||
Vector3fImmutable teleportLoc;
|
||||
|
||||
if (targetCity.getTOL().getRank() == 8)
|
||||
teleportLoc = targetCity.getTOL().getStuckLocation();
|
||||
else
|
||||
teleportLoc = Vector3fImmutable.getRandomPointOnCircle(targetCity.getTOL().getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
||||
|
||||
if (time > 0) {
|
||||
//TODO add timer to teleport
|
||||
TeleportJob tj = new TeleportJob(player, npc, teleportLoc, origin, true);
|
||||
JobScheduler.getInstance().scheduleJob(tj, time * 1000);
|
||||
} else if (joinedGuild) {
|
||||
player.teleport(teleportLoc);
|
||||
player.setSafeMode();
|
||||
}
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
//teleport player to city
|
||||
|
||||
Vector3fImmutable teleportLoc;
|
||||
|
||||
if (targetCity.getTOL().getRank() == 8)
|
||||
teleportLoc = targetCity.getTOL().getStuckLocation();
|
||||
else
|
||||
teleportLoc = Vector3fImmutable.getRandomPointOnCircle(targetCity.getTOL().getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
||||
|
||||
if (time > 0) {
|
||||
//TODO add timer to teleport
|
||||
TeleportJob tj = new TeleportJob(player, npc, teleportLoc, origin, true);
|
||||
JobScheduler.getInstance().scheduleJob(tj, time * 1000);
|
||||
} else if (joinedGuild) {
|
||||
player.teleport(teleportLoc);
|
||||
player.setSafeMode();
|
||||
}
|
||||
}
|
||||
|
||||
private static PowersBase getPowerforHermit(NPC npc) {
|
||||
@@ -459,7 +418,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
if (isHermit(npc))
|
||||
requestHermitBlessing(msg, origin, player, npc);
|
||||
else
|
||||
requestBoon(player, npc);
|
||||
requestBoon(msg, origin, player, npc);
|
||||
break;
|
||||
case 15:
|
||||
LeaderboardMessage lbm = new LeaderboardMessage();
|
||||
|
||||
@@ -8,7 +8,6 @@ import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -42,7 +41,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
if (player == null)
|
||||
return true;
|
||||
|
||||
if (minionMsg.getNpcType() == Enum.GameObjectType.NPC.ordinal()) {
|
||||
|
||||
NPC npc = NPC.getFromCache(minionMsg.getNpcID());
|
||||
@@ -63,10 +61,10 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
Mob toRemove = Mob.getFromCache(minionMsg.getUUID());
|
||||
|
||||
if (!npc.getSiegeMinionMap().containsKey(toRemove))
|
||||
if (!npc.siegeMinionMap.containsKey(toRemove))
|
||||
return true;
|
||||
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
npc.siegeMinionMap.remove(toRemove);
|
||||
|
||||
WorldGrid.RemoveWorldObject(toRemove);
|
||||
|
||||
@@ -74,14 +72,18 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
toRemove.getParentZone().zoneMobSet.remove(toRemove);
|
||||
|
||||
DbManager.removeFromCache(toRemove);
|
||||
PlayerCharacter petOwner = toRemove.getOwner();
|
||||
|
||||
if (petOwner != null) {
|
||||
petOwner.setPet(null);
|
||||
toRemove.setOwner(null);
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
if(toRemove.guardCaptain.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain;
|
||||
|
||||
if (petOwner != null) {
|
||||
petOwner.setPet(null);
|
||||
|
||||
toRemove.guardCaptain = null;
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
}
|
||||
}
|
||||
|
||||
// we Found the move to remove, lets break the for loop so it doesnt look for more.
|
||||
@@ -115,7 +117,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (npc.getContractID() == 842)
|
||||
maxSlots = 1;
|
||||
|
||||
if (npc.getSiegeMinionMap().size() == maxSlots)
|
||||
if (npc.siegeMinionMap.size() == maxSlots)
|
||||
return true;
|
||||
|
||||
int mobBase;
|
||||
@@ -146,42 +148,10 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (mobBase == 0)
|
||||
return true;
|
||||
|
||||
Mob siegeMob = Mob.createSiegeMob(npc, mobBase, npc.getGuild(), zone, b.getLoc(), (short) 1);
|
||||
Mob siegeMob = Mob.createSiegeMinion(npc, mobBase);
|
||||
|
||||
if (siegeMob == null)
|
||||
return true;
|
||||
|
||||
if (siegeMob != null) {
|
||||
|
||||
siegeMob.setSpawnTime(60 * 15);
|
||||
Building building = BuildingManager.getBuilding(((MinionTrainingMessage) baseMsg).getBuildingID());
|
||||
|
||||
siegeMob.building = building;
|
||||
siegeMob.parentZone = zone;
|
||||
|
||||
// Slot siege minion
|
||||
// Can be either corner tower or bulwark.
|
||||
|
||||
int slot;
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.ARTYTOWER))
|
||||
slot = 2;
|
||||
else
|
||||
slot = ((NPC) siegeMob.npcOwner).getSiegeMinionMap().get(siegeMob) + 1; // First slot is for the captain
|
||||
|
||||
BuildingLocation slotLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot);
|
||||
siegeMob.bindLoc = building.getLoc().add(slotLocation.getLocation());
|
||||
|
||||
// Rotate slot position by the building rotation
|
||||
|
||||
siegeMob.bindLoc = Vector3fImmutable.rotateAroundPoint(building.getLoc(), siegeMob.bindLoc, building.getBounds().getQuaternion().angleY);
|
||||
|
||||
siegeMob.loc = new Vector3fImmutable(siegeMob.bindLoc);
|
||||
siegeMob.endLoc = new Vector3fImmutable(siegeMob.bindLoc);
|
||||
|
||||
zone.zoneMobSet.add(siegeMob);
|
||||
siegeMob.setLoc(siegeMob.bindLoc);
|
||||
}
|
||||
}
|
||||
|
||||
ManageNPCMsg mnm = new ManageNPCMsg(npc);
|
||||
@@ -228,11 +198,14 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
toRemove.getParentZone().zoneMobSet.remove(toRemove);
|
||||
|
||||
DbManager.removeFromCache(toRemove);
|
||||
PlayerCharacter petOwner = toRemove.getOwner();
|
||||
|
||||
|
||||
PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain;
|
||||
|
||||
if (petOwner != null) {
|
||||
petOwner.setPet(null);
|
||||
toRemove.setOwner(null);
|
||||
|
||||
toRemove.guardCaptain = null;
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
@@ -298,14 +271,14 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
String pirateName = NPCManager.getPirateName(mobBase);
|
||||
|
||||
if (!DbManager.MobQueries.ADD_TO_GUARDS(npc.getObjectUUID(), mobBase, pirateName, npc.getSiegeMinionMap().size() + 1))
|
||||
return true;
|
||||
|
||||
Mob toCreate = Mob.createGuardMob(npc, npc.getGuild(), zone, building.getLoc(), npc.getLevel(), pirateName);
|
||||
Mob toCreate = Mob.createGuardMinion(npc, npc.getLevel(), pirateName);
|
||||
|
||||
if (toCreate == null)
|
||||
return true;
|
||||
|
||||
if (!DbManager.MobQueries.ADD_TO_GUARDS(npc.getObjectUUID(), mobBase, pirateName, npc.getSiegeMinionMap().size() + 1))
|
||||
return true;
|
||||
|
||||
if (toCreate != null) {
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.parentZone.zoneMobSet.add(toCreate);
|
||||
|
||||
@@ -195,7 +195,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
hPMod = (building.getMaxHitPoints() * Realm.getRealmHealthMod(city));
|
||||
float percentOfHealth = building.getCurrentHitpoints() / building.getHealthMax();
|
||||
building.setMaxHitPoints(building.getMaxHitPoints() + hPMod);
|
||||
building.setCurrentHitPoints(building.getMaxHitPoints() * percentOfHealth);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,12 +423,33 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
break;
|
||||
//ANNIVERSERY GIFT
|
||||
case 31:
|
||||
LootManager.peddleFate(player,item);
|
||||
// *** Disabled for now: Needs bootyset created
|
||||
|
||||
//if (ib.getUUID() == 971012) {
|
||||
// int random = ThreadLocalRandom.current().nextInt(ItemBase.AnniverseryGifts.size());
|
||||
// int annyID = ItemBase.AnniverseryGifts.get(random);
|
||||
|
||||
// ItemBase annyIB = ItemBase.getItemBase(annyID);
|
||||
// if (annyIB != null) {
|
||||
// Item gift = MobLoot.createItemForPlayer(player, annyIB);
|
||||
// if (gift != null) {
|
||||
// itemMan.addItemToInventory(gift);
|
||||
// itemMan.consume(item);
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
//}
|
||||
int i = 0;
|
||||
if(i != 0) {
|
||||
LootManager.peddleFate(player, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case 30: //water bucket
|
||||
case 8: //potions, tears of saedron
|
||||
|
||||
case 5: //runes, petition, warrant, scrolls
|
||||
if (uuid > 3000 && uuid < 3050) { //Discipline Runes
|
||||
if (ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
@@ -443,12 +466,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
break;
|
||||
} else if (uuid > 252122 && uuid < 252137) { //blood runes
|
||||
if (ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
break;
|
||||
} else if (uuid > 252128 && uuid < 252128) { //mastery runes
|
||||
} else if (uuid > 252122 && uuid < 252128) { //mastery runes
|
||||
if (ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
@@ -514,6 +532,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
// Send piss bucket animation
|
||||
|
||||
VisualUpdateMessage vum = new VisualUpdateMessage(player, 16323);
|
||||
vum.configure();
|
||||
DispatchMessage.sendToAllInRange(player, vum);
|
||||
@@ -523,14 +542,16 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
PowersManager.applyPower(player, target, Vector3fImmutable.ZERO, ib.getUseID(), ib.getUseAmount(), true);
|
||||
|
||||
itemMan.consume(item);
|
||||
} else //just remove the item at this point
|
||||
} else if(ib.getUUID() > 252128 && ib.getUUID() < 252568){
|
||||
if (ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
}else //just remove the item at this point
|
||||
itemMan.consume(item);
|
||||
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
if(!item.getItemBase().getType().equals(ItemType.POTION)) {
|
||||
player.cancelOnSpell();
|
||||
}
|
||||
player.cancelOnSpell();
|
||||
break;
|
||||
default: //shouldn't be here, consume item
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
|
||||
@@ -44,6 +44,13 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
|
||||
msg = (OpenFriendsCondemnListMsg) baseMsg;
|
||||
|
||||
sourceBuilding = BuildingManager.getBuildingFromCache(msg.getBuildingID());
|
||||
|
||||
if(sourceBuilding != null && sourceBuilding.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)){
|
||||
return true;
|
||||
}
|
||||
|
||||
openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(msg);
|
||||
friendListType = Enum.FriendListType.getListTypeByID(msg.getMessageType());
|
||||
|
||||
|
||||
@@ -212,10 +212,6 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
for (AbstractCharacter guard : building.getHirelings().keySet()) {
|
||||
if (guard.getObjectType() == GameObjectType.Mob)
|
||||
((Mob) guard).setPatrolPointIndex(0);
|
||||
}
|
||||
} else if (building.getPatrolPoints() != null)
|
||||
ClearPatrolPoints(building.getObjectUUID());
|
||||
|
||||
@@ -223,10 +219,6 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
AddSentryPoints(building.getObjectUUID(), orderNpcMsg.getSentryPoints());
|
||||
} else if (building.getSentryPoints() != null)
|
||||
ClearSentryPoints(building.getObjectUUID());
|
||||
|
||||
// Dispatch dispatch = Dispatch.borrow(pc, msg);
|
||||
// DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
|
||||
}
|
||||
|
||||
private static void processUpgradeNPC(PlayerCharacter player, AbstractCharacter abstractCharacter) {
|
||||
@@ -541,7 +533,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
} else if (orderNPCMsg.getObjectType() == GameObjectType.Mob.ordinal()) {
|
||||
|
||||
mob = Mob.getFromCacheDBID(orderNPCMsg.getNpcUUID());
|
||||
mob = Mob.getMob(orderNPCMsg.getNpcUUID());
|
||||
|
||||
if (mob == null)
|
||||
return true;
|
||||
|
||||
@@ -412,6 +412,9 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
break;
|
||||
if (!playerCharacter.getCharItemManager().doesCharOwnThisItem(contract.getObjectUUID()))
|
||||
break;
|
||||
if(contract.getItemBaseID() == 1035){//saetor shrine override
|
||||
msg.getFirstPlacementInfo().setBlueprintUUID(1720000);
|
||||
}
|
||||
buildingCreated = placeShrine(playerCharacter, origin, msg);
|
||||
break;
|
||||
case BARRACK:
|
||||
@@ -800,7 +803,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
treeObject.setObjectTypeMask(MBServerStatics.MASK_BUILDING);
|
||||
treeObject.setParentZone(zoneObject);
|
||||
MaintenanceManager.setMaintDateTime(treeObject, LocalDateTime.now().plusDays(7));
|
||||
MaintenanceManager.setMaintDateTime(treeObject, LocalDateTime.now().plusDays(14));
|
||||
|
||||
// Update guild binds and tags
|
||||
//load the new city on the clients
|
||||
@@ -967,7 +970,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
// Create the shrine
|
||||
|
||||
|
||||
return createShrine((PlayerCharacter) cityObject.getTOL().getOwner(), msg.getFirstPlacementInfo(), serverZone);
|
||||
}
|
||||
|
||||
@@ -1210,7 +1213,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
private boolean createShrine(PlayerCharacter player, PlacementInfo buildingInfo, Zone currentZone) {
|
||||
|
||||
Blueprint blueprint;
|
||||
Building newMesh;
|
||||
Building newMesh = null;
|
||||
Shrine newShrine;
|
||||
City city;
|
||||
ShrineType shrineType;
|
||||
@@ -1271,7 +1274,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(blueprint.getName().equals("Nephilim Shrine ") && newMesh != null){
|
||||
newMesh.setName("Chaos Shrine");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
player.setEnteredWorld(false);
|
||||
player.enteredWorld = false;
|
||||
|
||||
Account acc = SessionManager.getAccount(origin);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import engine.Enum;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -131,15 +132,15 @@ public class TaxCityMsgHandler extends AbstractClientMsgHandler {
|
||||
TaxCityMsg msg;
|
||||
|
||||
player = origin.getPlayerCharacter();
|
||||
ChatManager.chatSystemInfo(player,"Taxing has been disabled");
|
||||
return false;
|
||||
|
||||
//msg = (TaxCityMsg) baseMsg;
|
||||
|
||||
msg = (TaxCityMsg) baseMsg;
|
||||
|
||||
//realm taxing disabled
|
||||
//ViewTaxes(msg, player);
|
||||
|
||||
|
||||
return true;
|
||||
//return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public class UpgradeAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
Logger.error("Attempt to upgrade null building by " + player.getName());
|
||||
return true;
|
||||
}
|
||||
if(buildingToRank.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.WAREHOUSE))
|
||||
return true;
|
||||
|
||||
// Early exit for building that is already ranking
|
||||
|
||||
|
||||
@@ -71,8 +71,10 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
}
|
||||
|
||||
public static boolean applyRune(int runeID, ClientConnection origin, PlayerCharacter playerCharacter) {
|
||||
|
||||
RuneBase rb = RuneBase.getRuneBase(runeID);
|
||||
Dispatch dispatch;
|
||||
|
||||
if (playerCharacter == null || origin == null || rb == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -81,6 +83,7 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
ConcurrentHashMap<Integer, Boolean> races = rb.getRace();
|
||||
if(runeID != 3007 && runeID != 3014) {//bounty hunter and huntsman
|
||||
if (races.size() > 0) {
|
||||
|
||||
boolean valid = false;
|
||||
for (int validID : races.keySet()) {
|
||||
if (validID == raceID) {
|
||||
@@ -91,42 +94,20 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
if(runeID == 3040)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3049)
|
||||
if(runeID == 2514 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3036 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3033 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(raceID == 1999){
|
||||
switch(runeID){
|
||||
case 2514:
|
||||
case 3036:
|
||||
case 3033:
|
||||
case 3001:
|
||||
case 3002:
|
||||
case 3003:
|
||||
case 3004:
|
||||
case 3008:
|
||||
case 3009:
|
||||
case 3013:
|
||||
case 3016:
|
||||
case 3017:
|
||||
case 3018:
|
||||
case 3020:
|
||||
case 3021:
|
||||
case 3030:
|
||||
case 3031:
|
||||
case 3037:
|
||||
case 3045:
|
||||
case 3046:
|
||||
case 3047:
|
||||
case 3048:
|
||||
case 3049:
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Check base class is met
|
||||
ConcurrentHashMap<Integer, Boolean> baseClasses = rb.getBaseClass();
|
||||
if (baseClasses.size() > 0) {
|
||||
@@ -138,23 +119,28 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(runeID == 3040)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3036 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3033 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3035 && baseClassID == 2501)
|
||||
valid = true;
|
||||
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Check promotion class is met
|
||||
ConcurrentHashMap<Integer, Boolean> promotionClasses = rb.getPromotionClass();
|
||||
if (promotionClasses.size() > 0) {
|
||||
int promotionClassID = playerCharacter.getPromotionClassID();
|
||||
int baseClassID = playerCharacter.getBaseClassID();
|
||||
boolean valid = false;
|
||||
for (int validID : promotionClasses.keySet()) {
|
||||
if (validID == promotionClassID) {
|
||||
@@ -162,18 +148,19 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(runeID == 3040)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3004 && (playerCharacter.getPromotionClassID() == 2505 || playerCharacter.getPromotionClassID() == 2510))
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3036 && raceID == 1999)
|
||||
valid = true;
|
||||
|
||||
if(runeID == 3033 && raceID == 1999)
|
||||
valid = true;
|
||||
if(runeID == 3028 && (raceID == 2013 || raceID == 2014) && playerCharacter.getBaseClassID() == 2501)
|
||||
valid = true;
|
||||
if(runeID == 3035 && baseClassID == 2501)
|
||||
valid = true;
|
||||
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
@@ -196,6 +183,7 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int discCount = 0;
|
||||
for (CharacterRune cr : runes) {
|
||||
int runeBaseID = cr.getRuneBaseID();
|
||||
@@ -208,18 +196,22 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Check level is met
|
||||
if (playerCharacter.getLevel() < rb.getLevelRequired()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int strTotal = 0;
|
||||
int dexTotal = 0;
|
||||
int conTotal = 0;
|
||||
int intTotal = 0;
|
||||
int spiTotal = 0;
|
||||
int cost = 0;
|
||||
|
||||
//Check any attributes are met
|
||||
ArrayList<RuneBaseAttribute> attrs = rb.getAttrs();
|
||||
|
||||
if (rb.getAttrs() != null)
|
||||
for (RuneBaseAttribute rba : attrs) {
|
||||
int attrID = rba.getAttributeID();
|
||||
@@ -232,12 +224,10 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
case "Born of the Gwendannen":
|
||||
case "Born of the Invorri":
|
||||
case "Born of the Irydnu":
|
||||
case "Scion of the Dar Khelegeur":
|
||||
case "Scion of the Gwaridorn":
|
||||
case "Scion of the Twathedilion":
|
||||
mod = 0;
|
||||
}
|
||||
if (mod > playerCharacter.getUnusedStatPoints()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
cost = mod;
|
||||
@@ -289,11 +279,12 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Check if max number runes already reached
|
||||
if (runes.size() > 12) {
|
||||
ChatManager.chatSystemInfo(playerCharacter,"You Have Too Many Runes Applied");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (rb.getName()) {
|
||||
case "Born of the Ethyri":
|
||||
case "Born of the Taripontor":
|
||||
@@ -312,41 +303,22 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "Scion of the Dar Khelegeur":
|
||||
case "Scion of the Gwaridorn":
|
||||
case "Scion of the Twathedilion":
|
||||
for (CharacterRune charRune : playerCharacter.getRunes()) {
|
||||
RuneBase rb2 = charRune.getRuneBase();
|
||||
switch (rb2.getName()) {
|
||||
case "Scion of the Dar Khelegeur":
|
||||
case "Scion of the Gwaridorn":
|
||||
case "Scion of the Twathedilion":
|
||||
ChatManager.chatSystemError(playerCharacter, "You Have Already Applied A Blood Rune");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
//if discipline, check number applied
|
||||
if (isDiscipline(runeID)) {
|
||||
switch(playerCharacter.getRank()){
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
if(discCount > 3)
|
||||
return false;
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
if(discCount > 5)
|
||||
return false;
|
||||
break;
|
||||
//if(playerCharacter.getLevel() == 80)
|
||||
discCount -= 1; // level 80 characters get an extra disc rune
|
||||
if (playerCharacter.getLevel() < 70) {
|
||||
if (discCount > 2) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (discCount > 3) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Everything succeeded. Let's apply the rune
|
||||
//Attempt add rune to database
|
||||
CharacterRune runeWithoutID = new CharacterRune(rb, playerCharacter.getObjectUUID());
|
||||
@@ -360,6 +332,7 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
if (cr == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//remove any overridden runes from player
|
||||
ArrayList<Integer> overwrite = rb.getOverwrite();
|
||||
CharacterRune toRemove = null;
|
||||
@@ -368,10 +341,13 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
toRemove = playerCharacter.removeRune(overwriteID);
|
||||
}
|
||||
}
|
||||
|
||||
//add rune to player
|
||||
playerCharacter.addRune(cr);
|
||||
|
||||
// recalculate all bonuses/formulas/skills/powers
|
||||
playerCharacter.recalculate();
|
||||
|
||||
//if overwriting a stat rune, add any amount granted from previous rune.
|
||||
if (toRemove != null) {
|
||||
RuneBase rbs = toRemove.getRuneBase();
|
||||
@@ -397,6 +373,7 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
if (dif > 0 && spiTotal < (int) playerCharacter.statSpiMax) {
|
||||
playerCharacter.addSpi(dif);
|
||||
}
|
||||
|
||||
// recalculate all bonuses/formulas/skills/powers
|
||||
playerCharacter.recalculate();
|
||||
}
|
||||
@@ -407,9 +384,6 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
case "Born of the Gwendannen":
|
||||
case "Born of the Invorri":
|
||||
case "Born of the Irydnu":
|
||||
case "Scion of the Dar Khelegeur":
|
||||
case "Scion of the Gwaridorn":
|
||||
case "Scion of the Twathedilion":
|
||||
cost = 0;
|
||||
break;
|
||||
}
|
||||
@@ -418,14 +392,19 @@ public class ApplyRuneMsg extends ClientNetMsg {
|
||||
dispatch = Dispatch.borrow(playerCharacter, msm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
//send apply rune message to client
|
||||
ApplyRuneMsg arm = new ApplyRuneMsg(playerCharacter.getObjectType().ordinal(), playerCharacter.getObjectUUID(), runeID, cr.getObjectType().ordinal(), cr.getObjectUUID(), false);
|
||||
dispatch = Dispatch.borrow(playerCharacter, arm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
|
||||
|
||||
//alert them of success
|
||||
ErrorPopupMsg.sendErrorPopup(playerCharacter, 160);
|
||||
|
||||
//reapply bonuses
|
||||
playerCharacter.applyBonuses();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,12 +112,6 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
|
||||
|
||||
if (contract != null)
|
||||
sellInventory = contract.getSellInventory();
|
||||
//if(npc.contract.getObjectUUID() == 890){ // default steward
|
||||
// sellInventory = npc.getSellInventorySteward();
|
||||
// }
|
||||
//if(npc.contract.getObjectUUID() == 889){ // default builder
|
||||
// sellInventory = npc.getSellInventoryBuilder();
|
||||
// }
|
||||
}
|
||||
|
||||
if (man != null)
|
||||
|
||||
@@ -87,7 +87,11 @@ public class CityDataMsg extends ClientNetMsg {
|
||||
temp.putInt(cityList.size());
|
||||
|
||||
for (City city : cityList)
|
||||
City.serializeForClientMsg(city, temp);
|
||||
try {
|
||||
City.serializeForClientMsg(city, temp);
|
||||
}catch(Exception e){
|
||||
continue;
|
||||
}
|
||||
temp.put((byte) 0); // PAD
|
||||
|
||||
// Serialize runegates
|
||||
@@ -104,10 +108,8 @@ public class CityDataMsg extends ClientNetMsg {
|
||||
}
|
||||
|
||||
temp.putInt(mineList.size());
|
||||
for (Mine mine : mineList) {
|
||||
if(mine.getParentZone() != null && !mine.getParentZone().isContinent())
|
||||
Mine.serializeForClientMsg(mine, temp);
|
||||
}
|
||||
for (Mine mine : mineList)
|
||||
Mine.serializeForClientMsg(mine, temp);
|
||||
temp.put((byte) 0); // PAD
|
||||
}
|
||||
|
||||
@@ -180,10 +182,8 @@ public class CityDataMsg extends ClientNetMsg {
|
||||
}
|
||||
|
||||
writer.putInt(mineList.size());
|
||||
for (Mine mine : mineList) {
|
||||
if(mine.getParentZone() != null && !mine.getParentZone().isContinent())
|
||||
Mine.serializeForClientMsg(mine, writer);
|
||||
}
|
||||
for (Mine mine : mineList)
|
||||
Mine.serializeForClientMsg(mine, writer);
|
||||
} else
|
||||
writer.putInt(0);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package engine.net.client.msg;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
@@ -42,8 +43,8 @@ public class CityZoneMsg extends ClientNetMsg {
|
||||
this.locY = locY;
|
||||
this.locZ = locZ;
|
||||
this.name = name;
|
||||
this.radiusX = radiusX;
|
||||
this.radiusZ = radiusZ;
|
||||
this.radiusX = Enum.CityBoundsType.ZONE.extents;
|
||||
this.radiusZ = Enum.CityBoundsType.ZONE.extents;
|
||||
this.unknown01 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package engine.net.client.msg;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
@@ -275,7 +276,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
|
||||
writer.putString(npcHire.getName());
|
||||
writer.putInt(1);
|
||||
writer.putInt(0);
|
||||
writer.putInt(Blueprint.getNpcMaintCost(npcHire.getRank()));
|
||||
if (npcHire.getObjectType() == GameObjectType.NPC)
|
||||
writer.putInt(((NPC) npcHire).getContract().getIconID()); // Was 60
|
||||
else if (npcHire.getObjectType() == GameObjectType.Mob) {
|
||||
@@ -392,9 +393,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
writer.putInt(bane.getSiegePhase().ordinal()); //1 challenge //2 standoff //3 war
|
||||
writer.put((byte) 0);
|
||||
|
||||
//if (!bane.isAccepted() && this.assetManager.getGuild() == banedCity.getGuild() && GuildStatusController.isInnerCouncil(this.assetManager.getGuildStatus()))
|
||||
// writer.put((byte) 1); //canSetTime
|
||||
//else
|
||||
if (!bane.isAccepted() && this.assetManager.getGuild() == banedCity.getGuild() && GuildStatusController.isInnerCouncil(this.assetManager.getGuildStatus()))
|
||||
writer.put((byte) 1); //canSetTime
|
||||
else
|
||||
writer.put((byte) 0);
|
||||
|
||||
DateTime placedOn = bane.getLiveDate();
|
||||
@@ -485,19 +486,36 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
|
||||
writer.putInt(building.getRank());
|
||||
|
||||
writer.putInt(1); // Gold only
|
||||
// Maintenance costs include resource if
|
||||
// this structure is an R8 tree
|
||||
|
||||
if (building.getRank() == 8)
|
||||
writer.putInt(5); // Resources included
|
||||
else
|
||||
writer.putInt(1); // Gold only
|
||||
|
||||
writer.putInt(2308551); //Gold
|
||||
if (building.getBlueprint() == null)
|
||||
writer.putInt(0);
|
||||
else
|
||||
writer.putInt(building.getBlueprint().getMaintCost()); // maint cost
|
||||
writer.putInt(building.getBlueprint().getMaintCost(building.getRank())); // maint cost
|
||||
|
||||
if (building.getRank() == 8) {
|
||||
writer.putInt(74856115); // Stone
|
||||
writer.putInt(1500); // maint cost
|
||||
writer.putInt(-1603256692); // Lumber
|
||||
writer.putInt(1500); // maint cost
|
||||
writer.putInt(-1596311545); // Galvor
|
||||
writer.putInt(5); // maint cost
|
||||
writer.putInt(1532478436); // Wormwood
|
||||
writer.putInt(5); // maint cost
|
||||
}
|
||||
|
||||
LocalDateTime maintDate = building.maintDateTime;
|
||||
|
||||
if (maintDate == null)
|
||||
maintDate = LocalDateTime.now();
|
||||
writer.putLocalDateTime(maintDate); // current time
|
||||
writer.putLocalDateTime(LocalDateTime.now()); // current time
|
||||
|
||||
// utc offset?
|
||||
writer.putInt((int) java.time.Duration.between(LocalDateTime.now(), maintDate).getSeconds()); // Seconds to maint date
|
||||
@@ -514,7 +532,10 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
else if (building.getRank() == building.getBlueprint().getMaxRank())
|
||||
this.upgradeCost = Integer.MAX_VALUE;
|
||||
else
|
||||
this.upgradeCost = building.getBlueprint().getRankCost(Math.min(building.getRank() + 1, 7));
|
||||
if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.WAREHOUSE))
|
||||
this.upgradeCost = Integer.MAX_VALUE;
|
||||
else
|
||||
this.upgradeCost = building.getBlueprint().getRankCost(Math.min(building.getRank() + 1, 7));
|
||||
|
||||
writer.putInt(this.upgradeCost);
|
||||
} else
|
||||
|
||||
@@ -343,7 +343,7 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(0); //runemaster list
|
||||
|
||||
//artillery captain list
|
||||
ConcurrentHashMap<Mob, Integer> siegeMinions = npc.getSiegeMinionMap();
|
||||
ConcurrentHashMap<Mob, Integer> siegeMinions = npc.siegeMinionMap;
|
||||
writer.putInt(1 + siegeMinions.size());
|
||||
serializeBulwarkList(writer, 1); //Trebuchet
|
||||
//serializeBulwarkList(writer, 2); //Ballista
|
||||
@@ -366,7 +366,7 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
long timeLife = upgradeTime - curTime;
|
||||
|
||||
if (upgradeTime * 1000 > System.currentTimeMillis()) {
|
||||
if (mob.npcOwner.isAlive()) {
|
||||
if (mob.guardCaptain.isAlive()) {
|
||||
writer.put((byte) 0);//shows respawning timer
|
||||
writer.putInt(mob.spawnTime);
|
||||
writer.putInt(mob.spawnTime);
|
||||
@@ -503,7 +503,7 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(0);
|
||||
writer.putString("Repair items");
|
||||
writer.putString("percent");
|
||||
writer.putInt(npc.getSpecialPrice()); //cost for repair
|
||||
writer.putInt(npc.getRepairCost()); //cost for repair
|
||||
writer.putInt(0);
|
||||
|
||||
ArrayList<Integer> modPrefixList = npc.getModTypeTable();
|
||||
@@ -557,7 +557,7 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
|
||||
} else if (this.targetType == GameObjectType.Mob.ordinal()) {
|
||||
|
||||
mobA = Mob.getFromCacheDBID(this.targetID);
|
||||
mobA = Mob.getMob(this.targetID);
|
||||
|
||||
if (mobA == null) {
|
||||
Logger.error("Missing Mob of ID " + this.targetID);
|
||||
@@ -689,7 +689,7 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
long timeLife = upgradeTime - curTime;
|
||||
|
||||
if (upgradeTime * 1000 > System.currentTimeMillis()) {
|
||||
if (mob.npcOwner.isAlive()) {
|
||||
if (mob.guardCaptain.isAlive()) {
|
||||
writer.put((byte) 0);//shows respawning timer
|
||||
writer.putInt(mob.spawnTime);
|
||||
writer.putInt(mob.spawnTime);
|
||||
|
||||
@@ -601,6 +601,9 @@ public class PlaceAssetMsg extends ClientNetMsg {
|
||||
public int getBlueprintUUID() {
|
||||
return this.blueprintUUID;
|
||||
}
|
||||
public void setBlueprintUUID(int id) {
|
||||
this.blueprintUUID = id;
|
||||
}
|
||||
|
||||
public Vector3fImmutable getLoc() {
|
||||
return this.loc;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class RefinerScreenMsg extends ClientNetMsg {
|
||||
return this.unknown02;
|
||||
}
|
||||
|
||||
public void setUnknown02(int value) {
|
||||
public void setUnknown02(float value) {
|
||||
this.unknown02 = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ package engine.net.client.msg;
|
||||
|
||||
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
@@ -54,45 +53,18 @@ public class ServerInfoMsg extends ClientNetMsg {
|
||||
|
||||
writer.putInt(WorldServer.worldMapID);
|
||||
writer.putString(ConfigManager.MB_WORLD_NAME.getValue());
|
||||
int TotalTrees = 21;
|
||||
int currentR8Trees = DbManager.CityQueries.GET_CAPITAL_CITY_COUNT();
|
||||
|
||||
switch(currentR8Trees){
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
writer.putInt(0); //Land Rush
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
writer.putInt(1); //Low pop
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
writer.putInt(2); //Normal pop
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
writer.putInt(3); //High Pop
|
||||
break;
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case 20:
|
||||
writer.putInt(4); //Very overpopulated pop
|
||||
break;
|
||||
default:
|
||||
writer.putInt(5); //Full pop
|
||||
break;
|
||||
}
|
||||
if (LoginServer.population < MBServerStatics.LOW_POPULATION)
|
||||
writer.putInt(0); //Land Rush
|
||||
else if (LoginServer.population < MBServerStatics.NORMAL_POPULATION)
|
||||
writer.putInt(1); //Low pop
|
||||
else if (LoginServer.population < MBServerStatics.HIGH_POPULATION)
|
||||
writer.putInt(2); //Normal pop
|
||||
else if (LoginServer.population < MBServerStatics.VERY_OVERPOPULATED_POPULATION)
|
||||
writer.putInt(3); //High Pop
|
||||
else if (LoginServer.population < MBServerStatics.FULL_POPULATION)
|
||||
writer.putInt(4); //Very overpopulated pop
|
||||
else
|
||||
writer.putInt(5); //Full pop
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@ import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.City;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -26,7 +24,6 @@ import java.util.ArrayList;
|
||||
public class TeleportRepledgeListMsg extends ClientNetMsg {
|
||||
|
||||
ArrayList<City> cities;
|
||||
ArrayList<Mine> mines;
|
||||
private PlayerCharacter player;
|
||||
private boolean isTeleport;
|
||||
|
||||
@@ -80,19 +77,10 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
||||
|
||||
public void configure() {
|
||||
|
||||
if (isTeleport) {
|
||||
if (isTeleport)
|
||||
cities = City.getCitiesToTeleportTo(player);
|
||||
try {
|
||||
mines = Mine.getMinesToTeleportTo(player);
|
||||
if(mines == null)
|
||||
mines = new ArrayList<>();
|
||||
}catch(Exception e){
|
||||
Logger.error("Unable To Load Mines For Teleport: " + e.getMessage());
|
||||
}
|
||||
}else {
|
||||
else
|
||||
cities = City.getCitiesToRepledgeTo(player);
|
||||
mines = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,14 +96,10 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
||||
for (int i = 0; i < 3; i++)
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putInt(cities.size() + mines.size());
|
||||
writer.putInt(cities.size());
|
||||
|
||||
for (City city : cities)
|
||||
City.serializeForClientMsg(city, writer);
|
||||
|
||||
for(Mine mine : mines)
|
||||
Mine.serializeForClientMsgTeleport(mine, writer);
|
||||
|
||||
}
|
||||
|
||||
public PlayerCharacter getPlayer() {
|
||||
|
||||
@@ -94,7 +94,6 @@ public class TrainMsg extends ClientNetMsg {
|
||||
|
||||
if (sk == null)
|
||||
return;
|
||||
|
||||
if (sk.getSkillsBase().getToken() == 40661438) {
|
||||
int maxValue = 15;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user