Thread: Void to make NPC's talk?

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 Void to make NPC's talk? 
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    5,031
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    I think most winterLove servers already have this - But can someone give me the void to make NPC's talk?

    I'm using a cleaned DeltaScape source...

    ---------- Post added at 07:19 PM ---------- Previous post was at 07:18 PM ----------

    By the way - I need this for barrows. I'm trying to make full barrows.

    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Posts
    1,043
    Thanks given
    209
    Thanks received
    46
    Rep Power
    0
    Quote Originally Posted by Diabolus View Post
    I think most winterLove servers already have this - But can someone give me the void to make NPC's talk?

    I'm using a cleaned DeltaScape source...

    ---------- Post added at 07:19 PM ---------- Previous post was at 07:18 PM ----------

    By the way - I need this for barrows. I'm trying to make full barrows.
    you dont need any void...

    in NPCHandler.java
    search for:
    Code:
    "Moo"
    you see something like:
    Code:
    					if (npcs[i].npcType == 81 || npcs[i].npcType == 397 || npcs[i].npcType == 1766 || npcs[i].npcType == 1767 || npcs[i].npcType == 1768) {
    						if (misc.random2(50) == 1) {
    							npcs[i].updateRequired = true;
    							npcs[i].textUpdateRequired = true;
    							npcs[i].textUpdate = "Moo";
    Code:
    npcs[i].npcType == 1766 // is the npc that talks.	
    misc.random2(50) == 1 //is how frequently that npc talks.
    npcs[i].textUpdate = "Moo"; // what do they say every time the misc.random2 returns the integer 1
    thats the cow xD
    Reply With Quote  
     

  3. #3  
    Registered Member
    Core's Avatar
    Join Date
    Sep 2007
    Posts
    4,194
    Thanks given
    11
    Thanks received
    393
    Rep Power
    1985
    Text above there heads or dialogue?
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    delta source doesnt have "moo"

    thats for your source...
    Reply With Quote  
     

  5. #5  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    5,031
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    I would like the one for text above head, please

    Reply With Quote  
     

  6. #6  
    I LOVE CHEESE


    Join Date
    Oct 2007
    Age
    29
    Posts
    1,153
    Thanks given
    7
    Thanks received
    8
    Rep Power
    104
    Npchandler at process idk were exactly but at process u add this:

    Code:
    f (npcs[i].npcType == ####) {
    						if (misc.random2(**) == 1) {//This Make it so it dosent "speak" all time o_O
    							npcs[i].updateRequired = true;
    							npcs[i].textUpdateRequired = true;
    							npcs[i].textUpdate = "////";
    						}
    }
    #### = NPCID
    ** = Add a misc.random dependign if u want him to say it a lot or it hardly say it (higher the number less he will say it)
    ////= enter your Text
    Reply With Quote  
     

  7. #7  
    Registered Member
    ViperSniper's Avatar
    Join Date
    Apr 2007
    Age
    30
    Posts
    2,417
    Thanks given
    367
    Thanks received
    82
    Rep Power
    976
    do you want them to speak when they spawn?
    Ps i added so noone but the person who summoned can attack
    use this to spawn them:
    add this in npchandler
    Code:
    public void SpawnAndAttack(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) {
    			// first, search for a free slot
    		int slot = -1;
    		for (int i = 1; i < maxNPCs; i++) {
    			if (npcs[i] == null) {
    				slot = i;
    				break;
    			}
    		}
    
    		if(slot == -1) return;		// no free slot found
                     if(HP <= 0) { // This will cause client crashes if we don't use this :) - ****
                      HP = 3000;
                    }
    		NPC newNPC = new NPC(slot, npcType);
    		newNPC.absX = x;
    		newNPC.absY = y;
    		newNPC.makeX = x;
    		newNPC.makeY = y;
    		newNPC.moverangeX1 = rangex1;
    		newNPC.moverangeY1 = rangey1;
    		newNPC.moverangeX2 = rangex2;
    		newNPC.moverangeY2 = rangey2;
    		newNPC.walkingType = WalkingType;
    		newNPC.HP = HP;
    		newNPC.MaxHP = HP;
    		newNPC.MaxHit = (int)Math.floor((HP / 100));
    		if (newNPC.MaxHit < 1) {
    			newNPC.MaxHit = 1;
    		}
    		if(npcType >= 2025 && npcType <= 2030){
    		newNPC.textUpdate = "You dare disturb my rest!";
    		newNPC.textUpdateRequired = true;
    		newNPC.barrowsPlayer = summonedBy;
    		}
    		newNPC.heightLevel = heightLevel;
                    newNPC.Respawns = Respawns;
                    newNPC.followPlayer = summonedBy;
    				newNPC.StartKilling = summonedBy;
    				newNPC.IsUnderAttack = true;
                    newNPC.followingPlayer = true;
    				client plr = (client) server.playerHandler.players[summonedBy];
    				
    		npcs[slot] = newNPC;
    	}
    add this in NPC.java
    Code:
    public int barrowsPlayer;
    open client.java and find:
    Code:
    case 72:
    Now in there find:
    Code:
    attacknpc = inStream.readUnsignedWordA();
    under that add:
    Code:
    int NPCID = server.npcHandler.npcs[attacknpc].npcType;
    if(NPCID >= 2025 && NPCID <= 2030){
    				if(server.npcHandler.npcs[attacknpc].barrowsPlayer != playerId){
    				sM(GetNpcName(NPCID)+" isn't interested in Attacking you.");
    				break;
    				}
    }
    :indeed:
    Reply With Quote  
     

  8. #8  
    I LOVE CHEESE


    Join Date
    Oct 2007
    Age
    29
    Posts
    1,153
    Thanks given
    7
    Thanks received
    8
    Rep Power
    104
    Viper may a take to =P? (leech xD)
    Reply With Quote  
     

  9. #9  
    Registered Member
    ViperSniper's Avatar
    Join Date
    Apr 2007
    Age
    30
    Posts
    2,417
    Thanks given
    367
    Thanks received
    82
    Rep Power
    976
    Use it if you want, i believe in open source.
    :indeed:
    Reply With Quote  
     

  10. #10  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    5,031
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    Viper, thanks so much man. You're awesome.

    ---------- Post added at 07:53 PM ---------- Previous post was at 07:40 PM ----------

    Dangit man. They don't say it when I click the chest...

    ---------- Post added at 08:12 PM ---------- Previous post was at 07:53 PM ----------

    Oh I get it now! I have to use like, in the object clicking method

    SpawnAndAttack(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) {

    Man, do you think you could like fill that out for me as an example for dharok? So I know what to put.

    ---------- Post added at 08:29 PM ---------- Previous post was at 08:12 PM ----------

    God damnit. I'm getting an error

    I have to use

    NPCHandler.SpawnAndAttack(blah, blah, blah, blah, etc); and it says 'NPCHandler cannot be applied in int, int, int, int, int, etc.

    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •