[REQUEST] Mana Pills.

09/20/2009 14:57 CompacticCo#1
I'd like to get Mana pills working, so my players can refresh mana, please help me out with this, I'm using powersoruce CO, it's almost complete.
09/20/2009 15:40 Basser#2
Here is an example. This is SoulPill. It works for me, but you might need to change MaxMP. Thank me if this helped.

Code:
            else if (ItemParts[0] == "1001040")//SoulPill
            {
                CurMP += 2000;
                if (CurMP > MaxMP)
                    CurMP = MaxMP;
                MyClient.SPack(General.MPack.Vital(UID, 2, CurMP));
                RemoveItem(ItemUID);
            }
09/20/2009 16:14 Empty Project#3
Code:
 case "1001040": // SoulPill
                        {
                            if (CurMP != MaxMP)
                            {
                                CurMP += 2000;
                                if (CurMP > MaxMP)
                                    CurMP = MaxMP;
                                LiveManager.SendPacket(SystemControl.MyPackets.Vital((long)UID, 2, CurMP));
                                RemoveItem(ItemUID);
                            }
                            break;
                        }
Or you could do this way also.
09/20/2009 18:06 -Shunsui-#4
From this codes you can also do the rest of the Mana Pots or The HP Pots
(EX. of HP Pot)

else if (ItemParts[0] == "1002020")//Vanilla
{
CurHP += 2000;
if (CurHP > MaxHP)
CurHP = MaxHP;
MyClient.SendPacket(General.MyPackets.Vital(UID, 0, CurHP));
RemoveItem(ItemUID);
}
09/20/2009 18:40 Basser#5
Exactly the same as I made, but mine was completed with MP >_>.
09/20/2009 19:46 CompacticCo#6
Ah, dam, It's not working, keep getting errors.
09/20/2009 20:18 -Shunsui-#7
Your mostlikely geting erros from hes
MyClient.SPack(General.MPack.Vital(UID, 2, CurMP));

SPack you mostlikely need to add in the variables just try

Code:
         else if (ItemParts[0] == "1001040")//SoulPill
            {
                CurMP += 2000;
                if (CurMP > MaxMP)
                    CurMP = MaxMP;
                MyClient.SendPacket(General.MyPackets.Vital(UID, 2, CurMP));
                RemoveItem(ItemUID);
            }
All Changed was

MyClient.SendPacket(General.MyPackets.Vital(UID, 2, CurMP));

Try that .
09/20/2009 20:41 Zion~#8
Problem solved.

#Request close
09/21/2009 12:49 tanelipe#9
#Closed