mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-17 00:05:07 -05:00
* Code compiles - execution NOT tested * updating gitignore * Removed intellij settings files * Removed more intellij files * Added exclusion for JDK classes. * Fixed purchasing script for vendors that have listed coin types. * Updated script to not kick off until the entire preload is complete. * adds static name entry for Solo movie poster and tcg9 vendor entry * clean up empty and orphaned object templates * adds placeholder black market (static) spawns * corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors * Updated gitignore and removed intellij project files * Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src * Fixed appearance and template for terminal (#2) * Fixed appearance and template for terminal (#3) * Fixed appearance and template for terminal (#4) * Deleted another faulty/orphaned object template * Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges. * Fixed some unneeded java 11 changes
152 lines
4.8 KiB
Java
Executable File
152 lines
4.8 KiB
Java
Executable File
package script.player;
|
|
|
|
import script.dictionary;
|
|
import script.library.buff;
|
|
import script.library.dot;
|
|
import script.library.trial;
|
|
import script.library.utils;
|
|
import script.obj_id;
|
|
|
|
public class player_dot extends script.base_script
|
|
{
|
|
public player_dot()
|
|
{
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
String[] dot_ids = dot.getAllDots(self);
|
|
if (dot_ids != null)
|
|
{
|
|
for (String dot_id : dot_ids) {
|
|
String type = dot.getDotType(self, dot_id);
|
|
if (!type.equals(dot.DOT_DISEASE)) {
|
|
int pulse = dot.getDotPulse(self, dot_id);
|
|
dictionary d = new dictionary();
|
|
d.put("dot_id", dot_id);
|
|
d.put("pulse", pulse);
|
|
messageTo(self, "OnDotPulse", d, pulse, false);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
detachScript(self, dot.SCRIPT_PLAYER_DOT);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnDetach(obj_id self) throws InterruptedException
|
|
{
|
|
if (utils.hasScriptVar(self, dot.SCRIPT_VAR_DOT_GRACE))
|
|
{
|
|
utils.removeScriptVar(self, dot.SCRIPT_VAR_DOT_GRACE);
|
|
}
|
|
setState(self, STATE_BLEEDING, false);
|
|
setState(self, STATE_POISONED, false);
|
|
setState(self, STATE_DISEASED, false);
|
|
setState(self, STATE_ON_FIRE, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnEnterSwimming(obj_id self) throws InterruptedException
|
|
{
|
|
if (dot.isOnFire(self))
|
|
{
|
|
dot.reduceDotTypeStrength(self, dot.DOT_FIRE, 10000);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnAttribModDone(obj_id self, String modName, boolean isDead) throws InterruptedException
|
|
{
|
|
if (false)
|
|
{
|
|
String[] parts = split(modName, '.');
|
|
if (parts.length < 3)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String dot_id = parts[2];
|
|
dot.removeDotEffect(self, dot_id, true);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnDotPulse(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
if (params == null)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String dot_id;
|
|
if (params.containsKey("dot_id"))
|
|
{
|
|
dot_id = params.getString("dot_id");
|
|
}
|
|
else
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
int pulse;
|
|
if (params.containsKey("pulse"))
|
|
{
|
|
pulse = params.getInt("pulse");
|
|
}
|
|
else
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (dot.applyDotDamage(self, dot_id))
|
|
{
|
|
obj_id attacker = params.getObjId("attacker");
|
|
if (isPlayer(attacker) && exists(attacker))
|
|
{
|
|
addHate(self, attacker, 0.0f);
|
|
addHate(attacker, self, 0.0f);
|
|
}
|
|
messageTo(self, "OnDotPulse", params, pulse, false);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnBuffDotPulse(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
if (params == null)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!trial.verifySession(self, params, params.getString("buffName")))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id caster = params.getObjId("caster");
|
|
String buffName = params.getString("buffName");
|
|
int strength = params.getInt("strength");
|
|
String type = params.getString("type");
|
|
if (!buff.hasBuff(self, buffName))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
long stackCount = buff.getBuffStackCount(self, buffName);
|
|
strength *= stackCount;
|
|
if (dot.applyBuffDotDamage(self, caster, buffName, strength, type))
|
|
{
|
|
obj_id attacker = params.getObjId("attacker");
|
|
if (isPlayer(attacker) && exists(attacker))
|
|
{
|
|
addHate(self, attacker, 0.0f);
|
|
addHate(attacker, self, 0.0f);
|
|
}
|
|
messageTo(self, "OnBuffDotPulse", params, buff.BUFF_DOT_TICK, false);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int bleedingStopped(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnDotGraceEnd(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
if (utils.hasScriptVar(self, dot.SCRIPT_VAR_DOT_GRACE))
|
|
{
|
|
utils.removeScriptVar(self, dot.SCRIPT_VAR_DOT_GRACE);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|