Thread: [Elvarg 3.1] How do I make the Magic Tab's Back to Original

Results 1 to 8 of 8
  1. #1 [Elvarg 3.1] How do I make the Magic Tab's Back to Original 
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    So I've only just started working with Elvarg 3.1 and I just wanted to know a couple of things:

    1) Is there anyway or changing Magic Tabs back to original modern, ancients etc.

    2) Could we get a few tutorials for starters using the project because everything is setup differently

    3) How do I set specific PlayerRights to use commands?

    Thank you, your regular poster in this Thread Section

    - Tomshere


    I also have a huge problem with the attacking NPC'S When you attack them the client recieves and error code and de-spawns the npc.

    This is the Error Code Server-Sided:


    Code:
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    	at java.util.ArrayList.rangeCheck(Unknown Source)
    	at java.util.ArrayList.get(Unknown Source)
    	at com.elvarg.world.entity.impl.npc.combat.MobCombatHandler.getMaxHit(MobCombatHandler.java:33)
    	at com.elvarg.cache.impl.definitions.NpcDefinition.getMaxHit(NpcDefinition.java:316)
    	at com.elvarg.world.entity.combat.formula.DamageFormulas.calculateMaxMeleeHit(DamageFormulas.java:31)
    	at com.elvarg.world.entity.combat.CombatFactory.getHitDamage(CombatFactory.java:77)
    	at com.elvarg.world.entity.combat.hit.QueueableHit.prepareHits(QueueableHit.java:127)
    	at com.elvarg.world.entity.combat.hit.QueueableHit.<init>(QueueableHit.java:45)
    	at com.elvarg.world.entity.combat.method.impl.MeleeCombatMethod.fetchDamage(MeleeCombatMethod.java:24)
    	at com.elvarg.world.entity.combat.Combat.doCombat(Combat.java:101)
    	at com.elvarg.world.entity.combat.Combat.onTick(Combat.java:59)
    	at com.elvarg.world.entity.impl.npc.NPC.onTick(NPC.java:35)
    	at com.elvarg.world.entity.updating.NpcUpdateSequence.executePreUpdate(NpcUpdateSequence.java:18)
    	at com.elvarg.world.entity.updating.NpcUpdateSequence.executePreUpdate(NpcUpdateSequence.java:1)
    	at com.elvarg.world.entity.impl.CharacterList.forEach(CharacterList.java:168)
    	at com.elvarg.world.World.sequence(World.java:213)
    	at com.elvarg.engine.GameEngine.run(GameEngine.java:35)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    And No error Client side?
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,835
    Thanks given
    10,233
    Thanks received
    197
    Rep Power
    3313
    Looks like getMaxHit contains an arrayList rangeCheck, which seems to be empty, but the method expects that it isn't.

    Provide us with your code in order to help more. To start off, show us getMaxHit() method from MobCombatHandler
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #3  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by MrClassic View Post
    Looks like getMaxHit contains an arrayList rangeCheck, which seems to be empty, but the method expects that it isn't.

    Provide us with your code in order to help more. To start off, show us getMaxHit() method from MobCombatHandler
    MobCombatHandler.java:
    Code:
    package com.elvarg.world.entity.impl.npc.combat;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import com.elvarg.world.entity.impl.npc.NPC;
    import com.elvarg.world.entity.impl.npc.combat.impl.Goblin;
    import com.elvarg.world.entity.impl.player.Player;
    
    public class MobCombatHandler {
    
    	public static MobCombatHandler mobCombatHandler = new MobCombatHandler();
    
    	private static final List<SpecialMob> mob_list = new ArrayList<>();
    
    	static {
    		mob_list.add(new Goblin());
    	}
    
    	public int getAttackAnimation(int id) {
    		return mob_list.get(id).getAttackAnimation();
    	}
    
    	public int getDefenceAnimation(int id) {
    		return mob_list.get(id).getDefenceAnimation();
    	}
    
    	public int getDeathAnimation(int id) {
    		return mob_list.get(id).getDeathAnimation();
    	}
    
    	public int getMaxHit(int id) {
    		return mob_list.get(id).getMaxHit();
    	}
    
    	public static MobCombatHandler executeCombat(Player player, NPC mob, int id) {
    		return mob_list.get(id).executeCombat(mob);
    	}
    }
    NpcDefinition.java:
    Code:
    public int getMaxHit() {
    		MobCombatHandler.mobCombatHandler.getMaxHit(maxHit);
    		return maxHit;
    	}
    DamageFormulas.java:
    Code:
    public static int calculateMaxMeleeHit(Character entity) {
    		double maxHit = 0;
    
    		if (entity.isNpc()) {
    			NPC npc = (NPC) entity;
    			maxHit = npc.getDefinition().getMaxHit();
    		} else {
    			Player player = (Player) entity;
    
    			double base = 0;
    			double effective = getEffectiveStr(player);
    			double strengthBonus = player.getBonusManager().getOtherBonus()[0];
    			double specialBonus = 1;
    
    			// Special effects also affect maxhit
    			if (player.isSpecialActivated()
    					&& player.getCombatSpecial().getCombatMethod().getCombatType() == CombatType.MELEE) {
    				specialBonus = player.getCombatSpecial().getStrengthBonus();
    			}
    
    			// Use our multipliers to adjust the maxhit...
    			base = (13 + effective + (strengthBonus / 8) + ((effective * strengthBonus) / 65)) / 11;
    
    			if (specialBonus > 1) {
    				base = (base * specialBonus);
    			}
    
    			// Obsidian effect is +10% damage
    			if (CombatEquipment.wearingObsidian(player)) {
    				base = (base * 1.2);
    			}
    
    			// Void melee is +10% damage
    			if (CombatEquipment.wearingVoid(player, CombatType.MELEE)) {
    				base = (base * 1.1);
    			}
    
    			maxHit = (base *= 1);
    
    		}
    CombatFactory.java:
    Code:
    public static HitDamage getHitDamage(Character entity, Character victim, CombatType type) {
    
    		int damage = 0;
    
    		if (type == CombatType.MELEE) {
    			damage = Misc.inclusive(1, DamageFormulas.calculateMaxMeleeHit(entity));
    
    			// Do melee effects with the calculated damage..
    
    		} else if (type == CombatType.RANGED) {
    			damage = Misc.inclusive(1, DamageFormulas.calculateMaxRangedHit(entity));
    Reply With Quote  
     

  5. #4  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,835
    Thanks given
    10,233
    Thanks received
    197
    Rep Power
    3313
    this method now:
    Code:
    return mob_list.get(id).getMaxHit();
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by MrClassic View Post
    this method now:
    Code:
    return mob_list.get(id).getMaxHit();
    what should I do man?
    Reply With Quote  
     

  7. #6  
    Rune-Server Affiliate

    Join Date
    Oct 2010
    Posts
    2,843
    Thanks given
    1,188
    Thanks received
    1,581
    Rep Power
    5000
    Which elvarg server is this? Code doesn't look familiar at all.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by Professor Oak View Post
    Which elvarg server is this? Code doesn't look familiar at all.
    I found it on the forum but I've decided just to redownload using your topic post and just gotta add all my spawns and dialogues and everything to it mate
    Reply With Quote  
     

  9. #8  
    Rune-Server Affiliate

    Join Date
    Oct 2010
    Posts
    2,843
    Thanks given
    1,188
    Thanks received
    1,581
    Rep Power
    5000
    Quote Originally Posted by Tomshere View Post
    what should I do man?
    This code:
    Code:
    public int getMaxHit() {
    		MobCombatHandler.mobCombatHandler.getMaxHit(maxHit);
    		return maxHit;
    	}
    Is wrong. It's trying to grab the maxhit from the "MobCombatHandler", I'm assuming it should be grabbing by id but it's grabbing by the def's maxhit, makes no sense? Also if you look in MobCombatHandler, it only has Goblins added.
    Code:
    static {
    		mob_list.add(new Goblin());
    	}
    So even if you made it grab by id, it would only work for goblins.

    Code:
    MobCombatHandler.mobCombatHandler.getMaxHit(maxHit);
    Remove that line of code to make it fetch the maxhit from the actual defs.
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 08-24-2009, 05:42 PM
  2. Replies: 12
    Last Post: 04-08-2009, 11:54 PM
  3. how do u make the skillz tab tele
    By mrprostat in forum Help
    Replies: 8
    Last Post: 02-19-2009, 10:11 AM
  4. Replies: 1
    Last Post: 06-24-2008, 03:47 AM
  5. how do i make the server name appear
    By Mr. Gangster in forum Tutorials
    Replies: 5
    Last Post: 02-09-2008, 07:24 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
  •