Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • OracleScape: Bump my server and play [link]
      Today at 06:08:29 PM
    • OracleScape: BUMP my thread please [link]
      Today at 06:08:00 PM
    • stCky: idk man im just a chat bot
      August 22, 2017, 11:14:52 PM
    • symantec: is this forum
      August 22, 2017, 09:02:56 PM
    • symantec: what the fudge
      August 22, 2017, 09:02:52 PM
    • symantec: I just joined to download datmaker, the links are broken and a user named i nelson i has a fudgeing weird signature
      August 22, 2017, 08:59:33 PM
    • stCky: ur so cool and edgy
      August 22, 2017, 04:15:50 PM
    • Deathspirit: anyways, i'm un ip banned now.. but don't even want to be that at this point lmfao
      August 22, 2017, 01:58:14 PM
    • Deathspirit: now it's some sell out half leeched server :')
      August 22, 2017, 01:57:53 PM
    • Deathspirit: gf moparscape, was the best rsps community i've been on since 2006
      August 22, 2017, 01:57:31 PM
    • stCky: yeah, nah. it's cooked. [link] might help u with a backup or something idk man im just a chat bot
      August 22, 2017, 12:13:25 AM
    • flew420: I sure hope someone has a copy of the forum before it was recked
      August 21, 2017, 11:40:52 PM
    • flew420: O wow i see now, just read thru all the news articles. :(  i've been out of the game for a couple years so coming back to this shit is sad.
      August 21, 2017, 11:39:46 PM
    • flew420: Huh?
      August 21, 2017, 10:49:51 PM
    • stCky: got bought by a russian dude, he put a shitty rsps on it for donations, now no one cares
      August 21, 2017, 10:48:30 PM
    • flew420: I came on for some nostalgic reading in old classic development, and it only goes back to 2014 wtf.
      August 21, 2017, 10:43:09 PM
    • flew420: what happened to this site??
      August 21, 2017, 10:42:36 PM
    • Sean56:[link]
      August 21, 2017, 05:33:45 PM
    • kb010: how can i play? i downloaded the client and it doesnt open.
      August 21, 2017, 10:52:56 AM
    • wodkode: shut it down or fix it
      August 20, 2017, 10:11:28 PM

    Author Topic: How to change attack distance? or make npc attack back when attacked right..[PI  (Read 766 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinejoint33skinz

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    hi

    im havng issues with attacking npcs on my server

    if the npc walks away after being clicked my player stops and waits until they walk back within a good distance to attack.

    how can i change it so my player will chase the npc or attack further or something?

    do i change this? in npchandler?

    Code:

    Code: [Select]
    public void attacknpc(int i) {
    if(npcs[i] != null) {
    if (npcs[i].isDead)
    return;
    if (!npcs[i].inMulti() && npcs[i].underAttackBy > 0) {
    npcs[i].killerId = 0;
    return;
    }

    and add this or am i completely wrong? lol

    Code: [Select]
    followNpc();
    note it does follow the npc sometimes not always


    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    I personally don't know how you'd resolve the issue without using some rather "hacked" methods.

    Generally speaking, it happens because of this:
    [Normal scenario]
    You, the client, click an NPC at X, Y, Z
    You happen to be standing 5 tiles away, so the client walks you to the X, Y, Z (X or Y +/- 1 depending on pos) of the NPC, and stops.
    At the same time, the server is waiting for your player to hit a 1-tile range of the npc's coods to do anything. Once you do it fires the event (Packet is received on initial click - starting the wait process). The event being talking/attacking/shopping/whatever.

    [Your issue]
    You, the client, click an NPC at X, Y, Z
    You, being 5 tiles away, have to wait for the player to walk to the tile (Client sided). But at this time, the NPC walks 2 tiles from its position (Server sided).
    So now, the server is waiting on you to finish the walking event and get into 1 tile radius of the NPC's current coords. But, you won't be in a 1 tile radius as your client sent you to (and stopped you) where the npc was before, not where it is now.


    I could only think to solve this by adding some exception in the event that checks your click distance on npcs (Server sided) that if the player has clicked an npc, and the npc is a couple tiles away, the server attempts to force walk towards it.
    Reason this is hard to solve, properly, is because walking is handled client sided. So, you could probably add something to the existing walk methods there, but I'm not sure.


    Offlinejoint33skinz

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    funny its actaully a server that you released haha   :cool:

    i also have a invalid waypoint in walking sometimes i dont know how to fix..

    its aggroth v4 i have the issues with unfortunately im a java beginner as in the very start basically i have not wrote a java program before nor have i learn all i will need

    would be cool if you had a quick fix or know how to sort it for me but i appreciate the help even if you dont

    thanks for the reply
    « Last Edit: February 18, 2016, 10:58:46 AM by joint33skinz »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    funny its actaully a server that you released haha   :cool:

    i also have a invalid waypoint in walking sometimes i dont know how to fix..

    its aggroth v4 i have the issues with unfortunately im a java beginner as in the very start basically i have not wrote a java program before nor have i learn all i will need

    would be cool if you had a quick fix or know how to sort it for me but i appreciate the help even if you dont

    thanks for the reply
    I don't have a quick fix, never cared to look into the issue personally.
    Also: I only did minor fixes to aggroth. I'm not the creator.

    Offlinejoint33skinz

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    yea i remember reading about you just edited the mysql stuff..

    im actually also having trouble setting the mysql stuff up right with my site if you could maybe help with that?

    or do i need to change the scripts?

    if not maybe you could suggest something instead of this source for me to use that is both easy for beginners and full of content with newer gameframe similar to aggroth thanks
    « Last Edit: February 18, 2016, 12:05:13 PM by joint33skinz »

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal