Thread: npc forceChat help

Results 1 to 4 of 4
  1. #1 npc forceChat help 
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    hello I would like to add, a forceChat of some sayings like "You cannot beat me"
    stuff like that randomly in combat with the npc and i would like to know how you can get it to say something as soon as you attack it, i know were to add it just not sure how i could do it please help REP++ for helper
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    Reply With Quote  
     

  2. #2  
    RevolutionX PK
    All3n's Avatar
    Join Date
    Jul 2010
    Posts
    1,172
    Thanks given
    1,380
    Thanks received
    527
    Rep Power
    982
    npcs[i].forceChat("Hi I'm an npc.");

    To make them talk all the time go to NPCHandler.java under the npc folder search for process() and put this under that void

    if (npcs[i].npcType == NPCID){
    if (Misc.random(2) <= 3) {
    npcs[i].updateRequired = true;
    npcs[i].forceChat("I'm talking all the time!!!!");
    }

    }

    To make it when you attack the npc:
    Search:
    CombatAssitant.java - attackNPC(int i) {

    if (Server.npcHandler.npcs[i].npcType == NPCID){
    if (Misc.random(2) <= 3) {
    Server.npcHandler.npcs[i].updateRequired = true;
    Server.npcHandler.npcs[i].forceChat("I'm talking all the time!!!!");
    }

    }
    The code above also doesn't make them talk every time you attack them als if you wanted to make them say random things make the code this:

    if (Server.npcHandler.npcs[i].npcType == NPCID){
    rand = Misc.random(3);
    Server.npcHandler.npcs[i].updateRequired = true;
    if (rand == 0) {
    //no chat here
    } else if (rand == 1) {
    Server.npcHandler.npcs[i].forceChat("My chat #1!!!!");
    } else if (rand == 2) {
    Server.npcHandler.npcs[i].forceChat("MY chat #2!!!!");
    } else if (rand == 3) {
    Server.npcHandler.npcs[i].forceChat("My chat #4!!!!");
    }
    }

    }
    The code above makes them talk 3/4 of the time saying different things.

    Hope I helped
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    *edit umm he still isnt talking like i need this for my boss when i attack him i want him to say stoof
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    Fixed*
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] Get a NPC forcechat every second.
    By dark-natural in forum Help
    Replies: 3
    Last Post: 04-15-2011, 02:49 PM
  2. Replies: 2
    Last Post: 07-28-2010, 05:30 PM
  3. Replies: 2
    Last Post: 07-28-2010, 05:12 PM
  4. [PI] NPC forcechat conversion
    By Rugrats in forum Help
    Replies: 3
    Last Post: 07-03-2010, 05:53 PM
  5. NPC Forcechat?
    By Mr Fox in forum Help
    Replies: 2
    Last Post: 06-25-2010, 12:25 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •