Aller au contenu

Photo

REQUEST FOR NEW IDEAS TO SCRIPT


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

#26
ehye_khandee

ehye_khandee
  • Members
  • 855 messages

ShaDoOoW wrote...

Baaleos wrote...

it is definitely do-able via conversation.

Conversation approach is almost useless for me, but could work for some situations like roleplaying. So lets see, if we can see this done ehye_khandee :innocent:


Under two hours later, I have 35 lines of nwscript that should do the trick. I'll test it myself tonight and see how it runs, if it works as intended, I'll release it here in this thread tomorrow.

It works off the talk and whisper channels and requires only a short prefix be spoken followed by the number of the spell effect or the SPELL_(constant). Easy enough to keep a short list of your favorite spell numbers next to your desk I figure - doing mouse related selection is out of the question though, text is a FAST interface anyway. :D


Happy holiday.

GM_ODA

#27
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
UPDATE - my partner in code has agreed that my 35 lines of instruction will do the trick. We are testing this today on ArgentumRegio, subject to successful testing, a release will follow very soon. Stay tuned to this thread for details and PLEASE ADD MORE IDEAS TO OUR COLLECTION. We love these kind of challenges. :D



Be well. Game on.

GM_ODA

#28
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.



It is also on nwvault but not approved there yet so no link supplied at this time.



//alt_chatbit by GM_ODA (elapsed time 1:40) 20101125

//ADD TO CHAT_SCRIPT - PLEASE RETAIN FULL CREDITS,

// hire this scripter!

/* a Thanksgiving 2010 GIFT to the NWN community from

GM_ODA aka ehye_khandee of server ArgentumRegio

66.232.100.90 cep2.1+

aldohral.forumotion.com

My day may lack turkey - but I have a server more magical than gravy!

A simple 31 line routine to allow PCs to remove spell effects from

selves IF they themselves cast the spell.

HAVE A SAFE AND HAPPY HOLIDAY SEASON NWNers!!!

*/

void main()

{

int TV = GetPCChatVolume();

int nSpell=0;

effect eEffectDuJour;

object oPC = GetPCChatSpeaker(), oMod = GetModule();

string sSaid = GetPCChatMessage(), sLeft = GetStringLeft(sSaid, 1);

if(GetLocalInt(oMod, "SILENCEVOICES")) return;

// START - Possessing Messages

if(TV>1)return;// whisper and talk channel only

if(sLeft=="-")// trigger internal functions

{

if(FindSubString(sSaid,"dispel",1))// trigger self-spell dispel

{

// process spell number

nSpell = StringToInt(GetStringRight(sSaid,GetStringLength(sSaid)-7));

if(GetHasSpellEffect(nSpell,oPC))// has spell effect

{

eEffectDuJour=GetFirstEffect(oPC);

while(GetEffectCreator(eEffectDuJour)!=OBJECT_INVALID)

{

if(GetEffectSpellId(eEffectDuJour)==nSpell && GetEffectCreator(eEffectDuJour)==oPC)

{

RemoveEffect(oPC,eEffectDuJour);

}

eEffectDuJour=GetNextEffect(oPC);

}

}

}

}

}





Be well. Game on.

GM_ODA, genius by trade.


#29
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 877 messages
This is a decent script.  It looks similar to the second half of a little something I've been using in Aenea since the end of May.

You might also want to consider adding a chat-command function to quickly give players a list of the spell IDs for the self-dispelable effects that they currently have active on them.  That way they won't need to keep an out-of-game reference list, especially as they become more experienced with more and more spells available.

Modifié par The Amethyst Dragon, 26 novembre 2010 - 11:22 .


#30
Vhaeraun Baenre

Vhaeraun Baenre
  • Members
  • 45 messages
nice thread. I was hoping to get a little help with a script that I thought worked already with my module when I had Sherincall create the base mod for me but it has never worked. I need a script/script system so that when Players die they drop all of their gold into a sack and ALSO have a 20% chance to drop 1 randomly selected equipped item EXCEPT for plot items.

I'm not sure if this 'chance' is even possibly or the randomly selected equipment slot either. Much love if you could figure it out for me :)

this is what the script currently has in it, but again it never seemed to work:

 object oVault = GetLocalObject(GetModule(), "TM_Vault");
    int nDropLevel = GetLocalInt(oVault, "TM_PCDropLevel");
    int bPVP = GetIsPC(GetLastHostileActor(oPC));



    if (d100() < TM_PERCENT_ITEM_DROP_ON_PC_DEATH &&  nDropLevel != DEATH_DROP_NONE)
    {

      if (nDropLevel == DEATH_DROP_PVE && !bPVP)
      {
        int nSlot = Random(NUM_INVENTORY_SLOTS);
        object oItem = GetItemInSlot(nSlot, oPC);
        while (oItem == OBJECT_INVALID)
        {
           nSlot++;
           if (nSlot > NUM_INVENTORY_SLOTS-1) nSlot = 0;
           oItem = GetItemInSlot(nSlot, oPC);
        }
        location lLoc = GetLocation(oLootBag);
        CopyObject(oItem, lLoc, oLootBag);
        DestroyObject(oItem);
      }
    }
    AssignCommand(oLootBag, TakeGoldFromCreature(GetGold(oPC), oPC));

Modifié par Vhaeraun Baenre, 27 novembre 2010 - 02:30 .


#31
CalSailX

CalSailX
  • Members
  • 56 messages

Avonos the Rogue wrote... I’d like to see a few things scripted. I don’t know if they exist on the vault. I intended to write them someday, but I doubt I will ever get the time. I have always wanted to see contagious diseases between players, creatures, from some areas, triggers, etc. I had an outline with magical and natural diseases that didn’t just wear off, and would spread transparently among players. Usually to be contracted from creatures, or chance by area. Give NPCs a memory, probably SQL driven with unique IDs for characters with an opportunity for the NPC to react accordingly. This could be made so that the NPCs would forget a PC after enough time. Optional PvP set and stored server side by a NPC so it’s not just a one-sided instant toggle on a whim. If this is associated with an auto-hostile subsystem as well is up in the air. I'm sure there are other things I would like to see, but these are what I remembered off the top of my head.

PRR hasn't been converted to use a SQL database as near as I know, but would be a starting point for giving NCP's a memory... use it in a module I'm working on. Contagious diseases can be handled by faction area creature who's function is to infect and dispence disease. Using a custom disease.2da and effect scripts, and a bit to spellhooking. Enter the STD that can't be cured or only cured with the intervention of a quest NPC... wicked I know but rewards those that can show a bit of restaint when it comes to that type interaction with other PC/NPC's. Could easily be used to for generic custom diseases, add a target object to faction disease depensing creature fire a ude for  the creature and zap... bad things happen to your hero or the target depending on ude fired.



#32
Shadooow

Shadooow
  • Members
  • 4 468 messages

ehye_khandee wrote...

It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.

Its impossible to do the way I wanted. Your solution is very ugly and not user friendly. Thats for your blustering about.

For me, it wouldn't be such problem to use this, I even remember some spells ID. But for general player this wouldn't be much to use. The conversation option is also not ideal. Only right way is to code it into nwn client. But thanks to try.

#33
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 877 messages

ShaDoOoW wrote...

ehye_khandee wrote...
It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.

Its impossible to do the way I wanted. Your solution is very ugly and not user friendly. Thats for your blustering about.

For me, it wouldn't be such problem to use this, I even remember some spells ID. But for general player this wouldn't be much to use. The conversation option is also not ideal. Only right way is to code it into nwn client. But thanks to try.


Ouch.  I think it's a fine bit of scripting ehye_khandee did, which seems to be what the title of this thread is leaning towards.  If there's no way to be happy about a scripted solution, why ask for something in a "scripting ideas" thread?

Most scripting I know of is of no use to the general player...only to a builder that can use that script to deliver a better playing experience in a module/PW.

And for those wondering, a conversation option can work, as long as there is a call to ClearAllActions(TRUE) right before firing up the conversation (the "TRUE" part drops the PC out of combat so that the conversation can be started).  I just prefer the chat-command version to save on adding multiple scripts to my module.

#34
Shadooow

Shadooow
  • Members
  • 4 468 messages

The Amethyst Dragon wrote...

ShaDoOoW wrote...

ehye_khandee wrote...
It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.

Its impossible to do the way I wanted. Your solution is very ugly and not user friendly. Thats for your blustering about.

For me, it wouldn't be such problem to use this, I even remember some spells ID. But for general player this wouldn't be much to use. The conversation option is also not ideal. Only right way is to code it into nwn client. But thanks to try.


Ouch.  I think it's a fine bit of scripting ehye_khandee did, which seems to be what the title of this thread is leaning towards.  If there's no way to be happy about a scripted solution, why ask for something in a "scripting ideas" thread?

Most scripting I know of is of no use to the general player...only to a builder that can use that script to deliver a better playing experience in a module/PW.

And for those wondering, a conversation option can work, as long as there is a call to ClearAllActions(TRUE) right before firing up the conversation (the "TRUE" part drops the PC out of combat so that the conversation can be started).  I just prefer the chat-command version to save on adding multiple scripts to my module.

Ah, he changed the thread name, I noticed just now.

It was "REQUEST FOR NEW IDEAS TO CODE" first.

#35
dickloraine

dickloraine
  • Members
  • 4 messages
@Vhaeraun Baenre:
Doesn't look like the whole script, oLootBag and the constants aren't there. Maybe there is an nclude file? This systems seems to need a object called "TM_Vault" somewhere in your mod and on it some variables, which control the behavior of the script. First check, if the constants and the variables needed are set. If you didn't find them, set values per hand for trying it.

This should have nothing to do with not doing its job, but the while loop in the script seems to be an infinite loop, if the PC dying is naked. That needs to be redone.

Modifié par dickloraine, 27 novembre 2010 - 10:23 .


#36
Avonos the Rogue

Avonos the Rogue
  • Members
  • 39 messages

CalSailX wrote...

Avonos the Rogue wrote... I’d like to see a few things scripted. I don’t know if they exist on the vault. I intended to write them someday, but I doubt I will ever get the time. I have always wanted to see contagious diseases between players, creatures, from some areas, triggers, etc. I had an outline with magical and natural diseases that didn’t just wear off, and would spread transparently among players. Usually to be contracted from creatures, or chance by area. Give NPCs a memory, probably SQL driven with unique IDs for characters with an opportunity for the NPC to react accordingly. This could be made so that the NPCs would forget a PC after enough time. Optional PvP set and stored server side by a NPC so it’s not just a one-sided instant toggle on a whim. If this is associated with an auto-hostile subsystem as well is up in the air. I'm sure there are other things I would like to see, but these are what I remembered off the top of my head.

PRR hasn't been converted to use a SQL database as near as I know, but would be a starting point for giving NCP's a memory... use it in a module I'm working on. Contagious diseases can be handled by faction area creature who's function is to infect and dispence disease. Using a custom disease.2da and effect scripts, and a bit to spellhooking. Enter the STD that can't be cured or only cured with the intervention of a quest NPC... wicked I know but rewards those that can show a bit of restaint when it comes to that type interaction with other PC/NPC's. Could easily be used to for generic custom diseases, add a target object to faction disease depensing creature fire a ude for  the creature and zap... bad things happen to your hero or the target depending on ude fired.




The initial work I'd done on sorting out NPC
memory/attitudes was based mostly on the on perception event of the NPC
combined with NWNx2, and MySQL.  Probably each involved NPC remembering
every UID they see, then running it twice for each on perceive event would be
too much.  But I still like the idea, and as there are better coders out
there than I, it's worth a mention.  This
could give rise to reactions and reputation, among other things.



As far as the diseases go, I entirely enjoyed some of the contagious disease
events that occurred in WoW.  Also it could give some fun opportunities to
low chance random encounters or plagues, demon ****houses, whatever. 
Having the custom diseases spread in a variety of ways, and transparently, I thought
it would be a particularly evil way to torment people.

I will certainly put a link to this post into my notes in
the event I ever actually get the time to sit down and script this in the
future.  Thanks for the feedback!

Modifié par Avonos the Rogue, 27 novembre 2010 - 07:36 .


#37
ehye_khandee

ehye_khandee
  • Members
  • 855 messages

ShaDoOoW wrote...


ehye_khandee wrote...

It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.

Its impossible to do the way I wanted. Your solution is very ugly and not user friendly. Thats for your blustering about.

For me, it wouldn't be such problem to use this, I even remember some spells ID. But for general player this wouldn't be much to use. The conversation option is also not ideal. Only right way is to code it into nwn client. But thanks to try.


I think you underestimate other PLAYERS, they can well use cheat sheets or even memorize a handful of spell numbers to use (their frequent use ones). This is consistent with the rest of guile's posts, er, ShaDoOoW that is. You might well recall advice I gave prior in this thread.

"In many things, the difference between possible and impossible, is in the approach. -GM_ODA"

The approach I choose leads to the realm of possible. You should try it sometime.

:devil:

#38
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

ehye_khandee wrote...

It is in, tested a bit (not every spell but it seems to work so far). Here it is, the 'impossible to make in nwscript' script to allow your PCs to remove spells on themselves which they cast themselves. 31 lines of lean, clean code. Enjoy.


Here's what we use on HG to do this. It's a lot slicker, but it takes a lot more code, and some plugins to boot. It's done via custom SIMTools (chat) command, and takes a lot more types of input (you can cancel AoEs, weapon props, etc). I'm also including our listing function, which solves the whole issue of pcs having to look up / write their favorites. Code is acaos'.

First, the listing command (players do this by speaking '!effects'):
            } else if (sCText == "effects") {
                DeleteLocalString(oCPC, "FKY_CHAT_LOCAL_CTEXT");

                if (!GetIsObjectValid(oCTarget)) {
                    oCTarget = GetLocalObject(oCPC, "FKY_CHAT_TARGET");

                    if (!GetIsObjectValid(oCTarget)) {
                        FloatingTextStringOnCreature(COLOR_GOLD + REQUIRES_TARGET + COLOR_END, oCPC, FALSE);
                        SetLocalString(oCPC, "FKY_CHAT_COMMAND", OBJECT_TARGET + "!" + sCText);

                        if (!GetIsObjectValid(GetItemPossessedBy(oCPC, "fky_chat_target")))
                            CreateItemOnObject("fky_chat_target", oCPC);
                        return;
                    }
                    else
                        DeleteLocalObject(oCPC, "FKY_CHAT_TARGET");
                }


                int nSpellId, nDur;
                string sSpellName, sSpellId, sSpellsListed = "";
                string sMessage;

                if (GetObjectType(oCTarget) == OBJECT_TYPE_CREATURE) {
                    if (oCTarget == oCPC)
                        sMessage = COLOR_LT_GREEN + "Effects on you:\\n";
                    else
                        sMessage = COLOR_LT_GREEN + "Effects you cast on " + GetName(oCTarget) + ":\\n";

                    effect eEff = GetFirstEffect(oCTarget);

                    while (GetIsEffectValid(eEff)) {
                        if ((nSpellId = GetListableEffectSpellId(oCPC, oCTarget, eEff)) >= 0  &&
                            FindSubString(sSpellsListed, (sSpellId = "#" + IntToString(nSpellId) + " ")) < 0) {

                            if ((sSpellName = SFGetSpellName(nSpellId)) != "") {
                                sMessage += COLOR_WHITE + "    " + sSpellId + COLOR_LT_GREEN + sSpellName;

                                if (GetEffectDurationType(eEff) == DURATION_TYPE_TEMPORARY) {
                                    nDur = FloatToInt(GetEffectDurationRemaining(eEff));

                                    if (nDur > 60)
                                        sMessage += " [" + IntToString(nDur / 60) + "m" + IntToString(nDur % 60) + "s left]";
                                    else
                                        sMessage += " [" + IntToString(nDur) + "s left]";
                                } else
                                    sMessage += " [perm]";

                                object oCreator = GetListableEffectCreator(oCTarget, eEff);

                                if (oCreator != oCPC)
                                    sMessage += " (" + GetName(oCreator) + ")\\n";
                                else
                                    sMessage += "\\n";
                            }

                            sSpellsListed += sSpellId;
                        }

                        eEff = GetNextEffect(oCTarget);
                    }
                } else if (GetObjectType(oCTarget) == OBJECT_TYPE_ITEM && GetItemPossessor(oCTarget) == oCPC) {
                    sMessage = COLOR_LT_GREEN + "Magical effects on " + GetName(oCTarget) + ":\\n";

                    itemproperty ip = GetFirstItemProperty(oCTarget);

                    while (GetIsItemPropertyValid(ip)) {
                        if (GetItemPropertyDurationType(ip) == DURATION_TYPE_TEMPORARY &&
                            (nSpellId = GetItemPropertySpellId(ip)) >= 0               &&
                            FindSubString(sSpellsListed, (sSpellId = "#" + IntToString(nSpellId) + " ")) < 0) {

                            if ((sSpellName = SFGetSpellName(nSpellId)) != "") {
                                sMessage += COLOR_WHITE + "    " + sSpellId + COLOR_LT_GREEN + sSpellName;

                                nDur = FloatToInt(GetItemPropertyDurationRemaining(ip));

                                if (nDur > 60)
                                    sMessage += " [" + IntToString(nDur / 60) + "m" + IntToString(nDur % 60) + "s left]\\n";
                                else
                                    sMessage += " [" + IntToString(nDur) + "s left]\\n";
                            }

                            sSpellsListed += sSpellId;
                        }

                        ip = GetNextItemProperty(oCTarget);
                    }
                } else {
                    FloatingTextStringOnCreature(COLOR_RED +
                        "This command may only be targeted at creatures or items you possess!" + COLOR_END, oCPC, FALSE);
                    return;
                }

                SendChatLogMessage(oCPC, sMessage + COLOR_END, oCPC, 5);
            }


Then, the canceling command. Expected inputs are in the form of !cancel aoe, !cancel poly, and so on - the ! is pre-parsed out:
            if (GetStringLeft(sCText, 7) == "cancel ") {
                string sCancel = GetStringLowerCase(GetStringRight(sCText, GetStringLength(sCText) - 7));
                DeleteLocalString(oCPC, "FKY_CHAT_LOCAL_CTEXT");

                if (sCancel == "aoe") {
                    int nCount = 1;
                    object oPlace;

                    while (GetIsObjectValid(oCTarget = GetNearestObject(OBJECT_TYPE_AREA_OF_EFFECT, oCPC, nCount++))) {
                        if (GetAreaOfEffectCreator(oCTarget) == oCPC && !GetLocalInt(oCTarget, "NoAoEDispel")) {
                            oPlace = GetLocalObject(oCTarget, "AoEPlaceable");

                            ApplyVisualAtLocation(VFX_FNF_DISPEL, GetLocation(oCTarget));
                            DestroyObject(oCTarget);
                            DestroyObject(oPlace);
                        }
                    }

                    return;
                } else if (sCancel == "maze") {
                    int nCount = 1;

                    while (GetIsObjectValid(oCTarget = GetNearestObjectByTag("MazeReturn", oCPC, nCount++))) {
                        if (GetLocalObject(oCTarget, "MazeCaster") == oCPC) {
                            object oVictim = GetLocalObject(oCTarget, "MazeTarget");

                            RemoveEffectsFromSpell(SPELL_DOMINATE_MONSTER, oVictim);

                            ApplyVisualAtLocation(VFX_IMP_DISPEL, GetLocation(oCTarget));
                            SetPlotFlag(oCTarget, FALSE);
                            DestroyObject(oCTarget, 0.1);
                        }
                    }

                    return;
                } else if (sCancel == "poly") {
                    int nHP = 20 + (GetAbilityModifier(ABILITY_CONSTITUTION, oCPC) * GetHitDice(oCPC));
                    if (GetCurrentHitPoints(oCPC) < nHP)
                        FloatingTextStringOnCreature(COLOR_RED + "Unshifting now would kill you!" + COLOR_END, oCPC, FALSE);
                    else if (RemoveEffectsOfType(EFFECT_TYPE_POLYMORPH, oCPC, oCPC) > 0)
                        AssignCommand(oCPC, ClearAllActions());
                    return;
                }

                if (!GetIsObjectValid(oCTarget)) {
                    oCTarget = GetLocalObject(oCPC, "FKY_CHAT_TARGET");

                    if (!GetIsObjectValid(oCTarget)) {
                        FloatingTextStringOnCreature(COLOR_GOLD + REQUIRES_TARGET + COLOR_END, oCPC, FALSE);
                        SetLocalString(oCPC, "FKY_CHAT_COMMAND", OBJECT_TARGET + "!" + sCText);

                        if (!GetIsObjectValid(GetItemPossessedBy(oCPC, "fky_chat_target")))
                            CreateItemOnObject("fky_chat_target", oCPC);
                        return;
                    } else
                        DeleteLocalObject(oCPC, "FKY_CHAT_TARGET");
                }

                if (GetObjectType(oCTarget) != OBJECT_TYPE_CREATURE &&
                    !(GetObjectType(oCTarget) == OBJECT_TYPE_ITEM && GetItemPossessor(oCTarget) == oCPC)) {
                    FloatingTextStringOnCreature(COLOR_RED +
                        "This command may only be targeted at creatures or items you possess!" + COLOR_END, oCPC, FALSE);
                    return;
                }


                int nRemoved = 0;

                if (sCancel != "all") {
                    struct SubString ss;
                    ss.rest = sCancel;

                    while (ss.rest != "") {
                        ss = GetFirstSubString(ss.rest, " ");
                        nRemoved += RemoveMagicalEffects(oCTarget, oCPC, StringToInt(ss.first));
                    }
                } else
                    nRemoved = RemoveMagicalEffects(oCTarget, oCPC);

                if (nRemoved > 0)
                    ApplyVisualToObject(VFX_IMP_DISPEL, oCTarget);
            }


If you're interested in trying to adapt any of that, let me know what subfunctions you want to look at - I don't want to codebomb your thread.

Funky

#39
Frith5

Frith5
  • Members
  • 380 messages
Nice stuff going on here.

As for suggestions, well . . .

I've always wanted an 'introduction' system:

I'm playing Glokk, a half-orc barbarian.
You're playing Tilla, a halfling cleric.
He's playing Shaelitha, an elven ranger.

I look at Tilla, Her name, though, on mouseover shows only a physical descriptor: 'A female halfling'. Likewise, Shaelitha has the name 'a male elf'. My own shows as 'a male half-orc'.

Now, I overhear Tilla telling Shaelitha her name. So, I type !intro add Tilla, and a targeting cursor comes up. I click Tilla. Now, her name shows up as Tilla to me. I could get the wrong name, if she'd lied to Shaelitha. Or, I could give her a name of my choosing, like 'an annoying halfling', if I never got her name.
Entering a new name would overwrite whatever name I'd previously given.

Now, I'm SURE this can't be done that way, because the same name is seen once set, by everyone, right?

So. It'd still be cool to keep track of who you've met, or whatnot, somehow. Suppose you could chat !known, and get a list of those in your perception range that you've set up on your 'known' list, with names for them you've entered. You could then at least RP that you don't know the displayed name of a PC until you've 'met them' or at least given them a name of your own choosing to keep track.

Boy, it sounds more confusing than it is, I think.

Thoughts?

JFK

#40
ffbj

ffbj
  • Members
  • 593 messages
This is mostly a poke at VB's question. It's my onrespawn with a buch of extraneous stuff but also a take equipped item feature, where the higher level you are the more likely you are to lose one or more items.



#include "nw_i0_plot"

#include "x3_inc_horse"

// * Applies an XP and GP penalty chance of item loss

// * to the player respawning based on level ffbj. Help from Guyfensen of this one.

void DestroyMajorItem(object oPC)

{

object oItem;

switch(d12())

{

case 1: oItem = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC); break;

case 2: oItem = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC); break;

case 3: oItem = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC); break;

case 4: oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC); break;

case 5: oItem = GetItemInSlot(INVENTORY_SLOT_NECK,oPC); break;

case 6: oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC); break;

case 7: oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC); break;

case 8: oItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC); break;

case 9: oItem = GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC); break;

case 10: oItem = GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC); break;

case 11: oItem = GetItemInSlot(INVENTORY_SLOT_BELT,oPC); break;

case 12: oItem = GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC); break;

}



if ((GetIsObjectValid(oItem))&&(!GetPlotFlag(oItem)))

DestroyObject(oItem);

}

void ApplyPenalty(object oDead)

{

int nXP = GetXP(oDead);

int nPenalty = 100 * GetHitDice(oDead);

int nHD = GetHitDice(oDead);

// * You can not lose a level with this respawning



int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

int nNewXP = nXP - nPenalty;

if (nNewXP < nMin)

nNewXP = nMin;

SetXP(oDead, nNewXP);

DelayCommand(5.0, FloatingTextStringOnCreature("XP Loss", oDead, FALSE));

}

void main()

{

object oPC = GetLastRespawnButtonPresser();

object oHorse = HorseGetHorse(oPC,1);

object oDatabase = GetItemPossessedBy(oPC, "database");

effect eRaise = EffectResurrection();

object oSpawnPoint = GetWaypointByTag ("WP_CCFB");

object oSpawnPoint1 = GetWaypointByTag ("WP_JailCFB");

int iHD = GetHitDice(oPC);



HorseIfNotDefaultAppearanceChange(oPC);

if (GetCreatureTailType(oPC) == 0)

{

SetCreatureTailType(14, oPC);

}

if (GetLocalInt(oDatabase, "MountI") > 0)

{

HorseDismount(TRUE, TRUE);

HorseRemoveOwner(oHorse);

DeleteLocalInt(oDatabase,"MountI");

//delete and dismount

DestroyObject(oHorse, 1.0f);

}



effect eEffect = EffectAbilityDecrease(ABILITY_CONSTITUTION, 4);

DelayCommand (2.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oPC));

DelayCommand(6.0, FloatingTextStringOnCreature("You must rest after your recent exploits", oPC, FALSE));

DelayCommand(8.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 100.0 + (iHD * 4)));



//Apply the heal, raise dead and VFX impact effect

FloatingTextStringOnCreature("Miraculous Recovery",oPC,FALSE);

DeleteLocalInt(oDatabase, "Expired");



if (GetLocalInt(oDatabase, "Jailed") == 1)

{

DelayCommand(2.2, AssignCommand(oPC, JumpToLocation(GetLocation(oSpawnPoint1))));

DelayCommand(4.0, FloatingTextStringOnCreature("Incarcerated", oPC, FALSE));

DelayCommand (300.0, (DeleteLocalInt (oDatabase, "Jailed")));

return;

}



if ((oSpawnPoint!=OBJECT_INVALID) && (GetItemPossessedBy(oPC, "CoffinReceipt")!= OBJECT_INVALID))

{

DelayCommand(2.2, AssignCommand(oPC, JumpToLocation(GetLocation(oSpawnPoint))));

DelayCommand (4.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(d6(iHD)),oPC));

}



//Apply the heal, raise dead and VFX impact effect

else DelayCommand (3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(d4(iHD)),oPC));

if (GetLocalInt(oDatabase,"NaggingWound") > 10)

{

DelayCommand(25.0 + (iHD * 2), ExecuteScript("naggingwound",oPC));

}

if (iHD < 5)

return;

ApplyPenalty(oPC);

//set local based on level of PC

if (iHD < 8)

SetLocalInt(oPC,"TakeItem",1);

else if (iHD < 12)

SetLocalInt(oPC,"TakeItem",2);

else if (iHD < 20)

SetLocalInt(oPC,"TakeItem",3);

else if (iHD < 25)

SetLocalInt(oPC,"TakeItem",4);

else

SetLocalInt(oPC,"TakeItem",5);



while (GetLocalInt(oPC,"TakeItem")> 0)

if (d6()> 5)//1 in 6 chance you lose something on each loop

{

DestroyMajorItem(oPC);

SetLocalInt(oPC,"TakeItem", GetLocalInt(oPC,"TakeItem")-1);

}

}






#41
ffbj

ffbj
  • Members
  • 593 messages
Back to the original question. It seems to me on a practical basis there can be too much scripting going on in some situations. For instance the not being able to drink with a helm on. Sure it would be a bit impractical to eat but what about a straw for drinking or an open faced helm? Anyway there is expendiency and reality in these games. So there is a spectrum where people go to one extreme or the other but like a bell curve most are in the middle.



One area I think some rudimentary work has been done in in is healing. Like in AR you don't get your hp's back right away with bandages but after a brief delay, perhaps you could vary that somewhat, or, mercy me, actually have bandages fail, or heal slowly over time like a regeneration spell. So, for instance, bear jerky gives you 1-2 hp/rd for 10 rds.

Some things I like about AR are the tracking, though I suppose you could have it recognise you rown tracks, though you know it was you that made them, it could say you passed by here or maybe if the PC was wounded when they made the track. There was a battle here and a bit of blood. Oh well stuff like that so that a ranger could say: 'Two hobbits lay here. They were bound, they crawled off...their bounds were cut.'

#42
Avonos the Rogue

Avonos the Rogue
  • Members
  • 39 messages

Frith5 wrote...

Nice stuff going on here.

As for suggestions, well . . .

I've always wanted an 'introduction' system:

I'm playing Glokk, a half-orc barbarian.
You're playing Tilla, a halfling cleric.
He's playing Shaelitha, an elven ranger.

I look at Tilla, Her name, though, on mouseover shows only a physical descriptor: 'A female halfling'. Likewise, Shaelitha has the name 'a male elf'. My own shows as 'a male half-orc'.

Now, I overhear Tilla telling Shaelitha her name. So, I type !intro add Tilla, and a targeting cursor comes up. I click Tilla. Now, her name shows up as Tilla to me. I could get the wrong name, if she'd lied to Shaelitha. Or, I could give her a name of my choosing, like 'an annoying halfling', if I never got her name.
Entering a new name would overwrite whatever name I'd previously given.

Now, I'm SURE this can't be done that way, because the same name is seen once set, by everyone, right?

So. It'd still be cool to keep track of who you've met, or whatnot, somehow. Suppose you could chat !known, and get a list of those in your perception range that you've set up on your 'known' list, with names for them you've entered. You could then at least RP that you don't know the displayed name of a PC until you've 'met them' or at least given them a name of your own choosing to keep track.

Boy, it sounds more confusing than it is, I think.

Thoughts?

JFK


I think there was a nwnx plugin that did something like this.

#43
TSMDude

TSMDude
  • Members
  • 865 messages

HipMaestro wrote...

2) I have yet to encounter any underground emerging/burrowing/re-emerging foes like vine crawlers. It would be similar to a teleporting foe but much slower animation with shorter reappearance distances. There could be such a variety of special attacks assigned (like paralyze, poison, daze, called shot type damages, etc.) and strategy to master them, it seems a totally unexplored avenue.


We use a system that shows a burrowing out of the ground creature and reburrowing for things like anhkegs and bullettes and such like.

It has been done on the vault as well with some easy scripts.

#44
TSMDude

TSMDude
  • Members
  • 865 messages

Avonos the Rogue wrote...

Frith5 wrote...


I think there was a nwnx plugin that did something like this.



Which one as I would love to use that....

#45
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
It's called nwnx_names, by virusman, and yes, it displays different names to different clients:


Funky

Modifié par FunkySwerve, 28 novembre 2010 - 10:50 .


#46
Frith5

Frith5
  • Members
  • 380 messages
*speechless*

Holy <expletive deleted>!!! Who can port this to Windows, and what do we need to do to make it happen??  That's fantastic stuff!!

#47
TSMDude

TSMDude
  • Members
  • 865 messages

Frith5 wrote...

*speechless*

Holy !!! Who can port this to Windows, and what do we need to do to make it happen??  That's fantastic stuff!!


I agree  as that is awesome.

#48
lordofworms

lordofworms
  • Members
  • 252 messages

Fester Pot wrote...

How about a nice script that will take you from one location to another without having to sit around doing nothing in a wagon for 42 turns?

FP!



absolutely totally spot on!
lol

42 turns? hmmmm...I think I have to check my scripts....

...
...
string sName =  GetPCName(oPC)
if sName == "FesterPot"
{
wait(42 turns);
WaitSomeMore ();
PretendToActuallyDoActions;
NowJumpToOriginalPointHeStartedAtand RepeatProcess;
}
else // For All other players
{
JumpToLocation(iLoc); // immediately go to spot player wants
}
}
Posted Image

#49
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
I'm still watching and hoping more gems will come down this way soon. So post your thoughts please!



Be well. Game on.

GM_ODA

#50
Vhaeraun Baenre

Vhaeraun Baenre
  • Members
  • 45 messages
Well I sent you a pm about it but you never responded....


how about a script to make spell resistance % based instead of DC based like 2nd edition