EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Return items plugin (https://www.eqemulator.org/forums/showthread.php?t=28955)

Capheus 07-20-2009 08:58 AM

Return items plugin
 
This script works great except I get burned by the return items plugin. I have to set up the return items part this way or it returns the items handed in too. I've tried many things and this seems to be the simplest way of doing it. Anyone else got any ideas?


Code:

sub EVENT_ITEM {


        if(($item1 == 98550) or ($item2 == 98550) or ($item3 == 98550) or ($item4 == 98550)) { 
                $new = ($client->GetRawSkill(59))+($itemcount{98550}*4);
                quest::setskill(59, $new);
        }
       
        if(($item1 == 98551) or ($item2 == 98551) or ($item3 == 98551) or ($item4 == 98551)) { 
                $new = ($client->GetRawSkill(60))+($itemcount{98551}*4);
                quest::setskill(60, $new);
        }                 
 
        if(($item1 == 98552) or ($item2 == 98552) or ($item3 == 98552) or ($item4 == 98552)) { 
                $new = ($client->GetRawSkill(65))+($itemcount{98552}*4);
                quest::setskill(65, $new);
        }

        if(($item1 == 98553) or ($item2 == 98553) or ($item3 == 98553) or ($item4 == 98553)) { 
                $new = ($client->GetRawSkill(64))+($itemcount{98553}*4);
                quest::setskill(64, $new);
        }

        if(($item1 == 98554) or ($item2 == 98554) or ($item3 == 98554) or ($item4 == 98554)) { 
                $new = ($client->GetRawSkill(68))+($itemcount{98554}*4);
                quest::setskill(68, $new);
        }

        if(($item1 == 98555) or ($item2 == 98555) or ($item3 == 98555) or ($item4 == 98555)) { 
                $new = ($client->GetRawSkill(69))+($itemcount{98555}*4);
                quest::setskill(69, $new);
        }

        if(($item1 == 98556) or ($item2 == 98556) or ($item3 == 98556) or ($item4 == 98556)) { 
                $new = ($client->GetRawSkill(63))+($itemcount{98556}*4);
                quest::setskill(63, $new);
        }
               
        if(($item1 == 98557) or ($item2 == 98557) or ($item3 == 98557) or ($item4 == 98557)) { 
                $new = ($client->GetRawSkill(61))+($itemcount{98557}*4);
                quest::setskill(61, $new);
        }

        if(($item1 == 98558) or ($item2 == 98558) or ($item3 == 98558) or ($item4 == 98558)) { 
                $new = ($client->GetRawSkill(57))+($itemcount{98558}*4);
                quest::setskill(57, $new);
        }

        elsif  ((plugin::check_handin(\%itemcount,98550=>1) == 0) or
                (plugin::check_handin(\%itemcount,98551=>1) == 0) or
                (plugin::check_handin(\%itemcount,98552=>1) == 0) or
                (plugin::check_handin(\%itemcount,98553=>1) == 0) or
                (plugin::check_handin(\%itemcount,98554=>1) == 0) or
                (plugin::check_handin(\%itemcount,98555=>1) == 0) or
                (plugin::check_handin(\%itemcount,98556=>1) == 0) or
                (plugin::check_handin(\%itemcount,98557=>1) == 0) or
                (plugin::check_handin(\%itemcount,98558=>1) == 0)) {
                plugin::return_items(\%itemcount);
        }
       

}


joligario 07-24-2009 03:50 AM

Try this:

Code:

sub EVENT_ITEM {
  if(plugin::check_handin(\%itemcount, 98550 => 1) || plugin::check_handin(\%itemcount, 98550 => 2) || plugin::check_handin(\%itemcount, 98550 => 3) || plugin::check_handin(\%itemcount, 98550 => 4)) {
    $new = ($client->GetRawSkill(59))+($itemcount{98550}*4);
    quest::setskill(59, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98551 => 1) || plugin::check_handin(\%itemcount, 98551 => 2) || plugin::check_handin(\%itemcount, 98551 => 3) || plugin::check_handin(\%itemcount, 98551 => 4)) {
    $new = ($client->GetRawSkill(60))+($itemcount{98551}*4);
    quest::setskill(60, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98552 => 1) || plugin::check_handin(\%itemcount, 98552 => 2) || plugin::check_handin(\%itemcount, 98552 => 3) || plugin::check_handin(\%itemcount, 98552 => 4)) {
    $new = ($client->GetRawSkill(65))+($itemcount{98552}*4);
    quest::setskill(65, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98553 => 1) || plugin::check_handin(\%itemcount, 98553 => 2) || plugin::check_handin(\%itemcount, 98553 => 3) || plugin::check_handin(\%itemcount, 98553 => 4)) {
    $new = ($client->GetRawSkill(64))+($itemcount{98553}*4);
    quest::setskill(64, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98554 => 1) || plugin::check_handin(\%itemcount, 98554 => 2) || plugin::check_handin(\%itemcount, 98554 => 3) || plugin::check_handin(\%itemcount, 98554 => 4)) {
    $new = ($client->GetRawSkill(68))+($itemcount{98554}*4);
    quest::setskill(68, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98555 => 1) || plugin::check_handin(\%itemcount, 98555 => 2) || plugin::check_handin(\%itemcount, 98555 => 3) || plugin::check_handin(\%itemcount, 98555 => 4)) {
    $new = ($client->GetRawSkill(69))+($itemcount{98555}*4);
    quest::setskill(69, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98556 => 1) || plugin::check_handin(\%itemcount, 98556 => 2) || plugin::check_handin(\%itemcount, 98556 => 3) || plugin::check_handin(\%itemcount, 98556 => 4)) {
    $new = ($client->GetRawSkill(63))+($itemcount{98556}*4);
    quest::setskill(63, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98557 => 1) || plugin::check_handin(\%itemcount, 98557 => 2) || plugin::check_handin(\%itemcount, 98557 => 3) || plugin::check_handin(\%itemcount, 98557 => 4)) {
    $new = ($client->GetRawSkill(61))+($itemcount{98557}*4);
    quest::setskill(61, $new);
  }
  elsif(plugin::check_handin(\%itemcount, 98558 => 1) || plugin::check_handin(\%itemcount, 98558 => 2) || plugin::check_handin(\%itemcount, 98558 => 3) || plugin::check_handin(\%itemcount, 98558 => 4)) {
    $new = ($client->GetRawSkill(57))+($itemcount{98558}*4);
    quest::setskill(57, $new);
  }
  else {
    plugin::return_items(\%itemcount);
  }
}


Capheus 07-24-2009 09:03 AM

Yes that looks like it works too. I might have had some variation of that among the dozen ways I re-re-rewrote it


All times are GMT -4. The time now is 03:04 AM.

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