1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

Duration of Poisons and Familiars

Discussion in 'Census: EverQuest II' started by Chillispike, Sep 23, 2017.

  1. Chillispike

    Chillispike New Member

    EQ2U - Item Details - Caustic Poison
    Shows 5 days but it's only 12 Hours
    Reason: Duration is /10 unlike other items.

    http://census.daybreakgames.com/s:eq2i/xml/get/eq2/item/2946971428
    says Duration is duration="432000"
    432000/60 = 7600 minutes/60 = 120 Hours/24 = 5 days
    but actually it should be
    432000/600 = 760 minutes/60 = 12 Hours

    So i would say if the they item has Classificaton:
    - poison then duration="432000" => 12hours
    - familiar then duration="432000" => Until Cancelled

    Shame the Duration is that often different on census. Familars show 5 days as well while those are Until Cancelled.
     
    • Agree Agree x 1
  2. Chillispike

    Chillispike New Member

    Potions have /10 duration as well like poisons so only 1 hour and not 10 hours
     
    • Agree Agree x 1
  3. Feldon

    Feldon Administrator Staff Member

    Strange. If I've got something wrong on EQ2U please let me know!
     
  4. Chillispike

    Chillispike New Member

    Potions and familiars are wrong

    if it's itemtype "item" and classification "potion" the duration given has to be divided by 10 before calculating the time.
    Same with classification "familiar" they have the "same" duration like potions but they last "Until Cancelled" in game
     
  5. Feldon

    Feldon Administrator Staff Member

    There's so much internal exception behavior that is not documented anywhere. Here's what I am changing the code to:

    (incorrect code deleted)
     
    Last edited: Oct 12, 2017
  6. Feldon

    Feldon Administrator Staff Member

  7. Chillispike

    Chillispike New Member

    Posions last 12hours =) effect says so as well
     
  8. Chillispike

    Chillispike New Member

    My code for it:

    Code:
    if classification('"flyingmount"') or classification('"glidingmount"') or classification('"leapingmount"') or classification('"mount"')
       then begin if getvalue('item!typeinfo!duration')='864000'
                     then add(' duration= Until Cancelled|')
                     else add(' duration= '+do_item_time_seconds_normal('item!typeinfo!duration')+'|');   //1200 = 1 hour; 10 = 10 seconds
            end
       else begin if classification('"familiar"')
                     then begin if getvalue('item!typeinfo!duration')='432000'
                                   then add(' duration= Until Cancelled|')
                                   else add(' duration= '+do_item_time_seconds_normal('item!typeinfo!duration')+'|');   //1200 = 1 hour; 10 = 10 seconds
                          end
                     else if (getvalue('item!adornment_list!adornment0!name')='Exceptional Harvesting Technique') or (classification('"potion"'))
                             then Create_item_line(' duration= ',do_item_time_seconds('item!typeinfo!duration'),'|')   //12000 = 1 hour; 100 = 10 seconds
                             else Create_item_line(' duration= ',do_item_time_seconds_normal('item!typeinfo!duration'),'|');   //1200 = 1 hour; 10 = 10 seconds
            end;
    
    *edit* to make it code look only
     
    Last edited: Oct 12, 2017
  9. Feldon

    Feldon Administrator Staff Member

    Working on it. You can now search for Familiar as an item type on EQ2U.
     
    • Like Like x 1
  10. Feldon

    Feldon Administrator Staff Member

    I knew our display of Duration on mounts was broken, but never figured out how to fix it. You've provided that info. Thank you!
    Code:
                if (isset($item->classification_list)) {
                    if (in_array('flyingmount', $item->classification_list) || in_array('glidingmount', $item->classification_list) || in_array('leapingmount', $item->classification_list) || in_array('mount', $item->classification_list)) {
                        if ($item->typeinfo['duration'] == 864000) {
                            $tmp_duration = 'Until Cancelled';
                        } else {
                            $tmp_duration = nicetime2($item->typeinfo['duration']);
                        }
                    } elseif (in_array('familiar', $item->classification_list)) {
                        if ($item->typeinfo['duration'] == 432000) {
                            $tmp_duration = 'Until Cancelled';
                        } else {
                            $tmp_duration = nicetime2($item->typeinfo['duration']);
                        }
                    } elseif (in_array('potion', $item->classification_list)) {
                        if ($item->typeinfo['duration'] == 432000) {
                            $tmp_duration = 'Until Cancelled';
                        } else {
                            $tmp_duration = nicetime2($item->typeinfo['duration']) / 10;
                        }
                    } else {
                        $tmp_duration = nicetime2($item->typeinfo['duration']);
                    }
                } else {
                    if ($item->typeinfo['duration'] == 10000) {
                        $tmp_duration = 'Until Cancelled';
                    } else {
                        $tmp_duration = nicetime2($item->typeinfo['duration']);
                    }
                }
    
     
    • Like Like x 1
  11. Chillispike

    Chillispike New Member

    Happy to help .. figured it's easier to post my code as well .. different language but readable by the looks =)
     
    • Like Like x 1
  12. Chillispike

    Chillispike New Member

    I invested some time to see how i can "solve" the duration for the many other items.
    After checking all items from the itemtype="item" i saw that currently 50% are correct and 50% have the wrong duration.
    While looking for a reference of the duration i figured that the first effect line does say "Lasts for xx"
    So i use that line to get the "right" duration. (The mount and familiar section is still the same)


    Code:
    if (getvalue('item!typeinfo!name')='expendable') and not classification('"currency"') then ....
    
    ...
    if classification('"flyingmount"') or classification('"glidingmount"') or classification('"leapingmount"') or classification('"mount"')
       then begin if getvalue('item!typeinfo!duration')='864000'
                     then wikiitem.lines.add(' duration= Until Cancelled|')
                     else wikiitem.lines.add(' duration= '+do_item_time_seconds_normal('item!typeinfo!duration')+'|');   //1200 = 1 hour; 10 = 10 seconds
            end
       else begin if classification('"familiar"')
                     then begin if getvalue('item!typeinfo!duration')='432000'
                                   then wikiitem.lines.add(' duration= Until Cancelled|')
                                   else wikiitem.lines.add(' duration= '+do_item_time_seconds_normal('item!typeinfo!duration')+'|');   //1200 = 1 hour; 10 = 10 seconds
                          end
                     else begin
                                effect:=getvalue('item!effect_list!effect0!description');
                                duration:=do_item_time_seconds_normal('item!typeinfo!duration');
                                duration10:=do_item_time_seconds('item!typeinfo!duration');
                                if (ansipos('Lasts for ',effect)>0) and
                                   (ansipos(duration10,effect)=0) and (ansipos(stringreplace(duration10,'.0 seconds',' seconds',[rfreplaceall]),effect)=0) and
                                   ((ansipos(duration,effect)>0) or (ansipos(stringreplace(duration,'.0 seconds',' seconds',[rfreplaceall]),effect)>0))
                                    then begin Create_item_line(' duration= ',duration,'|');           //1200 = 1 hour; 10 = 10 seconds
                                         end
                                    else begin if (ansipos('Lasts for ',effect)>0) and
                                                  (ansipos(duration10,effect)>0) or (ansipos(stringreplace(duration10,'.0 seconds',' seconds',[rfreplaceall]),effect)>0)
                                                  then Create_item_line(' duration= ',duration10,'|')  //12000 = 1 hour; 100 = 10 seconds
                                                  else Create_item_line(' duration= ',duration,'|');   //1200 = 1 hour; 10 = 10 seconds
                                         end;
                          end;
            end;
    
    *edit*
    Note: ansipos checks returns the position of the substring in the string, while 0 is not found.
     
  13. Feldon

    Feldon Administrator Staff Member

    :eek:
     
    • Like Like x 1
    • Funny Funny x 1
  14. Chillispike

    Chillispike New Member

    i guess that means you are surprised by my solution hehe :)
     
  15. Feldon

    Feldon Administrator Staff Member

    It just seems like a lot of gymnastics. I know the durations have been wrong on EQ2U for a long time, but adding all that logic to make it right just seems prone to future breakage, especially reading the first few words of an Effect (items can have multiple effects in any order). Hrrmph.
     
  16. Chillispike

    Chillispike New Member

    They have multiple lines for sure but the duration is only in the first line. and the duration will only effect items that's why i use that only on "item!typeinfo!name='expendable'"
     

Share This Page