home *** CD-ROM | disk | FTP | other *** search
/ Igromania 2000 September / Igromania_09.iso / GameZone / Vampire / Mods / Salvation / Salvation.exe / wodvm / Codex.nob / source / DisciplineGhoulize.java < prev    next >
Text File  |  2000-08-03  |  4KB  |  123 lines

  1. /**
  2.  * Discipline Ghoulize script.
  3.  * <BR>Copyright (c) Nihilistic Software, Inc. 1998-1999
  4.  *
  5.  * @author YB
  6.  * Mod: Spock
  7. */
  8.  
  9.  
  10. public class DisciplineGhoulize extends Discipline
  11. {
  12.     private static final String    DISCIPLINE_NAME    = "Ghoulize";
  13.  
  14.     // --------------------------------------------------------------------------------------------
  15.  
  16.     public DisciplineGhoulize()
  17.     {
  18.     }
  19.  
  20.     // --------------------------------------------------------------------------------------------
  21.  
  22.     public boolean cancast(int level, int casterGuid, int targetGuid, float x, float y, float z, boolean bIsPos)
  23.     {
  24.         if(!CheckCastParameters(level, casterGuid, DISCIPLINE_NAME))
  25.             return(false);
  26.  
  27.         if(!CheckCastTarget(targetGuid, DISCIPLINE_NAME))
  28.             return(false);
  29.  
  30.         // Check that the target can be fed on
  31.         if((targetThing.GetActorFlags() & THING_AF_NOFEED) != 0)
  32.             return(false);
  33.  
  34.         // ghouls can only wristfeed from vampires in their team
  35.         if((casterThing.GetActorType() == ACTOR_TYPE_GHOUL) && ((targetThing.GetActorType() != ACTOR_TYPE_VAMPIRE) || (casterThing.GetActorTeam() != targetThing.GetActorTeam())))
  36.             return(false);
  37.  
  38.         return(true);
  39.     }
  40.  
  41.     public int cast(int level, int casterGuid, int targetGuid)
  42.     {
  43.         // do sanity checks
  44.         if(!CheckCastParameters(level, casterGuid, DISCIPLINE_NAME))
  45.             return(0);
  46.  
  47.         if(!CheckCastTarget(targetGuid, DISCIPLINE_NAME))
  48.             return(0);
  49.  
  50.         SetupWorld(DISCIPLINE_NAME);
  51.  
  52.         CaptureThing(casterGuid);
  53.  
  54.         try
  55.         {
  56.             casterThing.Feed(targetGuid);
  57.             return(1);
  58.         }
  59.         catch(Exception e)
  60.         {
  61.             CodexConsole.PrintException(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
  62.             return(0);
  63.         }
  64.         catch(Error e)
  65.         {
  66.             CodexConsole.PrintError(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
  67.             return(0);
  68.         }
  69.     }
  70.  
  71.     public void actorfeed(int actorGUID, int targetGUID, int status, int captureID)
  72.     {
  73.         if (status == ACTORFEED_STATUS_INPROGRESS &&
  74.             casterThing.GetActorType() == ACTOR_TYPE_VAMPIRE)
  75.         {
  76.           if (targetThing.GetActorType() == ACTOR_TYPE_HUMAN) //Ghoulize
  77.             {
  78.             targetThing.SetActorType(ACTOR_TYPE_GHOUL);
  79.             targetThing.SetActorDisciplineLevel("Feed",0);
  80.             targetThing.SetActorDisciplineLevel("BloodHealing",0);
  81.             targetThing.SetActorDisciplineLevel("BloodStrength",0);
  82.             targetThing.SetActorDisciplineLevel("BloodDexterity",0);
  83.             targetThing.SetActorDisciplineLevel("BloodStamina",0);
  84.             targetThing.SetActorDisciplineLevel("Potence",0);
  85.             targetThing.SetActorDisciplineLevel("Fortitude",0);
  86.             targetThing.SetActorBaseStat(ACTOR_STAT_BLOOD, 30);
  87.             targetThing.SetActorStat(ACTOR_STAT_BLOOD, 30);
  88.             targetThing.SetActorMaxHealth(140);
  89.             targetThing.SetActorClan(casterThing.GetActorClan());
  90.             targetThing.SetActorStat(ACTOR_STAT_BLOODPOOL, 100);
  91.             targetThing.SetActorAura("Ghoul");
  92.             targetThing.SetActorBaseStat(ACTOR_STAT_FAITH, 20);
  93.             targetThing.SetActorStat(ACTOR_STAT_FAITH, 20);
  94.             targetThing.SetActorBaseStat(ACTOR_STAT_MANA, 0);
  95.             targetThing.SetActorStat(ACTOR_STAT_MANA, 0);
  96.             targetThing.SetActorBaseStat(ACTOR_STAT_MANAPOOL, 0);
  97.             targetThing.SetActorStat(ACTOR_STAT_MANAPOOL, 0);
  98.         //Are You a NSC???
  99.             if (targetThing.GetActorTeam()>=9)
  100.                 {    // Yes...
  101.                 CodexConsole.PrintNLS(actorGUID, 0, "You made a Ghoul");
  102.                 }
  103.             else
  104.                 {    // No....
  105.                 CodexConsole.PrintNLS(targetGUID, 0, "You have become a Ghoul");
  106.                 CodexConsole.PrintNLS(actorGUID, 0, "You made a Ghoul");
  107.                 }
  108.             targetThing.SetActorTeam(casterThing.GetActorTeam());
  109.             casterThing.SetActorStat(ACTOR_STAT_BLOOD,casterThing.GetActorStat(ACTOR_STAT_BLOOD) - 20);
  110.             casterThing.StopFeeding();
  111.           }
  112.         }
  113.  
  114.           if (status == ACTORFEED_STATUS_STOPPED)
  115.           {
  116.             targetThing.ReviveActor(100,100);
  117.           }
  118.         
  119.     }
  120.  
  121. }
  122.  
  123.