EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Quest question. (https://www.eqemulator.org/forums/showthread.php?t=39618)

serivoth1234 05-04-2015 04:04 PM

Okay I removed the level check, compiled, no errors everything loads just fine, however still no AAexp updates being sent.

serivoth1234 05-04-2015 04:20 PM

Okay it's working now. Now I just need to get it to run on the mobs death and actually pass it to the player.

ghanja 05-04-2015 04:41 PM

Quote:

Originally Posted by serivoth1234 (Post 239844)
Okay it's working now. Now I just need to get it to run on the mobs death and actually pass it to the player.

Show me the entire script where you tried using the code I provided for giving aa exp when a mob dies. Be sure to use [code ] blocks please.

serivoth1234 05-04-2015 05:07 PM

I got it working now. Works perfectly, thanks everyone for the assist I appreciate it. Ghanja your code worked as it is, I had a declaration out of place is all.

serivoth1234 05-04-2015 05:43 PM

Okay trying to get this to only fire off if the client is level 20 or above, however it works just fine without the if($ulevel >19)
Code:

sub EVENT_DEATH {
    if ($ulevel > 19){
        my @hate_list = $npc->GetHateList();
        my $hate_count = @hate_list;
        if ($hate_count > 0) {
                foreach $ent (@hate_list) {
                        $hate_entity = $ent->GetEnt();
                        $hate_client = $hate_entity->CastToClient();
                        if (($hate_entity->IsClient()) && (!$hate_client->IsBecomeNPC())) {
                                $hate_client->SetEXP($hate_client->GetEXP(),($hate_client->GetAAExp()+1000));
                                }
                        }
                }
        }
}


ghanja 05-04-2015 06:18 PM

Code:

sub EVENT_DEATH {
        my @hate_list = $npc->GetHateList();
        my $hate_count = @hate_list;
        if ($hate_count > 0) {
                foreach $ent (@hate_list) {
                        $hate_entity = $ent->GetEnt();
                        $hate_client = $hate_entity->CastToClient();
                        if (($hate_entity->IsClient()) && (!$hate_client->IsBecomeNPC())) {
                                if ($hate_client->GetLevel() > 19) {
                                        $hate_client->SetEXP($hate_client->GetEXP(),($hate_client->GetAAExp()+1000));
                                }
            }
                }
        }
}


serivoth1234 05-04-2015 06:24 PM

Awesome, works perfectly, thank you

Shendare 05-04-2015 06:44 PM

You da man, ghanja.

ghanja 05-04-2015 08:14 PM

Quote:

Originally Posted by Shendare (Post 239854)
You da man, ghanja.

Appreciate that heh, but I pale in comparison to many others here.

NatedogEZ 05-04-2015 08:37 PM

There is a sub event that already does that btw... you are just creating extra work for yourself :)


EVENT_KILLED_MERIT triggers for each client that was given CREDIT for the kill.

Example.. anyone in the raid / group, however, if you want it so that players can just run up and "tag" something while someone else is killing it.. that they get credit.

Meaning a non-grouped player could run around hitting mobs 1 time that other players are fighting and get credit with the way you have it written.


Changing to this would eliminate that.

Code:

sub EVENT_KILLED_MERIT {
        if ($ulevel > 19) {
                $client->SetEXP($client->GetEXP(), $client->GetAAExp()+1000);
        }
}


Shendare 05-04-2015 08:39 PM

Oooh, nice. I don't remember that event.

ghanja 05-04-2015 08:42 PM

Quote:

Originally Posted by NatedogEZ (Post 239861)
There is a sub event that already does that btw... you are just creating extra work for yourself :)


EVENT_KILLED_MERIT triggers for each client that was given CREDIT for the kill.

Example.. anyone in the raid / group, however, if you want it so that players can just run up and "tag" something while someone else is killing it.. that they get credit.

Meaning a non-grouped player could run around hitting mobs 1 time that other players are fighting and get credit with the way you have it written.


Changing to this would eliminate that.

Code:

sub EVENT_KILLED_MERIT {
        if ($ulevel > 19) {
                $client->SetEXP($client->GetEXP(), $client->GetAAExp()+1000);
        }
}


I originally tried that, but found it was buggy. I dont recall precisely what was buggy with it, but, thus the work around.

I'll have to revisit the idea. That code I provided was a copy/paste from something done a year back, so, probably doesnt exist now. If not, well, then yes, that would be the best method to say the least.

So there you go, no shortage of options. :)

Akkadius 05-04-2015 09:09 PM

Nothing should be buggy about the EVENT_KILLED_MERIT option

The only caveat is that you have to keep in mind is that each client does trigger the sub EVENT on its own as Natedog said.

serivoth1234 05-05-2015 12:08 PM

EVENT_KILLED_MERIT works perfectly, thanks for the info on it.


All times are GMT -4. The time now is 12:13 AM.

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