EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Mend code snippet (https://www.eqemulator.org/forums/showthread.php?t=1645)

Wiz 05-02-2002 11:51 PM

Mend code snippet
 
Here's a mend code snippet. It has skill checks, 25% healing and skill advancement.

NOTE: This won't increase skill beyond 101, since skill above 100 is useless :p

Insert into client_process.cpp

(EDIT: Fixed a couple dumb errors)

Code:

                        case OP_Mend:
                                        {
                                                int mendhp = GetMaxHP() / 4;
                                                int noadvance = (rand()%200);
                                                int currenthp = GetHP();
                                                if (rand()%100 <= GetSkill(MEND)) {
                                                    SetHP(GetHP() + mendhp);
                                                    SendHPUpdate();
                                                        Message(4, "You mend your wounds and heal some damage");
                                                }
                                                else if (noadvance > 175 && currenthp > mendhp) {
                                                    SetHP(GetHP() - mendhp);
                                                    SendHPUpdate();
                                                        Message(4, "You have worsened your wounds!"
                                                }
                                                else if (noadvance > 175 && currenthp <= mendhp) {
                                                    SetHP(1);
                                                    SendHPUpdate();
                                                        Message(4, "You have worsened your wounds!");
                                                }
                                                else        {
                                                        Message(4, "You fail to mend your wounds");
                                                }
                                                if ((GetSkill(MEND) < noadvance) && (rand()%100 < 35) && (GetSkill(MEND) < 101))
                                                        this->SetSkill(MEND,++pp.skills[MEND]);
                                                break;
                                        }


05-03-2002 07:58 PM

i think the text for a failed mend + hurting yourself is "you worsen your wounds." or "you have worsened your wounds."


All times are GMT -4. The time now is 07:31 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.