EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   Charm Stats? (https://www.eqemulator.org/forums/showthread.php?t=39504)

Bandor 03-23-2015 12:35 PM

Charm Stats?
 
I noticed charms used to show stats,now however it appears they don't,unless aug'd in which case it shows the aug'd stats. Doesn't even show clicky effect any more. Any ideas as how to go about fixing this , or is it not just a bug on my side?

NatedogEZ 03-23-2015 12:45 PM

There is a field called charmfileid if that is greater than 0 the charm uses scaled stats based on the Charmfile .. (a quest)

If you just want to charms to use their base stats set charmfileid to 0.. if you want them to scale on a quest.. look inside... quests\global\items\ for examples :p

dagulus2 03-23-2015 12:51 PM

From what I have seen, they do display, but It takes a while to kick in, and they only display if they are actually in your characters inventory or charm slot.

demonstar55 03-23-2015 03:02 PM

Quote:

Originally Posted by dagulus2 (Post 238877)
From what I have seen, they do display, but It takes a while to kick in, and they only display if they are actually in your characters inventory or charm slot.

Which is consistent with live.

Bandor 03-24-2015 10:40 AM

Quote:

Originally Posted by NatedogEZ (Post 238876)
There is a field called charmfileid if that is greater than 0 the charm uses scaled stats based on the Charmfile .. (a quest)

If you just want to charms to use their base stats set charmfileid to 0.. if you want them to scale on a quest.. look inside... quests\global\items\ for examples :p

Thank you Nate. I knew about the quest file one and removed it thinking that would solve,did not know about the charmfileid though.

Uleat 03-24-2015 08:31 PM

I don't think this has changed recently..but, you can never tell :P


Scaling items are processed differently across the many clients.

To avoid conflict issues, a scaling item's charmfile id is set to 0 and is 'scaled' locally on the server.

It's been that way as long as I've been hanging around.

Bandor 03-24-2015 10:18 PM

I think something did change, Had a charm Ive been using for months and stats wouldn't work. Soon as I removed the charmfile ID (set it to 0) it worked fine. Pretty cool to see charms working correctly now though. I remember when you couldn't get stats from them at all lol.

Uleat 03-24-2015 11:12 PM

Might be something in the difference between scaling and non-scaling...

Demonstar55 mentioned something to me a while ago..but, I can't remember the details at the moment.

demonstar55 03-25-2015 11:34 AM

Quote:

Originally Posted by Uleat (Post 238915)
I don't think this has changed recently..but, you can never tell :P


Scaling items are processed differently across the many clients.

To avoid conflict issues, a scaling item's charmfile id is set to 0 and is 'scaled' locally on the server.

It's been that way as long as I've been hanging around.

That hack stopped working with RoF so I removed it and identified the scaling value in the item packet. What's not implemented is the usage of the opcode that they use to update the scale, we just send the item packet again, which works but is more expensive packet wise (full item packet vs a few bytes :P)

Edit: live will also send the scaling packet for all your charms with a scale of 100 before they send the AAs. This uses the small scaling packet and the absent of this step maybe causing the issues? (If there are any, but its probably just the delay between getting an the new item packet)

Maceblade 01-07-2016 11:13 PM

Been kinda working on something and Im not sure if I am missing something so was looking for some guidance... I am trying to combine the charm like properties with armor to make a custom set of elite armor once all pieces are acquired. My charm file looks like this:

Code:

sub EVENT_SCALE_CALC {
  my $hands = $hasitem(1807);
  my $wrist = $hasitem(1808);
  my $legs = $hasitem(1805);
  my $chest = $hasitem(1804);
  my $arms = $hasitem(1806);
  my $boots = $hasitem(1809);
  my $helm = $hasitem(1810);

  my $scale = $chest + $hands + $wrist + $legs + $arms + $boots + $helm;

  if($scale < 0) {
    $scale = 0;
  }
 
  if($scale > 7) {
    $scale = 7;
  }

  $questitem->SetScale($scale/7);
}

Using GeorgeS tools:

so when I add the charm name in the charm file box as : CHRMcustomgear
there is another box below Labelled: Charm
If I leave it Blank, you get full stats completely negating what im going for.
When I look at other charms they all have weird numbers in it that I cannot associate with anything else.

Am I missing something? Is my code not setup correctly? This is the first time ive ever messed with this type configuration so Im assuming that my code is wrong considering I keep getting errors on it.

demonstar55 01-07-2016 11:23 PM

I don't think your quest code is valid.

tearinall 01-08-2016 03:00 AM

Mace, I copy/pasted from the hasitem plugin to reduce some time, it doesnt go beyond checking to see if the item is in their proper slot, but should check either cursor or main inventory:

Code:

sub EVENT_SCALE_CALC {
        my @checkarray = (1804..1810);  ## denotes 1804 to 1810
        my $worn;
        foreach $itemtocheck (@checkarray) {
                $worn+=CheckForItem($itemtocheck);
        }
        $questitem->SetScale($worn/(scalar @checkarray));
}

sub CheckForItem {
        for ($slot1=0; $slot1<=30; $slot1++) {
                $itemid1=$client->GetItemIDAt($slot1);
                if ($itemid1==$_[0]) {
                        return 1;
                } else {
                        return 0;
                }
        }
}

Very much untested beyond syntax.

Kingly_Krab 01-08-2016 07:30 AM

Here is my item check plugin:
Code:

sub check_hasitem {
    my $client = shift;
    my $itemid = shift;
    foreach my $slot (0..30, 251..340, 2000..2023, 2030..2270, 2500..2501, 2531..2550, 9999) {
        if ($client->GetItemIDAt($slot) == $itemid) {
            return 1;
        }

        for ($i = 0; $i < 5; $i++) {
            if ($client->GetAugmentIDAt($slot, $i) == $itemid) {
                return 1;
            }
        }
    }
    return 0;
}

All you'd have to do for your script is this:
Code:

sub EVENT_SCALE_CALC {
    my $scale = 0;
    foreach my $item (1804..1810) {
        if (plugin::check_hasitem($client, $item)) {
            $scale++;
        }
    }
    $questitem->SetScale($scale / 7);
}


Maceblade 01-08-2016 07:53 AM

Wow awesome! Thanks Krab and Tear, ill check them later and hopefully can achieve what im going for, thanks!

Maceblade 01-08-2016 08:40 PM

Tearinall, I checked yours out and it does not scale or appear to do anything.

Krab, yours makes me crash but I think the reason being is that I have multiple items using the same charm file and IDK if that's allowed.

I basically wanted the armor to power up as you acquire more of the set items. One piece of armor will power up but the rest remain statless, hence bringing me back to multiple items using the same charmfile PL . Has anyone tried to do anything like this and been successful?

tearinall 01-08-2016 09:16 PM

Mace, it doesn't always "take hold" instantaneously from what I remember.

I get what you're after, which is why I only check the main inventory (worn, and consequently cursor rather than all slots). I also put the item numbers you want to check for in a declared array so that you may add to it in perhaps a more easier to understand method. I also have it check how many elements are in the array as a "total number of armor to check for", so it's easier to scale (as in grow, increase, etc.).

Try this debugging version:

Code:

sub EVENT_SCALE_CALC {
        my @checkarray = (1804..1810);  ## denotes a range between 1804 to 1810 - could also have (1804,1805,1806,etc.) to as many as you want
                                                                        ## since we check how many are in the array later
        my $worn = 0;
        foreach my $itemtocheck (@checkarray) {
                if (CheckForItem($itemtocheck) {
                        $worn++
                        quest::say ("".$worn." total worn items at this time.");
                }
        }
        $questitem->SetScale($worn/(scalar @checkarray));
}

sub CheckForItem {
        ## Check only main inventory/cursor (we want these pieces to be worn to count right?
        for ($slot1=0; $slot1<=30; $slot1++) {
                $itemid1=$client->GetItemIDAt($slot1);
                if ($itemid1==$_[0]) {
                        quest::say ("Found item: ".$_[0]."");
                        return 1;
                } else {
                        quest::say ("Did not find item: ".$_[0]."");
                        return 0;
                }
        }
}


tearinall 01-08-2016 09:23 PM

Quote:

I have multiple items using the same charm file and IDK if that's allowed.
And its perfectly fine to utilize the same charmfile (i.e. code) for multiple items.

Maceblade 01-10-2016 05:45 PM

that actually worked beautifully bro, stats scale and everything. Exactly what I wanted thanks man! Now if I could figure out what to do with that other box or what its even for I have a whole new design and set of progression setup lol

tearinall 01-10-2016 08:37 PM

Quote:

Originally Posted by Maceblade (Post 246441)
Now if I could figure out what to do with that other box or what its even for...

Not sure who you were replying to, so maybe the details are lost on that ignorance of mine. Though I'll still ask, what "other box" ?

Maceblade 01-11-2016 09:59 AM

Replying to anyone that will listen lol...

http://www.mediafire.com/convkey/593...k15y66zkzg.jpg

I used the 4032 or whatever is in there bc it seemed to work. It is also the same number used in the tainted heartstone which increases stats based on mastered languages. I thought it was the DBstr number but none of my items even have a "Item gains power with the more pieces of this set you carry " or whatever.

tearinall 01-11-2016 04:20 PM

Quote:

Originally Posted by Maceblade (Post 246458)
Replying to anyone that will listen lol...

http://www.mediafire.com/convkey/593...k15y66zkzg.jpg

I used the 4032 or whatever is in there bc it seemed to work. It is also the same number used in the tainted heartstone which increases stats based on mastered languages. I thought it was the DBstr number but none of my items even have a "Item gains power with the more pieces of this set you carry " or whatever.

Take a look at your `books` table. I think you'll figure it out from there. Though, that is where you'll place "Items increase in power as you gain more set pieces." (or whatever you had in mind to say).

Maceblade 01-11-2016 04:41 PM

Ah that's neat, I added the set information associated with my charmfile, but I am still unsure what and where the number inside the red box is coming from.

tearinall 01-11-2016 05:35 PM

Quote:

Originally Posted by Maceblade (Post 246473)
Ah that's neat, I added the set information associated with my charmfile, but I am still unsure what and where the number inside the red box is coming from.

If it's not 0 the server will set it as a scaling item.

`charmfile` is the (quest) file used to determine the scaling

Code:

GetAugment(slot) # Returns an item object for the augment found in the slot supplied
GetCharges() # Returns the number of charges on an item
GetID() # Returns the ID of the item
GetName() # Returns the name of the item
IsAttuned() # Returns 1 if the item is attuned (instanced no drop)
IsType(type) # Returns 1 if the item is of the type supplied (valid types are 0=common, 1=container, 2=book)
ItemSay(text, language) # The item says text, language is optional (currently only goes to item's owner)
SetScale(multiplier) # Sets the scale multiplier for scaling items.  1.0 = full stats

Code:

$questitem->GetID();
And so on.

Maceblade 01-11-2016 07:15 PM

oh so basically any number will work in the red box.

NatedogEZ 01-11-2016 08:22 PM

Hit me up on skype Maceblade and I can help ya out if you wish :)


All times are GMT -4. The time now is 09:15 PM.

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