EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Spellscale not work in Perl? (https://www.eqemulator.org/forums/showthread.php?t=36846)

NatedogEZ 05-17-2013 09:32 AM

Spellscale not work in Perl?
 
Code:

quest::modifynpcstat("spellscale",900);
I've done every other stat like this and they work just fine... (didn't try healscale actually)


Anyone else have problems with this? I've scaled all stats on an NPC.. but when it comes to spells it only takes the spellscale from the database value set for that NPC.


Side note... my source is up to date as well.

Akkadius 05-17-2013 02:33 PM

Quote:

Originally Posted by NatedogEZ (Post 220940)
Code:

quest::modifynpcstat("spellscale",900);
I've done every other stat like this and they work just fine... (didn't try healscale actually)


Anyone else have problems with this? I've scaled all stats on an NPC.. but when it comes to spells it only takes the spellscale from the database value set for that NPC.


Side note... my source is up to date as well.

Not sure about the quest version without looking at the source.

This is what I used in my stuff the day I put it in:

Code:

                        $NPC->ModifyNPCStat("spellscale", $SD[$NPC->GetLevel()][$NTYPE][22]  *  $SZD{$zonesn}[$instanceversion][9]);
                        $NPC->ModifyNPCStat("healscale", $SD[$NPC->GetLevel()][$NTYPE][23]  *  $SZD{$zonesn}[$instanceversion][8]);

$NPC being the entity iteration of course, and then the 2nd argument is my stuff I'm passing to it to get my scaling.

NatedogEZ 05-18-2013 01:37 AM

Thank you Akkadius I will try using entity like that.

NatedogEZ 05-18-2013 04:05 AM

Hmm.. did what you said... maybe its an issue with the NPC.

I am trying to scale "Spellscale" on player pets.

I tried just scaling the pets spell damage with the database .. set it to 150 and still doesn't work.

Works for normal NPCs though...

I spawned the pet with #dbspawn 1315 (the pet as an NPC it works!)

The NPC as a Player PET the scaling DOES NOT work.

So I wasn't doing it wrong.. just seems to be a problem somewhere in the code for player pets maybe?

I'll have to check it later.

NatedogEZ 05-18-2013 04:21 AM

From Attack.cpp
Code:

        if(other->IsNPC() && !other->IsPet())
{
float npcspellscale = other->CastToNPC()->GetSpellScale();
damage = ((float)damage * npcspellscale) / (float)100;
}


This makes spellscale NOT work for pets I am guessing.

Is this intended?

NatedogEZ 05-18-2013 05:29 AM

I edited that and it didn't help... still not sure why I can't spellscale Player pets. (database and quest don't work)

ChaosSlayerZ 05-18-2013 12:04 PM

stupid question - what IS a spellscale? what it suppose to do?

NatedogEZ 05-18-2013 05:14 PM

Scales how much damage an NPC will do with spells.

100 = Normal damage

50 = Half damage

150 = 50% more dmg.. ect ect

You can scale damage with Perl in a boss fight for example.

I am trying to figure out why spellscale doesn't work for pets.

Akkadius 05-18-2013 06:08 PM

It was originally intended to perform scaling on the fly through Perl scripts.

So one issue is making entirely new spell sets for NPC's (Fuck that).

Use a Cleric spell set and you can scale it for example, have it do 5x the damage if you wish (500) and you can reuse the same spellset.

healscale does the same thing but for only healing spells.

Natedog, pet is derived from mob so you may need to do a $mob->CastToNPC()->ModifyNPCStat("stuff", value);

Don't take my syntax as verbatim, you may want to check the reference sheet but that is how you would handle it for pets.

ChaosSlayerZ 05-18-2013 09:23 PM

got it ;)
how does it works with dots and debuffs? do those also get scaled?
non stat buffs? like SoW?

Akkadius 05-18-2013 09:50 PM

Quote:

Originally Posted by ChaosSlayerZ (Post 220976)
got it ;)
how does it works with dots and debuffs? do those also get scaled?
non stat buffs? like SoW?

They are only damage oriented scales, + or -, so DoT's, DD's (anything damage oriented) and healscale is obvious (HoT's, Direct Heals)

That covers like 80% of spells that can even make use of scaling, SoW is not a good example, buffs aren't really either because NPC's are like 1% impacted by a stat buff when it comes to scaling. However if you are going to get tricky with fights such as using charms or other fancy spells you are usually going to tie that into your fight specially.

NatedogEZ 05-19-2013 12:24 AM

One thing to note though Akkadius... spellscale on pets doesn't even work through the database.


Will try Casting it though. (Talking player pets btw)

Akkadius 05-19-2013 01:14 AM

Quote:

Originally Posted by NatedogEZ (Post 220982)
One thing to note though Akkadius... spellscale on pets doesn't even work through the database.


Will try Casting it though. (Talking player pets btw)

Was never meant to for pets, but the Perl handling should work

NatedogEZ 05-19-2013 08:26 AM

The perl handling works... but the damage never scales. (For player pets that is) :(

Akkadius 05-19-2013 02:53 PM

Quote:

Originally Posted by NatedogEZ (Post 220991)
The perl handling works... but the damage never scales. (For player pets that is) :(

Pet spells are handled in a different part of the code that those variables were not implemented most likely.

Kayen 05-19-2013 10:59 PM

$npc->SetSpellFocusDMG()
$npc->SetSpellFocusHeal()

These are alternative functions that I added prior to Akka's code (and will stack with the dbase spell scale)

They work fine.

100 = 100% focus ect

Negative values can be used to reduce spell damage or even cause spells to heal if under 100.

Will work on any NPC, pets included.

NatedogEZ 05-20-2013 01:24 AM

Neat I will give that a try for player pets!



That is exactly what I was looking for thanks Keyan!

Kind of weird for the other way of doing this excludes player pets =(

Akkadius 05-24-2013 02:58 AM

Well I just so happened to test this today and it does indeed work.

You just need to make sure you cast:

$CT was me getting my pet target, really this would affect any NPC I targeted

Code:

sub EVENT_TARGET_CHANGE{
        if($client->GetAggroCount() == 0){
                ### Test Scaling ###
                if($name eq "Akkasham"){
                        $CT = $client->GetTarget();
                        $CT->CastToNPC()->ModifyNPCStat("max_hp", "10000000");
                        $CT->CastToNPC()->SetHP($CT->GetMaxHP());
                }
        }
}


NatedogEZ 05-24-2013 03:04 AM

modifynpcstat works for sure on pets.. I already use it to mod ALL of their stats

except Spellscale / healscale

I use $npc->SetSpellFocusDMG() for the scaling of spell damage though.


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

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