ThunderMS - Because fun is a part of your life

Would you like to react to this message? Create an account in a few clicks or log in to continue.
ThunderMS - Because fun is a part of your life

Our users have posted a total of 4569 messages in 679 topics!
We have 8916 registered users, the newest registered user is xkyuzaki.


    Summoning ZAK with EYE

    HermitDash
    HermitDash


    Number of posts : 293
    Age : 31
    Location : Brooklyn NYC
    Warning :
    Summoning ZAK with EYE Left_bar_bleue0 / 1000 / 100Summoning ZAK with EYE Right_bar_bleue

    Character Name : iKitten.
    Registration date : 2008-04-29

    Summoning ZAK with EYE Empty Summoning ZAK with EYE

    Post by HermitDash Sat May 31, 2008 11:14 am

    Okay guys, I promised the dude from the other thread that I will release the code. So.. Here it is!

    What's included?

    1. Summoning Zakum by dropping an Eye of Fire over the altar.
    2. Zakum wouldn't be summoned if there is already one out there.
    3. Optional Music changes into "Final Fight".
    4. Optional Body could not be hit until arms are down.

    Known bugs:

    1. No delay between the dropping and the summoning.
    2. You must drop all of the eyes in your possession, unless it won't be summoned.
    3. Although damage is shown upon body, you don't deal it unless arms are dead. (If you have BOSS HP BAR script, you will notice that the bar only pops up after the arms are dead).

    To the code:

    Go to "MapleInventoryManipulator.java".

    Make sure the following classes are included:

    Code:

    import java.awt.Point;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Arrays;

    import net.sf.odinms.server.life.MapleMonster;
    import net.sf.odinms.client.Equip;
    import net.sf.odinms.client.IItem;
    import net.sf.odinms.client.InventoryException;
    import net.sf.odinms.client.Item;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.MapleInventoryType;
    import net.sf.odinms.server.life.MapleLifeFactory;
    import net.sf.odinms.tools.MaplePacketCreator;
    import net.sf.odinms.server.maps.MapleMapObject;
    import net.sf.odinms.server.maps.MapleMapObjectType;

    Now find the line c.getPlayer().getMap().spawnItemDrop(c.getPlayer() , c.getPlayer(), source, dropPos, true,true);
    (It's most likely the last line of actual code).

    Add the following code before that line:

    Code:

    if(source.getItemId() == 4001017&& c.getPlayer().getMapId() == 280030000 && dropPos.x > -63 && dropPos.x < 17 ){
    List<MapleMapObject> mobs = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
    if (!mobs.isEmpty()) return;
    // c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.musicChange("Bgm06/FinalFight")); UNCOMMENT THIS LINE ONLY IF YOU HAVE ROZENE'S MUSIC CHANGE PACKET INSTALLED.
    MapleMonster zbody = MapleLifeFactory.getMonster(8800000);
    MapleMonster zarm1 = MapleLifeFactory.getMonster(8800003);
    MapleMonster zarm2 = MapleLifeFactory.getMonster(8800004);
    MapleMonster zarm3 = MapleLifeFactory.getMonster(8800005);
    MapleMonster zarm4 = MapleLifeFactory.getMonster(8800006);
    MapleMonster zarm5 = MapleLifeFactory.getMonster(8800007);
    MapleMonster zarm6 = MapleLifeFactory.getMonster(8800008);
    MapleMonster zarm7 = MapleLifeFactory.getMonster(8800009);
    MapleMonster zarm8 = MapleLifeFactory.getMonster(8800010);
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zbody, new Point (-4,-215) );
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm1, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm2, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm3, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm4, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm5, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm6, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm7, new Point (-4,-215));
    c.getPlayer().getMap().spawnMonsterOnGroudBelow(zarm8, new Point (-4,-215));
    return;
    }

    Can you find the commented line? (If you can't, you're a total leecher.)
    In order to have it working (otherwise it will give you an error atm you uncomment it) - you'll need to get Rozene's Music Change Packet script - from over here. Thanks Rozene for the code, it really adds much to the battle ;D

    Almost done!
    OPTIONAL - do the following only if you wish to have the Zak's body invincible until arms are dead!

    Next thing you do is to go to "MapleMonster.java".

    Check if it includes everything as this one (unless you made changes to this class yourselves, you could just copy and past it over the old includes):

    Code:

    import java.lang.ref.WeakReference;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.LinkedHashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    import java.awt.Point;
    import java.util.Random;
    import java.util.Map.Entry;
    import java.util.concurrent.ScheduledFuture;

    import net.sf.odinms.client.MapleBuffStat;
    import net.sf.odinms.client.MapleCharacter;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.status.MonsterStatus;
    import net.sf.odinms.client.status.MonsterStatusEffect;
    import net.sf.odinms.net.MaplePacket;
    import net.sf.odinms.server.maps.MapleMapObject;
    import net.sf.odinms.net.channel.ChannelServer;
    import net.sf.odinms.net.world.MapleParty;
    import net.sf.odinms.net.world.MaplePartyCharacter;
    import net.sf.odinms.scripting.EventInstanceManager;
    import net.sf.odinms.server.TimerManager;
    import net.sf.odinms.server.life.MapleMonsterInformationProvider.DropEntry;
    import net.sf.odinms.server.maps.MapleMap;
    import net.sf.odinms.server.maps.MapleMapObjectType;
    import net.sf.odinms.tools.ArrayMap;
    import net.sf.odinms.tools.MaplePacketCreator;

    Look for the line: public void damage(MapleCharacter from, int damage, boolean updateAttackTime) {

    Below it there's a line AttackerEntry attacker = null;

    Below that line you should add the following code:

    Code:

    List<MapleMapObject> mobs = map.getMapObjectsInRange(new Point(0,0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
    if(map.getId() == 280030000 && this.getId() == 8800000 && mobs.size() > 1 ) return;

    Congratulations! You are done!
    You should have a fully functioning Zakum summoning system!<3
    I hope you'll find the code useful. Tell me if you do, I'll be glad to know that ;D

      Current date/time is Sun May 19, 2024 1:51 am