mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-12 03:13:00 -04:00
fixing borked scripts
This commit is contained in:
@@ -906,7 +906,7 @@ public class combat_engine
|
||||
attacker.aims=3;
|
||||
}
|
||||
String strAimMod = getWeaponStringType(weapon.weaponType);
|
||||
strAimMod.concat("_aim");
|
||||
strAimMod = strAimMod.concat("_aim");
|
||||
int intBaseAimMod = base_class.getSkillStatisticModifier(attacker.id, "aim");
|
||||
aimsMod = attacker.aims * (base_class.getSkillStatisticModifier(attacker.id, strAimMod)+intBaseAimMod);
|
||||
|
||||
|
||||
@@ -1223,7 +1223,7 @@ messageHandler makeSpaceStation()
|
||||
{
|
||||
for(int intI = 0; intI< strAdditionalScripts.length; intI++)
|
||||
{
|
||||
if(strAdditionalScripts!="")
|
||||
if(strAdditionalScripts[intI]!="")
|
||||
{
|
||||
attachScript(objStation, strAdditionalScripts[intI]);
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ string getSarlaccCollectionColumn(obj_id self)
|
||||
|
||||
for(int i = 0; i < foodList.length-1; i++)
|
||||
{
|
||||
if(foodList[i] == null || foodList.equals(""))
|
||||
if(foodList[i] == null || foodList[i].equals(""))
|
||||
continue;
|
||||
|
||||
allEdibles.add(foodList[i]);
|
||||
|
||||
+1
-1
@@ -1243,7 +1243,7 @@ string getSarlaccCollectionColumn(obj_id self)
|
||||
|
||||
for(int i = 0; i < foodList.length-1; i++)
|
||||
{
|
||||
if(foodList[i] == null || foodList.equals(""))
|
||||
if(foodList[i] == null || foodList[i].equals(""))
|
||||
continue;
|
||||
|
||||
allEdibles.add(foodList[i]);
|
||||
|
||||
@@ -33,7 +33,7 @@ trigger OnSpeaking(string text)
|
||||
i++;
|
||||
}
|
||||
|
||||
text.toLowerCase();
|
||||
text = text.toLowerCase();
|
||||
|
||||
if (text.startsWith("dungeonticket"))
|
||||
{
|
||||
|
||||
@@ -1033,7 +1033,7 @@ void prependModNameToObject(obj_id object, string modSIDreference)
|
||||
|
||||
string[] parsedString = split(baseName, ':');
|
||||
|
||||
if(!modName.startsWith("[") && !modName.startsWith("@") && !modName.equals("") && !modName.equals(null) && parsedString.length > 1)
|
||||
if(!modName.startsWith("[") && !modName.startsWith("@") && !modName.equals("") && parsedString.length > 1)
|
||||
{
|
||||
string stfFile = parsedString[0];
|
||||
string reference = parsedString[1];
|
||||
|
||||
@@ -3718,7 +3718,7 @@ boolean canPerformCommand(obj_id player, obj_id pet, string command)
|
||||
string[] abilityList = getTrainedSkills(pet);
|
||||
for(int i=0;i<abilityList.length;i++)
|
||||
{
|
||||
if(abilityList == "")
|
||||
if(abilityList[i] == "")
|
||||
continue;
|
||||
|
||||
if(abilityList[i].equals(command) && i <= additionalAbilitySlot)
|
||||
@@ -3799,7 +3799,7 @@ int calculateTrainingPointsSpent(obj_id pet, string passedAbility)
|
||||
|
||||
for(int i = 0; i < attackList.length; i++)
|
||||
{
|
||||
if(attackList == "empty")
|
||||
if(attackList[i] == "empty")
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ boolean updateCraftingSlot(obj_id player, string template)
|
||||
|
||||
string[] collectionTemplateCol = dataTableGetStringColumn(COLLECTION_REWARD_TABLE, CRAFTING_TEMPLATE );
|
||||
|
||||
if (collectionTemplateCol == null || collectionTemplateCol.equals(""))
|
||||
if (collectionTemplateCol == null || collectionTemplateCol[0].equals(""))
|
||||
return false;
|
||||
|
||||
int row = dataTableSearchColumnForString(template, CRAFTING_TEMPLATE, COLLECTION_REWARD_TABLE);
|
||||
|
||||
@@ -3807,7 +3807,7 @@ float getAttackerBlockReduction(obj_id attacker)
|
||||
|
||||
int getBlockAmmount(obj_id player)
|
||||
{
|
||||
int blockAmmount = isPlayer(player) || beast_lib.isBeast(player) ? 25 : Math.round(getLevel(player) * 2);
|
||||
int blockAmmount = isPlayer(player) || beast_lib.isBeast(player) ? 25 : Math.round((getLevel(player) * 2));
|
||||
|
||||
float blockStat = 0.0f;
|
||||
blockStat += (float)getEnhancedSkillStatisticModifierUncapped(player, "strength_modified");
|
||||
@@ -4668,4 +4668,4 @@ boolean hasPrescience(obj_id attacker, obj_id defender, combat_data actionData)
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void delegateFactionPoints(obj_id self, obj_id target, string params)
|
||||
prose.setDI(ppSuiTitle, available);
|
||||
string prompt = " \0" + packOutOfBandProsePackage(null, ppSuiTitle);
|
||||
|
||||
int pid = sui.transfer(self, self, prompt, title, utils.packStringId(SID_SUI_DELEGATE_FACTION_TITLE), Math.round(available), utils.packStringId(SID_SUI_DELEGATE_FACTION_CAT), 0, "handleDelegateSui", ratioFrom, ratioTo);
|
||||
int pid = sui.transfer(self, self, prompt, title, utils.packStringId(SID_SUI_DELEGATE_FACTION_TITLE), available, utils.packStringId(SID_SUI_DELEGATE_FACTION_CAT), 0, "handleDelegateSui", ratioFrom, ratioTo);
|
||||
if ( pid > -1 )
|
||||
{
|
||||
utils.setScriptVar(self, "delegate.pid", pid);
|
||||
|
||||
@@ -356,7 +356,7 @@ obj_id[] spawnExterior(obj_id hq, string tbl)
|
||||
string colName = dataTableGetColumnName(tbl, i);
|
||||
|
||||
string[] locs = dataTableGetStringColumnNoDefaults(tbl, i);
|
||||
if ( locs != null && !locs.equals("") )
|
||||
if ( locs != null)
|
||||
{
|
||||
for ( int n = 0; n < locs.length; n++ )
|
||||
{
|
||||
|
||||
@@ -493,10 +493,10 @@ void removeFromPlayerList(obj_id instance_id, obj_id player, int group)
|
||||
|
||||
for (int i=0;i<groupSplit.length;i++)
|
||||
{
|
||||
if (groupSplit.equals(""+player))
|
||||
if (groupSplit[i].equals(""+player))
|
||||
continue;
|
||||
|
||||
newList.concat("_"+groupSplit);
|
||||
newList = newList.concat("_"+groupSplit);
|
||||
}
|
||||
|
||||
if (newList == "")
|
||||
@@ -506,7 +506,7 @@ void removeFromPlayerList(obj_id instance_id, obj_id player, int group)
|
||||
}
|
||||
|
||||
if (newList.startsWith("_"))
|
||||
newList.substring(1);
|
||||
newList = newList.substring(1);
|
||||
|
||||
utils.setScriptVar(instance_id, PLAYER_LIST+"_"+group, newList);
|
||||
}
|
||||
|
||||
@@ -1089,7 +1089,7 @@ boolean quickSay( obj_id npc, string speech )
|
||||
{
|
||||
// Get reference to base.
|
||||
obj_id poiBaseObject = getBaseObject( npc );
|
||||
if ( (poiBaseObject == null) || (poiBaseObject == obj_id.NULL_ID) )
|
||||
if ( (poiBaseObject == obj_id.NULL_ID) )
|
||||
return false;
|
||||
|
||||
// Load convo file.
|
||||
|
||||
@@ -1182,7 +1182,7 @@ void checkForAddSetBonus(obj_id item, obj_id player)
|
||||
int numberOfSetItems = getNumSetItems(player, item, setBonusIndex);
|
||||
string setBonusBuffName = getSetBonusBuffName(item, setBonusIndex, numberOfSetItems);
|
||||
|
||||
if(!setBonusBuffName.equals(null) && !setBonusBuffName.equals("none"))
|
||||
if(!setBonusBuffName.equals("none"))
|
||||
{
|
||||
if(!buff.hasBuff(player, setBonusBuffName))
|
||||
{
|
||||
@@ -1209,7 +1209,7 @@ void checkForRemoveSetBonus(obj_id item, obj_id player)
|
||||
if(utils.hasScriptVar(item, NO_SET_ITEM_EQUIP_SPAM))
|
||||
utils.removeScriptVar(item, NO_SET_ITEM_EQUIP_SPAM);
|
||||
|
||||
if(!setBonusBuffName.equals(null) && !setBonusBuffName.equals("none"))
|
||||
if(!setBonusBuffName.equals("none"))
|
||||
{
|
||||
if(buff.hasBuff(player, setBonusBuffName))
|
||||
buff.removeBuff(player, setBonusBuffName);
|
||||
@@ -2598,4 +2598,4 @@ string_id getStaticItemStringIdName(obj_id object)
|
||||
string staticItemName = getStaticItemName(object);
|
||||
|
||||
return new string_id(STATIC_ITEM_NAME, staticItemName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ void createRangerLoot(obj_id mob, int level, string object, obj_id container)
|
||||
int getNumLootItems(int level, obj_id destContainer)
|
||||
{
|
||||
float lvl = level;
|
||||
int numItems = 1 + (int)Math.ceil(level/30);
|
||||
int numItems = 1 + (int)Math.ceil((level/30));
|
||||
|
||||
int free = getVolumeFree(destContainer);
|
||||
if(free < numItems)
|
||||
@@ -336,12 +336,12 @@ obj_id createHEPObject(obj_id container, int power, int count)
|
||||
{
|
||||
setObjVar(hep, HEP_BASE_POWER, power);
|
||||
setCount(hep, power);
|
||||
setObjVar(hep, HEP_EFFECTIVENESS, Math.round(power / 2));
|
||||
setObjVar(hep, HEP_EFFECTIVENESS, Math.round((power / 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
setObjVar(hep, HEP_EFFECTIVENESS, power);
|
||||
power = Math.round(power/2);
|
||||
power = Math.round((power/2));
|
||||
setObjVar(hep, HEP_BASE_POWER, power);
|
||||
setCount(hep, power);
|
||||
}
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
@@ -1965,7 +1965,7 @@ messageHandler makeSpaceStation()
|
||||
{
|
||||
for(int intI = 0; intI< strAdditionalScripts.length; intI++)
|
||||
{
|
||||
if(strAdditionalScripts!="")
|
||||
if(strAdditionalScripts[intI]!="")
|
||||
{
|
||||
attachScript(objStation, strAdditionalScripts[intI]);
|
||||
}
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -490,7 +490,7 @@ messageHandler handleAbilitySelection()
|
||||
//GET AN ARRAY OF ALL THE SKILLS BASED ON THE PROFESSION
|
||||
string[] professionSkillCodes = getProfessionSkillCodes( self, professionCodeSelection );
|
||||
|
||||
if (professionSkillCodes != "")
|
||||
if (professionSkillCodes[0] != "")
|
||||
{
|
||||
//sendSystemMessageTestingOnly(self, "professionSkillCodes == something");
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user