Inactive [Inactive][FUN] NPCX + Civilizations! [1.8] Everquest style BOTS, paths, aggro, loot, guard, shops,.

Discussion in 'Inactive/Unsupported Plugins' started by mixxit, Mar 19, 2011.

  1. Offline

    mixxit

    npcx!
    Version: See thread title for bukkit compatibility (usually RB)
    Test Server: world.soliniaonline.com:25565

    [​IMG]

    Implements everquest style npc spawngroups using the npc library allowing you to make persistent npcs/rare npcs spawn around your map. Npcs will fight back if attacked and even talk on right click. They will sell items and can even have loot assigned and be given factions and paths to walk and npc trading

    Install / Changelog / Commands / README

    All of this has now moved to http://soliniaonlinemc.wordpress.com/2011/09/24/npcx/

    Addendum

    I will be updating NPCX in the future with a rewrite for 1.9 bot functionality
     
  2. Offline

    Luong

    I edit my npc from the database, you can delete it. I create my own stored procedure that allows me to delete an npc easily by calling:
    Code:
    CALL database.DeleteStaticNPC_ByNPCID(1);
    You have to delete everything that is connected/constraining to the npc first, then the npc afterwards. delete the following:
    spawngroup_entries -> spawngroup
    merchant_entries -> merchant
    triggerwords -> npc_faction -> npc -> stoage

    Can't remember everything from the top of my head, since it's 6:25am here, have to leave in 5minutes, so I can't really sit and scan my procedures or all the tables for you.

    Oh yea, if you plan on creating stored procedures, you won't be able to unless you add the following line to the top of the code in mysql workbench:
    Code:
    DELIMITER $$
    Also, all variable has to be declare at the top before any of the logics are done >_> You can't declare it in the middle of the logic.
     
  3. Offline

    Lord Chaos

    This looks like an amazing plugin. Might donate to it if it will work and is usable enough.

    Some questions:

    1. Does it work with iConomy?
    2. Does it work with Towny? (this would be truly awesome if these two plugins could work together, so you could create living, breathing towns and nations)
    3. Any plans for creating an interface to create and edit NPCs outside of minecraft? Manually typing in all those commands for every NPC would be very very timeconsuming.
     
  4. Hello !
    I did the configuration of Mysql as presented before, but this error is blocking me.
    But I check the workbench, and the npcx.properties, and didn't find any mistakes (no space, and good name)
    (is this correct ? the db-host=localhost and db-port=3306)
    So I post the log of my server.

    Sorry for my bad english i'm french

     
  5. Offline

    Pomme72


    I have read the README --' But : I tried all the commands and all the commands reply to me :

    An error occurred.

    But I have setup this plugin fine ! So... Is this plugin require Citizens for work, or anything else ? :O
     
  6. Offline

    mixxit

    RTFM

    RTFM

    No you still set it up wrong

    Yes, i do this on my test server all the time. You will want to backup your database in advance just incase. As long as your existing db version is about 1.05 i think you should be ok to upgrade up to 1.9

    One of the first things in the manual is the commands, why not try them

    1) Yes, why not try it

    2) Yes, it was developed on a towny server (Just disable nations when you use it)

    3) No, its the same amount of keys wherever you type it but the reason I went mysql was to make it easier to read the data from sites

    Not on my list of issues right now!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  7. Offline

    1994mat

    Try to make a hook inside uQuest please, would be awesome to have quests via 2 epic plugins.

    And yet again: Nice plugin!
     
  8. Offline

    mixxit

    Yes use the /npcx faction commands (type it for a list and their syntax)

    faction add will allow you to define one npc factions standing to another (effects all npcs on this faction) and whether they will be KOS (killed on sight)

    Or you can just edit it in the database

    Why are you talking about tables lol - it creates them for you

    RTFM!

    Sorry i can't debug all the plugins you will need to look into this yourself

    Attach a merchant list to the npc
    /npcx npc merchant NPCID MERCHANTID
    Then change the npcs category
    /npcx npc category NPCID merchant
    voila

    Target is cleared when an npc or player is out of range etc or they right click to cancel

    Check distances and the actual distance its reporting

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  9. Offline

    Suda

    hi I'm having an issue with deleting and reassigning NPCs old IDs; for example:
    I have npc: NewbHelper (ID = 1) and he is in spawngroup (ID = 1). I deleted everything in the MySQL database and so there now is no spawngroups or NPCs. I create a new NPC anc Spawngroup but instead of checking if ID of 1 for NPC and spawngroup is empty and recreating the npc and spawngroup ID to 1 it skips 1 and goes to 2. This happens if I try it for any groups after that too, for example if I delete 2 it creates 3 instead of checking if 2 is empty and recreating 2. I've tried going into the database and manually changing the IDs but when I spawn the NPC they down't show up.

    I hope that explains my issue, and is there any way to make NPCs gods? like so they can't be killed?

    Also I noticed that all NPCs come with armor, I tried changing their armor to 0 but they still have the gear.
     
  10. Offline

    mixxit

    A) yes this is how auto-increment for an ID because you did not drop the table but why is it a problem? RTFM for the correct way

    B) No not currently

    C) I guess you did it wrong
     
  11. Offline

    Suda

    A) I see, it's not really a problem I just try to keep my stuff organized, I'll try reading the readme again maybe I missed it.

    B)ah okay

    C)yea I just figured out the correct way, sorry about that I was editing them through the workbench.

    Thanks for answering all my questions, this is a very nice plugin.
     
  12. Offline

    mixxit

    Addendum to:



    In this great video by sam he makes use of some things that don't work so I wanted to cover them for you having questions

    Update=false in the npcx.properties file
    Changing this to update=true will DBWIPE your database. It was used originally so in the older versions people with an incompatible database could quickly wipe all their tables by changing the flag. I'm not sure it still works
    with db 1.9 and i would not recommend you use it at present.

    If you want to clear your npcx settings and start from scratch simply delete the npcx folder so it will regenerate the config file and after changing the db details to the right ones will DBWIPE your database automatically to the new version.

    When he creates a EVENT_CLOSE event
    As you can see from the video you can add triggerwords to npcs using /npcx npc triggerword add NPCID TRIGGERWORD response

    He makes use of of a predefined triggerword called EVENT_CLOSE which triggers when an NPC goes near a player and runs the reply command NPCATTACK (attack player)

    Unfortunately, I think in that particular version of NPCX he was using, event_close did not parse NPCATTACK or other reply commands, this _should_ be fixed in the new version but also take into consideration that the npc has a line of sight as well as only firing this event on the first time you match EVENT_CLOSE (just move away and back again)

    Item amounts on loottables
    Those with a keen eye will notice that the npc loot of stone only dropped one even though he defined 10 - this is something I didnt' know about so I need to fix :) More info like this is exactly the kind of questions this thread is for and the issue tracker at github

    Error out of sync
    When a player first dies, he is given a new Player, effectively the npc is detecting that your old player has gone and that message is informing you that your player is being resynced.

    Because this is a very confusing thing for a normal non-op player to read, i have disabled this message in future versions

    The commands used
    With any of the commands he used you can type just the start of the command to retrieve the full syntax, for example when he is typgin /npcx spawngroup add 1 ... you could simply type /npcx spawngroup to see the full syntax. Clearly sam is well familiar with the commands and new starters might find this bit of advice useful when trying it themselves

    NPCIDs SpawnGroupIDs and Lottables! Oh My!

    I know IDs can be confusing, but it also gives you the advantage of having many NPCs with the same name. It's important to make use of the /npcx npc list, /npcx pathgroup list, /npcx spawngroup list commands etc to be able to find your correct IDs, so many people make the mistake of typing a NAME instead of an ID !

    You can also add parameters to /npcx npc list Fre - would list NPC Fred and his ID etc - this works for spawngroups too and maybe more, i can't remember them all

    Item Damage
    He makes use of a diamond sword in this video but it's important to note that gold swords do more damage! (to try to help with gold's lack of purpose in minecraft)

    Using /civ here to get an area info

    Also useful to note that the command '/civ here' will also list any members of that plot
    -
    Just wanted to shout out to Sam, great video and covers alot! Also good to see a fellow brit posting videos!
     
  13. Offline

    leadphalanx

    Awesome, although I can't figure out how to put players into a faction
     
  14. Offline

    mixxit

    That's cause a faction only becomes aware of the player after he has done something to make them happy or upset
    (Ie killed a friend or enemy of theirs)

    A faction BASE standing is what it will fall back on in this case (0 neutral 1000 ally -1001 killed on sight)
     
  15. Offline

    Luong

    Here is the sql script to delete NPCX tables. I have it in a text file with the extension '.sql' and executed within the MySQL IDE. Hopefully the dev don't mind me posting the code to remove the tables for his plugins.

    Code:
    /* ************************************************ */
    /* Removing NPCX Constraints                        */
    /* ************************************************ */
    
    /* Remove NPC Spawngroup Tables */
    DROP TABLE IF EXISTS spawngroup_entries;
    DROP TABLE IF EXISTS spawngroup;
    
    /* Remove NPC Pathgroup Tables */
    DROP TABLE IF EXISTS pathgroup_entries;
    DROP TABLE IF EXISTS pathgroup;
    
    /* Remove NPC Zone Tables */
    DROP TABLE IF EXISTS zone_members;
    DROP TABLE IF EXISTS zone;
    
    /* Remove NPC Misc Tables */
    DROP TABLE IF EXISTS npc_faction;
    DROP TABLE IF EXISTS npc_triggerwords;
    
    /* ************************************************ */
    /* Removing Player Constraints                      */
    /* ************************************************ */
    
    /* Remove Player Quest Tables */
    DROP TABLE IF EXISTS player_quests;
    DROP TABLE IF EXISTS quests;
    
    /* Remove Player PvP Flag Tables */
    DROP TABLE IF EXISTS player_flags;
    DROP TABLE IF EXISTS flags;
    
    /* Remove Player Misc Table */
    DROP TABLE IF EXISTS player_bank;
    DROP TABLE IF EXISTS player_faction;
    
    /* ************************************************ */
    /* Removing Other Constraints                       */
    /* ************************************************ */
    
    /* Remove NPC & Player Tables */
    DROP TABLE IF EXISTS npc;
    DROP TABLE IF EXISTS player;
    
    /* ************************************************ */
    /* Removing Remaining Tables                        */
    /* ************************************************ */
    
    /* Remove Merchant Tables */
    DROP TABLE IF EXISTS merchant_entries;
    DROP TABLE IF EXISTS merchant;
    
    /* Remove Lootable Tables */
    DROP TABLE IF EXISTS loottable_entries;
    DROP TABLE IF EXISTS loottables;
    
    /* Remove MISC Tables */
    DROP TABLE IF EXISTS faction_list;
    DROP TABLE IF EXISTS settings;
    DROP TABLE IF EXISTS storage;
    
    As for a simple create/delete static npc from database, I will let you figure it out. I still haven't finish coding all the stored procedures (a.k.a. routines) for them anyways.
     
  16. Offline

    Pomme72

    RTFM ? What does it mind please, I'm so sorry, I'm french and my english's so bad... :(
     
  17. Offline

    Luong

    Read The F****** Manual
     
  18. Offline

    mixxit

    It means read the frackin manual XD
     
  19. Offline

    leadphalanx

    Alright, that clears up a lot. However, I'm now having an issue trying to be an ally of a base -1000 NPC. I modified my standing with the faction to 1000, but it still attacks me.
     
  20. Offline

    Pomme72

    Oooh, Okay ! :p

    Yeah yeah I read it, and I installed well the plugin, but It don't work :(
     
  21. Offline

    mixxit

    When an error occurs, this will dump to the server.log file. Checking your log files for errors are just part of running a server and providing debugging feedback. The error in the console states stacktrace, this is what developers ask for when they say:
    [​IMG]

    'Doesn't work' is as general a question as the answer 'do stuff' is - neither provides assistance.

    The readme states clearly that you need the basic skills to debug this and where to submit your issues if there are indeed any
     
  22. Offline

    Pomme72

    Ooooh, okay, okay ! :)

    So I just try to reinstall it, and I Copy/past the error in the console of my server here, right ?
     
  23. Offline

    Luong

    Btw, those that are interested in store procedures, here's some basic ones for you guys to get started. These procedures are used in creating a basic static civilian npc. From there, you can decide whether or not it is worth your time learning store procedures to create more advance one.

    'CreateNPC.SQL'
    Code:
    DELIMITER $$
    
    CREATE PROCEDURE CreateNPC
    (
        IN sName VARCHAR(32)
    )
    BEGIN
    
        /* Create npc */
        INSERT INTO npc
        (
            name ,
            weapon , helmet , chest , legs , boots ,
            hp , damage , coin
        )
        VALUES
        (
            sName ,
            267 , 0 , 307 , 308 , 309 ,
            100 , 3 , 100
        );
    
    END
    
    'CreateSpawngroup.SQL'
    Code:
    DELIMITER $$
    
    CREATE PROCEDURE CreateSpawngroup
    (
        IN sName VARCHAR(32) ,
        IN fPosX FLOAT , fPosY FLOAT , fPosZ FLOAT ,
        IN fYaw FLOAT , fPitch FLOAT
    )
    BEGIN
    
        /* Create spawn group specifically for npc */
        INSERT INTO spawngroup
        (
            name ,
            x , y , z ,
            yaw , pitch
        )
        VALUES
        (
            sName ,
            fPosX + 0.5 , fPosY , fPosz + 0.5 ,
            fYaw + 90.0 , fPitch
        );
    
    END
    
    
    'CreateSpawnNPC.SQL'
    Code:
    DELIMITER $$
    
    CREATE PROCEDURE CreateSpawnNPC
    (
        IN iSpawngroupID INT UNSIGNED ,
        IN iNPCID INT UNSIGNED
    )
    BEGIN
    
        /* Link npc to spawngroup */
        INSERT INTO spawngroup_entries
        (
            spawngroupid ,
            npcid
        )
        VALUES
        (
            iSpawngroupID ,
            iNPCID
        );
    
    END
    
    'CreateStaticNPC.SQL'
    Code:
    DELIMITER $$
    
    CREATE PROCEDURE CreateStaticNPC
    (
        IN sName VARCHAR(32) ,
        IN fPosX FLOAT , fPosY FLOAT , fPosZ FLOAT ,
        IN fYaw FLOAT , fPitch FLOAT
    )
    BEGIN
    
        /* Initial variables */
        DECLARE iSpawngroupID , iNPCID INT UNSIGNED;
    
        /* Create and get spawngroup id */
        CALL CreateSpawngroup
        (
            sName ,
            fPosX , fPosY , fPosZ ,
            fYaw , fPitch
        );
        SET iSpawngroupID = LAST_INSERT_ID();
    
        /* Create and get npc id */
        CALL CreateNPC
        (
            sName
        );
        SET iNPCID = LAST_INSERT_ID();
    
        /* Link npc to spawngroup */
        CALL CreateSpawnNPC( iSpawngroupID , iNPCID );
    
    END
    
    Usage Example:
    'ExampleNPC.sql'
    Code:
    /* Create npc */
    CALL CreateStaticNPC( 'Blarg' , -233 , 112.5 , 63 , 90 , 0 );
    CALL SetReply( 1 , 'Hello!' , 'Hello newcomer, now leave me alone.' ); /* This is the default opening message */
    CALL SetReply( 1 , 'Blarg , 'Go run along like a little kid, and don't waste my time.' );
    CALL SetReply( 1 , 'Help' , 'You're not worth my time.' );
    To be honest, I think it would be super amazing if you somehow made the plugin able to call the stored procedures in our database XD lol
     
  24. Offline

    mixxit

    Possible but then the cache wouldn't match the db!
     
  25. Offline

    leadphalanx

    hmm.... it seems my npc is completely ignoring my player faction status, and will attack(or not attack) based only on the base faction amount.
     
  26. Offline

    Luong

    Ah, true, but then i have to reload the server constantly (, since it's easier to edit the text in db) to fix up the chat message from preventing the words get split in half ^^; I guess there is no point. Do you know what font the game uses? That way I can use notepad with specific window size to match the ingame chat box to format my text.

    I was surprise that there was no colour text. Guess you can't just use anther's person plugin to colour your own text, since I wanted to colour code the keywords. Might be something worth considering ^_~
     
  27. Offline

    mixxit

    with which version?

    keywords are automatically colour coded in one of the new versions, anything you type in [] gets turned ColorCode.LIGHT_PURPLE

    You can get a longer chat box by making your window wide :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  28. Offline

    leadphalanx

    0.448 and I am on bukkit build 617. I'll go grab 0.449 and see if that does anything
     
  29. Offline

    mixxit

    See the patch notes, discusses exactly what you said :)
     
  30. Offline

    Luong

    Oh really, looking forward to it =D

    Also for the chat box, we can do that? :confused: I did not know that, i thought it was a fix size. Guess doing all that formatting was pointless then =/
     
  31. Offline

    leadphalanx

    Fantastic, everything is in good order now, thanks
     

Share This Page