Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 30.88 KB | None | 0 0
  1. class 0 platinum_tribe_shaman : warrior_ag_casting_3skill_magical
  2. {
  3. handler:
  4.   EventHandler MY_DYING( always_list, code_info, i0, i1, i4, i9, last_attacker, lparty, member, random1_list, target )
  5.   {
  6.     always_list = gg::AllocCodeInfoList();
  7.     random1_list = gg::AllocCodeInfoList();
  8.     target = last_attacker;
  9.     if( gg::HaveMemo( target, @arrogant_quest ) &&
  10.         ( gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 12 ||
  11.           gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 13 ) &&
  12.         gg::OwnItemCount( target, @q0348_white_fabric ) > 0 )
  13.     {
  14.       random1_list::SetInfo( Fetch Base pointer, target );
  15.     }
  16.     if( gg::HaveMemo( target, @arrogant_quest ) &&
  17.         ( gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 12 ||
  18.           gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 13 ) &&
  19.         gg::OwnItemCount( target, @q0348_white_fabric ) > 0 )
  20.     {
  21.       random1_list::SetInfo( Fetch Base pointer, target );
  22.     }
  23.     if( gg::IsNull( lparty ) == 0 )
  24.     {
  25.       for( i9 = expr =; i9 < lparty.member_count; i9 = i9 + 1 )
  26.       {
  27.         target = myself::GetMemberOfParty( lparty, i9 );
  28.         if( gg::HaveMemo( target, @arrogant_quest ) &&
  29.             ( gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 12 ||
  30.               gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 13 ) &&
  31.             gg::OwnItemCount( target, @q0348_white_fabric ) > 0 )
  32.         {
  33.           random1_list::SetInfo( Fetch Base pointer, target );
  34.         }
  35.       }
  36.     }
  37.     target = last_attacker;
  38.     if( gg::HaveMemo( target, @whispers_of_destiny ) == 1 &&
  39.         gg::GetMemoState( target, @whispers_of_destiny ) == 8 &&
  40.         gg::OwnItemCount( target, @q_white_fabric_q0234 ) > 0 )
  41.     {
  42.       random1_list::SetInfo( Fetch Base pointer, target );
  43.     }
  44.     if( gg::HaveMemo( target, @whispers_of_destiny ) == 1 &&
  45.         gg::GetMemoState( target, @whispers_of_destiny ) == 8 &&
  46.         gg::OwnItemCount( target, @q_white_fabric_q0234 ) > 0 )
  47.     {
  48.       random1_list::SetInfo( Fetch Base pointer, target );
  49.     }
  50.     if( gg::IsNull( lparty ) == 0 )
  51.     {
  52.       for( i9 = expr =; i9 < lparty.member_count; i9 = i9 + 1 )
  53.       {
  54.         target = myself::GetMemberOfParty( lparty, i9 );
  55.         if( gg::HaveMemo( target, @whispers_of_destiny ) == 1 &&
  56.             gg::GetMemoState( target, @whispers_of_destiny ) == 8 &&
  57.             gg::OwnItemCount( target, @q_white_fabric_q0234 ) > 0 )
  58.         {
  59.           random1_list::SetInfo( Fetch Base pointer, target );
  60.         }
  61.       }
  62.     }
  63.     target = last_attacker;
  64.     if( gg::HaveMemo( target, @reagent_supplier ) )
  65.     {
  66.       random1_list::SetInfo( Fetch Base pointer, target );
  67.     }
  68.     if( gg::HaveMemo( target, @reagent_supplier ) )
  69.     {
  70.       random1_list::SetInfo( Fetch Base pointer, target );
  71.     }
  72.     if( gg::IsNull( lparty ) == 0 )
  73.     {
  74.       for( i9 = expr =; i9 < lparty.member_count; i9 = i9 + 1 )
  75.       {
  76.         target = myself::GetMemberOfParty( lparty, i9 );
  77.         if( gg::HaveMemo( target, @reagent_supplier ) )
  78.         {
  79.           random1_list::SetInfo( Fetch Base pointer, target );
  80.         }
  81.       }
  82.     }
  83.     target = last_attacker;
  84.     if( gg::HaveMemo( target, @get_fishing_shot ) == 1 )
  85.     {
  86.       random1_list::SetInfo( Fetch Base pointer, target );
  87.     }
  88.     if( gg::HaveMemo( target, @get_fishing_shot ) == 1 )
  89.     {
  90.       random1_list::SetInfo( Fetch Base pointer, target );
  91.     }
  92.     if( gg::IsNull( lparty ) == 0 )
  93.     {
  94.       for( i9 = expr =; i9 < lparty.member_count; i9 = i9 + 1 )
  95.       {
  96.         target = myself::GetMemberOfParty( lparty, i9 );
  97.         if( gg::HaveMemo( target, @get_fishing_shot ) == 1 )
  98.         {
  99.           random1_list::SetInfo( Fetch Base pointer, target );
  100.         }
  101.       }
  102.     }
  103.     target = last_attacker;
  104.     if( gg::HaveMemo( target, @put_the_power_in_your_blade ) == 1 )
  105.     {
  106.       random1_list::SetInfo( Fetch Base pointer, target );
  107.     }
  108.     while( gg::IsNull( code_info = always_list::Next() ) == 0 )
  109.     {
  110.       code_info.code;
  111.     }
  112.     code_info = random1_list::RandomSelectOne();
  113.     if( gg::IsNull( code_info ) == 0 )
  114.     {
  115.       switch( code_info.code )
  116.       {
  117.         case select_case compare:
  118.         {
  119.           myself::SetCurrentQuestID( SetCurrentQuestID );
  120.           target = code_info::RandomSelectOne();
  121.           if( gg::IsNull( target ) == 0 &&
  122.               myself::DistFromMe( target ) <= 1500 )
  123.           {
  124.             if( gg::HaveMemo( target, @arrogant_quest ) &&
  125.                 gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 12 &&
  126.                 gg::OwnItemCount( target, @q0348_white_fabric ) > 0 )
  127.             {
  128.               target.quest_last_reward_time = myself::GetCurrentTick();
  129.               i0 = gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST );
  130.               i0 = i0 + 600;
  131.               myself::SetMemoStateEx( target, @arrogant_quest,
  132.                                       unary->INTEGER_CONST, i0 );
  133.               if( gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) + 600 > 80000 )
  134.               {
  135.                 myself::GiveItem1( target, @q0348_blooded_fabric,
  136.                                    unary->INTEGER_CONST );
  137.                 myself::DeleteItem1( target, @q0348_white_fabric,
  138.                                      unary->INTEGER_CONST );
  139.                 myself::RemoveMemo( target, @arrogant_quest );
  140.                 gg::AddLog( AddLog, target, 348 );
  141.                 myself::SoundEffect( target, "ItemSound.quest_finish" );
  142.               }
  143.             }
  144.             if( gg::HaveMemo( target, @arrogant_quest ) &&
  145.                 gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) == 13 &&
  146.                 gg::OwnItemCount( target, @q0348_white_fabric ) > 0 )
  147.             {
  148.               target.quest_last_reward_time = myself::GetCurrentTick();
  149.               i0 = gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST );
  150.               i0 = i0 + 600;
  151.               myself::SetMemoStateEx( target, @arrogant_quest,
  152.                                       unary->INTEGER_CONST, i0 );
  153.               if( gg::GetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST ) + 600 > 100000 )
  154.               {
  155.                 myself::GiveItem1( target, @q0348_blooded_fabric,
  156.                                    unary->INTEGER_CONST );
  157.                 myself::DeleteItem1( target, @q0348_white_fabric,
  158.                                      unary->INTEGER_CONST );
  159.                 myself::SetMemoStateEx( target, @arrogant_quest, unary->INTEGER_CONST,
  160.                                         unary->INTEGER_CONST );
  161.                 myself::SoundEffect( target, "ItemSound.quest_middle" );
  162.               }
  163.             }
  164.           }
  165.           break;
  166.         }
  167.         case select_case compare:
  168.         {
  169.           myself::SetCurrentQuestID( SetCurrentQuestID );
  170.           target = code_info::RandomSelectOne();
  171.           if( gg::IsNull( target ) == 0 &&
  172.               myself::DistFromMe( target ) <= 1500 )
  173.           {
  174.             myself::GiveItem1( target, @q_bloody_fabric_q0234,
  175.                                unary->INTEGER_CONST );
  176.             myself::DeleteItem1( target, @q_white_fabric_q0234,
  177.                                  unary->INTEGER_CONST );
  178.             if( gg::OwnItemCount( target, @q_bloody_fabric_q0234 ) >= 29 )
  179.             {
  180.               myself::SetFlagJournal( target, @whispers_of_destiny,
  181.                                       unary->INTEGER_CONST );
  182.               myself::ShowQuestMark( target, 234 );
  183.               myself::SoundEffect( target, "ItemSound.quest_middle" );
  184.             }
  185.             else
  186.             {
  187.               myself::SoundEffect( target, "ItemSound.quest_itemget" );
  188.             }
  189.           }
  190.           break;
  191.         }
  192.         case select_case compare:
  193.         {
  194.           myself::SetCurrentQuestID( SetCurrentQuestID );
  195.           target = code_info::RandomSelectOne();
  196.           if( gg::IsNull( target ) == 0 &&
  197.               myself::DistFromMe( target ) <= 1500 )
  198.           {
  199.             i4 = gg::Rand( Rand );
  200.             if( i4 < 658 )
  201.             {
  202.               myself::GiveItem1( target, @ingredient_pouch2,
  203.                                  unary->INTEGER_CONST );
  204.               myself::SoundEffect( target, "ItemSound.quest_itemget" );
  205.             }
  206.             else if( i4 < 100 )
  207.             {
  208.               myself::GiveItem1( target, @quicksilver, unary->INTEGER_CONST );
  209.               myself::SoundEffect( target, "ItemSound.quest_itemget" );
  210.             }
  211.           }
  212.           break;
  213.         }
  214.         case select_case compare:
  215.         {
  216.           myself::SetCurrentQuestID( SetCurrentQuestID );
  217.           target = code_info::RandomSelectOne();
  218.           if( gg::IsNull( target ) == 0 &&
  219.               myself::DistFromMe( target ) <= 1500 )
  220.           {
  221.             if( gg::Rand( Rand ) < 935 )
  222.             {
  223.               myself::GiveItem1( target, @q_sweet_water,
  224.                                  unary->INTEGER_CONST );
  225.               myself::SoundEffect( target, "ItemSound.quest_itemget" );
  226.             }
  227.             else
  228.             {
  229.               myself::GiveItem1( target, @q_sweet_water,
  230.                                  unary->INTEGER_CONST );
  231.               myself::SoundEffect( target, "ItemSound.quest_itemget" );
  232.             }
  233.           }
  234.           break;
  235.         }
  236.         case select_case compare:
  237.         {
  238.           myself::SetCurrentQuestID( SetCurrentQuestID );
  239.           target = code_info::RandomSelectOne();
  240.           if( gg::IsNull( target ) == 0 &&
  241.               myself::DistFromMe( target ) <= 1500 )
  242.           {
  243.             if( target == myself.c_quest0 && myself.i_quest0 == 2 )
  244.             {
  245.               if( gg::OwnItemCount( target, @blue_soul_crystal_0 ) + gg::OwnItemCount( target, @blue_soul_crystal_1 ) + gg::OwnItemCount( target, @blue_soul_crystal_2 ) + gg::OwnItemCount( target, @blue_soul_crystal_3 ) + gg::OwnItemCount( target, @blue_soul_crystal_4 ) + gg::OwnItemCount( target, @blue_soul_crystal_5 ) + gg::OwnItemCount( target, @blue_soul_crystal_6 ) + gg::OwnItemCount( target, @blue_soul_crystal_7 ) + gg::OwnItemCount( target, @blue_soul_crystal_8 ) + gg::OwnItemCount( target, @blue_soul_crystal_9 ) + gg::OwnItemCount( target, @blue_soul_crystal_10 ) + gg::OwnItemCount( target, @blue_soul_crystal_11 ) + gg::OwnItemCount( target, @blue_soul_crystal_12 ) + gg::OwnItemCount( target, @blue_soul_crystal_13 ) + gg::OwnItemCount( target, @red_soul_crystal_0 ) + gg::OwnItemCount( target, @red_soul_crystal_1 ) + gg::OwnItemCount( target, @red_soul_crystal_2 ) + gg::OwnItemCount( target, @red_soul_crystal_3 ) + gg::OwnItemCount( target, @red_soul_crystal_4 ) + gg::OwnItemCount( target, @red_soul_crystal_5 ) + gg::OwnItemCount( target, @red_soul_crystal_6 ) + gg::OwnItemCount( target, @red_soul_crystal_7 ) + gg::OwnItemCount( target, @red_soul_crystal_8 ) + gg::OwnItemCount( target, @red_soul_crystal_9 ) + gg::OwnItemCount( target, @red_soul_crystal_10 ) + gg::OwnItemCount( target, @red_soul_crystal_11 ) + gg::OwnItemCount( target, @red_soul_crystal_12 ) + gg::OwnItemCount( target, @red_soul_crystal_13 ) + gg::OwnItemCount( target, @green_soul_crystal_0 ) + gg::OwnItemCount( target, @green_soul_crystal_1 ) + gg::OwnItemCount( target, @green_soul_crystal_2 ) + gg::OwnItemCount( target, @green_soul_crystal_3 ) + gg::OwnItemCount( target, @green_soul_crystal_4 ) + gg::OwnItemCount( target, @green_soul_crystal_5 ) + gg::OwnItemCount( target, @green_soul_crystal_6 ) + gg::OwnItemCount( target, @green_soul_crystal_7 ) + gg::OwnItemCount( target, @green_soul_crystal_8 ) + gg::OwnItemCount( target, @green_soul_crystal_9 ) + gg::OwnItemCount( target, @green_soul_crystal_10 ) + gg::OwnItemCount( target, @green_soul_crystal_11 ) + gg::OwnItemCount( target, @green_soul_crystal_12 ) + gg::OwnItemCount( target, @green_soul_crystal_13 ) + gg::OwnItemCount( target, @blue_soul_crystal_14 ) + gg::OwnItemCount( target, @cursed_blue_soul_crystal_14 ) + gg::OwnItemCount( target, @red_soul_crystal_14 ) + gg::OwnItemCount( target, @cursed_red_soul_crystal_14 ) + gg::OwnItemCount( target, @green_soul_crystal_14 ) + gg::OwnItemCount( target, @cursed_green_soul_crystal_14 ) + gg::OwnItemCount( target, @green_soul_crystal_15 ) + gg::OwnItemCount( target, @blue_soul_crystal_15 ) + gg::OwnItemCount( target, @red_soul_crystal_15 ) + gg::OwnItemCount( target, @blue_soul_crystal_16 ) + gg::OwnItemCount( target, @green_soul_crystal_16 ) + gg::OwnItemCount( target, @red_soul_crystal_16 ) == 1 )
  246.               {
  247.                 i0 = gg::Rand( Rand );
  248.                 if( i0 <= 9 )
  249.                 {
  250.                   if( gg::OwnItemCount( target, @blue_soul_crystal_0 ) == 1 )
  251.                   {
  252.                     myself::DeleteItem1( target, @blue_soul_crystal_0, unary->INTEGER_CONST );
  253.                     myself::GiveItem1( target, @blue_soul_crystal_1, unary->INTEGER_CONST );
  254.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  255.                     myself::ShowSystemMessage( target, 974 );
  256.                   }
  257.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_1 ) == 1 )
  258.                   {
  259.                     myself::DeleteItem1( target, @blue_soul_crystal_1, unary->INTEGER_CONST );
  260.                     myself::GiveItem1( target, @blue_soul_crystal_2, unary->INTEGER_CONST );
  261.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  262.                     myself::ShowSystemMessage( target, 974 );
  263.                   }
  264.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_2 ) == 1 )
  265.                   {
  266.                     myself::DeleteItem1( target, @blue_soul_crystal_2, unary->INTEGER_CONST );
  267.                     myself::GiveItem1( target, @blue_soul_crystal_3, unary->INTEGER_CONST );
  268.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  269.                     myself::ShowSystemMessage( target, 974 );
  270.                   }
  271.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_3 ) == 1 )
  272.                   {
  273.                     myself::DeleteItem1( target, @blue_soul_crystal_3, unary->INTEGER_CONST );
  274.                     myself::GiveItem1( target, @blue_soul_crystal_4, unary->INTEGER_CONST );
  275.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  276.                     myself::ShowSystemMessage( target, 974 );
  277.                   }
  278.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_4 ) == 1 )
  279.                   {
  280.                     myself::DeleteItem1( target, @blue_soul_crystal_4, unary->INTEGER_CONST );
  281.                     myself::GiveItem1( target, @blue_soul_crystal_5, unary->INTEGER_CONST );
  282.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  283.                     myself::ShowSystemMessage( target, 974 );
  284.                   }
  285.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_5 ) == 1 )
  286.                   {
  287.                     myself::DeleteItem1( target, @blue_soul_crystal_5, unary->INTEGER_CONST );
  288.                     myself::GiveItem1( target, @blue_soul_crystal_6, unary->INTEGER_CONST );
  289.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  290.                     myself::ShowSystemMessage( target, 974 );
  291.                   }
  292.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_6 ) == 1 )
  293.                   {
  294.                     myself::DeleteItem1( target, @blue_soul_crystal_6, unary->INTEGER_CONST );
  295.                     myself::GiveItem1( target, @blue_soul_crystal_7, unary->INTEGER_CONST );
  296.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  297.                     myself::ShowSystemMessage( target, 974 );
  298.                   }
  299.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_7 ) == 1 )
  300.                   {
  301.                     myself::DeleteItem1( target, @blue_soul_crystal_7, unary->INTEGER_CONST );
  302.                     myself::GiveItem1( target, @blue_soul_crystal_8, unary->INTEGER_CONST );
  303.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  304.                     myself::ShowSystemMessage( target, 974 );
  305.                   }
  306.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_8 ) == 1 )
  307.                   {
  308.                     myself::DeleteItem1( target, @blue_soul_crystal_8, unary->INTEGER_CONST );
  309.                     myself::GiveItem1( target, @blue_soul_crystal_9, unary->INTEGER_CONST );
  310.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  311.                     myself::ShowSystemMessage( target, 974 );
  312.                   }
  313.                   else if( gg::OwnItemCount( target, @blue_soul_crystal_9 ) == 1 )
  314.                   {
  315.                     myself::DeleteItem1( target, @blue_soul_crystal_9, unary->INTEGER_CONST );
  316.                     myself::GiveItem1( target, @blue_soul_crystal_10, unary->INTEGER_CONST );
  317.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  318.                     myself::ShowSystemMessage( target, 974 );
  319.                   }
  320.                   else if( gg::OwnItemCount( target, @red_soul_crystal_0 ) == 1 )
  321.                   {
  322.                     myself::DeleteItem1( target, @red_soul_crystal_0, unary->INTEGER_CONST );
  323.                     myself::GiveItem1( target, @red_soul_crystal_1, unary->INTEGER_CONST );
  324.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  325.                     myself::ShowSystemMessage( target, 974 );
  326.                   }
  327.                   else if( gg::OwnItemCount( target, @red_soul_crystal_1 ) == 1 )
  328.                   {
  329.                     myself::DeleteItem1( target, @red_soul_crystal_1, unary->INTEGER_CONST );
  330.                     myself::GiveItem1( target, @red_soul_crystal_2, unary->INTEGER_CONST );
  331.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  332.                     myself::ShowSystemMessage( target, 974 );
  333.                   }
  334.                   else if( gg::OwnItemCount( target, @red_soul_crystal_2 ) == 1 )
  335.                   {
  336.                     myself::DeleteItem1( target, @red_soul_crystal_2, unary->INTEGER_CONST );
  337.                     myself::GiveItem1( target, @red_soul_crystal_3, unary->INTEGER_CONST );
  338.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  339.                     myself::ShowSystemMessage( target, 974 );
  340.                   }
  341.                   else if( gg::OwnItemCount( target, @red_soul_crystal_3 ) == 1 )
  342.                   {
  343.                     myself::DeleteItem1( target, @red_soul_crystal_3, unary->INTEGER_CONST );
  344.                     myself::GiveItem1( target, @red_soul_crystal_4, unary->INTEGER_CONST );
  345.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  346.                     myself::ShowSystemMessage( target, 974 );
  347.                   }
  348.                   else if( gg::OwnItemCount( target, @red_soul_crystal_4 ) == 1 )
  349.                   {
  350.                     myself::DeleteItem1( target, @red_soul_crystal_4, unary->INTEGER_CONST );
  351.                     myself::GiveItem1( target, @red_soul_crystal_5, unary->INTEGER_CONST );
  352.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  353.                     myself::ShowSystemMessage( target, 974 );
  354.                   }
  355.                   else if( gg::OwnItemCount( target, @red_soul_crystal_5 ) == 1 )
  356.                   {
  357.                     myself::DeleteItem1( target, @red_soul_crystal_5, unary->INTEGER_CONST );
  358.                     myself::GiveItem1( target, @red_soul_crystal_6, unary->INTEGER_CONST );
  359.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  360.                     myself::ShowSystemMessage( target, 974 );
  361.                   }
  362.                   else if( gg::OwnItemCount( target, @red_soul_crystal_6 ) == 1 )
  363.                   {
  364.                     myself::DeleteItem1( target, @red_soul_crystal_6, unary->INTEGER_CONST );
  365.                     myself::GiveItem1( target, @red_soul_crystal_7, unary->INTEGER_CONST );
  366.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  367.                     myself::ShowSystemMessage( target, 974 );
  368.                   }
  369.                   else if( gg::OwnItemCount( target, @red_soul_crystal_7 ) == 1 )
  370.                   {
  371.                     myself::DeleteItem1( target, @red_soul_crystal_7, unary->INTEGER_CONST );
  372.                     myself::GiveItem1( target, @red_soul_crystal_8, unary->INTEGER_CONST );
  373.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  374.                     myself::ShowSystemMessage( target, 974 );
  375.                   }
  376.                   else if( gg::OwnItemCount( target, @red_soul_crystal_8 ) == 1 )
  377.                   {
  378.                     myself::DeleteItem1( target, @red_soul_crystal_8, unary->INTEGER_CONST );
  379.                     myself::GiveItem1( target, @red_soul_crystal_9, unary->INTEGER_CONST );
  380.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  381.                     myself::ShowSystemMessage( target, 974 );
  382.                   }
  383.                   else if( gg::OwnItemCount( target, @red_soul_crystal_9 ) == 1 )
  384.                   {
  385.                     myself::DeleteItem1( target, @red_soul_crystal_9, unary->INTEGER_CONST );
  386.                     myself::GiveItem1( target, @red_soul_crystal_10, unary->INTEGER_CONST );
  387.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  388.                     myself::ShowSystemMessage( target, 974 );
  389.                   }
  390.                   else if( gg::OwnItemCount( target, @green_soul_crystal_0 ) == 1 )
  391.                   {
  392.                     myself::DeleteItem1( target, @green_soul_crystal_0, unary->INTEGER_CONST );
  393.                     myself::GiveItem1( target, @green_soul_crystal_1, unary->INTEGER_CONST );
  394.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  395.                     myself::ShowSystemMessage( target, 974 );
  396.                   }
  397.                   else if( gg::OwnItemCount( target, @green_soul_crystal_1 ) == 1 )
  398.                   {
  399.                     myself::DeleteItem1( target, @green_soul_crystal_1, unary->INTEGER_CONST );
  400.                     myself::GiveItem1( target, @green_soul_crystal_2, unary->INTEGER_CONST );
  401.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  402.                     myself::ShowSystemMessage( target, 974 );
  403.                   }
  404.                   else if( gg::OwnItemCount( target, @green_soul_crystal_2 ) == 1 )
  405.                   {
  406.                     myself::DeleteItem1( target, @green_soul_crystal_2, unary->INTEGER_CONST );
  407.                     myself::GiveItem1( target, @green_soul_crystal_3, unary->INTEGER_CONST );
  408.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  409.                     myself::ShowSystemMessage( target, 974 );
  410.                   }
  411.                   else if( gg::OwnItemCount( target, @green_soul_crystal_3 ) == 1 )
  412.                   {
  413.                     myself::DeleteItem1( target, @green_soul_crystal_3, unary->INTEGER_CONST );
  414.                     myself::GiveItem1( target, @green_soul_crystal_4, unary->INTEGER_CONST );
  415.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  416.                     myself::ShowSystemMessage( target, 974 );
  417.                   }
  418.                   else if( gg::OwnItemCount( target, @green_soul_crystal_4 ) == 1 )
  419.                   {
  420.                     myself::DeleteItem1( target, @green_soul_crystal_4, unary->INTEGER_CONST );
  421.                     myself::GiveItem1( target, @green_soul_crystal_5, unary->INTEGER_CONST );
  422.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  423.                     myself::ShowSystemMessage( target, 974 );
  424.                   }
  425.                   else if( gg::OwnItemCount( target, @green_soul_crystal_5 ) == 1 )
  426.                   {
  427.                     myself::DeleteItem1( target, @green_soul_crystal_5, unary->INTEGER_CONST );
  428.                     myself::GiveItem1( target, @green_soul_crystal_6, unary->INTEGER_CONST );
  429.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  430.                     myself::ShowSystemMessage( target, 974 );
  431.                   }
  432.                   else if( gg::OwnItemCount( target, @green_soul_crystal_6 ) == 1 )
  433.                   {
  434.                     myself::DeleteItem1( target, @green_soul_crystal_6, unary->INTEGER_CONST );
  435.                     myself::GiveItem1( target, @green_soul_crystal_7, unary->INTEGER_CONST );
  436.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  437.                     myself::ShowSystemMessage( target, 974 );
  438.                   }
  439.                   else if( gg::OwnItemCount( target, @green_soul_crystal_7 ) == 1 )
  440.                   {
  441.                     myself::DeleteItem1( target, @green_soul_crystal_7, unary->INTEGER_CONST );
  442.                     myself::GiveItem1( target, @green_soul_crystal_8, unary->INTEGER_CONST );
  443.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  444.                     myself::ShowSystemMessage( target, 974 );
  445.                   }
  446.                   else if( gg::OwnItemCount( target, @green_soul_crystal_8 ) == 1 )
  447.                   {
  448.                     myself::DeleteItem1( target, @green_soul_crystal_8, unary->INTEGER_CONST );
  449.                     myself::GiveItem1( target, @green_soul_crystal_9, unary->INTEGER_CONST );
  450.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  451.                     myself::ShowSystemMessage( target, 974 );
  452.                   }
  453.                   else if( gg::OwnItemCount( target, @green_soul_crystal_9 ) == 1 )
  454.                   {
  455.                     myself::DeleteItem1( target, @green_soul_crystal_9, unary->INTEGER_CONST );
  456.                     myself::GiveItem1( target, @green_soul_crystal_10, unary->INTEGER_CONST );
  457.                     myself::SoundEffect( target, "ItemSound.quest_itemget" );
  458.                     myself::ShowSystemMessage( target, 974 );
  459.                   }
  460.                   else
  461.                   {
  462.                     myself::ShowSystemMessage( target, 978 );
  463.                   }
  464.                 }
  465.                 else
  466.                 {
  467.                   myself::ShowSystemMessage( target, 975 );
  468.                 }
  469.               }
  470.               else
  471.               {
  472.                 myself::ShowSystemMessage( target, 977 );
  473.               }
  474.             }
  475.           }
  476.           break;
  477.         }
  478.       }
  479.     }
  480.     super;
  481.   }
  482.  
  483.   EventHandler ATTACKED( attacker, c0, c1, c2, damage, i0, i1, i2, i3, skill_name_id )
  484.   {
  485.     myself::SetCurrentQuestID( SetCurrentQuestID );
  486.     c1 = attacker;
  487.     if( c1.master )
  488.     {
  489.       c1 = c1.master;
  490.     }
  491.     i1 = gg::Party_GetCount( c1 );
  492.     i2 = expr =;
  493.     if( i1 == 0 )
  494.     {
  495.       if( gg::HaveMemo( c1, @arrogant_quest ) &&
  496.           ( gg::GetMemoStateEx( c1, @arrogant_quest, unary->INTEGER_CONST ) == 12 ||
  497.             gg::GetMemoStateEx( c1, @arrogant_quest, unary->INTEGER_CONST ) == 13 ) &&
  498.           gg::OwnItemCount( c1, @q0348_white_fabric ) > 0 )
  499.       {
  500.         c2 = c1;
  501.       }
  502.     }
  503.     else
  504.     {
  505.       for( i0 = expr =; i0 < i1; i0 = i0 + 1 )
  506.       {
  507.         c0 = gg::Party_GetCreature( c1, i0 );
  508.         if( gg::HaveMemo( c0, @arrogant_quest ) &&
  509.             ( gg::GetMemoStateEx( c0, @arrogant_quest, unary->INTEGER_CONST ) == 12 ||
  510.               gg::GetMemoStateEx( c0, @arrogant_quest, unary->INTEGER_CONST ) == 13 ) &&
  511.             gg::OwnItemCount( c0, @q0348_white_fabric ) > 0 )
  512.         {
  513.           i3 = gg::Rand( Rand );
  514.           if( i2 <= i3 )
  515.           {
  516.             i2 = i3;
  517.             c2 = c0;
  518.           }
  519.         }
  520.       }
  521.     }
  522.     if( myself::IsNullCreature( c2 ) == 0 &&
  523.         myself::DistFromMe( c2 ) <= 1500 )
  524.     {
  525.       if( gg::HaveMemo( c2, @arrogant_quest ) &&
  526.           gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST ) == 12 &&
  527.           gg::OwnItemCount( c2, @q0348_white_fabric ) > 0 )
  528.       {
  529.         if( myself::GetCurrentTick() - c2.quest_last_reward_time > 1 )
  530.         {
  531.           c2.quest_last_reward_time = myself::GetCurrentTick();
  532.           i0 = gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST );
  533.           i0 = i0 + 60;
  534.           myself::SetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST,
  535.                                   i0 );
  536.           if( gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST ) + 60 > 80000 )
  537.           {
  538.             myself::GiveItem1( c2, @q0348_blooded_fabric,
  539.                                unary->INTEGER_CONST );
  540.             myself::DeleteItem1( c2, @q0348_white_fabric,
  541.                                  unary->INTEGER_CONST );
  542.             myself::RemoveMemo( c2, @arrogant_quest );
  543.             gg::AddLog( AddLog, c2, 348 );
  544.             myself::SoundEffect( c2, "ItemSound.quest_finish" );
  545.           }
  546.         }
  547.       }
  548.       if( gg::HaveMemo( c2, @arrogant_quest ) &&
  549.           gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST ) == 13 &&
  550.           gg::OwnItemCount( c2, @q0348_white_fabric ) > 0 )
  551.       {
  552.         if( myself::GetCurrentTick() - c2.quest_last_reward_time > 1 )
  553.         {
  554.           c2.quest_last_reward_time = myself::GetCurrentTick();
  555.           i0 = gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST );
  556.           i0 = i0 + 60;
  557.           myself::SetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST,
  558.                                   i0 );
  559.           if( gg::GetMemoStateEx( c2, @arrogant_quest, unary->INTEGER_CONST ) + 60 > 100000 )
  560.           {
  561.             myself::GiveItem1( c2, @q0348_blooded_fabric,
  562.                                unary->INTEGER_CONST );
  563.             myself::DeleteItem1( c2, @q0348_white_fabric,
  564.                                  unary->INTEGER_CONST );
  565.             myself::SetMemoStateEx( c2, @arrogant_quest,
  566.                                     unary->INTEGER_CONST,
  567.                                     unary->INTEGER_CONST );
  568.             myself::SoundEffect( c2, "ItemSound.quest_middle" );
  569.           }
  570.         }
  571.       }
  572.     }
  573.     myself::SetCurrentQuestID( SetCurrentQuestID );
  574.     switch( myself.i_quest0 )
  575.     {
  576.       case select_case compare:
  577.       {
  578.         myself.i_quest0 = expr =;
  579.         if( skill_name_id / 65536 == 137363457 / unary->INTEGER_CONST &&
  580.             myself.sm.hp <= myself.sm.max_hp * 0.500000 )
  581.         {
  582.           myself.i_quest0 = expr =;
  583.           myself.c_quest0 = attacker;
  584.         }
  585.         break;
  586.       }
  587.       case select_case compare:
  588.       {
  589.         if( skill_name_id / 65536 == 137363457 / unary->INTEGER_CONST &&
  590.             myself.sm.hp <= myself.sm.max_hp * 0.500000 )
  591.         {
  592.           myself.i_quest0 = expr =;
  593.           myself.c_quest0 = attacker;
  594.         }
  595.         break;
  596.       }
  597.       case select_case compare:
  598.       {
  599.         break;
  600.       }
  601.     }
  602.     super;
  603.   }
  604. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement