Author Topic: Factions and scripting, are these ideas possible?  (Read 328 times)

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« on: July 31, 2011, 03:30:54 pm »


               I had a few very odd ideas about the module/PW I'm building, and want some feedback on them.  To start with, I'd like to create 2 (possibly a 3rd 'neutral' one with no benefits) factions for player characters, granting them different options in equipment/quests/stores.  Most of that, I can figure out how to script.  However, I've come up with a few ideas I'm not sure are very possible, or at least plausible.  The first one deals with quests.  Would it be possible for each faction to have a different quest regarding an npc (like a dragon), with one group bringing it a treasure, and the other trying to kill it?  Maybe have an onPercieved event that will tell (based on the player's 'deity field' which would hold the faction information) whether the player is a friend or enemy, and have the dragon act accordingly?  Or, if not 'on percieved', then as a scripted encounter, that will spawn a friendly one for friendly players, and a non-friendly one for non-friendly players?

The other major question I have regards a few areas, clearly marked for this, as a 'bounty' area.  These would be full pvp, and players would be encouraged to pvp members of other factions, but only get rewards for pvp'ing opponents within a small range of levels, preferably 3 levels on either side of their own, to keep them from just intentionally slaughtering the low level pcs.  I was thinking this would require, on the OnDeath script, a check first to make sure they were in that area, then to see if they were of the same or different faction, and finally if they were within 3 levels of the killer...if it passed all 3 checks, the killer would get a bounty token to exchange for special gear.  These areas, of course, would be completely optional, and clearly marked, so that people who don't want to pvp don't have to.  Would it be feasible to modify the script thusly?

Thanks in advance for the advice.

Alassirana
               
               

               
            

Legacy_CID-78

  • Sr. Member
  • ****
  • Posts: 261
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #1 on: July 31, 2011, 05:47:21 pm »


               yes
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #2 on: August 01, 2011, 12:56:34 am »


               As far as the quests go, you need to have different conversation nodes show up for different factions, in the one conversation. So really that is all just going to be a big conversation with TextAppears checks using the GetDeity(); function.

In regards to the bounty system you could use an OnPlayerDeath script kinda like this:

void main()
{
    object oKiller = GetLastKiller();

    if (GetIsObjectValid(GetMaster(oKiller))
    oKiller = GetMaster(oKiller);

    if (GetIsPC(oKiller) && GetTag(GetArea(OBJECT_SELF)) == "PVP_AREA")
    {
        string sMyFaction = GetDeity(OBJECT_SELF);
        string sKillerFaction = GetDeity(oKiller);
        int iMyLevel = GetHitDice(OBJECT_SELF);
        int iKillerLevel = GetHitDice(oKiller);

        if (sMyFaction != sKillerFaction &&
            (iMyLevel - iKillerLevel <= 3 && iKillerLevel - iMyLevel <= 3))
        {
            CreateItemOnObject(sKillerFaction + "_bt", oKiller);
            //SendMessageToPC(oKiller, "Successful bounty kill!";
        }
    }
}

I scripted the creation of the bounty item to assume that the bounty tokens res ref would have a specific naming convention to keep the script short. So if my faction(deity) was Legion, then the res ref of the bounty token for the Legion faction would be"legion_bt" (bt for bounty token). This can be changed easily enough though. Like if you have faction names with spaces it might not work since res refs can't have spaces.

Anyhow, hope this helps.
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #3 on: August 01, 2011, 01:04:47 am »


               Very nice, thank you...I'll save that because it will work beautifully.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #4 on: August 01, 2011, 03:11:10 am »


               You just may want to set a local on the pvp area PvP set to 1.  Instead of using the tag of the area.  This way different areas could have different tags.  It is sort of a matter of taste, but I think it might be easier that way.  Unless it's sp you may want to consider adding in all the levels of the PC's present not just the killer of the dragon.  So since you say it's a pw you may want to add all the levels of the party together to make the comparison as to whether they should get the bounty or not.  For instance a party beats up the dragon real bad then the weakest of them goes in to finish it off, since that, is the most likely way to insure a reward.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #5 on: August 01, 2011, 04:25:04 am »


               

ffbj wrote...

You just may want to set a local on the pvp area PvP set to 1.  Instead of using the tag of the area.  This way different areas could have different tags.


An excellent suggestion.

ffbj wrote...

 Unless it's sp you may want to consider adding in all the levels of the PC's present not just the killer of the dragon.  So since you say it's a pw you may want to add all the levels of the party together to make the comparison as to whether they should get the bounty or not.  For instance a party beats up the dragon real bad then the weakest of them goes in to finish it off, since that, is the most likely way to insure a reward.


The script above was the OnPlayerDeath script for the pvp area/bounty solution. Just in case there was any confusion.'<img'>
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #6 on: August 01, 2011, 12:28:09 pm »


               The dragon idea was a separate idea...the pvp areas were for bounties, so that players could kill other players of similar level to gain special gear (through the bounty tokens).  What I was doing with the Dragon was the idea of having an encounter that would play out 2 different ways, depending on the faction of the players trying to deal with it (ie, curry favor with it, or fight it)...
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #7 on: August 01, 2011, 11:32:52 pm »


               Oh I see.  Yeah I did somwthing like that where you gain xp based on the level differences.  If you are more than 3 levels higher than the PC you kill you actually lose xp.  I think I gave 500xp per level plus or minus beyond 3 levels of difference.  Of course this can be problematic if you have 2 or more PC's ganging up on a higher level one, or you have the situation where a low level PC griefs a higher level one by, in essense suiciding on the higher level PC to cause them to lose xp.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Factions and scripting, are these ideas possible?
« Reply #8 on: August 02, 2011, 12:20:28 am »


               Along these lines you may be interested in this:
Death Shout II: http://nwvault.ign.c....Detail&id=3296

Other PvP related stuf I did, in my signature are:
Detrapper, Contract Hits, Karmic Retribution.