View Single Post
Old 06.02.2006, 06:30   #2
cool_santino
Архивный участник
 
Join Date: Nov 2005
Posts: 85
Default

Kirikups try this:

Code:
class warrior_sa
{ 
parameter: 
   int MaxLevel = 2; 

   int PerGet01 = 100; 
   int PerGet12 = 90; 

   int PerBreak0 = 0; 
   int PerBreak1 = 5; 

handler: 
   EventHandler SPELLED(speller, skill_name_id) 
   { 
      if(skill_name_id == @s_soul_crystal) 
      {
	  if(myself.sm.hp < myself.sm.max_hp / 2.0)
		myself.i_ai2 = speller;
      }
   }
   EventHandler MY_DYING(c1)
   {
	c1 = myself.i_ai2;
         //---------- BLUE SOUL CRYSTAL 
	
         if ((OwnItemCount(c1, @blue_soul_crystal_0) >= 1) && (MaxLevel >= 1)) 
	 { 
            if (Rand(100) <= PerGet01) { 
               DeleteItem1(c1, @blue_soul_crystal_0, 1); 
               GiveItem1(c1, @blue_soul_crystal_1,1); 
               SoundEffect(c1, "ItemSound.quest_itemget");
            } else if (Rand(100) < PerBreak0) { 
               DeleteItem1(c1, @blue_soul_crystal_0, 1); 
               SoundEffect(c1, "ItemSound.quest_middle");
            } 

         } 
	 else if ((OwnItemCount(c1, @blue_soul_crystal_1) >= 1) && (MaxLevel >= 2)) 
         { 
            if (Rand(100) <= PerGet12) 
	    { 
               DeleteItem1(c1, @blue_soul_crystal_1, 1); 
               GiveItem1(c1, @blue_soul_crystal_2,1); 
               SoundEffect(c1, "ItemSound.quest_itemget");
            } 
	    else if (Rand(100) < PerBreak1) 
	    { 
               DeleteItem1(c1, @blue_soul_crystal_1, 1); 
	       SoundEffect(c1, "ItemSound.quest_middle");
            } 

         } 
   }
}
cool_santino is offline