Thread: The Best Vengeance on Players and NPC

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 The Best Vengeance on Players and NPC 
    Hybrid Isle
    Guest
    Hello again xD

    Purpose: To add a real workinbg vengeance , no bugs in it ! That also workz on NPC and Players !

    Classes Modified: all client.java

    Credits: 85% I loot I ( me on moparscape ... if you don't believe me add me and i'll talk to you k ? [Only registered and activated users can see links. ])

    & 15% for zenzie for the booleans ...

    Procedure:

    open up client.java

    This is if your server is based on memberschip , check lower on how to add for non members !

    add this with your other voids :


    Code:
    public boolean vegeance = false;
    
    public void vengNPC(int maxDamage) { // vengeance on npc by I loot I
       if(server.npcHandler.npcs[attacknpc] != null) 
        {
            if (server.npcHandler.npcs[attacknpc].IsDead == false) {
    	int damage = misc.random(maxDamage);
            if (server.npcHandler.npcs[attacknpc].HP - hitDiff < 0) 
            damage = server.npcHandler.npcs[attacknpc].HP;
            server.npcHandler.npcs[attacknpc].StartKilling = playerId;
    	server.npcHandler.npcs[attacknpc].RandomWalk = false;
    	server.npcHandler.npcs[attacknpc].IsUnderAttack = true;
    	server.npcHandler.npcs[attacknpc].hitDiff = damage;
    	server.npcHandler.npcs[attacknpc].updateRequired = true;
    	server.npcHandler.npcs[attacknpc].hitUpdateRequired = true;
        } 
       }
      }
    
    public void warnplayer() { // warn players for the vengeance spell :p I loot I
    client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
    vengOnPlayer.sendMessage("A Vengeance Spell Has Been Cast On You");
    }
    
    public void warnplayer2() { // warn players for the vengeance spell :p I loot I
    client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
    vengOnPlayer.sendMessage("The Recoil Of Vengeance Has Effected You !");
    }
    
    public void castvengeancenpc() // improved vengeance by I loot I on npc
    {
    	if(IsAttackingNPC && VenganceTimer == 0 && vegeance == true && playerIsMember == 1) {
    	txt4 = "Taste vengeance !";
    	string4UpdateRequired = true;
    	startAnimation(1979);
    	staticAnimation(401, absX, absY, 100);
    	sendMessage("You have cast a perfect Vengeance !");
            vengNPC(30);
    	addSkillXP((3700 * hitDiff), 6);
    	addSkillXP((3700 * hitDiff), playerHitpoints);
    	waittimer = 30;
    	VenganceTimer = 25;
    	vegeance = false;
    	teleportToX = absX;
    	teleportToY = absY;
    	} else {
    	sendMessage("An Error Has Occured In Ur Vengeance !");
    	}
    }
    
    public void castvengeance() // improved vengeance by I loot I on players
    {
    	if(IsAttacking && !nonWild() && VenganceTimer == 0 && vegeance == true && PlayerHandler.players[AttackingOn] != null && playerIsMember == 1) {
    	txt4 = "Taste vengeance !";
    	string4UpdateRequired = true;
    	startAnimation(1979);
    	staticAnimation(401, absX, absY, 100);
    	sendMessage("You have cast a perfect Vengeance !");
    	warnplayer2();
    	PlayerHandler.players[AttackingOn].hitDiff = misc.random(30);
    	PlayerHandler.players[AttackingOn].updateRequired = true;
    	PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
    	waittimer = 30;
    	VenganceTimer = 25;
    	vegeance = false;
    	teleportToX = absX;
    	teleportToY = absY;
    	} else {
    	sendMessage("An Error Has Occured In Ur Vengeance !");
    	}
    }
    
    public int VenganceTimer = 0;
    public int waittimer = 0;
    now add this in boolean process

    Code:
    if(IsAttacking == true && VenganceTimer == 0 && vegeance == true && playerIsMember == 1) {
    castvengeance();
    }
    
    if(IsAttackingNPC == true && VenganceTimer == 0 && vegeance == true && playerIsMember == 1) {
    castvengeancenpc();
    }
    now i added vengeance in place of a ancients tele ( the second last tele ! )

    so change the case if u want

    Code:
    case 51031: // Vengeance 
    if(playerLevel[6] >= 115 && playerIsMember == 1 && waittimer == 0 && (IsAttacking || IsAttackingNPC))
    {
    vegeance = true;
    if(IsAttacking) {
    warnplayer();
    }
    VenganceTimer = 4;
    } else if(playerLevel[6] < 115) {
    sendMessage("You need a magic lvl of 115 to cast this Lunar Spell !");
    } else if(playerIsMember != 1) {
    sendMessage("Only Members Can Cast This Spell !");
    } else if(waittimer > 0) {
    sendMessage("You can only cast this spell every 15 secs !");
    } else {
    sendMessage("You need to be in a battle with a person or a monster !");
    }
    break;
    oke you need to add this to to make the timer workz .. (in boolean process

    Code:
    if (VenganceTimer > 0)
                        VenganceTimer -= 1;
    if(waittimer > 0) 
                waittimer -= 1;
    your done

    This is for Non Member servers !

    add this to your other voids

    Code:
    public boolean vegeance = false;
    
    public void vengNPC(int maxDamage) { // vengeance on npc by I loot I
       if(server.npcHandler.npcs[attacknpc] != null) 
        {
            if (server.npcHandler.npcs[attacknpc].IsDead == false) {
    	int damage = misc.random(maxDamage);
            if (server.npcHandler.npcs[attacknpc].HP - hitDiff < 0) 
            damage = server.npcHandler.npcs[attacknpc].HP;
            server.npcHandler.npcs[attacknpc].StartKilling = playerId;
    	server.npcHandler.npcs[attacknpc].RandomWalk = false;
    	server.npcHandler.npcs[attacknpc].IsUnderAttack = true;
    	server.npcHandler.npcs[attacknpc].hitDiff = damage;
    	server.npcHandler.npcs[attacknpc].updateRequired = true;
    	server.npcHandler.npcs[attacknpc].hitUpdateRequired = true;
        } 
       }
      }
    
    public void warnplayer() { // warn players for the vengeance spell :p I loot I
    client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
    vengOnPlayer.sendMessage("A Vengeance Spell Has Been Casted On You");
    }
    
    public void warnplayer2() { // warn players for the vengeance spell :p I loot I
    client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
    vengOnPlayer.sendMessage("The Recoil Of Vengeance Has Effect You !");
    }
    
    public void castvengeancenpc() // improved vengeance by I loot I on npc
    {
    	if(IsAttackingNPC && VenganceTimer == 0 && vegeance == true) {
    	txt4 = "Taste vengeance !";
    	string4UpdateRequired = true;
    	startAnimation(1979);
    	staticAnimation(401, absX, absY, 100);
    	sendMessage("You have cast a perfect Vengeance !");
            vengNPC(30);
    	addSkillXP((3700 * hitDiff), 6);
    	addSkillXP((3700 * hitDiff), playerHitpoints);
    	waittimer = 30;
    	VenganceTimer = 25;
    	vegeance = false;
    	teleportToX = absX;
    	teleportToY = absY;
    	} else {
    	sendMessage("An Error Has Occured In Ur Vengeance !");
    	}
    }
    
    public void castvengeance() // improved vengeance by I loot I on players
    {
    	if(IsAttacking && !nonWild() && VenganceTimer == 0 && vegeance == true && PlayerHandler.players[AttackingOn] != null) {
    	txt4 = "Taste vengeance !";
    	string4UpdateRequired = true;
    	startAnimation(1979);
    	staticAnimation(401, absX, absY, 100);
    	sendMessage("You have cast a perfect Vengeance !");
    	warnplayer2();
    	PlayerHandler.players[AttackingOn].hitDiff = misc.random(30);
    	PlayerHandler.players[AttackingOn].updateRequired = true;
    	PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
    	waittimer = 30;
    	VenganceTimer = 25;
    	vegeance = false;
    	teleportToX = absX;
    	teleportToY = absY;
    	} else {
    	sendMessage("An Error Has Occured In Ur Vengeance !");
    	}
    }
    
    public int VenganceTimer = 0;
    public int waittimer = 0;
    add this in boolean process

    Code:
    if(IsAttacking == true && VenganceTimer == 0 && vegeance == true) {
    castvengeance();
    }
    
    if(IsAttackingNPC == true && VenganceTimer == 0 && vegeance == true) {
    castvengeancenpc();
    }
    now add this in case 185 , its an ancients teleport so u probably need to delete the tele case !

    Code:
    case 51031: // Vengeance 
    if(playerLevel[6] >= 115 && waittimer == 0 && (IsAttacking || IsAttackingNPC))
    {
    vegeance = true;
    if(IsAttacking) {
    warnplayer();
    }
    VenganceTimer = 4;
    } else if(playerLevel[6] < 115) {
    sendMessage("You need a magic lvl of 115 to cast this Lunar Spell !");
    }  else if(waittimer > 0) {
    sendMessage("You can only cast this spell every 15 secs !");
    } else {
    sendMessage("You need to be in a battle with a person or a monster !");
    }
    break;
    oke you need to add this to to make the timer workz .. (in boolean process

    Code:
    if (VenganceTimer > 0)
                        VenganceTimer -= 1;
    if(waittimer > 0) 
                waittimer -= 1;
    add this in both servers if you don't have those voids yet !

    Code:
    	public void staticAnimation(int graphicID, int playerX, int playerY, int heightLevel) { /*Used from phates old stuff*/ // credits to phate for this bit :P
    		outStream.createFrame(85);
    		outStream.writeByteC(playerY - (mapRegionY * 8));
    		outStream.writeByteC(playerX - (mapRegionX * 8));
    		outStream.createFrame(4);
    		outStream.writeByte(0);				
    		outStream.writeWord(graphicID);			//	Graphic ID
    		outStream.writeByte(heightLevel);		//	Height above gorund
    		outStream.writeWord(0);					//	Pause before casting
    	}
    and if you get the startanimation error then just change 'start' to 'set' ...

    your done

    if this get some good comments , i'll release my other lunar spell to , nobody has it and it has no bugs to ...

    and thnx i'll probably add my healing group lunar spell to xD

    - I loot I -
     

  2. #2  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    very nice tut rep+
     

  3. #3  
    Registered Member
    waleed12345's Avatar
    Join Date
    Feb 2007
    Age
    28
    Posts
    814
    Thanks given
    14
    Thanks received
    4
    Rep Power
    113
    nice and can u post a pic of u doing vengence?
    Spoiler for Too big:
    [Only registered and activated users can see links. ]
     

  4. #4  
    Registered Member
    Join Date
    Jul 2006
    Age
    32
    Posts
    487
    Thanks given
    0
    Thanks received
    0
    Rep Power
    56
    If you're going to post a code make sure you use proper grammer.

    Cast is not Casted, it is just plain Cast and Effected is not Effect, it is just Effected. This isn't pre-school (Though most times you'd swear it is).
     

  5. #5  
    kilermage
    Guest
    I will use this on my server.
     

  6. #6  
    Oli Sykes
    Guest
    nice tut thanks
     

  7. #7  
    Hybrid Isle
    Guest
    thnx for the comments ,
    i want to post some pics , but it seems my laptop has some troubles with rune-server cause i can't see yet what ive posted , i'm now on my slow pc ... and doesn't has private server or anything on it

    so ... and i'll probably add my healing group lunar spell

    also i've edited the post , and srry for my english i'm dutch u know so i've some troubles in some tenses ...

    i've added the vengeance timer u need to add in boolean process i forgot -_-"

    - I loot I -
     

  8. #8  
    The Jax
    Guest
    I get so many errors.

    Code:
    client.java:45: cannot find symbol
    symbol  : variable txt4
    location: class client
            txt4 = "Taste vengeance !";
            ^
    client.java:46: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
            string4UpdateRequired = true;
            ^
    client.java:47: cannot find symbol
    symbol  : method startAnimation(int)
    location: class client
            startAnimation(1979);
            ^
    client.java:48: cannot find symbol
    symbol  : method staticAnimation(int,int,int,int)
    location: class client
            staticAnimation(401, absX, absY, 100);
            ^
    client.java:65: cannot find symbol
    symbol  : method nonWild()
    location: class client
            if(IsAttacking && !nonWild() && VenganceTimer == 0 && vegeance == true &
    & PlayerHandler.players[AttackingOn] != null && playerIsMember == 1) {
                               ^
    client.java:66: cannot find symbol
    symbol  : variable txt4
    location: class client
            txt4 = "Taste vengeance !";
            ^
    client.java:67: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
            string4UpdateRequired = true;
            ^
    client.java:68: cannot find symbol
    symbol  : method startAnimation(int)
    location: class client
            startAnimation(1979);
            ^
    client.java:69: cannot find symbol
    symbol  : method staticAnimation(int,int,int,int)
    location: class client
            staticAnimation(401, absX, absY, 100);
            ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    9 errors
    Press any key to continue . . .
     

  9. #9  
    l2 Java
    Guest
    Quote Originally Posted by The Jax View Post
    I get so many errors.

    Code:
    client.java:45: cannot find symbol
    symbol  : variable txt4
    location: class client
            txt4 = "Taste vengeance !";
            ^
    client.java:46: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
            string4UpdateRequired = true;
            ^
    client.java:47: cannot find symbol
    symbol  : method startAnimation(int)
    location: class client
            startAnimation(1979);
            ^
    client.java:48: cannot find symbol
    symbol  : method staticAnimation(int,int,int,int)
    location: class client
            staticAnimation(401, absX, absY, 100);
            ^
    client.java:65: cannot find symbol
    symbol  : method nonWild()
    location: class client
            if(IsAttacking && !nonWild() && VenganceTimer == 0 && vegeance == true &
    & PlayerHandler.players[AttackingOn] != null && playerIsMember == 1) {
                               ^
    client.java:66: cannot find symbol
    symbol  : variable txt4
    location: class client
            txt4 = "Taste vengeance !";
            ^
    client.java:67: cannot find symbol
    symbol  : variable string4UpdateRequired
    location: class client
            string4UpdateRequired = true;
            ^
    client.java:68: cannot find symbol
    symbol  : method startAnimation(int)
    location: class client
            startAnimation(1979);
            ^
    client.java:69: cannot find symbol
    symbol  : method staticAnimation(int,int,int,int)
    location: class client
            staticAnimation(401, absX, absY, 100);
            ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    9 errors
    Press any key to continue . . .
    Im pretty sure that means YOU did something wroong...
     

  10. #10  
    Crazy Cam10
    Guest
    l2 java you made me lol irl, you need to l2cjava

    You Don't Have Txt4 Or The Txt4updateboolean
    you Dont Have NonWild (Prolly Safezones), Add Startanimation Voids And Staticanim From Other Sources, Then That Should Do It
     

Page 1 of 3 123 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
  •