Results 1 to 11 of 11

Threaded View

  1. #1
    xbetim's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    42

    Cool Pet Heal (HP/MP) // only for Owner // New

    Hi, today i will show you the RIGHT pet heal (hp/mp)! (without Pet Attack)


    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using wServer.realm;
    using wServer.logic.attack;
    using wServer.logic.movement;
    using wServer.logic.loot;
    using wServer.logic.taunt;
    using wServer.logic.cond;
    
    namespace wServer.logic
    {
        partial class BehaviorDb
        {
            static _ Pets = Behav()
                .InitMany(0x1600, 0x1641, Behaves("Pet",
                    If.Instance(new PetBehaves(), PetChasing.Instance(9, 5, 1)),
                        Cooldown.Instance(1750, new PetHealHpMp()),
                        Cooldown.Instance(1750, new PetHealHpMp())
                ));
        }
    }

    And now make a new .cs file and rename it to: PetHealHpMp.cs

    Edit the PetHealHpMp.cs to:


    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using wServer.realm;
    using wServer.realm.entities;
    using wServer.svrPackets;
    
    namespace wServer.logic.cond
    {
        class PetHealHpMp : Behavior
        {
            protected override bool TickCore(RealmTime time)
            {
                float dist = 20;
                Player entity = (Host.Self.PlayerOwner) as Player;
                while (entity != null)
                {
                    int mp = entity.MP;
                    int maxMp = entity.Stats[1] + entity.Boost[1];
                    mp = Math.Min(mp + 15, maxMp);
                    if (mp != entity.MP)
                    {
                        int n = mp - entity.MP;
                        entity.MP = mp;
                        entity.UpdateCount++;
                        entity.Owner.BroadcastPacket(new ShowEffectPacket()
                        {
                            EffectType = EffectType.Potion,
                            TargetId = entity.Id,
                            Color = new ARGB(0xffffffff)
                        }, null);
                        entity.Owner.BroadcastPacket(new NotificationPacket()
                        {
                            ObjectId = entity.Id,
                            Text = "+" + n,
                            Color = new ARGB(0xff0000ff)
                        }, null);
                    }
                        int hp = entity.HP;
                        int maxHp = entity.Stats[0] + entity.Boost[0];
                        hp = Math.Min(hp + 35, maxHp);
                        if (hp != entity.HP)
                        {
                            int m = hp - entity.HP;
                            entity.HP = hp;
                            entity.UpdateCount++;
                            entity.Owner.BroadcastPacket(new ShowEffectPacket()
                            {
                                EffectType = EffectType.Potion,
                                TargetId = entity.Id,
                                Color = new ARGB(0xffffffff)
                            }, null);
                            entity.Owner.BroadcastPacket(new ShowEffectPacket()
                            {
    
                                EffectType = EffectType.Trail,
                                TargetId = Host.Self.Id,
                                PosA = new Position() { X = entity.X, Y = entity.Y },
                                Color = new ARGB(0xffffffff)
                            }, null);
                            entity.Owner.BroadcastPacket(new NotificationPacket()
                            {
                                ObjectId = entity.Id,
                                Text = "+" + m,
                                Color = new ARGB(0xffff0000)
                            }, null);
    
                            return true;
                        }
                        entity = null;
                    }
                    return false;
                }
            }
    }
    Save it and open SharpDevelop, go to wServer\logic and move the PetHealHpMp.cs file in the "cond" folder

    And now Rebuild the Solution!


    (U can change the hp and mp! go to: PetHealHpMp.cs and find: mp = Math.Min(mp + 15, maxMp); for MP or:
    hp = Math.Min(hp + 35, maxHp); for hp (change the blue numbers)

    Enjoy!
    Last edited by xbetim; 10-20-2014 at 01:53 PM.

Similar Threads

  1. New zealand players only for sale bf 3 and 4 pc
    By fishncips4T in forum Coupons, Deals and Discounts
    Replies: 0
    Last Post: 11-23-2013, 10:38 PM
  2. How to make pets heal on the new mmoe
    By Dragonlord3344 in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 31
    Last Post: 11-16-2013, 11:41 PM
  3. Searching for a new Co-Owner"MUST READ FIRST!"...
    By JAYDAH15 in forum Minecraft Discussions
    Replies: 5
    Last Post: 02-15-2013, 08:07 AM
  4. New CA Tele hack with anti kick u.s.w i try only for CA EU
    By elite40 in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 01-08-2010, 03:09 PM
  5. NEW MAP ONLY FOR CAE
    By x_GAZ_x in forum Combat Arms Hacks & Cheats
    Replies: 3
    Last Post: 04-16-2009, 08:20 AM