logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Limiting PP to once a day, per target (Beyond my skills...)

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Mask



Joined: 20 Mar 2005
Posts: 12

PostPosted: Wed May 18, 2005 3:56    Post subject: Limiting PP to once a day, per target (Beyond my skills...) Reply with quote

Alright, new strange Idea for everyone to ponder, and or tear apart...

Now unlike normally....Wait, scrtach that out..... Exactly like normally, I post here as I have a half formed idea, which is(As it turns out) far beyond me.

Here's the script I stumbled upon with a recent Builder-quest. http://nwvault.ign.com/View.php?view=Scripts.Detail&id=1746

The idea is that a thief, get's stuck in cutscene mode, now while I'm far from competent, What I had in mind was a minor alteration.

I want thieve's to get 1 attempt to PP anotehr player a day, my issues lies in how to write in the initial check, and how to Re-write the conditional of the existing one, so that it only trigger's when its been tried before.


As APS tracks name and login, I was thinking a string would be best to track target's name/login

something for example like

    player tag name val expire last
  • -Uphoria- Tanden Rashelz Pride TRIED 1 20050515154538
  • -Uphoria- Tanden Rashelz Pixie Mage TRIED 1 20050515163821
  • -Uphoria- Tanden Rashelz Calurion Feard TRIED 1 20050515165146
  • -Uphoria- Tanden Rashelz Shelin Fynolt TRIED 1 20050516071025
  • -Uphoria- Tanden Rashelz Cyricist Assassin TRIED 1 20050516094422
  • -Uphoria- Tanden Rashelz Shadow TRIED 1 20050516094444
  • -Uphoria- Tanden Rashelz Minotaur Shaman TRIED 1 20050516095440
  • -Uphoria- Tanden Rashelz Soran Nightwing TRIED 1 20050516101211
  • -Uphoria- Tanden Rashelz Troglodyte Warrior TRIED 1 20050516170829
  • -Uphoria- Tanden Rashelz Tanden Rashelz TRIED 1 20050516170831
  • -Uphoria- Tanden Rashelz Lizardfolk Shaman TRIED 1 20050516171331
  • -Uphoria- Tanden Rashelz Adynathor Galer TRIED 1 20050516172451
  • -Uphoria- Tanden Rashelz Vilmar Ilphukiir TRIED 1 20050516172530
  • -Uphoria- Tanden Rashelz Water Elemental TRIED 1 20050516172800
  • -Uphoria- Tanden Rashelz Gwenhwyfar TRIED 1 20050516185011



I was thinking of trying to change it to use GetName() of the target as the variable name, and the Login to be the value (Assumed that I'm using a string) and have it expire after 1 day, so as to prevent players form spamming PP on anyone/thing. My trouble presently is it cares about NPC's, in addition to what I wrote above. anyway, here's what I was using to get that... any inputs welcome.


~Mask
_________________
DM Mask


Legacy of Netheril


Last edited by Mask on Sat Jun 04, 2005 4:28; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Mask



Joined: 20 Mar 2005
Posts: 12

PostPosted: Sat Jun 04, 2005 4:28    Post subject: So I had to get smarter.. Reply with quote

So i had to get smarter..

Anyway is anyone able to find problems with this before I put it in? It does compile, bu I learned a long time ago that the script editor is aobut as trustable as an 'honest' Halfling.

Code:
#include "aps_include"
// x2_mod_def_unaqu,prc_onunaquire
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onunaquireitem event.
//
/////////////////////////////////////////////////////////////////////

void main()
{
object oDropped = GetModuleItemLost();
object oThief = GetModuleItemAcquiredBy();
object oTarget = GetModuleItemLostBy();
object oStolen = GetModuleItemLost();
string sTarLogin = GetPCPlayerName(oTarget);
string sTarName = GetName(oTarget);
string sThiName = GetName(oThief);
string sTargName = GetPersistentString(oThief, sTarName, "ThiefTracking");

    ExecuteScript("prc_onunaquire", OBJECT_SELF);

/* get item that was stolen only by player char, does not get items in barter
unless the item being bartered has stolen flag allready set */
if  (GetIsPC(oTarget)==FALSE) return;
if (sTargName != sTarName )
    {
    SetPersistentString(oThief , sTarLogin, sTarName, 1, "ThiefTracking");
    return;
    }

if(
   (GetStolenFlag(oStolen) == TRUE && GetIsPC(oThief)== TRUE)&&
   (GetPersistentString(oThief , sTarLogin, "ThiefTracking")== sTarName)
  )
    {
    // Sets player in cut scene, they cannot save or move
    SetCutsceneMode(oThief, TRUE);
    // Set Stolen Flag to False so it won't have problems being coppied
    SetStolenFlag(oStolen, FALSE);
    // Return stolen item to player that it was stolen from
    CopyItem(oStolen, oTarget);
    // Destroy the stolen item from thief's inventory
    DelayCommand(0.2, DestroyObject(oStolen));
    // Kill the moron
    DelayCommand(7.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oThief));
    // take him out of cut scene. (Optional)
    DelayCommand(8.0, SetCutsceneMode(oThief, FALSE));
    }
}

_________________
DM Mask


Legacy of Netheril
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group