Perhaps it's just me, but when joining a realm and having followers setup, I get a null pointer exception on moveClazz.
@asdfghjkl122 You have to tell the server what you hit with the ENEMY_HIT packet.
@Igzz I haven't completed it myself, it's just the product of a few days worth of boredom, although I do have other listeners that I've coded.
Perhaps it's just me, but when joining a realm and having followers setup, I get a null pointer exception on moveClazz.
Sorry to keep spamming the thread BUT i have literally exhausted all of my creativity and i am still not doing any damage to monsters. This is what i have so far. This code is run ~1000ms so i know its not me pushing the limits of how fast i can shoot.
what am i missing o.0??? the PLAYERSHOOT_Packet seems to work okay, just the damage isn't getting done.Code:for (int i = 0; i < gCli.gCon.world.objects.size(); i++) { if ((gCli.gCon.world.objects.get(i).isPlayer()) && (gCli.gCon.world.objects.get(i).getPosition().distanceTo(gCli.gCon.world.getPosition()) < distance) && (gCli.gCon.world.objects.get(i).getHealth() != 0)) { id = i; distance = gCli.gCon.world.objects.get(i).getPosition().distanceTo(gCli.gCon.world.getPosition()); } } if (distance < 8.6) { ObjectStatus obj = gCli.gCon.world.objects.get(id); if (obj != null){ double angle = ((float) Math.toRadians(gCli.gCon.world.getPosition().getAngleTo(obj.getPosition()))); angle = (angle + (Math.PI * 3/ 2)) % (Math.PI *2); if (obj != null){ PLAYERSHOOT_Packet shoot = new PLAYERSHOOT_Packet(); shoot.angle_ = (float) angle; shoot.bulletId_ = bulletID; shoo*****ntainerType_ = 2711; shoot.startingPos_ = gCli.gCon.world.getPosition(); shoot.time_ = gCli.currentTime(); gCli.gCon.sendPacket(shoot); //simply adds packet to queue for sending ENEMYHIT_Packet hit = new ENEMYHIT_Packet(); hit.bulletId_ = bulletID; hit.targetId_ = obj.objStatData.objectId; hit.kill_ = ((obj.getHealth() - 10) < 0); hit.time_ = gCli.currentTime(); try { Thread.sleep((long) (distance * 5)); } catch (InterruptedException e) { } Random rnd = new Random(); if (rnd.nextLong() < 0.7){ gCli.gCon.sendPacket(hit); bulletID = (bulletID + 1) % 255; } } }
Also what packet do i use to invoke a Class ability?? as you can see from the time stamp on my last post i have also exhausted my creativity on this problem too.
Hello
It's me again , i dont know why but my wizards cant get inside realm.
They all are getting in and get insta kicked out with this error :
QUESTOBJID [239841]
CHOOSENAME [Cyclops]
java.lang.NullPointerException
at client.base.BasicListener.packetRecived(BasicListe ner.java:69)
at client.base.GameConnection$2.run(GameConnection.ja va:137)
Some of them get : NAMERESULT [false , Name already in use]
@zakraj8 The error instance you described:
When you zone the client created a whole new connection and this new connection doesn't have a MoveClass attached to it. For a quick fix to this problem provided your just using the sample listeners is to uncomment a line in client.base.getNewListeners(GameConnection ngCon) line 144 (//li.add(new MultiBoxListener(ngCon, this))QUESTOBJID [239841]
CHOOSENAME [Cyclops]
java.lang.NullPointerException
at client.base.BasicListener.packetRecived(BasicListe ner.java:69)
at client.base.GameConnection$2.run(GameConnection.ja va:137). I have not encountered the other problem, however when an error packet is received i simple reuse the last RECONNECT_Packet to try to establish a new connection and that seems to work fine, requires a bit of code though.
As for my problem i posted about earlier i have solved it. For others trying to get this to work ENEMYHIT_Packet requires sensitive timing, you need to delay the sending of the ENEMYHIT_Packet till it actually would get hit, and don't send the packet if it's an obvious miss, you'll get disconnected quick like that.
I have not found a way to send CLASS ABILITIES, anyone else managed to do it and wants to share?
@asdfghjkl122 You have to send a USEITEM packet relating to your ability.
I ask that no one re-post my source in any shape or form, in whole or part. It wasn't intended to be used as a spam tool or to piss off other players or the devs.
@Nico Please delete this thread. Thanks.
Last edited by Ikulip; 06-20-2012 at 12:24 AM.
sha (06-26-2012)
@Ikulip i would be very disappointed if through deleting the thread i lost all contact with you, is there any way i could contact you off the forum. I have had a lot of fun codeing stuff and it would be a real shame if that had to stop. I'll post my contact details on your wall to avoid breaking any rules there might be in place.
Ikulip , please do not delete thread , continue your work on client.
There was no info on first page that no one is allowed to use your code for public clients etc.
I'm really sorry.
I'm sure than in next rotmg build no one will abuse it.
Got last question :
USEITEM_Packet.java need slotObject and it need objectId , slotId and itemType.
objectId is set to int.
In .swf file , first starting spell for wizard got : <ObjectId>Fire Bolt</ObjectId>
It's string... Do i need to modify Item.java or i just took wrong value.
My current code for using spell is (not working) :
Spell code in .swf :Code:@override public void loopp(){ { USEITEM_Packet uppp = new USEITEM_Packet(); uppp.time_= 1000; uppp.slotObject_.objectId = FireBolt; uppp.slotObject_.slotId = 11; uppp.slotObject_.itemType = 2606; uppp.itemUsePos_ = gCli.gCon.world.getPosition(); gCon.sendQueue.add(uppp); } }
Code:<Object type="0xa2e" id="Fire Spray Spell"> <Class>Equipment</Class> <Item/> <Texture><File>lofiObj6</File><Index>0x40</Index></Texture> <SlotType>11</SlotType> <Tier>0</Tier> <Description>A spell that shoots fire in all directions.</Description> <Sound>spell/fire_spray</Sound> <Projectile> <ObjectId>Fire Bolt</ObjectId> <Speed>160</Speed> <MinDamage>30</MinDamage> <MaxDamage>50</MaxDamage> <LifetimeMS>1000</LifetimeMS> </Projectile> <Usable/> <BagType>0</BagType> <MpCost>30</MpCost> <Activate>BulletNova</Activate> </Object>
@zakraj8 I am currently trying to get this to work too. What value are you using for Firebolt and i'd suggest trying gCli.currentTime(); for uppp.time, idk why your using 1000. I'll post an email address on your wall, we might be able to continue development together if Ikulip doesn't want it public anymore.
HOW DO I USE THID ON A MAC! PLZ GET BACK TO ME QUICKLY
I agree. Please remove this for malicious reasons. So much spam.
Hello everyone. I'm trying to learn java, I have no idea how to use an eclipse project properly. Could any of you make a tutorial on compiling/making a jar file out of the files? We all need to learn somehow.
@zakraj8 Please for the sake of ROTMG stop distributing my source with your code that makes it ridiculously simple for every noob to destroy the game. It's entirely my bad for releasing it in the first place, but this is just TRYING to kill the game.
@Liz or any other mod/admin please delete this thread.