Aller au contenu

Photo

Question : weapon buffs from scrolls staying on ....


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
 It seems if player does not rest before exiting they keep the buffs on weapons from scrolls.

Q: What is the solution?

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Look at the script for the scroll and see what is going wrong.

#3
Shadooow

Shadooow
  • Members
  • 4 471 messages
This works even on all others buffs by default. Cleric can buff his friend, then relog, then rest and them buff himself and they are fully buffed both...

Some PWs solves this via dispel OnEnter, boosts on weapons/armor including, others doesnt care...

#4
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Problem if player logs out ,when they login the buffs on weapon are permanent

keen, magic weapon, greater magic weapon, darkfire, flame weapon, and one or two bard/paladin weapon buff

I have a script that takes buffs off PC but does not take them off weapon .Is this going to be a script or in the nwnplayer.ini file?

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I do not think what you are discribing is what normally happens. Without knowing what scrolls are adding the proptries or seeing the script that is adding them? I am at a loss.

Are they standard boiware scrolls? Casting standard Bioware Spells. Have the Spell Scripts Been modified?

#6
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Sorry guys ..yes the standard darfire/greater magic weapon/scrolls and then standard weapon spells cast remain on weapon after relogging. I just tried a dispelling script oneneter like ShaDoOoW suggested but it didnt effect weapon.

void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;


// This is the Object to apply the effect to.


// Create the effect to apply
effect eDispelAll = EffectDispelMagicAll(40);

// Create the visual portion of the effect. This is instantly
// applied and not persistant with wether or not we have the
// above effect.
effect eVis = EffectVisualEffect(VFX_IMP_DISPEL);

// Apply the visual effect to the target
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC);
// Apply the effect to the object
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDispelAll, oPC);
}

#7
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Deafening Clang - x2_s0_deafclng
Flame Weapon - x2_s0_flmeweap
Greater Magic Weapon - x2_s0_grmagweap
Magic Vestment - x2_s0_magvest
Blackstaff - x2_s0_blckstff

These are some of the spells staying on players weapons ...if you guys have a fix to make them temporary or a link please let me know .

#8
TSMDude

TSMDude
  • Members
  • 865 messages
We had this problem too last year and I am racking my brain how we solved it...I will do a search on our archives as it sucked big beans.

#9
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Thanks TSMDude ... any help or clue how to solve this is appreciated greatly . It is #1 on my list of fixes and I am reminded regularly. lol

#10
TSMDude

TSMDude
  • Members
  • 865 messages
All right...I cannot find what we did. I know it was due to our game clock. Basically it was also not JUST scrlls but any spell effect. We found that we had a memory leak somewhere though that was the MAIN cause of this and plugged it as the system was getting over loaded and after we patched it it was fine.

You us enwnx too right? Check and see what script is being called too much.

#11
Shadooow

Shadooow
  • Members
  • 4 471 messages
This code will allow you to delete the spells from weapons after relog.

put this above void main

// remove all temporary effect on item
void removeAllTempEffect(object oItem) {
    itemproperty vlastnost;
    if (GetIsObjectValid(oItem)) {
          vlastnost = GetFirstItemProperty(oItem);
          while (GetIsItemPropertyValid(vlastnost))
          {
            if (GetItemPropertyDurationType(vlastnost)==DURATION_TYPE_TEMPORARY) RemoveItemProperty(oItem, vlastnost);
            vlastnost = GetNextItemProperty(oItem);
          }
    }
}

void removeEffectFromWeapons(object oPC) {
    removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC));
    removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC));
    removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC));
    removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC));

    // remove effect also from all item in invertory
    object oItem = GetFirstItemInInventory(oPC);
    while (oItem != OBJECT_INVALID) {
        removeAllTempEffect(oItem);
        oItem = GetNextItemInInventory(oPC);
    }
}


and then add removeEffectFromWeapons(oPC) somewhere below if (!GetIsPC(oPC)) return; line

but it shouldnt happen this way, do you have any of those weapon boost spellscripts in your module? if so post it.

Modifié par ShaDoOoW, 27 avril 2011 - 08:04 .


#12
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
ShaDoOoW ..I will give your script a try .Thanks

The only spell as far as spells go is I adjusted the TimeStop so it doesnt effect whole module.


TSMDude I use game version 1.69 with CEP 2.3 running on linux server.No nwnx2.
Yes it is mainly weapon spells that stay.Head DM made a list for me but not sure where I put it .
module hour is set to 2 minutes ...if I remember correctly ,it has been like this since I put server up.
I do have a save character script that fires every 2 minutes.
Also my module clock I have not made persistent.

Modifié par Knight_Shield, 27 avril 2011 - 08:59 .


#13
Shadooow

Shadooow
  • Members
  • 4 471 messages

Knight_Shield wrote...
Also my module clock I have not made persistent.

This is probably the reason why its happening. The itemproperties doesnt use the same way to fade as effects, instead they have set up timeline in which they will be removed. So if the clocks doesnt advance temporary itemproperties will never fade, also if you cast a weapon spell in the day 10 after module start day, the fade day will be set to lets say 11 after module start but if player logout and then log in when server restarts his weapons still be set to fade on day 11. Guess this is not removed after rest by default cos another issue I explained above. So adding that script above into OnPlayerRest event is probably good idea too.

#14
ffbj

ffbj
  • Members
  • 593 messages
I just do a remove temporary item property on unequip, and then on rest I also unequip the items in the players right and left hand. Of course this is somewhat related to my rest/fatigue system where players will need to periodically rest to recover fatigue. Yeah and you should get Dekalens persistent clock too,  Comes in real handy with the seasonal weather changes where I use Blasco Yangs weather system.  Probably one reason I have not had too much trouble in this regard since I have been using Dekalen's persistent clock for so long.  One other reason I use remove temp properties was to avoid certain exploits like selling magic items with temporary porperies on them. 

Modifié par ffbj, 27 avril 2011 - 11:58 .


#15
kalbaern

kalbaern
  • Members
  • 824 messages
Simply add the following in your modules OnAcquired Event:

object oItem = GetModuleItemAcquired();
    IPRemoveAllItemProperties(oItem,DURATION_TYPE_TEMPORARY);

When a player relogs, all equipment on their PC is recreated, IE acquired, and this is the best place to catch and correct the issue. The only drawback is that if a player crashes and relogs, their weapon buffs are gone.