EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Stats Calculator. (https://www.eqemulator.org/forums/showthread.php?t=36192)

kmra247 01-01-2013 07:05 AM

Stats Calculator.
 
All right, so I'm wanting to set up a stats calculator, but my only issue you is it won't calculate Mana or Health, all the other things work, when I put this two in it refuses to tell you anything, will post current code below that works.

Code:

sub EVENT_SAY
{

        my $stats = quest::saylink("stats", 1);

               
    if($text=~/hail/i)
    {
        quest::say("Hey there $name, I'm really good at guessing your $stats. Go on, try me!");
    }
    elsif($text=~/stats/i)
        {
                $str = $client->GetSTR();
                $sta = $client->GetSTA();
                $agi = $client->GetAGI();
                $dex = $client->GetDEX();
                $wis = $client->GetWIS();
                $intel = $client->GetINT();
                $cha = $client->GetCHA();
                $ac = $client->GetAC();
                $atk = $client->GetATK();;
                quest::say("$name: AC: $ac ATK: $atk");
                quest::say("$name: Str: $str Sta: $sta Agi: $agi");
                quest::say("$name: Dex: $dex Wis: $wis Int: $intel Cha: $cha ");
        }
}


lerxst2112 01-01-2013 07:13 AM

Show us what you tried. There are GetMana() and GetHP() functions exported to perl.

kmra247 01-01-2013 07:24 AM

I tried $client->GetMaxHP and $client->GetMP.

Code:

$hp = $client->GetMaxHP();
$mana = $client->GetMP();


kmra247 01-01-2013 07:40 AM

Would there happen to be a list of the things for "$client->" anywhere?

Edit: Found a list I believe, http://www.eqemulator.net/wiki/wikka...a=QuestObjects.

Edit 2: In that url it lists GetHP();,GetMana();, GetMaxHP();, GetMaxMana();, so I don't understand why it wouldn't work, will test and see if it works.

Edit 3: Works.

sorvani 01-01-2013 01:08 PM

Is this just for display? You can give everyone access to #mystats

kmra247 01-01-2013 01:12 PM

I know, just for display. It's an optional stat checker, incase they don't want to use #mystats or don't know how.

kmra247 01-06-2013 02:25 AM

Completed script below:

Code:

sub EVENT_SAY
{

        my $stats = quest::saylink("stats", 1);
        my $NPCNAME = $npc->GetCleanName();

               
    if($text=~/hail/i)
        {
                $client->Message(315, "$NPCNAME whispers to you, 'Hey there $name, I'm really good at guessing your $stats. Go on, try me!'");
    }
    elsif($text=~/stats/i)
        {
                $str = $client->GetSTR();
                $sta = $client->GetSTA();
                $agi = $client->GetAGI();
                $dex = $client->GetDEX();
                $wis = $client->GetWIS();
                $intel = $client->GetINT();
                $cha = $client->GetCHA();
                $ac = $client->GetAC();
                $atk = $client->GetATK();
                $hp = $client->GetHP();
                $hp2 = $client->GetMaxHP();
                $mana = $client->GetMana();
                $mana2 = $client->GetMaxMana();
                $end = $client->GetEndurance();
                $end2 = $client->GetMaxEndurance();
                $aa = $client->GetAAPoints();
                $aa2 = $client->GetSpentAA();
               
                $client->Message(314, "----------------------------------------------------------------");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Current Health: $hp Max Health: $hp2'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Current Endurance: $end Max Endurance: $end2'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Current Mana: $mana Max Mana: $mana2'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Total AA Points: $aa Spent AA Points: $aa2'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Armor Class: $ac Attack: $atk'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Strength: $str Stamina: $sta Agility: $agi'");
                $client->Message(315, "$NPCNAME whispers to you, '$name: Dexterity: $dex Wisdom: $wis Intelligence: $intel Charisma: $cha'");
                $client->Message(314, "----------------------------------------------------------------");
        }
}

sub EVENT_ITEM
{
  quest::say("I do not need this.");
  quest::givecash($copper,$silver,$gold,$platinum);
  plugin::return_items(\%itemcount);
}


thepoetwarrior 04-19-2013 03:44 AM

Any way via perl to get players Resist and Heroic Resist?

thepoetwarrior 04-19-2013 04:54 AM

Never mind, did GetMR() GetFR() get and seems to work.

Wasn't listed on the object client page for quest.

NatedogEZ 04-19-2013 04:56 AM

Code:

       
inline virtual int16        GetMR()        const { return MR; }
inline virtual int16        GetFR()        const { return FR; }
inline virtual int16        GetDR()        const { return DR; }
inline virtual int16        GetPR()        const { return PR; }
inline virtual int16        GetCR()        const { return CR; }
inline virtual int16        GetCorrup()        const { return Corrup; }



I just search the code on GITHub

https://github.com/search?q=%40EQEmu...=searchresults


All times are GMT -4. The time now is 01:11 PM.

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