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 >
Wrap
Text File
|
2000-08-03
|
4KB
|
123 lines
/**
* Discipline Ghoulize script.
* <BR>Copyright (c) Nihilistic Software, Inc. 1998-1999
*
* @author YB
* Mod: Spock
*/
public class DisciplineGhoulize extends Discipline
{
private static final String DISCIPLINE_NAME = "Ghoulize";
// --------------------------------------------------------------------------------------------
public DisciplineGhoulize()
{
}
// --------------------------------------------------------------------------------------------
public boolean cancast(int level, int casterGuid, int targetGuid, float x, float y, float z, boolean bIsPos)
{
if(!CheckCastParameters(level, casterGuid, DISCIPLINE_NAME))
return(false);
if(!CheckCastTarget(targetGuid, DISCIPLINE_NAME))
return(false);
// Check that the target can be fed on
if((targetThing.GetActorFlags() & THING_AF_NOFEED) != 0)
return(false);
// ghouls can only wristfeed from vampires in their team
if((casterThing.GetActorType() == ACTOR_TYPE_GHOUL) && ((targetThing.GetActorType() != ACTOR_TYPE_VAMPIRE) || (casterThing.GetActorTeam() != targetThing.GetActorTeam())))
return(false);
return(true);
}
public int cast(int level, int casterGuid, int targetGuid)
{
// do sanity checks
if(!CheckCastParameters(level, casterGuid, DISCIPLINE_NAME))
return(0);
if(!CheckCastTarget(targetGuid, DISCIPLINE_NAME))
return(0);
SetupWorld(DISCIPLINE_NAME);
CaptureThing(casterGuid);
try
{
casterThing.Feed(targetGuid);
return(1);
}
catch(Exception e)
{
CodexConsole.PrintException(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
return(0);
}
catch(Error e)
{
CodexConsole.PrintError(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
return(0);
}
}
public void actorfeed(int actorGUID, int targetGUID, int status, int captureID)
{
if (status == ACTORFEED_STATUS_INPROGRESS &&
casterThing.GetActorType() == ACTOR_TYPE_VAMPIRE)
{
if (targetThing.GetActorType() == ACTOR_TYPE_HUMAN) //Ghoulize
{
targetThing.SetActorType(ACTOR_TYPE_GHOUL);
targetThing.SetActorDisciplineLevel("Feed",0);
targetThing.SetActorDisciplineLevel("BloodHealing",0);
targetThing.SetActorDisciplineLevel("BloodStrength",0);
targetThing.SetActorDisciplineLevel("BloodDexterity",0);
targetThing.SetActorDisciplineLevel("BloodStamina",0);
targetThing.SetActorDisciplineLevel("Potence",0);
targetThing.SetActorDisciplineLevel("Fortitude",0);
targetThing.SetActorBaseStat(ACTOR_STAT_BLOOD, 30);
targetThing.SetActorStat(ACTOR_STAT_BLOOD, 30);
targetThing.SetActorMaxHealth(140);
targetThing.SetActorClan(casterThing.GetActorClan());
targetThing.SetActorStat(ACTOR_STAT_BLOODPOOL, 100);
targetThing.SetActorAura("Ghoul");
targetThing.SetActorBaseStat(ACTOR_STAT_FAITH, 20);
targetThing.SetActorStat(ACTOR_STAT_FAITH, 20);
targetThing.SetActorBaseStat(ACTOR_STAT_MANA, 0);
targetThing.SetActorStat(ACTOR_STAT_MANA, 0);
targetThing.SetActorBaseStat(ACTOR_STAT_MANAPOOL, 0);
targetThing.SetActorStat(ACTOR_STAT_MANAPOOL, 0);
//Are You a NSC???
if (targetThing.GetActorTeam()>=9)
{ // Yes...
CodexConsole.PrintNLS(actorGUID, 0, "You made a Ghoul");
}
else
{ // No....
CodexConsole.PrintNLS(targetGUID, 0, "You have become a Ghoul");
CodexConsole.PrintNLS(actorGUID, 0, "You made a Ghoul");
}
targetThing.SetActorTeam(casterThing.GetActorTeam());
casterThing.SetActorStat(ACTOR_STAT_BLOOD,casterThing.GetActorStat(ACTOR_STAT_BLOOD) - 20);
casterThing.StopFeeding();
}
}
if (status == ACTORFEED_STATUS_STOPPED)
{
targetThing.ReviveActor(100,100);
}
}
}