Morph

Results 1 to 11 of 11
  1. #1
    .. .-- - .-.. .. ...- . iwtLive is offline
    MemberRank
    Sep 2012 Join Date
    260Posts

    Morph

    Ok so I got the transformation potion from christmas events to work now I have a small problem, I don't know how to correctly transform a player into a morph (My handler is working all fine).
    PHP Code:
                        List<Pair<MapleBuffStatInteger>> list = new ArrayList<>();
                        
    int morph randomMorph();
                        list.
    add(new Pair<>(MapleBuffStat.MORPHmorph));
                        
    victim.setBuffedValue(MapleBuffStat.MORPHmorph);
                        
    victim.announce(MaplePacketCreator.giveBuff(00, list));
                        
    victim.getMap().broadcastMessage(victimMaplePacketCreator.giveForeignBuff(victim.getId(), list)); 
    This will transform them into the random morph but it will not put up that small icon at the top right that lets them easily cancel it by right clicking it. Does anyon know how to do that?


  2. #2
    :l Cygnus is offline
    MemberRank
    Mar 2015 Join Date
    f425Location
    237Posts

    Re: Morph

    This will apply the item to the player.
    Code:
    MapleItemInformationProvider.getInstance().getItemEffect(id).applyTo(c.getPlayer());

  3. #3
    .. .-- - .-.. .. ...- . iwtLive is offline
    MemberRank
    Sep 2012 Join Date
    260Posts

    Re: Morph

    Quote Originally Posted by Cygnus View Post
    This will apply the item to the player.
    Code:
    MapleItemInformationProvider.getInstance().getItemEffect(id).applyTo(c.getPlayer());
    Ok so these are the morph IDs im using for the potion:
    PHP Code:
            int[] morphs = {
                
    12345678912,
                
    1617182122232425,
                
    2627282930363839,
                
    404243444549
            
    }; 
    But i'm assuming that it's not what i'm supposed to put instead of the id.. Right?

  4. #4
    Account Upgraded | Title Enabled! jadeling is offline
    MemberRank
    Jul 2008 Join Date
    706Posts

    Re: Morph

    try search it on the end of applyBuffEffect for giveBuff part...

  5. #5
    :l Cygnus is offline
    MemberRank
    Mar 2015 Join Date
    f425Location
    237Posts

    Re: Morph

    I don't know how you're implementing it, nor which version you're working with, or which version this potion was used, but I'd assume in gms, using this item would shuffle an array of potential morph potions and apply a random one. Since most morphs have co-responding Use items, you could probably just select a random morph potion from an array when applying the item to the player.

  6. #6
    .. .-- - .-.. .. ...- . iwtLive is offline
    MemberRank
    Sep 2012 Join Date
    260Posts

    Re: Morph

    Quote Originally Posted by jadeling View Post
    try search it on the end of applyBuffEffect for giveBuff part...
    i already searched around there before but i really dont understand how it works, also there is no giveBuff part there o-o!

    Quote Originally Posted by Cygnus View Post
    I don't know how you're implementing it, nor which version you're working with, or which version this potion was used, but I'd assume in gms, using this item would shuffle an array of potential morph potions and apply a random one. Since most morphs have co-responding Use items, you could probably just select a random morph potion from an array when applying the item to the player.
    v83 Solaxia source, potion ID: 2212000 (the one you can get on christmas).
    Oh so you're saying that each morph has an item?

  7. #7
    Account Upgraded | Title Enabled! jadeling is offline
    MemberRank
    Jul 2008 Join Date
    706Posts

    Re: Morph

    I mean in MapleStatEffect :O

  8. #8
    .. .-- - .-.. .. ...- . iwtLive is offline
    MemberRank
    Sep 2012 Join Date
    260Posts

    Re: Morph

    Quote Originally Posted by jadeling View Post
    I mean in MapleStatEffect :O
    Yes that's where I was looking xD

  9. #9
    :l Cygnus is offline
    MemberRank
    Mar 2015 Join Date
    f425Location
    237Posts

    Re: Morph

    Item.wz->Consume->0221.img
    example code
    Code:
        public void randomMorph() {
            int[] Morphs = {2210001, 2210002, 2210003, 2210004};
            Random rng = null;
            int id = rng.nextInt(Morphs.length);
            MapleItemInformationProvider.getInstance().getItemEffect(Morphs[id]).applyTo(c.getPlayer());
        }

  10. #10
    Account Upgraded | Title Enabled! jadeling is offline
    MemberRank
    Jul 2008 Join Date
    706Posts

    Re: Morph

    Quote Originally Posted by dorkie4ever View Post
    Yes that's where I was looking xD
    paste me your applyBuffEffect :D

  11. #11
    .. .-- - .-.. .. ...- . iwtLive is offline
    MemberRank
    Sep 2012 Join Date
    260Posts

    Re: Morph

    The transformation potion has this attribute in the xml called randomMorph while the other potions have it called morph only. I'm guessing that the source is not coded to read that, but even if it does. How do I make it work? Simply putting in the id of the potion in that function does not work x:



Advertisement