Salk Posted April 8, 2020 Posted April 8, 2020 Hello! Does anyone know if there is a way to check in a script whether a mine was set by a party member and, if that is the case, which one in particular? Thanks! Quote
DarthParametric Posted April 8, 2020 Posted April 8, 2020 // 533: Get the creator of oTrapObject, the creature that set the trap. // - oTrapObject: a placeable, door or trigger // * Returns OBJECT_INVALID if oTrapObject was created in the toolset. object GetTrapCreator(object oTrapObject); You may also find the following useful in order to grab the trap in the first place: // 488: Get the trap nearest to oTarget. // Note : "trap objects" are actually any trigger, placeable or door that is // trapped in oTarget's area. // - oTarget // - nTrapDetected: if this is TRUE, the trap returned has to have been detected // by oTarget. object GetNearestTrapToObject(object oTarget=OBJECT_SELF, int nTrapDetected=TRUE); Since GetTrapCreator returns an Object, just do a GetTag on that and then you can do some simple if checks against the party member tags. 1 Quote
Salk Posted April 8, 2020 Author Posted April 8, 2020 That's very useful, thanks! I'll have to test it but I hope that my modification to the k_trp_generic script will work. I wanted to add a bonus to damage and DC to mines set by party members that have Heavy Weapon Feat Proficiency or better: float fBonus = 1.0; int nBonus = 0; object oNPC = GetTrapCreator(OBJECT_SELF); //Add damage multiplier bonus if the mine was set by a party member with Heavy Weapons Feat float TP_DamageBonus(object oNPC, float fBonus) { if (IsObjectPartyMember(oNPC)) { if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_HEAVY_WEAPONS, oNPC)) { fBonus += 0.05; if (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HEAVY_WEAPONS, oNPC)) { fBonus += 0.10; if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_WEAPONS, oNPC)) { fBonus += 0.25; } } } } return fBonus; } //Add DC bonus if the mine was set by a party member with Heavy Weapons Feat int TP_DCBonus(object oNPC, int nBonus) { if (GetIsPC(oNPC)) { if (GetHasFeat(FEAT_WEAPON_PROFICIENCY_HEAVY_WEAPONS, oNPC)) { nBonus += 1; if (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HEAVY_WEAPONS, oNPC)) { nBonus += 3; if (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_WEAPONS, oNPC)) { nBonus += 5; } } } } return nBonus; } Unfortunately it seems the Gas Mines have neither DC nor damage value to improve upon so I'm just wondering what I can do to improve their effectiveness. Cheers! EDIT: Looking better at the original k_trp_generic script I wonder if there are a couple of problems? Isn't the DC for the Flash Mine fixed at 15, no matter what the nDC value is set to? Spoiler //FLASH STUN MINE if( nTrapID == TRAP_BASE_TYPE_FLASH_STUN_MINOR || nTrapID == TRAP_BASE_TYPE_FLASH_STUN_AVERAGE || nTrapID == TRAP_BASE_TYPE_FLASH_STUN_DEADLY ) { //The only difference between the flash traps is the DC. Therefore I am //using 1 section of the if statement. if(nTrapID == TRAP_BASE_TYPE_FLASH_STUN_MINOR) {nDC = 15 ;} if(nTrapID == TRAP_BASE_TYPE_FLASH_STUN_AVERAGE) {nDC = 20 ;} if(nTrapID == TRAP_BASE_TYPE_FLASH_STUN_DEADLY) {nDC = 25 ;} effect eStun = EffectStunned(); oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 3.3, lTrap, TRUE); while(GetIsObjectValid(oTarget)) { if(!WillSave(oTarget, 15) && GetRacialType(oTarget) != RACIAL_TYPE_DROID && !GetIsNeutral(oTarget, OBJECT_SELF)) { ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStun, oTarget, RoundsToSeconds(3)); } oTarget = GetNextObjectInShape(SHAPE_SPHERE, 3.3, lTrap, TRUE); } } and similarly, the Gas Mines should have a Fortitude ST to resist their effect but I can't see it here: Spoiler //GAS POISON TRAP else if(nTrapID == TRAP_BASE_TYPE_POISON_GAS_MINOR || TRAP_BASE_TYPE_POISON_GAS_AVERAGE || TRAP_BASE_TYPE_POISON_GAS_DEADLY) { effect ePoison; //The only difference between the poison traps is the poison type. Therefore I am //using 1 section of the if statement. if(nTrapID == TRAP_BASE_TYPE_POISON_GAS_MINOR) {ePoison = EffectPoison(POISON_DAMAGE_MILD);} if(nTrapID == TRAP_BASE_TYPE_POISON_GAS_AVERAGE) {ePoison = EffectPoison(POISON_DAMAGE_AVERAGE);} if(nTrapID == TRAP_BASE_TYPE_POISON_GAS_DEADLY) {ePoison = EffectPoison(POISON_DAMAGE_VIRULENT);} oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 3.3, lTrap, TRUE); while(GetIsObjectValid(oTarget)) { if(GetRacialType(oTarget) != RACIAL_TYPE_DROID && !GetIsNeutral(oTarget, OBJECT_SELF)) { ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); } oTarget = GetNextObjectInShape(SHAPE_SPHERE, 3.3, lTrap, TRUE); } } Quote
DarthParametric Posted April 8, 2020 Posted April 8, 2020 1 hour ago, Salk said: Isn't Bioware's shit broken? Probably. 2 Quote
Salk Posted April 8, 2020 Author Posted April 8, 2020 Well, it seems that there is a bug also with the Adhesive Grenades. There is supposed to be a saving throw vs DC 25 while instead there is none: Spoiler else if(nSpell == 92) //Adhesive { nVFX = 3008; effect eDex = EffectEntangle(); eDex = SetEffectIcon(eDex, 43); effect eGoo = EffectVisualEffect(1038); oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 4.0, GetSpellTargetLocation()); while(GetIsObjectValid(oTarget)) { if(!GetIsNeutral(oTarget)) { SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL)); if(!GetIsLinkImmune(oTarget, eDex) || GetRacialType(oTarget) == RACIAL_TYPE_DROID) { ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDex, oTarget, 15.0); DelayCommand(0.8, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eGoo, GetLocation(oTarget))); } } oTarget = GetNextObjectInShape(SHAPE_SPHERE, 4.0, GetSpellTargetLocation()); } } but I would like some confirmation I'm seeing right before opening a K1 CP issue. Quote
DarthParametric Posted April 8, 2020 Posted April 8, 2020 You'll probably want to do some in-game testing and see what the feedback log says to make sure they didn''t just skip scripting and hardcode it all. 1 Quote
Salk Posted April 9, 2020 Author Posted April 9, 2020 From some preliminary testing it seems the DC and damage for poison grenades and gas mines are both hardcoded. I tried to set flash mines of different power and there was no feedback to read in the message window when enemies triggered them. The adhesive grenade is the only grenade that doesn't seem to allow for a saving throw (I locally have added DC 15 because it doesn't make sense to me). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.