↑ ↓

Хождения Npc по валкерам

Тема в разделе "Помощь", создана пользователем WeRn, 18 авг 2018.

  1. TopicStarter Overlay
    Offline

    WeRn Ефрейтор

    496
    59
    59
    Кредиты:
    $16.147,43
    Репутация:
    8
    Доброго вечера, подскажет кто как правильно по валкерам отправить непися?

    Вот каким кодом располагаю - по нему должно ходить, но что-то не ходит.
    Валкер сетается, в инфе нпс видно, что валкер есть, но он не хочет двигаться.

    Код:
    		Npc general = instance.getNpc(npcId);
    		general.getSpawn().setWalkerId(walkerId);
    		WalkManager.startWalking((NpcAI2) general.getAi2());
    		PacketSendUtility.broadcastPacket(general, new SM_EMOTION(general, EmotionType.START_EMOTE2, 0, general.getObjectId()));
     
  2. TopicStarter Overlay
    Offline

    WeRn Ефрейтор

    496
    59
    59
    Кредиты:
    $16.147,43
    Репутация:
    8
    Ну я не совсем долб*ёб), валкер существует:
    Код:
    	<walker_template route_id="event_handler_4000_ely" pool="1">
    		<routestep step="1" x="747.3766" y="232.69165" z="1183.8578"/>
    		<routestep step="2" x="726.9797" y="233.53207" z="1183.8578"/>
    		<routestep step="3" x="693.58655" y="233.5334" z="1183.8578"/>
    		<routestep step="4" x="663.64636" y="235.0481" z="1183.8578"/>
    		<routestep step="5" x="643.4625" y="236.25789" z="1183.8578"/>
    		<routestep step="6" x="612.493" y="239.9274" z="1183.8578"/>
    		<routestep step="7" x="586.31335" y="243.69524" z="1183.8578"/>
    		<routestep step="8" x="566.46497" y="250.18163" z="1183.8578"/>
    		<routestep step="9" x="544.72253" y="257.73743" z="1183.8578"/>
    		<routestep step="10" x="526.2141" y="264.6811" z="1183.8578"/>
    		<routestep step="11" x="505.477" y="272.3019" z="1183.8578"/>
    		<routestep step="12" x="482.88098" y="282.8061" z="1183.8578"/>
    		<routestep step="13" x="461.58722" y="294.27707" z="1183.8578"/>
    		<routestep step="14" x="441.46945" y="307.8182" z="1183.8578"/>
    		<routestep step="15" x="424.78516" y="319.04825" z="1183.8578"/>
    		<routestep step="16" x="412.16113" y="327.5045" z="1183.8578"/>
    		<routestep step="17" x="400.01334" y="336.21213" z="1183.8578"/>
    		<routestep step="18" x="398.82632" y="337.46497" z="1183.9202"/>
    		<routestep step="19" x="397.18246" y="339.1345" z="1184.7103"/>
    		<routestep step="20" x="395.41058" y="340.93402" z="1185.5623"/>
    		<routestep step="21" x="393.76114" y="342.6092" z="1186.3551"/>
    		<routestep step="22" x="392.16214" y="344.23312" z="1187.1239"/>
    		<routestep step="23" x="390.43634" y="345.97903" z="1187.9518"/>
    		<routestep step="24" x="389.1201" y="347.30753" z="1188.5823"/>
    		<routestep step="25" x="387.6985" y="348.74234" z="1189.2634"/>
    		<routestep step="26" x="386.36163" y="350.09164" z="1189.9038"/>
    		<routestep step="27" x="384.67413" y="351.79483" z="1190.7123"/>
    		<routestep step="28" x="383.02524" y="353.45905" z="1191.5002"/>
    		<routestep step="29" x="381.1849" y="355.3165" z="1191.8595"/>
    		<routestep step="30" x="374.42743" y="362.13687" z="1191.8595"/>
    		<routestep step="31" x="363.723" y="372.94073" z="1191.6683"/>
    		<routestep step="32" x="351.29367" y="385.48557" z="1191.8595"/>
    		<routestep step="33" x="345.31113" y="391.5237" z="1191.8595"/>
    		<routestep step="34" x="343.24207" y="393.612" z="1191.3215"/>
    		<routestep step="35" x="341.39517" y="395.47604" z="1190.4366"/>
    		<routestep step="36" x="339.1583" y="397.73373" z="1189.365"/>
    		<routestep step="37" x="337.18207" y="399.72836" z="1188.4182"/>
    		<routestep step="38" x="335.48425" y="401.44196" z="1187.6049"/>
    		<routestep step="39" x="333.32614" y="403.62015" z="1186.5709"/>
    		<routestep step="40" x="331.3246" y="405.64032" z="1185.612"/>
    		<routestep step="41" x="329.35583" y="407.62738" z="1184.6688"/>
    		<routestep step="42" x="327.07956" y="409.9248" z="1183.8578"/>
    		<routestep step="43" x="319.32455" y="414.28488" z="1183.8578"/>
    		<routestep step="44" x="310.90656" y="422.36133" z="1183.8578"/>
    		<routestep step="45" x="301.52075" y="435.88657" z="1183.8578"/>
    		<routestep step="46" x="289.91528" y="453.58224" z="1183.8578"/>
    		<routestep step="47" x="281.48877" y="466.93765" z="1183.8578"/>
    		<routestep step="48" x="272.67618" y="482.3471" z="1183.8578"/>
    		<routestep step="49" x="263.3941" y="500.61322" z="1183.8578"/>
    		<routestep step="50" x="253.60156" y="521.8908" z="1183.8578"/>
    		<routestep step="51" x="245.91791" y="540.66907" z="1183.8578"/>
    		<routestep step="52" x="240.70255" y="554.9897" z="1183.8578"/>
    		<routestep step="53" x="235.86548" y="568.2716" z="1183.8578"/>
    		<routestep step="54" x="232.45583" y="581.5248" z="1183.8578"/>
    		<routestep step="55" x="227.70644" y="595.1611" z="1183.8578"/>
    		<routestep step="56" x="223.83342" y="606.92914" z="1183.8578"/>
    		<routestep step="57" x="220.17354" y="622.27515" z="1183.8578"/>
    		<routestep step="58" x="218.88445" y="632.03253" z="1183.8578"/>
    		<routestep step="59" x="215.50504" y="645.11975" z="1183.8578"/>
    		<routestep step="60" x="214.48923" y="652.87775" z="1183.8578"/>
    		<routestep step="61" x="214.04509" y="655.33124" z="1184.5707"/>
    		<routestep step="62" x="214.02673" y="657.6326" z="1185.3457"/>
    		<routestep step="63" x="214.05511" y="659.705" z="1186.0452"/>
    		<routestep step="64" x="214.09392" y="662.53796" z="1187.0013"/>
    		<routestep step="65" x="214.12622" y="664.89667" z="1187.7975"/>
    		<routestep step="66" x="214.14595" y="666.33777" z="1188.2839"/>
    		<routestep step="67" x="214.1783" y="668.69916" z="1189.0784"/>
    		<routestep step="68" x="214.21046" y="671.04724" z="1189.8683"/>
    		<routestep step="69" x="214.23448" y="672.8" z="1190.458"/>
    		<routestep step="70" x="214.25807" y="674.52216" z="1191.0374"/>
    		<routestep step="71" x="214.28664" y="676.60657" z="1191.6761"/>
    		<routestep step="72" x="214.3081" y="678.1742" z="1191.8258"/>
    		<routestep step="73" x="214.27722" y="683.26025" z="1192.0078"/>
    		<routestep step="74" x="214.17181" y="687.19354" z="1192.0078"/>
    		<routestep step="75" x="214.0516" y="691.6794" z="1192.9744"/>
    		<routestep step="76" x="213.95555" y="695.26385" z="1193.8693"/>
    		<routestep step="77" x="214.0177" y="700.209" z="1195.1039"/>
    		<routestep step="78" x="214.1316" y="705.9248" z="1196.531"/>
    		<routestep step="79" x="214.24814" y="711.7739" z="1197.9912"/>
    		<routestep step="80" x="214.36365" y="717.571" z="1199.4386"/>
    		<routestep step="81" x="214.49934" y="724.38025" z="1200.1624"/>
    		<routestep step="82" x="214.50023" y="731.1306" z="1200.1624"/>
    		<routestep step="83" x="214.29791" y="738.6804" z="1200.1624"/>
    		<routestep step="84" x="214.32956" y="753.9973" z="1200.1624"/>
    		<routestep step="85" x="214.2124" y="764.6874" z="1200.1624"/>
    		<routestep step="86" x="216.38148" y="766.00397" z="1200.1624"/>
    		<routestep step="87" x="221.01448" y="767.0503" z="1200.1624"/>
    		<routestep step="88" x="232.7159" y="767.24945" z="1200.1624"/>
    		<routestep step="89" x="247.00757" y="767.009" z="1200.1624"/>
    		<routestep step="90" x="254.28326" y="766.88654" z="1200.3774"/>
    		<routestep step="91" x="257.65274" y="766.8299" z="1201.299"/>
    		<routestep step="92" x="267.6014" y="766.66254" z="1201.5222"/>
    		<routestep step="93" x="277.37842" y="766.5518" z="1201.7203"/>
    		<routestep step="94" x="286.70605" y="766.8542" z="1201.7183"/>
    		<routestep step="95" x="294.6646" y="766.6674" z="1201.7166"/>
    		<routestep step="96" x="306.717" y="767.01105" z="1201.7139"/>
    		<routestep step="97" x="317.4726" y="766.62366" z="1201.7114"/>
    		<routestep step="98" x="327.1335" y="766.66504" z="1201.7094"/>
    		<routestep step="99" x="336.81708" y="766.7084" z="1201.7072"/>
    		<routestep step="100" x="347.32117" y="766.75525" z="1201.7048"/>
    		<routestep step="101" x="356.4174" y="766.796" z="1201.7029"/>
    		<routestep step="102" x="364.3242" y="766.8315" z="1201.702"/>
    		<routestep step="103" x="371.5342" y="766.8638" z="1201.7661"/>
    		<routestep step="104" x="373.80127" y="766.87396" z="1202.0491"/>
    		<routestep step="105" x="375.76196" y="766.8828" z="1202.294"/>
    		<routestep step="106" x="377.51883" y="766.8907" z="1202.5132"/>
    		<routestep step="107" x="380.63168" y="766.9046" z="1202.9017"/>
    		<routestep step="108" x="382.47784" y="766.9129" z="1203.1322"/>
    		<routestep step="109" x="384.7649" y="766.9232" z="1203.4177"/>
    		<routestep step="110" x="386.1142" y="766.92926" z="1203.5862"/>
    		<routestep step="111" x="388.53708" y="766.9401" z="1203.8887"/>
    		<routestep step="112" x="390.47647" y="766.94885" z="1204.1307"/>
    		<routestep step="113" x="391.40353" y="766.953" z="1204.2465"/>
    		<routestep step="114" x="393.82242" y="766.9638" z="1204.5485"/>
    		<routestep step="115" x="395.71783" y="766.9723" z="1204.785"/>
    		<routestep step="116" x="398.222" y="766.9835" z="1205.0977"/>
    		<routestep step="117" x="400.1973" y="766.99243" z="1205.3442"/>
    		<routestep step="118" x="402.31116" y="767.00195" z="1205.6082"/>
    		<routestep step="119" x="404.35175" y="767.0111" z="1205.8628"/>
    		<routestep step="120" x="406.2112" y="767.0195" z="1206.095"/>
    		<routestep step="121" x="408.19455" y="767.0284" z="1206.3425"/>
    		<routestep step="122" x="410.5708" y="767.03906" z="1206.5686"/>
    		<routestep step="123" x="412.8152" y="767.0492" z="1206.7335"/>
    		<routestep step="124" x="421.89133" y="767.08997" z="1206.7036"/>
    		<routestep step="125" x="434.3095" y="767.14557" z="1206.7036"/>
    		<routestep step="126" x="442.46533" y="767.1821" z="1206.7036"/>
    		<routestep step="127" x="446.09818" y="767.1984" z="1206.8136"/>
    		<routestep step="128" x="448.00824" y="767.207" z="1207.052"/>
    		<routestep step="129" x="449.5813" y="767.21405" z="1207.2484"/>
    		<routestep step="130" x="451.95227" y="767.2247" z="1207.5443"/>
    		<routestep step="131" x="454.8853" y="767.2378" z="1207.9105"/>
    		<routestep step="132" x="456.06012" y="767.2431" z="1208.0571"/>
    		<routestep step="133" x="457.93823" y="767.2516" z="1208.2916"/>
    		<routestep step="134" x="459.843" y="767.26013" z="1208.5293"/>
    		<routestep step="135" x="461.801" y="767.2689" z="1208.7738"/>
    		<routestep step="136" x="463.3261" y="767.27576" z="1208.9641"/>
    		<routestep step="137" x="466.41367" y="767.2896" z="1209.3496"/>
    		<routestep step="138" x="468.37967" y="767.29846" z="1209.595"/>
    		<routestep step="139" x="470.81723" y="767.3094" z="1209.8993"/>
    		<routestep step="140" x="473.26276" y="767.3204" z="1210.2046"/>
    		<routestep step="141" x="474.9637" y="767.32794" z="1210.4169"/>
    		<routestep step="142" x="476.7952" y="767.3362" z="1210.6455"/>
    		<routestep step="143" x="478.648" y="767.3445" z="1210.8768"/>
    		<routestep step="144" x="481.15216" y="767.3557" z="1211.1895"/>
    		<routestep step="145" x="483.08752" y="767.3643" z="1211.431"/>
    		<routestep step="146" x="485.47046" y="767.37506" z="1211.6599"/>
    		<routestep step="147" x="489.84827" y="766.751" z="1211.7234"/>
    		<routestep step="148" x="497.06036" y="766.89734" z="1211.9135"/>
    		<routestep step="149" x="503.83255" y="766.7801" z="1213.6073"/>
    		<routestep step="150" x="508.4712" y="766.6998" z="1214.7666"/>
    		<routestep step="151" x="514.27673" y="766.6895" z="1216.2179"/>
    		<routestep step="152" x="519.58636" y="766.796" z="1217.5455"/>
    		<routestep step="153" x="524.6616" y="766.8979" z="1218.8138"/>
    		<routestep step="154" x="530.0045" y="767.005" z="1220.1489"/>
    		<routestep step="155" x="534.85516" y="767.04114" z="1221.3615"/>
    		<routestep step="156" x="541.15924" y="766.90247" z="1221.8517"/>
    		<routestep step="157" x="547.42505" y="766.7744" z="1221.8403"/>
    		<routestep step="158" x="550.12317" y="766.7193" z="1221.8354"/>
    		<routestep step="159" x="553.9493" y="766.64105" z="1222.2849"/>
    		<routestep step="160" x="557.36255" y="766.57135" z="1222.7104"/>
    		<routestep step="161" x="560.62" y="766.5048" z="1223.1166"/>
    		<routestep step="162" x="563.67053" y="766.595" z="1223.4984"/>
    		<routestep step="163" x="566.87067" y="766.70905" z="1223.8993"/>
    		<routestep step="164" x="569.63947" y="766.8077" z="1224.2451"/>
    		<routestep step="165" x="573.4026" y="766.9418" z="1224.7136"/>
    		<routestep step="166" x="576.46027" y="767.0508" z="1225.0944"/>
    		<routestep step="167" x="578.92554" y="767.1386" z="1225.4012"/>
    		<routestep step="168" x="581.5439" y="767.232" z="1225.7273"/>
    		<routestep step="169" x="584.30035" y="767.1671" z="1226.0721"/>
    		<routestep step="170" x="587.6201" y="767.089" z="1226.4875"/>
    		<routestep step="171" x="593.679" y="766.94635" z="1226.5035"/>
    		<routestep step="172" x="600.03625" y="766.79675" z="1226.5035"/>
    		<routestep step="173" x="606.8077" y="766.6373" z="1226.1296"/>
    		<routestep step="174" x="611.2619" y="766.5325" z="1225.5182"/>
    		<routestep step="175" x="618.5207" y="766.36163" z="1225.5182"/>
    		<routestep step="176" x="624.53186" y="766.38873" z="1225.5182"/>
    		<routestep step="177" x="631.90814" y="766.42194" z="1225.5182"/>
    		<routestep step="178" x="633.693" y="766.42993" z="1225.0088"/>
    		<routestep step="179" x="636.24384" y="766.44147" z="1223.8002"/>
    		<routestep step="180" x="639.89874" y="766.4579" z="1223.3048"/>
    		<routestep step="181" x="644.87897" y="766.4802" z="1223.3048"/>
    		<routestep step="182" x="649.1613" y="766.4994" z="1222.9677"/>
    		<routestep step="183" x="657.4064" y="766.53644" z="1221.773"/>
    		<routestep step="184" x="665.3689" y="766.5721" z="1220.8777"/>
    		<routestep step="185" x="673.76385" y="766.6097" z="1219.934"/>
    		<routestep step="186" x="683.0079" y="766.65125" z="1218.8947"/>
    		<routestep step="187" x="691.8153" y="766.69086" z="1217.9045"/>
    		<routestep step="188" x="701.16724" y="766.7327" z="1217.2035"/>
    		<routestep step="189" x="708.89404" y="766.76733" z="1217.0035"/>
    		<routestep step="190" x="715.59" y="766.79736" z="1217.0035"/>
    		<routestep step="191" x="722.8227" y="766.82996" z="1217.0035"/>
    		<routestep step="192" x="731.38873" y="766.8684" z="1217.0035"/>
    		<routestep step="193" x="737.9788" y="766.89795" z="1217.0035"/>
    		<routestep step="194" x="744.3813" y="766.9267" z="1217.0035"/>
    		<routestep step="195" x="750.39526" y="766.8214" z="1217.0035"/>
    	</walker_template>
     
  3. Offline

    SG Shaiy Ефрейтор

    402
    95
    61
    Кредиты:
    $15.767,72
    Репутация:
    9
    проверь walkerId по регистру символов если регистр отличается не будет работать
     
  4. Offline

    SG Shaiy Ефрейтор

    402
    95
    61
    Кредиты:
    $15.767,72
    Репутация:
    9
    ты под обычный спавн делаешь или для ai?
     
  5. Offline

    Dev4ik Ефрейтор

    223
    8
    51
    Кредиты:
    $15.254,23
    Репутация:
    -1
    нужно еще npc_templates посмотресть стоит ли там валк, если нету взять от других нпс которые ходят, у меня тоже самое было теперь они ходят
     
  6. Offline

    Dev4ik Ефрейтор

    223
    8
    51
    Кредиты:
    $15.254,23
    Репутация:
    -1
    <speeds walk="2" group_walk="2" run="6" run_fight="5" group_run_fight="6"/> типо так
     
  7. Offline

    Dev4ik Ефрейтор

    223
    8
    51
    Кредиты:
    $15.254,23
    Репутация:
    -1
    если его нету то не будет нпс ходить даже если валкер правильно указан в npc_walker
     
  8. TopicStarter Overlay
    Offline

    WeRn Ефрейтор

    496
    59
    59
    Кредиты:
    $16.147,43
    Репутация:
    8
    Ну я же не дебил, я просто дал вырезку из метода.
    Мои методы:
    Код:
    	public void startWalk(Npc npc, String walkId) {
    		npc.getSpawn().setWalkerId(walkId);
    		WalkManager.startWalking((NpcAI2) npc.getAi2());
    		npc.setState(1);
    		PacketSendUtility.broadcastPacket(npc, new SM_EMOTION(npc, EmotionType.START_EMOTE2, 0, npc.getObjectId()));
    	}
    Код:
    	@Override
    	public void onInstanceCreate(WorldMapInstance inst) {
    		super.onInstanceCreate(inst);
    		generalStartMove();
    
    	}
    Код:
    	protected void generalStartMove() {
    		ThreadPoolManager.getInstance().schedule(new Runnable() {
    
    			@Override
    			public void run() {
    				final Npc general = instance.getNpc(258202);
    				startWalk(general, "event_handler_4000_ely");
    			}
    		}, 60 * 1000);
    	}

    Нормально там все, я не новичок в этом, сколько я раз это делал, просто времени прошло много с того времени, многое чего вспоминаю, в примерах рабочих ивентов - все нормально ходит, а в новом -нет...
    Ивент сервис свой - в нем новый instanceEvent
    А вот это хорошая идея, посмотрю, спасибо :)
    Ну да, этого у меня нет поэтому он не пошел, нет вообще тэгов speeds... Незаметил этого в templates, буду пробовать)
     
  9. TopicStarter Overlay
    Offline

    WeRn Ефрейтор

    496
    59
    59
    Кредиты:
    $16.147,43
    Репутация:
    8
    Да из-за спида не работало, не обратил внимания даже... Спасибо всем большое за подсказки)
     
  10. Offline

    Dev4ik Ефрейтор

    223
    8
    51
    Кредиты:
    $15.254,23
    Репутация:
    -1
    незик ;)
     
    WeRn нравится это.